@yorz/cli 0.12.0 → 0.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agent-sdk/index.d.ts +4 -3
- package/dist/agent-sdk/index.js +3 -2
- package/dist/cli/index.js +6597 -288
- package/dist/gui/assets/{abnfDiagram-VRR7QNED-D6jGkm-z.js → abnfDiagram-VRR7QNED-CHas-sjI.js} +1 -1
- package/dist/{gui-mobile/assets/arc-fOfkVV1E.js → gui/assets/arc-2DIKI2ug.js} +1 -1
- package/dist/{gui-mobile/assets/architectureDiagram-ZJ3FMSHR-D8wWOPnv.js → gui/assets/architectureDiagram-ZJ3FMSHR-D2QIR4yT.js} +1 -1
- package/dist/{gui-mobile/assets/blockDiagram-677ZJIJ3-B3dJVlA1.js → gui/assets/blockDiagram-677ZJIJ3-C38mclkj.js} +1 -1
- package/dist/gui/assets/{c4Diagram-LMCZKHZV-BGGvE2NS.js → c4Diagram-LMCZKHZV-rfToA0_z.js} +1 -1
- package/dist/gui/assets/channel-Ctk8Mzxv.js +1 -0
- package/dist/gui/assets/{chunk-2Q5K7J3B-7Ln3c0UE.js → chunk-2Q5K7J3B-EBzGDbj7.js} +1 -1
- package/dist/gui/assets/{chunk-32BRIVSS-BCKEOVbY.js → chunk-32BRIVSS-BWjVeFy7.js} +1 -1
- package/dist/gui/assets/{chunk-5VM5RSS4-DAJQb8ot.js → chunk-5VM5RSS4-DTQx1JHi.js} +1 -1
- package/dist/{gui-mobile/assets/chunk-EX3LRPZG-DUIxO-Ha.js → gui/assets/chunk-EX3LRPZG-BG5uo2fg.js} +1 -1
- package/dist/gui/assets/{chunk-JWPE2WC7-DdS0F0Ce.js → chunk-JWPE2WC7--G0oyo9O.js} +1 -1
- package/dist/gui/assets/{chunk-MOJQB5TN-BZZSKMI0.js → chunk-MOJQB5TN-BQ-Mu9Ua.js} +1 -1
- package/dist/gui/assets/{chunk-RYQCIY6F-B-1EFLDG.js → chunk-RYQCIY6F-BEYJmvvY.js} +1 -1
- package/dist/gui/assets/{chunk-V7JOEXUC-pJV4CXUK.js → chunk-V7JOEXUC-CXTB9Dv-.js} +1 -1
- package/dist/gui/assets/{chunk-VR4S4FIN-BOK4dvIO.js → chunk-VR4S4FIN-DdWFxvZe.js} +1 -1
- package/dist/gui/assets/{chunk-XXDRQBXY-DHxKMKRx.js → chunk-XXDRQBXY-Bu2xNLMy.js} +1 -1
- package/dist/gui/assets/classDiagram-OUVF2IWQ-CdX03Kq_.js +1 -0
- package/dist/gui/assets/classDiagram-v2-EOCWNBFH-CdX03Kq_.js +1 -0
- package/dist/{gui-mobile/assets/cose-bilkent-JH36ORCC-DrB1Tg4S.js → gui/assets/cose-bilkent-JH36ORCC-D1zBTANI.js} +1 -1
- package/dist/gui/assets/{cynefin-VYW2F7L2-Dlnaehfc.js → cynefin-VYW2F7L2-CgdsCBRp.js} +1 -1
- package/dist/{gui-mobile/assets/cynefinDiagram-TSTJHNR4-Cou75BrF.js → gui/assets/cynefinDiagram-TSTJHNR4-DMALRnpH.js} +1 -1
- package/dist/gui/assets/{dagre-VKFMJZFB-CHRKHo63.js → dagre-VKFMJZFB-9mi0GAtJ.js} +1 -1
- package/dist/gui/assets/{diagram-FQU43EPY-CjOuL948.js → diagram-FQU43EPY-C1VrrSj8.js} +1 -1
- package/dist/{gui-mobile/assets/diagram-G47NLZAW-LlIe5THI.js → gui/assets/diagram-G47NLZAW-BjP4LLm6.js} +1 -1
- package/dist/gui/assets/{diagram-NH7WQ7WH-RF4bRWn3.js → diagram-NH7WQ7WH-Dt_RBtZf.js} +1 -1
- package/dist/{gui-mobile/assets/diagram-OA4YK3LP-Cmys7bA4.js → gui/assets/diagram-OA4YK3LP-YOcWMSYY.js} +1 -1
- package/dist/gui/assets/{diagram-WEI45ONY-soBxwLJr.js → diagram-WEI45ONY-DM2Z5Vfp.js} +1 -1
- package/dist/gui/assets/{ebnfDiagram-CCIWWBDH-w4xQvWu7.js → ebnfDiagram-CCIWWBDH-DJWV5L6j.js} +1 -1
- package/dist/{gui-mobile/assets/erDiagram-Q63AITRT-RQSaq-xl.js → gui/assets/erDiagram-Q63AITRT-CLQiaiAZ.js} +1 -1
- package/dist/gui/assets/{flowDiagram-23GEKE2U-S6GJBvAm.js → flowDiagram-23GEKE2U-GznvAjo1.js} +1 -1
- package/dist/{gui-mobile/assets/ganttDiagram-NO4QXBWP-B_1hou84.js → gui/assets/ganttDiagram-NO4QXBWP-Dxn0qtBL.js} +1 -1
- package/dist/{gui-mobile/assets/gitGraphDiagram-IHSO6WYX-Bntc4YuC.js → gui/assets/gitGraphDiagram-IHSO6WYX-Cqb8K3WB.js} +1 -1
- package/dist/gui/assets/index-BX4uV__j.css +1 -0
- package/dist/gui/assets/index-JL9p240A.js +41 -0
- package/dist/gui/assets/{infoDiagram-FWYZ7A6U-BLoIcrqq.js → infoDiagram-FWYZ7A6U-3mAm46xF.js} +1 -1
- package/dist/gui/assets/{ishikawaDiagram-FXEZZL3T-COS_x7S2.js → ishikawaDiagram-FXEZZL3T-s8LvetuP.js} +1 -1
- package/dist/{gui-mobile/assets/journeyDiagram-5HDEW3XC-CPzGmOhm.js → gui/assets/journeyDiagram-5HDEW3XC-CxKkBGrP.js} +1 -1
- package/dist/gui/assets/{kanban-definition-HUTT4EX6-B2ZpGDmS.js → kanban-definition-HUTT4EX6-CrDI5xq2.js} +1 -1
- package/dist/gui/assets/{linear-Bc2jjJG6.js → linear-AzP4MQxt.js} +1 -1
- package/dist/gui/assets/{mermaid.core-DnFq6ht5.js → mermaid.core-DHOOjgm_.js} +4 -4
- package/dist/gui/assets/{mindmap-definition-LN4V7U3C-L9PGMaD8.js → mindmap-definition-LN4V7U3C-B7wpSrxj.js} +1 -1
- package/dist/gui/assets/{pegDiagram-2B236MQR-Cp_O_2Yl.js → pegDiagram-2B236MQR-BOiuiSjj.js} +1 -1
- package/dist/gui/assets/{pieDiagram-ENE6RG2P-JOeaaIBy.js → pieDiagram-ENE6RG2P-DV_bb90P.js} +1 -1
- package/dist/{gui-mobile/assets/quadrantDiagram-ABIIQ3AL--q3CuL0S.js → gui/assets/quadrantDiagram-ABIIQ3AL-BN9QEn92.js} +1 -1
- package/dist/gui/assets/{railroadDiagram-RFXS5EU6-DdsKvVq3.js → railroadDiagram-RFXS5EU6-BaO9xxpp.js} +1 -1
- package/dist/gui/assets/{requirementDiagram-TGXJPOKE-C2e-5gKe.js → requirementDiagram-TGXJPOKE-B-r8AGph.js} +1 -1
- package/dist/{gui-mobile/assets/sankeyDiagram-HTMAVEWB-BkL0YBZM.js → gui/assets/sankeyDiagram-HTMAVEWB-DqRjcG-_.js} +1 -1
- package/dist/{gui-mobile/assets/sequenceDiagram-DBY2YBRQ-RLeQ-NZr.js → gui/assets/sequenceDiagram-DBY2YBRQ-KcYyDxXc.js} +1 -1
- package/dist/gui/assets/{sizeCapture-X5ZJPWSS-BkgyhLhm.js → sizeCapture-X5ZJPWSS-BhmePssk.js} +1 -1
- package/dist/{gui-mobile/assets/stateDiagram-2N3HPSRC-B7KwOjk3.js → gui/assets/stateDiagram-2N3HPSRC-DaA8s8RA.js} +1 -1
- package/dist/gui/assets/stateDiagram-v2-6OUMAXLB-CsxzEgZO.js +1 -0
- package/dist/gui/assets/{swimlanes-5IMT3BWC-Cb0fPcib.js → swimlanes-5IMT3BWC-uFXg9Hk3.js} +2 -2
- package/dist/gui/assets/swimlanesDiagram-G3AALYLV-DgybLg8h.js +8 -0
- package/dist/{gui-mobile/assets/timeline-definition-FHXFAJF6-DI_EGe4e.js → gui/assets/timeline-definition-FHXFAJF6-DtLX54bg.js} +1 -1
- package/dist/gui/assets/{vennDiagram-L72KCM5P-Cm_0jga4.js → vennDiagram-L72KCM5P-BIqvZp-4.js} +1 -1
- package/dist/gui/assets/{wardleyDiagram-EHGQE667-BXot5zEw.js → wardleyDiagram-EHGQE667-JPG7bZy9.js} +1 -1
- package/dist/{gui-mobile/assets/xychartDiagram-FW5EYKEG-BsyRk0pH.js → gui/assets/xychartDiagram-FW5EYKEG-BUx7LrAa.js} +1 -1
- package/dist/gui/index.html +2 -2
- package/dist/gui-mobile/assets/{abnfDiagram-VRR7QNED-ChtWOBep.js → abnfDiagram-VRR7QNED-Ct5gVqPT.js} +1 -1
- package/dist/{gui/assets/arc-B0AlaXMb.js → gui-mobile/assets/arc-W0d0aNNL.js} +1 -1
- package/dist/{gui/assets/architectureDiagram-ZJ3FMSHR-lYOkjnK7.js → gui-mobile/assets/architectureDiagram-ZJ3FMSHR-C7n8Akxp.js} +1 -1
- package/dist/{gui/assets/blockDiagram-677ZJIJ3-Cev5zm3W.js → gui-mobile/assets/blockDiagram-677ZJIJ3-DyqrKJT7.js} +1 -1
- package/dist/gui-mobile/assets/{c4Diagram-LMCZKHZV-BIKVYi9n.js → c4Diagram-LMCZKHZV-B3c0YPoi.js} +1 -1
- package/dist/gui-mobile/assets/channel-DZQuFUOP.js +1 -0
- package/dist/gui-mobile/assets/{chunk-2Q5K7J3B-DaK59vfz.js → chunk-2Q5K7J3B-DzXlffcc.js} +1 -1
- package/dist/gui-mobile/assets/{chunk-32BRIVSS-B9aY48lV.js → chunk-32BRIVSS-DNdPyBHB.js} +1 -1
- package/dist/gui-mobile/assets/{chunk-5VM5RSS4-CBJCiKzQ.js → chunk-5VM5RSS4-FHr258SK.js} +1 -1
- package/dist/{gui/assets/chunk-EX3LRPZG-Ci9btN70.js → gui-mobile/assets/chunk-EX3LRPZG-DpLoMziL.js} +1 -1
- package/dist/gui-mobile/assets/{chunk-JWPE2WC7-BjOGY2_Y.js → chunk-JWPE2WC7-BfJ8s3z4.js} +1 -1
- package/dist/gui-mobile/assets/{chunk-MOJQB5TN-BkEyo9AE.js → chunk-MOJQB5TN-B4KCM52Y.js} +1 -1
- package/dist/gui-mobile/assets/{chunk-RYQCIY6F-pSJT0TQf.js → chunk-RYQCIY6F-aU_mZozX.js} +1 -1
- package/dist/gui-mobile/assets/{chunk-V7JOEXUC-Cvb9dEtL.js → chunk-V7JOEXUC-CqjIsdVE.js} +1 -1
- package/dist/gui-mobile/assets/{chunk-VR4S4FIN-C_b2s6K7.js → chunk-VR4S4FIN-qx-Snhek.js} +1 -1
- package/dist/gui-mobile/assets/{chunk-XXDRQBXY-r1Sg_GN9.js → chunk-XXDRQBXY-Dg3iQUEM.js} +1 -1
- package/dist/gui-mobile/assets/classDiagram-OUVF2IWQ-Ef3O_Gur.js +1 -0
- package/dist/gui-mobile/assets/classDiagram-v2-EOCWNBFH-Ef3O_Gur.js +1 -0
- package/dist/{gui/assets/cose-bilkent-JH36ORCC-BJFtw3LT.js → gui-mobile/assets/cose-bilkent-JH36ORCC-B-ugahei.js} +1 -1
- package/dist/gui-mobile/assets/{cynefin-VYW2F7L2-D59B5xxc.js → cynefin-VYW2F7L2-DLOiRgeh.js} +1 -1
- package/dist/{gui/assets/cynefinDiagram-TSTJHNR4-b2oJIboT.js → gui-mobile/assets/cynefinDiagram-TSTJHNR4-EpR-VLwY.js} +1 -1
- package/dist/gui-mobile/assets/{dagre-VKFMJZFB-CAZsA_3p.js → dagre-VKFMJZFB-DP8rPgCo.js} +1 -1
- package/dist/gui-mobile/assets/{diagram-FQU43EPY-B1VZqWBq.js → diagram-FQU43EPY-zoHmM_c1.js} +1 -1
- package/dist/{gui/assets/diagram-G47NLZAW-BLfHcDjU.js → gui-mobile/assets/diagram-G47NLZAW-BkGDb5FF.js} +1 -1
- package/dist/gui-mobile/assets/{diagram-NH7WQ7WH-CKrRUCjZ.js → diagram-NH7WQ7WH-RISBAFck.js} +1 -1
- package/dist/{gui/assets/diagram-OA4YK3LP-CsggOsM1.js → gui-mobile/assets/diagram-OA4YK3LP-bUxPsiBQ.js} +1 -1
- package/dist/gui-mobile/assets/{diagram-WEI45ONY-lbL-O6_u.js → diagram-WEI45ONY-DX_OX85j.js} +1 -1
- package/dist/gui-mobile/assets/{ebnfDiagram-CCIWWBDH-BQ2kUIrD.js → ebnfDiagram-CCIWWBDH-DH_XqG-i.js} +1 -1
- package/dist/{gui/assets/erDiagram-Q63AITRT-CiRMCy0t.js → gui-mobile/assets/erDiagram-Q63AITRT-CbJRWC8U.js} +1 -1
- package/dist/gui-mobile/assets/{flowDiagram-23GEKE2U-B3xF0bb-.js → flowDiagram-23GEKE2U-WyU95Ioy.js} +1 -1
- package/dist/{gui/assets/ganttDiagram-NO4QXBWP-Cc--Z47l.js → gui-mobile/assets/ganttDiagram-NO4QXBWP-DEdAq2e9.js} +1 -1
- package/dist/{gui/assets/gitGraphDiagram-IHSO6WYX-BL9IXeiy.js → gui-mobile/assets/gitGraphDiagram-IHSO6WYX-CNKJbGdW.js} +1 -1
- package/dist/gui-mobile/assets/index-D4ldI3yk.js +33 -0
- package/dist/gui-mobile/assets/index-fVo_kT1f.css +1 -0
- package/dist/gui-mobile/assets/{infoDiagram-FWYZ7A6U-wVq8Af6M.js → infoDiagram-FWYZ7A6U-DxOtcAry.js} +1 -1
- package/dist/gui-mobile/assets/{ishikawaDiagram-FXEZZL3T-DRoyqq2d.js → ishikawaDiagram-FXEZZL3T-CMaJhSQh.js} +1 -1
- package/dist/{gui/assets/journeyDiagram-5HDEW3XC-BdAjBAfg.js → gui-mobile/assets/journeyDiagram-5HDEW3XC-CB79ifZC.js} +1 -1
- package/dist/gui-mobile/assets/{kanban-definition-HUTT4EX6-B-XbaSk9.js → kanban-definition-HUTT4EX6-D3ZZPGkn.js} +1 -1
- package/dist/gui-mobile/assets/{linear-CWuS29Zf.js → linear-B0c-4Ray.js} +1 -1
- package/dist/gui-mobile/assets/{mermaid.core-DPv8yS1D.js → mermaid.core-DvnVINHy.js} +4 -4
- package/dist/gui-mobile/assets/{mindmap-definition-LN4V7U3C-BssTrViW.js → mindmap-definition-LN4V7U3C-_ryv_wzi.js} +1 -1
- package/dist/gui-mobile/assets/{pegDiagram-2B236MQR-CG1RF9PO.js → pegDiagram-2B236MQR-DZ2VachG.js} +1 -1
- package/dist/gui-mobile/assets/{pieDiagram-ENE6RG2P-DXiL6_Gg.js → pieDiagram-ENE6RG2P-CBph_Pgy.js} +1 -1
- package/dist/{gui/assets/quadrantDiagram-ABIIQ3AL-CoJEZZ3Z.js → gui-mobile/assets/quadrantDiagram-ABIIQ3AL-Bx9pQYlQ.js} +1 -1
- package/dist/gui-mobile/assets/{railroadDiagram-RFXS5EU6-CIYRGuj1.js → railroadDiagram-RFXS5EU6-CmJHGX9l.js} +1 -1
- package/dist/gui-mobile/assets/{requirementDiagram-TGXJPOKE-DQ78r_6c.js → requirementDiagram-TGXJPOKE-jitvSOLv.js} +1 -1
- package/dist/{gui/assets/sankeyDiagram-HTMAVEWB-CO1Vty3R.js → gui-mobile/assets/sankeyDiagram-HTMAVEWB-CMC7JPmO.js} +1 -1
- package/dist/{gui/assets/sequenceDiagram-DBY2YBRQ-Dy0-5y0A.js → gui-mobile/assets/sequenceDiagram-DBY2YBRQ-hQilIEP9.js} +1 -1
- package/dist/gui-mobile/assets/{sizeCapture-X5ZJPWSS-CPQtIaYS.js → sizeCapture-X5ZJPWSS-DP0_srQJ.js} +1 -1
- package/dist/{gui/assets/stateDiagram-2N3HPSRC-BJ4KTZso.js → gui-mobile/assets/stateDiagram-2N3HPSRC-BVwptFNV.js} +1 -1
- package/dist/gui-mobile/assets/stateDiagram-v2-6OUMAXLB-C3kfseLl.js +1 -0
- package/dist/gui-mobile/assets/{swimlanes-5IMT3BWC--T6Q0kax.js → swimlanes-5IMT3BWC-BbylZ7V-.js} +2 -2
- package/dist/gui-mobile/assets/swimlanesDiagram-G3AALYLV-HFAz5nU-.js +8 -0
- package/dist/{gui/assets/timeline-definition-FHXFAJF6-kRq9L4-o.js → gui-mobile/assets/timeline-definition-FHXFAJF6-BV41TYYS.js} +1 -1
- package/dist/gui-mobile/assets/{vennDiagram-L72KCM5P-BC17Rlh6.js → vennDiagram-L72KCM5P-BwbuZWM5.js} +1 -1
- package/dist/gui-mobile/assets/{wardleyDiagram-EHGQE667-88Ya72xv.js → wardleyDiagram-EHGQE667-CIyvw8Ss.js} +1 -1
- package/dist/{gui/assets/xychartDiagram-FW5EYKEG-vVYhUb0Q.js → gui-mobile/assets/xychartDiagram-FW5EYKEG-Cx6vz85D.js} +1 -1
- package/dist/gui-mobile/index.html +2 -2
- package/dist/gui-mobile/sw.js +1 -1
- package/dist/service/agent-sdk/types.d.ts +29 -3
- package/package.json +1 -1
- package/dist/gui/assets/channel-BrmRGdrm.js +0 -1
- package/dist/gui/assets/classDiagram-OUVF2IWQ-D9zopxCj.js +0 -1
- package/dist/gui/assets/classDiagram-v2-EOCWNBFH-D9zopxCj.js +0 -1
- package/dist/gui/assets/index-BkUpHOBt.js +0 -41
- package/dist/gui/assets/index-CMT0wDYi.css +0 -1
- package/dist/gui/assets/stateDiagram-v2-6OUMAXLB-CDeoXb_7.js +0 -1
- package/dist/gui/assets/swimlanesDiagram-G3AALYLV-CaeioVWR.js +0 -8
- package/dist/gui-mobile/assets/channel--lxp96YN.js +0 -1
- package/dist/gui-mobile/assets/classDiagram-OUVF2IWQ-BSdmSXqG.js +0 -1
- package/dist/gui-mobile/assets/classDiagram-v2-EOCWNBFH-BSdmSXqG.js +0 -1
- package/dist/gui-mobile/assets/index-BVmT9d8v.css +0 -1
- package/dist/gui-mobile/assets/index-CAQYJwvr.js +0 -33
- package/dist/gui-mobile/assets/stateDiagram-v2-6OUMAXLB-yhOeM-TY.js +0 -1
- package/dist/gui-mobile/assets/swimlanesDiagram-G3AALYLV-DHMi-Imw.js +0 -8
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const i of o)if(i.type==="childList")for(const s of i.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).observe(document,{childList:!0,subtree:!0});function n(o){const i={};return o.integrity&&(i.integrity=o.integrity),o.referrerPolicy&&(i.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?i.credentials="include":o.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(o){if(o.ep)return;o.ep=!0;const i=n(o);fetch(o.href,i)}})();const He={context:void 0,registry:void 0,effects:void 0,done:!1,getContextId(){return Ud(this.context.count)},getNextContextId(){return Ud(this.context.count++)}};function Ud(e){const t=String(e),n=t.length-1;return He.context.id+(n?String.fromCharCode(96+n):"")+t}function hi(e){He.context=e}const pv=!1,hv=(e,t)=>e===t,Mn=Symbol("solid-proxy"),Zh=typeof Proxy=="function",ki=Symbol("solid-track"),js={equals:hv};let Xh=tm;const Pn=1,Ai=2,Jh={owned:null,cleanups:null,context:null,owner:null},nu={};var Qe=null;let ke=null,mv=null,st=null,Wt=null,Vt=null,ma=0;function Cn(e,t){const n=st,r=Qe,o=e.length===0,i=t===void 0?r:t,s=o?Jh:{owned:null,cleanups:null,context:i?i.context:null,owner:i},a=o?e:()=>e(()=>pt(()=>Kr(s)));Qe=s,st=null;try{return mn(a,!0)}finally{st=n,Qe=r}}function I(e,t){t=t?Object.assign({},js,t):js;const n={value:e,observers:null,observerSlots:null,comparator:t.equals||void 0},r=o=>(typeof o=="function"&&(ke&&ke.running&&ke.sources.has(n)?o=o(n.tValue):o=o(n.value)),em(n,o));return[Qh.bind(n),r]}function Hc(e,t,n){const r=ya(e,t,!0,Pn);ri(r)}function Me(e,t,n){const r=ya(e,t,!1,Pn);ri(r)}function ae(e,t,n){Xh=xv;const r=ya(e,t,!1,Pn),o=go&&ut(go);o&&(r.suspense=o),(!n||!n.render)&&(r.user=!0),Vt?Vt.push(r):ri(r)}function ne(e,t,n){n=n?Object.assign({},js,n):js;const r=ya(e,t,!0,0);return r.observers=null,r.observerSlots=null,r.comparator=n.equals||void 0,ri(r),Qh.bind(r)}function bv(e){return e&&typeof e=="object"&&"then"in e}function Zt(e,t,n){let r,o,i;typeof t=="function"?(r=e,o=t,i={}):(r=!0,o=e,i=t||{});let s=null,a=nu,u=null,c=!1,l=!1,d="initialValue"in i,g=typeof r=="function"&&ne(r);const p=new Set,[h,m]=(i.storage||I)(i.initialValue),[y,v]=I(void 0),[b,w]=I(void 0,{equals:!1}),[E,C]=I(d?"ready":"unresolved");He.context&&(u=He.getNextContextId(),i.ssrLoadFrom==="initial"?a=i.initialValue:He.load&&He.has(u)&&(a=He.load(u)));function k(O,P,L,D){return s===O&&(s=null,D!==void 0&&(d=!0),(O===a||P===a)&&i.onHydrated&&queueMicrotask(()=>i.onHydrated(D,{value:P})),a=nu,ke&&O&&c?(ke.promises.delete(O),c=!1,mn(()=>{ke.running=!0,T(P,L)},!1)):T(P,L)),P}function T(O,P){mn(()=>{P===void 0&&m(()=>O),C(P!==void 0?"errored":d?"ready":"unresolved"),v(P);for(const L of p.keys())L.decrement();p.clear()},!1)}function S(){const O=go&&ut(go),P=h(),L=y();if(L!==void 0&&!s)throw L;return st&&!st.user&&O&&Hc(()=>{b(),s&&(O.resolved&&ke&&c?ke.promises.add(s):p.has(O)||(O.increment(),p.add(O)))}),P}function A(O=!0){if(O!==!1&&l)return;l=!1;const P=g?g():r;if(c=ke&&ke.running,P==null||P===!1){k(s,pt(h));return}ke&&s&&ke.promises.delete(s);let L;const D=a!==nu?a:pt(()=>{try{return o(P,{value:h(),refetching:O})}catch(B){L=B}});if(L!==void 0){k(s,void 0,$s(L),P);return}else if(!bv(D))return k(s,D,void 0,P),D;return s=D,"v"in D?(D.s===1?k(s,D.v,void 0,P):k(s,void 0,$s(D.v),P),D):(l=!0,queueMicrotask(()=>l=!1),mn(()=>{C(d?"refreshing":"pending"),w()},!1),D.then(B=>k(D,B,void 0,P),B=>k(D,void 0,$s(B),P)))}Object.defineProperties(S,{state:{get:()=>E()},error:{get:()=>y()},loading:{get(){const O=E();return O==="pending"||O==="refreshing"}},latest:{get(){if(!d)return S();const O=y();if(O&&!s)throw O;return h()}}});let F=Qe;return g?Hc(()=>(F=Qe,A(!1))):A(!1),[S,{refetch:O=>ba(F,()=>A(O)),mutate:m}]}function kl(e){return mn(e,!1)}function pt(e){if(st===null)return e();const t=st;st=null;try{return e()}finally{st=t}}function _t(e,t,n){const r=Array.isArray(e);let o,i=n&&n.defer;return s=>{let a;if(r){a=Array(e.length);for(let c=0;c<e.length;c++)a[c]=e[c]()}else a=e();if(i)return i=!1,s;const u=pt(()=>t(a,o,s));return o=a,u}}function Sn(e){ae(()=>pt(e))}function ue(e){return Qe===null||(Qe.cleanups===null?Qe.cleanups=[e]:Qe.cleanups.push(e)),e}function Gc(){return st}function Ti(){return Qe}function ba(e,t){const n=Qe,r=st;Qe=e,st=null;try{return mn(t,!0)}catch(o){Tl(o)}finally{Qe=n,st=r}}function Al(e){if(ke&&ke.running)return e(),ke.done;const t=st,n=Qe;return Promise.resolve().then(()=>{st=t,Qe=n;let r;return go&&(r=ke||(ke={sources:new Set,effects:[],promises:new Set,disposed:new Set,queue:new Set,running:!0}),r.done||(r.done=new Promise(o=>r.resolve=o)),r.running=!0),mn(e,!1),st=Qe=null,r?r.done:void 0})}const[x$,Kd]=I(!1);function yv(e){Vt.push.apply(Vt,e),e.length=0}function dt(e,t){const n=Symbol("context");return{id:n,Provider:_v(n),defaultValue:e}}function ut(e){let t;return Qe&&Qe.context&&(t=Qe.context[e.id])!==void 0?t:e.defaultValue}function ni(e){const t=ne(e),n=ne(()=>Vc(t()));return n.toArray=()=>{const r=n();return Array.isArray(r)?r:r!=null?[r]:[]},n}let go;function vv(){return go||(go=dt())}function Qh(){const e=ke&&ke.running;if(this.sources&&(e?this.tState:this.state))if((e?this.tState:this.state)===Pn)ri(this);else{const t=Wt;Wt=null,mn(()=>Hs(this),!1),Wt=t}if(st){const t=this.observers;if(!t||t[t.length-1]!==st){const n=t?t.length:0;st.sources?(st.sources.push(this),st.sourceSlots.push(n)):(st.sources=[this],st.sourceSlots=[n]),t?(t.push(st),this.observerSlots.push(st.sources.length-1)):(this.observers=[st],this.observerSlots=[st.sources.length-1])}}return e&&ke.sources.has(this)?this.tValue:this.value}function em(e,t,n){let r=ke&&ke.running&&ke.sources.has(e)?e.tValue:e.value;if(!e.comparator||!e.comparator(r,t)){if(ke){const o=ke.running;(o||!n&&ke.sources.has(e))&&(ke.sources.add(e),e.tValue=t),o||(e.value=t)}else e.value=t;e.observers&&e.observers.length&&mn(()=>{for(let o=0;o<e.observers.length;o+=1){const i=e.observers[o],s=ke&&ke.running;s&&ke.disposed.has(i)||((s?!i.tState:!i.state)&&(i.pure?Wt.push(i):Vt.push(i),i.observers&&nm(i)),s?i.tState=Pn:i.state=Pn)}if(Wt.length>1e6)throw Wt=[],new Error},!1)}return t}function ri(e){if(!e.fn)return;Kr(e);const t=ma;jd(e,ke&&ke.running&&ke.sources.has(e)?e.tValue:e.value,t),ke&&!ke.running&&ke.sources.has(e)&&queueMicrotask(()=>{mn(()=>{ke&&(ke.running=!0),st=Qe=e,jd(e,e.tValue,t),st=Qe=null},!1)})}function jd(e,t,n){let r;const o=Qe,i=st;st=Qe=e;try{r=e.fn(t)}catch(s){return e.pure&&(ke&&ke.running?(e.tState=Pn,e.tOwned&&e.tOwned.forEach(Kr),e.tOwned=void 0):(e.state=Pn,e.owned&&e.owned.forEach(Kr),e.owned=null)),e.updatedAt=n+1,Tl(s)}finally{st=i,Qe=o}(!e.updatedAt||e.updatedAt<=n)&&(e.updatedAt!=null&&"observers"in e?em(e,r,!0):ke&&ke.running&&e.pure?(ke.sources.has(e)||(e.value=r),ke.sources.add(e),e.tValue=r):e.value=r,e.updatedAt=n)}function ya(e,t,n,r=Pn,o){const i={fn:e,state:r,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:Qe,context:Qe?Qe.context:null,pure:n};return ke&&ke.running&&(i.state=0,i.tState=r),Qe===null||Qe!==Jh&&(ke&&ke.running&&Qe.pure?Qe.tOwned?Qe.tOwned.push(i):Qe.tOwned=[i]:Qe.owned?Qe.owned.push(i):Qe.owned=[i]),i}function qs(e){const t=ke&&ke.running;if((t?e.tState:e.state)===0)return;if((t?e.tState:e.state)===Ai)return Hs(e);if(e.suspense&&pt(e.suspense.inFallback))return e.suspense.effects.push(e);const n=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt<ma);){if(t&&ke.disposed.has(e))return;(t?e.tState:e.state)&&n.push(e)}for(let r=n.length-1;r>=0;r--){if(e=n[r],t){let o=e,i=n[r+1];for(;(o=o.owner)&&o!==i;)if(ke.disposed.has(o))return}if((t?e.tState:e.state)===Pn)ri(e);else if((t?e.tState:e.state)===Ai){const o=Wt;Wt=null,mn(()=>Hs(e,n[0]),!1),Wt=o}}}function mn(e,t){if(Wt)return e();let n=!1;t||(Wt=[]),Vt?n=!0:Vt=[],ma++;try{const r=e();return wv(n),r}catch(r){n||(Vt=null),Wt=null,Tl(r)}}function wv(e){if(Wt&&(tm(Wt),Wt=null),e)return;let t;if(ke){if(!ke.promises.size&&!ke.queue.size){const r=ke.sources,o=ke.disposed;Vt.push.apply(Vt,ke.effects),t=ke.resolve;for(const i of Vt)"tState"in i&&(i.state=i.tState),delete i.tState;ke=null,mn(()=>{for(const i of o)Kr(i);for(const i of r){if(i.value=i.tValue,i.owned)for(let s=0,a=i.owned.length;s<a;s++)Kr(i.owned[s]);i.tOwned&&(i.owned=i.tOwned),delete i.tValue,delete i.tOwned,i.tState=0}Kd(!1)},!1)}else if(ke.running){ke.running=!1,ke.effects.push.apply(ke.effects,Vt),Vt=null,Kd(!0);return}}const n=Vt;Vt=null,n.length&&mn(()=>Xh(n),!1),t&&t()}function tm(e){for(let t=0;t<e.length;t++)qs(e[t])}function xv(e){let t,n=0;for(t=0;t<e.length;t++){const r=e[t];r.user?e[n++]=r:qs(r)}if(He.context){if(He.count){He.effects||(He.effects=[]),He.effects.push(...e.slice(0,n));return}hi()}for(He.effects&&(He.done||!He.count)&&(e=[...He.effects,...e],n+=He.effects.length,delete He.effects),t=0;t<n;t++)qs(e[t])}function Hs(e,t){const n=ke&&ke.running;n?e.tState=0:e.state=0;for(let r=0;r<e.sources.length;r+=1){const o=e.sources[r];if(o.sources){const i=n?o.tState:o.state;i===Pn?o!==t&&(!o.updatedAt||o.updatedAt<ma)&&qs(o):i===Ai&&Hs(o,t)}}}function nm(e){const t=ke&&ke.running;for(let n=0;n<e.observers.length;n+=1){const r=e.observers[n];(t?!r.tState:!r.state)&&(t?r.tState=Ai:r.state=Ai,r.pure?Wt.push(r):Vt.push(r),r.observers&&nm(r))}}function Kr(e){let t;if(e.sources)for(;e.sources.length;){const n=e.sources.pop(),r=e.sourceSlots.pop(),o=n.observers;if(o&&o.length){const i=o.pop(),s=n.observerSlots.pop();r<o.length&&(i.sourceSlots[s]=r,o[r]=i,n.observerSlots[r]=s)}}if(e.tOwned){for(t=e.tOwned.length-1;t>=0;t--)Kr(e.tOwned[t]);delete e.tOwned}if(ke&&ke.running&&e.pure)rm(e,!0);else if(e.owned){for(t=e.owned.length-1;t>=0;t--)Kr(e.owned[t]);e.owned=null}if(e.cleanups){for(t=e.cleanups.length-1;t>=0;t--)e.cleanups[t]();e.cleanups=null}ke&&ke.running?e.tState=0:e.state=0}function rm(e,t){if(t||(e.tState=0,ke.disposed.add(e)),e.owned)for(let n=0;n<e.owned.length;n++)rm(e.owned[n])}function $s(e){return e instanceof Error?e:new Error(typeof e=="string"?e:"Unknown error",{cause:e})}function Tl(e,t=Qe){throw $s(e)}function Vc(e){if(typeof e=="function"&&!e.length)return Vc(e());if(Array.isArray(e)){const t=[];for(let n=0;n<e.length;n++){const r=Vc(e[n]);if(Array.isArray(r))if(r.length<32768)t.push.apply(t,r);else for(let o=0;o<r.length;o++)t.push(r[o]);else t.push(r)}return t}return e}function _v(e,t){return function(r){let o;return Me(()=>o=pt(()=>(Qe.context={...Qe.context,[e]:r.value},ni(()=>r.children))),void 0),o}}const Wc=Symbol("fallback");function Gs(e){for(let t=0;t<e.length;t++)e[t]()}function Ev(e,t,n={}){let r=[],o=[],i=[],s=0,a=t.length>1?[]:null;return ue(()=>Gs(i)),()=>{let u=e()||[],c=u.length,l,d;return u[ki],pt(()=>{let p,h,m,y,v,b,w,E,C;if(c===0)s!==0&&(Gs(i),i=[],r=[],o=[],s=0,a&&(a=[])),n.fallback&&(r=[Wc],o[0]=Cn(k=>(i[0]=k,n.fallback())),s=1);else if(s===0){for(o=new Array(c),d=0;d<c;d++)r[d]=u[d],o[d]=Cn(g);s=c}else{for(m=new Array(c),y=new Array(c),a&&(v=new Array(c)),b=0,w=Math.min(s,c);b<w&&r[b]===u[b];b++);for(w=s-1,E=c-1;w>=b&&E>=b&&r[w]===u[E];w--,E--)m[E]=o[w],y[E]=i[w],a&&(v[E]=a[w]);for(p=new Map,h=new Array(E+1),d=E;d>=b;d--)C=u[d],l=p.get(C),h[d]=l===void 0?-1:l,p.set(C,d);for(l=b;l<=w;l++)C=r[l],d=p.get(C),d!==void 0&&d!==-1?(m[d]=o[l],y[d]=i[l],a&&(v[d]=a[l]),d=h[d],p.set(C,d)):i[l]();for(d=b;d<c;d++)d in m?(o[d]=m[d],i[d]=y[d],a&&(a[d]=v[d],a[d](d))):o[d]=Cn(g);o=o.slice(0,s=c),r=u.slice(0)}return o});function g(p){if(i[d]=p,a){const[h,m]=I(d);return a[d]=m,t(u[d],h)}return t(u[d])}}}function Cv(e,t,n={}){let r=[],o=[],i=[],s=[],a=0,u;return ue(()=>Gs(i)),()=>{const c=e()||[],l=c.length;return c[ki],pt(()=>{if(l===0)return a!==0&&(Gs(i),i=[],r=[],o=[],a=0,s=[]),n.fallback&&(r=[Wc],o[0]=Cn(g=>(i[0]=g,n.fallback())),a=1),o;for(r[0]===Wc&&(i[0](),i=[],r=[],o=[],a=0),u=0;u<l;u++)u<r.length&&r[u]!==c[u]?s[u](()=>c[u]):u>=r.length&&(o[u]=Cn(d));for(;u<r.length;u++)i[u]();return a=s.length=i.length=l,r=c.slice(0),o=o.slice(0,a)});function d(g){i[u]=g;const[p,h]=I(c[u]);return s[u]=h,t(p,u)}}}function f(e,t){return pt(()=>e(t||{}))}function vs(){return!0}const Yc={get(e,t,n){return t===Mn?n:e.get(t)},has(e,t){return t===Mn?!0:e.has(t)},set:vs,deleteProperty:vs,getOwnPropertyDescriptor(e,t){return{configurable:!0,enumerable:!0,get(){return e.get(t)},set:vs,deleteProperty:vs}},ownKeys(e){return e.keys()}};function ru(e){return(e=typeof e=="function"?e():e)?e:{}}function Sv(){for(let e=0,t=this.length;e<t;++e){const n=this[e]();if(n!==void 0)return n}}function G(...e){let t=!1;for(let s=0;s<e.length;s++){const a=e[s];t=t||!!a&&Mn in a,e[s]=typeof a=="function"?(t=!0,ne(a)):a}if(Zh&&t)return new Proxy({get(s){for(let a=e.length-1;a>=0;a--){const u=ru(e[a])[s];if(u!==void 0)return u}},has(s){for(let a=e.length-1;a>=0;a--)if(s in ru(e[a]))return!0;return!1},keys(){const s=[];for(let a=0;a<e.length;a++)s.push(...Object.keys(ru(e[a])));return[...new Set(s)]}},Yc);const n={},r=Object.create(null);for(let s=e.length-1;s>=0;s--){const a=e[s];if(!a)continue;const u=Object.getOwnPropertyNames(a);for(let c=u.length-1;c>=0;c--){const l=u[c];if(l==="__proto__"||l==="constructor")continue;const d=Object.getOwnPropertyDescriptor(a,l);if(!r[l])r[l]=d.get?{enumerable:!0,configurable:!0,get:Sv.bind(n[l]=[d.get.bind(a)])}:d.value!==void 0?d:void 0;else{const g=n[l];g&&(d.get?g.push(d.get.bind(a)):d.value!==void 0&&g.push(()=>d.value))}}}const o={},i=Object.keys(r);for(let s=i.length-1;s>=0;s--){const a=i[s],u=r[a];u&&u.get?Object.defineProperty(o,a,u):o[a]=u?u.value:void 0}return o}function me(e,...t){const n=t.length;if(Zh&&Mn in e){const o=n>1?t.flat():t[0],i=t.map(s=>new Proxy({get(a){return s.includes(a)?e[a]:void 0},has(a){return s.includes(a)&&a in e},keys(){return s.filter(a=>a in e)}},Yc));return i.push(new Proxy({get(s){return o.includes(s)?void 0:e[s]},has(s){return o.includes(s)?!1:s in e},keys(){return Object.keys(e).filter(s=>!o.includes(s))}},Yc)),i}const r=[];for(let o=0;o<=n;o++)r[o]={};for(const o of Object.getOwnPropertyNames(e)){let i=n;for(let u=0;u<t.length;u++)if(t[u].includes(o)){i=u;break}const s=Object.getOwnPropertyDescriptor(e,o);!s.get&&!s.set&&s.enumerable&&s.writable&&s.configurable?r[i][o]=s.value:Object.defineProperty(r[i],o,s)}return r}let kv=0;function Dt(){return He.context?He.getNextContextId():`cl-${kv++}`}const om=e=>`Stale read from <${e}>.`;function ot(e){const t="fallback"in e&&{fallback:()=>e.fallback};return ne(Ev(()=>e.each,e.children,t||void 0))}function Zc(e){const t="fallback"in e&&{fallback:()=>e.fallback};return ne(Cv(()=>e.each,e.children,t||void 0))}function q(e){const t=e.keyed,n=ne(()=>e.when,void 0,void 0),r=t?n:ne(n,void 0,{equals:(o,i)=>!o==!i});return ne(()=>{const o=r();if(o){const i=e.children;return typeof i=="function"&&i.length>0?pt(()=>i(t?o:()=>{if(!pt(r))throw om("Show");return n()})):i}return e.fallback},void 0,void 0)}function Av(e){const t=ni(()=>e.children),n=ne(()=>{const r=t(),o=Array.isArray(r)?r:[r];let i=()=>{};for(let s=0;s<o.length;s++){const a=s,u=o[s],c=i,l=ne(()=>c()?void 0:u.when,void 0,void 0),d=u.keyed?l:ne(l,void 0,{equals:(g,p)=>!g==!p});i=()=>c()||(d()?[a,l,u]:void 0)}return i});return ne(()=>{const r=n()();if(!r)return e.fallback;const[o,i,s]=r,a=s.children;return typeof a=="function"&&a.length>0?pt(()=>a(s.keyed?i():()=>{if(pt(n)()?.[0]!==o)throw om("Match");return i()})):a},void 0,void 0)}function qd(e){return e}const Tv=dt();function va(e){let t=0,n,r,o,i,s;const[a,u]=I(!1),c=vv(),l={increment:()=>{++t===1&&u(!0)},decrement:()=>{--t===0&&u(!1)},inFallback:a,effects:[],resolved:!1},d=Ti();if(He.context&&He.load){const h=He.getContextId();let m=He.load(h);if(m&&(typeof m!="object"||m.s!==1?o=m:He.gather(h)),o&&o!=="$$f"){const[y,v]=I(void 0,{equals:!1});i=y,o.then(()=>{if(He.done)return v();He.gather(h),hi(r),v(),hi()},b=>{s=b,v()})}}const g=ut(Tv);g&&(n=g.register(l.inFallback));let p;return ue(()=>p&&p()),f(c.Provider,{value:l,get children(){return ne(()=>{if(s)throw s;if(r=He.context,i)return i(),i=void 0;r&&o==="$$f"&&hi();const h=ne(()=>e.children);return ne(m=>{const y=l.inFallback(),{showContent:v=!0,showFallback:b=!0}=n?n():{};if((!y||o&&o!=="$$f")&&v)return l.resolved=!0,p&&p(),p=r=o=void 0,yv(l.effects),h();if(b)return p?m:Cn(w=>(p=w,r&&(hi({id:r.id+"F",count:0}),r=void 0),e.fallback),d)})})}})}const Dv=["allowfullscreen","async","alpha","autofocus","autoplay","checked","controls","default","disabled","formnovalidate","hidden","indeterminate","inert","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","seamless","selected","adauctionheaders","browsingtopics","credentialless","defaultchecked","defaultmuted","defaultselected","defer","disablepictureinpicture","disableremoteplayback","preservespitch","shadowrootclonable","shadowrootcustomelementregistry","shadowrootdelegatesfocus","shadowrootserializable","sharedstoragewritable"],Iv=new Set(["className","value","readOnly","noValidate","formNoValidate","isMap","noModule","playsInline","adAuctionHeaders","allowFullscreen","browsingTopics","defaultChecked","defaultMuted","defaultSelected","disablePictureInPicture","disableRemotePlayback","preservesPitch","shadowRootClonable","shadowRootCustomElementRegistry","shadowRootDelegatesFocus","shadowRootSerializable","sharedStorageWritable",...Dv]),Rv=new Set(["innerHTML","textContent","innerText","children"]),Ov=Object.assign(Object.create(null),{className:"class",htmlFor:"for"}),Nv=Object.assign(Object.create(null),{class:"className",novalidate:{$:"noValidate",FORM:1},formnovalidate:{$:"formNoValidate",BUTTON:1,INPUT:1},ismap:{$:"isMap",IMG:1},nomodule:{$:"noModule",SCRIPT:1},playsinline:{$:"playsInline",VIDEO:1},readonly:{$:"readOnly",INPUT:1,TEXTAREA:1},adauctionheaders:{$:"adAuctionHeaders",IFRAME:1},allowfullscreen:{$:"allowFullscreen",IFRAME:1},browsingtopics:{$:"browsingTopics",IMG:1},defaultchecked:{$:"defaultChecked",INPUT:1},defaultmuted:{$:"defaultMuted",AUDIO:1,VIDEO:1},defaultselected:{$:"defaultSelected",OPTION:1},disablepictureinpicture:{$:"disablePictureInPicture",VIDEO:1},disableremoteplayback:{$:"disableRemotePlayback",AUDIO:1,VIDEO:1},preservespitch:{$:"preservesPitch",AUDIO:1,VIDEO:1},shadowrootclonable:{$:"shadowRootClonable",TEMPLATE:1},shadowrootdelegatesfocus:{$:"shadowRootDelegatesFocus",TEMPLATE:1},shadowrootserializable:{$:"shadowRootSerializable",TEMPLATE:1},sharedstoragewritable:{$:"sharedStorageWritable",IFRAME:1,IMG:1}});function Mv(e,t){const n=Nv[e];return typeof n=="object"?n[t]?n.$:void 0:n}const Pv=new Set(["beforeinput","click","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"]),Lv=new Set(["altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignObject","g","glyph","glyphRef","hkern","image","line","linearGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","set","stop","svg","switch","symbol","text","textPath","tref","tspan","use","view","vkern"]),$v={xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace"},Q=e=>ne(()=>e());function Fv(e,t,n){let r=n.length,o=t.length,i=r,s=0,a=0,u=t[o-1].nextSibling,c=null;for(;s<o||a<i;){if(t[s]===n[a]){s++,a++;continue}for(;t[o-1]===n[i-1];)o--,i--;if(o===s){const l=i<r?a?n[a-1].nextSibling:n[i-a]:u;for(;a<i;)e.insertBefore(n[a++],l)}else if(i===a)for(;s<o;)(!c||!c.has(t[s]))&&t[s].remove(),s++;else if(t[s]===n[i-1]&&n[a]===t[o-1]){const l=t[--o].nextSibling;e.insertBefore(n[a++],t[s++].nextSibling),e.insertBefore(n[--i],l),t[o]=n[i]}else{if(!c){c=new Map;let d=a;for(;d<i;)c.set(n[d],d++)}const l=c.get(t[s]);if(l!=null)if(a<l&&l<i){let d=s,g=1,p;for(;++d<o&&d<i&&!((p=c.get(t[d]))==null||p!==l+g);)g++;if(g>l-a){const h=t[s];for(;a<l;)e.insertBefore(n[a++],h)}else e.replaceChild(n[a++],t[s++])}else s++;else t[s++].remove()}}}const Hd="_$DX_DELEGATE";function Bv(e,t,n,r={}){let o;return Cn(i=>{o=i,t===document?e():x(t,e(),t.firstChild?null:void 0,n)},r.owner),()=>{o(),t.textContent=""}}function $(e,t,n,r){let o;const i=()=>{const a=r?document.createElementNS("http://www.w3.org/1998/Math/MathML","template"):document.createElement("template");return a.innerHTML=e,n?a.content.firstChild.firstChild:r?a.firstChild:a.content.firstChild},s=t?()=>pt(()=>document.importNode(o||(o=i()),!0)):()=>(o||(o=i())).cloneNode(!0);return s.cloneNode=s,s}function jt(e,t=window.document){const n=t[Hd]||(t[Hd]=new Set);for(let r=0,o=e.length;r<o;r++){const i=e[r];n.has(i)||(n.add(i),t.addEventListener(i,Gv))}}function Ke(e,t,n){mo(e)||(n==null?e.removeAttribute(t):e.setAttribute(t,n))}function zv(e,t,n,r){mo(e)||(r==null?e.removeAttributeNS(t,n):e.setAttributeNS(t,n,r))}function Uv(e,t,n){mo(e)||(n?e.setAttribute(t,""):e.removeAttribute(t))}function xt(e,t){mo(e)||(t==null?e.removeAttribute("class"):e.className=t)}function Vs(e,t,n,r){if(r)Array.isArray(n)?(e[`$$${t}`]=n[0],e[`$$${t}Data`]=n[1]):e[`$$${t}`]=n;else if(Array.isArray(n)){const o=n[0];e.addEventListener(t,n[0]=i=>o.call(e,n[1],i))}else e.addEventListener(t,n,typeof n!="function"&&n)}function Kv(e,t,n={}){const r=Object.keys(t||{}),o=Object.keys(n);let i,s;for(i=0,s=o.length;i<s;i++){const a=o[i];!a||a==="undefined"||t[a]||(Gd(e,a,!1),delete n[a])}for(i=0,s=r.length;i<s;i++){const a=r[i],u=!!t[a];!a||a==="undefined"||n[a]===u||!u||(Gd(e,a,!0),n[a]=u)}return n}function Vo(e,t,n){if(!t)return n?Ke(e,"style"):t;const r=e.style;if(typeof t=="string")return r.cssText=t;typeof n=="string"&&(r.cssText=n=void 0),n||(n={}),t||(t={});let o,i;for(i in n)t[i]==null&&r.removeProperty(i),delete n[i];for(i in t)o=t[i],o!==n[i]&&(r.setProperty(i,o),n[i]=o);return n}function Di(e,t,n){n!=null?e.style.setProperty(t,n):e.style.removeProperty(t)}function sr(e,t={},n,r){const o={};return r||Me(()=>o.children=Ii(e,t.children,o.children)),Me(()=>typeof t.ref=="function"&&Ln(t.ref,e)),Me(()=>jv(e,t,n,!0,o,!0)),o}function Ln(e,t,n){return pt(()=>e(t,n))}function x(e,t,n,r){if(n!==void 0&&!r&&(r=[]),typeof t!="function")return Ii(e,t,r,n);Me(o=>Ii(e,t(),o,n),r)}function jv(e,t,n,r,o={},i=!1){t||(t={});for(const s in o)if(!(s in t)){if(s==="children")continue;o[s]=Vd(e,s,null,o[s],n,i,t)}for(const s in t){if(s==="children")continue;const a=t[s];o[s]=Vd(e,s,a,o[s],n,i,t)}}function qv(e){let t,n;return!mo()||!(t=He.registry.get(n=Vv()))?e():(He.completed&&He.completed.add(t),He.registry.delete(n),t)}function mo(e){return!!He.context&&!He.done&&(!e||e.isConnected)}function Hv(e){return e.toLowerCase().replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}function Gd(e,t,n){const r=t.trim().split(/\s+/);for(let o=0,i=r.length;o<i;o++)e.classList.toggle(r[o],n)}function Vd(e,t,n,r,o,i,s){let a,u,c,l,d;if(t==="style")return Vo(e,n,r);if(t==="classList")return Kv(e,n,r);if(n===r)return r;if(t==="ref")i||n(e);else if(t.slice(0,3)==="on:"){const g=t.slice(3);r&&e.removeEventListener(g,r,typeof r!="function"&&r),n&&e.addEventListener(g,n,typeof n!="function"&&n)}else if(t.slice(0,10)==="oncapture:"){const g=t.slice(10);r&&e.removeEventListener(g,r,!0),n&&e.addEventListener(g,n,!0)}else if(t.slice(0,2)==="on"){const g=t.slice(2).toLowerCase(),p=Pv.has(g);if(!p&&r){const h=Array.isArray(r)?r[0]:r;e.removeEventListener(g,h)}(p||n)&&(Vs(e,g,n,p),p&&jt([g]))}else if(t.slice(0,5)==="attr:")Ke(e,t.slice(5),n);else if(t.slice(0,5)==="bool:")Uv(e,t.slice(5),n);else if((d=t.slice(0,5)==="prop:")||(c=Rv.has(t))||!o&&((l=Mv(t,e.tagName))||(u=Iv.has(t)))||(a=e.nodeName.includes("-")||"is"in s)){if(d)t=t.slice(5),u=!0;else if(mo(e))return n;t==="class"||t==="className"?xt(e,n):a&&!u&&!c?e[Hv(t)]=n:e[l||t]=n}else{const g=o&&t.indexOf(":")>-1&&$v[t.split(":")[0]];g?zv(e,g,t,n):Ke(e,Ov[t]||t,n)}return n}function Gv(e){if(He.registry&&He.events&&He.events.find(([u,c])=>c===e))return;let t=e.target;const n=`$$${e.type}`,r=e.target,o=e.currentTarget,i=u=>Object.defineProperty(e,"target",{configurable:!0,value:u}),s=()=>{const u=t[n];if(u&&!t.disabled){const c=t[`${n}Data`];if(c!==void 0?u.call(t,c,e):u.call(t,e),e.cancelBubble)return}return t.host&&typeof t.host!="string"&&!t.host._$host&&t.contains(e.target)&&i(t.host),!0},a=()=>{for(;s()&&(t=t._$host||t.parentNode||t.host););};if(Object.defineProperty(e,"currentTarget",{configurable:!0,get(){return t||document}}),He.registry&&!He.done&&(He.done=_$HY.done=!0),e.composedPath){const u=e.composedPath();i(u[0]);for(let c=0;c<u.length-2&&(t=u[c],!!s());c++){if(t._$host){t=t._$host,a();break}if(t.parentNode===o)break}}else a();i(r)}function Ii(e,t,n,r,o){const i=mo(e);if(i){!n&&(n=[...e.childNodes]);let u=[];for(let c=0;c<n.length;c++){const l=n[c];l.nodeType===8&&l.data.slice(0,2)==="!$"?l.remove():u.push(l)}n=u}for(;typeof n=="function";)n=n();if(t===n)return n;const s=typeof t,a=r!==void 0;if(e=a&&n[0]&&n[0].parentNode||e,s==="string"||s==="number"){if(i||s==="number"&&(t=t.toString(),t===n))return n;if(a){let u=n[0];u&&u.nodeType===3?u.data!==t&&(u.data=t):u=document.createTextNode(t),n=Ao(e,n,r,u)}else n!==""&&typeof n=="string"?n=e.firstChild.data=t:n=e.textContent=t}else if(t==null||s==="boolean"){if(i)return n;n=Ao(e,n,r)}else{if(s==="function")return Me(()=>{let u=t();for(;typeof u=="function";)u=u();n=Ii(e,u,n,r)}),()=>n;if(Array.isArray(t)){const u=[],c=n&&Array.isArray(n);if(Xc(u,t,n,o))return Me(()=>n=Ii(e,u,n,r,!0)),()=>n;if(i){if(!u.length)return n;if(r===void 0)return n=[...e.childNodes];let l=u[0];if(l.parentNode!==e)return n;const d=[l];for(;(l=l.nextSibling)!==r;)d.push(l);return n=d}if(u.length===0){if(n=Ao(e,n,r),a)return n}else c?n.length===0?Wd(e,u,r):Fv(e,n,u):(n&&Ao(e),Wd(e,u));n=u}else if(t.nodeType){if(i&&t.parentNode)return n=a?[t]:t;if(Array.isArray(n)){if(a)return n=Ao(e,n,r,t);Ao(e,n,null,t)}else n==null||n===""||!e.firstChild?e.appendChild(t):e.replaceChild(t,e.firstChild);n=t}}return n}function Xc(e,t,n,r){let o=!1;for(let i=0,s=t.length;i<s;i++){let a=t[i],u=n&&n[e.length],c;if(!(a==null||a===!0||a===!1))if((c=typeof a)=="object"&&a.nodeType)e.push(a);else if(Array.isArray(a))o=Xc(e,a,u)||o;else if(c==="function")if(r){for(;typeof a=="function";)a=a();o=Xc(e,Array.isArray(a)?a:[a],Array.isArray(u)?u:[u])||o}else e.push(a),o=!0;else{const l=String(a);u&&u.nodeType===3&&u.data===l?e.push(u):e.push(document.createTextNode(l))}}return o}function Wd(e,t,n=null){for(let r=0,o=t.length;r<o;r++)e.insertBefore(t[r],n)}function Ao(e,t,n,r){if(n===void 0)return e.textContent="";const o=r||document.createTextNode("");if(t.length){let i=!1;for(let s=t.length-1;s>=0;s--){const a=t[s];if(o!==a){const u=a.parentNode===e;!i&&!s?u?e.replaceChild(o,a):e.insertBefore(o,n):u&&a.remove()}else i=!0}}else e.insertBefore(o,n);return[o]}function Vv(){return He.getNextContextId()}const Wv=!1,Yv="http://www.w3.org/2000/svg";function im(e,t=!1,n=void 0){return t?document.createElementNS(Yv,e):document.createElement(e,{is:n})}function Gi(e){const{useShadow:t}=e,n=document.createTextNode(""),r=()=>e.mount||document.body,o=Ti();let i,s=!!He.context;return ae(()=>{s&&(Ti().user=s=!1),i||(i=ba(o,()=>ne(()=>e.children)));const a=r();if(a instanceof HTMLHeadElement){const[u,c]=I(!1),l=()=>c(!0);Cn(d=>x(a,()=>u()?d():i(),null)),ue(l)}else{const u=im(e.isSVG?"g":"div",e.isSVG),c=t&&u.attachShadow?u.attachShadow({mode:"open"}):u;Object.defineProperty(u,"_$host",{get(){return n.parentNode},configurable:!0}),x(c,i),a.appendChild(u),e.ref&&e.ref(u),ue(()=>a.removeChild(u))}},void 0,{render:!s}),n}function Zv(e,t){const n=ne(e);return ne(()=>{const r=n();switch(typeof r){case"function":return pt(()=>r(t));case"string":const o=Lv.has(r),i=He.context?qv():im(r,o,pt(()=>t.is));return sr(i,t,o),i}})}function sm(e){const[,t]=me(e,["component"]);return Zv(()=>e.component,t)}function am(){let e=new Set;function t(o){return e.add(o),()=>e.delete(o)}let n=!1;function r(o,i){if(n)return!(n=!1);const s={to:o,options:i,defaultPrevented:!1,preventDefault:()=>s.defaultPrevented=!0};for(const a of e)a.listener({...s,from:a.location,retry:u=>{u&&(n=!0),a.navigate(o,{...i,resolve:!1})}});return!s.defaultPrevented}return{subscribe:t,confirm:r}}let Jc;function Dl(){(!window.history.state||window.history.state._depth==null)&&window.history.replaceState({...window.history.state,_depth:window.history.length-1},""),Jc=window.history.state._depth}Dl();function Xv(e){return{...e,_depth:window.history.state&&window.history.state._depth}}function Jv(e,t){let n=!1;return()=>{const r=Jc;Dl();const o=r==null?null:Jc-r;if(n){n=!1;return}o&&t(o)?(n=!0,window.history.go(-o)):e()}}const Qv=/^(?:[a-z0-9]+:)?\/\//i,ew=/^\/+|(\/)\/+$/g,um="http://sr";function fo(e,t=!1){const n=e.replace(ew,"$1");return n?t||/^[?#]/.test(n)?n:"/"+n:""}function Fs(e,t,n){if(Qv.test(t))return;const r=fo(e),o=n&&fo(n);let i="";return!o||t.startsWith("/")?i=r:o.toLowerCase().indexOf(r.toLowerCase())!==0?i=r+o:i=o,(i||"/")+fo(t,!i)}function tw(e,t){if(e==null)throw new Error(t);return e}function nw(e,t){return fo(e).replace(/\/*(\*.*)?$/g,"")+fo(t)}function cm(e){const t={};return e.searchParams.forEach((n,r)=>{r in t?Array.isArray(t[r])?t[r].push(n):t[r]=[t[r],n]:t[r]=n}),t}function rw(e,t,n){const[r,o]=e.split("/*",2),i=r.split("/").filter(Boolean),s=i.length;return a=>{const u=a.split("/").filter(Boolean),c=u.length-s;if(c<0||c>0&&o===void 0&&!t)return null;const l={path:s?"":"/",params:{}},d=g=>n===void 0?void 0:n[g];for(let g=0;g<s;g++){const p=i[g],h=p[0]===":",m=h?u[g]:u[g].toLowerCase(),y=h?p.slice(1):p.toLowerCase();if(h&&ou(m,d(y)))l.params[y]=m;else if(h||!ou(m,y))return null;l.path+=`/${m}`}if(o){const g=c?u.slice(-c).join("/"):"";if(ou(g,d(o)))l.params[o]=g;else return null}return l}}function ou(e,t){const n=r=>r===e;return t===void 0?!0:typeof t=="string"?n(t):typeof t=="function"?t(e):Array.isArray(t)?t.some(n):t instanceof RegExp?t.test(e):!1}function ow(e){const[t,n]=e.pattern.split("/*",2),r=t.split("/").filter(Boolean);return r.reduce((o,i)=>o+(i.startsWith(":")?2:3),r.length-(n===void 0?0:1))}function lm(e){const t=new Map,n=Ti();return new Proxy({},{get(r,o){return t.has(o)||ba(n,()=>t.set(o,ne(()=>e()[o]))),t.get(o)()},getOwnPropertyDescriptor(){return{enumerable:!0,configurable:!0}},ownKeys(){return Reflect.ownKeys(e())},has(r,o){return o in e()}})}function dm(e){let t=/(\/?\:[^\/]+)\?/.exec(e);if(!t)return[e];let n=e.slice(0,t.index),r=e.slice(t.index+t[0].length);const o=[n,n+=t[1]];for(;t=/^(\/\:[^\/]+)\?/.exec(r);)o.push(n+=t[1]),r=r.slice(t[0].length);return dm(r).reduce((i,s)=>[...i,...o.map(a=>a+s)],[])}const iw=100,fm=dt(),Il=dt(),bo=()=>tw(ut(fm),"<A> and 'use' router primitives can be only used inside a Route."),sw=()=>ut(Il)||bo().base,aw=e=>{const t=sw();return ne(()=>t.resolvePath(e()))},uw=e=>{const t=bo();return ne(()=>{const n=e();return n!==void 0?t.renderPath(n):n})},Wr=()=>bo().navigatorFactory(),oi=()=>bo().location,cw=()=>bo().isRouting,Vi=()=>bo().params,lw=e=>{const t=bo().beforeLeave.subscribe({listener:e,location:oi(),navigate:Wr()});ue(t)};function dw(e,t=""){const{component:n,preload:r,load:o,children:i,info:s}=e,a=!i||Array.isArray(i)&&!i.length,u={key:e,component:n,preload:r||o,info:s};return gm(e.path).reduce((c,l)=>{for(const d of dm(l)){const g=nw(t,d);let p=a?g:g.split("/*",1)[0];p=p.split("/").map(h=>h.startsWith(":")||h.startsWith("*")?h:encodeURIComponent(h)).join("/"),c.push({...u,originalPath:l,pattern:p,matcher:rw(p,!a,e.matchFilters)})}return c},[])}function fw(e,t=0){return{routes:e,score:ow(e[e.length-1])*1e4-t,matcher(n){const r=[];for(let o=e.length-1;o>=0;o--){const i=e[o],s=i.matcher(n);if(!s)return null;r.unshift({...s,route:i})}return r}}}function gm(e){return Array.isArray(e)?e:[e]}function pm(e,t="",n=[],r=[]){const o=gm(e);for(let i=0,s=o.length;i<s;i++){const a=o[i];if(a&&typeof a=="object"){a.hasOwnProperty("path")||(a.path="");const u=dw(a,t);for(const c of u){n.push(c);const l=Array.isArray(a.children)&&a.children.length===0;if(a.children&&!l)pm(a.children,c.pattern,n,r);else{const d=fw([...n],r.length);r.push(d)}n.pop()}}}return n.length?r:r.sort((i,s)=>s.score-i.score)}function iu(e,t){for(let n=0,r=e.length;n<r;n++){const o=e[n].matcher(t);if(o)return o}return[]}function gw(e,t,n){const r=new URL(um),o=ne(l=>{const d=e();try{return new URL(d,r)}catch{return console.error(`Invalid path ${d}`),l}},r,{equals:(l,d)=>l.href===d.href}),i=ne(()=>o().pathname),s=ne(()=>o().search,!0),a=ne(()=>o().hash),u=()=>"",c=_t(s,()=>cm(o()));return{get pathname(){return i()},get search(){return s()},get hash(){return a()},get state(){return t()},get key(){return u()},query:n?n(c):lm(c)}}let co;function pw(){return co}function hw(e,t,n,r={}){const{signal:[o,i],utils:s={}}=e,a=s.parsePath||(D=>D),u=s.renderPath||(D=>D),c=s.beforeLeave||am(),l=Fs("",r.base||"");if(l===void 0)throw new Error(`${l} is not a valid base path`);l&&!o().value&&i({value:l,replace:!0,scroll:!1});const[d,g]=I(!1);let p;const h=(D,B)=>{B.value===m()&&B.state===v()||(p===void 0&&g(!0),co=D,p=B,Al(()=>{p===B&&(y(p.value),b(p.state),C[1](N=>N.filter(Y=>Y.pending)))}).finally(()=>{p===B&&kl(()=>{co=void 0,D==="navigate"&&P(p),g(!1),p=void 0})}))},[m,y]=I(o().value),[v,b]=I(o().state),w=gw(m,v,s.queryWrapper),E=[],C=I([]),k=ne(()=>typeof r.transformUrl=="function"?iu(t(),r.transformUrl(w.pathname)):iu(t(),w.pathname)),T=()=>{const D=k(),B={};for(let N=0;N<D.length;N++)Object.assign(B,D[N].params);return B},S=s.paramsWrapper?s.paramsWrapper(T,t):lm(T),A={pattern:l,path:()=>l,outlet:()=>null,resolvePath(D){return Fs(l,D)}};return Me(_t(o,D=>h("native",D),{defer:!0})),{base:A,location:w,params:S,isRouting:d,renderPath:u,parsePath:a,navigatorFactory:O,matches:k,beforeLeave:c,preloadRoute:L,singleFlight:r.singleFlight===void 0?!0:r.singleFlight,submissions:C};function F(D,B,N){pt(()=>{if(typeof B=="number"){B&&(s.go?s.go(B):console.warn("Router integration does not support relative routing"));return}const Y=!B||B[0]==="?",{replace:ce,resolve:V,scroll:j,state:he}={replace:!1,resolve:!Y,scroll:!0,...N},K=V?D.resolvePath(B):Fs(Y&&w.pathname||"",B);if(K===void 0)throw new Error(`Path '${B}' is not a routable path`);if(E.length>=iw)throw new Error("Too many redirects");const z=m();(K!==z||he!==v())&&(Wv||c.confirm(K,N)&&(E.push({value:z,replace:ce,scroll:j,state:v()}),h("navigate",{value:K,state:he})))})}function O(D){return D=D||ut(Il)||A,(B,N)=>F(D,B,N)}function P(D){const B=E[0];B&&(i({...D,replace:B.replace,scroll:B.scroll}),E.length=0)}function L(D,B){const N=iu(t(),D.pathname),Y=co;co="preload";for(let ce in N){const{route:V,params:j}=N[ce];V.component&&V.component.preload&&V.component.preload();const{preload:he}=V;B&&he&&ba(n(),()=>he({params:j,location:{pathname:D.pathname,search:D.search,hash:D.hash,query:cm(D),state:null,key:""},intent:"preload"}))}co=Y}}function mw(e,t,n,r){const{base:o,location:i,params:s}=e,{pattern:a,component:u,preload:c}=r().route,l=ne(()=>r().path);u&&u.preload&&u.preload();const d=c?c({params:s,location:i,intent:co||"initial"}):void 0;return{parent:t,pattern:a,path:l,outlet:()=>u?f(u,{params:s,location:i,data:d,get children(){return n()}}):n(),resolvePath(p){return Fs(o.path(),p,l())}}}const bw=e=>t=>{const{base:n}=t,r=ni(()=>t.children),o=ne(()=>pm(r(),t.base||""));let i;const s=hw(e,o,()=>i,{base:n,singleFlight:t.singleFlight,transformUrl:t.transformUrl});return e.create&&e.create(s),f(fm.Provider,{value:s,get children(){return f(yw,{routerState:s,get root(){return t.root},get preload(){return t.rootPreload||t.rootLoad},get children(){return[Q(()=>(i=Ti())&&null),f(vw,{routerState:s,get branches(){return o()}})]}})}})};function yw(e){const t=e.routerState.location,n=e.routerState.params,r=ne(()=>e.preload&&pt(()=>{e.preload({params:n,location:t,intent:pw()||"initial"})}));return f(q,{get when(){return e.root},keyed:!0,get fallback(){return e.children},children:o=>f(o,{params:n,location:t,get data(){return r()},get children(){return e.children}})})}function vw(e){const t=[];let n;const r=ne(_t(e.routerState.matches,(o,i,s)=>{let a=i&&o.length===i.length;const u=[];for(let c=0,l=o.length;c<l;c++){const d=i&&i[c],g=o[c];s&&d&&g.route.key===d.route.key?u[c]=s[c]:(a=!1,t[c]&&t[c](),Cn(p=>{t[c]=p,u[c]=mw(e.routerState,u[c-1]||e.routerState.base,Yd(()=>r()[c+1]),()=>{const h=e.routerState.matches();return h[c]??h[0]})}))}return t.splice(o.length).forEach(c=>c()),s&&a?s:(n=u[0],u)}));return Yd(()=>r()&&n)()}const Yd=e=>()=>f(q,{get when(){return e()},keyed:!0,children:t=>f(Il.Provider,{value:t,get children(){return t.outlet()}})}),hr=e=>{const t=ni(()=>e.children);return G(e,{get children(){return t()}})};function ww([e,t],n,r){return[e,r?o=>t(r(o)):t]}function xw(e){let t=!1;const n=o=>typeof o=="string"?{value:o}:o,r=ww(I(n(e.get()),{equals:(o,i)=>o.value===i.value&&o.state===i.state}),void 0,o=>(!t&&e.set(o),He.registry&&!He.done&&(He.done=!0),o));return e.init&&ue(e.init((o=e.get())=>{t=!0,r[1](n(o)),t=!1})),bw({signal:r,create:e.create,utils:e.utils})}function _w(e,t,n){return e.addEventListener(t,n),()=>e.removeEventListener(t,n)}function Ew(e,t){const n=e&&document.getElementById(e);n?n.scrollIntoView():t&&window.scrollTo(0,0)}const Cw=new Map;function Sw({preload:e=!0,explicitLinks:t=!1,actionBase:n="/_server",transformUrl:r}={}){return o=>{const i=o.base.path(),s=o.navigatorFactory(o.base);let a,u;function c(m){return m.namespaceURI==="http://www.w3.org/2000/svg"}function l(m){if(m.defaultPrevented||m.button!==0||m.metaKey||m.altKey||m.ctrlKey||m.shiftKey)return;const y=m.composedPath().find(k=>k instanceof Node&&k.nodeName.toUpperCase()==="A");if(!y||t&&!y.hasAttribute("link"))return;const v=c(y),b=v?y.href.baseVal:y.href;if((v?y.target.baseVal:y.target)||!b&&!y.hasAttribute("state"))return;const E=(y.getAttribute("rel")||"").split(/\s+/);if(y.hasAttribute("download")||E&&E.includes("external"))return;const C=v?new URL(b,document.baseURI):new URL(b);if(!(C.origin!==window.location.origin||i&&C.pathname&&!C.pathname.toLowerCase().startsWith(i.toLowerCase())))return[y,C]}function d(m){const y=l(m);if(!y)return;const[v,b]=y,w=o.parsePath(b.pathname+b.search+b.hash),E=v.getAttribute("state");m.preventDefault(),s(w,{resolve:!1,replace:v.hasAttribute("replace"),scroll:!v.hasAttribute("noscroll"),state:E?JSON.parse(E):void 0})}function g(m){const y=l(m);if(!y)return;const[v,b]=y;r&&(b.pathname=r(b.pathname)),o.preloadRoute(b,v.getAttribute("preload")!=="false")}function p(m){clearTimeout(a);const y=l(m);if(!y)return u=null;const[v,b]=y;u!==v&&(r&&(b.pathname=r(b.pathname)),a=setTimeout(()=>{o.preloadRoute(b,v.getAttribute("preload")!=="false"),u=v},20))}function h(m){if(m.defaultPrevented)return;let y=m.submitter&&m.submitter.hasAttribute("formaction")?m.submitter.getAttribute("formaction"):m.target.getAttribute("action");if(!y)return;if(!y.startsWith("https://action/")){const b=new URL(y,um);if(y=o.parsePath(b.pathname+b.search),!y.startsWith(n))return}if(m.target.method.toUpperCase()!=="POST")throw new Error("Only POST forms are supported for Actions");const v=Cw.get(y);if(v){m.preventDefault();const b=new FormData(m.target,m.submitter);v.call({r:o,f:m.target},m.target.enctype==="multipart/form-data"?b:new URLSearchParams(b))}}jt(["click","submit"]),document.addEventListener("click",d),e&&(document.addEventListener("mousemove",p,{passive:!0}),document.addEventListener("focusin",g,{passive:!0}),document.addEventListener("touchstart",g,{passive:!0})),document.addEventListener("submit",h),ue(()=>{document.removeEventListener("click",d),e&&(document.removeEventListener("mousemove",p),document.removeEventListener("focusin",g),document.removeEventListener("touchstart",g)),document.removeEventListener("submit",h)})}}function kw(e){const t=()=>{const r=window.location.pathname.replace(/^\/+/,"/")+window.location.search,o=window.history.state&&window.history.state._depth&&Object.keys(window.history.state).length===1?void 0:window.history.state;return{value:r+window.location.hash,state:o}},n=am();return xw({get:t,set({value:r,replace:o,scroll:i,state:s}){o?window.history.replaceState(Xv(s),"",r):window.history.pushState(s,"",r),Ew(decodeURIComponent(window.location.hash.slice(1)),i),Dl()},init:r=>_w(window,"popstate",Jv(r,o=>{if(o)return!n.confirm(o);{const i=t();return!n.confirm(i.value,{state:i.state})}})),create:Sw({preload:e.preload,explicitLinks:e.explicitLinks,actionBase:e.actionBase,transformUrl:e.transformUrl}),utils:{go:r=>window.history.go(r),beforeLeave:n}})(e)}var Aw=$("<a>");function Nn(e){e=G({inactiveClass:"inactive",activeClass:"active"},e);const[,t]=me(e,["href","state","class","activeClass","inactiveClass","end"]),n=aw(()=>e.href),r=uw(n),o=oi(),i=ne(()=>{const s=n();if(s===void 0)return[!1,!1];const a=fo(s.split(/[?#]/,1)[0]).toLowerCase(),u=decodeURI(fo(o.pathname).toLowerCase());return[e.end?a===u:u.startsWith(a+"/")||u===a,a===u]});return(()=>{var s=Aw();return sr(s,G(t,{get href(){return r()||e.href},get state(){return JSON.stringify(e.state)},get classList(){return{...e.class&&{[e.class]:!0},[e.inactiveClass]:!i()[0],[e.activeClass]:i()[0],...t.classList}},link:"",get"aria-current"(){return i()[1]?"page":void 0}}),!1,!1),s})()}function Tw(e){const t=Wr(),n=oi(),{href:r,state:o}=e,i=typeof r=="function"?r({navigate:t,location:n}):r;return t(i,{replace:!0,state:o}),null}const Qc=Symbol("store-raw"),Uo=Symbol("store-node"),vr=Symbol("store-has"),hm=Symbol("store-self");function mm(e){let t=e[Mn];if(!t&&(Object.defineProperty(e,Mn,{value:t=new Proxy(e,Rw)}),!Array.isArray(e))){const n=Object.keys(e),r=Object.getOwnPropertyDescriptors(e),o=Object.getPrototypeOf(e),i=o!==null&&e!==null&&typeof e=="object"&&!Array.isArray(e)&&o!==Object.prototype;if(i){const s=Object.getOwnPropertyDescriptors(o);n.push(...Object.keys(s)),Object.assign(r,s)}for(let s=0,a=n.length;s<a;s++){const u=n[s];i&&u==="constructor"||r[u].get&&Object.defineProperty(e,u,{configurable:!0,enumerable:r[u].enumerable,get:r[u].get.bind(t)})}}return t}function Ws(e){let t;return e!=null&&typeof e=="object"&&(e[Mn]||!(t=Object.getPrototypeOf(e))||t===Object.prototype||Array.isArray(e))}function Ri(e,t=new Set){let n,r,o,i;if(n=e!=null&&e[Qc])return n;if(!Ws(e)||t.has(e))return e;if(Array.isArray(e)){Object.isFrozen(e)?e=e.slice(0):t.add(e);for(let s=0,a=e.length;s<a;s++)o=e[s],(r=Ri(o,t))!==o&&(e[s]=r)}else{Object.isFrozen(e)?e=Object.assign({},e):t.add(e);const s=Object.keys(e),a=Object.getOwnPropertyDescriptors(e);for(let u=0,c=s.length;u<c;u++)i=s[u],!a[i].get&&(o=e[i],(r=Ri(o,t))!==o&&(e[i]=r))}return e}function Ys(e,t){let n=e[t];return n||Object.defineProperty(e,t,{value:n=Object.create(null)}),n}function Oi(e,t,n){if(e[t])return e[t];const[r,o]=I(n,{equals:!1,internal:!0});return r.$=o,e[t]=r}function Dw(e,t){const n=Reflect.getOwnPropertyDescriptor(e,t);return!n||n.get||!n.configurable||t===Mn||t===Uo||(delete n.value,delete n.writable,n.get=()=>e[Mn][t]),n}function bm(e){Gc()&&Oi(Ys(e,Uo),hm)()}function Iw(e){return bm(e),Reflect.ownKeys(e)}const Rw={get(e,t,n){if(t===Qc)return e;if(t===Mn)return n;if(t===ki)return bm(e),n;const r=Ys(e,Uo),o=r[t];let i=o?o():e[t];if(t===Uo||t===vr||t==="__proto__")return i;if(!o){const s=Object.getOwnPropertyDescriptor(e,t);Gc()&&(typeof i!="function"||e.hasOwnProperty(t))&&!(s&&s.get)&&(i=Oi(r,t,i)())}return Ws(i)?mm(i):i},has(e,t){return t===Qc||t===Mn||t===ki||t===Uo||t===vr||t==="__proto__"?!0:(Gc()&&Oi(Ys(e,vr),t)(),t in e)},set(){return!0},deleteProperty(){return!0},ownKeys:Iw,getOwnPropertyDescriptor:Dw};function Zs(e,t,n,r=!1){if(t==="__proto__"||!r&&e[t]===n)return;const o=e[t],i=e.length;n===void 0?(delete e[t],e[vr]&&e[vr][t]&&o!==void 0&&e[vr][t].$()):(e[t]=n,e[vr]&&e[vr][t]&&o===void 0&&e[vr][t].$());let s=Ys(e,Uo),a;if((a=Oi(s,t,o))&&a.$(()=>n),Array.isArray(e)&&e.length!==i){for(let u=e.length;u<i;u++)(a=s[u])&&a.$();(a=Oi(s,"length",i))&&a.$(e.length)}(a=s[hm])&&a.$()}function ym(e,t){const n=Object.keys(t);for(let r=0;r<n.length;r+=1){const o=n[r];vm(o)||Zs(e,o,t[o])}}function vm(e){return e==="__proto__"||e==="constructor"||e==="prototype"}function Ow(e,t){if(typeof t=="function"&&(t=t(e)),t=Ri(t),Array.isArray(t)){if(e===t)return;let n=0,r=t.length;for(;n<r;n++){const o=t[n];e[n]!==o&&Zs(e,n,o)}Zs(e,"length",r)}else ym(e,t)}function mi(e,t,n=[]){let r,o=e;if(t.length>1){r=t.shift();const s=typeof r,a=Array.isArray(e);if(s==="string"&&(r==="__proto__"||t.length>1&&vm(r)))return;if(Array.isArray(r)){for(let u=0;u<r.length;u++)mi(e,[r[u]].concat(t),n);return}else if(a&&s==="function"){for(let u=0;u<e.length;u++)r(e[u],u)&&mi(e,[u].concat(t),n);return}else if(a&&s==="object"){const{from:u=0,to:c=e.length-1,by:l=1}=r;for(let d=u;d<=c;d+=l)mi(e,[d].concat(t),n);return}else if(t.length>1){mi(e[r],t,[r].concat(n));return}o=e[r],n=[r].concat(n)}let i=t[0];typeof i=="function"&&(i=i(o,n),i===o)||r===void 0&&i==null||(i=Ri(i),r===void 0||Ws(o)&&Ws(i)&&!Array.isArray(i)?ym(o,i):Zs(e,r,i))}function Nw(...[e,t]){const n=Ri(e||{}),r=Array.isArray(n),o=mm(n);function i(...s){kl(()=>{r&&s.length===1?Ow(n,s[0]):mi(n,s)})}return[o,i]}const qe=e=>typeof e=="string",ui=()=>{let e,t;const n=new Promise((r,o)=>{e=r,t=o});return n.resolve=e,n.reject=t,n},Zd=e=>e==null?"":String(e),Mw=(e,t,n)=>{e.forEach(r=>{t[r]&&(n[r]=t[r])})},Pw=/###/g,Xd=e=>e&&e.includes("###")?e.replace(Pw,"."):e,Jd=e=>!e||qe(e),xi=(e,t,n)=>{const r=qe(t)?t.split("."):t;let o=0;for(;o<r.length-1;){if(Jd(e))return{};const i=Xd(r[o]);!e[i]&&n&&(e[i]=new n),Object.prototype.hasOwnProperty.call(e,i)?e=e[i]:e={},++o}return Jd(e)?{}:{obj:e,k:Xd(r[o])}},Qd=(e,t,n)=>{const{obj:r,k:o}=xi(e,t,Object);if(r!==void 0||t.length===1){r[o]=n;return}let i=t[t.length-1],s=t.slice(0,t.length-1),a=xi(e,s,Object);for(;a.obj===void 0&&s.length;)i=`${s[s.length-1]}.${i}`,s=s.slice(0,s.length-1),a=xi(e,s,Object),a?.obj&&typeof a.obj[`${a.k}.${i}`]<"u"&&(a.obj=void 0);a.obj[`${a.k}.${i}`]=n},Lw=(e,t,n,r)=>{const{obj:o,k:i}=xi(e,t,Object);o[i]=o[i]||[],o[i].push(n)},Xs=(e,t)=>{const{obj:n,k:r}=xi(e,t);if(n&&Object.prototype.hasOwnProperty.call(n,r))return n[r]},$w=(e,t,n)=>{const r=Xs(e,n);return r!==void 0?r:Xs(t,n)},wm=(e,t,n)=>{for(const r in t)r!=="__proto__"&&r!=="constructor"&&(Object.prototype.hasOwnProperty.call(e,r)?qe(e[r])||e[r]instanceof String||qe(t[r])||t[r]instanceof String?n&&(e[r]=t[r]):wm(e[r],t[r],n):e[r]=t[r]);return e},mr=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),Fw={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"},Bw=e=>qe(e)?e.replace(/[&<>"'\/]/g,t=>Fw[t]):e;class zw{constructor(t){this.capacity=t,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(t){const n=this.regExpMap.get(t);if(n!==void 0)return n;const r=new RegExp(t);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(t,r),this.regExpQueue.push(t),r}}const Uw=[" ",",","?","!",";"],Kw=new zw(20),jw=(e,t,n)=>{t=t||"",n=n||"";const r=Uw.filter(s=>!t.includes(s)&&!n.includes(s));if(r.length===0)return!0;const o=Kw.getRegExp(`(${r.map(s=>s==="?"?"\\?":s).join("|")})`);let i=!o.test(e);if(!i){const s=e.indexOf(n);s>0&&!o.test(e.substring(0,s))&&(i=!0)}return i},el=(e,t,n=".")=>{if(!e)return;if(e[t])return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0;const r=t.split(n);let o=e;for(let i=0;i<r.length;){if(!o||typeof o!="object")return;let s,a="";for(let u=i;u<r.length;++u)if(u!==i&&(a+=n),a+=r[u],s=o[a],s!==void 0){if(["string","number","boolean"].includes(typeof s)&&u<r.length-1)continue;i+=u-i+1;break}o=s}return o},Ni=e=>e?.replace(/_/g,"-"),qw={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){console?.[e]?.apply?.(console,t)}};class Js{constructor(t,n={}){this.init(t,n)}init(t,n={}){this.prefix=n.prefix||"i18next:",this.logger=t||qw,this.options=n,this.debug=n.debug}log(...t){return this.forward(t,"log","",!0)}warn(...t){return this.forward(t,"warn","",!0)}error(...t){return this.forward(t,"error","")}deprecate(...t){return this.forward(t,"warn","WARNING DEPRECATED: ",!0)}forward(t,n,r,o){return o&&!this.debug?null:(t=t.map(i=>qe(i)?i.replace(/[\r\n\x00-\x1F\x7F]/g," "):i),qe(t[0])&&(t[0]=`${r}${this.prefix} ${t[0]}`),this.logger[n](t))}create(t){return new Js(this.logger,{prefix:`${this.prefix}:${t}:`,...this.options})}clone(t){return t=t||this.options,t.prefix=t.prefix||this.prefix,new Js(this.logger,t)}}var Zn=new Js;class wa{constructor(){this.observers={}}on(t,n){return t.split(" ").forEach(r=>{this.observers[r]||(this.observers[r]=new Map);const o=this.observers[r].get(n)||0;this.observers[r].set(n,o+1)}),this}off(t,n){if(this.observers[t]){if(!n){delete this.observers[t];return}this.observers[t].delete(n)}}once(t,n){const r=(...o)=>{n(...o),this.off(t,r)};return this.on(t,r),this}emit(t,...n){this.observers[t]&&Array.from(this.observers[t].entries()).forEach(([o,i])=>{for(let s=0;s<i;s++)o(...n)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(([o,i])=>{for(let s=0;s<i;s++)o(t,...n)})}}class ef extends wa{constructor(t,n={ns:["translation"],defaultNS:"translation"}){super(),this.data=t||{},this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(t){this.options.ns.includes(t)||this.options.ns.push(t)}removeNamespaces(t){const n=this.options.ns.indexOf(t);n>-1&&this.options.ns.splice(n,1)}getResource(t,n,r,o={}){const i=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator,s=o.ignoreJSONStructure!==void 0?o.ignoreJSONStructure:this.options.ignoreJSONStructure;let a;t.includes(".")?a=t.split("."):(a=[t,n],r&&(Array.isArray(r)?a.push(...r):qe(r)&&i?a.push(...r.split(i)):a.push(r)));const u=Xs(this.data,a);return!u&&!n&&!r&&t.includes(".")&&(t=a[0],n=a[1],r=a.slice(2).join(".")),u||!s||!qe(r)?u:el(this.data?.[t]?.[n],r,i)}addResource(t,n,r,o,i={silent:!1}){const s=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator;let a=[t,n];r&&(a=a.concat(s?r.split(s):r)),t.includes(".")&&(a=t.split("."),o=n,n=a[1]),this.addNamespaces(n),Qd(this.data,a,o),i.silent||this.emit("added",t,n,r,o)}addResources(t,n,r,o={silent:!1}){for(const i in r)(qe(r[i])||Array.isArray(r[i]))&&this.addResource(t,n,i,r[i],{silent:!0});o.silent||this.emit("added",t,n,r)}addResourceBundle(t,n,r,o,i,s={silent:!1,skipCopy:!1}){let a=[t,n];t.includes(".")&&(a=t.split("."),o=r,r=n,n=a[1]),this.addNamespaces(n);let u=Xs(this.data,a)||{};s.skipCopy||(r=JSON.parse(JSON.stringify(r))),o?wm(u,r,i):u={...u,...r},Qd(this.data,a,u),s.silent||this.emit("added",t,n,r)}removeResourceBundle(t,n){this.hasResourceBundle(t,n)&&delete this.data[t][n],this.removeNamespaces(n),this.emit("removed",t,n)}hasResourceBundle(t,n){return this.getResource(t,n)!==void 0}getResourceBundle(t,n){return n||(n=this.options.defaultNS),this.getResource(t,n)}getDataByLanguage(t){return this.data[t]}hasLanguageSomeTranslations(t){const n=this.getDataByLanguage(t);return!!(n&&Object.keys(n)||[]).find(o=>n[o]&&Object.keys(n[o]).length>0)}toJSON(){return this.data}}var xm={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,r,o){return e.forEach(i=>{t=this.processors[i]?.process(t,n,r,o)??t}),t}};const _m=Symbol("i18next/PATH_KEY");function Hw(){const e=[],t=Object.create(null);let n;return t.get=(r,o)=>(n?.revoke?.(),o===_m?e:(e.push(o),n=Proxy.revocable(r,t),n.proxy)),Proxy.revocable(Object.create(null),t).proxy}function Ko(e,t){const{[_m]:n}=e(Hw()),r=t?.keySeparator??".",o=t?.nsSeparator??":",i=t?.enableSelector==="strict";if(n.length>1&&o){const s=t?.ns,a=i?Array.isArray(s)?s:s?[s]:null:Array.isArray(s)?s:null;if(a&&(i?a:a.length>1?a.slice(1):[]).includes(n[0]))return`${n[0]}${o}${n.slice(1).join(r)}`}return n.join(r)}const su=e=>!qe(e)&&typeof e!="boolean"&&typeof e!="number";class Qs extends wa{constructor(t,n={}){super(),Mw(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],t,this),this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=Zn.create("translator"),this.checkedLoadedFor={}}changeLanguage(t){t&&(this.language=t)}exists(t,n={interpolation:{}}){const r={...n};if(t==null)return!1;const o=this.resolve(t,r);if(o?.res===void 0)return!1;const i=su(o.res);return!(r.returnObjects===!1&&i)}extractFromKey(t,n){let r=n.nsSeparator!==void 0?n.nsSeparator:this.options.nsSeparator;r===void 0&&(r=":");const o=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator;let i=n.ns||this.options.defaultNS||[];const s=r&&t.includes(r),a=!this.options.userDefinedKeySeparator&&!n.keySeparator&&!this.options.userDefinedNsSeparator&&!n.nsSeparator&&!jw(t,r,o);if(s&&!a){const u=t.match(this.interpolator.nestingRegexp);if(u&&u.length>0)return{key:t,namespaces:qe(i)?[i]:i};const c=t.split(r);(r!==o||r===o&&this.options.ns.includes(c[0]))&&(i=c.shift()),t=c.join(o)}return{key:t,namespaces:qe(i)?[i]:i}}translate(t,n,r){let o=typeof n=="object"?{...n}:n;if(typeof o!="object"&&this.options.overloadTranslationOptionHandler&&(o=this.options.overloadTranslationOptionHandler(arguments)),typeof o=="object"&&(o={...o}),o||(o={}),t==null)return"";typeof t=="function"&&(t=Ko(t,{...this.options,...o})),Array.isArray(t)||(t=[String(t)]),t=t.map(L=>typeof L=="function"?Ko(L,{...this.options,...o}):String(L));const i=o.returnDetails!==void 0?o.returnDetails:this.options.returnDetails,s=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator,{key:a,namespaces:u}=this.extractFromKey(t[t.length-1],o),c=u[u.length-1];let l=o.nsSeparator!==void 0?o.nsSeparator:this.options.nsSeparator;l===void 0&&(l=":");const d=o.lng||this.language,g=o.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(d?.toLowerCase()==="cimode")return g?i?{res:`${c}${l}${a}`,usedKey:a,exactUsedKey:a,usedLng:d,usedNS:c,usedParams:this.getUsedParamsDetails(o)}:`${c}${l}${a}`:i?{res:a,usedKey:a,exactUsedKey:a,usedLng:d,usedNS:c,usedParams:this.getUsedParamsDetails(o)}:a;const p=this.resolve(t,o);let h=p?.res;const m=p?.usedKey||a,y=p?.exactUsedKey||a,v=["[object Number]","[object Function]","[object RegExp]"],b=o.joinArrays!==void 0?o.joinArrays:this.options.joinArrays,w=!this.i18nFormat||this.i18nFormat.handleAsObject,E=o.count!==void 0&&!qe(o.count),C=Qs.hasDefaultValue(o),k=E?this.pluralResolver.getSuffix(d,o.count,o):"",T=o.ordinal&&E?this.pluralResolver.getSuffix(d,o.count,{ordinal:!1}):"",S=E&&!o.ordinal&&o.count===0,A=S&&o[`defaultValue${this.options.pluralSeparator}zero`]||o[`defaultValue${k}`]||o[`defaultValue${T}`]||o.defaultValue;let F=h;w&&!h&&C&&(F=A);const O=su(F),P=Object.prototype.toString.apply(F);if(w&&F&&O&&!v.includes(P)&&!(qe(b)&&Array.isArray(F))){if(!o.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const L=this.options.returnedObjectHandler?this.options.returnedObjectHandler(m,F,{...o,ns:u}):`key '${a} (${this.language})' returned an object instead of string.`;return i?(p.res=L,p.usedParams=this.getUsedParamsDetails(o),p):L}if(s){const L=Array.isArray(F),D=L?[]:{},B=L?y:m;for(const N in F)if(Object.prototype.hasOwnProperty.call(F,N)){const Y=`${B}${s}${N}`;C&&!h?D[N]=this.translate(Y,{...o,defaultValue:su(A)?A[N]:void 0,joinArrays:!1,ns:u}):D[N]=this.translate(Y,{...o,joinArrays:!1,ns:u}),D[N]===Y&&(D[N]=F[N])}h=D}}else if(w&&qe(b)&&Array.isArray(h))h=h.join(b),h&&(h=this.extendTranslation(h,t,o,r));else{let L=!1,D=!1;!this.isValidLookup(h)&&C&&(L=!0,h=A),this.isValidLookup(h)||(D=!0,h=a);const N=(o.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&D?void 0:h,Y=C&&A!==h&&this.options.updateMissing;if(D||L||Y){if(this.logger.log(Y?"updateKey":"missingKey",d,c,E&&!Y?`${a}${this.pluralResolver.getSuffix(d,o.count,o)}`:a,Y?A:h),s){const he=this.resolve(a,{...o,keySeparator:!1});he&&he.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let ce=[];const V=this.languageUtils.getFallbackCodes(this.options.fallbackLng,o.lng||this.language);if(this.options.saveMissingTo==="fallback"&&V&&V[0])for(let he=0;he<V.length;he++)ce.push(V[he]);else this.options.saveMissingTo==="all"?ce=this.languageUtils.toResolveHierarchy(o.lng||this.language):ce.push(o.lng||this.language);const j=(he,K,z)=>{const J=C&&z!==h?z:N;this.options.missingKeyHandler?this.options.missingKeyHandler(he,c,K,J,Y,o):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(he,c,K,J,Y,o),this.emit("missingKey",he,c,K,h)};this.options.saveMissing&&(this.options.saveMissingPlurals&&E?ce.forEach(he=>{const K=this.pluralResolver.getSuffixes(he,o);S&&o[`defaultValue${this.options.pluralSeparator}zero`]&&!K.includes(`${this.options.pluralSeparator}zero`)&&K.push(`${this.options.pluralSeparator}zero`),K.forEach(z=>{j([he],a+z,o[`defaultValue${z}`]||A)})}):j(ce,a,A))}h=this.extendTranslation(h,t,o,p,r),D&&h===a&&this.options.appendNamespaceToMissingKey&&(h=`${c}${l}${a}`),(D||L)&&this.options.parseMissingKeyHandler&&(h=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${c}${l}${a}`:a,L?h:void 0,o))}return i?(p.res=h,p.usedParams=this.getUsedParamsDetails(o),p):h}extendTranslation(t,n,r,o,i){if(this.i18nFormat?.parse)t=this.i18nFormat.parse(t,{...this.options.interpolation.defaultVariables,...r},r.lng||this.language||o.usedLng,o.usedNS,o.usedKey,{resolved:o});else if(!r.skipInterpolation){r.interpolation&&this.interpolator.init({...r,interpolation:{...this.options.interpolation,...r.interpolation}});const u=qe(t)&&(r?.interpolation?.skipOnVariables!==void 0?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let c;if(u){const d=t.match(this.interpolator.nestingRegexp);c=d&&d.length}let l=r.replace&&!qe(r.replace)?r.replace:r;if(this.options.interpolation.defaultVariables&&(l={...this.options.interpolation.defaultVariables,...l}),t=this.interpolator.interpolate(t,l,r.lng||this.language||o.usedLng,r),u){const d=t.match(this.interpolator.nestingRegexp),g=d&&d.length;c<g&&(r.nest=!1)}!r.lng&&o&&o.res&&(r.lng=this.language||o.usedLng),r.nest!==!1&&(t=this.interpolator.nest(t,(...d)=>i?.[0]===d[0]&&!r.context?(this.logger.warn(`It seems you are nesting recursively key: ${d[0]} in key: ${n[0]}`),null):this.translate(...d,n),r)),r.interpolation&&this.interpolator.reset()}const s=r.postProcess||this.options.postProcess,a=qe(s)?[s]:s;return t!=null&&a?.length&&r.applyPostProcessor!==!1&&(t=xm.handle(a,t,n,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...o,usedParams:this.getUsedParamsDetails(r)},...r}:r,this)),t}resolve(t,n={}){let r,o,i,s,a;return qe(t)&&(t=[t]),Array.isArray(t)&&(t=t.map(u=>typeof u=="function"?Ko(u,{...this.options,...n}):u)),t.forEach(u=>{if(this.isValidLookup(r))return;const c=this.extractFromKey(u,n),l=c.key;o=l;let d=c.namespaces;this.options.fallbackNS&&(d=d.concat(this.options.fallbackNS));const g=n.count!==void 0&&!qe(n.count),p=g&&!n.ordinal&&n.count===0,h=n.context!==void 0&&(qe(n.context)||typeof n.context=="number")&&n.context!=="",m=n.lngs?n.lngs:this.languageUtils.toResolveHierarchy(n.lng||this.language,n.fallbackLng);d.forEach(y=>{this.isValidLookup(r)||(a=y,!this.checkedLoadedFor[`${m[0]}-${y}`]&&this.utils?.hasLoadedNamespace&&!this.utils?.hasLoadedNamespace(a)&&(this.checkedLoadedFor[`${m[0]}-${y}`]=!0,this.logger.warn(`key "${o}" for languages "${m.join(", ")}" won't get resolved as namespace "${a}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),m.forEach(v=>{if(this.isValidLookup(r))return;s=v;const b=[l];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(b,l,v,y,n);else{let E;g&&(E=this.pluralResolver.getSuffix(v,n.count,n));const C=`${this.options.pluralSeparator}zero`,k=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(g&&(n.ordinal&&E.startsWith(k)&&b.push(l+E.replace(k,this.options.pluralSeparator)),b.push(l+E),p&&b.push(l+C)),h){const T=`${l}${this.options.contextSeparator||"_"}${n.context}`;b.push(T),g&&(n.ordinal&&E.startsWith(k)&&b.push(T+E.replace(k,this.options.pluralSeparator)),b.push(T+E),p&&b.push(T+C))}}let w;for(;w=b.pop();)this.isValidLookup(r)||(i=w,r=this.getResource(v,y,w,n))}))})}),{res:r,usedKey:o,exactUsedKey:i,usedLng:s,usedNS:a}}isValidLookup(t){return t!==void 0&&!(!this.options.returnNull&&t===null)&&!(!this.options.returnEmptyString&&t==="")}getResource(t,n,r,o={}){return this.i18nFormat?.getResource?this.i18nFormat.getResource(t,n,r,o):this.resourceStore.getResource(t,n,r,o)}getUsedParamsDetails(t={}){const n=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],r=t.replace&&!qe(t.replace);let o=r?t.replace:t;if(r&&typeof t.count<"u"&&(o={...o,count:t.count}),this.options.interpolation.defaultVariables&&(o={...this.options.interpolation.defaultVariables,...o}),!r){o={...o};for(const i of n)delete o[i]}return o}static hasDefaultValue(t){const n="defaultValue";for(const r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&r.startsWith(n)&&t[r]!==void 0)return!0;return!1}}class tf{constructor(t){this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=Zn.create("languageUtils")}getScriptPartFromCode(t){if(t=Ni(t),!t||!t.includes("-"))return null;const n=t.split("-");return n.length===2||(n.pop(),n[n.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(n.join("-"))}getLanguagePartFromCode(t){if(t=Ni(t),!t||!t.includes("-"))return t;const n=t.split("-");return this.formatLanguageCode(n[0])}formatLanguageCode(t){if(qe(t)&&t.includes("-")){let n;try{n=Intl.getCanonicalLocales(t)[0]}catch{}return n&&this.options.lowerCaseLng&&(n=n.toLowerCase()),n||(this.options.lowerCaseLng?t.toLowerCase():t)}return this.options.cleanCode||this.options.lowerCaseLng?t.toLowerCase():t}isSupportedCode(t){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(t=this.getLanguagePartFromCode(t)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.includes(t)}getBestMatchFromCodes(t){if(!t)return null;let n;return t.forEach(r=>{if(n)return;const o=this.formatLanguageCode(r);(!this.options.supportedLngs||this.isSupportedCode(o))&&(n=o)}),!n&&this.options.supportedLngs&&t.forEach(r=>{if(n)return;const o=this.getScriptPartFromCode(r);if(this.isSupportedCode(o))return n=o;const i=this.getLanguagePartFromCode(r);if(this.isSupportedCode(i))return n=i;n=this.options.supportedLngs.find(s=>s===i?!0:!s.includes("-")&&!i.includes("-")?!1:!!(s.includes("-")&&!i.includes("-")&&s.slice(0,s.indexOf("-"))===i||s.startsWith(i)&&i.length>1))}),n||(n=this.getFallbackCodes(this.options.fallbackLng)[0]),n}getFallbackCodes(t,n){if(!t)return[];if(typeof t=="function"&&(t=t(n)),qe(t)&&(t=[t]),Array.isArray(t))return t;if(!n)return t.default||[];let r=t[n];return r||(r=t[this.getScriptPartFromCode(n)]),r||(r=t[this.formatLanguageCode(n)]),r||(r=t[this.getLanguagePartFromCode(n)]),r||(r=t.default),r||[]}toResolveHierarchy(t,n){const r=this.getFallbackCodes((n===!1?[]:n)||this.options.fallbackLng||[],t),o=[],i=s=>{s&&(this.isSupportedCode(s)?o.push(s):this.logger.warn(`rejecting language code not found in supportedLngs: ${s}`))};return qe(t)&&(t.includes("-")||t.includes("_"))?(this.options.load!=="languageOnly"&&i(this.formatLanguageCode(t)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&i(this.getScriptPartFromCode(t)),this.options.load!=="currentOnly"&&i(this.getLanguagePartFromCode(t))):qe(t)&&i(this.formatLanguageCode(t)),r.forEach(s=>{o.includes(s)||i(this.formatLanguageCode(s))}),o}}const nf={zero:0,one:1,two:2,few:3,many:4,other:5},rf={select:e=>e===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class Gw{constructor(t,n={}){this.languageUtils=t,this.options=n,this.logger=Zn.create("pluralResolver"),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(t,n={}){const r=Ni(t==="dev"?"en":t),o=n.ordinal?"ordinal":"cardinal",i=JSON.stringify({cleanedCode:r,type:o});if(i in this.pluralRulesCache)return this.pluralRulesCache[i];let s;try{s=new Intl.PluralRules(r,{type:o})}catch{if(typeof Intl>"u")return this.logger.error("No Intl support, please use an Intl polyfill!"),rf;if(!t.match(/-|_/))return rf;const u=this.languageUtils.getLanguagePartFromCode(t);s=this.getRule(u,n)}return this.pluralRulesCache[i]=s,s}needsPlural(t,n={}){let r=this.getRule(t,n);return r||(r=this.getRule("dev",n)),r?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(t,n,r={}){return this.getSuffixes(t,r).map(o=>`${n}${o}`)}getSuffixes(t,n={}){let r=this.getRule(t,n);return r||(r=this.getRule("dev",n)),r?r.resolvedOptions().pluralCategories.sort((o,i)=>nf[o]-nf[i]).map(o=>`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${o}`):[]}getSuffix(t,n,r={}){const o=this.getRule(t,r);return o?`${this.options.prepend}${r.ordinal?`ordinal${this.options.prepend}`:""}${o.select(n)}`:(this.logger.warn(`no plural rule found for: ${t}`),this.getSuffix("dev",n,r))}}const of=(e,t,n,r=".",o=!0)=>{let i=$w(e,t,n);return!i&&o&&qe(n)&&(i=el(e,n,r),i===void 0&&(i=el(t,n,r))),i},Vw=e=>e.replace(/\$/g,"$$$$");class sf{constructor(t={}){this.logger=Zn.create("interpolator"),this.options=t,this.format=t?.interpolation?.format||(n=>n),this.init(t)}init(t={}){t.interpolation||(t.interpolation={escapeValue:!0});const{escape:n,escapeValue:r,useRawValueToEscape:o,prefix:i,prefixEscaped:s,suffix:a,suffixEscaped:u,formatSeparator:c,unescapeSuffix:l,unescapePrefix:d,nestingPrefix:g,nestingPrefixEscaped:p,nestingSuffix:h,nestingSuffixEscaped:m,nestingOptionsSeparator:y,maxReplaces:v,alwaysFormat:b}=t.interpolation;this.escape=n!==void 0?n:Bw,this.escapeValue=r!==void 0?r:!0,this.useRawValueToEscape=o!==void 0?o:!1,this.prefix=i?mr(i):s||"{{",this.suffix=a?mr(a):u||"}}",this.formatSeparator=c||",",this.unescapePrefix=l?"":d?mr(d):"-",this.unescapeSuffix=this.unescapePrefix?"":l?mr(l):"",this.nestingPrefix=g?mr(g):p||mr("$t("),this.nestingSuffix=h?mr(h):m||mr(")"),this.nestingOptionsSeparator=y||",",this.maxReplaces=v||1e3,this.alwaysFormat=b!==void 0?b:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const t=(n,r)=>n?.source===r?(n.lastIndex=0,n):new RegExp(r,"g");this.regexp=t(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=t(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=t(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(t,n,r,o){let i,s,a;const u=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},c=p=>{if(!p.includes(this.formatSeparator)){const v=of(n,u,p,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(v,void 0,r,{...o,...n,interpolationkey:p}):v}const h=p.split(this.formatSeparator),m=h.shift().trim(),y=h.join(this.formatSeparator).trim();return this.format(of(n,u,m,this.options.keySeparator,this.options.ignoreJSONStructure),y,r,{...o,...n,interpolationkey:m})};this.resetRegExp(),!this.escapeValue&&typeof t=="string"&&/\$t\([^)]*\{[^}]*\{\{/.test(t)&&this.logger.warn("nesting options string contains interpolated variables with escapeValue: false — if any of those values are attacker-controlled they can inject additional nesting options (e.g. redirect lng/ns). Sanitise untrusted input before passing it to t(), or keep escapeValue: true.");const l=o?.missingInterpolationHandler||this.options.missingInterpolationHandler,d=o?.interpolation?.skipOnVariables!==void 0?o.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:p=>p},{regex:this.regexp,safeValue:p=>this.escapeValue?this.escape(p):p}].forEach(p=>{for(a=0;i=p.regex.exec(t);){const h=i[1].trim();if(s=c(h),s===void 0)if(typeof l=="function"){const y=l(t,i,o);s=qe(y)?y:""}else if(o&&Object.prototype.hasOwnProperty.call(o,h))s="";else if(d){s=i[0];continue}else this.logger.warn(`missed to pass in variable ${h} for interpolating ${t}`),s="";else!qe(s)&&!this.useRawValueToEscape&&(s=Zd(s));const m=p.safeValue(s);if(t=t.replace(i[0],Vw(m)),d?(p.regex.lastIndex+=m.length,p.regex.lastIndex-=i[0].length):p.regex.lastIndex=0,a++,a>=this.maxReplaces)break}}),t}nest(t,n,r={}){let o,i,s;const a=(u,c)=>{const l=this.nestingOptionsSeparator;if(!u.includes(l))return u;const d=u.split(new RegExp(`${mr(l)}[ ]*{`));let g=`{${d[1]}`;u=d[0],g=this.interpolate(g,s);const p=g.match(/'/g),h=g.match(/"/g);((p?.length??0)%2===0&&!h||(h?.length??0)%2!==0)&&(g=g.replace(/'/g,'"'));try{s=JSON.parse(g),c&&(s={...c,...s})}catch(m){return this.logger.warn(`failed parsing options string in nesting for key ${u}`,m),`${u}${l}${g}`}return s.defaultValue&&s.defaultValue.includes(this.prefix)&&delete s.defaultValue,u};for(;o=this.nestingRegexp.exec(t);){let u=[];s={...r},s=s.replace&&!qe(s.replace)?s.replace:s,s.applyPostProcessor=!1,delete s.defaultValue;const c=/{.*}/s.test(o[1])?o[1].lastIndexOf("}")+1:o[1].indexOf(this.formatSeparator);if(c!==-1&&(u=o[1].slice(c).split(this.formatSeparator).map(l=>l.trim()).filter(Boolean),o[1]=o[1].slice(0,c)),i=n(a.call(this,o[1].trim(),s),s),i&&o[0]===t&&!qe(i))return i;qe(i)||(i=Zd(i)),i||(this.logger.warn(`missed to resolve ${o[1]} for nesting ${t}`),i=""),u.length&&(i=u.reduce((l,d)=>this.format(l,d,r.lng,{...r,interpolationkey:o[1].trim()}),i.trim())),t=t.replace(o[0],i),this.regexp.lastIndex=0}return t}}const Ww=e=>{let t=e.toLowerCase().trim();const n={};if(e.includes("(")){const r=e.split("(");t=r[0].toLowerCase().trim();const o=r[1].slice(0,-1);t==="currency"&&!o.includes(":")?n.currency||(n.currency=o.trim()):t==="relativetime"&&!o.includes(":")?n.range||(n.range=o.trim()):o.split(";").forEach(s=>{if(s){const[a,...u]=s.split(":"),c=u.join(":").trim().replace(/^'+|'+$/g,""),l=a.trim();n[l]||(n[l]=c),c==="false"&&(n[l]=!1),c==="true"&&(n[l]=!0),isNaN(c)||(n[l]=parseInt(c,10))}})}return{formatName:t,formatOptions:n}},af=e=>{const t={};return(n,r,o)=>{let i=o;o&&o.interpolationkey&&o.formatParams&&o.formatParams[o.interpolationkey]&&o[o.interpolationkey]&&(i={...i,[o.interpolationkey]:void 0});const s=r+JSON.stringify(i);let a=t[s];return a||(a=e(Ni(r),o),t[s]=a),a(n)}},Yw=e=>(t,n,r)=>e(Ni(n),r)(t);class Zw{constructor(t={}){this.logger=Zn.create("formatter"),this.options=t,this.init(t)}init(t,n={interpolation:{}}){this.formatSeparator=n.interpolation.formatSeparator||",";const r=n.cacheInBuiltFormats?af:Yw;this.formats={number:r((o,i)=>{const s=new Intl.NumberFormat(o,{...i});return a=>s.format(a)}),currency:r((o,i)=>{const s=new Intl.NumberFormat(o,{...i,style:"currency"});return a=>s.format(a)}),datetime:r((o,i)=>{const s=new Intl.DateTimeFormat(o,{...i});return a=>s.format(a)}),relativetime:r((o,i)=>{const s=new Intl.RelativeTimeFormat(o,{...i});return a=>s.format(a,i.range||"day")}),list:r((o,i)=>{const s=new Intl.ListFormat(o,{...i});return a=>s.format(a)})}}add(t,n){this.formats[t.toLowerCase().trim()]=n}addCached(t,n){this.formats[t.toLowerCase().trim()]=af(n)}format(t,n,r,o={}){if(!n||t==null)return t;const i=n.split(this.formatSeparator),s=[];for(let u=0;u<i.length;u++){let c=i[u];for(;c.indexOf("(")>-1&&!c.includes(")")&&u+1<i.length;)c=`${c}${this.formatSeparator}${i[++u]}`;s.push(c)}return s.reduce((u,c)=>{const{formatName:l,formatOptions:d}=Ww(c);if(this.formats[l]){let g=u;try{const p=o?.formatParams?.[o.interpolationkey]||{},h=p.locale||p.lng||o.locale||o.lng||r;g=this.formats[l](u,h,{...d,...o,...p})}catch(p){this.logger.warn(p)}return g}else this.logger.warn(`there was no format function for ${l}`);return u},t)}}const Xw=(e,t)=>{e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)};class Jw extends wa{constructor(t,n,r,o={}){super(),this.backend=t,this.store=n,this.services=r,this.languageUtils=r.languageUtils,this.options=o,this.logger=Zn.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=o.maxParallelReads||10,this.readingCalls=0,this.maxRetries=o.maxRetries>=0?o.maxRetries:5,this.retryTimeout=o.retryTimeout>=1?o.retryTimeout:350,this.state={},this.queue=[],this.backend?.init?.(r,o.backend,o)}queueLoad(t,n,r,o){const i={},s={},a={},u={};return t.forEach(c=>{let l=!0;n.forEach(d=>{const g=`${c}|${d}`;!r.reload&&this.store.hasResourceBundle(c,d)?this.state[g]=2:this.state[g]<0||(this.state[g]===1?s[g]===void 0&&(s[g]=!0):(this.state[g]=1,l=!1,s[g]===void 0&&(s[g]=!0),i[g]===void 0&&(i[g]=!0),u[d]===void 0&&(u[d]=!0)))}),l||(a[c]=!0)}),(Object.keys(i).length||Object.keys(s).length)&&this.queue.push({pending:s,pendingCount:Object.keys(s).length,loaded:{},errors:[],callback:o}),{toLoad:Object.keys(i),pending:Object.keys(s),toLoadLanguages:Object.keys(a),toLoadNamespaces:Object.keys(u)}}loaded(t,n,r){const o=t.split("|"),i=o[0],s=o[1];n&&this.emit("failedLoading",i,s,n),!n&&r&&this.store.addResourceBundle(i,s,r,void 0,void 0,{skipCopy:!0}),this.state[t]=n?-1:2,n&&r&&(this.state[t]=0);const a={};this.queue.forEach(u=>{Lw(u.loaded,[i],s),Xw(u,t),n&&u.errors.push(n),u.pendingCount===0&&!u.done&&(Object.keys(u.loaded).forEach(c=>{a[c]||(a[c]={});const l=u.loaded[c];l.length&&l.forEach(d=>{a[c][d]===void 0&&(a[c][d]=!0)})}),u.done=!0,u.errors.length?u.callback(u.errors):u.callback())}),this.emit("loaded",a),this.queue=this.queue.filter(u=>!u.done)}read(t,n,r,o=0,i=this.retryTimeout,s){if(!t.length)return s(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:t,ns:n,fcName:r,tried:o,wait:i,callback:s});return}this.readingCalls++;const a=(c,l)=>{if(this.readingCalls--,this.waitingReads.length>0){const d=this.waitingReads.shift();this.read(d.lng,d.ns,d.fcName,d.tried,d.wait,d.callback)}if(c&&l&&o<this.maxRetries){setTimeout(()=>{this.read(t,n,r,o+1,i*2,s)},i);return}s(c,l)},u=this.backend[r].bind(this.backend);if(u.length===2){try{const c=u(t,n);c&&typeof c.then=="function"?c.then(l=>a(null,l)).catch(a):a(null,c)}catch(c){a(c)}return}return u(t,n,a)}prepareLoading(t,n,r={},o){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),o&&o();qe(t)&&(t=this.languageUtils.toResolveHierarchy(t)),qe(n)&&(n=[n]);const i=this.queueLoad(t,n,r,o);if(!i.toLoad.length)return i.pending.length||o(),null;i.toLoad.forEach(s=>{this.loadOne(s)})}load(t,n,r){this.prepareLoading(t,n,{},r)}reload(t,n,r){this.prepareLoading(t,n,{reload:!0},r)}loadOne(t,n=""){const r=t.split("|"),o=r[0],i=r[1];this.read(o,i,"read",void 0,void 0,(s,a)=>{s&&this.logger.warn(`${n}loading namespace ${i} for language ${o} failed`,s),!s&&a&&this.logger.log(`${n}loaded namespace ${i} for language ${o}`,a),this.loaded(t,s,a)})}saveMissing(t,n,r,o,i,s={},a=()=>{}){if(this.services?.utils?.hasLoadedNamespace&&!this.services?.utils?.hasLoadedNamespace(n)){this.logger.warn(`did not save key "${r}" as the namespace "${n}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(r==null||r==="")){if(this.backend?.create){const u={...s,isUpdate:i},c=this.backend.create.bind(this.backend);if(c.length<6)try{let l;c.length===5?l=c(t,n,r,o,u):l=c(t,n,r,o),l&&typeof l.then=="function"?l.then(d=>a(null,d)).catch(a):a(null,l)}catch(l){a(l)}else c(t,n,r,o,a,u)}!t||!t[0]||this.store.addResource(t[0],n,r,o)}}}const au=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",enableSelector:!1,partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:e=>{let t={};if(typeof e[1]=="object"&&(t=e[1]),qe(e[1])&&(t.defaultValue=e[1]),qe(e[2])&&(t.tDescription=e[2]),typeof e[2]=="object"||typeof e[3]=="object"){const n=e[3]||e[2];Object.keys(n).forEach(r=>{t[r]=n[r]})}return t},interpolation:{escapeValue:!0,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),uf=e=>(qe(e.ns)&&(e.ns=[e.ns]),qe(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),qe(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&!e.supportedLngs.includes("cimode")&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e),ws=()=>{},Qw=e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(n=>{typeof e[n]=="function"&&(e[n]=e[n].bind(e))})};class _i extends wa{constructor(t={},n){if(super(),this.options=uf(t),this.services={},this.logger=Zn,this.modules={external:[]},Qw(this),n&&!this.isInitialized&&!t.isClone){if(!this.options.initAsync)return this.init(t,n),this;setTimeout(()=>{this.init(t,n)},0)}}init(t={},n){this.isInitializing=!0,typeof t=="function"&&(n=t,t={}),t.defaultNS==null&&t.ns&&(qe(t.ns)?t.defaultNS=t.ns:t.ns.includes("translation")||(t.defaultNS=t.ns[0]));const r=au();this.options={...r,...this.options,...uf(t)},this.options.interpolation={...r.interpolation,...this.options.interpolation},t.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=t.keySeparator),t.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=t.nsSeparator),typeof this.options.overloadTranslationOptionHandler!="function"&&(this.options.overloadTranslationOptionHandler=r.overloadTranslationOptionHandler);const o=c=>c?typeof c=="function"?new c:c:null;if(!this.options.isClone){this.modules.logger?Zn.init(o(this.modules.logger),this.options):Zn.init(null,this.options);let c;this.modules.formatter?c=this.modules.formatter:c=Zw;const l=new tf(this.options);this.store=new ef(this.options.resources,this.options);const d=this.services;d.logger=Zn,d.resourceStore=this.store,d.languageUtils=l,d.pluralResolver=new Gw(l,{prepend:this.options.pluralSeparator}),c&&(d.formatter=o(c),d.formatter.init&&d.formatter.init(d,this.options),this.options.interpolation.format=d.formatter.format.bind(d.formatter)),d.interpolator=new sf(this.options),d.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},d.backendConnector=new Jw(o(this.modules.backend),d.resourceStore,d,this.options),d.backendConnector.on("*",(g,...p)=>{this.emit(g,...p)}),this.modules.languageDetector&&(d.languageDetector=o(this.modules.languageDetector),d.languageDetector.init&&d.languageDetector.init(d,this.options.detection,this.options)),this.modules.i18nFormat&&(d.i18nFormat=o(this.modules.i18nFormat),d.i18nFormat.init&&d.i18nFormat.init(this)),this.translator=new Qs(this.services,this.options),this.translator.on("*",(g,...p)=>{this.emit(g,...p)}),this.modules.external.forEach(g=>{g.init&&g.init(this)})}if(this.format=this.options.interpolation.format,n||(n=ws),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const c=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);c.length>0&&c[0]!=="dev"&&(this.options.lng=c[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(c=>{this[c]=(...l)=>this.store[c](...l)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(c=>{this[c]=(...l)=>(this.store[c](...l),this)});const a=ui(),u=()=>{const c=(l,d)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),a.resolve(d),n(l,d)};if((this.languages||this.isLanguageChangingTo)&&!this.isInitialized)return c(null,this.t.bind(this));this.changeLanguage(this.options.lng,c)};return this.options.resources||!this.options.initAsync?u():setTimeout(u,0),a}loadResources(t,n=ws){let r=n;const o=qe(t)?t:this.language;if(typeof t=="function"&&(r=t),!this.options.resources||this.options.partialBundledLanguages){if(o?.toLowerCase()==="cimode"&&(!this.options.preload||this.options.preload.length===0))return r();const i=[],s=a=>{if(!a||a==="cimode")return;this.services.languageUtils.toResolveHierarchy(a).forEach(c=>{c!=="cimode"&&(i.includes(c)||i.push(c))})};o?s(o):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(u=>s(u)),this.options.preload?.forEach?.(a=>s(a)),this.services.backendConnector.load(i,this.options.ns,a=>{!a&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),r(a)})}else r(null)}reloadResources(t,n,r){const o=ui();return typeof t=="function"&&(r=t,t=void 0),typeof n=="function"&&(r=n,n=void 0),t||(t=this.languages),n||(n=this.options.ns),r||(r=ws),this.services.backendConnector.reload(t,n,i=>{o.resolve(),r(i)}),o}use(t){if(!t)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!t.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return t.type==="backend"&&(this.modules.backend=t),(t.type==="logger"||t.log&&t.warn&&t.error)&&(this.modules.logger=t),t.type==="languageDetector"&&(this.modules.languageDetector=t),t.type==="i18nFormat"&&(this.modules.i18nFormat=t),t.type==="postProcessor"&&xm.addPostProcessor(t),t.type==="formatter"&&(this.modules.formatter=t),t.type==="3rdParty"&&this.modules.external.push(t),this}setResolvedLanguage(t){if(!(!t||!this.languages)&&!["cimode","dev"].includes(t)){for(let n=0;n<this.languages.length;n++){const r=this.languages[n];if(!["cimode","dev"].includes(r)&&this.store.hasLanguageSomeTranslations(r)){this.resolvedLanguage=r;break}}!this.resolvedLanguage&&!this.languages.includes(t)&&this.store.hasLanguageSomeTranslations(t)&&(this.resolvedLanguage=t,this.languages.unshift(t))}}changeLanguage(t,n){this.isLanguageChangingTo=t;const r=ui();this.emit("languageChanging",t);const o=a=>{this.language=a,this.languages=this.services.languageUtils.toResolveHierarchy(a),this.resolvedLanguage=void 0,this.setResolvedLanguage(a)},i=(a,u)=>{u?this.isLanguageChangingTo===t&&(o(u),this.translator.changeLanguage(u),this.isLanguageChangingTo=void 0,this.emit("languageChanged",u),this.logger.log("languageChanged",u)):this.isLanguageChangingTo=void 0,r.resolve((...c)=>this.t(...c)),n&&n(a,(...c)=>this.t(...c))},s=a=>{!t&&!a&&this.services.languageDetector&&(a=[]);const u=qe(a)?a:a&&a[0],c=this.store.hasLanguageSomeTranslations(u)?u:this.services.languageUtils.getBestMatchFromCodes(qe(a)?[a]:a);c&&(this.language||o(c),this.translator.language||this.translator.changeLanguage(c),this.services.languageDetector?.cacheUserLanguage?.(c)),this.loadResources(c,l=>{i(l,c)})};return!t&&this.services.languageDetector&&!this.services.languageDetector.async?s(this.services.languageDetector.detect()):!t&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(s):this.services.languageDetector.detect(s):s(t),r}getFixedT(t,n,r,o){const i=o?.scopeNs,s=(a,u,...c)=>{let l;typeof u!="object"?l=this.options.overloadTranslationOptionHandler([a,u].concat(c)):l={...u},l.lng=l.lng||s.lng,l.lngs=l.lngs||s.lngs;const d=l.ns!==void 0&&l.ns!==null;l.ns=l.ns||s.ns,l.keyPrefix!==""&&(l.keyPrefix=l.keyPrefix||r||s.keyPrefix);const g={...this.options,...l};Array.isArray(i)&&!d&&(g.ns=i),typeof l.keyPrefix=="function"&&(l.keyPrefix=Ko(l.keyPrefix,g));const p=this.options.keySeparator||".";let h;return l.keyPrefix&&Array.isArray(a)?h=a.map(m=>(typeof m=="function"&&(m=Ko(m,g)),`${l.keyPrefix}${p}${m}`)):(typeof a=="function"&&(a=Ko(a,g)),h=l.keyPrefix?`${l.keyPrefix}${p}${a}`:a),this.t(h,l)};return qe(t)?s.lng=t:s.lngs=t,s.ns=n,s.keyPrefix=r,s}t(...t){return this.translator?.translate(...t)}exists(...t){return this.translator?.exists(...t)}setDefaultNamespace(t){this.options.defaultNS=t}hasLoadedNamespace(t,n={}){if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const r=n.lng||this.resolvedLanguage||this.languages[0],o=this.options?this.options.fallbackLng:!1,i=this.languages[this.languages.length-1];if(r.toLowerCase()==="cimode")return!0;const s=(a,u)=>{const c=this.services.backendConnector.state[`${a}|${u}`];return c===-1||c===0||c===2};if(n.precheck){const a=n.precheck(this,s);if(a!==void 0)return a}return!!(this.hasResourceBundle(r,t)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||s(r,t)&&(!o||s(i,t)))}loadNamespaces(t,n){const r=ui();return this.options.ns?(qe(t)&&(t=[t]),t.forEach(o=>{this.options.ns.includes(o)||this.options.ns.push(o)}),this.loadResources(o=>{r.resolve(),n&&n(o)}),r):(n&&n(),Promise.resolve())}loadLanguages(t,n){const r=ui();qe(t)&&(t=[t]);const o=this.options.preload||[],i=t.filter(s=>!o.includes(s)&&this.services.languageUtils.isSupportedCode(s));return i.length?(this.options.preload=o.concat(i),this.loadResources(s=>{r.resolve(),n&&n(s)}),r):(n&&n(),Promise.resolve())}dir(t){if(t||(t=this.resolvedLanguage||(this.languages?.length>0?this.languages[0]:this.language)),!t)return"rtl";try{const o=new Intl.Locale(t);if(o&&o.getTextInfo){const i=o.getTextInfo();if(i&&i.direction)return i.direction}}catch{}const n=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],r=this.services?.languageUtils||new tf(au());return t.toLowerCase().indexOf("-latn")>1?"ltr":n.includes(r.getLanguagePartFromCode(t))||t.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(t={},n){const r=new _i(t,n);return r.createInstance=_i.createInstance,r}cloneInstance(t={},n=ws){const r=t.forkResourceStore;r&&delete t.forkResourceStore;const o={...this.options,...t,isClone:!0},i=new _i(o);if((t.debug!==void 0||t.prefix!==void 0)&&(i.logger=i.logger.clone(t)),["store","services","language"].forEach(a=>{i[a]=this[a]}),i.services={...this.services},i.services.utils={hasLoadedNamespace:i.hasLoadedNamespace.bind(i)},r){const a=Object.keys(this.store.data).reduce((u,c)=>(u[c]={...this.store.data[c]},u[c]=Object.keys(u[c]).reduce((l,d)=>(l[d]={...u[c][d]},l),u[c]),u),{});i.store=new ef(a,o),i.services.resourceStore=i.store}if(t.interpolation){const u={...au().interpolation,...this.options.interpolation,...t.interpolation},c={...o,interpolation:u};i.services.interpolator=new sf(c)}return i.translator=new Qs(i.services,o),i.translator.on("*",(a,...u)=>{i.emit(a,...u)}),i.init(o,n),i.translator.options=o,i.translator.backendConnector.services.utils={hasLoadedNamespace:i.hasLoadedNamespace.bind(i)},i}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const At=_i.createInstance();At.createInstance;At.dir;At.init;At.loadResources;At.reloadResources;At.use;At.changeLanguage;At.getFixedT;At.t;At.exists;At.setDefaultNamespace;At.hasLoadedNamespace;At.loadNamespaces;At.loadLanguages;const{slice:ex,forEach:tx}=[];function nx(e){return tx.call(ex.call(arguments,1),t=>{if(t)for(const n in t)e[n]===void 0&&(e[n]=t[n])}),e}function rx(e){return typeof e!="string"?!1:[/<\s*script.*?>/i,/<\s*\/\s*script\s*>/i,/<\s*img.*?on\w+\s*=/i,/<\s*\w+\s*on\w+\s*=.*?>/i,/javascript\s*:/i,/vbscript\s*:/i,/expression\s*\(/i,/eval\s*\(/i,/alert\s*\(/i,/document\.cookie/i,/document\.write\s*\(/i,/window\.location/i,/innerHTML/i].some(n=>n.test(e))}const cf=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,ox=function(e,t){const r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{path:"/"},o=encodeURIComponent(t);let i=`${e}=${o}`;if(r.maxAge>0){const s=r.maxAge-0;if(Number.isNaN(s))throw new Error("maxAge should be a Number");i+=`; Max-Age=${Math.floor(s)}`}if(r.domain){if(!cf.test(r.domain))throw new TypeError("option domain is invalid");i+=`; Domain=${r.domain}`}if(r.path){if(!cf.test(r.path))throw new TypeError("option path is invalid");i+=`; Path=${r.path}`}if(r.expires){if(typeof r.expires.toUTCString!="function")throw new TypeError("option expires is invalid");i+=`; Expires=${r.expires.toUTCString()}`}if(r.httpOnly&&(i+="; HttpOnly"),r.secure&&(i+="; Secure"),r.sameSite)switch(typeof r.sameSite=="string"?r.sameSite.toLowerCase():r.sameSite){case!0:i+="; SameSite=Strict";break;case"lax":i+="; SameSite=Lax";break;case"strict":i+="; SameSite=Strict";break;case"none":i+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}return r.partitioned&&(i+="; Partitioned"),i},lf={create(e,t,n,r){let o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};n&&(o.expires=new Date,o.expires.setTime(o.expires.getTime()+n*60*1e3)),r&&(o.domain=r),document.cookie=ox(e,t,o)},read(e){const t=`${e}=`,n=document.cookie.split(";");for(let r=0;r<n.length;r++){let o=n[r];for(;o.charAt(0)===" ";)o=o.substring(1,o.length);if(o.indexOf(t)===0)return o.substring(t.length,o.length)}return null},remove(e,t){this.create(e,"",-1,t)}};var ix={name:"cookie",lookup(e){let{lookupCookie:t}=e;if(t&&typeof document<"u")return lf.read(t)||void 0},cacheUserLanguage(e,t){let{lookupCookie:n,cookieMinutes:r,cookieDomain:o,cookieOptions:i}=t;n&&typeof document<"u"&&lf.create(n,e,r,o,i)}},sx={name:"querystring",lookup(e){let{lookupQuerystring:t}=e,n;if(typeof window<"u"){let{search:r}=window.location;!window.location.search&&window.location.hash?.indexOf("?")>-1&&(r=window.location.hash.substring(window.location.hash.indexOf("?")));const i=r.substring(1).split("&");for(let s=0;s<i.length;s++){const a=i[s].indexOf("=");a>0&&i[s].substring(0,a)===t&&(n=i[s].substring(a+1))}}return n}},ax={name:"hash",lookup(e){let{lookupHash:t,lookupFromHashIndex:n}=e,r;if(typeof window<"u"){const{hash:o}=window.location;if(o&&o.length>2){const i=o.substring(1);if(t){const s=i.split("&");for(let a=0;a<s.length;a++){const u=s[a].indexOf("=");u>0&&s[a].substring(0,u)===t&&(r=s[a].substring(u+1))}}if(r)return r;if(!r&&n>-1){const s=o.match(/\/([a-zA-Z-]*)/g);return Array.isArray(s)?s[typeof n=="number"?n:0]?.replace("/",""):void 0}}}return r}};let To=null;const df=()=>{if(To!==null)return To;try{if(To=typeof window<"u"&&window.localStorage!==null,!To)return!1;const e="i18next.translate.boo";window.localStorage.setItem(e,"foo"),window.localStorage.removeItem(e)}catch{To=!1}return To};var ux={name:"localStorage",lookup(e){let{lookupLocalStorage:t}=e;if(t&&df())return window.localStorage.getItem(t)||void 0},cacheUserLanguage(e,t){let{lookupLocalStorage:n}=t;n&&df()&&window.localStorage.setItem(n,e)}};let Do=null;const ff=()=>{if(Do!==null)return Do;try{if(Do=typeof window<"u"&&window.sessionStorage!==null,!Do)return!1;const e="i18next.translate.boo";window.sessionStorage.setItem(e,"foo"),window.sessionStorage.removeItem(e)}catch{Do=!1}return Do};var cx={name:"sessionStorage",lookup(e){let{lookupSessionStorage:t}=e;if(t&&ff())return window.sessionStorage.getItem(t)||void 0},cacheUserLanguage(e,t){let{lookupSessionStorage:n}=t;n&&ff()&&window.sessionStorage.setItem(n,e)}},lx={name:"navigator",lookup(e){const t=[];if(typeof navigator<"u"){const{languages:n,userLanguage:r,language:o}=navigator;if(n)for(let i=0;i<n.length;i++)t.push(n[i]);r&&t.push(r),o&&t.push(o)}return t.length>0?t:void 0}},dx={name:"htmlTag",lookup(e){let{htmlTag:t}=e,n;const r=t||(typeof document<"u"?document.documentElement:null);return r&&typeof r.getAttribute=="function"&&(n=r.getAttribute("lang")),n}},fx={name:"path",lookup(e){let{lookupFromPathIndex:t}=e;if(typeof window>"u")return;const n=window.location.pathname.match(/\/([a-zA-Z-]*)/g);return Array.isArray(n)?n[typeof t=="number"?t:0]?.replace("/",""):void 0}},gx={name:"subdomain",lookup(e){let{lookupFromSubdomainIndex:t}=e;const n=typeof t=="number"?t+1:1,r=typeof window<"u"&&window.location?.hostname?.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i);if(r)return r[n]}};let Em=!1;try{document.cookie,Em=!0}catch{}const Cm=["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"];Em||Cm.splice(1,1);const px=()=>({order:Cm,lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:e=>e});class Sm{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.type="languageDetector",this.detectors={},this.init(t,n)}init(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{languageUtils:{}},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=t,this.options=nx(n,this.options||{},px()),typeof this.options.convertDetectedLanguage=="string"&&this.options.convertDetectedLanguage.indexOf("15897")>-1&&(this.options.convertDetectedLanguage=o=>o.replace("-","_")),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=r,this.addDetector(ix),this.addDetector(sx),this.addDetector(ux),this.addDetector(cx),this.addDetector(lx),this.addDetector(dx),this.addDetector(fx),this.addDetector(gx),this.addDetector(ax)}addDetector(t){return this.detectors[t.name]=t,this}detect(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.options.order,n=[];return t.forEach(r=>{if(this.detectors[r]){let o=this.detectors[r].lookup(this.options);o&&typeof o=="string"&&(o=[o]),o&&(n=n.concat(o))}}),n=n.filter(r=>r!=null&&!rx(r)).map(r=>this.options.convertDetectedLanguage(r)),this.services&&this.services.languageUtils&&this.services.languageUtils.getBestMatchFromCodes?n:n.length>0?n[0]:null}cacheUserLanguage(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.options.caches;n&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(t)>-1||n.forEach(r=>{this.detectors[r]&&this.detectors[r].cacheUserLanguage(t,this.options)}))}}Sm.type="languageDetector";function hx(e,t={}){const{fallbackLng:n="zh-CN",persistKey:r}=t,o=At.use(Sm).init({resources:e,fallbackLng:n,detection:{order:r?["localStorage","navigator"]:["navigator"],caches:r?["localStorage"]:[],...r?{lookupLocalStorage:r}:{}},interpolation:{escapeValue:!1}}),[i,s]=I(At.language||n),[a,u]=I(At.isInitialized);o.then(()=>{s(At.language||n),u(!0)}),At.on("languageChanged",d=>s(d));const c=(d,g)=>(i(),At.t(d,g));return{i18next:At,initPromise:o,t:c,useTranslation:()=>({t:c,lng:ne(()=>i()),ready:ne(()=>a()),changeLanguage:d=>{At.changeLanguage(d)}})}}const mx={common:{loading:"加载中…",cancel:"取消",delete:"删除",confirmDelete:"确认删除",deleting:"删除中…",submitting:"提交中…",saving:"保存中…",refresh:"刷新",refreshing:"刷新中…",pendingAgent:"(待 Agent 补全)",close:"关闭",remove:"移除",error:"错误",filterOptions:"筛选选项…",noMatchingOptions:"没有匹配的选项"},breadcrumb:{specList:"Spec 列表",newSpec:"新建 spec"},shell:{newSpec:"新建 spec",settingsMenu:"配置",languageSwitch:"切换语言",langZh:"中文",langEn:"English",themeSwitch:"外观",themeModeGroup:"色彩模式",themeSystem:"跟随系统",themeLight:"亮色",themeDark:"暗色",themeNameGroup:"主题",themeTerminal:"终端",themeGraphite:"石墨",themePaper:"纸感",globalConfig:"全局配置",userGuide:"使用指南"},systemNotifications:{title:"系统提示",delete:"删除提示",versionTitle:"发现新版本",versionMessage:"YorZ {{latest}} 已发布,当前版本 {{current}}。",update:"更新",updating:"更新中…",restart:"重启服务",restartTooltip:"重复服务会中断正在运行中的任务,可在 chat 中发送“继续”指令",disconnectedTitle:"服务已断开",disconnectedMessage:"与 YorZ 服务的连接已中断,正在执行的任务可能已停止。请在终端重新执行"},welcome:{title:"欢迎使用 YorZ",description:"YorZ 通过本地目录托管 spec 文档;请先添加一个项目目录,然后即可开始管理它的需求。"},addProject:{trigger:"添加项目",title:"添加项目",help:"帮助",helpTooltip:"也可使用命令 `yorz add <path>` 添加项目",parent:"上级目录",home:"主目录",driveRoot:"此电脑",empty:"该目录下没有子目录",truncated:"子目录过多,仅显示前 1000 项",showHidden:"显示隐藏目录",choose:"选择此目录",loading:"加载中…",newFolder:"新建文件夹",newFolderPlaceholder:"文件夹名称",newFolderConfirm:"创建",invalidName:"名称不能为空,且不能包含路径分隔符",gitInitTitle:"该目录不是 git 仓库",gitInitDesc:"{{path}} 尚未 git init。YorZ 的 git 面板与 worktree 功能依赖 git 仓库。",gitInitConfirm:"执行 git init 并添加",failed:"添加失败:{{message}}"},sidebar:{title:"项目",expand:"展开项目面板",collapse:"折叠项目面板",collapseShort:"折叠",pin:"固定展开项目面板",configure:"配置 {{name}}",projectConfig:"项目配置",removeProject:"移除 {{name}}",deleteProject:"删除项目",deleteDesc:"此操作将从 YorZ 项目列表中移除该项目。",deleteFiles:"同时删除文件目录",uncommittedChanges:"存在未提交 git 的变更",resizeHint:"拖动调整项目面板宽度",projectRunning:"{{name}} 有任务正在运行"},chat:{title:"Chat",expand:"展开 Chat",collapse:"折叠 Chat",newSession:"新建会话",collapseSessions:"折叠会话列表",expandSessions:"展开会话列表",sessionsLabel:"会话({{count}})",sessionsLabelPlain:"会话",sessionTitle:"{{kind}} · {{id}}",sessionTitleRunning:"{{kind}} · {{id}} · 执行中",sessionDivider:"{{kind}} · {{time}}",empty:"选择或新建一个会话开始对话。",draftEmpty:"Untitled 会话 —— 发送消息即开始。",usageLoading:"正在查询当前模型剩余用量…",usageError:"{{kind}} 剩余用量查询失败。",usageAvailableNoDetails:"{{kind}} 已连接,但未返回可展示的剩余用量明细。",usageSummary:"{{kind}} 用量:{{details}}",usageWindow:"{{label}} 剩余约 {{remaining}}%(已用 {{used}}%,重置:{{reset}})",usageWindowUnknown:"{{label}} 剩余用量未知",usageResetUnknown:"未知",usageSeparator:" · ",inputPlaceholder:"输入消息,/ 触发候选指令,@ 引用文件,Enter 发送…",draftPlaceholder:"输入消息,/ 触发候选指令,@ 引用文件,发送后自动创建会话…",noSessionPlaceholder:"请先选择项目",showHistory:"显示历史",sessionListLimit:"会话显示条数",sessionListRows:"会话列表高度",sessionListRows3:"3行",sessionListRows5:"5行",sessionListRows10:"10行",untitledSession:"未命名会话",noRunningSessions:"未提交的会话",abort:"中止",send:"发送",agentContextCollapsed:"Agent 上下文 ×{{count}}",toolCollapsed:"[工具] ×{{count}}",toolTextExpand:"展开全部 {{count}} 字符",toolTextCollapse:"收起",errorMessage:"[错误] {{message}}",copyFilePath:"复制文件路径",filePathCopied:"已复制文件路径",filePathCopyFailed:"复制文件路径失败",slashCommandYorzDebug:"启动 debug 模式,尝试解决疑难问题",slashCommandYorzSpec:"基于上下文启动 spec 驱动开发",addSlashCommandOption:"新增指令",addSlashCommandOptionDescription:"创建一个自定义斜杠指令",addSlashCommandTitle:"新增指令",editSlashCommandTitle:"编辑指令",slashCommandNoMatch:"没有匹配的指令",deleteSlashCommandTitle:"删除指令",deleteSlashCommandConfirm:"确定删除自定义指令 /{{name}}?此操作不可撤销。",slashCommandScopeProject:"当前项目",slashCommandScopeGlobal:"全局",customSlashCommandScope:"保存位置",customSlashCommandScopeProjectHint:"项目指令仅在当前项目可用,同名指令项目优先,保存后不可切换",customSlashCommandScopeGlobalHint:"全局指令在所有项目可用,保存后不可切换",customSlashCommandName:"名称",customSlashCommandNamePlaceholder:"git-commit",customSlashCommandDescription:"说明",customSlashCommandDescriptionPlaceholder:"提交当前会话相关的变更文件",customSlashCommandHiddenPrompt:"隐藏提示词",customSlashCommandHiddenPromptPlaceholder:"使用 git 提交当前会话相关的变更文件",customSlashCommandHiddenPromptHint:"发送时自动附加给 Agent,不会出现在输入框和聊天记录中",customSlashCommandPrefill:"预输入内容",customSlashCommandPrefillPlaceholder:"选择该指令后回填到输入框的内容",customSlashCommandPrefillHint:"选择该指令后回填到输入框,会自动带上 /指令名 前缀,可继续编辑后再发送",customSlashCommandNameRequired:"请输入指令名称",customSlashCommandNameInvalid:"名称只能包含字母、数字、下划线和连字符",customSlashCommandNoDescription:"自定义指令",editCustomSlashCommand:"编辑 {{name}}",deleteCustomSlashCommand:"删除 {{name}}",saveCustomSlashCommand:"保存"},home:{specList:"Spec 列表",mainProject:"主项目:",merging:"合并中…",mergeToMain:"合入主项目",mergeHint:"提交 worktree 改动并合入主项目",mergeDialogTitle:"合并 worktree",mergeDialogDescription:"合入主项目前,请确认本次合并的提交信息。",mergeCommitMessage:"提交信息",runningTasksPreventMerge:"存在进行中的命令或 Agent 任务,请等待任务结束后再合并",mainUnreachable:"主项目不可达",merged:"已合入主项目,正在跳转…",conflictDispatched:"冲突 spec 已自动派给 Agent 处理,列表会在合并完成后自动刷新",noSpecs:"还没有 spec。",createFirst:"新建第一个 spec",moreActions:"更多操作",copySpecPath:"复制路径",confirmDeleteSpec:"确定删除此 spec?",newSpec:"+ 新建 spec"},newSpec:{title:"新建 spec",description:"只需选择类型与录入需求内容;文件名、概要、初始骨架由 Agent 根据需求生成,Agent 创建完文档后会自动进入 plan 阶段。",type:"类型",typeFeat:"feat",typeFeatHint:"新功能",typeRefct:"refct",typeRefctHint:"重构 / 抽取",typeFix:"fix",typeFixHint:"修复缺陷",parallelWorktree:"新开项目并行",parallelWorktreeDesc:"以 git worktree 形式开新分支并行开发,避免与主项目互相干扰;合并将通过列表页『合入主项目』按钮一键完成。",requirement:"需求内容",requirementPlaceholder:"原始诉求、痛点、期望效果、关联文档/模块(可使用 @ 引用)",attachments:"附件",attachmentsHint:"共 {{count}}/{{max}},单文件 ≤ 10 MB;图片支持 Cmd/Ctrl-V 粘贴",importAttachment:"导入附件",createAndStart:"发送",creating:"Spec 创建中…",descTooShort:"请至少输入 5 个字符的需求描述",attachmentLimit:"附件总数不能超过 {{max}} 个",unsupportedType:"不支持的文件类型:{{name}}",unsupportedMime:"不支持的 MIME:{{mime}}",fileTooLarge:"{{name}} 超过 10 MB 限制",attachmentRoomLimit:"只能再添加 {{room}} 个附件(当前 {{current}}/{{max}})",attachmentFailedCount:"有 {{count}} 个附件上传失败,请先移除或重试",attachmentUploading:"附件仍在上传中,请稍候",uploading:"上传中…",uploadFailed:"失败:{{error}}",clickToRename:"点击重命名",agentRunFailed:"Agent 运行失败",creatingSpec:"(新建 spec 中)",deleteAttachment:"删除 {{name}}"},specDetail:{appendTask:"追加任务",agentLogs:"执行日志",review:"Review",debug:"Debug 文档",running:"运行中…",forceStage:"强制设置 spec 状态",notFound:"spec 不存在或已删除",fullscreen:"全屏(临时折叠项目列表与对话面板)",exitFullscreen:"退出全屏(Esc)",copySpecPath:"复制 spec 文件路径",specPathCopied:"已复制 spec 文件路径",appendSavedSpecBusy:"追加任务已保存;该 spec 有正在执行的会话,未自动派发,请在其结束后手动运行。",specPathCopyFailed:"复制 spec 文件路径失败"},mermaid:{maximize:"最大化图表",viewerLabel:"Mermaid 图表查看器",zoomIn:"放大",zoomOut:"缩小",reset:"重置视图",close:"关闭图表查看器"},specDebug:{empty:"暂无 debug.md 记录"},review:{backToSpec:"返回 spec",heading:"Review · {{id}}",commit:"提交",discard:"丢弃",committing:"提交中…",discarding:"丢弃中…",commitPlaceholder:"commit message…({{shortcut}} 提交)",manualSelect:"手动选择",agentSelect:"Agent 智能判定",selectAll:"全选",deselectAll:"全部取消",fileCount:"{{selected}}/{{total}} 个文件",noChanges:"暂无变更文件",selectAtLeastOne:"请至少选择一个文件",discardTitle:"丢弃变更",confirmDiscardAction:"确认丢弃",confirmDiscard:"确定要丢弃选中的变更吗?此操作不可撤销。",confirmDiscardAll:"确定要丢弃当前 spec 相关的所有未提交变更吗?此操作不可撤销。",enterCommitMsg:"请输入 commit message",dispatched:"已派发:"},git:{title:"Git 状态",branchSelect:"切换分支",branchPlaceholder:"选择分支",branchFilterPlaceholder:"过滤 / 新建分支…",noBranches:"没有匹配的分支",createBranch:"创建",creatingBranch:"创建中…",branchCreated:"已创建并切换到 {{branch}}",branchExists:"分支已存在",fetching:"拉取远端中…",fetchFailed:"拉取远端失败",fetched:"远端已更新",mergeBranch:"合并分支",mergeBranchPlaceholder:"选择要合并的分支",mergeFilterPlaceholder:"过滤本地 / 远程分支…",mergeAction:"合并",merging:"合并中…",merged:"已将 {{branch}} 合并到 {{current}}",mergeUpToDate:"{{current}} 已包含 {{branch}},无需合并",mergeSelfHint:"当前分支不能合并到自身",push:"推送",pushing:"推送中…",pushed:"已推送到远端({{branch}})",pull:"拉取",pulling:"拉取中…",pulled:"已拉取最新提交({{branch}})",upToDate:"已是最新,无需拉取",binaryFile:"二进制文件,无法展示差异",diffTruncated:"差异过大,已截断展示",diffEmpty:"该文件暂无可展示的差异",diffLoading:"差异加载中…"},agentLogs:{backToSpec:"← 返回 spec",title:"执行日志 · {{id}}",listTitle:"Agent 执行日志({{count}})",empty:"暂无 Agent 执行日志",truncated:"已截断显示末尾 256KB",emptyLog:"日志为空",success:"成功",notFinished:"未收尾",failed:"失败 ({{code}})"},agentDock:{title:"Agent 任务",panelLabel:"Agent 任务面板",clearFinished:"清理已完成",progressLabel:"进行中 {{running}} / 已完成 {{done}} / 失败 {{failed}}",waitingOutput:"(等待输出…)",creatingNew:"(新建中)",sourceRun:"执行 spec",sourceExplain:"解释",sourceDraft:"新建 spec",statusPending:"等待…",statusStreaming:"运行中",statusDone:"已完成",statusFailed:"失败"},selectionMenu:{annotate:"批注",explain:"解释"},annotate:{title:"批注",placeholder:"写下你对这段文本的批注…",submit:"添加批注",inSection:"中"},questionConfirm:{title:"待确认项",unanswered:"未确认",submitAll:"发送",running:"运行中…",noAnswers:"没有可提交的答复",selectionAnnotation:"选区批注",notePlaceholder:"写下你的答复…",recommended:"(推荐)",freeformLabel:"其他(自由批注)",quoteConnector:"中",confirmPlanLabel:"方案",confirmImpactLabel:"影响",decisionAccept:"确认,按此推进",decisionReject:"否决",intentAlternative:"换方案(原目标下另寻实现)",intentConstraint:"补约束(我来补充你漏掉的信息)",intentDropGoal:"弃目标(影响太大,不做)",dropGoalCurrent:"废弃当前目标,继续其余",dropGoalSpec:"放弃整个 spec",reasonPlaceholder:"请说明否决理由或约束(必填)…",reasonRequired:"否决时必须填写理由"},appendTask:{title:"追加任务",hint:"提交后将自动重开 plan 阶段,Agent 会续跑处理新增项",type:"类型",kindFeat:"feat 新增/扩展需求",kindRefct:"refct 重构/重写/抽取",kindFix:"fix 修复缺陷",description:"描述",descPlaceholder:"详细描述新增需求 / 重构意图 / 缺陷复现…",descRequired:"描述不能为空",submit:"发送",refSection:"引用章节:"},projectConfig:{title:"项目配置",inheritGlobal:"继承全局默认",agentClaude:"ClaudeCode",agentOpencode:"OpenCode",agentCodex:"Codex",agentPi:"Pi",agent:"Agent",model:"模型",reasoningEffort:"推理强度",agentDefaultOption:"--",specsDir:"spec 文档目录",specsDirHint:"相对项目根路径,不存在时会自动创建",invalidPath:'spec 目录不能包含 ".." 段',saved:"配置已保存",oldSpecsHint:"旧 spec 仍在原目录,请手工迁移",save:"保存"},globalConfig:{title:"全局配置",agentDefault:"默认 Agent",model:"模型",reasoningEffort:"推理强度",agentDefaultOption:"--",sessionEnd:"任务结束提示",banner:"横幅提示",sound:"声音提示",powerTitle:"任务运行期间防休眠",powerSystemDefault:"系统默认",powerPreventDisplaySleep:"禁止息屏",powerKeepSystemAwake:"禁止休眠",shortcutsTitle:"快捷键",shortcutRecord:"录制",shortcutRecording:"按下新的组合键…",shortcutRecordingButton:"录制中",shortcutReset:"重置",shortcutConflict:"快捷键不能重复绑定",saveStatusSaving:"保存中...",saveStatusSaved:"已保存",shortcuts:{newSpec:"新建 spec",toggleSpecDetailFullscreen:"页面最大化",projectSettings:"项目设置",globalSettings:"全局配置"}},commands:{menuTitle:"命令",empty:"还没有配置命令",add:"添加命令",addTitle:"添加命令",name:"名称",namePlaceholder:"例如:dev",cli:"命令行",cliPlaceholder:"例如:pnpm dev",submit:"添加",deleteDef:"删除命令",running:"运行中的命令",status:{running:"运行中",exited:"已退出",killed:"已终止",failed:"启动失败"},clearTitle:"终止并清空该条记录?",clearDescription:"将终止正在运行的进程,并删除该条执行记录与日志文件。",clear:"终止并清空",restart:"重启",stop:"终止",stopping:"终止中…",detailTitle:"命令执行详情",logFile:"日志文件",exitCode:"退出码",startedAt:"开始时间",duration:"运行时长",outputEmpty:"暂无输出",outputTruncated:"日志过长,仅显示尾部内容",notFound:"执行记录不存在或已被清空",back:"返回列表"},errors:{serverDisconnected:"Server 失联,任务可能已终止",serverRestarted:"Server 已重启,原任务未恢复"},selection:{noSection:"(无章节)"},pairing:{title:"配对移动端",hint:"在手机上打开应用,扫描二维码或手动输入下方配对码完成配对。配对码 5 分钟内有效、仅可使用一次。",loading:"生成配对码中…",error:"生成配对码失败",retry:"重试",refresh:"刷新配对码",unauthorizedTitle:"未授权",unauthorized:"当前页面缺少有效令牌,请使用 `yorz serve` 启动日志中打印的带 token 链接打开本页面。"}},bx={common:{loading:"Loading…",cancel:"Cancel",delete:"Delete",confirmDelete:"Confirm Delete",deleting:"Deleting…",submitting:"Submitting…",saving:"Saving…",refresh:"Refresh",refreshing:"Refreshing…",pendingAgent:"(Pending Agent)",close:"Close",remove:"Remove",error:"Error",filterOptions:"Filter options…",noMatchingOptions:"No matching options"},breadcrumb:{specList:"Spec List",newSpec:"New Spec"},shell:{newSpec:"New Spec",settingsMenu:"Settings",languageSwitch:"Switch Language",langZh:"中文",langEn:"English",themeSwitch:"Appearance",themeModeGroup:"Color Mode",themeSystem:"System",themeLight:"Light",themeDark:"Dark",themeNameGroup:"Theme",themeTerminal:"Terminal",themeGraphite:"Graphite",themePaper:"Paper",globalConfig:"Global Settings",userGuide:"User Guide"},systemNotifications:{title:"System Notifications",delete:"Delete notification",versionTitle:"New Version Available",versionMessage:"YorZ {{latest}} is available. Current version: {{current}}.",update:"Update",updating:"Updating…",restart:"Restart Service",restartTooltip:'Restarting the service will interrupt running tasks. You can send "continue" in chat.',disconnectedTitle:"Service disconnected",disconnectedMessage:"The connection to the YorZ service was lost; running tasks may have stopped. Restart it in your terminal with"},welcome:{title:"Welcome to YorZ",description:"YorZ hosts spec documents in local directories. Add a project directory first, then start managing its requirements."},addProject:{trigger:"Add Project",title:"Add Project",help:"Help",helpTooltip:"You can also run `yorz add <path>` to add a project",parent:"Parent directory",home:"Home directory",driveRoot:"This PC",empty:"No subdirectories here",truncated:"Too many subdirectories; showing the first 1000",showHidden:"Show hidden directories",choose:"Choose this directory",loading:"Loading…",newFolder:"New folder",newFolderPlaceholder:"Folder name",newFolderConfirm:"Create",invalidName:"Name must not be empty or contain a path separator",gitInitTitle:"Not a git repository",gitInitDesc:"{{path}} has not been git-initialized. The git panel and worktree features require a git repository.",gitInitConfirm:"Run git init and add",failed:"Failed to add: {{message}}"},sidebar:{title:"Projects",expand:"Expand project panel",collapse:"Collapse project panel",collapseShort:"Collapse",pin:"Keep project panel open",configure:"Configure {{name}}",projectConfig:"Project Config",removeProject:"Remove {{name}}",deleteProject:"Delete Project",deleteDesc:"This will remove the project from the YorZ project list.",deleteFiles:"Also delete file directory",uncommittedChanges:"Uncommitted git changes",resizeHint:"Drag to resize project panel width",projectRunning:"Task running in {{name}}"},chat:{title:"Chat",expand:"Expand Chat",collapse:"Collapse Chat",newSession:"New Session",collapseSessions:"Collapse session list",expandSessions:"Expand session list",sessionsLabel:"Sessions ({{count}})",sessionsLabelPlain:"Sessions",sessionTitle:"{{kind}} · {{id}}",sessionTitleRunning:"{{kind}} · {{id}} · Running",sessionDivider:"{{kind}} · {{time}}",empty:"Select or create a session to start chatting.",draftEmpty:"Untitled session — send a message to start.",usageLoading:"Checking current model usage…",usageError:"Failed to query {{kind}} remaining usage.",usageAvailableNoDetails:"{{kind}} is connected, but returned no displayable usage details.",usageSummary:"{{kind}} usage: {{details}}",usageWindow:"{{label}} about {{remaining}}% remaining ({{used}}% used, resets: {{reset}})",usageWindowUnknown:"{{label}} remaining usage unknown",usageResetUnknown:"unknown",usageSeparator:" · ",inputPlaceholder:"Type a message, / for commands, @ to reference files, Enter to send…",draftPlaceholder:"Type a message, / for commands, @ to reference files — a session starts on send…",noSessionPlaceholder:"Select a project first",showHistory:"History",sessionListLimit:"Session list count",sessionListRows:"Session list height",sessionListRows3:"3 rows",sessionListRows5:"5 rows",sessionListRows10:"10 rows",untitledSession:"Untitled session",noRunningSessions:"Uncommitted sessions",abort:"Abort",send:"Send",agentContextCollapsed:"Agent context ×{{count}}",toolCollapsed:"[Tool] ×{{count}}",toolTextExpand:"Show all {{count}} chars",toolTextCollapse:"Collapse",errorMessage:"[Error] {{message}}",copyFilePath:"Copy file path",filePathCopied:"File path copied",filePathCopyFailed:"Failed to copy file path",slashCommandYorzDebug:"Start debug mode to troubleshoot difficult issues",slashCommandYorzSpec:"Start spec-driven development from the current context",addSlashCommandOption:"Add Command",addSlashCommandOptionDescription:"Create a custom slash command",addSlashCommandTitle:"Add Command",editSlashCommandTitle:"Edit Command",slashCommandNoMatch:"No matching command",deleteSlashCommandTitle:"Delete command",deleteSlashCommandConfirm:"Delete the custom command /{{name}}? This cannot be undone.",slashCommandScopeProject:"This project",slashCommandScopeGlobal:"Global",customSlashCommandScope:"Saved in",customSlashCommandScopeProjectHint:"Available only in this project, shadows a global command of the same name, and cannot be moved after saving",customSlashCommandScopeGlobalHint:"Available in every project, and cannot be moved after saving",customSlashCommandName:"Name",customSlashCommandNamePlaceholder:"git-commit",customSlashCommandDescription:"Description",customSlashCommandDescriptionPlaceholder:"Commit files related to the current session",customSlashCommandHiddenPrompt:"Hidden Prompt",customSlashCommandHiddenPromptPlaceholder:"Use git to commit files related to this session",customSlashCommandHiddenPromptHint:"Sent to the Agent automatically; never shown in the composer or the chat log",customSlashCommandPrefill:"Prefill Content",customSlashCommandPrefillPlaceholder:"Content inserted into the input when selected",customSlashCommandPrefillHint:"Inserted into the composer on select, prefixed with /command-name; you can edit before sending",customSlashCommandNameRequired:"Enter a command name",customSlashCommandNameInvalid:"Use only letters, numbers, underscores, and hyphens",customSlashCommandNoDescription:"Custom command",editCustomSlashCommand:"Edit {{name}}",deleteCustomSlashCommand:"Delete {{name}}",saveCustomSlashCommand:"Save"},home:{specList:"Specs",mainProject:"Main project: ",merging:"Merging…",mergeToMain:"Merge to Main",mergeHint:"Commit worktree changes and merge into main project",mergeDialogTitle:"Merge worktree",mergeDialogDescription:"Review the merge commit message before merging into the main project.",mergeCommitMessage:"Commit message",runningTasksPreventMerge:"Wait for running commands or Agent tasks to finish before merging",mainUnreachable:"Main project unreachable",merged:"Merged into main, redirecting…",conflictDispatched:"Conflict specs dispatched to Agent, list will refresh after merge",noSpecs:"No specs yet.",createFirst:"Create first spec",moreActions:"More actions",copySpecPath:"Copy path",confirmDeleteSpec:"Delete this spec?",newSpec:"+ New Spec"},newSpec:{title:"New Spec",description:"Just pick a type and enter your requirements. Filename, summary, and initial skeleton are generated by Agent based on your input. After document creation, it enters the plan stage automatically.",type:"Type",typeFeat:"feat",typeFeatHint:"New feature",typeRefct:"refct",typeRefctHint:"Refactor / Extract",typeFix:"fix",typeFixHint:"Bug fix",parallelWorktree:"Parallel worktree",parallelWorktreeDesc:'Create a new branch via git worktree for parallel development. Merge via the "Merge to Main" button on the list page.',requirement:"Requirement",requirementPlaceholder:"Raw needs, pain points, expected outcomes, related docs/modules (use @ to reference)",attachments:"Attachments",attachmentsHint:"{{count}}/{{max}}, max 10 MB per file; images support Cmd/Ctrl-V paste",importAttachment:"Import",createAndStart:"Send",creating:"Creating spec…",descTooShort:"Please enter at least 5 characters",attachmentLimit:"Cannot exceed {{max}} attachments",unsupportedType:"Unsupported file type: {{name}}",unsupportedMime:"Unsupported MIME: {{mime}}",fileTooLarge:"{{name}} exceeds 10 MB limit",attachmentRoomLimit:"Can only add {{room}} more ({{current}}/{{max}})",attachmentFailedCount:"{{count}} attachment(s) failed to upload, please remove or retry",attachmentUploading:"Attachments still uploading, please wait",uploading:"Uploading…",uploadFailed:"Failed: {{error}}",clickToRename:"Click to rename",agentRunFailed:"Agent run failed",creatingSpec:"(Creating spec…)",deleteAttachment:"Delete {{name}}"},specDetail:{appendTask:"Append Task",agentLogs:"Agent Logs",review:"Review",debug:"Debug document",running:"Running…",forceStage:"Force set spec stage",notFound:"Spec not found or deleted",fullscreen:"Fullscreen (temporarily collapse projects & chat)",exitFullscreen:"Exit fullscreen (Esc)",copySpecPath:"Copy spec file path",specPathCopied:"Spec file path copied",appendSavedSpecBusy:"Append saved. This spec already has a running session, so no round was dispatched — run it manually once that finishes.",specPathCopyFailed:"Failed to copy spec file path"},mermaid:{maximize:"Maximize diagram",viewerLabel:"Mermaid diagram viewer",zoomIn:"Zoom in",zoomOut:"Zoom out",reset:"Reset view",close:"Close diagram viewer"},specDebug:{empty:"No debug.md records yet"},review:{backToSpec:"Back to spec",heading:"Review · {{id}}",commit:"Commit",discard:"Discard",committing:"Committing…",discarding:"Discarding…",commitPlaceholder:"commit message… ({{shortcut}} to commit)",manualSelect:"Manual select",agentSelect:"Agent smart select",selectAll:"Select all",deselectAll:"Deselect all",fileCount:"{{selected}}/{{total}} files",noChanges:"No changed files",selectAtLeastOne:"Please select at least one file",discardTitle:"Discard changes",confirmDiscardAction:"Confirm Discard",confirmDiscard:"Discard selected changes? This cannot be undone.",confirmDiscardAll:"Discard all uncommitted changes for this spec? This cannot be undone.",enterCommitMsg:"Please enter commit message",dispatched:"Dispatched: "},git:{title:"Git status",branchSelect:"Switch branch",branchPlaceholder:"Select branch",branchFilterPlaceholder:"Filter / create branch…",noBranches:"No matching branches",createBranch:"Create",creatingBranch:"Creating…",branchCreated:"Created and switched to {{branch}}",branchExists:"Branch already exists",fetching:"Fetching remotes…",fetchFailed:"Failed to fetch remotes",fetched:"Remotes updated",mergeBranch:"Merge branch",mergeBranchPlaceholder:"Pick a branch to merge",mergeFilterPlaceholder:"Filter local / remote branches…",mergeAction:"Merge",merging:"Merging…",merged:"Merged {{branch}} into {{current}}",mergeUpToDate:"{{current}} already contains {{branch}}",mergeSelfHint:"The current branch cannot be merged into itself",push:"Push",pushing:"Pushing…",pushed:"Pushed to remote ({{branch}})",pull:"Pull",pulling:"Pulling…",pulled:"Pulled latest commits ({{branch}})",upToDate:"Already up to date",binaryFile:"Binary file — diff not shown",diffTruncated:"Diff too large, truncated",diffEmpty:"No diff to show for this file",diffLoading:"Loading diff…"},agentLogs:{backToSpec:"← Back to spec",title:"Agent Logs · {{id}}",listTitle:"Agent Execution Logs ({{count}})",empty:"No agent execution logs",truncated:"Showing last 256KB (truncated)",emptyLog:"Log is empty",success:"Success",notFinished:"Not finished",failed:"Failed ({{code}})"},agentDock:{title:"Agent Tasks",panelLabel:"Agent task panel",clearFinished:"Clear finished",progressLabel:"Running {{running}} / Done {{done}} / Failed {{failed}}",waitingOutput:"(Waiting for output…)",creatingNew:"(Creating…)",sourceRun:"Run spec",sourceExplain:"Explain",sourceDraft:"New spec",statusPending:"Pending…",statusStreaming:"Running",statusDone:"Done",statusFailed:"Failed"},selectionMenu:{annotate:"Annotate",explain:"Explain"},annotate:{title:"Annotation",placeholder:"Write your annotation for this text…",submit:"Add Annotation",inSection:"in"},questionConfirm:{title:"Pending Items",unanswered:"Unconfirmed",submitAll:"Send",running:"Running…",noAnswers:"No answers to submit",selectionAnnotation:"Selection Annotation",notePlaceholder:"Write your answer…",recommended:"(Recommended)",freeformLabel:"Other (free-form annotation)",quoteConnector:"in",confirmPlanLabel:"Plan",confirmImpactLabel:"Impact",decisionAccept:"Confirm & proceed",decisionReject:"Reject",intentAlternative:"Find alternative (same goal, different approach)",intentConstraint:"Add constraint (info you missed)",intentDropGoal:"Drop goal (impact too large)",dropGoalCurrent:"Drop this goal, keep the rest",dropGoalSpec:"Abandon the whole spec",reasonPlaceholder:"Explain your reason or constraint (required)…",reasonRequired:"A reason is required to reject"},appendTask:{title:"Append Task",hint:"After submission, plan stage will reopen automatically. Agent will process new items.",type:"Type",kindFeat:"feat new/extended requirement",kindRefct:"refct refactor/rewrite/extract",kindFix:"fix bug fix",description:"Description",descPlaceholder:"Describe new requirement / refactor intent / bug reproduction…",descRequired:"Description cannot be empty",submit:"Send",refSection:"Reference section: "},projectConfig:{title:"Project Config",inheritGlobal:"Use global default",agentClaude:"ClaudeCode",agentOpencode:"OpenCode",agentCodex:"Codex",agentPi:"Pi",agent:"Agent",model:"Model",reasoningEffort:"Reasoning effort",agentDefaultOption:"--",specsDir:"Spec directory",specsDirHint:"Relative to project root, auto-created if missing",invalidPath:'Spec directory cannot contain ".."',saved:"Configuration saved",oldSpecsHint:"Old specs remain in the original directory; migrate them manually",save:"Save"},globalConfig:{title:"Global Settings",agentDefault:"Default Agent",model:"Model",reasoningEffort:"Reasoning effort",agentDefaultOption:"--",sessionEnd:"Task end alerts",banner:"Banner alert",sound:"Sound alert",powerTitle:"Prevent sleep while tasks run",powerSystemDefault:"System default",powerPreventDisplaySleep:"Prevent display sleep",powerKeepSystemAwake:"Prevent sleep",shortcutsTitle:"Shortcuts",shortcutRecord:"Record",shortcutRecording:"Press a new shortcut…",shortcutRecordingButton:"Recording",shortcutReset:"Reset",shortcutConflict:"Shortcut bindings must be unique",saveStatusSaving:"Saving...",saveStatusSaved:"Saved",shortcuts:{newSpec:"New Spec",toggleSpecDetailFullscreen:"Page fullscreen",projectSettings:"Project Settings",globalSettings:"Global Settings"}},commands:{menuTitle:"Commands",empty:"No commands configured yet",add:"Add command",addTitle:"Add command",name:"Name",namePlaceholder:"e.g. dev",cli:"Command line",cliPlaceholder:"e.g. pnpm dev",submit:"Add",deleteDef:"Delete command",running:"Running commands",status:{running:"Running",exited:"Exited",killed:"Killed",failed:"Failed to start"},clearTitle:"Stop and clear this record?",clearDescription:"Terminates the running process and deletes this run record and its log file.",clear:"Stop and clear",restart:"Restart",stop:"Stop",stopping:"Stopping...",detailTitle:"Command run",logFile:"Log file",exitCode:"Exit code",startedAt:"Started at",duration:"Duration",outputEmpty:"No output yet",outputTruncated:"Log is large; showing the tail only",notFound:"This run record does not exist or has been cleared",back:"Back to list"},errors:{serverDisconnected:"Server disconnected, task may have terminated",serverRestarted:"Server restarted, previous task not recovered"},selection:{noSection:"(no section)"},pairing:{title:"Pair a mobile device",hint:"Open the app on your phone, then scan the QR code or type the pairing code below. The code is valid for 5 minutes and can be used once.",loading:"Generating pairing code…",error:"Failed to generate pairing code",retry:"Retry",refresh:"Refresh code",unauthorizedTitle:"Unauthorized",unauthorized:"This page has no valid token. Open it using the token-bearing URL printed in the `yorz serve` startup log."}},Rl=hx({"zh-CN":{translation:mx},en:{translation:bx}}),{i18next:gf}=Rl,yx=["system","light","dark"],vx=["terminal","graphite","paper"],km="(prefers-color-scheme: dark)",Am="yorz.appearanceHint";function wx(e){return yx.includes(e)}function xx(e){return vx.includes(e)}function _x(){if(typeof window>"u")return null;try{const e=window.localStorage.getItem(Am);if(!e)return null;const t=JSON.parse(e);if(!t||typeof t!="object")return null;const{mode:n,name:r}=t;return!wx(n)||!xx(r)?null:{mode:n,name:r}}catch{return null}}function Tm(e,t){if(!(typeof window>"u"))try{window.localStorage.setItem(Am,JSON.stringify({mode:e,name:t}))}catch{}}function Dm(){return typeof window>"u"||!window.matchMedia?"light":window.matchMedia(km).matches?"dark":"light"}function Im(e,t){return e==="light"||e==="dark"?e:t?"dark":"light"}const Ol=_x(),[ea,Ex]=I(Ol?.mode??"system"),[ta,Rm]=I(Ol?.name??"paper"),[Cx,Sx]=I(Im(Ol?.mode??"system",Dm()==="dark"));let Om=!1;function kx(e,t){typeof document>"u"||(document.documentElement.setAttribute("data-kb-theme",e),document.documentElement.setAttribute("data-kb-theme-name",t),document.documentElement.style.colorScheme=e)}function na(e,t){const n=Im(e,Dm()==="dark");Sx(n),kx(n,t),Om&&Tm(e,t)}function Nm(e){Ex(e),na(e,ta())}function Ax(e){Rm(e),na(ea(),e)}function Tx(e,t){Rm(t),Nm(e)}let pf=!1;function Dx(e={}){pf||(pf=!0,Om=e.persistHint??!1,na(ea(),ta()),!(typeof window>"u"||!window.matchMedia)&&window.matchMedia(km).addEventListener("change",()=>{ea()==="system"&&na("system",ta())}))}const Ix="x-yorz-pair-token";let Mm=()=>null,Pm=()=>{};function Rx(e){e.tokenProvider&&(Mm=e.tokenProvider),e.onUnauthorized&&(Pm=e.onUnauthorized)}function Lm(){try{return Mm()}catch{return null}}function Ox(){try{Pm()}catch{}}function $m(e){const t=Lm();if(!t)return e??{};const n=new Headers(e?.headers);return n.set(Ix,t),{...e,headers:n}}function Fm(e){const t=Lm();if(!t)return e;const n=e.includes("?")?"&":"?";return`${e}${n}token=${encodeURIComponent(t)}`}const Bm="yorz.token",[Nx,hf]=I(!1);function Mx(){try{return localStorage.getItem(Bm)}catch{return null}}function Px(e){try{localStorage.setItem(Bm,e)}catch{}}function Lx(){try{const e=new URL(window.location.href),t=e.searchParams.get("token");if(t){Px(t),hf(!1),e.searchParams.delete("token");const n=e.pathname+(e.search?e.search:"")+e.hash;window.history.replaceState(window.history.state,"",n)}}catch{}Rx({tokenProvider:Mx,onUnauthorized:()=>hf(!0)})}/**
|
|
2
|
+
* @license lucide-solid v1.24.0 - ISC
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the ISC license.
|
|
5
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/var $x={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"},Io=$x,Fx=dt({size:24,color:"currentColor",strokeWidth:2,absoluteStrokeWidth:!1,class:""}),Bx=$("<svg>"),zx=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1},Ux=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim(),Kx=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase()),mf=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),jx=e=>{const t=Kx(e);return t.charAt(0).toUpperCase()+t.slice(1)},qx=e=>{const[t,n]=me(e,["color","size","strokeWidth","children","class","name","iconNode","absoluteStrokeWidth"]),r=ut(Fx);return(()=>{var o=Bx();return sr(o,G(Io,{get width(){return t.size??r.size??Io.width},get height(){return t.size??r.size??Io.height},get stroke(){return t.color??r.color??Io.stroke},get"stroke-width"(){return Q(()=>(t.absoluteStrokeWidth??r.absoluteStrokeWidth)===!0)()?Number(t.strokeWidth??r.strokeWidth??Io["stroke-width"])*24/Number(t.size??r.size):Number(t.strokeWidth??r.strokeWidth??Io["stroke-width"])},get class(){return Ux("lucide","lucide-icon",r.class,...t.name!=null?[`lucide-${mf(jx(t.name))}`,`lucide-${mf(t.name)}`]:[],t.class)},get"aria-hidden"(){return!t.children&&!zx(n)?"true":void 0}},n),!0,!0),x(o,f(ot,{get each(){return t.iconNode},children:([i,s])=>f(sm,G({component:i},s))})),o})()},Ve=qx,Hx=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],Gx=e=>f(Ve,G(e,{iconNode:Hx,name:"arrow-left"})),Vx=Gx,Wx=[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]],Yx=e=>f(Ve,G(e,{iconNode:Wx,name:"bell"})),Zx=Yx,Xx=[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]],Jx=e=>f(Ve,G(e,{iconNode:Xx,name:"book-open"})),Qx=Jx,e_=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],t_=e=>f(Ve,G(e,{iconNode:e_,name:"check"})),bi=t_,n_=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],r_=e=>f(Ve,G(e,{iconNode:n_,name:"chevron-down"})),Nl=r_,o_=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],i_=e=>f(Ve,G(e,{iconNode:o_,name:"chevron-right"})),Ml=i_,s_=[["path",{d:"m11 17-5-5 5-5",key:"13zhaf"}],["path",{d:"m18 17-5-5 5-5",key:"h8a8et"}]],a_=e=>f(Ve,G(e,{iconNode:s_,name:"chevrons-left"})),zm=a_,u_=[["path",{d:"m6 17 5-5-5-5",key:"xnjwq"}],["path",{d:"m13 17 5-5-5-5",key:"17xmmf"}]],c_=e=>f(Ve,G(e,{iconNode:u_,name:"chevrons-right"})),tl=c_,l_=[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]],d_=e=>f(Ve,G(e,{iconNode:l_,name:"chevrons-up-down"})),f_=d_,g_=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],p_=e=>f(Ve,G(e,{iconNode:g_,name:"circle-check"})),h_=p_,m_=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],b_=e=>f(Ve,G(e,{iconNode:m_,name:"circle-question-mark"})),y_=b_,v_=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],w_=e=>f(Ve,G(e,{iconNode:v_,name:"copy"})),x_=w_,__=[["path",{d:"M14 9 9 4 4 9",key:"1af5af"}],["path",{d:"M20 20h-7a4 4 0 0 1-4-4V4",key:"1blwi3"}]],E_=e=>f(Ve,G(e,{iconNode:__,name:"corner-left-up"})),C_=E_,S_=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],k_=e=>f(Ve,G(e,{iconNode:S_,name:"ellipsis"})),A_=k_,T_=[["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"M9 13h6",key:"1uhe8q"}],["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],D_=e=>f(Ve,G(e,{iconNode:T_,name:"folder-plus"})),I_=D_,R_=[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],O_=e=>f(Ve,G(e,{iconNode:R_,name:"folder"})),N_=O_,M_=[["path",{d:"M15 6a9 9 0 0 0-9 9V3",key:"1cii5b"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}]],P_=e=>f(Ve,G(e,{iconNode:M_,name:"git-branch"})),Pl=P_,L_=[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M6 21V9a9 9 0 0 0 9 9",key:"7kw0sc"}]],$_=e=>f(Ve,G(e,{iconNode:L_,name:"git-merge"})),Um=$_,F_=[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"r6nss1"}]],B_=e=>f(Ve,G(e,{iconNode:F_,name:"house"})),z_=B_,U_=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],K_=e=>f(Ve,G(e,{iconNode:U_,name:"info"})),j_=K_,q_=[["path",{d:"m5 8 6 6",key:"1wu5hv"}],["path",{d:"m4 14 6-6 2-3",key:"1k1g8d"}],["path",{d:"M2 5h12",key:"or177f"}],["path",{d:"M7 2h1",key:"1t2jsx"}],["path",{d:"m22 22-5-10-5 10",key:"don7ne"}],["path",{d:"M14 18h6",key:"1m8k6r"}]],H_=e=>f(Ve,G(e,{iconNode:q_,name:"languages"})),G_=H_,V_=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],W_=e=>f(Ve,G(e,{iconNode:V_,name:"loader-circle"})),sn=W_,Y_=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"m21 3-7 7",key:"1l2asr"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M9 21H3v-6",key:"wtvkvv"}]],Z_=e=>f(Ve,G(e,{iconNode:Y_,name:"maximize-2"})),X_=Z_,J_=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],Q_=e=>f(Ve,G(e,{iconNode:J_,name:"menu"})),e2=Q_,t2=[["path",{d:"m14 10 7-7",key:"oa77jy"}],["path",{d:"M20 10h-6V4",key:"mjg0md"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M4 14h6v6",key:"rmj7iw"}]],n2=e=>f(Ve,G(e,{iconNode:t2,name:"minimize-2"})),r2=n2,o2=[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]],i2=e=>f(Ve,G(e,{iconNode:o2,name:"monitor"})),Km=i2,s2=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],a2=e=>f(Ve,G(e,{iconNode:s2,name:"moon"})),u2=a2,c2=[["path",{d:"M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z",key:"e79jfc"}],["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}]],l2=e=>f(Ve,G(e,{iconNode:c2,name:"palette"})),d2=l2,f2=[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]],g2=e=>f(Ve,G(e,{iconNode:f2,name:"paperclip"})),p2=g2,h2=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],m2=e=>f(Ve,G(e,{iconNode:h2,name:"pencil"})),jm=m2,b2=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],y2=e=>f(Ve,G(e,{iconNode:b2,name:"plus"})),jr=y2,v2=[["rect",{width:"5",height:"5",x:"3",y:"3",rx:"1",key:"1tu5fj"}],["rect",{width:"5",height:"5",x:"16",y:"3",rx:"1",key:"1v8r4q"}],["rect",{width:"5",height:"5",x:"3",y:"16",rx:"1",key:"1x03jg"}],["path",{d:"M21 16h-3a2 2 0 0 0-2 2v3",key:"177gqh"}],["path",{d:"M21 21v.01",key:"ents32"}],["path",{d:"M12 7v3a2 2 0 0 1-2 2H7",key:"8crl2c"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M12 3h.01",key:"n36tog"}],["path",{d:"M12 16v.01",key:"133mhm"}],["path",{d:"M16 12h1",key:"1slzba"}],["path",{d:"M21 12v.01",key:"1lwtk9"}],["path",{d:"M12 21v-1",key:"1880an"}]],w2=e=>f(Ve,G(e,{iconNode:v2,name:"qr-code"})),x2=w2,_2=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],E2=e=>f(Ve,G(e,{iconNode:_2,name:"rotate-ccw"})),C2=E2,S2=[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]],k2=e=>f(Ve,G(e,{iconNode:S2,name:"rotate-cw"})),A2=k2,T2=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],D2=e=>f(Ve,G(e,{iconNode:T2,name:"send"})),xa=D2,I2=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],R2=e=>f(Ve,G(e,{iconNode:I2,name:"settings"})),O2=R2,N2=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],M2=e=>f(Ve,G(e,{iconNode:N2,name:"square"})),qm=M2,P2=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],L2=e=>f(Ve,G(e,{iconNode:P2,name:"sun"})),$2=L2,F2=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],B2=e=>f(Ve,G(e,{iconNode:F2,name:"terminal"})),z2=B2,U2=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],K2=e=>f(Ve,G(e,{iconNode:U2,name:"trash-2"})),Ll=K2,j2=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],q2=e=>f(Ve,G(e,{iconNode:j2,name:"triangle-alert"})),H2=q2,G2=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],V2=e=>f(Ve,G(e,{iconNode:G2,name:"upload"})),W2=V2,Y2=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Z2=e=>f(Ve,G(e,{iconNode:Y2,name:"x"})),Yr=Z2;async function Bs(e,t){const n=await fetch(e,$m(t));return n.status===401&&Ox(),n}function je(e){return`/api/projects/${encodeURIComponent(e)}`}async function zs(e){const t=await e.text();if(!t)return"";try{return JSON.parse(t).error??t}catch{return t}}async function Ae(e,t){const n=await Bs(e,t);if(!n.ok){const r=await zs(n);throw new Error(`${n.status} ${r||n.statusText}`)}return n.json()}const we={listSpecs:e=>Ae(`${je(e)}/specs`),getSpec:(e,t)=>Ae(`${je(e)}/specs/${encodeURIComponent(t)}`),deleteSpec:(e,t)=>Ae(`${je(e)}/specs/${encodeURIComponent(t)}`,{method:"DELETE"}),setStage:(e,t,n)=>Ae(`${je(e)}/specs/${encodeURIComponent(t)}/stage`,{method:"PATCH",headers:{"content-type":"application/json"},body:JSON.stringify({stage:n})}),createSpec:(e,t)=>Bs(`${je(e)}/specs`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(t)}).then(async n=>{if(!n.ok){const r=await zs(n);throw new Error(`${n.status} ${r||n.statusText}`)}return n.json()}),appendAnnotation:(e,t,n)=>Ae(`${je(e)}/specs/${encodeURIComponent(t)}/inputs`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({kind:"annotate",...n})}),submitQuestionAnswers:(e,t,n)=>Ae(`${je(e)}/specs/${encodeURIComponent(t)}/questions/answers`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(n)}),runAgent:(e,t)=>Ae(`${je(e)}/specs/${encodeURIComponent(t)}/run`,{method:"POST",headers:{"content-type":"application/json"},body:"{}"}),appendItem:(e,t,n)=>Ae(`${je(e)}/specs/${encodeURIComponent(t)}/appends`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(n)}),explain:(e,t,n)=>Ae(`${je(e)}/specs/${encodeURIComponent(t)}/explain`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({text:n})}),gitOp:(e,t,n)=>Ae(`${je(e)}/specs/${encodeURIComponent(t)}/git`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({action:n})}),getProjectChanges:e=>Ae(`${je(e)}/git/changes`),getFileDiff:(e,t)=>Ae(`${je(e)}/git/diff?path=${encodeURIComponent(t)}`),getGitBranches:e=>Ae(`${je(e)}/git/branches`),checkoutGitBranch:(e,t)=>Ae(`${je(e)}/git/checkout`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({branch:t})}),createGitBranch:(e,t)=>Ae(`${je(e)}/git/create-branch`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({name:t})}),gitFetch:e=>Ae(`${je(e)}/git/fetch`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({})}),mergeGitBranch:(e,t)=>Ae(`${je(e)}/git/merge`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({branch:t})}),projectCommit:(e,t)=>Ae(`${je(e)}/git/commit`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(t)}),projectDiscard:(e,t)=>Ae(`${je(e)}/git/discard`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(t)}),projectPush:e=>Ae(`${je(e)}/git/push`,{method:"POST",headers:{"content-type":"application/json"},body:"{}"}),projectPull:e=>Ae(`${je(e)}/git/pull`,{method:"POST",headers:{"content-type":"application/json"},body:"{}"}),getDebug:(e,t)=>Ae(`${je(e)}/specs/${encodeURIComponent(t)}/debug`),listProjects:()=>Ae("/api/projects"),listDirs:(e,t)=>{const n=new URLSearchParams;e!==void 0&&n.set("path",e),t&&n.set("showHidden","1");const r=n.toString();return Ae(`/api/fs/list${r?`?${r}`:""}`)},createDir:(e,t)=>Ae("/api/fs/mkdir",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({parent:e,name:t})}),addProject:async(e,t)=>{const n=await Bs("/api/projects",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:e,...t?.gitInit?{gitInit:!0}:{}})});if(n.status===409){const r=await n.json();if(r.needGitInit)return{ok:!1,needGitInit:!0,path:r.path??e}}if(!n.ok){const r=await zs(n);throw new Error(`${n.status} ${r||n.statusText}`)}return{ok:!0,project:await n.json()}},listSystemNotifications:()=>Ae("/api/system-notifications"),deleteSystemNotification:e=>Ae(`/api/system-notifications/${encodeURIComponent(e)}`,{method:"DELETE"}),updateSystemNotification:e=>Ae(`/api/system-notifications/${encodeURIComponent(e)}/update`,{method:"POST"}),restartSystemNotification:e=>Ae(`/api/system-notifications/${encodeURIComponent(e)}/restart`,{method:"POST"}),removeProject:e=>Ae(`/api/projects/${encodeURIComponent(e)}`,{method:"DELETE"}),removeProjectWithFiles:e=>Ae(`/api/projects/${encodeURIComponent(e)}?deleteFiles=true`,{method:"DELETE"}),createWorktree:(e,t)=>Ae(`/api/projects/${encodeURIComponent(e)}/worktrees`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(t)}),mergeWorktreeToMain:(e,t)=>Ae(`/api/projects/${encodeURIComponent(e)}/merge-main`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(t)}),getProjectConfig:e=>Ae(`/api/projects/${encodeURIComponent(e)}/config`),updateProjectConfig:(e,t)=>Ae(`/api/projects/${encodeURIComponent(e)}/config`,{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify(t)}),getProjectCustomInstructions:e=>Ae(`/api/projects/${encodeURIComponent(e)}/custom-instructions`),updateProjectCustomInstructions:(e,t)=>Ae(`/api/projects/${encodeURIComponent(e)}/custom-instructions`,{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify({customInstructions:t})}),getPairingCode:()=>Ae("/api/pairing/code"),claimPairing:e=>Ae("/api/pairing/claim",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({code:e})}),getVapidPublicKey:()=>Ae("/api/push/vapid-public-key"),savePushSubscription:e=>Ae("/api/push/subscriptions",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(e)}),deletePushSubscription:e=>Ae("/api/push/subscriptions",{method:"DELETE",headers:{"content-type":"application/json"},body:JSON.stringify({endpoint:e})}),getGlobalConfig:()=>Ae("/api/global-config"),listGlobalAgents:()=>Ae("/api/agents"),listGlobalAgentModels:e=>Ae(`/api/agents/${encodeURIComponent(e)}/models`),updateGlobalConfig:e=>Ae("/api/global-config",{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify(e)}),createDraft:e=>Ae(`${je(e)}/spec-drafts`,{method:"POST",headers:{"content-type":"application/json"},body:"{}"}),uploadAttachment:async(e,t,n)=>{const r=new FormData;r.append("file",n,n.name);const o=await Bs(`${je(e)}/spec-drafts/${encodeURIComponent(t)}/attachments`,{method:"POST",body:r});if(!o.ok){const i=await zs(o);throw new Error(`${o.status} ${i||o.statusText}`)}return o.json()},deleteAttachment:(e,t,n)=>Ae(`${je(e)}/spec-drafts/${encodeURIComponent(t)}/attachments/${encodeURIComponent(n)}`,{method:"DELETE"}),renameAttachment:(e,t,n,r)=>Ae(`${je(e)}/spec-drafts/${encodeURIComponent(t)}/attachments/${encodeURIComponent(n)}`,{method:"PATCH",headers:{"content-type":"application/json"},body:JSON.stringify({name:r})}),draftAttachmentUrl:(e,t,n)=>`${je(e)}/spec-drafts/${encodeURIComponent(t)}/attachments/${encodeURIComponent(n)}`,specAttachmentUrl:(e,t,n)=>`${je(e)}/specs/${encodeURIComponent(t)}/attachments/${encodeURIComponent(n)}`,listFiles:(e,t,n=50)=>Ae(`${je(e)}/files?query=${encodeURIComponent(t)}&limit=${n}`),listSessions:e=>Ae(`${je(e)}/sessions`),listAgents:e=>Ae(`${je(e)}/agents`),listAgentModels:(e,t)=>Ae(`${je(e)}/agents/${encodeURIComponent(t)}/models`),getAgentUsageStatus:e=>Ae(`${je(e)}/agent-usage`),createSession:(e,t={})=>Ae(`${je(e)}/sessions`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(t)}),getSessionMessages:(e,t)=>Ae(`${je(e)}/sessions/${encodeURIComponent(t)}/messages`),getSpecMessages:(e,t)=>Ae(`${je(e)}/specs/${encodeURIComponent(t)}/messages`),sendSessionMessage:(e,t,n,r)=>Ae(`${je(e)}/sessions/${encodeURIComponent(t)}/messages`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(r?{prompt:n,draftId:r}:{prompt:n})}),abortSession:(e,t)=>Ae(`${je(e)}/sessions/${encodeURIComponent(t)}/abort`,{method:"POST"}),getSpecSession:(e,t)=>Ae(`${je(e)}/specs/${encodeURIComponent(t)}/session`),listCommands:e=>Ae(`${je(e)}/commands`),createCommand:(e,t)=>Ae(`${je(e)}/commands`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(t)}),deleteCommand:(e,t)=>Ae(`${je(e)}/commands/${encodeURIComponent(t)}`,{method:"DELETE"}),listCommandRuns:e=>Ae(`${je(e)}/command-runs`),getCommandRun:(e,t)=>Ae(`${je(e)}/command-runs/${encodeURIComponent(t)}`),runCommand:(e,t)=>Ae(`${je(e)}/command-runs`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({commandId:t})}),readCommandOutput:(e,t,n)=>Ae(`${je(e)}/command-runs/${encodeURIComponent(t)}/output${n===void 0?"":`?offset=${n}`}`),stopCommandRun:(e,t)=>Ae(`${je(e)}/command-runs/${encodeURIComponent(t)}/stop`,{method:"POST"}),clearCommandRun:(e,t)=>Ae(`${je(e)}/command-runs/${encodeURIComponent(t)}`,{method:"DELETE"})},[X2,Hm]=I(""),[J2,Gm]=I(null);function Bo(e,t){e&&(Hm(e),Gm(t&&t.userText?{sessionId:e,...t}:null))}function Q2(){Hm(""),Gm(null)}const[wt,eE]=I(tE());function tE(){if(typeof window>"u")return"";const e=window.location.pathname.match(/^\/([^/]+)/);return e&&e[1]!=="api"?e[1]:""}function yo(){const e=Vi();return()=>e.projectId??wt()}function Tt(e="",t){const n=t??wt();if(!n)return e.startsWith("/")?e:`/${e}`;const r=e.startsWith("/")?e:e?`/${e}`:"";return`/${n}${r}`}const[nE,rE]=I(0),[oE,bf]=I(null);let yf=0;function iE(){rE(e=>e+1)}function sE(e){const t=++yf;bf(()=>e),ue(()=>{yf===t&&bf(null)})}const[Cr,$l]=I(!1);function Vm(){$l(e=>!e)}function ra(){$l(!1)}let nl=0,uu=!1;function aE(){nl-=1,!uu&&(uu=!0,queueMicrotask(()=>{uu=!1,nl<=0&&$l(!1)}))}function Wi(e){nl+=1,ue(aE),sE(Vm),ae(()=>{if(!Cr())return;const t=n=>{n.key!=="Escape"||e?.()||ra()};window.addEventListener("keydown",t),ue(()=>window.removeEventListener("keydown",t))})}const uE=16e3,cE=5e3,lE=5e3;function dE(){const e=globalThis;return e.crypto?.randomUUID?e.crypto.randomUUID():`c-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,10)}`}class fE{clientId=dE();source=null;handlers=new Map;syncTimer=null;syncInFlight=!1;syncPending=!1;lastFrameAt=0;watchdogTimer=null;visibilityBound=!1;connected=!0;connListeners=new Set;subscribe(t,n){let r=this.handlers.get(t);return r||(r=new Set,this.handlers.set(t,r)),r.add(n),this.ensureOpen(),this.scheduleSync(),()=>{const o=this.handlers.get(t);o&&(o.delete(n),o.size===0&&this.handlers.delete(t),this.scheduleSync())}}readyState(){return this.source?.readyState??2}ensureOpen(){if(this.source)return;const t=Fm(`/api/events/stream?clientId=${encodeURIComponent(this.clientId)}`),n=new EventSource(t);this.source=n,this.lastFrameAt=Date.now(),this.startWatchdog(),n.addEventListener("open",()=>{this.lastFrameAt=Date.now(),this.markConnected(!0),this.scheduleSync(!0)}),n.addEventListener("server-heartbeat",r=>{this.lastFrameAt=Date.now(),this.markConnected(!0);let o={ts:Date.now()};try{o=JSON.parse(r.data)}catch{}for(const i of this.handlers.values())for(const s of i)try{s("server-heartbeat",o)}catch{}}),n.addEventListener("msg",r=>{this.lastFrameAt=Date.now(),this.markConnected(!0);let o;try{o=JSON.parse(r.data)}catch{return}const i=this.handlers.get(o.topic);if(i)for(const s of i)try{s(o.event,o.data)}catch{}}),n.addEventListener("error",()=>{})}startWatchdog(){if(this.watchdogTimer===null){const t=setInterval(()=>this.checkAlive(),lE);t.unref?.(),this.watchdogTimer=t}!this.visibilityBound&&typeof document<"u"&&(this.visibilityBound=!0,document.addEventListener("visibilitychange",()=>{document.hidden||this.checkAlive()}))}checkAlive(){const t=this.source;if(!t)return;const n=Date.now()-this.lastFrameAt,r=t.readyState===2;(n>cE||r)&&this.markConnected(!1),(n>uE||r)&&this.reconnect()}markConnected(t){if(this.connected!==t){this.connected=t;for(const n of this.connListeners)try{n(t)}catch{}}}isConnected(){return this.connected}subscribeConnectionState(t){return this.connListeners.add(t),this.ensureOpen(),t(this.connected),()=>{this.connListeners.delete(t)}}reconnect(){const t=this.source;this.source=null;try{t?.close()}catch{}this.ensureOpen()}scheduleSync(t=!1){if(this.syncTimer)return;const n=t?0:20;this.syncTimer=setTimeout(()=>{this.syncTimer=null,this.runSync()},n)}async runSync(){if(this.syncInFlight){this.syncPending=!0;return}this.syncInFlight=!0;try{const t=[...this.handlers.keys()].sort();await fetch("/api/events/subscribe",$m({method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({clientId:this.clientId,topics:t})}))}catch{}finally{this.syncInFlight=!1,this.syncPending&&(this.syncPending=!1,this.scheduleSync(!0))}}dispose(){this.watchdogTimer!==null&&(clearInterval(this.watchdogTimer),this.watchdogTimer=null),this.syncTimer!==null&&(clearTimeout(this.syncTimer),this.syncTimer=null);try{this.source?.close()}catch{}this.source=null,this.handlers.clear(),this.connListeners.clear(),this.connected=!0}}let Un=new fE;function _a(e){const t=e;return t.readyState=()=>Un.readyState(),t}function gE(e,t,n){if(!e){const i=(()=>{});return i.readyState=()=>2,i}const r=`project:${e}:spec:${t}`,o=Un.subscribe(r,(i,s)=>{switch(i){case"updated":n.onUpdated?.();break;case"server-heartbeat":n.onServerHeartbeat?.(s);break}});return _a(o)}function Ea(e,t,n){if(!e){const i=(()=>{});return i.readyState=()=>2,i}const r=`project:${e}:session:${t}`,o=Un.subscribe(r,(i,s)=>{i==="session-msg"?n.onEvent?.(s):i==="ready"?n.onReady?.(s):i==="server-heartbeat"&&n.onServerHeartbeat?.(s)});return _a(o)}function Wm(e,t){if(!e){const o=(()=>{});return o.readyState=()=>2,o}const n=`project:${e}:sessions`,r=Un.subscribe(n,(o,i)=>{o==="session-status"?t.onStatus?.(i):o==="server-heartbeat"&&t.onServerHeartbeat?.(i)});return _a(r)}function Ym(e,t){if(!e)return()=>{};const n=`project:${e}:specs`;return Un.subscribe(n,r=>{r==="list-updated"&&t()})}function Zm(e){return Un.subscribe("projects",t=>{t==="projects-changed"&&e()})}function pE(e){return Un.subscribe("system-notifications",t=>{t==="updated"&&e()})}function hE(e){return Un.subscribeConnectionState(e)}function mE(e,t){if(!e)return()=>{};const n=`project:${e}:commands`;return Un.subscribe(n,(r,o)=>{r==="runs-updated"&&t(o.runs)})}function bE(e,t,n){if(!e||!t)return()=>{};const r=`project:${e}:command:${t}`;return Un.subscribe(r,(o,i)=>{if(o==="output-appended")n.onOutput?.(i);else if(o==="run-updated")n.onRun?.(i.run);else if(o==="ready"){const s=i.run;s&&n.onRun?.(s)}else o==="error"&&n.onError?.(String(i.error??"unknown error"))})}function yE(e,t){if(!e){const o=(()=>{});return o.readyState=()=>2,o}const n=`project:${e}:changes`,r=Un.subscribe(n,(o,i)=>{o==="changes-updated"&&t(i.changes)});return _a(r)}function Xm(e){if(!e)return"";const t=e.replace(/^['"]|['"]$/g,"").trim();return/^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}$/.test(t)||/^\d{4}-\d{2}-\d{2}$/.test(t)?t:t||""}const vE={plan:"bg-stage-plan/15 text-stage-plan border-stage-plan/30",tasks:"bg-stage-tasks/15 text-stage-tasks border-stage-tasks/30",execute:"bg-stage-execute/15 text-stage-execute border-stage-execute/30",done:"bg-stage-done/15 text-stage-done border-stage-done/30"},wE={feat:"text-success",refct:"text-info",fix:"text-destructive"};function Jm(e){const[t,n,...r]=e.split(".");return!t||!n||r.length===0?null:{prefix:t,type:n,suffix:r.join(".")}}function xE(e,t){const n=Jm(e)?.type??e.split(".")[1]??"feat",r=t?.trim()??"";return r?`${n}: ${r}`:`${n}: update`}function _E(e){return`@.yorz/specs/${e}/spec.md`}function EE(e){return(...t)=>{for(const n of e)n&&n(...t)}}const ee=e=>typeof e=="function"&&!e.length?e():e,vf=e=>Array.isArray(e)?e:e?[e]:[];function CE(e,...t){return typeof e=="function"?e(...t):e}const SE=ue;function kE(e,t,n,r){return e.addEventListener(t,n,r),SE(e.removeEventListener.bind(e,t,n,r))}function AE(e,t,n,r){const o=()=>{vf(ee(e)).forEach(i=>{i&&vf(ee(t)).forEach(s=>kE(i,s,n,r))})};typeof e=="function"?ae(o):Me(o)}const cu=Symbol("fallback");function wf(e){for(const t of e)t.dispose()}function TE(e,t,n,r={}){const o=new Map;return ue(()=>wf(o.values())),()=>{const s=e()||[];return s[ki],pt(()=>{if(!s.length)return wf(o.values()),o.clear(),r.fallback?[Cn(d=>(o.set(cu,{dispose:d}),r.fallback()))]:[];const a=new Array(s.length),u=o.get(cu);if(!o.size||u){u?.dispose(),o.delete(cu);for(let l=0;l<s.length;l++){const d=s[l],g=t(d,l);i(a,d,l,g)}return a}const c=new Set(o.keys());for(let l=0;l<s.length;l++){const d=s[l],g=t(d,l);c.delete(g);const p=o.get(g);p?(a[l]=p.mapped,p.setIndex?.(l),p.setItem(()=>d)):i(a,d,l,g)}for(const l of c)o.get(l)?.dispose(),o.delete(l);return a})};function i(s,a,u,c){Cn(l=>{const[d,g]=I(a),p={setItem:g,dispose:l};if(n.length>1){const[h,m]=I(u);p.setIndex=m,p.mapped=n(d,h)}else p.mapped=n(d);o.set(c,p),s[u]=p.mapped})}}function DE(e){const{by:t}=e;return ne(TE(()=>e.each,typeof t=="function"?t:n=>n[t],e.children,"fallback"in e?{fallback:()=>e.fallback}:void 0))}const IE=/((?:--)?(?:\w+-?)+)\s*:\s*([^;]*)/g;function xf(e){const t={};let n;for(;n=IE.exec(e);)t[n[1]]=n[2];return t}function wn(e,t){if(typeof e=="string"){if(typeof t=="string")return`${e};${t}`;e=xf(e)}else typeof t=="string"&&(t=xf(t));return{...e,...t}}function tt(...e){return EE(e)}function RE(e,t,n=-1){return n in e?[...e.slice(0,n),t,...e.slice(n)]:[...e,t]}function rl(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function OE(e){return typeof e=="number"}function $o(e){return Object.prototype.toString.call(e)==="[object String]"}function Yi(e){return typeof e=="function"}function nn(e){return t=>`${e()}-${t}`}function Pt(e,t){return e?e===t||e.contains(t):!1}function yi(e,t=!1){const{activeElement:n}=tn(e);if(!n?.nodeName)return null;if(Qm(n)&&n.contentDocument)return yi(n.contentDocument.body,t);if(t){const r=n.getAttribute("aria-activedescendant");if(r){const o=tn(n).getElementById(r);if(o)return o}}return n}function Fl(e){return tn(e).defaultView||window}function tn(e){return e?e.ownerDocument||e:document}function Qm(e){return e.tagName==="IFRAME"}var Ca=(e=>(e.Escape="Escape",e.Enter="Enter",e.Tab="Tab",e.Space=" ",e.ArrowDown="ArrowDown",e.ArrowLeft="ArrowLeft",e.ArrowRight="ArrowRight",e.ArrowUp="ArrowUp",e.End="End",e.Home="Home",e.PageDown="PageDown",e.PageUp="PageUp",e))(Ca||{});function e0(e){return typeof window>"u"||window.navigator==null?!1:window.navigator.userAgentData?.brands.some(t=>e.test(t.brand))||e.test(window.navigator.userAgent)}function Bl(e){return typeof window<"u"&&window.navigator!=null?e.test(window.navigator.userAgentData?.platform||window.navigator.platform):!1}function Zi(){return Bl(/^Mac/i)}function NE(){return Bl(/^iPhone/i)}function ME(){return Bl(/^iPad/i)||Zi()&&navigator.maxTouchPoints>1}function PE(){return NE()||ME()}function LE(){return Zi()||PE()}function $E(){return e0(/AppleWebKit/i)&&!FE()}function FE(){return e0(/Chrome/i)}function Oe(e,t){return t&&(Yi(t)?t(e):t[0](t[1],e)),e?.defaultPrevented}function gt(e){return t=>{for(const n of e)Oe(t,n)}}function BE(e){return Zi()?e.metaKey&&!e.ctrlKey:e.ctrlKey&&!e.metaKey}function Et(e){if(e)if(zE())e.focus({preventScroll:!0});else{const t=UE(e);e.focus(),KE(t)}}var xs=null;function zE(){if(xs==null){xs=!1;try{document.createElement("div").focus({get preventScroll(){return xs=!0,!0}})}catch{}}return xs}function UE(e){let t=e.parentNode;const n=[],r=document.scrollingElement||document.documentElement;for(;t instanceof HTMLElement&&t!==r;)(t.offsetHeight<t.scrollHeight||t.offsetWidth<t.scrollWidth)&&n.push({element:t,scrollTop:t.scrollTop,scrollLeft:t.scrollLeft}),t=t.parentNode;return r instanceof HTMLElement&&n.push({element:r,scrollTop:r.scrollTop,scrollLeft:r.scrollLeft}),n}function KE(e){for(const{element:t,scrollTop:n,scrollLeft:r}of e)t.scrollTop=n,t.scrollLeft=r}var t0=["input:not([type='hidden']):not([disabled])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])","a[href]","area[href]","[tabindex]","iframe","object","embed","audio[controls]","video[controls]","[contenteditable]:not([contenteditable='false'])"],jE=[...t0,'[tabindex]:not([tabindex="-1"]):not([disabled])'],zl=`${t0.join(":not([hidden]),")},[tabindex]:not([disabled]):not([hidden])`,qE=jE.join(':not([hidden]):not([tabindex="-1"]),');function n0(e,t){const r=Array.from(e.querySelectorAll(zl)).filter(_f);return t&&_f(e)&&r.unshift(e),r.forEach((o,i)=>{if(Qm(o)&&o.contentDocument){const s=o.contentDocument.body,a=n0(s,!1);r.splice(i,1,...a)}}),r}function _f(e){return r0(e)&&!HE(e)}function r0(e){return e.matches(zl)&&Ul(e)}function HE(e){return Number.parseInt(e.getAttribute("tabindex")||"0",10)<0}function Ul(e,t){return e.nodeName!=="#comment"&&GE(e)&&VE(e,t)&&(!e.parentElement||Ul(e.parentElement,e))}function GE(e){if(!(e instanceof HTMLElement)&&!(e instanceof SVGElement))return!1;const{display:t,visibility:n}=e.style;let r=t!=="none"&&n!=="hidden"&&n!=="collapse";if(r){if(!e.ownerDocument.defaultView)return r;const{getComputedStyle:o}=e.ownerDocument.defaultView,{display:i,visibility:s}=o(e);r=i!=="none"&&s!=="hidden"&&s!=="collapse"}return r}function VE(e,t){return!e.hasAttribute("hidden")&&(e.nodeName==="DETAILS"&&t&&t.nodeName!=="SUMMARY"?e.hasAttribute("open"):!0)}function WE(e,t,n){const r=t?.tabbable?qE:zl,o=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode(i){return t?.from?.contains(i)?NodeFilter.FILTER_REJECT:i.matches(r)&&Ul(i)&&(!t?.accept||t.accept(i))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});return t?.from&&(o.currentNode=t.from),o}function Ef(e){let t=e;for(;t&&!YE(t);)t=t.parentElement;return t||document.scrollingElement||document.documentElement}function YE(e){const t=window.getComputedStyle(e);return/(auto|scroll)/.test(t.overflow+t.overflowX+t.overflowY)}function ZE(){}function XE(e){return[e.clientX,e.clientY]}function o0(e,t){const[n,r]=e;let o=!1;const i=t.length;for(let s=i,a=0,u=s-1;a<s;u=a++){const[c,l]=t[a],[d,g]=t[u],[,p]=t[u===0?s-1:u-1]||[0,0],h=(l-g)*(n-c)-(c-d)*(r-l);if(g<l){if(r>=g&&r<l){if(h===0)return!0;h>0&&(r===g?r>p&&(o=!o):o=!o)}}else if(l<g){if(r>l&&r<=g){if(h===0)return!0;h<0&&(r===g?r<p&&(o=!o):o=!o)}}else if(r===l&&(n>=d&&n<=c||n>=c&&n<=d))return!0}return o}function Re(e,t){return G(e,t)}var ci=new Map,Cf=new Set;function Sf(){if(typeof window>"u"||document.body===null)return;const e=n=>{if(!n.target)return;let r=ci.get(n.target);r||(r=new Set,ci.set(n.target,r),n.target.addEventListener("transitioncancel",t)),r.add(n.propertyName)},t=n=>{if(!n.target)return;const r=ci.get(n.target);if(r&&(r.delete(n.propertyName),r.size===0&&(n.target.removeEventListener("transitioncancel",t),ci.delete(n.target)),ci.size===0)){for(const o of Cf)o();Cf.clear()}};document.body.addEventListener("transitionrun",e),document.body.addEventListener("transitionend",t)}typeof document<"u"&&(document.readyState!=="loading"?Sf():document.addEventListener("DOMContentLoaded",Sf));function ol(e,t){const n=kf(e,t,"left"),r=kf(e,t,"top"),o=t.offsetWidth,i=t.offsetHeight;let s=e.scrollLeft,a=e.scrollTop;const u=s+e.offsetWidth,c=a+e.offsetHeight;n<=s?s=n:n+o>u&&(s+=n+o-u),r<=a?a=r:r+i>c&&(a+=r+i-c),e.scrollLeft=s,e.scrollTop=a}function kf(e,t,n){const r=n==="left"?"offsetLeft":"offsetTop";let o=0;for(;t.offsetParent&&(o+=t[r],t.offsetParent!==e);){if(t.offsetParent.contains(e)){o-=e[r];break}t=t.offsetParent}return o}function JE(e,t){if(document.contains(e)){const n=document.scrollingElement||document.documentElement;if(window.getComputedStyle(n).overflow==="hidden"){let o=Ef(e);for(;e&&o&&e!==n&&o!==n;)ol(o,e),e=o,o=Ef(e)}else{const{left:o,top:i}=e.getBoundingClientRect();e?.scrollIntoView?.({block:"nearest"});const{left:s,top:a}=e.getBoundingClientRect();(Math.abs(o-s)>1||Math.abs(i-a)>1)&&e.scrollIntoView?.({block:"nearest"})}}}var Sa={border:"0",clip:"rect(0 0 0 0)","clip-path":"inset(50%)",height:"1px",margin:"0 -1px -1px 0",overflow:"hidden",padding:"0",position:"absolute",width:"1px","white-space":"nowrap"},Mi="data-kb-top-layer",i0,il=!1,er=[];function Pi(e){return er.findIndex(t=>t.node===e)}function QE(e){return er[Pi(e)]}function eC(e){return er.length>0&&er[er.length-1].node===e}function s0(){return er.filter(e=>e.isPointerBlocking)}function tC(){return[...s0()].slice(-1)[0]}function Kl(){return s0().length>0}function a0(e){const t=Pi(tC()?.node);return Pi(e)<t}function nC(e){er.push(e)}function rC(e){const t=Pi(e);t<0||er.splice(t,1)}function oC(){for(const{node:e}of er)e.style.pointerEvents=a0(e)?"none":"auto"}function iC(e){if(Kl()&&!il){const t=tn(e);i0=document.body.style.pointerEvents,t.body.style.pointerEvents="none",il=!0}}function sC(e){if(Kl())return;const t=tn(e);t.body.style.pointerEvents=i0,t.body.style.length===0&&t.body.removeAttribute("style"),il=!1}var dn={layers:er,isTopMostLayer:eC,hasPointerBlockingLayer:Kl,isBelowPointerBlockingLayer:a0,addLayer:nC,removeLayer:rC,indexOf:Pi,find:QE,assignPointerEventToLayers:oC,disableBodyPointerEvents:iC,restoreBodyPointerEvents:sC};function ka(e,t){const[n,r]=I(Af(t?.()));return ae(()=>{r(e()?.tagName.toLowerCase()||Af(t?.()))}),n}function Af(e){return $o(e)?e:void 0}function ze(e){const[t,n]=me(e,["as"]);if(!t.as)throw new Error("[kobalte]: Polymorphic is missing the required `as` prop.");return f(sm,G(n,{get component(){return t.as}}))}var aC=Object.defineProperty,An=(e,t)=>{for(var n in t)aC(e,n,{get:t[n],enumerable:!0})},uC={};An(uC,{Button:()=>u0,Root:()=>ar});var cC=["button","color","file","image","reset","submit"];function lC(e){const t=e.tagName.toLowerCase();return t==="button"?!0:t==="input"&&e.type?cC.indexOf(e.type)!==-1:!1}function ar(e){let t;const n=Re({type:"button"},e),[r,o]=me(n,["ref","type","disabled"]),i=ka(()=>t,()=>"button"),s=ne(()=>{const c=i();return c==null?!1:lC({tagName:c,type:r.type})}),a=ne(()=>i()==="input"),u=ne(()=>i()==="a"&&t?.getAttribute("href")!=null);return f(ze,G({as:"button",ref(c){var l=tt(d=>t=d,r.ref);typeof l=="function"&&l(c)},get type(){return Q(()=>!!(s()||a()))()?r.type:void 0},get role(){return!s()&&!u()?"button":void 0},get tabIndex(){return!s()&&!u()&&!r.disabled?0:void 0},get disabled(){return Q(()=>!!(s()||a()))()?r.disabled:void 0},get"aria-disabled"(){return!s()&&!a()&&r.disabled?!0:void 0},get"data-disabled"(){return r.disabled?"":void 0}},o))}var u0=ar;function ht(e){return t=>(e(t),()=>e(void 0))}var Gt=e=>typeof e=="function"?e():e,dC=e=>{const t=ne(()=>{const s=Gt(e.element);if(s)return getComputedStyle(s)}),n=()=>t()?.animationName??"none",[r,o]=I(Gt(e.show)?"present":"hidden");let i="none";return ae(s=>{const a=Gt(e.show);return pt(()=>{if(s===a)return a;const u=i,c=n();a?o("present"):c==="none"||t()?.display==="none"?o("hidden"):o(s===!0&&u!==c?"hiding":"hidden")}),a}),ae(()=>{const s=Gt(e.element);if(!s)return;const a=c=>{c.target===s&&(i=n())},u=c=>{const d=n().includes(c.animationName);c.target===s&&d&&r()==="hiding"&&o("hidden")};s.addEventListener("animationstart",a),s.addEventListener("animationcancel",u),s.addEventListener("animationend",u),ue(()=>{s.removeEventListener("animationstart",a),s.removeEventListener("animationcancel",u),s.removeEventListener("animationend",u)})}),{present:()=>r()==="present"||r()==="hiding",state:r,setState:o}},fC=dC,nr=fC,gC={};An(gC,{CloseButton:()=>l0,Description:()=>d0,List:()=>g0,ProgressFill:()=>p0,ProgressTrack:()=>h0,Region:()=>m0,Root:()=>b0,Title:()=>y0,Toast:()=>lo,toaster:()=>Li,useToastContext:()=>Xi});var c0=dt();function Xi(){const e=ut(c0);if(e===void 0)throw new Error("[kobalte]: `useToastContext` must be used within a `Toast.Root` component");return e}function l0(e){const t=Xi(),[n,r]=me(e,["aria-label","onClick"]);return f(ar,G({get"aria-label"(){return n["aria-label"]||t.translations().close},onClick:i=>{Oe(i,n.onClick),t.close()}},r))}function d0(e){const t=Xi(),n=Re({id:t.generateId("description")},e),[r,o]=me(n,["id"]);return ae(()=>ue(t.registerDescriptionId(r.id))),f(ze,G({as:"div",get id(){return r.id}},o))}var f0=dt();function jl(){const e=ut(f0);if(e===void 0)throw new Error("[kobalte]: `useToastRegionContext` must be used within a `Toast.Region` component");return e}function g0(e){let t;const n=jl(),[r,o]=me(e,["ref","onFocusIn","onFocusOut","onPointerMove","onPointerLeave"]),i=c=>{Oe(c,r.onFocusIn),n.pauseOnInteraction()&&!n.isPaused()&&n.pauseAllTimer()},s=c=>{Oe(c,r.onFocusOut),Pt(t,c.relatedTarget)||n.resumeAllTimer()},a=c=>{Oe(c,r.onPointerMove),n.pauseOnInteraction()&&!n.isPaused()&&n.pauseAllTimer()},u=c=>{Oe(c,r.onPointerLeave),Pt(t,tn(t).activeElement)||n.resumeAllTimer()};return ae(_t([()=>t,()=>n.hotkey()],([c,l])=>{if(!c)return;const d=tn(c),g=p=>{l.every(m=>p[m]||p.code===m)&&Et(c)};d.addEventListener("keydown",g),ue(()=>d.removeEventListener("keydown",g))})),ae(()=>{if(!n.pauseOnPageIdle())return;const c=Fl(t);c.addEventListener("blur",n.pauseAllTimer),c.addEventListener("focus",n.resumeAllTimer),ue(()=>{c.removeEventListener("blur",n.pauseAllTimer),c.removeEventListener("focus",n.resumeAllTimer)})}),f(ze,G({as:"ol",ref(c){var l=tt(d=>t=d,r.ref);typeof l=="function"&&l(c)},tabIndex:-1,onFocusIn:i,onFocusOut:s,onPointerMove:a,onPointerLeave:u},o,{get children(){return f(ot,{get each(){return n.toasts()},children:c=>c.toastComponent({get toastId(){return c.id}})})}}))}function p0(e){const t=jl(),n=Xi(),[r,o]=me(e,["style"]),[i,s]=I(100);let a=0;return ae(()=>{if(t.isPaused()||n.isPersistent())return;const u=setInterval(()=>{const c=new Date().getTime()-n.closeTimerStartTime()+a,l=Math.trunc(100-c/n.duration()*100);s(l<0?0:l)});ue(()=>{a+=new Date().getTime()-n.closeTimerStartTime(),clearInterval(u)})}),f(ze,G({as:"div",get style(){return wn({"--kb-toast-progress-fill-width":`${i()}%`},r.style)}},o))}function h0(e){return f(ze,G({as:"div","aria-hidden":"true",role:"presentation"},e))}var[ql,Ji]=Nw({toasts:[]});function pC(e){Ji("toasts",t=>[...t,e])}function hC(e){return ql.toasts.find(t=>t.id===e)}function mC(e,t){const n=ql.toasts.findIndex(r=>r.id===e);n!==-1&&Ji("toasts",r=>[...r.slice(0,n),t,...r.slice(n+1)])}function bC(e){Ji("toasts",t=>t.id===e,"dismiss",!0)}function yC(e){Ji("toasts",t=>t.filter(n=>n.id!==e))}function vC(){Ji("toasts",[])}var po={toasts:()=>ql.toasts,add:pC,get:hC,update:mC,dismiss:bC,remove:yC,clear:vC},Tf="{hotkey}",wC={close:"Close"},xC={notifications:e=>`Notifications (${e})`};function m0(e){const t=Re({id:`toast-region-${Dt()}`,hotkey:["altKey","KeyT"],duration:5e3,limit:3,swipeDirection:"right",swipeThreshold:50,pauseOnInteraction:!0,pauseOnPageIdle:!0,topLayer:!0,translations:xC},e),[n,r]=me(t,["translations","style","hotkey","duration","limit","swipeDirection","swipeThreshold","pauseOnInteraction","pauseOnPageIdle","topLayer","aria-label","regionId"]),o=ne(()=>po.toasts().filter(g=>g.region===n.regionId&&g.dismiss===!1).slice(0,n.limit)),[i,s]=I(!1),a=()=>o().length>0,u=()=>n.hotkey.join("+").replace(/Key/g,"").replace(/Digit/g,""),c=()=>(n["aria-label"]||n.translations.notifications(Tf)).replace(Tf,u()),l=()=>({[Mi]:n.topLayer?"":void 0}),d={isPaused:i,toasts:o,hotkey:()=>n.hotkey,duration:()=>n.duration,swipeDirection:()=>n.swipeDirection,swipeThreshold:()=>n.swipeThreshold,pauseOnInteraction:()=>n.pauseOnInteraction,pauseOnPageIdle:()=>n.pauseOnPageIdle,pauseAllTimer:()=>s(!0),resumeAllTimer:()=>s(!1),generateId:nn(()=>r.id)};return f(f0.Provider,{value:d,get children(){return f(ze,G({as:"div",role:"region",tabIndex:-1,get"aria-label"(){return c()},get style(){return wn({"pointer-events":a()?n.topLayer?"auto":void 0:"none"},n.style)}},l,r))}})}var _C="toast.swipeStart",EC="toast.swipeMove",CC="toast.swipeCancel",SC="toast.swipeEnd";function b0(e){const t=jl(),n=Re({id:`toast-${Dt()}`,priority:"high",translations:wC},e),[r,o]=me(n,["ref","translations","toastId","style","priority","duration","persistent","onPause","onResume","onSwipeStart","onSwipeMove","onSwipeCancel","onSwipeEnd","onEscapeKeyDown","onKeyDown","onPointerDown","onPointerMove","onPointerUp"]),[i,s]=I(!0),[a,u]=I(),[c,l]=I(),[d,g]=I(!0),[p,h]=I(),{present:m}=nr({show:i,element:()=>p()??null}),y=ne(()=>r.duration||t.duration());let v,b=0,w=y(),E=null,C=null;const k=()=>{s(!1),g(!0)},T=()=>{po.remove(r.toastId)},S=N=>{!N||r.persistent||(window.clearTimeout(v),b=new Date().getTime(),v=window.setTimeout(k,N))},A=()=>{S(w),r.onResume?.()},F=()=>{const N=new Date().getTime()-b;w=w-N,window.clearTimeout(v),r.onPause?.()},O=N=>{Oe(N,r.onKeyDown),N.key==="Escape"&&(r.onEscapeKeyDown?.(N),N.defaultPrevented||k())},P=N=>{Oe(N,r.onPointerDown),N.button===0&&(E={x:N.clientX,y:N.clientY})},L=N=>{if(Oe(N,r.onPointerMove),!E)return;const Y=N.clientX-E.x,ce=N.clientY-E.y,V=!!C,j=["left","right"].includes(t.swipeDirection()),he=["left","up"].includes(t.swipeDirection())?Math.min:Math.max,K=j?he(0,Y):0,z=j?0:he(0,ce),J=N.pointerType==="touch"?10:2,re={x:K,y:z},ve={originalEvent:N,delta:re};if(V){C=re,_s(EC,r.onSwipeMove,ve);const{x:Z,y:M}=re;N.currentTarget.setAttribute("data-swipe","move"),N.currentTarget.style.setProperty("--kb-toast-swipe-move-x",`${Z}px`),N.currentTarget.style.setProperty("--kb-toast-swipe-move-y",`${M}px`)}else Df(re,t.swipeDirection(),J)?(C=re,_s(_C,r.onSwipeStart,ve),N.currentTarget.setAttribute("data-swipe","start"),N.target.setPointerCapture(N.pointerId)):(Math.abs(Y)>J||Math.abs(ce)>J)&&(E=null)},D=N=>{Oe(N,r.onPointerUp);const Y=C,ce=N.target;if(ce.hasPointerCapture(N.pointerId)&&ce.releasePointerCapture(N.pointerId),C=null,E=null,Y){const V=N.currentTarget,j={originalEvent:N,delta:Y};if(Df(Y,t.swipeDirection(),t.swipeThreshold())){_s(SC,r.onSwipeEnd,j);const{x:he,y:K}=Y;N.currentTarget.setAttribute("data-swipe","end"),N.currentTarget.style.removeProperty("--kb-toast-swipe-move-x"),N.currentTarget.style.removeProperty("--kb-toast-swipe-move-y"),N.currentTarget.style.setProperty("--kb-toast-swipe-end-x",`${he}px`),N.currentTarget.style.setProperty("--kb-toast-swipe-end-y",`${K}px`),k()}else _s(CC,r.onSwipeCancel,j),N.currentTarget.setAttribute("data-swipe","cancel"),N.currentTarget.style.removeProperty("--kb-toast-swipe-move-x"),N.currentTarget.style.removeProperty("--kb-toast-swipe-move-y"),N.currentTarget.style.removeProperty("--kb-toast-swipe-end-x"),N.currentTarget.style.removeProperty("--kb-toast-swipe-end-y");V.addEventListener("click",he=>he.preventDefault(),{once:!0})}};Sn(()=>{t.toasts().find(N=>N.id===r.toastId&&N.update)&&g(!1)}),ae(_t(()=>t.isPaused(),N=>{N?F():A()},{defer:!0})),ae(_t([i,y],([N,Y])=>{N&&!t.isPaused()&&S(Y)})),ae(_t(()=>po.get(r.toastId)?.dismiss,N=>N&&k())),ae(_t(()=>m(),N=>!N&&T()));const B={translations:()=>r.translations,close:k,duration:y,isPersistent:()=>r.persistent??!1,closeTimerStartTime:()=>b,generateId:nn(()=>o.id),registerTitleId:ht(u),registerDescriptionId:ht(l)};return f(q,{get when(){return m()},get children(){return f(c0.Provider,{value:B,get children(){return f(ze,G({as:"li",ref(N){var Y=tt(h,r.ref);typeof Y=="function"&&Y(N)},role:"status",tabIndex:0,get style(){return wn({animation:d()?void 0:"none","user-select":"none","touch-action":"none"},r.style)},get"aria-live"(){return r.priority==="high"?"assertive":"polite"},"aria-atomic":"true",get"aria-labelledby"(){return a()},get"aria-describedby"(){return c()},get"data-opened"(){return i()?"":void 0},get"data-closed"(){return i()?void 0:""},get"data-swipe-direction"(){return t.swipeDirection()},onKeyDown:O,onPointerDown:P,onPointerMove:L,onPointerUp:D},o))}})}})}function Df(e,t,n=0){const r=Math.abs(e.x),o=Math.abs(e.y),i=r>o;return t==="left"||t==="right"?i&&r>n:!i&&o>n}function _s(e,t,n){const r=n.originalEvent.currentTarget,o=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:n});t&&r.addEventListener(e,t,{once:!0}),r.dispatchEvent(o)}function y0(e){const t=Xi(),n=Re({id:t.generateId("title")},e),[r,o]=me(n,["id"]);return ae(()=>ue(t.registerTitleId(r.id))),f(ze,G({as:"div",get id(){return r.id}},o))}var kC=0;function v0(e,t){const n=kC++;return po.add({id:n,toastComponent:e,dismiss:!1,update:!1,region:t?.region}),n}function sl(e,t){po.update(e,{id:e,toastComponent:t,dismiss:!1,update:!0})}function AC(e,t,n){const r=v0(o=>t({get toastId(){return o.toastId},state:"pending"}),n);return(Yi(e)?e():e).then(o=>sl(r,i=>t({get toastId(){return i.toastId},state:"fulfilled",data:o}))).catch(o=>sl(r,i=>t({get toastId(){return i.toastId},state:"rejected",error:o}))),r}function TC(e){return po.dismiss(e),e}function DC(){po.clear()}var Li={show:v0,update:sl,promise:AC,dismiss:TC,clear:DC},lo=Object.assign(b0,{CloseButton:l0,Description:d0,List:g0,ProgressFill:p0,ProgressTrack:h0,Region:m0,Title:y0,toaster:Li});function Qi(e){const[t,n]=I(e.defaultValue?.()),r=ne(()=>e.value?.()!==void 0),o=ne(()=>r()?e.value?.():t());return[o,s=>{pt(()=>{const a=CE(s,o());return Object.is(a,o())||(r()||n(a),e.onChange?.(a)),a})}]}function w0(e){const[t,n]=Qi(e);return[()=>t()??!1,n]}function IC(e){const[t,n]=Qi(e);return[()=>t()??[],n]}function x0(e={}){const[t,n]=w0({value:()=>ee(e.isSelected),defaultValue:()=>!!ee(e.defaultIsSelected),onChange:i=>e.onSelectedChange?.(i)});return{isSelected:t,setIsSelected:i=>{!ee(e.isReadOnly)&&!ee(e.isDisabled)&&n(i)},toggle:()=>{!ee(e.isReadOnly)&&!ee(e.isDisabled)&&n(!t())}}}function _0(e){let t=e.startIndex??0;const n=e.startLevel??0,r=[],o=u=>{if(u==null)return"";const c=e.getKey??"key",l=$o(c)?u[c]:c(u);return l!=null?String(l):""},i=u=>{if(u==null)return"";const c=e.getTextValue??"textValue",l=$o(c)?u[c]:c(u);return l!=null?String(l):""},s=u=>{if(u==null)return!1;const c=e.getDisabled??"disabled";return($o(c)?u[c]:c(u))??!1},a=u=>{if(u!=null)return $o(e.getSectionChildren)?u[e.getSectionChildren]:e.getSectionChildren?.(u)};for(const u of e.dataSource){if($o(u)||OE(u)){r.push({type:"item",rawValue:u,key:String(u),textValue:String(u),disabled:s(u),level:n,index:t}),t++;continue}if(a(u)!=null){r.push({type:"section",rawValue:u,key:"",textValue:"",disabled:!1,level:n,index:t}),t++;const c=a(u)??[];if(c.length>0){const l=_0({dataSource:c,getKey:e.getKey,getTextValue:e.getTextValue,getDisabled:e.getDisabled,getSectionChildren:e.getSectionChildren,startIndex:t,startLevel:n+1});r.push(...l),t+=l.length}}else r.push({type:"item",rawValue:u,key:o(u),textValue:i(u),disabled:s(u),level:n,index:t}),t++}return r}function RC(e,t=[]){return ne(()=>{const n=_0({dataSource:ee(e.dataSource),getKey:ee(e.getKey),getTextValue:ee(e.getTextValue),getDisabled:ee(e.getDisabled),getSectionChildren:ee(e.getSectionChildren)});for(let r=0;r<t.length;r++)t[r]();return e.factory(n)})}var OC=new Set(["Avst","Arab","Armi","Syrc","Samr","Mand","Thaa","Mend","Nkoo","Adlm","Rohg","Hebr"]),NC=new Set(["ae","ar","arc","bcc","bqi","ckb","dv","fa","glk","he","ku","mzn","nqo","pnb","ps","sd","ug","ur","yi"]);function MC(e){if(Intl.Locale){const n=new Intl.Locale(e).maximize().script??"";return OC.has(n)}const t=e.split("-")[0];return NC.has(t)}function PC(e){return MC(e)?"rtl":"ltr"}function E0(){let e=typeof navigator<"u"&&(navigator.language||navigator.userLanguage)||"en-US";try{Intl.DateTimeFormat.supportedLocalesOf([e])}catch{e="en-US"}return{locale:e,direction:PC(e)}}var al=E0(),vi=new Set;function If(){al=E0();for(const e of vi)e(al)}function LC(){const[e,t]=I(al),n=ne(()=>e());return Sn(()=>{vi.size===0&&window.addEventListener("languagechange",If),vi.add(t),ue(()=>{vi.delete(t),vi.size===0&&window.removeEventListener("languagechange",If)})}),{locale:()=>n().locale,direction:()=>n().direction}}var $C=dt();function Zr(){const e=LC();return ut($C)||e}var lu=new Map;function C0(e){const{locale:t}=Zr(),n=ne(()=>t()+(e?Object.entries(e).sort((r,o)=>r[0]<o[0]?-1:1).join():""));return ne(()=>{const r=n();let o;return lu.has(r)&&(o=lu.get(r)),o||(o=new Intl.Collator(t(),e),lu.set(r,o)),o})}var Wn=class S0 extends Set{anchorKey;currentKey;constructor(t,n,r){super(t),t instanceof S0?(this.anchorKey=n||t.anchorKey,this.currentKey=r||t.currentKey):(this.anchorKey=n,this.currentKey=r)}};function FC(e){const[t,n]=Qi(e);return[()=>t()??new Wn,n]}function k0(e){return LE()?e.altKey:e.ctrlKey}function Fo(e){return Zi()?e.metaKey:e.ctrlKey}function Rf(e){return new Wn(e)}function A0(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function BC(e){const t=Re({selectionMode:"none",selectionBehavior:"toggle"},e),[n,r]=I(!1),[o,i]=I(),s=ne(()=>{const m=ee(t.selectedKeys);return m!=null?Rf(m):m}),a=ne(()=>{const m=ee(t.defaultSelectedKeys);return m!=null?Rf(m):new Wn}),[u,c]=FC({value:s,defaultValue:a,onChange:m=>t.onSelectionChange?.(m)}),[l,d]=I(ee(t.selectionBehavior)),g=()=>ee(t.selectionMode),p=()=>ee(t.disallowEmptySelection)??!1,h=m=>{(ee(t.allowDuplicateSelectionEvents)||!A0(m,u()))&&c(m)};return ae(()=>{const m=u();ee(t.selectionBehavior)==="replace"&&l()==="toggle"&&typeof m=="object"&&m.size===0&&d("replace")}),ae(()=>{d(ee(t.selectionBehavior)??"toggle")}),{selectionMode:g,disallowEmptySelection:p,selectionBehavior:l,setSelectionBehavior:d,isFocused:n,setFocused:r,focusedKey:o,setFocusedKey:i,selectedKeys:u,setSelectedKeys:h}}function T0(e){const[t,n]=I(""),[r,o]=I(-1);return{typeSelectHandlers:{onKeyDown:s=>{if(ee(e.isDisabled))return;const a=ee(e.keyboardDelegate),u=ee(e.selectionManager);if(!a.getKeyForSearch)return;const c=zC(s.key);if(!c||s.ctrlKey||s.metaKey)return;c===" "&&t().trim().length>0&&(s.preventDefault(),s.stopPropagation());let l=n(g=>g+c),d=a.getKeyForSearch(l,u.focusedKey())??a.getKeyForSearch(l);d==null&&UC(l)&&(l=l[0],d=a.getKeyForSearch(l,u.focusedKey())??a.getKeyForSearch(l)),d!=null&&(u.setFocusedKey(d),e.onTypeSelect?.(d)),clearTimeout(r()),o(window.setTimeout(()=>n(""),500))}}}}function zC(e){return e.length===1||!/^[A-Z]/i.test(e)?e:""}function UC(e){return e.split("").every(t=>t===e[0])}function KC(e,t,n){const o=G({selectOnFocus:()=>ee(e.selectionManager).selectionBehavior()==="replace"},e),i=()=>n?.()??t(),{direction:s}=Zr();let a={top:0,left:0};AE(()=>ee(o.isVirtualized)?void 0:i(),"scroll",()=>{const y=i();y&&(a={top:y.scrollTop,left:y.scrollLeft})});const{typeSelectHandlers:u}=T0({isDisabled:()=>ee(o.disallowTypeAhead),keyboardDelegate:()=>ee(o.keyboardDelegate),selectionManager:()=>ee(o.selectionManager)}),c=()=>ee(o.orientation)??"vertical",l=y=>{Oe(y,u.onKeyDown),y.altKey&&y.key==="Tab"&&y.preventDefault();const v=t();if(!v?.contains(y.target))return;const b=ee(o.selectionManager),w=ee(o.selectOnFocus),E=S=>{S!=null&&(b.setFocusedKey(S),y.shiftKey&&b.selectionMode()==="multiple"?b.extendSelection(S):w&&!k0(y)&&b.replaceSelection(S))},C=ee(o.keyboardDelegate),k=ee(o.shouldFocusWrap),T=b.focusedKey();switch(y.key){case(c()==="vertical"?"ArrowDown":"ArrowRight"):{if(C.getKeyBelow){y.preventDefault();let S;T!=null?S=C.getKeyBelow(T):S=C.getFirstKey?.(),S==null&&k&&(S=C.getFirstKey?.(T)),E(S)}break}case(c()==="vertical"?"ArrowUp":"ArrowLeft"):{if(C.getKeyAbove){y.preventDefault();let S;T!=null?S=C.getKeyAbove(T):S=C.getLastKey?.(),S==null&&k&&(S=C.getLastKey?.(T)),E(S)}break}case(c()==="vertical"?"ArrowLeft":"ArrowUp"):{if(C.getKeyLeftOf){y.preventDefault();const S=s()==="rtl";let A;T!=null?A=C.getKeyLeftOf(T):A=S?C.getFirstKey?.():C.getLastKey?.(),E(A)}break}case(c()==="vertical"?"ArrowRight":"ArrowDown"):{if(C.getKeyRightOf){y.preventDefault();const S=s()==="rtl";let A;T!=null?A=C.getKeyRightOf(T):A=S?C.getLastKey?.():C.getFirstKey?.(),E(A)}break}case"Home":if(C.getFirstKey){y.preventDefault();const S=C.getFirstKey(T,Fo(y));S!=null&&(b.setFocusedKey(S),Fo(y)&&y.shiftKey&&b.selectionMode()==="multiple"?b.extendSelection(S):w&&b.replaceSelection(S))}break;case"End":if(C.getLastKey){y.preventDefault();const S=C.getLastKey(T,Fo(y));S!=null&&(b.setFocusedKey(S),Fo(y)&&y.shiftKey&&b.selectionMode()==="multiple"?b.extendSelection(S):w&&b.replaceSelection(S))}break;case"PageDown":if(C.getKeyPageBelow&&T!=null){y.preventDefault();const S=C.getKeyPageBelow(T);E(S)}break;case"PageUp":if(C.getKeyPageAbove&&T!=null){y.preventDefault();const S=C.getKeyPageAbove(T);E(S)}break;case"a":Fo(y)&&b.selectionMode()==="multiple"&&ee(o.disallowSelectAll)!==!0&&(y.preventDefault(),b.selectAll());break;case"Escape":y.defaultPrevented||(y.preventDefault(),ee(o.disallowEmptySelection)||b.clearSelection());break;case"Tab":if(!ee(o.allowsTabNavigation)){if(y.shiftKey)v.focus();else{const S=WE(v,{tabbable:!0});let A,F;do F=S.lastChild(),F&&(A=F);while(F);A&&!A.contains(document.activeElement)&&Et(A)}break}}},d=y=>{const v=ee(o.selectionManager),b=ee(o.keyboardDelegate),w=ee(o.selectOnFocus);if(v.isFocused()){y.currentTarget.contains(y.target)||v.setFocused(!1);return}if(y.currentTarget.contains(y.target)){if(v.setFocused(!0),v.focusedKey()==null){const E=k=>{k!=null&&(v.setFocusedKey(k),w&&v.replaceSelection(k))},C=y.relatedTarget;C&&y.currentTarget.compareDocumentPosition(C)&Node.DOCUMENT_POSITION_FOLLOWING?E(v.lastSelectedKey()??b.getLastKey?.()):E(v.firstSelectedKey()??b.getFirstKey?.())}else if(!ee(o.isVirtualized)){const E=i();if(E){E.scrollTop=a.top,E.scrollLeft=a.left;const C=E.querySelector(`[data-key="${v.focusedKey()}"]`);C&&(Et(C),ol(E,C))}}}},g=y=>{const v=ee(o.selectionManager);y.currentTarget.contains(y.relatedTarget)||v.setFocused(!1)},p=y=>{i()===y.target&&y.preventDefault()},h=()=>{const y=ee(o.autoFocus);if(!y)return;const v=ee(o.selectionManager),b=ee(o.keyboardDelegate);let w;y==="first"&&(w=b.getFirstKey?.()),y==="last"&&(w=b.getLastKey?.());const E=v.selectedKeys();E.size&&(w=E.values().next().value),v.setFocused(!0),v.setFocusedKey(w);const C=t();C&&w==null&&!ee(o.shouldUseVirtualFocus)&&Et(C)};return Sn(()=>{o.deferAutoFocus?setTimeout(h,0):h()}),ae(_t([i,()=>ee(o.isVirtualized),()=>ee(o.selectionManager).focusedKey()],y=>{const[v,b,w]=y;if(b)w&&o.scrollToKey?.(w);else if(w&&v){const E=v.querySelector(`[data-key="${w}"]`);E&&ol(v,E)}})),{tabIndex:ne(()=>{if(!ee(o.shouldUseVirtualFocus))return ee(o.selectionManager).focusedKey()==null?0:-1}),onKeyDown:l,onMouseDown:p,onFocusIn:d,onFocusOut:g}}function Hl(e,t){const n=()=>ee(e.selectionManager),r=()=>ee(e.key),o=()=>ee(e.shouldUseVirtualFocus),i=b=>{n().selectionMode()!=="none"&&(n().selectionMode()==="single"?n().isSelected(r())&&!n().disallowEmptySelection()?n().toggleSelection(r()):n().replaceSelection(r()):b?.shiftKey?n().extendSelection(r()):n().selectionBehavior()==="toggle"||Fo(b)||"pointerType"in b&&b.pointerType==="touch"?n().toggleSelection(r()):n().replaceSelection(r()))},s=()=>n().isSelected(r()),a=()=>ee(e.disabled)||n().isDisabled(r()),u=()=>!a()&&n().canSelectItem(r());let c=null;const l=b=>{u()&&(c=b.pointerType,b.pointerType==="mouse"&&b.button===0&&!ee(e.shouldSelectOnPressUp)&&i(b))},d=b=>{u()&&b.pointerType==="mouse"&&b.button===0&&ee(e.shouldSelectOnPressUp)&&ee(e.allowsDifferentPressOrigin)&&i(b)},g=b=>{u()&&(ee(e.shouldSelectOnPressUp)&&!ee(e.allowsDifferentPressOrigin)||c!=="mouse")&&i(b)},p=b=>{!u()||!["Enter"," "].includes(b.key)||(k0(b)?n().toggleSelection(r()):i(b))},h=b=>{a()&&b.preventDefault()},m=b=>{const w=t();o()||a()||!w||b.target===w&&n().setFocusedKey(r())},y=ne(()=>{if(!(o()||a()))return r()===n().focusedKey()?0:-1}),v=ne(()=>ee(e.virtualized)?void 0:r());return ae(_t([t,r,o,()=>n().focusedKey(),()=>n().isFocused()],([b,w,E,C,k])=>{b&&w===C&&k&&!E&&document.activeElement!==b&&(e.focus?e.focus():Et(b))})),{isSelected:s,isDisabled:a,allowsSelection:u,tabIndex:y,dataKey:v,onPointerDown:l,onPointerUp:d,onClick:g,onKeyDown:p,onMouseDown:h,onFocus:m}}var jC=class{collection;state;constructor(e,t){this.collection=e,this.state=t}selectionMode(){return this.state.selectionMode()}disallowEmptySelection(){return this.state.disallowEmptySelection()}selectionBehavior(){return this.state.selectionBehavior()}setSelectionBehavior(e){this.state.setSelectionBehavior(e)}isFocused(){return this.state.isFocused()}setFocused(e){this.state.setFocused(e)}focusedKey(){return this.state.focusedKey()}setFocusedKey(e){(e==null||this.collection().getItem(e))&&this.state.setFocusedKey(e)}selectedKeys(){return this.state.selectedKeys()}isSelected(e){if(this.state.selectionMode()==="none")return!1;const t=this.getKey(e);return t==null?!1:this.state.selectedKeys().has(t)}isEmpty(){return this.state.selectedKeys().size===0}isSelectAll(){if(this.isEmpty())return!1;const e=this.state.selectedKeys();return this.getAllSelectableKeys().every(t=>e.has(t))}firstSelectedKey(){let e;for(const t of this.state.selectedKeys()){const n=this.collection().getItem(t),r=n?.index!=null&&e?.index!=null&&n.index<e.index;(!e||r)&&(e=n)}return e?.key}lastSelectedKey(){let e;for(const t of this.state.selectedKeys()){const n=this.collection().getItem(t),r=n?.index!=null&&e?.index!=null&&n.index>e.index;(!e||r)&&(e=n)}return e?.key}extendSelection(e){if(this.selectionMode()==="none")return;if(this.selectionMode()==="single"){this.replaceSelection(e);return}const t=this.getKey(e);if(t==null)return;const n=this.state.selectedKeys(),r=n.anchorKey||t,o=new Wn(n,r,t);for(const i of this.getKeyRange(r,n.currentKey||t))o.delete(i);for(const i of this.getKeyRange(t,r))this.canSelectItem(i)&&o.add(i);this.state.setSelectedKeys(o)}getKeyRange(e,t){const n=this.collection().getItem(e),r=this.collection().getItem(t);return n&&r?n.index!=null&&r.index!=null&&n.index<=r.index?this.getKeyRangeInternal(e,t):this.getKeyRangeInternal(t,e):[]}getKeyRangeInternal(e,t){const n=[];let r=e;for(;r!=null;){const o=this.collection().getItem(r);if(o&&o.type==="item"&&n.push(r),r===t)return n;r=this.collection().getKeyAfter(r)}return[]}getKey(e){const t=this.collection().getItem(e);return t?!t||t.type!=="item"?null:t.key:e}toggleSelection(e){if(this.selectionMode()==="none")return;if(this.selectionMode()==="single"&&!this.isSelected(e)){this.replaceSelection(e);return}const t=this.getKey(e);if(t==null)return;const n=new Wn(this.state.selectedKeys());n.has(t)?n.delete(t):this.canSelectItem(t)&&(n.add(t),n.anchorKey=t,n.currentKey=t),!(this.disallowEmptySelection()&&n.size===0)&&this.state.setSelectedKeys(n)}replaceSelection(e){if(this.selectionMode()==="none")return;const t=this.getKey(e);if(t==null)return;const n=this.canSelectItem(t)?new Wn([t],t,t):new Wn;this.state.setSelectedKeys(n)}setSelectedKeys(e){if(this.selectionMode()==="none")return;const t=new Wn;for(const n of e){const r=this.getKey(n);if(r!=null&&(t.add(r),this.selectionMode()==="single"))break}this.state.setSelectedKeys(t)}selectAll(){this.selectionMode()==="multiple"&&this.state.setSelectedKeys(new Set(this.getAllSelectableKeys()))}clearSelection(){const e=this.state.selectedKeys();!this.disallowEmptySelection()&&e.size>0&&this.state.setSelectedKeys(new Wn)}toggleSelectAll(){this.isSelectAll()?this.clearSelection():this.selectAll()}select(e,t){this.selectionMode()!=="none"&&(this.selectionMode()==="single"?this.isSelected(e)&&!this.disallowEmptySelection()?this.toggleSelection(e):this.replaceSelection(e):this.selectionBehavior()==="toggle"||t&&t.pointerType==="touch"?this.toggleSelection(e):this.replaceSelection(e))}isSelectionEqual(e){if(e===this.state.selectedKeys())return!0;const t=this.selectedKeys();if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;for(const n of t)if(!e.has(n))return!1;return!0}canSelectItem(e){if(this.state.selectionMode()==="none")return!1;const t=this.collection().getItem(e);return t!=null&&!t.disabled}isDisabled(e){const t=this.collection().getItem(e);return!t||t.disabled}getAllSelectableKeys(){const e=[];return(n=>{for(;n!=null;){if(this.canSelectItem(n)){const r=this.collection().getItem(n);if(!r)continue;r.type==="item"&&e.push(n)}n=this.collection().getKeyAfter(n)}})(this.collection().getFirstKey()),e}},Of=class{keyMap=new Map;iterable;firstKey;lastKey;constructor(e){this.iterable=e;for(const r of e)this.keyMap.set(r.key,r);if(this.keyMap.size===0)return;let t,n=0;for(const[r,o]of this.keyMap)t?(t.nextKey=r,o.prevKey=t.key):(this.firstKey=r,o.prevKey=void 0),o.type==="item"&&(o.index=n++),t=o,t.nextKey=void 0;this.lastKey=t.key}*[Symbol.iterator](){yield*this.iterable}getSize(){return this.keyMap.size}getKeys(){return this.keyMap.keys()}getKeyBefore(e){return this.keyMap.get(e)?.prevKey}getKeyAfter(e){return this.keyMap.get(e)?.nextKey}getFirstKey(){return this.firstKey}getLastKey(){return this.lastKey}getItem(e){return this.keyMap.get(e)}at(e){const t=[...this.getKeys()];return this.getItem(t[e])}};function Gl(e){const t=BC(e),r=RC({dataSource:()=>ee(e.dataSource),getKey:()=>ee(e.getKey),getTextValue:()=>ee(e.getTextValue),getDisabled:()=>ee(e.getDisabled),getSectionChildren:()=>ee(e.getSectionChildren),factory:i=>e.filter?new Of(e.filter(i)):new Of(i)},[()=>e.filter]),o=new jC(r,t);return Hc(()=>{const i=t.focusedKey();i!=null&&!r().getItem(i)&&t.setFocusedKey(void 0)}),{collection:r,selectionManager:()=>o}}var D0=dt();function I0(){return ut(D0)}function qC(){const e=I0();if(e===void 0)throw new Error("[kobalte]: `useDomCollectionContext` must be used within a `DomCollectionProvider` component");return e}function R0(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}function HC(e,t){const n=t.ref();if(!n)return-1;let r=e.length;if(!r)return-1;for(;r--;){const o=e[r]?.ref();if(o&&R0(o,n))return r+1}return 0}function GC(e){const t=e.map((r,o)=>[o,r]);let n=!1;return t.sort(([r,o],[i,s])=>{const a=o.ref(),u=s.ref();return a===u||!a||!u?0:R0(a,u)?(r>i&&(n=!0),-1):(r<i&&(n=!0),1)}),n?t.map(([r,o])=>o):e}function O0(e,t){const n=GC(e);e!==n&&t(n)}function VC(e){const t=e[0],n=e[e.length-1]?.ref();let r=t?.ref()?.parentElement;for(;r;){if(n&&r.contains(n))return r;r=r.parentElement}return tn(r).body}function WC(e,t){ae(()=>{const n=setTimeout(()=>{O0(e(),t)});ue(()=>clearTimeout(n))})}function YC(e,t){if(typeof IntersectionObserver!="function"){WC(e,t);return}let n=[];ae(()=>{const r=()=>{const s=!!n.length;n=e(),s&&O0(e(),t)},o=VC(e()),i=new IntersectionObserver(r,{root:o});for(const s of e()){const a=s.ref();a&&i.observe(a)}ue(()=>i.disconnect())})}function ZC(e={}){const[t,n]=IC({value:()=>ee(e.items),onChange:i=>e.onItemsChange?.(i)});YC(t,n);const r=i=>(n(s=>{const a=HC(s,i);return RE(s,i,a)}),()=>{n(s=>{const a=s.filter(u=>u.ref()!==i.ref());return s.length===a.length?s:a})});return{DomCollectionProvider:i=>f(D0.Provider,{value:{registerItem:r},get children(){return i.children}})}}function XC(e){const t=qC(),n=Re({shouldRegisterItem:!0},e);ae(()=>{if(!n.shouldRegisterItem)return;const r=t.registerItem(n.getItem());ue(r)})}const JC=["top","right","bottom","left"],qr=Math.min,fn=Math.max,oa=Math.round,Es=Math.floor,tr=e=>({x:e,y:e}),QC={left:"right",right:"left",bottom:"top",top:"bottom"};function ul(e,t,n){return fn(e,qr(t,n))}function vo(e,t){return typeof e=="function"?e(t):e}function Hr(e){return e.split("-")[0]}function ii(e){return e.split("-")[1]}function N0(e){return e==="x"?"y":"x"}function Vl(e){return e==="y"?"height":"width"}function xr(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function Wl(e){return N0(xr(e))}function eS(e,t,n){n===void 0&&(n=!1);const r=ii(e),o=Wl(e),i=Vl(o);let s=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=ia(s)),[s,ia(s)]}function tS(e){const t=ia(e);return[cl(e),t,cl(t)]}function cl(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const Nf=["left","right"],Mf=["right","left"],nS=["top","bottom"],rS=["bottom","top"];function oS(e,t,n){switch(e){case"top":case"bottom":return n?t?Mf:Nf:t?Nf:Mf;case"left":case"right":return t?nS:rS;default:return[]}}function iS(e,t,n,r){const o=ii(e);let i=oS(Hr(e),n==="start",r);return o&&(i=i.map(s=>s+"-"+o),t&&(i=i.concat(i.map(cl)))),i}function ia(e){const t=Hr(e);return QC[t]+e.slice(t.length)}function sS(e){return{top:0,right:0,bottom:0,left:0,...e}}function M0(e){return typeof e!="number"?sS(e):{top:e,right:e,bottom:e,left:e}}function sa(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function Pf(e,t,n){let{reference:r,floating:o}=e;const i=xr(t),s=Wl(t),a=Vl(s),u=Hr(t),c=i==="y",l=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,g=r[a]/2-o[a]/2;let p;switch(u){case"top":p={x:l,y:r.y-o.height};break;case"bottom":p={x:l,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:d};break;case"left":p={x:r.x-o.width,y:d};break;default:p={x:r.x,y:r.y}}switch(ii(t)){case"start":p[s]-=g*(n&&c?-1:1);break;case"end":p[s]+=g*(n&&c?-1:1);break}return p}async function aS(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:i,rects:s,elements:a,strategy:u}=e,{boundary:c="clippingAncestors",rootBoundary:l="viewport",elementContext:d="floating",altBoundary:g=!1,padding:p=0}=vo(t,e),h=M0(p),y=a[g?d==="floating"?"reference":"floating":d],v=sa(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(y)))==null||n?y:y.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(a.floating)),boundary:c,rootBoundary:l,strategy:u})),b=d==="floating"?{x:r,y:o,width:s.floating.width,height:s.floating.height}:s.reference,w=await(i.getOffsetParent==null?void 0:i.getOffsetParent(a.floating)),E=await(i.isElement==null?void 0:i.isElement(w))?await(i.getScale==null?void 0:i.getScale(w))||{x:1,y:1}:{x:1,y:1},C=sa(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:b,offsetParent:w,strategy:u}):b);return{top:(v.top-C.top+h.top)/E.y,bottom:(C.bottom-v.bottom+h.bottom)/E.y,left:(v.left-C.left+h.left)/E.x,right:(C.right-v.right+h.right)/E.x}}const uS=50,cS=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:s}=n,a=s.detectOverflow?s:{...s,detectOverflow:aS},u=await(s.isRTL==null?void 0:s.isRTL(t));let c=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:l,y:d}=Pf(c,r,u),g=r,p=0;const h={};for(let m=0;m<i.length;m++){const y=i[m];if(!y)continue;const{name:v,fn:b}=y,{x:w,y:E,data:C,reset:k}=await b({x:l,y:d,initialPlacement:r,placement:g,strategy:o,middlewareData:h,rects:c,platform:a,elements:{reference:e,floating:t}});l=w??l,d=E??d,h[v]={...h[v],...C},k&&p<uS&&(p++,typeof k=="object"&&(k.placement&&(g=k.placement),k.rects&&(c=k.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:o}):k.rects),{x:l,y:d}=Pf(c,g,u)),m=-1)}return{x:l,y:d,placement:g,strategy:o,middlewareData:h}},lS=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:s,elements:a,middlewareData:u}=t,{element:c,padding:l=0}=vo(e,t)||{};if(c==null)return{};const d=M0(l),g={x:n,y:r},p=Wl(o),h=Vl(p),m=await s.getDimensions(c),y=p==="y",v=y?"top":"left",b=y?"bottom":"right",w=y?"clientHeight":"clientWidth",E=i.reference[h]+i.reference[p]-g[p]-i.floating[h],C=g[p]-i.reference[p],k=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c));let T=k?k[w]:0;(!T||!await(s.isElement==null?void 0:s.isElement(k)))&&(T=a.floating[w]||i.floating[h]);const S=E/2-C/2,A=T/2-m[h]/2-1,F=qr(d[v],A),O=qr(d[b],A),P=F,L=T-m[h]-O,D=T/2-m[h]/2+S,B=ul(P,D,L),N=!u.arrow&&ii(o)!=null&&D!==B&&i.reference[h]/2-(D<P?F:O)-m[h]/2<0,Y=N?D<P?D-P:D-L:0;return{[p]:g[p]+Y,data:{[p]:B,centerOffset:D-B-Y,...N&&{alignmentOffset:Y}},reset:N}}}),dS=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:s,initialPlacement:a,platform:u,elements:c}=t,{mainAxis:l=!0,crossAxis:d=!0,fallbackPlacements:g,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:m=!0,...y}=vo(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const v=Hr(o),b=xr(a),w=Hr(a)===a,E=await(u.isRTL==null?void 0:u.isRTL(c.floating)),C=g||(w||!m?[ia(a)]:tS(a)),k=h!=="none";!g&&k&&C.push(...iS(a,m,h,E));const T=[a,...C],S=await u.detectOverflow(t,y),A=[];let F=((r=i.flip)==null?void 0:r.overflows)||[];if(l&&A.push(S[v]),d){const D=eS(o,s,E);A.push(S[D[0]],S[D[1]])}if(F=[...F,{placement:o,overflows:A}],!A.every(D=>D<=0)){var O,P;const D=(((O=i.flip)==null?void 0:O.index)||0)+1,B=T[D];if(B&&(!(d==="alignment"?b!==xr(B):!1)||F.every(ce=>xr(ce.placement)===b?ce.overflows[0]>0:!0)))return{data:{index:D,overflows:F},reset:{placement:B}};let N=(P=F.filter(Y=>Y.overflows[0]<=0).sort((Y,ce)=>Y.overflows[1]-ce.overflows[1])[0])==null?void 0:P.placement;if(!N)switch(p){case"bestFit":{var L;const Y=(L=F.filter(ce=>{if(k){const V=xr(ce.placement);return V===b||V==="y"}return!0}).map(ce=>[ce.placement,ce.overflows.filter(V=>V>0).reduce((V,j)=>V+j,0)]).sort((ce,V)=>ce[1]-V[1])[0])==null?void 0:L[0];Y&&(N=Y);break}case"initialPlacement":N=a;break}if(o!==N)return{reset:{placement:N}}}return{}}}};function Lf(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function $f(e){return JC.some(t=>e[t]>=0)}const fS=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:o="referenceHidden",...i}=vo(e,t);switch(o){case"referenceHidden":{const s=await r.detectOverflow(t,{...i,elementContext:"reference"}),a=Lf(s,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:$f(a)}}}case"escaped":{const s=await r.detectOverflow(t,{...i,altBoundary:!0}),a=Lf(s,n.floating);return{data:{escapedOffsets:a,escaped:$f(a)}}}default:return{}}}}},gS=new Set(["left","top"]);async function pS(e,t){const{placement:n,platform:r,elements:o}=e,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),s=Hr(n),a=ii(n),u=xr(n)==="y",c=gS.has(s)?-1:1,l=i&&u?-1:1,d=vo(t,e);let{mainAxis:g,crossAxis:p,alignmentAxis:h}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&typeof h=="number"&&(p=a==="end"?h*-1:h),u?{x:p*l,y:g*c}:{x:g*c,y:p*l}}const hS=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:s,middlewareData:a}=t,u=await pS(t,e);return s===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:o+u.x,y:i+u.y,data:{...u,placement:s}}}}},mS=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o,platform:i}=t,{mainAxis:s=!0,crossAxis:a=!1,limiter:u={fn:v=>{let{x:b,y:w}=v;return{x:b,y:w}}},...c}=vo(e,t),l={x:n,y:r},d=await i.detectOverflow(t,c),g=xr(Hr(o)),p=N0(g);let h=l[p],m=l[g];if(s){const v=p==="y"?"top":"left",b=p==="y"?"bottom":"right",w=h+d[v],E=h-d[b];h=ul(w,h,E)}if(a){const v=g==="y"?"top":"left",b=g==="y"?"bottom":"right",w=m+d[v],E=m-d[b];m=ul(w,m,E)}const y=u.fn({...t,[p]:h,[g]:m});return{...y,data:{x:y.x-n,y:y.y-r,enabled:{[p]:s,[g]:a}}}}}},bS=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:i,platform:s,elements:a}=t,{apply:u=()=>{},...c}=vo(e,t),l=await s.detectOverflow(t,c),d=Hr(o),g=ii(o),p=xr(o)==="y",{width:h,height:m}=i.floating;let y,v;d==="top"||d==="bottom"?(y=d,v=g===(await(s.isRTL==null?void 0:s.isRTL(a.floating))?"start":"end")?"left":"right"):(v=d,y=g==="end"?"top":"bottom");const b=m-l.top-l.bottom,w=h-l.left-l.right,E=qr(m-l[y],b),C=qr(h-l[v],w),k=!t.middlewareData.shift;let T=E,S=C;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(S=w),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(T=b),k&&!g){const F=fn(l.left,0),O=fn(l.right,0),P=fn(l.top,0),L=fn(l.bottom,0);p?S=h-2*(F!==0||O!==0?F+O:fn(l.left,l.right)):T=m-2*(P!==0||L!==0?P+L:fn(l.top,l.bottom))}await u({...t,availableWidth:S,availableHeight:T});const A=await s.getDimensions(a.floating);return h!==A.width||m!==A.height?{reset:{rects:!0}}:{}}}};function Aa(){return typeof window<"u"}function si(e){return P0(e)?(e.nodeName||"").toLowerCase():"#document"}function bn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ur(e){var t;return(t=(P0(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function P0(e){return Aa()?e instanceof Node||e instanceof bn(e).Node:!1}function $n(e){return Aa()?e instanceof Element||e instanceof bn(e).Element:!1}function kr(e){return Aa()?e instanceof HTMLElement||e instanceof bn(e).HTMLElement:!1}function Ff(e){return!Aa()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof bn(e).ShadowRoot}function es(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Fn(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&o!=="inline"&&o!=="contents"}function yS(e){return/^(table|td|th)$/.test(si(e))}function Ta(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const vS=/transform|translate|scale|rotate|perspective|filter/,wS=/paint|layout|strict|content/,oo=e=>!!e&&e!=="none";let du;function Yl(e){const t=$n(e)?Fn(e):e;return oo(t.transform)||oo(t.translate)||oo(t.scale)||oo(t.rotate)||oo(t.perspective)||!Zl()&&(oo(t.backdropFilter)||oo(t.filter))||vS.test(t.willChange||"")||wS.test(t.contain||"")}function xS(e){let t=Gr(e);for(;kr(t)&&!Wo(t);){if(Yl(t))return t;if(Ta(t))return null;t=Gr(t)}return null}function Zl(){return du==null&&(du=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),du}function Wo(e){return/^(html|body|#document)$/.test(si(e))}function Fn(e){return bn(e).getComputedStyle(e)}function Da(e){return $n(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Gr(e){if(si(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Ff(e)&&e.host||ur(e);return Ff(t)?t.host:t}function L0(e){const t=Gr(e);return Wo(t)?e.ownerDocument?e.ownerDocument.body:e.body:kr(t)&&es(t)?t:L0(t)}function $i(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=L0(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),s=bn(o);if(i){const a=ll(s);return t.concat(s,s.visualViewport||[],es(o)?o:[],a&&n?$i(a):[])}else return t.concat(o,$i(o,[],n))}function ll(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function $0(e){const t=Fn(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=kr(e),i=o?e.offsetWidth:n,s=o?e.offsetHeight:r,a=oa(n)!==i||oa(r)!==s;return a&&(n=i,r=s),{width:n,height:r,$:a}}function Xl(e){return $n(e)?e:e.contextElement}function jo(e){const t=Xl(e);if(!kr(t))return tr(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=$0(t);let s=(i?oa(n.width):n.width)/r,a=(i?oa(n.height):n.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const _S=tr(0);function F0(e){const t=bn(e);return!Zl()||!t.visualViewport?_S:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function ES(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==bn(e)?!1:t}function ho(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=Xl(e);let s=tr(1);t&&(r?$n(r)&&(s=jo(r)):s=jo(e));const a=ES(i,n,r)?F0(i):tr(0);let u=(o.left+a.x)/s.x,c=(o.top+a.y)/s.y,l=o.width/s.x,d=o.height/s.y;if(i){const g=bn(i),p=r&&$n(r)?bn(r):r;let h=g,m=ll(h);for(;m&&r&&p!==h;){const y=jo(m),v=m.getBoundingClientRect(),b=Fn(m),w=v.left+(m.clientLeft+parseFloat(b.paddingLeft))*y.x,E=v.top+(m.clientTop+parseFloat(b.paddingTop))*y.y;u*=y.x,c*=y.y,l*=y.x,d*=y.y,u+=w,c+=E,h=bn(m),m=ll(h)}}return sa({width:l,height:d,x:u,y:c})}function Ia(e,t){const n=Da(e).scrollLeft;return t?t.left+n:ho(ur(e)).left+n}function B0(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-Ia(e,n),o=n.top+t.scrollTop;return{x:r,y:o}}function CS(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i=o==="fixed",s=ur(r),a=t?Ta(t.floating):!1;if(r===s||a&&i)return n;let u={scrollLeft:0,scrollTop:0},c=tr(1);const l=tr(0),d=kr(r);if((d||!d&&!i)&&((si(r)!=="body"||es(s))&&(u=Da(r)),d)){const p=ho(r);c=jo(r),l.x=p.x+r.clientLeft,l.y=p.y+r.clientTop}const g=s&&!d&&!i?B0(s,u):tr(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-u.scrollLeft*c.x+l.x+g.x,y:n.y*c.y-u.scrollTop*c.y+l.y+g.y}}function SS(e){return Array.from(e.getClientRects())}function kS(e){const t=ur(e),n=Da(e),r=e.ownerDocument.body,o=fn(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=fn(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+Ia(e);const a=-n.scrollTop;return Fn(r).direction==="rtl"&&(s+=fn(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:s,y:a}}const Bf=25;function AS(e,t){const n=bn(e),r=ur(e),o=n.visualViewport;let i=r.clientWidth,s=r.clientHeight,a=0,u=0;if(o){i=o.width,s=o.height;const l=Zl();(!l||l&&t==="fixed")&&(a=o.offsetLeft,u=o.offsetTop)}const c=Ia(r);if(c<=0){const l=r.ownerDocument,d=l.body,g=getComputedStyle(d),p=l.compatMode==="CSS1Compat"&&parseFloat(g.marginLeft)+parseFloat(g.marginRight)||0,h=Math.abs(r.clientWidth-d.clientWidth-p);h<=Bf&&(i-=h)}else c<=Bf&&(i+=c);return{width:i,height:s,x:a,y:u}}function TS(e,t){const n=ho(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=kr(e)?jo(e):tr(1),s=e.clientWidth*i.x,a=e.clientHeight*i.y,u=o*i.x,c=r*i.y;return{width:s,height:a,x:u,y:c}}function zf(e,t,n){let r;if(t==="viewport")r=AS(e,n);else if(t==="document")r=kS(ur(e));else if($n(t))r=TS(t,n);else{const o=F0(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return sa(r)}function z0(e,t){const n=Gr(e);return n===t||!$n(n)||Wo(n)?!1:Fn(n).position==="fixed"||z0(n,t)}function DS(e,t){const n=t.get(e);if(n)return n;let r=$i(e,[],!1).filter(a=>$n(a)&&si(a)!=="body"),o=null;const i=Fn(e).position==="fixed";let s=i?Gr(e):e;for(;$n(s)&&!Wo(s);){const a=Fn(s),u=Yl(s);!u&&a.position==="fixed"&&(o=null),(i?!u&&!o:!u&&a.position==="static"&&!!o&&(o.position==="absolute"||o.position==="fixed")||es(s)&&!u&&z0(e,s))?r=r.filter(l=>l!==s):o=a,s=Gr(s)}return t.set(e,r),r}function IS(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const s=[...n==="clippingAncestors"?Ta(t)?[]:DS(t,this._c):[].concat(n),r],a=zf(t,s[0],o);let u=a.top,c=a.right,l=a.bottom,d=a.left;for(let g=1;g<s.length;g++){const p=zf(t,s[g],o);u=fn(p.top,u),c=qr(p.right,c),l=qr(p.bottom,l),d=fn(p.left,d)}return{width:c-d,height:l-u,x:d,y:u}}function RS(e){const{width:t,height:n}=$0(e);return{width:t,height:n}}function OS(e,t,n){const r=kr(t),o=ur(t),i=n==="fixed",s=ho(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const u=tr(0);function c(){u.x=Ia(o)}if(r||!r&&!i)if((si(t)!=="body"||es(o))&&(a=Da(t)),r){const p=ho(t,!0,i,t);u.x=p.x+t.clientLeft,u.y=p.y+t.clientTop}else o&&c();i&&!r&&o&&c();const l=o&&!r&&!i?B0(o,a):tr(0),d=s.left+a.scrollLeft-u.x-l.x,g=s.top+a.scrollTop-u.y-l.y;return{x:d,y:g,width:s.width,height:s.height}}function fu(e){return Fn(e).position==="static"}function Uf(e,t){if(!kr(e)||Fn(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return ur(e)===n&&(n=n.ownerDocument.body),n}function U0(e,t){const n=bn(e);if(Ta(e))return n;if(!kr(e)){let o=Gr(e);for(;o&&!Wo(o);){if($n(o)&&!fu(o))return o;o=Gr(o)}return n}let r=Uf(e,t);for(;r&&yS(r)&&fu(r);)r=Uf(r,t);return r&&Wo(r)&&fu(r)&&!Yl(r)?n:r||xS(e)||n}const NS=async function(e){const t=this.getOffsetParent||U0,n=this.getDimensions,r=await n(e.floating);return{reference:OS(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function MS(e){return Fn(e).direction==="rtl"}const K0={convertOffsetParentRelativeRectToViewportRelativeRect:CS,getDocumentElement:ur,getClippingRect:IS,getOffsetParent:U0,getElementRects:NS,getClientRects:SS,getDimensions:RS,getScale:jo,isElement:$n,isRTL:MS};function j0(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function PS(e,t){let n=null,r;const o=ur(e);function i(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function s(a,u){a===void 0&&(a=!1),u===void 0&&(u=1),i();const c=e.getBoundingClientRect(),{left:l,top:d,width:g,height:p}=c;if(a||t(),!g||!p)return;const h=Es(d),m=Es(o.clientWidth-(l+g)),y=Es(o.clientHeight-(d+p)),v=Es(l),w={rootMargin:-h+"px "+-m+"px "+-y+"px "+-v+"px",threshold:fn(0,qr(1,u))||1};let E=!0;function C(k){const T=k[0].intersectionRatio;if(T!==u){if(!E)return s();T?s(!1,T):r=setTimeout(()=>{s(!1,1e-7)},1e3)}T===1&&!j0(c,e.getBoundingClientRect())&&s(),E=!1}try{n=new IntersectionObserver(C,{...w,root:o.ownerDocument})}catch{n=new IntersectionObserver(C,w)}n.observe(e)}return s(!0),i}function LS(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:u=!1}=r,c=Xl(e),l=o||i?[...c?$i(c):[],...t?$i(t):[]]:[];l.forEach(v=>{o&&v.addEventListener("scroll",n,{passive:!0}),i&&v.addEventListener("resize",n)});const d=c&&a?PS(c,n):null;let g=-1,p=null;s&&(p=new ResizeObserver(v=>{let[b]=v;b&&b.target===c&&p&&t&&(p.unobserve(t),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var w;(w=p)==null||w.observe(t)})),n()}),c&&!u&&p.observe(c),t&&p.observe(t));let h,m=u?ho(e):null;u&&y();function y(){const v=ho(e);m&&!j0(m,v)&&n(),m=v,h=requestAnimationFrame(y)}return n(),()=>{var v;l.forEach(b=>{o&&b.removeEventListener("scroll",n),i&&b.removeEventListener("resize",n)}),d?.(),(v=p)==null||v.disconnect(),p=null,u&&cancelAnimationFrame(h)}}const $S=hS,FS=mS,BS=dS,zS=bS,US=fS,KS=lS,jS=(e,t,n)=>{const r=new Map,o={platform:K0,...n},i={...o.platform,_c:r};return cS(e,t,{...o,platform:i})};var qS=$('<svg display=block viewBox="0 0 30 30"style=transform:scale(1.02)><g><path fill=none d=M23,27.8c1.1,1.2,3.4,2.2,5,2.2h2H0h2c1.7,0,3.9-1,5-2.2l6.6-7.2c0.7-0.8,2-0.8,2.7,0L23,27.8L23,27.8z></path><path stroke=none d=M23,27.8c1.1,1.2,3.4,2.2,5,2.2h2H0h2c1.7,0,3.9-1,5-2.2l6.6-7.2c0.7-0.8,2-0.8,2.7,0L23,27.8L23,27.8z>'),Jl=dt();function Ql(){const e=ut(Jl);if(e===void 0)throw new Error("[kobalte]: `usePopperContext` must be used within a `Popper` component");return e}var dl=30,Kf=dl/2,HS={top:180,right:-90,bottom:0,left:90};function Ar(e){const t=Ql(),n=Re({size:dl},e),[r,o]=me(n,["ref","style","size"]),i=()=>t.currentPlacement().split("-")[0],s=GS(t.contentRef),a=()=>s()?.getPropertyValue("background-color")||"none",u=()=>s()?.getPropertyValue(`border-${i()}-color`)||"none",c=()=>s()?.getPropertyValue(`border-${i()}-width`)||"0px",l=()=>Number.parseInt(c())*2*(dl/r.size),d=()=>`rotate(${HS[i()]} ${Kf} ${Kf}) translate(0 2)`;return f(ze,G({as:"div",ref(g){var p=tt(t.setArrowRef,r.ref);typeof p=="function"&&p(g)},"aria-hidden":"true",get style(){return wn({position:"absolute","font-size":`${r.size}px`,width:"1em",height:"1em","pointer-events":"none",fill:a(),stroke:u(),"stroke-width":l()},r.style)}},o,{get children(){var g=qS(),p=g.firstChild,h=p.firstChild;return h.nextSibling,Me(()=>Ke(p,"transform",d())),g}}))}function GS(e){const[t,n]=I();return ae(()=>{const r=e();r&&n(Fl(r).getComputedStyle(r))}),t}function VS(e){const t=Ql(),[n,r]=me(e,["ref","style"]);return f(ze,G({as:"div",ref(o){var i=tt(t.setPositionerRef,n.ref);typeof i=="function"&&i(o)},"data-popper-positioner":"",get style(){return wn({position:"absolute",top:0,left:0,"min-width":"max-content"},n.style)}},r))}function jf(e){const{x:t=0,y:n=0,width:r=0,height:o=0}=e??{};if(typeof DOMRect=="function")return new DOMRect(t,n,r,o);const i={x:t,y:n,width:r,height:o,top:n,right:t+r,bottom:n+o,left:t};return{...i,toJSON:()=>i}}function WS(e,t){return{contextElement:e,getBoundingClientRect:()=>{const r=t(e);return r?jf(r):e?e.getBoundingClientRect():jf()}}}function YS(e){return/^(?:top|bottom|left|right)(?:-(?:start|end))?$/.test(e)}var ZS={top:"bottom",right:"left",bottom:"top",left:"right"};function XS(e,t){const[n,r]=e.split("-"),o=ZS[n];return r?n==="left"||n==="right"?`${o} ${r==="start"?"top":"bottom"}`:r==="start"?`${o} ${t==="rtl"?"right":"left"}`:`${o} ${t==="rtl"?"left":"right"}`:`${o} center`}function JS(e){const t=Re({getAnchorRect:g=>g?.getBoundingClientRect(),placement:"bottom",gutter:0,shift:0,flip:!0,slide:!0,overlap:!1,sameWidth:!1,fitViewport:!1,hideWhenDetached:!1,detachedPadding:0,arrowPadding:4,overflowPadding:8},e),[n,r]=I(),[o,i]=I(),[s,a]=I(t.placement),u=()=>WS(t.anchorRef?.(),t.getAnchorRect),{direction:c}=Zr();async function l(){const g=u(),p=n(),h=o();if(!g||!p)return;const m=(h?.clientHeight||0)/2,y=typeof t.gutter=="number"?t.gutter+m:t.gutter??m;p.style.setProperty("--kb-popper-content-overflow-padding",`${t.overflowPadding}px`),g.getBoundingClientRect();const v=[$S(({placement:k})=>{const T=!!k.split("-")[1];return{mainAxis:y,crossAxis:T?void 0:t.shift,alignmentAxis:t.shift}})];if(t.flip!==!1){const k=typeof t.flip=="string"?t.flip.split(" "):void 0;if(k!==void 0&&!k.every(YS))throw new Error("`flip` expects a spaced-delimited list of placements");v.push(BS({padding:t.overflowPadding,fallbackPlacements:k}))}(t.slide||t.overlap)&&v.push(FS({mainAxis:t.slide,crossAxis:t.overlap,padding:t.overflowPadding})),v.push(zS({padding:t.overflowPadding,apply({availableWidth:k,availableHeight:T,rects:S}){const A=Math.round(S.reference.width);k=Math.floor(k),T=Math.floor(T),p.style.setProperty("--kb-popper-anchor-width",`${A}px`),p.style.setProperty("--kb-popper-content-available-width",`${k}px`),p.style.setProperty("--kb-popper-content-available-height",`${T}px`),t.sameWidth&&(p.style.width=`${A}px`),t.fitViewport&&(p.style.maxWidth=`${k}px`,p.style.maxHeight=`${T}px`)}})),t.hideWhenDetached&&v.push(US({padding:t.detachedPadding})),h&&v.push(KS({element:h,padding:t.arrowPadding}));const b=await jS(g,p,{placement:t.placement,strategy:"absolute",middleware:v,platform:{...K0,isRTL:()=>c()==="rtl"}});if(a(b.placement),t.onCurrentPlacementChange?.(b.placement),!p)return;p.style.setProperty("--kb-popper-content-transform-origin",XS(b.placement,c()));const w=Math.round(b.x),E=Math.round(b.y);let C;if(t.hideWhenDetached&&(C=b.middlewareData.hide?.referenceHidden?"hidden":"visible"),Object.assign(p.style,{top:"0",left:"0",transform:`translate3d(${w}px, ${E}px, 0)`,visibility:C}),h&&b.middlewareData.arrow){const{x:k,y:T}=b.middlewareData.arrow,S=b.placement.split("-")[0];Object.assign(h.style,{left:k!=null?`${k}px`:"",top:T!=null?`${T}px`:"",[S]:"100%"})}}ae(()=>{const g=u(),p=n();if(!g||!p)return;const h=LS(g,p,l,{elementResize:typeof ResizeObserver=="function"});ue(h)}),ae(()=>{const g=n(),p=t.contentRef?.();!g||!p||queueMicrotask(()=>{g.style.zIndex=getComputedStyle(p).zIndex})});const d={currentPlacement:s,contentRef:()=>t.contentRef?.(),setPositionerRef:r,setArrowRef:i};return f(Jl.Provider,{value:d,get children(){return t.children}})}var Xr=Object.assign(JS,{Arrow:Ar,Context:Jl,usePopperContext:Ql,Positioner:VS});function QS(e){const t=n=>{n.key===Ca.Escape&&e.onEscapeKeyDown?.(n)};ae(()=>{if(ee(e.isDisabled))return;const n=e.ownerDocument?.()??tn();n.addEventListener("keydown",t),ue(()=>{n.removeEventListener("keydown",t)})})}var qf="interactOutside.pointerDownOutside",Hf="interactOutside.focusOutside";function ek(e,t){let n,r=ZE;const o=()=>tn(t()),i=d=>e.onPointerDownOutside?.(d),s=d=>e.onFocusOutside?.(d),a=d=>e.onInteractOutside?.(d),u=d=>{const g=d.target;return!(g instanceof Element)||g.closest(`[${Mi}]`)||!Pt(o(),g)||Pt(t(),g)?!1:!e.shouldExcludeElement?.(g)},c=d=>{function g(){const p=t(),h=d.target;if(!p||!h||!u(d))return;const m=gt([i,a]);h.addEventListener(qf,m,{once:!0});const y=new CustomEvent(qf,{bubbles:!1,cancelable:!0,detail:{originalEvent:d,isContextMenu:d.button===2||BE(d)&&d.button===0}});h.dispatchEvent(y)}d.pointerType==="touch"?(o().removeEventListener("click",g),r=g,o().addEventListener("click",g,{once:!0})):g()},l=d=>{const g=t(),p=d.target;if(!g||!p||!u(d))return;const h=gt([s,a]);p.addEventListener(Hf,h,{once:!0});const m=new CustomEvent(Hf,{bubbles:!1,cancelable:!0,detail:{originalEvent:d,isContextMenu:!1}});p.dispatchEvent(m)};ae(()=>{ee(e.isDisabled)||(n=window.setTimeout(()=>{o().addEventListener("pointerdown",c,!0)},0),o().addEventListener("focusin",l,!0),ue(()=>{window.clearTimeout(n),o().removeEventListener("click",r),o().removeEventListener("pointerdown",c,!0),o().removeEventListener("focusin",l,!0)}))})}var q0=dt();function tk(){return ut(q0)}function ts(e){let t;const n=tk(),[r,o]=me(e,["ref","disableOutsidePointerEvents","excludedElements","onEscapeKeyDown","onPointerDownOutside","onFocusOutside","onInteractOutside","onDismiss","bypassTopMostLayerCheck"]),i=new Set([]),s=d=>{i.add(d);const g=n?.registerNestedLayer(d);return()=>{i.delete(d),g?.()}};ek({shouldExcludeElement:d=>t?r.excludedElements?.some(g=>Pt(g(),d))||[...i].some(g=>Pt(g,d)):!1,onPointerDownOutside:d=>{!t||dn.isBelowPointerBlockingLayer(t)||!r.bypassTopMostLayerCheck&&!dn.isTopMostLayer(t)||(r.onPointerDownOutside?.(d),r.onInteractOutside?.(d),d.defaultPrevented||r.onDismiss?.())},onFocusOutside:d=>{r.onFocusOutside?.(d),r.onInteractOutside?.(d),d.defaultPrevented||r.onDismiss?.()}},()=>t),QS({ownerDocument:()=>tn(t),onEscapeKeyDown:d=>{!t||!dn.isTopMostLayer(t)||(r.onEscapeKeyDown?.(d),!d.defaultPrevented&&r.onDismiss&&(d.preventDefault(),r.onDismiss()))}}),Sn(()=>{if(!t)return;dn.addLayer({node:t,isPointerBlocking:r.disableOutsidePointerEvents,dismiss:r.onDismiss});const d=n?.registerNestedLayer(t);dn.assignPointerEventToLayers(),dn.disableBodyPointerEvents(t),ue(()=>{t&&(dn.removeLayer(t),d?.(),dn.assignPointerEventToLayers(),dn.restoreBodyPointerEvents(t))})}),ae(_t([()=>t,()=>r.disableOutsidePointerEvents],([d,g])=>{if(!d)return;const p=dn.find(d);p&&p.isPointerBlocking!==g&&(p.isPointerBlocking=g,dn.assignPointerEventToLayers()),g&&dn.disableBodyPointerEvents(d),ue(()=>{dn.restoreBodyPointerEvents(d)})},{defer:!0}));const l={registerNestedLayer:s};return f(q0.Provider,{value:l,get children(){return f(ze,G({as:"div",ref(d){var g=tt(p=>t=p,r.ref);typeof g=="function"&&g(d)}},o))}})}function wo(e={}){const[t,n]=w0({value:()=>ee(e.open),defaultValue:()=>!!ee(e.defaultOpen),onChange:s=>e.onOpenChange?.(s)}),r=()=>{n(!0)},o=()=>{n(!1)};return{isOpen:t,setIsOpen:n,open:r,close:o,toggle:()=>{t()?o():r()}}}var nk={};An(nk,{Arrow:()=>Ar,Content:()=>G0,Portal:()=>V0,Root:()=>W0,Tooltip:()=>Fi,Trigger:()=>Y0,useTooltipContext:()=>Ra});var H0=dt();function Ra(){const e=ut(H0);if(e===void 0)throw new Error("[kobalte]: `useTooltipContext` must be used within a `Tooltip` component");return e}function G0(e){const t=Ra(),n=Re({id:t.generateId("content")},e),[r,o]=me(n,["ref","style"]);return ae(()=>ue(t.registerContentId(o.id))),f(q,{get when(){return t.contentPresent()},get children(){return f(Xr.Positioner,{get children(){return f(ts,G({ref(i){var s=tt(a=>{t.setContentRef(a)},r.ref);typeof s=="function"&&s(i)},role:"tooltip",disableOutsidePointerEvents:!1,get style(){return wn({"--kb-tooltip-content-transform-origin":"var(--kb-popper-content-transform-origin)",position:"relative"},r.style)},onFocusOutside:i=>i.preventDefault(),onDismiss:()=>t.hideTooltip(!0)},()=>t.dataset(),o))}})}})}function V0(e){const t=Ra();return f(q,{get when(){return t.contentPresent()},get children(){return f(Gi,e)}})}function rk(e,t,n){const r=e.split("-")[0],o=t.getBoundingClientRect(),i=n.getBoundingClientRect(),s=[],a=o.left+o.width/2,u=o.top+o.height/2;switch(r){case"top":s.push([o.left,u]),s.push([i.left,i.bottom]),s.push([i.left,i.top]),s.push([i.right,i.top]),s.push([i.right,i.bottom]),s.push([o.right,u]);break;case"right":s.push([a,o.top]),s.push([i.left,i.top]),s.push([i.right,i.top]),s.push([i.right,i.bottom]),s.push([i.left,i.bottom]),s.push([a,o.bottom]);break;case"bottom":s.push([o.left,u]),s.push([i.left,i.top]),s.push([i.left,i.bottom]),s.push([i.right,i.bottom]),s.push([i.right,i.top]),s.push([o.right,u]);break;case"left":s.push([a,o.top]),s.push([i.right,i.top]),s.push([i.left,i.top]),s.push([i.left,i.bottom]),s.push([i.right,i.bottom]),s.push([a,o.bottom]);break}return s}var io={},ok=0,Ro=!1,br,li,Oo;function W0(e){const t=`tooltip-${Dt()}`,n=`${++ok}`,r=Re({id:t,openDelay:700,closeDelay:300,skipDelayDuration:300},e),[o,i]=me(r,["id","open","defaultOpen","onOpenChange","disabled","triggerOnFocusOnly","openDelay","closeDelay","skipDelayDuration","ignoreSafeArea","forceMount","onCurrentPlacementChange"]);let s;const[a,u]=I(),[c,l]=I(),[d,g]=I(),[p,h]=I(i.placement),m=wo({open:()=>o.open,defaultOpen:()=>o.defaultOpen,onOpenChange:D=>o.onOpenChange?.(D)}),{present:y}=nr({show:()=>o.forceMount||m.isOpen(),element:()=>d()??null}),v=()=>{io[n]=w},b=()=>{for(const D in io)D!==n&&(io[D](!0),delete io[D])},w=(D=!1)=>{D||o.closeDelay&&o.closeDelay<=0?(window.clearTimeout(s),s=void 0,m.close()):s||(s=window.setTimeout(()=>{s=void 0,m.close()},o.closeDelay)),window.clearTimeout(br),br=void 0,o.skipDelayDuration&&o.skipDelayDuration>=0&&(Oo=window.setTimeout(()=>{window.clearTimeout(Oo),Oo=void 0},o.skipDelayDuration)),Ro&&(window.clearTimeout(li),li=window.setTimeout(()=>{delete io[n],li=void 0,Ro=!1},o.closeDelay))},E=()=>{clearTimeout(s),s=void 0,b(),v(),Ro=!0,m.open(),window.clearTimeout(br),br=void 0,window.clearTimeout(li),li=void 0,window.clearTimeout(Oo),Oo=void 0},C=()=>{b(),v(),!m.isOpen()&&!br&&!Ro?br=window.setTimeout(()=>{br=void 0,Ro=!0,E()},o.openDelay):m.isOpen()||E()},k=(D=!1)=>{!D&&o.openDelay&&o.openDelay>0&&!s&&!Oo?C():E()},T=()=>{window.clearTimeout(br),br=void 0,Ro=!1},S=()=>{window.clearTimeout(s),s=void 0},A=D=>Pt(c(),D)||Pt(d(),D),F=D=>{const B=c(),N=d();if(!(!B||!N))return rk(D,B,N)},O=D=>{const B=D.target;if(A(B)){S();return}if(!o.ignoreSafeArea){const N=F(p());if(N&&o0(XE(D),N)){S();return}}s||w()};ae(()=>{if(!m.isOpen())return;const D=tn();D.addEventListener("pointermove",O,!0),ue(()=>{D.removeEventListener("pointermove",O,!0)})}),ae(()=>{const D=c();if(!D||!m.isOpen())return;const B=Y=>{const ce=Y.target;Pt(ce,D)&&w(!0)},N=Fl();N.addEventListener("scroll",B,{capture:!0}),ue(()=>{N.removeEventListener("scroll",B,{capture:!0})})}),ue(()=>{clearTimeout(s),io[n]&&delete io[n]});const L={dataset:ne(()=>({"data-expanded":m.isOpen()?"":void 0,"data-closed":m.isOpen()?void 0:""})),isOpen:m.isOpen,isDisabled:()=>o.disabled??!1,triggerOnFocusOnly:()=>o.triggerOnFocusOnly??!1,contentId:a,contentPresent:y,openTooltip:k,hideTooltip:w,cancelOpening:T,generateId:nn(()=>r.id),registerContentId:ht(u),isTargetOnTooltip:A,setTriggerRef:l,setContentRef:g};return f(H0.Provider,{value:L,get children(){return f(Xr,G({anchorRef:c,contentRef:d,onCurrentPlacementChange:D=>{h(D),o.onCurrentPlacementChange?.(D)}},i))}})}function Y0(e){let t;const n=Ra(),[r,o]=me(e,["ref","onPointerEnter","onPointerLeave","onPointerDown","onClick","onFocus","onBlur"]);let i=!1,s=!1,a=!1;const u=()=>{i=!1},c=()=>{!n.isOpen()&&(s||a)&&n.openTooltip(a)},l=v=>{n.isOpen()&&!s&&!a&&n.hideTooltip(v)},d=v=>{Oe(v,r.onPointerEnter),!(v.pointerType==="touch"||n.triggerOnFocusOnly()||n.isDisabled()||v.defaultPrevented)&&(s=!0,c())},g=v=>{Oe(v,r.onPointerLeave),v.pointerType!=="touch"&&(s=!1,a=!1,n.isOpen()?l():n.cancelOpening())},p=v=>{Oe(v,r.onPointerDown),i=!0,tn(t).addEventListener("pointerup",u,{once:!0})},h=v=>{Oe(v,r.onClick),s=!1,a=!1,l(!0)},m=v=>{Oe(v,r.onFocus),!(n.isDisabled()||v.defaultPrevented||i)&&(a=!0,c())},y=v=>{Oe(v,r.onBlur);const b=v.relatedTarget;n.isTargetOnTooltip(b)||(s=!1,a=!1,l(!0))};return ue(()=>{tn(t).removeEventListener("pointerup",u)}),f(ze,G({as:"button",ref(v){var b=tt(w=>{n.setTriggerRef(w),t=w},r.ref);typeof b=="function"&&b(v)},get"aria-describedby"(){return Q(()=>!!n.isOpen())()?n.contentId():void 0},onPointerEnter:d,onPointerLeave:g,onPointerDown:p,onClick:h,onFocus:m,onBlur:y},()=>n.dataset(),o))}var Fi=Object.assign(W0,{Arrow:Ar,Content:G0,Portal:V0,Trigger:Y0}),ed=["id","name","validationState","required","disabled","readOnly"];function td(e){const t=`form-control-${Dt()}`,n=Re({id:t},e),[r,o]=I(),[i,s]=I(),[a,u]=I(),[c,l]=I(),d=(m,y,v)=>{const b=v!=null||r()!=null;return[v,r(),b&&y!=null?m:void 0].filter(Boolean).join(" ")||void 0},g=m=>[a(),c(),m].filter(Boolean).join(" ")||void 0,p=ne(()=>({"data-valid":ee(n.validationState)==="valid"?"":void 0,"data-invalid":ee(n.validationState)==="invalid"?"":void 0,"data-required":ee(n.required)?"":void 0,"data-disabled":ee(n.disabled)?"":void 0,"data-readonly":ee(n.readOnly)?"":void 0}));return{formControlContext:{name:()=>ee(n.name)??ee(n.id),dataset:p,validationState:()=>ee(n.validationState),isRequired:()=>ee(n.required),isDisabled:()=>ee(n.disabled),isReadOnly:()=>ee(n.readOnly),labelId:r,fieldId:i,descriptionId:a,errorMessageId:c,getAriaLabelledBy:d,getAriaDescribedBy:g,generateId:nn(()=>ee(n.id)),registerLabel:ht(o),registerField:ht(s),registerDescription:ht(u),registerErrorMessage:ht(l)}}}var Oa=dt();function Tn(){const e=ut(Oa);if(e===void 0)throw new Error("[kobalte]: `useFormControlContext` must be used within a `FormControlContext.Provider` component");return e}function ns(e){const t=Tn(),n=Re({id:t.generateId("description")},e);return ae(()=>ue(t.registerDescription(n.id))),f(ze,G({as:"div"},()=>t.dataset(),n))}var ik=$("<option>"),sk=$("<div aria-hidden=true><input type=text style=font-size:16px><select tabindex=-1><option>");function ak(e){let t;const[n,r]=me(e,["ref","onChange","collection","selectionManager","isOpen","isMultiple","isVirtualized","focusTrigger"]),o=Tn(),[i,s]=I(!1),a=u=>{const c=n.collection.getItem(u);return f(q,{get when(){return c?.type==="item"},get children(){var l=ik();return l.value=u,x(l,()=>c?.textValue),Me(()=>l.selected=n.selectionManager.isSelected(u)),l}})};return ae(_t(()=>n.selectionManager.selectedKeys(),(u,c)=>{c&&A0(u,c)||(s(!0),t?.dispatchEvent(new Event("input",{bubbles:!0,cancelable:!0})),t?.dispatchEvent(new Event("change",{bubbles:!0,cancelable:!0})))},{defer:!0})),(()=>{var u=sk(),c=u.firstChild,l=c.nextSibling;l.firstChild,c.addEventListener("focus",()=>n.focusTrigger()),l.addEventListener("change",g=>{Oe(g,n.onChange),i()||n.selectionManager.setSelectedKeys(new Set([g.target.value])),s(!1)});var d=tt(g=>t=g,n.ref);return typeof d=="function"&&Ln(d,l),sr(l,G({get multiple(){return n.isMultiple},get name(){return o.name()},get required(){return o.isRequired()},get disabled(){return o.isDisabled()},get size(){return n.collection.getSize()},get value(){return n.selectionManager.firstSelectedKey()??""}},r),!1,!0),x(l,f(q,{get when(){return n.isVirtualized},get fallback(){return f(ot,{get each(){return[...n.collection.getKeys()]},children:a})},get children(){return f(ot,{get each(){return[...n.selectionManager.selectedKeys()]},children:a})}}),null),Me(g=>{var p=Sa,h=n.selectionManager.isFocused()||n.isOpen?-1:0,m=o.isRequired(),y=o.isDisabled(),v=o.isReadOnly();return g.e=Vo(u,p,g.e),h!==g.t&&Ke(c,"tabindex",g.t=h),m!==g.a&&(c.required=g.a=m),y!==g.o&&(c.disabled=g.o=y),v!==g.i&&(c.readOnly=g.i=v),g},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),u})()}var Gf=new WeakMap;function uk(e){let t=Gf.get(e);if(t!=null)return t;t=0;for(const n of e)n.type==="item"&&t++;return Gf.set(e,t),t}var Z0=class{collection;ref;collator;constructor(e,t,n){this.collection=e,this.ref=t,this.collator=n}getKeyBelow(e){let t=this.collection().getKeyAfter(e);for(;t!=null;){const n=this.collection().getItem(t);if(n&&n.type==="item"&&!n.disabled)return t;t=this.collection().getKeyAfter(t)}}getKeyAbove(e){let t=this.collection().getKeyBefore(e);for(;t!=null;){const n=this.collection().getItem(t);if(n&&n.type==="item"&&!n.disabled)return t;t=this.collection().getKeyBefore(t)}}getFirstKey(){let e=this.collection().getFirstKey();for(;e!=null;){const t=this.collection().getItem(e);if(t&&t.type==="item"&&!t.disabled)return e;e=this.collection().getKeyAfter(e)}}getLastKey(){let e=this.collection().getLastKey();for(;e!=null;){const t=this.collection().getItem(e);if(t&&t.type==="item"&&!t.disabled)return e;e=this.collection().getKeyBefore(e)}}getItem(e){return this.ref?.()?.querySelector(`[data-key="${e}"]`)??null}getKeyPageAbove(e){const t=this.ref?.();let n=this.getItem(e);if(!t||!n)return;const r=Math.max(0,n.offsetTop+n.offsetHeight-t.offsetHeight);let o=e;for(;o&&n&&n.offsetTop>r;)o=this.getKeyAbove(o),n=o!=null?this.getItem(o):null;return o}getKeyPageBelow(e){const t=this.ref?.();let n=this.getItem(e);if(!t||!n)return;const r=Math.min(t.scrollHeight,n.offsetTop-n.offsetHeight+t.offsetHeight);let o=e;for(;o&&n&&n.offsetTop<r;)o=this.getKeyBelow(o),n=o!=null?this.getItem(o):null;return o}getKeyForSearch(e,t){const n=this.collator?.();if(!n)return;let r=t!=null?this.getKeyBelow(t):this.getFirstKey();for(;r!=null;){const o=this.collection().getItem(r);if(o){const i=o.textValue.slice(0,e.length);if(o.textValue&&n.compare(i,e)===0)return r}r=this.getKeyBelow(r)}}};function X0(e,t,n){const r=C0({usage:"search",sensitivity:"base"}),o=ne(()=>{const i=ee(e.keyboardDelegate);return i||new Z0(e.collection,t,r)});return KC({selectionManager:()=>ee(e.selectionManager),keyboardDelegate:o,autoFocus:()=>ee(e.autoFocus),deferAutoFocus:()=>ee(e.deferAutoFocus),shouldFocusWrap:()=>ee(e.shouldFocusWrap),disallowEmptySelection:()=>ee(e.disallowEmptySelection),selectOnFocus:()=>ee(e.selectOnFocus),disallowTypeAhead:()=>ee(e.disallowTypeAhead),shouldUseVirtualFocus:()=>ee(e.shouldUseVirtualFocus),allowsTabNavigation:()=>ee(e.allowsTabNavigation),isVirtualized:()=>ee(e.isVirtualized),scrollToKey:i=>ee(e.scrollToKey)?.(i),orientation:()=>ee(e.orientation)},t,n)}var ck={};An(ck,{Item:()=>Na,ItemDescription:()=>Ma,ItemIndicator:()=>Pa,ItemLabel:()=>La,Listbox:()=>lk,Root:()=>rd,Section:()=>$a,useListboxContext:()=>Q0});var J0=dt();function Q0(){const e=ut(J0);if(e===void 0)throw new Error("[kobalte]: `useListboxContext` must be used within a `Listbox` component");return e}var eb=dt();function nd(){const e=ut(eb);if(e===void 0)throw new Error("[kobalte]: `useListboxItemContext` must be used within a `Listbox.Item` component");return e}function Na(e){let t;const n=Q0(),r=`${n.generateId("item")}-${Dt()}`,o=Re({id:r},e),[i,s]=me(o,["ref","item","aria-label","aria-labelledby","aria-describedby","onPointerMove","onPointerDown","onPointerUp","onClick","onKeyDown","onMouseDown","onFocus"]),[a,u]=I(),[c,l]=I(),d=()=>n.listState().selectionManager(),g=()=>d().focusedKey()===i.item.key,p=Hl({key:()=>i.item.key,selectionManager:d,shouldSelectOnPressUp:n.shouldSelectOnPressUp,allowsDifferentPressOrigin:()=>n.shouldSelectOnPressUp()&&n.shouldFocusOnHover(),shouldUseVirtualFocus:n.shouldUseVirtualFocus,disabled:()=>i.item.disabled},()=>t),h=()=>{if(d().selectionMode()!=="none")return p.isSelected()},m=ne(()=>!(Zi()&&$E())),y=()=>m()?i["aria-label"]:void 0,v=()=>m()?a():void 0,b=()=>m()?c():void 0,w=()=>{if(!n.isVirtualized())return;const S=n.listState().collection().getItem(i.item.key)?.index;return S!=null?S+1:void 0},E=()=>{if(n.isVirtualized())return uk(n.listState().collection())},C=S=>{Oe(S,i.onPointerMove),S.pointerType==="mouse"&&!p.isDisabled()&&n.shouldFocusOnHover()&&(Et(S.currentTarget),d().setFocused(!0),d().setFocusedKey(i.item.key))},k=ne(()=>({"data-disabled":p.isDisabled()?"":void 0,"data-selected":p.isSelected()?"":void 0,"data-highlighted":g()?"":void 0})),T={isSelected:p.isSelected,dataset:k,generateId:nn(()=>s.id),registerLabelId:ht(u),registerDescriptionId:ht(l)};return f(eb.Provider,{value:T,get children(){return f(ze,G({as:"li",ref(S){var A=tt(F=>t=F,i.ref);typeof A=="function"&&A(S)},role:"option",get tabIndex(){return p.tabIndex()},get"aria-disabled"(){return p.isDisabled()},get"aria-selected"(){return h()},get"aria-label"(){return y()},get"aria-labelledby"(){return v()},get"aria-describedby"(){return b()},get"aria-posinset"(){return w()},get"aria-setsize"(){return E()},get"data-key"(){return p.dataKey()},get onPointerDown(){return gt([i.onPointerDown,p.onPointerDown])},get onPointerUp(){return gt([i.onPointerUp,p.onPointerUp])},get onClick(){return gt([i.onClick,p.onClick])},get onKeyDown(){return gt([i.onKeyDown,p.onKeyDown])},get onMouseDown(){return gt([i.onMouseDown,p.onMouseDown])},get onFocus(){return gt([i.onFocus,p.onFocus])},onPointerMove:C},k,s))}})}function Ma(e){const t=nd(),n=Re({id:t.generateId("description")},e);return ae(()=>ue(t.registerDescriptionId(n.id))),f(ze,G({as:"div"},()=>t.dataset(),n))}function Pa(e){const t=nd(),n=Re({id:t.generateId("indicator")},e),[r,o]=me(n,["forceMount"]);return f(q,{get when(){return r.forceMount||t.isSelected()},get children(){return f(ze,G({as:"div","aria-hidden":"true"},()=>t.dataset(),o))}})}function La(e){const t=nd(),n=Re({id:t.generateId("label")},e);return ae(()=>ue(t.registerLabelId(n.id))),f(ze,G({as:"div"},()=>t.dataset(),n))}function rd(e){let t;const n=`listbox-${Dt()}`,r=Re({id:n,selectionMode:"single",virtualized:!1},e),[o,i]=me(r,["ref","children","renderItem","renderSection","value","defaultValue","onChange","options","optionValue","optionTextValue","optionDisabled","optionGroupChildren","state","keyboardDelegate","autoFocus","selectionMode","shouldFocusWrap","shouldUseVirtualFocus","shouldSelectOnPressUp","shouldFocusOnHover","allowDuplicateSelectionEvents","disallowEmptySelection","selectionBehavior","selectOnFocus","disallowTypeAhead","allowsTabNavigation","virtualized","scrollToItem","scrollRef","onKeyDown","onMouseDown","onFocusIn","onFocusOut"]),s=ne(()=>o.state?o.state:Gl({selectedKeys:()=>o.value,defaultSelectedKeys:()=>o.defaultValue,onSelectionChange:o.onChange,allowDuplicateSelectionEvents:()=>ee(o.allowDuplicateSelectionEvents),disallowEmptySelection:()=>ee(o.disallowEmptySelection),selectionBehavior:()=>ee(o.selectionBehavior),selectionMode:()=>ee(o.selectionMode),dataSource:()=>o.options??[],getKey:()=>o.optionValue,getTextValue:()=>o.optionTextValue,getDisabled:()=>o.optionDisabled,getSectionChildren:()=>o.optionGroupChildren})),a=X0({selectionManager:()=>s().selectionManager(),collection:()=>s().collection(),autoFocus:()=>ee(o.autoFocus),shouldFocusWrap:()=>ee(o.shouldFocusWrap),keyboardDelegate:()=>o.keyboardDelegate,disallowEmptySelection:()=>ee(o.disallowEmptySelection),selectOnFocus:()=>ee(o.selectOnFocus),disallowTypeAhead:()=>ee(o.disallowTypeAhead),shouldUseVirtualFocus:()=>ee(o.shouldUseVirtualFocus),allowsTabNavigation:()=>ee(o.allowsTabNavigation),isVirtualized:()=>o.virtualized,scrollToKey:()=>o.scrollToItem},()=>t,()=>o.scrollRef?.()),u={listState:s,generateId:nn(()=>i.id),shouldUseVirtualFocus:()=>r.shouldUseVirtualFocus,shouldSelectOnPressUp:()=>r.shouldSelectOnPressUp,shouldFocusOnHover:()=>r.shouldFocusOnHover,isVirtualized:()=>o.virtualized};return f(J0.Provider,{value:u,get children(){return f(ze,G({as:"ul",ref(c){var l=tt(d=>t=d,o.ref);typeof l=="function"&&l(c)},role:"listbox",get tabIndex(){return a.tabIndex()},get"aria-multiselectable"(){return s().selectionManager().selectionMode()==="multiple"?!0:void 0},get onKeyDown(){return gt([o.onKeyDown,a.onKeyDown])},get onMouseDown(){return gt([o.onMouseDown,a.onMouseDown])},get onFocusIn(){return gt([o.onFocusIn,a.onFocusIn])},get onFocusOut(){return gt([o.onFocusOut,a.onFocusOut])}},i,{get children(){return f(q,{get when(){return!o.virtualized},get fallback(){return o.children?.(s().collection)},get children(){return f(DE,{get each(){return[...s().collection()]},by:"key",children:c=>f(Av,{get children(){return[f(qd,{get when(){return c().type==="section"},get children(){return o.renderSection?.(c())}}),f(qd,{get when(){return c().type==="item"},get children(){return o.renderItem?.(c())}})]}})})}})}}))}})}function $a(e){return f(ze,G({as:"li",role:"presentation"},e))}var lk=Object.assign(rd,{Item:Na,ItemDescription:Ma,ItemIndicator:Pa,ItemLabel:La,Section:$a}),gu="focusScope.autoFocusOnMount",pu="focusScope.autoFocusOnUnmount",Vf={bubbles:!1,cancelable:!0},Wf={stack:[],active(){return this.stack[0]},add(e){e!==this.active()&&this.active()?.pause(),this.stack=rl(this.stack,e),this.stack.unshift(e)},remove(e){this.stack=rl(this.stack,e),this.active()?.resume()}};function Fa(e,t){const[n,r]=I(!1),o={pause(){r(!0)},resume(){r(!1)}};let i=null;const s=h=>e.onMountAutoFocus?.(h),a=h=>e.onUnmountAutoFocus?.(h),u=()=>tn(t()),c=()=>{const h=u().createElement("span");return h.setAttribute("data-focus-trap",""),h.tabIndex=0,Object.assign(h.style,Sa),h},l=()=>{const h=t();return h?n0(h,!0).filter(m=>!m.hasAttribute("data-focus-trap")):[]},d=()=>{const h=l();return h.length>0?h[0]:null},g=()=>{const h=l();return h.length>0?h[h.length-1]:null},p=()=>{const h=t();if(!h)return!1;const m=yi(h);return!m||Pt(h,m)?!1:r0(m)};ae(()=>{const h=t();if(!h)return;Wf.add(o);const m=yi(h);if(!Pt(h,m)){const v=new CustomEvent(gu,Vf);h.addEventListener(gu,s),h.dispatchEvent(v),v.defaultPrevented||setTimeout(()=>{Et(d()),yi(h)===m&&Et(h)},0)}ue(()=>{h.removeEventListener(gu,s),setTimeout(()=>{const v=new CustomEvent(pu,Vf);p()&&v.preventDefault(),h.addEventListener(pu,a),h.dispatchEvent(v),v.defaultPrevented||Et(m??u().body),h.removeEventListener(pu,a),Wf.remove(o)},0)})}),ae(()=>{const h=t();if(!h||!ee(e.trapFocus)||n())return;const m=v=>{const b=v.target;b?.closest(`[${Mi}]`)||(Pt(h,b)?i=b:Et(i))},y=v=>{const w=v.relatedTarget??yi(h);w?.closest(`[${Mi}]`)||Pt(h,w)||Et(i)};u().addEventListener("focusin",m),u().addEventListener("focusout",y),ue(()=>{u().removeEventListener("focusin",m),u().removeEventListener("focusout",y)})}),ae(()=>{const h=t();if(!h||!ee(e.trapFocus)||n())return;const m=c();h.insertAdjacentElement("afterbegin",m);const y=c();h.insertAdjacentElement("beforeend",y);function v(w){const E=d(),C=g();w.relatedTarget===E?Et(C):Et(E)}m.addEventListener("focusin",v),y.addEventListener("focusin",v);const b=new MutationObserver(w=>{for(const E of w)E.previousSibling===y&&(y.remove(),h.insertAdjacentElement("beforeend",y)),E.nextSibling===m&&(m.remove(),h.insertAdjacentElement("afterbegin",m))});b.observe(h,{childList:!0,subtree:!1}),ue(()=>{m.removeEventListener("focusin",v),y.removeEventListener("focusin",v),m.remove(),y.remove(),b.disconnect()})})}var dk="data-live-announcer";function Ba(e){ae(()=>{ee(e.isDisabled)||ue(fk(ee(e.targets),ee(e.root)))})}var di=new WeakMap,xn=[];function fk(e,t=document.body){const n=new Set(e),r=new Set,o=u=>{for(const g of u.querySelectorAll(`[${dk}], [${Mi}]`))n.add(g);const c=g=>{if(n.has(g)||g.parentElement&&r.has(g.parentElement)&&g.parentElement.getAttribute("role")!=="row")return NodeFilter.FILTER_REJECT;for(const p of n)if(g.contains(p))return NodeFilter.FILTER_SKIP;return NodeFilter.FILTER_ACCEPT},l=document.createTreeWalker(u,NodeFilter.SHOW_ELEMENT,{acceptNode:c}),d=c(u);if(d===NodeFilter.FILTER_ACCEPT&&i(u),d!==NodeFilter.FILTER_REJECT){let g=l.nextNode();for(;g!=null;)i(g),g=l.nextNode()}},i=u=>{const c=di.get(u)??0;u.getAttribute("aria-hidden")==="true"&&c===0||(c===0&&u.setAttribute("aria-hidden","true"),r.add(u),di.set(u,c+1))};xn.length&&xn[xn.length-1].disconnect(),o(t);const s=new MutationObserver(u=>{for(const c of u)if(!(c.type!=="childList"||c.addedNodes.length===0)&&![...n,...r].some(l=>l.contains(c.target))){for(const l of c.removedNodes)l instanceof Element&&(n.delete(l),r.delete(l));for(const l of c.addedNodes)(l instanceof HTMLElement||l instanceof SVGElement)&&(l.dataset.liveAnnouncer==="true"||l.dataset.reactAriaTopLayer==="true")?n.add(l):l instanceof Element&&o(l)}});s.observe(t,{childList:!0,subtree:!0});const a={observe(){s.observe(t,{childList:!0,subtree:!0})},disconnect(){s.disconnect()}};return xn.push(a),()=>{s.disconnect();for(const u of r){const c=di.get(u);if(c==null)return;c===1?(u.removeAttribute("aria-hidden"),di.delete(u)):di.set(u,c-1)}a===xn[xn.length-1]?(xn.pop(),xn.length&&xn[xn.length-1].observe()):xn.splice(xn.indexOf(a),1)}}var tb=["id","aria-label","aria-labelledby","aria-describedby"];function nb(e){const t=Tn(),n=Re({id:t.generateId("field")},e);return ae(()=>ue(t.registerField(ee(n.id)))),{fieldProps:{id:()=>ee(n.id),ariaLabel:()=>ee(n["aria-label"]),ariaLabelledBy:()=>t.getAriaLabelledBy(ee(n.id),ee(n["aria-label"]),ee(n["aria-labelledby"])),ariaDescribedBy:()=>t.getAriaDescribedBy(ee(n["aria-describedby"]))}}}function od(e){let t;const n=Tn(),r=Re({id:n.generateId("label")},e),[o,i]=me(r,["ref"]),s=ka(()=>t,()=>"label");return ae(()=>ue(n.registerLabel(i.id))),f(ze,G({as:"label",ref(a){var u=tt(c=>t=c,o.ref);typeof u=="function"&&u(a)},get for(){return Q(()=>s()==="label")()?n.fieldId():void 0}},()=>n.dataset(),i))}function id(e,t){ae(_t(e,n=>{if(n==null)return;const r=gk(n);r!=null&&(r.addEventListener("reset",t,{passive:!0}),ue(()=>{r.removeEventListener("reset",t)}))}))}function gk(e){return pk(e)?e.form:e.closest("form")}function pk(e){return e.matches("textarea, input, select, button")}function rs(e){const t=Tn(),n=Re({id:t.generateId("error-message")},e),[r,o]=me(n,["forceMount"]),i=()=>t.validationState()==="invalid";return ae(()=>{i()&&ue(t.registerErrorMessage(o.id))}),f(q,{get when(){return r.forceMount||i()},get children(){return f(ze,G({as:"div"},()=>t.dataset(),o))}})}var fl=(e,t)=>{if(e.contains(t))return!0;let n=t;for(;n;){if(n===e)return!0;n=n._$host??n.parentElement}return!1},Cs=new Map,hk=e=>{ae(()=>{const t=Gt(e.style)??{},n=Gt(e.properties)??[],r={};for(const i in t)r[i]=e.element.style[i];const o=Cs.get(e.key);o?o.activeCount++:Cs.set(e.key,{activeCount:1,originalStyles:r,properties:n.map(i=>i.key)}),Object.assign(e.element.style,e.style);for(const i of n)e.element.style.setProperty(i.key,i.value);ue(()=>{const i=Cs.get(e.key);if(i){if(i.activeCount!==1){i.activeCount--;return}Cs.delete(e.key);for(const[s,a]of Object.entries(i.originalStyles))e.element.style[s]=a;for(const s of i.properties)e.element.style.removeProperty(s);e.element.style.length===0&&e.element.removeAttribute("style"),e.cleanup?.()}})})},Yf=hk,mk=(e,t)=>{switch(t){case"x":return[e.clientWidth,e.scrollLeft,e.scrollWidth];case"y":return[e.clientHeight,e.scrollTop,e.scrollHeight]}},bk=(e,t)=>{const n=getComputedStyle(e),r=t==="x"?n.overflowX:n.overflowY;return r==="auto"||r==="scroll"||e.tagName==="HTML"&&r==="visible"},yk=(e,t,n)=>{const r=t==="x"&&window.getComputedStyle(e).direction==="rtl"?-1:1;let o=e,i=0,s=0,a=!1;do{const[u,c,l]=mk(o,t),d=l-u-r*c;(c!==0||d!==0)&&bk(o,t)&&(i+=d,s+=c),o===(n??document.documentElement)?a=!0:o=o._$host??o.parentElement}while(o&&!a);return[i,s]},[Zf,Xf]=I([]),vk=e=>Zf().indexOf(e)===Zf().length-1,wk=e=>{const t=G({element:null,enabled:!0,hideScrollbar:!0,preventScrollbarShift:!0,preventScrollbarShiftMode:"padding",restoreScrollPosition:!0,allowPinchZoom:!1},e),n=Dt();let r=[0,0],o=null,i=null;ae(()=>{Gt(t.enabled)&&(Xf(c=>[...c,n]),ue(()=>{Xf(c=>c.filter(l=>l!==n))}))}),ae(()=>{if(!Gt(t.enabled)||!Gt(t.hideScrollbar))return;const{body:c}=document,l=window.innerWidth-c.offsetWidth;if(Gt(t.preventScrollbarShift)){const d={overflow:"hidden"},g=[];l>0&&(Gt(t.preventScrollbarShiftMode)==="padding"?d.paddingRight=`calc(${window.getComputedStyle(c).paddingRight} + ${l}px)`:d.marginRight=`calc(${window.getComputedStyle(c).marginRight} + ${l}px)`,g.push({key:"--scrollbar-width",value:`${l}px`}));const p=window.scrollY,h=window.scrollX;Yf({key:"prevent-scroll",element:c,style:d,properties:g,cleanup:()=>{Gt(t.restoreScrollPosition)&&l>0&&window.scrollTo(h,p)}})}else Yf({key:"prevent-scroll",element:c,style:{overflow:"hidden"}})}),ae(()=>{!vk(n)||!Gt(t.enabled)||(document.addEventListener("wheel",a,{passive:!1}),document.addEventListener("touchstart",s,{passive:!1}),document.addEventListener("touchmove",u,{passive:!1}),ue(()=>{document.removeEventListener("wheel",a),document.removeEventListener("touchstart",s),document.removeEventListener("touchmove",u)}))});const s=c=>{r=Jf(c),o=null,i=null},a=c=>{const l=c.target,d=Gt(t.element),g=xk(c),p=Math.abs(g[0])>Math.abs(g[1])?"x":"y",h=p==="x"?g[0]:g[1],m=Qf(l,p,h,d);let y;d&&fl(d,l)?y=!m:y=!0,y&&c.cancelable&&c.preventDefault()},u=c=>{const l=Gt(t.element),d=c.target;let g;if(c.touches.length===2)g=!Gt(t.allowPinchZoom);else{if(o==null||i===null){const p=Jf(c).map((m,y)=>r[y]-m),h=Math.abs(p[0])>Math.abs(p[1])?"x":"y";o=h,i=h==="x"?p[0]:p[1]}if(d.type==="range")g=!1;else{const p=Qf(d,o,i,l);l&&fl(l,d)?g=!p:g=!0}}g&&c.cancelable&&c.preventDefault()}},xk=e=>[e.deltaX,e.deltaY],Jf=e=>e.changedTouches[0]?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0],Qf=(e,t,n,r)=>{const o=r!==null&&fl(r,e),[i,s]=yk(e,t,o?r:void 0);return!(n>0&&Math.abs(i)<=1||n<0&&Math.abs(s)<1)},_k=wk,za=_k,Ek={};An(Ek,{Arrow:()=>Ar,Content:()=>ob,Description:()=>ns,ErrorMessage:()=>rs,HiddenSelect:()=>ib,Icon:()=>sb,Item:()=>Na,ItemDescription:()=>Ma,ItemIndicator:()=>Pa,ItemLabel:()=>La,Label:()=>ab,Listbox:()=>ub,Portal:()=>cb,Root:()=>lb,Section:()=>$a,Select:()=>Yt,Trigger:()=>db,Value:()=>fb,useSelectContext:()=>Tr});var rb=dt();function Tr(){const e=ut(rb);if(e===void 0)throw new Error("[kobalte]: `useSelectContext` must be used within a `Select` component");return e}function ob(e){let t;const n=Tr(),[r,o]=me(e,["ref","style","onCloseAutoFocus","onFocusOutside"]),i=a=>{n.close()},s=a=>{r.onFocusOutside?.(a),n.isOpen()&&n.isModal()&&a.preventDefault()};return Ba({isDisabled:()=>!(n.isOpen()&&n.isModal()),targets:()=>t?[t]:[]}),za({element:()=>t??null,enabled:()=>n.contentPresent()&&n.preventScroll()}),Fa({trapFocus:()=>n.isOpen()&&n.isModal(),onMountAutoFocus:a=>{a.preventDefault()},onUnmountAutoFocus:a=>{r.onCloseAutoFocus?.(a),a.defaultPrevented||(Et(n.triggerRef()),a.preventDefault())}},()=>t),f(q,{get when(){return n.contentPresent()},get children(){return f(Xr.Positioner,{get children(){return f(ts,G({ref(a){var u=tt(c=>{n.setContentRef(c),t=c},r.ref);typeof u=="function"&&u(a)},get disableOutsidePointerEvents(){return Q(()=>!!n.isModal())()&&n.isOpen()},get excludedElements(){return[n.triggerRef]},get style(){return wn({"--kb-select-content-transform-origin":"var(--kb-popper-content-transform-origin)",position:"relative"},r.style)},onEscapeKeyDown:i,onFocusOutside:s,get onDismiss(){return n.close}},()=>n.dataset(),o))}})}})}function ib(e){const t=Tr();return f(ak,G({get collection(){return t.listState().collection()},get selectionManager(){return t.listState().selectionManager()},get isOpen(){return t.isOpen()},get isMultiple(){return t.isMultiple()},get isVirtualized(){return t.isVirtualized()},focusTrigger:()=>t.triggerRef()?.focus()},e))}function sb(e){const t=Tr(),n=Re({children:"▼"},e);return f(ze,G({as:"span","aria-hidden":"true"},()=>t.dataset(),n))}function ab(e){const t=Tr(),[n,r]=me(e,["onClick"]);return f(od,G({as:"span",onClick:i=>{Oe(i,n.onClick),t.isDisabled()||t.triggerRef()?.focus()}},r))}function ub(e){const t=Tr(),n=Re({id:t.generateId("listbox")},e),[r,o]=me(n,["ref","id","onKeyDown"]);return ae(()=>ue(t.registerListboxId(r.id))),f(rd,G({ref(s){var a=tt(t.setListboxRef,r.ref);typeof a=="function"&&a(s)},get id(){return r.id},get state(){return t.listState()},get virtualized(){return t.isVirtualized()},get autoFocus(){return t.autoFocus()},shouldSelectOnPressUp:!0,shouldFocusOnHover:!0,get shouldFocusWrap(){return t.shouldFocusWrap()},get disallowTypeAhead(){return t.disallowTypeAhead()},get"aria-labelledby"(){return t.listboxAriaLabelledBy()},get renderItem(){return t.renderItem},get renderSection(){return t.renderSection},onKeyDown:s=>{Oe(s,r.onKeyDown),s.key==="Escape"&&s.preventDefault()}},o))}function cb(e){const t=Tr();return f(q,{get when(){return t.contentPresent()},get children(){return f(Gi,e)}})}function Ck(e){const t=`select-${Dt()}`,n=Re({id:t,selectionMode:"single",disallowEmptySelection:!1,closeOnSelection:e.selectionMode==="single",allowDuplicateSelectionEvents:!0,gutter:8,sameWidth:!0,modal:!1},e),[r,o,i,s]=me(n,["itemComponent","sectionComponent","open","defaultOpen","onOpenChange","value","defaultValue","onChange","placeholder","options","optionValue","optionTextValue","optionDisabled","optionGroupChildren","keyboardDelegate","allowDuplicateSelectionEvents","disallowEmptySelection","closeOnSelection","disallowTypeAhead","shouldFocusWrap","selectionBehavior","selectionMode","virtualized","modal","preventScroll","forceMount"],["getAnchorRect","placement","gutter","shift","flip","slide","overlap","sameWidth","fitViewport","hideWhenDetached","detachedPadding","arrowPadding","overflowPadding"],ed),[a,u]=I(),[c,l]=I(),[d,g]=I(),[p,h]=I(),[m,y]=I(),[v,b]=I(),[w,E]=I(),[C,k]=I(!0),T=Z=>{const M=r.optionValue;return M==null?String(Z):String(Yi(M)?M(Z):Z[M])},S=ne(()=>{const Z=r.optionGroupChildren;return Z==null?r.options:r.options.flatMap(M=>M[Z]??M)}),A=ne(()=>S().map(Z=>T(Z))),F=Z=>[...Z].map(M=>S().find(W=>T(W)===M)).filter(M=>M!=null),O=wo({open:()=>r.open,defaultOpen:()=>r.defaultOpen,onOpenChange:Z=>r.onOpenChange?.(Z)}),P=Gl({selectedKeys:()=>r.value!=null?r.value.map(T):r.value,defaultSelectedKeys:()=>r.defaultValue!=null?r.defaultValue.map(T):r.defaultValue,onSelectionChange:Z=>{r.onChange?.(F(Z)),r.closeOnSelection&&ce()},allowDuplicateSelectionEvents:()=>ee(r.allowDuplicateSelectionEvents),disallowEmptySelection:()=>ee(r.disallowEmptySelection),selectionBehavior:()=>ee(r.selectionBehavior),selectionMode:()=>r.selectionMode,dataSource:()=>r.options??[],getKey:()=>r.optionValue,getTextValue:()=>r.optionTextValue,getDisabled:()=>r.optionDisabled,getSectionChildren:()=>r.optionGroupChildren}),L=ne(()=>F(P.selectionManager().selectedKeys())),D=Z=>{P.selectionManager().toggleSelection(T(Z))},{present:B}=nr({show:()=>r.forceMount||O.isOpen(),element:()=>m()??null}),N=()=>{const Z=v();Z&&Et(Z)},Y=Z=>{if(r.options.length<=0)return;k(Z),O.open();let M=P.selectionManager().firstSelectedKey();M==null&&(Z==="first"?M=P.collection().getFirstKey():Z==="last"&&(M=P.collection().getLastKey())),N(),P.selectionManager().setFocused(!0),P.selectionManager().setFocusedKey(M)},ce=()=>{O.close(),P.selectionManager().setFocused(!1),P.selectionManager().setFocusedKey(void 0)},V=Z=>{O.isOpen()?ce():Y(Z)},{formControlContext:j}=td(i);id(p,()=>{const Z=r.defaultValue?[...r.defaultValue].map(T):new Wn;P.selectionManager().setSelectedKeys(Z)});const he=C0({usage:"search",sensitivity:"base"}),K=ne(()=>{const Z=ee(r.keyboardDelegate);return Z||new Z0(P.collection,void 0,he)}),z=Z=>r.itemComponent?.({item:Z}),J=Z=>r.sectionComponent?.({section:Z});ae(_t([A],([Z])=>{const W=[...P.selectionManager().selectedKeys()].filter(oe=>Z.includes(oe));P.selectionManager().setSelectedKeys(W)},{defer:!0}));const re=ne(()=>({"data-expanded":O.isOpen()?"":void 0,"data-closed":O.isOpen()?void 0:""})),ve={dataset:re,isOpen:O.isOpen,isDisabled:()=>j.isDisabled()??!1,isMultiple:()=>ee(r.selectionMode)==="multiple",isVirtualized:()=>r.virtualized??!1,isModal:()=>r.modal??!1,preventScroll:()=>r.preventScroll??ve.isModal(),disallowTypeAhead:()=>r.disallowTypeAhead??!1,shouldFocusWrap:()=>r.shouldFocusWrap??!1,selectedOptions:L,contentPresent:B,autoFocus:C,triggerRef:p,listState:()=>P,keyboardDelegate:K,triggerId:a,valueId:c,listboxId:d,listboxAriaLabelledBy:w,setListboxAriaLabelledBy:E,setTriggerRef:h,setContentRef:y,setListboxRef:b,open:Y,close:ce,toggle:V,placeholder:()=>r.placeholder,renderItem:z,renderSection:J,removeOptionFromSelection:D,generateId:nn(()=>ee(i.id)),registerTriggerId:ht(u),registerValueId:ht(l),registerListboxId:ht(g)};return f(Oa.Provider,{value:j,get children(){return f(rb.Provider,{value:ve,get children(){return f(Xr,G({anchorRef:p,contentRef:m},o,{get children(){return f(ze,G({as:"div",role:"group",get id(){return ee(i.id)}},()=>j.dataset(),re,s))}}))}})}})}function lb(e){const[t,n]=me(e,["value","defaultValue","onChange","multiple"]),r=ne(()=>t.value!=null?t.multiple?t.value:[t.value]:t.value),o=ne(()=>t.defaultValue!=null?t.multiple?t.defaultValue:[t.defaultValue]:t.defaultValue);return f(Ck,G({get value(){return r()},get defaultValue(){return o()},onChange:s=>{t.multiple?t.onChange?.(s??[]):t.onChange?.(s[0]??null)},get selectionMode(){return t.multiple?"multiple":"single"}},n))}function db(e){const t=Tn(),n=Tr(),r=Re({id:n.generateId("trigger")},e),[o,i,s]=me(r,["ref","disabled","onPointerDown","onClick","onKeyDown","onFocus","onBlur"],tb),a=()=>n.listState().selectionManager(),u=()=>n.keyboardDelegate(),c=()=>o.disabled||n.isDisabled(),{fieldProps:l}=nb(i),{typeSelectHandlers:d}=T0({keyboardDelegate:u,selectionManager:a,onTypeSelect:b=>a().select(b)}),g=()=>[n.listboxAriaLabelledBy(),n.valueId()].filter(Boolean).join(" ")||void 0,p=b=>{Oe(b,o.onPointerDown),b.currentTarget.dataset.pointerType=b.pointerType,!c()&&b.pointerType!=="touch"&&b.button===0&&(b.preventDefault(),n.toggle(!0))},h=b=>{Oe(b,o.onClick),!c()&&b.currentTarget.dataset.pointerType==="touch"&&n.toggle(!0)},m=b=>{if(Oe(b,o.onKeyDown),!c())switch(Oe(b,d.onKeyDown),b.key){case"Enter":case" ":case"ArrowDown":b.stopPropagation(),b.preventDefault(),n.toggle("first");break;case"ArrowUp":b.stopPropagation(),b.preventDefault(),n.toggle("last");break;case"ArrowLeft":{if(b.preventDefault(),n.isMultiple())return;const w=a().firstSelectedKey(),E=w!=null?u().getKeyAbove?.(w):u().getFirstKey?.();E!=null&&a().select(E);break}case"ArrowRight":{if(b.preventDefault(),n.isMultiple())return;const w=a().firstSelectedKey(),E=w!=null?u().getKeyBelow?.(w):u().getFirstKey?.();E!=null&&a().select(E);break}}},y=b=>{Oe(b,o.onFocus),!a().isFocused()&&a().setFocused(!0)},v=b=>{Oe(b,o.onBlur),!n.isOpen()&&a().setFocused(!1)};return ae(()=>ue(n.registerTriggerId(l.id()))),ae(()=>{n.setListboxAriaLabelledBy([l.ariaLabelledBy(),l.ariaLabel()&&!l.ariaLabelledBy()?l.id():null].filter(Boolean).join(" ")||void 0)}),f(ar,G({ref(b){var w=tt(n.setTriggerRef,o.ref);typeof w=="function"&&w(b)},get id(){return l.id()},get disabled(){return c()},"aria-haspopup":"listbox",get"aria-expanded"(){return n.isOpen()},get"aria-controls"(){return Q(()=>!!n.isOpen())()?n.listboxId():void 0},get"aria-label"(){return l.ariaLabel()},get"aria-labelledby"(){return g()},get"aria-describedby"(){return l.ariaDescribedBy()},onPointerDown:p,onClick:h,onKeyDown:m,onFocus:y,onBlur:v},()=>n.dataset(),()=>t.dataset(),s))}function fb(e){const t=Tn(),n=Tr(),r=Re({id:n.generateId("value")},e),[o,i]=me(r,["id","children"]),s=()=>n.listState().selectionManager(),a=()=>{const u=s().selectedKeys();return u.size===1&&u.has("")?!0:s().isEmpty()};return ae(()=>ue(n.registerValueId(o.id))),f(ze,G({as:"span",get id(){return o.id},get"data-placeholder-shown"(){return a()?"":void 0}},()=>t.dataset(),i,{get children(){return f(q,{get when(){return!a()},get fallback(){return n.placeholder()},get children(){return f(Sk,{state:{selectedOption:()=>n.selectedOptions()[0],selectedOptions:()=>n.selectedOptions(),remove:u=>n.removeOptionFromSelection(u),clear:()=>s().clearSelection()},get children(){return o.children}})}})}}))}function Sk(e){const t=ni(()=>{const n=e.children;return Yi(n)?n(e.state):n});return Q(t)}var Yt=Object.assign(lb,{Arrow:Ar,Content:ob,Description:ns,ErrorMessage:rs,HiddenSelect:ib,Icon:sb,Item:Na,ItemDescription:Ma,ItemIndicator:Pa,ItemLabel:La,Label:ab,Listbox:ub,Portal:cb,Section:$a,Trigger:db,Value:fb}),kk={};An(kk,{Anchor:()=>pb,Arrow:()=>Ar,CloseButton:()=>hb,Content:()=>mb,Description:()=>bb,Popover:()=>zr,Portal:()=>yb,Root:()=>vb,Title:()=>wb,Trigger:()=>xb,usePopoverContext:()=>Jr});var gb=dt();function Jr(){const e=ut(gb);if(e===void 0)throw new Error("[kobalte]: `usePopoverContext` must be used within a `Popover` component");return e}function pb(e){const t=Jr(),[n,r]=me(e,["ref"]);return f(ze,G({as:"div",ref(o){var i=tt(t.setDefaultAnchorRef,n.ref);typeof i=="function"&&i(o)}},()=>t.dataset(),r))}function hb(e){const t=Jr(),[n,r]=me(e,["aria-label","onClick"]);return f(ar,G({get"aria-label"(){return n["aria-label"]||t.translations().dismiss},onClick:i=>{Oe(i,n.onClick),t.close()}},()=>t.dataset(),r))}function mb(e){let t;const n=Jr(),r=Re({id:n.generateId("content")},e),[o,i]=me(r,["ref","style","onOpenAutoFocus","onCloseAutoFocus","onPointerDownOutside","onFocusOutside","onInteractOutside"]);let s=!1,a=!1,u=!1;const c=p=>{o.onCloseAutoFocus?.(p),n.isModal()?(p.preventDefault(),s||Et(n.triggerRef())):(p.defaultPrevented||(a||Et(n.triggerRef()),p.preventDefault()),a=!1,u=!1)},l=p=>{o.onPointerDownOutside?.(p),n.isModal()&&(s=p.detail.isContextMenu)},d=p=>{o.onFocusOutside?.(p),n.isOpen()&&n.isModal()&&p.preventDefault()},g=p=>{o.onInteractOutside?.(p),!n.isModal()&&(p.defaultPrevented||(a=!0,p.detail.originalEvent.type==="pointerdown"&&(u=!0)),Pt(n.triggerRef(),p.target)&&p.preventDefault(),p.detail.originalEvent.type==="focusin"&&u&&p.preventDefault())};return Ba({isDisabled:()=>!(n.isOpen()&&n.isModal()),targets:()=>t?[t]:[]}),za({element:()=>t??null,enabled:()=>n.contentPresent()&&n.preventScroll()}),Fa({trapFocus:()=>n.isOpen()&&n.isModal(),onMountAutoFocus:o.onOpenAutoFocus,onUnmountAutoFocus:c},()=>t),ae(()=>ue(n.registerContentId(i.id))),f(q,{get when(){return n.contentPresent()},get children(){return f(Xr.Positioner,{get children(){return f(ts,G({ref(p){var h=tt(m=>{n.setContentRef(m),t=m},o.ref);typeof h=="function"&&h(p)},role:"dialog",tabIndex:-1,get disableOutsidePointerEvents(){return Q(()=>!!n.isOpen())()&&n.isModal()},get excludedElements(){return[n.triggerRef]},get style(){return wn({"--kb-popover-content-transform-origin":"var(--kb-popper-content-transform-origin)",position:"relative"},o.style)},get"aria-labelledby"(){return n.titleId()},get"aria-describedby"(){return n.descriptionId()},onPointerDownOutside:l,onFocusOutside:d,onInteractOutside:g,get onDismiss(){return n.close}},()=>n.dataset(),i))}})}})}function bb(e){const t=Jr(),n=Re({id:t.generateId("description")},e),[r,o]=me(n,["id"]);return ae(()=>ue(t.registerDescriptionId(r.id))),f(ze,G({as:"p",get id(){return r.id}},()=>t.dataset(),o))}function yb(e){const t=Jr();return f(q,{get when(){return t.contentPresent()},get children(){return f(Gi,e)}})}var eg={dismiss:"Dismiss"};function vb(e){const t=`popover-${Dt()}`,n=Re({id:t,modal:!1,translations:eg},e),[r,o]=me(n,["translations","id","open","defaultOpen","onOpenChange","modal","preventScroll","forceMount","anchorRef"]),[i,s]=I(),[a,u]=I(),[c,l]=I(),[d,g]=I(),[p,h]=I(),[m,y]=I(),v=wo({open:()=>r.open,defaultOpen:()=>r.defaultOpen,onOpenChange:k=>r.onOpenChange?.(k)}),b=()=>r.anchorRef?.()??i()??a(),{present:w}=nr({show:()=>r.forceMount||v.isOpen(),element:()=>c()??null}),E=ne(()=>({"data-expanded":v.isOpen()?"":void 0,"data-closed":v.isOpen()?void 0:""})),C={translations:()=>r.translations??eg,dataset:E,isOpen:v.isOpen,isModal:()=>r.modal??!1,preventScroll:()=>r.preventScroll??C.isModal(),contentPresent:w,triggerRef:a,contentId:d,titleId:p,descriptionId:m,setDefaultAnchorRef:s,setTriggerRef:u,setContentRef:l,close:v.close,toggle:v.toggle,generateId:nn(()=>r.id),registerContentId:ht(g),registerTitleId:ht(h),registerDescriptionId:ht(y)};return f(gb.Provider,{value:C,get children(){return f(Xr,G({anchorRef:b,contentRef:c},o))}})}function wb(e){const t=Jr(),n=Re({id:t.generateId("title")},e),[r,o]=me(n,["id"]);return ae(()=>ue(t.registerTitleId(r.id))),f(ze,G({as:"h2",get id(){return r.id}},()=>t.dataset(),o))}function xb(e){const t=Jr(),[n,r]=me(e,["ref","onClick","onPointerDown"]);return f(ar,G({ref(s){var a=tt(t.setTriggerRef,n.ref);typeof a=="function"&&a(s)},"aria-haspopup":"dialog",get"aria-expanded"(){return t.isOpen()},get"aria-controls"(){return Q(()=>!!t.isOpen())()?t.contentId():void 0},onPointerDown:s=>{Oe(s,n.onPointerDown),s.preventDefault()},onClick:s=>{Oe(s,n.onClick),t.toggle()}},()=>t.dataset(),r))}var zr=Object.assign(vb,{Anchor:pb,Arrow:Ar,CloseButton:hb,Content:mb,Description:bb,Portal:yb,Title:wb,Trigger:xb}),Ak={};An(Ak,{Description:()=>ns,ErrorMessage:()=>rs,Item:()=>Cb,ItemControl:()=>Sb,ItemDescription:()=>kb,ItemIndicator:()=>Ab,ItemInput:()=>Tb,ItemLabel:()=>Db,Label:()=>Ib,RadioGroup:()=>Bn,Root:()=>Rb,useRadioGroupContext:()=>sd});var _b=dt();function sd(){const e=ut(_b);if(e===void 0)throw new Error("[kobalte]: `useRadioGroupContext` must be used within a `RadioGroup` component");return e}var Eb=dt();function os(){const e=ut(Eb);if(e===void 0)throw new Error("[kobalte]: `useRadioGroupItemContext` must be used within a `RadioGroup.Item` component");return e}function Cb(e){const t=Tn(),n=sd(),r=`${t.generateId("item")}-${Dt()}`,o=Re({id:r},e),[i,s]=me(o,["value","disabled","onPointerDown"]),[a,u]=I(),[c,l]=I(),[d,g]=I(),[p,h]=I(),[m,y]=I(!1),v=ne(()=>n.isDefaultValue(i.value)),b=ne(()=>n.isSelectedValue(i.value)),w=ne(()=>i.disabled||t.isDisabled()||!1),E=T=>{Oe(T,i.onPointerDown),m()&&T.preventDefault()},C=ne(()=>({...t.dataset(),"data-disabled":w()?"":void 0,"data-checked":b()?"":void 0})),k={value:()=>i.value,dataset:C,isDefault:v,isSelected:b,isDisabled:w,inputId:a,labelId:c,descriptionId:d,inputRef:p,select:()=>n.setSelectedValue(i.value),generateId:nn(()=>s.id),registerInput:ht(u),registerLabel:ht(l),registerDescription:ht(g),setIsFocused:y,setInputRef:h};return f(Eb.Provider,{value:k,get children(){return f(ze,G({as:"div",role:"group",onPointerDown:E},C,s))}})}function Sb(e){const t=os(),n=Re({id:t.generateId("control")},e),[r,o]=me(n,["onClick","onKeyDown"]);return f(ze,G({as:"div",onClick:a=>{Oe(a,r.onClick),t.select(),t.inputRef()?.focus({preventScroll:!0})},onKeyDown:a=>{Oe(a,r.onKeyDown),a.key===Ca.Space&&(t.select(),t.inputRef()?.focus({preventScroll:!0}))}},()=>t.dataset(),o))}function kb(e){const t=os(),n=Re({id:t.generateId("description")},e);return ae(()=>ue(t.registerDescription(n.id))),f(ze,G({as:"div"},()=>t.dataset(),n))}function Ab(e){const t=os(),n=Re({id:t.generateId("indicator")},e),[r,o]=me(n,["ref","forceMount"]),[i,s]=I(),{present:a}=nr({show:()=>r.forceMount||t.isSelected(),element:()=>i()??null});return f(q,{get when(){return a()},get children(){return f(ze,G({as:"div",ref(u){var c=tt(s,r.ref);typeof c=="function"&&c(u)}},()=>t.dataset(),o))}})}function Tb(e){const t=Tn(),n=sd(),r=os(),o=Re({id:r.generateId("input")},e),[i,s]=me(o,["ref","style","aria-labelledby","aria-describedby","onChange","onFocus","onBlur"]),a=()=>[i["aria-labelledby"],r.labelId(),i["aria-labelledby"]!=null&&s["aria-label"]!=null?s.id:void 0].filter(Boolean).join(" ")||void 0,u=()=>[i["aria-describedby"],r.descriptionId(),n.ariaDescribedBy()].filter(Boolean).join(" ")||void 0,[c,l]=I(!1),d=h=>{if(Oe(h,i.onChange),h.stopPropagation(),!c()){n.setSelectedValue(r.value());const m=h.target;m.checked=r.isSelected()}l(!1)},g=h=>{Oe(h,i.onFocus),r.setIsFocused(!0)},p=h=>{Oe(h,i.onBlur),r.setIsFocused(!1)};return ae(_t([()=>r.isSelected(),()=>r.value()],h=>{if(!h[0]&&h[1]===r.value())return;l(!0);const m=r.inputRef();m?.dispatchEvent(new Event("input",{bubbles:!0,cancelable:!0})),m?.dispatchEvent(new Event("change",{bubbles:!0,cancelable:!0}))},{defer:!0})),ae(()=>ue(r.registerInput(s.id))),f(ze,G({as:"input",ref(h){var m=tt(r.setInputRef,i.ref);typeof m=="function"&&m(h)},type:"radio",get name(){return t.name()},get value(){return r.value()},get checked(){return r.isSelected()},get required(){return t.isRequired()},get disabled(){return r.isDisabled()},get readonly(){return t.isReadOnly()},get style(){return wn({...Sa},i.style)},get"aria-labelledby"(){return a()},get"aria-describedby"(){return u()},onChange:d,onFocus:g,onBlur:p},()=>r.dataset(),s))}function Db(e){const t=os(),n=Re({id:t.generateId("label")},e);return ae(()=>ue(t.registerLabel(n.id))),f(ze,G({as:"label",get for(){return t.inputId()}},()=>t.dataset(),n))}function Ib(e){return f(od,G({as:"span"},e))}function Rb(e){let t;const n=`radiogroup-${Dt()}`,r=Re({id:n,orientation:"vertical"},e),[o,i,s]=me(r,["ref","value","defaultValue","onChange","orientation","aria-labelledby","aria-describedby"],ed),[a,u]=Qi({value:()=>o.value,defaultValue:()=>o.defaultValue,onChange:y=>o.onChange?.(y)}),{formControlContext:c}=td(i);id(()=>t,()=>u(o.defaultValue??""));const l=()=>c.getAriaLabelledBy(ee(i.id),s["aria-label"],o["aria-labelledby"]),d=()=>c.getAriaDescribedBy(o["aria-describedby"]),g=y=>y===e.defaultValue,p=y=>y===a(),m={ariaDescribedBy:d,isDefaultValue:g,isSelectedValue:p,setSelectedValue:y=>{if(!(c.isReadOnly()||c.isDisabled())&&(u(y),t))for(const v of t.querySelectorAll("[type='radio']")){const b=v;b.checked=p(b.value)}}};return f(Oa.Provider,{value:c,get children(){return f(_b.Provider,{value:m,get children(){return f(ze,G({as:"div",ref(y){var v=tt(b=>t=b,o.ref);typeof v=="function"&&v(y)},role:"radiogroup",get id(){return ee(i.id)},get"aria-invalid"(){return c.validationState()==="invalid"||void 0},get"aria-required"(){return c.isRequired()||void 0},get"aria-disabled"(){return c.isDisabled()||void 0},get"aria-readonly"(){return c.isReadOnly()||void 0},get"aria-orientation"(){return o.orientation},get"aria-labelledby"(){return l()},get"aria-describedby"(){return d()}},()=>c.dataset(),s))}})}})}var Bn=Object.assign(Rb,{Description:ns,ErrorMessage:rs,Item:Cb,ItemControl:Sb,ItemDescription:kb,ItemIndicator:Ab,ItemInput:Tb,ItemLabel:Db,Label:Ib}),Tk=dt();function Ua(){return ut(Tk)}var Dk=dt();function Ob(){return ut(Dk)}var Nb=dt();function Mb(){return ut(Nb)}function Dr(){const e=Mb();if(e===void 0)throw new Error("[kobalte]: `useMenuContext` must be used within a `Menu` component");return e}var Pb=dt();function ad(){const e=ut(Pb);if(e===void 0)throw new Error("[kobalte]: `useMenuItemContext` must be used within a `Menu.Item` component");return e}var Lb=dt();function cr(){const e=ut(Lb);if(e===void 0)throw new Error("[kobalte]: `useMenuRootContext` must be used within a `MenuRoot` component");return e}function ud(e){let t;const n=cr(),r=Dr(),o=Re({id:n.generateId(`item-${Dt()}`)},e),[i,s]=me(o,["ref","textValue","disabled","closeOnSelect","checked","indeterminate","onSelect","onPointerMove","onPointerLeave","onPointerDown","onPointerUp","onClick","onKeyDown","onMouseDown","onFocus"]),[a,u]=I(),[c,l]=I(),[d,g]=I(),p=()=>r.listState().selectionManager(),h=()=>s.id,m=()=>p().focusedKey()===h(),y=()=>{i.onSelect?.(),i.closeOnSelect&&setTimeout(()=>{r.close(!0)},1)};XC({getItem:()=>({ref:()=>t,type:"item",key:h(),textValue:i.textValue??d()?.textContent??t?.textContent??"",disabled:i.disabled??!1})});const v=Hl({key:h,selectionManager:p,shouldSelectOnPressUp:!0,allowsDifferentPressOrigin:!0,disabled:()=>i.disabled},()=>t),b=A=>{Oe(A,i.onPointerMove),A.pointerType==="mouse"&&(i.disabled?r.onItemLeave(A):(r.onItemEnter(A),A.defaultPrevented||(Et(A.currentTarget),r.listState().selectionManager().setFocused(!0),r.listState().selectionManager().setFocusedKey(h()))))},w=A=>{Oe(A,i.onPointerLeave),A.pointerType==="mouse"&&r.onItemLeave(A)},E=A=>{Oe(A,i.onPointerUp),!i.disabled&&A.button===0&&y()},C=A=>{if(Oe(A,i.onKeyDown),!A.repeat&&!i.disabled)switch(A.key){case"Enter":case" ":y();break}},k=ne(()=>{if(i.indeterminate)return"mixed";if(i.checked!=null)return i.checked}),T=ne(()=>({"data-indeterminate":i.indeterminate?"":void 0,"data-checked":i.checked&&!i.indeterminate?"":void 0,"data-disabled":i.disabled?"":void 0,"data-highlighted":m()?"":void 0})),S={isChecked:()=>i.checked,dataset:T,setLabelRef:g,generateId:nn(()=>s.id),registerLabel:ht(u),registerDescription:ht(l)};return f(Pb.Provider,{value:S,get children(){return f(ze,G({as:"div",ref(A){var F=tt(O=>t=O,i.ref);typeof F=="function"&&F(A)},get tabIndex(){return v.tabIndex()},get"aria-checked"(){return k()},get"aria-disabled"(){return i.disabled},get"aria-labelledby"(){return a()},get"aria-describedby"(){return c()},get"data-key"(){return v.dataKey()},get onPointerDown(){return gt([i.onPointerDown,v.onPointerDown])},get onPointerUp(){return gt([E,v.onPointerUp])},get onClick(){return gt([i.onClick,v.onClick])},get onKeyDown(){return gt([C,v.onKeyDown])},get onMouseDown(){return gt([i.onMouseDown,v.onMouseDown])},get onFocus(){return gt([i.onFocus,v.onFocus])},onPointerMove:b,onPointerLeave:w},T,s))}})}function $b(e){const t=Re({closeOnSelect:!1},e),[n,r]=me(t,["checked","defaultChecked","onChange","onSelect"]),o=x0({isSelected:()=>n.checked,defaultIsSelected:()=>n.defaultChecked,onSelectedChange:s=>n.onChange?.(s),isDisabled:()=>r.disabled});return f(ud,G({role:"menuitemcheckbox",get checked(){return o.isSelected()},onSelect:()=>{n.onSelect?.(),o.toggle()}},r))}var Bi={next:(e,t)=>e==="ltr"?t==="horizontal"?"ArrowRight":"ArrowDown":t==="horizontal"?"ArrowLeft":"ArrowUp",previous:(e,t)=>Bi.next(e==="ltr"?"rtl":"ltr",t)},tg={first:e=>e==="horizontal"?"ArrowDown":"ArrowRight",last:e=>e==="horizontal"?"ArrowUp":"ArrowLeft"};function Fb(e){const t=cr(),n=Dr(),r=Ua(),{direction:o}=Zr(),i=Re({id:t.generateId("trigger")},e),[s,a]=me(i,["ref","id","disabled","onPointerDown","onClick","onKeyDown","onMouseOver","onFocus"]);let u=()=>t.value();r!==void 0&&(u=()=>t.value()??s.id,r.lastValue()===void 0&&r.setLastValue(u));const c=ka(()=>n.triggerRef(),()=>"button"),l=ne(()=>c()==="a"&&n.triggerRef()?.getAttribute("href")!=null);ae(_t(()=>r?.value(),v=>{l()&&v===u()&&n.triggerRef()?.focus()}));const d=()=>{r!==void 0?n.isOpen()?r.value()===u()&&r.closeMenu():(r.autoFocusMenu()||r.setAutoFocusMenu(!0),n.open(!1)):n.toggle(!0)},g=v=>{Oe(v,s.onPointerDown),v.currentTarget.dataset.pointerType=v.pointerType,!s.disabled&&v.pointerType!=="touch"&&v.button===0&&d()},p=v=>{Oe(v,s.onClick),s.disabled||v.currentTarget.dataset.pointerType==="touch"&&d()},h=v=>{if(Oe(v,s.onKeyDown),!s.disabled){if(l())switch(v.key){case"Enter":case" ":return}switch(v.key){case"Enter":case" ":case tg.first(t.orientation()):v.stopPropagation(),v.preventDefault(),JE(v.currentTarget),n.open("first"),r?.setAutoFocusMenu(!0),r?.setValue(u);break;case tg.last(t.orientation()):v.stopPropagation(),v.preventDefault(),n.open("last");break;case Bi.next(o(),t.orientation()):if(r===void 0)break;v.stopPropagation(),v.preventDefault(),r.nextMenu();break;case Bi.previous(o(),t.orientation()):if(r===void 0)break;v.stopPropagation(),v.preventDefault(),r.previousMenu();break}}},m=v=>{Oe(v,s.onMouseOver),n.triggerRef()?.dataset.pointerType!=="touch"&&!s.disabled&&r!==void 0&&r.value()!==void 0&&r.setValue(u)},y=v=>{Oe(v,s.onFocus),r!==void 0&&v.currentTarget.dataset.pointerType!=="touch"&&r.setValue(u)};return ae(()=>ue(n.registerTriggerId(s.id))),f(ar,G({ref(v){var b=tt(n.setTriggerRef,s.ref);typeof b=="function"&&b(v)},get"data-kb-menu-value-trigger"(){return t.value()},get id(){return s.id},get disabled(){return s.disabled},"aria-haspopup":"true",get"aria-expanded"(){return n.isOpen()},get"aria-controls"(){return Q(()=>!!n.isOpen())()?n.contentId():void 0},get"data-highlighted"(){return u()!==void 0&&r?.value()===u()?!0:void 0},get tabIndex(){return r!==void 0?r.value()===u()||r.lastValue()===u()?0:-1:void 0},onPointerDown:g,onMouseOver:m,onClick:p,onKeyDown:h,onFocus:y,role:r!==void 0?"menuitem":void 0},()=>n.dataset(),a))}function Bb(e){let t;const n=cr(),r=Dr(),o=Ua(),i=Ob(),{direction:s}=Zr(),a=Re({id:n.generateId(`content-${Dt()}`)},e),[u,c]=me(a,["ref","id","style","onOpenAutoFocus","onCloseAutoFocus","onEscapeKeyDown","onFocusOutside","onPointerEnter","onPointerMove","onKeyDown","onMouseDown","onFocusIn","onFocusOut"]);let l=0;const d=()=>r.parentMenuContext()==null&&o===void 0&&n.isModal(),g=X0({selectionManager:r.listState().selectionManager,collection:r.listState().collection,autoFocus:r.autoFocus,deferAutoFocus:!0,shouldFocusWrap:!0,disallowTypeAhead:()=>!r.listState().selectionManager().isFocused(),orientation:()=>n.orientation()==="horizontal"?"vertical":"horizontal"},()=>t);Fa({trapFocus:()=>d()&&r.isOpen(),onMountAutoFocus:w=>{o===void 0&&u.onOpenAutoFocus?.(w)},onUnmountAutoFocus:u.onCloseAutoFocus},()=>t);const p=w=>{if(Pt(w.currentTarget,w.target)&&(w.key==="Tab"&&r.isOpen()&&w.preventDefault(),o!==void 0&&w.currentTarget.getAttribute("aria-haspopup")!=="true"))switch(w.key){case Bi.next(s(),n.orientation()):w.stopPropagation(),w.preventDefault(),r.close(!0),o.setAutoFocusMenu(!0),o.nextMenu();break;case Bi.previous(s(),n.orientation()):if(w.currentTarget.hasAttribute("data-closed"))break;w.stopPropagation(),w.preventDefault(),r.close(!0),o.setAutoFocusMenu(!0),o.previousMenu();break}},h=w=>{u.onEscapeKeyDown?.(w),o?.setAutoFocusMenu(!1),r.close(!0)},m=w=>{u.onFocusOutside?.(w),n.isModal()&&w.preventDefault()},y=w=>{Oe(w,u.onPointerEnter),r.isOpen()&&(r.parentMenuContext()?.listState().selectionManager().setFocused(!1),r.parentMenuContext()?.listState().selectionManager().setFocusedKey(void 0))},v=w=>{if(Oe(w,u.onPointerMove),w.pointerType!=="mouse")return;const E=w.target,C=l!==w.clientX;Pt(w.currentTarget,E)&&C&&(r.setPointerDir(w.clientX>l?"right":"left"),l=w.clientX)};ae(()=>ue(r.registerContentId(u.id))),ue(()=>r.setContentRef(void 0));const b={ref:tt(w=>{r.setContentRef(w),t=w},u.ref),role:"menu",get id(){return u.id},get tabIndex(){return g.tabIndex()},get"aria-labelledby"(){return r.triggerId()},onKeyDown:gt([u.onKeyDown,g.onKeyDown,p]),onMouseDown:gt([u.onMouseDown,g.onMouseDown]),onFocusIn:gt([u.onFocusIn,g.onFocusIn]),onFocusOut:gt([u.onFocusOut,g.onFocusOut]),onPointerEnter:y,onPointerMove:v,get"data-orientation"(){return n.orientation()}};return f(q,{get when(){return r.contentPresent()},get children(){return f(q,{get when(){return i===void 0||r.parentMenuContext()!=null},get fallback(){return f(ze,G({as:"div"},()=>r.dataset(),b,c))},get children(){return f(Xr.Positioner,{get children(){return f(ts,G({get disableOutsidePointerEvents(){return Q(()=>!!d())()&&r.isOpen()},get excludedElements(){return[r.triggerRef]},bypassTopMostLayerCheck:!0,get style(){return wn({"--kb-menu-content-transform-origin":"var(--kb-popper-content-transform-origin)",position:"relative"},u.style)},onEscapeKeyDown:h,onFocusOutside:m,get onDismiss(){return r.close}},()=>r.dataset(),b,c))}})}})}})}function Ik(e){let t;const n=cr(),r=Dr(),[o,i]=me(e,["ref"]);return za({element:()=>t??null,enabled:()=>r.contentPresent()&&n.preventScroll()}),f(Bb,G({ref(s){var a=tt(u=>{t=u},o.ref);typeof a=="function"&&a(s)}},i))}var zb=dt();function Rk(){const e=ut(zb);if(e===void 0)throw new Error("[kobalte]: `useMenuGroupContext` must be used within a `Menu.Group` component");return e}function cd(e){const t=cr(),n=Re({id:t.generateId(`group-${Dt()}`)},e),[r,o]=I(),i={generateId:nn(()=>n.id),registerLabelId:ht(o)};return f(zb.Provider,{value:i,get children(){return f(ze,G({as:"div",role:"group",get"aria-labelledby"(){return r()}},n))}})}function Ub(e){const t=Rk(),n=Re({id:t.generateId("label")},e),[r,o]=me(n,["id"]);return ae(()=>ue(t.registerLabelId(r.id))),f(ze,G({as:"span",get id(){return r.id},"aria-hidden":"true"},o))}function Kb(e){const t=Dr(),n=Re({children:"▼"},e);return f(ze,G({as:"span","aria-hidden":"true"},()=>t.dataset(),n))}function jb(e){return f(ud,G({role:"menuitem",closeOnSelect:!0},e))}function qb(e){const t=ad(),n=Re({id:t.generateId("description")},e),[r,o]=me(n,["id"]);return ae(()=>ue(t.registerDescription(r.id))),f(ze,G({as:"div",get id(){return r.id}},()=>t.dataset(),o))}function Hb(e){const t=ad(),n=Re({id:t.generateId("indicator")},e),[r,o]=me(n,["forceMount"]);return f(q,{get when(){return r.forceMount||t.isChecked()},get children(){return f(ze,G({as:"div"},()=>t.dataset(),o))}})}function Gb(e){const t=ad(),n=Re({id:t.generateId("label")},e),[r,o]=me(n,["ref","id"]);return ae(()=>ue(t.registerLabel(r.id))),f(ze,G({as:"div",ref(i){var s=tt(t.setLabelRef,r.ref);typeof s=="function"&&s(i)},get id(){return r.id}},()=>t.dataset(),o))}function Vb(e){const t=Dr();return f(q,{get when(){return t.contentPresent()},get children(){return f(Gi,e)}})}var Wb=dt();function Ok(){const e=ut(Wb);if(e===void 0)throw new Error("[kobalte]: `useMenuRadioGroupContext` must be used within a `Menu.RadioGroup` component");return e}function Yb(e){const n=cr().generateId(`radiogroup-${Dt()}`),r=Re({id:n},e),[o,i]=me(r,["value","defaultValue","onChange","disabled"]),[s,a]=Qi({value:()=>o.value,defaultValue:()=>o.defaultValue,onChange:c=>o.onChange?.(c)}),u={isDisabled:()=>o.disabled,isSelectedValue:c=>c===s(),setSelectedValue:c=>a(c)};return f(Wb.Provider,{value:u,get children(){return f(cd,i)}})}function Zb(e){const t=Ok(),n=Re({closeOnSelect:!1},e),[r,o]=me(n,["value","onSelect"]);return f(ud,G({role:"menuitemradio",get checked(){return t.isSelectedValue(r.value)},onSelect:()=>{r.onSelect?.(),t.setSelectedValue(r.value)}},o))}function Nk(e,t,n){const r=e.split("-")[0],o=n.getBoundingClientRect(),i=[],s=t.clientX,a=t.clientY;switch(r){case"top":i.push([s,a+5]),i.push([o.left,o.bottom]),i.push([o.left,o.top]),i.push([o.right,o.top]),i.push([o.right,o.bottom]);break;case"right":i.push([s-5,a]),i.push([o.left,o.top]),i.push([o.right,o.top]),i.push([o.right,o.bottom]),i.push([o.left,o.bottom]);break;case"bottom":i.push([s,a-5]),i.push([o.right,o.top]),i.push([o.right,o.bottom]),i.push([o.left,o.bottom]),i.push([o.left,o.top]);break;case"left":i.push([s+5,a]),i.push([o.right,o.bottom]),i.push([o.left,o.bottom]),i.push([o.left,o.top]),i.push([o.right,o.top]);break}return i}function Mk(e,t){return t?o0([e.clientX,e.clientY],t):!1}function Xb(e){const t=cr(),n=I0(),r=Mb(),o=Ua(),i=Ob(),s=Re({placement:t.orientation()==="horizontal"?"bottom-start":"right-start"},e),[a,u]=me(s,["open","defaultOpen","onOpenChange"]);let c=0,l=null,d="right";const[g,p]=I(),[h,m]=I(),[y,v]=I(),[b,w]=I(),[E,C]=I(!0),[k,T]=I(u.placement),[S,A]=I([]),[F,O]=I([]),{DomCollectionProvider:P}=ZC({items:F,onItemsChange:O}),L=wo({open:()=>a.open,defaultOpen:()=>a.defaultOpen,onOpenChange:M=>a.onOpenChange?.(M)}),{present:D}=nr({show:()=>t.forceMount()||L.isOpen(),element:()=>b()??null}),B=Gl({selectionMode:"none",dataSource:F}),N=M=>{C(M),L.open()},Y=(M=!1)=>{L.close(),M&&r&&r.close(!0)},ce=M=>{C(M),L.toggle()},V=()=>{const M=b();M&&(Et(M),B.selectionManager().setFocused(!0),B.selectionManager().setFocusedKey(void 0))},j=()=>{i!=null?setTimeout(()=>V()):V()},he=M=>{A(oe=>[...oe,M]);const W=r?.registerNestedMenu(M);return()=>{A(oe=>rl(oe,M)),W?.()}},K=M=>d===l?.side&&Mk(M,l?.area),z=M=>{K(M)&&M.preventDefault()},J=M=>{K(M)||j()},re=M=>{K(M)&&M.preventDefault()};Ba({isDisabled:()=>!(r==null&&L.isOpen()&&t.isModal()),targets:()=>[b(),...S()].filter(Boolean)}),ae(()=>{const M=b();if(!M||!r)return;const W=r.registerNestedMenu(M);ue(()=>{W()})}),ae(()=>{r===void 0&&o?.registerMenu(t.value(),[b(),...S()])}),ae(()=>{r!==void 0||o===void 0||(o.value()===t.value()?(y()?.focus(),o.autoFocusMenu()&&N(!0)):Y())}),ae(()=>{r!==void 0||o===void 0||L.isOpen()&&o.setValue(t.value())}),ue(()=>{r===void 0&&o?.unregisterMenu(t.value())});const Z={dataset:ne(()=>({"data-expanded":L.isOpen()?"":void 0,"data-closed":L.isOpen()?void 0:""})),isOpen:L.isOpen,contentPresent:D,nestedMenus:S,currentPlacement:k,pointerGraceTimeoutId:()=>c,autoFocus:E,listState:()=>B,parentMenuContext:()=>r,triggerRef:y,contentRef:b,triggerId:g,contentId:h,setTriggerRef:v,setContentRef:w,open:N,close:Y,toggle:ce,focusContent:j,onItemEnter:z,onItemLeave:J,onTriggerLeave:re,setPointerDir:M=>d=M,setPointerGraceTimeoutId:M=>c=M,setPointerGraceIntent:M=>l=M,registerNestedMenu:he,registerItemToParentDomCollection:n?.registerItem,registerTriggerId:ht(p),registerContentId:ht(m)};return f(P,{get children(){return f(Nb.Provider,{value:Z,get children(){return f(q,{when:i===void 0,get fallback(){return u.children},get children(){return f(Xr,G({anchorRef:y,contentRef:b,onCurrentPlacementChange:T},u))}})}})}})}function Jb(e){const{direction:t}=Zr();return f(Xb,G({get placement(){return t()==="rtl"?"left-start":"right-start"},flip:!0},e))}var Pk={close:(e,t)=>e==="ltr"?[t==="horizontal"?"ArrowLeft":"ArrowUp"]:[t==="horizontal"?"ArrowRight":"ArrowDown"]};function Qb(e){const t=Dr(),n=cr(),[r,o]=me(e,["onFocusOutside","onKeyDown"]),{direction:i}=Zr();return f(Bb,G({onOpenAutoFocus:l=>{l.preventDefault()},onCloseAutoFocus:l=>{l.preventDefault()},onFocusOutside:l=>{r.onFocusOutside?.(l);const d=l.target;Pt(t.triggerRef(),d)||t.close()},onKeyDown:l=>{Oe(l,r.onKeyDown);const d=Pt(l.currentTarget,l.target),g=Pk.close(i(),n.orientation()).includes(l.key),p=t.parentMenuContext()!=null;d&&g&&p&&(t.close(),Et(t.triggerRef()))}},o))}var ng=["Enter"," "],Lk={open:(e,t)=>e==="ltr"?[...ng,t==="horizontal"?"ArrowRight":"ArrowDown"]:[...ng,t==="horizontal"?"ArrowLeft":"ArrowUp"]};function e1(e){let t;const n=cr(),r=Dr(),o=Re({id:n.generateId(`sub-trigger-${Dt()}`)},e),[i,s]=me(o,["ref","id","textValue","disabled","onPointerMove","onPointerLeave","onPointerDown","onPointerUp","onClick","onKeyDown","onMouseDown","onFocus"]);let a=null;const u=()=>{a&&window.clearTimeout(a),a=null},{direction:c}=Zr(),l=()=>i.id,d=()=>{const w=r.parentMenuContext();if(w==null)throw new Error("[kobalte]: `Menu.SubTrigger` must be used within a `Menu.Sub` component");return w.listState().selectionManager()},g=()=>r.listState().collection(),p=()=>d().focusedKey()===l(),h=Hl({key:l,selectionManager:d,shouldSelectOnPressUp:!0,allowsDifferentPressOrigin:!0,disabled:()=>i.disabled},()=>t),m=w=>{Oe(w,i.onClick),!r.isOpen()&&!i.disabled&&r.open(!0)},y=w=>{if(Oe(w,i.onPointerMove),w.pointerType!=="mouse")return;const E=r.parentMenuContext();if(E?.onItemEnter(w),!w.defaultPrevented){if(i.disabled){E?.onItemLeave(w);return}!r.isOpen()&&!a&&(r.parentMenuContext()?.setPointerGraceIntent(null),a=window.setTimeout(()=>{r.open(!1),u()},100)),E?.onItemEnter(w),w.defaultPrevented||(r.listState().selectionManager().isFocused()&&(r.listState().selectionManager().setFocused(!1),r.listState().selectionManager().setFocusedKey(void 0)),Et(w.currentTarget),E?.listState().selectionManager().setFocused(!0),E?.listState().selectionManager().setFocusedKey(l()))}},v=w=>{if(Oe(w,i.onPointerLeave),w.pointerType!=="mouse")return;u();const E=r.parentMenuContext(),C=r.contentRef();if(C){E?.setPointerGraceIntent({area:Nk(r.currentPlacement(),w,C),side:r.currentPlacement().split("-")[0]}),window.clearTimeout(E?.pointerGraceTimeoutId());const k=window.setTimeout(()=>{E?.setPointerGraceIntent(null)},300);E?.setPointerGraceTimeoutId(k)}else{if(E?.onTriggerLeave(w),w.defaultPrevented)return;E?.setPointerGraceIntent(null)}E?.onItemLeave(w)},b=w=>{Oe(w,i.onKeyDown),!w.repeat&&(i.disabled||Lk.open(c(),n.orientation()).includes(w.key)&&(w.stopPropagation(),w.preventDefault(),d().setFocused(!1),d().setFocusedKey(void 0),r.isOpen()||r.open("first"),r.focusContent(),r.listState().selectionManager().setFocused(!0),r.listState().selectionManager().setFocusedKey(g().getFirstKey())))};return ae(()=>{if(r.registerItemToParentDomCollection==null)throw new Error("[kobalte]: `Menu.SubTrigger` must be used within a `Menu.Sub` component");const w=r.registerItemToParentDomCollection({ref:()=>t,type:"item",key:l(),textValue:i.textValue??t?.textContent??"",disabled:i.disabled??!1});ue(w)}),ae(_t(()=>r.parentMenuContext()?.pointerGraceTimeoutId(),w=>{ue(()=>{window.clearTimeout(w),r.parentMenuContext()?.setPointerGraceIntent(null)})})),ae(()=>ue(r.registerTriggerId(i.id))),ue(()=>{u()}),f(ze,G({as:"div",ref(w){var E=tt(C=>{r.setTriggerRef(C),t=C},i.ref);typeof E=="function"&&E(w)},get id(){return i.id},role:"menuitem",get tabIndex(){return h.tabIndex()},"aria-haspopup":"true",get"aria-expanded"(){return r.isOpen()},get"aria-controls"(){return Q(()=>!!r.isOpen())()?r.contentId():void 0},get"aria-disabled"(){return i.disabled},get"data-key"(){return h.dataKey()},get"data-highlighted"(){return p()?"":void 0},get"data-disabled"(){return i.disabled?"":void 0},get onPointerDown(){return gt([i.onPointerDown,h.onPointerDown])},get onPointerUp(){return gt([i.onPointerUp,h.onPointerUp])},get onClick(){return gt([m,h.onClick])},get onKeyDown(){return gt([b,h.onKeyDown])},get onMouseDown(){return gt([i.onMouseDown,h.onMouseDown])},get onFocus(){return gt([i.onFocus,h.onFocus])},onPointerMove:y,onPointerLeave:v},()=>r.dataset(),s))}function $k(e){const t=Ua(),n=`menu-${Dt()}`,r=Re({id:n,modal:!0},e),[o,i]=me(r,["id","modal","preventScroll","forceMount","open","defaultOpen","onOpenChange","value","orientation"]),s=wo({open:()=>o.open,defaultOpen:()=>o.defaultOpen,onOpenChange:u=>o.onOpenChange?.(u)}),a={isModal:()=>o.modal??!0,preventScroll:()=>o.preventScroll??a.isModal(),forceMount:()=>o.forceMount??!1,generateId:nn(()=>o.id),value:()=>o.value,orientation:()=>o.orientation??t?.orientation()??"horizontal"};return f(Lb.Provider,{value:a,get children(){return f(Xb,G({get open(){return s.isOpen()},get onOpenChange(){return s.setIsOpen}},i))}})}var Fk={};An(Fk,{Root:()=>Ka,Separator:()=>Bk});function Ka(e){let t;const n=Re({orientation:"horizontal"},e),[r,o]=me(n,["ref","orientation"]),i=ka(()=>t,()=>"hr");return f(ze,G({as:"hr",ref(s){var a=tt(u=>t=u,r.ref);typeof a=="function"&&a(s)},get role(){return i()!=="hr"?"separator":void 0},get"aria-orientation"(){return r.orientation==="vertical"?"vertical":void 0},get"data-orientation"(){return r.orientation}},o))}var Bk=Ka,zk={};An(zk,{Arrow:()=>Ar,CheckboxItem:()=>$b,Content:()=>t1,DropdownMenu:()=>yn,Group:()=>cd,GroupLabel:()=>Ub,Icon:()=>Kb,Item:()=>jb,ItemDescription:()=>qb,ItemIndicator:()=>Hb,ItemLabel:()=>Gb,Portal:()=>Vb,RadioGroup:()=>Yb,RadioItem:()=>Zb,Root:()=>n1,Separator:()=>Ka,Sub:()=>Jb,SubContent:()=>Qb,SubTrigger:()=>e1,Trigger:()=>Fb});function t1(e){const t=cr(),n=Dr(),[r,o]=me(e,["onCloseAutoFocus","onInteractOutside"]);let i=!1;return f(Ik,G({onCloseAutoFocus:u=>{r.onCloseAutoFocus?.(u),i||Et(n.triggerRef()),i=!1,u.preventDefault()},onInteractOutside:u=>{r.onInteractOutside?.(u),(!t.isModal()||u.detail.isContextMenu)&&(i=!0)}},o))}function n1(e){const t=`dropdownmenu-${Dt()}`,n=Re({id:t},e);return f($k,n)}var yn=Object.assign(n1,{Arrow:Ar,CheckboxItem:$b,Content:t1,Group:cd,GroupLabel:Ub,Icon:Kb,Item:jb,ItemDescription:qb,ItemIndicator:Hb,ItemLabel:Gb,Portal:Vb,RadioGroup:Yb,RadioItem:Zb,Separator:Ka,Sub:Jb,SubContent:Qb,SubTrigger:e1,Trigger:Fb}),Uk={};An(Uk,{Collapsible:()=>ja,Content:()=>o1,Root:()=>i1,Trigger:()=>s1,useCollapsibleContext:()=>ld});var r1=dt();function ld(){const e=ut(r1);if(e===void 0)throw new Error("[kobalte]: `useCollapsibleContext` must be used within a `Collapsible.Root` component");return e}function o1(e){const[t,n]=I(),r=ld(),o=Re({id:r.generateId("content")},e),[i,s]=me(o,["ref","id","style"]),{present:a}=nr({show:r.shouldMount,element:()=>t()??null}),[u,c]=I(0),[l,d]=I(0);let p=r.isOpen()||a();return Sn(()=>{const h=requestAnimationFrame(()=>{p=!1});ue(()=>{cancelAnimationFrame(h)})}),ae(_t(a,()=>{if(!t())return;t().style.transitionDuration="0s",t().style.animationName="none";const h=t().getBoundingClientRect();c(h.height),d(h.width),p||(t().style.transitionDuration="",t().style.animationName="")})),ae(_t(r.isOpen,h=>{!h&&t()&&(t().style.transitionDuration="",t().style.animationName="")},{defer:!0})),ae(()=>ue(r.registerContentId(i.id))),f(q,{get when(){return a()},get children(){return f(ze,G({as:"div",ref(h){var m=tt(n,i.ref);typeof m=="function"&&m(h)},get id(){return i.id},get style(){return wn({"--kb-collapsible-content-height":u()?`${u()}px`:void 0,"--kb-collapsible-content-width":l()?`${l()}px`:void 0},i.style)}},()=>r.dataset(),s))}})}function i1(e){const t=`collapsible-${Dt()}`,n=Re({id:t},e),[r,o]=me(n,["open","defaultOpen","onOpenChange","disabled","forceMount"]),[i,s]=I(),a=wo({open:()=>r.open,defaultOpen:()=>r.defaultOpen,onOpenChange:l=>r.onOpenChange?.(l)}),u=ne(()=>({"data-expanded":a.isOpen()?"":void 0,"data-closed":a.isOpen()?void 0:"","data-disabled":r.disabled?"":void 0})),c={dataset:u,isOpen:a.isOpen,disabled:()=>r.disabled??!1,shouldMount:()=>r.forceMount||a.isOpen(),contentId:i,toggle:a.toggle,generateId:nn(()=>o.id),registerContentId:ht(s)};return f(r1.Provider,{value:c,get children(){return f(ze,G({as:"div"},u,o))}})}function s1(e){const t=ld(),[n,r]=me(e,["onClick"]);return f(ar,G({get"aria-expanded"(){return t.isOpen()},get"aria-controls"(){return Q(()=>!!t.isOpen())()?t.contentId():void 0},get disabled(){return t.disabled()},onClick:i=>{Oe(i,n.onClick),t.toggle()}},()=>t.dataset(),r))}var ja=Object.assign(i1,{Content:o1,Trigger:s1}),Kk={};An(Kk,{CloseButton:()=>u1,Content:()=>c1,Description:()=>l1,Dialog:()=>_r,Overlay:()=>d1,Portal:()=>f1,Root:()=>g1,Title:()=>p1,Trigger:()=>h1,useDialogContext:()=>Qr});var a1=dt();function Qr(){const e=ut(a1);if(e===void 0)throw new Error("[kobalte]: `useDialogContext` must be used within a `Dialog` component");return e}function u1(e){const t=Qr(),[n,r]=me(e,["aria-label","onClick"]);return f(ar,G({get"aria-label"(){return n["aria-label"]||t.translations().dismiss},onClick:i=>{Oe(i,n.onClick),t.close()}},r))}function c1(e){let t;const n=Qr(),r=Re({id:n.generateId("content")},e),[o,i]=me(r,["ref","onOpenAutoFocus","onCloseAutoFocus","onPointerDownOutside","onFocusOutside","onInteractOutside"]);let s=!1,a=!1;const u=g=>{o.onPointerDownOutside?.(g),n.modal()&&g.detail.isContextMenu&&g.preventDefault()},c=g=>{o.onFocusOutside?.(g),n.modal()&&g.preventDefault()},l=g=>{o.onInteractOutside?.(g),!n.modal()&&(g.defaultPrevented||(s=!0,g.detail.originalEvent.type==="pointerdown"&&(a=!0)),Pt(n.triggerRef(),g.target)&&g.preventDefault(),g.detail.originalEvent.type==="focusin"&&a&&g.preventDefault())},d=g=>{o.onCloseAutoFocus?.(g),n.modal()?(g.preventDefault(),Et(n.triggerRef())):(g.defaultPrevented||(s||Et(n.triggerRef()),g.preventDefault()),s=!1,a=!1)};return Ba({isDisabled:()=>!(n.isOpen()&&n.modal()),targets:()=>t?[t]:[]}),za({element:()=>t??null,enabled:()=>n.contentPresent()&&n.preventScroll()}),Fa({trapFocus:()=>n.isOpen()&&n.modal(),onMountAutoFocus:o.onOpenAutoFocus,onUnmountAutoFocus:d},()=>t),ae(()=>ue(n.registerContentId(i.id))),f(q,{get when(){return n.contentPresent()},get children(){return f(ts,G({ref(g){var p=tt(h=>{n.setContentRef(h),t=h},o.ref);typeof p=="function"&&p(g)},role:"dialog",tabIndex:-1,get disableOutsidePointerEvents(){return Q(()=>!!n.modal())()&&n.isOpen()},get excludedElements(){return[n.triggerRef]},get"aria-labelledby"(){return n.titleId()},get"aria-describedby"(){return n.descriptionId()},get"data-expanded"(){return n.isOpen()?"":void 0},get"data-closed"(){return n.isOpen()?void 0:""},onPointerDownOutside:u,onFocusOutside:c,onInteractOutside:l,get onDismiss(){return n.close}},i))}})}function l1(e){const t=Qr(),n=Re({id:t.generateId("description")},e),[r,o]=me(n,["id"]);return ae(()=>ue(t.registerDescriptionId(r.id))),f(ze,G({as:"p",get id(){return r.id}},o))}function d1(e){const t=Qr(),[n,r]=me(e,["ref","style","onPointerDown"]),o=i=>{Oe(i,n.onPointerDown),i.target===i.currentTarget&&i.preventDefault()};return f(q,{get when(){return t.overlayPresent()},get children(){return f(ze,G({as:"div",ref(i){var s=tt(t.setOverlayRef,n.ref);typeof s=="function"&&s(i)},get style(){return wn({"pointer-events":"auto"},n.style)},get"data-expanded"(){return t.isOpen()?"":void 0},get"data-closed"(){return t.isOpen()?void 0:""},onPointerDown:o},r))}})}function f1(e){const t=Qr();return f(q,{get when(){return t.contentPresent()||t.overlayPresent()},get children(){return f(Gi,e)}})}var rg={dismiss:"Dismiss"};function g1(e){const t=`dialog-${Dt()}`,n=Re({id:t,modal:!0,translations:rg},e),[r,o]=I(),[i,s]=I(),[a,u]=I(),[c,l]=I(),[d,g]=I(),[p,h]=I(),m=wo({open:()=>n.open,defaultOpen:()=>n.defaultOpen,onOpenChange:E=>n.onOpenChange?.(E)}),y=()=>n.forceMount||m.isOpen(),{present:v}=nr({show:y,element:()=>c()??null}),{present:b}=nr({show:y,element:()=>d()??null}),w={translations:()=>n.translations??rg,isOpen:m.isOpen,modal:()=>n.modal??!0,preventScroll:()=>n.preventScroll??w.modal(),contentId:r,titleId:i,descriptionId:a,triggerRef:p,overlayRef:c,setOverlayRef:l,contentRef:d,setContentRef:g,overlayPresent:v,contentPresent:b,close:m.close,toggle:m.toggle,setTriggerRef:h,generateId:nn(()=>n.id),registerContentId:ht(o),registerTitleId:ht(s),registerDescriptionId:ht(u)};return f(a1.Provider,{value:w,get children(){return n.children}})}function p1(e){const t=Qr(),n=Re({id:t.generateId("title")},e),[r,o]=me(n,["id"]);return ae(()=>ue(t.registerTitleId(r.id))),f(ze,G({as:"h2",get id(){return r.id}},o))}function h1(e){const t=Qr(),[n,r]=me(e,["ref","onClick"]);return f(ar,G({ref(i){var s=tt(t.setTriggerRef,n.ref);typeof s=="function"&&s(i)},"aria-haspopup":"dialog",get"aria-expanded"(){return t.isOpen()},get"aria-controls"(){return Q(()=>!!t.isOpen())()?t.contentId():void 0},get"data-expanded"(){return t.isOpen()?"":void 0},get"data-closed"(){return t.isOpen()?void 0:""},onClick:i=>{Oe(i,n.onClick),t.toggle()}},r))}var _r=Object.assign(g1,{CloseButton:u1,Content:c1,Description:l1,Overlay:d1,Portal:f1,Title:p1,Trigger:h1}),jk={};An(jk,{Checkbox:()=>Ur,Control:()=>b1,Description:()=>y1,ErrorMessage:()=>v1,Indicator:()=>w1,Input:()=>x1,Label:()=>_1,Root:()=>E1,useCheckboxContext:()=>xo});var m1=dt();function xo(){const e=ut(m1);if(e===void 0)throw new Error("[kobalte]: `useCheckboxContext` must be used within a `Checkbox` component");return e}function b1(e){const t=Tn(),n=xo(),r=Re({id:n.generateId("control")},e),[o,i]=me(r,["onClick","onKeyDown"]);return f(ze,G({as:"div",onClick:u=>{Oe(u,o.onClick),n.toggle(),n.inputRef()?.focus({preventScroll:!0})},onKeyDown:u=>{Oe(u,o.onKeyDown),u.key===Ca.Space&&(n.toggle(),n.inputRef()?.focus({preventScroll:!0}))}},()=>t.dataset(),()=>n.dataset(),i))}function y1(e){const t=xo();return f(ns,G(()=>t.dataset(),e))}function v1(e){const t=xo();return f(rs,G(()=>t.dataset(),e))}function w1(e){const t=Tn(),n=xo(),[r,o]=I(),i=Re({id:n.generateId("indicator")},e),[s,a]=me(i,["ref","forceMount"]),{present:u}=nr({show:()=>s.forceMount||n.indeterminate()||n.checked(),element:()=>r()??null});return f(q,{get when(){return u()},get children(){return f(ze,G({as:"div",ref(c){var l=tt(o,s.ref);typeof l=="function"&&l(c)}},()=>t.dataset(),()=>n.dataset(),a))}})}function x1(e){let t;const n=Tn(),r=xo(),o=Re({id:r.generateId("input")},e),[i,s,a]=me(o,["ref","style","onChange","onFocus","onBlur"],tb),{fieldProps:u}=nb(s),[c,l]=I(!1),d=h=>{if(Oe(h,i.onChange),h.stopPropagation(),!c()){const m=h.target;r.setIsChecked(m.checked),m.checked=r.checked()}l(!1)},g=h=>{Oe(h,i.onFocus),r.setIsFocused(!0)},p=h=>{Oe(h,i.onBlur),r.setIsFocused(!1)};return ae(_t([()=>r.checked(),()=>r.value()],()=>{l(!0),t?.dispatchEvent(new Event("input",{bubbles:!0,cancelable:!0})),t?.dispatchEvent(new Event("change",{bubbles:!0,cancelable:!0}))},{defer:!0})),ae(_t([()=>t,()=>r.indeterminate(),()=>r.checked()],([h,m])=>{h&&(h.indeterminate=m)})),f(ze,G({as:"input",ref(h){var m=tt(y=>{r.setInputRef(y),t=y},i.ref);typeof m=="function"&&m(h)},type:"checkbox",get id(){return u.id()},get name(){return n.name()},get value(){return r.value()},get checked(){return r.checked()},get required(){return n.isRequired()},get disabled(){return n.isDisabled()},get readonly(){return n.isReadOnly()},get style(){return wn(Sa,i.style)},get"aria-label"(){return u.ariaLabel()},get"aria-labelledby"(){return u.ariaLabelledBy()},get"aria-describedby"(){return u.ariaDescribedBy()},get"aria-invalid"(){return n.validationState()==="invalid"||void 0},get"aria-required"(){return n.isRequired()},get"aria-disabled"(){return n.isDisabled()},get"aria-readonly"(){return n.isReadOnly()},onChange:d,onFocus:g,onBlur:p},()=>n.dataset(),()=>r.dataset(),a))}function _1(e){const t=xo();return f(od,G(()=>t.dataset(),e))}function E1(e){let t;const n=`checkbox-${Dt()}`,r=Re({value:"on",id:n},e),[o,i,s]=me(r,["ref","children","value","checked","defaultChecked","indeterminate","onChange","onPointerDown"],ed),[a,u]=I(),[c,l]=I(!1),{formControlContext:d}=td(i),g=x0({isSelected:()=>o.checked,defaultIsSelected:()=>o.defaultChecked,onSelectedChange:y=>o.onChange?.(y),isDisabled:()=>d.isDisabled(),isReadOnly:()=>d.isReadOnly()});id(()=>t,()=>g.setIsSelected(o.defaultChecked??!1));const p=y=>{Oe(y,o.onPointerDown),c()&&y.preventDefault()},h=ne(()=>({"data-checked":g.isSelected()?"":void 0,"data-indeterminate":o.indeterminate?"":void 0})),m={value:()=>o.value,dataset:h,checked:()=>g.isSelected(),indeterminate:()=>o.indeterminate??!1,inputRef:a,generateId:nn(()=>ee(i.id)),toggle:()=>g.toggle(),setIsChecked:y=>g.setIsSelected(y),setIsFocused:l,setInputRef:u};return f(Oa.Provider,{value:d,get children(){return f(m1.Provider,{value:m,get children(){return f(ze,G({as:"div",ref(y){var v=tt(b=>t=b,o.ref);typeof v=="function"&&v(y)},role:"group",get id(){return ee(i.id)},onPointerDown:p},()=>d.dataset(),h,s,{get children(){return f(qk,{state:m,get children(){return o.children}})}}))}})}})}function qk(e){const t=ni(()=>{const n=e.children;return Yi(n)?n(e.state):n});return Q(t)}var Ur=Object.assign(E1,{Control:b1,Description:y1,ErrorMessage:v1,Indicator:w1,Input:x1,Label:_1});function C1(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=C1(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function S1(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=C1(e))&&(r&&(r+=" "),r+=t);return r}const Hk=(e,t)=>{const n=new Array(e.length+t.length);for(let r=0;r<e.length;r++)n[r]=e[r];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},Gk=(e,t)=>({classGroupId:e,validator:t}),k1=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),aa="-",og=[],Vk="arbitrary..",Wk=e=>{const t=Zk(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:s=>{if(s.startsWith("[")&&s.endsWith("]"))return Yk(s);const a=s.split(aa),u=a[0]===""&&a.length>1?1:0;return A1(a,u,t)},getConflictingClassGroupIds:(s,a)=>{if(a){const u=r[s],c=n[s];return u?c?Hk(c,u):u:c||og}return n[s]||og}}},A1=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const o=e[t],i=n.nextPart.get(o);if(i){const c=A1(e,t+1,i);if(c)return c}const s=n.validators;if(s===null)return;const a=t===0?e.join(aa):e.slice(t).join(aa),u=s.length;for(let c=0;c<u;c++){const l=s[c];if(l.validator(a))return l.classGroupId}},Yk=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),r=t.slice(0,n);return r?Vk+r:void 0})(),Zk=e=>{const{theme:t,classGroups:n}=e;return Xk(n,t)},Xk=(e,t)=>{const n=k1();for(const r in e){const o=e[r];dd(o,n,r,t)}return n},dd=(e,t,n,r)=>{const o=e.length;for(let i=0;i<o;i++){const s=e[i];Jk(s,t,n,r)}},Jk=(e,t,n,r)=>{if(typeof e=="string"){Qk(e,t,n);return}if(typeof e=="function"){e3(e,t,n,r);return}t3(e,t,n,r)},Qk=(e,t,n)=>{const r=e===""?t:T1(t,e);r.classGroupId=n},e3=(e,t,n,r)=>{if(n3(e)){dd(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(Gk(n,e))},t3=(e,t,n,r)=>{const o=Object.entries(e),i=o.length;for(let s=0;s<i;s++){const[a,u]=o[s];dd(u,T1(t,a),n,r)}},T1=(e,t)=>{let n=e;const r=t.split(aa),o=r.length;for(let i=0;i<o;i++){const s=r[i];let a=n.nextPart.get(s);a||(a=k1(),n.nextPart.set(s,a)),n=a}return n},n3=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,r3=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null);const o=(i,s)=>{n[i]=s,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(i){let s=n[i];if(s!==void 0)return s;if((s=r[i])!==void 0)return o(i,s),s},set(i,s){i in n?n[i]=s:o(i,s)}}},gl="!",ig=":",o3=[],sg=(e,t,n,r,o)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:o}),i3=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=o=>{const i=[];let s=0,a=0,u=0,c;const l=o.length;for(let m=0;m<l;m++){const y=o[m];if(s===0&&a===0){if(y===ig){i.push(o.slice(u,m)),u=m+1;continue}if(y==="/"){c=m;continue}}y==="["?s++:y==="]"?s--:y==="("?a++:y===")"&&a--}const d=i.length===0?o:o.slice(u);let g=d,p=!1;d.endsWith(gl)?(g=d.slice(0,-1),p=!0):d.startsWith(gl)&&(g=d.slice(1),p=!0);const h=c&&c>u?c-u:void 0;return sg(i,p,g,h)};if(t){const o=t+ig,i=r;r=s=>s.startsWith(o)?i(s.slice(o.length)):sg(o3,!1,s,void 0,!0)}if(n){const o=r;r=i=>n({className:i,parseClassName:o})}return r},s3=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,r)=>{t.set(n,1e6+r)}),n=>{const r=[];let o=[];for(let i=0;i<n.length;i++){const s=n[i],a=s[0]==="[",u=t.has(s);a||u?(o.length>0&&(o.sort(),r.push(...o),o=[]),r.push(s)):o.push(s)}return o.length>0&&(o.sort(),r.push(...o)),r}},a3=e=>({cache:r3(e.cacheSize),parseClassName:i3(e),sortModifiers:s3(e),postfixLookupClassGroupIds:u3(e),...Wk(e)}),u3=e=>{const t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let r=0;r<n.length;r++)t[n[r]]=!0;return t},c3=/\s+/,l3=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o,sortModifiers:i,postfixLookupClassGroupIds:s}=t,a=[],u=e.trim().split(c3);let c="";for(let l=u.length-1;l>=0;l-=1){const d=u[l],{isExternal:g,modifiers:p,hasImportantModifier:h,baseClassName:m,maybePostfixModifierPosition:y}=n(d);if(g){c=d+(c.length>0?" "+c:c);continue}let v=!!y,b;if(v){const T=m.substring(0,y);b=r(T);const S=b&&s[b]?r(m):void 0;S&&S!==b&&(b=S,v=!1)}else b=r(m);if(!b){if(!v){c=d+(c.length>0?" "+c:c);continue}if(b=r(m),!b){c=d+(c.length>0?" "+c:c);continue}v=!1}const w=p.length===0?"":p.length===1?p[0]:i(p).join(":"),E=h?w+gl:w,C=E+b;if(a.indexOf(C)>-1)continue;a.push(C);const k=o(b,v);for(let T=0;T<k.length;++T){const S=k[T];a.push(E+S)}c=d+(c.length>0?" "+c:c)}return c},d3=(...e)=>{let t=0,n,r,o="";for(;t<e.length;)(n=e[t++])&&(r=D1(n))&&(o&&(o+=" "),o+=r);return o},D1=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=D1(e[r]))&&(n&&(n+=" "),n+=t);return n},f3=(e,...t)=>{let n,r,o,i;const s=u=>{const c=t.reduce((l,d)=>d(l),e());return n=a3(c),r=n.cache.get,o=n.cache.set,i=a,a(u)},a=u=>{const c=r(u);if(c)return c;const l=l3(u,n);return o(u,l),l};return i=s,(...u)=>i(d3(...u))},g3=[],Mt=e=>{const t=n=>n[e]||g3;return t.isThemeGetter=!0,t},I1=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,R1=/^\((?:(\w[\w-]*):)?(.+)\)$/i,p3=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,h3=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,m3=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,b3=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,y3=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,v3=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Mr=e=>p3.test(e),Je=e=>!!e&&!Number.isNaN(Number(e)),Gn=e=>!!e&&Number.isInteger(Number(e)),hu=e=>e.endsWith("%")&&Je(e.slice(0,-1)),yr=e=>h3.test(e),O1=()=>!0,w3=e=>m3.test(e)&&!b3.test(e),fd=()=>!1,x3=e=>y3.test(e),_3=e=>v3.test(e),E3=e=>!De(e)&&!Ie(e),C3=e=>e.startsWith("@container")&&(e[10]==="/"&&e[11]!==void 0||e[11]==="s"&&e[16]!==void 0&&e.startsWith("-size/",10)||e[11]==="n"&&e[18]!==void 0&&e.startsWith("-normal/",10)),S3=e=>eo(e,P1,fd),De=e=>I1.test(e),so=e=>eo(e,L1,w3),ag=e=>eo(e,N3,Je),k3=e=>eo(e,F1,O1),A3=e=>eo(e,$1,fd),ug=e=>eo(e,N1,fd),T3=e=>eo(e,M1,_3),Ss=e=>eo(e,B1,x3),Ie=e=>R1.test(e),fi=e=>_o(e,L1),D3=e=>_o(e,$1),cg=e=>_o(e,N1),I3=e=>_o(e,P1),R3=e=>_o(e,M1),ks=e=>_o(e,B1,!0),O3=e=>_o(e,F1,!0),eo=(e,t,n)=>{const r=I1.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},_o=(e,t,n=!1)=>{const r=R1.exec(e);return r?r[1]?t(r[1]):n:!1},N1=e=>e==="position"||e==="percentage",M1=e=>e==="image"||e==="url",P1=e=>e==="length"||e==="size"||e==="bg-size",L1=e=>e==="length",N3=e=>e==="number",$1=e=>e==="family-name",F1=e=>e==="number"||e==="weight",B1=e=>e==="shadow",M3=()=>{const e=Mt("color"),t=Mt("font"),n=Mt("text"),r=Mt("font-weight"),o=Mt("tracking"),i=Mt("leading"),s=Mt("breakpoint"),a=Mt("container"),u=Mt("spacing"),c=Mt("radius"),l=Mt("shadow"),d=Mt("inset-shadow"),g=Mt("text-shadow"),p=Mt("drop-shadow"),h=Mt("blur"),m=Mt("perspective"),y=Mt("aspect"),v=Mt("ease"),b=Mt("animate"),w=()=>["auto","avoid","all","avoid-page","page","left","right","column"],E=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],C=()=>[...E(),Ie,De],k=()=>["auto","hidden","clip","visible","scroll"],T=()=>["auto","contain","none"],S=()=>[Ie,De,u],A=()=>[Mr,"full","auto",...S()],F=()=>[Gn,"none","subgrid",Ie,De],O=()=>["auto",{span:["full",Gn,Ie,De]},Gn,Ie,De],P=()=>[Gn,"auto",Ie,De],L=()=>["auto","min","max","fr",Ie,De],D=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],B=()=>["start","end","center","stretch","center-safe","end-safe"],N=()=>["auto",...S()],Y=()=>[Mr,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...S()],ce=()=>[Mr,"screen","full","dvw","lvw","svw","min","max","fit",...S()],V=()=>[Mr,"screen","full","lh","dvh","lvh","svh","min","max","fit",...S()],j=()=>[e,Ie,De],he=()=>[...E(),cg,ug,{position:[Ie,De]}],K=()=>["no-repeat",{repeat:["","x","y","space","round"]}],z=()=>["auto","cover","contain",I3,S3,{size:[Ie,De]}],J=()=>[hu,fi,so],re=()=>["","none","full",c,Ie,De],ve=()=>["",Je,fi,so],Z=()=>["solid","dashed","dotted","double"],M=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],W=()=>[Je,hu,cg,ug],oe=()=>["","none",h,Ie,De],te=()=>["none",Je,Ie,De],H=()=>["none",Je,Ie,De],de=()=>[Je,Ie,De],fe=()=>[Mr,"full",...S()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[yr],breakpoint:[yr],color:[O1],container:[yr],"drop-shadow":[yr],ease:["in","out","in-out"],font:[E3],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[yr],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[yr],shadow:[yr],spacing:["px",Je],text:[yr],"text-shadow":[yr],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Mr,De,Ie,y]}],container:["container"],"container-type":[{"@container":["","normal","size",Ie,De]}],"container-named":[C3],columns:[{columns:[Je,De,Ie,a]}],"break-after":[{"break-after":w()}],"break-before":[{"break-before":w()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:C()}],overflow:[{overflow:k()}],"overflow-x":[{"overflow-x":k()}],"overflow-y":[{"overflow-y":k()}],overscroll:[{overscroll:T()}],"overscroll-x":[{"overscroll-x":T()}],"overscroll-y":[{"overscroll-y":T()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:A()}],"inset-x":[{"inset-x":A()}],"inset-y":[{"inset-y":A()}],start:[{"inset-s":A(),start:A()}],end:[{"inset-e":A(),end:A()}],"inset-bs":[{"inset-bs":A()}],"inset-be":[{"inset-be":A()}],top:[{top:A()}],right:[{right:A()}],bottom:[{bottom:A()}],left:[{left:A()}],visibility:["visible","invisible","collapse"],z:[{z:[Gn,"auto",Ie,De]}],basis:[{basis:[Mr,"full","auto",a,...S()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Je,Mr,"auto","initial","none",De]}],grow:[{grow:["",Je,Ie,De]}],shrink:[{shrink:["",Je,Ie,De]}],order:[{order:[Gn,"first","last","none",Ie,De]}],"grid-cols":[{"grid-cols":F()}],"col-start-end":[{col:O()}],"col-start":[{"col-start":P()}],"col-end":[{"col-end":P()}],"grid-rows":[{"grid-rows":F()}],"row-start-end":[{row:O()}],"row-start":[{"row-start":P()}],"row-end":[{"row-end":P()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":L()}],"auto-rows":[{"auto-rows":L()}],gap:[{gap:S()}],"gap-x":[{"gap-x":S()}],"gap-y":[{"gap-y":S()}],"justify-content":[{justify:[...D(),"normal"]}],"justify-items":[{"justify-items":[...B(),"normal"]}],"justify-self":[{"justify-self":["auto",...B()]}],"align-content":[{content:["normal",...D()]}],"align-items":[{items:[...B(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...B(),{baseline:["","last"]}]}],"place-content":[{"place-content":D()}],"place-items":[{"place-items":[...B(),"baseline"]}],"place-self":[{"place-self":["auto",...B()]}],p:[{p:S()}],px:[{px:S()}],py:[{py:S()}],ps:[{ps:S()}],pe:[{pe:S()}],pbs:[{pbs:S()}],pbe:[{pbe:S()}],pt:[{pt:S()}],pr:[{pr:S()}],pb:[{pb:S()}],pl:[{pl:S()}],m:[{m:N()}],mx:[{mx:N()}],my:[{my:N()}],ms:[{ms:N()}],me:[{me:N()}],mbs:[{mbs:N()}],mbe:[{mbe:N()}],mt:[{mt:N()}],mr:[{mr:N()}],mb:[{mb:N()}],ml:[{ml:N()}],"space-x":[{"space-x":S()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":S()}],"space-y-reverse":["space-y-reverse"],size:[{size:Y()}],"inline-size":[{inline:["auto",...ce()]}],"min-inline-size":[{"min-inline":["auto",...ce()]}],"max-inline-size":[{"max-inline":["none",...ce()]}],"block-size":[{block:["auto",...V()]}],"min-block-size":[{"min-block":["auto",...V()]}],"max-block-size":[{"max-block":["none",...V()]}],w:[{w:[a,"screen",...Y()]}],"min-w":[{"min-w":[a,"screen","none",...Y()]}],"max-w":[{"max-w":[a,"screen","none","prose",{screen:[s]},...Y()]}],h:[{h:["screen","lh",...Y()]}],"min-h":[{"min-h":["screen","lh","none",...Y()]}],"max-h":[{"max-h":["screen","lh",...Y()]}],"font-size":[{text:["base",n,fi,so]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,O3,k3]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",hu,De]}],"font-family":[{font:[D3,A3,t]}],"font-features":[{"font-features":[De]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[o,Ie,De]}],"line-clamp":[{"line-clamp":[Je,"none",Ie,ag]}],leading:[{leading:[i,...S()]}],"list-image":[{"list-image":["none",Ie,De]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Ie,De]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:j()}],"text-color":[{text:j()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Z(),"wavy"]}],"text-decoration-thickness":[{decoration:[Je,"from-font","auto",Ie,so]}],"text-decoration-color":[{decoration:j()}],"underline-offset":[{"underline-offset":[Je,"auto",Ie,De]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:S()}],"tab-size":[{tab:[Gn,Ie,De]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ie,De]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Ie,De]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:he()}],"bg-repeat":[{bg:K()}],"bg-size":[{bg:z()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Gn,Ie,De],radial:["",Ie,De],conic:[Gn,Ie,De]},R3,T3]}],"bg-color":[{bg:j()}],"gradient-from-pos":[{from:J()}],"gradient-via-pos":[{via:J()}],"gradient-to-pos":[{to:J()}],"gradient-from":[{from:j()}],"gradient-via":[{via:j()}],"gradient-to":[{to:j()}],rounded:[{rounded:re()}],"rounded-s":[{"rounded-s":re()}],"rounded-e":[{"rounded-e":re()}],"rounded-t":[{"rounded-t":re()}],"rounded-r":[{"rounded-r":re()}],"rounded-b":[{"rounded-b":re()}],"rounded-l":[{"rounded-l":re()}],"rounded-ss":[{"rounded-ss":re()}],"rounded-se":[{"rounded-se":re()}],"rounded-ee":[{"rounded-ee":re()}],"rounded-es":[{"rounded-es":re()}],"rounded-tl":[{"rounded-tl":re()}],"rounded-tr":[{"rounded-tr":re()}],"rounded-br":[{"rounded-br":re()}],"rounded-bl":[{"rounded-bl":re()}],"border-w":[{border:ve()}],"border-w-x":[{"border-x":ve()}],"border-w-y":[{"border-y":ve()}],"border-w-s":[{"border-s":ve()}],"border-w-e":[{"border-e":ve()}],"border-w-bs":[{"border-bs":ve()}],"border-w-be":[{"border-be":ve()}],"border-w-t":[{"border-t":ve()}],"border-w-r":[{"border-r":ve()}],"border-w-b":[{"border-b":ve()}],"border-w-l":[{"border-l":ve()}],"divide-x":[{"divide-x":ve()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ve()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...Z(),"hidden","none"]}],"divide-style":[{divide:[...Z(),"hidden","none"]}],"border-color":[{border:j()}],"border-color-x":[{"border-x":j()}],"border-color-y":[{"border-y":j()}],"border-color-s":[{"border-s":j()}],"border-color-e":[{"border-e":j()}],"border-color-bs":[{"border-bs":j()}],"border-color-be":[{"border-be":j()}],"border-color-t":[{"border-t":j()}],"border-color-r":[{"border-r":j()}],"border-color-b":[{"border-b":j()}],"border-color-l":[{"border-l":j()}],"divide-color":[{divide:j()}],"outline-style":[{outline:[...Z(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Je,Ie,De]}],"outline-w":[{outline:["",Je,fi,so]}],"outline-color":[{outline:j()}],shadow:[{shadow:["","none",l,ks,Ss]}],"shadow-color":[{shadow:j()}],"inset-shadow":[{"inset-shadow":["none",d,ks,Ss]}],"inset-shadow-color":[{"inset-shadow":j()}],"ring-w":[{ring:ve()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:j()}],"ring-offset-w":[{"ring-offset":[Je,so]}],"ring-offset-color":[{"ring-offset":j()}],"inset-ring-w":[{"inset-ring":ve()}],"inset-ring-color":[{"inset-ring":j()}],"text-shadow":[{"text-shadow":["none",g,ks,Ss]}],"text-shadow-color":[{"text-shadow":j()}],opacity:[{opacity:[Je,Ie,De]}],"mix-blend":[{"mix-blend":[...M(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":M()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Je]}],"mask-image-linear-from-pos":[{"mask-linear-from":W()}],"mask-image-linear-to-pos":[{"mask-linear-to":W()}],"mask-image-linear-from-color":[{"mask-linear-from":j()}],"mask-image-linear-to-color":[{"mask-linear-to":j()}],"mask-image-t-from-pos":[{"mask-t-from":W()}],"mask-image-t-to-pos":[{"mask-t-to":W()}],"mask-image-t-from-color":[{"mask-t-from":j()}],"mask-image-t-to-color":[{"mask-t-to":j()}],"mask-image-r-from-pos":[{"mask-r-from":W()}],"mask-image-r-to-pos":[{"mask-r-to":W()}],"mask-image-r-from-color":[{"mask-r-from":j()}],"mask-image-r-to-color":[{"mask-r-to":j()}],"mask-image-b-from-pos":[{"mask-b-from":W()}],"mask-image-b-to-pos":[{"mask-b-to":W()}],"mask-image-b-from-color":[{"mask-b-from":j()}],"mask-image-b-to-color":[{"mask-b-to":j()}],"mask-image-l-from-pos":[{"mask-l-from":W()}],"mask-image-l-to-pos":[{"mask-l-to":W()}],"mask-image-l-from-color":[{"mask-l-from":j()}],"mask-image-l-to-color":[{"mask-l-to":j()}],"mask-image-x-from-pos":[{"mask-x-from":W()}],"mask-image-x-to-pos":[{"mask-x-to":W()}],"mask-image-x-from-color":[{"mask-x-from":j()}],"mask-image-x-to-color":[{"mask-x-to":j()}],"mask-image-y-from-pos":[{"mask-y-from":W()}],"mask-image-y-to-pos":[{"mask-y-to":W()}],"mask-image-y-from-color":[{"mask-y-from":j()}],"mask-image-y-to-color":[{"mask-y-to":j()}],"mask-image-radial":[{"mask-radial":[Ie,De]}],"mask-image-radial-from-pos":[{"mask-radial-from":W()}],"mask-image-radial-to-pos":[{"mask-radial-to":W()}],"mask-image-radial-from-color":[{"mask-radial-from":j()}],"mask-image-radial-to-color":[{"mask-radial-to":j()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":E()}],"mask-image-conic-pos":[{"mask-conic":[Je]}],"mask-image-conic-from-pos":[{"mask-conic-from":W()}],"mask-image-conic-to-pos":[{"mask-conic-to":W()}],"mask-image-conic-from-color":[{"mask-conic-from":j()}],"mask-image-conic-to-color":[{"mask-conic-to":j()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:he()}],"mask-repeat":[{mask:K()}],"mask-size":[{mask:z()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Ie,De]}],filter:[{filter:["","none",Ie,De]}],blur:[{blur:oe()}],brightness:[{brightness:[Je,Ie,De]}],contrast:[{contrast:[Je,Ie,De]}],"drop-shadow":[{"drop-shadow":["","none",p,ks,Ss]}],"drop-shadow-color":[{"drop-shadow":j()}],grayscale:[{grayscale:["",Je,Ie,De]}],"hue-rotate":[{"hue-rotate":[Je,Ie,De]}],invert:[{invert:["",Je,Ie,De]}],saturate:[{saturate:[Je,Ie,De]}],sepia:[{sepia:["",Je,Ie,De]}],"backdrop-filter":[{"backdrop-filter":["","none",Ie,De]}],"backdrop-blur":[{"backdrop-blur":oe()}],"backdrop-brightness":[{"backdrop-brightness":[Je,Ie,De]}],"backdrop-contrast":[{"backdrop-contrast":[Je,Ie,De]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Je,Ie,De]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Je,Ie,De]}],"backdrop-invert":[{"backdrop-invert":["",Je,Ie,De]}],"backdrop-opacity":[{"backdrop-opacity":[Je,Ie,De]}],"backdrop-saturate":[{"backdrop-saturate":[Je,Ie,De]}],"backdrop-sepia":[{"backdrop-sepia":["",Je,Ie,De]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":S()}],"border-spacing-x":[{"border-spacing-x":S()}],"border-spacing-y":[{"border-spacing-y":S()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Ie,De]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Je,"initial",Ie,De]}],ease:[{ease:["linear","initial",v,Ie,De]}],delay:[{delay:[Je,Ie,De]}],animate:[{animate:["none",b,Ie,De]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[m,Ie,De]}],"perspective-origin":[{"perspective-origin":C()}],rotate:[{rotate:te()}],"rotate-x":[{"rotate-x":te()}],"rotate-y":[{"rotate-y":te()}],"rotate-z":[{"rotate-z":te()}],scale:[{scale:H()}],"scale-x":[{"scale-x":H()}],"scale-y":[{"scale-y":H()}],"scale-z":[{"scale-z":H()}],"scale-3d":["scale-3d"],skew:[{skew:de()}],"skew-x":[{"skew-x":de()}],"skew-y":[{"skew-y":de()}],transform:[{transform:[Ie,De,"","none","gpu","cpu"]}],"transform-origin":[{origin:C()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:fe()}],"translate-x":[{"translate-x":fe()}],"translate-y":[{"translate-y":fe()}],"translate-z":[{"translate-z":fe()}],"translate-none":["translate-none"],zoom:[{zoom:[Gn,Ie,De]}],accent:[{accent:j()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:j()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Ie,De]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":j()}],"scrollbar-track-color":[{"scrollbar-track":j()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":S()}],"scroll-mx":[{"scroll-mx":S()}],"scroll-my":[{"scroll-my":S()}],"scroll-ms":[{"scroll-ms":S()}],"scroll-me":[{"scroll-me":S()}],"scroll-mbs":[{"scroll-mbs":S()}],"scroll-mbe":[{"scroll-mbe":S()}],"scroll-mt":[{"scroll-mt":S()}],"scroll-mr":[{"scroll-mr":S()}],"scroll-mb":[{"scroll-mb":S()}],"scroll-ml":[{"scroll-ml":S()}],"scroll-p":[{"scroll-p":S()}],"scroll-px":[{"scroll-px":S()}],"scroll-py":[{"scroll-py":S()}],"scroll-ps":[{"scroll-ps":S()}],"scroll-pe":[{"scroll-pe":S()}],"scroll-pbs":[{"scroll-pbs":S()}],"scroll-pbe":[{"scroll-pbe":S()}],"scroll-pt":[{"scroll-pt":S()}],"scroll-pr":[{"scroll-pr":S()}],"scroll-pb":[{"scroll-pb":S()}],"scroll-pl":[{"scroll-pl":S()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Ie,De]}],fill:[{fill:["none",...j()]}],"stroke-w":[{stroke:[Je,fi,so,ag]}],stroke:[{stroke:["none",...j()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},P3=f3(M3);function at(...e){return P3(S1(e))}const _=Rl.t,z1=Rl.useTranslation;var L3=$("<div>"),$3=$("<div class=min-w-0>");const F3={"top-left":"left-0 top-0 items-start","top-right":"right-0 top-0 items-end","bottom-left":"bottom-0 left-0 items-start","bottom-right":"bottom-0 right-0 items-end","top-center":"left-0 right-0 top-0 items-center","bottom-center":"bottom-0 left-0 right-0 items-center"},B3={default:"border-border",success:"border-success/40 text-success",info:"border-info/40 text-info",warning:"border-warning/40 text-warning",error:"border-destructive/40 text-destructive",loading:"border-border"};function z3(e){switch(e.type){case"success":return f(h_,{class:"h-4 w-4"});case"info":return f(j_,{class:"h-4 w-4"});case"warning":case"error":return f(H2,{class:"h-4 w-4"});case"loading":return f(sn,{class:"h-4 w-4 animate-spin"});default:return null}}function U3(e){return f(lo,{get toastId(){return e.toastId},get duration(){return e.duration},get persistent(){return e.persistent},get priority(){return e.priority},get class(){return at("pointer-events-auto relative inline-flex w-fit max-w-[calc(100vw-2rem)] items-start gap-3 overflow-hidden rounded-md border bg-background px-4 py-3 text-sm text-foreground shadow-lg outline-none","data-[closed]:animate-out data-[opened]:animate-in data-[closed]:fade-out-0 data-[opened]:fade-in-0 data-[closed]:zoom-out-95 data-[opened]:zoom-in-95","data-[swipe=move]:translate-x-[var(--kb-toast-swipe-move-x)] data-[swipe=move]:translate-y-[var(--kb-toast-swipe-move-y)] data-[swipe=move]:transition-none","data-[swipe=end]:animate-out data-[swipe=end]:fade-out-0 sm:max-w-md")},get children(){return[(()=>{var t=L3();return x(t,f(z3,{get type(){return e.type}})),Me(()=>xt(t,at("shrink-0 self-center",B3[e.type]))),t})(),(()=>{var t=$3();return x(t,f(lo.Title,{class:"font-medium leading-5",get children(){return e.title}}),null),x(t,(()=>{var n=Q(()=>!!e.description);return()=>n()?f(lo.Description,{class:"mt-1 max-w-[22rem] leading-5 text-muted-foreground",get children(){return e.description}}):null})(),null),t})(),f(lo.CloseButton,{class:"ml-2 inline-flex h-5 w-5 shrink-0 self-center items-center justify-center rounded-sm text-muted-foreground opacity-70 transition-[opacity,box-shadow] hover:opacity-100 focus:outline-none focus:ring-[1.5px] focus:ring-ring",get"aria-label"(){return _("common.close")},get children(){return f(Yr,{class:"h-4 w-4"})}})]}})}function No(e,t,n={}){return Li.show(r=>f(U3,{get toastId(){return r.toastId},type:e,title:t,get description(){return n.description},get duration(){return n.duration},get persistent(){return n.persistent},get priority(){return n.priority}}),{region:n.region})}const zt=Object.assign((e,t)=>No("default",e,t),{success:(e,t)=>No("success",e,t),info:(e,t)=>No("info",e,t),warning:(e,t)=>No("warning",e,t),error:(e,t)=>No("error",e,t),loading:(e,t)=>No("loading",e,t),dismiss:e=>{if(typeof e=="number")return Li.dismiss(e);Li.clear()}}),K3=e=>{const[t,n]=me(e,["position","duration","visibleToasts","class"]);return f(lo.Region,G({get duration(){return t.duration??5e3},get limit(){return t.visibleToasts??3},swipeDirection:"right",get class(){return at("!pointer-events-none fixed z-[100] flex max-h-screen w-full flex-col gap-2 p-4 sm:p-6",F3[t.position??"bottom-right"],t.class)}},n,{get children(){return f(lo.List,{class:"flex w-fit max-w-full flex-col gap-2 outline-none"})}}))};async function U1(e){try{if(!navigator.clipboard?.writeText)throw new Error("Clipboard API unavailable");await navigator.clipboard.writeText(_E(e)),zt.success(_("specDetail.specPathCopied"))}catch{zt.error(_("specDetail.specPathCopyFailed"))}}function j3(e,t){return e.some(n=>n.status==="running")||t.some(n=>n.running)}async function lg(e,t){const[n,r]=await Promise.all([t.listCommandRuns(e),t.listSessions(e)]);return!j3(n,r)}function q3(e,t=()=>{}){let n=!1;async function r(o){if(!n){n=!0,t(!0);try{return await o()}finally{n=!1,t(!1)}}}return{async check(o){const i=await r(()=>lg(o,e));return i===void 0?"busy":i?"allowed":"running"},async merge(o,i){return await r(async()=>await lg(o,e)?{status:"merged",value:await i()}:{status:"blocked",reason:"running"})??{status:"blocked",reason:"busy"}}}}const dg=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,fg=S1,K1=(e,t)=>n=>{var r;if(t?.variants==null)return fg(e,n?.class,n?.className);const{variants:o,defaultVariants:i}=t,s=Object.keys(o).map(c=>{const l=n?.[c],d=i?.[c];if(l===null)return null;const g=dg(l)||dg(d);return o[c][g]}),a=n&&Object.entries(n).reduce((c,l)=>{let[d,g]=l;return g===void 0||(c[d]=g),c},{}),u=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((c,l)=>{let{class:d,className:g,...p}=l;return Object.entries(p).every(h=>{let[m,y]=h;return Array.isArray(y)?y.includes({...i,...a}[m]):{...i,...a}[m]===y})?[...c,d,g]:c},[]);return fg(e,s,u,n?.class,n?.className)},H3=K1("inline-flex items-center justify-center rounded-md font-medium transition-[color,background-color,box-shadow] focus-visible:outline-none focus-visible:ring-[1.5px] focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-2 text-sm",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),Ee=e=>{const[t,n]=me(e,["class","variant","size"]);return f(u0,G({get class(){return at(H3({size:t.size,variant:t.variant}),t.class)}},n))};var G3=$("<div>");const V3=K1("inline-flex items-center rounded-md border px-2.5 py-0.5 text-sm font-semibold transition-shadow focus-visible:outline-none focus-visible:ring-[1.5px] focus-visible:ring-ring",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}}),j1=e=>{const[t,n]=me(e,["class","variant"]);return(()=>{var r=G3();return sr(r,G({get class(){return at(V3({variant:t.variant}),t.class)}},n),!1,!1),r})()},is=()=>{const e=()=>Cr()?_("specDetail.exitFullscreen"):_("specDetail.fullscreen");return f(Ee,{variant:"outline",size:"sm",class:"h-6 w-6 shrink-0 p-0",onClick:Vm,get title(){return e()},get"aria-label"(){return e()},get"aria-pressed"(){return Cr()},get children(){return f(q,{get when(){return Cr()},get fallback(){return f(X_,{class:"h-3 w-3"})},get children(){return f(r2,{class:"h-3 w-3"})}})}})};var W3=$("<input>");const zn=e=>{const[t,n]=me(e,["class"]);return(()=>{var r=W3();return sr(r,G({get class(){return at("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 shadow-sm transition-shadow file:border-0 file:bg-transparent file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-[1.5px] focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",t.class)}},n),!1,!1),r})()},gd=yn.Trigger;yn.Group;const gg=yn.Sub;yn.RadioGroup;const pd=e=>{const t=G({gutter:4,flip:!1},e);return f(yn,t)},hd=e=>{const[t,n]=me(e,["class"]);return f(yn.Portal,{get children(){return f(yn.Content,G({get class(){return at("min-w-8rem z-50 overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md transition-shadow focus-visible:outline-none focus-visible:ring-[1.5px] focus-visible:ring-ring data-[expanded]:animate-in data-[closed]:animate-out data-[closed]:fade-out-0 data-[expanded]:fade-in-0 data-[closed]:zoom-out-95 data-[expanded]:zoom-in-95",t.class)}},n))}})},Yn=e=>{const[t,n]=me(e,["class","inset"]);return f(yn.Item,G({get class(){return at("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t.inset&&"pl-8",t.class)}},n))},pg=e=>{const[t,n]=me(e,["class","children"]);return f(yn.SubTrigger,G({get class(){return at("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[expanded]:bg-accent data-[expanded]:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t.class)}},n,{get children(){return[Q(()=>t.children),f(Ml,{class:"ml-auto h-4 w-4 text-muted-foreground"})]}}))},hg=e=>{const[t,n]=me(e,["class"]);return f(yn.Portal,{get children(){return f(yn.SubContent,G({get class(){return at("min-w-8rem z-50 overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md focus-visible:outline-none data-[expanded]:animate-in data-[closed]:animate-out data-[closed]:fade-out-0 data-[expanded]:fade-in-0 data-[closed]:zoom-out-95 data-[expanded]:zoom-in-95",t.class)}},n))}})},pl=e=>{const[t,n]=me(e,["class"]);return f(yn.Separator,G({get class(){return at("-mx-1 my-1 h-px bg-muted",t.class)}},n))};var Y3=$('<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"class="h-4 w-4"><path fill=none stroke=currentColor stroke-linecap=round stroke-linejoin=round stroke-width=2 d="M18 6L6 18M6 6l12 12"></path><title>Close'),q1=$("<div>");const Qt=_r;_r.Trigger;const rr=e=>{const[t,n]=me(e,["class","children"]);return f(_r.Portal,{get children(){return[f(_r.Overlay,{class:"fixed inset-0 z-50 bg-background/80 data-[expanded]:animate-in data-[closed]:animate-out data-[closed]:fade-out-0 data-[expanded]:fade-in-0"}),f(_r.Content,G({get class(){return at("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg data-[closed]:duration-200 data-[expanded]:duration-200 data-[expanded]:animate-in data-[closed]:animate-out data-[closed]:fade-out-0 data-[expanded]:fade-in-0 data-[closed]:zoom-out-95 data-[expanded]:zoom-in-95 data-[closed]:slide-out-to-left-1/2 data-[closed]:slide-out-to-top-[48%] data-[expanded]:slide-in-from-left-1/2 data-[expanded]:slide-in-from-top-[48%] sm:rounded-lg md:w-full",t.class)}},n,{get children(){return[Q(()=>t.children),f(_r.CloseButton,{class:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-[opacity,box-shadow] hover:opacity-100 focus:outline-none focus:ring-[1.5px] focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none",get children(){return Y3()}})]}}))]}})},or=e=>{const[t,n]=me(e,["class"]);return f(_r.Title,G({get class(){return at("text-lg font-semibold text-foreground",t.class)}},n))},qa=e=>{const[t,n]=me(e,["class"]);return f(_r.Description,G({get class(){return at(" text-muted-foreground",t.class)}},n))},ir=e=>{const[t,n]=me(e,["class"]);return(()=>{var r=q1();return sr(r,G({get class(){return at("flex flex-col space-y-2 text-center sm:text-left",t.class)}},n),!1,!1),r})()},Sr=e=>{const[t,n]=me(e,["class"]);return(()=>{var r=q1();return sr(r,G({get class(){return at("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t.class)}},n),!1,!1),r})()};var Z3=$('<p class="m-0 text-destructive">'),X3=$('<form class="grid gap-4"><label class="grid gap-2 text-sm font-medium"for=command-name></label><label class="grid gap-2 text-sm font-medium"for=command-cli>'),J3=$('<div class="flex items-center">'),Q3=$('<div class="px-2 py-1.5 text-sm text-muted-foreground">'),eA=$('<span class="flex min-w-0 flex-col"><span class=truncate></span><span class="truncate font-mono text-[11px] text-muted-foreground">'),tA=$('<button type=button class="shrink-0 rounded p-1 opacity-0 transition-opacity hover:bg-muted group-hover:opacity-100">');const nA=e=>{const t=Wr(),[n,{refetch:r}]=Zt(e.projectId,v=>v?we.listCommands(v):Promise.resolve([])),[o,i]=I(!1),[s,a]=I(""),[u,c]=I(""),[l,d]=I(!1),[g,p]=I(null);async function h(v){const b=e.projectId();if(b)try{const w=await we.runCommand(b,v.id);e.onRunStarted?.(),t(Tt(`commands/${encodeURIComponent(w.runId)}`))}catch(w){zt.error(w.message)}}async function m(v){const b=e.projectId();if(b)try{await we.deleteCommand(b,v.id),await r()}catch(w){zt.error(w.message)}}async function y(v){v.preventDefault();const b=e.projectId();if(!b)return;const w=s().trim(),E=u().trim();if(!(!w||!E)){d(!0),p(null);try{await we.createCommand(b,{name:w,cli:E}),a(""),c(""),i(!1),await r()}catch(C){p(C.message)}finally{d(!1)}}}return(()=>{var v=J3();return x(v,f(pd,{placement:"bottom-start",get children(){return[f(gd,{as:Ee,variant:"ghost",size:"icon",class:"h-8 w-8",get title(){return _("commands.menuTitle")},get children(){return f(z2,{class:"h-4 w-4"})}}),f(hd,{class:"min-w-56",get children(){return[f(q,{get when(){return(n()??[]).length>0},get fallback(){return(()=>{var b=Q3();return x(b,()=>_("commands.empty")),b})()},get children(){return f(ot,{get each(){return n()??[]},children:b=>f(Yn,{class:"group flex items-center justify-between gap-2",onSelect:()=>void h(b),get children(){return[(()=>{var w=eA(),E=w.firstChild,C=E.nextSibling;return x(E,()=>b.name),x(C,()=>b.cli),w})(),(()=>{var w=tA();return w.$$click=E=>{E.stopPropagation(),E.preventDefault(),m(b)},w.$$keydown=E=>E.stopPropagation(),w.$$pointerup=E=>E.stopPropagation(),w.$$pointerdown=E=>E.stopPropagation(),x(w,f(Ll,{class:"h-3.5 w-3.5 text-destructive"})),Me(()=>Ke(w,"title",_("commands.deleteDef"))),w})()]}})})}}),f(pl,{}),f(Yn,{onSelect:()=>i(!0),get children(){return[f(jr,{class:"mr-1 h-4 w-4"}),Q(()=>_("commands.add"))]}})]}})]}}),null),x(v,f(Qt,{get open(){return o()},onOpenChange:b=>{i(b),b||p(null)},get children(){return f(rr,{class:"max-w-md",get children(){return[f(ir,{get children(){return f(or,{get children(){return _("commands.addTitle")}})}}),(()=>{var b=X3(),w=b.firstChild,E=w.nextSibling;return b.addEventListener("submit",C=>void y(C)),x(w,()=>_("commands.name"),null),x(w,f(zn,{id:"command-name",get value(){return s()},get placeholder(){return _("commands.namePlaceholder")},onInput:C=>a(C.currentTarget.value),get disabled(){return l()}}),null),x(E,()=>_("commands.cli"),null),x(E,f(zn,{id:"command-cli",get value(){return u()},get placeholder(){return _("commands.cliPlaceholder")},onInput:C=>c(C.currentTarget.value),get disabled(){return l()}}),null),x(b,f(q,{get when(){return g()},get children(){var C=Z3();return x(C,g),C}}),null),x(b,f(Sr,{get children(){return[f(Ee,{type:"button",variant:"outline",onClick:()=>i(!1),get disabled(){return l()},get children(){return _("common.cancel")}}),f(Ee,{type:"submit",get disabled(){return l()||!s().trim()||!u().trim()},get children(){return Q(()=>!!l())()?_("common.submitting"):_("commands.submit")}})]}}),null),b})()]}})}}),null),v})()};jt(["pointerdown","pointerup","keydown","click"]);var rA=$("<span>");const oA={running:"text-success",exited:"text-muted-foreground",killed:"text-warning",failed:"text-destructive"},H1=e=>(()=>{var t=rA();return x(t,()=>_(`commands.status.${e.status}`)),Me(()=>xt(t,`shrink-0 text-xs font-medium ${oA[e.status]} ${e.class??""}`)),t})();var iA=$('<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"class="h-4 w-4"><path fill=none stroke=currentColor stroke-linecap=round stroke-linejoin=round stroke-width=2 d="M18 6L6 18M6 6l12 12"></path><title>Close');const Yo=zr.Trigger,G1=zr.Title;zr.Description;const Zo=e=>{const t=G({gutter:4,flip:!1},e);return f(zr,t)},Xo=e=>{const[t,n]=me(e,["class","children","hideCloseButton"]);return f(zr.Portal,{get children(){return f(zr.Content,G({get class(){return at("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[expanded]:animate-in data-[closed]:animate-out data-[closed]:fade-out-0 data-[expanded]:fade-in-0 data-[closed]:zoom-out-95 data-[expanded]:zoom-in-95",t.class)}},n,{get children(){return[Q(()=>t.children),f(q,{get when(){return!t.hideCloseButton},get children(){return f(zr.CloseButton,{class:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-[opacity,box-shadow] hover:opacity-100 focus:outline-none focus:ring-[1.5px] focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none",get children(){return iA()}})}})]}}))}})};function V1(e,t,n){const r=Math.max(0,(t??n)-e),o=Math.floor(r/1e3),i=Math.floor(o/3600),s=Math.floor(o%3600/60),a=o%60,u=c=>String(c).padStart(2,"0");return i>0?`${i}:${u(s)}:${u(a)}`:`${s}:${u(a)}`}var sA=$('<section class=mt-3><h2 class="m-0 mb-1.5 text-sm font-medium text-muted-foreground"></h2><ul class="grid list-none gap-2 p-0 [grid-template-columns:repeat(auto-fill,minmax(min(100%,400px),1fr))]">'),aA=$('<span class="truncate font-medium">'),uA=$('<span class="truncate font-mono text-xs text-muted-foreground">'),cA=$('<span class="ml-auto shrink-0 font-mono text-xs text-muted-foreground">'),lA=$('<p class="m-0 text-sm font-medium">'),dA=$('<p class="mb-3 mt-1 text-xs text-muted-foreground">'),fA=$('<div class="flex justify-end">'),gA=$('<li class="flex items-center gap-3 rounded-lg border bg-card px-3 py-2"><div>');const pA=e=>{const[t,{refetch:n,mutate:r}]=Zt(e.projectId,p=>p?we.listCommandRuns(p):Promise.resolve([])),[o,i]=I(Date.now()),[s,a]=I(null),[u,c]=I(null),l=setInterval(()=>i(Date.now()),1e3);ue(()=>clearInterval(l)),ae(()=>{e.revision?.(),n()}),ae(()=>{const p=e.projectId();if(!p)return;const h=mE(p,m=>r(m));ue(h)});async function d(p){const h=e.projectId();if(h){a(p.runId);try{await we.clearCommandRun(h,p.runId),await n()}catch(m){zt.error(m.message)}finally{a(null)}}}async function g(p){const h=e.projectId();if(h){c(p.runId);try{await we.clearCommandRun(h,p.runId),await we.runCommand(h,p.commandId),await n()}catch(m){zt.error(m.message)}finally{c(null)}}}return f(q,{get when(){return(t()??[]).length>0},get children(){var p=sA(),h=p.firstChild,m=h.nextSibling;return x(h,()=>_("commands.running")),x(m,f(ot,{get each(){return t()??[]},children:y=>(()=>{var v=gA(),b=v.firstChild;return x(v,f(Nn,{get href(){return Tt(`commands/${encodeURIComponent(y.runId)}`)},class:"flex min-w-0 flex-1 items-center gap-3",get children(){return[f(H1,{get status(){return y.status}}),(()=>{var w=aA();return x(w,()=>y.name),w})(),(()=>{var w=uA();return x(w,()=>y.cli),w})(),(()=>{var w=cA();return x(w,()=>V1(y.startedAt,y.endedAt,o())),w})()]}}),b),x(b,f(Ee,{variant:"ghost",size:"icon",class:"h-7 w-7 shrink-0",get title(){return _("commands.restart")},get disabled(){return u()===y.runId||s()===y.runId},onClick:()=>void g(y),get children(){return f(C2,{class:"h-4 w-4"})}}),null),x(b,f(Zo,{get children(){return[f(Yo,{as:Ee,variant:"ghost",size:"icon",class:"h-7 w-7 shrink-0",get title(){return _("commands.clear")},get disabled(){return u()===y.runId},get children(){return f(Yr,{class:"h-4 w-4"})}}),f(Xo,{class:"w-72",get children(){return[(()=>{var w=lA();return x(w,()=>_("commands.clearTitle")),w})(),(()=>{var w=dA();return x(w,()=>_("commands.clearDescription")),w})(),(()=>{var w=fA();return x(w,f(Ee,{variant:"destructive",size:"sm",get disabled(){return s()===y.runId},onClick:()=>void d(y),get children(){return Q(()=>s()===y.runId)()?_("common.deleting"):_("commands.clear")}})),w})()]}})]}}),null),v})()})),p}})};var hA=$('<span class=" text-muted-foreground">'),mA=$('<span class=" text-destructive">'),bA=$('<div class="mt-2 flex flex-wrap items-center gap-3"><div class="flex items-center gap-2"><span class=" text-muted-foreground">'),yA=$('<ul class="mt-4 grid list-none gap-3 p-0 [grid-template-columns:repeat(auto-fill,minmax(min(100%,400px),1fr))]">'),vA=$('<div class="py-6 text-center text-sm text-muted-foreground">'),mg=$('<p class=" text-destructive">'),wA=$('<form class="grid gap-4"><label class="grid gap-2 text-sm font-medium"for=merge-commit-message>'),xA=$('<section class="overflow-y-auto p-2"><header class="flex items-center justify-between"><div class="flex items-center gap-2"><h1 class="mr-2 text-xl">'),_A=$('<p class=" text-muted-foreground">'),EA=$('<div class="mt-4 flex flex-col items-center gap-3 rounded-xl border border-dashed bg-card p-12"><p>'),CA=$('<div class="flex items-center justify-between text-sm text-muted-foreground"><time>'),SA=$('<h2 class="my-1.5 text-base font-semibold">'),kA=$('<p class="m-0 mb-3 flex-1 text-muted-foreground">'),AA=$('<code class="mt-auto block break-all font-mono text-sm text-muted-foreground">'),TA=$('<li class="group relative flex rounded-xl border bg-card shadow transition-transform hover:-translate-y-px"><div class="absolute right-1.5 top-1.5 z-[2] opacity-0 transition-opacity group-hover:opacity-100">'),bg=$("<span>."),DA=$("<span>");const mu=40,IA=()=>{const e=Wr(),t=yo(),[n,{refetch:r}]=Zt(t,z=>z?we.listSpecs(z):Promise.resolve([])),[o,{refetch:i}]=Zt(()=>we.listProjects()),s=ne(()=>(o()??[]).find(z=>z.id===t())),a=ne(()=>{const z=s();return z?.worktree?(o()??[]).some(J=>J.id===z.worktree.mainProjectId):!0}),u=ne(()=>{const z=s();return z?.worktree?`feat(${z.worktree.branch}): merge from worktree`:""}),[c,l]=I(!1),[d,g]=I(!1),[p,h]=I(null),[m,y]=I(!1),[v,b]=I(""),[w,E]=I(null),[C,k]=I(0),[T,S]=I(!1),[A,F]=I(null),O=q3(we,g);Wi(()=>m()||w()!==null);const[P,L]=I(mu),D=ne(()=>(n()??[]).slice(0,P())),B=ne(()=>P()<(n()??[]).length),[N,Y]=I(null);ae(()=>{t(),L(mu)}),Sn(()=>{const z=new IntersectionObserver(J=>{if(!J.some(ve=>ve.isIntersecting))return;const re=(n()??[]).length;L(ve=>ve>=re?ve:Math.min(ve+mu,re))},{rootMargin:"300px"});ae(()=>{const J=N();P(),J&&(z.observe(J),ue(()=>z.unobserve(J)))}),ue(()=>z.disconnect())});let ce=null;ae(()=>{const z=t();ce?.(),ce=null,z&&(ce=Ym(z,()=>{r()}))}),Sn(()=>{const z=Zm(()=>{(async()=>{const J=s()?.worktree?.mainProjectId??null;await i();const re=t();!re||(o()??[]).some(Z=>Z.id===re)||J&&e(`/${encodeURIComponent(J)}`)})()});ue(z)}),ue(()=>{ce?.(),ce=null});async function V(){const z=t();if(!z)return!1;h(null);try{const J=await O.check(z);return J==="running"?(h(_("home.runningTasksPreventMerge")),!1):J==="allowed"}catch(J){return h(J.message),!1}}async function j(){s()?.worktree&&a()&&await V()&&(b(u()),h(null),y(!0))}async function he(){const z=s();if(!z?.worktree||!a())return;const J=v().trim()||u();h(null);try{const re=await O.merge(z.id,async()=>{l(!0);try{return await we.mergeWorktreeToMain(z.id,{commitMessage:J})}finally{l(!1)}});if(re.status==="blocked"){re.reason==="running"&&h(_("home.runningTasksPreventMerge"));return}const ve=re.value;y(!1),ve.status==="merged"?(zt.success(_("home.merged")),await i(),e(`/${encodeURIComponent(ve.mainProjectId)}`)):(zt.info(_("home.conflictDispatched")),await i(),e(`/${encodeURIComponent(ve.mainProjectId)}/specs/${encodeURIComponent(ve.conflictSpecId)}`))}catch(re){h(re.message)}}async function K(z){const J=t();if(J){S(!0),F(null);try{await we.deleteSpec(J,z),E(null),await r()}catch(re){F(re.message)}finally{S(!1)}}}return(()=>{var z=xA(),J=z.firstChild,re=J.firstChild,ve=re.firstChild;return x(ve,()=>_("home.specList")),x(re,f(nA,{projectId:t,onRunStarted:()=>k(Z=>Z+1)}),null),x(re,f(Ee,{as:Nn,get href(){return Tt("git")},variant:"ghost",size:"icon",class:"h-8 w-8",get title(){return _("git.title")},get children(){return f(Pl,{class:"h-4 w-4"})}}),null),x(J,f(is,{}),null),x(z,f(pA,{projectId:t,revision:C}),null),x(z,f(q,{get when(){return s()?.worktree},get children(){var Z=bA(),M=Z.firstChild,W=M.firstChild;return x(W,()=>_("home.mainProject"),null),x(W,()=>s().worktree.mainPath.split("/").filter(Boolean).pop()??s().worktree.mainPath,null),x(Z,f(Ee,{variant:"default",size:"sm",onClick:()=>void j(),get disabled(){return c()||d()||!a()},get title(){return Q(()=>!!a())()?_("home.mergeHint"):_("home.mainUnreachable")},get children(){return[f(Um,{class:"mr-1 h-3.5 w-3.5"}),Q(()=>Q(()=>!!c())()?_("home.merging"):_("home.mergeToMain"))]}}),null),x(Z,f(q,{get when(){return!a()},get children(){var oe=hA();return x(oe,()=>_("home.mainUnreachable")),oe}}),null),x(Z,f(q,{get when(){return p()},get children(){var oe=mA();return x(oe,p),oe}}),null),Z}}),null),x(z,f(va,{get fallback(){return(()=>{var Z=_A();return x(Z,()=>_("common.loading")),Z})()},get children(){return f(q,{get when(){return(n()??[]).length>0},get fallback(){return(()=>{var Z=EA(),M=Z.firstChild;return x(M,()=>_("home.noSpecs")),x(Z,f(Ee,{as:Nn,get href(){return Tt("specs/new")},variant:"default",size:"sm",get children(){return[f(jr,{class:"mr-1 h-4 w-4"}),Q(()=>_("home.createFirst"))]}}),null),Z})()},get children(){return[(()=>{var Z=yA();return x(Z,f(ot,{get each(){return D()},children:M=>{const W=Jm(M.id);return(()=>{var oe=TA(),te=oe.firstChild;return x(oe,f(Nn,{get href(){return Tt(`specs/${encodeURIComponent(M.id)}`)},class:"flex min-h-40 flex-1 flex-col p-4",get children(){return[(()=>{var H=CA(),de=H.firstChild;return x(H,f(j1,{variant:"outline",get class(){return`font-mono ${vE[M.stage]??"bg-muted text-muted-foreground border-border"} uppercase tracking-wider`},get children(){return M.stage}}),de),x(de,()=>Xm(M.updated_at)),H})(),(()=>{var H=SA();return x(H,()=>M.title||_("common.pendingAgent")),H})(),(()=>{var H=kA();return x(H,()=>M.summary||_("common.pendingAgent")),H})(),(()=>{var H=AA();return x(H,f(q,{when:W,get fallback(){return M.id},children:de=>[(()=>{var fe=bg(),Ue=fe.firstChild;return x(fe,()=>de().prefix,Ue),fe})(),(()=>{var fe=DA();return x(fe,()=>de().type),Me(()=>xt(fe,`font-semibold ${wE[de().type]??"text-foreground"}`)),fe})(),(()=>{var fe=bg();return fe.firstChild,x(fe,()=>de().suffix,null),fe})()]})),H})()]}}),te),x(te,f(pd,{placement:"bottom-end",get children(){return[f(gd,{as:Ee,variant:"ghost",size:"icon",class:"h-7 w-7",get title(){return _("home.moreActions")},get children(){return f(A_,{class:"h-4 w-4"})}}),f(hd,{get children(){return[f(Yn,{onSelect:()=>void U1(M.id),get children(){return _("home.copySpecPath")}}),f(Yn,{class:"text-destructive focus:text-destructive",onSelect:()=>E(M.id),get children(){return _("common.delete")}})]}})]}})),oe})()}})),Z})(),f(q,{get when(){return B()},get children(){var Z=vA();return Ln(M=>Y(M),Z),x(Z,()=>_("common.loading")),Z}})]}})}}),null),x(z,f(Qt,{get open(){return m()},onOpenChange:Z=>{y(Z),Z||h(null)},get children(){return f(rr,{class:"max-w-md",get children(){return[f(ir,{get children(){return[f(or,{get children(){return _("home.mergeDialogTitle")}}),f(qa,{get children(){return _("home.mergeDialogDescription")}})]}}),(()=>{var Z=wA(),M=Z.firstChild;return Z.addEventListener("submit",W=>{W.preventDefault(),he()}),x(M,()=>_("home.mergeCommitMessage"),null),x(M,f(zn,{id:"merge-commit-message",get value(){return v()},onInput:W=>b(W.currentTarget.value),get disabled(){return c()}}),null),x(Z,f(q,{get when(){return p()},get children(){var W=mg();return x(W,p),W}}),null),x(Z,f(Sr,{get children(){return[f(Ee,{type:"button",variant:"outline",onClick:()=>y(!1),get disabled(){return c()},get children(){return _("common.cancel")}}),f(Ee,{type:"submit",get disabled(){return c()||d()||!a()},get children(){return Q(()=>!!c())()?_("home.merging"):_("home.mergeToMain")}})]}}),null),Z})()]}})}}),null),x(z,f(Qt,{get open(){return w()!==null},onOpenChange:Z=>{Z||(E(null),F(null))},get children(){return f(rr,{class:"max-w-sm",get children(){return[f(ir,{get children(){return f(or,{get children(){return _("home.confirmDeleteSpec")}})}}),f(q,{get when(){return A()},get children(){var Z=mg();return x(Z,A),Z}}),f(Sr,{get children(){return[f(Ee,{variant:"outline",onClick:()=>E(null),get disabled(){return T()},get children(){return _("common.cancel")}}),f(Ee,{variant:"destructive",onClick:()=>w()&&void K(w()),get disabled(){return T()},get children(){return Q(()=>!!T())()?_("common.deleting"):_("common.confirmDelete")}})]}})]}})}}),null),z})()},W1="",RA=10*1024*1024,qo=10;function OA(e){const t=e.type;return t.startsWith("image/")?"image":t==="application/pdf"?"pdf":t==="text/plain"||t==="text/markdown"||t===""&&/\.(md|markdown|txt)$/i.test(e.name)?"text":"file"}function NA(e){return e.type?e:/\.md$/i.test(e.name)||/\.markdown$/i.test(e.name)?new File([e],e.name,{type:"text/markdown"}):/\.txt$/i.test(e.name)?new File([e],e.name,{type:"text/plain"}):e}function yg(e){const t=e.lastIndexOf(".");return t<=0?e:e.slice(0,t)}function MA(){return Math.random().toString(36).slice(2,8)}function Y1(e){const t=e.labels,[n,r]=I([]),[o,i]=I(null),[s,a]=I(null),[u,c]=I(null),[l,d]=I(""),g=ne(()=>n().length),p=ne(()=>n().some(O=>O.status==="pending")),h=ne(()=>n().some(O=>O.status==="failed"));ue(()=>{for(const O of n())O.previewUrl&&URL.revokeObjectURL(O.previewUrl)});async function m(){const O=o();if(O)return O;const{draftId:P}=await we.createDraft(e.projectId());return i(P),P}function y(O){r(P=>[...P,O])}function v(O,P){r(L=>L.map(D=>D.id===O?{...D,...P}:D))}function b(O){r(P=>{const L=[];for(const D of P){if(D.id===O){D.previewUrl&&URL.revokeObjectURL(D.previewUrl);continue}L.push(D)}return L})}async function w(O){a(null);const P=n(),L=qo-P.length;if(L<=0){a(t.attachmentLimit(qo));return}const D=[];for(const B of O.slice(0,L)){const N=NA(B),Y=OA(N);if(N.size>RA){a(t.fileTooLarge(N.name));continue}const ce=`att-${Date.now()}-${MA()}`,V=Y==="image"?URL.createObjectURL(N):void 0;D.push({id:ce,file:N,name:N.name,kind:Y,previewUrl:V,status:"pending"})}if(D.length!==0){O.length>L&&a(t.attachmentRoomLimit(L,P.length,qo));for(const B of D)y(B);try{const B=await m();for(const N of D)try{const Y=await we.uploadAttachment(e.projectId(),B,N.file);v(N.id,{storedName:Y.storedName,name:Y.storedName,status:"uploaded"})}catch(Y){v(N.id,{status:"failed",error:Y.message})}}catch(B){a(B.message);for(const N of D)v(N.id,{status:"failed",error:B.message})}}}async function E(O){const P=O.currentTarget;if(!P.files)return;const L=Array.from(P.files);P.value="",await w(L)}async function C(O){const P=O.clipboardData?.items;if(!P)return;const L=[];for(const D of Array.from(P))if(D.kind==="file"&&D.type.startsWith("image/")){const B=D.getAsFile();B&&L.push(B)}L.length!==0&&(O.preventDefault(),await w(L))}async function k(O){const P=n().find(L=>L.id===O);if(P){if(P.storedName&&o())try{await we.deleteAttachment(e.projectId(),o(),P.storedName)}catch(L){a(L.message)}b(O)}}function T(O){d(yg(O.name)),c(O.id)}async function S(O){const P=l().trim();if(c(null),!(!P||!O.storedName||!o())&&P!==yg(O.name))try{const L=await we.renameAttachment(e.projectId(),o(),O.storedName,P);v(O.id,{storedName:L.storedName,name:L.storedName})}catch(L){a(L.message)}}function A(){c(null)}function F(){const O=pt(n);for(const P of O)P.previewUrl&&URL.revokeObjectURL(P.previewUrl);O.length>0&&r([]),i(null),c(null),d(""),a(null)}return{attachments:n,draftId:o,error:s,setError:a,count:g,hasPending:p,hasFailed:h,renamingId:u,renameDraft:l,setRenameDraft:d,addFiles:w,onFileInputChange:E,onPaste:C,removeAttachment:k,beginRename:T,commitRename:S,cancelRename:A,reset:F}}const Z1={attachmentLimit:e=>_("newSpec.attachmentLimit",{max:e}),unsupportedType:e=>_("newSpec.unsupportedType",{name:e}),unsupportedMime:e=>_("newSpec.unsupportedMime",{mime:e}),fileTooLarge:e=>_("newSpec.fileTooLarge",{name:e}),attachmentRoomLimit:(e,t,n)=>_("newSpec.attachmentRoomLimit",{room:e,current:t,max:n})},PA=150,LA=16,$A=48,FA=24,BA=8;function bu(e){return e.replace(/^\/+/,"")}function zA(e,t){return t===0?!0:/[\s/_.-]/.test(e[t-1]??"")}function vg(e,t){if(!e)return 0;const n=e.toLowerCase(),r=t.toLowerCase();let o=0,i=-1;for(let s=0;s<n.length;s++){const a=r.indexOf(n[s],i+1);if(a===-1)return null;o+=LA,a===s&&(o+=$A),a===i+1&&(o+=FA),zA(t,a)&&(o+=BA),o-=Math.max(0,a-i-1),i=a}return o-t.length*.01}function UA(e,t){const n=bu(e.trim());if(!n)return 0;const r=vg(n,bu(t.value)),o=t.label?vg(n,bu(t.label)):null;return r==null?o:o==null?r:Math.max(r,o)}function KA(e,t){return t?e.map((n,r)=>{const o=UA(t,n);return o==null?null:{cmd:n,score:o,index:r}}).filter(n=>n!=null).sort((n,r)=>r.score-n.score||n.index-r.index).map(n=>n.cmd):e}function jA(e,t,n){const r=e.slice(0,t);if(n&&/^\/[\w-]*$/.test(r))return{kind:"slash",query:r.slice(1)};const o=r.lastIndexOf("@");if(o===-1)return null;const i=r.slice(o+1);return/^[\w./@-]*$/.test(i)?{kind:"mention",start:o,query:i}:null}function wg(e,t,n){const r=t.kind==="slash"?0:t.start,o=e.slice(0,r),i=e.slice(r+1+t.query.length);return{next:o+n+i,cursorPos:o.length+n.length}}function qA(e){return e.kind==="mention"?`@${e.value}`:e.replacement??`${e.value} `}function HA(e){const[t,n]=I(!1),[r,o]=I([]),[i,s]=I(0),[a,u]=I(!1);let c=null,l=null;ue(()=>{l&&clearTimeout(l)});function d(){n(!1),u(!1),o([]),s(0),c=null,l&&(clearTimeout(l),l=null)}function g(b){l&&clearTimeout(l),l=setTimeout(async()=>{const w=e.projectId();if(w)try{const E=await we.listFiles(w,b);if(c?.kind!=="mention"||c.query!==b)return;o(E.items.map(C=>({kind:"mention",value:C}))),s(0)}catch{o([])}},e.searchDebounceMs??PA)}function p(b){const w=e.slashCommands?.()??[],E=KA(w,b).map(C=>({kind:"slash",value:C.value,label:C.label??C.value,description:C.description,replacement:C.replacement,action:C.action,customId:C.customId,editable:C.editable,editLabel:C.editLabel,deletable:C.deletable,deleteLabel:C.deleteLabel,icon:C.icon,command:C}));o(E),s(0),E.length>0?(u(!1),n(!0)):e.slashEmptyEnabled?.()?(u(!0),n(!0)):d()}function h(b){const w=(e.slashCommands?.()??[]).length>0,E=jA(b.value,b.selectionStart,w);if(!E){d();return}if(c=E,E.kind==="slash"){p(E.query);return}u(!1),t()||n(!0),g(E.query)}function m(b){const w=c;if(!w)return{kind:"noop"};if(b.kind==="slash"&&b.action==="add"){const{next:k}=wg(e.value(),w,"");return e.onValueChange(k),d(),{kind:"action",command:b.command}}const{next:E,cursorPos:C}=wg(e.value(),w,qA(b));return e.onValueChange(E),d(),{kind:"text",cursorPos:C}}function y(b){const w=r();w.length!==0&&s(E=>(E+b+w.length)%w.length)}function v(b){if(!b)return;const w=r().filter(E=>E.kind!=="slash"||E.customId!==b);o(w),s(E=>Math.min(E,Math.max(0,w.length-1))),w.length===0&&d()}return{open:t,items:r,index:i,setIndex:s,slashEmpty:a,handleInput:h,select:m,close:d,moveIndex:y,removeSlashItem:v}}var GA=$("<textarea>");const hl=e=>{const[t,n]=me(e,["class"]);return(()=>{var r=GA();return sr(r,G({get class(){return at("flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 shadow-sm transition-shadow placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-[1.5px] focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",t.class)}},n),!1,!1),r})()},xg=1.5,X1=2,VA=10;function WA(e,t=X1,n=VA){if(!e)return;const r=getComputedStyle(e),o=parseFloat(r.fontSize)||14,i=r.lineHeight==="normal"?o*xg:parseFloat(r.lineHeight)||o*xg,s=parseFloat(r.paddingTop)+parseFloat(r.paddingBottom)+parseFloat(r.borderTopWidth)+parseFloat(r.borderBottomWidth),a=i*t+s,u=i*n+s;e.style.height="auto",e.style.height=`${Math.min(Math.max(e.scrollHeight,a),u)}px`,e.style.overflowY=e.scrollHeight>u?"auto":"hidden"}const ua=e=>{const[t,n]=me(e,["minRows","maxRows","class","ref","onInput"]);let r;const o=()=>WA(r,t.minRows,t.maxRows),i=a=>{r=a;const u=t.ref;typeof u=="function"&&u(a)},s=a=>{const u=t.onInput;typeof u=="function"?u(a):Array.isArray(u)&&u[0](u[1],a),o()};return Sn(()=>{o(),requestAnimationFrame(o)}),ae(_t(()=>e.value,o)),f(hl,G({ref:i,get class(){return at("min-h-0 resize-none",t.class)},get rows(){return t.minRows??X1},onInput:s},n))};var YA=$('<li class="px-3 py-1.5 text-sm text-muted-foreground">'),ZA=$('<ul class="absolute bottom-full left-0 right-0 z-[100] m-0 max-h-60 list-none overflow-y-auto rounded-lg border bg-card py-1 shadow-lg">'),XA=$('<div class="relative w-full">'),JA=$("<span>"),QA=$('<div class="mr-1 flex shrink-0 items-center gap-0.5">'),eT=$('<li><button type=button class="flex min-w-0 flex-1 items-center gap-2 overflow-hidden border-0 bg-transparent px-3 py-1.5 text-left text-sm text-inherit"><span class="min-w-0 flex-1"><span class="block overflow-hidden text-ellipsis whitespace-nowrap">');const tT=150,Ha=e=>{let t,n=[],r=null;ue(()=>{r&&clearTimeout(r)});const o=HA({projectId:()=>e.projectId,value:()=>e.value,onValueChange:l=>e.onValueChange(l),slashCommands:()=>e.slashCommands??[],slashEmptyEnabled:()=>!!e.slashEmptyLabel});function i(l){n=[];const d=o.select(l);if(d.kind!=="noop"){if(d.kind==="action"){e.onSlashCommandAction?.(d.command),requestAnimationFrame(()=>t?.focus());return}requestAnimationFrame(()=>{t&&(t.focus(),t.setSelectionRange(d.cursorPos,d.cursorPos))})}}function s(l){l.kind==="slash"&&(e.onDeleteSlashCommand?.(l.command),l.customId&&o.removeSlashItem(l.customId))}function a(l){l.kind==="slash"&&(e.onEditSlashCommand?.(l.command),o.close(),requestAnimationFrame(()=>t?.focus()))}function u(){n[o.index()]?.scrollIntoView({block:"nearest"})}function c(l){const d=o.items();if(o.open()&&d.length>0){if(l.key==="ArrowDown"){l.preventDefault(),o.moveIndex(1),requestAnimationFrame(u);return}if(l.key==="ArrowUp"){l.preventDefault(),o.moveIndex(-1),requestAnimationFrame(u);return}if(l.key==="Enter"||l.key==="Tab"){if(!l.isComposing){l.preventDefault(),i(d[o.index()]);return}}else if(l.key==="Escape"){l.preventDefault(),o.close();return}}e.onKeyDown?.(l)}return(()=>{var l=XA();return x(l,f(ua,{ref(d){var g=t;typeof g=="function"?g(d):t=d},get minRows(){return e.minRows},get maxRows(){return e.maxRows},get value(){return e.value},get placeholder(){return e.placeholder},get disabled(){return e.disabled},get required(){return e.required},get autofocus(){return e.autofocus},get class(){return e.class},onInput:d=>{e.onValueChange(d.currentTarget.value),n=[],o.handleInput(d.currentTarget)},onKeyDown:c,onPaste:d=>e.onPaste?.(d),onBlur:()=>{r&&clearTimeout(r),r=setTimeout(o.close,tT)}}),null),x(l,f(q,{get when(){return Q(()=>!!o.open())()&&(o.items().length>0||o.slashEmpty())},get children(){var d=ZA();return x(d,f(q,{get when(){return o.slashEmpty()},get children(){var g=YA();return x(g,()=>e.slashEmptyLabel),g}}),null),x(d,f(ot,{get each(){return o.items()},children:(g,p)=>(()=>{var h=eT(),m=h.firstChild,y=m.firstChild,v=y.firstChild;return h.addEventListener("mouseenter",()=>o.setIndex(p())),Ln(b=>n[p()]=b,h),m.$$mousedown=b=>{b.preventDefault(),i(g)},x(m,f(q,{get when(){return Q(()=>g.kind==="slash")()&&g.icon==="plus"},get children(){return f(jr,{class:"h-3.5 w-3.5 shrink-0"})}}),y),x(v,(()=>{var b=Q(()=>g.kind==="slash");return()=>b()?g.label:g.value})()),x(y,f(q,{get when(){return Q(()=>g.kind==="slash")()&&g.description},get children(){var b=JA();return x(b,(()=>{var w=Q(()=>g.kind==="slash");return()=>w()?g.description:""})()),Me(()=>xt(b,at("block overflow-hidden text-ellipsis whitespace-nowrap text-xs",o.index()===p()?"text-primary-foreground/80":"text-muted-foreground"))),b}}),null),x(h,f(q,{get when(){return Q(()=>g.kind==="slash")()&&(g.editable||g.deletable)},get children(){var b=QA();return x(b,f(q,{get when(){return Q(()=>g.kind==="slash")()&&g.editable},get children(){return f(Ee,{type:"button",variant:"ghost",size:"sm",tabIndex:-1,get title(){return Q(()=>g.kind==="slash")()?g.editLabel:void 0},get class(){return at("h-7 w-7 p-0",o.index()===p()?"text-primary-foreground hover:bg-primary-foreground/20 hover:text-primary-foreground":"text-muted-foreground hover:bg-accent hover:text-accent-foreground")},onMouseDown:w=>{w.preventDefault(),w.stopPropagation(),a(g)},get children(){return f(jm,{class:"h-3.5 w-3.5"})}})}}),null),x(b,f(q,{get when(){return Q(()=>g.kind==="slash")()&&g.deletable},get children(){return f(Ee,{type:"button",variant:"ghost",size:"sm",tabIndex:-1,get title(){return Q(()=>g.kind==="slash")()?g.deleteLabel:void 0},get class(){return at("h-7 w-7 p-0",o.index()===p()?"text-primary-foreground hover:bg-primary-foreground/20 hover:text-primary-foreground":"text-destructive hover:bg-destructive/10 hover:text-destructive")},onMouseDown:w=>{w.preventDefault(),w.stopPropagation(),s(g)},get children(){return f(Ll,{class:"h-3.5 w-3.5"})}})}}),null),b}}),null),Me(b=>{var w=at("flex items-center",o.index()===p()?"bg-primary text-primary-foreground":"text-foreground hover:bg-accent hover:text-accent-foreground"),E=g.kind==="slash"&&g.description?g.description:g.value;return w!==b.e&&xt(h,b.e=w),E!==b.t&&Ke(m,"title",b.t=E),b},{e:void 0,t:void 0}),h})()}),null),d}}),null),l})()};jt(["mousedown"]);const md=Fi.Trigger,bd=e=>{const t=G({gutter:4,flip:!1},e);return f(Fi,t)},yd=e=>{const[t,n]=me(e,["class"]);return f(Fi.Portal,{get children(){return f(Fi.Content,G({get class(){return at("z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-sm text-primary-foreground data-[expanded]:animate-in data-[closed]:animate-out data-[closed]:fade-out-0 data-[expanded]:fade-in-0 data-[closed]:zoom-out-95 data-[expanded]:zoom-in-95",t.class)}},n))}})};var nT=$('<img class="max-h-[80vh] max-w-[80vw] rounded-lg object-contain shadow-lg">');const rT=e=>f(Qt,{get open(){return e.open},get onOpenChange(){return e.onOpenChange},get children(){return f(Qt.Portal,{get children(){return[f(Qt.Overlay,{class:"fixed inset-0 z-50 bg-background/80 data-[expanded]:animate-in data-[closed]:animate-out data-[closed]:fade-out-0 data-[expanded]:fade-in-0"}),f(Qt.Content,{class:"fixed left-1/2 top-1/2 z-50 -translate-x-1/2 -translate-y-1/2 outline-none data-[expanded]:animate-in data-[closed]:animate-out data-[closed]:fade-out-0 data-[expanded]:fade-in-0 data-[closed]:zoom-out-95 data-[expanded]:zoom-in-95",get children(){return[f(q,{get when(){return e.src},get children(){var t=nT();return Me(n=>{var r=e.src,o=e.alt;return r!==n.e&&Ke(t,"src",n.e=r),o!==n.t&&Ke(t,"alt",n.t=o),n},{e:void 0,t:void 0}),t}}),f(Qt.CloseButton,{class:"absolute right-2 top-2 flex h-7 w-7 items-center justify-center rounded-full bg-background/80 text-foreground shadow ring-offset-background transition hover:bg-background focus:outline-none focus:ring-[1.5px] focus:ring-ring focus:ring-offset-2","aria-label":"Close",get children(){return f(Yr,{class:"h-4 w-4"})}})]}})]}})}});var oT=$('<ul class="m-0 flex list-none flex-wrap gap-2 p-0">'),J1=$('<img class="h-full w-full object-cover">'),iT=$('<div class="absolute inset-0 flex items-center justify-center bg-background/50">'),sT=$('<li class="group relative shrink-0"><button type=button class="absolute right-0 top-0 z-10 flex h-4 w-4 items-center justify-center rounded-bl bg-background/80 text-muted-foreground opacity-0 transition-opacity hover:text-destructive group-hover:opacity-100 disabled:opacity-0">'),aT=$('<span class="text-xs font-bold text-muted-foreground">'),uT=$('<ul class="m-0 grid list-none gap-2 [grid-template-columns:repeat(auto-fill,minmax(180px,1fr))]">'),cT=$('<li><div class="flex h-14 w-14 items-center justify-center overflow-hidden rounded-md bg-card"></div><div class="flex min-w-0 flex-col"><span class="text-sm text-muted-foreground">'),lT=$('<span class="rounded border border-border bg-background px-1 py-0.5 text-sm font-bold text-muted-foreground">'),dT=$('<button type=button class="cursor-pointer overflow-hidden whitespace-nowrap border-0 bg-transparent p-0 text-left text-ellipsis hover:underline disabled:cursor-default disabled:no-underline">');function Q1(e){return e==="pdf"?"PDF":e==="text"?"TXT":"FILE"}function fT(e){return e.status==="pending"?`${e.name} · ${_("newSpec.uploading")}`:e.status==="failed"?`${e.name} · ${_("newSpec.uploadFailed",{error:e.error})}`:`${e.name} · ${Math.round(e.file.size/1024)} KB · ${e.kind}`}const ey=e=>{const t=e.ctrl,[n,r]=I(),[o,i]=I(),[s,a]=I(!1);function u(c){c.kind!=="image"||!c.previewUrl||(r(c.previewUrl),i(c.name),a(!0))}return f(q,{get when(){return e.compact},get fallback(){return f(gT,e)},get children(){return[(()=>{var c=oT();return x(c,f(ot,{get each(){return t.attachments()},children:l=>(()=>{var d=sT(),g=d.firstChild;return x(d,f(bd,{openDelay:150,closeDelay:0,get children(){return[f(md,{type:"button",get class(){return`flex h-14 w-14 items-center justify-center overflow-hidden rounded-md border bg-card ${l.status==="pending"?"opacity-75":""} ${l.status==="failed"?"border-destructive":""} ${l.kind==="image"&&l.previewUrl?"cursor-zoom-in":"cursor-default"}`},onClick:()=>u(l),get children(){return[f(q,{get when(){return Q(()=>l.kind==="image")()&&l.previewUrl},get fallback(){return(()=>{var p=aT();return x(p,()=>Q1(l.kind)),p})()},get children(){var p=J1();return Me(h=>{var m=l.previewUrl,y=l.name;return m!==h.e&&Ke(p,"src",h.e=m),y!==h.t&&Ke(p,"alt",h.t=y),h},{e:void 0,t:void 0}),p}}),f(q,{get when(){return l.status==="pending"},get children(){var p=iT();return x(p,f(sn,{class:"h-4 w-4 animate-spin text-muted-foreground"})),p}})]}}),f(yd,{get children(){return fT(l)}})]}}),g),g.$$click=()=>void t.removeAttachment(l.id),x(g,f(Yr,{class:"h-3 w-3"})),Me(p=>{var h=e.busy,m=_("newSpec.deleteAttachment",{name:l.name});return h!==p.e&&(g.disabled=p.e=h),m!==p.t&&Ke(g,"aria-label",p.t=m),p},{e:void 0,t:void 0}),d})()})),c})(),f(rT,{get src(){return n()},get alt(){return o()},get open(){return s()},onOpenChange:a})]}})},gT=e=>{const t=e.ctrl;return(()=>{var n=uT();return x(n,f(ot,{get each(){return t.attachments()},children:r=>(()=>{var o=cT(),i=o.firstChild,s=i.nextSibling,a=s.firstChild;return x(i,f(q,{get when(){return Q(()=>r.kind==="image")()&&r.previewUrl},get fallback(){return(()=>{var u=lT();return x(u,()=>Q1(r.kind)),u})()},get children(){var u=J1();return Me(c=>{var l=r.previewUrl,d=r.name;return l!==c.e&&Ke(u,"src",c.e=l),d!==c.t&&Ke(u,"alt",c.t=d),c},{e:void 0,t:void 0}),u}})),x(s,f(q,{get when(){return Q(()=>!!e.allowRename)()&&t.renamingId()===r.id},get fallback(){return(()=>{var u=dT();return u.$$click=()=>e.allowRename&&t.beginRename(r),x(u,()=>r.name),Me(c=>{var l=e.busy||!e.allowRename||r.status!=="uploaded",d=e.allowRename?_("newSpec.clickToRename"):r.name;return l!==c.e&&(u.disabled=c.e=l),d!==c.t&&Ke(u,"title",c.t=d),c},{e:void 0,t:void 0}),u})()},get children(){return f(zn,{type:"text",get value(){return t.renameDraft()},autofocus:!0,onInput:u=>t.setRenameDraft(u.currentTarget.value),onBlur:()=>void t.commitRename(r),onKeyDown:u=>{u.key==="Enter"?(u.preventDefault(),t.commitRename(r)):u.key==="Escape"&&t.cancelRename()},class:"h-7 py-0.5 text-sm"})}}),a),x(a,f(q,{get when(){return r.status==="pending"},get children(){return[f(sn,{class:"mr-0.5 inline h-3 w-3 animate-spin"}),Q(()=>_("newSpec.uploading"))]}}),null),x(a,f(q,{get when(){return r.status==="failed"},get children(){return _("newSpec.uploadFailed",{error:r.error})}}),null),x(a,f(q,{get when(){return r.status==="uploaded"},get children(){return[Q(()=>Math.round(r.file.size/1024))," KB · ",Q(()=>r.kind)]}}),null),x(o,f(Ee,{variant:"ghost",size:"icon",type:"button",class:"h-7 w-7",onClick:()=>void t.removeAttachment(r.id),get disabled(){return e.busy},get"aria-label"(){return _("newSpec.deleteAttachment",{name:r.name})},get children(){return f(Yr,{class:"h-3.5 w-3.5"})}}),null),Me(()=>xt(o,`grid items-center gap-2 rounded-lg border bg-background p-2 [grid-template-columns:56px_1fr_auto] ${r.status==="pending"?"opacity-75":""} ${r.status==="failed"?"border-destructive":""}`)),o})()})),n})()};jt(["click"]);var pT=$('<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"class="h-4 w-4"><path fill=none stroke=currentColor stroke-linecap=round stroke-linejoin=round stroke-width=2 d="m5 12l5 5L20 7"></path><title>Checkbox');const zi=Ur.Label,Jo=Ur;Ur.ErrorMessage;Ur.Description;const Qo=e=>{const[t,n]=me(e,["class","children"]);return[f(Ur.Input,{class:"[&:focus-visible+div]:outline-none [&:focus-visible+div]:ring-[1.5px] [&:focus-visible+div]:ring-ring [&:focus-visible+div]:ring-offset-2 [&:focus-visible+div]:ring-offset-background"}),f(Ur.Control,G({get class(){return at("h-4 w-4 shrink-0 rounded-sm border border-input shadow transition-shadow focus-visible:outline-none focus-visible:ring-[1.5px] focus-visible:ring-ring data-[disabled]:cursor-not-allowed data-[checked]:border-primary data-[checked]:bg-primary data-[checked]:text-primary-foreground data-[disabled]:opacity-50",t.class)}},n,{get children(){return f(Ur.Indicator,{class:"flex items-center justify-center text-current",get children(){return pT()}})}}))]};Bn.Description;Bn.ErrorMessage;Bn.ItemDescription;const gn=Bn.ItemInput,pn=Bn.ItemLabel,vd=Bn.Label,Xn=Bn,hn=Bn.Item,_n=e=>{const[t,n]=me(e,["class"]);return f(Bn.ItemControl,G({get class(){return at("flex aspect-square h-4 w-4 items-center justify-center rounded-full border border-input bg-background shadow-sm transition-[border-color,background-color,box-shadow] focus:outline-none focus-visible:ring-[1.5px] focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 data-[checked]:border-primary data-[checked]:bg-primary data-[checked]:shadow data-[checked]:ring-2 data-[checked]:ring-primary/20",t.class)}},n,{get children(){return f(Bn.ItemIndicator,{class:"h-2 w-2 rounded-full bg-primary-foreground"})}}))};var hT=$('<nav class="flex items-center gap-1 text-muted-foreground"aria-label=breadcrumb>'),mT=$('<span class="truncate font-medium text-foreground">');const ss=e=>(()=>{var t=hT();return x(t,f(ot,{get each(){return e.items},children:(n,r)=>[f(q,{get when(){return r()>0},get children(){return f(Ml,{class:"h-3.5 w-3.5 shrink-0 opacity-60"})}}),f(q,{get when(){return n.href},get fallback(){return(()=>{var o=mT();return x(o,()=>n.label),o})()},get children(){return f(Nn,{class:"truncate cursor-pointer hover:text-foreground",get href(){return n.href},get children(){return n.label}})}})]})),t})(),bT="yorz:new-spec-draft:";function yT(e){return e==="feat"||e==="refct"||e==="fix"}function wd(e){return`${bT}${e}`}function vT(e){if(!e||typeof window>"u")return{};try{const t=window.localStorage.getItem(wd(e));if(!t)return{};const n=JSON.parse(t);return{content:typeof n.content=="string"?n.content:void 0,type:yT(n.type)?n.type:void 0,useWorktree:typeof n.useWorktree=="boolean"?n.useWorktree:void 0}}catch{return{}}}function wT(e,t){if(!(!e||typeof window>"u"))try{const n=t.content.trim().length>0||t.type!=="feat"||t.useWorktree!==!1,r=wd(e);if(!n){window.localStorage.removeItem(r);return}window.localStorage.setItem(r,JSON.stringify(t))}catch{}}function _g(e){return JSON.stringify(e)}function Eg(e){if(!(!e||typeof window>"u"))try{window.localStorage.removeItem(wd(e))}catch{}}function xT(e){const n=(e.split(/\r?\n/)[0]??"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,40);return n&&!/^[0-9]+$/.test(n)?n:`spec-${Date.now().toString(36)}`}function _T(e){let t=new Set,n=!1;return{setBaseline(r){t=new Set(r),n=!1},async poll(){if(!n)try{const o=(await e.listSpecs()).find(i=>!t.has(i.id));if(!o||n)return;n=!0,e.onFound(o.id)}catch{}},found:()=>n}}var Cg=$('<span class="text-sm text-muted-foreground">'),ET=$('<section class="flex min-h-0 flex-1 flex-col gap-2 p-2"><header class="flex flex-col gap-1"></header><p class=" text-muted-foreground"></p><form class="flex flex-col gap-4 rounded-xl border bg-card p-4"><label class="flex flex-col gap-1.5 font-medium"><span></span></label><section class="flex flex-col gap-2.5 rounded-lg border border-dashed bg-card p-3"><div class="flex flex-wrap items-center gap-2.5"><span class=font-semibold></span><span class="text-sm text-muted-foreground"></span><input type=file multiple hidden>'),CT=$('<strong class=" ">'),ST=$('<p class=" text-destructive">');const kT=[{value:"feat",labelKey:"newSpec.typeFeat",hintKey:"newSpec.typeFeatHint"},{value:"refct",labelKey:"newSpec.typeRefct",hintKey:"newSpec.typeRefctHint"},{value:"fix",labelKey:"newSpec.typeFix",hintKey:"newSpec.typeFixHint"}],AT=()=>{const e=Wr(),t=yo(),[n,r]=I(""),[o,i]=I("feat"),[s,a]=I("idle"),[u,c]=I(!1),l=()=>s()==="creating",d=Y1({projectId:t,labels:Z1}),g=d.error,p=d.setError;let h=null,m=null,y="",v="",b,w=!1,E="";ue(()=>{h?.(),m?.()}),ae(_t(t,T=>{w=!0;const S=vT(T);r(S.content??""),i(S.type??"feat"),c(S.useWorktree??!1),w=!1})),ae(()=>{if(w||l())return;const T={content:n(),type:o(),useWorktree:u()};_g(T)!==E&&(E="",wT(t(),T))});const C=_T({listSpecs:()=>we.listSpecs(y||t()),onFound:T=>{const S=y||t();h?.(),h=null,m?.(),m=null;const A=S?`/${S}/specs/${encodeURIComponent(T)}`:Tt(`specs/${encodeURIComponent(T)}`);e(A),v&&(Bo(v),v="")}});async function k(T){if(T.preventDefault(),s()==="creating")return;p(null);const S=n().trim();if(S.length<5){p(_("newSpec.descTooShort"));return}const A=d.attachments().filter(F=>F.status==="failed");if(A.length>0){p(_("newSpec.attachmentFailedCount",{count:A.length}));return}if(d.hasPending()){p(_("newSpec.attachmentUploading"));return}a("creating");try{const F=t();E=_g({content:n(),type:o(),useWorktree:u()}),Eg(F);let O=F;if(u()){const N=xT(S);O=(await we.createWorktree(F,{specSlug:N})).id,Eg(O)}y=O;const P=await we.listSpecs(O);C.setBaseline(P.map(N=>N.id));const L={type:o(),requirement:S},D=d.draftId();D&&(L.draftId=D,O!==F&&(L.draftProjectId=F));const B=await we.createSpec(O,L);"draft"in B&&B.draft?(v=B.sessionId,m=Ea(O,B.sessionId,{onEvent:N=>{N.type==="error"&&(a("failed"),p(N.message||_("newSpec.agentRunFailed")),m?.(),m=null)}}),h=Ym(O,()=>{C.poll()}),C.poll()):"id"in B&&e(`/${O}/specs/${encodeURIComponent(B.id)}`)}catch(F){p(F.message),a("failed")}}return(()=>{var T=ET(),S=T.firstChild,A=S.nextSibling,F=A.nextSibling,O=F.firstChild,P=O.firstChild,L=O.nextSibling,D=L.firstChild,B=D.firstChild,N=B.nextSibling,Y=N.nextSibling;x(S,f(ss,{get items(){return[{label:_("breadcrumb.specList"),href:Tt("")},{label:_("breadcrumb.newSpec")}]}})),x(A,()=>_("newSpec.description")),F.addEventListener("submit",k),x(F,f(Xn,{class:"m-0 flex flex-wrap gap-2 border-0 p-0",get value(){return o()},onChange:V=>i(V),get disabled(){return l()},get children(){return[f(vd,{class:"mb-1.5 w-full font-medium",get children(){return _("newSpec.type")}}),Q(()=>kT.map(V=>f(hn,{get value(){return V.value},class:"flex min-h-[44px] flex-1",get children(){return[f(gn,{class:"sr-only"}),f(pn,{get class(){return`flex w-full cursor-pointer flex-col items-start gap-0.5 rounded-lg border p-3 transition-colors ${o()===V.value?"border-primary bg-primary/10":"border-border bg-background"}`},get children(){return[(()=>{var j=CT();return x(j,()=>_(V.labelKey)),j})(),(()=>{var j=Cg();return x(j,()=>_(V.hintKey)),j})()]}})]}})))]}}),O),x(F,f(Jo,{get checked(){return u()},onChange:V=>c(V),get disabled(){return l()},class:"flex flex-wrap items-center gap-2",get children(){return[f(Qo,{}),f(zi,{class:"cursor-pointer font-medium",get children(){return _("newSpec.parallelWorktree")}}),(()=>{var V=Cg();return x(V,()=>_("newSpec.parallelWorktreeDesc")),V})()]}}),O),x(P,()=>_("newSpec.requirement")),x(O,f(Ha,{get projectId(){return t()},get value(){return n()},onValueChange:r,get onPaste(){return d.onPaste},get placeholder(){return _("newSpec.requirementPlaceholder")},minRows:10,maxRows:10,required:!0,autofocus:!0,get disabled(){return l()}}),null),Vs(L,"paste",d.onPaste),x(B,()=>_("newSpec.attachments")),x(N,()=>_("newSpec.attachmentsHint",{count:d.count(),max:qo})),x(D,f(Ee,{variant:"outline",size:"sm",type:"button",onClick:()=>b?.click(),get disabled(){return l()||d.count()>=qo},get children(){return[f(W2,{class:"mr-1 h-3.5 w-3.5"}),Q(()=>_("newSpec.importAttachment"))]}}),Y),Vs(Y,"change",d.onFileInputChange);var ce=b;return typeof ce=="function"?Ln(ce,Y):b=Y,Ke(Y,"accept",W1),x(L,f(q,{get when(){return d.count()>0},get children(){return f(ey,{ctrl:d,get busy(){return l()},allowRename:!0})}}),null),x(F,(()=>{var V=Q(()=>!!g());return()=>V()&&(()=>{var j=ST();return x(j,g),j})()})(),null),x(F,f(Ee,{type:"submit",variant:"default",get disabled(){return l()},get children(){return[Q(()=>Q(()=>!!l())()?f(sn,{class:"mr-1 h-4 w-4 animate-spin"}):f(xa,{class:"mr-1 h-4 w-4"})),Q(()=>Q(()=>!!l())()?_("newSpec.creating"):_("newSpec.createAndStart"))]}}),null),T})()};var Sg=11;function TT(e,t){var n=t.attributes,r,o,i,s,a;if(!(t.nodeType===Sg||e.nodeType===Sg)){for(var u=n.length-1;u>=0;u--)r=n[u],o=r.name,i=r.namespaceURI,s=r.value,i?(o=r.localName||o,a=e.getAttributeNS(i,o),a!==s&&(r.prefix==="xmlns"&&(o=r.name),e.setAttributeNS(i,o,s))):(a=e.getAttribute(o),a!==s&&e.setAttribute(o,s));for(var c=e.attributes,l=c.length-1;l>=0;l--)r=c[l],o=r.name,i=r.namespaceURI,i?(o=r.localName||o,t.hasAttributeNS(i,o)||e.removeAttributeNS(i,o)):t.hasAttribute(o)||e.removeAttribute(o)}}var As,DT="http://www.w3.org/1999/xhtml",en=typeof document>"u"?void 0:document,IT=!!en&&"content"in en.createElement("template"),RT=!!en&&en.createRange&&"createContextualFragment"in en.createRange();function OT(e){var t=en.createElement("template");return t.innerHTML=e,t.content.childNodes[0]}function NT(e){As||(As=en.createRange(),As.selectNode(en.body));var t=As.createContextualFragment(e);return t.childNodes[0]}function MT(e){var t=en.createElement("body");return t.innerHTML=e,t.childNodes[0]}function PT(e){return e=e.trim(),IT?OT(e):RT?NT(e):MT(e)}function Ts(e,t){var n=e.nodeName,r=t.nodeName,o,i;return n===r?!0:(o=n.charCodeAt(0),i=r.charCodeAt(0),o<=90&&i>=97?n===r.toUpperCase():i<=90&&o>=97?r===n.toUpperCase():!1)}function LT(e,t){return!t||t===DT?en.createElement(e):en.createElementNS(t,e)}function $T(e,t){for(var n=e.firstChild;n;){var r=n.nextSibling;t.appendChild(n),n=r}return t}function yu(e,t,n){e[n]!==t[n]&&(e[n]=t[n],e[n]?e.setAttribute(n,""):e.removeAttribute(n))}var kg={OPTION:function(e,t){var n=e.parentNode;if(n){var r=n.nodeName.toUpperCase();r==="OPTGROUP"&&(n=n.parentNode,r=n&&n.nodeName.toUpperCase()),r==="SELECT"&&!n.hasAttribute("multiple")&&(e.hasAttribute("selected")&&!t.selected&&(e.setAttribute("selected","selected"),e.removeAttribute("selected")),n.selectedIndex=-1)}yu(e,t,"selected")},INPUT:function(e,t){yu(e,t,"checked"),yu(e,t,"disabled"),e.value!==t.value&&(e.value=t.value),t.hasAttribute("value")||e.removeAttribute("value")},TEXTAREA:function(e,t){var n=t.value;e.value!==n&&(e.value=n);var r=e.firstChild;if(r){var o=r.nodeValue;if(o==n||!n&&o==e.placeholder)return;r.nodeValue=n}},SELECT:function(e,t){if(!t.hasAttribute("multiple")){for(var n=-1,r=0,o=e.firstChild,i,s;o;)if(s=o.nodeName&&o.nodeName.toUpperCase(),s==="OPTGROUP")i=o,o=i.firstChild,o||(o=i.nextSibling,i=null);else{if(s==="OPTION"){if(o.hasAttribute("selected")){n=r;break}r++}o=o.nextSibling,!o&&i&&(o=i.nextSibling,i=null)}e.selectedIndex=n}}},gi=1,Ag=11,Tg=3,Dg=8;function Pr(){}function FT(e){if(e)return e.getAttribute&&e.getAttribute("id")||e.id}function BT(e){return function(n,r,o){if(o||(o={}),typeof r=="string")if(n.nodeName==="#document"||n.nodeName==="HTML"){var i=r;r=en.createElement("html"),r.innerHTML=i}else if(n.nodeName==="BODY"){var s=r;r=en.createElement("html"),r.innerHTML=s;var a=r.querySelector("body");a&&(r=a)}else r=PT(r);else r.nodeType===Ag&&(r=r.firstElementChild);var u=o.getNodeKey||FT,c=o.onBeforeNodeAdded||Pr,l=o.onNodeAdded||Pr,d=o.onBeforeElUpdated||Pr,g=o.onElUpdated||Pr,p=o.onBeforeNodeDiscarded||Pr,h=o.onNodeDiscarded||Pr,m=o.onBeforeElChildrenUpdated||Pr,y=o.skipFromChildren||Pr,v=o.addChild||function(V,j){return V.appendChild(j)},b=o.childrenOnly===!0,w=Object.create(null),E=[];function C(V){E.push(V)}function k(V,j){if(V.nodeType===gi)for(var he=V.firstChild;he;){var K=void 0;j&&(K=u(he))?C(K):(h(he),he.firstChild&&k(he,j)),he=he.nextSibling}}function T(V,j,he){p(V)!==!1&&(j&&j.removeChild(V),h(V),k(V,he))}function S(V){if(V.nodeType===gi||V.nodeType===Ag)for(var j=V.firstChild;j;){var he=u(j);he&&(w[he]=j),S(j),j=j.nextSibling}}S(n);function A(V){l(V);for(var j=V.firstChild;j;){var he=j.nextSibling,K=u(j);if(K){var z=w[K];z&&Ts(j,z)?(j.parentNode.replaceChild(z,j),O(z,j)):A(j)}else A(j);j=he}}function F(V,j,he){for(;j;){var K=j.nextSibling;(he=u(j))?C(he):T(j,V,!0),j=K}}function O(V,j,he){var K=u(j);if(K&&delete w[K],!he){var z=d(V,j);if(z===!1||(z instanceof HTMLElement&&(V=z,S(V)),e(V,j),g(V),m(V,j)===!1))return}V.nodeName!=="TEXTAREA"?P(V,j):kg.TEXTAREA(V,j)}function P(V,j){var he=y(V,j),K=j.firstChild,z=V.firstChild,J,re,ve,Z,M;e:for(;K;){for(Z=K.nextSibling,J=u(K);!he&&z;){if(ve=z.nextSibling,K.isSameNode&&K.isSameNode(z)){K=Z,z=ve;continue e}re=u(z);var W=z.nodeType,oe=void 0;if(W===K.nodeType&&(W===gi?(J?J!==re&&((M=w[J])?ve===M?oe=!1:(V.insertBefore(M,z),re?C(re):T(z,V,!0),z=M,re=u(z)):oe=!1):re&&(oe=!1),oe=oe!==!1&&Ts(z,K),oe&&O(z,K)):(W===Tg||W==Dg)&&(oe=!0,z.nodeValue!==K.nodeValue&&(z.nodeValue=K.nodeValue))),oe){K=Z,z=ve;continue e}re?C(re):T(z,V,!0),z=ve}if(J&&(M=w[J])&&Ts(M,K))he||v(V,M),O(M,K);else{var te=c(K);te!==!1&&(te&&(K=te),K.actualize&&(K=K.actualize(V.ownerDocument||en)),v(V,K),A(K))}K=Z,z=ve}F(V,z,re);var H=kg[V.nodeName];H&&H(V,j)}var L=n,D=L.nodeType,B=r.nodeType;if(!b){if(D===gi)B===gi?Ts(n,r)||(h(n),L=$T(n,LT(r.nodeName,r.namespaceURI))):L=r;else if(D===Tg||D===Dg){if(B===D)return L.nodeValue!==r.nodeValue&&(L.nodeValue=r.nodeValue),L;L=r}}if(L===r)h(n);else{if(r.isSameNode&&r.isSameNode(L))return;if(O(L,r,b),E)for(var N=0,Y=E.length;N<Y;N++){var ce=w[E[N]];ce&&T(ce,ce.parentNode,!1)}}return!b&&L!==n&&n.parentNode&&(L.actualize&&(L=L.actualize(n.ownerDocument||en)),n.parentNode.replaceChild(L,n)),L}}var zT=BT(TT);const Ig={};function UT(e){let t=Ig[e];if(t)return t;t=Ig[e]=[];for(let n=0;n<128;n++){const r=String.fromCharCode(n);t.push(r)}for(let n=0;n<e.length;n++){const r=e.charCodeAt(n);t[r]="%"+("0"+r.toString(16).toUpperCase()).slice(-2)}return t}function ei(e,t){typeof t!="string"&&(t=ei.defaultChars);const n=UT(t);return e.replace(/(%[a-f0-9]{2})+/gi,function(r){let o="";for(let i=0,s=r.length;i<s;i+=3){const a=parseInt(r.slice(i+1,i+3),16);if(a<128){o+=n[a];continue}if((a&224)===192&&i+3<s){const u=parseInt(r.slice(i+4,i+6),16);if((u&192)===128){const c=a<<6&1984|u&63;c<128?o+="��":o+=String.fromCharCode(c),i+=3;continue}}if((a&240)===224&&i+6<s){const u=parseInt(r.slice(i+4,i+6),16),c=parseInt(r.slice(i+7,i+9),16);if((u&192)===128&&(c&192)===128){const l=a<<12&61440|u<<6&4032|c&63;l<2048||l>=55296&&l<=57343?o+="���":o+=String.fromCharCode(l),i+=6;continue}}if((a&248)===240&&i+9<s){const u=parseInt(r.slice(i+4,i+6),16),c=parseInt(r.slice(i+7,i+9),16),l=parseInt(r.slice(i+10,i+12),16);if((u&192)===128&&(c&192)===128&&(l&192)===128){let d=a<<18&1835008|u<<12&258048|c<<6&4032|l&63;d<65536||d>1114111?o+="����":(d-=65536,o+=String.fromCharCode(55296+(d>>10),56320+(d&1023))),i+=9;continue}}o+="�"}return o})}ei.defaultChars=";/?:@&=+$,#";ei.componentChars="";const Rg={};function KT(e){let t=Rg[e];if(t)return t;t=Rg[e]=[];for(let n=0;n<128;n++){const r=String.fromCharCode(n);/^[0-9a-z]$/i.test(r)?t.push(r):t.push("%"+("0"+n.toString(16).toUpperCase()).slice(-2))}for(let n=0;n<e.length;n++)t[e.charCodeAt(n)]=e[n];return t}function as(e,t,n){typeof t!="string"&&(n=t,t=as.defaultChars),typeof n>"u"&&(n=!0);const r=KT(t);let o="";for(let i=0,s=e.length;i<s;i++){const a=e.charCodeAt(i);if(n&&a===37&&i+2<s&&/^[0-9a-f]{2}$/i.test(e.slice(i+1,i+3))){o+=e.slice(i,i+3),i+=2;continue}if(a<128){o+=r[a];continue}if(a>=55296&&a<=57343){if(a>=55296&&a<=56319&&i+1<s){const u=e.charCodeAt(i+1);if(u>=56320&&u<=57343){o+=encodeURIComponent(e[i]+e[i+1]),i++;continue}}o+="%EF%BF%BD";continue}o+=encodeURIComponent(e[i])}return o}as.defaultChars=";/?:@&=+$,-_.!~*'()#";as.componentChars="-_.!~*'()";function xd(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 ca(){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 jT=/^([a-z0-9.+-]+:)/i,qT=/:[0-9]*$/,HT=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,GT=["<",">",'"',"`"," ","\r",`
|
|
7
|
+
`," "],VT=["{","}","|","\\","^","`"].concat(GT),WT=["'"].concat(VT),Og=["%","/","?",";","#"].concat(WT),Ng=["/","?","#"],YT=255,Mg=/^[+a-z0-9A-Z_-]{0,63}$/,ZT=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,Pg={javascript:!0,"javascript:":!0},Lg={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function _d(e,t){if(e&&e instanceof ca)return e;const n=new ca;return n.parse(e,t),n}ca.prototype.parse=function(e,t){let n,r,o,i=e;if(i=i.trim(),!t&&e.split("#").length===1){const c=HT.exec(i);if(c)return this.pathname=c[1],c[2]&&(this.search=c[2]),this}let s=jT.exec(i);if(s&&(s=s[0],n=s.toLowerCase(),this.protocol=s,i=i.substr(s.length)),(t||s||i.match(/^\/\/[^@\/]+@[^@\/]+/))&&(o=i.substr(0,2)==="//",o&&!(s&&Pg[s])&&(i=i.substr(2),this.slashes=!0)),!Pg[s]&&(o||s&&!Lg[s])){let c=-1;for(let h=0;h<Ng.length;h++)r=i.indexOf(Ng[h]),r!==-1&&(c===-1||r<c)&&(c=r);let l,d;c===-1?d=i.lastIndexOf("@"):d=i.lastIndexOf("@",c),d!==-1&&(l=i.slice(0,d),i=i.slice(d+1),this.auth=l),c=-1;for(let h=0;h<Og.length;h++)r=i.indexOf(Og[h]),r!==-1&&(c===-1||r<c)&&(c=r);c===-1&&(c=i.length),i[c-1]===":"&&c--;const g=i.slice(0,c);i=i.slice(c),this.parseHost(g),this.hostname=this.hostname||"";const p=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!p){const h=this.hostname.split(/\./);for(let m=0,y=h.length;m<y;m++){const v=h[m];if(v&&!v.match(Mg)){let b="";for(let w=0,E=v.length;w<E;w++)v.charCodeAt(w)>127?b+="x":b+=v[w];if(!b.match(Mg)){const w=h.slice(0,m),E=h.slice(m+1),C=v.match(ZT);C&&(w.push(C[1]),E.unshift(C[2])),E.length&&(i=E.join(".")+i),this.hostname=w.join(".");break}}}}this.hostname.length>YT&&(this.hostname=""),p&&(this.hostname=this.hostname.substr(1,this.hostname.length-2))}const a=i.indexOf("#");a!==-1&&(this.hash=i.substr(a),i=i.slice(0,a));const u=i.indexOf("?");return u!==-1&&(this.search=i.substr(u),i=i.slice(0,u)),i&&(this.pathname=i),Lg[n]&&this.hostname&&!this.pathname&&(this.pathname=""),this};ca.prototype.parseHost=function(e){let t=qT.exec(e);t&&(t=t[0],t!==":"&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)};const XT=Object.freeze(Object.defineProperty({__proto__:null,decode:ei,encode:as,format:xd,parse:_d},Symbol.toStringTag,{value:"Module"})),ty=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,ny=/[\0-\x1F\x7F-\x9F]/,JT=/[\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]/,Ed=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\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]/,ry=/[\$\+<->\^`\|~\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]/,oy=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/,QT=Object.freeze(Object.defineProperty({__proto__:null,Any:ty,Cc:ny,Cf:JT,P:Ed,S:ry,Z:oy},Symbol.toStringTag,{value:"Module"})),eD=new Uint16Array('ᵁ<Õıʊҝջאٵ۞ޢߖࠏઑඡ༉༦ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲϏϢϸontourIntegraìȹoɴ\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲy;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱còJTabcdfgorstרׯؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ߂ߐĀiyޱrc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣসে্ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४ĀnrࢃgleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpwਖਛgȀLRlr৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼અઋp;椅y;䐜Ādl੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑඞcy;䐊cute;䅃ƀaeyહાron;䅇dil;䅅;䐝ƀgswે૰ativeƀMTV૨ediumSpace;怋hiĀcn૦ëeryThiîtedĀGLଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷreak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪௫ఄ಄ದൡඅ櫬Āoungruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater;EFGLSTஶஷ扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨setĀ;Eೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂෛ෧ขภยา฿ไlig;䅒cute耻Ó䃓Āiyීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲcr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬืde耻Õ䃕es;樷ml耻Ö䃖erĀBP๋Āar๐๓r;怾acĀek๚;揞et;掴arenthesis;揜ҀacfhilorsງຊຏຒດຝະrtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ檻cedesȀ;EST່້扺qual;檯lantEqual;扼ilde;找me;怳Ādpuct;戏ortionĀ;aȥl;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL憒ar;懥eftArrow;懄eiling;按oǵ\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄቕቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHcቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗ĀeiቻDzኀ\0ኇefore;戴a;䎘ĀcnኘkSpace;쀀 Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtèa;䎖r;愨pf;愤cr;쀀𝒵ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒;Eaeiopᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;eᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;eᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰᝃᝈ០៦ᠹᡐᜍ᥈ᥰot;櫭ĀcrᛶkȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;tbrk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯᝳ;䎲;愶een;扬r;쀀𝔟gcostuvwឍឝឳេ៕៛ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀakoᠦᠵĀcn៲ᠣkƀlst֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ;敛;敘;攘;攔;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģbar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;elƀ;bhᥨᥩᥫ䁜;槅sub;柈ŬᥴlĀ;e怢t»pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭒\0᯽\0ᰌƀcprᦲute;䄇̀;abcdsᦿᧀᧄ᧕᧙戩nd;橄rcup;橉Āau᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r;Ecefms᩠ᩢᩫ᪤᪪旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ\0\0aĀ;t䀬;䁀ƀ;fl戁îᅠeĀmxent»eóɍǧ\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯delprvw᭠᭬᭷ᮂᮬᯔarrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;pᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰻᰿ᱝᱩᱵᲞᲬᲷᴍᵻᶑᶫᶻ᷆᷍ròar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂᳖᳜᳠mƀ;oș᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄĀDoḆᴴoôĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»ṺƀaeiἒἚls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧\0耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₥₰₴⃰℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽ƀ;qsؾٌlanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqrⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0proør;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼ròòΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonóquigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roøurĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨íistĀ;sடr;쀀𝔫ȀEest⩦⩹⩼ƀ;qs⩭ƀ;qs⩴lanôií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast⭕⭚⭟lleìl;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖchimpqu⮽⯍⯙⬄⯤⯯Ȁ;cerല⯆ഷ⯉uå;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭ååഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñĀ;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;cⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācrir;榿;쀀𝔬ͯ\0\0\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕⶥⶨrò᪀Āirⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔǒr;榷rp;榹;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ\0\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ脀¶;l䂶leìЃɩ\0\0m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳ᤈ⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t⾴ïrel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⋢⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔ABHabcdefhilmnoprstuxけさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstwガクシスゼゾダッデナp;極Ā;fゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ìâヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘rrowĀ;tㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowóarpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓ròaòՑ;怏oustĀ;a㈞掱che»mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì耻䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;qኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫwar;椪lig耻ß䃟㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rëƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproøim»ኬsðኞĀas㚺㚮ðrn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈadempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xôheadĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roðtré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜtré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map(e=>e.charCodeAt(0))),tD=new Uint16Array("Ȁaglq \x1Bɭ\0\0p;䀦os;䀧t;䀾t;䀼uot;䀢".split("").map(e=>e.charCodeAt(0)));var vu;const nD=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]]),rD=(vu=String.fromCodePoint)!==null&&vu!==void 0?vu:function(e){let t="";return e>65535&&(e-=65536,t+=String.fromCharCode(e>>>10&1023|55296),e=56320|e&1023),t+=String.fromCharCode(e),t};function oD(e){var t;return e>=55296&&e<=57343||e>1114111?65533:(t=nD.get(e))!==null&&t!==void 0?t:e}var Bt;(function(e){e[e.NUM=35]="NUM",e[e.SEMI=59]="SEMI",e[e.EQUALS=61]="EQUALS",e[e.ZERO=48]="ZERO",e[e.NINE=57]="NINE",e[e.LOWER_A=97]="LOWER_A",e[e.LOWER_F=102]="LOWER_F",e[e.LOWER_X=120]="LOWER_X",e[e.LOWER_Z=122]="LOWER_Z",e[e.UPPER_A=65]="UPPER_A",e[e.UPPER_F=70]="UPPER_F",e[e.UPPER_Z=90]="UPPER_Z"})(Bt||(Bt={}));const iD=32;var Br;(function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.BRANCH_LENGTH=16256]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"})(Br||(Br={}));function ml(e){return e>=Bt.ZERO&&e<=Bt.NINE}function sD(e){return e>=Bt.UPPER_A&&e<=Bt.UPPER_F||e>=Bt.LOWER_A&&e<=Bt.LOWER_F}function aD(e){return e>=Bt.UPPER_A&&e<=Bt.UPPER_Z||e>=Bt.LOWER_A&&e<=Bt.LOWER_Z||ml(e)}function uD(e){return e===Bt.EQUALS||aD(e)}var Ft;(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"})(Ft||(Ft={}));var wr;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(wr||(wr={}));class cD{constructor(t,n,r){this.decodeTree=t,this.emitCodePoint=n,this.errors=r,this.state=Ft.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=wr.Strict}startEntity(t){this.decodeMode=t,this.state=Ft.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(t,n){switch(this.state){case Ft.EntityStart:return t.charCodeAt(n)===Bt.NUM?(this.state=Ft.NumericStart,this.consumed+=1,this.stateNumericStart(t,n+1)):(this.state=Ft.NamedEntity,this.stateNamedEntity(t,n));case Ft.NumericStart:return this.stateNumericStart(t,n);case Ft.NumericDecimal:return this.stateNumericDecimal(t,n);case Ft.NumericHex:return this.stateNumericHex(t,n);case Ft.NamedEntity:return this.stateNamedEntity(t,n)}}stateNumericStart(t,n){return n>=t.length?-1:(t.charCodeAt(n)|iD)===Bt.LOWER_X?(this.state=Ft.NumericHex,this.consumed+=1,this.stateNumericHex(t,n+1)):(this.state=Ft.NumericDecimal,this.stateNumericDecimal(t,n))}addToNumericResult(t,n,r,o){if(n!==r){const i=r-n;this.result=this.result*Math.pow(o,i)+parseInt(t.substr(n,i),o),this.consumed+=i}}stateNumericHex(t,n){const r=n;for(;n<t.length;){const o=t.charCodeAt(n);if(ml(o)||sD(o))n+=1;else return this.addToNumericResult(t,r,n,16),this.emitNumericEntity(o,3)}return this.addToNumericResult(t,r,n,16),-1}stateNumericDecimal(t,n){const r=n;for(;n<t.length;){const o=t.charCodeAt(n);if(ml(o))n+=1;else return this.addToNumericResult(t,r,n,10),this.emitNumericEntity(o,2)}return this.addToNumericResult(t,r,n,10),-1}emitNumericEntity(t,n){var r;if(this.consumed<=n)return(r=this.errors)===null||r===void 0||r.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(t===Bt.SEMI)this.consumed+=1;else if(this.decodeMode===wr.Strict)return 0;return this.emitCodePoint(oD(this.result),this.consumed),this.errors&&(t!==Bt.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(t,n){const{decodeTree:r}=this;let o=r[this.treeIndex],i=(o&Br.VALUE_LENGTH)>>14;for(;n<t.length;n++,this.excess++){const s=t.charCodeAt(n);if(this.treeIndex=lD(r,o,this.treeIndex+Math.max(1,i),s),this.treeIndex<0)return this.result===0||this.decodeMode===wr.Attribute&&(i===0||uD(s))?0:this.emitNotTerminatedNamedEntity();if(o=r[this.treeIndex],i=(o&Br.VALUE_LENGTH)>>14,i!==0){if(s===Bt.SEMI)return this.emitNamedEntityData(this.treeIndex,i,this.consumed+this.excess);this.decodeMode!==wr.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var t;const{result:n,decodeTree:r}=this,o=(r[n]&Br.VALUE_LENGTH)>>14;return this.emitNamedEntityData(n,o,this.consumed),(t=this.errors)===null||t===void 0||t.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(t,n,r){const{decodeTree:o}=this;return this.emitCodePoint(n===1?o[t]&~Br.VALUE_LENGTH:o[t+1],r),n===3&&this.emitCodePoint(o[t+2],r),r}end(){var t;switch(this.state){case Ft.NamedEntity:return this.result!==0&&(this.decodeMode!==wr.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case Ft.NumericDecimal:return this.emitNumericEntity(0,2);case Ft.NumericHex:return this.emitNumericEntity(0,3);case Ft.NumericStart:return(t=this.errors)===null||t===void 0||t.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case Ft.EntityStart:return 0}}}function iy(e){let t="";const n=new cD(e,r=>t+=rD(r));return function(o,i){let s=0,a=0;for(;(a=o.indexOf("&",a))>=0;){t+=o.slice(s,a),n.startEntity(i);const c=n.write(o,a+1);if(c<0){s=a+n.end();break}s=a+c,a=c===0?s+1:s}const u=t+o.slice(s);return t="",u}}function lD(e,t,n,r){const o=(t&Br.BRANCH_LENGTH)>>7,i=t&Br.JUMP_TABLE;if(o===0)return i!==0&&r===i?n:-1;if(i){const u=r-i;return u<0||u>=o?-1:e[n+u]-1}let s=n,a=s+o-1;for(;s<=a;){const u=s+a>>>1,c=e[u];if(c<r)s=u+1;else if(c>r)a=u-1;else return e[u+o]}return-1}const sy=iy(eD);iy(tD);function dD(e,t=wr.Legacy){return sy(e,t)}function fD(e){return sy(e,wr.Strict)}function gD(e){return Object.prototype.toString.call(e)}function Cd(e){return gD(e)==="[object String]"}const pD=Object.prototype.hasOwnProperty;function hD(e,t){return pD.call(e,t)}function Ga(e){return Array.prototype.slice.call(arguments,1).forEach(function(n){if(n){if(typeof n!="object")throw new TypeError(n+"must be object");Object.keys(n).forEach(function(r){e[r]=n[r]})}}),e}function ay(e,t,n){return[].concat(e.slice(0,t),n,e.slice(t+1))}function Sd(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 Ui(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 uy=/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g,mD=/&([a-z#][a-z0-9]{1,31});/gi,bD=new RegExp(uy.source+"|"+mD.source,"gi"),yD=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i;function vD(e,t){if(t.charCodeAt(0)===35&&yD.test(t)){const r=t[1].toLowerCase()==="x"?parseInt(t.slice(2),16):parseInt(t.slice(1),10);return Sd(r)?Ui(r):e}const n=dD(e);return n!==e?n:e}function wD(e){return e.indexOf("\\")<0?e:e.replace(uy,"$1")}function ti(e){return e.indexOf("\\")<0&&e.indexOf("&")<0?e:e.replace(bD,function(t,n,r){return n||vD(t,r)})}const xD=/[&<>"]/,_D=/[&<>"]/g,ED={"&":"&","<":"<",">":">",'"':"""};function CD(e){return ED[e]}function Vr(e){return xD.test(e)?e.replace(_D,CD):e}const SD=/[.?*+^$[\]\\(){}|-]/g;function kD(e){return e.replace(SD,"\\$&")}function vt(e){switch(e){case 9:case 32:return!0}return!1}function Ki(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 cy(e){return Ed.test(e)||ry.test(e)}function ji(e){return cy(Ui(e))}function qi(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 Va(e){return e=e.trim().replace(/\s+/g," "),"ẞ".toLowerCase()==="Ṿ"&&(e=e.replace(/ẞ/g,"ß")),e.toLowerCase().toUpperCase()}function $g(e){return e===32||e===9||e===10||e===13}function Wa(e){let t=0;for(;t<e.length&&$g(e.charCodeAt(t));t++);let n=e.length-1;for(;n>=t&&$g(e.charCodeAt(n));n--);return e.slice(t,n+1)}const AD={mdurl:XT,ucmicro:QT},TD=Object.freeze(Object.defineProperty({__proto__:null,arrayReplaceAt:ay,asciiTrim:Wa,assign:Ga,escapeHtml:Vr,escapeRE:kD,fromCodePoint:Ui,has:hD,isMdAsciiPunct:qi,isPunctChar:cy,isPunctCharCode:ji,isSpace:vt,isString:Cd,isValidEntityCode:Sd,isWhiteSpace:Ki,lib:AD,normalizeReference:Va,unescapeAll:ti,unescapeMd:wD},Symbol.toStringTag,{value:"Module"}));function DD(e,t,n){let r,o,i,s;const a=e.posMax,u=e.pos;for(e.pos=t+1,r=1;e.pos<a;){if(i=e.src.charCodeAt(e.pos),i===93&&(r--,r===0)){o=!0;break}if(s=e.pos,e.md.inline.skipToken(e),i===91){if(s===e.pos-1)r++;else if(n)return e.pos=u,-1}}let c=-1;return o&&(c=e.pos),e.pos=u,c}function ID(e,t,n){let r,o=t;const i={ok:!1,pos:0,str:""};if(e.charCodeAt(o)===60){for(o++;o<n;){if(r=e.charCodeAt(o),r===10||r===60)return i;if(r===62)return i.pos=o+1,i.str=ti(e.slice(t+1,o)),i.ok=!0,i;if(r===92&&o+1<n){o+=2;continue}o++}return i}let s=0;for(;o<n&&(r=e.charCodeAt(o),!(r===32||r<32||r===127));){if(r===92&&o+1<n){if(e.charCodeAt(o+1)===32)break;o+=2;continue}if(r===40&&(s++,s>32))return i;if(r===41){if(s===0)break;s--}o++}return t===o||s!==0||(i.str=ti(e.slice(t,o)),i.pos=o,i.ok=!0),i}function RD(e,t,n,r){let o,i=t;const s={ok:!1,can_continue:!1,pos:0,str:"",marker:0};if(r)s.str=r.str,s.marker=r.marker;else{if(i>=n)return s;let a=e.charCodeAt(i);if(a!==34&&a!==39&&a!==40)return s;t++,i++,a===40&&(a=41),s.marker=a}for(;i<n;){if(o=e.charCodeAt(i),o===s.marker)return s.pos=i+1,s.str+=ti(e.slice(t,i)),s.ok=!0,s;if(o===40&&s.marker===41)return s;o===92&&i+1<n&&i++,i++}return s.can_continue=!0,s.str+=ti(e.slice(t,i)),s}const OD=Object.freeze(Object.defineProperty({__proto__:null,parseLinkDestination:ID,parseLinkLabel:DD,parseLinkTitle:RD},Symbol.toStringTag,{value:"Module"})),lr={};lr.code_inline=function(e,t,n,r,o){const i=e[t];return"<code"+o.renderAttrs(i)+">"+Vr(i.content)+"</code>"};lr.code_block=function(e,t,n,r,o){const i=e[t];return"<pre"+o.renderAttrs(i)+"><code>"+Vr(e[t].content)+`</code></pre>
|
|
8
|
+
`};lr.fence=function(e,t,n,r,o){const i=e[t],s=i.info?ti(i.info).trim():"";let a="",u="";if(s){const l=s.split(/(\s+)/g);a=l[0],u=l.slice(2).join("")}let c;if(n.highlight?c=n.highlight(i.content,a,u)||Vr(i.content):c=Vr(i.content),c.indexOf("<pre")===0)return c+`
|
|
9
|
+
`;if(s){const l=i.attrIndex("class"),d=i.attrs?i.attrs.slice():[];l<0?d.push(["class",n.langPrefix+a]):(d[l]=d[l].slice(),d[l][1]+=" "+n.langPrefix+a);const g={attrs:d};return`<pre><code${o.renderAttrs(g)}>${c}</code></pre>
|
|
10
|
+
`}return`<pre><code${o.renderAttrs(i)}>${c}</code></pre>
|
|
11
|
+
`};lr.image=function(e,t,n,r,o){const i=e[t];return i.attrs[i.attrIndex("alt")][1]=o.renderInlineAsText(i.children,n,r),o.renderToken(e,t,n)};lr.hardbreak=function(e,t,n){return n.xhtmlOut?`<br />
|
|
12
|
+
`:`<br>
|
|
13
|
+
`};lr.softbreak=function(e,t,n){return n.breaks?n.xhtmlOut?`<br />
|
|
14
|
+
`:`<br>
|
|
15
|
+
`:`
|
|
16
|
+
`};lr.text=function(e,t){return Vr(e[t].content)};lr.html_block=function(e,t){return e[t].content};lr.html_inline=function(e,t){return e[t].content};function ai(){this.rules=Ga({},lr)}ai.prototype.renderAttrs=function(t){let n,r,o;if(!t.attrs)return"";for(o="",n=0,r=t.attrs.length;n<r;n++)o+=" "+Vr(t.attrs[n][0])+'="'+Vr(t.attrs[n][1])+'"';return o};ai.prototype.renderToken=function(t,n,r){const o=t[n];let i="";if(o.hidden)return"";o.block&&o.nesting!==-1&&n&&t[n-1].hidden&&(i+=`
|
|
17
|
+
`),i+=(o.nesting===-1?"</":"<")+o.tag,i+=this.renderAttrs(o),o.nesting===0&&r.xhtmlOut&&(i+=" /");let s=!1;if(o.block&&(s=!0,o.nesting===1&&n+1<t.length)){const a=t[n+1];(a.type==="inline"||a.hidden||a.nesting===-1&&a.tag===o.tag)&&(s=!1)}return i+=s?`>
|
|
18
|
+
`:">",i};ai.prototype.renderInline=function(e,t,n){let r="";const o=this.rules;for(let i=0,s=e.length;i<s;i++){const a=e[i].type;typeof o[a]<"u"?r+=o[a](e,i,t,n,this):r+=this.renderToken(e,i,t)}return r};ai.prototype.renderInlineAsText=function(e,t,n){let r="";for(let o=0,i=e.length;o<i;o++)switch(e[o].type){case"text":r+=e[o].content;break;case"image":r+=this.renderInlineAsText(e[o].children,t,n);break;case"html_inline":case"html_block":r+=e[o].content;break;case"softbreak":case"hardbreak":r+=`
|
|
19
|
+
`;break}return r};ai.prototype.render=function(e,t,n){let r="";const o=this.rules;for(let i=0,s=e.length;i<s;i++){const a=e[i].type;a==="inline"?r+=this.renderInline(e[i].children,t,n):typeof o[a]<"u"?r+=o[a](e,i,t,n,this):r+=this.renderToken(e,i,t,n)}return r};function an(){this.__rules__=[],this.__cache__=null}an.prototype.__find__=function(e){for(let t=0;t<this.__rules__.length;t++)if(this.__rules__[t].name===e)return t;return-1};an.prototype.__compile__=function(){const e=this,t=[""];e.__rules__.forEach(function(n){n.enabled&&n.alt.forEach(function(r){t.indexOf(r)<0&&t.push(r)})}),e.__cache__={},t.forEach(function(n){e.__cache__[n]=[],e.__rules__.forEach(function(r){r.enabled&&(n&&r.alt.indexOf(n)<0||e.__cache__[n].push(r.fn))})})};an.prototype.at=function(e,t,n){const r=this.__find__(e),o=n||{};if(r===-1)throw new Error("Parser rule not found: "+e);this.__rules__[r].fn=t,this.__rules__[r].alt=o.alt||[],this.__cache__=null};an.prototype.before=function(e,t,n,r){const o=this.__find__(e),i=r||{};if(o===-1)throw new Error("Parser rule not found: "+e);this.__rules__.splice(o,0,{name:t,enabled:!0,fn:n,alt:i.alt||[]}),this.__cache__=null};an.prototype.after=function(e,t,n,r){const o=this.__find__(e),i=r||{};if(o===-1)throw new Error("Parser rule not found: "+e);this.__rules__.splice(o+1,0,{name:t,enabled:!0,fn:n,alt:i.alt||[]}),this.__cache__=null};an.prototype.push=function(e,t,n){const r=n||{};this.__rules__.push({name:e,enabled:!0,fn:t,alt:r.alt||[]}),this.__cache__=null};an.prototype.enable=function(e,t){Array.isArray(e)||(e=[e]);const n=[];return e.forEach(function(r){const o=this.__find__(r);if(o<0){if(t)return;throw new Error("Rules manager: invalid rule name "+r)}this.__rules__[o].enabled=!0,n.push(r)},this),this.__cache__=null,n};an.prototype.enableOnly=function(e,t){Array.isArray(e)||(e=[e]),this.__rules__.forEach(function(n){n.enabled=!1}),this.enable(e,t)};an.prototype.disable=function(e,t){Array.isArray(e)||(e=[e]);const n=[];return e.forEach(function(r){const o=this.__find__(r);if(o<0){if(t)return;throw new Error("Rules manager: invalid rule name "+r)}this.__rules__[o].enabled=!1,n.push(r)},this),this.__cache__=null,n};an.prototype.getRules=function(e){return this.__cache__===null&&this.__compile__(),this.__cache__[e]||[]};function Kn(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}Kn.prototype.attrIndex=function(t){if(!this.attrs)return-1;const n=this.attrs;for(let r=0,o=n.length;r<o;r++)if(n[r][0]===t)return r;return-1};Kn.prototype.attrPush=function(t){this.attrs?this.attrs.push(t):this.attrs=[t]};Kn.prototype.attrSet=function(t,n){const r=this.attrIndex(t),o=[t,n];r<0?this.attrPush(o):this.attrs[r]=o};Kn.prototype.attrGet=function(t){const n=this.attrIndex(t);let r=null;return n>=0&&(r=this.attrs[n][1]),r};Kn.prototype.attrJoin=function(t,n){const r=this.attrIndex(t);r<0?this.attrPush([t,n]):this.attrs[r][1]=this.attrs[r][1]+" "+n};function ly(e,t,n){this.src=e,this.env=n,this.tokens=[],this.inlineMode=!1,this.md=t}ly.prototype.Token=Kn;const ND=/\r\n?|\n/g,MD=/\0/g;function PD(e){let t;t=e.src.replace(ND,`
|
|
20
|
+
`),t=t.replace(MD,"�"),e.src=t}function LD(e){let t;e.inlineMode?(t=new e.Token("inline","",0),t.content=e.src,t.map=[0,1],t.children=[],e.tokens.push(t)):e.md.block.parse(e.src,e.md,e.env,e.tokens)}function $D(e){const t=e.tokens;for(let n=0,r=t.length;n<r;n++){const o=t[n];o.type==="inline"&&e.md.inline.parse(o.content,e.md,e.env,o.children)}}function FD(e){return/^<a[>\s]/i.test(e)}function BD(e){return/^<\/a\s*>/i.test(e)}function zD(e){const t=e.tokens;if(e.md.options.linkify)for(let n=0,r=t.length;n<r;n++){if(t[n].type!=="inline"||!e.md.linkify.pretest(t[n].content))continue;let o=t[n].children,i=0;for(let s=o.length-1;s>=0;s--){const a=o[s];if(a.type==="link_close"){for(s--;o[s].level!==a.level&&o[s].type!=="link_open";)s--;continue}if(a.type==="html_inline"&&(FD(a.content)&&i>0&&i--,BD(a.content)&&i++),!(i>0)&&a.type==="text"&&e.md.linkify.test(a.content)){const u=a.content;let c=e.md.linkify.match(u);const l=[];let d=a.level,g=0;c.length>0&&c[0].index===0&&s>0&&o[s-1].type==="text_special"&&(c=c.slice(1));for(let p=0;p<c.length;p++){const h=c[p].url,m=e.md.normalizeLink(h);if(!e.md.validateLink(m))continue;let y=c[p].text;c[p].schema?c[p].schema==="mailto:"&&!/^mailto:/i.test(y)?y=e.md.normalizeLinkText("mailto:"+y).replace(/^mailto:/,""):y=e.md.normalizeLinkText(y):y=e.md.normalizeLinkText("http://"+y).replace(/^http:\/\//,"");const v=c[p].index;if(v>g){const C=new e.Token("text","",0);C.content=u.slice(g,v),C.level=d,l.push(C)}const b=new e.Token("link_open","a",1);b.attrs=[["href",m]],b.level=d++,b.markup="linkify",b.info="auto",l.push(b);const w=new e.Token("text","",0);w.content=y,w.level=d,l.push(w);const E=new e.Token("link_close","a",-1);E.level=--d,E.markup="linkify",E.info="auto",l.push(E),g=c[p].lastIndex}if(g<u.length){const p=new e.Token("text","",0);p.content=u.slice(g),p.level=d,l.push(p)}t[n].children=o=ay(o,s,l)}}}}const dy=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/,UD=/\((c|tm|r)\)/i,KD=/\((c|tm|r)\)/ig,jD={c:"©",r:"®",tm:"™"};function qD(e,t){return jD[t.toLowerCase()]}function HD(e){let t=0;for(let n=e.length-1;n>=0;n--){const r=e[n];r.type==="text"&&!t&&(r.content=r.content.replace(KD,qD)),r.type==="link_open"&&r.info==="auto"&&t--,r.type==="link_close"&&r.info==="auto"&&t++}}function GD(e){let t=0;for(let n=e.length-1;n>=0;n--){const r=e[n];r.type==="text"&&!t&&dy.test(r.content)&&(r.content=r.content.replace(/\+-/g,"±").replace(/\.{2,}/g,"…").replace(/([?!])…/g,"$1..").replace(/([?!]){4,}/g,"$1$1$1").replace(/,{2,}/g,",").replace(/(^|[^-])---(?=[^-]|$)/mg,"$1—").replace(/(^|\s)--(?=\s|$)/mg,"$1–").replace(/(^|[^-\s])--(?=[^-\s]|$)/mg,"$1–")),r.type==="link_open"&&r.info==="auto"&&t--,r.type==="link_close"&&r.info==="auto"&&t++}}function VD(e){let t;if(e.md.options.typographer)for(t=e.tokens.length-1;t>=0;t--)e.tokens[t].type==="inline"&&(UD.test(e.tokens[t].content)&&HD(e.tokens[t].children),dy.test(e.tokens[t].content)&&GD(e.tokens[t].children))}const WD=/['"]/,Fg=/['"]/g,Bg="’";function Ds(e,t,n,r){e[t]||(e[t]=[]),e[t].push({pos:n,ch:r})}function YD(e,t){let n="",r=0;t.sort((o,i)=>o.pos-i.pos);for(let o=0;o<t.length;o++){const i=t[o];n+=e.slice(r,i.pos)+i.ch,r=i.pos+1}return n+e.slice(r)}function ZD(e,t){let n;const r=[],o={};for(let i=0;i<e.length;i++){const s=e[i],a=e[i].level;for(n=r.length-1;n>=0&&!(r[n].level<=a);n--);if(r.length=n+1,s.type!=="text")continue;const u=s.content;let c=0;const l=u.length;e:for(;c<l;){Fg.lastIndex=c;const d=Fg.exec(u);if(!d)break;let g=!0,p=!0;c=d.index+1;const h=d[0]==="'";let m=32;if(d.index-1>=0)m=u.charCodeAt(d.index-1);else for(n=i-1;n>=0&&!(e[n].type==="softbreak"||e[n].type==="hardbreak");n--)if(e[n].content){m=e[n].content.charCodeAt(e[n].content.length-1);break}let y=32;if(c<l)y=u.charCodeAt(c);else for(n=i+1;n<e.length&&!(e[n].type==="softbreak"||e[n].type==="hardbreak");n++)if(e[n].content){y=e[n].content.charCodeAt(0);break}const v=qi(m)||ji(m),b=qi(y)||ji(y),w=Ki(m),E=Ki(y);if(E?g=!1:b&&(w||v||(g=!1)),w?p=!1:v&&(E||b||(p=!1)),y===34&&d[0]==='"'&&m>=48&&m<=57&&(p=g=!1),g&&p&&(g=v,p=b),!g&&!p){h&&Ds(o,i,d.index,Bg);continue}if(p)for(n=r.length-1;n>=0;n--){let C=r[n];if(r[n].level<a)break;if(C.single===h&&r[n].level===a){C=r[n];let k,T;h?(k=t.md.options.quotes[2],T=t.md.options.quotes[3]):(k=t.md.options.quotes[0],T=t.md.options.quotes[1]),Ds(o,i,d.index,T),Ds(o,C.token,C.pos,k),r.length=n;continue e}}g?r.push({token:i,pos:d.index,single:h,level:a}):p&&h&&Ds(o,i,d.index,Bg)}}Object.keys(o).forEach(function(i){e[i].content=YD(e[i].content,o[i])})}function XD(e){if(e.md.options.typographer)for(let t=e.tokens.length-1;t>=0;t--)e.tokens[t].type!=="inline"||!WD.test(e.tokens[t].content)||ZD(e.tokens[t].children,e)}function JD(e){let t,n;const r=e.tokens,o=r.length;for(let i=0;i<o;i++){if(r[i].type!=="inline")continue;const s=r[i].children,a=s.length;for(t=0;t<a;t++)s[t].type==="text_special"&&(s[t].type="text");for(t=n=0;t<a;t++)s[t].type==="text"&&t+1<a&&s[t+1].type==="text"?s[t+1].content=s[t].content+s[t+1].content:(t!==n&&(s[n]=s[t]),n++);t!==n&&(s.length=n)}}const wu=[["normalize",PD],["block",LD],["inline",$D],["linkify",zD],["replacements",VD],["smartquotes",XD],["text_join",JD]];function kd(){this.ruler=new an;for(let e=0;e<wu.length;e++)this.ruler.push(wu[e][0],wu[e][1])}kd.prototype.process=function(e){const t=this.ruler.getRules("");for(let n=0,r=t.length;n<r;n++)t[n](e)};kd.prototype.State=ly;function dr(e,t,n,r){this.src=e,this.md=t,this.env=n,this.tokens=r,this.bMarks=[],this.eMarks=[],this.tShift=[],this.sCount=[],this.bsCount=[],this.blkIndent=0,this.line=0,this.lineMax=0,this.tight=!1,this.ddIndent=-1,this.listIndent=-1,this.parentType="root",this.level=0;const o=this.src;for(let i=0,s=0,a=0,u=0,c=o.length,l=!1;s<c;s++){const d=o.charCodeAt(s);if(!l)if(vt(d)){a++,d===9?u+=4-u%4:u++;continue}else l=!0;(d===10||s===c-1)&&(d!==10&&s++,this.bMarks.push(i),this.eMarks.push(s),this.tShift.push(a),this.sCount.push(u),this.bsCount.push(0),l=!1,a=0,u=0,i=s+1)}this.bMarks.push(o.length),this.eMarks.push(o.length),this.tShift.push(0),this.sCount.push(0),this.bsCount.push(0),this.lineMax=this.bMarks.length-1}dr.prototype.push=function(e,t,n){const r=new Kn(e,t,n);return r.block=!0,n<0&&this.level--,r.level=this.level,n>0&&this.level++,this.tokens.push(r),r};dr.prototype.isEmpty=function(t){return this.bMarks[t]+this.tShift[t]>=this.eMarks[t]};dr.prototype.skipEmptyLines=function(t){for(let n=this.lineMax;t<n&&!(this.bMarks[t]+this.tShift[t]<this.eMarks[t]);t++);return t};dr.prototype.skipSpaces=function(t){for(let n=this.src.length;t<n;t++){const r=this.src.charCodeAt(t);if(!vt(r))break}return t};dr.prototype.skipSpacesBack=function(t,n){if(t<=n)return t;for(;t>n;)if(!vt(this.src.charCodeAt(--t)))return t+1;return t};dr.prototype.skipChars=function(t,n){for(let r=this.src.length;t<r&&this.src.charCodeAt(t)===n;t++);return t};dr.prototype.skipCharsBack=function(t,n,r){if(t<=r)return t;for(;t>r;)if(n!==this.src.charCodeAt(--t))return t+1;return t};dr.prototype.getLines=function(t,n,r,o){if(t>=n)return"";const i=new Array(n-t);for(let s=0,a=t;a<n;a++,s++){let u=0;const c=this.bMarks[a];let l=c,d;for(a+1<n||o?d=this.eMarks[a]+1:d=this.eMarks[a];l<d&&u<r;){const g=this.src.charCodeAt(l);if(vt(g))g===9?u+=4-(u+this.bsCount[a])%4:u++;else if(l-c<this.tShift[a])u++;else break;l++}u>r?i[s]=new Array(u-r+1).join(" ")+this.src.slice(l,d):i[s]=this.src.slice(l,d)}return i.join("")};dr.prototype.Token=Kn;const QD=65536;function xu(e,t){const n=e.bMarks[t]+e.tShift[t],r=e.eMarks[t];return e.src.slice(n,r)}function zg(e){const t=[],n=e.length;let r=0,o=e.charCodeAt(r),i=!1,s=0,a="";for(;r<n;)o===124&&(i?(a+=e.substring(s,r-1),s=r):(t.push(a+e.substring(s,r)),a="",s=r+1)),i=o===92,r++,o=e.charCodeAt(r);return t.push(a+e.substring(s)),t}function eI(e,t,n,r){if(t+2>n)return!1;let o=t+1;if(e.sCount[o]<e.blkIndent||e.sCount[o]-e.blkIndent>=4)return!1;let i=e.bMarks[o]+e.tShift[o];if(i>=e.eMarks[o])return!1;const s=e.src.charCodeAt(i++);if(s!==124&&s!==45&&s!==58||i>=e.eMarks[o])return!1;const a=e.src.charCodeAt(i++);if(a!==124&&a!==45&&a!==58&&!vt(a)||s===45&&vt(a))return!1;for(;i<e.eMarks[o];){const E=e.src.charCodeAt(i);if(E!==124&&E!==45&&E!==58&&!vt(E))return!1;i++}let u=xu(e,t+1),c=u.split("|");const l=[];for(let E=0;E<c.length;E++){const C=c[E].trim();if(!C){if(E===0||E===c.length-1)continue;return!1}if(!/^:?-+:?$/.test(C))return!1;C.charCodeAt(C.length-1)===58?l.push(C.charCodeAt(0)===58?"center":"right"):C.charCodeAt(0)===58?l.push("left"):l.push("")}if(u=xu(e,t).trim(),u.indexOf("|")===-1||e.sCount[t]-e.blkIndent>=4)return!1;c=zg(u),c.length&&c[0]===""&&c.shift(),c.length&&c[c.length-1]===""&&c.pop();const d=c.length;if(d===0||d!==l.length)return!1;if(r)return!0;const g=e.parentType;e.parentType="table";const p=e.md.block.ruler.getRules("blockquote"),h=e.push("table_open","table",1),m=[t,0];h.map=m;const y=e.push("thead_open","thead",1);y.map=[t,t+1];const v=e.push("tr_open","tr",1);v.map=[t,t+1];for(let E=0;E<c.length;E++){const C=e.push("th_open","th",1);l[E]&&(C.attrs=[["style","text-align:"+l[E]]]);const k=e.push("inline","",0);k.content=c[E].trim(),k.children=[],e.push("th_close","th",-1)}e.push("tr_close","tr",-1),e.push("thead_close","thead",-1);let b,w=0;for(o=t+2;o<n&&!(e.sCount[o]<e.blkIndent);o++){let E=!1;for(let k=0,T=p.length;k<T;k++)if(p[k](e,o,n,!0)){E=!0;break}if(E||(u=xu(e,o).trim(),!u)||e.sCount[o]-e.blkIndent>=4||(c=zg(u),c.length&&c[0]===""&&c.shift(),c.length&&c[c.length-1]===""&&c.pop(),w+=d-c.length,w>QD))break;if(o===t+2){const k=e.push("tbody_open","tbody",1);k.map=b=[t+2,0]}const C=e.push("tr_open","tr",1);C.map=[o,o+1];for(let k=0;k<d;k++){const T=e.push("td_open","td",1);l[k]&&(T.attrs=[["style","text-align:"+l[k]]]);const S=e.push("inline","",0);S.content=c[k]?c[k].trim():"",S.children=[],e.push("td_close","td",-1)}e.push("tr_close","tr",-1)}return b&&(e.push("tbody_close","tbody",-1),b[1]=o),e.push("table_close","table",-1),m[1]=o,e.parentType=g,e.line=o,!0}function tI(e,t,n){if(e.sCount[t]-e.blkIndent<4)return!1;let r=t+1,o=r;for(;r<n;){if(e.isEmpty(r)){r++;continue}if(e.sCount[r]-e.blkIndent>=4){r++,o=r;continue}break}e.line=o;const i=e.push("code_block","code",0);return i.content=e.getLines(t,o,4+e.blkIndent,!1)+`
|
|
21
|
+
`,i.map=[t,e.line],!0}function nI(e,t,n,r){let o=e.bMarks[t]+e.tShift[t],i=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||o+3>i)return!1;const s=e.src.charCodeAt(o);if(s!==126&&s!==96)return!1;let a=o;o=e.skipChars(o,s);let u=o-a;if(u<3)return!1;const c=e.src.slice(a,o),l=e.src.slice(o,i);if(s===96&&l.indexOf(String.fromCharCode(s))>=0)return!1;if(r)return!0;let d=t,g=!1;for(;d++,!(d>=n||(o=a=e.bMarks[d]+e.tShift[d],i=e.eMarks[d],o<i&&e.sCount[d]<e.blkIndent));)if(e.src.charCodeAt(o)===s&&!(e.sCount[d]-e.blkIndent>=4)&&(o=e.skipChars(o,s),!(o-a<u)&&(o=e.skipSpaces(o),!(o<i)))){g=!0;break}u=e.sCount[t],e.line=d+(g?1:0);const p=e.push("fence","code",0);return p.info=l,p.content=e.getLines(t+1,d,u,!0),p.markup=c,p.map=[t,e.line],!0}function rI(e,t,n,r){let o=e.bMarks[t]+e.tShift[t],i=e.eMarks[t];const s=e.lineMax;if(e.sCount[t]-e.blkIndent>=4||e.src.charCodeAt(o)!==62)return!1;if(r)return!0;const a=[],u=[],c=[],l=[],d=e.md.block.ruler.getRules("blockquote"),g=e.parentType;e.parentType="blockquote";let p=!1,h;for(h=t;h<n;h++){const w=e.sCount[h]<e.blkIndent;if(o=e.bMarks[h]+e.tShift[h],i=e.eMarks[h],o>=i)break;if(e.src.charCodeAt(o++)===62&&!w){let C=e.sCount[h]+1,k,T;e.src.charCodeAt(o)===32?(o++,C++,T=!1,k=!0):e.src.charCodeAt(o)===9?(k=!0,(e.bsCount[h]+C)%4===3?(o++,C++,T=!1):T=!0):k=!1;let S=C;for(a.push(e.bMarks[h]),e.bMarks[h]=o;o<i;){const A=e.src.charCodeAt(o);if(vt(A))A===9?S+=4-(S+e.bsCount[h]+(T?1:0))%4:S++;else break;o++}p=o>=i,u.push(e.bsCount[h]),e.bsCount[h]=e.sCount[h]+1+(k?1:0),c.push(e.sCount[h]),e.sCount[h]=S-C,l.push(e.tShift[h]),e.tShift[h]=o-e.bMarks[h];continue}if(p)break;let E=!1;for(let C=0,k=d.length;C<k;C++)if(d[C](e,h,n,!0)){E=!0;break}if(E){e.lineMax=h,e.blkIndent!==0&&(a.push(e.bMarks[h]),u.push(e.bsCount[h]),l.push(e.tShift[h]),c.push(e.sCount[h]),e.sCount[h]-=e.blkIndent);break}a.push(e.bMarks[h]),u.push(e.bsCount[h]),l.push(e.tShift[h]),c.push(e.sCount[h]),e.sCount[h]=-1}const m=e.blkIndent;e.blkIndent=0;const y=e.push("blockquote_open","blockquote",1);y.markup=">";const v=[t,0];y.map=v,e.md.block.tokenize(e,t,h);const b=e.push("blockquote_close","blockquote",-1);b.markup=">",e.lineMax=s,e.parentType=g,v[1]=e.line;for(let w=0;w<l.length;w++)e.bMarks[w+t]=a[w],e.tShift[w+t]=l[w],e.sCount[w+t]=c[w],e.bsCount[w+t]=u[w];return e.blkIndent=m,!0}function oI(e,t,n,r){const o=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;let i=e.bMarks[t]+e.tShift[t];const s=e.src.charCodeAt(i++);if(s!==42&&s!==45&&s!==95)return!1;let a=1;for(;i<o;){const c=e.src.charCodeAt(i++);if(c!==s&&!vt(c))return!1;c===s&&a++}if(a<3)return!1;if(r)return!0;e.line=t+1;const u=e.push("hr","hr",0);return u.map=[t,e.line],u.markup=Array(a+1).join(String.fromCharCode(s)),!0}function Ug(e,t){const n=e.eMarks[t];let r=e.bMarks[t]+e.tShift[t];const o=e.src.charCodeAt(r++);if(o!==42&&o!==45&&o!==43)return-1;if(r<n){const i=e.src.charCodeAt(r);if(!vt(i))return-1}return r}function Kg(e,t){const n=e.bMarks[t]+e.tShift[t],r=e.eMarks[t];let o=n;if(o+1>=r)return-1;let i=e.src.charCodeAt(o++);if(i<48||i>57)return-1;for(;;){if(o>=r)return-1;if(i=e.src.charCodeAt(o++),i>=48&&i<=57){if(o-n>=10)return-1;continue}if(i===41||i===46)break;return-1}return o<r&&(i=e.src.charCodeAt(o),!vt(i))?-1:o}function iI(e,t){const n=e.level+2;for(let r=t+2,o=e.tokens.length-2;r<o;r++)e.tokens[r].level===n&&e.tokens[r].type==="paragraph_open"&&(e.tokens[r+2].hidden=!0,e.tokens[r].hidden=!0,r+=2)}function sI(e,t,n,r){let o,i,s,a,u=t,c=!0;if(e.sCount[u]-e.blkIndent>=4||e.listIndent>=0&&e.sCount[u]-e.listIndent>=4&&e.sCount[u]<e.blkIndent)return!1;let l=!1;r&&e.parentType==="paragraph"&&e.sCount[u]>=e.blkIndent&&(l=!0);let d,g,p;if((p=Kg(e,u))>=0){if(d=!0,s=e.bMarks[u]+e.tShift[u],g=Number(e.src.slice(s,p-1)),l&&g!==1)return!1}else if((p=Ug(e,u))>=0)d=!1;else return!1;if(l&&e.skipSpaces(p)>=e.eMarks[u])return!1;if(r)return!0;const h=e.src.charCodeAt(p-1),m=e.tokens.length;d?(a=e.push("ordered_list_open","ol",1),g!==1&&(a.attrs=[["start",g]])):a=e.push("bullet_list_open","ul",1);const y=[u,0];a.map=y,a.markup=String.fromCharCode(h);let v=!1;const b=e.md.block.ruler.getRules("list"),w=e.parentType;for(e.parentType="list";u<n;){i=p,o=e.eMarks[u];const E=e.sCount[u]+p-(e.bMarks[u]+e.tShift[u]);let C=E;for(;i<o;){const B=e.src.charCodeAt(i);if(B===9)C+=4-(C+e.bsCount[u])%4;else if(B===32)C++;else break;i++}const k=i;let T;k>=o?T=1:T=C-E,T>4&&(T=1);const S=E+T;a=e.push("list_item_open","li",1),a.markup=String.fromCharCode(h);const A=[u,0];a.map=A,d&&(a.info=e.src.slice(s,p-1));const F=e.tight,O=e.tShift[u],P=e.sCount[u],L=e.listIndent;if(e.listIndent=e.blkIndent,e.blkIndent=S,e.tight=!0,e.tShift[u]=k-e.bMarks[u],e.sCount[u]=C,k>=o&&e.isEmpty(u+1)?e.line=Math.min(e.line+2,n):e.md.block.tokenize(e,u,n,!0),(!e.tight||v)&&(c=!1),v=e.line-u>1&&e.isEmpty(e.line-1),e.blkIndent=e.listIndent,e.listIndent=L,e.tShift[u]=O,e.sCount[u]=P,e.tight=F,a=e.push("list_item_close","li",-1),a.markup=String.fromCharCode(h),u=e.line,A[1]=u,u>=n||e.sCount[u]<e.blkIndent||e.sCount[u]-e.blkIndent>=4)break;let D=!1;for(let B=0,N=b.length;B<N;B++)if(b[B](e,u,n,!0)){D=!0;break}if(D)break;if(d){if(p=Kg(e,u),p<0)break;s=e.bMarks[u]+e.tShift[u]}else if(p=Ug(e,u),p<0)break;if(h!==e.src.charCodeAt(p-1))break}return d?a=e.push("ordered_list_close","ol",-1):a=e.push("bullet_list_close","ul",-1),a.markup=String.fromCharCode(h),y[1]=u,e.line=u,e.parentType=w,c&&iI(e,m),!0}function aI(e,t,n,r){let o=e.bMarks[t]+e.tShift[t],i=e.eMarks[t],s=t+1;if(e.sCount[t]-e.blkIndent>=4||e.src.charCodeAt(o)!==91)return!1;function a(b){const w=e.lineMax;if(b>=w||e.isEmpty(b))return null;let E=!1;if(e.sCount[b]-e.blkIndent>3&&(E=!0),e.sCount[b]<0&&(E=!0),!E){const T=e.md.block.ruler.getRules("reference"),S=e.parentType;e.parentType="reference";let A=!1;for(let F=0,O=T.length;F<O;F++)if(T[F](e,b,w,!0)){A=!0;break}if(e.parentType=S,A)return null}const C=e.bMarks[b]+e.tShift[b],k=e.eMarks[b];return e.src.slice(C,k+1)}let u=e.src.slice(o,i+1);i=u.length;let c=-1;for(o=1;o<i;o++){const b=u.charCodeAt(o);if(b===91)return!1;if(b===93){c=o;break}else if(b===10){const w=a(s);w!==null&&(u+=w,i=u.length,s++)}else if(b===92&&(o++,o<i&&u.charCodeAt(o)===10)){const w=a(s);w!==null&&(u+=w,i=u.length,s++)}}if(c<0||u.charCodeAt(c+1)!==58)return!1;for(o=c+2;o<i;o++){const b=u.charCodeAt(o);if(b===10){const w=a(s);w!==null&&(u+=w,i=u.length,s++)}else if(!vt(b))break}const l=e.md.helpers.parseLinkDestination(u,o,i);if(!l.ok)return!1;const d=e.md.normalizeLink(l.str);if(!e.md.validateLink(d))return!1;o=l.pos;const g=o,p=s,h=o;for(;o<i;o++){const b=u.charCodeAt(o);if(b===10){const w=a(s);w!==null&&(u+=w,i=u.length,s++)}else if(!vt(b))break}let m=e.md.helpers.parseLinkTitle(u,o,i);for(;m.can_continue;){const b=a(s);if(b===null)break;u+=b,o=i,i=u.length,s++,m=e.md.helpers.parseLinkTitle(u,o,i,m)}let y;for(o<i&&h!==o&&m.ok?(y=m.str,o=m.pos):(y="",o=g,s=p);o<i;){const b=u.charCodeAt(o);if(!vt(b))break;o++}if(o<i&&u.charCodeAt(o)!==10&&y)for(y="",o=g,s=p;o<i;){const b=u.charCodeAt(o);if(!vt(b))break;o++}if(o<i&&u.charCodeAt(o)!==10)return!1;const v=Va(u.slice(1,c));return v?(r||(typeof e.env.references>"u"&&(e.env.references={}),typeof e.env.references[v]>"u"&&(e.env.references[v]={title:y,href:d}),e.line=s),!0):!1}const uI=["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"],cI="[a-zA-Z_:][a-zA-Z0-9:._-]*",lI="[^\"'=<>`\\x00-\\x20]+",dI="'[^']*'",fI='"[^"]*"',gI="(?:"+lI+"|"+dI+"|"+fI+")",pI="(?:\\s+"+cI+"(?:\\s*=\\s*"+gI+")?)",fy="<[A-Za-z][A-Za-z0-9\\-]*"+pI+"*\\s*\\/?>",gy="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",hI="<!---?>|<!--(?:[^-]|-[^-]|--[^>])*-->",mI="<[?][\\s\\S]*?[?]>",bI="<![A-Za-z][^>]*>",yI="<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",vI=new RegExp("^(?:"+fy+"|"+gy+"|"+hI+"|"+mI+"|"+bI+"|"+yI+")"),wI=new RegExp("^(?:"+fy+"|"+gy+")"),ao=[[/^<(script|pre|style|textarea)(?=(\s|>|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^<!--/,/-->/,!0],[/^<\?/,/\?>/,!0],[/^<![A-Z]/,/>/,!0],[/^<!\[CDATA\[/,/\]\]>/,!0],[new RegExp("^</?("+uI.join("|")+")(?=(\\s|/?>|$))","i"),/^$/,!0],[new RegExp(wI.source+"\\s*$"),/^$/,!1]];function xI(e,t,n,r){let o=e.bMarks[t]+e.tShift[t],i=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||!e.md.options.html||e.src.charCodeAt(o)!==60)return!1;let s=e.src.slice(o,i),a=0;for(;a<ao.length&&!ao[a][0].test(s);a++);if(a===ao.length)return!1;if(r)return ao[a][2];let u=t+1;const c=ao[a][1].test("");if(!ao[a][1].test(s)){for(;u<n&&!(e.sCount[u]<e.blkIndent&&(c||!e.isEmpty(u)));u++)if(o=e.bMarks[u]+e.tShift[u],i=e.eMarks[u],s=e.src.slice(o,i),ao[a][1].test(s)){s.length!==0&&u++;break}}e.line=u;const l=e.push("html_block","",0);return l.map=[t,u],l.content=e.getLines(t,u,e.blkIndent,!0),!0}function _I(e,t,n,r){let o=e.bMarks[t]+e.tShift[t],i=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;let s=e.src.charCodeAt(o);if(s!==35||o>=i)return!1;let a=1;for(s=e.src.charCodeAt(++o);s===35&&o<i&&a<=6;)a++,s=e.src.charCodeAt(++o);if(a>6||o<i&&!vt(s))return!1;if(r)return!0;i=e.skipSpacesBack(i,o);const u=e.skipCharsBack(i,35,o);u>o&&vt(e.src.charCodeAt(u-1))&&(i=u),e.line=t+1;const c=e.push("heading_open","h"+String(a),1);c.markup="########".slice(0,a),c.map=[t,e.line];const l=e.push("inline","",0);l.content=Wa(e.src.slice(o,i)),l.map=[t,e.line],l.children=[];const d=e.push("heading_close","h"+String(a),-1);return d.markup="########".slice(0,a),!0}function EI(e,t,n){const r=e.md.block.ruler.getRules("paragraph");if(e.sCount[t]-e.blkIndent>=4)return!1;const o=e.parentType;e.parentType="paragraph";let i=0,s,a=t+1;for(;a<n&&!e.isEmpty(a);a++){if(e.sCount[a]-e.blkIndent>3)continue;if(e.sCount[a]>=e.blkIndent){let p=e.bMarks[a]+e.tShift[a];const h=e.eMarks[a];if(p<h&&(s=e.src.charCodeAt(p),(s===45||s===61)&&(p=e.skipChars(p,s),p=e.skipSpaces(p),p>=h))){i=s===61?1:2;break}}if(e.sCount[a]<0)continue;let g=!1;for(let p=0,h=r.length;p<h;p++)if(r[p](e,a,n,!0)){g=!0;break}if(g)break}if(!i)return e.parentType=o,!1;const u=Wa(e.getLines(t,a,e.blkIndent,!1));e.line=a+1;const c=e.push("heading_open","h"+String(i),1);c.markup=String.fromCharCode(s),c.map=[t,e.line];const l=e.push("inline","",0);l.content=u,l.map=[t,e.line-1],l.children=[];const d=e.push("heading_close","h"+String(i),-1);return d.markup=String.fromCharCode(s),e.parentType=o,!0}function CI(e,t,n){const r=e.md.block.ruler.getRules("paragraph"),o=e.parentType;let i=t+1;for(e.parentType="paragraph";i<n&&!e.isEmpty(i);i++){if(e.sCount[i]-e.blkIndent>3||e.sCount[i]<0)continue;let c=!1;for(let l=0,d=r.length;l<d;l++)if(r[l](e,i,n,!0)){c=!0;break}if(c)break}const s=Wa(e.getLines(t,i,e.blkIndent,!1));e.line=i;const a=e.push("paragraph_open","p",1);a.map=[t,e.line];const u=e.push("inline","",0);return u.content=s,u.map=[t,e.line],u.children=[],e.push("paragraph_close","p",-1),e.parentType=o,!0}const Is=[["table",eI,["paragraph","reference"]],["code",tI],["fence",nI,["paragraph","reference","blockquote","list"]],["blockquote",rI,["paragraph","reference","blockquote","list"]],["hr",oI,["paragraph","reference","blockquote","list"]],["list",sI,["paragraph","reference","blockquote"]],["reference",aI],["html_block",xI,["paragraph","reference","blockquote"]],["heading",_I,["paragraph","reference","blockquote"]],["lheading",EI],["paragraph",CI]];function Ya(){this.ruler=new an;for(let e=0;e<Is.length;e++)this.ruler.push(Is[e][0],Is[e][1],{alt:(Is[e][2]||[]).slice()})}Ya.prototype.tokenize=function(e,t,n){const r=this.ruler.getRules(""),o=r.length,i=e.md.options.maxNesting;let s=t,a=!1;for(;s<n&&(e.line=s=e.skipEmptyLines(s),!(s>=n||e.sCount[s]<e.blkIndent));){if(e.level>=i){e.line=n;break}const u=e.line;let c=!1;for(let l=0;l<o;l++)if(c=r[l](e,s,n,!1),c){if(u>=e.line)throw new Error("block rule didn't increment state.line");break}if(!c)throw new Error("none of the block rules matched");e.tight=!a,e.isEmpty(e.line-1)&&(a=!0),s=e.line,s<n&&e.isEmpty(s)&&(a=!0,s++,e.line=s)}};Ya.prototype.parse=function(e,t,n,r){if(!e)return;const o=new this.State(e,t,n,r);this.tokenize(o,o.line,o.lineMax)};Ya.prototype.State=dr;function us(e,t,n,r){this.src=e,this.env=n,this.md=t,this.tokens=r,this.tokens_meta=Array(r.length),this.pos=0,this.posMax=this.src.length,this.level=0,this.pending="",this.pendingLevel=0,this.cache={},this.delimiters=[],this._prev_delimiters=[],this.backticks={},this.backticksScanned=!1,this.linkLevel=0}us.prototype.pushPending=function(){const e=new Kn("text","",0);return e.content=this.pending,e.level=this.pendingLevel,this.tokens.push(e),this.pending="",e};us.prototype.push=function(e,t,n){this.pending&&this.pushPending();const r=new Kn(e,t,n);let o=null;return n<0&&(this.level--,this.delimiters=this._prev_delimiters.pop()),r.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(r),this.tokens_meta.push(o),r};us.prototype.scanDelims=function(e,t){const n=this.posMax,r=this.src.charCodeAt(e);let o;if(e===0)o=32;else if(e===1)o=this.src.charCodeAt(0),(o&63488)===55296&&(o=65533);else if(o=this.src.charCodeAt(e-1),(o&64512)===56320){const y=this.src.charCodeAt(e-2);o=(y&64512)===55296?65536+(y-55296<<10)+(o-56320):65533}else(o&64512)===55296&&(o=65533);let i=e;for(;i<n&&this.src.charCodeAt(i)===r;)i++;const s=i-e;let a=i<n?this.src.charCodeAt(i):32;if((a&64512)===55296){const y=this.src.charCodeAt(i+1);a=(y&64512)===56320?65536+(a-55296<<10)+(y-56320):65533}else(a&64512)===56320&&(a=65533);const u=qi(o)||ji(o),c=qi(a)||ji(a),l=Ki(o),d=Ki(a),g=!d&&(!c||l||u),p=!l&&(!u||d||c);return{can_open:g&&(t||!p||u),can_close:p&&(t||!g||c),length:s}};us.prototype.Token=Kn;function SI(e){switch(e){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!0;default:return!1}}function kI(e,t){let n=e.pos;for(;n<e.posMax&&!SI(e.src.charCodeAt(n));)n++;return n===e.pos?!1:(t||(e.pending+=e.src.slice(e.pos,n)),e.pos=n,!0)}const AI=/(?:^|[^a-z0-9.+-])([a-z][a-z0-9.+-]*)$/i;function TI(e,t){if(!e.md.options.linkify||e.linkLevel>0)return!1;const n=e.pos,r=e.posMax;if(n+3>r||e.src.charCodeAt(n)!==58||e.src.charCodeAt(n+1)!==47||e.src.charCodeAt(n+2)!==47)return!1;const o=e.pending.match(AI);if(!o)return!1;const i=o[1],s=e.md.linkify.matchAtStart(e.src.slice(n-i.length));if(!s)return!1;let a=s.url;if(a.length<=i.length)return!1;let u=a.length;for(;u>0&&a.charCodeAt(u-1)===42;)u--;u!==a.length&&(a=a.slice(0,u));const c=e.md.normalizeLink(a);if(!e.md.validateLink(c))return!1;if(!t){e.pending=e.pending.slice(0,-i.length);const l=e.push("link_open","a",1);l.attrs=[["href",c]],l.markup="linkify",l.info="auto";const d=e.push("text","",0);d.content=e.md.normalizeLinkText(a);const g=e.push("link_close","a",-1);g.markup="linkify",g.info="auto"}return e.pos+=a.length-i.length,!0}function DI(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==10)return!1;const r=e.pending.length-1,o=e.posMax;if(!t)if(r>=0&&e.pending.charCodeAt(r)===32)if(r>=1&&e.pending.charCodeAt(r-1)===32){let i=r-1;for(;i>=1&&e.pending.charCodeAt(i-1)===32;)i--;e.pending=e.pending.slice(0,i),e.push("hardbreak","br",0)}else e.pending=e.pending.slice(0,-1),e.push("softbreak","br",0);else e.push("softbreak","br",0);for(n++;n<o&&vt(e.src.charCodeAt(n));)n++;return e.pos=n,!0}const Ad=[];for(let e=0;e<256;e++)Ad.push(0);"\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-".split("").forEach(function(e){Ad[e.charCodeAt(0)]=1});function II(e,t){let n=e.pos;const r=e.posMax;if(e.src.charCodeAt(n)!==92||(n++,n>=r))return!1;let o=e.src.charCodeAt(n);if(o===10){for(t||e.push("hardbreak","br",0),n++;n<r&&(o=e.src.charCodeAt(n),!!vt(o));)n++;return e.pos=n,!0}let i=e.src[n];if(o>=55296&&o<=56319&&n+1<r){const a=e.src.charCodeAt(n+1);a>=56320&&a<=57343&&(i+=e.src[n+1],n++)}const s="\\"+i;if(!t){const a=e.push("text_special","",0);o<256&&Ad[o]!==0?a.content=i:a.content=s,a.markup=s,a.info="escape"}return e.pos=n+1,!0}function RI(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==96)return!1;const o=n;n++;const i=e.posMax;for(;n<i&&e.src.charCodeAt(n)===96;)n++;const s=e.src.slice(o,n),a=s.length;if(e.backticksScanned&&(e.backticks[a]||0)<=o)return t||(e.pending+=s),e.pos+=a,!0;let u=n,c;for(;(c=e.src.indexOf("`",u))!==-1;){for(u=c+1;u<i&&e.src.charCodeAt(u)===96;)u++;const l=u-c;if(l===a){if(!t){const d=e.push("code_inline","code",0);d.markup=s,d.content=e.src.slice(n,c).replace(/\n/g," ").replace(/^ (.+) $/,"$1")}return e.pos=u,!0}e.backticks[l]=c}return e.backticksScanned=!0,t||(e.pending+=s),e.pos+=a,!0}function OI(e,t){const n=e.pos,r=e.src.charCodeAt(n);if(t||r!==126)return!1;const o=e.scanDelims(e.pos,!0);let i=o.length;const s=String.fromCharCode(r);if(i<2)return!1;let a;i%2&&(a=e.push("text","",0),a.content=s,i--);for(let u=0;u<i;u+=2)a=e.push("text","",0),a.content=s+s,e.delimiters.push({marker:r,length:0,token:e.tokens.length-1,end:-1,open:o.can_open,close:o.can_close});return e.pos+=o.length,!0}function jg(e,t){let n;const r=[],o=t.length;for(let i=0;i<o;i++){const s=t[i];if(s.marker!==126||s.end===-1)continue;const a=t[s.end];n=e.tokens[s.token],n.type="s_open",n.tag="s",n.nesting=1,n.markup="~~",n.content="",n=e.tokens[a.token],n.type="s_close",n.tag="s",n.nesting=-1,n.markup="~~",n.content="",e.tokens[a.token-1].type==="text"&&e.tokens[a.token-1].content==="~"&&r.push(a.token-1)}for(;r.length;){const i=r.pop();let s=i+1;for(;s<e.tokens.length&&e.tokens[s].type==="s_close";)s++;s--,i!==s&&(n=e.tokens[s],e.tokens[s]=e.tokens[i],e.tokens[i]=n)}}function NI(e){const t=e.tokens_meta,n=e.tokens_meta.length;jg(e,e.delimiters);for(let r=0;r<n;r++)t[r]&&t[r].delimiters&&jg(e,t[r].delimiters)}const py={tokenize:OI,postProcess:NI};function MI(e,t){const n=e.pos,r=e.src.charCodeAt(n);if(t||r!==95&&r!==42)return!1;const o=e.scanDelims(e.pos,r===42);for(let i=0;i<o.length;i++){const s=e.push("text","",0);s.content=String.fromCharCode(r),e.delimiters.push({marker:r,length:o.length,token:e.tokens.length-1,end:-1,open:o.can_open,close:o.can_close})}return e.pos+=o.length,!0}function qg(e,t){const n=t.length;for(let r=n-1;r>=0;r--){const o=t[r];if(o.marker!==95&&o.marker!==42||o.end===-1)continue;const i=t[o.end],s=r>0&&t[r-1].end===o.end+1&&t[r-1].marker===o.marker&&t[r-1].token===o.token-1&&t[o.end+1].token===i.token+1,a=String.fromCharCode(o.marker),u=e.tokens[o.token];u.type=s?"strong_open":"em_open",u.tag=s?"strong":"em",u.nesting=1,u.markup=s?a+a:a,u.content="";const c=e.tokens[i.token];c.type=s?"strong_close":"em_close",c.tag=s?"strong":"em",c.nesting=-1,c.markup=s?a+a:a,c.content="",s&&(e.tokens[t[r-1].token].content="",e.tokens[t[o.end+1].token].content="",r--)}}function PI(e){const t=e.tokens_meta,n=e.tokens_meta.length;qg(e,e.delimiters);for(let r=0;r<n;r++)t[r]&&t[r].delimiters&&qg(e,t[r].delimiters)}const hy={tokenize:MI,postProcess:PI};function LI(e,t){let n,r,o,i,s="",a="",u=e.pos,c=!0;if(e.src.charCodeAt(e.pos)!==91)return!1;const l=e.pos,d=e.posMax,g=e.pos+1,p=e.md.helpers.parseLinkLabel(e,e.pos,!0);if(p<0)return!1;let h=p+1;if(h<d&&e.src.charCodeAt(h)===40){for(c=!1,h++;h<d&&(n=e.src.charCodeAt(h),!(!vt(n)&&n!==10));h++);if(h>=d)return!1;if(u=h,o=e.md.helpers.parseLinkDestination(e.src,h,e.posMax),o.ok){for(s=e.md.normalizeLink(o.str),e.md.validateLink(s)?h=o.pos:s="",u=h;h<d&&(n=e.src.charCodeAt(h),!(!vt(n)&&n!==10));h++);if(o=e.md.helpers.parseLinkTitle(e.src,h,e.posMax),h<d&&u!==h&&o.ok)for(a=o.str,h=o.pos;h<d&&(n=e.src.charCodeAt(h),!(!vt(n)&&n!==10));h++);}(h>=d||e.src.charCodeAt(h)!==41)&&(c=!0),h++}if(c){if(typeof e.env.references>"u")return!1;if(h<d&&e.src.charCodeAt(h)===91?(u=h+1,h=e.md.helpers.parseLinkLabel(e,h),h>=0?r=e.src.slice(u,h++):h=p+1):h=p+1,r||(r=e.src.slice(g,p)),i=e.env.references[Va(r)],!i)return e.pos=l,!1;s=i.href,a=i.title}if(!t){e.pos=g,e.posMax=p;const m=e.push("link_open","a",1),y=[["href",s]];m.attrs=y,a&&y.push(["title",a]),e.linkLevel++,e.md.inline.tokenize(e),e.linkLevel--,e.push("link_close","a",-1)}return e.pos=h,e.posMax=d,!0}function $I(e,t){let n,r,o,i,s,a,u,c,l="";const d=e.pos,g=e.posMax;if(e.src.charCodeAt(e.pos)!==33||e.src.charCodeAt(e.pos+1)!==91)return!1;const p=e.pos+2,h=e.md.helpers.parseLinkLabel(e,e.pos+1,!1);if(h<0)return!1;if(i=h+1,i<g&&e.src.charCodeAt(i)===40){for(i++;i<g&&(n=e.src.charCodeAt(i),!(!vt(n)&&n!==10));i++);if(i>=g)return!1;for(c=i,a=e.md.helpers.parseLinkDestination(e.src,i,e.posMax),a.ok&&(l=e.md.normalizeLink(a.str),e.md.validateLink(l)?i=a.pos:l=""),c=i;i<g&&(n=e.src.charCodeAt(i),!(!vt(n)&&n!==10));i++);if(a=e.md.helpers.parseLinkTitle(e.src,i,e.posMax),i<g&&c!==i&&a.ok)for(u=a.str,i=a.pos;i<g&&(n=e.src.charCodeAt(i),!(!vt(n)&&n!==10));i++);else u="";if(i>=g||e.src.charCodeAt(i)!==41)return e.pos=d,!1;i++}else{if(typeof e.env.references>"u")return!1;if(i<g&&e.src.charCodeAt(i)===91?(c=i+1,i=e.md.helpers.parseLinkLabel(e,i),i>=0?o=e.src.slice(c,i++):i=h+1):i=h+1,o||(o=e.src.slice(p,h)),s=e.env.references[Va(o)],!s)return e.pos=d,!1;l=s.href,u=s.title}if(!t){r=e.src.slice(p,h);const m=[];e.md.inline.parse(r,e.md,e.env,m);const y=e.push("image","img",0),v=[["src",l],["alt",""]];y.attrs=v,y.children=m,y.content=r,u&&v.push(["title",u])}return e.pos=i,e.posMax=g,!0}const FI=/^([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])?)*)$/,BI=/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;function zI(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==60)return!1;const r=e.pos,o=e.posMax;for(;;){if(++n>=o)return!1;const s=e.src.charCodeAt(n);if(s===60)return!1;if(s===62)break}const i=e.src.slice(r+1,n);if(BI.test(i)){const s=e.md.normalizeLink(i);if(!e.md.validateLink(s))return!1;if(!t){const a=e.push("link_open","a",1);a.attrs=[["href",s]],a.markup="autolink",a.info="auto";const u=e.push("text","",0);u.content=e.md.normalizeLinkText(i);const c=e.push("link_close","a",-1);c.markup="autolink",c.info="auto"}return e.pos+=i.length+2,!0}if(FI.test(i)){const s=e.md.normalizeLink("mailto:"+i);if(!e.md.validateLink(s))return!1;if(!t){const a=e.push("link_open","a",1);a.attrs=[["href",s]],a.markup="autolink",a.info="auto";const u=e.push("text","",0);u.content=e.md.normalizeLinkText(i);const c=e.push("link_close","a",-1);c.markup="autolink",c.info="auto"}return e.pos+=i.length+2,!0}return!1}function UI(e){return/^<a[>\s]/i.test(e)}function KI(e){return/^<\/a\s*>/i.test(e)}function jI(e){const t=e|32;return t>=97&&t<=122}function qI(e,t){if(!e.md.options.html)return!1;const n=e.posMax,r=e.pos;if(e.src.charCodeAt(r)!==60||r+2>=n)return!1;const o=e.src.charCodeAt(r+1);if(o!==33&&o!==63&&o!==47&&!jI(o))return!1;const i=e.src.slice(r).match(vI);if(!i)return!1;if(!t){const s=e.push("html_inline","",0);s.content=i[0],UI(s.content)&&e.linkLevel++,KI(s.content)&&e.linkLevel--}return e.pos+=i[0].length,!0}const HI=/^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i,GI=/^&([a-z][a-z0-9]{1,31});/i;function VI(e,t){const n=e.pos,r=e.posMax;if(e.src.charCodeAt(n)!==38||n+1>=r)return!1;if(e.src.charCodeAt(n+1)===35){const i=e.src.slice(n).match(HI);if(i){if(!t){const s=i[1][0].toLowerCase()==="x"?parseInt(i[1].slice(1),16):parseInt(i[1],10),a=e.push("text_special","",0);a.content=Sd(s)?Ui(s):Ui(65533),a.markup=i[0],a.info="entity"}return e.pos+=i[0].length,!0}}else{const i=e.src.slice(n).match(GI);if(i){const s=fD(i[0]);if(s!==i[0]){if(!t){const a=e.push("text_special","",0);a.content=s,a.markup=i[0],a.info="entity"}return e.pos+=i[0].length,!0}}}return!1}function Hg(e){const t={},n=e.length;if(!n)return;let r=0,o=-2;const i=[];for(let s=0;s<n;s++){const a=e[s];if(i.push(0),(e[r].marker!==a.marker||o!==a.token-1)&&(r=s),o=a.token,a.length=a.length||0,!a.close)continue;t.hasOwnProperty(a.marker)||(t[a.marker]=[-1,-1,-1,-1,-1,-1]);const u=t[a.marker][(a.open?3:0)+a.length%3];let c=r-i[r]-1,l=c;for(;c>u;c-=i[c]+1){const d=e[c];if(d.marker===a.marker&&d.open&&d.end<0){let g=!1;if((d.close||a.open)&&(d.length+a.length)%3===0&&(d.length%3!==0||a.length%3!==0)&&(g=!0),!g){const p=c>0&&!e[c-1].open?i[c-1]+1:0;i[s]=s-c+p,i[c]=p,a.open=!1,d.end=s,d.close=!1,l=-1,o=-2;break}}}l!==-1&&(t[a.marker][(a.open?3:0)+(a.length||0)%3]=l)}}function WI(e){const t=e.tokens_meta,n=e.tokens_meta.length;Hg(e.delimiters);for(let r=0;r<n;r++)t[r]&&t[r].delimiters&&Hg(t[r].delimiters)}function YI(e){let t,n,r=0;const o=e.tokens,i=e.tokens.length;for(t=n=0;t<i;t++)o[t].nesting<0&&r--,o[t].level=r,o[t].nesting>0&&r++,o[t].type==="text"&&t+1<i&&o[t+1].type==="text"?o[t+1].content=o[t].content+o[t+1].content:(t!==n&&(o[n]=o[t]),n++);t!==n&&(o.length=n)}const _u=[["text",kI],["linkify",TI],["newline",DI],["escape",II],["backticks",RI],["strikethrough",py.tokenize],["emphasis",hy.tokenize],["link",LI],["image",$I],["autolink",zI],["html_inline",qI],["entity",VI]],Eu=[["balance_pairs",WI],["strikethrough",py.postProcess],["emphasis",hy.postProcess],["fragments_join",YI]];function cs(){this.ruler=new an;for(let e=0;e<_u.length;e++)this.ruler.push(_u[e][0],_u[e][1]);this.ruler2=new an;for(let e=0;e<Eu.length;e++)this.ruler2.push(Eu[e][0],Eu[e][1])}cs.prototype.skipToken=function(e){const t=e.pos,n=this.ruler.getRules(""),r=n.length,o=e.md.options.maxNesting,i=e.cache;if(typeof i[t]<"u"){e.pos=i[t];return}let s=!1;if(e.level<o){for(let a=0;a<r;a++)if(e.level++,s=n[a](e,!0),e.level--,s){if(t>=e.pos)throw new Error("inline rule didn't increment state.pos");break}}else e.pos=e.posMax;s||e.pos++,i[t]=e.pos};cs.prototype.tokenize=function(e){const t=this.ruler.getRules(""),n=t.length,r=e.posMax,o=e.md.options.maxNesting;for(;e.pos<r;){const i=e.pos;let s=!1;if(e.level<o){for(let a=0;a<n;a++)if(s=t[a](e,!1),s){if(i>=e.pos)throw new Error("inline rule didn't increment state.pos");break}}if(s){if(e.pos>=r)break;continue}e.pending+=e.src[e.pos++]}e.pending&&e.pushPending()};cs.prototype.parse=function(e,t,n,r){const o=new this.State(e,t,n,r);this.tokenize(o);const i=this.ruler2.getRules(""),s=i.length;for(let a=0;a<s;a++)i[a](o)};cs.prototype.State=us;function ZI(e){const t={};e=e||{},t.src_Any=ty.source,t.src_Cc=ny.source,t.src_Z=oy.source,t.src_P=Ed.source,t.src_ZPCc=[t.src_Z,t.src_P,t.src_Cc].join("|"),t.src_ZCc=[t.src_Z,t.src_Cc].join("|");const n="[><|]";return t.src_pseudo_letter="(?:(?!"+n+"|"+t.src_ZPCc+")"+t.src_Any+")",t.src_ip4="(?:(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)",t.src_auth="(?:(?:(?!"+t.src_ZCc+"|[@/\\[\\]()]).)+@)?",t.src_port="(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?",t.src_host_terminator="(?=$|"+n+"|"+t.src_ZPCc+")(?!"+(e["---"]?"-(?!--)|":"-|")+"_|:\\d|\\.-|\\.(?!$|"+t.src_ZPCc+"))",t.src_path="(?:[/?#](?:(?!"+t.src_ZCc+"|"+n+`|[()[\\]{}.,"'?!\\-;]).|\\[(?:(?!`+t.src_ZCc+"|\\]).)*\\]|\\((?:(?!"+t.src_ZCc+"|[)]).)*\\)|\\{(?:(?!"+t.src_ZCc+'|[}]).)*\\}|\\"(?:(?!'+t.src_ZCc+`|["]).)+\\"|\\'(?:(?!`+t.src_ZCc+"|[']).)+\\'|\\'(?="+t.src_pseudo_letter+"|[-])|\\.{2,}[a-zA-Z0-9%/&]|\\.(?!"+t.src_ZCc+"|[.]|$)|"+(e["---"]?"\\-(?!--(?:[^-]|$))(?:-*)|":"\\-+|")+",(?!"+t.src_ZCc+"|$)|;(?!"+t.src_ZCc+"|$)|\\!+(?!"+t.src_ZCc+"|[!]|$)|\\?(?!"+t.src_ZCc+"|[?]|$))+|\\/)?",t.src_email_name='[\\-;:&=\\+\\$,\\.a-zA-Z0-9_][\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]*',t.src_xn="xn--[a-z0-9\\-]{1,59}",t.src_domain_root="(?:"+t.src_xn+"|"+t.src_pseudo_letter+"{1,63})",t.src_domain="(?:"+t.src_xn+"|(?:"+t.src_pseudo_letter+")|(?:"+t.src_pseudo_letter+"(?:-|"+t.src_pseudo_letter+"){0,61}"+t.src_pseudo_letter+"))",t.src_host="(?:(?:(?:(?:"+t.src_domain+")\\.)*"+t.src_domain+"))",t.tpl_host_fuzzy="(?:"+t.src_ip4+"|(?:(?:(?:"+t.src_domain+")\\.)+(?:%TLDS%)))",t.tpl_host_no_ip_fuzzy="(?:(?:(?:"+t.src_domain+")\\.)+(?:%TLDS%))",t.src_host_strict=t.src_host+t.src_host_terminator,t.tpl_host_fuzzy_strict=t.tpl_host_fuzzy+t.src_host_terminator,t.src_host_port_strict=t.src_host+t.src_port+t.src_host_terminator,t.tpl_host_port_fuzzy_strict=t.tpl_host_fuzzy+t.src_port+t.src_host_terminator,t.tpl_host_port_no_ip_fuzzy_strict=t.tpl_host_no_ip_fuzzy+t.src_port+t.src_host_terminator,t.tpl_host_fuzzy_test="localhost|www\\.|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:"+t.src_ZPCc+"|>|$))",t.tpl_email_fuzzy="(^|"+n+'|"|\\(|'+t.src_ZCc+")("+t.src_email_name+"@"+t.tpl_host_fuzzy_strict+")",t.tpl_link_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+t.src_ZPCc+"))((?![$+<=>^`||])"+t.tpl_host_port_fuzzy_strict+t.src_path+")",t.tpl_link_no_ip_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+t.src_ZPCc+"))((?![$+<=>^`||])"+t.tpl_host_port_no_ip_fuzzy_strict+t.src_path+")",t}function bl(e){return Array.prototype.slice.call(arguments,1).forEach(function(n){n&&Object.keys(n).forEach(function(r){e[r]=n[r]})}),e}function Za(e){return Object.prototype.toString.call(e)}function XI(e){return Za(e)==="[object String]"}function JI(e){return Za(e)==="[object Object]"}function QI(e){return Za(e)==="[object RegExp]"}function Gg(e){return Za(e)==="[object Function]"}function e6(e){return e.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}const my={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};function t6(e){return Object.keys(e||{}).reduce(function(t,n){return t||my.hasOwnProperty(n)},!1)}const n6={"http:":{validate:function(e,t,n){const r=e.slice(t);return n.re.http||(n.re.http=new RegExp("^\\/\\/"+n.re.src_auth+n.re.src_host_port_strict+n.re.src_path,"i")),n.re.http.test(r)?r.match(n.re.http)[0].length:0}},"https:":"http:","ftp:":"http:","//":{validate:function(e,t,n){const r=e.slice(t);return n.re.no_http||(n.re.no_http=new RegExp("^"+n.re.src_auth+"(?:localhost|(?:(?:"+n.re.src_domain+")\\.)+"+n.re.src_domain_root+")"+n.re.src_port+n.re.src_host_terminator+n.re.src_path,"i")),n.re.no_http.test(r)?t>=3&&e[t-3]===":"||t>=3&&e[t-3]==="/"?0:r.match(n.re.no_http)[0].length:0}},"mailto:":{validate:function(e,t,n){const r=e.slice(t);return n.re.mailto||(n.re.mailto=new RegExp("^"+n.re.src_email_name+"@"+n.re.src_host_strict,"i")),n.re.mailto.test(r)?r.match(n.re.mailto)[0].length:0}}},r6="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]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]",o6="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф".split("|");function i6(e){return function(t,n){const r=t.slice(n);return e.test(r)?r.match(e)[0].length:0}}function Vg(){return function(e,t){t.normalize(e)}}function la(e){const t=e.re=ZI(e.__opts__),n=e.__tlds__.slice();e.onCompile(),e.__tlds_replaced__||n.push(r6),n.push(t.src_xn),t.src_tlds=n.join("|");function r(a){return a.replace("%TLDS%",t.src_tlds)}t.email_fuzzy=RegExp(r(t.tpl_email_fuzzy),"i"),t.email_fuzzy_global=RegExp(r(t.tpl_email_fuzzy),"ig"),t.link_fuzzy=RegExp(r(t.tpl_link_fuzzy),"i"),t.link_fuzzy_global=RegExp(r(t.tpl_link_fuzzy),"ig"),t.link_no_ip_fuzzy=RegExp(r(t.tpl_link_no_ip_fuzzy),"i"),t.link_no_ip_fuzzy_global=RegExp(r(t.tpl_link_no_ip_fuzzy),"ig"),t.host_fuzzy_test=RegExp(r(t.tpl_host_fuzzy_test),"i");const o=[];e.__compiled__={};function i(a,u){throw new Error('(LinkifyIt) Invalid schema "'+a+'": '+u)}Object.keys(e.__schemas__).forEach(function(a){const u=e.__schemas__[a];if(u===null)return;const c={validate:null,link:null};if(e.__compiled__[a]=c,JI(u)){QI(u.validate)?c.validate=i6(u.validate):Gg(u.validate)?c.validate=u.validate:i(a,u),Gg(u.normalize)?c.normalize=u.normalize:u.normalize?i(a,u):c.normalize=Vg();return}if(XI(u)){o.push(a);return}i(a,u)}),o.forEach(function(a){e.__compiled__[e.__schemas__[a]]&&(e.__compiled__[a].validate=e.__compiled__[e.__schemas__[a]].validate,e.__compiled__[a].normalize=e.__compiled__[e.__schemas__[a]].normalize)}),e.__compiled__[""]={validate:null,normalize:Vg()};const s=Object.keys(e.__compiled__).filter(function(a){return a.length>0&&e.__compiled__[a]}).map(e6).join("|");e.re.schema_test=RegExp("(^|(?!_)(?:[><|]|"+t.src_ZPCc+"))("+s+")","i"),e.re.schema_search=RegExp("(^|(?!_)(?:[><|]|"+t.src_ZPCc+"))("+s+")","ig"),e.re.schema_at_start=RegExp("^"+e.re.schema_search.source,"i"),e.re.pretest=RegExp("("+e.re.schema_test.source+")|("+e.re.host_fuzzy_test.source+")|@","i")}function by(e,t,n,r){const o=e.slice(n,r);this.schema=t.toLowerCase(),this.index=n,this.lastIndex=r,this.raw=o,this.text=o,this.url=o}function vn(e,t){if(!(this instanceof vn))return new vn(e,t);t||t6(e)&&(t=e,e={}),this.__opts__=bl({},my,t),this.__schemas__=bl({},n6,e),this.__compiled__={},this.__tlds__=o6,this.__tlds_replaced__=!1,this.re={},la(this)}vn.prototype.add=function(t,n){return this.__schemas__[t]=n,la(this),this};vn.prototype.set=function(t){return this.__opts__=bl(this.__opts__,t),this};vn.prototype.test=function(t){if(!t.length)return!1;let n,r;if(this.re.schema_test.test(t)){for(r=this.re.schema_search,r.lastIndex=0;(n=r.exec(t))!==null;)if(this.testSchemaAt(t,n[2],r.lastIndex))return!0}return!!(this.__opts__.fuzzyLink&&this.__compiled__["http:"]&&t.search(this.re.host_fuzzy_test)>=0&&t.match(this.__opts__.fuzzyIP?this.re.link_fuzzy:this.re.link_no_ip_fuzzy)!==null||this.__opts__.fuzzyEmail&&this.__compiled__["mailto:"]&&t.indexOf("@")>=0&&t.match(this.re.email_fuzzy)!==null)};vn.prototype.pretest=function(t){return this.re.pretest.test(t)};vn.prototype.testSchemaAt=function(t,n,r){return this.__compiled__[n.toLowerCase()]?this.__compiled__[n.toLowerCase()].validate(t,r,this):0};vn.prototype.match=function(t){const n=[],r=[],o=[],i=[];let s,a,u;function c(g,p){return g?p?g.index!==p.index?g.index<p.index?g:p:g.lastIndex>=p.lastIndex?g:p:g:p}if(!t.length)return null;if(this.re.schema_test.test(t))for(u=this.re.schema_search,u.lastIndex=0;(s=u.exec(t))!==null;)a=this.testSchemaAt(t,s[2],u.lastIndex),a&&r.push({schema:s[2],index:s.index+s[1].length,lastIndex:s.index+s[0].length+a});if(this.__opts__.fuzzyLink&&this.__compiled__["http:"])for(u=this.__opts__.fuzzyIP?this.re.link_fuzzy_global:this.re.link_no_ip_fuzzy_global,u.lastIndex=0;(s=u.exec(t))!==null;)o.push({schema:"",index:s.index+s[1].length,lastIndex:s.index+s[0].length});if(this.__opts__.fuzzyEmail&&this.__compiled__["mailto:"])for(u=this.re.email_fuzzy_global,u.lastIndex=0;(s=u.exec(t))!==null;)i.push({schema:"mailto:",index:s.index+s[1].length,lastIndex:s.index+s[0].length});const l=[0,0,0];let d=0;for(;;){const g=[r[l[0]],i[l[1]],o[l[2]]],p=c(c(g[0],g[1]),g[2]);if(!p)break;if(p===g[0]?l[0]++:p===g[1]?l[1]++:l[2]++,p.index<d)continue;const h=new by(t,p.schema,p.index,p.lastIndex);this.__compiled__[h.schema].normalize(h,this),n.push(h),d=p.lastIndex}return n.length?n:null};vn.prototype.matchAtStart=function(t){if(!t.length)return null;const n=this.re.schema_at_start.exec(t);if(!n)return null;const r=this.testSchemaAt(t,n[2],n[0].length);if(!r)return null;const o=new by(t,n[2],n.index+n[1].length,n.index+n[0].length+r);return this.__compiled__[o.schema].normalize(o,this),o};vn.prototype.tlds=function(t,n){return t=Array.isArray(t)?t:[t],n?(this.__tlds__=this.__tlds__.concat(t).sort().filter(function(r,o,i){return r!==i[o-1]}).reverse(),la(this),this):(this.__tlds__=t.slice(),this.__tlds_replaced__=!0,la(this),this)};vn.prototype.normalize=function(t){t.schema||(t.url="http://"+t.url),t.schema==="mailto:"&&!/^mailto:/i.test(t.url)&&(t.url="mailto:"+t.url)};vn.prototype.onCompile=function(){};const Ho=2147483647,Jn=36,Td=1,Hi=26,s6=38,a6=700,yy=72,vy=128,wy="-",u6=/^xn--/,c6=/[^\0-\x7F]/,l6=/[\x2E\u3002\uFF0E\uFF61]/g,d6={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},Cu=Jn-Td,Qn=Math.floor,Su=String.fromCharCode;function Fr(e){throw new RangeError(d6[e])}function f6(e,t){const n=[];let r=e.length;for(;r--;)n[r]=t(e[r]);return n}function xy(e,t){const n=e.split("@");let r="";n.length>1&&(r=n[0]+"@",e=n[1]),e=e.replace(l6,".");const o=e.split("."),i=f6(o,t).join(".");return r+i}function _y(e){const t=[];let n=0;const r=e.length;for(;n<r;){const o=e.charCodeAt(n++);if(o>=55296&&o<=56319&&n<r){const i=e.charCodeAt(n++);(i&64512)==56320?t.push(((o&1023)<<10)+(i&1023)+65536):(t.push(o),n--)}else t.push(o)}return t}const g6=e=>String.fromCodePoint(...e),p6=function(e){return e>=48&&e<58?26+(e-48):e>=65&&e<91?e-65:e>=97&&e<123?e-97:Jn},Wg=function(e,t){return e+22+75*(e<26)-((t!=0)<<5)},Ey=function(e,t,n){let r=0;for(e=n?Qn(e/a6):e>>1,e+=Qn(e/t);e>Cu*Hi>>1;r+=Jn)e=Qn(e/Cu);return Qn(r+(Cu+1)*e/(e+s6))},Cy=function(e){const t=[],n=e.length;let r=0,o=vy,i=yy,s=e.lastIndexOf(wy);s<0&&(s=0);for(let a=0;a<s;++a)e.charCodeAt(a)>=128&&Fr("not-basic"),t.push(e.charCodeAt(a));for(let a=s>0?s+1:0;a<n;){const u=r;for(let l=1,d=Jn;;d+=Jn){a>=n&&Fr("invalid-input");const g=p6(e.charCodeAt(a++));g>=Jn&&Fr("invalid-input"),g>Qn((Ho-r)/l)&&Fr("overflow"),r+=g*l;const p=d<=i?Td:d>=i+Hi?Hi:d-i;if(g<p)break;const h=Jn-p;l>Qn(Ho/h)&&Fr("overflow"),l*=h}const c=t.length+1;i=Ey(r-u,c,u==0),Qn(r/c)>Ho-o&&Fr("overflow"),o+=Qn(r/c),r%=c,t.splice(r++,0,o)}return String.fromCodePoint(...t)},Sy=function(e){const t=[];e=_y(e);const n=e.length;let r=vy,o=0,i=yy;for(const u of e)u<128&&t.push(Su(u));const s=t.length;let a=s;for(s&&t.push(wy);a<n;){let u=Ho;for(const l of e)l>=r&&l<u&&(u=l);const c=a+1;u-r>Qn((Ho-o)/c)&&Fr("overflow"),o+=(u-r)*c,r=u;for(const l of e)if(l<r&&++o>Ho&&Fr("overflow"),l===r){let d=o;for(let g=Jn;;g+=Jn){const p=g<=i?Td:g>=i+Hi?Hi:g-i;if(d<p)break;const h=d-p,m=Jn-p;t.push(Su(Wg(p+h%m,0))),d=Qn(h/m)}t.push(Su(Wg(d,0))),i=Ey(o,c,a===s),o=0,++a}++o,++r}return t.join("")},h6=function(e){return xy(e,function(t){return u6.test(t)?Cy(t.slice(4).toLowerCase()):t})},m6=function(e){return xy(e,function(t){return c6.test(t)?"xn--"+Sy(t):t})},ky={version:"2.3.1",ucs2:{decode:_y,encode:g6},decode:Cy,encode:Sy,toASCII:m6,toUnicode:h6},b6={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:100},components:{core:{},block:{},inline:{}}},y6={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline","text_join"]},block:{rules:["paragraph"]},inline:{rules:["text"],rules2:["balance_pairs","fragments_join"]}}},v6={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"],rules2:["balance_pairs","emphasis","fragments_join"]}}},w6={default:b6,zero:y6,commonmark:v6},x6=/^(vbscript|javascript|file|data):/,_6=/^data:image\/(gif|png|jpeg|webp);/;function E6(e){const t=e.trim().toLowerCase();return x6.test(t)?_6.test(t):!0}const Ay=["http:","https:","mailto:"];function C6(e){const t=_d(e,!0);if(t.hostname&&(!t.protocol||Ay.indexOf(t.protocol)>=0))try{t.hostname=ky.toASCII(t.hostname)}catch{}return as(xd(t))}function S6(e){const t=_d(e,!0);if(t.hostname&&(!t.protocol||Ay.indexOf(t.protocol)>=0))try{t.hostname=ky.toUnicode(t.hostname)}catch{}return ei(xd(t),ei.defaultChars+"%")}function kn(e,t){if(!(this instanceof kn))return new kn(e,t);t||Cd(e)||(t=e||{},e="default"),this.inline=new cs,this.block=new Ya,this.core=new kd,this.renderer=new ai,this.linkify=new vn,this.validateLink=E6,this.normalizeLink=C6,this.normalizeLinkText=S6,this.utils=TD,this.helpers=Ga({},OD),this.options={},this.configure(e),t&&this.set(t)}kn.prototype.set=function(e){return Ga(this.options,e),this};kn.prototype.configure=function(e){const t=this;if(Cd(e)){const n=e;if(e=w6[n],!e)throw new Error('Wrong `markdown-it` preset "'+n+'", check name')}if(!e)throw new Error("Wrong `markdown-it` preset, can't be empty");return e.options&&t.set(e.options),e.components&&Object.keys(e.components).forEach(function(n){e.components[n].rules&&t[n].ruler.enableOnly(e.components[n].rules),e.components[n].rules2&&t[n].ruler2.enableOnly(e.components[n].rules2)}),this};kn.prototype.enable=function(e,t){let n=[];Array.isArray(e)||(e=[e]),["core","block","inline"].forEach(function(o){n=n.concat(this[o].ruler.enable(e,!0))},this),n=n.concat(this.inline.ruler2.enable(e,!0));const r=e.filter(function(o){return n.indexOf(o)<0});if(r.length&&!t)throw new Error("MarkdownIt. Failed to enable unknown rule(s): "+r);return this};kn.prototype.disable=function(e,t){let n=[];Array.isArray(e)||(e=[e]),["core","block","inline"].forEach(function(o){n=n.concat(this[o].ruler.disable(e,!0))},this),n=n.concat(this.inline.ruler2.disable(e,!0));const r=e.filter(function(o){return n.indexOf(o)<0});if(r.length&&!t)throw new Error("MarkdownIt. Failed to disable unknown rule(s): "+r);return this};kn.prototype.use=function(e){const t=[this].concat(Array.prototype.slice.call(arguments,1));return e.apply(e,t),this};kn.prototype.parse=function(e,t){if(typeof e!="string")throw new Error("Input data should be a String");const n=new this.core.State(e,this,t);return this.core.process(n),n.tokens};kn.prototype.render=function(e,t){return t=t||{},this.renderer.render(this.parse(e,t),this.options,t)};kn.prototype.parseInline=function(e,t){const n=new this.core.State(e,this,t);return n.inlineMode=!0,this.core.process(n),n.tokens};kn.prototype.renderInline=function(e,t){return t=t||{},this.renderer.render(this.parseInline(e,t),this.options,t)};function ls(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ku,Yg;function k6(){if(Yg)return ku;Yg=1;var e=!0,t=!1,n=!1;ku=function(m,y){y&&(e=!y.enabled,t=!!y.label,n=!!y.labelAfter),m.core.ruler.after("inline","github-task-lists",function(v){for(var b=v.tokens,w=2;w<b.length;w++)i(b,w)&&(s(b[w],v.Token),r(b[w-2],"class","task-list-item"+(e?"":" enabled")),r(b[o(b,w-2)],"class","contains-task-list"))})};function r(m,y,v){var b=m.attrIndex(y),w=[y,v];b<0?m.attrPush(w):m.attrs[b]=w}function o(m,y){for(var v=m[y].level-1,b=y-1;b>=0;b--)if(m[b].level===v)return b;return-1}function i(m,y){return d(m[y])&&g(m[y-1])&&p(m[y-2])&&h(m[y])}function s(m,y){if(m.children.unshift(a(m,y)),m.children[1].content=m.children[1].content.slice(3),m.content=m.content.slice(3),t)if(n){m.children.pop();var v="task-item-"+Math.ceil(Math.random()*(1e4*1e3)-1e3);m.children[0].content=m.children[0].content.slice(0,-1)+' id="'+v+'">',m.children.push(l(m.content,v,y))}else m.children.unshift(u(y)),m.children.push(c(y))}function a(m,y){var v=new y("html_inline","",0),b=e?' disabled="" ':"";return m.content.indexOf("[ ] ")===0?v.content='<input class="task-list-item-checkbox"'+b+'type="checkbox">':(m.content.indexOf("[x] ")===0||m.content.indexOf("[X] ")===0)&&(v.content='<input class="task-list-item-checkbox" checked=""'+b+'type="checkbox">'),v}function u(m){var y=new m("html_inline","",0);return y.content="<label>",y}function c(m){var y=new m("html_inline","",0);return y.content="</label>",y}function l(m,y,v){var b=new v("html_inline","",0);return b.content='<label class="task-list-item-label" for="'+y+'">'+m+"</label>",b.attrs=[{for:y}],b}function d(m){return m.type==="inline"}function g(m){return m.type==="paragraph_open"}function p(m){return m.type==="list_item_open"}function h(m){return m.content.indexOf("[ ] ")===0||m.content.indexOf("[x] ")===0||m.content.indexOf("[X] ")===0}return ku}var A6=k6();const T6=ls(A6);var Au,Zg;function D6(){if(Zg)return Au;Zg=1;function e(R){return R instanceof Map?R.clear=R.delete=R.set=function(){throw new Error("map is read-only")}:R instanceof Set&&(R.add=R.clear=R.delete=function(){throw new Error("set is read-only")}),Object.freeze(R),Object.getOwnPropertyNames(R).forEach(X=>{const be=R[X],le=typeof be;(le==="object"||le==="function")&&!Object.isFrozen(be)&&e(be)}),R}class t{constructor(X){X.data===void 0&&(X.data={}),this.data=X.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function n(R){return R.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function r(R,...X){const be=Object.create(null);for(const le in R)be[le]=R[le];return X.forEach(function(le){for(const Fe in le)be[Fe]=le[Fe]}),be}const o="</span>",i=R=>!!R.scope,s=(R,{prefix:X})=>{if(R.startsWith("language:"))return R.replace("language:","language-");if(R.includes(".")){const be=R.split(".");return[`${X}${be.shift()}`,...be.map((le,Fe)=>`${le}${"_".repeat(Fe+1)}`)].join(" ")}return`${X}${R}`};class a{constructor(X,be){this.buffer="",this.classPrefix=be.classPrefix,X.walk(this)}addText(X){this.buffer+=n(X)}openNode(X){if(!i(X))return;const be=s(X.scope,{prefix:this.classPrefix});this.span(be)}closeNode(X){i(X)&&(this.buffer+=o)}value(){return this.buffer}span(X){this.buffer+=`<span class="${X}">`}}const u=(R={})=>{const X={children:[]};return Object.assign(X,R),X};class c{constructor(){this.rootNode=u(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(X){this.top.children.push(X)}openNode(X){const be=u({scope:X});this.add(be),this.stack.push(be)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(X){return this.constructor._walk(X,this.rootNode)}static _walk(X,be){return typeof be=="string"?X.addText(be):be.children&&(X.openNode(be),be.children.forEach(le=>this._walk(X,le)),X.closeNode(be)),X}static _collapse(X){typeof X!="string"&&X.children&&(X.children.every(be=>typeof be=="string")?X.children=[X.children.join("")]:X.children.forEach(be=>{c._collapse(be)}))}}class l extends c{constructor(X){super(),this.options=X}addText(X){X!==""&&this.add(X)}startScope(X){this.openNode(X)}endScope(){this.closeNode()}__addSublanguage(X,be){const le=X.root;be&&(le.scope=`language:${be}`),this.add(le)}toHTML(){return new a(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function d(R){return R?typeof R=="string"?R:R.source:null}function g(R){return m("(?=",R,")")}function p(R){return m("(?:",R,")*")}function h(R){return m("(?:",R,")?")}function m(...R){return R.map(be=>d(be)).join("")}function y(R){const X=R[R.length-1];return typeof X=="object"&&X.constructor===Object?(R.splice(R.length-1,1),X):{}}function v(...R){return"("+(y(R).capture?"":"?:")+R.map(le=>d(le)).join("|")+")"}function b(R){return new RegExp(R.toString()+"|").exec("").length-1}function w(R,X){const be=R&&R.exec(X);return be&&be.index===0}const E=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function C(R,{joinWith:X}){let be=0;return R.map(le=>{be+=1;const Fe=be;let Ze=d(le),_e="";for(;Ze.length>0;){const U=E.exec(Ze);if(!U){_e+=Ze;break}_e+=Ze.substring(0,U.index),Ze=Ze.substring(U.index+U[0].length),U[0][0]==="\\"&&U[1]?_e+="\\"+String(Number(U[1])+Fe):(_e+=U[0],U[0]==="("&&be++)}return _e}).map(le=>`(${le})`).join(X)}const k=/\b\B/,T="[a-zA-Z]\\w*",S="[a-zA-Z_]\\w*",A="\\b\\d+(\\.\\d+)?",F="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",O="\\b(0b[01]+)",P="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",L=(R={})=>{const X=/^#![ ]*\//;return R.binary&&(R.begin=m(X,/.*\b/,R.binary,/\b.*/)),r({scope:"meta",begin:X,end:/$/,relevance:0,"on:begin":(be,le)=>{be.index!==0&&le.ignoreMatch()}},R)},D={begin:"\\\\[\\s\\S]",relevance:0},B={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[D]},N={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[D]},Y={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},ce=function(R,X,be={}){const le=r({scope:"comment",begin:R,end:X,contains:[]},be);le.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const Fe=v("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return le.contains.push({begin:m(/[ ]+/,"(",Fe,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),le},V=ce("//","$"),j=ce("/\\*","\\*/"),he=ce("#","$"),K={scope:"number",begin:A,relevance:0},z={scope:"number",begin:F,relevance:0},J={scope:"number",begin:O,relevance:0},re={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[D,{begin:/\[/,end:/\]/,relevance:0,contains:[D]}]},ve={scope:"title",begin:T,relevance:0},Z={scope:"title",begin:S,relevance:0},M={begin:"\\.\\s*"+S,relevance:0};var oe=Object.freeze({__proto__:null,APOS_STRING_MODE:B,BACKSLASH_ESCAPE:D,BINARY_NUMBER_MODE:J,BINARY_NUMBER_RE:O,COMMENT:ce,C_BLOCK_COMMENT_MODE:j,C_LINE_COMMENT_MODE:V,C_NUMBER_MODE:z,C_NUMBER_RE:F,END_SAME_AS_BEGIN:function(R){return Object.assign(R,{"on:begin":(X,be)=>{be.data._beginMatch=X[1]},"on:end":(X,be)=>{be.data._beginMatch!==X[1]&&be.ignoreMatch()}})},HASH_COMMENT_MODE:he,IDENT_RE:T,MATCH_NOTHING_RE:k,METHOD_GUARD:M,NUMBER_MODE:K,NUMBER_RE:A,PHRASAL_WORDS_MODE:Y,QUOTE_STRING_MODE:N,REGEXP_MODE:re,RE_STARTERS_RE:P,SHEBANG:L,TITLE_MODE:ve,UNDERSCORE_IDENT_RE:S,UNDERSCORE_TITLE_MODE:Z});function te(R,X){R.input[R.index-1]==="."&&X.ignoreMatch()}function H(R,X){R.className!==void 0&&(R.scope=R.className,delete R.className)}function de(R,X){X&&R.beginKeywords&&(R.begin="\\b("+R.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",R.__beforeBegin=te,R.keywords=R.keywords||R.beginKeywords,delete R.beginKeywords,R.relevance===void 0&&(R.relevance=0))}function fe(R,X){Array.isArray(R.illegal)&&(R.illegal=v(...R.illegal))}function Ue(R,X){if(R.match){if(R.begin||R.end)throw new Error("begin & end are not supported with match");R.begin=R.match,delete R.match}}function se(R,X){R.relevance===void 0&&(R.relevance=1)}const xe=(R,X)=>{if(!R.beforeMatch)return;if(R.starts)throw new Error("beforeMatch cannot be used with starts");const be=Object.assign({},R);Object.keys(R).forEach(le=>{delete R[le]}),R.keywords=be.keywords,R.begin=m(be.beforeMatch,g(be.begin)),R.starts={relevance:0,contains:[Object.assign(be,{endsParent:!0})]},R.relevance=0,delete be.beforeMatch},Ce=["of","and","for","in","not","or","if","then","parent","list","value"],We="keyword";function it(R,X,be=We){const le=Object.create(null);return typeof R=="string"?Fe(be,R.split(" ")):Array.isArray(R)?Fe(be,R):Object.keys(R).forEach(function(Ze){Object.assign(le,it(R[Ze],X,Ze))}),le;function Fe(Ze,_e){X&&(_e=_e.map(U=>U.toLowerCase())),_e.forEach(function(U){const ie=U.split("|");le[ie[0]]=[Ze,Ye(ie[0],ie[1])]})}}function Ye(R,X){return X?Number(X):Ct(R)?0:1}function Ct(R){return Ce.includes(R.toLowerCase())}const Ot={},Pe=R=>{console.error(R)},mt=(R,...X)=>{console.log(`WARN: ${R}`,...X)},It=(R,X)=>{Ot[`${R}/${X}`]||(console.log(`Deprecated as of ${R}. ${X}`),Ot[`${R}/${X}`]=!0)},un=new Error;function Dn(R,X,{key:be}){let le=0;const Fe=R[be],Ze={},_e={};for(let U=1;U<=X.length;U++)_e[U+le]=Fe[U],Ze[U+le]=!0,le+=b(X[U-1]);R[be]=_e,R[be]._emit=Ze,R[be]._multi=!0}function Lt(R){if(Array.isArray(R.begin)){if(R.skip||R.excludeBegin||R.returnBegin)throw Pe("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),un;if(typeof R.beginScope!="object"||R.beginScope===null)throw Pe("beginScope must be object"),un;Dn(R,R.begin,{key:"beginScope"}),R.begin=C(R.begin,{joinWith:""})}}function Ut(R){if(Array.isArray(R.end)){if(R.skip||R.excludeEnd||R.returnEnd)throw Pe("skip, excludeEnd, returnEnd not compatible with endScope: {}"),un;if(typeof R.endScope!="object"||R.endScope===null)throw Pe("endScope must be object"),un;Dn(R,R.end,{key:"endScope"}),R.end=C(R.end,{joinWith:""})}}function rn(R){R.scope&&typeof R.scope=="object"&&R.scope!==null&&(R.beginScope=R.scope,delete R.scope)}function Ir(R){rn(R),typeof R.beginScope=="string"&&(R.beginScope={_wrap:R.beginScope}),typeof R.endScope=="string"&&(R.endScope={_wrap:R.endScope}),Lt(R),Ut(R)}function to(R){function X(_e,U){return new RegExp(d(_e),"m"+(R.case_insensitive?"i":"")+(R.unicodeRegex?"u":"")+(U?"g":""))}class be{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(U,ie){ie.position=this.position++,this.matchIndexes[this.matchAt]=ie,this.regexes.push([ie,U]),this.matchAt+=b(U)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const U=this.regexes.map(ie=>ie[1]);this.matcherRe=X(C(U,{joinWith:"|"}),!0),this.lastIndex=0}exec(U){this.matcherRe.lastIndex=this.lastIndex;const ie=this.matcherRe.exec(U);if(!ie)return null;const pe=ie.findIndex((ct,St)=>St>0&&ct!==void 0),Le=this.matchIndexes[pe];return ie.splice(0,pe),Object.assign(ie,Le)}}class le{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(U){if(this.multiRegexes[U])return this.multiRegexes[U];const ie=new be;return this.rules.slice(U).forEach(([pe,Le])=>ie.addRule(pe,Le)),ie.compile(),this.multiRegexes[U]=ie,ie}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(U,ie){this.rules.push([U,ie]),ie.type==="begin"&&this.count++}exec(U){const ie=this.getMatcher(this.regexIndex);ie.lastIndex=this.lastIndex;let pe=ie.exec(U);if(this.resumingScanAtSamePosition()&&!(pe&&pe.index===this.lastIndex)){const Le=this.getMatcher(0);Le.lastIndex=this.lastIndex+1,pe=Le.exec(U)}return pe&&(this.regexIndex+=pe.position+1,this.regexIndex===this.count&&this.considerAll()),pe}}function Fe(_e){const U=new le;return _e.contains.forEach(ie=>U.addRule(ie.begin,{rule:ie,type:"begin"})),_e.terminatorEnd&&U.addRule(_e.terminatorEnd,{type:"end"}),_e.illegal&&U.addRule(_e.illegal,{type:"illegal"}),U}function Ze(_e,U){const ie=_e;if(_e.isCompiled)return ie;[H,Ue,Ir,xe].forEach(Le=>Le(_e,U)),R.compilerExtensions.forEach(Le=>Le(_e,U)),_e.__beforeBegin=null,[de,fe,se].forEach(Le=>Le(_e,U)),_e.isCompiled=!0;let pe=null;return typeof _e.keywords=="object"&&_e.keywords.$pattern&&(_e.keywords=Object.assign({},_e.keywords),pe=_e.keywords.$pattern,delete _e.keywords.$pattern),pe=pe||/\w+/,_e.keywords&&(_e.keywords=it(_e.keywords,R.case_insensitive)),ie.keywordPatternRe=X(pe,!0),U&&(_e.begin||(_e.begin=/\B|\b/),ie.beginRe=X(ie.begin),!_e.end&&!_e.endsWithParent&&(_e.end=/\B|\b/),_e.end&&(ie.endRe=X(ie.end)),ie.terminatorEnd=d(ie.end)||"",_e.endsWithParent&&U.terminatorEnd&&(ie.terminatorEnd+=(_e.end?"|":"")+U.terminatorEnd)),_e.illegal&&(ie.illegalRe=X(_e.illegal)),_e.contains||(_e.contains=[]),_e.contains=[].concat(..._e.contains.map(function(Le){return no(Le==="self"?_e:Le)})),_e.contains.forEach(function(Le){Ze(Le,ie)}),_e.starts&&Ze(_e.starts,U),ie.matcher=Fe(ie),ie}if(R.compilerExtensions||(R.compilerExtensions=[]),R.contains&&R.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return R.classNameAliases=r(R.classNameAliases||{}),Ze(R)}function Rr(R){return R?R.endsWithParent||Rr(R.starts):!1}function no(R){return R.variants&&!R.cachedVariants&&(R.cachedVariants=R.variants.map(function(X){return r(R,{variants:null},X)})),R.cachedVariants?R.cachedVariants:Rr(R)?r(R,{starts:R.starts?r(R.starts):null}):Object.isFrozen(R)?r(R):R}var $t="11.11.1";class Or extends Error{constructor(X,be){super(X),this.name="HTMLInjectionError",this.html=be}}const fr=n,gr=r,nt=Symbol("nomatch"),In=7,ge=function(R){const X=Object.create(null),be=Object.create(null),le=[];let Fe=!0;const Ze="Could not find the language '{}', did you forget to load/include a language module?",_e={disableAutodetect:!0,name:"Plain text",contains:[]};let U={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:l};function ie(ye){return U.noHighlightRe.test(ye)}function pe(ye){let Be=ye.className+" ";Be+=ye.parentNode?ye.parentNode.className:"";const et=U.languageDetectRe.exec(Be);if(et){const bt=Rn(et[1]);return bt||(mt(Ze.replace("{}",et[1])),mt("Falling back to no-highlight mode for this block.",ye)),bt?et[1]:"no-highlight"}return Be.split(/\s+/).find(bt=>ie(bt)||Rn(bt))}function Le(ye,Be,et){let bt="",Nt="";typeof Be=="object"?(bt=ye,et=Be.ignoreIllegals,Nt=Be.language):(It("10.7.0","highlight(lang, code, ...args) has been deprecated."),It("10.7.0",`Please use highlight(code, options) instead.
|
|
22
|
+
https://github.com/highlightjs/highlight.js/issues/2277`),Nt=ye,bt=Be),et===void 0&&(et=!0);const On={code:bt,language:Nt};hs("before:highlight",On);const Nr=On.result?On.result:ct(On.language,On.code,et);return Nr.code=On.code,hs("after:highlight",Nr),Nr}function ct(ye,Be,et,bt){const Nt=Object.create(null);function On(Se,$e){return Se.keywords[$e]}function Nr(){if(!Ge.keywords){Kt.addText(yt);return}let Se=0;Ge.keywordPatternRe.lastIndex=0;let $e=Ge.keywordPatternRe.exec(yt),Xe="";for(;$e;){Xe+=yt.substring(Se,$e.index);const lt=Hn.case_insensitive?$e[0].toLowerCase():$e[0],Ht=On(Ge,lt);if(Ht){const[pr,fv]=Ht;if(Kt.addText(Xe),Xe="",Nt[lt]=(Nt[lt]||0)+1,Nt[lt]<=In&&(ys+=fv),pr.startsWith("_"))Xe+=$e[0];else{const gv=Hn.classNameAliases[pr]||pr;qn($e[0],gv)}}else Xe+=$e[0];Se=Ge.keywordPatternRe.lastIndex,$e=Ge.keywordPatternRe.exec(yt)}Xe+=yt.substring(Se),Kt.addText(Xe)}function ms(){if(yt==="")return;let Se=null;if(typeof Ge.subLanguage=="string"){if(!X[Ge.subLanguage]){Kt.addText(yt);return}Se=ct(Ge.subLanguage,yt,!0,zd[Ge.subLanguage]),zd[Ge.subLanguage]=Se._top}else Se=Rt(yt,Ge.subLanguage.length?Ge.subLanguage:null);Ge.relevance>0&&(ys+=Se.relevance),Kt.__addSublanguage(Se._emitter,Se.language)}function ln(){Ge.subLanguage!=null?ms():Nr(),yt=""}function qn(Se,$e){Se!==""&&(Kt.startScope($e),Kt.addText(Se),Kt.endScope())}function Ld(Se,$e){let Xe=1;const lt=$e.length-1;for(;Xe<=lt;){if(!Se._emit[Xe]){Xe++;continue}const Ht=Hn.classNameAliases[Se[Xe]]||Se[Xe],pr=$e[Xe];Ht?qn(pr,Ht):(yt=pr,Nr(),yt=""),Xe++}}function $d(Se,$e){return Se.scope&&typeof Se.scope=="string"&&Kt.openNode(Hn.classNameAliases[Se.scope]||Se.scope),Se.beginScope&&(Se.beginScope._wrap?(qn(yt,Hn.classNameAliases[Se.beginScope._wrap]||Se.beginScope._wrap),yt=""):Se.beginScope._multi&&(Ld(Se.beginScope,$e),yt="")),Ge=Object.create(Se,{parent:{value:Ge}}),Ge}function Fd(Se,$e,Xe){let lt=w(Se.endRe,Xe);if(lt){if(Se["on:end"]){const Ht=new t(Se);Se["on:end"]($e,Ht),Ht.isMatchIgnored&&(lt=!1)}if(lt){for(;Se.endsParent&&Se.parent;)Se=Se.parent;return Se}}if(Se.endsWithParent)return Fd(Se.parent,$e,Xe)}function av(Se){return Ge.matcher.regexIndex===0?(yt+=Se[0],1):(tu=!0,0)}function uv(Se){const $e=Se[0],Xe=Se.rule,lt=new t(Xe),Ht=[Xe.__beforeBegin,Xe["on:begin"]];for(const pr of Ht)if(pr&&(pr(Se,lt),lt.isMatchIgnored))return av($e);return Xe.skip?yt+=$e:(Xe.excludeBegin&&(yt+=$e),ln(),!Xe.returnBegin&&!Xe.excludeBegin&&(yt=$e)),$d(Xe,Se),Xe.returnBegin?0:$e.length}function cv(Se){const $e=Se[0],Xe=Be.substring(Se.index),lt=Fd(Ge,Se,Xe);if(!lt)return nt;const Ht=Ge;Ge.endScope&&Ge.endScope._wrap?(ln(),qn($e,Ge.endScope._wrap)):Ge.endScope&&Ge.endScope._multi?(ln(),Ld(Ge.endScope,Se)):Ht.skip?yt+=$e:(Ht.returnEnd||Ht.excludeEnd||(yt+=$e),ln(),Ht.excludeEnd&&(yt=$e));do Ge.scope&&Kt.closeNode(),!Ge.skip&&!Ge.subLanguage&&(ys+=Ge.relevance),Ge=Ge.parent;while(Ge!==lt.parent);return lt.starts&&$d(lt.starts,Se),Ht.returnEnd?0:$e.length}function lv(){const Se=[];for(let $e=Ge;$e!==Hn;$e=$e.parent)$e.scope&&Se.unshift($e.scope);Se.forEach($e=>Kt.openNode($e))}let bs={};function Bd(Se,$e){const Xe=$e&&$e[0];if(yt+=Se,Xe==null)return ln(),0;if(bs.type==="begin"&&$e.type==="end"&&bs.index===$e.index&&Xe===""){if(yt+=Be.slice($e.index,$e.index+1),!Fe){const lt=new Error(`0 width match regex (${ye})`);throw lt.languageName=ye,lt.badRule=bs.rule,lt}return 1}if(bs=$e,$e.type==="begin")return uv($e);if($e.type==="illegal"&&!et){const lt=new Error('Illegal lexeme "'+Xe+'" for mode "'+(Ge.scope||"<unnamed>")+'"');throw lt.mode=Ge,lt}else if($e.type==="end"){const lt=cv($e);if(lt!==nt)return lt}if($e.type==="illegal"&&Xe==="")return yt+=`
|
|
23
|
+
`,1;if(eu>1e5&&eu>$e.index*3)throw new Error("potential infinite loop, way more iterations than matches");return yt+=Xe,Xe.length}const Hn=Rn(ye);if(!Hn)throw Pe(Ze.replace("{}",ye)),new Error('Unknown language: "'+ye+'"');const dv=to(Hn);let Qa="",Ge=bt||dv;const zd={},Kt=new U.__emitter(U);lv();let yt="",ys=0,ro=0,eu=0,tu=!1;try{if(Hn.__emitTokens)Hn.__emitTokens(Be,Kt);else{for(Ge.matcher.considerAll();;){eu++,tu?tu=!1:Ge.matcher.considerAll(),Ge.matcher.lastIndex=ro;const Se=Ge.matcher.exec(Be);if(!Se)break;const $e=Be.substring(ro,Se.index),Xe=Bd($e,Se);ro=Se.index+Xe}Bd(Be.substring(ro))}return Kt.finalize(),Qa=Kt.toHTML(),{language:ye,value:Qa,relevance:ys,illegal:!1,_emitter:Kt,_top:Ge}}catch(Se){if(Se.message&&Se.message.includes("Illegal"))return{language:ye,value:fr(Be),illegal:!0,relevance:0,_illegalBy:{message:Se.message,index:ro,context:Be.slice(ro-100,ro+100),mode:Se.mode,resultSoFar:Qa},_emitter:Kt};if(Fe)return{language:ye,value:fr(Be),illegal:!1,relevance:0,errorRaised:Se,_emitter:Kt,_top:Ge};throw Se}}function St(ye){const Be={value:fr(ye),illegal:!1,relevance:0,_top:_e,_emitter:new U.__emitter(U)};return Be._emitter.addText(ye),Be}function Rt(ye,Be){Be=Be||U.languages||Object.keys(X);const et=St(ye),bt=Be.filter(Rn).filter(on).map(ln=>ct(ln,ye,!1));bt.unshift(et);const Nt=bt.sort((ln,qn)=>{if(ln.relevance!==qn.relevance)return qn.relevance-ln.relevance;if(ln.language&&qn.language){if(Rn(ln.language).supersetOf===qn.language)return 1;if(Rn(qn.language).supersetOf===ln.language)return-1}return 0}),[On,Nr]=Nt,ms=On;return ms.secondBest=Nr,ms}function Xt(ye,Be,et){const bt=Be&&be[Be]||et;ye.classList.add("hljs"),ye.classList.add(`language-${bt}`)}function cn(ye){let Be=null;const et=pe(ye);if(ie(et))return;if(hs("before:highlightElement",{el:ye,language:et}),ye.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",ye);return}if(ye.children.length>0&&(U.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(ye)),U.throwUnescapedHTML))throw new Or("One of your code blocks includes unescaped HTML.",ye.innerHTML);Be=ye;const bt=Be.textContent,Nt=et?Le(bt,{language:et,ignoreIllegals:!0}):Rt(bt);ye.innerHTML=Nt.value,ye.dataset.highlighted="yes",Xt(ye,et,Nt.language),ye.result={language:Nt.language,re:Nt.relevance,relevance:Nt.relevance},Nt.secondBest&&(ye.secondBest={language:Nt.secondBest.language,relevance:Nt.secondBest.relevance}),hs("after:highlightElement",{el:ye,result:Nt,text:bt})}function Jt(ye){U=gr(U,ye)}const ft=()=>{rt(),It("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function Ne(){rt(),It("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let kt=!1;function rt(){function ye(){rt()}if(document.readyState==="loading"){kt||window.addEventListener("DOMContentLoaded",ye,!1),kt=!0;return}document.querySelectorAll(U.cssSelector).forEach(cn)}function qt(ye,Be){let et=null;try{et=Be(R)}catch(bt){if(Pe("Language definition for '{}' could not be registered.".replace("{}",ye)),Fe)Pe(bt);else throw bt;et=_e}et.name||(et.name=ye),X[ye]=et,et.rawDefinition=Be.bind(null,R),et.aliases&&ko(et.aliases,{languageName:ye})}function So(ye){delete X[ye];for(const Be of Object.keys(be))be[Be]===ye&&delete be[Be]}function ds(){return Object.keys(X)}function Rn(ye){return ye=(ye||"").toLowerCase(),X[ye]||X[be[ye]]}function ko(ye,{languageName:Be}){typeof ye=="string"&&(ye=[ye]),ye.forEach(et=>{be[et.toLowerCase()]=Be})}function on(ye){const Be=Rn(ye);return Be&&!Be.disableAutodetect}function fs(ye){ye["before:highlightBlock"]&&!ye["before:highlightElement"]&&(ye["before:highlightElement"]=Be=>{ye["before:highlightBlock"](Object.assign({block:Be.el},Be))}),ye["after:highlightBlock"]&&!ye["after:highlightElement"]&&(ye["after:highlightElement"]=Be=>{ye["after:highlightBlock"](Object.assign({block:Be.el},Be))})}function gs(ye){fs(ye),le.push(ye)}function ps(ye){const Be=le.indexOf(ye);Be!==-1&&le.splice(Be,1)}function hs(ye,Be){const et=ye;le.forEach(function(bt){bt[et]&&bt[et](Be)})}function sv(ye){return It("10.7.0","highlightBlock will be removed entirely in v12.0"),It("10.7.0","Please use highlightElement now."),cn(ye)}Object.assign(R,{highlight:Le,highlightAuto:Rt,highlightAll:rt,highlightElement:cn,highlightBlock:sv,configure:Jt,initHighlighting:ft,initHighlightingOnLoad:Ne,registerLanguage:qt,unregisterLanguage:So,listLanguages:ds,getLanguage:Rn,registerAliases:ko,autoDetection:on,inherit:gr,addPlugin:gs,removePlugin:ps}),R.debugMode=function(){Fe=!1},R.safeMode=function(){Fe=!0},R.versionString=$t,R.regex={concat:m,lookahead:g,either:v,optional:h,anyNumberOfTimes:p};for(const ye in oe)typeof oe[ye]=="object"&&e(oe[ye]);return Object.assign(R,oe),R},Te=ge({});return Te.newInstance=()=>ge({}),Au=Te,Te.HighlightJS=Te,Te.default=Te,Au}var Tu,Xg;function I6(){if(Xg)return Tu;Xg=1;function e(t){const n=t.regex,r=n.concat(/[\p{L}_]/u,n.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),o=/[\p{L}0-9._:-]+/u,i={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},s={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},a=t.inherit(s,{begin:/\(/,end:/\)/}),u=t.inherit(t.APOS_STRING_MODE,{className:"string"}),c=t.inherit(t.QUOTE_STRING_MODE,{className:"string"}),l={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",begin:o,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[i]},{begin:/'/,end:/'/,contains:[i]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,relevance:10,contains:[s,c,u,a,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[s,a,c,u]}]}]},t.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},i,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[c]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/<style(?=\s|>)/,end:/>/,keywords:{name:"style"},contains:[l],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[l],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:n.concat(/</,n.lookahead(n.concat(r,n.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:r,relevance:0,starts:l}]},{className:"tag",begin:n.concat(/<\//,n.lookahead(n.concat(r,/>/))),contains:[{className:"name",begin:r,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}return Tu=e,Tu}var Du,Jg;function R6(){if(Jg)return Du;Jg=1;function e(t){const n=t.regex,r={},o={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[r]}]};Object.assign(r,{className:"variable",variants:[{begin:n.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},o]});const i={className:"subst",begin:/\$\(/,end:/\)/,contains:[t.BACKSLASH_ESCAPE]},s=t.inherit(t.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),a={begin:/<<-?\s*(?=\w+)/,starts:{contains:[t.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},u={className:"string",begin:/"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,r,i]};i.contains.push(u);const c={match:/\\"/},l={className:"string",begin:/'/,end:/'/},d={match:/\\'/},g={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},t.NUMBER_MODE,r]},p=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],h=t.SHEBANG({binary:`(${p.join("|")})`,relevance:10}),m={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[t.inherit(t.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},y=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],v=["true","false"],b={match:/(\/[a-z._-]+)+/},w=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],E=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],C=["autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp"],k=["chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"];return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:y,literal:v,built_in:[...w,...E,"set","shopt",...C,...k]},contains:[h,t.SHEBANG(),m,g,s,a,b,u,c,l,d,r]}}return Du=e,Du}var Iu,Qg;function O6(){if(Qg)return Iu;Qg=1;function e(t){const n=t.regex,r=t.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),o="decltype\\(auto\\)",i="[a-zA-Z_]\\w*::",a="("+o+"|"+n.optional(i)+"[a-zA-Z_]\\w*"+n.optional("<[^<>]+>")+")",u={className:"type",variants:[{begin:"\\b[a-z\\d_]*_t\\b"},{match:/\batomic_[a-z]{3,6}\b/}]},l={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[t.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},t.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},d={className:"number",variants:[{match:/\b(0b[01']+)/},{match:/(-?)\b([\d']+(\.[\d']*)?|\.[\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)/},{match:/(-?)\b(0[xX][a-fA-F0-9]+(?:'[a-fA-F0-9]+)*(?:\.[a-fA-F0-9]*(?:'[a-fA-F0-9]*)*)?(?:[pP][-+]?[0-9]+)?(l|L)?(u|U)?)/},{match:/(-?)\b\d+(?:'\d+)*(?:\.\d*(?:'\d*)*)?(?:[eE][-+]?\d+)?/}],relevance:0},g={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef elifdef elifndef include"},contains:[{begin:/\\\n/,relevance:0},t.inherit(l,{className:"string"}),{className:"string",begin:/<.*?>/},r,t.C_BLOCK_COMMENT_MODE]},p={className:"title",begin:n.optional(i)+t.IDENT_RE,relevance:0},h=n.optional(i)+t.IDENT_RE+"\\s*\\(",v={keyword:["asm","auto","break","case","continue","default","do","else","enum","extern","for","fortran","goto","if","inline","register","restrict","return","sizeof","typeof","typeof_unqual","struct","switch","typedef","union","volatile","while","_Alignas","_Alignof","_Atomic","_Generic","_Noreturn","_Static_assert","_Thread_local","alignas","alignof","noreturn","static_assert","thread_local","_Pragma"],type:["float","double","signed","unsigned","int","short","long","char","void","_Bool","_BitInt","_Complex","_Imaginary","_Decimal32","_Decimal64","_Decimal96","_Decimal128","_Decimal64x","_Decimal128x","_Float16","_Float32","_Float64","_Float128","_Float32x","_Float64x","_Float128x","const","static","constexpr","complex","bool","imaginary"],literal:"true false NULL",built_in:"std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr"},b=[g,u,r,t.C_BLOCK_COMMENT_MODE,d,l],w={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:v,contains:b.concat([{begin:/\(/,end:/\)/,keywords:v,contains:b.concat(["self"]),relevance:0}]),relevance:0},E={begin:"("+a+"[\\*&\\s]+)+"+h,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:v,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:o,keywords:v,relevance:0},{begin:h,returnBegin:!0,contains:[t.inherit(p,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:v,relevance:0,contains:[r,t.C_BLOCK_COMMENT_MODE,l,d,u,{begin:/\(/,end:/\)/,keywords:v,relevance:0,contains:["self",r,t.C_BLOCK_COMMENT_MODE,l,d,u]}]},u,r,t.C_BLOCK_COMMENT_MODE,g]};return{name:"C",aliases:["h"],keywords:v,disableAutodetect:!0,illegal:"</",contains:[].concat(w,E,b,[g,{begin:t.IDENT_RE+"::",keywords:v},{className:"class",beginKeywords:"enum class struct union",end:/[{;:<>=]/,contains:[{beginKeywords:"final class struct"},t.TITLE_MODE]}]),exports:{preprocessor:g,strings:l,keywords:v}}}return Iu=e,Iu}var Ru,ep;function N6(){if(ep)return Ru;ep=1;function e(t){const n=t.regex,r=t.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),o="decltype\\(auto\\)",i="[a-zA-Z_]\\w*::",a="(?!struct)("+o+"|"+n.optional(i)+"[a-zA-Z_]\\w*"+n.optional("<[^<>]+>")+")",u={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},l={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[t.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},t.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},d={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},g={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},t.inherit(l,{className:"string"}),{className:"string",begin:/<.*?>/},r,t.C_BLOCK_COMMENT_MODE]},p={className:"title",begin:n.optional(i)+t.IDENT_RE,relevance:0},h=n.optional(i)+t.IDENT_RE+"\\s*\\(",m=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],y=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],v=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],b=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],C={type:y,keyword:m,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:v},k={className:"function.dispatch",relevance:0,keywords:{_hint:b},begin:n.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,t.IDENT_RE,n.lookahead(/(<[^<>]+>|)\s*\(/))},T=[k,g,u,r,t.C_BLOCK_COMMENT_MODE,d,l],S={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:C,contains:T.concat([{begin:/\(/,end:/\)/,keywords:C,contains:T.concat(["self"]),relevance:0}]),relevance:0},A={className:"function",begin:"("+a+"[\\*&\\s]+)+"+h,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:C,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:o,keywords:C,relevance:0},{begin:h,returnBegin:!0,contains:[p],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[l,d]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:C,relevance:0,contains:[r,t.C_BLOCK_COMMENT_MODE,l,d,u,{begin:/\(/,end:/\)/,keywords:C,relevance:0,contains:["self",r,t.C_BLOCK_COMMENT_MODE,l,d,u]}]},u,r,t.C_BLOCK_COMMENT_MODE,g]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:C,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(S,A,k,T,[g,{begin:"\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function|flat_map|flat_set)\\s*<(?!<)",end:">",keywords:C,contains:["self",u]},{begin:t.IDENT_RE+"::",keywords:C},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}return Ru=e,Ru}var Ou,tp;function M6(){if(tp)return Ou;tp=1;function e(t){const n=["bool","byte","char","decimal","delegate","double","dynamic","enum","float","int","long","nint","nuint","object","sbyte","short","string","ulong","uint","ushort"],r=["public","private","protected","static","internal","protected","abstract","async","extern","override","unsafe","virtual","new","sealed","partial"],o=["default","false","null","true"],i=["abstract","as","base","break","case","catch","class","const","continue","do","else","event","explicit","extern","finally","fixed","for","foreach","goto","if","implicit","in","interface","internal","is","lock","namespace","new","operator","out","override","params","private","protected","public","readonly","record","ref","return","scoped","sealed","sizeof","stackalloc","static","struct","switch","this","throw","try","typeof","unchecked","unsafe","using","virtual","void","volatile","while"],s=["add","alias","and","ascending","args","async","await","by","descending","dynamic","equals","file","from","get","global","group","init","into","join","let","nameof","not","notnull","on","or","orderby","partial","record","remove","required","scoped","select","set","unmanaged","value|0","var","when","where","with","yield"],a={keyword:i.concat(s),built_in:n,literal:o},u=t.inherit(t.TITLE_MODE,{begin:"[a-zA-Z](\\.?\\w)*"}),c={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},l={className:"string",begin:/"""("*)(?!")(.|\n)*?"""\1/,relevance:1},d={className:"string",begin:'@"',end:'"',contains:[{begin:'""'}]},g=t.inherit(d,{illegal:/\n/}),p={className:"subst",begin:/\{/,end:/\}/,keywords:a},h=t.inherit(p,{illegal:/\n/}),m={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},t.BACKSLASH_ESCAPE,h]},y={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},p]},v=t.inherit(y,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},h]});p.contains=[y,m,d,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,c,t.C_BLOCK_COMMENT_MODE],h.contains=[v,m,g,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,c,t.inherit(t.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];const b={variants:[l,y,m,d,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},w={begin:"<",end:">",contains:[{beginKeywords:"in out"},u]},E=t.IDENT_RE+"(<"+t.IDENT_RE+"(\\s*,\\s*"+t.IDENT_RE+")*>)?(\\[\\])?",C={begin:"@"+t.IDENT_RE,relevance:0};return{name:"C#",aliases:["cs","c#"],keywords:a,illegal:/::/,contains:[t.COMMENT("///","$",{returnBegin:!0,contains:[{className:"doctag",variants:[{begin:"///",relevance:0},{begin:"<!--|-->"},{begin:"</?",end:">"}]}]}),t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,{className:"meta",begin:"#",end:"$",keywords:{keyword:"if else elif endif define undef warning error line region endregion pragma checksum"}},b,c,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},u,w,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[u,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[u,w,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{className:"meta",begin:"^\\s*\\[(?=[\\w])",excludeBegin:!0,end:"\\]",excludeEnd:!0,contains:[{className:"string",begin:/"/,end:/"/}]},{beginKeywords:"new return throw await else",relevance:0},{className:"function",begin:"("+E+"\\s+)+"+t.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:a,contains:[{beginKeywords:r.join(" "),relevance:0},{begin:t.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,contains:[t.TITLE_MODE,w],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,relevance:0,contains:[b,c,t.C_BLOCK_COMMENT_MODE]},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},C]}}return Ou=e,Ou}var Nu,np;function P6(){if(np)return Nu;np=1;const e=c=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:c.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[c.APOS_STRING_MODE,c.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:c.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),t=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],n=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],r=[...t,...n],o=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),i=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),s=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),a=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function u(c){const l=c.regex,d=e(c),g={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},p="and or not only",h=/@-?\w[\w]*(-\w+)*/,m="[a-zA-Z-][a-zA-Z0-9_-]*",y=[c.APOS_STRING_MODE,c.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[d.BLOCK_COMMENT,g,d.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\."+m,relevance:0},d.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+i.join("|")+")"},{begin:":(:)?("+s.join("|")+")"}]},d.CSS_VARIABLE,{className:"attribute",begin:"\\b("+a.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[d.BLOCK_COMMENT,d.HEXCOLOR,d.IMPORTANT,d.CSS_NUMBER_MODE,...y,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...y,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},d.FUNCTION_DISPATCH]},{begin:l.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:h},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:p,attribute:o.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...y,d.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+r.join("|")+")\\b"}]}}return Nu=u,Nu}var Mu,rp;function L6(){if(rp)return Mu;rp=1;function e(t){const n=t.regex,r={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},o={begin:"^[-\\*]{3,}",end:"$"},i={className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},s={className:"bullet",begin:"^[ ]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},a={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},u=/[A-Za-z][A-Za-z0-9+.-]*/,c={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:n.concat(/\[.+?\]\(/,u,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},l={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},d={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},g=t.inherit(l,{contains:[]}),p=t.inherit(d,{contains:[]});l.contains.push(p),d.contains.push(g);let h=[r,c];return[l,d,g,p].forEach(b=>{b.contains=b.contains.concat(h)}),h=h.concat(l,d),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:h},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:h}]}]},r,s,l,d,{className:"quote",begin:"^>\\s+",contains:h,end:"$"},i,o,c,a,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}return Mu=e,Mu}var Pu,op;function $6(){if(op)return Pu;op=1;function e(t){const n=t.regex;return{name:"Diff",aliases:["patch"],contains:[{className:"meta",relevance:10,match:n.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)},{className:"comment",variants:[{begin:n.either(/Index: /,/^index/,/={3,}/,/^-{3}/,/^\*{3} /,/^\+{3}/,/^diff --git/),end:/$/},{match:/^\*{15}$/}]},{className:"addition",begin:/^\+/,end:/$/},{className:"deletion",begin:/^-/,end:/$/},{className:"addition",begin:/^!/,end:/$/}]}}return Pu=e,Pu}var Lu,ip;function F6(){if(ip)return Lu;ip=1;function e(t){const n=t.regex,r="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",o=n.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),i=n.concat(o,/(::\w+)*/),a={"variable.constant":["__FILE__","__LINE__","__ENCODING__"],"variable.language":["self","super"],keyword:["alias","and","begin","BEGIN","break","case","class","defined","do","else","elsif","end","END","ensure","for","if","in","module","next","not","or","redo","require","rescue","retry","return","then","undef","unless","until","when","while","yield",...["include","extend","prepend","public","private","protected","raise","throw"]],built_in:["proc","lambda","attr_accessor","attr_reader","attr_writer","define_method","private_constant","module_function"],literal:["true","false","nil"]},u={className:"doctag",begin:"@[A-Za-z]+"},c={begin:"#<",end:">"},l=[t.COMMENT("#","$",{contains:[u]}),t.COMMENT("^=begin","^=end",{contains:[u],relevance:10}),t.COMMENT("^__END__",t.MATCH_NOTHING_RE)],d={className:"subst",begin:/#\{/,end:/\}/,keywords:a},g={className:"string",contains:[t.BACKSLASH_ESCAPE,d],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:/%[qQwWx]?\(/,end:/\)/},{begin:/%[qQwWx]?\[/,end:/\]/},{begin:/%[qQwWx]?\{/,end:/\}/},{begin:/%[qQwWx]?</,end:/>/},{begin:/%[qQwWx]?\//,end:/\//},{begin:/%[qQwWx]?%/,end:/%/},{begin:/%[qQwWx]?-/,end:/-/},{begin:/%[qQwWx]?\|/,end:/\|/},{begin:/\B\?(\\\d{1,3})/},{begin:/\B\?(\\x[A-Fa-f0-9]{1,2})/},{begin:/\B\?(\\u\{?[A-Fa-f0-9]{1,6}\}?)/},{begin:/\B\?(\\M-\\C-|\\M-\\c|\\c\\M-|\\M-|\\C-\\M-)[\x20-\x7e]/},{begin:/\B\?\\(c|C-)[\x20-\x7e]/},{begin:/\B\?\\?\S/},{begin:n.concat(/<<[-~]?'?/,n.lookahead(/(\w+)(?=\W)[^\n]*\n(?:[^\n]*\n)*?\s*\1\b/)),contains:[t.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[t.BACKSLASH_ESCAPE,d]})]}]},p="[1-9](_?[0-9])*|0",h="[0-9](_?[0-9])*",m={className:"number",relevance:0,variants:[{begin:`\\b(${p})(\\.(${h}))?([eE][+-]?(${h})|r)?i?\\b`},{begin:"\\b0[dD][0-9](_?[0-9])*r?i?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*r?i?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*r?i?\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b"},{begin:"\\b0(_?[0-7])+r?i?\\b"}]},y={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:a}]},T=[g,{variants:[{match:[/class\s+/,i,/\s+<\s+/,i]},{match:[/\b(class|module)\s+/,i]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:a},{match:[/(include|extend)\s+/,i],scope:{2:"title.class"},keywords:a},{relevance:0,match:[i,/\.new[. (]/],scope:{1:"title.class"}},{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},{relevance:0,match:o,scope:"title.class"},{match:[/def/,/\s+/,r],scope:{1:"keyword",3:"title.function"},contains:[y]},{begin:t.IDENT_RE+"::"},{className:"symbol",begin:t.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[g,{begin:r}],relevance:0},m,{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},{className:"params",begin:/\|(?!=)/,end:/\|/,excludeBegin:!0,excludeEnd:!0,relevance:0,keywords:a},{begin:"("+t.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[{className:"regexp",contains:[t.BACKSLASH_ESCAPE,d],illegal:/\n/,variants:[{begin:"/",end:"/[a-z]*"},{begin:/%r\{/,end:/\}[a-z]*/},{begin:"%r\\(",end:"\\)[a-z]*"},{begin:"%r!",end:"![a-z]*"},{begin:"%r\\[",end:"\\][a-z]*"}]}].concat(c,l),relevance:0}].concat(c,l);d.contains=T,y.contains=T;const O=[{begin:/^\s*=>/,starts:{end:"$",contains:T}},{className:"meta.prompt",begin:"^("+"[>?]>"+"|"+"[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]"+"|"+"(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>"+")(?=[ ])",starts:{end:"$",keywords:a,contains:T}}];return l.unshift(c),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:a,illegal:/\/\*/,contains:[t.SHEBANG({binary:"ruby"})].concat(O).concat(l).concat(T)}}return Lu=e,Lu}var $u,sp;function B6(){if(sp)return $u;sp=1;function e(t){const s={keyword:["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var"],type:["bool","byte","complex64","complex128","error","float32","float64","int8","int16","int32","int64","string","uint8","uint16","uint32","uint64","int","uint","uintptr","rune"],literal:["true","false","iota","nil"],built_in:["append","cap","close","complex","copy","imag","len","make","new","panic","print","println","real","recover","delete"]};return{name:"Go",aliases:["golang"],keywords:s,illegal:"</",contains:[t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,{className:"string",variants:[t.QUOTE_STRING_MODE,t.APOS_STRING_MODE,{begin:"`",end:"`"}]},{className:"number",variants:[{match:/-?\b0[xX]\.[a-fA-F0-9](_?[a-fA-F0-9])*[pP][+-]?\d(_?\d)*i?/,relevance:0},{match:/-?\b0[xX](_?[a-fA-F0-9])+((\.([a-fA-F0-9](_?[a-fA-F0-9])*)?)?[pP][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b0[oO](_?[0-7])*i?/,relevance:0},{match:/-?\.\d(_?\d)*([eE][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b\d(_?\d)*(\.(\d(_?\d)*)?)?([eE][+-]?\d(_?\d)*)?i?/,relevance:0}]},{begin:/:=/},{className:"function",beginKeywords:"func",end:"\\s*(\\{|$)",excludeEnd:!0,contains:[t.TITLE_MODE,{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:s,illegal:/["']/}]}]}}return $u=e,$u}var Fu,ap;function z6(){if(ap)return Fu;ap=1;function e(t){const n=t.regex,r=/[_A-Za-z][_0-9A-Za-z]*/;return{name:"GraphQL",aliases:["gql"],case_insensitive:!0,disableAutodetect:!1,keywords:{keyword:["query","mutation","subscription","type","input","schema","directive","interface","union","scalar","fragment","enum","on"],literal:["true","false","null"]},contains:[t.HASH_COMMENT_MODE,t.QUOTE_STRING_MODE,t.NUMBER_MODE,{scope:"punctuation",match:/[.]{3}/,relevance:0},{scope:"punctuation",begin:/[\!\(\)\:\=\[\]\{\|\}]{1}/,relevance:0},{scope:"variable",begin:/\$/,end:/\W/,excludeEnd:!0,relevance:0},{scope:"meta",match:/@\w+/,excludeEnd:!0},{scope:"symbol",begin:n.concat(r,n.lookahead(/\s*:/)),relevance:0}],illegal:[/[;<']/,/BEGIN/]}}return Fu=e,Fu}var Bu,up;function U6(){if(up)return Bu;up=1;function e(t){const n=t.regex,r={className:"number",relevance:0,variants:[{begin:/([+-]+)?[\d]+_[\d_]+/},{begin:t.NUMBER_RE}]},o=t.COMMENT();o.variants=[{begin:/;/,end:/$/},{begin:/#/,end:/$/}];const i={className:"variable",variants:[{begin:/\$[\w\d"][\w\d_]*/},{begin:/\$\{(.*?)\}/}]},s={className:"literal",begin:/\bon|off|true|false|yes|no\b/},a={className:"string",contains:[t.BACKSLASH_ESCAPE],variants:[{begin:"'''",end:"'''",relevance:10},{begin:'"""',end:'"""',relevance:10},{begin:'"',end:'"'},{begin:"'",end:"'"}]},u={begin:/\[/,end:/\]/,contains:[o,s,i,a,r,"self"],relevance:0},c=/[A-Za-z0-9_-]+/,l=/"(\\"|[^"])*"/,d=/'[^']*'/,g=n.either(c,l,d),p=n.concat(g,"(\\s*\\.\\s*",g,")*",n.lookahead(/\s*=\s*[^#\s]/));return{name:"TOML, also INI",aliases:["toml"],case_insensitive:!0,illegal:/\S/,contains:[o,{className:"section",begin:/\[+/,end:/\]+/},{begin:p,className:"attr",starts:{end:/$/,contains:[o,u,s,i,a,r]}}]}}return Bu=e,Bu}var zu,cp;function K6(){if(cp)return zu;cp=1;var e="[0-9](_*[0-9])*",t=`\\.(${e})`,n="[0-9a-fA-F](_*[0-9a-fA-F])*",r={className:"number",variants:[{begin:`(\\b(${e})((${t})|\\.)?|(${t}))[eE][+-]?(${e})[fFdD]?\\b`},{begin:`\\b(${e})((${t})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${t})[fFdD]?\\b`},{begin:`\\b(${e})[fFdD]\\b`},{begin:`\\b0[xX]((${n})\\.?|(${n})?\\.(${n}))[pP][+-]?(${e})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${n})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function o(s,a,u){return u===-1?"":s.replace(a,c=>o(s,a,u-1))}function i(s){const a=s.regex,u="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",c=u+o("(?:<"+u+"~~~(?:\\s*,\\s*"+u+"~~~)*>)?",/~~~/g,2),h={keyword:["synchronized","abstract","private","var","static","if","const ","for","while","strictfp","finally","protected","import","native","final","void","enum","else","break","transient","catch","instanceof","volatile","case","assert","package","default","public","try","switch","continue","throws","protected","public","private","module","requires","exports","do","sealed","yield","permits","goto","when"],literal:["false","true","null"],type:["char","boolean","long","float","int","byte","short","double"],built_in:["super","this"]},m={className:"meta",begin:"@"+u,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},y={className:"params",begin:/\(/,end:/\)/,keywords:h,relevance:0,contains:[s.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:h,illegal:/<\/|#/,contains:[s.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{begin:/import java\.[a-z]+\./,keywords:"import",relevance:2},s.C_LINE_COMMENT_MODE,s.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:"string",contains:[s.BACKSLASH_ESCAPE]},s.APOS_STRING_MODE,s.QUOTE_STRING_MODE,{match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,u],className:{1:"keyword",3:"title.class"}},{match:/non-sealed/,scope:"keyword"},{begin:[a.concat(/(?!else)/,u),/\s+/,u,/\s+/,/=(?!=)/],className:{1:"type",3:"variable",5:"operator"}},{begin:[/record/,/\s+/,u],className:{1:"keyword",3:"title.class"},contains:[y,s.C_LINE_COMMENT_MODE,s.C_BLOCK_COMMENT_MODE]},{beginKeywords:"new throw return else",relevance:0},{begin:["(?:"+c+"\\s+)",s.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:"title.function"},keywords:h,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:h,relevance:0,contains:[m,s.APOS_STRING_MODE,s.QUOTE_STRING_MODE,r,s.C_BLOCK_COMMENT_MODE]},s.C_LINE_COMMENT_MODE,s.C_BLOCK_COMMENT_MODE]},r,m]}}return zu=i,zu}var Uu,lp;function j6(){if(lp)return Uu;lp=1;const e="[A-Za-z$_][0-9A-Za-z$_]*",t=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],n=["true","false","null","undefined","NaN","Infinity"],r=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],o=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],i=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],s=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],a=[].concat(i,r,o);function u(c){const l=c.regex,d=(Z,{after:M})=>{const W="</"+Z[0].slice(1);return Z.input.indexOf(W,M)!==-1},g=e,p={begin:"<>",end:"</>"},h=/<[A-Za-z0-9\\._:-]+\s*\/>/,m={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(Z,M)=>{const W=Z[0].length+Z.index,oe=Z.input[W];if(oe==="<"||oe===","){M.ignoreMatch();return}oe===">"&&(d(Z,{after:W})||M.ignoreMatch());let te;const H=Z.input.substring(W);if(te=H.match(/^\s*=/)){M.ignoreMatch();return}if((te=H.match(/^\s+extends\s+/))&&te.index===0){M.ignoreMatch();return}}},y={$pattern:e,keyword:t,literal:n,built_in:a,"variable.language":s},v="[0-9](_?[0-9])*",b=`\\.(${v})`,w="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",E={className:"number",variants:[{begin:`(\\b(${w})((${b})|\\.)?|(${b}))[eE][+-]?(${v})\\b`},{begin:`\\b(${w})\\b((${b})\\b|\\.)?|(${b})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},C={className:"subst",begin:"\\$\\{",end:"\\}",keywords:y,contains:[]},k={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[c.BACKSLASH_ESCAPE,C],subLanguage:"xml"}},T={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[c.BACKSLASH_ESCAPE,C],subLanguage:"css"}},S={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[c.BACKSLASH_ESCAPE,C],subLanguage:"graphql"}},A={className:"string",begin:"`",end:"`",contains:[c.BACKSLASH_ESCAPE,C]},O={className:"comment",variants:[c.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:g+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),c.C_BLOCK_COMMENT_MODE,c.C_LINE_COMMENT_MODE]},P=[c.APOS_STRING_MODE,c.QUOTE_STRING_MODE,k,T,S,A,{match:/\$\d+/},E];C.contains=P.concat({begin:/\{/,end:/\}/,keywords:y,contains:["self"].concat(P)});const L=[].concat(O,C.contains),D=L.concat([{begin:/(\s*)\(/,end:/\)/,keywords:y,contains:["self"].concat(L)}]),B={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:y,contains:D},N={variants:[{match:[/class/,/\s+/,g,/\s+/,/extends/,/\s+/,l.concat(g,"(",l.concat(/\./,g),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,g],scope:{1:"keyword",3:"title.class"}}]},Y={relevance:0,match:l.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...r,...o]}},ce={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},V={variants:[{match:[/function/,/\s+/,g,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[B],illegal:/%/},j={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function he(Z){return l.concat("(?!",Z.join("|"),")")}const K={match:l.concat(/\b/,he([...i,"super","import"].map(Z=>`${Z}\\s*\\(`)),g,l.lookahead(/\s*\(/)),className:"title.function",relevance:0},z={begin:l.concat(/\./,l.lookahead(l.concat(g,/(?![0-9A-Za-z$_(])/))),end:g,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},J={match:[/get|set/,/\s+/,g,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},B]},re="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+c.UNDERSCORE_IDENT_RE+")\\s*=>",ve={match:[/const|var|let/,/\s+/,g,/\s*/,/=\s*/,/(async\s*)?/,l.lookahead(re)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[B]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:y,exports:{PARAMS_CONTAINS:D,CLASS_REFERENCE:Y},illegal:/#(?![$_A-z])/,contains:[c.SHEBANG({label:"shebang",binary:"node",relevance:5}),ce,c.APOS_STRING_MODE,c.QUOTE_STRING_MODE,k,T,S,A,O,{match:/\$\d+/},E,Y,{scope:"attr",match:g+l.lookahead(":"),relevance:0},ve,{begin:"("+c.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[O,c.REGEXP_MODE,{className:"function",begin:re,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:c.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:y,contains:D}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:p.begin,end:p.end},{match:h},{begin:m.begin,"on:begin":m.isTrulyOpeningTag,end:m.end}],subLanguage:"xml",contains:[{begin:m.begin,end:m.end,skip:!0,contains:["self"]}]}]},V,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+c.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[B,c.inherit(c.TITLE_MODE,{begin:g,className:"title.function"})]},{match:/\.\.\./,relevance:0},z,{match:"\\$"+g,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[B]},K,j,N,J,{match:/\$[(.]/}]}}return Uu=u,Uu}var Ku,dp;function q6(){if(dp)return Ku;dp=1;function e(t){const n={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},r={match:/[{}[\],:]/,className:"punctuation",relevance:0},o=["true","false","null"],i={scope:"literal",beginKeywords:o.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:o},contains:[n,r,t.QUOTE_STRING_MODE,i,t.C_NUMBER_MODE,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}return Ku=e,Ku}var ju,fp;function H6(){if(fp)return ju;fp=1;var e="[0-9](_*[0-9])*",t=`\\.(${e})`,n="[0-9a-fA-F](_*[0-9a-fA-F])*",r={className:"number",variants:[{begin:`(\\b(${e})((${t})|\\.)?|(${t}))[eE][+-]?(${e})[fFdD]?\\b`},{begin:`\\b(${e})((${t})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${t})[fFdD]?\\b`},{begin:`\\b(${e})[fFdD]\\b`},{begin:`\\b0[xX]((${n})\\.?|(${n})?\\.(${n}))[pP][+-]?(${e})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${n})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function o(i){const s={keyword:"abstract as val var vararg get set class object open private protected public noinline crossinline dynamic final enum if else do while for when throw try catch finally import package is in fun override companion reified inline lateinit init interface annotation data sealed internal infix operator out by constructor super tailrec where const inner suspend typealias external expect actual",built_in:"Byte Short Char Int Long Boolean Float Double Void Unit Nothing",literal:"true false null"},a={className:"keyword",begin:/\b(break|continue|return|this)\b/,starts:{contains:[{className:"symbol",begin:/@\w+/}]}},u={className:"symbol",begin:i.UNDERSCORE_IDENT_RE+"@"},c={className:"subst",begin:/\$\{/,end:/\}/,contains:[i.C_NUMBER_MODE]},l={className:"variable",begin:"\\$"+i.UNDERSCORE_IDENT_RE},d={className:"string",variants:[{begin:'"""',end:'"""(?=[^"])',contains:[l,c]},{begin:"'",end:"'",illegal:/\n/,contains:[i.BACKSLASH_ESCAPE]},{begin:'"',end:'"',illegal:/\n/,contains:[i.BACKSLASH_ESCAPE,l,c]}]};c.contains.push(d);const g={className:"meta",begin:"@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*"+i.UNDERSCORE_IDENT_RE+")?"},p={className:"meta",begin:"@"+i.UNDERSCORE_IDENT_RE,contains:[{begin:/\(/,end:/\)/,contains:[i.inherit(d,{className:"string"}),"self"]}]},h=r,m=i.COMMENT("/\\*","\\*/",{contains:[i.C_BLOCK_COMMENT_MODE]}),y={variants:[{className:"type",begin:i.UNDERSCORE_IDENT_RE},{begin:/\(/,end:/\)/,contains:[]}]},v=y;return v.variants[1].contains=[y],y.variants[1].contains=[v],{name:"Kotlin",aliases:["kt","kts"],keywords:s,contains:[i.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"}]}),i.C_LINE_COMMENT_MODE,m,a,u,g,p,{className:"function",beginKeywords:"fun",end:"[(]|$",returnBegin:!0,excludeEnd:!0,keywords:s,relevance:5,contains:[{begin:i.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,relevance:0,contains:[i.UNDERSCORE_TITLE_MODE]},{className:"type",begin:/</,end:/>/,keywords:"reified",relevance:0},{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:s,relevance:0,contains:[{begin:/:/,end:/[=,\/]/,endsWithParent:!0,contains:[y,i.C_LINE_COMMENT_MODE,m],relevance:0},i.C_LINE_COMMENT_MODE,m,g,p,d,i.C_NUMBER_MODE]},m]},{begin:[/class|interface|trait/,/\s+/,i.UNDERSCORE_IDENT_RE],beginScope:{3:"title.class"},keywords:"class interface trait",end:/[:\{(]|$/,excludeEnd:!0,illegal:"extends implements",contains:[{beginKeywords:"public protected internal private constructor"},i.UNDERSCORE_TITLE_MODE,{className:"type",begin:/</,end:/>/,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:/[,:]\s*/,end:/[<\(,){\s]|$/,excludeBegin:!0,returnEnd:!0},g,p]},d,{className:"meta",begin:"^#!/usr/bin/env",end:"$",illegal:`
|
|
24
|
+
`},h]}}return ju=o,ju}var qu,gp;function G6(){if(gp)return qu;gp=1;const e=l=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:l.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[l.APOS_STRING_MODE,l.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:l.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),t=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],n=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],r=[...t,...n],o=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),i=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),s=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),a=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse(),u=i.concat(s).sort().reverse();function c(l){const d=e(l),g=u,p="and or not only",h="[\\w-]+",m="("+h+"|@\\{"+h+"\\})",y=[],v=[],b=function(L){return{className:"string",begin:"~?"+L+".*?"+L}},w=function(L,D,B){return{className:L,begin:D,relevance:B}},E={$pattern:/[a-z-]+/,keyword:p,attribute:o.join(" ")},C={begin:"\\(",end:"\\)",contains:v,keywords:E,relevance:0};v.push(l.C_LINE_COMMENT_MODE,l.C_BLOCK_COMMENT_MODE,b("'"),b('"'),d.CSS_NUMBER_MODE,{begin:"(url|data-uri)\\(",starts:{className:"string",end:"[\\)\\n]",excludeEnd:!0}},d.HEXCOLOR,C,w("variable","@@?"+h,10),w("variable","@\\{"+h+"\\}"),w("built_in","~?`[^`]*?`"),{className:"attribute",begin:h+"\\s*:",end:":",returnBegin:!0,excludeEnd:!0},d.IMPORTANT,{beginKeywords:"and not"},d.FUNCTION_DISPATCH);const k=v.concat({begin:/\{/,end:/\}/,contains:y}),T={beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not"}].concat(v)},S={begin:m+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},d.CSS_VARIABLE,{className:"attribute",begin:"\\b("+a.join("|")+")\\b",end:/(?=:)/,starts:{endsWithParent:!0,illegal:"[<=$]",relevance:0,contains:v}}]},A={className:"keyword",begin:"@(import|media|charset|font-face|(-[a-z]+-)?keyframes|supports|document|namespace|page|viewport|host)\\b",starts:{end:"[;{}]",keywords:E,returnEnd:!0,contains:v,relevance:0}},F={className:"variable",variants:[{begin:"@"+h+"\\s*:",relevance:15},{begin:"@"+h}],starts:{end:"[;}]",returnEnd:!0,contains:k}},O={variants:[{begin:"[\\.#:&\\[>]",end:"[;{}]"},{begin:m,end:/\{/}],returnBegin:!0,returnEnd:!0,illegal:`[<='$"]`,relevance:0,contains:[l.C_LINE_COMMENT_MODE,l.C_BLOCK_COMMENT_MODE,T,w("keyword","all\\b"),w("variable","@\\{"+h+"\\}"),{begin:"\\b("+r.join("|")+")\\b",className:"selector-tag"},d.CSS_NUMBER_MODE,w("selector-tag",m,0),w("selector-id","#"+m),w("selector-class","\\."+m,0),w("selector-tag","&",0),d.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",begin:":("+i.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+s.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:k},{begin:"!important"},d.FUNCTION_DISPATCH]},P={begin:h+`:(:)?(${g.join("|")})`,returnBegin:!0,contains:[O]};return y.push(l.C_LINE_COMMENT_MODE,l.C_BLOCK_COMMENT_MODE,A,F,P,S,O,T,d.FUNCTION_DISPATCH),{name:"Less",case_insensitive:!0,illegal:`[=>'/<($"]`,contains:y}}return qu=c,qu}var Hu,pp;function V6(){if(pp)return Hu;pp=1;function e(t){const n="\\[=*\\[",r="\\]=*\\]",o={begin:n,end:r,contains:["self"]},i=[t.COMMENT("--(?!"+n+")","$"),t.COMMENT("--"+n,r,{contains:[o],relevance:10})];return{name:"Lua",aliases:["pluto"],keywords:{$pattern:t.UNDERSCORE_IDENT_RE,literal:"true false nil",keyword:"and break do else elseif end for goto if in local not or repeat return then until while",built_in:"_G _ENV _VERSION __index __newindex __mode __call __metatable __tostring __len __gc __add __sub __mul __div __mod __pow __concat __unm __eq __lt __le assert collectgarbage dofile error getfenv getmetatable ipairs load loadfile loadstring module next pairs pcall print rawequal rawget rawset require select setfenv setmetatable tonumber tostring type unpack xpcall arg self coroutine resume yield status wrap create running debug getupvalue debug sethook getmetatable gethook setmetatable setlocal traceback setfenv getinfo setupvalue getlocal getregistry getfenv io lines write close flush open output type read stderr stdin input stdout popen tmpfile math log max acos huge ldexp pi cos tanh pow deg tan cosh sinh random randomseed frexp ceil floor rad abs sqrt modf asin min mod fmod log10 atan2 exp sin atan os exit setlocale date getenv difftime remove time clock tmpname rename execute package preload loadlib loaded loaders cpath config path seeall string sub upper len gfind rep find match char dump gmatch reverse byte format gsub lower table setn insert getn foreachi maxn foreach concat sort remove"},contains:i.concat([{className:"function",beginKeywords:"function",end:"\\)",contains:[t.inherit(t.TITLE_MODE,{begin:"([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*"}),{className:"params",begin:"\\(",endsWithParent:!0,contains:i}].concat(i)},t.C_NUMBER_MODE,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,{className:"string",begin:n,end:r,contains:[o],relevance:5}])}}return Hu=e,Hu}var Gu,hp;function W6(){if(hp)return Gu;hp=1;function e(t){const n={className:"variable",variants:[{begin:"\\$\\("+t.UNDERSCORE_IDENT_RE+"\\)",contains:[t.BACKSLASH_ESCAPE]},{begin:/\$[@%<?\^\+\*]/}]},r={className:"string",begin:/"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,n]},o={className:"variable",begin:/\$\([\w-]+\s/,end:/\)/,keywords:{built_in:"subst patsubst strip findstring filter filter-out sort word wordlist firstword lastword dir notdir suffix basename addsuffix addprefix join wildcard realpath abspath error warning shell origin flavor foreach if or and call eval file value"},contains:[n,r]},i={begin:"^"+t.UNDERSCORE_IDENT_RE+"\\s*(?=[:+?]?=)"},s={className:"meta",begin:/^\.PHONY:/,end:/$/,keywords:{$pattern:/[\.\w]+/,keyword:".PHONY"}},a={className:"section",begin:/^[^\s]+:/,end:/$/,contains:[n]};return{name:"Makefile",aliases:["mk","mak","make"],keywords:{$pattern:/[\w-]+/,keyword:"define endef undefine ifdef ifndef ifeq ifneq else endif include -include sinclude override export unexport private vpath"},contains:[t.HASH_COMMENT_MODE,n,r,o,i,s,a]}}return Gu=e,Gu}var Vu,mp;function Y6(){if(mp)return Vu;mp=1;function e(t){const n=t.regex,r=["abs","accept","alarm","and","atan2","bind","binmode","bless","break","caller","chdir","chmod","chomp","chop","chown","chr","chroot","class","close","closedir","connect","continue","cos","crypt","dbmclose","dbmopen","defined","delete","die","do","dump","each","else","elsif","endgrent","endhostent","endnetent","endprotoent","endpwent","endservent","eof","eval","exec","exists","exit","exp","fcntl","field","fileno","flock","for","foreach","fork","format","formline","getc","getgrent","getgrgid","getgrnam","gethostbyaddr","gethostbyname","gethostent","getlogin","getnetbyaddr","getnetbyname","getnetent","getpeername","getpgrp","getpriority","getprotobyname","getprotobynumber","getprotoent","getpwent","getpwnam","getpwuid","getservbyname","getservbyport","getservent","getsockname","getsockopt","given","glob","gmtime","goto","grep","gt","hex","if","index","int","ioctl","join","keys","kill","last","lc","lcfirst","length","link","listen","local","localtime","log","lstat","lt","ma","map","method","mkdir","msgctl","msgget","msgrcv","msgsnd","my","ne","next","no","not","oct","open","opendir","or","ord","our","pack","package","pipe","pop","pos","print","printf","prototype","push","q|0","qq","quotemeta","qw","qx","rand","read","readdir","readline","readlink","readpipe","recv","redo","ref","rename","require","reset","return","reverse","rewinddir","rindex","rmdir","say","scalar","seek","seekdir","select","semctl","semget","semop","send","setgrent","sethostent","setnetent","setpgrp","setpriority","setprotoent","setpwent","setservent","setsockopt","shift","shmctl","shmget","shmread","shmwrite","shutdown","sin","sleep","socket","socketpair","sort","splice","split","sprintf","sqrt","srand","stat","state","study","sub","substr","symlink","syscall","sysopen","sysread","sysseek","system","syswrite","tell","telldir","tie","tied","time","times","tr","truncate","uc","ucfirst","umask","undef","unless","unlink","unpack","unshift","untie","until","use","utime","values","vec","wait","waitpid","wantarray","warn","when","while","write","x|0","xor","y|0"],o=/[dualxmsipngr]{0,12}/,i={$pattern:/[\w.]+/,keyword:r.join(" ")},s={className:"subst",begin:"[$@]\\{",end:"\\}",keywords:i},a={begin:/->\{/,end:/\}/},u={scope:"attr",match:/\s+:\s*\w+(\s*\(.*?\))?/},c={scope:"variable",variants:[{begin:/\$\d/},{begin:n.concat(/[$%@](?!")(\^\w\b|#\w+(::\w+)*|\{\w+\}|\w+(::\w*)*)/,"(?![A-Za-z])(?![@$%])")},{begin:/[$%@](?!")[^\s\w{=]|\$=/,relevance:0}],contains:[u]},l={className:"number",variants:[{match:/0?\.[0-9][0-9_]+\b/},{match:/\bv?(0|[1-9][0-9_]*(\.[0-9_]+)?|[1-9][0-9_]*)\b/},{match:/\b0[0-7][0-7_]*\b/},{match:/\b0x[0-9a-fA-F][0-9a-fA-F_]*\b/},{match:/\b0b[0-1][0-1_]*\b/}],relevance:0},d=[t.BACKSLASH_ESCAPE,s,c],g=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],p=(y,v,b="\\1")=>{const w=b==="\\1"?b:n.concat(b,v);return n.concat(n.concat("(?:",y,")"),v,/(?:\\.|[^\\\/])*?/,w,/(?:\\.|[^\\\/])*?/,b,o)},h=(y,v,b)=>n.concat(n.concat("(?:",y,")"),v,/(?:\\.|[^\\\/])*?/,b,o),m=[c,t.HASH_COMMENT_MODE,t.COMMENT(/^=\w/,/=cut/,{endsWithParent:!0}),a,{className:"string",contains:d,variants:[{begin:"q[qwxr]?\\s*\\(",end:"\\)",relevance:5},{begin:"q[qwxr]?\\s*\\[",end:"\\]",relevance:5},{begin:"q[qwxr]?\\s*\\{",end:"\\}",relevance:5},{begin:"q[qwxr]?\\s*\\|",end:"\\|",relevance:5},{begin:"q[qwxr]?\\s*<",end:">",relevance:5},{begin:"qw\\s+q",end:"q",relevance:5},{begin:"'",end:"'",contains:[t.BACKSLASH_ESCAPE]},{begin:'"',end:'"'},{begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE]},{begin:/\{\w+\}/,relevance:0},{begin:"-?\\w+\\s*=>",relevance:0}]},l,{begin:"(\\/\\/|"+t.RE_STARTERS_RE+"|\\b(split|return|print|reverse|grep)\\b)\\s*",keywords:"split return print reverse grep",relevance:0,contains:[t.HASH_COMMENT_MODE,{className:"regexp",variants:[{begin:p("s|tr|y",n.either(...g,{capture:!0}))},{begin:p("s|tr|y","\\(","\\)")},{begin:p("s|tr|y","\\[","\\]")},{begin:p("s|tr|y","\\{","\\}")}],relevance:2},{className:"regexp",variants:[{begin:/(m|qr)\/\//,relevance:0},{begin:h("(?:m|qr)?",/\//,/\//)},{begin:h("m|qr",n.either(...g,{capture:!0}),/\1/)},{begin:h("m|qr",/\(/,/\)/)},{begin:h("m|qr",/\[/,/\]/)},{begin:h("m|qr",/\{/,/\}/)}]}]},{className:"function",beginKeywords:"sub method",end:"(\\s*\\(.*?\\))?[;{]",excludeEnd:!0,relevance:5,contains:[t.TITLE_MODE,u]},{className:"class",beginKeywords:"class",end:"[;{]",excludeEnd:!0,relevance:5,contains:[t.TITLE_MODE,u,l]},{begin:"-\\w\\b",relevance:0},{begin:"^__DATA__$",end:"^__END__$",subLanguage:"mojolicious",contains:[{begin:"^@@.*",end:"$",className:"comment"}]}];return s.contains=m,a.contains=m,{name:"Perl",aliases:["pl","pm"],keywords:i,contains:m}}return Vu=e,Vu}var Wu,bp;function Z6(){if(bp)return Wu;bp=1;function e(t){const n={className:"built_in",begin:"\\b(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)\\w+"},r=/[a-zA-Z@][a-zA-Z0-9_]*/,u={"variable.language":["this","super"],$pattern:r,keyword:["while","export","sizeof","typedef","const","struct","for","union","volatile","static","mutable","if","do","return","goto","enum","else","break","extern","asm","case","default","register","explicit","typename","switch","continue","inline","readonly","assign","readwrite","self","@synchronized","id","typeof","nonatomic","IBOutlet","IBAction","strong","weak","copy","in","out","inout","bycopy","byref","oneway","__strong","__weak","__block","__autoreleasing","@private","@protected","@public","@try","@property","@end","@throw","@catch","@finally","@autoreleasepool","@synthesize","@dynamic","@selector","@optional","@required","@encode","@package","@import","@defs","@compatibility_alias","__bridge","__bridge_transfer","__bridge_retained","__bridge_retain","__covariant","__contravariant","__kindof","_Nonnull","_Nullable","_Null_unspecified","__FUNCTION__","__PRETTY_FUNCTION__","__attribute__","getter","setter","retain","unsafe_unretained","nonnull","nullable","null_unspecified","null_resettable","class","instancetype","NS_DESIGNATED_INITIALIZER","NS_UNAVAILABLE","NS_REQUIRES_SUPER","NS_RETURNS_INNER_POINTER","NS_INLINE","NS_AVAILABLE","NS_DEPRECATED","NS_ENUM","NS_OPTIONS","NS_SWIFT_UNAVAILABLE","NS_ASSUME_NONNULL_BEGIN","NS_ASSUME_NONNULL_END","NS_REFINED_FOR_SWIFT","NS_SWIFT_NAME","NS_SWIFT_NOTHROW","NS_DURING","NS_HANDLER","NS_ENDHANDLER","NS_VALUERETURN","NS_VOIDRETURN"],literal:["false","true","FALSE","TRUE","nil","YES","NO","NULL"],built_in:["dispatch_once_t","dispatch_queue_t","dispatch_sync","dispatch_async","dispatch_once"],type:["int","float","char","unsigned","signed","short","long","double","wchar_t","unichar","void","bool","BOOL","id|0","_Bool"]},c={$pattern:r,keyword:["@interface","@class","@protocol","@implementation"]};return{name:"Objective-C",aliases:["mm","objc","obj-c","obj-c++","objective-c++"],keywords:u,illegal:"</",contains:[n,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,t.C_NUMBER_MODE,t.QUOTE_STRING_MODE,t.APOS_STRING_MODE,{className:"string",variants:[{begin:'@"',end:'"',illegal:"\\n",contains:[t.BACKSLASH_ESCAPE]}]},{className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},t.inherit(t.QUOTE_STRING_MODE,{className:"string"}),{className:"string",begin:/<.*?>/,end:/$/,illegal:"\\n"},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{className:"class",begin:"("+c.keyword.join("|")+")\\b",end:/(\{|$)/,excludeEnd:!0,keywords:c,contains:[t.UNDERSCORE_TITLE_MODE]},{begin:"\\."+t.UNDERSCORE_IDENT_RE,relevance:0}]}}return Wu=e,Wu}var Yu,yp;function X6(){if(yp)return Yu;yp=1;function e(t){const n=t.regex,r=/(?![A-Za-z0-9])(?![$])/,o=n.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,r),i=n.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,r),s=n.concat(/[A-Z]+/,r),a={scope:"variable",match:"\\$+"+o},u={scope:"meta",variants:[{begin:/<\?php/,relevance:10},{begin:/<\?=/},{begin:/<\?/,relevance:.1},{begin:/\?>/}]},c={scope:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},l=t.inherit(t.APOS_STRING_MODE,{illegal:null}),d=t.inherit(t.QUOTE_STRING_MODE,{illegal:null,contains:t.QUOTE_STRING_MODE.contains.concat(c)}),g={begin:/<<<[ \t]*(?:(\w+)|"(\w+)")\n/,end:/[ \t]*(\w+)\b/,contains:t.QUOTE_STRING_MODE.contains.concat(c),"on:begin":(B,N)=>{N.data._beginMatch=B[1]||B[2]},"on:end":(B,N)=>{N.data._beginMatch!==B[1]&&N.ignoreMatch()}},p=t.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),h=`[
|
|
25
|
+
]`,m={scope:"string",variants:[d,l,g,p]},y={scope:"number",variants:[{begin:"\\b0[bB][01]+(?:_[01]+)*\\b"},{begin:"\\b0[oO][0-7]+(?:_[0-7]+)*\\b"},{begin:"\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b"},{begin:"(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?"}],relevance:0},v=["false","null","true"],b=["__CLASS__","__DIR__","__FILE__","__FUNCTION__","__COMPILER_HALT_OFFSET__","__LINE__","__METHOD__","__NAMESPACE__","__TRAIT__","die","echo","exit","include","include_once","print","require","require_once","array","abstract","and","as","binary","bool","boolean","break","callable","case","catch","class","clone","const","continue","declare","default","do","double","else","elseif","empty","enddeclare","endfor","endforeach","endif","endswitch","endwhile","enum","eval","extends","final","finally","float","for","foreach","from","global","goto","if","implements","instanceof","insteadof","int","integer","interface","isset","iterable","list","match|0","mixed","new","never","object","or","private","protected","public","readonly","real","return","string","switch","throw","trait","try","unset","use","var","void","while","xor","yield"],w=["Error|0","AppendIterator","ArgumentCountError","ArithmeticError","ArrayIterator","ArrayObject","AssertionError","BadFunctionCallException","BadMethodCallException","CachingIterator","CallbackFilterIterator","CompileError","Countable","DirectoryIterator","DivisionByZeroError","DomainException","EmptyIterator","ErrorException","Exception","FilesystemIterator","FilterIterator","GlobIterator","InfiniteIterator","InvalidArgumentException","IteratorIterator","LengthException","LimitIterator","LogicException","MultipleIterator","NoRewindIterator","OutOfBoundsException","OutOfRangeException","OuterIterator","OverflowException","ParentIterator","ParseError","RangeException","RecursiveArrayIterator","RecursiveCachingIterator","RecursiveCallbackFilterIterator","RecursiveDirectoryIterator","RecursiveFilterIterator","RecursiveIterator","RecursiveIteratorIterator","RecursiveRegexIterator","RecursiveTreeIterator","RegexIterator","RuntimeException","SeekableIterator","SplDoublyLinkedList","SplFileInfo","SplFileObject","SplFixedArray","SplHeap","SplMaxHeap","SplMinHeap","SplObjectStorage","SplObserver","SplPriorityQueue","SplQueue","SplStack","SplSubject","SplTempFileObject","TypeError","UnderflowException","UnexpectedValueException","UnhandledMatchError","ArrayAccess","BackedEnum","Closure","Fiber","Generator","Iterator","IteratorAggregate","Serializable","Stringable","Throwable","Traversable","UnitEnum","WeakReference","WeakMap","Directory","__PHP_Incomplete_Class","parent","php_user_filter","self","static","stdClass"],C={keyword:b,literal:(B=>{const N=[];return B.forEach(Y=>{N.push(Y),Y.toLowerCase()===Y?N.push(Y.toUpperCase()):N.push(Y.toLowerCase())}),N})(v),built_in:w},k=B=>B.map(N=>N.replace(/\|\d+$/,"")),T={variants:[{match:[/new/,n.concat(h,"+"),n.concat("(?!",k(w).join("\\b|"),"\\b)"),i],scope:{1:"keyword",4:"title.class"}}]},S=n.concat(o,"\\b(?!\\()"),A={variants:[{match:[n.concat(/::/,n.lookahead(/(?!class\b)/)),S],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[i,n.concat(/::/,n.lookahead(/(?!class\b)/)),S],scope:{1:"title.class",3:"variable.constant"}},{match:[i,n.concat("::",n.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[i,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},F={scope:"attr",match:n.concat(o,n.lookahead(":"),n.lookahead(/(?!::)/))},O={relevance:0,begin:/\(/,end:/\)/,keywords:C,contains:[F,a,A,t.C_BLOCK_COMMENT_MODE,m,y,T]},P={relevance:0,match:[/\b/,n.concat("(?!fn\\b|function\\b|",k(b).join("\\b|"),"|",k(w).join("\\b|"),"\\b)"),o,n.concat(h,"*"),n.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[O]};O.contains.push(P);const L=[F,A,t.C_BLOCK_COMMENT_MODE,m,y,T],D={begin:n.concat(/#\[\s*\\?/,n.either(i,s)),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:v,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:v,keyword:["new","array"]},contains:["self",...L]},...L,{scope:"meta",variants:[{match:i},{match:s}]}]};return{case_insensitive:!1,keywords:C,contains:[D,t.HASH_COMMENT_MODE,t.COMMENT("//","$"),t.COMMENT("/\\*","\\*/",{contains:[{scope:"doctag",match:"@[A-Za-z]+"}]}),{match:/__halt_compiler\(\);/,keywords:"__halt_compiler",starts:{scope:"comment",end:t.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:"meta",endsParent:!0}]}},u,{scope:"variable.language",match:/\$this\b/},a,P,A,{match:[/const/,/\s/,o],scope:{1:"keyword",3:"variable.constant"}},T,{scope:"function",relevance:0,beginKeywords:"fn function",end:/[;{]/,excludeEnd:!0,illegal:"[$%\\[]",contains:[{beginKeywords:"use"},t.UNDERSCORE_TITLE_MODE,{begin:"=>",endsParent:!0},{scope:"params",begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0,keywords:C,contains:["self",D,a,A,t.C_BLOCK_COMMENT_MODE,m,y]}]},{scope:"class",variants:[{beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"class interface trait",illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:!0,contains:[{beginKeywords:"extends implements"},t.UNDERSCORE_TITLE_MODE]},{beginKeywords:"namespace",relevance:0,end:";",illegal:/[.']/,contains:[t.inherit(t.UNDERSCORE_TITLE_MODE,{scope:"title.class"})]},{beginKeywords:"use",relevance:0,end:";",contains:[{match:/\b(as|const|function)\b/,scope:"keyword"},t.UNDERSCORE_TITLE_MODE]},m,y]}}return Yu=e,Yu}var Zu,vp;function J6(){if(vp)return Zu;vp=1;function e(t){return{name:"PHP template",subLanguage:"xml",contains:[{begin:/<\?(php|=)?/,end:/\?>/,subLanguage:"php",contains:[{begin:"/\\*",end:"\\*/",skip:!0},{begin:'b"',end:'"',skip:!0},{begin:"b'",end:"'",skip:!0},t.inherit(t.APOS_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0}),t.inherit(t.QUOTE_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0})]}]}}return Zu=e,Zu}var Xu,wp;function Q6(){if(wp)return Xu;wp=1;function e(t){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}return Xu=e,Xu}var Ju,xp;function eR(){if(xp)return Ju;xp=1;function e(t){const n=t.regex,r=/[\p{XID_Start}_]\p{XID_Continue}*/u,o=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],u={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:o,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},c={className:"meta",begin:/^(>>>|\.\.\.) /},l={className:"subst",begin:/\{/,end:/\}/,keywords:u,illegal:/#/},d={begin:/\{\{/,relevance:0},g={className:"string",contains:[t.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[t.BACKSLASH_ESCAPE,c],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[t.BACKSLASH_ESCAPE,c],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[t.BACKSLASH_ESCAPE,c,d,l]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[t.BACKSLASH_ESCAPE,c,d,l]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[t.BACKSLASH_ESCAPE,d,l]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,d,l]},t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},p="[0-9](_?[0-9])*",h=`(\\b(${p}))?\\.(${p})|\\b(${p})\\.`,m=`\\b|${o.join("|")}`,y={className:"number",relevance:0,variants:[{begin:`(\\b(${p})|(${h}))[eE][+-]?(${p})[jJ]?(?=${m})`},{begin:`(${h})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${m})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${m})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${m})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${m})`},{begin:`\\b(${p})[jJ](?=${m})`}]},v={className:"comment",begin:n.lookahead(/# type:/),end:/$/,keywords:u,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},b={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:u,contains:["self",c,y,g,t.HASH_COMMENT_MODE]}]};return l.contains=[g,y,c],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:u,illegal:/(<\/|\?)|=>/,contains:[c,y,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},g,v,t.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,r],scope:{1:"keyword",3:"title.function"},contains:[b]},{variants:[{match:[/\bclass/,/\s+/,r,/\s*/,/\(\s*/,r,/\s*\)/]},{match:[/\bclass/,/\s+/,r]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[y,b,g]}]}}return Ju=e,Ju}var Qu,_p;function tR(){if(_p)return Qu;_p=1;function e(t){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}return Qu=e,Qu}var ec,Ep;function nR(){if(Ep)return ec;Ep=1;function e(t){const n=t.regex,r=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/,o=n.either(/0[xX][0-9a-fA-F]+\.[0-9a-fA-F]*[pP][+-]?\d+i?/,/0[xX][0-9a-fA-F]+(?:[pP][+-]?\d+)?[Li]?/,/(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?[Li]?/),i=/[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/,s=n.either(/[()]/,/[{}]/,/\[\[/,/[[\]]/,/\\/,/,/);return{name:"R",keywords:{$pattern:r,keyword:"function if in break next repeat else for while",literal:"NULL NA TRUE FALSE Inf NaN NA_integer_|10 NA_real_|10 NA_character_|10 NA_complex_|10",built_in:"LETTERS letters month.abb month.name pi T F abs acos acosh all any anyNA Arg as.call as.character as.complex as.double as.environment as.integer as.logical as.null.default as.numeric as.raw asin asinh atan atanh attr attributes baseenv browser c call ceiling class Conj cos cosh cospi cummax cummin cumprod cumsum digamma dim dimnames emptyenv exp expression floor forceAndCall gamma gc.time globalenv Im interactive invisible is.array is.atomic is.call is.character is.complex is.double is.environment is.expression is.finite is.function is.infinite is.integer is.language is.list is.logical is.matrix is.na is.name is.nan is.null is.numeric is.object is.pairlist is.raw is.recursive is.single is.symbol lazyLoadDBfetch length lgamma list log max min missing Mod names nargs nzchar oldClass on.exit pos.to.env proc.time prod quote range Re rep retracemem return round seq_along seq_len seq.int sign signif sin sinh sinpi sqrt standardGeneric substitute sum switch tan tanh tanpi tracemem trigamma trunc unclass untracemem UseMethod xtfrm"},contains:[t.COMMENT(/#'/,/$/,{contains:[{scope:"doctag",match:/@examples/,starts:{end:n.lookahead(n.either(/\n^#'\s*(?=@[a-zA-Z]+)/,/\n^(?!#')/)),endsParent:!0}},{scope:"doctag",begin:"@param",end:/$/,contains:[{scope:"variable",variants:[{match:r},{match:/`(?:\\.|[^`\\])+`/}],endsParent:!0}]},{scope:"doctag",match:/@[a-zA-Z]+/},{scope:"keyword",match:/\\[a-zA-Z]+/}]}),t.HASH_COMMENT_MODE,{scope:"string",contains:[t.BACKSLASH_ESCAPE],variants:[t.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\(/,end:/\)(-*)"/}),t.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\{/,end:/\}(-*)"/}),t.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\[/,end:/\](-*)"/}),t.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\(/,end:/\)(-*)'/}),t.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\{/,end:/\}(-*)'/}),t.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\[/,end:/\](-*)'/}),{begin:'"',end:'"',relevance:0},{begin:"'",end:"'",relevance:0}]},{relevance:0,variants:[{scope:{1:"operator",2:"number"},match:[i,o]},{scope:{1:"operator",2:"number"},match:[/%[^%]*%/,o]},{scope:{1:"punctuation",2:"number"},match:[s,o]},{scope:{2:"number"},match:[/[^a-zA-Z0-9._]|^/,o]}]},{scope:{3:"operator"},match:[r,/\s+/,/<-/,/\s+/]},{scope:"operator",relevance:0,variants:[{match:i},{match:/%[^%]*%/}]},{scope:"punctuation",relevance:0,match:s},{begin:"`",end:"`",contains:[{begin:/\\./}]}]}}return ec=e,ec}var tc,Cp;function rR(){if(Cp)return tc;Cp=1;function e(t){const n=t.regex,r=/(r#)?/,o=n.concat(r,t.UNDERSCORE_IDENT_RE),i=n.concat(r,t.IDENT_RE),s={className:"title.function.invoke",relevance:0,begin:n.concat(/\b/,/(?!let|for|while|if|else|match\b)/,i,n.lookahead(/\s*\(/))},a="([ui](8|16|32|64|128|size)|f(32|64))?",u=["abstract","as","async","await","become","box","break","const","continue","crate","do","dyn","else","enum","extern","false","final","fn","for","if","impl","in","let","loop","macro","match","mod","move","mut","override","priv","pub","ref","return","self","Self","static","struct","super","trait","true","try","type","typeof","union","unsafe","unsized","use","virtual","where","while","yield"],c=["true","false","Some","None","Ok","Err"],l=["drop ","Copy","Send","Sized","Sync","Drop","Fn","FnMut","FnOnce","ToOwned","Clone","Debug","PartialEq","PartialOrd","Eq","Ord","AsRef","AsMut","Into","From","Default","Iterator","Extend","IntoIterator","DoubleEndedIterator","ExactSizeIterator","SliceConcatExt","ToString","assert!","assert_eq!","bitflags!","bytes!","cfg!","col!","concat!","concat_idents!","debug_assert!","debug_assert_eq!","env!","eprintln!","panic!","file!","format!","format_args!","include_bytes!","include_str!","line!","local_data_key!","module_path!","option_env!","print!","println!","select!","stringify!","try!","unimplemented!","unreachable!","vec!","write!","writeln!","macro_rules!","assert_ne!","debug_assert_ne!"],d=["i8","i16","i32","i64","i128","isize","u8","u16","u32","u64","u128","usize","f32","f64","str","char","bool","Box","Option","Result","String","Vec"];return{name:"Rust",aliases:["rs"],keywords:{$pattern:t.IDENT_RE+"!?",type:d,keyword:u,literal:c,built_in:l},illegal:"</",contains:[t.C_LINE_COMMENT_MODE,t.COMMENT("/\\*","\\*/",{contains:["self"]}),t.inherit(t.QUOTE_STRING_MODE,{begin:/b?"/,illegal:null}),{className:"symbol",begin:/'[a-zA-Z_][a-zA-Z0-9_]*(?!')/},{scope:"string",variants:[{begin:/b?r(#*)"(.|\n)*?"\1(?!#)/},{begin:/b?'/,end:/'/,contains:[{scope:"char.escape",match:/\\('|\w|x\w{2}|u\w{4}|U\w{8})/}]}]},{className:"number",variants:[{begin:"\\b0b([01_]+)"+a},{begin:"\\b0o([0-7_]+)"+a},{begin:"\\b0x([A-Fa-f0-9_]+)"+a},{begin:"\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)"+a}],relevance:0},{begin:[/fn/,/\s+/,o],className:{1:"keyword",3:"title.function"}},{className:"meta",begin:"#!?\\[",end:"\\]",contains:[{className:"string",begin:/"/,end:/"/,contains:[t.BACKSLASH_ESCAPE]}]},{begin:[/let/,/\s+/,/(?:mut\s+)?/,o],className:{1:"keyword",3:"keyword",4:"variable"}},{begin:[/for/,/\s+/,o,/\s+/,/in/],className:{1:"keyword",3:"variable",5:"keyword"}},{begin:[/type/,/\s+/,o],className:{1:"keyword",3:"title.class"}},{begin:[/(?:trait|enum|struct|union|impl|for)/,/\s+/,o],className:{1:"keyword",3:"title.class"}},{begin:t.IDENT_RE+"::",keywords:{keyword:"Self",built_in:l,type:d}},{className:"punctuation",begin:"->"},s]}}return tc=e,tc}var nc,Sp;function oR(){if(Sp)return nc;Sp=1;const e=c=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:c.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[c.APOS_STRING_MODE,c.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:c.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),t=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],n=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],r=[...t,...n],o=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),i=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),s=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),a=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function u(c){const l=e(c),d=s,g=i,p="@[a-z-]+",h="and or not only",y={className:"variable",begin:"(\\$"+"[a-zA-Z-][a-zA-Z0-9_-]*"+")\\b",relevance:0};return{name:"SCSS",case_insensitive:!0,illegal:"[=/|']",contains:[c.C_LINE_COMMENT_MODE,c.C_BLOCK_COMMENT_MODE,l.CSS_NUMBER_MODE,{className:"selector-id",begin:"#[A-Za-z0-9_-]+",relevance:0},{className:"selector-class",begin:"\\.[A-Za-z0-9_-]+",relevance:0},l.ATTRIBUTE_SELECTOR_MODE,{className:"selector-tag",begin:"\\b("+r.join("|")+")\\b",relevance:0},{className:"selector-pseudo",begin:":("+g.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+d.join("|")+")"},y,{begin:/\(/,end:/\)/,contains:[l.CSS_NUMBER_MODE]},l.CSS_VARIABLE,{className:"attribute",begin:"\\b("+a.join("|")+")\\b"},{begin:"\\b(whitespace|wait|w-resize|visible|vertical-text|vertical-ideographic|uppercase|upper-roman|upper-alpha|underline|transparent|top|thin|thick|text|text-top|text-bottom|tb-rl|table-header-group|table-footer-group|sw-resize|super|strict|static|square|solid|small-caps|separate|se-resize|scroll|s-resize|rtl|row-resize|ridge|right|repeat|repeat-y|repeat-x|relative|progress|pointer|overline|outside|outset|oblique|nowrap|not-allowed|normal|none|nw-resize|no-repeat|no-drop|newspaper|ne-resize|n-resize|move|middle|medium|ltr|lr-tb|lowercase|lower-roman|lower-alpha|loose|list-item|line|line-through|line-edge|lighter|left|keep-all|justify|italic|inter-word|inter-ideograph|inside|inset|inline|inline-block|inherit|inactive|ideograph-space|ideograph-parenthesis|ideograph-numeric|ideograph-alpha|horizontal|hidden|help|hand|groove|fixed|ellipsis|e-resize|double|dotted|distribute|distribute-space|distribute-letter|distribute-all-lines|disc|disabled|default|decimal|dashed|crosshair|collapse|col-resize|circle|char|center|capitalize|break-word|break-all|bottom|both|bolder|bold|block|bidi-override|below|baseline|auto|always|all-scroll|absolute|table|table-cell)\\b"},{begin:/:/,end:/[;}{]/,relevance:0,contains:[l.BLOCK_COMMENT,y,l.HEXCOLOR,l.CSS_NUMBER_MODE,c.QUOTE_STRING_MODE,c.APOS_STRING_MODE,l.IMPORTANT,l.FUNCTION_DISPATCH]},{begin:"@(page|font-face)",keywords:{$pattern:p,keyword:"@page @font-face"}},{begin:"@",end:"[{;]",returnBegin:!0,keywords:{$pattern:/[a-z-]+/,keyword:h,attribute:o.join(" ")},contains:[{begin:p,className:"keyword"},{begin:/[a-z-]+(?=:)/,className:"attribute"},y,c.QUOTE_STRING_MODE,c.APOS_STRING_MODE,l.HEXCOLOR,l.CSS_NUMBER_MODE]},l.FUNCTION_DISPATCH]}}return nc=u,nc}var rc,kp;function iR(){if(kp)return rc;kp=1;function e(t){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}return rc=e,rc}var oc,Ap;function sR(){if(Ap)return oc;Ap=1;function e(t){const n=t.regex,r=t.COMMENT("--","$"),o={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},i={begin:/"/,end:/"/,contains:[{match:/""/}]},s=["true","false","unknown"],a=["double precision","large object","with timezone","without timezone"],u=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],c=["add","asc","collation","desc","final","first","last","view"],l=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year"],d=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],g=["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"],p=["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"],h=d,m=[...l,...c].filter(k=>!d.includes(k)),y={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},v={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},b={match:n.concat(/\b/,n.either(...h),/\s*\(/),relevance:0,keywords:{built_in:h}};function w(k){return n.concat(/\b/,n.either(...k.map(T=>T.replace(/\s+/,"\\s+"))),/\b/)}const E={scope:"keyword",match:w(p),relevance:0};function C(k,{exceptions:T,when:S}={}){const A=S;return T=T||[],k.map(F=>F.match(/\|\d+$/)||T.includes(F)?F:A(F)?`${F}|0`:F)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:C(m,{when:k=>k.length<3}),literal:s,type:u,built_in:g},contains:[{scope:"type",match:w(a)},E,b,y,o,i,t.C_NUMBER_MODE,t.C_BLOCK_COMMENT_MODE,r,v]}}return oc=e,oc}var ic,Tp;function aR(){if(Tp)return ic;Tp=1;function e(S){return S?typeof S=="string"?S:S.source:null}function t(S){return n("(?=",S,")")}function n(...S){return S.map(F=>e(F)).join("")}function r(S){const A=S[S.length-1];return typeof A=="object"&&A.constructor===Object?(S.splice(S.length-1,1),A):{}}function o(...S){return"("+(r(S).capture?"":"?:")+S.map(O=>e(O)).join("|")+")"}const i=S=>n(/\b/,S,/\w$/.test(S)?/\b/:/\B/),s=["Protocol","Type"].map(i),a=["init","self"].map(i),u=["Any","Self"],c=["actor","any","associatedtype","async","await",/as\?/,/as!/,"as","borrowing","break","case","catch","class","consume","consuming","continue","convenience","copy","default","defer","deinit","didSet","distributed","do","dynamic","each","else","enum","extension","fallthrough",/fileprivate\(set\)/,"fileprivate","final","for","func","get","guard","if","import","indirect","infix",/init\?/,/init!/,"inout",/internal\(set\)/,"internal","in","is","isolated","nonisolated","lazy","let","macro","mutating","nonmutating",/open\(set\)/,"open","operator","optional","override","package","postfix","precedencegroup","prefix",/private\(set\)/,"private","protocol",/public\(set\)/,"public","repeat","required","rethrows","return","set","some","static","struct","subscript","super","switch","throws","throw",/try\?/,/try!/,"try","typealias",/unowned\(safe\)/,/unowned\(unsafe\)/,"unowned","var","weak","where","while","willSet"],l=["false","nil","true"],d=["assignment","associativity","higherThan","left","lowerThan","none","right"],g=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],p=["abs","all","any","assert","assertionFailure","debugPrint","dump","fatalError","getVaList","isKnownUniquelyReferenced","max","min","numericCast","pointwiseMax","pointwiseMin","precondition","preconditionFailure","print","readLine","repeatElement","sequence","stride","swap","swift_unboxFromSwiftValueWithType","transcode","type","unsafeBitCast","unsafeDowncast","withExtendedLifetime","withUnsafeMutablePointer","withUnsafePointer","withVaList","withoutActuallyEscaping","zip"],h=o(/[/=\-+!*%<>&|^~?]/,/[\u00A1-\u00A7]/,/[\u00A9\u00AB]/,/[\u00AC\u00AE]/,/[\u00B0\u00B1]/,/[\u00B6\u00BB\u00BF\u00D7\u00F7]/,/[\u2016-\u2017]/,/[\u2020-\u2027]/,/[\u2030-\u203E]/,/[\u2041-\u2053]/,/[\u2055-\u205E]/,/[\u2190-\u23FF]/,/[\u2500-\u2775]/,/[\u2794-\u2BFF]/,/[\u2E00-\u2E7F]/,/[\u3001-\u3003]/,/[\u3008-\u3020]/,/[\u3030]/),m=o(h,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),y=n(h,m,"*"),v=o(/[a-zA-Z_]/,/[\u00A8\u00AA\u00AD\u00AF\u00B2-\u00B5\u00B7-\u00BA]/,/[\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/,/[\u0100-\u02FF\u0370-\u167F\u1681-\u180D\u180F-\u1DBF]/,/[\u1E00-\u1FFF]/,/[\u200B-\u200D\u202A-\u202E\u203F-\u2040\u2054\u2060-\u206F]/,/[\u2070-\u20CF\u2100-\u218F\u2460-\u24FF\u2776-\u2793]/,/[\u2C00-\u2DFF\u2E80-\u2FFF]/,/[\u3004-\u3007\u3021-\u302F\u3031-\u303F\u3040-\uD7FF]/,/[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/,/[\uFE47-\uFEFE\uFF00-\uFFFD]/),b=o(v,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),w=n(v,b,"*"),E=n(/[A-Z]/,b,"*"),C=["attached","autoclosure",n(/convention\(/,o("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",n(/objc\(/,w,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],k=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function T(S){const A={match:/\s+/,relevance:0},F=S.COMMENT("/\\*","\\*/",{contains:["self"]}),O=[S.C_LINE_COMMENT_MODE,F],P={match:[/\./,o(...s,...a)],className:{2:"keyword"}},L={match:n(/\./,o(...c)),relevance:0},D=c.filter(nt=>typeof nt=="string").concat(["_|0"]),B=c.filter(nt=>typeof nt!="string").concat(u).map(i),N={variants:[{className:"keyword",match:o(...B,...a)}]},Y={$pattern:o(/\b\w+/,/#\w+/),keyword:D.concat(g),literal:l},ce=[P,L,N],V={match:n(/\./,o(...p)),relevance:0},j={className:"built_in",match:n(/\b/,o(...p),/(?=\()/)},he=[V,j],K={match:/->/,relevance:0},z={className:"operator",relevance:0,variants:[{match:y},{match:`\\.(\\.|${m})+`}]},J=[K,z],re="([0-9]_*)+",ve="([0-9a-fA-F]_*)+",Z={className:"number",relevance:0,variants:[{match:`\\b(${re})(\\.(${re}))?([eE][+-]?(${re}))?\\b`},{match:`\\b0x(${ve})(\\.(${ve}))?([pP][+-]?(${re}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},M=(nt="")=>({className:"subst",variants:[{match:n(/\\/,nt,/[0\\tnr"']/)},{match:n(/\\/,nt,/u\{[0-9a-fA-F]{1,8}\}/)}]}),W=(nt="")=>({className:"subst",match:n(/\\/,nt,/[\t ]*(?:[\r\n]|\r\n)/)}),oe=(nt="")=>({className:"subst",label:"interpol",begin:n(/\\/,nt,/\(/),end:/\)/}),te=(nt="")=>({begin:n(nt,/"""/),end:n(/"""/,nt),contains:[M(nt),W(nt),oe(nt)]}),H=(nt="")=>({begin:n(nt,/"/),end:n(/"/,nt),contains:[M(nt),oe(nt)]}),de={className:"string",variants:[te(),te("#"),te("##"),te("###"),H(),H("#"),H("##"),H("###")]},fe=[S.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[S.BACKSLASH_ESCAPE]}],Ue={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:fe},se=nt=>{const In=n(nt,/\//),ge=n(/\//,nt);return{begin:In,end:ge,contains:[...fe,{scope:"comment",begin:`#(?!.*${ge})`,end:/$/}]}},xe={scope:"regexp",variants:[se("###"),se("##"),se("#"),Ue]},Ce={match:n(/`/,w,/`/)},We={className:"variable",match:/\$\d+/},it={className:"variable",match:`\\$${b}+`},Ye=[Ce,We,it],Ct={match:/(@|#(un)?)available/,scope:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:k,contains:[...J,Z,de]}]}},Ot={scope:"keyword",match:n(/@/,o(...C),t(o(/\(/,/\s+/)))},Pe={scope:"meta",match:n(/@/,w)},mt=[Ct,Ot,Pe],It={match:t(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:n(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,b,"+")},{className:"type",match:E,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:n(/\s+&\s+/,t(E)),relevance:0}]},un={begin:/</,end:/>/,keywords:Y,contains:[...O,...ce,...mt,K,It]};It.contains.push(un);const Dn={match:n(w,/\s*:/),keywords:"_|0",relevance:0},Lt={begin:/\(/,end:/\)/,relevance:0,keywords:Y,contains:["self",Dn,...O,xe,...ce,...he,...J,Z,de,...Ye,...mt,It]},Ut={begin:/</,end:/>/,keywords:"repeat each",contains:[...O,It]},rn={begin:o(t(n(w,/\s*:/)),t(n(w,/\s+/,w,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:w}]},Ir={begin:/\(/,end:/\)/,keywords:Y,contains:[rn,...O,...ce,...J,Z,de,...mt,It,Lt],endsParent:!0,illegal:/["']/},to={match:[/(func|macro)/,/\s+/,o(Ce.match,w,y)],className:{1:"keyword",3:"title.function"},contains:[Ut,Ir,A],illegal:[/\[/,/%/]},Rr={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[Ut,Ir,A],illegal:/\[|%/},no={match:[/operator/,/\s+/,y],className:{1:"keyword",3:"title"}},$t={begin:[/precedencegroup/,/\s+/,E],className:{1:"keyword",3:"title"},contains:[It],keywords:[...d,...l],end:/}/},Or={match:[/class\b/,/\s+/,/func\b/,/\s+/,/\b[A-Za-z_][A-Za-z0-9_]*\b/],scope:{1:"keyword",3:"keyword",5:"title.function"}},fr={match:[/class\b/,/\s+/,/var\b/],scope:{1:"keyword",3:"keyword"}},gr={begin:[/(struct|protocol|class|extension|enum|actor)/,/\s+/,w,/\s*/],beginScope:{1:"keyword",3:"title.class"},keywords:Y,contains:[Ut,...ce,{begin:/:/,end:/\{/,keywords:Y,contains:[{scope:"title.class.inherited",match:E},...ce],relevance:0}]};for(const nt of de.variants){const In=nt.contains.find(Te=>Te.label==="interpol");In.keywords=Y;const ge=[...ce,...he,...J,Z,de,...Ye];In.contains=[...ge,{begin:/\(/,end:/\)/,contains:["self",...ge]}]}return{name:"Swift",keywords:Y,contains:[...O,to,Rr,Or,fr,gr,no,$t,{beginKeywords:"import",end:/$/,contains:[...O],relevance:0},xe,...ce,...he,...J,Z,de,...Ye,...mt,It,Lt]}}return ic=T,ic}var sc,Dp;function uR(){if(Dp)return sc;Dp=1;function e(t){const n="true false yes no null",r="[\\w#;/?:@&=+$,.~*'()[\\]]+",o={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},i={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},s={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},a={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[t.BACKSLASH_ESCAPE,i]},u=t.inherit(a,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),p={className:"number",begin:"\\b"+"[0-9]{4}(-[0-9][0-9]){0,2}"+"([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?"+"(\\.[0-9]*)?"+"([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?"+"\\b"},h={end:",",endsWithParent:!0,excludeEnd:!0,keywords:n,relevance:0},m={begin:/\{/,end:/\}/,contains:[h],illegal:"\\n",relevance:0},y={begin:"\\[",end:"\\]",contains:[h],illegal:"\\n",relevance:0},v=[o,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+r},{className:"type",begin:"!<"+r+">"},{className:"type",begin:"!"+r},{className:"type",begin:"!!"+r},{className:"meta",begin:"&"+t.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+t.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},t.HASH_COMMENT_MODE,{beginKeywords:n,keywords:{literal:n}},p,{className:"number",begin:t.C_NUMBER_RE+"\\b",relevance:0},m,y,s,a],b=[...v];return b.pop(),b.push(u),h.contains=b,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:v}}return sc=e,sc}var ac,Ip;function cR(){if(Ip)return ac;Ip=1;const e="[A-Za-z$_][0-9A-Za-z$_]*",t=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],n=["true","false","null","undefined","NaN","Infinity"],r=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],o=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],i=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],s=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],a=[].concat(i,r,o);function u(l){const d=l.regex,g=(M,{after:W})=>{const oe="</"+M[0].slice(1);return M.input.indexOf(oe,W)!==-1},p=e,h={begin:"<>",end:"</>"},m=/<[A-Za-z0-9\\._:-]+\s*\/>/,y={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(M,W)=>{const oe=M[0].length+M.index,te=M.input[oe];if(te==="<"||te===","){W.ignoreMatch();return}te===">"&&(g(M,{after:oe})||W.ignoreMatch());let H;const de=M.input.substring(oe);if(H=de.match(/^\s*=/)){W.ignoreMatch();return}if((H=de.match(/^\s+extends\s+/))&&H.index===0){W.ignoreMatch();return}}},v={$pattern:e,keyword:t,literal:n,built_in:a,"variable.language":s},b="[0-9](_?[0-9])*",w=`\\.(${b})`,E="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",C={className:"number",variants:[{begin:`(\\b(${E})((${w})|\\.)?|(${w}))[eE][+-]?(${b})\\b`},{begin:`\\b(${E})\\b((${w})\\b|\\.)?|(${w})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},k={className:"subst",begin:"\\$\\{",end:"\\}",keywords:v,contains:[]},T={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[l.BACKSLASH_ESCAPE,k],subLanguage:"xml"}},S={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[l.BACKSLASH_ESCAPE,k],subLanguage:"css"}},A={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[l.BACKSLASH_ESCAPE,k],subLanguage:"graphql"}},F={className:"string",begin:"`",end:"`",contains:[l.BACKSLASH_ESCAPE,k]},P={className:"comment",variants:[l.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:p+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),l.C_BLOCK_COMMENT_MODE,l.C_LINE_COMMENT_MODE]},L=[l.APOS_STRING_MODE,l.QUOTE_STRING_MODE,T,S,A,F,{match:/\$\d+/},C];k.contains=L.concat({begin:/\{/,end:/\}/,keywords:v,contains:["self"].concat(L)});const D=[].concat(P,k.contains),B=D.concat([{begin:/(\s*)\(/,end:/\)/,keywords:v,contains:["self"].concat(D)}]),N={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:v,contains:B},Y={variants:[{match:[/class/,/\s+/,p,/\s+/,/extends/,/\s+/,d.concat(p,"(",d.concat(/\./,p),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,p],scope:{1:"keyword",3:"title.class"}}]},ce={relevance:0,match:d.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...r,...o]}},V={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},j={variants:[{match:[/function/,/\s+/,p,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[N],illegal:/%/},he={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function K(M){return d.concat("(?!",M.join("|"),")")}const z={match:d.concat(/\b/,K([...i,"super","import"].map(M=>`${M}\\s*\\(`)),p,d.lookahead(/\s*\(/)),className:"title.function",relevance:0},J={begin:d.concat(/\./,d.lookahead(d.concat(p,/(?![0-9A-Za-z$_(])/))),end:p,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},re={match:[/get|set/,/\s+/,p,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},N]},ve="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+l.UNDERSCORE_IDENT_RE+")\\s*=>",Z={match:[/const|var|let/,/\s+/,p,/\s*/,/=\s*/,/(async\s*)?/,d.lookahead(ve)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[N]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:v,exports:{PARAMS_CONTAINS:B,CLASS_REFERENCE:ce},illegal:/#(?![$_A-z])/,contains:[l.SHEBANG({label:"shebang",binary:"node",relevance:5}),V,l.APOS_STRING_MODE,l.QUOTE_STRING_MODE,T,S,A,F,P,{match:/\$\d+/},C,ce,{scope:"attr",match:p+d.lookahead(":"),relevance:0},Z,{begin:"("+l.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[P,l.REGEXP_MODE,{className:"function",begin:ve,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:l.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:v,contains:B}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:h.begin,end:h.end},{match:m},{begin:y.begin,"on:begin":y.isTrulyOpeningTag,end:y.end}],subLanguage:"xml",contains:[{begin:y.begin,end:y.end,skip:!0,contains:["self"]}]}]},j,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+l.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[N,l.inherit(l.TITLE_MODE,{begin:p,className:"title.function"})]},{match:/\.\.\./,relevance:0},J,{match:"\\$"+p,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[N]},z,he,Y,re,{match:/\$[(.]/}]}}function c(l){const d=l.regex,g=u(l),p=e,h=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],m={begin:[/namespace/,/\s+/,l.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},y={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:h},contains:[g.exports.CLASS_REFERENCE]},v={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},b=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],w={$pattern:e,keyword:t.concat(b),literal:n,built_in:a.concat(h),"variable.language":s},E={className:"meta",begin:"@"+p},C=(A,F,O)=>{const P=A.contains.findIndex(L=>L.label===F);if(P===-1)throw new Error("can not find mode to replace");A.contains.splice(P,1,O)};Object.assign(g.keywords,w),g.exports.PARAMS_CONTAINS.push(E);const k=g.contains.find(A=>A.scope==="attr"),T=Object.assign({},k,{match:d.concat(p,d.lookahead(/\s*\?:/))});g.exports.PARAMS_CONTAINS.push([g.exports.CLASS_REFERENCE,k,T]),g.contains=g.contains.concat([E,m,y,T]),C(g,"shebang",l.SHEBANG()),C(g,"use_strict",v);const S=g.contains.find(A=>A.label==="func.def");return S.relevance=0,Object.assign(g,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),g}return ac=c,ac}var uc,Rp;function lR(){if(Rp)return uc;Rp=1;function e(t){const n=t.regex,r={className:"string",begin:/"(""|[^/n])"C\b/},o={className:"string",begin:/"/,end:/"/,illegal:/\n/,contains:[{begin:/""/}]},i=/\d{1,2}\/\d{1,2}\/\d{4}/,s=/\d{4}-\d{1,2}-\d{1,2}/,a=/(\d|1[012])(:\d+){0,2} *(AM|PM)/,u=/\d{1,2}(:\d{1,2}){1,2}/,c={className:"literal",variants:[{begin:n.concat(/# */,n.either(s,i),/ *#/)},{begin:n.concat(/# */,u,/ *#/)},{begin:n.concat(/# */,a,/ *#/)},{begin:n.concat(/# */,n.either(s,i),/ +/,n.either(a,u),/ *#/)}]},l={className:"number",relevance:0,variants:[{begin:/\b\d[\d_]*((\.[\d_]+(E[+-]?[\d_]+)?)|(E[+-]?[\d_]+))[RFD@!#]?/},{begin:/\b\d[\d_]*((U?[SIL])|[%&])?/},{begin:/&H[\dA-F_]+((U?[SIL])|[%&])?/},{begin:/&O[0-7_]+((U?[SIL])|[%&])?/},{begin:/&B[01_]+((U?[SIL])|[%&])?/}]},d={className:"label",begin:/^\w+:/},g=t.COMMENT(/'''/,/$/,{contains:[{className:"doctag",begin:/<\/?/,end:/>/}]}),p=t.COMMENT(null,/$/,{variants:[{begin:/'/},{begin:/([\t ]|^)REM(?=\s)/}]});return{name:"Visual Basic .NET",aliases:["vb"],case_insensitive:!0,classNameAliases:{label:"symbol"},keywords:{keyword:"addhandler alias aggregate ansi as async assembly auto binary by byref byval call case catch class compare const continue custom declare default delegate dim distinct do each equals else elseif end enum erase error event exit explicit finally for friend from function get global goto group handles if implements imports in inherits interface into iterator join key let lib loop me mid module mustinherit mustoverride mybase myclass namespace narrowing new next notinheritable notoverridable of off on operator option optional order overloads overridable overrides paramarray partial preserve private property protected public raiseevent readonly redim removehandler resume return select set shadows shared skip static step stop structure strict sub synclock take text then throw to try unicode until using when where while widening with withevents writeonly yield",built_in:"addressof and andalso await directcast gettype getxmlnamespace is isfalse isnot istrue like mod nameof new not or orelse trycast typeof xor cbool cbyte cchar cdate cdbl cdec cint clng cobj csbyte cshort csng cstr cuint culng cushort",type:"boolean byte char date decimal double integer long object sbyte short single string uinteger ulong ushort",literal:"true false nothing"},illegal:"//|\\{|\\}|endif|gosub|variant|wend|^\\$ ",contains:[r,o,c,l,d,g,p,{className:"meta",begin:/[\t ]*#(const|disable|else|elseif|enable|end|externalsource|if|region)\b/,end:/$/,keywords:{keyword:"const disable else elseif enable end externalsource if region then"},contains:[p]}]}}return uc=e,uc}var cc,Op;function dR(){if(Op)return cc;Op=1;function e(t){t.regex;const n=t.COMMENT(/\(;/,/;\)/);n.contains.push("self");const r=t.COMMENT(/;;/,/$/),o=["anyfunc","block","br","br_if","br_table","call","call_indirect","data","drop","elem","else","end","export","func","global.get","global.set","local.get","local.set","local.tee","get_global","get_local","global","if","import","local","loop","memory","memory.grow","memory.size","module","mut","nop","offset","param","result","return","select","set_global","set_local","start","table","tee_local","then","type","unreachable"],i={begin:[/(?:func|call|call_indirect)/,/\s+/,/\$[^\s)]+/],className:{1:"keyword",3:"title.function"}},s={className:"variable",begin:/\$[\w_]+/},a={match:/(\((?!;)|\))+/,className:"punctuation",relevance:0},u={className:"number",relevance:0,match:/[+-]?\b(?:\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:[eE][+-]?\d(?:_?\d)*)?|0x[\da-fA-F](?:_?[\da-fA-F])*(?:\.[\da-fA-F](?:_?[\da-fA-D])*)?(?:[pP][+-]?\d(?:_?\d)*)?)\b|\binf\b|\bnan(?::0x[\da-fA-F](?:_?[\da-fA-D])*)?\b/},c={match:/(i32|i64|f32|f64)(?!\.)/,className:"type"},l={className:"keyword",match:/\b(f32|f64|i32|i64)(?:\.(?:abs|add|and|ceil|clz|const|convert_[su]\/i(?:32|64)|copysign|ctz|demote\/f64|div(?:_[su])?|eqz?|extend_[su]\/i32|floor|ge(?:_[su])?|gt(?:_[su])?|le(?:_[su])?|load(?:(?:8|16|32)_[su])?|lt(?:_[su])?|max|min|mul|nearest|neg?|or|popcnt|promote\/f32|reinterpret\/[fi](?:32|64)|rem_[su]|rot[lr]|shl|shr_[su]|store(?:8|16|32)?|sqrt|sub|trunc(?:_[su]\/f(?:32|64))?|wrap\/i64|xor))\b/};return{name:"WebAssembly",keywords:{$pattern:/[\w.]+/,keyword:o},contains:[r,n,{match:[/(?:offset|align)/,/\s*/,/=/],className:{1:"keyword",3:"operator"}},s,a,i,t.QUOTE_STRING_MODE,c,l,u]}}return cc=e,cc}var lc,Np;function fR(){if(Np)return lc;Np=1;var e=D6();return e.registerLanguage("xml",I6()),e.registerLanguage("bash",R6()),e.registerLanguage("c",O6()),e.registerLanguage("cpp",N6()),e.registerLanguage("csharp",M6()),e.registerLanguage("css",P6()),e.registerLanguage("markdown",L6()),e.registerLanguage("diff",$6()),e.registerLanguage("ruby",F6()),e.registerLanguage("go",B6()),e.registerLanguage("graphql",z6()),e.registerLanguage("ini",U6()),e.registerLanguage("java",K6()),e.registerLanguage("javascript",j6()),e.registerLanguage("json",q6()),e.registerLanguage("kotlin",H6()),e.registerLanguage("less",G6()),e.registerLanguage("lua",V6()),e.registerLanguage("makefile",W6()),e.registerLanguage("perl",Y6()),e.registerLanguage("objectivec",Z6()),e.registerLanguage("php",X6()),e.registerLanguage("php-template",J6()),e.registerLanguage("plaintext",Q6()),e.registerLanguage("python",eR()),e.registerLanguage("python-repl",tR()),e.registerLanguage("r",nR()),e.registerLanguage("rust",rR()),e.registerLanguage("scss",oR()),e.registerLanguage("shell",iR()),e.registerLanguage("sql",sR()),e.registerLanguage("swift",aR()),e.registerLanguage("yaml",uR()),e.registerLanguage("typescript",cR()),e.registerLanguage("vbnet",lR()),e.registerLanguage("wasm",dR()),e.HighlightJS=e,e.default=e,lc=e,lc}var gR=fR();const da=ls(gR),jn=new kn({html:!0,linkify:!0,breaks:!1,highlight(e,t){if(t&&da.getLanguage(t))try{const n=da.highlight(e,{language:t}).value;return`<pre><code class="hljs language-${t}">${n}</code></pre>`}catch{}return""}}),pR=/^<\/?(?:details|summary)>$/i,hR=/^<details\s+open\s*>$/i,mR=/^<input class="task-list-item-checkbox"(?: checked="")? disabled="" type="checkbox">$/;function bR(e){return pR.test(e)||hR.test(e)||mR.test(e)}function Ty(e){const t=jn.utils.escapeHtml;let n="",r=0;const o=/<[^>]*>/g;let i;for(;(i=o.exec(e))!==null;){n+=t(e.slice(r,i.index));const s=i[0];n+=bR(s)?s:t(s),r=i.index+s.length}return n+=t(e.slice(r)),n}jn.renderer.rules.html_block=(e,t)=>Ty(e[t].content);jn.renderer.rules.html_inline=(e,t)=>Ty(e[t].content);const yR=jn.renderer.rules.image??((e,t,n,r,o)=>o.renderToken(e,t,n)),Mp=jn.renderer.rules.link_open??((e,t,n,r,o)=>o.renderToken(e,t,n)),vR=jn.renderer.rules.fence??((e,t,n,r,o)=>o.renderToken(e,t,n));function Dy(e,t,n){if(!e||/^([a-z]+:)?\/\//i.test(e)||e.startsWith("/")||e.startsWith("#"))return e;const r=e.match(/^attachments\/(.+)$/);return!r||!n?e:Fm(`/api/projects/${encodeURIComponent(n)}/specs/${encodeURIComponent(t)}/attachments/${encodeURIComponent(r[1])}`)}function wR(e){return e.replace(/:\d+(?::\d+)?$/,"")}function xR(e){const n=wR(e).replace(/[?#].*$/,"").split(/[\\/]/).filter(Boolean).pop()??"";return/^\.[^./\\]+$/.test(n)||/\.[A-Za-z0-9][A-Za-z0-9_-]{0,15}$/.test(n)}function _R(e){return!e||e.startsWith("#")||/^([a-z]+:)?\/\//i.test(e)||/^[a-z][a-z0-9+.-]*:/i.test(e)&&!/^[A-Za-z]:[\\/]/.test(e)||e.startsWith("attachments/")?!1:(e.startsWith("/")||/^[A-Za-z]:[\\/]/.test(e))&&xR(e)}function dc(e,t){e.attrs&&(e.attrs=e.attrs.filter(([n])=>n!==t))}function Mo(e,t,n){e.attrs||(e.attrs=[]);const r=e.attrs.find(([o])=>o===t);r?r[1]=n:e.attrs.push([t,n])}jn.renderer.rules.image=function(e,t,n,r,o){const i=r,s=i?.specId;if(s){const u=e[t].attrs?.find(([c])=>c==="src");u&&(u[1]=Dy(u[1],s,i?.projectId))}return yR(e,t,n,r,o)};jn.renderer.rules.link_open=function(e,t,n,r,o){const i=r,s=e[t],a=s.attrs?.find(([c])=>c==="href");if(i?.fileLinks==="copy"&&a&&_R(a[1])){const c=a[1];return dc(s,"href"),dc(s,"target"),dc(s,"rel"),Mo(s,"role","button"),Mo(s,"tabindex","0"),Mo(s,"data-file-link","true"),Mo(s,"data-file-path",c),i.fileLinkTitle&&(Mo(s,"title",i.fileLinkTitle),Mo(s,"aria-label",i.fileLinkTitle)),Mp(e,t,n,r,o)}const u=i?.specId;if(u&&a){const c=Dy(a[1],u,i?.projectId);if(c!==a[1]){a[1]=c;const l=s.attrs?.find(([d])=>d==="target");l?l[1]="_blank":s.attrs?.push(["target","_blank"]),s.attrs?.push(["rel","noopener noreferrer"])}}return Mp(e,t,n,r,o)};jn.renderer.rules.fence=function(e,t,n,r,o){const i=e[t],s=i.info.trim(),a=r?.mermaid??"diagram";if(s==="mermaid"&&a==="diagram"){const u=i.content;return`<div class="mermaid" data-mermaid-source="${u.replace(/"/g,""").replace(/</g,"<").replace(/>/g,">")}">${u}</div>`}return vR(e,t,n,r,o)};jn.use(T6,{enabled:!1,label:!1});function Dd(e,t={}){const n={};return t.specId&&(n.specId=t.specId),t.projectId&&(n.projectId=t.projectId),t.mermaid&&(n.mermaid=t.mermaid),t.fileLinks&&(n.fileLinks=t.fileLinks),t.fileLinkTitle&&(n.fileLinkTitle=t.fileLinkTitle),jn.render(e,n)}function ER(e){return e.replace(/^\uFEFF?---[ \t]*\r?\n[\s\S]*?\r?\n---[ \t]*(?:\r?\n|$)/,"")}const CR="modulepreload",SR=function(e){return"/"+e},Pp={},kR=function(t,n,r){let o=Promise.resolve();if(n&&n.length>0){let s=function(c){return Promise.all(c.map(l=>Promise.resolve(l).then(d=>({status:"fulfilled",value:d}),d=>({status:"rejected",reason:d}))))};document.getElementsByTagName("link");const a=document.querySelector("meta[property=csp-nonce]"),u=a?.nonce||a?.getAttribute("nonce");o=s(n.map(c=>{if(c=SR(c),c in Pp)return;Pp[c]=!0;const l=c.endsWith(".css"),d=l?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${d}`))return;const g=document.createElement("link");if(g.rel=l?"stylesheet":CR,l||(g.as="script"),g.crossOrigin="",g.href=c,u&&g.setAttribute("nonce",u),document.head.appendChild(g),l)return new Promise((p,h)=>{g.addEventListener("load",p),g.addEventListener("error",()=>h(new Error(`Unable to preload CSS for ${c}`)))})}))}function i(s){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=s,window.dispatchEvent(a),!a.defaultPrevented)throw s}return o.then(s=>{for(const a of s||[])a.status==="rejected"&&i(a.reason);return t().catch(i)})};let fc=null,Lp=Promise.resolve();const yl=new WeakMap,AR=30,$p=3;async function TR(e,t){for(let n=0;n<AR;n+=1){if(!Ks(e,t))return!1;if(e.isConnected)return!0;await Us()}return e.querySelectorAll(".mermaid").length,!1}function DR(e){return Array.from(e.querySelectorAll(".mermaid")).filter(t=>{const n=t.getAttribute("data-mermaid-source");return n!==null&&n!==""&&t.querySelector("svg")===null})}async function IR(){return fc||(fc=kR(()=>import("./mermaid.core-DHOOjgm_.js").then(e=>e.bp),[]).then(e=>e.default)),fc}function RR(){return Cx()==="dark"?"dark":"default"}function Us(){return new Promise(e=>{if(typeof window.requestAnimationFrame=="function"){window.requestAnimationFrame(()=>e());return}window.setTimeout(e,0)})}function OR(e){const t=(yl.get(e)??0)+1;return yl.set(e,t),t}function Ks(e,t){return yl.get(e)===t}async function NR(e){const t=Lp.then(e,e);Lp=t.catch(()=>{}),await t}async function MR(e,t={}){if(e.querySelector(".mermaid")===null)return()=>{};const n=OR(e),r=await IR();if(!Ks(e,n))return()=>{};if(!await TR(e,n))return()=>{};let o=()=>{},i=!1;function s(){o(),o=t.enhance?t.enhance(e):()=>{}}async function a(d){const g=d.filter(p=>p.isConnected&&e.contains(p));if(g.length===0){d.length;return}await NR(async()=>{if(!Ks(e,n))return;const p=g.filter(m=>m.isConnected&&e.contains(m));if(p.length===0){g.length;return}const h=RR();r.initialize({startOnLoad:!1,theme:h}),o(),o=()=>{},p.forEach(m=>{const y=m.getAttribute("data-mermaid-source");y&&(m.removeAttribute("data-processed"),m.textContent=y)});try{await r.run({nodes:p}),await Us(),s()}catch(m){i=!0,console.error("[mermaid] render error:",m)}})}let u=Array.from(e.querySelectorAll(".mermaid:not([data-processed])"));for(let d=1;d<=$p&&(u.length>0&&await a(u),!(i||!Ks(e,n)));d+=1){const g=DR(e);if(g.length===0)break;if(d===$p){g.length;break}await Us(),u=g}await Us(),s();const c=()=>void a(Array.from(e.querySelectorAll(".mermaid"))),l=new window.MutationObserver(c);return l.observe(document.documentElement,{attributes:!0,attributeFilter:["data-kb-theme"]}),()=>{o(),l.disconnect()}}const Rs=new WeakMap;let zo=null;const Fp=96,Iy=.25,PR=8,LR=2.5;function Ry(e,t,n){return Math.min(n,Math.max(t,e))}function Os(e){const t=Math.round(e*1e3)/1e3;return Object.is(t,-0)?"0":String(t)}function Bp(e){if(!e)return null;const t=Number.parseFloat(e);return Number.isFinite(t)&&t>0?t:null}function $R(e){const t=e.getBoundingClientRect();if(t.width>0&&t.height>0)return{width:t.width,height:t.height};const n=e.getAttribute("viewBox")?.trim().split(/[\s,]+/).map(Number);return n?.length===4&&n[2]>0&&n[3]>0?{width:n[2],height:n[3]}:{width:Bp(e.getAttribute("width"))??0,height:Bp(e.getAttribute("height"))??0}}function FR(e,t){const n=t.getBoundingClientRect();if(e.width<=0||e.height<=0||n.width<=0||n.height<=0)return 1;const r=Math.max(n.width-Fp,n.width*.5),o=Math.max(n.height-Fp,n.height*.5),i=Math.min(r/e.width,o/e.height);return Ry(i,Iy,LR)}function wi(e,t,n){const r=document.createElement("button");return r.type="button",r.className=e,r.setAttribute("aria-label",t),r.title=t,r.textContent=n,r}function Oy(e){return typeof SVGSVGElement<"u"&&e instanceof SVGSVGElement}function BR(e,t){if(Oy(e)){const r=e.parentElement;return!r||r===t?null:{host:r,svg:e}}if(!(e instanceof HTMLElement))return null;const n=e.querySelector("svg");return n?{host:e,svg:n}:null}function zR(e,t){zo?.close();const n=t.parentNode,r=t.nextSibling,o=t.style.width,i=t.style.height,s=document.createElement("div");s.className="mermaid-overlay",s.setAttribute("role","dialog"),s.setAttribute("aria-modal","true"),s.setAttribute("aria-label",_("mermaid.viewerLabel"));const a=document.createElement("div");a.className="mermaid-overlay__toolbar";const u=wi("mermaid-overlay__button",_("mermaid.zoomOut"),"-"),c=wi("mermaid-overlay__button",_("mermaid.zoomIn"),"+"),l=wi("mermaid-overlay__button",_("mermaid.reset"),"1:1"),d=wi("mermaid-overlay__button",_("mermaid.close"),"x");a.append(u,c,l,d);const g=document.createElement("div");g.className="mermaid-overlay__viewport";const p=document.createElement("div");p.className="mermaid-overlay__canvas",t.classList.add("mermaid-overlay__svg"),p.appendChild(t),g.appendChild(p),s.append(a,g),document.body.appendChild(s);const h=$R(t),m=FR(h,g);let y=m,v=0,b=0,w=!1,E=0,C=0,k=0,T=0;const S=()=>{p.style.transform=`translate(${Os(v)}px, ${Os(b)}px)`},A=()=>{h.width<=0||h.height<=0||(t.style.width=`${Os(h.width*y)}px`,t.style.height=`${Os(h.height*y)}px`)},F=()=>{A(),S()},O=(V,j,he)=>{const K=g.getBoundingClientRect(),z=j===void 0?K.width/2:j-K.left,J=he===void 0?K.height/2:he-K.top,re=K.width/2,ve=K.height/2,Z=y;y=Ry(V,Iy,PR),v=z-re-(z-re-v)/Z*y,b=J-ve-(J-ve-b)/Z*y,F()},P=()=>{y=m,v=h.width>0?-(h.width*y)/2:0,b=h.height>0?-(h.height*y)/2:0,F()},L=()=>{if(document.removeEventListener("keydown",ce),t.classList.remove("mermaid-overlay__svg"),t.style.width=o,t.style.height=i,n?.isConnected){const V=r?.parentNode===n?r:null;n.insertBefore(t,V)}s.remove(),zo?.close===L&&(zo=null)},D=V=>{V.preventDefault();const j=V.deltaY>0?.9:1.1;O(y*j,V.clientX,V.clientY)},B=V=>{V.button===0&&(w=!0,E=V.clientX,C=V.clientY,k=v,T=b,g.setPointerCapture(V.pointerId),g.classList.add("is-dragging"))},N=V=>{w&&(v=k+V.clientX-E,b=T+V.clientY-C,S())},Y=V=>{w&&(w=!1,g.classList.remove("is-dragging"),g.hasPointerCapture(V.pointerId)&&g.releasePointerCapture(V.pointerId))},ce=V=>{V.key==="Escape"&&(V.stopPropagation(),L())};return u.addEventListener("click",()=>O(y/1.2)),c.addEventListener("click",()=>O(y*1.2)),l.addEventListener("click",P),d.addEventListener("click",L),g.addEventListener("wheel",D,{passive:!1}),g.addEventListener("pointerdown",B),g.addEventListener("pointermove",N),g.addEventListener("pointerup",Y),g.addEventListener("pointercancel",Y),document.addEventListener("keydown",ce),zo={host:e,sourceSvg:t,close:L},P(),d.focus(),L}function UR(e){const t=[];return e.querySelectorAll(".mermaid").forEach(n=>{const r=BR(n,e);if(!r)return;const{host:o}=r,i=Rs.get(o);if(i?.button.isConnected){t.push(i.cleanup);return}i?.cleanup(),o.classList.add("mermaid-control-host");const s=wi("mermaid-fullscreen-button",_("mermaid.maximize"),"⤢"),a=()=>{const c=Oy(n)&&n.isConnected?n:o.querySelector("svg");c&&zR(o,c)};s.addEventListener("click",a),o.appendChild(s);const u=()=>{zo?.host===o&&zo.close(),s.removeEventListener("click",a),s.isConnected&&s.remove(),o.classList.remove("mermaid-control-host"),Rs.get(o)?.button===s&&Rs.delete(o)};Rs.set(o,{button:s,cleanup:u}),t.push(u)}),()=>{t.forEach(n=>n())}}async function Ny(e){return MR(e,{enhance:UR})}function KR(e,t){let n=e;for(;n&&n!==t;){if(n.nodeType===1){const o=n.tagName;if(o==="H2"||o==="H3")return n}let r=n.previousSibling;if(!r){n=n.parentNode;continue}for(;r?.lastChild;)r=r.lastChild;n=r}return null}function jR(e,t){return t.contains(e.startContainer)&&t.contains(e.endContainer)&&t.contains(e.commonAncestorContainer)}function qR(e,t,n){const r=n.throttleMs??50;let o,i="";const s=()=>{window.clearTimeout(o),o=window.setTimeout(()=>{const a=window.getSelection();if(!a||a.rangeCount===0||a.isCollapsed){i!==""&&(i="",t(null));return}const u=a.getRangeAt(0);if(!jR(u,e)){i!==""&&(i="",t(null));return}const c=a.toString();if(!c.trim()){i!==""&&(i="",t(null));return}const l=u.getBoundingClientRect(),d=KR(u.startContainer,e),g=n.noSectionLabel,p=d&&d.textContent?.trim()||g;i=c,t({text:c,rect:l,sectionPath:p})},r)};return document.addEventListener("selectionchange",s),()=>{document.removeEventListener("selectionchange",s),window.clearTimeout(o)}}function HR(e,t,n={}){return qR(e,t,{...n,noSectionLabel:_("selection.noSection")})}const GR=/^##\s+(?:\d+(?:\.\d+)*\.?\s+)?待确认(?:项|问题)\s*$/,VR=/^##\s+/,WR=/^###\s+(?:\d+(?:\.\d+)*\s+)?(.+\S)\s*$/,YR=/^\d+\.\s+(.*\S)\s*$/,ZR=/^\s*$/,zp=/\s*[((]推荐[))]\s*$/,Up=/\s*(自由文本)\s*$/,XR=/^\[(choice|confirm)\]\s*/i,JR=/^\*\*方案\*\*\s*[::]\s*(.*\S)?\s*$/,QR=/^\*\*(?:影响|代价)\*\*\s*[::]\s*(.*\S)?\s*$/;function eO(e){const t=e.split(`
|
|
26
|
+
`);let n=0;for(;n<t.length&&!GR.test(t[n]);)n+=1;if(n>=t.length)return[];n+=1;const r=[];let o=null;for(;n<t.length;){const i=t[n];if(VR.test(i))break;const s=oO(i);s?(o={headingText:s,bodyLines:[]},r.push(o)):o&&o.bodyLines.push(i),n+=1}return r.map((i,s)=>tO(i,s))}function tO(e,t){const n=XR.exec(e.headingText),r=n?.[1]?.toLowerCase(),o=n?e.headingText.slice(n[0].length):e.headingText,i=Up.test(o),s=i?o.replace(Up,"").trim():o.trim();if(r==="confirm"){const{plan:c,impact:l}=nO(e.bodyLines);return{id:Kp(t,s),text:s,kind:"confirm",options:[],isFreeform:!1,plan:c,impact:l}}const a=rO(e.bodyLines,t,s),u=i||a.length===0;return{id:Kp(t,s),text:s,kind:u?"freeform":"choice",options:a,isFreeform:u}}function nO(e){let t,n;for(const r of e){const o=r.trim(),i=JR.exec(o);if(i){t=i[1]?.trim()||"";continue}const s=QR.exec(o);s&&(n=s[1]?.trim()||"")}return{plan:t,impact:n}}function rO(e,t,n){const r=[];let o=0;for(const i of e){if(ZR.test(i))continue;const s=iO(i);if(s===null)continue;const a=zp.test(s),u=a?s.replace(zp,"").trim():s.trim();u&&(a&&(o+=1),r.push({id:sO(t,r.length,u),label:u,recommended:a&&o===1}))}return o>=2&&console.warn(`[question-parse] 问题 "${n}" 含 ${o} 个 (推荐),已保留首个,其余降级`),r}function oO(e){const t=WR.exec(e);return t?t[1]:null}function iO(e){const t=YR.exec(e);return t?t[1]:null}function Kp(e,t){return`q-${e}-${My(t)}`}function sO(e,t,n){return`q-${e}-o-${t}-${My(n)}`}function My(e){let t=0;for(let n=0;n<e.length;n+=1)t=t*31+e.charCodeAt(n)|0;return(t>>>0).toString(36)}var aO=$('<div class="selection-menu fixed z-50 flex gap-1 rounded-md border bg-popover p-1 shadow-md">');const uO=36,cO=140,lO=e=>{const t=()=>{const n=e.snap;if(!n)return{top:0,left:0,visible:!1};const r=n.rect.top-uO-8,o=n.rect.left,i=r<8?n.rect.bottom+8:r,s=Math.min(Math.max(8,o),window.innerWidth-cO-8);return{top:i,left:s,visible:!0}};return f(q,{get when(){return e.snap},children:n=>{const r=t();return(()=>{var o=aO();return o.$$mousedown=i=>i.preventDefault(),x(o,f(Ee,{variant:"ghost",size:"sm",onClick:()=>e.onAnnotate(n()),get children(){return _("selectionMenu.annotate")}}),null),x(o,f(Ee,{variant:"ghost",size:"sm",onClick:()=>e.onExplain(n()),get children(){return _("selectionMenu.explain")}}),null),Me(i=>{var s=`${r.top}px`,a=`${r.left}px`;return s!==i.e&&Di(o,"top",i.e=s),a!==i.t&&Di(o,"left",i.t=a),i},{e:void 0,t:void 0}),o})()}})};jt(["mousedown"]);var dO=$('<div class="fixed z-[60] flex max-h-[calc(100vh-16px)] flex-col gap-2.5 overflow-visible rounded-lg border bg-card p-3.5 shadow-xl"style=width:500px><header class="flex flex-col gap-0.5"><strong></strong></header><blockquote class="m-0 border-l-2 border-border bg-background px-2.5 py-1.5 text-[0.9em] text-muted-foreground"><em></em> <!> "<!>"</blockquote><form><div class="mt-3 flex justify-end gap-2">'),fO=$('<p class="text-destructive ">');const gO=500,Lr=8,pO=e=>{const[t,n]=I(""),[r,o]=I(!1),[i,s]=I(null),[a,u]=I(0),c=()=>{const d=e.snap;if(!d)return{top:0,left:0};const g=a()||260,p=window.innerHeight,h=d.rect.bottom+Lr,m=d.rect.top-Lr-g;let y;h+g<=p-Lr?y=h:m>=Lr?y=m:y=Math.max(Lr,p-g-Lr);const v=Math.min(Math.max(Lr,d.rect.left),window.innerWidth-gO-Lr);return{top:y,left:v}};async function l(d){if(d.preventDefault(),!!t().trim()){o(!0),s(null);try{await e.onSubmit(t().trim()),n(""),e.onCancel()}catch(g){s(g.message)}finally{o(!1)}}}return f(q,{get when(){return Q(()=>!!e.open)()&&e.snap},get children(){var d=dO(),g=d.firstChild,p=g.firstChild,h=g.nextSibling,m=h.firstChild,y=m.nextSibling,v=y.nextSibling,b=v.nextSibling,w=b.nextSibling;w.nextSibling;var E=h.nextSibling,C=E.firstChild;return d.$$mousedown=k=>k.stopPropagation(),Ln(k=>{queueMicrotask(()=>{k.offsetHeight!==a()&&u(k.offsetHeight)})},d),x(p,()=>_("annotate.title")),x(m,()=>e.snap?.sectionPath),x(h,()=>_("annotate.inSection"),v),x(h,()=>(e.snap?.text??"").slice(0,200),w),E.addEventListener("submit",l),x(E,f(Ha,{get projectId(){return e.projectId},minRows:3,maxRows:3,get value(){return t()},onValueChange:n,get placeholder(){return _("annotate.placeholder")},autofocus:!0}),C),x(E,(()=>{var k=Q(()=>!!i());return()=>k()&&(()=>{var T=fO();return x(T,i),T})()})(),C),x(C,f(Ee,{variant:"ghost",type:"button",get onClick(){return e.onCancel},get children(){return _("common.cancel")}}),null),x(C,f(Ee,{variant:"default",type:"submit",get disabled(){return r()||!t().trim()},get children(){return Q(()=>!!r())()?_("common.submitting"):_("annotate.submit")}}),null),Me(k=>{var T=`${c().top}px`,S=`${c().left}px`;return T!==k.e&&Di(d,"top",k.e=T),S!==k.t&&Di(d,"left",k.t=S),k},{e:void 0,t:void 0}),d}})};jt(["mousedown"]);var hO=$("<div><span class=text-muted-foreground></span><code class=font-mono>"),mO=$('<blockquote class="m-0 border-l-2 border-border pl-2 text-muted-foreground">'),bO=$('<div class="flex flex-col gap-1 text-sm">'),yO=$('<p class="text-destructive ">'),vO=$('<div class="append-dialog-backdrop fixed inset-0 z-50"><div class="append-dialog fixed z-50 flex w-96 max-w-[calc(100vw-2rem)] flex-col gap-3 rounded-xl border bg-card p-4 shadow-lg"role=dialog><header class="flex flex-col gap-0.5"><strong class=" "></strong><span class="text-sm text-muted-foreground"></span></header><form class="flex flex-col gap-3"><label class="flex flex-col gap-1 "><span></span></label><div class="flex items-center justify-end gap-2">');const wO={feat:"appendTask.kindFeat",refct:"appendTask.kindRefct",fix:"appendTask.kindFix"},xO=e=>{const[t,n]=I("fix"),[r,o]=I(""),[i,s]=I(!1),[a,u]=I(null),[c,l]=I(null);ae(()=>{if(!e.open){l(null);return}const h=e.anchorEl;if(!h)return;const m=h.getBoundingClientRect(),v=Math.max(16,Math.min(m.left,window.innerWidth-384-16));l({top:m.bottom+8,left:v})}),ae(()=>{if(!e.open)return;const h=m=>{m.defaultPrevented||m.key==="Escape"&&(m.preventDefault(),p())};window.addEventListener("keydown",h),ue(()=>window.removeEventListener("keydown",h))});function d(){n("fix"),o(""),u(null)}async function g(h){h.preventDefault();const m=r().trim();if(!m){u(_("appendTask.descRequired"));return}s(!0),u(null);try{await e.onSubmit({kind:t(),description:m,sectionPath:e.sectionPath,quote:e.quote}),d(),e.onCancel()}catch(y){u(y.message)}finally{s(!1)}}function p(){e.onCancel()}return f(q,{get when(){return e.open},get children(){var h=vO(),m=h.firstChild,y=m.firstChild,v=y.firstChild,b=v.nextSibling,w=y.nextSibling,E=w.firstChild,C=E.firstChild,k=E.nextSibling;return h.$$mousedown=p,m.$$mousedown=T=>T.stopPropagation(),x(v,()=>_("appendTask.title")),x(b,()=>_("appendTask.hint")),w.addEventListener("submit",g),x(w,f(Xn,{class:"m-0 flex flex-col gap-1.5 border-0 p-0",get value(){return t()},onChange:T=>n(T),get disabled(){return i()},get children(){return[f(vd,{class:"mb-1 font-medium",get children(){return _("appendTask.type")}}),Q(()=>["feat","refct","fix"].map(T=>f(hn,{value:T,class:"flex items-center gap-1.5",get children(){return[f(gn,{}),f(_n,{}),f(pn,{class:"cursor-pointer",get children(){return _(wO[T])}})]}})))]}}),E),x(C,()=>_("appendTask.description")),x(E,f(Ha,{get projectId(){return e.projectId},minRows:5,maxRows:5,get value(){return r()},onValueChange:o,get placeholder(){return _("appendTask.descPlaceholder")},autofocus:!0,get disabled(){return i()}}),null),x(w,f(q,{get when(){return e.sectionPath||e.quote},get children(){var T=bO();return x(T,f(q,{get when(){return e.sectionPath},get children(){var S=hO(),A=S.firstChild,F=A.nextSibling;return x(A,()=>_("appendTask.refSection")),x(F,()=>e.sectionPath),S}}),null),x(T,f(q,{get when(){return e.quote},get children(){var S=mO();return x(S,()=>e.quote?.slice(0,200)),S}}),null),T}}),k),x(w,f(q,{get when(){return a()},get children(){var T=yO();return x(T,a),T}}),k),x(k,f(Ee,{type:"button",variant:"ghost",size:"sm",onClick:p,get disabled(){return i()},get children(){return _("common.cancel")}}),null),x(k,f(Ee,{type:"submit",variant:"default",size:"sm",get disabled(){return i()},get children(){return[f(xa,{class:"mr-1 h-3.5 w-3.5"}),Q(()=>Q(()=>!!i())()?_("common.submitting"):_("appendTask.submit"))]}}),null),Me(T=>{var S=_("appendTask.title"),A=c()?{top:`${c().top}px`,left:`${c().left}px`}:void 0;return S!==T.e&&Ke(m,"aria-label",T.e=S),T.t=Vo(m,A,T.t),T},{e:void 0,t:void 0}),h}})};jt(["mousedown"]);const fa="__freeform__",_O={accept:"确认,按此推进",rejectAlternative:"否决·换方案",rejectConstraint:"否决·补约束",rejectDropGoal:"否决·弃目标·废弃当前目标,继续其余",rejectDropSpec:"否决·弃目标·放弃整个 spec"},EO="accept";function CO(e){return e!==EO}function SO(e,t,n){const r=_O[t],o=(n??"").trim();if(CO(t)&&!o)return null;const i={questionId:e.id,questionText:e.text,selectedOptionLabel:r};return o&&(i.note=o),i}function kO(e,t){const n=(t.note??"").trim();if(e.isFreeform)return n?{questionId:e.id,questionText:e.text,note:n}:null;const r=t.selectedOptionLabel;return r===fa?n?{questionId:e.id,questionText:e.text,note:n}:null:r?{questionId:e.id,questionText:e.text,selectedOptionLabel:r}:null}function Py(e){if(e.confirmTop==="accept")return"accept";if(e.confirmTop!=="reject")return null;if(e.confirmIntent==="alternative")return"rejectAlternative";if(e.confirmIntent==="constraint")return"rejectConstraint";if(e.confirmIntent==="dropGoal"){if(e.confirmDrop==="current")return"rejectDropGoal";if(e.confirmDrop==="spec")return"rejectDropSpec"}return null}function AO(e){const t=Py(e);return t?t==="accept"?!0:e.note.trim().length>0:!1}function TO(e){const t={};for(const n of e){if(n.kind==="confirm"){t[n.id]={note:"",confirmTop:"accept"};continue}const r=n.options.find(o=>o.recommended);t[n.id]={selectedOptionLabel:r?.label??n.options[0]?.label,note:""}}return t}function DO(e,t){let n=0;for(const r of e){const o=t[r.id];if(!o){n+=1;continue}if(r.kind==="confirm"){AO(o)||(n+=1);continue}const i=o.note??"";r.isFreeform||o.selectedOptionLabel===fa?i.trim()||(n+=1):o.selectedOptionLabel||(n+=1)}return n}function IO(e,t){const n=[];for(const r of e){const o=t[r.id]??{note:""};if(r.kind==="confirm"){const s=Py(o);if(!s)continue;const a=SO(r,s,o.note);if(!a)return{ok:!1,reason:"reasonRequired"};n.push(a);continue}const i=kO(r,o);i&&n.push(i)}return{ok:!0,items:n}}function RO(e){return`f-${Date.now()}-${e}`}function OO(e){return e.map(t=>({sectionPath:t.sectionPath,quote:t.quote,note:t.note}))}function NO(e){return e?e.includes("🔴")?"border-l-2 border-l-destructive":e.includes("🟡")?"border-l-2 border-l-warning":"border-border":"border-border"}var MO=$('<p class="text-destructive mx-3 mt-1 ">'),PO=$('<aside class="flex min-w-0 flex-[4] flex-col overflow-hidden rounded-lg border bg-card shadow-lg"data-testid=question-confirm-panel><header class="flex items-center justify-between gap-2 border-b bg-background px-3 py-2.5"><div class="flex min-w-0 flex-1 items-baseline gap-2"><strong class="min-w-0 truncate font-semibold"></strong><span class="shrink-0 whitespace-nowrap text-sm text-muted-foreground"> <span class="font-semibold text-warning"></span> / </span></div></header><ul class="m-0 flex min-h-0 min-w-0 list-none flex-1 flex-col gap-2 overflow-auto p-2">'),jp=$('<p class="m-0 break-words"><strong></strong>:'),LO=$("<div>"),$O=$('<li class="flex min-w-0 flex-col gap-2 rounded-lg border bg-background p-2.5"><p class="qcp-question m-0 font-medium break-words">'),FO=$('<em class="text-sm not-italic text-primary"> '),BO=$('<li class="flex min-w-0 flex-col gap-2 rounded-lg border border-accent/60 bg-background p-2.5"><header class="text-muted-foreground flex items-center justify-between text-sm"><strong></strong></header><blockquote class="border-border bg-card m-0 border-l-2 px-2 py-1 text-sm text-muted-foreground break-words"><em></em> <!> "<!>"</blockquote><p class="m-0 whitespace-pre-wrap break-words">!!!');const zO=e=>{const t=ne(()=>TO(e.questions)),[n,r]=I({}),o=ne(()=>({...t(),...n()})),[i,s]=I(!1),[a,u]=I(null);function c(v,b){r(w=>({...w,[v]:{...w[v]??o()[v],...b}}))}function l(v,b){c(v,{selectedOptionLabel:b})}function d(v,b){c(v,{note:b})}function g(v,b){b==="accept"?c(v,{confirmTop:b,confirmIntent:void 0,confirmDrop:void 0}):c(v,{confirmTop:b})}function p(v,b){b==="dropGoal"?c(v,{confirmIntent:b}):c(v,{confirmIntent:b,confirmDrop:void 0})}function h(v,b){c(v,{confirmDrop:b})}const m=ne(()=>DO(e.questions,o()));async function y(){s(!0),u(null);try{const v=IO(e.questions,o());if(!v.ok){u(_("questionConfirm.reasonRequired"));return}const b={answers:v.items,freeformAnnotations:OO(e.freeforms)};if(b.answers.length===0&&b.freeformAnnotations.length===0){u(_("questionConfirm.noAnswers"));return}await e.onSubmit(b)}catch(v){u(v.message)}finally{s(!1)}}return(()=>{var v=PO(),b=v.firstChild,w=b.firstChild,E=w.firstChild,C=E.nextSibling,k=C.firstChild,T=k.nextSibling;T.nextSibling;var S=b.nextSibling;return x(E,()=>_("questionConfirm.title")),x(C,()=>_("questionConfirm.unanswered"),k),x(T,m),x(C,()=>e.questions.length,null),x(b,f(Ee,{size:"sm",class:"shrink-0",get disabled(){return i()||e.running},onClick:y,get children(){return[f(xa,{class:"mr-1 h-3.5 w-3.5"}),Q(()=>Q(()=>!!i())()?_("common.submitting"):Q(()=>!!e.running)()?_("questionConfirm.running"):_("questionConfirm.submitAll"))]}}),null),x(v,f(q,{get when(){return a()},get children(){var A=MO();return x(A,a),A}}),S),x(S,f(ot,{get each(){return e.questions},children:A=>{const F=()=>o()[A.id]??{note:""},O=()=>A.kind!=="confirm"&&(A.isFreeform||F().selectedOptionLabel===fa),P=()=>A.kind==="confirm"&&F().confirmTop==="reject";return(()=>{var L=$O(),D=L.firstChild;return x(D,()=>A.text),x(L,f(q,{get when(){return A.kind==="choice"},get children(){return f(Xn,{class:"m-0 flex flex-col gap-1 p-0",get value(){return F().selectedOptionLabel??""},onChange:B=>l(A.id,B),get children(){return[f(ot,{get each(){return A.options},children:B=>f(hn,{get value(){return B.label},class:"flex items-center gap-1.5 rounded-md px-1 py-0.5 hover:bg-primary/5",get children(){return[f(gn,{}),f(_n,{}),f(pn,{class:"min-w-0 cursor-pointer break-words",get children(){return[Q(()=>B.label),f(q,{get when(){return B.recommended},get children(){var N=FO();return N.firstChild,x(N,()=>_("questionConfirm.recommended"),null),N}})]}})]}})}),f(hn,{value:fa,class:"flex items-center gap-1.5 rounded-md px-1 py-0.5 hover:bg-primary/5",get children(){return[f(gn,{}),f(_n,{}),f(pn,{class:"qcp-option-freeform cursor-pointer",get children(){return _("questionConfirm.freeformLabel")}})]}})]}})}}),null),x(L,f(q,{get when(){return A.kind==="confirm"},get children(){return[(()=>{var B=LO();return x(B,f(q,{get when(){return A.plan},get children(){var N=jp(),Y=N.firstChild;return Y.nextSibling,x(Y,()=>_("questionConfirm.confirmPlanLabel")),x(N,()=>A.plan,null),N}}),null),x(B,f(q,{get when(){return A.impact},get children(){var N=jp(),Y=N.firstChild;return Y.nextSibling,x(Y,()=>_("questionConfirm.confirmImpactLabel")),x(N,()=>A.impact,null),N}}),null),Me(()=>xt(B,`flex flex-col gap-1 rounded-md border bg-card px-2 py-1.5 text-sm ${NO(A.impact)}`)),B})(),f(Xn,{class:"m-0 flex flex-col gap-1 p-0",get value(){return F().confirmTop??""},onChange:B=>g(A.id,B),get children(){return[f(hn,{value:"accept",class:"flex items-center gap-1.5 rounded-md px-1 py-0.5 hover:bg-primary/5",get children(){return[f(gn,{}),f(_n,{}),f(pn,{class:"qcp-confirm-accept cursor-pointer",get children(){return _("questionConfirm.decisionAccept")}})]}}),f(hn,{value:"reject",class:"flex items-center gap-1.5 rounded-md px-1 py-0.5 hover:bg-primary/5",get children(){return[f(gn,{}),f(_n,{}),f(pn,{class:"qcp-confirm-reject cursor-pointer font-medium text-destructive",get children(){return _("questionConfirm.decisionReject")}})]}})]}}),f(q,{get when(){return F().confirmTop==="reject"},get children(){return f(Xn,{class:"m-0 ml-5 flex flex-col gap-1 border-l border-border pl-2",get value(){return F().confirmIntent??""},onChange:B=>p(A.id,B),get children(){return[f(ot,{get each(){return[["alternative",_("questionConfirm.intentAlternative")],["constraint",_("questionConfirm.intentConstraint")],["dropGoal",_("questionConfirm.intentDropGoal")]]},children:([B,N])=>f(hn,{value:B,class:"flex items-center gap-1.5 rounded-md px-1 py-0.5 hover:bg-primary/5",get children(){return[f(gn,{}),f(_n,{}),f(pn,{class:"min-w-0 cursor-pointer break-words",children:N})]}})}),f(q,{get when(){return F().confirmIntent==="dropGoal"},get children(){return f(Xn,{class:"m-0 ml-5 flex flex-col gap-1 border-l border-border pl-2",get value(){return F().confirmDrop??""},onChange:B=>h(A.id,B),get children(){return f(ot,{get each(){return[["current",_("questionConfirm.dropGoalCurrent")],["spec",_("questionConfirm.dropGoalSpec")]]},children:([B,N])=>f(hn,{value:B,class:"flex items-center gap-1.5 rounded-md px-1 py-0.5 hover:bg-primary/5",get children(){return[f(gn,{}),f(_n,{}),f(pn,{class:"min-w-0 cursor-pointer break-words",children:N})]}})})}})}})]}})}})]}}),null),x(L,f(q,{get when(){return O()},get children(){return f(hl,{class:"qcp-note",rows:2,get placeholder(){return _("questionConfirm.notePlaceholder")},get value(){return F().note},onInput:B=>d(A.id,B.currentTarget.value)})}}),null),x(L,f(q,{get when(){return P()},get children(){return f(hl,{class:"qcp-reject-reason",rows:2,get placeholder(){return _("questionConfirm.reasonPlaceholder")},get value(){return F().note},onInput:B=>d(A.id,B.currentTarget.value)})}}),null),L})()}}),null),x(S,f(ot,{get each(){return e.freeforms},children:A=>(()=>{var F=BO(),O=F.firstChild,P=O.firstChild,L=O.nextSibling,D=L.firstChild,B=D.nextSibling,N=B.nextSibling,Y=N.nextSibling,ce=Y.nextSibling;ce.nextSibling;var V=L.nextSibling;return V.firstChild,x(P,()=>_("questionConfirm.selectionAnnotation")),x(O,f(Ee,{variant:"ghost",size:"icon",class:"h-6 w-6",onClick:()=>e.onRemoveFreeform(A.id),"aria-label":"remove",get children(){return f(Yr,{class:"h-4 w-4"})}}),null),x(D,()=>A.sectionPath),x(L,()=>_("questionConfirm.quoteConnector"),N),x(L,()=>A.quote.slice(0,200),ce),x(V,()=>A.note,null),F})()}),null),Me(()=>Ke(E,"title",_("questionConfirm.title"))),v})()};var UO=$('<section class="flex min-h-0 flex-1 flex-col gap-2 p-2">'),qp=$("<p class=text-muted-foreground>"),KO=$('<header class="flex flex-col items-start justify-between gap-2"><div class="flex w-full items-center justify-between gap-2"><div class="flex min-w-0 items-center gap-1"></div></div><div><p class=" text-muted-foreground"></p></div><div class="flex items-center gap-2 text-muted-foreground"><div class="relative inline-flex shrink-0 rounded-md has-[:focus-visible]:ring-[1.5px] has-[:focus-visible]:ring-ring"><span aria-hidden=true></span><select class="absolute inset-0 h-full w-full cursor-pointer opacity-0"><option value=plan>plan</option><option value=tasks>tasks</option><option value=execute>execute</option><option value=done>done</option></select></div><time>'),jO=$('<p class="text-destructive ">'),qO=$('<div class="flex min-h-0 flex-1 items-stretch gap-4"><article class="markdown spec-main flex-[6] min-w-0 overflow-auto rounded-xl border bg-card p-4 shadow">');const HO={plan:"bg-stage-plan/15 text-stage-plan border-stage-plan/30",tasks:"bg-stage-tasks/15 text-stage-tasks border-stage-tasks/30",execute:"bg-stage-execute/15 text-stage-execute border-stage-execute/30",done:"bg-stage-done/15 text-stage-done border-stage-done/30"},GO=120,Hp=3,VO=150,WO=e=>new Promise(t=>setTimeout(t,e));async function YO(e,t,n){for(let r=0;r<=Hp;r+=1)try{return await we.getSpec(e,t)}catch(o){if(!o.message.startsWith("404"))throw o;r<Hp&&await WO(VO)}return n??null}const ZO=()=>{const e=Vi(),t=yo(),[n,r]=I(0),[o,i]=I(!1),[s,a]=I(""),[u]=Zt(()=>[t(),e.id,n()],async([K,z],J)=>YO(K,z,J.value)),[c]=Zt(()=>[t(),e.id,n()],async([K,z])=>{try{return await we.getDebug(K,z)}catch{return{exists:!1,text:""}}}),[l,d]=I(null),[g,p]=I(!1),[h,m]=I(null),[y,v]=I(null),[b,w]=I(null),[E,C]=I([]),[k,T]=I(!1),[S,A]=I(null);let F;const O=ne(()=>{const K=u();return K?eO(K.body):[]}),P=ne(()=>!u()||o()?!1:O().length>0||E().length>0);ae(()=>{const K=e.id,z=t();if(!K||!z)return;let J;const re=gE(z,K,{onUpdated:()=>{J&&clearTimeout(J),J=setTimeout(()=>void Al(()=>r(ve=>ve+1)),GO)}});ue(()=>{J&&clearTimeout(J),re()})}),ae(()=>{const K=e.id,z=t();!K||!z||we.getSpecSession(z,K).then(({sessionId:J,running:re})=>{J&&(a(J),i(re),Bo(J))}).catch(()=>{})}),ae(()=>{const K=t(),z=s();if(!K||!z)return;const J=Wm(K,{onStatus:re=>{re.sessionId===z&&i(re.running)}});ue(J)}),ae(()=>{const K=t(),z=s();if(!K||!z)return;const J=Ea(K,z,{onEvent:re=>{(re.type==="turn-completed"||re.type==="error")&&i(!1)}});ue(J)}),ae(()=>{const K=b();if(!K)return;const z=HR(K,d);ue(z)}),Wi(()=>k()||g()),ae(()=>{const K=b(),z=u();if(!K||!z)return;const J=t();let re=!0,ve;const Z=Dd(z.body,{specId:z.id,projectId:J||void 0});zT(K,`<article>${Z}</article>`,{childrenOnly:!0,onBeforeElUpdated:(M,W)=>!(M.classList?.contains("mermaid")&&M.getAttribute("data-mermaid-source")===W.getAttribute?.("data-mermaid-source"))}),Ny(K).then(M=>{if(!re){M();return}ve=M}),ue(()=>{re=!1,ve?.()})});async function L(){v(null),i(!0);try{const K=t(),{sessionId:z}=await we.runAgent(K,e.id);a(z),Bo(z)}catch(K){i(!1),v(K.message)}}async function D(K){v(null);try{await we.setStage(t(),e.id,K),r(z=>z+1)}catch(z){v(z.message)}}function B(K){m(K),p(!0)}async function N(K){const z=h();z&&C(J=>[...J,{id:RO(J.length),sectionPath:z.sectionPath,quote:z.text,note:K}])}function Y(K){C(z=>z.filter(J=>J.id!==K))}async function ce(K){await we.submitQuestionAnswers(t(),e.id,K),C([]),await L()}function V(){A(l()),T(!0)}async function j(K){const z=t(),J=await we.appendItem(z,e.id,K);J.busy&&v(_("specDetail.appendSavedSpecBusy")),J.sessionId&&(i(!0),a(J.sessionId),Bo(J.sessionId,J.commandLine?{userText:J.commandLine,kind:J.kind??"claude"}:void 0))}async function he(K){i(!0);try{const z=t(),{sessionId:J}=await we.explain(z,e.id,K.text);a(J),Bo(J)}catch(z){i(!1),v(z.message)}}return(()=>{var K=UO();return x(K,f(va,{get fallback(){return(()=>{var z=qp();return x(z,()=>_("common.loading")),z})()},get children(){return f(q,{get when(){return u()},get fallback(){return(()=>{var z=qp();return x(z,()=>_("specDetail.notFound")),z})()},children:z=>[(()=>{var J=KO(),re=J.firstChild,ve=re.firstChild,Z=re.nextSibling,M=Z.firstChild,W=Z.nextSibling,oe=W.firstChild,te=oe.firstChild,H=te.nextSibling,de=oe.nextSibling;return x(ve,f(ss,{get items(){return[{label:_("breadcrumb.specList"),href:Tt("")},{label:z().id}]}}),null),x(ve,f(Ee,{variant:"ghost",size:"icon",class:"h-7 w-7 shrink-0",get title(){return _("specDetail.copySpecPath")},get"aria-label"(){return _("specDetail.copySpecPath")},onClick:()=>void U1(e.id),get children(){return f(x_,{class:"h-3.5 w-3.5"})}}),null),x(re,f(is,{}),null),x(M,()=>z().frontmatter.summary||_("common.pendingAgent")),x(te,()=>z().frontmatter.stage),H.addEventListener("change",fe=>D(fe.currentTarget.value)),x(de,()=>Xm(z().frontmatter.updated_at)),x(W,f(Ee,{variant:"outline",size:"sm",class:"append-btn",ref(fe){var Ue=F;typeof Ue=="function"?Ue(fe):F=fe},onClick:V,get children(){return _("specDetail.appendTask")}}),null),x(W,f(q,{get when(){return c()?.exists},get children(){return f(Nn,{class:"inline-flex h-8 cursor-pointer items-center justify-center rounded-md px-3 font-medium hover:bg-accent hover:text-accent-foreground",get href(){return Tt(`specs/${z().id}/debug`)},get children(){return _("specDetail.debug")}})}}),null),x(W,f(Nn,{class:"inline-flex h-8 w-8 cursor-pointer items-center justify-center rounded-md hover:bg-accent hover:text-accent-foreground",get href(){return Tt(`specs/${z().id}/review`)},get title(){return _("git.title")},get children(){return f(Pl,{class:"h-4 w-4"})}}),null),x(W,f(q,{get when(){return o()},get children(){return f(j1,{variant:"secondary",get children(){return _("specDetail.running")}})}}),null),Me(fe=>{var Ue=`inline-flex items-center rounded-md border px-2.5 py-0.5 font-mono text-sm font-semibold uppercase tracking-wider ${HO[z().frontmatter.stage]??"bg-muted text-muted-foreground border-border"}`,se=_("specDetail.forceStage"),xe=_("specDetail.forceStage");return Ue!==fe.e&&xt(te,fe.e=Ue),se!==fe.t&&Ke(H,"title",fe.t=se),xe!==fe.a&&Ke(H,"aria-label",fe.a=xe),fe},{e:void 0,t:void 0,a:void 0}),Me(()=>H.value=z().frontmatter.stage),J})(),f(q,{get when(){return y()},get children(){var J=jO();return x(J,y),J}}),(()=>{var J=qO(),re=J.firstChild;return x(J,f(q,{get when(){return P()},get children(){return f(zO,{get questions(){return O()},get freeforms(){return E()},get running(){return o()},onRemoveFreeform:Y,onSubmit:ce})}}),re),Ln(w,re),J})(),f(lO,{get snap(){return Q(()=>!!g())()?null:l()},onAnnotate:B,onExplain:he}),f(pO,{get open(){return g()},get projectId(){return t()},get snap(){return h()},onCancel:()=>p(!1),onSubmit:N}),f(xO,{get open(){return k()},get projectId(){return t()},get sectionPath(){return S()?.sectionPath},get quote(){return S()?.text},anchorEl:F,onCancel:()=>T(!1),onSubmit:j})]})}})),K})()},XO={M:"text-warning",A:"text-success",D:"text-destructive","??":"text-info",R:"text-primary"};function JO(e){return XO[e]??""}function QO(e,t,n){const r=new Set(n.map(i=>i.path)),o=new Set;for(const i of e)r.has(i)&&o.add(i);return{selected:o,active:t&&r.has(t)?t:null}}function e4(e){return`${e?.index??""}${e?.worktree??""}`}var gc,Gp;function t4(){if(Gp)return gc;Gp=1,gc=l=>{if(!l)return[];if(typeof l!="string"||l.match(/^\s+$/))return[];const d=l.split(`
|
|
27
|
+
`);if(d.length===0)return[];const g=[];let p=null,h=null,m=0,y=0,v=null;const b=K=>{h?.changes.push({type:"normal",normal:!0,ln1:m++,ln2:y++,content:K}),v.oldLines--,v.newLines--},w=K=>{const[z,J]=n(K)??[];p={chunks:[],deletions:0,additions:0,from:z,to:J},g.push(p)},E=()=>{(!p||p.chunks.length)&&w()},C=(K,z)=>{E(),p.new=!0,p.newMode=z[1],p.from="/dev/null"},k=(K,z)=>{E(),p.deleted=!0,p.oldMode=z[1],p.to="/dev/null"},T=(K,z)=>{E(),p.oldMode=z[1]},S=(K,z)=>{E(),p.newMode=z[1]},A=(K,z)=>{E(),p.index=K.split(" ").slice(1),z[1]&&(p.oldMode=p.newMode=z[1].trim())},F=K=>{E(),p.from=o(K)},O=K=>{E(),p.to=o(K)},P=K=>+(K||1),L=(K,z)=>{p||w(K);const[J,re,ve,Z]=z.slice(1);m=+J,y=+ve,h={content:K,changes:[],oldStart:+J,oldLines:P(re),newStart:+ve,newLines:P(Z)},v={oldLines:P(re),newLines:P(Z)},p.chunks.push(h)},D=K=>{h&&(h.changes.push({type:"del",del:!0,ln:m++,content:K}),p.deletions++,v.oldLines--)},B=K=>{h&&(h.changes.push({type:"add",add:!0,ln:y++,content:K}),p.additions++,v.newLines--)},N=K=>{if(!h)return;const[z]=h.changes.slice(-1);h.changes.push({type:z.type,[z.type]:!0,ln1:z.ln1,ln2:z.ln2,ln:z.ln,content:K})},Y=[[/^diff\s/,w],[/^new file mode (\d+)$/,C],[/^deleted file mode (\d+)$/,k],[/^old mode (\d+)$/,T],[/^new mode (\d+)$/,S],[/^index\s[\da-zA-Z]+\.\.[\da-zA-Z]+(\s(\d+))?$/,A],[/^---\s/,F],[/^\+\+\+\s/,O],[/^@@\s+-(\d+),?(\d+)?\s+\+(\d+),?(\d+)?\s@@/,L],[/^\$/,N]],ce=[[/^\$/,N],[/^-/,D],[/^\+/,B],[/^\s*/,b]],V=K=>{for(const[z,J]of ce){const re=K.match(z);if(re){J(K,re);break}}v.oldLines===0&&v.newLines===0&&(v=null)},j=K=>{for(const[z,J]of Y){const re=K.match(z);if(re){J(K,re);break}}},he=K=>{v?V(K):j(K)};for(const K of d)he(K);return g};const e=/(a|i|w|c|o|1|2)\/.*(?=["']? ["']?(b|i|w|c|o|1|2)\/)|(b|i|w|c|o|1|2)\/.*$/g,t=/^(a|b|i|w|c|o|1|2)\//,n=l=>l?.match(e)?.map(d=>d.replace(t,"").replace(/("|')$/,"")),r=/^\\?['"]|\\?['"]$/g,o=l=>{let d=i(l,"-+").trim();return d=a(d),d.replace(r,"").replace(t,"")},i=(l,d)=>{l=c(l);const g=u(d);return l.replace(new RegExp(`^${g}+`),"")},s=/\t.*|\d{4}-\d\d-\d\d\s\d\d:\d\d:\d\d(.\d+)?\s(\+|-)\d\d\d\d/,a=l=>{const d=s.exec(l);return d&&(l=l.substring(0,d.index).trim()),l},u=l=>l instanceof RegExp?l.source:`[${c(l).replace(/([.*+?^=!:${}()|[\]/\\])/g,"\\$1")}]`,c=l=>`${l??""}`;return gc}var n4=t4();const r4=ls(n4),o4={ts:"typescript",tsx:"typescript",mts:"typescript",cts:"typescript",js:"javascript",jsx:"javascript",mjs:"javascript",cjs:"javascript",json:"json",css:"css",scss:"scss",less:"less",html:"xml",vue:"xml",xml:"xml",svg:"xml",md:"markdown",markdown:"markdown",sh:"bash",bash:"bash",zsh:"bash",yml:"yaml",yaml:"yaml",toml:"ini",ini:"ini",py:"python",rb:"ruby",go:"go",rs:"rust",java:"java",kt:"kotlin",swift:"swift",c:"c",h:"c",cpp:"cpp",hpp:"cpp",cs:"csharp",php:"php",sql:"sql"};function i4(e){const t=e.split(".").pop()?.toLowerCase()??"",n=o4[t];return n&&da.getLanguage(n)?n:void 0}function s4(e,t){if(!(!t||!e))try{return da.highlight(e,{language:t,ignoreIllegals:!0}).value}catch{return}}function a4(e){return e?r4(e).map(t=>({chunks:t.chunks.map(n=>({header:n.content,rows:n.changes.map(u4)}))})):[]}function u4(e){const t=e.type==="add"?"":e.type==="del"?e.ln:e.ln1,n=e.type==="del"?"":e.type==="add"?e.ln:e.ln2;return{oldLn:t,newLn:n,marker:e.content.slice(0,1),code:e.content.slice(1),tone:e.type==="add"?"add":e.type==="del"?"del":"normal"}}var c4=$('<span class="shrink-0 text-sm text-warning">'),l4=$('<button type=button class="ml-auto inline-flex h-7 w-7 shrink-0 items-center justify-center rounded-md border-0 bg-transparent text-muted-foreground transition-colors hover:bg-accent hover:text-foreground focus-visible:outline-none focus-visible:ring-[1.5px] focus-visible:ring-ring">'),d4=$('<div data-testid=git-diff-pane class="code-highlight flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden rounded-xl border bg-card"><div class="flex items-center gap-2 border-b px-2 py-1"><span class="min-w-0 flex-1 truncate font-mono text-sm"></span></div><div class="min-h-0 flex-1 overflow-auto">'),pc=$('<p class="p-3 text-muted-foreground">'),f4=$('<p class="p-3 text-destructive">'),g4=$('<div><div class="bg-muted px-2 py-0.5 font-mono text-sm text-muted-foreground">'),p4=$('<div><span class="w-12 shrink-0 select-none px-1 text-right text-muted-foreground"></span><span class="w-12 shrink-0 select-none px-1 text-right text-muted-foreground"></span><pre class="m-0 flex-1 whitespace-pre-wrap break-all px-2"><span>'),h4=$("<span>"),m4=$("<span class=hljs>");const b4=e=>{const t=ne(()=>a4(e.patch)),n=ne(()=>t().some(o=>o.chunks.length>0)),r=ne(()=>i4(e.path));return(()=>{var o=d4(),i=o.firstChild,s=i.firstChild,a=i.nextSibling;return x(s,()=>e.path),x(i,f(q,{get when(){return e.truncated},get children(){var u=c4();return x(u,()=>_("git.diffTruncated")),u}}),null),x(i,f(q,{get when(){return e.onClose},get children(){var u=l4();return u.$$click=()=>e.onClose?.(),x(u,f(Yr,{class:"h-4 w-4"})),Me(c=>{var l=_("common.close"),d=_("common.close");return l!==c.e&&Ke(u,"aria-label",c.e=l),d!==c.t&&Ke(u,"title",c.t=d),c},{e:void 0,t:void 0}),u}}),null),x(a,f(q,{get when(){return!e.loading},get fallback(){return(()=>{var u=pc();return x(u,()=>_("git.diffLoading")),u})()},get children(){return f(q,{get when(){return!e.error},get fallback(){return(()=>{var u=f4();return x(u,()=>e.error),u})()},get children(){return f(q,{get when(){return!e.binary},get fallback(){return(()=>{var u=pc();return x(u,()=>_("git.binaryFile")),u})()},get children(){return f(q,{get when(){return n()},get fallback(){return(()=>{var u=pc();return x(u,()=>_("git.diffEmpty")),u})()},get children(){return f(ot,{get each(){return t()},children:u=>f(ot,{get each(){return u.chunks},children:c=>(()=>{var l=g4(),d=l.firstChild;return x(d,()=>c.header),x(l,f(ot,{get each(){return c.rows},children:g=>{const p=g.tone==="add"?"bg-success/10":g.tone==="del"?"bg-destructive/10":"",h=g.tone==="add"?"text-success":g.tone==="del"?"text-destructive":"text-muted-foreground",m=s4(g.code,r());return(()=>{var y=p4(),v=y.firstChild,b=v.nextSibling,w=b.nextSibling,E=w.firstChild;return xt(y,`flex font-mono text-sm ${p}`),x(v,()=>g.oldLn),x(b,()=>g.newLn),xt(E,`select-none ${h}`),x(E,()=>g.marker),x(w,f(q,{when:m,get fallback(){return(()=>{var C=h4();return x(C,()=>g.code),C})()},children:C=>(()=>{var k=m4();return Me(()=>k.innerHTML=C()),k})()}),null),y})()}}),null),l})()})})}})}})}})}})),Me(()=>Ke(s,"title",e.path)),o})()};jt(["click"]);var y4=$('<span class="min-w-0 flex-1 truncate text-left">'),v4=$('<div class="flex items-center gap-1 border-b p-1">'),Vp=$('<div class="px-2 py-2 text-sm text-muted-foreground">'),Wp=$('<div class="max-h-64 overflow-auto p-1">'),w4=$('<div class="absolute inset-x-0 bottom-0 flex items-center gap-1 rounded-b-md border-t bg-popover px-2 py-1 text-xs text-muted-foreground">'),x4=$('<div class="border-b p-1 pr-9">'),_4=$('<div class="flex min-h-0 flex-1 flex-col gap-1 overflow-auto rounded-xl border"><div class="sticky top-0 flex items-center gap-2 border-b bg-card px-2 py-1"><span class=" text-muted-foreground">'),E4=$('<p class=" text-muted-foreground">'),C4=$('<p class="text-destructive ">'),S4=$('<p class=" text-muted-foreground">(runId: <code></code>)'),k4=$('<div class="flex min-h-0 flex-1 gap-4"><section data-testid=review-controls-pane class="flex min-h-0 min-w-0 flex-1 flex-col gap-3"><div class="flex flex-wrap items-center gap-2"><span aria-hidden=true class="select-none text-border">|</span><span aria-hidden=true class="select-none text-border">|'),A4=$('<button type=button><span class="min-w-0 flex-1 truncate">'),T4=$('<div><button type=button class="min-w-0 flex-1 truncate border-0 bg-transparent p-0 text-left font-mono text-sm disabled:opacity-50">'),D4=$('<div><button type=button class="flex min-w-0 flex-1 cursor-pointer items-center gap-2 border-0 bg-transparent p-0 text-left"><span></span><span class="truncate font-mono text-sm">');const I4=new Set(["commit","discard"]),R4=typeof navigator<"u"&&/mac|iphone|ipad|ipod/i.test(navigator.platform||navigator.userAgent),O4=R4?"⌘ + Enter":"Ctrl + Enter",Ly=e=>{const[t,n]=I([]),[r,o]=I("manual"),[i,s]=I(new Set),[a,u]=I(null),[c,l]=I(""),[d,g]=I(!1),[p,h]=I(null),[m,y]=I(""),[v,b]=I(""),[w,E]=I(null),[C,k]=I(!1),[T,S]=I(!1),[A,F]=I(!1),[O,P]=I("idle"),[L,D]=I(null),[B,N]=I(null),[Y,ce]=I(null),[V,j]=I(null),[he,K]=I(""),[z,J]=I(null);function re(ge){return K(ge),new Promise(Te=>J(()=>Te))}function ve(ge){const Te=z();Te&&(J(null),Te(ge))}const Z=()=>e.specId?.(),M=ne(()=>!!Z());let W=null;ue(()=>W?.()),ue(()=>ve(!1)),ae(()=>{const ge=e.initialMessage?.()??"";ge&&!d()&&l(ge)});const[oe,{refetch:te,mutate:H}]=Zt(e.projectId,ge=>we.getGitBranches(ge)),de=()=>Al(()=>te()),fe=ne(()=>{const ge=oe();return[...ge?.branches??[],...ge?.remoteBranches??[]]}),Ue=ne(()=>{const ge=m().trim().toLowerCase(),Te=fe();return ge?Te.filter(R=>R.toLowerCase().includes(ge)):Te}),se=ne(()=>m().trim()),xe=ne(()=>se().length>=1),Ce=ne(()=>(oe()?.branches??[]).includes(se())),We=ne(()=>{const ge=oe();return[...ge?.branches??[],...ge?.remoteBranches??[]]}),it=ne(()=>{const ge=v().trim().toLowerCase(),Te=We();return ge?Te.filter(R=>R.toLowerCase().includes(ge)):Te});function Ye(ge){n(ge);const Te=QO(i(),a(),ge);s(Te.selected),u(Te.active)}ae(()=>{const ge=e.projectId();if(!ge)return;let Te=!1,R=!1;we.getProjectChanges(ge).then(be=>{Te||R||Ye(be.changes)}).catch(()=>{});const X=yE(ge,be=>{R=!0,Ye(be)});ue(()=>{Te=!0,X()})});const[Ct]=Zt(()=>{const ge=a(),Te=e.projectId();if(!ge||!Te)return null;const R=t().find(X=>X.path===ge);return{pid:Te,path:ge,revision:e4(R)}},ge=>we.getFileDiff(ge.pid,ge.path));function Ot(ge){return V()===ge}const Pe=ne(()=>L()!==null||V()!==null||p()!==null),mt=ne(()=>B()??(oe.error?oe.error.message:null));function It(ge,Te){W?.(),j(ge),W=Ea(e.projectId(),Te,{onEvent:R=>{(R.type==="turn-completed"||R.type==="error")&&(j(null),W?.(),W=null)}})}function un(){return r()==="agent"?t().map(ge=>ge.path):[...i()]}async function Dn(ge){if(Pe())return;N(null);const Te=un();if(Te.length===0){N(_("review.selectAtLeastOne"));return}if(!(ge==="discard"&&!await re(_("review.confirmDiscard")))){h(ge);try{if(ge==="commit"){const X=c().trim();if(!X){N(_("review.enterCommitMsg"));return}await we.projectCommit(e.projectId(),{message:X,paths:Te})}else await we.projectDiscard(e.projectId(),{paths:Te});s(new Set),u(null);const R=await we.getProjectChanges(e.projectId());Ye(R.changes)}catch(R){N(R.message)}finally{h(null)}}}async function Lt(ge){const Te=Z();if(!(!Te||Pe())&&(N(null),!(ge==="discard"&&!await re(_("review.confirmDiscardAll"))))){D(ge);try{const R=await we.gitOp(e.projectId(),Te,ge);ce({kind:ge,runId:R.runId}),Bo(R.sessionId),It(ge,R.sessionId)}catch(R){N(R.message)}finally{D(null)}}}async function Ut(ge){r()==="manual"?await Dn(ge):await Lt(ge)}async function rn(ge){if(!Pe()){N(null),h(ge);try{if(ge==="push"){const Te=await we.projectPush(e.projectId());zt.success(_("git.pushed",{branch:Te.branch}))}else{const Te=await we.projectPull(e.projectId());zt.success(Te.updated?_("git.pulled",{branch:Te.branch}):_("git.upToDate"))}}catch(Te){N(Te.message)}finally{h(null)}}}async function Ir(ge){const Te=ge?.trim(),R=e.projectId();if(!(!Te||!R||Pe())&&Te!==oe()?.current){N(null),h("checkout");try{const X=await we.checkoutGitBranch(R,Te);H(le=>({current:X.current,branches:le?.branches.includes(X.current)?le.branches:[...le?.branches??[],X.current].sort(),remoteBranches:le?.remoteBranches??[]})),s(new Set),u(null),y(""),S(!1);const be=await we.getProjectChanges(R);n(be.changes),await de()}catch(X){N(X.message)}finally{h(null)}}}async function to(){const ge=e.projectId(),Te=m().trim();if(!(!ge||!Te||Pe())){N(null),h("checkout");try{const R=await we.createGitBranch(ge,Te);zt.success(_("git.branchCreated",{branch:R.current})),s(new Set),u(null),y(""),S(!1);const X=await we.getProjectChanges(ge);n(X.changes),await de()}catch(R){N(R.message)}finally{h(null)}}}async function Rr(){const ge=e.projectId();if(!(!ge||O()==="fetching")){P("fetching");try{await we.gitFetch(ge),await de(),P("done")}catch{P("failed")}}}async function no(ge){const Te=e.projectId();if(!(!ge||!Te||Pe())){N(null),h("merge");try{const R=await we.mergeGitBranch(Te,ge);zt.success(R.alreadyUpToDate?_("git.mergeUpToDate",{current:R.current,branch:R.merged}):_("git.merged",{current:R.current,branch:R.merged})),E(null),b("");const X=await we.getProjectChanges(Te);n(X.changes),await de()}catch(R){N(R.message)}finally{h(null),k(!1)}}}function $t(ge){return p()===ge||I4.has(ge)&&(Ot(ge)||L()===ge)}function Or(ge){s(Te=>{const R=new Set(Te);return R.has(ge)?R.delete(ge):R.add(ge),R})}function fr(){t().every(ge=>i().has(ge.path))?s(new Set):s(new Set(t().map(ge=>ge.path)))}const gr=ne(()=>t().length>0&&t().every(ge=>i().has(ge.path))),nt=ne(()=>r()==="manual"&&i().size===0),In=ne(()=>Pe()||r()==="manual"&&(nt()||c().trim()===""));return(()=>{var ge=k4(),Te=ge.firstChild,R=Te.firstChild,X=R.firstChild,be=X.nextSibling;return x(R,f(Zo,{get open(){return T()},onOpenChange:le=>{S(le),le?A()||(F(!0),Rr()):y("")},get children(){return[f(Yo,{as:Ee,variant:"outline",size:"sm",class:"h-8 w-56 max-w-full justify-start gap-2 px-2 text-sm font-mono",get disabled(){return Pe()||oe.loading||!!oe.error},get title(){return _("git.branchSelect")},get"aria-label"(){return _("git.branchSelect")},get children(){return[f(q,{get when(){return Q(()=>!oe.loading&&p()!=="checkout")()&&O()!=="fetching"},get fallback(){return f(sn,{class:"h-3.5 w-3.5 shrink-0 animate-spin"})},get children(){return f(Pl,{class:"h-3.5 w-3.5 shrink-0"})}}),(()=>{var le=y4();return x(le,()=>oe()?.current??_("git.branchPlaceholder")),le})()]}}),f(Xo,{class:"relative w-72 p-0",hideCloseButton:!0,get children(){return[(()=>{var le=v4();return x(le,f(zn,{get value(){return m()},onInput:Fe=>y(Fe.currentTarget.value),get placeholder(){return _("git.branchFilterPlaceholder")},class:"h-8 flex-1 text-sm"}),null),x(le,f(q,{get when(){return xe()},get children(){return f(Ee,{size:"sm",variant:"secondary",class:"h-8 shrink-0 px-2 text-xs",get disabled(){return Pe()||Ce()},get title(){return Q(()=>!!Ce())()?_("git.branchExists"):void 0},onClick:()=>void to(),get children(){return[f(q,{get when(){return p()==="checkout"},get children(){return f(sn,{class:"mr-1 h-3 w-3 animate-spin"})}}),Q(()=>Q(()=>p()==="checkout")()?_("git.creatingBranch"):_("git.createBranch"))]}})}}),null),le})(),(()=>{var le=Wp();return x(le,f(ot,{get each(){return Ue()},children:Fe=>(()=>{var Ze=A4(),_e=Ze.firstChild;return Ze.$$click=()=>void Ir(Fe),Ke(Ze,"title",Fe),x(_e,Fe),Me(U=>{var ie=`flex w-full items-center gap-2 rounded-sm px-2 py-1 text-left font-mono text-sm disabled:opacity-50 ${Fe===oe()?.current?"bg-accent":""}`,pe=Fe===oe()?.current||Pe();return ie!==U.e&&xt(Ze,U.e=ie),pe!==U.t&&(Ze.disabled=U.t=pe),U},{e:void 0,t:void 0}),Ze})()}),null),x(le,f(q,{get when(){return Q(()=>!oe.loading)()&&Ue().length===0},get children(){var Fe=Vp();return x(Fe,()=>_("git.noBranches")),Fe}}),null),Me(()=>le.classList.toggle("pb-8",O()==="fetching"||O()==="failed")),le})(),f(q,{get when(){return O()==="fetching"||O()==="failed"},get children(){var le=w4();return x(le,f(q,{get when(){return O()==="fetching"},get children(){return[f(sn,{class:"h-3 w-3 animate-spin"}),Q(()=>_("git.fetching"))]}}),null),x(le,f(q,{get when(){return O()==="failed"},get children(){return _("git.fetchFailed")}}),null),le}})]}})]}}),X),x(R,f(Ee,{variant:"default",size:"sm",get disabled(){return In()},onClick:()=>Ut("commit"),get children(){return[f(q,{get when(){return $t("commit")},get children(){return f(sn,{class:"mr-1 h-3 w-3 animate-spin"})}}),Q(()=>Q(()=>!!$t("commit"))()?_("review.committing"):_("review.commit"))]}}),X),x(R,f(Ee,{variant:"ghost",size:"sm",class:"text-destructive",get disabled(){return Pe()||nt()},onClick:()=>Ut("discard"),get children(){return[f(q,{get when(){return $t("discard")},get children(){return f(sn,{class:"mr-1 h-3 w-3 animate-spin"})}}),Q(()=>Q(()=>!!$t("discard"))()?_("review.discarding"):_("review.discard"))]}}),X),x(R,f(Zo,{get open(){return C()},onOpenChange:le=>{k(le),le||(b(""),E(null))},get children(){return[f(Yo,{as:Ee,variant:"ghost",size:"sm",get disabled(){return Pe()||oe.loading||!!oe.error},get title(){return _("git.mergeBranch")},get children(){return[f(q,{get when(){return!$t("merge")},get fallback(){return f(sn,{class:"mr-1 h-3 w-3 animate-spin"})},get children(){return f(Um,{class:"mr-1 h-3 w-3"})}}),Q(()=>Q(()=>!!$t("merge"))()?_("git.merging"):_("git.mergeBranch"))]}}),f(Xo,{class:"w-72 p-0",get children(){return[(()=>{var le=x4();return x(le,f(zn,{get value(){return v()},onInput:Fe=>b(Fe.currentTarget.value),get placeholder(){return _("git.mergeFilterPlaceholder")},class:"h-8 text-sm"})),le})(),(()=>{var le=Wp();return x(le,f(ot,{get each(){return it()},children:Fe=>(()=>{var Ze=T4(),_e=Ze.firstChild;return _e.$$click=()=>E(Fe),x(_e,Fe),x(Ze,f(q,{get when(){return w()===Fe},get children(){return f(Ee,{size:"sm",variant:"secondary",class:"h-6 shrink-0 px-2 text-xs",get disabled(){return Pe()},onClick:()=>void no(Fe),get children(){return[f(q,{get when(){return $t("merge")},get children(){return f(sn,{class:"mr-1 h-3 w-3 animate-spin"})}}),Q(()=>Q(()=>!!$t("merge"))()?_("git.merging"):_("git.mergeAction"))]}})}}),null),Me(U=>{var ie=`flex items-center gap-2 rounded-sm px-2 py-1 ${w()===Fe?"bg-accent":""}`,pe=Fe===oe()?.current,Le=Fe===oe()?.current?_("git.mergeSelfHint"):Fe;return ie!==U.e&&xt(Ze,U.e=ie),pe!==U.t&&(_e.disabled=U.t=pe),Le!==U.a&&Ke(_e,"title",U.a=Le),U},{e:void 0,t:void 0,a:void 0}),Ze})()}),null),x(le,f(q,{get when(){return Q(()=>!oe.loading)()&&it().length===0},get children(){var Fe=Vp();return x(Fe,()=>_("git.noBranches")),Fe}}),null),le})()]}})]}}),be),x(R,f(Ee,{variant:"ghost",size:"sm",get disabled(){return Pe()},onClick:()=>void rn("push"),get children(){return[f(q,{get when(){return $t("push")},get children(){return f(sn,{class:"mr-1 h-3 w-3 animate-spin"})}}),Q(()=>Q(()=>!!$t("push"))()?_("git.pushing"):_("git.push"))]}}),null),x(R,f(Ee,{variant:"ghost",size:"sm",get disabled(){return Pe()},onClick:()=>void rn("pull"),get children(){return[f(q,{get when(){return $t("pull")},get children(){return f(sn,{class:"mr-1 h-3 w-3 animate-spin"})}}),Q(()=>Q(()=>!!$t("pull"))()?_("git.pulling"):_("git.pull"))]}}),null),x(Te,f(ua,{get placeholder(){return _("review.commitPlaceholder",{shortcut:O4})},get value(){return c()},onInput:le=>{g(!0),l(le.currentTarget.value)},onKeyDown:le=>{le.key!=="Enter"||!(le.metaKey||le.ctrlKey)||(le.preventDefault(),!In()&&Ut("commit"))},get disabled(){return Pe()},minRows:1,maxRows:3}),null),x(Te,f(q,{get when(){return M()},get children(){return f(Xn,{class:"flex gap-4",get value(){return r()},onChange:le=>o(le),get disabled(){return Pe()},get children(){return[f(hn,{value:"manual",class:"flex items-center gap-1.5",get children(){return[f(gn,{}),f(_n,{}),f(pn,{class:"cursor-pointer",get children(){return _("review.manualSelect")}})]}}),f(hn,{value:"agent",class:"flex items-center gap-1.5",get children(){return[f(gn,{}),f(_n,{}),f(pn,{class:"cursor-pointer",get children(){return _("review.agentSelect")}})]}})]}})}}),null),x(Te,f(q,{get when(){return Q(()=>r()==="manual")()&&t().length>0},get children(){var le=_4(),Fe=le.firstChild,Ze=Fe.firstChild;return x(Fe,f(Ee,{variant:"ghost",size:"sm",onClick:fr,get disabled(){return Pe()},get children(){return Q(()=>!!gr())()?_("review.deselectAll"):_("review.selectAll")}}),Ze),x(Ze,()=>_("review.fileCount",{selected:i().size,total:t().length})),x(le,f(ot,{get each(){return t()},children:_e=>(()=>{var U=D4(),ie=U.firstChild,pe=ie.firstChild,Le=pe.nextSibling;return x(U,f(Jo,{get checked(){return i().has(_e.path)},onChange:()=>Or(_e.path),get disabled(){return Pe()},get children(){return f(Qo,{})}}),ie),ie.$$click=()=>u(_e.path),x(pe,()=>_e.status),x(Le,()=>_e.path),Me(ct=>{var St=`flex items-center gap-2 px-2 py-0.5 ${a()===_e.path?"bg-accent":""}`,Rt=_e.path,Xt=`inline-block w-6 text-center text-sm font-bold ${JO(_e.status)}`;return St!==ct.e&&xt(U,ct.e=St),Rt!==ct.t&&Ke(ie,"title",ct.t=Rt),Xt!==ct.a&&xt(pe,ct.a=Xt),ct},{e:void 0,t:void 0,a:void 0}),U})()}),null),le}}),null),x(Te,f(q,{get when(){return Q(()=>r()==="manual")()&&t().length===0},get children(){var le=E4();return x(le,()=>_("review.noChanges")),le}}),null),x(Te,f(q,{get when(){return mt()},get children(){var le=C4();return x(le,mt),le}}),null),x(Te,f(q,{get when(){return Y()},get children(){var le=S4(),Fe=le.firstChild,Ze=Fe.nextSibling;return x(le,()=>_("review.dispatched"),Fe),x(le,(()=>{var _e=Q(()=>Y().kind==="commit");return()=>_e()?_("review.commit"):_("review.discard")})(),Fe),x(Ze,()=>Y().runId.slice(0,8)),le}}),null),x(ge,f(q,{get when(){return a()},children:le=>f(b4,{get path(){return le()},get patch(){return Ct()?.patch??""},get binary(){return Ct()?.binary??!1},get truncated(){return Ct()?.truncated??!1},get loading(){return Ct.loading},get error(){return Q(()=>!!Ct.error)()?Ct.error.message:null},onClose:()=>u(null)})}),null),x(ge,f(Qt,{get open(){return z()!==null},onOpenChange:le=>{le||ve(!1)},get children(){return f(rr,{class:"max-w-sm",get children(){return[f(ir,{get children(){return[f(or,{get children(){return _("review.discardTitle")}}),f(qa,{get children(){return he()}})]}}),f(Sr,{get children(){return[f(Ee,{variant:"outline",onClick:()=>ve(!1),get children(){return _("common.cancel")}}),f(Ee,{variant:"destructive",onClick:()=>ve(!0),get children(){return _("review.confirmDiscardAction")}})]}})]}})}}),null),ge})()};jt(["click"]);var N4=$('<header class="flex items-start justify-between gap-2"><div class="flex flex-col gap-1"><p class=" text-muted-foreground"></p></div><div class="flex shrink-0 items-center gap-2 text-muted-foreground">'),M4=$('<section class="flex min-h-0 flex-1 flex-col gap-2 p-2">'),P4=$("<p class=text-muted-foreground>");const L4=()=>{const e=Vi(),t=yo(),[n]=Zt(()=>[t(),e.id],([o,i])=>we.getSpec(o,i));Wi();const r=ne(()=>xE(e.id,n()?.frontmatter.summary));return(()=>{var o=M4();return x(o,f(va,{get fallback(){return(()=>{var i=P4();return x(i,()=>_("common.loading")),i})()},get children(){return[(()=>{var i=N4(),s=i.firstChild,a=s.firstChild,u=s.nextSibling;return x(s,f(ss,{get items(){return[{label:_("breadcrumb.specList"),href:Tt("")},{label:e.id,href:Tt(`specs/${e.id}`)},{label:_("git.title")}]}}),a),x(a,()=>n()?.frontmatter.summary||_("common.pendingAgent")),x(u,f(is,{})),i})(),f(Ly,{projectId:t,specId:()=>e.id,initialMessage:r})]}})),o})()};var $4=$('<header class="flex items-start justify-between gap-2"><div class="flex flex-col gap-1"><p class=" text-muted-foreground"></p></div><div class="flex shrink-0 items-center gap-2 text-muted-foreground">'),Yp=$("<p class=text-muted-foreground>"),F4=$('<section class="flex min-h-0 min-w-0 flex-1 flex-col gap-2">'),B4=$('<section class="flex min-h-0 flex-1 flex-col gap-2 p-2">'),z4=$('<article class="markdown review-md flex-1 overflow-auto rounded-xl border bg-card p-4 shadow">'),U4=$('<div class="flex flex-1 items-center justify-center text-muted-foreground">');const K4=()=>{const e=Vi(),t=yo();Wi();const[n]=Zt(()=>[t(),e.id],([a,u])=>we.getSpec(a,u)),[r]=Zt(()=>[t(),e.id],([a,u])=>we.getDebug(a,u)),o=ne(()=>{const a=ER(r()?.text??"");return a.trim()?Dd(a,{specId:e.id,projectId:t()}):""}),[i,s]=I(null);return ae(()=>{const a=i(),u=o();if(!a)return;a.innerHTML=u;let c=!0,l;Ny(a).then(d=>{if(!c){d();return}l=d}),ue(()=>{c=!1,l?.()})}),(()=>{var a=B4();return x(a,f(va,{get fallback(){return(()=>{var u=Yp();return x(u,()=>_("common.loading")),u})()},get children(){return[(()=>{var u=$4(),c=u.firstChild,l=c.firstChild,d=c.nextSibling;return x(c,f(ss,{get items(){return[{label:_("breadcrumb.specList"),href:Tt("")},{label:e.id,href:Tt(`specs/${e.id}`)},{label:_("specDetail.debug")}]}}),l),x(l,()=>n()?.frontmatter.summary||_("common.pendingAgent")),x(d,f(is,{})),u})(),(()=>{var u=F4();return x(u,f(q,{get when(){return r.loading},get fallback(){return f(q,{get when(){return o()},get fallback(){return(()=>{var c=U4();return x(c,()=>_("specDebug.empty")),c})()},get children(){var c=z4();return Ln(s,c),c}})},get children(){var c=Yp();return x(c,()=>_("common.loading")),c}})),u})()]}})),a})()};var j4=$('<section class="flex min-h-0 flex-1 flex-col gap-2 p-2"><header class="flex items-start justify-between gap-2"><div class="flex shrink-0 items-center gap-2 text-muted-foreground">');const q4=()=>{const e=yo();return Wi(),(()=>{var t=j4(),n=t.firstChild,r=n.firstChild;return x(n,f(ss,{get items(){return[{label:_("breadcrumb.specList"),href:Tt("")},{label:_("git.title")}]}}),r),x(r,f(is,{})),x(t,f(Ly,{projectId:e}),null),t})()};function Zp(){return{text:"",nextOffset:0,truncated:!1}}function H4(e){return{text:e.text,nextOffset:e.offset+vl(e.text),truncated:e.truncated}}function G4(e,t){return t.offset===e.nextOffset?{state:{text:e.text+t.chunk,nextOffset:e.nextOffset+vl(t.chunk),truncated:e.truncated},needsRefetch:!1}:t.offset+vl(t.chunk)<=e.nextOffset?{state:e,needsRefetch:!1}:{state:e,needsRefetch:!0}}function Xp(e,t){return e.text.length<=t?e:{text:e.text.slice(e.text.length-t),nextOffset:e.nextOffset,truncated:!0}}function vl(e){return typeof TextEncoder<"u"?new TextEncoder().encode(e).length:e.length}const V4=80,Jp=4e5;function W4(e){const[t,{mutate:n}]=Zt(()=>[e.projectId(),e.runId()],async([b,w])=>b&&w?we.getCommandRun(b,w):null),[r,o]=I(Zp()),[i,s]=I(null),[a,u]=I(!1),[c,l]=I(Date.now());let d=null,g=null,p=!1;const h=setInterval(()=>l(Date.now()),1e3);ue(()=>clearInterval(h)),ue(()=>{g!==null&&window.clearTimeout(g)});function m(b){d=Xp(b,Jp),g===null&&(g=window.setTimeout(()=>{g=null,d&&(o(d),d=null,e.onFlush?.())},V4))}async function y(){const b=e.projectId(),w=e.runId();if(!(!b||!w||p)){p=!0;try{const E=await we.readCommandOutput(b,w),C=Xp(H4(E),Jp);d=null,o(C),s(null),e.onReset?.()}catch(E){s(E.message)}finally{p=!1}}}ae(()=>{const b=e.projectId(),w=e.runId();if(!b||!w)return;o(Zp()),y();const E=bE(b,w,{onOutput:C=>{const k=d??r(),T=G4(k,C);T.needsRefetch?y():m(T.state)},onRun:C=>n(C),onError:C=>s(C)});ue(E)});async function v(){const b=e.projectId(),w=t();if(!b||!w)return{ok:!1};u(!0);try{const E=await we.stopCommandRun(b,w.runId);return n(E.run),{ok:!0}}catch(E){return{ok:!1,error:E.message}}finally{u(!1)}}return{run:t,text:()=>r().text,truncated:()=>r().truncated,loadError:i,stopping:a,now:c,reload:y,stop:v}}var Y4=$('<section class="flex h-full min-h-0 flex-col overflow-hidden p-2"><header class="flex items-center gap-3"><h1 class="m-0 text-xl">'),Z4=$("<p class=text-muted-foreground>"),X4=$('<span class="text-xs text-muted-foreground">: '),J4=$('<div class="mt-2 flex flex-wrap items-center gap-3 rounded-lg border bg-card px-3 py-2"><span class=font-medium></span><code class="font-mono text-xs text-muted-foreground"></code><span class="text-xs text-muted-foreground">: </span><code class="ml-auto font-mono text-xs text-muted-foreground">: '),Q4=$('<p class="m-0 mt-2 text-xs text-muted-foreground">'),eN=$('<p class="m-0 mt-2 text-xs text-destructive">'),tN=$('<pre class="mt-2 min-h-0 flex-1 overflow-auto rounded-lg border bg-background p-3 font-mono text-[12px] leading-snug">');const nN=96,rN=()=>{const e=Vi(),t=yo();let n,r=!0;const o=W4({projectId:()=>t()||void 0,runId:()=>e.runId,onFlush:()=>{r&&n&&(n.scrollTop=n.scrollHeight)},onReset:()=>{n&&(n.scrollTop=n.scrollHeight)}}),{run:i,loadError:s,stopping:a,now:u}=o;function c(){n&&(r=n.scrollHeight-n.scrollTop-n.clientHeight<=nN)}async function l(){const d=await o.stop();d.error&&zt.error(d.error)}return(()=>{var d=Y4(),g=d.firstChild,p=g.firstChild;return x(g,f(Ee,{as:Nn,get href(){return Tt("")},variant:"ghost",size:"sm",get children(){return[f(Vx,{class:"mr-1 h-4 w-4"}),Q(()=>_("commands.back"))]}}),p),x(p,()=>_("commands.detailTitle")),x(d,f(q,{get when(){return i()},get fallback(){return(()=>{var h=Z4();return x(h,()=>s()??_("common.loading")),h})()},children:h=>[(()=>{var m=J4(),y=m.firstChild,v=y.nextSibling,b=v.nextSibling,w=b.firstChild,E=b.nextSibling,C=E.firstChild;return x(m,f(q,{get when(){return h().status==="running"},get children(){return f(Ee,{variant:"destructive",size:"sm",get disabled(){return a()},onClick:()=>void l(),get children(){return[f(qm,{class:"mr-1 h-3.5 w-3.5"}),Q(()=>Q(()=>!!a())()?_("commands.stopping"):_("commands.stop"))]}})}}),y),x(m,f(H1,{get status(){return h().status}}),y),x(y,()=>h().name),x(v,()=>h().cli),x(b,()=>_("commands.duration"),w),x(b,()=>V1(h().startedAt,h().endedAt,u()),null),x(m,f(q,{get when(){return h().status!=="running"},get children(){var k=X4(),T=k.firstChild;return x(k,()=>_("commands.exitCode"),T),x(k,()=>h().exitCode??h().signal??"—",null),k}}),E),x(E,()=>_("commands.logFile"),C),x(E,()=>h().logFile,null),m})(),f(q,{get when(){return o.truncated()},get children(){var m=Q4();return x(m,()=>_("commands.outputTruncated")),m}}),f(q,{get when(){return s()},get children(){var m=eN();return x(m,s),m}}),(()=>{var m=tN();m.addEventListener("scroll",c);var y=n;return typeof y=="function"?Ln(y,m):n=m,x(m,()=>o.text()||_("commands.outputEmpty")),m})()]}),null),d})()};function oN(e,t){if(!e)return[];if(t==="\\"){const n=/^\\\\([^\\]+)\\([^\\]+)(.*)$/.exec(e);if(n){const o=`\\\\${n[1]}\\${n[2]}`;return[{label:o,path:o},...hc(o,n[3]??"",t)]}const r=/^([A-Za-z]:)\\?(.*)$/.exec(e);if(r){const o=r[1];return[{label:o,path:`${o}\\`},...hc(`${o}\\`,r[2]??"",t)]}return[]}return[{label:t,path:t},...hc(t,e.slice(1),t)]}function $y(e,t,n){return e?e.endsWith(n)?`${e}${t}`:`${e}${n}${t}`:t}function Qp(e){const t=e.trim();return!(!t||t==="."||t===".."||t.includes("/")||t.includes("\\"))}function hc(e,t,n){const r=t.split(n).filter(Boolean),o=[];let i=e;for(const s of r)i=$y(i,s,n),o.push({label:s,path:i});return o}var iN=$('<div class="flex items-center gap-1.5">'),sN=$('<button type=button class="inline-flex items-center gap-1 rounded px-1 py-0.5 hover:bg-accent hover:text-accent-foreground">'),aN=$('<div class="flex items-center gap-2">'),uN=$('<button type=button class="flex w-full items-center gap-2 px-3 py-1.5 text-left text-sm hover:bg-accent hover:text-accent-foreground">'),cN=$('<p class="m-0 px-3 py-1.5 text-sm text-muted-foreground">'),lN=$('<p class="m-0 text-sm text-destructive break-all">'),dN=$('<div class="grid gap-3"><div class="flex items-center gap-1"><div class="flex min-w-0 flex-1 flex-wrap items-center gap-1 text-sm text-muted-foreground"><button type=button class="inline-flex items-center gap-1 rounded px-1 py-0.5 hover:bg-accent hover:text-accent-foreground"></button></div></div><div class="h-64 overflow-y-auto rounded border">'),fN=$('<div class="grid gap-4"><p class="m-0 font-medium"></p><p class="m-0 text-sm text-muted-foreground break-all">'),gN=$('<button type=button class="rounded px-1 py-0.5 hover:bg-accent hover:text-accent-foreground">'),eh=$('<p class="m-0 p-3 text-sm text-muted-foreground">'),pN=$('<button type=button class="flex w-full items-center gap-2 px-3 py-1.5 text-left text-sm hover:bg-accent hover:text-accent-foreground"><span class=truncate>');const Fy=e=>{const[t,n]=I(null),[r,o]=I(!1),[i,s]=I(null),[a,u]=I(!1),[c,l]=I(!1),[d,g]=I(null),[p,h]=I(!1),[m,y]=I(""),[v,b]=I(!1),w=()=>{const A=t();return!A||A.path===""?null:A.path},E=()=>t()?.sep==="\\";async function C(A){o(!0),s(null);try{const F=await we.listDirs(A,a());n(F)}catch(F){s(F.message)}finally{o(!1)}}ae(_t(()=>e.open,A=>{A?(g(null),s(null),k(),C()):(n(null),k())}));function k(){h(!1),y("")}async function T(){const A=w(),F=m().trim();if(!A||!Qp(F)){s(_("addProject.invalidName"));return}b(!0),s(null);try{const O=await we.createDir(A,F);k(),await C(O.path)}catch(O){s(O.message)}finally{b(!1)}}async function S(A){const F=w();if(F){l(!0),s(null);try{const O=await we.addProject(F,A?{gitInit:!0}:void 0);if(!O.ok){g(O.path);return}g(null),e.onOpenChange(!1),e.onAdded?.(O.project.id)}catch(O){s(_("addProject.failed",{message:O.message}))}finally{l(!1)}}}return f(Qt,{get open(){return e.open},get onOpenChange(){return e.onOpenChange},get children(){return f(rr,{class:"max-w-xl",onOpenAutoFocus:A=>{A.preventDefault();const F=A.currentTarget;F instanceof HTMLElement&&F.focus()},get children(){return[f(ir,{get children(){var A=iN();return x(A,f(or,{get children(){return _("addProject.title")}}),null),x(A,f(bd,{openDelay:150,closeDelay:0,get children(){return[f(md,{as:Ee,type:"button",variant:"ghost",size:"icon",class:"h-6 w-6 text-muted-foreground",get"aria-label"(){return _("addProject.help")},get children(){return f(y_,{class:"h-4 w-4"})}}),f(yd,{get children(){return _("addProject.helpTooltip")}})]}}),null),A}}),f(q,{get when(){return!d()},get fallback(){return(()=>{var A=fN(),F=A.firstChild,O=F.nextSibling;return x(F,()=>_("addProject.gitInitTitle")),x(O,()=>_("addProject.gitInitDesc",{path:d()??""})),x(A,f(Sr,{get children(){return[f(Ee,{type:"button",variant:"outline",get disabled(){return c()},onClick:()=>g(null),get children(){return _("common.cancel")}}),f(Ee,{type:"button",get disabled(){return c()},onClick:()=>void S(!0),get children(){return Q(()=>!!c())()?_("common.submitting"):_("addProject.gitInitConfirm")}})]}}),null),A})()},get children(){var A=dN(),F=A.firstChild,O=F.firstChild,P=O.firstChild,L=F.nextSibling;return P.$$click=()=>void C(t()?.home),x(P,f(z_,{class:"h-3.5 w-3.5"})),x(O,f(q,{get when(){return E()},get children(){var D=sN();return D.$$click=()=>void C(""),x(D,f(Km,{class:"h-3.5 w-3.5"})),Me(B=>{var N=_("addProject.driveRoot"),Y=_("addProject.driveRoot");return N!==B.e&&Ke(D,"aria-label",B.e=N),Y!==B.t&&Ke(D,"title",B.t=Y),B},{e:void 0,t:void 0}),D}}),null),x(O,f(ot,{get each(){return oN(t()?.path??"",t()?.sep??"/")},children:D=>[f(Ml,{class:"h-3 w-3 shrink-0 opacity-50"}),(()=>{var B=gN();return B.$$click=()=>void C(D.path),x(B,()=>D.label),B})()]}),null),x(F,f(Ee,{type:"button",variant:"ghost",size:"icon",class:"h-7 w-7 shrink-0",get"aria-label"(){return _("addProject.newFolder")},get title(){return _("addProject.newFolder")},get disabled(){return!w()||r()||c()},onClick:()=>{s(null),h(!0)},get children(){return f(I_,{class:"h-4 w-4"})}}),null),x(A,f(q,{get when(){return p()},get children(){var D=aN();return x(D,f(zn,{id:"add-project-new-folder",class:"h-8",autofocus:!0,get value(){return m()},get placeholder(){return _("addProject.newFolderPlaceholder")},get disabled(){return v()},onInput:B=>y(B.currentTarget.value),onKeyDown:B=>{B.key==="Enter"?(B.preventDefault(),T()):B.key==="Escape"&&(B.preventDefault(),k())}}),null),x(D,f(Ee,{type:"button",size:"sm",class:"shrink-0",get disabled(){return v()||!Qp(m())},onClick:()=>void T(),get children(){return _("addProject.newFolderConfirm")}}),null),x(D,f(Ee,{type:"button",size:"sm",variant:"outline",class:"shrink-0",get disabled(){return v()},onClick:k,get children(){return _("common.cancel")}}),null),D}}),L),x(L,f(q,{get when(){return!r()},get fallback(){return(()=>{var D=eh();return x(D,()=>_("addProject.loading")),D})()},get children(){return[f(q,{get when(){return Q(()=>t()?.parent!==null)()&&t()?.parent!==void 0},get children(){var D=uN();return D.$$click=()=>void C(t().parent),x(D,f(C_,{class:"h-4 w-4 shrink-0 opacity-70"}),null),x(D,()=>_("addProject.parent"),null),D}}),f(ot,{get each(){return t()?.entries??[]},get fallback(){return f(q,{get when(){return Q(()=>!!t())()&&t().entries.length===0},get children(){var D=eh();return x(D,()=>_("addProject.empty")),D}})},children:D=>(()=>{var B=pN(),N=B.firstChild;return B.$$click=()=>void C($y(t().path,D.name,t().sep)),x(B,f(N_,{class:"h-4 w-4 shrink-0 opacity-70"}),N),x(N,()=>D.name),B})()}),f(q,{get when(){return t()?.truncated},get children(){var D=cN();return x(D,()=>_("addProject.truncated")),D}})]}})),x(A,f(Jo,{class:"flex items-center gap-2",get checked(){return a()},onChange:D=>{u(D),C(t()?.path)},get children(){return[f(Qo,{}),f(zi,{class:"text-sm",get children(){return _("addProject.showHidden")}})]}}),null),x(A,f(q,{get when(){return i()},get children(){var D=lN();return x(D,i),D}}),null),x(A,f(Sr,{get children(){return[f(Ee,{type:"button",variant:"outline",get disabled(){return c()},onClick:()=>e.onOpenChange(!1),get children(){return _("common.cancel")}}),f(Ee,{type:"button",get disabled(){return c()||r()||!w()},onClick:()=>void S(!1),get children(){return Q(()=>!!c())()?_("common.submitting"):_("addProject.choose")}})]}}),null),Me(D=>{var B=_("addProject.home"),N=_("addProject.home"),Y=!t();return B!==D.e&&Ke(P,"aria-label",D.e=B),N!==D.t&&Ke(P,"title",D.t=N),Y!==D.a&&(P.disabled=D.a=Y),D},{e:void 0,t:void 0,a:void 0}),A}})]}})}})};jt(["click"]);var hN=$('<section class=p-8><header class=mb-4><h1 class="text-2xl font-bold"></h1></header><p class=text-muted-foreground>');const By=()=>{const e=Wr(),[t,n]=I(!1);return(()=>{var r=hN(),o=r.firstChild,i=o.firstChild,s=o.nextSibling;return x(i,()=>_("welcome.title")),x(s,()=>_("welcome.description")),x(r,f(Ee,{class:"mt-4 gap-1",onClick:()=>n(!0),get children(){return[f(jr,{class:"h-4 w-4"}),Q(()=>_("addProject.trigger"))]}}),null),x(r,f(Fy,{get open(){return t()},onOpenChange:n,onAdded:a=>e(Tt("",a))}),null),r})()};var mN=$('<p class="p-8 text-muted-foreground">');const bN=()=>{const[e]=Zt(()=>we.listProjects());return f(q,{get when(){return!e.loading},get fallback(){return(()=>{var t=mN();return x(t,()=>_("common.loading")),t})()},get children(){return f(q,{get when(){return(e()??[]).length>0},get fallback(){return f(By,{})},get children(){return(()=>{const n=(e()??[])[0];return n?f(Tw,{get href(){return`/${encodeURIComponent(n.id)}`}}):null})()}})}})},th="data-vt";function yN(){return typeof document<"u"&&typeof document.startViewTransition=="function"}function vN(){return typeof window>"u"||typeof window.matchMedia!="function"?!1:window.matchMedia("(prefers-reduced-motion: reduce)").matches}function nh(e){return e.split("/").filter(Boolean).length}function wN(e,t){const n=nh(e),r=nh(t);return r>n?"forward":r<n?"back":"lateral"}function zy(e){const t=typeof window>"u"?"http://localhost":window.location.origin;try{return new URL(e,t).pathname}catch{return e}}function rh(e,t=600){return e()?Promise.resolve():new Promise(n=>{let r=!1,o;const i=setTimeout(s,t);function s(){r||(r=!0,clearTimeout(i),o?.(),n())}Cn(a=>{o=a,ae(()=>{e()&&s()})})})}let Ns=null;function xN(e,t){const n=document.documentElement;Ns?.skipTransition(),n.setAttribute(th,e);const r=document.startViewTransition(async()=>{await t()});Ns=r,r.finished.catch(()=>{}).finally(()=>{Ns===r&&(Ns=null,n.removeAttribute(th))})}function _N(e,t){return e.defaultPrevented||e.enabled===!1||e.replace||typeof e.to=="string"&&zy(e.to)===e.fromPathname?null:t(e.fromPathname,e.to)}function EN(e){const t=oi(),n=cw();lw(r=>{const o=t.pathname,i=_N({fromPathname:o,to:r.to,replace:r.options?.replace,defaultPrevented:r.defaultPrevented,enabled:yN()&&!vN()},e.resolveDirection);if(!i)return;const s=typeof r.to=="number";r.preventDefault();const a=s?CN():void 0;xN(i,async()=>{a&&await a,r.retry(!0),s&&await rh(()=>t.pathname!==o),await rh(()=>!n())})})}function CN(e=600){return new Promise(t=>{let n=!1;function r(){n||(n=!0,clearTimeout(o),window.removeEventListener("popstate",r),t())}const o=setTimeout(r,e);window.addEventListener("popstate",r,{once:!0})})}function Uy(){let e=Promise.resolve(),t=0;return{enqueue(n){const r=++t,o=e.then(n.task);return e=o.then(()=>{},()=>{}),o.then(i=>{r===t&&n.onLatestSuccess?.(i)},i=>{r===t&&n.onLatestError?.(i)})},whenIdle(){return e}}}var SN=$('<svg><path fill=none stroke=currentColor stroke-linecap=round stroke-linejoin=round stroke-width=2 d="m8 9l4-4l4 4m0 6l-4 4l-4-4"></svg>',!1,!0,!1),kN=$('<svg xmlns=http://www.w3.org/2000/svg class="h-4 w-4"viewBox="0 0 24 24"><path fill=none stroke=currentColor stroke-linecap=round stroke-linejoin=round stroke-width=2 d="m5 12l5 5L20 7"></path><title>Checked');const AN=Yt,TN=Yt.Value;Yt.Description;Yt.ErrorMessage;Yt.ItemDescription;Yt.HiddenSelect;Yt.Section;const DN=e=>{const[t,n]=me(e,["class","children"]);return f(Yt.Trigger,G({get class(){return at("flex h-9 w-full items-center justify-between rounded-md border border-input bg-transparent px-3 py-2 shadow-sm ring-offset-background transition-shadow placeholder:text-muted-foreground focus:outline-none focus-visible:ring-[1.5px] focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",t.class)}},n,{get children(){return[Q(()=>t.children),f(Yt.Icon,{as:"svg",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"flex size-4 shrink-0 items-center justify-center opacity-50",get children(){return SN()}})]}}))},IN=e=>{const[t,n]=me(e,["class","children"]);return f(Yt.Portal,{get children(){return f(Yt.Content,G({"data-kb-top-layer":"",get class(){return at("relative z-[60] min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[expanded]:animate-in data-[closed]:animate-out data-[closed]:fade-out-0 data-[expanded]:fade-in-0 data-[closed]:zoom-out-95 data-[expanded]:zoom-in-95",t.class)}},n,{get children(){return[Q(()=>t.children),f(Yt.Listbox,{class:"p-1 focus-visible:outline-none"})]}}))}})},RN=e=>{const[t,n]=me(e,["class","children"]);return f(Yt.Item,G({get class(){return at("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t.class)}},n,{get children(){return[f(Yt.ItemIndicator,{class:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",get children(){return kN()}}),f(Yt.ItemLabel,{get children(){return t.children}})]}}))};var ON=$('<span class="min-w-0 flex-1 truncate text-left">'),NN=$('<div class="border-b p-1">'),MN=$('<p class="m-0 px-2 py-3 text-center text-sm text-muted-foreground">'),PN=$('<div class="max-h-64 overflow-y-auto p-1">'),LN=$('<div class="flex flex-col gap-1.5 font-medium"><span>'),$N=$('<button type=button class="flex w-full items-center gap-2 rounded-sm px-2 py-1.5 text-left text-sm hover:bg-accent focus-visible:bg-accent focus-visible:outline-none"><span class="min-w-0 flex-1 truncate">');const Go=e=>{const[t,n]=I(!1),[r,o]=I(""),i=ne(()=>e.options.find(c=>c.value===e.value)??null),s=ne(()=>e.options.find(c=>c.value==="")?.label),a=ne(()=>{const c=r().trim().toLocaleLowerCase();return c?e.options.filter(l=>l.value===""||l.label.toLocaleLowerCase().includes(c)||l.value.toLocaleLowerCase().includes(c)):e.options}),u=c=>{e.onChange(c),n(!1)};return(()=>{var c=LN(),l=c.firstChild;return x(l,()=>e.label),x(c,f(q,{get when(){return e.searchable},get fallback(){return f(AN,{get options(){return[...e.options]},optionValue:"value",optionTextValue:"label",get value(){return i()},get placeholder(){return s()},get disabled(){return e.disabled},allowDuplicateSelectionEvents:!1,onChange:d=>{d&&queueMicrotask(()=>e.onChange(d.value))},itemComponent:d=>f(RN,{get item(){return d.item},get children(){return d.item.rawValue.label}}),get"aria-label"(){return e.label},get children(){return[f(DN,{class:"min-w-0",get children(){return f(TN,{class:"min-w-0 flex-1 truncate text-left",children:d=>d.selectedOption().label})}}),f(IN,{})]}})},get children(){return f(Zo,{get open(){return t()},onOpenChange:d=>{n(d),d||o("")},placement:"bottom-start",get children(){return[f(Yo,{as:Ee,type:"button",variant:"outline",class:"min-w-0 justify-between gap-2 px-3 font-normal",get disabled(){return e.disabled},get"aria-label"(){return e.label},get children(){return[(()=>{var d=ON();return x(d,()=>i()?.label??s()??e.value),d})(),f(f_,{class:"size-4 shrink-0 opacity-50"})]}}),f(Xo,{class:"w-80 max-w-[calc(100vw-2rem)] p-0",hideCloseButton:!0,get children(){return[(()=>{var d=NN();return x(d,f(zn,{get value(){return r()},onInput:g=>o(g.currentTarget.value),get placeholder(){return e.filterPlaceholder},class:"h-8"})),d})(),(()=>{var d=PN();return x(d,f(ot,{get each(){return a()},children:g=>(()=>{var p=$N(),h=p.firstChild;return p.$$click=()=>u(g.value),x(h,()=>g.label),x(p,f(bi,{get class(){return`size-4 shrink-0 ${g.value===e.value?"opacity-100":"opacity-0"}`}}),null),Me(m=>{var y=g.label,v=g.value===e.value;return y!==m.e&&Ke(p,"title",m.e=y),v!==m.t&&Ke(p,"aria-pressed",m.t=v),m},{e:void 0,t:void 0}),p})()}),null),x(d,f(q,{get when(){return a().length===0},get children(){var g=MN();return x(g,()=>e.emptyText),g}}),null),d})()]}})]}})}}),null),c})()};jt(["click"]);var FN=$("<span> · "),BN=$('<span class="text-xs font-normal text-muted-foreground">'),zN=$('<span class="text-sm text-muted-foreground">'),UN=$('<div class="flex flex-col gap-4"><fieldset class="m-0 grid gap-3 border-0 p-0 sm:grid-cols-3"></fieldset><label class="flex flex-col gap-1 font-medium"><span></span><span class="text-sm text-muted-foreground">'),KN=$('<p class=" text-muted-foreground">'),jN=$('<p class=" text-destructive">');const uo=".yorz/specs",qN={claude:"projectConfig.agentClaude",opencode:"projectConfig.agentOpencode",codex:"projectConfig.agentCodex",pi:"projectConfig.agentPi"},HN=e=>{const[t,n]=I("inherit"),[r,o]=I([]),[i,s]=I(""),[a,u]=I(""),[c,l]=I({models:[],defaultReasoningEfforts:[]}),[d,g]=I(!1),[p,h]=I(uo),[m,y]=I(uo),[v,b]=I(!1),[w,E]=I("idle"),[C,k]=I(!1),[T,S]=I(null);let A=0,F=0,O,P=uo;const L=Uy();ae(()=>{const M=++F;e.open&&(S(null),Z(),E("idle"),k(!1),b(!0),(async()=>{try{if(await L.whenIdle(),M!==F||!e.open)return;const[W,oe]=await Promise.all([we.getProjectConfig(e.projectId),we.listAgents(e.projectId).catch(()=>[])]);if(M!==F||!e.open)return;o(oe),D(W),W.agent.kind!=="inherit"&&he(W.agent.kind)}catch(W){if(M!==F||!e.open)return;S(W.message)}finally{M===F&&b(!1)}})())});function D(M){n(M.agent.kind),s(M.agent.model??""),u(M.agent.reasoningEffort??"");const W=M.specsDir||uo;h(W),y(W),P=W}function B(){return t()==="inherit"?{kind:"inherit"}:{kind:t(),...i()?{model:i()}:{},...a()?{reasoningEffort:a()}:{}}}const N=()=>["inherit",...r().map(M=>M.id)];function Y(M){if(M==="inherit")return _("projectConfig.inheritGlobal");const W=r().find(te=>te.id===M);if(W&&W.source==="external")return W.displayName;const oe=qN[M];return oe?_(oe):W?.displayName??M}function ce(M){n(M),s(""),u(""),l({models:[],defaultReasoningEfforts:[]}),M!=="inherit"&&he(M),J({kind:M},P)}function V(M){s(M),u(""),J({kind:t(),...M?{model:M}:{}},P)}function j(M){u(M),J({kind:t(),...i()?{model:i()}:{},...M?{reasoningEffort:M}:{}},P)}async function he(M){const W=++A;g(!0);try{const oe=await we.listAgentModels(e.projectId,M);W===A&&l(oe)}catch{W===A&&l({models:[],defaultReasoningEfforts:[]})}finally{W===A&&g(!1)}}const K=()=>{const M=[{value:"",label:_("projectConfig.agentDefaultOption")},...c().models.map(W=>({value:W.id,label:W.displayName}))];return i()&&!M.some(W=>W.value===i())&&M.push({value:i(),label:i()}),M},z=()=>{const M=i()?c().models.find(oe=>oe.id===i())?.reasoningEfforts??[]:c().defaultReasoningEfforts,W=[{value:"",label:_("projectConfig.agentDefaultOption")},...M.map(oe=>({value:oe.id,label:oe.displayName}))];return a()&&!W.some(oe=>oe.value===a())&&W.push({value:a(),label:a()}),W};async function J(M,W){S(null),k(!1),Z(),E("saving"),await L.enqueue({task:()=>we.updateProjectConfig(e.projectId,{agent:M,specsDir:W}),onLatestSuccess:oe=>{const te=oe.config.specsDir!==m();y(oe.config.specsDir),P=oe.config.specsDir,(p().trim()||uo)===W&&h(oe.config.specsDir),k(te),E("saved"),O=setTimeout(()=>E("idle"),2e3)},onLatestError:oe=>{P===W&&(P=m()),E("idle"),S(oe.message)}})}function re(){const M=p().trim()||uo;if(M.split(/[\\/]/).some(W=>W==="..")){S(_("projectConfig.invalidPath"));return}h(M),M!==P&&(P=M,J(B(),M))}function ve(){re(),e.onClose()}function Z(){O&&(clearTimeout(O),O=void 0)}return ue(Z),f(Qt,{get open(){return e.open},onOpenChange:M=>!M&&ve(),get children(){return f(rr,{class:"max-w-[480px]",get children(){return[f(ir,{get children(){return f(or,{class:"flex items-baseline gap-2",get children(){return[(()=>{var M=FN(),W=M.firstChild;return x(M,()=>_("projectConfig.title"),W),x(M,()=>e.projectName,null),M})(),f(q,{get when(){return w()!=="idle"},get children(){var M=BN();return x(M,(()=>{var W=Q(()=>w()==="saving");return()=>W()?_("globalConfig.saveStatusSaving"):_("globalConfig.saveStatusSaved")})()),M}})]}})}}),f(q,{get when(){return!v()},get fallback(){return(()=>{var M=KN();return x(M,()=>_("common.loading")),M})()},get children(){var M=UN(),W=M.firstChild,oe=W.nextSibling,te=oe.firstChild,H=te.nextSibling;return x(W,f(Go,{get label(){return _("projectConfig.agent")},get value(){return t()},get options(){return N().map(de=>({value:de,label:Y(de)}))},onChange:ce}),null),x(W,f(Go,{get label(){return _("projectConfig.model")},get value(){return i()},get options(){return K()},get searchable(){return c().models.length>10},get filterPlaceholder(){return _("common.filterOptions")},get emptyText(){return _("common.noMatchingOptions")},get disabled(){return t()==="inherit"||d()||K().length<=1},onChange:V}),null),x(W,f(Go,{get label(){return _("projectConfig.reasoningEffort")},get value(){return a()},get options(){return z()},get disabled(){return t()==="inherit"||d()||z().length<=1},onChange:j}),null),x(te,()=>_("projectConfig.specsDir")),x(oe,f(zn,{type:"text",get value(){return p()},onInput:de=>h(de.currentTarget.value),onBlur:re,onKeyDown:de=>{de.key==="Enter"&&de.currentTarget.blur()},placeholder:uo}),H),x(H,()=>_("projectConfig.specsDirHint")),x(oe,f(q,{get when(){return C()},get children(){var de=zN();return x(de,()=>_("projectConfig.oldSpecsHint")),de}}),null),x(M,(()=>{var de=Q(()=>!!T());return()=>de()&&(()=>{var fe=jN();return x(fe,T),fe})()})(),null),M}})]}})}})};function oh(e){if(!e.worktree)return e.name;const t=e.worktree.mainPath.split("/").filter(Boolean).pop()??e.worktree.mainPath,n=e.worktree.cleanSlug??e.worktree.branch.replace(/^wt\//,"");return`${t} · ${n}`}function ih(e){return(e[0]??"?").toUpperCase()}function GN(e){const t=new Set(e.map(s=>s.id)),n=new Map,r=s=>s.worktree&&t.has(s.worktree.mainProjectId)?s.worktree.mainProjectId:s.id;e.forEach((s,a)=>{const u=r(s),c=n.get(u);c?c.push(a):n.set(u,[a])});const o=Array.from(n.entries()).map(([s,a])=>({key:s,idxs:a,freshness:Math.min(...a)}));o.sort((s,a)=>s.freshness-a.freshness||(s.key<a.key?-1:s.key>a.key?1:0));const i=[];for(const s of o){const a=s.idxs.length>=2,u=[...s.idxs].sort((d,g)=>{const p=e[d].id===s.key?0:1,h=e[g].id===s.key?0:1;return p-h||d-g}),c=u.find(d=>e[d].id===s.key)??u[0],l=ih(e[c].name);u.forEach((d,g)=>{i.push({project:e[d],groupId:s.key,grouped:a,indexInGroup:a?g:0,groupSize:s.idxs.length,letter:a?l:ih(e[d].name)})})}return i}var VN=$('<span class=" font-semibold tracking-wide">'),WN=$('<div class="flex items-center gap-1">'),YN=$('<ul class="m-0 flex-1 list-none overflow-y-auto py-1.5">'),ZN=$('<div class="absolute right-0 top-0 z-[2] h-full w-1 cursor-col-resize bg-transparent hover:bg-accent/40"role=separator aria-orientation=vertical>'),XN=$("<aside data-testid=projects-sidebar><div data-testid=projects-sidebar-panel><header></header><footer>"),JN=$('<p class="px-2.5 py-2 text-muted-foreground">'),QN=$('<span class="flex min-w-0 items-center"><span></span><span class=truncate>'),eM=$('<button type=button class="absolute right-6 top-1/2 -translate-y-1/2 p-1 text-muted-foreground opacity-0 transition-opacity hover:text-accent-foreground group-hover:opacity-100">'),tM=$('<button type=button class="absolute right-1.5 top-1/2 -translate-y-1/2 p-1 text-muted-foreground opacity-0 transition-opacity hover:text-destructive group-hover:opacity-100">'),nM=$('<li class="group relative flex items-center">'),rM=$('<sub class="absolute -bottom-1 -right-2 text-[9px] font-semibold leading-none">'),oM=$('<span class="absolute -right-2 -top-1 size-1.5 animate-pulse rounded-full bg-primary">'),iM=$('<span class="relative inline-block font-semibold">'),sM=$('<button type=button class="flex h-5 w-5 items-center justify-center rounded bg-muted text-muted-foreground hover:text-foreground">'),aM=$('<p class="mt-1 text-sm text-destructive break-words">'),uM=$('<p class="break-all font-semibold">');const Ky="yorz.projectsSidebar.collapsed",jy="yorz.projectsSidebar.width",cM=300,Id=220,lM=.2,dM=160,fM=640;function gM(){try{return typeof window<"u"&&window.localStorage.getItem(Ky)==="1"}catch{return!1}}function sh(e){try{typeof window<"u"&&window.localStorage.setItem(Ky,e?"1":"0")}catch{}}function Xa(e){return Number.isFinite(e)?Math.min(fM,Math.max(dM,Math.round(e))):Id}function mc(){return typeof window>"u"?Id:Xa(window.innerWidth*lM)}function pM(){try{if(typeof window>"u")return Id;const e=window.localStorage.getItem(jy);if(!e)return mc();const t=Number(e);return Number.isFinite(t)?Xa(t):mc()}catch{return mc()}}function hM(e){try{typeof window<"u"&&window.localStorage.setItem(jy,String(Xa(e)))}catch{}}const mM=()=>{const[e,t]=I(gM()),[n,r]=I(pM()),[o,{refetch:i}]=Zt(()=>we.listProjects()),[s,a]=I(null),[u,c]=I(null),[l,d]=I(null),[g,p]=I(!1),[h,m]=I(!1),[y,v]=I(!1),b=Wr(),w=oi(),E=ne(()=>{const M=w.pathname.match(/^\/([^/]+)/);return M&&M[1]!=="api"?M[1]:""}),C=()=>e()||Cr(),[k,T]=I(!1);let S=null;function A(){S!=null&&(window.clearTimeout(S),S=null)}const F=()=>u()!==null||l()!==null,O=()=>C()&&(k()||F()),P=()=>C()&&!O();function L(){!C()||k()||(A(),S=window.setTimeout(()=>{S=null,C()&&T(!0)},cM))}function D(){A(),T(!1)}function B(){A()}ue(A);function N(){A(),T(!1),Cr()&&ra(),t(!1),sh(!1)}function Y(){if(Cr()){ra();return}const M=!e();t(M),sh(M)}let ce=null,V=null,j=null;Sn(()=>{const M=Zm(()=>{i()});ue(M)});let he=0;ae(()=>{const M=nE();if(M===0||M===he)return;if(pt(u)){he=M,c(null);return}const W=pt(E),oe=(o()??[]).find(te=>te.id===W);oe&&(he=M,c(oe))});function K(M){C()||(M.preventDefault(),ce={startX:M.clientX,startW:n(),raf:null},document.body.classList.add("is-resizing"),V=W=>{if(!ce)return;const oe=W.clientX-ce.startX,te=Xa(ce.startW+oe);ce.raf==null&&(ce.raf=requestAnimationFrame(()=>{ce&&(ce.raf=null,r(te))}))},j=()=>{ce?.raf!=null&&cancelAnimationFrame(ce.raf),ce=null,document.body.classList.remove("is-resizing"),V&&document.removeEventListener("mousemove",V),j&&document.removeEventListener("mouseup",j),V=null,j=null,hM(n())},document.addEventListener("mousemove",V),document.addEventListener("mouseup",j))}ue(()=>{V&&document.removeEventListener("mousemove",V),j&&document.removeEventListener("mouseup",j),document.body.classList.remove("is-resizing")});function z(M,W){W.preventDefault(),W.stopPropagation(),c(M)}function J(M,W){W.preventDefault(),W.stopPropagation(),p(!1),d(M)}async function re(){const M=l();if(M){m(!0);try{g()&&M.worktree?await we.removeProjectWithFiles(M.id):await we.removeProject(M.id),await i(),E()===M.id&&b("/"),d(null)}catch(W){const oe=W.message;oe.includes("409")?(zt.error(_("sidebar.uncommittedChanges")),d(null)):(a(oe),zt.error(oe))}finally{m(!1)}}}const ve=()=>C()?void 0:{width:`${n()}px`},Z=()=>P()?void 0:{width:`${n()}px`};return(()=>{var M=XN(),W=M.firstChild,oe=W.firstChild,te=oe.nextSibling;return M.addEventListener("mouseleave",D),M.addEventListener("mouseenter",L),x(oe,f(q,{get when(){return!P()},get fallback(){return f(Ee,{variant:"outline",size:"sm",class:"h-7 w-7 p-0",onClick:Y,onMouseEnter:B,onMouseLeave:L,get title(){return _("sidebar.expand")},get children(){return f(tl,{class:"h-4 w-4"})}})},get children(){return[(()=>{var H=VN();return x(H,()=>_("sidebar.title")),H})(),(()=>{var H=WN();return x(H,f(Ee,{variant:"outline",size:"sm",class:"h-7 w-7 p-0",get onClick(){return O()?N:Y},get title(){return Q(()=>!!O())()?_("sidebar.pin"):_("sidebar.collapse")},get children(){return f(q,{get when(){return O()},get fallback(){return f(zm,{class:"h-4 w-4"})},get children(){return f(tl,{class:"h-4 w-4"})}})}})),H})()]}})),x(W,f(q,{get when(){return o()!==void 0},get fallback(){return(()=>{var H=JN();return x(H,()=>_("common.loading")),H})()},get children(){var H=YN();return x(H,f(ot,{get each(){return GN(o()??[])},children:de=>{const fe=de.project,Ue=()=>E()===fe.id;return(()=>{var se=nM();return x(se,f(Nn,{get href(){return`/${encodeURIComponent(fe.id)}`},get class(){return`flex-1 truncate py-1.5 no-underline ${Ue()?"bg-primary-soft text-foreground font-semibold":"hover:bg-accent"} ${P()?"px-0 text-center":"pl-2.5 pr-12"}`},get title(){return Q(()=>!!fe.worktree)()?`${fe.path}
|
|
28
|
+
worktree of ${fe.worktree.mainPath}`:fe.path},get children(){return f(q,{get when(){return!P()},get fallback(){return(()=>{var xe=iM();return x(xe,()=>de.letter,null),x(xe,f(q,{get when(){return de.grouped},get children(){var Ce=rM();return x(Ce,()=>de.indexInGroup),Ce}}),null),x(xe,f(q,{get when(){return fe.running},get children(){var Ce=oM();return Me(()=>Ke(Ce,"aria-label",_("sidebar.projectRunning",{name:fe.name}))),Ce}}),null),xe})()},get children(){var xe=QN(),Ce=xe.firstChild,We=Ce.nextSibling;return x(We,()=>oh(fe)),Me(it=>{var Ye=at("mr-1.5 size-2 shrink-0 rounded-full",fe.running?"animate-pulse bg-primary":"bg-transparent"),Ct=fe.running?_("sidebar.projectRunning",{name:fe.name}):void 0;return Ye!==it.e&&xt(Ce,it.e=Ye),Ct!==it.t&&Ke(Ce,"aria-label",it.t=Ct),it},{e:void 0,t:void 0}),xe}})}}),null),x(se,f(q,{get when(){return!P()},get children(){return[(()=>{var xe=eM();return xe.$$click=Ce=>z(fe,Ce),x(xe,f(jm,{class:"h-3.5 w-3.5"})),Me(Ce=>{var We=_("sidebar.configure",{name:fe.name}),it=_("sidebar.projectConfig");return We!==Ce.e&&Ke(xe,"aria-label",Ce.e=We),it!==Ce.t&&Ke(xe,"title",Ce.t=it),Ce},{e:void 0,t:void 0}),xe})(),(()=>{var xe=tM();return xe.$$click=Ce=>void J(fe,Ce),x(xe,f(Yr,{class:"h-3.5 w-3.5"})),Me(Ce=>{var We=_("sidebar.removeProject",{name:fe.name}),it=_("sidebar.deleteProject");return We!==Ce.e&&Ke(xe,"aria-label",Ce.e=We),it!==Ce.t&&Ke(xe,"title",Ce.t=it),Ce},{e:void 0,t:void 0}),xe})()]}}),null),se})()}})),H}}),te),x(te,f(q,{get when(){return!P()},get fallback(){return(()=>{var H=sM();return H.$$click=()=>v(!0),x(H,f(jr,{class:"h-3.5 w-3.5"})),Me(de=>{var fe=_("addProject.trigger"),Ue=_("addProject.trigger");return fe!==de.e&&Ke(H,"title",de.e=fe),Ue!==de.t&&Ke(H,"aria-label",de.t=Ue),de},{e:void 0,t:void 0}),H})()},get children(){return f(Ee,{variant:"outline",size:"sm",class:"w-full justify-start gap-1",onClick:()=>v(!0),get children(){return[f(jr,{class:"h-3.5 w-3.5"}),Q(()=>_("addProject.trigger"))]}})}}),null),x(te,(()=>{var H=Q(()=>!!s());return()=>H()&&(()=>{var de=aM();return x(de,s),Me(()=>Ke(de,"title",s())),de})()})(),null),x(W,f(q,{get when(){return!C()},get children(){var H=ZN();return H.$$mousedown=K,Me(()=>Ke(H,"aria-label",_("sidebar.resizeHint"))),H}}),null),x(M,f(Fy,{get open(){return y()},onOpenChange:v,onAdded:H=>b(Tt("",H))}),null),x(M,f(q,{get when(){return u()},children:H=>f(HN,{open:!0,get projectId(){return H().id},get projectName(){return H().name},onClose:()=>c(null)})}),null),x(M,f(Qt,{get open(){return l()!==null},onOpenChange:H=>!H&&!h()&&d(null),get children(){return f(rr,{class:"max-w-sm",get children(){return[f(ir,{get children(){return[f(or,{get children(){return _("sidebar.deleteProject")}}),f(qa,{get children(){return _("sidebar.deleteDesc")}})]}}),f(q,{get when(){return l()},children:H=>[(()=>{var de=uM();return x(de,()=>oh(H())),de})(),f(q,{get when(){return H().worktree},get children(){return f(Jo,{get checked(){return g()},onChange:de=>p(de),class:"flex items-center gap-2 text-destructive",get children(){return[f(Qo,{}),f(zi,{get children(){return _("sidebar.deleteFiles")}})]}})}})]}),f(Sr,{get children(){return[f(Ee,{variant:"outline",onClick:()=>d(null),get disabled(){return h()},get children(){return _("common.cancel")}}),f(Ee,{variant:"destructive",onClick:()=>void re(),get disabled(){return h()},get children(){return Q(()=>!!h())()?_("common.deleting"):_("common.confirmDelete")}})]}})]}})}}),null),Me(H=>{var de=`relative shrink-0 ${C()?"w-9 transition-[width] duration-150":""}`,fe=ve(),Ue=O()?"1":void 0,se=`flex flex-col border-r bg-background ${O()?"absolute left-0 top-0 z-40 h-full shadow-xl animate-in fade-in-0 slide-in-from-left-2 duration-150":"h-full w-full"}`,xe=Z(),Ce=`flex items-center border-b ${P()?"justify-center py-2":"justify-between px-2.5 py-2"}`,We=`border-t ${P()?"flex justify-center py-2":"p-2"}`;return de!==H.e&&xt(M,H.e=de),H.t=Vo(M,fe,H.t),Ue!==H.a&&Ke(W,"data-peek",H.a=Ue),se!==H.o&&xt(W,H.o=se),H.i=Vo(W,xe,H.i),Ce!==H.n&&xt(oe,H.n=Ce),We!==H.s&&xt(te,H.s=We),H},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0}),M})()};jt(["mousedown","click"]);var bM=["second","minute","hour","day","week","month","year"];function yM(e,t){if(t===0)return["just now","right now"];var n=bM[Math.floor(t/2)];return e>1&&(n+="s"),[e+" "+n+" ago","in "+e+" "+n]}var vM=["秒","分钟","小时","天","周","个月","年"];function wM(e,t){if(t===0)return["刚刚","片刻后"];var n=vM[~~(t/2)];return[e+" "+n+"前",e+" "+n+"后"]}var wl={},Ja=function(e,t){wl[e]=t},xM=function(e){return wl[e]||wl.en_US},bc=[60,60,24,7,365/7/12,12];function _M(e){return e instanceof Date?e:!isNaN(e)||/^\d+$/.test(e)?new Date(parseInt(e)):(e=(e||"").trim().replace(/\.\d+/,"").replace(/-/,"/").replace(/-/,"/").replace(/(\d)T(\d)/,"$1 $2").replace(/Z/," UTC").replace(/([+-]\d\d):?(\d\d)/," $1$2"),new Date(e))}function EM(e,t){var n=e<0?1:0;e=Math.abs(e);for(var r=e,o=0;e>=bc[o]&&o<bc.length;o++)e/=bc[o];return e=Math.floor(e),o*=2,e>(o===0?9:1)&&(o+=1),t(e,o,r)[n].replace("%s",e.toString())}function CM(e,t){var n=new Date;return(+n-+_M(e))/1e3}var SM=function(e,t,n){var r=CM(e);return EM(r,xM(t))};Ja("en_US",yM);Ja("zh_CN",wM);var Ms={},ah;function kM(){if(ah)return Ms;ah=1,Object.defineProperty(Ms,"__esModule",{value:!0});var e=["秒","分钟","小时","天","周","个月","年"];function t(n,r){if(r===0)return["刚刚","片刻后"];var o=e[~~(r/2)];return[n+" "+o+"前",n+" "+o+"后"]}return Ms.default=t,Ms}var AM=kM();const TM=ls(AM),uh=[["just now","right now"],["%ss ago","in %ss"],["1m ago","in 1m"],["%sm ago","in %sm"],["1h ago","in 1h"],["%sh ago","in %sh"],["1d ago","in 1d"],["%sd ago","in %sd"],["1w ago","in 1w"],["%sw ago","in %sw"],["1mo ago","in 1mo"],["%smo ago","in %smo"],["1y ago","in 1y"],["%sy ago","in %sy"]];function DM(e,t){return uh[t]??uh[0]}const IM=2;function RM(e,t){if(!e)return t.t("chat.usageResetUnknown");const n=new Date(e);return Number.isFinite(n.getTime())?t.formatTime(n):t.t("chat.usageResetUnknown")}function OM(e,t){if(typeof e.utilization!="number")return t.t("chat.usageWindowUnknown",{label:e.label});const n=Math.min(100,Math.max(0,Math.round(e.utilization)));return t.t("chat.usageWindow",{label:e.label,remaining:Math.max(0,100-n),used:n,reset:RM(e.resetsAt,t)})}function NM(e,t,n){if(t)return n.t("chat.usageLoading");if(!e)return"";if(e.status==="error")return n.t("chat.usageError",{kind:e.kind});if(e.status==="unavailable")return"";const r=e.windows??[];return r.length===0?n.t("chat.usageAvailableNoDetails",{kind:e.kind}):n.t("chat.usageSummary",{kind:e.kind,details:r.slice(0,IM).map(o=>OM(o,n)).join(n.t("chat.usageSeparator"))})}const Ei={agent:{defaultKind:"claude"},notifications:{sessionEnd:{banner:!1,sound:!1},push:{enabled:!1}},shortcuts:{},power:{inhibitWhenRunning:"system-default"},appearance:{themeMode:"system",themeName:"paper",language:"zh-CN"},customInstructions:[]},[En,xl]=I(Ei);async function MM(){try{const e=await we.getGlobalConfig();return xl(e),_l(e),PM(e),e}catch{return xl(Ei),_l(Ei,!1),Ei}}async function qy(e){const t=await we.updateGlobalConfig(e);return xl(t.config),_l(t.config),Hy(),t.config}async function Ci(e){return qy(e(En()))}async function ch(e){return Ci(t=>({...t,customInstructions:e}))}function _l(e,t=!0){Tx(e.appearance.themeMode,e.appearance.themeName),t&&Tm(e.appearance.themeMode,e.appearance.themeName),gf.language!==e.appearance.language&&gf.changeLanguage(e.appearance.language)}function PM(e){if(!(typeof window>"u"))try{const t=window.localStorage,n=t.getItem("yorz.theme"),r=t.getItem("yorz.themeName"),o=t.getItem("yorz.lang"),i=BM(t.getItem("yorz.chat.customSlashCommands")),s=e.appearance,a={themeMode:LM(n)?n:s.themeMode,themeName:$M(r)?r:s.themeName,language:FM(o)?o:s.language},u=e.customInstructions.length>0||i.length===0?e.customInstructions:i;if(a.themeMode===s.themeMode&&a.themeName===s.themeName&&a.language===s.language&&u===e.customInstructions){Hy();return}Ci(c=>({...c,appearance:a,customInstructions:u}))}catch{}}function Hy(){if(!(typeof window>"u"))try{window.localStorage.removeItem("yorz.theme"),window.localStorage.removeItem("yorz.themeName"),window.localStorage.removeItem("yorz.lang"),window.localStorage.removeItem("yorz.chat.customSlashCommands")}catch{}}function LM(e){return e==="system"||e==="light"||e==="dark"}function $M(e){return e==="terminal"||e==="graphite"||e==="paper"}function FM(e){return e==="zh-CN"||e==="en"}function BM(e){if(!e)return[];try{const t=JSON.parse(e);return Array.isArray(t)?t.map(zM).filter(n=>n!==null):[]}catch{return[]}}function zM(e){if(!e||typeof e!="object")return null;const t=e,n=typeof t.hiddenPrompt=="string"?t.hiddenPrompt:typeof t.systemPrompt=="string"?t.systemPrompt:null;return typeof t.id!="string"||typeof t.name!="string"||typeof t.description!="string"||n===null||typeof t.prefill!="string"||typeof t.createdAt!="number"?null:{id:t.id,name:t.name,description:t.description,hiddenPrompt:n,prefill:t.prefill,createdAt:t.createdAt}}const[UM,KM]=I({});function yc(e){return e?UM()[e]??[]:[]}function El(e,t){return KM(n=>({...n,[e]:t})),t}async function jM(e){if(!e)return[];try{const t=await we.getProjectCustomInstructions(e);return El(e,t.customInstructions)}catch{return El(e,[])}}async function lh(e,t){const n=await we.updateProjectCustomInstructions(e,t);return El(e,n.customInstructions)}function qM(e,t){const n=`/${e}`;return t.trim()?HM(t,e)?t:`${n} ${t}`:`${n} `}function HM(e,t){const n=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return new RegExp(`^/${n}(\\s|$)`).test(e.trimStart())}function GM(e,t){const n=new Set(e.map(r=>r.name));return[...e.map(r=>({...r,scope:"project"})),...t.filter(r=>!n.has(r.name)).map(r=>({...r,scope:"global"}))]}const Gy=`
|
|
29
|
+
|
|
30
|
+
`,VM="<!-- yorz:hidden -->",WM=/<!-- yorz:hidden -->[\s\S]*?<!-- \/yorz:hidden -->\n?/g;function ga(e){return e.includes(VM)?e.replace(WM,"").trim():e}function YM(e,t){return t.type==="text"?t.contextKind?{kind:"context",contextKind:t.contextKind,text:t.text}:{kind:"text",role:e,text:ga(t.text)}:t.type==="tool-use"?{kind:"tool",name:t.name,input:t.input}:{kind:"tool",result:t.text}}function Vy(e){const t=[];for(const n of e){let r=!1;for(const o of n.parts){const i=YM(n.role,o);if(i.kind==="text"){const s=t[t.length-1],a=!r&&s?.kind==="text"&&s.role===i.role;t.push(a?{...i,text:Gy+i.text}:i),r=!0}else t.push(i)}}return t}function ZM(e){const t=[];for(const n of e){const r=Vy(n.messages);r.length!==0&&(t.length>0&&t.push({kind:"divider",sessionId:n.sessionId,agentKind:n.kind,startedAt:n.createdAt}),t.push(...r))}return t}function XM(e,t){return!e||!t||e.endsWith(`
|
|
31
|
+
`)||t.startsWith(`
|
|
32
|
+
`)?e+t:e+Gy+t}function JM(e,t){for(let n=e.length-1;n>=0;n--){const r=e[n];if(r.result===void 0){r.result=t;return}}e.push({kind:"tool",result:t})}function dh(e,t,n){return`${e}#${t}:${n}`}function QM(e){const t=[];let n=null,r=0;const o=()=>`t${r++}`,i=()=>(n||(n={kind:"assistant",segments:[]},t.push(n)),n);for(const a of e){if(a.kind==="divider"){n=null,t.push({kind:"divider",sessionId:a.sessionId,agentKind:a.agentKind,startedAt:a.startedAt});continue}if(a.kind==="context"){n=null;const l=t[t.length-1];l?.kind==="context"?l.contexts.push(a):t.push({kind:"context",contexts:[a]});continue}if(a.kind==="text"&&a.role==="user"){n=null;const l=t[t.length-1];l?.kind==="user"?l.text=XM(l.text,a.text):t.push({kind:"user",text:a.text});continue}const u=i(),c=u.segments[u.segments.length-1];if(a.kind==="text"){c?.kind==="text"?c.text+=a.text:u.segments.push({kind:"text",text:a.text});continue}c?.kind==="tools"?a.result!==void 0&&a.name===void 0?JM(c.tools,a.result):c.tools.push({...a}):u.segments.push({kind:"tools",id:o(),tools:[{...a}]})}return t.map(a=>a.kind==="user"?{...a,text:ga(a.text)}:a.kind!=="assistant"?a:{...a,segments:a.segments.map(u=>u.kind==="text"?{...u,text:ga(u.text)}:u)}).filter(a=>a.kind!=="assistant"||a.segments.length>0)}function eP(e){const{sid:t,displayedSid:n,displayedSpecId:r,fresh:o,listPending:i,known:s,specId:a,running:u}=e;if(!t)return{action:"idle"};const c=n===t;return o&&c?{action:"fresh"}:!s&&i?{action:"hold"}:u&&c&&r===a?{action:"keep"}:{action:"load",clear:!c,specId:a}}function tP(){let e=0;return{begin(){const t=++e;return()=>t===e},invalidate(){e+=1}}}const nP="\0";function vc(e,t){return`${e}${nP}${t}`}function Wy(e,t){return e.kind!==t.kind?!1:e.kind==="text"&&t.kind==="text"?e.role===t.role&&e.text===t.text:e.kind==="tool"&&t.kind==="tool"?e.name===t.name&&e.result===t.result:e.kind==="context"&&t.kind==="context"?e.contextKind===t.contextKind&&e.text===t.text:e.kind==="divider"&&t.kind==="divider"?e.sessionId===t.sessionId&&e.startedAt===t.startedAt:!1}function rP(e,t){return e.length!==t.length?!1:e.length===0?!0:Wy(e[e.length-1],t[t.length-1])}function oP(e,t){if(e.length>t.length)return!1;for(let n=0;n<e.length;n++)if(!Wy(e[n],t[n]))return!1;return!0}const iP=80,sP=1500;function aP(e){return new Promise(t=>window.setTimeout(t,e))}function uP(e){const[t,n]=I([]),r=ne(()=>QM(t())),[o,i]=I(!1),[s,a]=I(!1),[u,c]=I({}),l={isExpanded:te=>u()[te]===!0,set:(te,H)=>c(de=>de[te]===H?de:{...de,[te]:H})};function d(){c(te=>Object.keys(te).length===0?te:{})}const g=new Set,[p,h]=I(0);let m=new Set,y=!1,v;const[b,w]=I(0);let E=null;function C(){E==null&&(E=window.setTimeout(()=>{E=null,w(te=>te+1)},120))}let k="",T,S="";const A=tP();function F(te){return k!==te&&S!==te?!1:pt(t).length>0}function O(te,H){if(S===H||F(H))return!0;const de=e.transcriptCache?.get(vc(te,H));return!de||de.parts.length===0?!1:(z(de.parts),S=H,!0)}const P=new Map;function L(te){let H=P.get(te);if(!H){let de=()=>{};H={promise:new Promise(Ue=>{de=Ue}),resolve:de},P.set(te,H)}return H.promise}function D(te){L(te),P.get(te)?.resolve()}function B(te){g.delete(te)&&te===e.sessionId()&&h(H=>H+1)}let N="",Y=null;function ce(te,H){const de=te[te.length-1];return de&&de.kind==="text"&&de.role==="assistant"?[...te.slice(0,-1),{...de,text:de.text+H}]:[...te,{kind:"text",role:"assistant",text:H}]}function V(){Y!=null&&(clearTimeout(Y),Y=null);const te=N;N="",te&&n(H=>ce(H,te))}function j(te){N+=te,Y==null&&(Y=window.setTimeout(V,iP))}function he(te){V(),n(H=>ce(H,te))}function K(te){V(),n(H=>[...H,te])}function z(te=[]){Y!=null&&(clearTimeout(Y),Y=null),N="",n(H=>te.length===0&&H.length===0?H:te)}function J(te){he(`
|
|
33
|
+
${e.errorLabel(te)}
|
|
34
|
+
`)}ae(()=>{const te=e.projectId(),H=e.sessionId(),de=e.specId(),fe=de?e.running():!1,Ue=eP({sid:H,displayedSid:k,displayedSpecId:T,fresh:g.has(H),listPending:e.listPending?.()??!1,known:e.known?.()??!0,specId:de,running:fe});if(p(),b(),!te){a(!1);return}if(Ue.action==="hold"){a(!O(te,H));return}if(Ue.action==="idle"||Ue.action==="keep"){a(!1);return}if(Ue.action==="fresh"){a(!1),e.onSubjectChange?.();return}e.onSubjectChange?.(),Ue.clear&&S!==H&&(z(),d()),Ue.clear&&(m=new Set,y=!1,v&&v.sid!==H&&(v=void 0)),k=H,T=Ue.specId;const se=A.begin();a(!O(te,H)),(Ue.specId?we.getSpecMessages(te,Ue.specId).then(Ce=>({next:ZM(Ce),folded:new Set(Ce.filter(We=>We.messages.length>0).map(We=>We.sessionId))})):we.getSessionMessages(te,H).then(Ce=>({next:Vy(Ce),folded:new Set(Ce.length>0?[H]:[])}))).then(({next:Ce,folded:We})=>{if(!se())return;v&&v.sid===H&&We.has(H)&&(v=void 0);const it=!!(Ue.specId&&v&&v.sid===H&&!We.has(H));if(Ue.specId&&!We.has(H)&&y&&!it){a(!1);return}let Ye=Ce;if(it&&v){const mt=[];Ce.length>0&&mt.push({kind:"divider",sessionId:H,agentKind:v.kind,startedAt:v.startedAt}),mt.push({kind:"text",role:"user",text:v.userText}),Ye=[...Ce,...mt]}S="";const Ct=pt(t),Ot=rP(Ct,Ye)||oP(Ye,Ct);Ot||z(Ye),m=We,We.has(H)&&(y=!1),a(!1);const Pe=Ot?Ct:Ye;Pe.length>0&&e.transcriptCache?.set(vc(te,H),{specId:Ue.specId,parts:Pe})}).catch(()=>{se()&&a(!1)})}),ae(()=>{const te=e.projectId(),H=e.sessionId();if(!te||!H)return;const de=Ea(te,H,{onReady:()=>D(H),onEvent:fe=>{const Ue=()=>{e.specId()&&H===e.sessionId()&&!m.has(H)&&(y=!0)};fe.type==="text"?(j(fe.delta),Ue()):fe.type==="tool-use"?(K({kind:"tool",name:fe.name,input:fe.input}),Ue()):fe.type==="tool-result"?(K({kind:"tool",result:fe.text}),Ue()):fe.type==="turn-completed"?(V(),B(H),e.onRunningChange(H,!1),e.specId()&&H===e.sessionId()&&!m.has(H)&&(y=!0,C())):fe.type==="error"?(J(fe.message),e.onRunningChange(H,!1)):fe.type==="session-started"&&fe.sessionId!==H&&kl(()=>{g.has(H)&&g.add(fe.sessionId),k===H&&(k=fe.sessionId),e.onSessionIdChange(fe.sessionId),e.onRunningChange(H,!1),e.onRunningChange(fe.sessionId,!0),e.onSessionsChanged?.()})}});ue(()=>{P.delete(H),de()})}),ue(()=>{Y!=null&&clearTimeout(Y),E!=null&&clearTimeout(E),A.invalidate();const te=e.projectId(),H=t();te&&k&&H.length>0&&e.transcriptCache?.set(vc(te,k),{specId:T,parts:H})});function re(){z(),d(),A.invalidate(),a(!1),k="",T=void 0,S="",m=new Set,y=!1,v=void 0,E!=null&&(clearTimeout(E),E=null),e.onSubjectChange?.()}function ve(te,H,de){!te||!H||(v={sid:te,userText:H,kind:de,startedAt:Date.now()},y=!0,C())}function Z(){re(),i(!1),g.clear(),h(te=>te+1),P.clear()}async function M(te,H){const de=e.projectId(),fe=e.sessionId();if(!de||!te||o()||e.running())return"failed";if(e.onSubjectChange?.(),!fe)return W(de,te,H);K({kind:"text",role:"user",text:te}),a(!1),e.onRunningChange(fe,!0);try{return await we.sendSessionMessage(de,fe,te,H),"sent"}catch(Ue){return J(Ue.message),e.onRunningChange(fe,!1),"failed"}}async function W(te,H,de){i(!0);try{let fe;try{fe=(await we.createSession(te,{})).sessionId}catch(xe){return J(xe.message),"not-started"}g.add(fe);const Ue=L(fe);z([{kind:"text",role:"user",text:H}]),d(),A.invalidate(),k=fe,T=void 0,S="",e.onRunningChange(fe,!0),e.onSessionIdChange(fe),await Promise.race([Ue,aP(sP)]);let se;try{await we.sendSessionMessage(te,fe,H,de),se="sent"}catch(xe){J(xe.message),e.onRunningChange(fe,!1),se="failed"}return e.onSessionsChanged?.(),se}finally{i(!1)}}async function oe(){const te=e.projectId(),H=e.sessionId();!te||!H||(await we.abortSession(te,H).catch(()=>{}),e.onRunningChange(H,!1))}return{blocks:r,running:e.running,starting:o,historyLoading:s,toolExpand:l,send:M,beginOptimisticRound:ve,abort:oe,reset:re,markPersisted:B,resetAll:Z}}function cP(e){const t=ga(e.title),r=(/^\s*<!--\s*yorz:hidden\b/i.test(t)?"":t)||e.id;return r===e.title?e:{...e,title:r}}function lP(e,t){const n=[],r=new Map;for(const o of e){const i=cP(o),s=t(i.id);if(!i.specId){n.push({key:i.id,sessions:[i],latest:i,updatedAt:i.updatedAt,running:s});continue}const a=r.get(i.specId);if(!a){const u={key:i.specId,specId:i.specId,sessions:[i],latest:i,updatedAt:i.updatedAt,running:s};r.set(i.specId,u),n.push(u);continue}a.sessions.push(i),i.updatedAt>a.latest.updatedAt&&(a.latest=i),a.updatedAt=Math.max(a.updatedAt,i.updatedAt),a.running||=s}for(const o of r.values())o.sessions.sort((i,s)=>i.createdAt-s.createdAt);return n}function dP(e,t){return e.find(n=>n.sessions.some(r=>r.id===t))}var fP=$("<div>");const gP=e=>{const[t,n]=me(e,["class"]);return(()=>{var r=fP();return sr(r,G({get class(){return at("rounded-xl border bg-card text-card-foreground shadow",t.class)}},n),!1,!1),r})()},pP=300;function hP(e,t=pP){const n=e.length;return n<=t?{truncated:!1,preview:e,length:n}:{truncated:!0,preview:e.slice(0,t),length:n}}const Rd=ja;ja.Trigger;const Od=e=>{const[t,n]=me(e,["class"]);return f(ja.Content,G({get class(){return at("animate-collapsible-up data-[expanded]:animate-collapsible-down",t.class)}},n))};var mP=$('<button type=button class="inline-flex w-fit cursor-pointer items-center gap-1 py-0.5 text-left text-xs text-muted-foreground/70"><span class=font-mono>'),bP=$('<div class="mt-1 max-h-[32rem] space-y-2 overflow-auto rounded border bg-background p-2">'),yP=$('<div class="font-mono text-xs font-semibold">'),vP=$("<div class=space-y-1>"),wP=$('<button type=button class="inline-flex w-fit cursor-pointer items-center text-left text-[11px] text-muted-foreground/70">'),xP=$("<div class=space-y-1><pre>");const _P=e=>{const t=()=>e.expand.isExpanded(e.segment.id),n=r=>e.expand.set(e.segment.id,r);return f(Rd,{get open(){return t()},onOpenChange:n,class:"my-1",get children(){return[(()=>{var r=mP(),o=r.firstChild;return r.$$click=()=>n(!t()),x(r,f(Nl,{get class(){return`h-3 w-3 shrink-0 transition-transform duration-150 ${t()?"":"-rotate-90"}`}}),o),x(o,()=>_("chat.toolCollapsed",{count:e.segment.tools.length})),r})(),f(Od,{get children(){var r=bP();return x(r,f(Zc,{get each(){return e.segment.tools},children:(o,i)=>(()=>{var s=vP();return x(s,f(q,{get when(){return o().name},get children(){var a=yP();return x(a,()=>o().name),a}}),null),x(s,f(q,{get when(){return o().input!==void 0},get children(){return f(fh,{get text(){return EP(o().input)},get expandKey(){return dh(e.segment.id,i,"input")},get expand(){return e.expand}})}}),null),x(s,f(q,{get when(){return o().result!==void 0},get children(){return f(fh,{get text(){return o().result??""},get expandKey(){return dh(e.segment.id,i,"result")},get expand(){return e.expand},wrap:!0})}}),null),s})()})),r}})]}})},fh=e=>{const t=()=>hP(e.text),n=()=>e.expand.isExpanded(e.expandKey),r=()=>t().truncated&&!n();return(()=>{var o=xP(),i=o.firstChild;return x(i,(()=>{var s=Q(()=>!!r());return()=>s()?`${t().preview}…`:e.text})()),x(o,f(q,{get when(){return t().truncated},get children(){var s=wP();return s.$$click=()=>e.expand.set(e.expandKey,!n()),x(s,(()=>{var a=Q(()=>!!n());return()=>a()?_("chat.toolTextCollapse"):_("chat.toolTextExpand",{count:t().length})})()),s}}),null),Me(()=>xt(i,`overflow-x-auto rounded bg-muted px-2 py-1 text-[11px] leading-snug ${e.wrap?"whitespace-pre-wrap":""}`)),o})()};function EP(e){try{return JSON.stringify(e,null,2)??String(e)}catch{return String(e)}}jt(["click"]);var CP=$('<button type=button class="inline-flex w-fit cursor-pointer items-center gap-1 rounded border border-dashed px-1.5 py-0.5 text-left text-xs text-muted-foreground/80"><span class=font-mono>'),SP=$('<div class="mt-1 max-h-72 space-y-2 overflow-auto rounded border border-dashed bg-muted/40 p-2">'),kP=$('<pre class="overflow-x-auto whitespace-pre-wrap rounded bg-background px-2 py-1 text-[11px] leading-snug text-muted-foreground">');const AP=e=>{const[t,n]=I(!1);return f(Rd,{get open(){return t()},onOpenChange:n,class:"mb-2",get children(){return[(()=>{var r=CP(),o=r.firstChild;return r.$$click=()=>n(!t()),x(r,f(Nl,{get class(){return`h-3 w-3 shrink-0 transition-transform duration-150 ${t()?"":"-rotate-90"}`}}),o),x(o,()=>_("chat.agentContextCollapsed",{count:e.contexts.length})),Me(()=>Ke(r,"title",_("chat.agentContextCollapsed",{count:e.contexts.length}))),r})(),f(Od,{get children(){var r=SP();return x(r,f(ot,{get each(){return e.contexts},children:o=>(()=>{var i=kP();return x(i,()=>o.text),i})()})),r}})]}})};jt(["click"]);var TP=$('<span class="font-semibold tracking-wide">'),gh=$("<span>"),DP=$('<div class="flex w-full items-center gap-2 rounded-lg px-2.5 py-1.5"><button type=button class="min-w-0 flex-1 text-left font-medium"></button><button type=button class=shrink-0>'),IP=$('<ul class="m-0 list-none overflow-y-auto border-t py-1">'),RP=$("<div class=mb-1.5>"),OP=$('<p class="mb-1 text-xs text-destructive">'),NP=$('<div class="flex min-h-0 flex-1 flex-col"><div class="min-h-0 flex-1 overflow-x-hidden overflow-y-auto p-2 pt-0 pr-1 mr-1 "></div><div class="border-t p-2"><div class="mb-1 flex items-center gap-1"><input type=file multiple hidden></div><div class="flex items-center justify-end gap-1">'),MP=$('<div class="absolute right-0 top-0 z-[2] h-full w-1 cursor-col-resize bg-transparent hover:bg-accent/40"role=separator aria-orientation=vertical>'),PP=$('<p class="m-0 text-sm text-destructive">'),LP=$('<form class="flex flex-col gap-4"><div class="flex flex-col gap-1 font-medium"><span class="text-xs font-normal text-muted-foreground"></span></div><label class="flex flex-col gap-1 font-medium"for=chat-custom-command-name></label><label class="flex flex-col gap-1 font-medium"for=chat-custom-command-description></label><label class="flex flex-col gap-1 font-medium"for=chat-custom-command-hidden-prompt><span class="text-xs font-normal text-muted-foreground"></span></label><label class="flex flex-col gap-1 font-medium"for=chat-custom-command-prefill><span class="text-xs font-normal text-muted-foreground">'),$P=$("<aside><header>"),FP=$('<li class="px-2.5 py-1.5 text-xs text-muted-foreground">'),BP=$('<span class="shrink-0 text-[11px] font-normal tabular-nums text-muted-foreground">×'),zP=$('<li><button type=button><span class="shrink-0 text-xs text-muted-foreground">[<!>]</span><span class="min-w-0 flex-1 truncate"></span><span class="ml-auto max-w-20 shrink-0 truncate pl-2 text-right text-[11px] font-normal tabular-nums text-muted-foreground">'),UP=$("<div class=text-muted-foreground><p class=m-0>"),KP=$('<p class="mt-1 text-sm">'),jP=$('<div class="mb-2 whitespace-pre-wrap rounded border border-primary/20 border-l-2 border-l-primary bg-primary/10 px-2 py-1.5 font-medium text-foreground [overflow-wrap:anywhere]">'),qP=$('<div class="mb-2 min-w-0 rounded border bg-card px-2 py-1.5 [overflow-wrap:anywhere]">'),HP=$('<div class="markdown chat-md">'),GP=$('<div class="my-3 flex items-center gap-2 text-[11px] text-muted-foreground"><span class="h-px flex-1 bg-border"></span><span class="shrink-0 tabular-nums"></span><span class="h-px flex-1 bg-border">'),VP=$('<span class="text-sm font-normal text-muted-foreground">');const wc="yorz.layout.col2.collapsed",Cl="yorz.layout.col2.width",ph="yorz.chat.sessionList.collapsed",Yy="yorz.chat.sessionList.rows",WP="yorz.chat.sessionList.limit",YP="yorz.chat.sessionList.showHistory",Zy=[3,5,10],ZP=28,Nd=340,XP=.4,Xy=260,JP=960,QP=.8,eL=96,tL=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,nL=e=>e.kind==="divider"?e:null,rL=e=>e.kind==="context"?e:null,oL=e=>e.kind==="assistant"?e:null,iL=e=>e.kind==="user"?e:null,sL=e=>e.kind==="tools"?e:null,aL=e=>e.kind==="text"?e.text:"";Ja("en",DM);Ja("zh-CN",TM);function uL(){return typeof window>"u"?JP:Math.max(Xy,Math.round(window.innerWidth*QP))}function pa(e){return Number.isFinite(e)?Math.min(uL(),Math.max(Xy,Math.round(e))):Nd}function xc(){return typeof window>"u"?Nd:pa(window.innerWidth*XP)}function hh(e){return e instanceof Element?e.closest('[data-file-link="true"]'):null}function cL(){try{if(typeof window>"u")return Nd;const e=window.localStorage.getItem(Cl);if(!e)return xc();const t=Number(e);return Number.isFinite(t)?pa(t):xc()}catch{return xc()}}function Si(e,t){try{return typeof window<"u"&&window.localStorage.getItem(e)||t}catch{return t}}function Po(e,t){try{typeof window<"u"&&window.localStorage.setItem(e,t)}catch{}}function Sl(e){return Zy.includes(e)}function lL(){const e=Number(Si(Yy,""));if(Sl(e))return e;const t=Number(Si(WP,""));return Sl(t)?t:Si(YP,"0")==="1"?10:3}const mh=3,bh=10;function yh(e){return e.trim().replace(/^\/+/,"")}function dL(e){return/^[\w-]+$/.test(e)}function fL(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():`${Date.now().toString(36)}-${Math.random().toString(36).slice(2,10)}`}const gL=()=>{let e,t;const{lng:n}=z1(),r=Y1({projectId:()=>wt()||"",labels:Z1}),o=ne(()=>GM(yc(wt()||""),En().customInstructions));ae(()=>{const U=wt()||"";U&&jM(U)});const[i,s]=I(!1),[a,u]=I(""),[c,l]=I(""),[d,g]=I(""),[p,h]=I(""),[m,y]=I("project"),[v,b]=I(null),[w,E]=I(!1),[C,k]=I(null),[T,S]=I(null),[A,F]=I(!1),O=ne(()=>{n();const U=o().map(ie=>{const pe=`/${ie.name}`;return{value:pe,label:pe,description:ie.description||_("chat.customSlashCommandNoDescription"),replacement:qM(ie.name,ie.prefill),customId:ie.id,editable:!0,editLabel:_("chat.editCustomSlashCommand",{name:ie.name}),deletable:!0,deleteLabel:_("chat.deleteCustomSlashCommand",{name:ie.name})}});return[{value:"/yorz-debug",description:_("chat.slashCommandYorzDebug")},{value:"/yorz-spec",description:_("chat.slashCommandYorzSpec")},...U,{value:"/add-command",label:_("chat.addSlashCommandOption"),description:_("chat.addSlashCommandOptionDescription"),action:"add",icon:"plus"}]}),[P,L]=I(Si(wc,"0")==="1"),[D,B]=I(cL()),[N,Y]=I(Si(ph,"0")!=="1"),[ce,V]=I(lL()),[j,he]=I(""),[K,z]=I(""),[J,re]=I(!0),[ve,Z]=I(Date.now()),[M,W]=I({}),[oe,{refetch:te}]=Zt(()=>wt()||void 0,U=>we.listSessions(U)),[H]=Zt(()=>{const U=wt();return U&&!j()?U:void 0},U=>we.getAgentUsageStatus(U));ae(()=>{const U=oe();if(!U)return;const ie=j();for(const pe of U)pe.running||Ye.markPersisted(pe.id);W(pe=>{const Le={};for(const ct of U)Le[ct.id]=!!ct.running;return ie&&!(ie in Le)&&pe[ie]===!0&&(Le[ie]=!0),Le})}),ae(_t(wt,()=>{he(""),W({}),Ye.resetAll(),r.reset()})),ae(()=>{const U=wt();if(!U)return;const ie=Wm(U,{onStatus:pe=>{W(Le=>({...Le,[pe.sessionId]:pe.running})),te()}});ue(ie)});const de=U=>M()[U]===!0,fe=ne(()=>{const U=j();return U?de(U):!1}),Ue=ne(()=>lP(oe()??[],de)),se=ne(()=>Ue().filter(U=>U.running).length),xe=ne(()=>dP(Ue(),j())),Ce=ne(()=>xe()?.specId),We=ne(()=>!!xe()),it=ne(()=>!We()&&oe.loading),Ye=uP({projectId:()=>wt()||"",sessionId:j,specId:Ce,running:fe,listPending:it,known:We,onSessionIdChange:he,onRunningChange:(U,ie)=>W(pe=>({...pe,[U]:ie})),onSessionsChanged:()=>void te(),onSubjectChange:()=>re(!0),errorLabel:U=>_("chat.errorMessage",{message:U})});function Ct(U){!U||U===j()||(te(),he(U))}ae(()=>{const U=X2();if(!U)return;const ie=J2();Q2(),Ct(U),ie&&ie.sessionId===U&&Ye.beginOptimisticRound(U,ie.userText,ie.kind),P()&&(L(!1),Po(wc,"0"))});const Ot=()=>P()||Cr();function Pe(){if(Cr()){ra();return}const U=!P();L(U),Po(wc,U?"1":"0")}function mt(U){Y(U),Po(ph,U?"0":"1")}function It(U){const ie=Number(U);Sl(ie)&&(V(ie),Po(Yy,String(ie)))}function un(U){return _(U===3?"chat.sessionListRows3":U===5?"chat.sessionListRows5":"chat.sessionListRows10")}function Dn(U){const ie=U.title.trim();return ie&&ie!==U.id&&!tL.test(ie)?ie:U.id}Sn(()=>{const U=()=>{const ie=pa(D());ie!==D()&&(B(ie),Po(Cl,String(ie)))};window.addEventListener("resize",U),ue(()=>window.removeEventListener("resize",U))}),Sn(()=>{const U=window.setInterval(()=>Z(Date.now()),6e4);ue(()=>window.clearInterval(U))});let Lt=null,Ut=null,rn=null;function Ir(U){Ot()||(U.preventDefault(),Lt={startX:U.clientX,startW:D(),raf:null},document.body.classList.add("is-resizing"),Ut=ie=>{if(!Lt)return;const pe=pa(Lt.startW+(ie.clientX-Lt.startX));Lt.raf==null&&(Lt.raf=requestAnimationFrame(()=>{Lt&&(Lt.raf=null,B(pe))}))},rn=()=>{Lt?.raf!=null&&cancelAnimationFrame(Lt.raf),Lt=null,document.body.classList.remove("is-resizing"),Ut&&document.removeEventListener("mousemove",Ut),rn&&document.removeEventListener("mouseup",rn),Ut=null,rn=null,Po(Cl,String(D()))},document.addEventListener("mousemove",Ut),document.addEventListener("mouseup",rn))}ue(()=>{Ut&&document.removeEventListener("mousemove",Ut),rn&&document.removeEventListener("mouseup",rn),document.body.classList.remove("is-resizing")}),ae(()=>{Ye.blocks(),J()&&requestAnimationFrame(Rr)});function to(U){return U.scrollHeight-U.scrollTop-U.clientHeight<=eL}function Rr(){e&&(e.scrollTop=e.scrollHeight)}function no(){e&&re(to(e))}function $t(U){return ve(),!Number.isFinite(U)||U<=0?"":SM(U,n())}function Or(U){return!Number.isFinite(U)||U<=0?"":new Date(U).toLocaleString(n())}const fr=ne(()=>(n(),NM(H(),H.loading,{t:_,formatTime:U=>U.toLocaleString(n())})));async function gr(U){try{if(!navigator.clipboard?.writeText)throw new Error("Clipboard API unavailable");await navigator.clipboard.writeText(U),zt.success(_("chat.filePathCopied"))}catch{zt.error(_("chat.filePathCopyFailed"))}}function nt(U){const ie=hh(U.target);if(!ie||e&&!e.contains(ie))return;const pe=ie.dataset.filePath;pe&&(U.preventDefault(),gr(pe))}function In(U){if(U.key!=="Enter"&&U.key!==" ")return;const ie=hh(U.target);if(!ie||e&&!e.contains(ie))return;const pe=ie.dataset.filePath;pe&&(U.preventDefault(),gr(pe))}function ge(){!wt()||!j()||(he(""),Ye.reset(),r.reset())}async function Te(){const U=K().trim();if(!wt()||!U||Ye.starting()||fe()||r.hasPending())return;z("");const ie=await Ye.send(U,r.draftId()??void 0);ie==="sent"?r.reset():ie==="not-started"&&z(U)}function R(U){U.defaultPrevented||U.isComposing||U.key==="Enter"&&!U.shiftKey&&(U.preventDefault(),Te())}function X(){return C()===null&&!!wt()}function be(){u(""),l(""),g(""),h(""),y(wt()?"project":"global"),b(null),k(null)}function le(){be(),s(!0)}function Fe(U){const ie=U.customId,pe=ie?o().find(Le=>Le.id===ie):void 0;pe&&(k(pe.id),u(pe.name),l(pe.description),g(pe.hiddenPrompt),h(pe.prefill),y(pe.scope),b(null),s(!0))}async function Ze(U){if(U.preventDefault(),w())return;const ie=yh(a());if(!ie){b(_("chat.customSlashCommandNameRequired"));return}if(!dL(ie)){b(_("chat.customSlashCommandNameInvalid"));return}const pe=C(),Le=wt()||"",ct=m()==="project"&&Le?"project":"global",St=ct==="project"?yc(Le):En().customInstructions,Rt=pe?St.find(Jt=>Jt.id===pe):void 0,Xt={id:Rt?.id??fL(),name:ie,description:c().trim(),hiddenPrompt:d().trim(),prefill:p(),createdAt:Rt?.createdAt??Date.now()},cn=[...St.filter(Jt=>Jt.id!==Xt.id&&Jt.name!==ie),Xt];E(!0);try{ct==="project"?await lh(Le,cn):await ch(cn),s(!1),be()}catch(Jt){b(Jt.message)}finally{E(!1)}}async function _e(){const U=T()?.customId;if(!U)return;const ie=o().find(pe=>pe.id===U);if(ie){F(!0);try{if(ie.scope==="project"){const pe=wt()||"";await lh(pe,yc(pe).filter(Le=>Le.id!==U))}else await ch(En().customInstructions.filter(pe=>pe.id!==U));S(null)}catch(pe){zt.error(pe.message)}finally{F(!1)}}}return(()=>{var U=$P(),ie=U.firstChild;return x(ie,f(q,{get when(){return!Ot()},get fallback(){return f(Ee,{variant:"outline",size:"sm",class:"h-7 w-7 p-0",onClick:Pe,get title(){return _("chat.expand")},get children(){return f(tl,{class:"h-4 w-4"})}})},get children(){return[(()=>{var pe=TP();return x(pe,()=>_("chat.title")),pe})(),f(Ee,{variant:"outline",size:"sm",class:"h-7 w-7 p-0",onClick:Pe,get title(){return _("chat.collapse")},get children(){return f(zm,{class:"h-4 w-4"})}})]}})),x(U,f(q,{get when(){return!Ot()},get children(){var pe=NP(),Le=pe.firstChild,ct=Le.nextSibling,St=ct.firstChild,Rt=St.firstChild,Xt=St.nextSibling;x(pe,f(q,{get when(){return wt()},get children(){return f(gP,{class:"m-2 rounded-lg shadow-none",get children(){return f(Rd,{get open(){return N()},onOpenChange:mt,get children(){return[(()=>{var ft=DP(),Ne=ft.firstChild,kt=Ne.nextSibling;return Ne.$$click=()=>mt(!N()),x(Ne,f(q,{get when(){return se()>0},get fallback(){return(()=>{var rt=gh();return x(rt,()=>_("chat.sessionsLabelPlain")),rt})()},get children(){var rt=gh();return x(rt,()=>_("chat.sessionsLabel",{count:se()})),rt}})),x(ft,f(Xn,{class:"flex shrink-0 items-center gap-2",get value(){return String(ce())},onChange:It,get"aria-label"(){return _("chat.sessionListRows")},get children(){return f(ot,{each:Zy,children:rt=>f(hn,{get value(){return String(rt)},class:"flex items-center gap-1",get children(){return[f(gn,{}),f(_n,{class:"h-3 w-3"}),f(pn,{class:"cursor-pointer text-xs text-muted-foreground",get children(){return un(rt)}})]}})})}}),kt),kt.$$click=()=>mt(!N()),x(kt,f(Nl,{get class(){return`h-4 w-4 shrink-0 text-muted-foreground transition-transform duration-150 ${N()?"":"-rotate-90"}`}})),Me(rt=>{var qt=N()?_("chat.collapseSessions"):_("chat.expandSessions"),So=N()?_("chat.collapseSessions"):_("chat.expandSessions");return qt!==rt.e&&Ke(Ne,"title",rt.e=qt),So!==rt.t&&Ke(kt,"title",rt.t=So),rt},{e:void 0,t:void 0}),ft})(),f(Od,{get children(){var ft=IP();return x(ft,f(q,{get when(){return Ue().length>0},get fallback(){return(()=>{var Ne=FP();return x(Ne,()=>_("chat.noRunningSessions")),Ne})()},get children(){return f(ot,{get each(){return Ue()},children:Ne=>(()=>{var kt=zP(),rt=kt.firstChild,qt=rt.firstChild,So=qt.firstChild,ds=So.nextSibling;ds.nextSibling;var Rn=qt.nextSibling,ko=Rn.nextSibling;return rt.$$click=()=>Ct(Ne.latest.id),x(rt,f(q,{get when(){return Ne.running},get children(){return f(sn,{class:"h-3.5 w-3.5 shrink-0 animate-spin text-muted-foreground"})}}),qt),x(qt,()=>Ne.latest.kind,ds),x(Rn,()=>Dn(Ne.latest)),x(rt,f(q,{get when(){return Ne.sessions.length>1},get children(){var on=BP();return on.firstChild,x(on,()=>Ne.sessions.length,null),on}}),ko),x(ko,()=>$t(Ne.updatedAt)),Me(on=>{var fs=`flex w-full items-center gap-1 px-2 py-1 text-left text-sm ${xe()?.key===Ne.key?"bg-primary-soft font-semibold":"hover:bg-accent"}`,gs=Ne.running?_("chat.sessionTitleRunning",{kind:Ne.latest.kind,id:Ne.latest.id}):_("chat.sessionTitle",{kind:Ne.latest.kind,id:Ne.latest.id}),ps=Or(Ne.updatedAt);return fs!==on.e&&xt(rt,on.e=fs),gs!==on.t&&Ke(rt,"title",on.t=gs),ps!==on.a&&Ke(ko,"title",on.a=ps),on},{e:void 0,t:void 0,a:void 0}),kt})()})}})),Me(Ne=>Di(ft,"max-height",`${ce()*ZP+4}px`)),ft}})]}})}})}}),Le),Le.addEventListener("scroll",no),Le.$$keydown=In,Le.$$click=nt;var cn=e;typeof cn=="function"?Ln(cn,Le):e=Le,x(Le,f(q,{get when(){return Ye.blocks().length>0},get fallback(){return(()=>{var ft=UP(),Ne=ft.firstChild;return x(Ne,(()=>{var kt=Q(()=>!!j());return()=>kt()?_("chat.empty"):_("chat.draftEmpty")})()),x(ft,f(q,{get when(){return Q(()=>!j())()&&fr()},children:kt=>(()=>{var rt=KP();return x(rt,kt),rt})()}),null),ft})()},get children(){return f(Zc,{get each(){return Ye.blocks()},children:ft=>f(q,{get when(){return nL(ft())},get fallback(){return f(q,{get when(){return rL(ft())},get fallback(){return f(q,{get when(){return oL(ft())},get fallback(){return(()=>{var Ne=jP();return x(Ne,()=>iL(ft())?.text),Ne})()},children:Ne=>(()=>{var kt=qP();return x(kt,f(Zc,{get each(){return Ne().segments},children:rt=>f(q,{get when(){return sL(rt())},get fallback(){return(()=>{var qt=HP();return Me(()=>qt.innerHTML=Dd(aL(rt()),{mermaid:"code",fileLinks:"copy",fileLinkTitle:_("chat.copyFilePath")})),qt})()},children:qt=>f(_P,{get segment(){return qt()},get expand(){return Ye.toolExpand}})})})),kt})()})},children:Ne=>f(AP,{get contexts(){return Ne().contexts}})})},children:Ne=>(()=>{var kt=GP(),rt=kt.firstChild,qt=rt.nextSibling;return x(qt,()=>_("chat.sessionDivider",{kind:Ne().agentKind,time:Or(Ne().startedAt)})),kt})()})})}})),x(ct,f(q,{get when(){return r.count()>0},get children(){var ft=RP();return x(ft,f(ey,{ctrl:r,compact:!0})),ft}}),St),x(ct,f(q,{get when(){return r.error()},get children(){var ft=OP();return x(ft,()=>r.error()),ft}}),St),x(St,f(Ha,{get projectId(){return wt()||""},get value(){return K()},onValueChange:z,get slashCommands(){return O()},get slashEmptyLabel(){return _("chat.slashCommandNoMatch")},onSlashCommandAction:le,onEditSlashCommand:Fe,onDeleteSlashCommand:S,onKeyDown:R,get onPaste(){return r.onPaste},get placeholder(){return Q(()=>!wt())()?_("chat.noSessionPlaceholder"):Q(()=>!!j())()?_("chat.inputPlaceholder"):_("chat.draftPlaceholder")},get disabled(){return!wt()},minRows:2,maxRows:10,class:"min-w-0 flex-1 bg-background px-2 py-1"}),Rt),x(St,f(Ee,{variant:"outline",size:"sm",class:"h-8 w-8 shrink-0 p-0",onClick:()=>t?.click(),get disabled(){return!wt()||r.count()>=qo},get title(){return _("newSpec.importAttachment")},get children(){return f(p2,{class:"h-4 w-4"})}}),Rt),Vs(Rt,"change",r.onFileInputChange);var Jt=t;return typeof Jt=="function"?Ln(Jt,Rt):t=Rt,Ke(Rt,"accept",W1),x(Xt,f(Ee,{variant:"outline",size:"sm",class:"h-8 w-8 p-0",onClick:ge,get disabled(){return!wt()||!j()},get title(){return _("chat.newSession")},get children(){return f(jr,{class:"h-4 w-4"})}}),null),x(Xt,f(q,{get when(){return fe()},get fallback(){return f(Ee,{size:"sm",onClick:()=>void Te(),get disabled(){return!wt()||!K().trim()||Ye.starting()||r.hasPending()},get children(){return[f(xa,{class:"mr-1 h-3.5 w-3.5"}),Q(()=>_("chat.send"))]}})},get children(){return f(Ee,{variant:"outline",size:"sm",onClick:()=>void Ye.abort(),get title(){return _("chat.abort")},get children(){return[f(qm,{class:"mr-1 h-3.5 w-3.5"}),Q(()=>_("chat.abort"))]}})}}),null),pe}}),null),x(U,f(q,{get when(){return!Ot()},get children(){var pe=MP();return pe.$$mousedown=Ir,pe}}),null),x(U,f(Qt,{get open(){return i()},onOpenChange:pe=>{!pe&&w()||(s(pe),pe||be())},get children(){return f(rr,{class:"max-w-[700px]",get children(){return[f(ir,{get children(){return f(or,{get children(){return Q(()=>!!C())()?_("chat.editSlashCommandTitle"):_("chat.addSlashCommandTitle")}})}}),(()=>{var pe=LP(),Le=pe.firstChild,ct=Le.firstChild,St=Le.nextSibling,Rt=St.nextSibling,Xt=Rt.nextSibling,cn=Xt.firstChild,Jt=Xt.nextSibling,ft=Jt.firstChild;return pe.addEventListener("submit",Ne=>void Ze(Ne)),x(Le,()=>_("chat.customSlashCommandScope"),ct),x(Le,f(q,{get when(){return X()},get fallback(){return(()=>{var Ne=VP();return x(Ne,(()=>{var kt=Q(()=>m()==="project");return()=>kt()?_("chat.slashCommandScopeProject"):_("chat.slashCommandScopeGlobal")})()),Ne})()},get children(){return f(Xn,{get value(){return m()},onChange:Ne=>y(Ne),class:"flex items-center gap-4",get children(){return f(ot,{get each(){return[{value:"project",label:_("chat.slashCommandScopeProject")},{value:"global",label:_("chat.slashCommandScopeGlobal")}]},children:Ne=>f(hn,{get value(){return Ne.value},class:"flex items-center gap-1",get children(){return[f(gn,{}),f(_n,{class:"h-3 w-3"}),f(pn,{class:"cursor-pointer text-sm font-normal",get children(){return Ne.label}})]}})})}})}}),ct),x(ct,(()=>{var Ne=Q(()=>m()==="project");return()=>Ne()?_("chat.customSlashCommandScopeProjectHint"):_("chat.customSlashCommandScopeGlobalHint")})()),x(St,()=>_("chat.customSlashCommandName"),null),x(St,f(zn,{id:"chat-custom-command-name",get value(){return a()},get placeholder(){return _("chat.customSlashCommandNamePlaceholder")},onInput:Ne=>{u(Ne.currentTarget.value),b(null)},required:!0}),null),x(Rt,()=>_("chat.customSlashCommandDescription"),null),x(Rt,f(zn,{id:"chat-custom-command-description",get value(){return c()},get placeholder(){return _("chat.customSlashCommandDescriptionPlaceholder")},onInput:Ne=>l(Ne.currentTarget.value)}),null),x(Xt,()=>_("chat.customSlashCommandHiddenPrompt"),cn),x(Xt,f(ua,{id:"chat-custom-command-hidden-prompt",get value(){return d()},get placeholder(){return _("chat.customSlashCommandHiddenPromptPlaceholder")},minRows:mh,maxRows:bh,onInput:Ne=>g(Ne.currentTarget.value)}),cn),x(cn,()=>_("chat.customSlashCommandHiddenPromptHint")),x(Jt,()=>_("chat.customSlashCommandPrefill"),ft),x(Jt,f(ua,{id:"chat-custom-command-prefill",get value(){return p()},get placeholder(){return _("chat.customSlashCommandPrefillPlaceholder")},minRows:mh,maxRows:bh,onInput:Ne=>h(Ne.currentTarget.value)}),ft),x(ft,()=>_("chat.customSlashCommandPrefillHint")),x(pe,f(q,{get when(){return v()},get children(){var Ne=PP();return x(Ne,v),Ne}}),null),x(pe,f(Sr,{get children(){return[f(Ee,{type:"button",variant:"outline",onClick:()=>s(!1),get disabled(){return w()},get children(){return _("common.cancel")}}),f(Ee,{type:"submit",get disabled(){return!a().trim()||w()},get children(){return Q(()=>!!w())()?_("common.saving"):_("chat.saveCustomSlashCommand")}})]}}),null),pe})()]}})}}),null),x(U,f(Qt,{get open(){return T()!==null},onOpenChange:pe=>!pe&&!A()&&S(null),get children(){return f(rr,{class:"max-w-sm",get children(){return[f(ir,{get children(){return[f(or,{get children(){return _("chat.deleteSlashCommandTitle")}}),f(qa,{get children(){return _("chat.deleteSlashCommandConfirm",{name:yh(T()?.value??"")})}})]}}),f(Sr,{get children(){return[f(Ee,{variant:"outline",onClick:()=>S(null),get disabled(){return A()},get children(){return _("common.cancel")}}),f(Ee,{variant:"destructive",onClick:()=>void _e(),get disabled(){return A()},get children(){return Q(()=>!!A())()?_("common.deleting"):_("common.confirmDelete")}})]}})]}})}}),null),Me(pe=>{var Le=`relative flex flex-col border-r bg-background text-base shrink-0 ${Ot()?"w-9 transition-[width] duration-150":""}`,ct=Ot()?void 0:{width:`${D()}px`},St=`flex items-center border-b ${Ot()?"justify-center py-2":"justify-between px-2.5 py-2"}`;return Le!==pe.e&&xt(U,pe.e=Le),pe.t=Vo(U,ct,pe.t),St!==pe.a&&xt(ie,pe.a=St),pe},{e:void 0,t:void 0,a:void 0}),U})()};jt(["click","keydown","mousedown"]);const Jy=["newSpec","toggleSpecDetailFullscreen","projectSettings","globalSettings"],Er={newSpec:"Ctrl+Shift+N",toggleSpecDetailFullscreen:"Ctrl+Shift+F",projectSettings:"Ctrl+Shift+S",globalSettings:"Ctrl+Shift+G"},pL=new Set(["Control","Shift","Alt","Meta"]);function Ps(e){if(!e)return null;const t=e.split("+").map(r=>r.trim()).filter(Boolean),n={key:""};for(const r of t){const o=r.toLowerCase();o==="ctrl"||o==="control"?n.ctrl=!0:o==="shift"?n.shift=!0:o==="alt"||o==="option"?n.alt=!0:o==="meta"||o==="cmd"||o==="command"?n.meta=!0:n.key=Md(r)}return n.key?ev(n):null}function Qy(e){if(pL.has(e.key))return null;const t=Md(e.key);return t?ev({key:t,ctrl:e.ctrlKey,shift:e.shiftKey,alt:e.altKey,meta:e.metaKey}):null}function ha(e){return{newSpec:Ps(e?.newSpec)??Er.newSpec,toggleSpecDetailFullscreen:Ps(e?.toggleSpecDetailFullscreen)??Er.toggleSpecDetailFullscreen,projectSettings:Ps(e?.projectSettings)??Er.projectSettings,globalSettings:Ps(e?.globalSettings)??Er.globalSettings}}function vh(e){const t=ha(e),n=new Map,r=new Set;for(const o of Jy){const i=t[o],s=n.get(i);s?(r.add(s),r.add(o)):n.set(i,o)}return[...r]}function hL(e){if(!(e instanceof HTMLElement))return!1;if(e.isContentEditable)return!0;const t=e.tagName.toLowerCase();if(t==="textarea"||t==="select")return!0;if(t!=="input")return!1;const r=e.type.toLowerCase();return!["button","checkbox","radio","submit","reset","file","color"].includes(r)}function ev(e){const t=[];return e.ctrl&&t.push("Ctrl"),e.shift&&t.push("Shift"),e.alt&&t.push("Alt"),e.meta&&t.push("Meta"),t.push(Md(e.key)),t.join("+")}function Md(e){return e.length===1?e.toUpperCase():e===" "?"Space":e.startsWith("Arrow")?e:e.slice(0,1).toUpperCase()+e.slice(1)}var mL=$("<span>"),bL=$('<span class="text-xs font-normal text-muted-foreground">'),yL=$('<p class="m-0 text-sm text-destructive">'),vL=$('<div class="flex flex-col gap-4"><fieldset class="m-0 grid gap-3 border-0 p-0 sm:grid-cols-3"></fieldset><fieldset class="m-0 flex flex-col gap-3 border-0 p-0"><legend class=font-medium></legend><div class="flex flex-wrap items-center gap-x-6 gap-y-2"></div></fieldset><fieldset class="m-0 flex flex-col gap-2 border-0 p-0"><legend class=font-medium></legend><div class="flex flex-col gap-2">'),wL=$("<p class=text-muted-foreground>"),xL=$('<div class="grid grid-cols-[minmax(0,1fr)_auto_auto] items-center gap-2 rounded-md border p-2"><div class=min-w-0><p class="m-0 font-medium"></p><p>'),_L=$("<p class=text-destructive>");const EL={claude:"projectConfig.agentClaude",opencode:"projectConfig.agentOpencode",codex:"projectConfig.agentCodex",pi:"projectConfig.agentPi"},CL=e=>{const[t,n]=I("claude"),[r,o]=I([]),[i,s]=I(""),[a,u]=I(""),[c,l]=I({models:[],defaultReasoningEfforts:[]}),[d,g]=I(!1),[p,h]=I(!1),[m,y]=I(!1),[v,b]=I("system-default"),[w,E]=I({}),[C,k]=I(null),[T,S]=I(!1),[A,F]=I("idle"),[O,P]=I(null);let L=0,D=0;const B=Uy(),N=ne(()=>new Set(vh(w())));let Y;ae(()=>{const se=++D;e.open&&(P(null),j(),F("idle"),S(!0),(async()=>{try{if(await B.whenIdle(),se!==D||!e.open)return;const[xe,Ce]=await Promise.all([we.getGlobalConfig(),we.listGlobalAgents().catch(()=>[])]);if(se!==D||!e.open)return;ce(xe),o(Ce),oe(xe.agent.defaultKind)}catch(xe){if(se!==D||!e.open)return;P(xe.message),ce(Ei)}finally{se===D&&S(!1)}})())});function ce(se){n(se.agent.defaultKind),s(se.agent.model??""),u(se.agent.reasoningEffort??""),h(!!se.notifications.sessionEnd.banner),y(!!se.notifications.sessionEnd.sound),b(se.power?.inhibitWhenRunning??"system-default"),E(se.shortcuts??{}),k(null)}ae(()=>{const se=C();if(!se)return;const xe=Ce=>{if(Ce.preventDefault(),Ce.stopPropagation(),Ce.key==="Escape"){k(null);return}if(Ce.key==="Backspace"||Ce.key==="Delete"){const Ye={...w(),[se]:null};E(Ye),k(null),V({shortcuts:Ye});return}const We=Qy(Ce);if(!We)return;const it={...w(),[se]:We};E(it),k(null),V({shortcuts:it})};window.addEventListener("keydown",xe,!0),ue(()=>window.removeEventListener("keydown",xe,!0))});async function V(se){P(null);const xe=se.shortcuts??w();if(vh(xe).length>0){P(_("globalConfig.shortcutConflict"));return}j(),F("saving");const Ce=se.agent?se.agent.model:i()||void 0,We=se.agent?se.agent.reasoningEffort:a()||void 0,it={agent:{defaultKind:se.agent?.defaultKind??t(),...Ce?{model:Ce}:{},...We?{reasoningEffort:We}:{}},notifications:{sessionEnd:{banner:se.notifications?.sessionEnd.banner??p(),sound:se.notifications?.sessionEnd.sound??m()},push:se.notifications?.push??En().notifications.push},shortcuts:xe,power:{inhibitWhenRunning:se.power?.inhibitWhenRunning??v()},appearance:En().appearance,customInstructions:En().customInstructions};await B.enqueue({task:()=>qy(it),onLatestSuccess:()=>{F("saved"),Y=setTimeout(()=>F("idle"),2e3)},onLatestError:Ye=>{F("idle"),P(Ye.message)}})}function j(){Y&&(clearTimeout(Y),Y=void 0)}ue(j);const he=()=>{const se=r().map(xe=>xe.id);return se.length>0?se:["claude","opencode","codex","pi"]};function K(se){const xe=r().find(We=>We.id===se);if(xe&&xe.source==="external")return xe.displayName;const Ce=EL[se];return Ce?_(Ce):xe?.displayName??se}function z(se){return _(`globalConfig.shortcuts.${se}`)}function J(se){return _(se==="prevent-display-sleep"?"globalConfig.powerPreventDisplaySleep":se==="keep-system-awake"?"globalConfig.powerKeepSystemAwake":"globalConfig.powerSystemDefault")}function re(se){return C()===se?_("globalConfig.shortcutRecording"):ha(w())[se]}function ve(se){const xe={...w(),[se]:null};E(xe),V({shortcuts:xe})}function Z(se){n(se),s(""),u(""),oe(se),V({agent:{defaultKind:se}})}function M(se){s(se),u(""),V({agent:{defaultKind:t(),...se?{model:se}:{}}})}function W(se){u(se),V({agent:{defaultKind:t(),...i()?{model:i()}:{},...se?{reasoningEffort:se}:{}}})}async function oe(se){const xe=++L;g(!0);try{const Ce=await we.listGlobalAgentModels(se);xe===L&&l(Ce)}catch{xe===L&&l({models:[],defaultReasoningEfforts:[]})}finally{xe===L&&g(!1)}}const te=()=>{const se=[{value:"",label:_("globalConfig.agentDefaultOption")},...c().models.map(xe=>({value:xe.id,label:xe.displayName}))];return i()&&!se.some(xe=>xe.value===i())&&se.push({value:i(),label:i()}),se},H=()=>{const se=i()?c().models.find(Ce=>Ce.id===i())?.reasoningEfforts??[]:c().defaultReasoningEfforts,xe=[{value:"",label:_("globalConfig.agentDefaultOption")},...se.map(Ce=>({value:Ce.id,label:Ce.displayName}))];return a()&&!xe.some(Ce=>Ce.value===a())&&xe.push({value:a(),label:a()}),xe};function de(se){h(se),V({notifications:{sessionEnd:{banner:se,sound:m()},push:En().notifications.push}})}function fe(se){y(se),V({notifications:{sessionEnd:{banner:p(),sound:se},push:En().notifications.push}})}function Ue(se){b(se),V({power:{inhibitWhenRunning:se}})}return f(Qt,{get open(){return e.open},onOpenChange:se=>!se&&e.onClose(),get children(){return f(rr,{class:"max-w-[560px]",get children(){return[f(ir,{get children(){return f(or,{class:"flex items-baseline gap-2",get children(){return[(()=>{var se=mL();return x(se,()=>_("globalConfig.title")),se})(),f(q,{get when(){return A()!=="idle"},get children(){var se=bL();return x(se,(()=>{var xe=Q(()=>A()==="saving");return()=>xe()?_("globalConfig.saveStatusSaving"):_("globalConfig.saveStatusSaved")})()),se}})]}})}}),f(q,{get when(){return!T()},get fallback(){return(()=>{var se=wL();return x(se,()=>_("common.loading")),se})()},get children(){var se=vL(),xe=se.firstChild,Ce=xe.nextSibling,We=Ce.firstChild,it=We.nextSibling,Ye=Ce.nextSibling,Ct=Ye.firstChild,Ot=Ct.nextSibling;return x(xe,f(Go,{get label(){return _("globalConfig.agentDefault")},get value(){return t()},get options(){return he().map(Pe=>({value:Pe,label:K(Pe)}))},onChange:Z}),null),x(xe,f(Go,{get label(){return _("globalConfig.model")},get value(){return i()},get options(){return te()},get searchable(){return c().models.length>10},get filterPlaceholder(){return _("common.filterOptions")},get emptyText(){return _("common.noMatchingOptions")},get disabled(){return d()||te().length<=1},onChange:M}),null),x(xe,f(Go,{get label(){return _("globalConfig.reasoningEffort")},get value(){return a()},get options(){return H()},get disabled(){return d()||H().length<=1},onChange:W}),null),x(We,()=>_("globalConfig.sessionEnd")),x(it,f(Jo,{get checked(){return p()},onChange:de,class:"flex items-center gap-2",get children(){return[f(Qo,{}),f(zi,{get children(){return _("globalConfig.banner")}})]}}),null),x(it,f(Jo,{get checked(){return m()},onChange:fe,class:"flex items-center gap-2",get children(){return[f(Qo,{}),f(zi,{get children(){return _("globalConfig.sound")}})]}}),null),x(se,f(Xn,{class:"m-0 flex flex-wrap gap-2 border-0 p-0",get value(){return v()},onChange:Pe=>Ue(Pe),get children(){return[f(vd,{class:"mb-1.5 w-full font-medium",get children(){return _("globalConfig.powerTitle")}}),Q(()=>["system-default","prevent-display-sleep","keep-system-awake"].map(Pe=>f(hn,{value:Pe,class:"flex items-center gap-1.5",get children(){return[f(gn,{}),f(_n,{}),f(pn,{class:"cursor-pointer",get children(){return J(Pe)}})]}})))]}}),Ye),x(Ct,()=>_("globalConfig.shortcutsTitle")),x(Ot,f(ot,{each:Jy,children:Pe=>(()=>{var mt=xL(),It=mt.firstChild,un=It.firstChild,Dn=un.nextSibling;return x(un,()=>z(Pe)),x(Dn,()=>re(Pe)),x(mt,f(Ee,{type:"button",variant:"outline",size:"sm",onClick:()=>k(Pe),get children(){return Q(()=>C()===Pe)()?_("globalConfig.shortcutRecordingButton"):_("globalConfig.shortcutRecord")}}),null),x(mt,f(Ee,{type:"button",variant:"ghost",size:"sm",onClick:()=>ve(Pe),get disabled(){return re(Pe)===Er[Pe]},get children(){return _("globalConfig.shortcutReset")}}),null),Me(()=>xt(Dn,`m-0 font-mono text-sm ${N().has(Pe)?"text-destructive":"text-muted-foreground"}`)),mt})()})),x(Ye,f(q,{get when(){return N().size>0},get children(){var Pe=yL();return x(Pe,()=>_("globalConfig.shortcutConflict")),Pe}}),null),x(se,(()=>{var Pe=Q(()=>!!O());return()=>Pe()&&(()=>{var mt=_L();return x(mt,O),mt})()})(),null),se}})]}})}})},[wh,SL]=I(!0);function kL(){const e=hE(SL);ue(e)}const AL=200,TL=8e3;async function DL({id:e,list:t,intervalMs:n=AL,timeoutMs:r=TL,sleep:o=IL}){const i=Math.max(1,n),s=Math.max(1,Math.ceil(r/i)+1);for(let a=0;a<s;a++){try{if(!(await t()).some(c=>c.id===e))return!0}catch{}a<s-1&&await o(i)}return!1}function IL(e){return new Promise(t=>window.setTimeout(t,e))}var RL=$('<span class="absolute right-2 top-2 h-2 w-2 rounded-full bg-destructive">'),OL=$('<div class="border-b px-3 py-2">'),NL=$('<div class="rounded-md px-2 py-2 text-sm"><div class="flex items-center gap-3"><div class="min-w-0 flex-1"><div class="font-medium text-destructive"></div><p class="mt-1 text-xs leading-5 text-muted-foreground"> <code class="rounded bg-muted px-1 py-0.5 font-mono text-foreground">yorz serve start'),ML=$('<div class="max-h-96 overflow-auto p-2">'),PL=$('<div class="rounded-md px-2 py-2 text-sm"><div class="flex items-center gap-3"><div class="min-w-0 flex-1"><div class=font-medium></div><p class="mt-1 text-xs leading-5 text-muted-foreground"></p></div><div class="flex shrink-0 items-center gap-1 self-center">');function LL(){const[e,t]=I([]),[n,r]=I(null);kL();async function o(){try{t(await we.listSystemNotifications())}catch{}}ae(()=>{o();const u=pE(()=>void o());ue(u)});async function i(u){r(u);try{await we.deleteSystemNotification(u),await o()}finally{r(null)}}async function s(u){r(u);try{await we.updateSystemNotification(u),await o()}finally{r(null)}}async function a(u){r(u);try{await we.restartSystemNotification(u),t(c=>c.filter(l=>l.id!==u)),await DL({id:u,list:we.listSystemNotifications}),window.location.reload()}finally{r(null)}}return f(q,{get when(){return e().length>0||!wh()},get children(){return f(Zo,{placement:"bottom-start",get children(){return[f(Yo,{as:Ee,variant:"ghost",size:"icon",class:"relative h-8 w-8",get title(){return _("systemNotifications.title")},get children(){return[f(Zx,{class:"h-4 w-4"}),RL()]}}),f(Xo,{class:"w-[26rem] max-w-[calc(100vw-2rem)] p-0",get children(){return[(()=>{var u=OL();return x(u,f(G1,{class:"text-sm font-semibold",get children(){return _("systemNotifications.title")}})),u})(),(()=>{var u=ML();return x(u,f(q,{get when(){return!wh()},get children(){var c=NL(),l=c.firstChild,d=l.firstChild,g=d.firstChild,p=g.nextSibling,h=p.firstChild;return x(g,()=>_("systemNotifications.disconnectedTitle")),x(p,()=>_("systemNotifications.disconnectedMessage"),h),c}}),null),x(u,f(ot,{get each(){return e()},children:c=>(()=>{var l=PL(),d=l.firstChild,g=d.firstChild,p=g.firstChild,h=p.nextSibling,m=g.nextSibling;return x(p,()=>$L(c)),x(h,()=>FL(c)),x(m,f(q,{get when(){return c.kind==="version-update"},get children(){return f(q,{get when(){return c.action==="restart-ready"},get fallback(){return f(Ee,{variant:"ghost",size:"sm",class:"h-7 px-2 hover:bg-primary hover:text-primary-foreground",get disabled(){return n()===c.id||c.action==="updating"},onClick:()=>void s(c.id),get children(){return f(q,{get when(){return n()===c.id||c.action==="updating"},get fallback(){return _("systemNotifications.update")},get children(){return[f(A2,{class:"mr-1 h-3.5 w-3.5 animate-spin"}),Q(()=>_("systemNotifications.updating"))]}})}})},get children(){return f(bd,{openDelay:150,closeDelay:0,get children(){return[f(md,{as:Ee,variant:"ghost",size:"sm",class:"h-7 px-2 hover:bg-primary hover:text-primary-foreground",get disabled(){return n()===c.id},onClick:()=>void a(c.id),get children(){return _("systemNotifications.restart")}}),f(yd,{get children(){return _("systemNotifications.restartTooltip")}})]}})}})}}),null),x(m,f(Ee,{variant:"ghost",size:"icon",class:"h-7 w-7 shrink-0 text-destructive hover:bg-destructive/10 hover:text-destructive",get title(){return _("systemNotifications.delete")},get disabled(){return n()===c.id},onClick:()=>void i(c.id),get children(){return f(Ll,{class:"h-4 w-4"})}}),null),l})()}),null),u})()]}})]}})}})}function $L(e){return e.kind==="version-update"?_("systemNotifications.versionTitle"):e.title}function FL(e){return e.kind!=="version-update"?e.message:_("systemNotifications.versionMessage",{current:e.metadata?.currentVersion??"",latest:e.metadata?.latestVersion??""})}var Lo={},_c,xh;function BL(){return xh||(xh=1,_c=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then}),_c}var Ec={},$r={},_h;function Eo(){if(_h)return $r;_h=1;let e;const t=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];return $r.getSymbolSize=function(r){if(!r)throw new Error('"version" cannot be null or undefined');if(r<1||r>40)throw new Error('"version" should be in range from 1 to 40');return r*4+17},$r.getSymbolTotalCodewords=function(r){return t[r]},$r.getBCHDigit=function(n){let r=0;for(;n!==0;)r++,n>>>=1;return r},$r.setToSJISFunction=function(r){if(typeof r!="function")throw new Error('"toSJISFunc" is not a valid function.');e=r},$r.isKanjiModeEnabled=function(){return typeof e<"u"},$r.toSJIS=function(r){return e(r)},$r}var Cc={},Eh;function Pd(){return Eh||(Eh=1,(function(e){e.L={bit:1},e.M={bit:0},e.Q={bit:3},e.H={bit:2};function t(n){if(typeof n!="string")throw new Error("Param is not a string");switch(n.toLowerCase()){case"l":case"low":return e.L;case"m":case"medium":return e.M;case"q":case"quartile":return e.Q;case"h":case"high":return e.H;default:throw new Error("Unknown EC Level: "+n)}}e.isValid=function(r){return r&&typeof r.bit<"u"&&r.bit>=0&&r.bit<4},e.from=function(r,o){if(e.isValid(r))return r;try{return t(r)}catch{return o}}})(Cc)),Cc}var Sc,Ch;function zL(){if(Ch)return Sc;Ch=1;function e(){this.buffer=[],this.length=0}return e.prototype={get:function(t){const n=Math.floor(t/8);return(this.buffer[n]>>>7-t%8&1)===1},put:function(t,n){for(let r=0;r<n;r++)this.putBit((t>>>n-r-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(t){const n=Math.floor(this.length/8);this.buffer.length<=n&&this.buffer.push(0),t&&(this.buffer[n]|=128>>>this.length%8),this.length++}},Sc=e,Sc}var kc,Sh;function UL(){if(Sh)return kc;Sh=1;function e(t){if(!t||t<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=t,this.data=new Uint8Array(t*t),this.reservedBit=new Uint8Array(t*t)}return e.prototype.set=function(t,n,r,o){const i=t*this.size+n;this.data[i]=r,o&&(this.reservedBit[i]=!0)},e.prototype.get=function(t,n){return this.data[t*this.size+n]},e.prototype.xor=function(t,n,r){this.data[t*this.size+n]^=r},e.prototype.isReserved=function(t,n){return this.reservedBit[t*this.size+n]},kc=e,kc}var Ac={},kh;function KL(){return kh||(kh=1,(function(e){const t=Eo().getSymbolSize;e.getRowColCoords=function(r){if(r===1)return[];const o=Math.floor(r/7)+2,i=t(r),s=i===145?26:Math.ceil((i-13)/(2*o-2))*2,a=[i-7];for(let u=1;u<o-1;u++)a[u]=a[u-1]-s;return a.push(6),a.reverse()},e.getPositions=function(r){const o=[],i=e.getRowColCoords(r),s=i.length;for(let a=0;a<s;a++)for(let u=0;u<s;u++)a===0&&u===0||a===0&&u===s-1||a===s-1&&u===0||o.push([i[a],i[u]]);return o}})(Ac)),Ac}var Tc={},Ah;function jL(){if(Ah)return Tc;Ah=1;const e=Eo().getSymbolSize,t=7;return Tc.getPositions=function(r){const o=e(r);return[[0,0],[o-t,0],[0,o-t]]},Tc}var Dc={},Th;function qL(){return Th||(Th=1,(function(e){e.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};const t={N1:3,N2:3,N3:40,N4:10};e.isValid=function(o){return o!=null&&o!==""&&!isNaN(o)&&o>=0&&o<=7},e.from=function(o){return e.isValid(o)?parseInt(o,10):void 0},e.getPenaltyN1=function(o){const i=o.size;let s=0,a=0,u=0,c=null,l=null;for(let d=0;d<i;d++){a=u=0,c=l=null;for(let g=0;g<i;g++){let p=o.get(d,g);p===c?a++:(a>=5&&(s+=t.N1+(a-5)),c=p,a=1),p=o.get(g,d),p===l?u++:(u>=5&&(s+=t.N1+(u-5)),l=p,u=1)}a>=5&&(s+=t.N1+(a-5)),u>=5&&(s+=t.N1+(u-5))}return s},e.getPenaltyN2=function(o){const i=o.size;let s=0;for(let a=0;a<i-1;a++)for(let u=0;u<i-1;u++){const c=o.get(a,u)+o.get(a,u+1)+o.get(a+1,u)+o.get(a+1,u+1);(c===4||c===0)&&s++}return s*t.N2},e.getPenaltyN3=function(o){const i=o.size;let s=0,a=0,u=0;for(let c=0;c<i;c++){a=u=0;for(let l=0;l<i;l++)a=a<<1&2047|o.get(c,l),l>=10&&(a===1488||a===93)&&s++,u=u<<1&2047|o.get(l,c),l>=10&&(u===1488||u===93)&&s++}return s*t.N3},e.getPenaltyN4=function(o){let i=0;const s=o.data.length;for(let u=0;u<s;u++)i+=o.data[u];return Math.abs(Math.ceil(i*100/s/5)-10)*t.N4};function n(r,o,i){switch(r){case e.Patterns.PATTERN000:return(o+i)%2===0;case e.Patterns.PATTERN001:return o%2===0;case e.Patterns.PATTERN010:return i%3===0;case e.Patterns.PATTERN011:return(o+i)%3===0;case e.Patterns.PATTERN100:return(Math.floor(o/2)+Math.floor(i/3))%2===0;case e.Patterns.PATTERN101:return o*i%2+o*i%3===0;case e.Patterns.PATTERN110:return(o*i%2+o*i%3)%2===0;case e.Patterns.PATTERN111:return(o*i%3+(o+i)%2)%2===0;default:throw new Error("bad maskPattern:"+r)}}e.applyMask=function(o,i){const s=i.size;for(let a=0;a<s;a++)for(let u=0;u<s;u++)i.isReserved(u,a)||i.xor(u,a,n(o,u,a))},e.getBestMask=function(o,i){const s=Object.keys(e.Patterns).length;let a=0,u=1/0;for(let c=0;c<s;c++){i(c),e.applyMask(c,o);const l=e.getPenaltyN1(o)+e.getPenaltyN2(o)+e.getPenaltyN3(o)+e.getPenaltyN4(o);e.applyMask(c,o),l<u&&(u=l,a=c)}return a}})(Dc)),Dc}var Ls={},Dh;function tv(){if(Dh)return Ls;Dh=1;const e=Pd(),t=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],n=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];return Ls.getBlocksCount=function(o,i){switch(i){case e.L:return t[(o-1)*4+0];case e.M:return t[(o-1)*4+1];case e.Q:return t[(o-1)*4+2];case e.H:return t[(o-1)*4+3];default:return}},Ls.getTotalCodewordsCount=function(o,i){switch(i){case e.L:return n[(o-1)*4+0];case e.M:return n[(o-1)*4+1];case e.Q:return n[(o-1)*4+2];case e.H:return n[(o-1)*4+3];default:return}},Ls}var Ic={},pi={},Ih;function HL(){if(Ih)return pi;Ih=1;const e=new Uint8Array(512),t=new Uint8Array(256);return(function(){let r=1;for(let o=0;o<255;o++)e[o]=r,t[r]=o,r<<=1,r&256&&(r^=285);for(let o=255;o<512;o++)e[o]=e[o-255]})(),pi.log=function(r){if(r<1)throw new Error("log("+r+")");return t[r]},pi.exp=function(r){return e[r]},pi.mul=function(r,o){return r===0||o===0?0:e[t[r]+t[o]]},pi}var Rh;function GL(){return Rh||(Rh=1,(function(e){const t=HL();e.mul=function(r,o){const i=new Uint8Array(r.length+o.length-1);for(let s=0;s<r.length;s++)for(let a=0;a<o.length;a++)i[s+a]^=t.mul(r[s],o[a]);return i},e.mod=function(r,o){let i=new Uint8Array(r);for(;i.length-o.length>=0;){const s=i[0];for(let u=0;u<o.length;u++)i[u]^=t.mul(o[u],s);let a=0;for(;a<i.length&&i[a]===0;)a++;i=i.slice(a)}return i},e.generateECPolynomial=function(r){let o=new Uint8Array([1]);for(let i=0;i<r;i++)o=e.mul(o,new Uint8Array([1,t.exp(i)]));return o}})(Ic)),Ic}var Rc,Oh;function VL(){if(Oh)return Rc;Oh=1;const e=GL();function t(n){this.genPoly=void 0,this.degree=n,this.degree&&this.initialize(this.degree)}return t.prototype.initialize=function(r){this.degree=r,this.genPoly=e.generateECPolynomial(this.degree)},t.prototype.encode=function(r){if(!this.genPoly)throw new Error("Encoder not initialized");const o=new Uint8Array(r.length+this.degree);o.set(r);const i=e.mod(o,this.genPoly),s=this.degree-i.length;if(s>0){const a=new Uint8Array(this.degree);return a.set(i,s),a}return i},Rc=t,Rc}var Oc={},Nc={},Mc={},Nh;function nv(){return Nh||(Nh=1,Mc.isValid=function(t){return!isNaN(t)&&t>=1&&t<=40}),Mc}var Vn={},Mh;function rv(){if(Mh)return Vn;Mh=1;const e="[0-9]+",t="[A-Z $%*+\\-./:]+";let n="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";n=n.replace(/u/g,"\\u");const r="(?:(?![A-Z0-9 $%*+\\-./:]|"+n+`)(?:.|[\r
|
|
35
|
+
]))+`;Vn.KANJI=new RegExp(n,"g"),Vn.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),Vn.BYTE=new RegExp(r,"g"),Vn.NUMERIC=new RegExp(e,"g"),Vn.ALPHANUMERIC=new RegExp(t,"g");const o=new RegExp("^"+n+"$"),i=new RegExp("^"+e+"$"),s=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");return Vn.testKanji=function(u){return o.test(u)},Vn.testNumeric=function(u){return i.test(u)},Vn.testAlphanumeric=function(u){return s.test(u)},Vn}var Ph;function Co(){return Ph||(Ph=1,(function(e){const t=nv(),n=rv();e.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},e.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},e.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},e.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},e.MIXED={bit:-1},e.getCharCountIndicator=function(i,s){if(!i.ccBits)throw new Error("Invalid mode: "+i);if(!t.isValid(s))throw new Error("Invalid version: "+s);return s>=1&&s<10?i.ccBits[0]:s<27?i.ccBits[1]:i.ccBits[2]},e.getBestModeForData=function(i){return n.testNumeric(i)?e.NUMERIC:n.testAlphanumeric(i)?e.ALPHANUMERIC:n.testKanji(i)?e.KANJI:e.BYTE},e.toString=function(i){if(i&&i.id)return i.id;throw new Error("Invalid mode")},e.isValid=function(i){return i&&i.bit&&i.ccBits};function r(o){if(typeof o!="string")throw new Error("Param is not a string");switch(o.toLowerCase()){case"numeric":return e.NUMERIC;case"alphanumeric":return e.ALPHANUMERIC;case"kanji":return e.KANJI;case"byte":return e.BYTE;default:throw new Error("Unknown mode: "+o)}}e.from=function(i,s){if(e.isValid(i))return i;try{return r(i)}catch{return s}}})(Nc)),Nc}var Lh;function WL(){return Lh||(Lh=1,(function(e){const t=Eo(),n=tv(),r=Pd(),o=Co(),i=nv(),s=7973,a=t.getBCHDigit(s);function u(g,p,h){for(let m=1;m<=40;m++)if(p<=e.getCapacity(m,h,g))return m}function c(g,p){return o.getCharCountIndicator(g,p)+4}function l(g,p){let h=0;return g.forEach(function(m){const y=c(m.mode,p);h+=y+m.getBitsLength()}),h}function d(g,p){for(let h=1;h<=40;h++)if(l(g,h)<=e.getCapacity(h,p,o.MIXED))return h}e.from=function(p,h){return i.isValid(p)?parseInt(p,10):h},e.getCapacity=function(p,h,m){if(!i.isValid(p))throw new Error("Invalid QR Code version");typeof m>"u"&&(m=o.BYTE);const y=t.getSymbolTotalCodewords(p),v=n.getTotalCodewordsCount(p,h),b=(y-v)*8;if(m===o.MIXED)return b;const w=b-c(m,p);switch(m){case o.NUMERIC:return Math.floor(w/10*3);case o.ALPHANUMERIC:return Math.floor(w/11*2);case o.KANJI:return Math.floor(w/13);case o.BYTE:default:return Math.floor(w/8)}},e.getBestVersionForData=function(p,h){let m;const y=r.from(h,r.M);if(Array.isArray(p)){if(p.length>1)return d(p,y);if(p.length===0)return 1;m=p[0]}else m=p;return u(m.mode,m.getLength(),y)},e.getEncodedBits=function(p){if(!i.isValid(p)||p<7)throw new Error("Invalid QR Code version");let h=p<<12;for(;t.getBCHDigit(h)-a>=0;)h^=s<<t.getBCHDigit(h)-a;return p<<12|h}})(Oc)),Oc}var Pc={},$h;function YL(){if($h)return Pc;$h=1;const e=Eo(),t=1335,n=21522,r=e.getBCHDigit(t);return Pc.getEncodedBits=function(i,s){const a=i.bit<<3|s;let u=a<<10;for(;e.getBCHDigit(u)-r>=0;)u^=t<<e.getBCHDigit(u)-r;return(a<<10|u)^n},Pc}var Lc={},$c,Fh;function ZL(){if(Fh)return $c;Fh=1;const e=Co();function t(n){this.mode=e.NUMERIC,this.data=n.toString()}return t.getBitsLength=function(r){return 10*Math.floor(r/3)+(r%3?r%3*3+1:0)},t.prototype.getLength=function(){return this.data.length},t.prototype.getBitsLength=function(){return t.getBitsLength(this.data.length)},t.prototype.write=function(r){let o,i,s;for(o=0;o+3<=this.data.length;o+=3)i=this.data.substr(o,3),s=parseInt(i,10),r.put(s,10);const a=this.data.length-o;a>0&&(i=this.data.substr(o),s=parseInt(i,10),r.put(s,a*3+1))},$c=t,$c}var Fc,Bh;function XL(){if(Bh)return Fc;Bh=1;const e=Co(),t=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function n(r){this.mode=e.ALPHANUMERIC,this.data=r}return n.getBitsLength=function(o){return 11*Math.floor(o/2)+6*(o%2)},n.prototype.getLength=function(){return this.data.length},n.prototype.getBitsLength=function(){return n.getBitsLength(this.data.length)},n.prototype.write=function(o){let i;for(i=0;i+2<=this.data.length;i+=2){let s=t.indexOf(this.data[i])*45;s+=t.indexOf(this.data[i+1]),o.put(s,11)}this.data.length%2&&o.put(t.indexOf(this.data[i]),6)},Fc=n,Fc}var Bc,zh;function JL(){if(zh)return Bc;zh=1;const e=Co();function t(n){this.mode=e.BYTE,typeof n=="string"?this.data=new TextEncoder().encode(n):this.data=new Uint8Array(n)}return t.getBitsLength=function(r){return r*8},t.prototype.getLength=function(){return this.data.length},t.prototype.getBitsLength=function(){return t.getBitsLength(this.data.length)},t.prototype.write=function(n){for(let r=0,o=this.data.length;r<o;r++)n.put(this.data[r],8)},Bc=t,Bc}var zc,Uh;function QL(){if(Uh)return zc;Uh=1;const e=Co(),t=Eo();function n(r){this.mode=e.KANJI,this.data=r}return n.getBitsLength=function(o){return o*13},n.prototype.getLength=function(){return this.data.length},n.prototype.getBitsLength=function(){return n.getBitsLength(this.data.length)},n.prototype.write=function(r){let o;for(o=0;o<this.data.length;o++){let i=t.toSJIS(this.data[o]);if(i>=33088&&i<=40956)i-=33088;else if(i>=57408&&i<=60351)i-=49472;else throw new Error("Invalid SJIS character: "+this.data[o]+`
|
|
36
|
+
Make sure your charset is UTF-8`);i=(i>>>8&255)*192+(i&255),r.put(i,13)}},zc=n,zc}var Uc={exports:{}},Kh;function e$(){return Kh||(Kh=1,(function(e){var t={single_source_shortest_paths:function(n,r,o){var i={},s={};s[r]=0;var a=t.PriorityQueue.make();a.push(r,0);for(var u,c,l,d,g,p,h,m,y;!a.empty();){u=a.pop(),c=u.value,d=u.cost,g=n[c]||{};for(l in g)g.hasOwnProperty(l)&&(p=g[l],h=d+p,m=s[l],y=typeof s[l]>"u",(y||m>h)&&(s[l]=h,a.push(l,h),i[l]=c))}if(typeof o<"u"&&typeof s[o]>"u"){var v=["Could not find a path from ",r," to ",o,"."].join("");throw new Error(v)}return i},extract_shortest_path_from_predecessor_list:function(n,r){for(var o=[],i=r;i;)o.push(i),n[i],i=n[i];return o.reverse(),o},find_path:function(n,r,o){var i=t.single_source_shortest_paths(n,r,o);return t.extract_shortest_path_from_predecessor_list(i,o)},PriorityQueue:{make:function(n){var r=t.PriorityQueue,o={},i;n=n||{};for(i in r)r.hasOwnProperty(i)&&(o[i]=r[i]);return o.queue=[],o.sorter=n.sorter||r.default_sorter,o},default_sorter:function(n,r){return n.cost-r.cost},push:function(n,r){var o={value:n,cost:r};this.queue.push(o),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};e.exports=t})(Uc)),Uc.exports}var jh;function t$(){return jh||(jh=1,(function(e){const t=Co(),n=ZL(),r=XL(),o=JL(),i=QL(),s=rv(),a=Eo(),u=e$();function c(v){return unescape(encodeURIComponent(v)).length}function l(v,b,w){const E=[];let C;for(;(C=v.exec(w))!==null;)E.push({data:C[0],index:C.index,mode:b,length:C[0].length});return E}function d(v){const b=l(s.NUMERIC,t.NUMERIC,v),w=l(s.ALPHANUMERIC,t.ALPHANUMERIC,v);let E,C;return a.isKanjiModeEnabled()?(E=l(s.BYTE,t.BYTE,v),C=l(s.KANJI,t.KANJI,v)):(E=l(s.BYTE_KANJI,t.BYTE,v),C=[]),b.concat(w,E,C).sort(function(T,S){return T.index-S.index}).map(function(T){return{data:T.data,mode:T.mode,length:T.length}})}function g(v,b){switch(b){case t.NUMERIC:return n.getBitsLength(v);case t.ALPHANUMERIC:return r.getBitsLength(v);case t.KANJI:return i.getBitsLength(v);case t.BYTE:return o.getBitsLength(v)}}function p(v){return v.reduce(function(b,w){const E=b.length-1>=0?b[b.length-1]:null;return E&&E.mode===w.mode?(b[b.length-1].data+=w.data,b):(b.push(w),b)},[])}function h(v){const b=[];for(let w=0;w<v.length;w++){const E=v[w];switch(E.mode){case t.NUMERIC:b.push([E,{data:E.data,mode:t.ALPHANUMERIC,length:E.length},{data:E.data,mode:t.BYTE,length:E.length}]);break;case t.ALPHANUMERIC:b.push([E,{data:E.data,mode:t.BYTE,length:E.length}]);break;case t.KANJI:b.push([E,{data:E.data,mode:t.BYTE,length:c(E.data)}]);break;case t.BYTE:b.push([{data:E.data,mode:t.BYTE,length:c(E.data)}])}}return b}function m(v,b){const w={},E={start:{}};let C=["start"];for(let k=0;k<v.length;k++){const T=v[k],S=[];for(let A=0;A<T.length;A++){const F=T[A],O=""+k+A;S.push(O),w[O]={node:F,lastCount:0},E[O]={};for(let P=0;P<C.length;P++){const L=C[P];w[L]&&w[L].node.mode===F.mode?(E[L][O]=g(w[L].lastCount+F.length,F.mode)-g(w[L].lastCount,F.mode),w[L].lastCount+=F.length):(w[L]&&(w[L].lastCount=F.length),E[L][O]=g(F.length,F.mode)+4+t.getCharCountIndicator(F.mode,b))}}C=S}for(let k=0;k<C.length;k++)E[C[k]].end=0;return{map:E,table:w}}function y(v,b){let w;const E=t.getBestModeForData(v);if(w=t.from(b,E),w!==t.BYTE&&w.bit<E.bit)throw new Error('"'+v+'" cannot be encoded with mode '+t.toString(w)+`.
|
|
37
|
+
Suggested mode is: `+t.toString(E));switch(w===t.KANJI&&!a.isKanjiModeEnabled()&&(w=t.BYTE),w){case t.NUMERIC:return new n(v);case t.ALPHANUMERIC:return new r(v);case t.KANJI:return new i(v);case t.BYTE:return new o(v)}}e.fromArray=function(b){return b.reduce(function(w,E){return typeof E=="string"?w.push(y(E,null)):E.data&&w.push(y(E.data,E.mode)),w},[])},e.fromString=function(b,w){const E=d(b,a.isKanjiModeEnabled()),C=h(E),k=m(C,w),T=u.find_path(k.map,"start","end"),S=[];for(let A=1;A<T.length-1;A++)S.push(k.table[T[A]].node);return e.fromArray(p(S))},e.rawSplit=function(b){return e.fromArray(d(b,a.isKanjiModeEnabled()))}})(Lc)),Lc}var qh;function n$(){if(qh)return Ec;qh=1;const e=Eo(),t=Pd(),n=zL(),r=UL(),o=KL(),i=jL(),s=qL(),a=tv(),u=VL(),c=WL(),l=YL(),d=Co(),g=t$();function p(k,T){const S=k.size,A=i.getPositions(T);for(let F=0;F<A.length;F++){const O=A[F][0],P=A[F][1];for(let L=-1;L<=7;L++)if(!(O+L<=-1||S<=O+L))for(let D=-1;D<=7;D++)P+D<=-1||S<=P+D||(L>=0&&L<=6&&(D===0||D===6)||D>=0&&D<=6&&(L===0||L===6)||L>=2&&L<=4&&D>=2&&D<=4?k.set(O+L,P+D,!0,!0):k.set(O+L,P+D,!1,!0))}}function h(k){const T=k.size;for(let S=8;S<T-8;S++){const A=S%2===0;k.set(S,6,A,!0),k.set(6,S,A,!0)}}function m(k,T){const S=o.getPositions(T);for(let A=0;A<S.length;A++){const F=S[A][0],O=S[A][1];for(let P=-2;P<=2;P++)for(let L=-2;L<=2;L++)P===-2||P===2||L===-2||L===2||P===0&&L===0?k.set(F+P,O+L,!0,!0):k.set(F+P,O+L,!1,!0)}}function y(k,T){const S=k.size,A=c.getEncodedBits(T);let F,O,P;for(let L=0;L<18;L++)F=Math.floor(L/3),O=L%3+S-8-3,P=(A>>L&1)===1,k.set(F,O,P,!0),k.set(O,F,P,!0)}function v(k,T,S){const A=k.size,F=l.getEncodedBits(T,S);let O,P;for(O=0;O<15;O++)P=(F>>O&1)===1,O<6?k.set(O,8,P,!0):O<8?k.set(O+1,8,P,!0):k.set(A-15+O,8,P,!0),O<8?k.set(8,A-O-1,P,!0):O<9?k.set(8,15-O-1+1,P,!0):k.set(8,15-O-1,P,!0);k.set(A-8,8,1,!0)}function b(k,T){const S=k.size;let A=-1,F=S-1,O=7,P=0;for(let L=S-1;L>0;L-=2)for(L===6&&L--;;){for(let D=0;D<2;D++)if(!k.isReserved(F,L-D)){let B=!1;P<T.length&&(B=(T[P]>>>O&1)===1),k.set(F,L-D,B),O--,O===-1&&(P++,O=7)}if(F+=A,F<0||S<=F){F-=A,A=-A;break}}}function w(k,T,S){const A=new n;S.forEach(function(D){A.put(D.mode.bit,4),A.put(D.getLength(),d.getCharCountIndicator(D.mode,k)),D.write(A)});const F=e.getSymbolTotalCodewords(k),O=a.getTotalCodewordsCount(k,T),P=(F-O)*8;for(A.getLengthInBits()+4<=P&&A.put(0,4);A.getLengthInBits()%8!==0;)A.putBit(0);const L=(P-A.getLengthInBits())/8;for(let D=0;D<L;D++)A.put(D%2?17:236,8);return E(A,k,T)}function E(k,T,S){const A=e.getSymbolTotalCodewords(T),F=a.getTotalCodewordsCount(T,S),O=A-F,P=a.getBlocksCount(T,S),L=A%P,D=P-L,B=Math.floor(A/P),N=Math.floor(O/P),Y=N+1,ce=B-N,V=new u(ce);let j=0;const he=new Array(P),K=new Array(P);let z=0;const J=new Uint8Array(k.buffer);for(let W=0;W<P;W++){const oe=W<D?N:Y;he[W]=J.slice(j,j+oe),K[W]=V.encode(he[W]),j+=oe,z=Math.max(z,oe)}const re=new Uint8Array(A);let ve=0,Z,M;for(Z=0;Z<z;Z++)for(M=0;M<P;M++)Z<he[M].length&&(re[ve++]=he[M][Z]);for(Z=0;Z<ce;Z++)for(M=0;M<P;M++)re[ve++]=K[M][Z];return re}function C(k,T,S,A){let F;if(Array.isArray(k))F=g.fromArray(k);else if(typeof k=="string"){let B=T;if(!B){const N=g.rawSplit(k);B=c.getBestVersionForData(N,S)}F=g.fromString(k,B||40)}else throw new Error("Invalid data");const O=c.getBestVersionForData(F,S);if(!O)throw new Error("The amount of data is too big to be stored in a QR Code");if(!T)T=O;else if(T<O)throw new Error(`
|
|
38
|
+
The chosen QR Code version cannot contain this amount of data.
|
|
39
|
+
Minimum version required to store current data is: `+O+`.
|
|
40
|
+
`);const P=w(T,S,F),L=e.getSymbolSize(T),D=new r(L);return p(D,T),h(D),m(D,T),v(D,S,0),T>=7&&y(D,T),b(D,P),isNaN(A)&&(A=s.getBestMask(D,v.bind(null,D,S))),s.applyMask(A,D),v(D,S,A),{modules:D,version:T,errorCorrectionLevel:S,maskPattern:A,segments:F}}return Ec.create=function(T,S){if(typeof T>"u"||T==="")throw new Error("No input text");let A=t.M,F,O;return typeof S<"u"&&(A=t.from(S.errorCorrectionLevel,t.M),F=c.from(S.version),O=s.from(S.maskPattern),S.toSJISFunc&&e.setToSJISFunction(S.toSJISFunc)),C(T,F,A,O)},Ec}var Kc={},jc={},Hh;function ov(){return Hh||(Hh=1,(function(e){function t(n){if(typeof n=="number"&&(n=n.toString()),typeof n!="string")throw new Error("Color should be defined as hex string");let r=n.slice().replace("#","").split("");if(r.length<3||r.length===5||r.length>8)throw new Error("Invalid hex color: "+n);(r.length===3||r.length===4)&&(r=Array.prototype.concat.apply([],r.map(function(i){return[i,i]}))),r.length===6&&r.push("F","F");const o=parseInt(r.join(""),16);return{r:o>>24&255,g:o>>16&255,b:o>>8&255,a:o&255,hex:"#"+r.slice(0,6).join("")}}e.getOptions=function(r){r||(r={}),r.color||(r.color={});const o=typeof r.margin>"u"||r.margin===null||r.margin<0?4:r.margin,i=r.width&&r.width>=21?r.width:void 0,s=r.scale||4;return{width:i,scale:i?4:s,margin:o,color:{dark:t(r.color.dark||"#000000ff"),light:t(r.color.light||"#ffffffff")},type:r.type,rendererOpts:r.rendererOpts||{}}},e.getScale=function(r,o){return o.width&&o.width>=r+o.margin*2?o.width/(r+o.margin*2):o.scale},e.getImageWidth=function(r,o){const i=e.getScale(r,o);return Math.floor((r+o.margin*2)*i)},e.qrToImageData=function(r,o,i){const s=o.modules.size,a=o.modules.data,u=e.getScale(s,i),c=Math.floor((s+i.margin*2)*u),l=i.margin*u,d=[i.color.light,i.color.dark];for(let g=0;g<c;g++)for(let p=0;p<c;p++){let h=(g*c+p)*4,m=i.color.light;if(g>=l&&p>=l&&g<c-l&&p<c-l){const y=Math.floor((g-l)/u),v=Math.floor((p-l)/u);m=d[a[y*s+v]?1:0]}r[h++]=m.r,r[h++]=m.g,r[h++]=m.b,r[h]=m.a}}})(jc)),jc}var Gh;function r$(){return Gh||(Gh=1,(function(e){const t=ov();function n(o,i,s){o.clearRect(0,0,i.width,i.height),i.style||(i.style={}),i.height=s,i.width=s,i.style.height=s+"px",i.style.width=s+"px"}function r(){try{return document.createElement("canvas")}catch{throw new Error("You need to specify a canvas element")}}e.render=function(i,s,a){let u=a,c=s;typeof u>"u"&&(!s||!s.getContext)&&(u=s,s=void 0),s||(c=r()),u=t.getOptions(u);const l=t.getImageWidth(i.modules.size,u),d=c.getContext("2d"),g=d.createImageData(l,l);return t.qrToImageData(g.data,i,u),n(d,c,l),d.putImageData(g,0,0),c},e.renderToDataURL=function(i,s,a){let u=a;typeof u>"u"&&(!s||!s.getContext)&&(u=s,s=void 0),u||(u={});const c=e.render(i,s,u),l=u.type||"image/png",d=u.rendererOpts||{};return c.toDataURL(l,d.quality)}})(Kc)),Kc}var qc={},Vh;function o$(){if(Vh)return qc;Vh=1;const e=ov();function t(o,i){const s=o.a/255,a=i+'="'+o.hex+'"';return s<1?a+" "+i+'-opacity="'+s.toFixed(2).slice(1)+'"':a}function n(o,i,s){let a=o+i;return typeof s<"u"&&(a+=" "+s),a}function r(o,i,s){let a="",u=0,c=!1,l=0;for(let d=0;d<o.length;d++){const g=Math.floor(d%i),p=Math.floor(d/i);!g&&!c&&(c=!0),o[d]?(l++,d>0&&g>0&&o[d-1]||(a+=c?n("M",g+s,.5+p+s):n("m",u,0),u=0,c=!1),g+1<i&&o[d+1]||(a+=n("h",l),l=0)):u++}return a}return qc.render=function(i,s,a){const u=e.getOptions(s),c=i.modules.size,l=i.modules.data,d=c+u.margin*2,g=u.color.light.a?"<path "+t(u.color.light,"fill")+' d="M0 0h'+d+"v"+d+'H0z"/>':"",p="<path "+t(u.color.dark,"stroke")+' d="'+r(l,c,u.margin)+'"/>',h='viewBox="0 0 '+d+" "+d+'"',y='<svg xmlns="http://www.w3.org/2000/svg" '+(u.width?'width="'+u.width+'" height="'+u.width+'" ':"")+h+' shape-rendering="crispEdges">'+g+p+`</svg>
|
|
41
|
+
`;return typeof a=="function"&&a(null,y),y},qc}var Wh;function i$(){if(Wh)return Lo;Wh=1;const e=BL(),t=n$(),n=r$(),r=o$();function o(i,s,a,u,c){const l=[].slice.call(arguments,1),d=l.length,g=typeof l[d-1]=="function";if(!g&&!e())throw new Error("Callback required as last argument");if(g){if(d<2)throw new Error("Too few arguments provided");d===2?(c=a,a=s,s=u=void 0):d===3&&(s.getContext&&typeof c>"u"?(c=u,u=void 0):(c=u,u=a,a=s,s=void 0))}else{if(d<1)throw new Error("Too few arguments provided");return d===1?(a=s,s=u=void 0):d===2&&!s.getContext&&(u=a,a=s,s=void 0),new Promise(function(p,h){try{const m=t.create(a,u);p(i(m,s,u))}catch(m){h(m)}})}try{const p=t.create(a,u);c(null,i(p,s,u))}catch(p){c(p)}}return Lo.create=t.create,Lo.toCanvas=o.bind(null,n.render),Lo.toDataURL=o.bind(null,n.renderToDataURL),Lo.toString=o.bind(null,function(i,s,a){return r.render(i,a)}),Lo}var s$=i$();const a$=ls(s$);var u$=$('<p class="mb-3 text-xs text-muted-foreground">'),c$=$('<img class="h-44 w-44 rounded bg-white p-2">'),l$=$('<div class="flex flex-col items-center gap-3"><div class="font-mono text-lg tracking-widest"></div><button type=button class="text-xs text-muted-foreground underline">'),d$=$('<div class="py-10 text-center text-sm text-muted-foreground">'),f$=$('<div class="flex flex-col items-center gap-3 py-4"><p class="text-sm text-destructive">');function g$(){const[e,t]=I(!1),[n,r]=I(null),[o,i]=I(null),[s,a]=I(!1),[u,c]=I(!1),l=async()=>{c(!0),a(!1);try{const d=await we.getPairingCode();r(d.code);const g=await a$.toDataURL(d.code,{width:220,margin:1});i(g)}catch{a(!0),r(null),i(null)}finally{c(!1)}};return ae(()=>{e()&&l()}),f(Zo,{get open(){return e()},onOpenChange:t,get children(){return[f(Yo,{as:Ee,variant:"ghost",size:"icon",get title(){return _("pairing.title")},get children(){return f(x2,{class:"h-4 w-4"})}}),f(Xo,{class:"w-72",get children(){return[f(G1,{class:"mb-2 pr-6 text-sm font-semibold",get children(){return _("pairing.title")}}),(()=>{var d=u$();return x(d,()=>_("pairing.hint")),d})(),f(q,{get when(){return!u()},get fallback(){return(()=>{var d=d$();return x(d,()=>_("pairing.loading")),d})()},get children(){return f(q,{get when(){return!s()},get fallback(){return(()=>{var d=f$(),g=d.firstChild;return x(g,()=>_("pairing.error")),x(d,f(Ee,{size:"sm",variant:"outline",onClick:()=>void l(),get children(){return _("pairing.retry")}}),null),d})()},get children(){var d=l$(),g=d.firstChild,p=g.nextSibling;return x(d,f(q,{get when(){return o()},get children(){var h=c$();return Me(m=>{var y=o(),v=_("pairing.title");return y!==m.e&&Ke(h,"src",m.e=y),v!==m.t&&Ke(h,"alt",m.t=v),m},{e:void 0,t:void 0}),h}}),g),x(g,n),p.$$click=()=>void l(),x(p,()=>_("pairing.refresh")),d}})}})]}})]}})}jt(["click"]);function p$(e,t){return typeof t=="number"?t===0?null:t<0?"back":"forward":wN(e,zy(t))}var Yh=$('<div class="px-2 py-1 text-xs text-muted-foreground">'),h$=$('<div class="shrink-0 border-b border-destructive/40 bg-destructive/10 px-4 py-2 text-xs text-destructive">'),m$=$('<div class="flex h-full flex-col"><header class="flex h-12 shrink-0 items-center gap-2 border-b bg-card px-4"><div class="ml-auto flex items-center gap-2"></div></header><div class="flex min-h-0 flex-1"><main class="vt-page flex min-h-0 min-w-0 flex-1 flex-col overflow-auto">');const b$=[{mode:"system",labelKey:"shell.themeSystem",icon:Km},{mode:"light",labelKey:"shell.themeLight",icon:$2},{mode:"dark",labelKey:"shell.themeDark",icon:u2}],y$=[{name:"terminal",labelKey:"shell.themeTerminal"},{name:"graphite",labelKey:"shell.themeGraphite"},{name:"paper",labelKey:"shell.themePaper"}],v$="https://github.com/hughfenghen/YorZ/blob/main/docs",w$=e=>{const t=oi(),n=Wr();EN({resolveDirection:p$});const{lng:r,changeLanguage:o}=z1(),[i,s]=I(!1),a=ne(()=>t.pathname===Tt("specs/new")),u=ne(()=>`${v$}/${r().startsWith("en")?"User-Guide.md":"User-Guide-CN.md"}`);function c(m){m!==r()&&(o(m),Ci(y=>({...y,appearance:{...y.appearance,language:m}})))}function l(m){Nm(m),Ci(y=>({...y,appearance:{...y.appearance,themeMode:m}}))}function d(m){Ax(m),Ci(y=>({...y,appearance:{...y.appearance,themeName:m}}))}function g(){if(!wt())return;const m=Tt("specs/new");a()?window.open(m,"_blank","noopener"):n(m)}function p(m){const y=ha(En().shortcuts);if(m===y.newSpec)return g(),!0;if(m===y.projectSettings)return iE(),!0;if(m===y.globalSettings)return s(v=>!v),!0;if(m===y.toggleSpecDetailFullscreen){const v=oE();return v?(v(),!0):!1}return!1}const h=m=>{if(m.defaultPrevented)return;const y=Qy(m);if(!y)return;const v=ha(En().shortcuts),b=y===v.toggleSpecDetailFullscreen||y===v.projectSettings||y===v.globalSettings;hL(m.target)&&!b||y!==Er.newSpec&&y!==Er.projectSettings&&y!==Er.toggleSpecDetailFullscreen&&y!==Er.globalSettings&&!Object.values(En().shortcuts).includes(y)||p(y)&&m.preventDefault()};return Sn(()=>{MM(),window.addEventListener("keydown",h)}),ue(()=>window.removeEventListener("keydown",h)),ae(()=>{const m=t.pathname.match(/^\/([^/]+)/);eE(m&&m[1]!=="api"?m[1]:"")}),(()=>{var m=m$(),y=m.firstChild,v=y.firstChild,b=y.nextSibling,w=b.firstChild;return x(y,f(Nn,{href:"/",class:"text-lg font-bold",children:"YorZ"}),v),x(y,f(g$,{}),v),x(y,f(LL,{}),v),x(v,f(q,{get when(){return wt()},get children(){return f(Ee,{as:Nn,get href(){return Tt("specs/new")},get target(){return a()?"_blank":void 0},get rel(){return a()?"noopener":void 0},variant:"default",size:"sm",get children(){return[f(jr,{class:"mr-1 h-4 w-4"}),Q(()=>_("shell.newSpec"))]}})}}),null),x(v,f(pd,{placement:"bottom-end",get children(){return[f(gd,{as:Ee,variant:"ghost",size:"icon",get title(){return _("shell.settingsMenu")},get children(){return f(e2,{class:"h-4 w-4"})}}),f(hd,{get children(){return[f(gg,{get children(){return[f(pg,{"data-submenu":"language",get children(){return[f(G_,{class:"mr-2 h-4 w-4"}),Q(()=>_("shell.languageSwitch"))]}}),f(hg,{get children(){return[f(Yn,{onSelect:()=>c("zh-CN"),get children(){return[f(bi,{get class(){return`mr-2 h-4 w-4 ${r()==="zh-CN"?"opacity-100":"opacity-0"}`}}),Q(()=>_("shell.langZh"))]}}),f(Yn,{onSelect:()=>c("en"),get children(){return[f(bi,{get class(){return`mr-2 h-4 w-4 ${r()==="en"?"opacity-100":"opacity-0"}`}}),Q(()=>_("shell.langEn"))]}})]}})]}}),f(gg,{get children(){return[f(pg,{"data-submenu":"theme",get children(){return[f(d2,{class:"mr-2 h-4 w-4"}),Q(()=>_("shell.themeSwitch"))]}}),f(hg,{get children(){return[(()=>{var E=Yh();return x(E,()=>_("shell.themeModeGroup")),E})(),f(ot,{each:b$,children:E=>f(Yn,{get"data-theme-option"(){return E.mode},onSelect:()=>l(E.mode),get children(){return[f(bi,{get class(){return`mr-2 h-4 w-4 ${ea()===E.mode?"opacity-100":"opacity-0"}`}}),f(E.icon,{class:"mr-2 h-4 w-4 text-muted-foreground"}),Q(()=>_(E.labelKey))]}})}),f(pl,{}),(()=>{var E=Yh();return x(E,()=>_("shell.themeNameGroup")),E})(),f(ot,{each:y$,children:E=>f(Yn,{get"data-theme-name-option"(){return E.name},onSelect:()=>d(E.name),get children(){return[f(bi,{get class(){return`mr-2 h-4 w-4 ${ta()===E.name?"opacity-100":"opacity-0"}`}}),Q(()=>_(E.labelKey))]}})})]}})]}}),f(pl,{}),f(Yn,{onSelect:()=>s(!0),get children(){return[f(O2,{class:"mr-2 h-4 w-4"}),Q(()=>_("shell.globalConfig"))]}}),f(Yn,{as:"a","data-menu-item":"user-guide",get href(){return u()},target:"_blank",rel:"noopener noreferrer",get children(){return[f(Qx,{class:"mr-2 h-4 w-4"}),Q(()=>_("shell.userGuide"))]}})]}})]}}),null),x(m,f(q,{get when(){return Nx()},get children(){var E=h$();return x(E,()=>_("pairing.unauthorized")),E}}),b),x(b,f(mM,{}),w),x(b,f(gL,{}),w),x(w,()=>e.children),x(m,f(K3,{position:"top-center"}),null),x(m,f(CL,{get open(){return i()},onClose:()=>s(!1)}),null),m})()};Dx({persistHint:!1});Lx();const iv=document.getElementById("app");if(!iv)throw new Error("missing #app root");Bv(()=>f(kw,{root:w$,get children(){return[f(hr,{path:"/",component:bN}),f(hr,{path:"/:projectId",component:IA}),f(hr,{path:"/:projectId/git",component:q4}),f(hr,{path:"/:projectId/commands/:runId",component:rN}),f(hr,{path:"/:projectId/specs/new",component:AT}),f(hr,{path:"/:projectId/specs/:id",component:ZO}),f(hr,{path:"/:projectId/specs/:id/review",component:L4}),f(hr,{path:"/:projectId/specs/:id/debug",component:K4}),f(hr,{path:"*",component:By})]}}),iv);queueMicrotask(()=>{const e=document.body,t=document.documentElement;console.log("[body-overflow-diagnostic]",{bodyScrollHeight:e.scrollHeight,bodyClientHeight:e.clientHeight,docScrollHeight:t.scrollHeight,docClientHeight:t.clientHeight,windowInnerHeight:window.innerHeight,bodyOverflowing:e.scrollHeight>e.clientHeight,docOverflowing:t.scrollHeight>t.clientHeight})});export{kR as _,ls as g};
|