@ensocode/server 0.3.12 → 0.3.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/out/phone/assets/EditDiff-B3HxLrbF.js +28 -0
- package/out/phone/assets/ReadFileView-BFpGH-kK.js +7 -0
- package/out/phone/assets/{abnfDiagram-VCTEODGH-D-9apHOZ.js → abnfDiagram-VCTEODGH-BNvyPGoF.js} +1 -1
- package/out/phone/assets/architecture-7GRP2DOG-Duql1LsL.js +1 -0
- package/out/phone/assets/{architectureDiagram-5GKGNRK7-B7ti5Yuy.js → architectureDiagram-5GKGNRK7-1bhpTEFA.js} +1 -1
- package/out/phone/assets/{blockDiagram-I7D4REHJ-CMg6PHJB.js → blockDiagram-I7D4REHJ-Bo9UMudu.js} +1 -1
- package/out/phone/assets/{c4Diagram-7LVT6UL2-YtDbC01g.js → c4Diagram-7LVT6UL2-YS11cig2.js} +1 -1
- package/out/phone/assets/channel-BPoIHov1.js +1 -0
- package/out/phone/assets/{chunk-4HAMMTFA-Djg6ctlZ.js → chunk-4HAMMTFA-gA-CzNGD.js} +1 -1
- package/out/phone/assets/{chunk-75Z2AOVW-Be2kq0FP.js → chunk-75Z2AOVW-BL_5b1Dw.js} +1 -1
- package/out/phone/assets/{chunk-DU6HZSFF-d5JZiOMy.js → chunk-DU6HZSFF-BpNlAs9R.js} +1 -1
- package/out/phone/assets/{chunk-F27PBJKO-DHBQ6nrV.js → chunk-F27PBJKO-lsKx96Nt.js} +1 -1
- package/out/phone/assets/{chunk-GMAD6QVW-BatU6uXC.js → chunk-GMAD6QVW-CxbljbtE.js} +1 -1
- package/out/phone/assets/{chunk-GVQU2GXP-CiyvoRIy.js → chunk-GVQU2GXP-CTO3kTOF.js} +1 -1
- package/out/phone/assets/{chunk-IMKFNOWR-vOQaK90i.js → chunk-IMKFNOWR-Cq8XlkcB.js} +1 -1
- package/out/phone/assets/{chunk-L3NEJ4N5-CPykFzBy.js → chunk-L3NEJ4N5-CvIm0JX7.js} +1 -1
- package/out/phone/assets/{chunk-OSK3NFVY-q4NiGH59.js → chunk-OSK3NFVY-Cj3ilTL-.js} +1 -1
- package/out/phone/assets/{chunk-P2QGCYS3-DUV9S_qP.js → chunk-P2QGCYS3-B-twI_Fz.js} +1 -1
- package/out/phone/assets/{chunk-POPQ4Y6H-CjycswNE.js → chunk-POPQ4Y6H-lPQttJ5s.js} +1 -1
- package/out/phone/assets/{chunk-PWAF6VOD-Dben6plA.js → chunk-PWAF6VOD-DjwqZuIR.js} +1 -1
- package/out/phone/assets/{chunk-SHT3W25Y-D2hK_jmb.js → chunk-SHT3W25Y-BWRVin1H.js} +1 -1
- package/out/phone/assets/{chunk-SVP7TREG-DLtgLN89.js → chunk-SVP7TREG-CGLhvnsS.js} +1 -1
- package/out/phone/assets/{chunk-TICWLB2K-BeBB0_0w.js → chunk-TICWLB2K-DkFUa03q.js} +1 -1
- package/out/phone/assets/classDiagram-ZZMXUADV-CIR76lHP.js +1 -0
- package/out/phone/assets/classDiagram-v2-VYDZK3BY-CIR76lHP.js +1 -0
- package/out/phone/assets/codeHighlighter-jQti-W31.js +1346 -0
- package/out/phone/assets/{cynefin-OW5HDTMX-CsDdLZPP.js → cynefin-OW5HDTMX-L8oWVu5S.js} +1 -1
- package/out/phone/assets/{cynefinDiagram-5FMLGOSQ-BcaPty-s.js → cynefinDiagram-5FMLGOSQ-DH8-4p4N.js} +1 -1
- package/out/phone/assets/{dagre-GXQ25YYZ-o7dqm5ri.js → dagre-GXQ25YYZ-HhLDmcu9.js} +1 -1
- package/out/phone/assets/desk-CixRGdTk.js +52 -0
- package/out/phone/assets/{diagram-S7CK7UJ4-B5m8q3yP.js → diagram-S7CK7UJ4-CeIbR3Ir.js} +1 -1
- package/out/phone/assets/{diagram-UQ7AKVKN-_lP617OW.js → diagram-UQ7AKVKN-BQ84Qnq6.js} +1 -1
- package/out/phone/assets/{diagram-VSXAHHWV-D16twHR0.js → diagram-VSXAHHWV-aF_J57fD.js} +1 -1
- package/out/phone/assets/{diagram-VX7I27RA-BT8YSil1.js → diagram-VX7I27RA-Bg1ZqM4Y.js} +1 -1
- package/out/phone/assets/{diagram-Z3DM3KII-CiSuhrxd.js → diagram-Z3DM3KII-DjTkPAqa.js} +1 -1
- package/out/phone/assets/{ebnfDiagram-PWID7BFC-BbCXn4HA.js → ebnfDiagram-PWID7BFC-DPsH5Eky.js} +1 -1
- package/out/phone/assets/{erDiagram-RLTQ6QDP-5-xE_bP2.js → erDiagram-RLTQ6QDP-ExvY7e6T.js} +1 -1
- package/out/phone/assets/eventmodeling-NTZA5JFV-DYp-zWcL.js +1 -0
- package/out/phone/assets/flowDiagram-HODETNUW-CIU32By5.js +1 -0
- package/out/phone/assets/{ganttDiagram-EL5Y4UJY-Rqgggqg_.js → ganttDiagram-EL5Y4UJY-hCe06ucl.js} +1 -1
- package/out/phone/assets/{gitGraph-4MIJSDKK-Drt18ZKK.js → gitGraph-4MIJSDKK-BuZ6lDat.js} +1 -1
- package/out/phone/assets/{gitGraphDiagram-WWUBYQGX-BQ5y4d2H.js → gitGraphDiagram-WWUBYQGX-D-8aVxvj.js} +1 -1
- package/out/phone/assets/{info-A6RAGUB7-CpPeSHE0.js → info-A6RAGUB7-CrZtdoYs.js} +1 -1
- package/out/phone/assets/{infoDiagram-27XIBGKW-D3d9S0Y6.js → infoDiagram-27XIBGKW-BLRFHxtO.js} +1 -1
- package/out/phone/assets/{ishikawaDiagram-5VMMS53U-plFMqx62.js → ishikawaDiagram-5VMMS53U-D7SYWKoj.js} +1 -1
- package/out/phone/assets/{journeyDiagram-3NMN7TZE-CX-n-XXx.js → journeyDiagram-3NMN7TZE-BPsg7CQD.js} +1 -1
- package/out/phone/assets/{kanban-definition-UXKFOSKX-DrdTzKIc.js → kanban-definition-UXKFOSKX-CbPuNr-E.js} +1 -1
- package/out/phone/assets/{line-CqyaArNm.js → line-CkpKMiqK.js} +1 -1
- package/out/phone/assets/main-BCnf7dVM.js +264 -0
- package/out/phone/assets/main-nqB-uD3v.css +2 -0
- package/out/phone/assets/{mermaid-parser.core-CERMa6fg.js → mermaid-parser.core-RTq_mEm1.js} +3 -3
- package/out/phone/assets/{mermaid.core-CbGP2wFn.js → mermaid.core-D9LtIKua.js} +4 -4
- package/out/phone/assets/{mindmap-definition-YA3MSWOX-BxaIrov6.js → mindmap-definition-YA3MSWOX-8cGgRiRD.js} +1 -1
- package/out/phone/assets/{packet-AYTQ26CC-DguFQxPm.js → packet-AYTQ26CC-D9-eSn0v.js} +1 -1
- package/out/phone/assets/{pegDiagram-XKGWAZYB-t3td03dz.js → pegDiagram-XKGWAZYB-DztU_rIE.js} +1 -1
- package/out/phone/assets/{pie-WAS4IAKB-DoFu2rhu.js → pie-WAS4IAKB-Bk2Tqaq_.js} +1 -1
- package/out/phone/assets/{pieDiagram-E7YTZNPT-DctHLSL8.js → pieDiagram-E7YTZNPT-Dm_3mJ9_.js} +1 -1
- package/out/phone/assets/{quadrantDiagram-AXDQQJYC-Br7-ImNr.js → quadrantDiagram-AXDQQJYC-lKskzjzu.js} +1 -1
- package/out/phone/assets/{radar-RG4KPBEZ-BDjTOHD8.js → radar-RG4KPBEZ-B2z8Txd8.js} +1 -1
- package/out/phone/assets/{railroad-74A4TZTK-v8vsrpxb.js → railroad-74A4TZTK-11VmdALq.js} +1 -1
- package/out/phone/assets/railroad-abnf-HS5TGJTU-BkSycwye.js +1 -0
- package/out/phone/assets/railroad-ebnf-LZEXJU2U-BsPIU3iV.js +1 -0
- package/out/phone/assets/railroad-peg-WCYAUIDC-Cy8G7u5C.js +1 -0
- package/out/phone/assets/{railroadDiagram-O6MQD6OU-DtH4qQrr.js → railroadDiagram-O6MQD6OU-Dr0NTIA6.js} +1 -1
- package/out/phone/assets/{requirementDiagram-BXWQKSXE-BSqejjZP.js → requirementDiagram-BXWQKSXE-C0W6h_5I.js} +1 -1
- package/out/phone/assets/{sankeyDiagram-P5KCCOFB-DsTWuNtL.js → sankeyDiagram-P5KCCOFB-CVJDathY.js} +1 -1
- package/out/phone/assets/{sequenceDiagram-WJ2MYXX4-zLMvPyPC.js → sequenceDiagram-WJ2MYXX4-BxHQTG6x.js} +1 -1
- package/out/phone/assets/shellUpdate-DPSfgHG3.js +36 -0
- package/out/phone/assets/{stateDiagram-D77RDMKH-DrBC05BN.js → stateDiagram-D77RDMKH-BO5MAjhs.js} +1 -1
- package/out/phone/assets/stateDiagram-v2-MP3YSRHH-B8IHc2bm.js +1 -0
- package/out/phone/assets/{swimlanes-42K2YHIH-B27-qSm5.js → swimlanes-42K2YHIH-DnhDPyy6.js} +1 -1
- package/out/phone/assets/swimlanesDiagram-VR7AAH4N-dmSDAN2F.js +8 -0
- package/out/phone/assets/{timeline-definition-24CTP7MA-8NDkGf5U.js → timeline-definition-24CTP7MA-bLEjS7re.js} +1 -1
- package/out/phone/assets/{treeView-Q6P3EWNA-B9BXwCDC.js → treeView-Q6P3EWNA-Ci-sA9wK.js} +1 -1
- package/out/phone/assets/{treemap-WGGIJYW6-B0IqbwdT.js → treemap-WGGIJYW6-BXCjzK65.js} +1 -1
- package/out/phone/assets/{vennDiagram-4TSXK5OY-Dp-aKgNa.js → vennDiagram-4TSXK5OY-DHsj5dRx.js} +1 -1
- package/out/phone/assets/{wardley-WFR3VGLG-B7FlADZf.js → wardley-WFR3VGLG-d8TdCu-H.js} +1 -1
- package/out/phone/assets/{wardleyDiagram-VM6X3IG4-BVntjQNl.js → wardleyDiagram-VM6X3IG4-DQFVP9qu.js} +1 -1
- package/out/phone/assets/{xychartDiagram-S5SC5T6Z-kgVJvkgO.js → xychartDiagram-S5SC5T6Z-Dni2Y0ov.js} +1 -1
- package/out/phone/desk.html +81 -2
- package/out/phone/index.html +51 -3
- package/out/phone/manifest.webmanifest +1 -0
- package/out/phone/splash/1125x2436-dark.png +0 -0
- package/out/phone/splash/1125x2436-light.png +0 -0
- package/out/phone/splash/1170x2532-dark.png +0 -0
- package/out/phone/splash/1170x2532-light.png +0 -0
- package/out/phone/splash/1179x2556-dark.png +0 -0
- package/out/phone/splash/1179x2556-light.png +0 -0
- package/out/phone/splash/1206x2622-dark.png +0 -0
- package/out/phone/splash/1206x2622-light.png +0 -0
- package/out/phone/splash/1242x2208-dark.png +0 -0
- package/out/phone/splash/1242x2208-light.png +0 -0
- package/out/phone/splash/1242x2688-dark.png +0 -0
- package/out/phone/splash/1242x2688-light.png +0 -0
- package/out/phone/splash/1260x2736-dark.png +0 -0
- package/out/phone/splash/1260x2736-light.png +0 -0
- package/out/phone/splash/1284x2778-dark.png +0 -0
- package/out/phone/splash/1284x2778-light.png +0 -0
- package/out/phone/splash/1290x2796-dark.png +0 -0
- package/out/phone/splash/1290x2796-light.png +0 -0
- package/out/phone/splash/1320x2868-dark.png +0 -0
- package/out/phone/splash/1320x2868-light.png +0 -0
- package/out/phone/splash/750x1334-dark.png +0 -0
- package/out/phone/splash/750x1334-light.png +0 -0
- package/out/phone/splash/828x1792-dark.png +0 -0
- package/out/phone/splash/828x1792-light.png +0 -0
- package/out/phone/sw.js +219 -6
- package/out/renderer/assets/EditDiff-DxxLuCEI.js +1 -0
- package/out/renderer/assets/File-Tz3MUtN6.js +1 -0
- package/out/renderer/assets/ReadFileView-DFoLPU04.js +4 -0
- package/out/renderer/assets/SidePanel-CL40W2RY.js +47 -0
- package/out/renderer/assets/SidePanel-D0m4IYxS.css +1 -0
- package/out/renderer/assets/Virtualizer-B0uwx_XV.js +1345 -0
- package/out/renderer/assets/{abnfDiagram-VCTEODGH-Bp0r3dKm.js → abnfDiagram-VCTEODGH-CJ9nn9eH.js} +1 -1
- package/out/renderer/assets/{arc-BD5HnhIt.js → arc-B8im8n0O.js} +1 -1
- package/out/renderer/assets/{architectureDiagram-5GKGNRK7-CgJHjETB.js → architectureDiagram-5GKGNRK7-BRSi5FBk.js} +1 -1
- package/out/renderer/assets/{blockDiagram-I7D4REHJ-5le9vk4G.js → blockDiagram-I7D4REHJ-CQ1wirIl.js} +1 -1
- package/out/renderer/assets/{c4Diagram-7LVT6UL2-B4DCe-qN.js → c4Diagram-7LVT6UL2-9HyLIioe.js} +1 -1
- package/out/renderer/assets/channel-DjB0ww6b.js +1 -0
- package/out/renderer/assets/{chunk-2Q5K7J3B-DIxWfJHE.js → chunk-2Q5K7J3B-BwC9g3bx.js} +1 -1
- package/out/renderer/assets/{chunk-5VM5RSS4-D9j4om1l.js → chunk-5VM5RSS4-DMtgxPBL.js} +1 -1
- package/out/renderer/assets/{chunk-F27PBJKO-B_tGbKyc.js → chunk-F27PBJKO-DSi_XV5v.js} +1 -1
- package/out/renderer/assets/{chunk-IMKFNOWR-Cfffd1p9.js → chunk-IMKFNOWR-Dctc6Apj.js} +1 -1
- package/out/renderer/assets/{chunk-JWPE2WC7-BABZOPGb.js → chunk-JWPE2WC7-I2BD5qM7.js} +1 -1
- package/out/renderer/assets/{chunk-POPQ4Y6H-D-QyVpSn.js → chunk-POPQ4Y6H-k60pc4eT.js} +1 -1
- package/out/renderer/assets/{chunk-SVP7TREG-BghyPSd6.js → chunk-SVP7TREG-zCGemfqm.js} +1 -1
- package/out/renderer/assets/{chunk-TICWLB2K-CQmthy6z.js → chunk-TICWLB2K-CdDiHIq-.js} +1 -1
- package/out/renderer/assets/{chunk-XXDRQBXY-CDKsbyR7.js → chunk-XXDRQBXY-GYVDxVfN.js} +1 -1
- package/out/renderer/assets/classDiagram-ZZMXUADV-6SiAw1np.js +1 -0
- package/out/renderer/assets/classDiagram-v2-VYDZK3BY-6SiAw1np.js +1 -0
- package/out/renderer/assets/{cose-bilkent-JH36ORCC-oajViFnN.js → cose-bilkent-JH36ORCC-BnSAtUh-.js} +1 -1
- package/out/renderer/assets/{cynefin-OW5HDTMX-DMH1CUmI.js → cynefin-OW5HDTMX-DnQaS9VN.js} +1 -1
- package/out/renderer/assets/{cynefinDiagram-5FMLGOSQ-DVUJf9t0.js → cynefinDiagram-5FMLGOSQ-BNQdw0PV.js} +1 -1
- package/out/renderer/assets/{cytoscape-fcose-adTZ191M.js → cytoscape-fcose-CzkrRInm.js} +1 -1
- package/out/renderer/assets/{dagre-GXQ25YYZ-BXRWWNje.js → dagre-GXQ25YYZ-fG1vMsyn.js} +1 -1
- package/out/renderer/assets/{diagram-S7CK7UJ4-Dg7f2Dan.js → diagram-S7CK7UJ4-BcfAFVc2.js} +1 -1
- package/out/renderer/assets/{diagram-UQ7AKVKN-DsLRyZAt.js → diagram-UQ7AKVKN-D8f3Tsx9.js} +1 -1
- package/out/renderer/assets/{diagram-VSXAHHWV-3_LoodSS.js → diagram-VSXAHHWV-B-U9CIWt.js} +1 -1
- package/out/renderer/assets/{diagram-VX7I27RA-DQeZp2Cz.js → diagram-VX7I27RA-CX6ifTkJ.js} +1 -1
- package/out/renderer/assets/{diagram-Z3DM3KII-Dwil6g5m.js → diagram-Z3DM3KII-49dS9s3L.js} +1 -1
- package/out/renderer/assets/{ebnfDiagram-PWID7BFC-DecVNxpu.js → ebnfDiagram-PWID7BFC-CraGJRI7.js} +1 -1
- package/out/renderer/assets/{erDiagram-RLTQ6QDP-D2rmo2nP.js → erDiagram-RLTQ6QDP-CfMNvEoW.js} +1 -1
- package/out/renderer/assets/{flowDiagram-HODETNUW-_SF2dRBl.js → flowDiagram-HODETNUW-C8XM3p4T.js} +1 -1
- package/out/renderer/assets/{ganttDiagram-EL5Y4UJY-BoYWs5Ev.js → ganttDiagram-EL5Y4UJY-DlJBMKFX.js} +1 -1
- package/out/renderer/assets/{gitGraphDiagram-WWUBYQGX-BqRbZ3V0.js → gitGraphDiagram-WWUBYQGX-DvEzDsKF.js} +1 -1
- package/out/renderer/assets/globals-BFf1P-Y5.js +715 -0
- package/out/renderer/assets/globals-DUBhAVpU.css +1 -0
- package/out/renderer/assets/index-L4TTIP10.js +89 -0
- package/out/renderer/assets/{infoDiagram-27XIBGKW-CFt6xyuD.js → infoDiagram-27XIBGKW-CckfBO-R.js} +1 -1
- package/out/renderer/assets/{ishikawaDiagram-5VMMS53U-CZB8G4dD.js → ishikawaDiagram-5VMMS53U-mUoXchkB.js} +1 -1
- package/out/renderer/assets/{journeyDiagram-3NMN7TZE-CO2VRmpx.js → journeyDiagram-3NMN7TZE-zzLL0HFW.js} +1 -1
- package/out/renderer/assets/{kanban-definition-UXKFOSKX-DIqEnfMM.js → kanban-definition-UXKFOSKX-BJ_9aIhB.js} +1 -1
- package/out/renderer/assets/{layout-DXRKfO_Y.js → layout-3SRMHY7n.js} +1 -1
- package/out/renderer/assets/{linear-Cdx1AdZJ.js → linear-CWpclK_R.js} +1 -1
- package/out/renderer/assets/manifest-DOzTaB8J.js +525 -0
- package/out/renderer/assets/{mermaid.core-DuIO2jsm.js → mermaid.core-DORpmVi3.js} +5 -5
- package/out/renderer/assets/{mindmap-definition-YA3MSWOX-B5lvxG2M.js → mindmap-definition-YA3MSWOX-CYBlCqIB.js} +1 -1
- package/out/renderer/assets/{pegDiagram-XKGWAZYB-DCwHp-K3.js → pegDiagram-XKGWAZYB-DhWwLs4v.js} +1 -1
- package/out/renderer/assets/{pieDiagram-E7YTZNPT-Dq048Wh7.js → pieDiagram-E7YTZNPT-Bzpc57-A.js} +1 -1
- package/out/renderer/assets/{quadrantDiagram-AXDQQJYC-DwkFkAi_.js → quadrantDiagram-AXDQQJYC-spKXEbds.js} +1 -1
- package/out/renderer/assets/{railroadDiagram-O6MQD6OU-2NKvwLP-.js → railroadDiagram-O6MQD6OU-Br553px3.js} +1 -1
- package/out/renderer/assets/{requirementDiagram-BXWQKSXE-Bp44tNQ0.js → requirementDiagram-BXWQKSXE-CX-Dqij_.js} +1 -1
- package/out/renderer/assets/{sankeyDiagram-P5KCCOFB-C3TFp1NK.js → sankeyDiagram-P5KCCOFB-Bgx1W6B9.js} +1 -1
- package/out/renderer/assets/{sequenceDiagram-WJ2MYXX4-BTPoYQeW.js → sequenceDiagram-WJ2MYXX4-CKQv6pcU.js} +1 -1
- package/out/renderer/assets/sessionChanges-BLzNhRuv.js +31 -0
- package/out/renderer/assets/settings-Bsrw4ERp.js +25 -0
- package/out/renderer/assets/{sizeCapture-INFHLROL-DvNj5TDT.js → sizeCapture-INFHLROL-DtRedfRe.js} +1 -1
- package/out/renderer/assets/{stateDiagram-D77RDMKH-DC8YykNp.js → stateDiagram-D77RDMKH-CMP5owem.js} +1 -1
- package/out/renderer/assets/stateDiagram-v2-MP3YSRHH-6-731AqJ.js +1 -0
- package/out/renderer/assets/{swimlanes-42K2YHIH-0yL1nNkg.js → swimlanes-42K2YHIH-D30AvvmW.js} +1 -1
- package/out/renderer/assets/swimlanesDiagram-VR7AAH4N-B8KijqIT.js +8 -0
- package/out/renderer/assets/{timeline-definition-24CTP7MA-Pg-2roGv.js → timeline-definition-24CTP7MA-CsZAMmMZ.js} +1 -1
- package/out/renderer/assets/{vennDiagram-4TSXK5OY-D0af5K4E.js → vennDiagram-4TSXK5OY-COQ7L1f7.js} +1 -1
- package/out/renderer/assets/{wardleyDiagram-VM6X3IG4-CB_nIy_l.js → wardleyDiagram-VM6X3IG4-dqMWLTCs.js} +1 -1
- package/out/renderer/assets/{xychartDiagram-S5SC5T6Z-A26Yld8R.js → xychartDiagram-S5SC5T6Z-DX4clIYP.js} +1 -1
- package/out/renderer/index.html +3 -4
- package/out/renderer/plugin-view.html +37 -0
- package/out/renderer/settings.html +7 -4
- package/out/renderer/web-preload.js +28 -28
- package/out/server/agent.js +663 -124
- package/out/server/chunks/{agent-D33nI7fP.js → agent-BbNq8i9j.js} +909 -592
- package/out/server/chunks/conversationsMove-CvFPFHaa.js +587 -0
- package/out/server/chunks/{gpuBackendInstall-CRzfB150.js → gpuBackendInstall-jAzoFq7U.js} +3 -3
- package/out/server/chunks/{loadProvider-4Y15KP7W.js → loadProvider-NdOVbsHi.js} +2 -2
- package/out/server/chunks/{manifest-wlfh-NN5.js → manifest-BPXFscqI.js} +9 -3
- package/out/server/chunks/registry-BhoHPSKn.js +3353 -0
- package/out/server/chunks/{resources-DzUshg1j.js → resources-BfbTkFP0.js} +21 -10
- package/out/server/chunks/sendImage-BCNW9JRV.js +418 -0
- package/out/server/chunks/{storageScanWorker-CuttDIGS.js → storageScanWorker-CR7HbOWG.js} +2 -2
- package/out/server/chunks/{storageScanWorker-CX8O_DlF.js → storageScanWorker-DjFyHTye.js} +2 -2
- package/out/server/chunks/{workflowPresets-CAA0AY6f.js → workflowPresets-C2T1BzA2.js} +863 -662
- package/out/server/index.js +13584 -15047
- package/out/server/memory-service.js +5008 -0
- package/out/server/plugin-host.js +2 -2
- package/package.json +1 -1
- package/out/phone/assets/EnsoNerdSymbolsMono-Regular-TdeMQojc.ttf +0 -0
- package/out/phone/assets/architecture-7GRP2DOG-ihVIDRRt.js +0 -1
- package/out/phone/assets/channel-BQsoblXW.js +0 -1
- package/out/phone/assets/classDiagram-ZZMXUADV-rwnxFDXp.js +0 -1
- package/out/phone/assets/classDiagram-v2-VYDZK3BY-rwnxFDXp.js +0 -1
- package/out/phone/assets/desk-DNf6lCoq.js +0 -2
- package/out/phone/assets/eventmodeling-NTZA5JFV-BVS2RGt-.js +0 -1
- package/out/phone/assets/flowDiagram-HODETNUW-BSlxj9Uk.js +0 -1
- package/out/phone/assets/main-BGlFv7yA.js +0 -1658
- package/out/phone/assets/main-BS1SSCau.css +0 -1
- package/out/phone/assets/railroad-abnf-HS5TGJTU-CUELjEtC.js +0 -1
- package/out/phone/assets/railroad-ebnf-LZEXJU2U-DdIokM4i.js +0 -1
- package/out/phone/assets/railroad-peg-WCYAUIDC-DYyy0B-_.js +0 -1
- package/out/phone/assets/stateDiagram-v2-MP3YSRHH-DT7BlwvF.js +0 -1
- package/out/phone/assets/storage-BeJvYXAx.js +0 -36
- package/out/phone/assets/swimlanesDiagram-VR7AAH4N-CWnm4v0A.js +0 -8
- package/out/renderer/assets/channel-D-HltTAP.js +0 -1
- package/out/renderer/assets/classDiagram-ZZMXUADV-BCWhgMul.js +0 -1
- package/out/renderer/assets/classDiagram-v2-VYDZK3BY-BCWhgMul.js +0 -1
- package/out/renderer/assets/globals-BEwCf508.css +0 -1
- package/out/renderer/assets/globals-C3zxoqqH.js +0 -2603
- package/out/renderer/assets/index-9vqh4wxi.js +0 -133
- package/out/renderer/assets/index-F_0FxVZ_.css +0 -1
- package/out/renderer/assets/settings-DlDHkOe2.js +0 -25
- package/out/renderer/assets/stateDiagram-v2-MP3YSRHH-B4rCEEYH.js +0 -1
- package/out/renderer/assets/swimlanesDiagram-VR7AAH4N-zQqW8MJ5.js +0 -8
- package/out/server/chunks/conversationsMove-CJZfkj55.js +0 -57
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import{i as e,r as t,t as n}from"./rolldown-runtime-Dd_uD5pT.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var r=n((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.iterator;function m(e){return typeof e!=`object`||!e?null:(e=p&&e[p]||e[`@@iterator`],typeof e==`function`?e:null)}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,_={};function v(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}v.prototype.isReactComponent={},v.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function y(){}y.prototype=v.prototype;function b(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}var x=b.prototype=new y;x.constructor=b,g(x,v.prototype),x.isPureReactComponent=!0;var S=Array.isArray;function C(){}var w={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function E(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function D(e,t){return E(e.type,t,e.props)}function O(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function k(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var A=/\/+/g;function j(e,t){return typeof e==`object`&&e&&e.key!=null?k(``+e.key):t.toString(36)}function M(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(C,C):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function N(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,N(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+j(e,0):a,S(o)?(i=``,c!=null&&(i=c.replace(A,`$&/`)+`/`),N(o,r,i,``,function(e){return e})):o!=null&&(O(o)&&(o=D(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(A,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(S(e))for(var u=0;u<e.length;u++)a=e[u],s=l+j(a,u),c+=N(a,r,i,s,o);else if(u=m(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+j(a,u++),c+=N(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return N(M(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function P(e,t,n){if(e==null)return e;var r=[],i=0;return N(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function F(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t)},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var I=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},L={map:P,forEach:function(e,t,n){P(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return P(e,function(){t++}),t},toArray:function(e){return P(e,function(e){return e})||[]},only:function(e){if(!O(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=L,e.Component=v,e.Fragment=r,e.Profiler=a,e.PureComponent=b,e.StrictMode=i,e.Suspense=l,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=w,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return w.H.useMemoCache(e)}},e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=g({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!T.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return E(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)T.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return E(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=O,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:F}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=function(e){var t=w.T,n={};w.T=n;try{var r=e(),i=w.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(C,I)}catch(e){I(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),w.T=t}},e.unstable_useCacheRefresh=function(){return w.H.useCacheRefresh()},e.use=function(e){return w.H.use(e)},e.useActionState=function(e,t,n){return w.H.useActionState(e,t,n)},e.useCallback=function(e,t){return w.H.useCallback(e,t)},e.useContext=function(e){return w.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return w.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return w.H.useEffect(e,t)},e.useEffectEvent=function(e){return w.H.useEffectEvent(e)},e.useId=function(){return w.H.useId()},e.useImperativeHandle=function(e,t,n){return w.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return w.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return w.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return w.H.useMemo(e,t)},e.useOptimistic=function(e,t){return w.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return w.H.useReducer(e,t,n)},e.useRef=function(e){return w.H.useRef(e)},e.useState=function(e){return w.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return w.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return w.H.useTransition()},e.version=`19.2.8`})),i=n(((e,t)=>{t.exports=r()}));function a(e,t,n=Date.now()){switch(t.type){case`turn-retry`:{let{attempt:r,maxAttempts:i,delayMs:a,error:o}=t;return typeof r!=`number`||typeof i!=`number`||typeof a!=`number`||typeof o!=`string`||o.length===0?e:{attempt:r,maxAttempts:i,delayMs:a,error:o,at:n}}case`status`:case`turn-completed`:case`turn-failed`:return;default:return e}}function o(e,t){switch(t.type){case`task-started`:{let n=t.task;return!n||typeof n.taskId!=`string`?null:e.tasks.some(e=>e.taskId===n.taskId)?e:{...e,tasks:[...e.tasks,n]}}case`task-output`:{let n=t.taskId;return n?{...e,tasks:e.tasks.map(e=>e.taskId===n?{...e,tail:t.tail,status:t.status,...typeof t.outputBytes==`number`?{outputBytes:t.outputBytes}:{}}:e)}:null}case`task-ended`:{let n=t.taskId;return n?{...e,tasks:e.tasks.map(e=>e.taskId===n?{...e,status:t.status,exitCode:t.exitCode}:e)}:null}case`background-tasks-level`:return Array.isArray(t.tasks)?{...e,tasks:t.tasks}:null;case`subagent-update`:{let n=t.agent;if(!n||typeof n.id!=`string`)return null;let r=e.subagents.some(e=>e.id===n.id);return{...e,subagents:r?e.subagents.map(e=>e.id===n.id?n:e):[...e.subagents,n]}}default:return null}}function s(e,t){if(t===void 0)return;let n=0;for(let r of e)r<t&&(n+=1);return n}function c(){return{messages:new Map,status:`idle`,approvals:[],asks:[],tasks:[],subagents:[]}}var l=e=>e.size?Math.max(...e.keys()):-1;function u(e,t,n){let r={...e,messages:new Map(e.messages)};r.retry=a(r.retry,t,n?.now);let i=o({tasks:r.tasks,subagents:r.subagents},t);if(i)return{view:{...r,...i}};switch(t.type){case`message-upsert`:{let e=t.index;return r.messages.set(e,t.message),{view:r,lastIndex:l(r.messages)}}case`messages-truncated`:{let e=t.length;for(let t of r.messages.keys())t>=e&&r.messages.delete(t);return{view:r,lastIndex:e-1}}case`status`:r.status=t.status;break;case`turn-completed`:r.status=`idle`;break;case`turn-failed`:r.status=`failed`;break;case`approval-request`:{let e=t.request??t;r.approvals=[...r.approvals,e];break}case`approval-resolved`:r.approvals=r.approvals.filter(e=>e.requestId!==t.requestId);break;case`ask-request`:{let e=t.ask??t;r.asks=[...r.asks,e];break}case`ask-resolved`:r.asks=r.asks.filter(e=>e.requestId!==t.requestId);break;case`compaction`:{let e=t.state;r.compaction=e===`queued`?`queued`:e===`start`?`running`:void 0,e===`end`&&!t.error&&!t.abandoned&&(r.compactionNoticeAt=l(r.messages)+1);break}}return{view:r}}function d(e,t){let n=[];for(let r of t.sessions??[]){let t=r.sessionId??r.identity?.sessionId;if(!t)continue;let i=r.baseIndex??0,a=e.get(t)?.messages,o=a?.size?Math.max(...a.keys()):-1,s=a&&i<=o+1?new Map(a):new Map,c=r.messages??[];for(let e of s.keys())e>=i+c.length&&s.delete(e);for(let[e,t]of c.entries())s.set(i+e,t);n.push({id:t,view:{messages:s,status:r.status??`idle`,approvals:r.pendingApprovals??[],asks:r.pendingAsks??[],tasks:r.backgroundTasks??[],subagents:r.subagents??[],compaction:r.compaction,compactionNoticeAt:r.compactionNoticeAt??e.get(t)?.compactionNoticeAt},lastIndex:i+c.length-1})}return n}function f(e,t){if(t.messages.length===0)return e;let n=new Map(e.messages);for(let[e,r]of t.messages.entries())n.set(t.baseIndex+e,r);return{...e,messages:n}}function p(e){let t=new Map;for(let[n,r]of e)t.set(n,{...r,status:`failed`,messages:new Map(r.messages)});return t}var m=[`read_only`,`regenerable`,`reversible_workspace_change`,`data_loss`,`system_state`,`exfiltration`,`unclear_target`],h=200;function g(e){return m.includes(e)}function _(e){return typeof e==`number`&&Number.isFinite(e)&&e>=0&&e<=1}function v(e){if(!e||typeof e!=`object`||Array.isArray(e))return;let{verdict:t,model:n,allow:r,ask:i,block:a,reason:o}=e;if(!(t!==`allow`&&t!==`deny`||typeof n!=`string`||!n||n.length>h||!_(r)||!_(i)||!_(a)||o!==void 0&&!g(o)))return{verdict:t,model:n,allow:r,ask:i,block:a,...o?{reason:o}:{}}}var y=`agent:enso`,b=/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i,x=/^[a-z][a-z0-9_-]*$/;function S(e){return typeof e==`string`&&b.test(e)}function C(e){if(e===`agent:enso`)return y;if(typeof e!=`string`)return null;if(e.startsWith(`builtin:`)){let t=e.slice(8);return x.test(t)&&t!==`general`&&t!==`enso`?e:null}return e.startsWith(`custom:`)?S(e.slice(7))?e:null:e.startsWith(`bot:`)&&S(e.slice(4))?e:null}function w(e){if(!e||typeof e!=`object`||Array.isArray(e))return null;let t=e,n=C(t.typeKey);return Object.keys(t).length!==7||!n||typeof t.displayName!=`string`||!t.displayName.trim()||typeof t.description!=`string`||t.source!==`system`&&t.source!==`builtin`&&t.source!==`custom`&&t.source!==`bot`||typeof t.locked!=`boolean`||typeof t.canDisable!=`boolean`||typeof t.canEdit!=`boolean`||n===`agent:enso`||t.source===`bot`!==n.startsWith(`bot:`)?null:t}function T(e){if(!e||typeof e!=`object`||Array.isArray(e))return null;let t=e;if(Object.keys(t).length!==2||!Number.isInteger(t.revision)||t.revision<0||!Array.isArray(t.candidates)||t.candidates.some(e=>w(e)===null))return null;let n=t.candidates.map(e=>e.typeKey);return new Set(n).size===n.length?t:null}var E=`__`,D=/^plugin_([a-z][a-z0-9]*(?:-[a-z0-9]+)+)__([a-z][a-z0-9_]*)$/;function O(e){let t=D.exec(e);return!t?.[1]||!t[2]||t[2].includes(E)?null:{pluginId:t[1].replaceAll(`-`,`.`),toolName:t[2]}}function k(e){if(e.api===`typesafe-system-one`||e.catalogId===`typesafe`)return!0;try{let t=new URL(e.baseUrl??``).hostname.toLowerCase();return t===`api.typesafe.ai`||t.endsWith(`.api.typesafe.ai`)}catch{return!1}}var A={"openai-completions":`https://api.openai.com/v1`,"openai-responses":`https://api.openai.com/v1`,"anthropic-messages":`https://api.anthropic.com`,"google-generative-ai":`https://generativelanguage.googleapis.com/v1beta`,ollama:`http://127.0.0.1:11434`,"typesafe-system-one":`https://api.typesafe.ai/v1/`};A[`google-generative-ai`],A[`typesafe-system-one`],A.ollama;var j=`local-image`,M=`__ensoRemoteLocalImagePrefix`;function N(e){let t=globalThis[M];return typeof t==`string`?`${t}${encodeURIComponent(e)}`:e}var P=`posix`,F=`secretary-avatar`,I=(e,t,n)=>N(`${j}://${F}/avatar.png?v=${e}${t?`&h=${encodeURIComponent(t)}`:``}${n?`&s=${encodeURIComponent(n)}`:``}`),L=[`png`,`jpg`,`jpeg`,`gif`,`webp`,`bmp`,`svg`,`jfif`,`avif`],R=[`mp4`,`webm`,`ogg`,`ogv`,`mov`];[...L,...R];function z(e){let t=e.split(/[?#]/)[0]??``,n=t.lastIndexOf(`.`);return n<0?``:t.slice(n+1).toLowerCase()}function B(e){let t=e.replace(/\\/g,`/`);if(t.startsWith(`//`)){let[e,...n]=t.slice(2).split(`/`).filter(Boolean);return N(`${j}://${e}/${n.map(encodeURIComponent).join(`/`)}`)}let n=/^([a-zA-Z]):\/(.*)$/.exec(t);if(n){let e=n[2].split(`/`).filter(Boolean).map(encodeURIComponent);return N(`${j}://${n[1].toLowerCase()}/${e.join(`/`)}`)}return N(`${j}://${P}/${t.split(`/`).filter(Boolean).map(encodeURIComponent).join(`/`)}`)}new Set(L);var V=e=>typeof e==`string`&&/^openai-codex(?:#[2-9]\d*|#1\d+)?$/.test(e);function H(e){if(!e||typeof e!=`object`||Array.isArray(e))return null;let t=e;if(Object.keys(t).some(e=>e!==`accountKeys`)||!Array.isArray(t.accountKeys))return null;let n=t.accountKeys;return n.length>0&&n.length<=100&&n.every(V)&&new Set(n).size===n.length?{accountKeys:[...n]}:null}function U(e){return!e.apiKey&&V(e.oauthAccountKey)&&H(e.oauthAccountPool)!==null}function W(e,t,n,r){return!U(e)||!e.enabled||!e.models.some(e=>e.id===t&&e.enabled!==!1)?[]:(e.oauthAccountPool?.accountKeys??[]).filter(i=>r.has(i)&&n.some(n=>n.id!==e.id&&n.oauthAccountPool===void 0&&!n.apiKey&&n.oauthAccountKey===i&&n.enabled&&n.models.some(e=>e.id===t&&e.enabled!==!1)))}var G=/^<(plan-mode|active-plan)(?: id="[^"]*")?>\n([\s\S]*?)\n<\/\1>(?:\n\n|$)/;function K(e){let t=G.exec(e);return t?{note:t[1]===`active-plan`?`active-plan`:t[2].includes(`Plan mode is ON`)?`on`:`off`,rest:e.slice(t[0].length)}:{rest:e}}var q=/^<plan-approved id="([^"]*)">\nThe user approved the plan "([\s\S]*?)"; plan mode/,J=/^<plan-feedback id="([^"]*)">\n[\s\S]*?<feedback>\n([\s\S]*)\n<\/feedback>\n<\/plan-feedback>$/;function ee(e){let t=q.exec(e);if(t)return{kind:`approved`,planId:t[1],title:t[2]};let n=J.exec(e);return n?{kind:`feedback`,planId:n[1],feedback:n[2]}:null}var te=[`system`,`user`,`tool_result`,`tool_args`,`assistant`,`tools`],ne=class{hits=new Map;blocked=!1;restored=0;add(e,t=1){let n=`${e.kind}\0${e.rule}\0${e.action}\0${e.where}\0${e.token}`,r=this.hits.get(n);r?r.count+=t:this.hits.set(n,{...e,count:t})}get empty(){return this.hits.size===0&&this.restored===0}build(){return{hits:[...this.hits.values()].map(e=>({...e})),blocked:this.blocked,restored:this.restored}}};new Set(te);function re(e,t){if(!e)return t;let n=new ne;for(let r of[...e.hits,...t.hits])n.add(r,r.count);return n.blocked=e.blocked||t.blocked,n.restored=e.restored+t.restored,n.build()}function ie(e){let t=new Map;for(let n of e){let e=`${n.action}\0${n.kind}\0${n.where}`,r=t.get(e);r?(r.tokens.add(n.token),r.count+=n.count):t.set(e,{action:n.action,kind:n.kind,where:n.where,values:0,count:n.count,preview:n.preview,tokens:new Set([n.token])})}return[...t.values()].map(({tokens:e,...t})=>({...t,values:e.size}))}var ae={mask:1,warn:2,block:3};function oe(e){let t;for(let n of e.hits)(!t||ae[n.action]>ae[t])&&(t=n.action);return t}var se={enabled:!1,secrets:{enabled:!0,action:`mask`,shape:!1},personal:{enabled:!1,action:`mask`,kinds:[`email`,`phone`,`idCard`,`bankCard`]},custom:{words:[],rules:[],action:`mask`},allow:[]},ce=(e,t)=>e.length>t?`${e.slice(0,t)}…`:e;function le(e){if(!e||typeof e!=`object`||Array.isArray(e))return;let{status:t,originalCommand:n,rewrittenCommand:r,inputTokens:i,outputTokens:a,reason:o}=e;if(t!==`compressed`&&t!==`unchanged`&&t!==`pending`&&t!==`bypassed`&&t!==`unavailable`||typeof n!=`string`||r!==void 0&&typeof r!=`string`||o!==void 0&&typeof o!=`string`)return;let s={status:t,originalCommand:ce(n,16e3)};if(r!==void 0&&(s.rewrittenCommand=ce(r,16e3)),o!==void 0&&(s.reason=ce(o,1e3)),i!==void 0||a!==void 0){if(typeof i!=`number`||!Number.isSafeInteger(i)||i<0||typeof a!=`number`||!Number.isSafeInteger(a)||a<0)return;s.inputTokens=i,s.outputTokens=a}return s}var ue=Symbol.for(`yaml.alias`),de=Symbol.for(`yaml.document`),fe=Symbol.for(`yaml.map`),pe=Symbol.for(`yaml.pair`),me=Symbol.for(`yaml.scalar`),he=Symbol.for(`yaml.seq`),ge=Symbol.for(`yaml.node.type`),_e=e=>!!e&&typeof e==`object`&&e[ge]===ue,ve=e=>!!e&&typeof e==`object`&&e[ge]===de,ye=e=>!!e&&typeof e==`object`&&e[ge]===fe,be=e=>!!e&&typeof e==`object`&&e[ge]===pe,Y=e=>!!e&&typeof e==`object`&&e[ge]===me,xe=e=>!!e&&typeof e==`object`&&e[ge]===he;function Se(e){if(e&&typeof e==`object`)switch(e[ge]){case fe:case he:return!0}return!1}function Ce(e){if(e&&typeof e==`object`)switch(e[ge]){case ue:case fe:case me:case he:return!0}return!1}var we=e=>(Y(e)||Se(e))&&!!e.anchor,Te=Symbol(`break visit`),Ee=Symbol(`skip children`),De=Symbol(`remove node`);function Oe(e,t){let n=Ae(t);ve(e)?ke(null,e.contents,n,Object.freeze([e]))===De&&(e.contents=null):ke(null,e,n,Object.freeze([]))}Oe.BREAK=Te,Oe.SKIP=Ee,Oe.REMOVE=De;function ke(e,t,n,r){let i=je(e,t,n,r);if(Ce(i)||be(i))return Me(e,r,i),ke(e,i,n,r);if(typeof i!=`symbol`){if(Se(t)){r=Object.freeze(r.concat(t));for(let e=0;e<t.items.length;++e){let i=ke(e,t.items[e],n,r);if(typeof i==`number`)e=i-1;else if(i===Te)return Te;else i===De&&(t.items.splice(e,1),--e)}}else if(be(t)){r=Object.freeze(r.concat(t));let e=ke(`key`,t.key,n,r);if(e===Te)return Te;e===De&&(t.key=null);let i=ke(`value`,t.value,n,r);if(i===Te)return Te;i===De&&(t.value=null)}}return i}function Ae(e){return typeof e==`object`&&(e.Collection||e.Node||e.Value)?Object.assign({Alias:e.Node,Map:e.Node,Scalar:e.Node,Seq:e.Node},e.Value&&{Map:e.Value,Scalar:e.Value,Seq:e.Value},e.Collection&&{Map:e.Collection,Seq:e.Collection},e):e}function je(e,t,n,r){if(typeof n==`function`)return n(e,t,r);if(ye(t))return n.Map?.(e,t,r);if(xe(t))return n.Seq?.(e,t,r);if(be(t))return n.Pair?.(e,t,r);if(Y(t))return n.Scalar?.(e,t,r);if(_e(t))return n.Alias?.(e,t,r)}function Me(e,t,n){let r=t[t.length-1];if(Se(r))r.items[e]=n;else if(be(r))e===`key`?r.key=n:r.value=n;else if(ve(r))r.contents=n;else{let e=_e(r)?`alias`:`scalar`;throw Error(`Cannot replace node with ${e} parent`)}}function Ne(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){let t=`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;throw Error(t)}return!0}function Pe(e,t,n,r){if(r&&typeof r==`object`){if(Array.isArray(r))for(let t=0,n=r.length;t<n;++t){let n=r[t],i=Pe(e,r,String(t),n);i===void 0?delete r[t]:i!==n&&(r[t]=i)}else if(r instanceof Map)for(let t of Array.from(r.keys())){let n=r.get(t),i=Pe(e,r,t,n);i===void 0?r.delete(t):i!==n&&r.set(t,i)}else if(r instanceof Set)for(let t of Array.from(r)){let n=Pe(e,r,t,t);n===void 0?r.delete(t):n!==t&&(r.delete(t),r.add(n))}else for(let[t,n]of Object.entries(r)){let i=Pe(e,r,t,n);i===void 0?delete r[t]:i!==n&&(r[t]=i)}}return e.call(t,n,r)}function Fe(e,t,n){if(Array.isArray(e))return e.map((e,t)=>Fe(e,String(t),n));if(e&&typeof e.toJSON==`function`){if(!n||!we(e))return e.toJSON(t,n);let r={aliasCount:0,count:1,res:void 0};n.anchors.set(e,r),n.onCreate=e=>{r.res=e,delete n.onCreate};let i=e.toJSON(t,n);return n.onCreate&&n.onCreate(i),i}return typeof e==`bigint`&&!n?.keep?Number(e):e}var Ie=class{constructor(e){Object.defineProperty(this,ge,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:t,maxAliasCount:n,onAnchor:r,reviver:i}={}){if(!ve(e))throw TypeError(`A document argument is required`);let a={anchors:new Map,doc:e,keep:!0,mapAsMap:t===!0,mapKeyWarned:!1,maxAliasCount:typeof n==`number`?n:100},o=Fe(this,``,a);if(typeof r==`function`)for(let{count:e,res:t}of a.anchors.values())r(t,e);return typeof i==`function`?Pe(i,{"":o},``,o):o}},Le=class extends Ie{constructor(e){super(ue),this.source=e,Object.defineProperty(this,"tag",{set(){throw Error(`Alias nodes cannot have tags`)}})}resolve(e,t){if(t?.maxAliasCount===0)throw ReferenceError(`Alias resolution is disabled`);let n;t?.aliasResolveCache?n=t.aliasResolveCache:(n=[],Oe(e,{Node:(e,t)=>{(_e(t)||we(t))&&n.push(t)}}),t&&(t.aliasResolveCache=n));let r;for(let e of n){if(e===this)break;e.anchor===this.source&&(r=e)}return r}toJSON(e,t){if(!t)return{source:this.source};let{anchors:n,doc:r,maxAliasCount:i}=t,a=this.resolve(r,t);if(!a){let e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw ReferenceError(e)}let o=n.get(a);if(o||=(Fe(a,null,t),n.get(a)),o?.res===void 0)throw ReferenceError(`This should not happen: Alias anchor was not resolved?`);if(i>=0&&(o.count+=1,o.aliasCount===0&&(o.aliasCount=Re(r,a,n)),o.count*o.aliasCount>i))throw ReferenceError(`Excessive alias count indicates a resource exhaustion attack`);return o.res}toString(e,t,n){let r=`*${this.source}`;if(e){if(Ne(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw Error(e)}if(e.implicitKey)return`${r} `}return r}};function Re(e,t,n){if(_e(t)){let r=t.resolve(e),i=n&&r&&n.get(r);return i?i.count*i.aliasCount:0}if(Se(t)){let r=0;for(let i of t.items){let t=Re(e,i,n);t>r&&(r=t)}return r}if(be(t)){let r=Re(e,t.key,n),i=Re(e,t.value,n);return Math.max(r,i)}return 1}var ze=e=>!e||typeof e!=`function`&&typeof e!=`object`,Be=class extends Ie{constructor(e){super(me),this.value=e}toJSON(e,t){return t?.keep?this.value:Fe(this.value,e,t)}toString(){return String(this.value)}};Be.BLOCK_FOLDED=`BLOCK_FOLDED`,Be.BLOCK_LITERAL=`BLOCK_LITERAL`,Be.PLAIN=`PLAIN`,Be.QUOTE_DOUBLE=`QUOTE_DOUBLE`,Be.QUOTE_SINGLE=`QUOTE_SINGLE`;var Ve=`tag:yaml.org,2002:`;function He(e,t,n){if(t){let e=n.filter(e=>e.tag===t),r=e.find(e=>!e.format)??e[0];if(!r)throw Error(`Tag ${t} not found`);return r}return n.find(t=>t.identify?.(e)&&!t.format)}function Ue(e,t,n){if(ve(e)&&(e=e.contents),Ce(e))return e;if(be(e)){let t=n.schema[fe].createNode?.(n.schema,null,n);return t.items.push(e),t}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<`u`&&e instanceof BigInt)&&(e=e.valueOf());let{aliasDuplicateObjects:r,onAnchor:i,onTagObj:a,schema:o,sourceObjects:s}=n,c;if(r&&e&&typeof e==`object`){if(c=s.get(e),c)return c.anchor??(c.anchor=i(e)),new Le(c.anchor);c={anchor:null,node:null},s.set(e,c)}t?.startsWith(`!!`)&&(t=Ve+t.slice(2));let l=He(e,t,o.tags);if(!l){if(e&&typeof e.toJSON==`function`&&(e=e.toJSON()),!e||typeof e!=`object`){let t=new Be(e);return c&&(c.node=t),t}l=e instanceof Map?o[fe]:Symbol.iterator in Object(e)?o[he]:o[fe]}a&&(a(l),delete n.onTagObj);let u=l?.createNode?l.createNode(n.schema,e,n):typeof l?.nodeClass?.from==`function`?l.nodeClass.from(n.schema,e,n):new Be(e);return t?u.tag=t:l.default||(u.tag=l.tag),c&&(c.node=u),u}function We(e,t,n){let r=n;for(let e=t.length-1;e>=0;--e){let n=t[e];if(typeof n==`number`&&Number.isInteger(n)&&n>=0){let e=[];e[n]=r,r=e}else r=new Map([[n,r]])}return Ue(r,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw Error(`This should not happen, please report a bug.`)},schema:e,sourceObjects:new Map})}var Ge=e=>e==null||typeof e==`object`&&!!e[Symbol.iterator]().next().done,Ke=class extends Ie{constructor(e,t){super(e),Object.defineProperty(this,"schema",{value:t,configurable:!0,enumerable:!1,writable:!0})}clone(e){let t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(t.schema=e),t.items=t.items.map(t=>Ce(t)||be(t)?t.clone(e):t),this.range&&(t.range=this.range.slice()),t}addIn(e,t){if(Ge(e))this.add(t);else{let[n,...r]=e,i=this.get(n,!0);if(Se(i))i.addIn(r,t);else if(i===void 0&&this.schema)this.set(n,We(this.schema,r,t));else throw Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}}deleteIn(e){let[t,...n]=e;if(n.length===0)return this.delete(t);let r=this.get(t,!0);if(Se(r))return r.deleteIn(n);throw Error(`Expected YAML collection at ${t}. Remaining path: ${n}`)}getIn(e,t){let[n,...r]=e,i=this.get(n,!0);return r.length===0?!t&&Y(i)?i.value:i:Se(i)?i.getIn(r,t):void 0}hasAllNullValues(e){return this.items.every(t=>{if(!be(t))return!1;let n=t.value;return n==null||e&&Y(n)&&n.value==null&&!n.commentBefore&&!n.comment&&!n.tag})}hasIn(e){let[t,...n]=e;if(n.length===0)return this.has(t);let r=this.get(t,!0);return Se(r)?r.hasIn(n):!1}setIn(e,t){let[n,...r]=e;if(r.length===0)this.set(n,t);else{let e=this.get(n,!0);if(Se(e))e.setIn(r,t);else if(e===void 0&&this.schema)this.set(n,We(this.schema,r,t));else throw Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}}},qe=e=>e.replace(/^(?!$)(?: $)?/gm,`#`);function Je(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}var Ye=(e,t,n)=>e.endsWith(`
|
|
2
|
+
`)?Je(n,t):n.includes(`
|
|
3
|
+
`)?`
|
|
4
|
+
`+Je(n,t):(e.endsWith(` `)?``:` `)+n,Xe=`flow`,Ze=`block`,Qe=`quoted`;function $e(e,t,n=`flow`,{indentAtStart:r,lineWidth:i=80,minContentWidth:a=20,onFold:o,onOverflow:s}={}){if(!i||i<0)return e;i<a&&(a=0);let c=Math.max(1+a,1+i-t.length);if(e.length<=c)return e;let l=[],u={},d=i-t.length;typeof r==`number`&&(r>i-Math.max(2,a)?l.push(0):d=i-r);let f,p,m=!1,h=-1,g=-1,_=-1;n===`block`&&(h=et(e,h,t.length),h!==-1&&(d=h+c));for(let r;r=e[h+=1];){if(n===`quoted`&&r===`\\`){switch(g=h,e[h+1]){case`x`:h+=3;break;case`u`:h+=5;break;case`U`:h+=9;break;default:h+=1}_=h}if(r===`
|
|
5
|
+
`)n===`block`&&(h=et(e,h,t.length)),d=h+t.length+c,f=void 0;else{if(r===` `&&p&&p!==` `&&p!==`
|
|
6
|
+
`&&p!==` `){let t=e[h+1];t&&t!==` `&&t!==`
|
|
7
|
+
`&&t!==` `&&(f=h)}if(h>=d){if(f)l.push(f),d=f+c,f=void 0;else if(n===`quoted`){for(;p===` `||p===` `;)p=r,r=e[h+=1],m=!0;let t=h>_+1?h-2:g-1;if(u[t])return e;l.push(t),u[t]=!0,d=t+c,f=void 0}else m=!0}}p=r}if(m&&s&&s(),l.length===0)return e;o&&o();let v=e.slice(0,l[0]);for(let r=0;r<l.length;++r){let i=l[r],a=l[r+1]||e.length;i===0?v=`\n${t}${e.slice(0,a)}`:(n===`quoted`&&u[i]&&(v+=`${e[i]}\\`),v+=`\n${t}${e.slice(i+1,a)}`)}return v}function et(e,t,n){let r=t,i=t+1,a=e[i];for(;a===` `||a===` `;)if(t<i+n)a=e[++t];else{do a=e[++t];while(a&&a!==`
|
|
8
|
+
`);r=t,i=t+1,a=e[i]}return r}var tt=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),nt=e=>/^(%|---|\.\.\.)/m.test(e);function rt(e,t,n){if(!t||t<0)return!1;let r=t-n,i=e.length;if(i<=r)return!1;for(let t=0,n=0;t<i;++t)if(e[t]===`
|
|
9
|
+
`){if(t-n>r)return!0;if(n=t+1,i-n<=r)return!1}return!0}function it(e,t){let n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;let{implicitKey:r}=t,i=t.options.doubleQuotedMinMultiLineLength,a=t.indent||(nt(e)?` `:``),o=``,s=0;for(let e=0,t=n[e];t;t=n[++e])if(t===` `&&n[e+1]===`\\`&&n[e+2]===`n`&&(o+=n.slice(s,e)+`\\ `,e+=1,s=e,t=`\\`),t===`\\`)switch(n[e+1]){case`u`:{o+=n.slice(s,e);let t=n.substr(e+2,4);switch(t){case`0000`:o+=`\\0`;break;case`0007`:o+=`\\a`;break;case`000b`:o+=`\\v`;break;case`001b`:o+=`\\e`;break;case`0085`:o+=`\\N`;break;case`00a0`:o+=`\\_`;break;case`2028`:o+=`\\L`;break;case`2029`:o+=`\\P`;break;default:t.substr(0,2)===`00`?o+=`\\x`+t.substr(2):o+=n.substr(e,6)}e+=5,s=e+1}break;case`n`:if(r||n[e+2]===`"`||n.length<i)e+=1;else{for(o+=n.slice(s,e)+`
|
|
10
|
+
|
|
11
|
+
`;n[e+2]===`\\`&&n[e+3]===`n`&&n[e+4]!==`"`;)o+=`
|
|
12
|
+
`,e+=2;o+=a,n[e+2]===` `&&(o+=`\\`),e+=1,s=e+1}break;default:e+=1}return o=s?o+n.slice(s):n,r?o:$e(o,a,Qe,tt(t,!1))}function at(e,t){if(t.options.singleQuote===!1||t.implicitKey&&e.includes(`
|
|
13
|
+
`)||/[ \t]\n|\n[ \t]/.test(e))return it(e,t);let n=t.indent||(nt(e)?` `:``),r=`'`+e.replace(/'/g,`''`).replace(/\n+/g,`$&\n${n}`)+`'`;return t.implicitKey?r:$e(r,n,Xe,tt(t,!1))}function ot(e,t){let{singleQuote:n}=t.options,r;if(n===!1)r=it;else{let t=e.includes(`"`),i=e.includes(`'`);r=t&&!i?at:i&&!t?it:n?at:it}return r(e,t)}var st;try{st=RegExp(`(^|(?<!
|
|
14
|
+
))
|
|
15
|
+
+(?!
|
|
16
|
+
|$)`,`g`)}catch{st=/\n+(?!\n|$)/g}function ct({comment:e,type:t,value:n},r,i,a){let{blockQuote:o,commentString:s,lineWidth:c}=r.options;if(!o||/\n[\t ]+$/.test(n))return ot(n,r);let l=r.indent||(r.forceBlockIndent||nt(n)?` `:``),u=o===`literal`?!0:o===`folded`||t===Be.BLOCK_FOLDED?!1:t===Be.BLOCK_LITERAL||!rt(n,c,l.length);if(!n)return u?`|
|
|
17
|
+
`:`>
|
|
18
|
+
`;let d,f;for(f=n.length;f>0;--f){let e=n[f-1];if(e!==`
|
|
19
|
+
`&&e!==` `&&e!==` `)break}let p=n.substring(f),m=p.indexOf(`
|
|
20
|
+
`);m===-1?d=`-`:n===p||m!==p.length-1?(d=`+`,a&&a()):d=``,p&&=(n=n.slice(0,-p.length),p[p.length-1]===`
|
|
21
|
+
`&&(p=p.slice(0,-1)),p.replace(st,`$&${l}`));let h=!1,g,_=-1;for(g=0;g<n.length;++g){let e=n[g];if(e===` `)h=!0;else if(e===`
|
|
22
|
+
`)_=g;else break}let v=n.substring(0,_<g?_+1:g);v&&=(n=n.substring(v.length),v.replace(/\n+/g,`$&${l}`));let y=(h?l?`2`:`1`:``)+d;if(e&&(y+=` `+s(e.replace(/ ?[\r\n]+/g,` `)),i&&i()),!u){let e=n.replace(/\n+/g,`
|
|
23
|
+
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,`$1$2`).replace(/\n+/g,`$&${l}`),i=!1,a=tt(r,!0);o!==`folded`&&t!==Be.BLOCK_FOLDED&&(a.onOverflow=()=>{i=!0});let s=$e(`${v}${e}${p}`,l,Ze,a);if(!i)return`>${y}\n${l}${s}`}return n=n.replace(/\n+/g,`$&${l}`),`|${y}\n${l}${v}${n}${p}`}function lt(e,t,n,r){let{type:i,value:a}=e,{actualString:o,implicitKey:s,indent:c,indentStep:l,inFlow:u}=t;if(s&&a.includes(`
|
|
24
|
+
`)||u&&/[[\]{},]/.test(a))return ot(a,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(a))return s||u||!a.includes(`
|
|
25
|
+
`)?ot(a,t):ct(e,t,n,r);if(!s&&!u&&i!==Be.PLAIN&&a.includes(`
|
|
26
|
+
`))return ct(e,t,n,r);if(nt(a)){if(c===``)return t.forceBlockIndent=!0,ct(e,t,n,r);if(s&&c===l)return ot(a,t)}let d=a.replace(/\n+/g,`$&\n${c}`);if(o){let e=e=>e.default&&e.tag!==`tag:yaml.org,2002:str`&&e.test?.test(d),{compat:n,tags:r}=t.doc.schema;if(r.some(e)||n?.some(e))return ot(a,t)}return s?d:$e(d,c,Xe,tt(t,!1))}function ut(e,t,n,r){let{implicitKey:i,inFlow:a}=t,o=typeof e.value==`string`?e:Object.assign({},e,{value:String(e.value)}),{type:s}=e;s!==Be.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(s=Be.QUOTE_DOUBLE);let c=e=>{switch(e){case Be.BLOCK_FOLDED:case Be.BLOCK_LITERAL:return i||a?ot(o.value,t):ct(o,t,n,r);case Be.QUOTE_DOUBLE:return it(o.value,t);case Be.QUOTE_SINGLE:return at(o.value,t);case Be.PLAIN:return lt(o,t,n,r);default:return null}},l=c(s);if(l===null){let{defaultKeyType:e,defaultStringType:n}=t.options,r=i&&e||n;if(l=c(r),l===null)throw Error(`Unsupported default string type ${r}`)}return l}function dt(e,t){let n=Object.assign({blockQuote:!0,commentString:qe,defaultKeyType:null,defaultStringType:`PLAIN`,directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:`false`,flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:`null`,simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:`true`,verifyAliasOrder:!0},e.schema.toStringOptions,t),r;switch(n.collectionStyle){case`block`:r=!1;break;case`flow`:r=!0;break;default:r=null}return{anchors:new Set,doc:e,flowCollectionPadding:n.flowCollectionPadding?` `:``,indent:``,indentStep:typeof n.indent==`number`?` `.repeat(n.indent):` `,inFlow:r,options:n}}function ft(e,t){if(t.tag){let n=e.filter(e=>e.tag===t.tag);if(n.length>0)return n.find(e=>e.format===t.format)??n[0]}let n,r;if(Y(t)){r=t.value;let i=e.filter(e=>e.identify?.(r));if(i.length>1){let e=i.filter(e=>e.test);e.length>0&&(i=e)}n=i.find(e=>e.format===t.format)??i.find(e=>!e.format)}else r=t,n=e.find(e=>e.nodeClass&&r instanceof e.nodeClass);if(!n){let e=r?.constructor?.name??(r===null?`null`:typeof r);throw Error(`Tag not resolved for ${e} value`)}return n}function pt(e,t,{anchors:n,doc:r}){if(!r.directives)return``;let i=[],a=(Y(e)||Se(e))&&e.anchor;a&&Ne(a)&&(n.add(a),i.push(`&${a}`));let o=e.tag??(t.default?null:t.tag);return o&&i.push(r.directives.tagString(o)),i.join(` `)}function mt(e,t,n,r){if(be(e))return e.toString(t,n,r);if(_e(e)){if(t.doc.directives)return e.toString(t);if(t.resolvedAliases?.has(e))throw TypeError(`Cannot stringify circular structure without alias nodes`);t.resolvedAliases?t.resolvedAliases.add(e):t.resolvedAliases=new Set([e]),e=e.resolve(t.doc)}let i,a=Ce(e)?e:t.doc.createNode(e,{onTagObj:e=>i=e});i??=ft(t.doc.schema.tags,a);let o=pt(a,i,t);o.length>0&&(t.indentAtStart=(t.indentAtStart??0)+o.length+1);let s=typeof i.stringify==`function`?i.stringify(a,t,n,r):Y(a)?ut(a,t,n,r):a.toString(t,n,r);return o?Y(a)||s[0]===`{`||s[0]===`[`?`${o} ${s}`:`${o}\n${t.indent}${s}`:s}function ht({key:e,value:t},n,r,i){let{allNullValues:a,doc:o,indent:s,indentStep:c,options:{commentString:l,indentSeq:u,simpleKeys:d}}=n,f=Ce(e)&&e.comment||null;if(d){if(f)throw Error(`With simple keys, key nodes cannot have comments`);if(Se(e)||!Ce(e)&&typeof e==`object`)throw Error(`With simple keys, collection cannot be used as a key value`)}let p=!d&&(!e||f&&t==null&&!n.inFlow||Se(e)||(Y(e)?e.type===Be.BLOCK_FOLDED||e.type===Be.BLOCK_LITERAL:typeof e==`object`));n=Object.assign({},n,{allNullValues:!1,implicitKey:!p&&(d||!a),indent:s+c});let m=!1,h=!1,g=mt(e,n,()=>m=!0,()=>h=!0);if(!p&&!n.inFlow&&g.length>1024){if(d)throw Error(`With simple keys, single line scalar must not span more than 1024 characters`);p=!0}if(n.inFlow){if(a||t==null)return m&&r&&r(),g===``?`?`:p?`? ${g}`:g}else if(a&&!d||t==null&&p)return g=`? ${g}`,f&&!m?g+=Ye(g,n.indent,l(f)):h&&i&&i(),g;m&&(f=null),p?(f&&(g+=Ye(g,n.indent,l(f))),g=`? ${g}\n${s}:`):(g=`${g}:`,f&&(g+=Ye(g,n.indent,l(f))));let _,v,y;Ce(t)?(_=!!t.spaceBefore,v=t.commentBefore,y=t.comment):(_=!1,v=null,y=null,t&&typeof t==`object`&&(t=o.createNode(t))),n.implicitKey=!1,!p&&!f&&Y(t)&&(n.indentAtStart=g.length+1),h=!1,!u&&c.length>=2&&!n.inFlow&&!p&&xe(t)&&!t.flow&&!t.tag&&!t.anchor&&(n.indent=n.indent.substring(2));let b=!1,x=mt(t,n,()=>b=!0,()=>h=!0),S=` `;if(f||_||v){if(S=_?`
|
|
27
|
+
`:``,v){let e=l(v);S+=`\n${Je(e,n.indent)}`}x===``&&!n.inFlow?S===`
|
|
28
|
+
`&&y&&(S=`
|
|
29
|
+
|
|
30
|
+
`):S+=`\n${n.indent}`}else if(!p&&Se(t)){let e=x[0],r=x.indexOf(`
|
|
31
|
+
`),i=r!==-1,a=n.inFlow??t.flow??t.items.length===0;if(i||!a){let t=!1;if(i&&(e===`&`||e===`!`)){let n=x.indexOf(` `);e===`&`&&n!==-1&&n<r&&x[n+1]===`!`&&(n=x.indexOf(` `,n+1)),(n===-1||r<n)&&(t=!0)}t||(S=`\n${n.indent}`)}}else(x===``||x[0]===`
|
|
32
|
+
`)&&(S=``);return g+=S+x,n.inFlow?b&&r&&r():y&&!b?g+=Ye(g,n.indent,l(y)):h&&i&&i(),g}function gt(e,t){(e===`debug`||e===`warn`)&&console.warn(t)}var _t=`<<`,vt={identify:e=>e===_t||typeof e==`symbol`&&e.description===_t,default:`key`,tag:`tag:yaml.org,2002:merge`,test:/^<<$/,resolve:()=>Object.assign(new Be(Symbol(_t)),{addToJSMap:bt}),stringify:()=>_t},yt=(e,t)=>(vt.identify(t)||Y(t)&&(!t.type||t.type===Be.PLAIN)&&vt.identify(t.value))&&e?.doc.schema.tags.some(e=>e.tag===vt.tag&&e.default);function bt(e,t,n){let r=St(e,n);if(xe(r))for(let n of r.items)xt(e,t,n);else if(Array.isArray(r))for(let n of r)xt(e,t,n);else xt(e,t,r)}function xt(e,t,n){let r=St(e,n);if(!ye(r))throw Error(`Merge sources must be maps or map aliases`);let i=r.toJSON(null,e,Map);for(let[e,n]of i)t instanceof Map?t.has(e)||t.set(e,n):t instanceof Set?t.add(e):Object.prototype.hasOwnProperty.call(t,e)||Object.defineProperty(t,e,{value:n,writable:!0,enumerable:!0,configurable:!0});return t}function St(e,t){return e&&_e(t)?t.resolve(e.doc,e):t}function Ct(e,t,{key:n,value:r}){if(Ce(n)&&n.addToJSMap)n.addToJSMap(e,t,r);else if(yt(e,n))bt(e,t,r);else{let i=Fe(n,``,e);if(t instanceof Map)t.set(i,Fe(r,i,e));else if(t instanceof Set)t.add(i);else{let a=wt(n,i,e),o=Fe(r,a,e);a in t?Object.defineProperty(t,a,{value:o,writable:!0,enumerable:!0,configurable:!0}):t[a]=o}}return t}function wt(e,t,n){if(t===null)return``;if(typeof t!=`object`)return String(t);if(Ce(e)&&n?.doc){let t=dt(n.doc,{});t.anchors=new Set;for(let e of n.anchors.keys())t.anchors.add(e.anchor);t.inFlow=!0,t.inStringifyKey=!0;let r=e.toString(t);if(!n.mapKeyWarned){let e=JSON.stringify(r);e.length>40&&(e=e.substring(0,36)+`..."`),gt(n.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${e}. Set mapAsMap: true to use object keys.`),n.mapKeyWarned=!0}return r}return JSON.stringify(t)}function Tt(e,t,n){return new Et(Ue(e,void 0,n),Ue(t,void 0,n))}var Et=class e{constructor(e,t=null){Object.defineProperty(this,ge,{value:pe}),this.key=e,this.value=t}clone(t){let{key:n,value:r}=this;return Ce(n)&&(n=n.clone(t)),Ce(r)&&(r=r.clone(t)),new e(n,r)}toJSON(e,t){return Ct(t,t?.mapAsMap?new Map:{},this)}toString(e,t,n){return e?.doc?ht(this,e,t,n):JSON.stringify(this)}};function Dt(e,t,n){return(t.inFlow??e.flow?kt:Ot)(e,t,n)}function Ot({comment:e,items:t},n,{blockItemPrefix:r,flowChars:i,itemIndent:a,onChompKeep:o,onComment:s}){let{indent:c,options:{commentString:l}}=n,u=Object.assign({},n,{indent:a,type:null}),d=!1,f=[];for(let e=0;e<t.length;++e){let i=t[e],o=null;if(Ce(i))!d&&i.spaceBefore&&f.push(``),At(n,f,i.commentBefore,d),i.comment&&(o=i.comment);else if(be(i)){let e=Ce(i.key)?i.key:null;e&&(!d&&e.spaceBefore&&f.push(``),At(n,f,e.commentBefore,d))}d=!1;let s=mt(i,u,()=>o=null,()=>d=!0);o&&(s+=Ye(s,a,l(o))),d&&o&&(d=!1),f.push(r+s)}let p;if(f.length===0)p=i.start+i.end;else{p=f[0];for(let e=1;e<f.length;++e){let t=f[e];p+=t?`\n${c}${t}`:`
|
|
33
|
+
`}}return e?(p+=`
|
|
34
|
+
`+Je(l(e),c),s&&s()):d&&o&&o(),p}function kt({items:e},t,{flowChars:n,itemIndent:r}){let{indent:i,indentStep:a,flowCollectionPadding:o,options:{commentString:s}}=t;r+=a;let c=Object.assign({},t,{indent:r,inFlow:!0,type:null}),l=!1,u=0,d=[];for(let n=0;n<e.length;++n){let i=e[n],a=null;if(Ce(i))i.spaceBefore&&d.push(``),At(t,d,i.commentBefore,!1),i.comment&&(a=i.comment);else if(be(i)){let e=Ce(i.key)?i.key:null;e&&(e.spaceBefore&&d.push(``),At(t,d,e.commentBefore,!1),e.comment&&(l=!0));let n=Ce(i.value)?i.value:null;n?(n.comment&&(a=n.comment),n.commentBefore&&(l=!0)):i.value==null&&e?.comment&&(a=e.comment)}a&&(l=!0);let o=mt(i,c,()=>a=null);l||=d.length>u||o.includes(`
|
|
35
|
+
`),n<e.length-1?o+=`,`:t.options.trailingComma&&(t.options.lineWidth>0&&(l||=d.reduce((e,t)=>e+t.length+2,2)+(o.length+2)>t.options.lineWidth),l&&(o+=`,`)),a&&(o+=Ye(o,r,s(a))),d.push(o),u=d.length}let{start:f,end:p}=n;if(d.length===0)return f+p;if(!l){let e=d.reduce((e,t)=>e+t.length+2,2);l=t.options.lineWidth>0&&e>t.options.lineWidth}if(l){let e=f;for(let t of d)e+=t?`\n${a}${i}${t}`:`
|
|
36
|
+
`;return`${e}\n${i}${p}`}return`${f}${o}${d.join(` `)}${o}${p}`}function At({indent:e,options:{commentString:t}},n,r,i){if(r&&i&&(r=r.replace(/^\n+/,``)),r){let i=Je(t(r),e);n.push(i.trimStart())}}function jt(e,t){let n=Y(t)?t.value:t;for(let r of e)if(be(r)&&(r.key===t||r.key===n||Y(r.key)&&r.key.value===n))return r}var Mt=class extends Ke{static get tagName(){return`tag:yaml.org,2002:map`}constructor(e){super(fe,e),this.items=[]}static from(e,t,n){let{keepUndefined:r,replacer:i}=n,a=new this(e),o=(e,o)=>{if(typeof i==`function`)o=i.call(t,e,o);else if(Array.isArray(i)&&!i.includes(e))return;(o!==void 0||r)&&a.items.push(Tt(e,o,n))};if(t instanceof Map)for(let[e,n]of t)o(e,n);else if(t&&typeof t==`object`)for(let e of Object.keys(t))o(e,t[e]);return typeof e.sortMapEntries==`function`&&a.items.sort(e.sortMapEntries),a}add(e,t){let n;n=be(e)?e:!e||typeof e!=`object`||!(`key`in e)?new Et(e,e?.value):new Et(e.key,e.value);let r=jt(this.items,n.key),i=this.schema?.sortMapEntries;if(r){if(!t)throw Error(`Key ${n.key} already set`);Y(r.value)&&ze(n.value)?r.value.value=n.value:r.value=n.value}else if(i){let e=this.items.findIndex(e=>i(n,e)<0);e===-1?this.items.push(n):this.items.splice(e,0,n)}else this.items.push(n)}delete(e){let t=jt(this.items,e);return t?this.items.splice(this.items.indexOf(t),1).length>0:!1}get(e,t){let n=jt(this.items,e)?.value;return(!t&&Y(n)?n.value:n)??void 0}has(e){return!!jt(this.items,e)}set(e,t){this.add(new Et(e,t),!0)}toJSON(e,t,n){let r=n?new n:t?.mapAsMap?new Map:{};t?.onCreate&&t.onCreate(r);for(let e of this.items)Ct(t,r,e);return r}toString(e,t,n){if(!e)return JSON.stringify(this);for(let e of this.items)if(!be(e))throw Error(`Map items must all be pairs; found ${JSON.stringify(e)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),Dt(this,e,{blockItemPrefix:``,flowChars:{start:`{`,end:`}`},itemIndent:e.indent||``,onChompKeep:n,onComment:t})}},Nt={collection:`map`,default:!0,nodeClass:Mt,tag:`tag:yaml.org,2002:map`,resolve(e,t){return ye(e)||t(`Expected a mapping for this tag`),e},createNode:(e,t,n)=>Mt.from(e,t,n)},Pt=class extends Ke{static get tagName(){return`tag:yaml.org,2002:seq`}constructor(e){super(he,e),this.items=[]}add(e){this.items.push(e)}delete(e){let t=Ft(e);return typeof t==`number`&&this.items.splice(t,1).length>0}get(e,t){let n=Ft(e);if(typeof n!=`number`)return;let r=this.items[n];return!t&&Y(r)?r.value:r}has(e){let t=Ft(e);return typeof t==`number`&&t<this.items.length}set(e,t){let n=Ft(e);if(typeof n!=`number`)throw Error(`Expected a valid index, not ${e}.`);let r=this.items[n];Y(r)&&ze(t)?r.value=t:this.items[n]=t}toJSON(e,t){let n=[];t?.onCreate&&t.onCreate(n);let r=0;for(let e of this.items)n.push(Fe(e,String(r++),t));return n}toString(e,t,n){return e?Dt(this,e,{blockItemPrefix:`- `,flowChars:{start:`[`,end:`]`},itemIndent:(e.indent||``)+` `,onChompKeep:n,onComment:t}):JSON.stringify(this)}static from(e,t,n){let{replacer:r}=n,i=new this(e);if(t&&Symbol.iterator in Object(t)){let e=0;for(let a of t){if(typeof r==`function`){let n=t instanceof Set?a:String(e++);a=r.call(t,n,a)}i.items.push(Ue(a,void 0,n))}}return i}};function Ft(e){let t=Y(e)?e.value:e;return t&&typeof t==`string`&&(t=Number(t)),typeof t==`number`&&Number.isInteger(t)&&t>=0?t:null}var It={collection:`seq`,default:!0,nodeClass:Pt,tag:`tag:yaml.org,2002:seq`,resolve(e,t){return xe(e)||t(`Expected a sequence for this tag`),e},createNode:(e,t,n)=>Pt.from(e,t,n)};function Lt(e){return typeof e==`bigint`||Number.isInteger(e)}var Rt=({value:e})=>JSON.stringify(e),zt=[{identify:e=>typeof e==`string`,default:!0,tag:`tag:yaml.org,2002:str`,resolve:e=>e,stringify:Rt},{identify:e=>e==null,createNode:()=>new Be(null),default:!0,tag:`tag:yaml.org,2002:null`,test:/^null$/,resolve:()=>null,stringify:Rt},{identify:e=>typeof e==`boolean`,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^true$|^false$/,resolve:e=>e===`true`,stringify:Rt},{identify:Lt,default:!0,tag:`tag:yaml.org,2002:int`,test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(e,t,{intAsBigInt:n})=>n?BigInt(e):parseInt(e,10),stringify:({value:e})=>Lt(e)?e.toString():JSON.stringify(e)},{identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:e=>parseFloat(e),stringify:Rt}];[Nt,It].concat(zt,{default:!0,tag:``,test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}});function Bt(e,t,n){let{replacer:r}=n,i=new Pt(e);i.tag=`tag:yaml.org,2002:pairs`;let a=0;if(t&&Symbol.iterator in Object(t))for(let e of t){typeof r==`function`&&(e=r.call(t,String(a++),e));let o,s;if(Array.isArray(e)){if(e.length===2)o=e[0],s=e[1];else throw TypeError(`Expected [key, value] tuple: ${e}`)}else if(e&&e instanceof Object){let t=Object.keys(e);if(t.length===1)o=t[0],s=e[o];else throw TypeError(`Expected tuple with one key, not ${t.length} keys`)}else o=e;i.items.push(Tt(o,s,n))}return i}var Vt=class e extends Pt{constructor(){super(),this.add=Mt.prototype.add.bind(this),this.delete=Mt.prototype.delete.bind(this),this.get=Mt.prototype.get.bind(this),this.has=Mt.prototype.has.bind(this),this.set=Mt.prototype.set.bind(this),this.tag=e.tag}toJSON(e,t){if(!t)return super.toJSON(e);let n=new Map;t?.onCreate&&t.onCreate(n);for(let e of this.items){let r,i;if(be(e)?(r=Fe(e.key,``,t),i=Fe(e.value,r,t)):r=Fe(e,``,t),n.has(r))throw Error(`Ordered maps must not include duplicate keys`);n.set(r,i)}return n}static from(e,t,n){let r=Bt(e,t,n),i=new this;return i.items=r.items,i}};Vt.tag=`tag:yaml.org,2002:omap`;var Ht=class e extends Mt{constructor(t){super(t),this.tag=e.tag}add(e){let t;t=be(e)?e:e&&typeof e==`object`&&`key`in e&&`value`in e&&e.value===null?new Et(e.key,null):new Et(e,null),jt(this.items,t.key)||this.items.push(t)}get(e,t){let n=jt(this.items,e);return!t&&be(n)?Y(n.key)?n.key.value:n.key:n}set(e,t){if(typeof t!=`boolean`)throw Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof t}`);let n=jt(this.items,e);n&&!t?this.items.splice(this.items.indexOf(n),1):!n&&t&&this.items.push(new Et(e))}toJSON(e,t){return super.toJSON(e,t,Set)}toString(e,t,n){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),t,n);throw Error(`Set items must all have null values`)}static from(e,t,n){let{replacer:r}=n,i=new this(e);if(t&&Symbol.iterator in Object(t))for(let e of t)typeof r==`function`&&(e=r.call(t,e,e)),i.items.push(Tt(e,null,n));return i}};Ht.tag=`tag:yaml.org,2002:set`;var Ut=Symbol(`break visit`),Wt=Symbol(`skip children`),Gt=Symbol(`remove item`);function Kt(e,t){`type`in e&&e.type===`document`&&(e={start:e.start,value:e.value}),qt(Object.freeze([]),e,t)}Kt.BREAK=Ut,Kt.SKIP=Wt,Kt.REMOVE=Gt,Kt.itemAtPath=(e,t)=>{let n=e;for(let[e,r]of t){let t=n?.[e];if(t&&`items`in t)n=t.items[r];else return}return n},Kt.parentCollection=(e,t)=>{let n=Kt.itemAtPath(e,t.slice(0,-1)),r=t[t.length-1][0],i=n?.[r];if(i&&`items`in i)return i;throw Error(`Parent collection not found`)};function qt(e,t,n){let r=n(t,e);if(typeof r==`symbol`)return r;for(let i of[`key`,`value`]){let a=t[i];if(a&&`items`in a){for(let t=0;t<a.items.length;++t){let r=qt(Object.freeze(e.concat([[i,t]])),a.items[t],n);if(typeof r==`number`)t=r-1;else if(r===Ut)return Ut;else r===Gt&&(a.items.splice(t,1),--t)}typeof r==`function`&&i===`key`&&(r=r(t,e))}}return typeof r==`function`?r(t,e):r}var Jt=[{id:`image_generation`,name:`ImageGen`,description:`Generate images with the configured image model and save them to the session scratch directory`},{id:`subagent`,name:`Subagent`,description:`Unified agents: delegate one-shot tasks or keep persistent coworkers under Main control`},{id:`workflow`,name:`Workflow`,description:`Run a JavaScript workflow that fans work out across subagents. Live status appears in the side panel.`},{id:`todo`,name:`Todo`,description:`Task list: track progress on multi-step work`},{id:`plan`,name:`Plan mode`,description:`Plan mode: research read-only, submit a plan for approval, then carry it out after approval`},{id:`ask_user`,name:`Ask user`,description:`Ask the user a question and wait for an answer (options / timeout)`},{id:`browser`,name:`Browser`,description:`Built-in browser: open pages in Enso's own Chromium, read snapshots, click and type by ref`},{id:`web`,name:`Web search`,description:`Web search and fetch: search with the session model's built-in search (falls back to a keyless service) and read public pages as markdown`},{id:`background_tasks`,name:`Background tasks`,description:`Background shell task: run long commands in the background and notify on completion`},{id:`memory`,name:`Memory`,description:`Long-term memory: the agent can search, capture and consolidate durable decisions, preferences and lessons across sessions`},{id:`turn_discard`,name:`Turn discard`,description:`Let the agent drop an irrelevant automatic delivery or throwaway exchange from its context; the timeline keeps it and turn_recall can read it back`},{id:`isolated_sandbox`,name:`Isolated sandbox`,description:`Run JavaScript in an isolated sandbox that can call session tools. Intermediate reads and edits stay out of the chat; only the returned value is added to the conversation.`},{id:`computer`,name:`Computer`,description:`Host desktop: list windows, screenshot, accessibility tree, and input. Default off. Not the built-in browser.`}],Yt=[`memory`,`computer`];function Xt(e){return Array.isArray(e)?e.filter(e=>typeof e==`string`):[...Yt]}function Zt(e,t){return Array.isArray(t?.disabledBuiltinTools)?Xt(t.disabledBuiltinTools):Xt(e)}function Qt(e,t,n,r){return!Zt(e,{disabledBuiltinTools:$t(t,n)}).includes(r)}function $t(e,t){if(!(!t||!Array.isArray(e)))for(let n of e){if(!n||typeof n!=`object`||Array.isArray(n))continue;let e=n;if(e.id===t)return e.disabledBuiltinTools}}var en=`<secretary-silent/>`,tn=`silence_turn`;function nn(e){return/<session-updates>|<secretary-schedule>|<secretary-message>/.test(e)?e.replace(/<session-updates>[\s\S]*?<\/session-updates>/g,``).replace(/<secretary-schedule>[\s\S]*?<\/secretary-schedule>/g,``).replace(/<secretary-message>[\s\S]*?<\/secretary-message>/g,``).trim().length===0:!1}function rn(e){return e.trim()===en}var an=`project_list.project_info.repo_status.session_list.session_read.session_tasks.session_activity.session_create.session_send.session_queue_list.session_queue_cancel.session_stop.session_task_stop.session_archive.result_mark_done.result_mark_undo.session_answer.session_takeover_propose.image_view.contact_send_file.cleanup_list.cleanup_apply.todo_list.todo_item_add.todo_item_update.todo_item_dispatch.schedule_add.schedule_list.schedule_remove.secretary_profile_propose.skill_propose.tool_propose.secretary_list.secretary_message`.split(`.`);[...an];var on=new Set([`ask_user`,`web`,`memory`]);[...Jt.map(e=>e.id).filter(e=>!on.has(e))];var sn=15e3;Object.freeze({yieldDefaultMs:45e3,yieldBuildMs:18e4,yieldServerMs:1e4,quietMs:sn,taskWaitMaxMs:3e4,maxTasks:20,logMaxBytes:268435456,killGraceMs:5e3});var cn=32768,ln=e=>!!e&&typeof e==`object`&&!Array.isArray(e),un=e=>Number.isInteger(e)&&e>=0,dn=e=>typeof e==`number`&&Number.isFinite(e)&&e>=0;function fn(e){if(!ln(e)||!un(e.inputTokens)||!un(e.outputTokens))return;let t={inputTokens:e.inputTokens,outputTokens:e.outputTokens};for(let n of[`cacheHitPercent`,`ttftAvgMs`,`tokensPerSecond`]){let r=e[n];if(r!==void 0){if(!dn(r))return;t[n]=r}}return t}var pn=e(i(),1),mn=e=>typeof e==`string`&&e.length>0,hn=e=>!!e&&typeof e==`object`&&mn(e.data)&&mn(e.mimeType);function gn(e){if(!Array.isArray(e))return[];let t=new Set,n=[];for(let r of e){if(!r||typeof r!=`object`)continue;let e=r;if(!mn(e.deliveryId)||!mn(e.chatId)||typeof e.text!=`string`||typeof e.createdAt!=`number`||t.has(e.deliveryId)||e.images!==void 0&&!(Array.isArray(e.images)&&e.images.every(hn)))continue;t.add(e.deliveryId);let i=e.status===`failed`;n.push({deliveryId:e.deliveryId,chatId:e.chatId,text:e.text,...e.images?{images:e.images}:{},createdAt:e.createdAt,status:i?`failed`:`pending`,...i&&typeof e.error==`string`?{error:e.error}:{}})}return n}var _n=class{storage;pairId;items=[];listeners=new Set;writing=Promise.resolve();newId;now;durable=new Set;sentAt=new Map;loadFailed=!1;loading;constructor(e,t,n={}){this.storage=e,this.pairId=t,this.newId=n.newId??(()=>crypto.randomUUID()),this.now=n.now??Date.now}async restore(){let e=this.loadExisting();this.loading=e;try{await e}finally{this.loading===e&&(this.loading=void 0)}}async loadExisting(){let e;try{e=gn(await this.storage.load(this.pairId)),this.loadFailed=!1}catch(e){throw this.loadFailed=!0,e}let t=new Set(this.items.map(e=>e.deliveryId)),n=e.filter(e=>!t.has(e.deliveryId));if(n.length!==0){this.items=[...n,...this.items];for(let e of n)this.durable.add(e.deliveryId);for(let e of this.listeners)e([...this.items])}}list(e){return e?this.items.filter(t=>t.chatId===e):[...this.items]}subscribe(e){return this.listeners.add(e),()=>this.listeners.delete(e)}enqueue(e){let t={deliveryId:this.newId(),chatId:e.chatId,text:e.text,...e.images?.length?{images:e.images}:{},createdAt:this.now(),status:`pending`};return this.items=[...this.items,t],this.changed(),t}drain(){let e=this.items.filter(e=>e.status===`pending`&&this.durable.has(e.deliveryId));if(e.length===0)return[];let t=new Set(e.map(e=>e.deliveryId));for(let e of t)this.sentAt.set(e,this.now());return this.update(e=>t.has(e.deliveryId)?{...e,status:`sending`}:e),e}interrupted(){this.sentAt.clear(),this.items.some(e=>e.status===`sending`)&&this.update(e=>e.status===`sending`?{...e,status:`pending`}:e)}settle(e,t,n){if(this.sentAt.delete(e),this.items.some(t=>t.deliveryId===e)){if(t){this.durable.delete(e),this.items=this.items.filter(t=>t.deliveryId!==e),this.changed();return}this.update(t=>t.deliveryId===e?{...t,status:`failed`,...n?{error:n}:{}}:t)}}retry(e){this.durable.delete(e),this.update(t=>{if(t.deliveryId!==e||t.status!==`failed`)return t;let{error:n,...r}=t;return{...r,status:`pending`}})}async discard(e){if(!this.items.some(t=>t.deliveryId===e))return;this.durable.delete(e),this.sentAt.delete(e),this.items=this.items.map(t=>t.deliveryId===e?{...t,status:`failed`,error:`outbox-discarding`}:t);for(let e of this.listeners)e([...this.items]);let t=this.writing.then(async()=>{try{await this.loading,this.loadFailed&&await this.loadExisting(),await this.storage.save(this.pairId,this.items.filter(t=>t.deliveryId!==e)),this.items=this.items.filter(t=>t.deliveryId!==e)}catch{this.items=this.items.map(t=>t.deliveryId===e?{...t,status:`failed`,error:`outbox-discard`}:t),await this.storage.save(this.pairId,this.items).catch(()=>{})}for(let e of this.listeners)e([...this.items])});return this.writing=t,t}flushed(){return this.writing}expire(e=this.now()){for(let[t,n]of this.sentAt)e-n>=6e4&&this.settle(t,!1,`delivery-unconfirmed`)}update(e){this.items=this.items.map(e),this.changed()}changed(){for(let e of this.listeners)e([...this.items]);this.writing=this.writing.then(async()=>{let e=[...this.items];try{await this.loading,this.loadFailed&&await this.loadExisting(),e=[...this.items],await this.storage.save(this.pairId,e);let t=!1;for(let n of e){let e=this.items.find(e=>e.deliveryId===n.deliveryId);!e||this.durable.has(n.deliveryId)||(this.durable.add(n.deliveryId),e.status===`pending`&&(t=!0))}if(t)for(let e of this.listeners)e([...this.items])}catch{this.items=this.items.map(t=>t.status!==`pending`||!e.includes(t)?t:(this.durable.delete(t.deliveryId),{...t,status:`failed`,error:`outbox-storage`}));for(let e of this.listeners)e([...this.items])}})}},vn=`enso-phone-outbox`,yn=`outbox`;function bn(e=globalThis.indexedDB){let t=null,n=()=>e?(t??=new Promise((t,n)=>{let r=e.open(vn,1);r.onupgradeneeded=()=>{r.result.objectStoreNames.contains(yn)||r.result.createObjectStore(yn)},r.onsuccess=()=>t(r.result),r.onerror=()=>n(r.error)}).catch(e=>{throw t=null,e}),t):Promise.reject(Error(`IndexedDB unavailable`)),r=async(e,t)=>{let r=await n();return new Promise((n,i)=>{let a=r.transaction(yn,e),o=t(a.objectStore(yn));a.oncomplete=()=>n(o.result),a.onabort=()=>i(a.error??Error(`Outbox transaction aborted`)),a.onerror=()=>i(a.error),o.onerror=()=>i(o.error)})};return{load:e=>r(`readonly`,t=>t.get(e)),save:async(e,t)=>{await r(`readwrite`,n=>t.length>0?n.put(t,e):n.delete(e))},remove:async e=>{await r(`readwrite`,t=>t.delete(e))}}}var xn=bn();function Sn(e){return{expandLiveReasoning:e.expandLiveReasoning!==!1,autoCollapseTurns:e.autoCollapseTurns===!0,collapseCompletedActivity:e.collapseCompletedActivity!==!1,collapseLiveActivity:e.collapseLiveActivity===!0,pinUnfinishedTodos:e.pinUnfinishedTodos!==!1}}var Cn={language:`system`,theme:`system`,terminalTheme:``,terminalFontFamily:``,syncTerminalTheme:!1,providers:[],projects:[],skills:[],presets:[],agentTypes:[],loadLocalSkills:!0,compactReadOnlyTools:!0,expandLiveEdits:!0,...Sn({}),keybindings:{},privacyMasking:se,contextMenuOpen:[]},wn=new Set;function Tn(e){let t=Cn;Cn={...Cn,...e};for(let e of wn)e(Cn,t)}var En;function Dn(e,t){En=e,Tn({terminalTheme:e?`host`:``,terminalFontFamily:t??``})}function On(e){Cn.compactReadOnlyTools!==e&&Tn({compactReadOnlyTools:e})}function kn(e){Cn.expandLiveEdits!==e&&Tn({expandLiveEdits:e})}function An(e){Object.keys(e).some(t=>Cn[t]!==e[t])&&Tn(e)}function jn(e,t){(Cn.theme!==e||Cn.syncTerminalTheme!==t)&&Tn({theme:e,syncTerminalTheme:t})}function Mn(){return En}var Nn=e=>(wn.add(e),()=>{wn.delete(e)});function Pn(e){return(0,pn.useSyncExternalStore)(Nn,()=>e(Cn))}Pn.getState=()=>Cn,Pn.subscribe=Nn;var Fn=`enso-remote-images`,In=120,Ln=8388608,Rn=/\/desk\/li\/([^/]+)\/([^?#]+)$/;function zn(e){let t=Rn.exec(e.startsWith(`/`)?e:Bn(e));if(!t)return null;let n;try{n=new URL(decodeURIComponent(t[2]))}catch{return null}if(n.protocol!==`local-image:`||!n.searchParams.get(`v`))return null;let r=n.hostname,i=r===`secretary-avatar`?`${r}?s=${n.searchParams.get(`s`)??``}`:r===`bot-avatar`||r===`plugin-asset`||r===`secretary-report`?`${r}${n.pathname}`:null;return i?{pair:t[1],identity:`${t[1]}\n${i}`}:null}function Bn(e){try{return new URL(e).pathname}catch{return``}}var Vn=e=>typeof e==`string`?e:e.url;async function Hn(e,t){if(zn(t))return(await e.open(Fn)).match(t)}async function Un(e,t,n){let r=zn(t);if(!r||n.status!==200||!n.mime.startsWith(`image/`)||n.body.byteLength===0||n.body.byteLength>Ln)return;let i=await e.open(Fn),a=(await i.keys()).map(Vn),o=a.filter(e=>e!==t&&zn(e)?.identity===r.identity);for(let e of o)await i.delete(e);await i.put(t,new Response(n.body.slice(),{headers:{"Content-Type":n.mime}}));let s=a.filter(e=>e!==t&&!o.includes(e));for(let e of s.slice(0,Math.max(0,s.length+1-In)))await i.delete(e)}async function Wn(e,t){let n=zn(t);if(!n)return;let r=await e.open(Fn),i=await r.match(t);if(i)return i;let a=(await r.keys()).map(Vn).filter(e=>zn(e)?.identity===n.identity).at(-1);return a?r.match(a):void 0}async function Gn(e,t){let n=await e.open(Fn);for(let e of(await n.keys()).map(Vn))t(e)&&await n.delete(e)}function Kn(e,t){let n=new Set(t.map(e=>encodeURIComponent(e)));return Gn(e,e=>{let t=Rn.exec(Bn(e))?.[1];return t===void 0||!n.has(t)})}function qn(e,t,n){let r=/^\/desk\/li\/([^/]+)\/$/.exec(t)?.[1];if(!r)return Promise.resolve();let i=new Set(n.map(e=>`${r}\n${F}?s=${e}`)),a=`${r}\n${F}?s=`;return Gn(e,e=>{let t=zn(e)?.identity;return!!t&&t.startsWith(a)&&t!==a&&!i.has(t)})}var Jn=/\ssrc="((?:https?:\/\/[^/"]+)?\/desk\/li\/[^"]+)"/g;async function Yn(e,t){let n=[...new Set([...e.matchAll(Jn)].map(e=>e[1]))],r=new Map;for(let e of n)r.set(e,await t(e).catch(()=>null));return e.replace(Jn,(e,t)=>{let n=r.get(t);return n?` src="${n}"`:``})}var Xn={background:`#1e1e1e`,foreground:`#d4d4d4`,cursor:`#d4d4d4`,cursorAccent:`#1e1e1e`,selectionBackground:`#264f78`,selectionForeground:`#ffffff`,black:`#000000`,red:`#cd3131`,green:`#0dbc79`,yellow:`#e5e510`,blue:`#2472c8`,magenta:`#bc3fbc`,cyan:`#11a8cd`,white:`#e5e5e5`,brightBlack:`#666666`,brightRed:`#f14c4c`,brightGreen:`#23d18b`,brightYellow:`#f5f543`,brightBlue:`#3b8eea`,brightMagenta:`#d670d6`,brightCyan:`#29b8db`,brightWhite:`#ffffff`};function Zn(e){return Mn()}function Qn(e){let t=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})/i.exec(e.trim());return t?{r:Number.parseInt(t[1],16),g:Number.parseInt(t[2],16),b:Number.parseInt(t[3],16)}:null}function $n(e,t,n){return`#${[e,t,n].map(e=>Math.round(e).toString(16).padStart(2,`0`)).join(``)}`}function er(e,t,n){let r=Qn(e),i=Qn(t);if(!r||!i)return e;let a=Math.max(0,Math.min(1,n));return $n(r.r*(1-a)+i.r*a,r.g*(1-a)+i.g*a,r.b*(1-a)+i.b*a)}function tr(e){let t=Qn(e);if(!t)return 0;let[n,r,i]=[t.r,t.g,t.b].map(e=>{let t=e/255;return t<=.03928?t/12.92:((t+.055)/1.055)**2.4});return .2126*n+.7152*r+.0722*i}function nr(e){let t=Zn();return!t||tr(t.background)<.5}var rr=[`--background`,`--foreground`,`--card`,`--card-foreground`,`--popover`,`--popover-foreground`,`--primary`,`--primary-foreground`,`--secondary`,`--secondary-foreground`,`--muted`,`--muted-foreground`,`--accent`,`--accent-foreground`,`--destructive`,`--destructive-foreground`,`--success`,`--success-foreground`,`--warning`,`--warning-foreground`,`--info`,`--info-foreground`,`--border`,`--input`,`--ring`];function ir(e,t=!0){let n=Zn();if(!n)return;let r=document.documentElement,i=tr(n.background)<.5;t&&r.classList.toggle(`dark`,i),r.style.setProperty(`--background`,n.background),r.style.setProperty(`--foreground`,n.foreground),r.style.setProperty(`--card`,n.background),r.style.setProperty(`--card-foreground`,n.foreground),r.style.setProperty(`--popover`,n.background),r.style.setProperty(`--popover-foreground`,n.foreground),r.style.setProperty(`--primary`,n.foreground),r.style.setProperty(`--primary-foreground`,n.background);let a=i?er(n.background,n.brightBlack,.5):er(n.background,n.black,.1);r.style.setProperty(`--secondary`,a),r.style.setProperty(`--secondary-foreground`,n.foreground);let o=i?er(n.background,n.brightBlack,.4):er(n.background,n.black,.08),s=i?er(n.foreground,n.background,.4):er(n.foreground,n.background,.3);r.style.setProperty(`--muted`,o),r.style.setProperty(`--muted-foreground`,s);let c=i?n.brightBlue:n.blue,l=er(n.background,c,.3);r.style.setProperty(`--accent`,l),r.style.setProperty(`--accent-foreground`,tr(l)<.5?`#ffffff`:`#000000`),r.style.setProperty(`--destructive`,n.red),r.style.setProperty(`--destructive-foreground`,`#ffffff`),r.style.setProperty(`--success`,n.green),r.style.setProperty(`--success-foreground`,`#ffffff`),r.style.setProperty(`--warning`,n.yellow),r.style.setProperty(`--warning-foreground`,i?n.background:`#000000`),r.style.setProperty(`--info`,n.blue),r.style.setProperty(`--info-foreground`,`#ffffff`);let u=i?er(n.background,n.foreground,.15):er(n.background,n.foreground,.12);r.style.setProperty(`--border`,u),r.style.setProperty(`--input`,u),r.style.setProperty(`--ring`,i?n.brightBlue:n.blue)}function ar(){for(let e of rr)document.documentElement.style.removeProperty(e)}var or=n(((e,t)=>{t.exports={}})),sr=e(n(((e,n)=>{(function(e){var n=function(e){var t,n=new Float64Array(16);if(e)for(t=0;t<e.length;t++)n[t]=e[t];return n},r=function(){throw Error(`no PRNG`)},i=new Uint8Array(16),a=new Uint8Array(32);a[0]=9;var o=n(),s=n([1]),c=n([56129,1]),l=n([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),u=n([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),d=n([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),f=n([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),p=n([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function m(e,t,n,r){e[t]=n>>24&255,e[t+1]=n>>16&255,e[t+2]=n>>8&255,e[t+3]=n&255,e[t+4]=r>>24&255,e[t+5]=r>>16&255,e[t+6]=r>>8&255,e[t+7]=r&255}function h(e,t,n,r,i){var a,o=0;for(a=0;a<i;a++)o|=e[t+a]^n[r+a];return(1&o-1>>>8)-1}function g(e,t,n,r){return h(e,t,n,r,16)}function _(e,t,n,r){return h(e,t,n,r,32)}function v(e,t,n,r){for(var i=r[0]&255|(r[1]&255)<<8|(r[2]&255)<<16|(r[3]&255)<<24,a=n[0]&255|(n[1]&255)<<8|(n[2]&255)<<16|(n[3]&255)<<24,o=n[4]&255|(n[5]&255)<<8|(n[6]&255)<<16|(n[7]&255)<<24,s=n[8]&255|(n[9]&255)<<8|(n[10]&255)<<16|(n[11]&255)<<24,c=n[12]&255|(n[13]&255)<<8|(n[14]&255)<<16|(n[15]&255)<<24,l=r[4]&255|(r[5]&255)<<8|(r[6]&255)<<16|(r[7]&255)<<24,u=t[0]&255|(t[1]&255)<<8|(t[2]&255)<<16|(t[3]&255)<<24,d=t[4]&255|(t[5]&255)<<8|(t[6]&255)<<16|(t[7]&255)<<24,f=t[8]&255|(t[9]&255)<<8|(t[10]&255)<<16|(t[11]&255)<<24,p=t[12]&255|(t[13]&255)<<8|(t[14]&255)<<16|(t[15]&255)<<24,m=r[8]&255|(r[9]&255)<<8|(r[10]&255)<<16|(r[11]&255)<<24,h=n[16]&255|(n[17]&255)<<8|(n[18]&255)<<16|(n[19]&255)<<24,g=n[20]&255|(n[21]&255)<<8|(n[22]&255)<<16|(n[23]&255)<<24,_=n[24]&255|(n[25]&255)<<8|(n[26]&255)<<16|(n[27]&255)<<24,v=n[28]&255|(n[29]&255)<<8|(n[30]&255)<<16|(n[31]&255)<<24,y=r[12]&255|(r[13]&255)<<8|(r[14]&255)<<16|(r[15]&255)<<24,b=i,x=a,S=o,C=s,w=c,T=l,E=u,D=d,O=f,k=p,A=m,j=h,M=g,N=_,P=v,F=y,I,L=0;L<20;L+=2)I=b+M|0,w^=I<<7|I>>>25,I=w+b|0,O^=I<<9|I>>>23,I=O+w|0,M^=I<<13|I>>>19,I=M+O|0,b^=I<<18|I>>>14,I=T+x|0,k^=I<<7|I>>>25,I=k+T|0,N^=I<<9|I>>>23,I=N+k|0,x^=I<<13|I>>>19,I=x+N|0,T^=I<<18|I>>>14,I=A+E|0,P^=I<<7|I>>>25,I=P+A|0,S^=I<<9|I>>>23,I=S+P|0,E^=I<<13|I>>>19,I=E+S|0,A^=I<<18|I>>>14,I=F+j|0,C^=I<<7|I>>>25,I=C+F|0,D^=I<<9|I>>>23,I=D+C|0,j^=I<<13|I>>>19,I=j+D|0,F^=I<<18|I>>>14,I=b+C|0,x^=I<<7|I>>>25,I=x+b|0,S^=I<<9|I>>>23,I=S+x|0,C^=I<<13|I>>>19,I=C+S|0,b^=I<<18|I>>>14,I=T+w|0,E^=I<<7|I>>>25,I=E+T|0,D^=I<<9|I>>>23,I=D+E|0,w^=I<<13|I>>>19,I=w+D|0,T^=I<<18|I>>>14,I=A+k|0,j^=I<<7|I>>>25,I=j+A|0,O^=I<<9|I>>>23,I=O+j|0,k^=I<<13|I>>>19,I=k+O|0,A^=I<<18|I>>>14,I=F+P|0,M^=I<<7|I>>>25,I=M+F|0,N^=I<<9|I>>>23,I=N+M|0,P^=I<<13|I>>>19,I=P+N|0,F^=I<<18|I>>>14;b=b+i|0,x=x+a|0,S=S+o|0,C=C+s|0,w=w+c|0,T=T+l|0,E=E+u|0,D=D+d|0,O=O+f|0,k=k+p|0,A=A+m|0,j=j+h|0,M=M+g|0,N=N+_|0,P=P+v|0,F=F+y|0,e[0]=b>>>0&255,e[1]=b>>>8&255,e[2]=b>>>16&255,e[3]=b>>>24&255,e[4]=x>>>0&255,e[5]=x>>>8&255,e[6]=x>>>16&255,e[7]=x>>>24&255,e[8]=S>>>0&255,e[9]=S>>>8&255,e[10]=S>>>16&255,e[11]=S>>>24&255,e[12]=C>>>0&255,e[13]=C>>>8&255,e[14]=C>>>16&255,e[15]=C>>>24&255,e[16]=w>>>0&255,e[17]=w>>>8&255,e[18]=w>>>16&255,e[19]=w>>>24&255,e[20]=T>>>0&255,e[21]=T>>>8&255,e[22]=T>>>16&255,e[23]=T>>>24&255,e[24]=E>>>0&255,e[25]=E>>>8&255,e[26]=E>>>16&255,e[27]=E>>>24&255,e[28]=D>>>0&255,e[29]=D>>>8&255,e[30]=D>>>16&255,e[31]=D>>>24&255,e[32]=O>>>0&255,e[33]=O>>>8&255,e[34]=O>>>16&255,e[35]=O>>>24&255,e[36]=k>>>0&255,e[37]=k>>>8&255,e[38]=k>>>16&255,e[39]=k>>>24&255,e[40]=A>>>0&255,e[41]=A>>>8&255,e[42]=A>>>16&255,e[43]=A>>>24&255,e[44]=j>>>0&255,e[45]=j>>>8&255,e[46]=j>>>16&255,e[47]=j>>>24&255,e[48]=M>>>0&255,e[49]=M>>>8&255,e[50]=M>>>16&255,e[51]=M>>>24&255,e[52]=N>>>0&255,e[53]=N>>>8&255,e[54]=N>>>16&255,e[55]=N>>>24&255,e[56]=P>>>0&255,e[57]=P>>>8&255,e[58]=P>>>16&255,e[59]=P>>>24&255,e[60]=F>>>0&255,e[61]=F>>>8&255,e[62]=F>>>16&255,e[63]=F>>>24&255}function y(e,t,n,r){for(var i=r[0]&255|(r[1]&255)<<8|(r[2]&255)<<16|(r[3]&255)<<24,a=n[0]&255|(n[1]&255)<<8|(n[2]&255)<<16|(n[3]&255)<<24,o=n[4]&255|(n[5]&255)<<8|(n[6]&255)<<16|(n[7]&255)<<24,s=n[8]&255|(n[9]&255)<<8|(n[10]&255)<<16|(n[11]&255)<<24,c=n[12]&255|(n[13]&255)<<8|(n[14]&255)<<16|(n[15]&255)<<24,l=r[4]&255|(r[5]&255)<<8|(r[6]&255)<<16|(r[7]&255)<<24,u=t[0]&255|(t[1]&255)<<8|(t[2]&255)<<16|(t[3]&255)<<24,d=t[4]&255|(t[5]&255)<<8|(t[6]&255)<<16|(t[7]&255)<<24,f=t[8]&255|(t[9]&255)<<8|(t[10]&255)<<16|(t[11]&255)<<24,p=t[12]&255|(t[13]&255)<<8|(t[14]&255)<<16|(t[15]&255)<<24,m=r[8]&255|(r[9]&255)<<8|(r[10]&255)<<16|(r[11]&255)<<24,h=n[16]&255|(n[17]&255)<<8|(n[18]&255)<<16|(n[19]&255)<<24,g=n[20]&255|(n[21]&255)<<8|(n[22]&255)<<16|(n[23]&255)<<24,_=n[24]&255|(n[25]&255)<<8|(n[26]&255)<<16|(n[27]&255)<<24,v=n[28]&255|(n[29]&255)<<8|(n[30]&255)<<16|(n[31]&255)<<24,y=r[12]&255|(r[13]&255)<<8|(r[14]&255)<<16|(r[15]&255)<<24,b=i,x=a,S=o,C=s,w=c,T=l,E=u,D=d,O=f,k=p,A=m,j=h,M=g,N=_,P=v,F=y,I,L=0;L<20;L+=2)I=b+M|0,w^=I<<7|I>>>25,I=w+b|0,O^=I<<9|I>>>23,I=O+w|0,M^=I<<13|I>>>19,I=M+O|0,b^=I<<18|I>>>14,I=T+x|0,k^=I<<7|I>>>25,I=k+T|0,N^=I<<9|I>>>23,I=N+k|0,x^=I<<13|I>>>19,I=x+N|0,T^=I<<18|I>>>14,I=A+E|0,P^=I<<7|I>>>25,I=P+A|0,S^=I<<9|I>>>23,I=S+P|0,E^=I<<13|I>>>19,I=E+S|0,A^=I<<18|I>>>14,I=F+j|0,C^=I<<7|I>>>25,I=C+F|0,D^=I<<9|I>>>23,I=D+C|0,j^=I<<13|I>>>19,I=j+D|0,F^=I<<18|I>>>14,I=b+C|0,x^=I<<7|I>>>25,I=x+b|0,S^=I<<9|I>>>23,I=S+x|0,C^=I<<13|I>>>19,I=C+S|0,b^=I<<18|I>>>14,I=T+w|0,E^=I<<7|I>>>25,I=E+T|0,D^=I<<9|I>>>23,I=D+E|0,w^=I<<13|I>>>19,I=w+D|0,T^=I<<18|I>>>14,I=A+k|0,j^=I<<7|I>>>25,I=j+A|0,O^=I<<9|I>>>23,I=O+j|0,k^=I<<13|I>>>19,I=k+O|0,A^=I<<18|I>>>14,I=F+P|0,M^=I<<7|I>>>25,I=M+F|0,N^=I<<9|I>>>23,I=N+M|0,P^=I<<13|I>>>19,I=P+N|0,F^=I<<18|I>>>14;e[0]=b>>>0&255,e[1]=b>>>8&255,e[2]=b>>>16&255,e[3]=b>>>24&255,e[4]=T>>>0&255,e[5]=T>>>8&255,e[6]=T>>>16&255,e[7]=T>>>24&255,e[8]=A>>>0&255,e[9]=A>>>8&255,e[10]=A>>>16&255,e[11]=A>>>24&255,e[12]=F>>>0&255,e[13]=F>>>8&255,e[14]=F>>>16&255,e[15]=F>>>24&255,e[16]=E>>>0&255,e[17]=E>>>8&255,e[18]=E>>>16&255,e[19]=E>>>24&255,e[20]=D>>>0&255,e[21]=D>>>8&255,e[22]=D>>>16&255,e[23]=D>>>24&255,e[24]=O>>>0&255,e[25]=O>>>8&255,e[26]=O>>>16&255,e[27]=O>>>24&255,e[28]=k>>>0&255,e[29]=k>>>8&255,e[30]=k>>>16&255,e[31]=k>>>24&255}function b(e,t,n,r){v(e,t,n,r)}function x(e,t,n,r){y(e,t,n,r)}var S=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]);function C(e,t,n,r,i,a,o){var s=new Uint8Array(16),c=new Uint8Array(64),l,u;for(u=0;u<16;u++)s[u]=0;for(u=0;u<8;u++)s[u]=a[u];for(;i>=64;){for(b(c,s,o,S),u=0;u<64;u++)e[t+u]=n[r+u]^c[u];for(l=1,u=8;u<16;u++)l=l+(s[u]&255)|0,s[u]=l&255,l>>>=8;i-=64,t+=64,r+=64}if(i>0)for(b(c,s,o,S),u=0;u<i;u++)e[t+u]=n[r+u]^c[u];return 0}function w(e,t,n,r,i){var a=new Uint8Array(16),o=new Uint8Array(64),s,c;for(c=0;c<16;c++)a[c]=0;for(c=0;c<8;c++)a[c]=r[c];for(;n>=64;){for(b(o,a,i,S),c=0;c<64;c++)e[t+c]=o[c];for(s=1,c=8;c<16;c++)s=s+(a[c]&255)|0,a[c]=s&255,s>>>=8;n-=64,t+=64}if(n>0)for(b(o,a,i,S),c=0;c<n;c++)e[t+c]=o[c];return 0}function T(e,t,n,r,i){var a=new Uint8Array(32);x(a,r,i,S);for(var o=new Uint8Array(8),s=0;s<8;s++)o[s]=r[s+16];return w(e,t,n,o,a)}function E(e,t,n,r,i,a,o){var s=new Uint8Array(32);x(s,a,o,S);for(var c=new Uint8Array(8),l=0;l<8;l++)c[l]=a[l+16];return C(e,t,n,r,i,c,s)}var D=function(e){this.buffer=new Uint8Array(16),this.r=new Uint16Array(10),this.h=new Uint16Array(10),this.pad=new Uint16Array(8),this.leftover=0,this.fin=0;var t=e[0]&255|(e[1]&255)<<8,n,r,i,a,o,s,c;this.r[0]=t&8191,n=e[2]&255|(e[3]&255)<<8,this.r[1]=(t>>>13|n<<3)&8191,r=e[4]&255|(e[5]&255)<<8,this.r[2]=(n>>>10|r<<6)&7939,i=e[6]&255|(e[7]&255)<<8,this.r[3]=(r>>>7|i<<9)&8191,a=e[8]&255|(e[9]&255)<<8,this.r[4]=(i>>>4|a<<12)&255,this.r[5]=a>>>1&8190,o=e[10]&255|(e[11]&255)<<8,this.r[6]=(a>>>14|o<<2)&8191,s=e[12]&255|(e[13]&255)<<8,this.r[7]=(o>>>11|s<<5)&8065,c=e[14]&255|(e[15]&255)<<8,this.r[8]=(s>>>8|c<<8)&8191,this.r[9]=c>>>5&127,this.pad[0]=e[16]&255|(e[17]&255)<<8,this.pad[1]=e[18]&255|(e[19]&255)<<8,this.pad[2]=e[20]&255|(e[21]&255)<<8,this.pad[3]=e[22]&255|(e[23]&255)<<8,this.pad[4]=e[24]&255|(e[25]&255)<<8,this.pad[5]=e[26]&255|(e[27]&255)<<8,this.pad[6]=e[28]&255|(e[29]&255)<<8,this.pad[7]=e[30]&255|(e[31]&255)<<8};D.prototype.blocks=function(e,t,n){for(var r=this.fin?0:2048,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x,S,C=this.h[0],w=this.h[1],T=this.h[2],E=this.h[3],D=this.h[4],O=this.h[5],k=this.h[6],A=this.h[7],j=this.h[8],M=this.h[9],N=this.r[0],P=this.r[1],F=this.r[2],I=this.r[3],L=this.r[4],R=this.r[5],z=this.r[6],B=this.r[7],V=this.r[8],H=this.r[9];n>=16;)i=e[t+0]&255|(e[t+1]&255)<<8,C+=i&8191,a=e[t+2]&255|(e[t+3]&255)<<8,w+=(i>>>13|a<<3)&8191,o=e[t+4]&255|(e[t+5]&255)<<8,T+=(a>>>10|o<<6)&8191,s=e[t+6]&255|(e[t+7]&255)<<8,E+=(o>>>7|s<<9)&8191,c=e[t+8]&255|(e[t+9]&255)<<8,D+=(s>>>4|c<<12)&8191,O+=c>>>1&8191,l=e[t+10]&255|(e[t+11]&255)<<8,k+=(c>>>14|l<<2)&8191,u=e[t+12]&255|(e[t+13]&255)<<8,A+=(l>>>11|u<<5)&8191,d=e[t+14]&255|(e[t+15]&255)<<8,j+=(u>>>8|d<<8)&8191,M+=d>>>5|r,f=0,p=f,p+=C*N,p+=5*H*w,p+=5*V*T,p+=5*B*E,p+=5*z*D,f=p>>>13,p&=8191,p+=5*R*O,p+=5*L*k,p+=5*I*A,p+=5*F*j,p+=5*P*M,f+=p>>>13,p&=8191,m=f,m+=C*P,m+=w*N,m+=5*H*T,m+=5*V*E,m+=5*B*D,f=m>>>13,m&=8191,m+=5*z*O,m+=5*R*k,m+=5*L*A,m+=5*I*j,m+=5*F*M,f+=m>>>13,m&=8191,h=f,h+=C*F,h+=w*P,h+=T*N,h+=5*H*E,h+=5*V*D,f=h>>>13,h&=8191,h+=5*B*O,h+=5*z*k,h+=5*R*A,h+=5*L*j,h+=5*I*M,f+=h>>>13,h&=8191,g=f,g+=C*I,g+=w*F,g+=T*P,g+=E*N,g+=5*H*D,f=g>>>13,g&=8191,g+=5*V*O,g+=5*B*k,g+=5*z*A,g+=5*R*j,g+=5*L*M,f+=g>>>13,g&=8191,_=f,_+=C*L,_+=w*I,_+=T*F,_+=E*P,_+=D*N,f=_>>>13,_&=8191,_+=5*H*O,_+=5*V*k,_+=5*B*A,_+=5*z*j,_+=5*R*M,f+=_>>>13,_&=8191,v=f,v+=C*R,v+=w*L,v+=T*I,v+=E*F,v+=D*P,f=v>>>13,v&=8191,v+=O*N,v+=5*H*k,v+=5*V*A,v+=5*B*j,v+=5*z*M,f+=v>>>13,v&=8191,y=f,y+=C*z,y+=w*R,y+=T*L,y+=E*I,y+=D*F,f=y>>>13,y&=8191,y+=O*P,y+=k*N,y+=5*H*A,y+=5*V*j,y+=5*B*M,f+=y>>>13,y&=8191,b=f,b+=C*B,b+=w*z,b+=T*R,b+=E*L,b+=D*I,f=b>>>13,b&=8191,b+=O*F,b+=k*P,b+=A*N,b+=5*H*j,b+=5*V*M,f+=b>>>13,b&=8191,x=f,x+=C*V,x+=w*B,x+=T*z,x+=E*R,x+=D*L,f=x>>>13,x&=8191,x+=O*I,x+=k*F,x+=A*P,x+=j*N,x+=5*H*M,f+=x>>>13,x&=8191,S=f,S+=C*H,S+=w*V,S+=T*B,S+=E*z,S+=D*R,f=S>>>13,S&=8191,S+=O*L,S+=k*I,S+=A*F,S+=j*P,S+=M*N,f+=S>>>13,S&=8191,f=(f<<2)+f|0,f=f+p|0,p=f&8191,f>>>=13,m+=f,C=p,w=m,T=h,E=g,D=_,O=v,k=y,A=b,j=x,M=S,t+=16,n-=16;this.h[0]=C,this.h[1]=w,this.h[2]=T,this.h[3]=E,this.h[4]=D,this.h[5]=O,this.h[6]=k,this.h[7]=A,this.h[8]=j,this.h[9]=M},D.prototype.finish=function(e,t){var n=new Uint16Array(10),r,i,a,o;if(this.leftover){for(o=this.leftover,this.buffer[o++]=1;o<16;o++)this.buffer[o]=0;this.fin=1,this.blocks(this.buffer,0,16)}for(r=this.h[1]>>>13,this.h[1]&=8191,o=2;o<10;o++)this.h[o]+=r,r=this.h[o]>>>13,this.h[o]&=8191;for(this.h[0]+=r*5,r=this.h[0]>>>13,this.h[0]&=8191,this.h[1]+=r,r=this.h[1]>>>13,this.h[1]&=8191,this.h[2]+=r,n[0]=this.h[0]+5,r=n[0]>>>13,n[0]&=8191,o=1;o<10;o++)n[o]=this.h[o]+r,r=n[o]>>>13,n[o]&=8191;for(n[9]-=8192,i=(r^1)-1,o=0;o<10;o++)n[o]&=i;for(i=~i,o=0;o<10;o++)this.h[o]=this.h[o]&i|n[o];for(this.h[0]=(this.h[0]|this.h[1]<<13)&65535,this.h[1]=(this.h[1]>>>3|this.h[2]<<10)&65535,this.h[2]=(this.h[2]>>>6|this.h[3]<<7)&65535,this.h[3]=(this.h[3]>>>9|this.h[4]<<4)&65535,this.h[4]=(this.h[4]>>>12|this.h[5]<<1|this.h[6]<<14)&65535,this.h[5]=(this.h[6]>>>2|this.h[7]<<11)&65535,this.h[6]=(this.h[7]>>>5|this.h[8]<<8)&65535,this.h[7]=(this.h[8]>>>8|this.h[9]<<5)&65535,a=this.h[0]+this.pad[0],this.h[0]=a&65535,o=1;o<8;o++)a=(this.h[o]+this.pad[o]|0)+(a>>>16)|0,this.h[o]=a&65535;e[t+0]=this.h[0]>>>0&255,e[t+1]=this.h[0]>>>8&255,e[t+2]=this.h[1]>>>0&255,e[t+3]=this.h[1]>>>8&255,e[t+4]=this.h[2]>>>0&255,e[t+5]=this.h[2]>>>8&255,e[t+6]=this.h[3]>>>0&255,e[t+7]=this.h[3]>>>8&255,e[t+8]=this.h[4]>>>0&255,e[t+9]=this.h[4]>>>8&255,e[t+10]=this.h[5]>>>0&255,e[t+11]=this.h[5]>>>8&255,e[t+12]=this.h[6]>>>0&255,e[t+13]=this.h[6]>>>8&255,e[t+14]=this.h[7]>>>0&255,e[t+15]=this.h[7]>>>8&255},D.prototype.update=function(e,t,n){var r,i;if(this.leftover){for(i=16-this.leftover,i>n&&(i=n),r=0;r<i;r++)this.buffer[this.leftover+r]=e[t+r];if(n-=i,t+=i,this.leftover+=i,this.leftover<16)return;this.blocks(this.buffer,0,16),this.leftover=0}if(n>=16&&(i=n-n%16,this.blocks(e,t,i),t+=i,n-=i),n){for(r=0;r<n;r++)this.buffer[this.leftover+r]=e[t+r];this.leftover+=n}};function O(e,t,n,r,i,a){var o=new D(a);return o.update(n,r,i),o.finish(e,t),0}function k(e,t,n,r,i,a){var o=new Uint8Array(16);return O(o,0,n,r,i,a),g(e,t,o,0)}function A(e,t,n,r,i){var a;if(n<32)return-1;for(E(e,0,t,0,n,r,i),O(e,16,e,32,n-32,e),a=0;a<16;a++)e[a]=0;return 0}function j(e,t,n,r,i){var a,o=new Uint8Array(32);if(n<32||(T(o,0,32,r,i),k(t,16,t,32,n-32,o)!==0))return-1;for(E(e,0,t,0,n,r,i),a=0;a<32;a++)e[a]=0;return 0}function M(e,t){var n;for(n=0;n<16;n++)e[n]=t[n]|0}function N(e){var t,n,r=1;for(t=0;t<16;t++)n=e[t]+r+65535,r=Math.floor(n/65536),e[t]=n-r*65536;e[0]+=r-1+37*(r-1)}function P(e,t,n){for(var r,i=~(n-1),a=0;a<16;a++)r=i&(e[a]^t[a]),e[a]^=r,t[a]^=r}function F(e,t){var r,i,a,o=n(),s=n();for(r=0;r<16;r++)s[r]=t[r];for(N(s),N(s),N(s),i=0;i<2;i++){for(o[0]=s[0]-65517,r=1;r<15;r++)o[r]=s[r]-65535-(o[r-1]>>16&1),o[r-1]&=65535;o[15]=s[15]-32767-(o[14]>>16&1),a=o[15]>>16&1,o[14]&=65535,P(s,o,1-a)}for(r=0;r<16;r++)e[2*r]=s[r]&255,e[2*r+1]=s[r]>>8}function I(e,t){var n=new Uint8Array(32),r=new Uint8Array(32);return F(n,e),F(r,t),_(n,0,r,0)}function L(e){var t=new Uint8Array(32);return F(t,e),t[0]&1}function R(e,t){var n;for(n=0;n<16;n++)e[n]=t[2*n]+(t[2*n+1]<<8);e[15]&=32767}function z(e,t,n){for(var r=0;r<16;r++)e[r]=t[r]+n[r]}function B(e,t,n){for(var r=0;r<16;r++)e[r]=t[r]-n[r]}function V(e,t,n){var r,i,a=0,o=0,s=0,c=0,l=0,u=0,d=0,f=0,p=0,m=0,h=0,g=0,_=0,v=0,y=0,b=0,x=0,S=0,C=0,w=0,T=0,E=0,D=0,O=0,k=0,A=0,j=0,M=0,N=0,P=0,F=0,I=n[0],L=n[1],R=n[2],z=n[3],B=n[4],V=n[5],H=n[6],U=n[7],W=n[8],G=n[9],K=n[10],q=n[11],J=n[12],ee=n[13],te=n[14],ne=n[15];r=t[0],a+=r*I,o+=r*L,s+=r*R,c+=r*z,l+=r*B,u+=r*V,d+=r*H,f+=r*U,p+=r*W,m+=r*G,h+=r*K,g+=r*q,_+=r*J,v+=r*ee,y+=r*te,b+=r*ne,r=t[1],o+=r*I,s+=r*L,c+=r*R,l+=r*z,u+=r*B,d+=r*V,f+=r*H,p+=r*U,m+=r*W,h+=r*G,g+=r*K,_+=r*q,v+=r*J,y+=r*ee,b+=r*te,x+=r*ne,r=t[2],s+=r*I,c+=r*L,l+=r*R,u+=r*z,d+=r*B,f+=r*V,p+=r*H,m+=r*U,h+=r*W,g+=r*G,_+=r*K,v+=r*q,y+=r*J,b+=r*ee,x+=r*te,S+=r*ne,r=t[3],c+=r*I,l+=r*L,u+=r*R,d+=r*z,f+=r*B,p+=r*V,m+=r*H,h+=r*U,g+=r*W,_+=r*G,v+=r*K,y+=r*q,b+=r*J,x+=r*ee,S+=r*te,C+=r*ne,r=t[4],l+=r*I,u+=r*L,d+=r*R,f+=r*z,p+=r*B,m+=r*V,h+=r*H,g+=r*U,_+=r*W,v+=r*G,y+=r*K,b+=r*q,x+=r*J,S+=r*ee,C+=r*te,w+=r*ne,r=t[5],u+=r*I,d+=r*L,f+=r*R,p+=r*z,m+=r*B,h+=r*V,g+=r*H,_+=r*U,v+=r*W,y+=r*G,b+=r*K,x+=r*q,S+=r*J,C+=r*ee,w+=r*te,T+=r*ne,r=t[6],d+=r*I,f+=r*L,p+=r*R,m+=r*z,h+=r*B,g+=r*V,_+=r*H,v+=r*U,y+=r*W,b+=r*G,x+=r*K,S+=r*q,C+=r*J,w+=r*ee,T+=r*te,E+=r*ne,r=t[7],f+=r*I,p+=r*L,m+=r*R,h+=r*z,g+=r*B,_+=r*V,v+=r*H,y+=r*U,b+=r*W,x+=r*G,S+=r*K,C+=r*q,w+=r*J,T+=r*ee,E+=r*te,D+=r*ne,r=t[8],p+=r*I,m+=r*L,h+=r*R,g+=r*z,_+=r*B,v+=r*V,y+=r*H,b+=r*U,x+=r*W,S+=r*G,C+=r*K,w+=r*q,T+=r*J,E+=r*ee,D+=r*te,O+=r*ne,r=t[9],m+=r*I,h+=r*L,g+=r*R,_+=r*z,v+=r*B,y+=r*V,b+=r*H,x+=r*U,S+=r*W,C+=r*G,w+=r*K,T+=r*q,E+=r*J,D+=r*ee,O+=r*te,k+=r*ne,r=t[10],h+=r*I,g+=r*L,_+=r*R,v+=r*z,y+=r*B,b+=r*V,x+=r*H,S+=r*U,C+=r*W,w+=r*G,T+=r*K,E+=r*q,D+=r*J,O+=r*ee,k+=r*te,A+=r*ne,r=t[11],g+=r*I,_+=r*L,v+=r*R,y+=r*z,b+=r*B,x+=r*V,S+=r*H,C+=r*U,w+=r*W,T+=r*G,E+=r*K,D+=r*q,O+=r*J,k+=r*ee,A+=r*te,j+=r*ne,r=t[12],_+=r*I,v+=r*L,y+=r*R,b+=r*z,x+=r*B,S+=r*V,C+=r*H,w+=r*U,T+=r*W,E+=r*G,D+=r*K,O+=r*q,k+=r*J,A+=r*ee,j+=r*te,M+=r*ne,r=t[13],v+=r*I,y+=r*L,b+=r*R,x+=r*z,S+=r*B,C+=r*V,w+=r*H,T+=r*U,E+=r*W,D+=r*G,O+=r*K,k+=r*q,A+=r*J,j+=r*ee,M+=r*te,N+=r*ne,r=t[14],y+=r*I,b+=r*L,x+=r*R,S+=r*z,C+=r*B,w+=r*V,T+=r*H,E+=r*U,D+=r*W,O+=r*G,k+=r*K,A+=r*q,j+=r*J,M+=r*ee,N+=r*te,P+=r*ne,r=t[15],b+=r*I,x+=r*L,S+=r*R,C+=r*z,w+=r*B,T+=r*V,E+=r*H,D+=r*U,O+=r*W,k+=r*G,A+=r*K,j+=r*q,M+=r*J,N+=r*ee,P+=r*te,F+=r*ne,a+=38*x,o+=38*S,s+=38*C,c+=38*w,l+=38*T,u+=38*E,d+=38*D,f+=38*O,p+=38*k,m+=38*A,h+=38*j,g+=38*M,_+=38*N,v+=38*P,y+=38*F,i=1,r=a+i+65535,i=Math.floor(r/65536),a=r-i*65536,r=o+i+65535,i=Math.floor(r/65536),o=r-i*65536,r=s+i+65535,i=Math.floor(r/65536),s=r-i*65536,r=c+i+65535,i=Math.floor(r/65536),c=r-i*65536,r=l+i+65535,i=Math.floor(r/65536),l=r-i*65536,r=u+i+65535,i=Math.floor(r/65536),u=r-i*65536,r=d+i+65535,i=Math.floor(r/65536),d=r-i*65536,r=f+i+65535,i=Math.floor(r/65536),f=r-i*65536,r=p+i+65535,i=Math.floor(r/65536),p=r-i*65536,r=m+i+65535,i=Math.floor(r/65536),m=r-i*65536,r=h+i+65535,i=Math.floor(r/65536),h=r-i*65536,r=g+i+65535,i=Math.floor(r/65536),g=r-i*65536,r=_+i+65535,i=Math.floor(r/65536),_=r-i*65536,r=v+i+65535,i=Math.floor(r/65536),v=r-i*65536,r=y+i+65535,i=Math.floor(r/65536),y=r-i*65536,r=b+i+65535,i=Math.floor(r/65536),b=r-i*65536,a+=i-1+37*(i-1),i=1,r=a+i+65535,i=Math.floor(r/65536),a=r-i*65536,r=o+i+65535,i=Math.floor(r/65536),o=r-i*65536,r=s+i+65535,i=Math.floor(r/65536),s=r-i*65536,r=c+i+65535,i=Math.floor(r/65536),c=r-i*65536,r=l+i+65535,i=Math.floor(r/65536),l=r-i*65536,r=u+i+65535,i=Math.floor(r/65536),u=r-i*65536,r=d+i+65535,i=Math.floor(r/65536),d=r-i*65536,r=f+i+65535,i=Math.floor(r/65536),f=r-i*65536,r=p+i+65535,i=Math.floor(r/65536),p=r-i*65536,r=m+i+65535,i=Math.floor(r/65536),m=r-i*65536,r=h+i+65535,i=Math.floor(r/65536),h=r-i*65536,r=g+i+65535,i=Math.floor(r/65536),g=r-i*65536,r=_+i+65535,i=Math.floor(r/65536),_=r-i*65536,r=v+i+65535,i=Math.floor(r/65536),v=r-i*65536,r=y+i+65535,i=Math.floor(r/65536),y=r-i*65536,r=b+i+65535,i=Math.floor(r/65536),b=r-i*65536,a+=i-1+37*(i-1),e[0]=a,e[1]=o,e[2]=s,e[3]=c,e[4]=l,e[5]=u,e[6]=d,e[7]=f,e[8]=p,e[9]=m,e[10]=h,e[11]=g,e[12]=_,e[13]=v,e[14]=y,e[15]=b}function H(e,t){V(e,t,t)}function U(e,t){var r=n(),i;for(i=0;i<16;i++)r[i]=t[i];for(i=253;i>=0;i--)H(r,r),i!==2&&i!==4&&V(r,r,t);for(i=0;i<16;i++)e[i]=r[i]}function W(e,t){var r=n(),i;for(i=0;i<16;i++)r[i]=t[i];for(i=250;i>=0;i--)H(r,r),i!==1&&V(r,r,t);for(i=0;i<16;i++)e[i]=r[i]}function G(e,t,r){var i=new Uint8Array(32),a=new Float64Array(80),o,s,l=n(),u=n(),d=n(),f=n(),p=n(),m=n();for(s=0;s<31;s++)i[s]=t[s];for(i[31]=t[31]&127|64,i[0]&=248,R(a,r),s=0;s<16;s++)u[s]=a[s],f[s]=l[s]=d[s]=0;for(l[0]=f[0]=1,s=254;s>=0;--s)o=i[s>>>3]>>>(s&7)&1,P(l,u,o),P(d,f,o),z(p,l,d),B(l,l,d),z(d,u,f),B(u,u,f),H(f,p),H(m,l),V(l,d,l),V(d,u,p),z(p,l,d),B(l,l,d),H(u,l),B(d,f,m),V(l,d,c),z(l,l,f),V(d,d,l),V(l,f,m),V(f,u,a),H(u,p),P(l,u,o),P(d,f,o);for(s=0;s<16;s++)a[s+16]=l[s],a[s+32]=d[s],a[s+48]=u[s],a[s+64]=f[s];var h=a.subarray(32),g=a.subarray(16);return U(h,h),V(g,g,h),F(e,g),0}function K(e,t){return G(e,t,a)}function q(e,t){return r(t,32),K(e,t)}function J(e,t,n){var r=new Uint8Array(32);return G(r,n,t),x(e,i,r,S)}var ee=A,te=j;function ne(e,t,n,r,i,a){var o=new Uint8Array(32);return J(o,i,a),ee(e,t,n,r,o)}function re(e,t,n,r,i,a){var o=new Uint8Array(32);return J(o,i,a),te(e,t,n,r,o)}var ie=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function ae(e,t,n,r){for(var i=new Int32Array(16),a=new Int32Array(16),o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x,S,C,w,T,E,D,O,k,A,j,M=e[0],N=e[1],P=e[2],F=e[3],I=e[4],L=e[5],R=e[6],z=e[7],B=t[0],V=t[1],H=t[2],U=t[3],W=t[4],G=t[5],K=t[6],q=t[7],J=0;r>=128;){for(w=0;w<16;w++)T=8*w+J,i[w]=n[T+0]<<24|n[T+1]<<16|n[T+2]<<8|n[T+3],a[w]=n[T+4]<<24|n[T+5]<<16|n[T+6]<<8|n[T+7];for(w=0;w<80;w++)if(o=M,s=N,c=P,l=F,u=I,d=L,f=R,p=z,m=B,h=V,g=H,_=U,v=W,y=G,b=K,x=q,E=z,D=q,O=D&65535,k=D>>>16,A=E&65535,j=E>>>16,E=(I>>>14|W<<18)^(I>>>18|W<<14)^(W>>>9|I<<23),D=(W>>>14|I<<18)^(W>>>18|I<<14)^(I>>>9|W<<23),O+=D&65535,k+=D>>>16,A+=E&65535,j+=E>>>16,E=I&L^~I&R,D=W&G^~W&K,O+=D&65535,k+=D>>>16,A+=E&65535,j+=E>>>16,E=ie[w*2],D=ie[w*2+1],O+=D&65535,k+=D>>>16,A+=E&65535,j+=E>>>16,E=i[w%16],D=a[w%16],O+=D&65535,k+=D>>>16,A+=E&65535,j+=E>>>16,k+=O>>>16,A+=k>>>16,j+=A>>>16,S=A&65535|j<<16,C=O&65535|k<<16,E=S,D=C,O=D&65535,k=D>>>16,A=E&65535,j=E>>>16,E=(M>>>28|B<<4)^(B>>>2|M<<30)^(B>>>7|M<<25),D=(B>>>28|M<<4)^(M>>>2|B<<30)^(M>>>7|B<<25),O+=D&65535,k+=D>>>16,A+=E&65535,j+=E>>>16,E=M&N^M&P^N&P,D=B&V^B&H^V&H,O+=D&65535,k+=D>>>16,A+=E&65535,j+=E>>>16,k+=O>>>16,A+=k>>>16,j+=A>>>16,p=A&65535|j<<16,x=O&65535|k<<16,E=l,D=_,O=D&65535,k=D>>>16,A=E&65535,j=E>>>16,E=S,D=C,O+=D&65535,k+=D>>>16,A+=E&65535,j+=E>>>16,k+=O>>>16,A+=k>>>16,j+=A>>>16,l=A&65535|j<<16,_=O&65535|k<<16,N=o,P=s,F=c,I=l,L=u,R=d,z=f,M=p,V=m,H=h,U=g,W=_,G=v,K=y,q=b,B=x,w%16==15)for(T=0;T<16;T++)E=i[T],D=a[T],O=D&65535,k=D>>>16,A=E&65535,j=E>>>16,E=i[(T+9)%16],D=a[(T+9)%16],O+=D&65535,k+=D>>>16,A+=E&65535,j+=E>>>16,S=i[(T+1)%16],C=a[(T+1)%16],E=(S>>>1|C<<31)^(S>>>8|C<<24)^S>>>7,D=(C>>>1|S<<31)^(C>>>8|S<<24)^(C>>>7|S<<25),O+=D&65535,k+=D>>>16,A+=E&65535,j+=E>>>16,S=i[(T+14)%16],C=a[(T+14)%16],E=(S>>>19|C<<13)^(C>>>29|S<<3)^S>>>6,D=(C>>>19|S<<13)^(S>>>29|C<<3)^(C>>>6|S<<26),O+=D&65535,k+=D>>>16,A+=E&65535,j+=E>>>16,k+=O>>>16,A+=k>>>16,j+=A>>>16,i[T]=A&65535|j<<16,a[T]=O&65535|k<<16;E=M,D=B,O=D&65535,k=D>>>16,A=E&65535,j=E>>>16,E=e[0],D=t[0],O+=D&65535,k+=D>>>16,A+=E&65535,j+=E>>>16,k+=O>>>16,A+=k>>>16,j+=A>>>16,e[0]=M=A&65535|j<<16,t[0]=B=O&65535|k<<16,E=N,D=V,O=D&65535,k=D>>>16,A=E&65535,j=E>>>16,E=e[1],D=t[1],O+=D&65535,k+=D>>>16,A+=E&65535,j+=E>>>16,k+=O>>>16,A+=k>>>16,j+=A>>>16,e[1]=N=A&65535|j<<16,t[1]=V=O&65535|k<<16,E=P,D=H,O=D&65535,k=D>>>16,A=E&65535,j=E>>>16,E=e[2],D=t[2],O+=D&65535,k+=D>>>16,A+=E&65535,j+=E>>>16,k+=O>>>16,A+=k>>>16,j+=A>>>16,e[2]=P=A&65535|j<<16,t[2]=H=O&65535|k<<16,E=F,D=U,O=D&65535,k=D>>>16,A=E&65535,j=E>>>16,E=e[3],D=t[3],O+=D&65535,k+=D>>>16,A+=E&65535,j+=E>>>16,k+=O>>>16,A+=k>>>16,j+=A>>>16,e[3]=F=A&65535|j<<16,t[3]=U=O&65535|k<<16,E=I,D=W,O=D&65535,k=D>>>16,A=E&65535,j=E>>>16,E=e[4],D=t[4],O+=D&65535,k+=D>>>16,A+=E&65535,j+=E>>>16,k+=O>>>16,A+=k>>>16,j+=A>>>16,e[4]=I=A&65535|j<<16,t[4]=W=O&65535|k<<16,E=L,D=G,O=D&65535,k=D>>>16,A=E&65535,j=E>>>16,E=e[5],D=t[5],O+=D&65535,k+=D>>>16,A+=E&65535,j+=E>>>16,k+=O>>>16,A+=k>>>16,j+=A>>>16,e[5]=L=A&65535|j<<16,t[5]=G=O&65535|k<<16,E=R,D=K,O=D&65535,k=D>>>16,A=E&65535,j=E>>>16,E=e[6],D=t[6],O+=D&65535,k+=D>>>16,A+=E&65535,j+=E>>>16,k+=O>>>16,A+=k>>>16,j+=A>>>16,e[6]=R=A&65535|j<<16,t[6]=K=O&65535|k<<16,E=z,D=q,O=D&65535,k=D>>>16,A=E&65535,j=E>>>16,E=e[7],D=t[7],O+=D&65535,k+=D>>>16,A+=E&65535,j+=E>>>16,k+=O>>>16,A+=k>>>16,j+=A>>>16,e[7]=z=A&65535|j<<16,t[7]=q=O&65535|k<<16,J+=128,r-=128}return r}function oe(e,t,n){var r=new Int32Array(8),i=new Int32Array(8),a=new Uint8Array(256),o,s=n;for(r[0]=1779033703,r[1]=3144134277,r[2]=1013904242,r[3]=2773480762,r[4]=1359893119,r[5]=2600822924,r[6]=528734635,r[7]=1541459225,i[0]=4089235720,i[1]=2227873595,i[2]=4271175723,i[3]=1595750129,i[4]=2917565137,i[5]=725511199,i[6]=4215389547,i[7]=327033209,ae(r,i,t,n),n%=128,o=0;o<n;o++)a[o]=t[s-n+o];for(a[n]=128,n=256-128*(n<112),a[n-9]=0,m(a,n-8,s/536870912|0,s<<3),ae(r,i,a,n),o=0;o<8;o++)m(e,8*o,r[o],i[o]);return 0}function se(e,t){var r=n(),i=n(),a=n(),o=n(),s=n(),c=n(),l=n(),d=n(),f=n();B(r,e[1],e[0]),B(f,t[1],t[0]),V(r,r,f),z(i,e[0],e[1]),z(f,t[0],t[1]),V(i,i,f),V(a,e[3],t[3]),V(a,a,u),V(o,e[2],t[2]),z(o,o,o),B(s,i,r),B(c,o,a),z(l,o,a),z(d,i,r),V(e[0],s,c),V(e[1],d,l),V(e[2],l,c),V(e[3],s,d)}function ce(e,t,n){var r;for(r=0;r<4;r++)P(e[r],t[r],n)}function le(e,t){var r=n(),i=n(),a=n();U(a,t[2]),V(r,t[0],a),V(i,t[1],a),F(e,i),e[31]^=L(r)<<7}function ue(e,t,n){var r,i;for(M(e[0],o),M(e[1],s),M(e[2],s),M(e[3],o),i=255;i>=0;--i)r=n[i/8|0]>>(i&7)&1,ce(e,t,r),se(t,e),se(e,e),ce(e,t,r)}function de(e,t){var r=[n(),n(),n(),n()];M(r[0],d),M(r[1],f),M(r[2],s),V(r[3],d,f),ue(e,r,t)}function fe(e,t,i){var a=new Uint8Array(64),o=[n(),n(),n(),n()],s;for(i||r(t,32),oe(a,t,32),a[0]&=248,a[31]&=127,a[31]|=64,de(o,a),le(e,o),s=0;s<32;s++)t[s+32]=e[s];return 0}var pe=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function me(e,t){var n,r,i,a;for(r=63;r>=32;--r){for(n=0,i=r-32,a=r-12;i<a;++i)t[i]+=n-16*t[r]*pe[i-(r-32)],n=Math.floor((t[i]+128)/256),t[i]-=n*256;t[i]+=n,t[r]=0}for(n=0,i=0;i<32;i++)t[i]+=n-(t[31]>>4)*pe[i],n=t[i]>>8,t[i]&=255;for(i=0;i<32;i++)t[i]-=n*pe[i];for(r=0;r<32;r++)t[r+1]+=t[r]>>8,e[r]=t[r]&255}function he(e){var t=new Float64Array(64),n;for(n=0;n<64;n++)t[n]=e[n];for(n=0;n<64;n++)e[n]=0;me(e,t)}function ge(e,t,r,i){var a=new Uint8Array(64),o=new Uint8Array(64),s=new Uint8Array(64),c,l,u=new Float64Array(64),d=[n(),n(),n(),n()];oe(a,i,32),a[0]&=248,a[31]&=127,a[31]|=64;var f=r+64;for(c=0;c<r;c++)e[64+c]=t[c];for(c=0;c<32;c++)e[32+c]=a[32+c];for(oe(s,e.subarray(32),r+32),he(s),de(d,s),le(e,d),c=32;c<64;c++)e[c]=i[c];for(oe(o,e,r+64),he(o),c=0;c<64;c++)u[c]=0;for(c=0;c<32;c++)u[c]=s[c];for(c=0;c<32;c++)for(l=0;l<32;l++)u[c+l]+=o[c]*a[l];return me(e.subarray(32),u),f}function _e(e,t){var r=n(),i=n(),a=n(),c=n(),u=n(),d=n(),f=n();return M(e[2],s),R(e[1],t),H(a,e[1]),V(c,a,l),B(a,a,e[2]),z(c,e[2],c),H(u,c),H(d,u),V(f,d,u),V(r,f,a),V(r,r,c),W(r,r),V(r,r,a),V(r,r,c),V(r,r,c),V(e[0],r,c),H(i,e[0]),V(i,i,c),I(i,a)&&V(e[0],e[0],p),H(i,e[0]),V(i,i,c),I(i,a)?-1:(L(e[0])===t[31]>>7&&B(e[0],o,e[0]),V(e[3],e[0],e[1]),0)}function ve(e,t,r,i){var a,o=new Uint8Array(32),s=new Uint8Array(64),c=[n(),n(),n(),n()],l=[n(),n(),n(),n()];if(r<64||_e(l,i))return-1;for(a=0;a<r;a++)e[a]=t[a];for(a=0;a<32;a++)e[a+32]=i[a];if(oe(s,e,r),he(s),ue(c,l,s),de(l,t.subarray(32)),se(c,l),le(o,c),r-=64,_(t,0,o,0)){for(a=0;a<r;a++)e[a]=0;return-1}for(a=0;a<r;a++)e[a]=t[a+64];return r}var ye=32,be=24,Y=32,xe=16,Se=32,Ce=32,we=32,Te=32,Ee=32,De=be,Oe=Y,ke=xe,Ae=64,je=32,Me=64,Ne=32,Pe=64;e.lowlevel={crypto_core_hsalsa20:x,crypto_stream_xor:E,crypto_stream:T,crypto_stream_salsa20_xor:C,crypto_stream_salsa20:w,crypto_onetimeauth:O,crypto_onetimeauth_verify:k,crypto_verify_16:g,crypto_verify_32:_,crypto_secretbox:A,crypto_secretbox_open:j,crypto_scalarmult:G,crypto_scalarmult_base:K,crypto_box_beforenm:J,crypto_box_afternm:ee,crypto_box:ne,crypto_box_open:re,crypto_box_keypair:q,crypto_hash:oe,crypto_sign:ge,crypto_sign_keypair:fe,crypto_sign_open:ve,crypto_secretbox_KEYBYTES:ye,crypto_secretbox_NONCEBYTES:be,crypto_secretbox_ZEROBYTES:Y,crypto_secretbox_BOXZEROBYTES:xe,crypto_scalarmult_BYTES:Se,crypto_scalarmult_SCALARBYTES:Ce,crypto_box_PUBLICKEYBYTES:we,crypto_box_SECRETKEYBYTES:Te,crypto_box_BEFORENMBYTES:Ee,crypto_box_NONCEBYTES:De,crypto_box_ZEROBYTES:Oe,crypto_box_BOXZEROBYTES:ke,crypto_sign_BYTES:Ae,crypto_sign_PUBLICKEYBYTES:je,crypto_sign_SECRETKEYBYTES:Me,crypto_sign_SEEDBYTES:Ne,crypto_hash_BYTES:Pe,gf:n,D:l,L:pe,pack25519:F,unpack25519:R,M:V,A:z,S:H,Z:B,pow2523:W,add:se,set25519:M,modL:me,scalarmult:ue,scalarbase:de};function Fe(e,t){if(e.length!==ye)throw Error(`bad key size`);if(t.length!==be)throw Error(`bad nonce size`)}function Ie(e,t){if(e.length!==we)throw Error(`bad public key size`);if(t.length!==Te)throw Error(`bad secret key size`)}function Le(){for(var e=0;e<arguments.length;e++)if(!(arguments[e]instanceof Uint8Array))throw TypeError(`unexpected type, use Uint8Array`)}function Re(e){for(var t=0;t<e.length;t++)e[t]=0}e.randomBytes=function(e){var t=new Uint8Array(e);return r(t,e),t},e.secretbox=function(e,t,n){Le(e,t,n),Fe(n,t);for(var r=new Uint8Array(Y+e.length),i=new Uint8Array(r.length),a=0;a<e.length;a++)r[a+Y]=e[a];return A(i,r,r.length,t,n),i.subarray(xe)},e.secretbox.open=function(e,t,n){Le(e,t,n),Fe(n,t);for(var r=new Uint8Array(xe+e.length),i=new Uint8Array(r.length),a=0;a<e.length;a++)r[a+xe]=e[a];return r.length<32||j(i,r,r.length,t,n)!==0?null:i.subarray(Y)},e.secretbox.keyLength=ye,e.secretbox.nonceLength=be,e.secretbox.overheadLength=xe,e.scalarMult=function(e,t){if(Le(e,t),e.length!==Ce)throw Error(`bad n size`);if(t.length!==Se)throw Error(`bad p size`);var n=new Uint8Array(Se);return G(n,e,t),n},e.scalarMult.base=function(e){if(Le(e),e.length!==Ce)throw Error(`bad n size`);var t=new Uint8Array(Se);return K(t,e),t},e.scalarMult.scalarLength=Ce,e.scalarMult.groupElementLength=Se,e.box=function(t,n,r,i){var a=e.box.before(r,i);return e.secretbox(t,n,a)},e.box.before=function(e,t){Le(e,t),Ie(e,t);var n=new Uint8Array(Ee);return J(n,e,t),n},e.box.after=e.secretbox,e.box.open=function(t,n,r,i){var a=e.box.before(r,i);return e.secretbox.open(t,n,a)},e.box.open.after=e.secretbox.open,e.box.keyPair=function(){var e=new Uint8Array(we),t=new Uint8Array(Te);return q(e,t),{publicKey:e,secretKey:t}},e.box.keyPair.fromSecretKey=function(e){if(Le(e),e.length!==Te)throw Error(`bad secret key size`);var t=new Uint8Array(we);return K(t,e),{publicKey:t,secretKey:new Uint8Array(e)}},e.box.publicKeyLength=we,e.box.secretKeyLength=Te,e.box.sharedKeyLength=Ee,e.box.nonceLength=De,e.box.overheadLength=e.secretbox.overheadLength,e.sign=function(e,t){if(Le(e,t),t.length!==Me)throw Error(`bad secret key size`);var n=new Uint8Array(Ae+e.length);return ge(n,e,e.length,t),n},e.sign.open=function(e,t){if(Le(e,t),t.length!==je)throw Error(`bad public key size`);var n=new Uint8Array(e.length),r=ve(n,e,e.length,t);if(r<0)return null;for(var i=new Uint8Array(r),a=0;a<i.length;a++)i[a]=n[a];return i},e.sign.detached=function(t,n){for(var r=e.sign(t,n),i=new Uint8Array(Ae),a=0;a<i.length;a++)i[a]=r[a];return i},e.sign.detached.verify=function(e,t,n){if(Le(e,t,n),t.length!==Ae)throw Error(`bad signature size`);if(n.length!==je)throw Error(`bad public key size`);var r=new Uint8Array(Ae+e.length),i=new Uint8Array(Ae+e.length),a;for(a=0;a<Ae;a++)r[a]=t[a];for(a=0;a<e.length;a++)r[a+Ae]=e[a];return ve(i,r,r.length,n)>=0},e.sign.keyPair=function(){var e=new Uint8Array(je),t=new Uint8Array(Me);return fe(e,t),{publicKey:e,secretKey:t}},e.sign.keyPair.fromSecretKey=function(e){if(Le(e),e.length!==Me)throw Error(`bad secret key size`);for(var t=new Uint8Array(je),n=0;n<t.length;n++)t[n]=e[32+n];return{publicKey:t,secretKey:new Uint8Array(e)}},e.sign.keyPair.fromSeed=function(e){if(Le(e),e.length!==Ne)throw Error(`bad seed size`);for(var t=new Uint8Array(je),n=new Uint8Array(Me),r=0;r<32;r++)n[r]=e[r];return fe(t,n,!0),{publicKey:t,secretKey:n}},e.sign.publicKeyLength=je,e.sign.secretKeyLength=Me,e.sign.seedLength=Ne,e.sign.signatureLength=Ae,e.hash=function(e){Le(e);var t=new Uint8Array(Pe);return oe(t,e,e.length),t},e.hash.hashLength=Pe,e.verify=function(e,t){return Le(e,t),e.length===0||t.length===0||e.length!==t.length?!1:h(e,0,t,0,e.length)===0},e.setPRNG=function(e){r=e},(function(){var n=typeof self<`u`?self.crypto||self.msCrypto:null;if(n&&n.getRandomValues){var r=65536;e.setPRNG(function(e,t){var i,a=new Uint8Array(t);for(i=0;i<t;i+=r)n.getRandomValues(a.subarray(i,i+Math.min(t-i,r)));for(i=0;i<t;i++)e[i]=a[i];Re(a)})}else t!==void 0&&(n=or(),n&&n.randomBytes&&e.setPRNG(function(e,t){var r,i=n.randomBytes(t);for(r=0;r<t;r++)e[r]=i[r];Re(i)}))})()})(n!==void 0&&n.exports?n.exports:self.nacl=self.nacl||{})}))(),1),cr=class extends Error{constructor(e){super(e),this.name=`PairCryptoError`}},lr=1,ur=12,dr=32,fr=new TextEncoder,pr=new TextDecoder;function mr(e){return e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength)}function hr(){return sr.default.randomBytes(dr)}function gr(e,t){let n=sr.default.box.keyPair(),r=sr.default.randomBytes(sr.default.box.nonceLength),i=sr.default.box(e,r,t,n.secretKey);return{ephPublicKey:n.publicKey,nonce:r,boxed:i}}async function _r(e){if(e.length!==dr)throw new cr(`contentKey must be ${dr} bytes`);return crypto.subtle.importKey(`raw`,mr(e),`AES-GCM`,!1,[`encrypt`,`decrypt`])}async function vr(e,t,n=crypto.getRandomValues(new Uint8Array(ur))){let r=await _r(e);if(n.length!==ur)throw new cr(`nonce must be 12 bytes`);let i=fr.encode(JSON.stringify(t)),a=new Uint8Array(await crypto.subtle.encrypt({name:`AES-GCM`,iv:mr(n)},r,mr(i))),o=new Uint8Array(13+a.length);return o[0]=lr,o.set(n,1),o.set(a,13),o}async function yr(e,t){if(t.length<29)throw new cr(`frame too short`);if(t[0]!==lr)throw new cr(`unsupported frame version ${t[0]}`);let n=t.subarray(1,13),r=t.subarray(13),i=await _r(e),a;try{a=await crypto.subtle.decrypt({name:`AES-GCM`,iv:mr(n)},i,mr(r))}catch{throw new cr(`decrypt failed: wrong key or tampered frame`)}try{return JSON.parse(pr.decode(new Uint8Array(a)))}catch{throw new cr(`decrypt ok but payload is not valid JSON`)}}function br(){return typeof RTCPeerConnection>`u`?null:e=>xr(e)}function xr(e){let t=new RTCPeerConnection({iceServers:e,iceTransportPolicy:`all`}),n=null,r=!1,i=!1,a=!1,o=[],s=[],c=[],l=[],u=[],d=()=>{if(!(r||i)){i=!0;for(let e of u)e()}},f=e=>{n=e,e.binaryType=`arraybuffer`,e.onopen=()=>{if(!r)for(let e of c)e()},e.onmessage=e=>{if(r)return;let t=e.data,n=typeof t==`string`?new TextEncoder().encode(t):new Uint8Array(t);for(let e of l)e(n)},e.onclose=d,e.onerror=d};t.onicecandidate=e=>{if(!(r||!e.candidate?.candidate))for(let t of s)t({candidate:e.candidate.candidate,sdpMid:e.candidate.sdpMid})},t.onconnectionstatechange=()=>{let e=t.connectionState;(e===`disconnected`||e===`failed`||e===`closed`)&&d()},t.ondatachannel=e=>{r||f(e.channel)};let p=async()=>{a=!0;for(let e of o.splice(0))try{await t.addIceCandidate(e)}catch{}};return{async createOffer(){f(t.createDataChannel(`pair`,{ordered:!0}));let e=await t.createOffer();return await t.setLocalDescription(e),e.sdp??``},async acceptOffer(e){await t.setRemoteDescription({type:`offer`,sdp:e});let n=await t.createAnswer();return await t.setLocalDescription(n),await p(),n.sdp??``},async acceptAnswer(e){await t.setRemoteDescription({type:`answer`,sdp:e}),await p()},async addIceCandidate(e){if(!a){o.push(e);return}await t.addIceCandidate(e)},onIceCandidate(e){return s.push(e),()=>void s.splice(s.indexOf(e),1)},onOpen(e){return c.push(e),()=>void c.splice(c.indexOf(e),1)},onMessage(e){return l.push(e),()=>void l.splice(l.indexOf(e),1)},onClose(e){return u.push(e),()=>void u.splice(u.indexOf(e),1)},send(e){if(r||n?.readyState!==`open`||n.bufferedAmount>1048576)return!1;try{return n.send(e.slice().buffer),!0}catch{return!1}},buffered:()=>n&&!r?n.bufferedAmount:0,close(){if(!r){r=!0;try{n?.close()}catch{}try{t.close()}catch{}}}}}var Sr=16384,Cr=0,wr=1;function Tr(e){let t=[],n=0;do{let r=Math.min(e.byteLength,n+Sr),i=new Uint8Array(1+r-n);i[0]=r>=e.byteLength?wr:Cr,i.set(e.subarray(n,r),1),t.push(i),n=r}while(n<e.byteLength);return t}function Er(){let e=[],t=0,n=!1,r=()=>{e=[],t=0};return{push(i){let a=i[0];if(a!==Cr&&a!==wr)return r(),n=!1,null;if(n)return a===wr&&(n=!1),null;let o=i.subarray(1);if(t+=o.byteLength,t>1048576)return r(),n=a===Cr,null;if(e.push(o),a===Cr)return null;let s=new Uint8Array(t),c=0;for(let t of e)s.set(t,c),c+=t.byteLength;return r(),s}}}var Dr=15e3;function Or(e){return{role:e,phase:`idle`,gen:0,attempt:0,capable:!1,peerOnline:!1,preferRelay:!1}}var kr=e=>({state:e,actions:[]});function Ar(e){if(e.phase===`idle`||e.phase===`cooldown`)return[];let t=[{type:`destroy-peer`}];return e.phase===`connected`&&t.push({type:`switch`,transport:`relay`},{type:`resync`}),t}function jr(e){let t=e.gen+1;return{state:{...e,phase:`negotiating`,gen:t},actions:[{type:`create-offer`,gen:t},{type:`start-timeout`,gen:t}]}}function Mr(e,t){if(e.preferRelay)return{state:{...e,phase:`idle`},actions:t};if(e.capable&&e.peerOnline){let n=jr(e);return{state:n.state,actions:[...t,...n.actions]}}return{state:{...e,phase:`idle`},actions:t}}function Nr(e,t){let n=t=>t===e.gen;switch(t.type){case`peer-capable`:{if(!t.capable)return{state:{...e,capable:!1,preferRelay:!1,phase:`idle`},actions:Ar(e)};let n={...e,capable:!0};return e.phase===`idle`?Mr(n,[]):kr(n)}case`peer-online`:{let n={...e,peerOnline:t.online};return t.online&&e.phase===`idle`?Mr(n,[]):kr(n)}case`answer`:return e.phase===`negotiating`&&n(t.gen)?{state:e,actions:[{type:`apply-answer`,gen:t.gen}]}:kr(e);case`ice`:return(e.phase===`negotiating`||e.phase===`connected`)&&n(t.gen)?{state:e,actions:[{type:`apply-ice`,gen:t.gen}]}:kr(e);case`dc-open`:return e.phase===`negotiating`&&n(t.gen)?{state:{...e,phase:`connected`,attempt:0},actions:[{type:`switch`,transport:`direct`},{type:`resync`}]}:kr(e);case`negotiate-timeout`:{if(e.phase!==`negotiating`||!n(t.gen))return kr(e);let r=e.attempt+1;return{state:{...e,phase:`cooldown`,attempt:r},actions:[{type:`send-close`,gen:t.gen},{type:`destroy-peer`},{type:`schedule-retry`,attempt:r}]}}case`dc-close`:{if(!n(t.gen))return kr(e);let r=e.attempt+1;return e.phase===`connected`?{state:{...e,phase:`cooldown`,attempt:r},actions:[...Ar(e),{type:`schedule-retry`,attempt:r}]}:e.phase===`negotiating`?{state:{...e,phase:`cooldown`,attempt:r},actions:[{type:`send-close`,gen:t.gen},{type:`destroy-peer`},{type:`schedule-retry`,attempt:r}]}:kr(e)}case`cooldown-elapsed`:return e.phase===`cooldown`?Mr(e,[]):kr(e);case`network-change`:{let t=e.phase===`negotiating`||e.phase===`connected`?[{type:`send-close`,gen:e.gen},...Ar(e)]:[];return Mr({...e,attempt:0,preferRelay:!1},t)}case`peer-gone`:{let t=Ar(e).filter(e=>e.type!==`resync`);return{state:{...e,phase:`idle`,attempt:0,capable:!1,peerOnline:!1,preferRelay:!1},actions:t}}case`prefer-relay`:return e.phase===`idle`||e.phase===`cooldown`?{state:{...e,preferRelay:!0,phase:`idle`},actions:[]}:{state:{...e,phase:`idle`,preferRelay:!0,attempt:0},actions:[{type:`send-close`,gen:e.gen},...Ar(e)]};default:return kr(e)}}function Pr(e,t){let n=t=>t===e.gen,r=()=>({state:{...e,phase:`idle`},actions:Ar(e)});switch(t.type){case`peer-online`:return kr({...e,peerOnline:t.online});case`offer`:{let n=t.gen===1&&e.gen===1&&e.phase===`negotiating`;return!(t.gen===1&&e.gen>=1&&!n)&&t.gen<=e.gen?kr(e):{state:{...e,phase:`negotiating`,gen:t.gen},actions:[...Ar(e),{type:`accept-offer`,gen:t.gen},{type:`start-timeout`,gen:t.gen}]}}case`ice`:return(e.phase===`negotiating`||e.phase===`connected`)&&n(t.gen)?{state:e,actions:[{type:`apply-ice`,gen:t.gen}]}:kr(e);case`dc-open`:return e.phase===`negotiating`&&n(t.gen)?{state:{...e,phase:`connected`},actions:[{type:`switch`,transport:`direct`},{type:`resync`}]}:kr(e);case`dc-close`:case`negotiate-timeout`:case`remote-close`:return n(t.gen)&&e.phase!==`idle`?r():kr(e);case`network-change`:return r();case`peer-gone`:return{state:{...e,phase:`idle`,peerOnline:!1},actions:Ar(e)};default:return kr(e)}}function Fr(e,t){return e.role===`guest`?Nr(e,t):Pr(e,t)}function Ir(e,t=Math.random){let n=Math.min(3e5,1e3*2**Math.max(0,e));return Math.round(n*(.7+t()*.6))}function Lr(e){return e.startsWith(`a=`)?e.slice(2):e}function Rr(e){let t=/\styp\s+(\S+)/.exec(Lr(e))?.[1];return t===`host`||t===`srflx`}function zr(e){let t=Lr(e).split(/\s+/),n=t.indexOf(`typ`);if(n<5||!t[n+1])return null;let r=t.indexOf(`raddr`),i=t.indexOf(`rport`);return{typ:t[n+1],address:t[4],port:t[5],base:r>0&&i>0?`${t[r+1]}:${t[i+1]}`:null}}function Br(e){let t=new Map;for(let n of e){let e=zr(n);if(e?.typ!==`srflx`||!e.base)continue;let r=t.get(e.base)??new Set;r.add(`${e.address}:${e.port}`),t.set(e.base,r)}if(t.size===0)return`none`;for(let e of t.values())if(e.size>1)return`symmetric`;return`cone`}function Vr(e){let t=new Map,n=!1;for(let r of e){let e=zr(r);e&&(t.set(e.typ,(t.get(e.typ)??0)+1),e.address.includes(`:`)&&(n=!0))}if(t.size===0)return`none`;let r=[...t].map(([e,t])=>`${e}×${t}`);return n&&r.push(`v6`),r.push(`nat=${Br(e)}`),r.join(` `)}var Hr=40,Ur=1.25,Wr=1e3;function Gr(e,t){return!Number.isFinite(e)||!Number.isFinite(t)||e<0||t<0?!1:e>=t+Hr&&e>=t*Ur}var Kr=2,qr=3,Jr=25e3,Yr=1e4,Xr=2e3,Zr=class{deps;state;peer=null;peerGen=0;dcOpen=!1;iceServers;reassembler=Er();negotiateTimer=null;retryTimer=null;heartbeatTimer=null;heartbeatDeadline=null;pingSentAt=null;closed=!1;qualityGen=null;qualityTimer=null;lastDirectRtt=null;lastRelayRtt=null;constructor(e){this.deps=e,this.state=Or(e.role),this.iceServers=e.iceServers??[]}hostInfo(e){e.iceServers&&(this.iceServers=e.iceServers);let t=this.deps.factory!==null&&(e.capabilities??[]).includes(`direct-v1`);this.dispatch({type:`peer-capable`,capable:t})}peerOnline(e){this.dispatch({type:`peer-online`,online:e})}handleSignal(e){switch(e.type){case`direct-offer`:this.pendingOffer=e.sdp,this.dispatch({type:`offer`,gen:e.gen});break;case`direct-answer`:this.pendingAnswer=e.sdp,this.dispatch({type:`answer`,gen:e.gen});break;case`direct-ice`:e.gen===this.state.gen&&this.remoteCandidates.push(e.candidate),this.pendingIce={candidate:e.candidate,sdpMid:e.sdpMid},this.dispatch({type:`ice`,gen:e.gen});break;case`direct-close`:this.dispatch({type:`remote-close`,gen:e.gen})}}networkChange(){this.dispatch({type:`network-change`})}probe(e=Xr){let t=this.peer,n=this.peerGen;return this.transport()!==`direct`||!t?!1:(this.pingSentAt=Date.now(),t.send(new Uint8Array([Kr])),this.heartbeatDeadline&&clearTimeout(this.heartbeatDeadline),this.heartbeatDeadline=setTimeout(()=>{this.heartbeatDeadline=null,this.peerGen===n&&this.dispatch({type:`dc-close`,gen:n})},e),!0)}noteRelayRtt(e){!Number.isFinite(e)||e<0||(this.lastRelayRtt=e,this.maybeFinishQuality())}peerGone(){this.dispatch({type:`peer-gone`})}close(){this.closed||(this.dispatch({type:`peer-gone`}),this.closed=!0,this.clearRetry(),this.destroyPeer())}transport(){return this.state.phase===`connected`&&this.dcOpen?`direct`:`relay`}send(e){if(this.transport()!==`direct`||!this.peer||(this.peer.buffered?.()??0)+e.byteLength>1048576)return!1;let t=Tr(e);for(let e=0;e<t.length;e++)if(!this.peer.send(t[e]))return e>0&&this.failGen(this.peerGen),!1;return!0}pendingOffer=``;pendingAnswer=``;pendingIce=null;localCandidates=[];remoteCandidates=[];dispatch(e){if(this.closed)return;let t=this.state,{state:n,actions:r}=Fr(this.state,e);this.state=n,this.diagnose(t,e);for(let e of r)this.run(e)}diagnose(e,t){if(!this.deps.onDiagnostic||e.phase!==`negotiating`)return;let n=this.state.phase===`connected`?`open`:t.type===`negotiate-timeout`||t.type===`dc-close`?`failed`:null;n&&this.deps.onDiagnostic(`direct ${n} gen=${e.gen} local[${Vr(this.localCandidates)}] remote[${Vr(this.remoteCandidates)}]`)}run(e){switch(e.type){case`create-offer`:this.spawnPeer(e.gen,t=>t.createOffer().then(t=>{this.peerGen===e.gen&&!this.closed&&this.deps.sendSignal({type:`direct-offer`,gen:e.gen,sdp:t})}));break;case`accept-offer`:{let t=this.pendingOffer;this.spawnPeer(e.gen,n=>n.acceptOffer(t).then(t=>{this.peerGen===e.gen&&!this.closed&&this.deps.sendSignal({type:`direct-answer`,gen:e.gen,sdp:t})}));break}case`apply-answer`:this.peer?.acceptAnswer(this.pendingAnswer).catch(()=>this.failGen(e.gen));break;case`apply-ice`:this.pendingIce&&this.peer?.addIceCandidate(this.pendingIce).catch(()=>{});break;case`start-timeout`:if(this.clearNegotiateTimer(),!this.peer)break;this.negotiateTimer=setTimeout(()=>{this.negotiateTimer=null,this.dispatch({type:`negotiate-timeout`,gen:e.gen})},Dr);break;case`destroy-peer`:this.destroyPeer();break;case`send-close`:this.deps.sendSignal({type:`direct-close`,gen:e.gen});break;case`switch`:this.deps.onTransportChange(e.transport);break;case`resync`:this.deps.onResync();break;case`schedule-retry`:this.clearRetry(),this.retryTimer=setTimeout(()=>{this.retryTimer=null,this.dispatch({type:`cooldown-elapsed`})},Ir(e.attempt))}}spawnPeer(e,t){this.destroyPeer();let n=this.deps.factory?.(this.iceServers)??null;if(!n){this.deps.role===`guest`?this.dispatch({type:`peer-capable`,capable:!1}):this.dispatch({type:`dc-close`,gen:e});return}this.peer=n,this.peerGen=e,this.reassembler=Er(),this.localCandidates=[],this.remoteCandidates=[],n.onIceCandidate(t=>{this.peerGen===e&&(this.localCandidates.push(t.candidate),Rr(t.candidate)&&this.deps.sendSignal({type:`direct-ice`,gen:e,candidate:Lr(t.candidate),sdpMid:t.sdpMid}))}),n.onOpen(()=>{if(this.peerGen===e){if(this.dcOpen=!0,this.clearNegotiateTimer(),this.startHeartbeat(n,e),this.deps.role===`guest`&&this.deps.onNeedRelayProbe){this.beginQuality(e);return}this.dispatch({type:`dc-open`,gen:e})}}),n.onMessage(t=>{if(this.peerGen!==e)return;if(this.alive(),t.byteLength===1&&t[0]===Kr){n.send(new Uint8Array([qr]));return}if(t.byteLength===1&&t[0]===qr){if(this.pingSentAt!==null){let e=Date.now()-this.pingSentAt;this.deps.onRtt?.(e),this.lastDirectRtt=e,this.pingSentAt=null,this.maybeFinishQuality()}return}let r=this.reassembler.push(t);r&&this.deps.onFrame(r)}),n.onClose(()=>{this.peerGen===e&&this.dispatch({type:`dc-close`,gen:e})}),t(n).catch(()=>this.failGen(e))}failGen(e){(this.peerGen===e||this.state.gen===e)&&this.dispatch({type:`dc-close`,gen:e})}destroyPeer(){this.clearNegotiateTimer(),this.clearQuality(),this.stopHeartbeat(),this.dcOpen=!1;let e=this.peer;this.peer=null,this.peerGen=-1;try{e?.close()}catch{}}startHeartbeat(e,t){this.stopHeartbeat();let n=()=>{this.peerGen===t&&(this.pingSentAt=Date.now(),e.send(new Uint8Array([Kr])),this.heartbeatDeadline??=setTimeout(()=>{this.heartbeatDeadline=null,this.peerGen===t&&this.dispatch({type:`dc-close`,gen:t})},Yr))};n(),this.heartbeatTimer=setInterval(n,Jr)}alive(){this.heartbeatDeadline&&clearTimeout(this.heartbeatDeadline),this.heartbeatDeadline=null}stopHeartbeat(){this.heartbeatTimer&&clearInterval(this.heartbeatTimer),this.heartbeatTimer=null,this.pingSentAt=null,this.alive()}clearNegotiateTimer(){this.negotiateTimer&&clearTimeout(this.negotiateTimer),this.negotiateTimer=null}clearRetry(){this.retryTimer&&clearTimeout(this.retryTimer),this.retryTimer=null}beginQuality(e){this.clearQuality(),this.qualityGen=e,this.lastDirectRtt=null,this.lastRelayRtt=null,this.deps.onNeedRelayProbe?.(),this.qualityTimer=setTimeout(()=>this.finishQuality(e),Wr)}maybeFinishQuality(){this.qualityGen!==null&&this.qualityGen===this.peerGen&&this.lastDirectRtt!==null&&this.lastRelayRtt!==null&&this.finishQuality(this.qualityGen)}finishQuality(e){if(this.qualityGen===e&&(this.clearQuality(),!(this.peerGen!==e||!this.dcOpen))){if(this.lastDirectRtt!==null&&this.lastRelayRtt!==null&&Gr(this.lastDirectRtt,this.lastRelayRtt)){this.deps.onDiagnostic?.(`direct slower than relay ${Math.round(this.lastDirectRtt)}ms>${Math.round(this.lastRelayRtt)}ms, stay relay`),this.dispatch({type:`prefer-relay`});return}this.dispatch({type:`dc-open`,gen:e})}}clearQuality(){this.qualityTimer&&clearTimeout(this.qualityTimer),this.qualityTimer=null,this.qualityGen=null}};function Qr(e){let t=``;for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return btoa(t).replace(/\+/g,`-`).replace(/\//g,`_`).replace(/=+$/,``)}function $r(e){let t=e.replace(/-/g,`+`).replace(/_/g,`/`),n=t.length%4==0?``:`=`.repeat(4-t.length%4),r=atob(t+n),i=new Uint8Array(r.length);for(let e=0;e<r.length;e++)i[e]=r.charCodeAt(e);return i}function ei(e){let t=e.trim(),n=/^enso:\/\/pair\?(.*)$/.exec(t);if(n)return ti(new URLSearchParams(n[1]));if(/^https?:\/\//i.test(t)){let e=new URL(t);return ti(new URLSearchParams(e.hash.replace(/^#/,``)||e.search),e.origin)}throw Error(`not an enso pair uri`)}function ti(e,t){let n=e.get(`relay`)??t,r=e.get(`pk`);if(!n||!r)throw Error(`pair uri missing relay or pk`);return{relay:n,publicKey:$r(r)}}function ni(e){return e.trim().replace(/\/+$/,``).replace(/^http/,`ws`)}function ri(e){return e.trim().replace(/\/+$/,``)}function ii(e){if(e<=0)return 0;let t=Math.min(3e4,1e3*2**(e-1));return Math.round(t*(.7+Math.random()*.6))}function ai(e){return[Qr(e.ephPublicKey),Qr(e.nonce),Qr(e.boxed)].join(`.`)}async function oi(e,t){let n;for(let r=0;r<2;r++)try{let n=await fetch(e,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify(t),signal:AbortSignal.timeout(1e4)}),r=await n.json().catch(()=>({}));if(!n.ok)throw Error(r.error??`relay ${n.status}`);return r}catch(e){if(n=e,!(e instanceof TypeError||e?.name===`TimeoutError`))throw e}throw n}async function si(e,t,n){let r=ri(e),i=hr(),a=gr(i,t),o=await oi(`${r}/v1/pair/claim`,{publicKey:Qr(t),boxedKey:ai(a),deviceName:n});return{pairId:o.pairId,deviceToken:o.deviceToken,contentKey:i}}async function ci(e,t,n){let r=`${ri(e)}/v1/pair/${encodeURIComponent(t)}?token=${encodeURIComponent(n)}`;await fetch(r,{method:`DELETE`})}var li=15e3,ui=8e3;function di(e,t,n){let r=null,i=null,a=0,o=!1,s=()=>{r&&clearTimeout(r),r=null,a=0},c=(n,s)=>{if(!(o||e.readyState!==1)){i=Date.now();try{e.send(`ping`)}catch{}r&&clearTimeout(r),r=setTimeout(()=>{if(r=null,!o){if(a+=1,a<s){c(n,s);return}t()}},n)}},l=(e=ui)=>{c(e,1)},u=()=>{r||c(ui,2)},d=e=>{s(),e.data===`pong`&&i!==null&&(n?.(Date.now()-i),i=null)};e.addEventListener(`message`,d);let f=()=>u();e.addEventListener(`open`,f),e.readyState===1&&u();let p=setInterval(u,li);return{probe:l,stop(){o=!0,clearInterval(p),s(),i=null,e.removeEventListener(`message`,d),e.removeEventListener(`open`,f)}}}var fi=24e4,pi=1024;function mi(e){let t=atob(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;e++)n[e]=t.charCodeAt(e);return n}var hi=mi;function gi(e,t,n=fi){let r=JSON.stringify(e);if(r.length<=n)return[e];let i=Math.ceil(r.length/n);if(i>pi)throw Error(`remote frame too large: ${r.length} chars`);let a=t();return Array.from({length:i},(e,t)=>({type:`part`,pid:a,index:t,total:i,data:r.slice(t*n,(t+1)*n)}))}function _i(e){if(typeof e!=`object`||!e)return!1;let t=e;return t.type===`part`&&typeof t.pid==`string`&&t.pid.length>0&&t.pid.length<=64&&Number.isInteger(t.index)&&Number.isInteger(t.total)&&t.total>0&&t.total<=pi&&t.index>=0&&t.index<t.total&&typeof t.data==`string`&&t.data.length<=24e4}var vi=new Set([`rpc-ready`,`rpc-result`,`rpc-event`,`asset`,`gzip`,`part`]);function yi(e){return vi.has(e.type)}async function bi(e,t){let n=new Blob([e]).stream().pipeThrough(t);return new Uint8Array(await new Response(n).arrayBuffer())}async function xi(e){try{let t=await bi(mi(e.data),new DecompressionStream(`gzip`));return JSON.parse(new TextDecoder().decode(t))}catch{return null}}function Si(e={}){let t=e.ttlMs??12e4,n=e.maxPending??16,r=e.now??Date.now,i=new Map,a=()=>{let e=r();for(let[n,r]of i)e-r.at>t&&i.delete(n)};return{push(e){a();let t=i.get(e.pid);if(t&&t.total!==e.total)return i.delete(e.pid),null;if(!t){if(i.size>=n){let e=i.keys().next().value;e!==void 0&&i.delete(e)}t={total:e.total,parts:Array(e.total),got:0,at:r()},i.set(e.pid,t)}if(t.parts[e.index]===void 0&&(t.parts[e.index]=e.data,t.got++),t.at=r(),t.got<t.total)return null;i.delete(e.pid);try{return JSON.parse(t.parts.join(``))}catch{return null}},clear(){i.clear()}}}function Ci(e={}){let t=e.maxHeld??4096,n=new Map,r=0,i=!1;return{push(e,a){if(e===void 0)return[a];if(e<=r||n.has(e))return[];n.set(e,a),n.size>t&&(i=!0);let o=[];for(let e=n.get(r+1);e!==void 0;e=n.get(r+1))n.delete(r+1),r++,o.push(e);return o},get applied(){return r},get gap(){return n.size>0},get overflowed(){return i}}}var wi=8,Ti=12,Ei=64;function Di(e){return typeof e==`object`&&!!e&&e.type===`replay-hello`}function Oi(e=vr,t=yr){let n=Fi(wi),r=0,i=Fi(wi),a=null,o=!1,s=!1,c=null,l=0,u=!1,d=0n;function f(){i=Fi(wi),a=null,o=!1,s=!1,c=null,l=0,u=!1,d=0n}function p(){let e={p:Qr(n),c:Qr(i)};return a&&(e.e=Qr(a)),e}function m(e){if(e<=0||e>4294967295)return!1;if(l===0)return l=e,d=1n,!0;if(e>l){let t=BigInt(e-l);return d=t>=BigInt(Ei)?1n:(d<<t|1n)&(1n<<BigInt(Ei))-1n,l=e,!0}let t=l-e;if(t>=Ei)return!1;let n=1n<<BigInt(t);return d&n?!1:(d|=n,!0)}return{peerReset:f,async seal(t,i){let a=ki(i,p());if(!o)return e(t,a);if(r===4294967295)throw new cr(`replay counter exhausted`);r+=1;let s=new Uint8Array(Ti);return s.set(n,0),s[8]=r>>>24,s[9]=r>>>16&255,s[10]=r>>>8&255,s[11]=r&255,e(t,a,s)},async open(e,n){let r=await t(e,n),f=ji(r);f&&(!a||!Pi(a,f.c))&&(a=f.c,o=!0,u=!0);let p=n.subarray(1,13);if(f?.e&&Pi(f.e,i)&&Pi(p.subarray(0,wi),f.p))return(!s||!c||!Pi(c,f.p))&&(s=!0,c=f.p,l=0,d=0n),m(Ni(p))?Ai(r):void 0;if(!s||c&&Pi(p.subarray(0,wi),c)&&m(Ni(p)))return Ai(r)},takeHello(){return u?(u=!1,!0):!1}}}function ki(e,t){return typeof e!=`object`||!e||Array.isArray(e)?e:{...e,replay:t}}function Ai(e){if(typeof e!=`object`||!e||!(`replay`in e))return e;let{replay:t,...n}=e;return n}function ji(e){if(typeof e!=`object`||!e||!(`replay`in e))return null;let t=e.replay;if(typeof t!=`object`||!t)return null;let n=t,r=Mi(n.p),i=Mi(n.c);if(!r||!i)return null;if(n.e===void 0)return{p:r,c:i};let a=Mi(n.e);return a?{p:r,c:i,e:a}:null}function Mi(e){if(typeof e!=`string`)return null;try{let t=$r(e);return t.length===wi?t:null}catch{return null}}function Ni(e){return(e[8]<<24|e[9]<<16|e[10]<<8|e[11])>>>0}function Pi(e,t){if(e.length!==t.length)return!1;let n=0;for(let r=0;r<e.length;r++)n|=e[r]^t[r];return n===0}function Fi(e){let t=new Uint8Array(e);return crypto.getRandomValues(t),t}function Ii(e,t,n=null){return!t||n!==null&&n!==1||e===`network-change`||e===`online`}var Li=2e3;function Ri(e,t=Li){return e>=t}var zi=8e3;function Bi(e,t,n=zi){return e===0&&t>=n}var Vi=512,Hi=e=>typeof e==`object`&&!!e&&!Array.isArray(e),Ui=e=>typeof e==`string`&&e.length>0&&e.length<=Vi,Wi=e=>typeof e==`number`&&Number.isSafeInteger(e)&&e>=0,Gi=(e,t)=>Object.keys(e).length===t.length&&Object.keys(e).every(e=>t.includes(e));function Ki(e){return Hi(e)&&Gi(e,[`epoch`,`seq`])&&Ui(e.epoch)&&Wi(e.seq)}function qi(e,t){if(!Hi(e)||e.type!==`snapshot`||!Array.isArray(e.sessions)||e.sessions.length!==1)return!1;let n=e.sessions[0];return!(!Hi(n)||n.sessionId!==t||!Array.isArray(n.messages)||!Wi(n.baseIndex)||n.identity!==void 0&&(!Hi(n.identity)||n.identity.sessionId!==t))}function Ji(e){return!Hi(e)||e.type!==`session-sync`||!Ui(e.sessionId)||!Ui(e.requestId)||!Ki(e.cursor)?null:e.mode===`snapshot`?Gi(e,[`type`,`sessionId`,`requestId`,`cursor`,`mode`,`snapshot`])&&qi(e.snapshot,e.sessionId)?e:null:e.mode!==`replay`||!Gi(e,[`type`,`sessionId`,`requestId`,`cursor`,`mode`,`fromSeq`,`events`])||!Wi(e.fromSeq)||!Array.isArray(e.events)||e.fromSeq>e.cursor.seq||e.events.length!==e.cursor.seq-e.fromSeq?null:e.events.every(t=>Hi(t)&&Ui(t.type)&&t.sessionId===e.sessionId)?e:null}var Yi={state:`synced`,knownIds:new Set};function Xi(e,t,n){return{...e,state:t&&!n?.fresh?`syncing`:`synced`}}function Zi(e,t,n){return!t||!n.includes(t)?e:{...e,state:`synced`}}function Qi(e,t,n){let r=t!==null&&e.knownIds.has(t)&&!n.includes(t);return{tracking:{state:r?`synced`:e.state,knownIds:new Set(n)},ghost:r}}var $i=1,ea=`enso-phone-session-cache`,ta=`pairs`,na=2,ra=8e3,ia={ttlMs:6048e5,maxSessions:5,maxMessages:200,maxDeviceBytes:4194304,maxRecords:8,maxTotalBytes:16777216},X=e=>typeof e==`object`&&!!e&&!Array.isArray(e),Z=e=>typeof e==`string`,aa=e=>typeof e==`boolean`,Q=e=>typeof e==`number`&&Number.isFinite(e)&&Math.abs(e)<=2**53-1,oa=e=>Q(e)&&Number.isSafeInteger(e)&&e>=0,$=(e,t,n)=>e[t]===void 0||n(e[t]);function sa(e,t){if(!Array.isArray(e))return null;let n=[];for(let r of e){let e=t(r);if(e===null)return null;n.push(e)}return n}function ca(e,t){if(!Array.isArray(e))return null;let n=[];for(let r of e){let e=t(r);e&&n.push(e)}return n}function la(e){let t=new Set,n=[];for(let r of e)t.has(r.id)||(t.add(r.id),n.push(r));return n}function ua(e){return new Set(e).size===e.length}function da(e){if(!X(e)||!Z(e.id)||!Z(e.title)||!Z(e.projectId)||!Z(e.status)||!$(e,`projectName`,Z)||!$(e,`cwd`,Z)||!$(e,`unread`,aa)||!$(e,`pendingAskCount`,oa)||!$(e,`pendingApprovalCount`,oa)||!$(e,`parentId`,Z)||!$(e,`updatedAt`,oa)||!$(e,`pinned`,aa)||!$(e,`archived`,aa)||!$(e,`muted`,aa)||!$(e,`providerId`,Z)||!$(e,`modelId`,Z)||!$(e,`reasoningEnabled`,aa))return null;let t=e.queued===void 0?void 0:ca(e.queued,e=>!X(e)||!Z(e.id)||!Z(e.text)||!$(e,`hasImages`,aa)?null:{id:e.id,text:e.text,...typeof e.hasImages==`boolean`?{hasImages:e.hasImages}:{}}),n;if(e.goal!==void 0){if(!X(e.goal)||!Z(e.goal.text)||!oa(e.goal.autoTurns)||!$(e.goal,`note`,Z))return null;let t=e.goal.status;if(t!==`active`&&t!==`paused`&&t!==`completed`&&t!==`blocked`&&t!==`waiting`)return null;n={text:e.goal.text,status:t,autoTurns:e.goal.autoTurns,...typeof e.goal.note==`string`?{note:e.goal.note}:{}}}let r=e.slashCommands===void 0?void 0:ca(e.slashCommands,e=>X(e)&&Z(e.name)&&Z(e.description)?{name:e.name,description:e.description}:null),i={id:e.id,title:e.title,projectName:Z(e.projectName)?e.projectName:``,projectId:e.projectId,status:e.status};typeof e.cwd==`string`&&(i.cwd=e.cwd),typeof e.unread==`boolean`&&(i.unread=e.unread),typeof e.pendingAskCount==`number`&&(i.pendingAskCount=e.pendingAskCount),typeof e.pendingApprovalCount==`number`&&(i.pendingApprovalCount=e.pendingApprovalCount),typeof e.parentId==`string`&&(i.parentId=e.parentId),typeof e.updatedAt==`number`&&(i.updatedAt=e.updatedAt),typeof e.pinned==`boolean`&&(i.pinned=e.pinned),typeof e.archived==`boolean`&&(i.archived=e.archived),e.muted===!0&&(i.muted=!0),typeof e.providerId==`string`&&(i.providerId=e.providerId),typeof e.modelId==`string`&&(i.modelId=e.modelId),typeof e.reasoningEnabled==`boolean`&&(i.reasoningEnabled=e.reasoningEnabled),(e.thinkingLevel===`minimal`||e.thinkingLevel===`low`||e.thinkingLevel===`medium`||e.thinkingLevel===`high`||e.thinkingLevel===`xhigh`||e.thinkingLevel===`max`)&&(i.thinkingLevel=e.thinkingLevel),t&&(i.queued=t),n&&(i.goal=n),r&&(i.slashCommands=r);let a=fa(e.context);a&&(i.context=a);let o=fn(e.usageTotals);return o&&(i.usageTotals=o),i}function fa(e){if(!(!X(e)||!oa(e.used)||!$(e,`window`,oa)))return typeof e.window==`number`?{used:e.used,window:e.window}:{used:e.used}}function pa(e){return!X(e)||!Z(e.id)||!Z(e.name)||!$(e,`path`,Z)||!$(e,`alias`,Z)||!$(e,`sshConnectionName`,Z)||!$(e,`sshHost`,Z)||!$(e,`groupId`,Z)||e.kind!==void 0&&e.kind!==`local`&&e.kind!==`ssh`||e.archived!==void 0&&e.archived!==!0?null:{id:e.id,name:e.name,path:Z(e.path)?e.path:``,...typeof e.alias==`string`?{alias:e.alias}:{},...e.kind===`local`||e.kind===`ssh`?{kind:e.kind}:{},...typeof e.sshConnectionName==`string`?{sshConnectionName:e.sshConnectionName}:{},...typeof e.sshHost==`string`?{sshHost:e.sshHost}:{},...e.archived===!0?{archived:!0}:{},...typeof e.groupId==`string`?{groupId:e.groupId}:{}}}function ma(e){return!X(e)||!Z(e.id)||!Z(e.name)||!Q(e.order)||!$(e,`emoji`,Z)||!$(e,`color`,Z)?null:{id:e.id,name:e.name,order:e.order,...typeof e.emoji==`string`?{emoji:e.emoji}:{},...typeof e.color==`string`?{color:e.color}:{}}}function ha(e){if(!X(e)||!Z(e.id)||!Z(e.name))return null;let t=ca(e.models,e=>!X(e)||!Z(e.id)||!$(e,`label`,Z)?null:{id:e.id,...typeof e.label==`string`?{label:e.label}:{}});return t?{id:e.id,name:e.name,models:la(t)}:null}var ga={ok:!1};function _a(e,t={nodes:0,seen:new WeakSet},n=0){if(t.nodes+=1,t.nodes>2e5||n>32)return ga;if(e===null||Z(e)||aa(e)||Q(e))return{ok:!0,value:e};if(Array.isArray(e)){if(t.seen.has(e))return ga;t.seen.add(e);let r=[];for(let i of e){let e=_a(i,t,n+1);if(!e.ok)return ga;r.push(e.value)}return t.seen.delete(e),{ok:!0,value:r}}if(!X(e))return ga;let r=Object.getPrototypeOf(e);if(r!==Object.prototype&&r!==null||t.seen.has(e))return ga;t.seen.add(e);let i={};for(let[r,a]of Object.entries(e)){if(a===void 0)continue;let e=_a(a,t,n+1);if(!e.ok)return ga;Object.defineProperty(i,r,{value:e.value,enumerable:!0,configurable:!0,writable:!0})}return t.seen.delete(e),{ok:!0,value:i}}function va(e){if(!X(e))return null;switch(e.type){case`text`:return Z(e.text)?{type:`text`,text:e.text}:null;case`thinking`:return Z(e.text)?{type:`thinking`,text:e.text}:null;case`toolCall`:{if(!Z(e.id)||!Z(e.name))return null;if(e.arguments===void 0)return{type:`toolCall`,id:e.id,name:e.name};let t=_a(e.arguments);return t.ok?{type:`toolCall`,id:e.id,name:e.name,arguments:t.value}:null}case`image`:return Z(e.data)&&Z(e.mimeType)?{type:`image`,data:e.data,mimeType:e.mimeType}:null;case`unknown`:return{type:`unknown`};default:return null}}function ya(e){return!X(e)||!Q(e.input)||!Q(e.output)||!Q(e.cacheRead)||!Q(e.cacheWrite)?null:{input:e.input,output:e.output,cacheRead:e.cacheRead,cacheWrite:e.cacheWrite}}function ba(e){return!X(e)||!Q(e.stepStartMs)||!$(e,`firstTokenMs`,Q)||!$(e,`thinkingEndMs`,Q)||!$(e,`completedMs`,Q)?null:{stepStartMs:e.stepStartMs,...typeof e.firstTokenMs==`number`?{firstTokenMs:e.firstTokenMs}:{},...typeof e.thinkingEndMs==`number`?{thinkingEndMs:e.thinkingEndMs}:{},...typeof e.completedMs==`number`?{completedMs:e.completedMs}:{}}}function xa(e){if(!X(e)||!Z(e.role))return null;let t=sa(e.content,va);if(!t||!$(e,`toolName`,Z)||!$(e,`toolCallId`,Z)||!$(e,`isError`,aa)||!$(e,`stopReason`,Z)||!$(e,`errorMessage`,Z)||!$(e,`timestamp`,Q)||!$(e,`ttft`,Q)||!$(e,`duration`,Q)||!$(e,`toolDurationMs`,Q)||!$(e,`tokensBefore`,Q)||!$(e,`verified`,aa)||!$(e,`memory`,aa)||!$(e,`restartResumed`,aa))return null;let n=e.usage===void 0?void 0:ya(e.usage),r=e.timing===void 0?void 0:ba(e.timing);if(e.usage!==void 0&&!n||e.timing!==void 0&&!r)return null;let i=e.todos===void 0?void 0:sa(e.todos,e=>!X(e)||!Z(e.content)||e.status!==`pending`&&e.status!==`in_progress`&&e.status!==`completed`?null:{content:e.content,status:e.status});if(e.todos!==void 0&&!i)return null;let a;if(e.subagentMeta!==void 0){if(!X(e.subagentMeta)||!$(e.subagentMeta,`modelId`,Z)||!$(e.subagentMeta,`outputTokens`,Q)||!$(e.subagentMeta,`steps`,Q))return null;a={...typeof e.subagentMeta.modelId==`string`?{modelId:e.subagentMeta.modelId}:{},...typeof e.subagentMeta.outputTokens==`number`?{outputTokens:e.subagentMeta.outputTokens}:{},...typeof e.subagentMeta.steps==`number`?{steps:e.subagentMeta.steps}:{}}}let o;if(e.editDiff!==void 0){if(!X(e.editDiff)||!Z(e.editDiff.oldText)||!Z(e.editDiff.newText))return null;o={oldText:e.editDiff.oldText,newText:e.editDiff.newText}}let s=e.fileChanges===void 0?void 0:sa(e.fileChanges,e=>!X(e)||!Z(e.path)||!Z(e.oldText)||!Z(e.newText)||e.type!==`add`&&e.type!==`update`&&e.type!==`delete`||e.truncated!==void 0&&e.truncated!==!0?null:{path:e.path,oldText:e.oldText,newText:e.newText,type:e.type,...e.truncated===!0?{truncated:!0}:{}});if(e.fileChanges!==void 0&&!s)return null;let c;if(e.applyPatchOutcome!==void 0){let t=e.applyPatchOutcome;if(!X(t)||t.status!==`success`&&t.status!==`partial`&&t.status!==`failed`||!$(t,`error`,Z)||!$(t,`input`,Z)||t.errorTruncated!==void 0&&t.errorTruncated!==!0||t.inputTruncated!==void 0&&t.inputTruncated!==!0)return null;let n=sa(t.applied,e=>Z(e)?e:null),r=sa(t.failed,e=>Z(e)?e:null),i=sa(t.unattempted,e=>Z(e)?e:null),a=sa(t.uncertain,e=>Z(e)?e:null);if(!n||!r||!i||!a)return null;c={status:t.status,applied:n,failed:r,unattempted:i,uncertain:a,...typeof t.error==`string`?{error:t.error}:{},...t.errorTruncated===!0?{errorTruncated:!0}:{},...typeof t.input==`string`?{input:t.input}:{},...t.inputTruncated===!0?{inputTruncated:!0}:{}}}let l={role:e.role,content:t};return typeof e.toolName==`string`&&(l.toolName=e.toolName),typeof e.toolCallId==`string`&&(l.toolCallId=e.toolCallId),typeof e.isError==`boolean`&&(l.isError=e.isError),typeof e.stopReason==`string`&&(l.stopReason=e.stopReason),typeof e.errorMessage==`string`&&(l.errorMessage=e.errorMessage),typeof e.timestamp==`number`&&(l.timestamp=e.timestamp),n&&(l.usage=n),typeof e.ttft==`number`&&(l.ttft=e.ttft),typeof e.duration==`number`&&(l.duration=e.duration),r&&(l.timing=r),i&&(l.todos=i),typeof e.toolDurationMs==`number`&&(l.toolDurationMs=e.toolDurationMs),a&&(l.subagentMeta=a),o&&(l.editDiff=o),s&&(l.fileChanges=s),c&&(l.applyPatchOutcome=c),typeof e.tokensBefore==`number`&&(l.tokensBefore=e.tokensBefore),typeof e.verified==`boolean`&&(l.verified=e.verified),typeof e.memory==`boolean`&&(l.memory=e.memory),e.restartResumed===!0&&(l.restartResumed=!0),l}function Sa(e){return sa(e,e=>!X(e)||!Z(e.requestId)||!Z(e.tool)||!Z(e.summary)||!$(e,`toolCallId`,Z)||e.phase!==void 0&&e.phase!==`reviewing`||e.kind!==`command`&&e.kind!==`file-edit`&&e.kind!==`file-write`&&e.kind!==`mcp`?null:{requestId:e.requestId,tool:e.tool,kind:e.kind,summary:e.summary,...typeof e.toolCallId==`string`?{toolCallId:e.toolCallId}:{},...e.phase===`reviewing`?{phase:`reviewing`}:{},...typeof e.expiresAt==`number`?{expiresAt:e.expiresAt}:{}})}function Ca(e){return sa(e,e=>{if(!X(e)||!Z(e.requestId)||!Z(e.question))return null;let t=e.options===void 0?void 0:sa(e.options,e=>Z(e)?e:null);return e.options!==void 0&&!t?null:{requestId:e.requestId,question:e.question,...t?{options:t}:{},...typeof e.expiresAt==`number`?{expiresAt:e.expiresAt}:{}}})}function wa(e){return sa(e,e=>!X(e)||!Z(e.taskId)||!Z(e.command)||!Z(e.tail)||!Q(e.startedAt)||!$(e,`exitCode`,Q)||e.status!==`running`&&e.status!==`done`&&e.status!==`failed`?null:{taskId:e.taskId,command:e.command,status:e.status,tail:e.tail,startedAt:e.startedAt,...typeof e.exitCode==`number`?{exitCode:e.exitCode}:{}})}function Ta(e){return sa(e,e=>{if(!X(e)||!Z(e.id)||!Z(e.description)||!Q(e.steps)||!Z(e.currentActivity)||!Q(e.startedAt)||!$(e,`detailsPruned`,aa)||!$(e,`resultText`,Z)||!$(e,`modelId`,Z)||!$(e,`agentType`,Z)||!$(e,`outputTokens`,Q)||e.status!==`running`&&e.status!==`done`&&e.status!==`failed`)return null;let t=e.activityLog===void 0?void 0:sa(e.activityLog,e=>Z(e)?e:null),n=e.activities===void 0?void 0:sa(e.activities,e=>!X(e)||!Z(e.id)?null:e.type===`assistant`&&Z(e.text)&&aa(e.streaming)?{id:e.id,type:`assistant`,text:e.text,streaming:e.streaming}:e.type===`tool`&&Z(e.toolName)&&Z(e.argumentsText)&&$(e,`outputText`,Z)&&(e.status===`running`||e.status===`done`||e.status===`failed`||e.status===`aborted`)?{id:e.id,type:`tool`,toolName:e.toolName,argumentsText:e.argumentsText,status:e.status,...typeof e.outputText==`string`?{outputText:e.outputText}:{}}:null);return e.activityLog!==void 0&&!t||e.activities!==void 0&&!n?null:{id:e.id,description:e.description,status:e.status,steps:e.steps,currentActivity:e.currentActivity,startedAt:e.startedAt,...t?{activityLog:t}:{},...n?{activities:n}:{},...typeof e.detailsPruned==`boolean`?{detailsPruned:e.detailsPruned}:{},...typeof e.resultText==`string`?{resultText:e.resultText}:{},...typeof e.modelId==`string`?{modelId:e.modelId}:{},...typeof e.agentType==`string`?{agentType:e.agentType}:{},...typeof e.outputTokens==`number`?{outputTokens:e.outputTokens}:{}}})}function Ea(e,t){if(!X(e)||!Z(e.status))return null;let n=Sa(e.approvals),r=Ca(e.asks),i=wa(e.tasks),a=Ta(e.subagents);if(!n||!r||!i||!a)return null;let o;if(e.retry!==void 0){if(!X(e.retry)||!oa(e.retry.attempt)||!oa(e.retry.maxAttempts)||!oa(e.retry.delayMs)||!Z(e.retry.error)||!Q(e.retry.at))return null;o={attempt:e.retry.attempt,maxAttempts:e.retry.maxAttempts,delayMs:e.retry.delayMs,error:e.retry.error,at:e.retry.at}}return e.compaction!==void 0&&e.compaction!==`queued`&&e.compaction!==`running`||!$(e,`compactionNoticeAt`,oa)?null:{messages:t,status:e.status,approvals:n,asks:r,tasks:i,subagents:a,...o?{retry:o}:{},...e.compaction===`queued`||e.compaction===`running`?{compaction:e.compaction}:{},...typeof e.compactionNoticeAt==`number`?{compactionNoticeAt:e.compactionNoticeAt}:{}}}function Da(e){return X(e)&&Z(e.epoch)&&e.epoch.length>0&&oa(e.seq)?{epoch:e.epoch,seq:e.seq}:null}function Oa(e,t){if(!X(e)||!Z(e.id)||!X(e.view)||!(e.view.messages instanceof Map))return null;let n=[...e.view.messages.entries()];if(n.some(([e])=>!oa(e)))return null;n.sort((e,t)=>e[0]-t[0]);let r=Math.max(0,n.length-1);for(;r>0&&n[r-1][0]===n[r][0]-1;)--r;let i=n.slice(Math.max(r,n.length-t));if(n.length>0&&i.length===0)return null;let a=[];for(let[e,t]of i){let n=xa(t);n&&a.push([e,n])}let o=Ea(e.view,new Map(a));if(!o)return null;let s=e.cursor===void 0?void 0:Da(e.cursor);return e.cursor!==void 0&&!s?null:{id:e.id,view:{...o,messages:a},...s?{cursor:s}:{}}}function ka(e,t){if(!X(e)||!Z(e.id)||!X(e.view))return null;let n=e.view.messages;if(!Array.isArray(n)||n.length>t.maxMessages)return null;let r=new Map,i;for(let e of n){if(!Array.isArray(e)||e.length!==2||!oa(e[0])||i!==void 0&&e[0]<=i)return null;let t=xa(e[1]);if(!t||r.has(e[0]))return null;r.set(e[0],t),i=e[0]}let a=Ea(e.view,r);if(!a)return null;let o=e.cursor===void 0?void 0:Da(e.cursor);return e.cursor!==void 0&&!o?null:{id:e.id,view:a,...o?{cursor:o}:{}}}function Aa(e){if(!X(e))return null;let t=ca(e.catalog,da)??[],n=ca(e.pinnedOrder,e=>Z(e)?e:null)??[],r=ca(e.projects,pa)??[],i=ca(e.projectGroups,ma)??[],a=ca(e.providers,ha)??[],o=[...new Set(n)];return{catalog:la(t),pinnedOrder:o,projects:la(r),projectGroups:la(i),providers:la(a)}}function ja(e){try{let t=JSON.stringify(e);return t===void 0?null:new TextEncoder().encode(t).byteLength}catch{return null}}function Ma(e,t){if(!X(e)||!Array.isArray(e.sessions))return console.warn(`[pair] cache encode skipped`),null;let n=Aa(e)??{catalog:[],pinnedOrder:[],projects:[],projectGroups:[],providers:[]},r=[],i=t.maxSessions===0?[]:e.sessions.slice(-t.maxSessions);for(let e of i){let n=Oa(e,t.maxMessages);n&&r.push(n)}if(!ua(r.map(e=>e.id)))return null;let a={...n,sessions:r},o=ja(a);if(o===null)return null;for(;o>t.maxDeviceBytes&&a.sessions.length>1;)if(a.sessions.shift(),o=ja(a),o===null)return null;if(o<=t.maxDeviceBytes)return a;let s=a.sessions[0];if(s?.view.messages.length){let e=s.view.messages,n=1,r=e.length-1,i=-1;for(;n<=r;){let o=Math.floor((n+r)/2);s.view.messages=e.slice(o);let c=ja(a);c!==null&&c<=t.maxDeviceBytes?(i=o,r=o-1):n=o+1}if(i>=0)return s.view.messages=e.slice(i),a}return a.sessions=[],o=ja(a),o!==null&&o<=t.maxDeviceBytes?a:null}function Na(e,t){let n=Aa(e);if(!n||!X(e)||!Array.isArray(e.sessions)||e.sessions.length>t.maxSessions)return null;let r=sa(e.sessions,e=>ka(e,t));return!r||!ua(r.map(e=>e.id))?null:{...n,sessions:r}}function Pa(e,t,n,r){if(!X(e)||!oa(r)||e.schema!==$i||e.pairId!==t||!oa(e.updatedAt)||!oa(e.accessedAt)||!oa(e.bytes)||r-e.updatedAt>n.ttlMs)return null;let i=ja(e.data),a=ja(e);if(i===null||i!==e.bytes||i>n.maxDeviceBytes||a===null||a>n.maxDeviceBytes)return null;let o=Na(e.data,n);if(!o)return null;let s=Fa(t,e.updatedAt,n.maxDeviceBytes),c=Ma(o,{...n,maxDeviceBytes:s}),l=c?ja(c):null;return!c||l===null?null:{data:o,record:{pairId:t,schema:$i,updatedAt:e.updatedAt,accessedAt:e.accessedAt,bytes:l,data:c}}}function Fa(e,t,n){let r=ja({pairId:e,schema:$i,updatedAt:t,accessedAt:t,bytes:n,data:null});return r===null?0:Math.max(0,n-(r-4))}function Ia(e,t,n){let r=[],i=[];for(let t of e){let e=t.value,n=ja(e);if(!X(e)||e.schema!==$i||e.pairId!==t.key||!oa(e.accessedAt)||n===null){r.push(t.key);continue}i.push({key:t.key,accessedAt:e.accessedAt,bytes:n})}i.sort((e,t)=>t.accessedAt-e.accessedAt||Number(t.key===n)-Number(e.key===n)||e.key.localeCompare(t.key));let a=0,o=0;for(let e of i)o>=t.maxRecords||a+e.bytes>t.maxTotalBytes?r.push(e.key):(o+=1,a+=e.bytes);return[...new Set(r)]}var La=class{factory;timeoutMs;opening=null;constructor(e,t){this.factory=e,this.timeoutMs=t}database(){if(!this.opening){let e=this.open();this.opening=e,e.catch(()=>{this.opening===e&&(this.opening=null)})}return this.opening}open(){return new Promise((e,t)=>{let n;try{n=this.factory.open(ea,na)}catch(e){t(e);return}let r=!1,i=(n,i)=>{if(r){n?.close();return}r=!0,clearTimeout(a),n?e(n):t(i??Error(`IndexedDB unavailable`))},a=setTimeout(()=>i(null,Error(`IndexedDB open timeout`)),this.timeoutMs);n.onupgradeneeded=()=>{try{n.result.objectStoreNames.contains(ta)||n.result.createObjectStore(ta)}catch(e){try{n.transaction?.abort()}catch{}i(null,e)}},n.onsuccess=()=>{n.result.onversionchange=()=>n.result.close(),i(n.result)},n.onerror=()=>i(null,n.error),n.onblocked=()=>{}})}async read(e){let t=await this.database();return new Promise((n,r)=>{let i;try{i=t.transaction(ta,`readonly`)}catch(e){r(e);return}let a,o=!1,s=(e,t)=>{o||(o=!0,clearTimeout(c),t?r(t):n(e))},c=setTimeout(()=>{try{i.abort()}catch{}s(null,Error(`IndexedDB transaction timeout`))},this.timeoutMs),l=i.objectStore(ta).get(e);l.onsuccess=()=>{a=l.result},i.oncomplete=()=>s(a),i.onabort=()=>s(null,i.error??Error(`IndexedDB aborted`)),i.onerror=()=>{}})}async write(e,t,n){let r=await this.database();return new Promise((i,a)=>{let o;try{o=r.transaction(ta,`readwrite`)}catch(e){a(e);return}let s=!1,c=e=>{s||(s=!0,clearTimeout(l),e?a(e):i())},l=setTimeout(()=>{try{o.abort()}catch{}c(Error(`IndexedDB transaction timeout`))},this.timeoutMs),u=o.objectStore(ta),d=u.getAll(),f=u.getAllKeys(),p=!1,m=!1,h=()=>{if(!(!p||!m))try{let r=[];for(let t=0;t<f.result.length;t+=1){let n=f.result[t];typeof n==`string`&&n!==e&&r.push({key:n,value:d.result[t]})}r.push({key:e,value:t}),u.put(t,e);for(let e of n(r))u.delete(e)}catch(e){try{o.abort()}catch{}c(e)}};d.onsuccess=()=>{p=!0,h()},f.onsuccess=()=>{m=!0,h()},o.oncomplete=()=>c(),o.onabort=()=>c(o.error??Error(`IndexedDB aborted`)),o.onerror=()=>{}})}async remove(e){let t=await this.database();return new Promise((n,r)=>{let i;try{i=t.transaction(ta,`readwrite`),i.objectStore(ta).delete(e)}catch(e){r(e);return}let a=!1,o=e=>{a||(a=!0,clearTimeout(s),e?r(e):n())},s=setTimeout(()=>{try{i.abort()}catch{}o(Error(`IndexedDB transaction timeout`))},this.timeoutMs);i.oncomplete=()=>o(),i.onabort=()=>o(i.error??Error(`IndexedDB aborted`)),i.onerror=()=>{}})}};function Ra(e){let t={...ia};if(!e)return t;for(let n of Object.keys(t)){let r=e[n];typeof r==`number`&&Number.isSafeInteger(r)&&r>=0&&(t[n]=r)}return t}function za(e={}){let t=Ra(e.limits),n=typeof e.openTimeoutMs==`number`&&e.openTimeoutMs>0?e.openTimeoutMs:ra,r=`indexedDB`in e?e.indexedDB:`indexedDB`in globalThis?globalThis.indexedDB:void 0,i=e.backend??(r?new La(r,n):null),a=e.now??Date.now,o=new Map,s=(e,t,n)=>{if(!e||e.length>512)return Promise.resolve(t);let r=(o.get(e)??Promise.resolve()).then(n).catch(()=>t),i=r.then(()=>void 0,()=>void 0);return o.set(e,i),i.then(()=>{o.get(e)===i&&o.delete(e)}),r};return{load(e){return s(e,null,async()=>{if(!i)return null;let n=a(),r=await i.read(e);if(r===void 0)return null;let o=Pa(r,e,t,n);if(!o){try{await i.remove(e)}catch{}return null}if(o.record.accessedAt!==n&&oa(n)){let r=Ma(o.data,{...t,maxDeviceBytes:Fa(e,n,t.maxDeviceBytes)}),a=r?ja(r):null;if(r&&a!==null){let s={...o.record,accessedAt:n,bytes:a,data:r};try{await i.write(e,s,n=>Ia(n,t,e))}catch{}}}return o.data})},save(e,n){return s(e,void 0,async()=>{if(!i)return;let r=a(),o=oa(r)?Ma(n,{...t,maxDeviceBytes:Fa(e,r,t.maxDeviceBytes)}):null;if(!o||!oa(r))return;let s=ja(o);if(s===null)return;let c={pairId:e,schema:$i,updatedAt:r,accessedAt:r,bytes:s,data:o};try{await i.write(e,c,n=>Ia(n,t,e))}catch(e){console.warn(`[pair] cache write failed`,e)}})},clear(e){return s(e,void 0,async()=>{i&&await i.remove(e)})}}}var Ba=za();function Va(e){let t=document.querySelector(`meta[name="theme-color"]`);if(t?.content===e&&!t.media)return;for(let e of document.querySelectorAll(`meta[name="theme-color"]`))e.remove();let n=document.createElement(`meta`);n.name=`theme-color`,n.content=e,document.head.prepend(n)}function Ha(e){if(e.startsWith(`rgb`)||e.startsWith(`#`))return e;try{let t=document.createElement(`canvas`);t.width=1,t.height=1;let n=t.getContext(`2d`,{willReadFrequently:!0});if(!n)return e;n.fillStyle=e,n.fillRect(0,0,1,1);let[r,i,a]=n.getImageData(0,0,1,1).data;return`rgb(${r}, ${i}, ${a})`}catch{return e}}function Ua(e,t){return e===`auto`?{theme:t,syncTerminalTheme:t===`sync-terminal`}:{theme:e,syncTerminalTheme:!1}}var Wa=`enso-phone-theme`,Ga=`system`,Ka=Ya(),qa=window.matchMedia(`(prefers-color-scheme: dark)`),Ja=new Set;function Ya(){let e=localStorage.getItem(Wa);return e===`light`||e===`dark`?e:`auto`}function Xa(){requestAnimationFrame(()=>{let e=getComputedStyle(document.body).backgroundColor;e&&Va(Ha(e))})}function Za(){if(Ka!==`auto`)ar(),document.documentElement.classList.toggle(`dark`,Ka===`dark`);else if(Ga===`sync-terminal`)ir(void 0,!0);else{ar();let e=Ga===`system`?qa.matches:Ga===`dark`;document.documentElement.classList.toggle(`dark`,e)}for(let e of Ja)e();Xa();let e=Ua(Ka,Ga);jn(e.theme,e.syncTerminalTheme)}function Qa(e){Ga=e,Za()}function $a(){return Ka}function eo(e){Ka=e,e===`auto`?localStorage.removeItem(Wa):localStorage.setItem(Wa,e),Za()}function to(e){return Ja.add(e),()=>Ja.delete(e)}function no(){Za(),qa.addEventListener(`change`,Za)}var ro=1e6,io=3e3,ao=class{device;events;cache;desk;ws=null;heartbeat=null;contentKey;replay=Oi(vr,yr);relayOnlyUntil=0;attempt=0;timer=null;closed=!1;revoked=!1;replaced=!1;subscribedId=null;sessions=new Map;historyPending=new Set;sync=Yi;direct;cursors=new Map;baselines=new Set;pendingSync=null;freshSessionId=null;syncTimer=null;receiveQueue=Promise.resolve();sendQueue=Promise.resolve();cacheReady=!1;cacheLoading=!1;cacheTimer=null;cacheDirty=!1;roomPrimed=!1;roomStatusSeen=!1;hiddenAt=null;pendingDirectRestart=!1;probeNonce=0;probeSentAt=null;metadata={catalog:[],pinnedOrder:[],projects:[],projectGroups:[],providers:[]};constructor(e,t,n=br(),r=Ba,i=!1){this.device=e,this.events=t,this.cache=r,this.desk=i,this.contentKey=$r(e.contentKey),this.direct=new Zr({role:`guest`,factory:n,sendSignal:e=>this.sendViaRelay(e),onFrame:e=>this.enqueueFrame(e),onTransportChange:e=>{e===`relay`&&this.ws?.readyState!==1&&!this.revoked&&!this.closed&&this.events.onState(`offline`),this.events.onTransport?.(e)},onResync:()=>{this.roomPrimed=!1,this.primeRoom()},onDiagnostic:e=>console.info(`[pair] ${e}`),onRtt:e=>this.events.onRtt?.(e),onNeedRelayProbe:()=>this.sendRelayProbe()})}transport(){return this.direct.transport()}connect(){if(this.closed||this.revoked||this.replaced||this.cacheLoading||this.ws&&this.ws.readyState<2)return;if(!this.cacheReady){this.cacheLoading=!0,this.cache.load(this.device.pairId).then(e=>{if(!e||this.closed||this.revoked)return;let{sessions:t,...n}=e;this.metadata=n,this.sync={...this.sync,knownIds:new Set(n.catalog.map(e=>e.id))},this.events.onCatalog(n.catalog,n.pinnedOrder),this.events.onProjects(n.projects,n.projectGroups),this.events.onProviders(n.providers);for(let{id:e,view:n,cursor:r}of t)this.sessions.set(e,n),this.baselines.add(e),r&&this.cursors.set(e,r),this.events.onSession(e,{...n,messages:new Map(n.messages)})}).catch(()=>{}).finally(()=>{this.cacheReady=!0,this.cacheLoading=!1,this.connect()});return}this.direct.transport()!==`direct`&&this.events.onState(`connecting`);let e=`${ni(this.device.relayUrl)}/v1/pair/${encodeURIComponent(this.device.pairId)}?role=guest&token=${encodeURIComponent(this.device.token)}`,t;try{t=new WebSocket(e)}catch{this.scheduleReconnect();return}t.binaryType=`arraybuffer`,this.ws=t,this.roomPrimed=!1,this.roomStatusSeen=!1;let n=!1,r,i=(e,i=``)=>{if(!n&&(n=!0,r&&clearTimeout(r),this.ws===t)){if(this.heartbeat?.stop(),this.heartbeat=null,this.ws=null,this.roomPrimed=!1,e===4001||i===`replaced`){this.suspendReplaced();return}if(e===1008||this.revoked){this.revoke();return}this.closed||(this.direct.transport()!==`direct`&&this.events.onState(`offline`),this.scheduleReconnect())}};this.heartbeat=di(t,()=>{try{t.close()}catch{}i(null)},e=>{this.direct.transport()===`relay`&&this.events.onRtt?.(e)}),r=setTimeout(()=>{if(Bi(t.readyState,8e3)){try{t.close()}catch{}i(null)}},zi),t.onopen=()=>{this.closed||this.revoked||this.ws!==t||(clearTimeout(r),this.attempt=0,this.primeRoom())},t.onmessage=e=>{if(!(this.closed||this.revoked||this.ws!==t)){if(typeof e.data==`string`){try{let t=JSON.parse(e.data);t.type===`host-online`?(this.roomStatusSeen&&(this.roomPrimed=!1),this.roomStatusSeen=!0,this.replay.peerReset(),this.relayOnlyUntil=Date.now()+io,this.events.onState(`online`),this.direct.peerOnline(!0),this.flushDirectRestart(),this.primeRoom()):t.type===`host-offline`?(this.roomStatusSeen=!0,this.events.onState(`host-offline`),this.direct.peerOnline(!1),this.roomPrimed=!1):t.type===`revoked`&&this.revoke()}catch{}return}this.enqueueFrame(new Uint8Array(e.data),t)}},t.onclose=e=>i(e.code,e.reason),t.onerror=()=>{try{t.close()}catch{}}}nudge(e=`visibility`){if(this.closed||this.revoked)return;if(this.ws?.readyState===0){(e===`online`||e===`network-change`)&&(this.pendingDirectRestart=!0);return}let t=this.hiddenAt===null?0:Date.now()-this.hiddenAt;this.hiddenAt=null;let n=(e===`visibility`||e===`resume`)&&Ri(t),r=n||Ii(e,this.ws!==null,this.ws?.readyState??null);if((e===`online`||e===`network-change`||n&&!this.direct.probe())&&(r?this.pendingDirectRestart=!0:this.direct.networkChange()),r){this.replaceRelay();return}this.heartbeat?.probe(e===`visibility`||e===`resume`?500:void 0)}flushDirectRestart(){this.pendingDirectRestart&&(this.pendingDirectRestart=!1,this.direct.networkChange())}conceal(){this.hiddenAt??=Date.now()}close(){this.flushCache(),this.closed=!0,this.pendingDirectRestart=!1,this.stopSyncRetry(),this.timer&&clearTimeout(this.timer),this.direct.close(),this.heartbeat?.stop(),this.heartbeat=null;try{this.ws?.close()}catch{}}scheduleReconnect(){this.closed||this.revoked||(this.timer&&clearTimeout(this.timer),this.timer=setTimeout(()=>this.connect(),ii(this.attempt++)))}replaceRelay(){this.timer&&clearTimeout(this.timer),this.timer=null,this.attempt=0;let e=this.ws;if(e){this.heartbeat?.stop(),this.heartbeat=null,this.ws=null,this.roomPrimed=!1;try{e.close()}catch{}}this.connect()}enqueueFrame(e,t){this.receiveQueue=this.receiveQueue.then(async()=>{this.closed||this.revoked||t&&t!==this.ws||await this.handleFrame(e,t)}).catch(()=>{})}async handleFrame(e,t){let n;try{let t=await this.replay.open(this.contentKey,e);if(t===void 0)return;n=t}catch{return}if(!(this.closed||this.revoked||t&&t!==this.ws)&&(this.replay.takeHello()&&this.send({type:`replay-hello`}),!Di(n))){if(yi(n)){this.events.onRemoteFrame?.(n);return}switch(n.type){case`catalog`:{let{tracking:e,ghost:t}=Qi(this.sync,this.subscribedId,n.entries.map(e=>e.id)),r=t?this.subscribedId:null,i=new Set(n.entries.map(e=>e.id));for(let e of this.sync.knownIds)i.has(e)||(this.sessions.delete(e),this.baselines.delete(e),this.cursors.delete(e));this.setSync(e),r&&this.subscribe(null),r&&this.events.onGhostSession?.(r),this.metadata.catalog=n.entries,this.metadata.pinnedOrder=n.pinnedOrder??[],this.events.onCatalog(n.entries,n.pinnedOrder),this.scheduleCache();break}case`projects`:this.metadata.projects=n.projects,this.metadata.projectGroups=n.groups??[],this.events.onProjects(n.projects,n.groups),this.scheduleCache();break;case`providers`:this.metadata.providers=n.providers,this.events.onProviders(n.providers),this.scheduleCache();break;case`appearance`:Dn(n.terminal,n.terminalFontFamily),Qa(n.theme),On(n.compactReadOnlyTools!==!1),kn(n.expandLiveEdits!==!1),An(Sn(n));break;case`agent-event`:this.acceptAgentEvent(n.event,n.cursor);break;case`session-sync`:{let e=Ji(n);e?this.applySessionSync(e):console.warn(`[pair] dropped invalid session-sync`);break}case`push-config`:this.events.onPushConfig?.(n.vapidPublicKey);break;case`host-info`:this.direct.hostInfo(n),this.events.onReadOnly?.(n.readOnly===!0),this.events.onRemoteDesktop?.(n.remoteDesktop===!0);break;case`direct-answer`:case`direct-ice`:this.direct.handleSignal(n);break;case`probe-ack`:n.nonce===this.probeNonce&&this.probeSentAt!==null&&(this.direct.noteRelayRtt(Date.now()-this.probeSentAt),this.probeSentAt=null);break;case`history`:{if(!this.historyPending.has(n.sessionId))break;this.historyPending.delete(n.sessionId),this.events.onHistoryPending?.(n.sessionId,!1);let e=this.sessions.get(n.sessionId);if(!e)break;let t=f(e,n);if(t===e)break;this.sessions.set(n.sessionId,t),this.events.onSession(n.sessionId,{...t,messages:new Map(t.messages)}),this.scheduleCache();break}case`bot-catalog`:Array.isArray(n.bots)&&this.events.onBotCatalog?.(n.enabled===!0,n.bots,n.newSession===!0,n.threads===!0);break;case`bot-chats`:Array.isArray(n.chats)&&this.events.onBotChats?.(n.chats,Array.isArray(n.threads)?n.threads:[]);break;case`group-timeline`:typeof n.chatId==`string`&&Array.isArray(n.entries)&&this.events.onGroupTimeline?.(n);break;case`bot-event`:typeof n.event==`object`&&n.event!==null&&this.events.onBotEvent?.(n.event);break;case`bot-chat-state`:typeof n.chatId==`string`&&this.events.onBotChatState?.(n);break;case`bot-send-result`:typeof n.deliveryId==`string`&&this.events.onBotSendResult?.(n);break;case`bot-new-session-result`:typeof n.chatId==`string`&&typeof n.requestId==`string`&&typeof n.ok==`boolean`&&this.events.onBotNewSessionResult?.(n);break;case`bot-thread-result`:typeof n.chatId==`string`&&typeof n.requestId==`string`&&typeof n.ok==`boolean`&&this.events.onBotThreadResult?.(n);break;case`bot-retry-result`:typeof n.chatId==`string`&&typeof n.entryId==`string`&&this.events.onBotRetryResult?.(n);break;case`bot-inbox`:Array.isArray(n.items)&&this.events.onBotInbox?.(n.items);break;case`bot-activity`:Array.isArray(n.items)&&typeof n.now==`number`&&this.events.onBotActivity?.(n.items,Date.now()-n.now);break;case`bot-artifacts`:typeof n.target==`object`&&n.target!==null&&this.events.onBotArtifacts?.(n);break;case`bot-artifact-image`:typeof n.requestId==`string`&&this.events.onBotArtifactImage?.(n);break;case`command-rejected`:typeof n.command==`string`&&this.events.onCommandRejected?.(n.command,n.error)}}}applySessionSync(e){if(this.pendingSync?.requestId!==e.requestId||this.pendingSync.sessionId!==e.sessionId)return;let t=e.sessionId;this.stopSyncRetry();let n=this.sessions.get(t);if(e.mode===`snapshot`)n=d(this.cursors.get(t)?.epoch===e.cursor.epoch?this.sessions:new Map,e.snapshot)[0]?.view,n&&=this.keepCachedMessages(t,n);else{let r=this.cursors.get(t);if(!n||r?.epoch!==e.cursor.epoch||r.seq!==e.fromSeq){this.cursors.delete(t),this.subscribe(t);return}for(let r of e.events){let e=r;if(this.truncatesBeforeCache(n,e)){this.cursors.delete(t),this.subscribe(t);return}n=u(n,e).view}}if(!n)return;this.sessions.set(t,n),this.baselines.add(t),this.cursors.set(t,e.cursor);let r=this.pendingSync.observed;this.pendingSync=null,r&&(r===`mixed`||r.epoch!==e.cursor.epoch||r.seq>e.cursor.seq)?this.subscribe(t):this.setSync({...this.sync,state:`synced`}),this.events.onSession(t,{...n,messages:new Map(n.messages)}),this.scheduleCache()}acceptAgentEvent(e,t){let n=typeof e.sessionId==`string`?e.sessionId:void 0;if(t!==void 0){if(!n||!Ki(t))return;if(this.pendingSync?.sessionId===n){let e=this.pendingSync.observed;this.pendingSync.observed=e?e===`mixed`||e.epoch!==t.epoch?`mixed`:{epoch:t.epoch,seq:Math.max(e.seq,t.seq)}:t;return}let r=this.cursors.get(n);if(r?.epoch===t.epoch&&t.seq<=r.seq)return;if(!r||t.epoch!==r.epoch||t.seq!==r.seq+1){n===this.subscribedId?(this.freshSessionId===n&&(this.freshSessionId=null),this.subscribe(n)):this.cursors.delete(n);return}let i=this.sessions.get(n);if(i&&this.truncatesBeforeCache(i,e)){this.cursors.delete(n),n===this.subscribedId&&this.subscribe(n);return}this.applyAgentEvent(e),this.cursors.set(n,t)}else n&&this.cursors.delete(n),this.applyAgentEvent(e);this.scheduleCache()}truncatesBeforeCache(e,t){return t.type===`messages-truncated`&&typeof t.length==`number`&&t.length>0&&(e.messages.size===0||Math.min(...e.messages.keys())>=t.length)}keepCachedMessages(e,t){if(t.messages.size>0)return t;let n=this.sessions.get(e);return!n||n.messages.size===0?t:{...t,messages:new Map(n.messages)}}applyAgentEvent(e){let t=e.sessionId,n=e.type;if(n===`worker-exited`){this.cursors.clear(),this.sessions=p(this.sessions);for(let[e,t]of this.sessions)this.events.onSession(e,{...t,messages:new Map(t.messages)});return}if(n===`snapshot`){let t=(e.sessions??[]).map(e=>e.sessionId??e.identity?.sessionId).filter(e=>typeof e==`string`);this.setSync(Zi(this.sync,this.subscribedId,t));for(let{id:t,view:n}of d(this.sessions,e)){let e=this.keepCachedMessages(t,n);this.cursors.delete(t),this.baselines.add(t),t===this.pendingSync?.sessionId&&(this.pendingSync=null,this.stopSyncRetry()),this.sessions.set(t,e),this.events.onSession(t,{...e,messages:new Map(e.messages)})}return}if(!t)return;let{view:r}=u(this.sessions.get(t)??c(),e);this.sessions.set(t,r),this.events.onSession(t,{...r,messages:new Map(r.messages)})}getSession(e){return this.sessions.get(e)}canSend(){return!this.closed&&!this.revoked&&(this.direct.transport()===`direct`||this.ws?.readyState===1)}send(e,t){if(this.canSend()){if((t?.bulk||Date.now()<this.relayOnlyUntil)&&this.ws?.readyState===1){this.sendViaRelay(e);return}this.sendQueue=this.sendQueue.then(async()=>{if(this.closed||this.revoked)return;let t=await this.replay.seal(this.contentKey,e);this.closed||this.revoked||this.overRelayLimit(t,e)||this.direct.send(t)||this.sendFrameViaRelay(t)}).catch(()=>{})}}overRelayLimit(e,t){return e.byteLength<=ro?!1:(console.warn(`[pair] ${t.type} frame ${e.byteLength}B over relay limit, dropped`),this.events.onCommandRejected?.(t.type,`frame over relay limit`),!0)}sendFrameViaRelay(e){this.ws?.readyState===1&&this.ws.send(e.slice().buffer)}sendRelayProbe(){this.probeNonce=this.probeNonce+1>>>0,this.probeSentAt=Date.now(),this.sendViaRelay({type:`probe`,nonce:this.probeNonce})}sendViaRelay(e){this.sendQueue=this.sendQueue.then(async()=>{if(this.closed||this.revoked)return;let t=await this.replay.seal(this.contentKey,e);this.closed||this.revoked||this.overRelayLimit(t,e)||this.sendFrameViaRelay(t)}).catch(()=>{})}setSync(e){let t=e.state!==this.sync.state;this.sync=e,t&&this.events.onSync?.(e.state)}primeRoom(){this.closed||this.revoked||this.roomPrimed||this.ws?.readyState===1&&(this.roomPrimed=!0,this.send(this.desk?{type:`snapshot`,desk:!0}:{type:`snapshot`}),this.subscribedId&&this.subscribe(this.subscribedId))}subscribe(e,t){if(this.closed||this.revoked||(this.stopSyncRetry(),this.subscribedId=e,t?.fresh?this.freshSessionId=e:(e!==this.freshSessionId||e&&this.baselines.has(e))&&(this.freshSessionId=null),!this.cacheReady))return;let n=e!==null&&e===this.freshSessionId;if(this.pendingSync=e&&!n?{sessionId:e,requestId:crypto.randomUUID()}:null,this.historyPending.size>0){let e=[...this.historyPending];this.historyPending.clear();for(let t of e)this.events.onHistoryPending?.(t,!1)}if(this.setSync(Xi(this.sync,e,{fresh:n})),!e){this.send({type:`subscribe`,sessionId:null});return}let r=this.sessions.get(e),i=this.baselines.has(e)&&r?r.messages.size?Math.max(...r.messages.keys()):-1:void 0;r&&(this.sessions.delete(e),this.sessions.set(e,r));let a={type:`subscribe`,sessionId:e,...this.pendingSync?{sync:{requestId:this.pendingSync.requestId,cursor:this.cursors.get(e)}}:typeof i==`number`?{sinceIndex:i}:{}};this.send(a),this.pendingSync&&this.armSyncRetry(a,this.pendingSync.requestId)}armSyncRetry(e,t){this.syncTimer=setTimeout(()=>{this.closed||this.revoked||this.pendingSync?.requestId!==t||(this.send(e),this.armSyncRetry(e,t))},1e4)}stopSyncRetry(){this.syncTimer&&clearTimeout(this.syncTimer),this.syncTimer=null}scheduleCache(){this.closed||this.revoked||(this.cacheDirty=!0,!this.cacheTimer&&(this.cacheTimer=setTimeout(()=>this.flushCache(),500)))}flushCache(){if(this.cacheTimer&&clearTimeout(this.cacheTimer),this.cacheTimer=null,!this.cacheReady||!this.cacheDirty||this.closed||this.revoked)return;this.cacheDirty=!1;let e=[...this.sessions].filter(([e])=>this.baselines.has(e)).map(([e,t])=>({id:e,view:t,cursor:this.cursors.get(e)}));this.cache.save(this.device.pairId,{...this.metadata,sessions:e}).catch(()=>{})}suspendReplaced(){this.replaced=!0,this.pendingDirectRestart=!1,this.stopSyncRetry(),this.timer&&clearTimeout(this.timer),this.timer=null,this.direct.close(),this.heartbeat?.stop(),this.heartbeat=null,this.flushCache(),this.events.onState(`replaced`)}revoke(){this.revoked=!0,this.pendingDirectRestart=!1,this.stopSyncRetry(),this.timer&&clearTimeout(this.timer),this.cacheTimer&&clearTimeout(this.cacheTimer),this.cacheTimer=null,this.direct.close(),this.heartbeat?.stop(),this.sessions.clear(),this.cursors.clear(),this.baselines.clear(),this.cache.clear(this.device.pairId).catch(()=>{}),this.events.onState(`unauthorized`)}hasOlder(e){let t=this.sessions.get(e);return!t||t.messages.size===0?!1:Math.min(...t.messages.keys())>0}requestHistory(e){if(this.pendingSync||this.subscribedId!==e||this.historyPending.has(e)||!this.hasOlder(e))return;let t=this.sessions.get(e);t&&(this.historyPending.add(e),this.events.onHistoryPending?.(e,!0),this.send({type:`history`,sessionId:e,beforeIndex:Math.min(...t.messages.keys())}))}};function oo(e){if(e==null||!Number.isFinite(e)||e<0)return null;let t=Math.round(e);return t<1?`<1ms`:`${t}ms`}var so={connecting:`连接中…`,online:`已连接`,"host-offline":`桌面端离线`,unauthorized:`配对已失效`,replaced:`已在其他页面打开`,offline:`重连中…`};function co(e,t){let n=e===`direct`?`直连`:`中继`,r=oo(t);return r?`已连接 · ${n} · ${r}`:`已连接 · ${n}`}function lo(e,t){if(e)try{let t=JSON.parse(e);return Array.isArray(t)?t:[]}catch{return[]}if(t)try{let e=JSON.parse(t);return e?.pairId?[{...e,label:uo([])}]:[]}catch{return[]}return[]}function uo(e){let t=new Set(e.map(e=>e.label));for(let e=1;;e++){let n=`电脑 ${e}`;if(!t.has(n))return n}}function fo(e,t){return e.find(e=>e.pairId===t.pairId)?e.map(e=>e.pairId===t.pairId?{...t,label:e.label}:e):[...e,{...t,label:uo(e)}]}function po(e,t){return e.filter(e=>e.pairId!==t)}function mo(e,t,n){let r=n.trim();return r?e.map(e=>e.pairId===t?{...e,label:r}:e):[...e]}function ho(e,t){return e.find(e=>e.pairId===t)??e[0]??null}var go=`enso-phone-launch`,_o=`/__open-session`,vo=200,yo=/^[\w.:-]+$/;function bo(e){if(typeof e!=`string`)return null;let t=e.trim();return!t||t.length>vo||!yo.test(t)?null:t}function xo(e){if(typeof e!=`string`||!e)return null;let t=e.startsWith(`?`)?e.slice(1):e;return bo(new URLSearchParams(t).get(`session`))}async function So(e=typeof caches>`u`?void 0:caches){if(!e)return null;try{let t=await e.open(go),n=await t.match(_o);return await t.delete(_o),n?bo(await n.text()):null}catch{return null}}var Co=`enso-phone-mark`,wo=`/__paired`,To=()=>typeof caches>`u`?void 0:caches;async function Eo(e=typeof navigator>`u`?void 0:navigator.storage){if(!e?.persist)return null;try{return await e.persisted?.()?!0:await e.persist()}catch{return null}}async function Do(e,t=To()){if(t)try{if(!e){await t.delete(Co);return}await(await t.open(Co)).put(wo,new Response(`1`))}catch{}}async function Oo(e=To()){if(!e)return!1;try{return!!await(await e.open(Co)).match(wo)}catch{return!1}}function ko(e){return e.paired?null:e.marked?`这台手机上保存的配对信息不见了,可能被系统清理了存储。请在桌面端「设置 → 手机」重新生成配对码,再扫码配对。`:e.standalone?`如果之前配对过:iOS 可能清理了本地数据,需要重新扫码配对。`:null}var Ao=`enso-phone-pairing`,jo=`enso-phone-devices`,Mo=`enso-phone-active-device`,No=`enso-phone-cursors`,Po=`enso-phone-last-session`,Fo=e=>`enso-phone-cursors:${e}`,Io=e=>`enso-phone-last-session:${e}`,Lo=e=>`enso-phone-last-bot-chat:${e}`;function Ro(){let e=localStorage.getItem(Ao),t=lo(localStorage.getItem(jo),e);if(e&&t.length>0){zo(t),localStorage.removeItem(Ao);let e=t[0].pairId,n=localStorage.getItem(No);n&&(localStorage.setItem(Fo(e),n),localStorage.removeItem(No));let r=localStorage.getItem(Po);r&&(localStorage.setItem(Io(e),r),localStorage.removeItem(Po)),localStorage.getItem(Mo)||Vo(e)}return t}function zo(e){localStorage.setItem(jo,JSON.stringify(e)),Do(e.length>0),e.length>0&&Eo()}function Bo(){return localStorage.getItem(Mo)}function Vo(e){e?localStorage.setItem(Mo,e):localStorage.removeItem(Mo)}function Ho(e){Ba.clear(e),xn.remove?.(e).catch(()=>{}),localStorage.removeItem(Fo(e)),localStorage.removeItem(Io(e)),localStorage.removeItem(Lo(e))}function Uo(e){return localStorage.getItem(Io(e))}function Wo(e,t){t?localStorage.setItem(Io(e),t):localStorage.removeItem(Io(e))}function Go(e,t=null){return{activeId:t??(e?Uo(e):null),botChatId:!t&&e?bo(localStorage.getItem(Lo(e))):null}}function Ko(e,t){Wo(e,t.activeId),t.botChatId?localStorage.setItem(Lo(e),t.botChatId):localStorage.removeItem(Lo(e))}var qo={saveDevices:zo,saveActiveDeviceId:Vo,clearDeviceData:Ho,revoke:e=>ci(e.relayUrl,e.pairId,e.token)};function Jo(e,t,n,r=qo){let i=e.find(e=>e.pairId===t),a=i?r.revoke(i).catch(()=>{}):Promise.resolve();r.clearDeviceData(t);let o=po(e,t);if(r.saveDevices(o),t!==n)return{devices:o,revoked:a};let s=ho(o,null);return r.saveActiveDeviceId(s?.pairId??null),{devices:o,fallback:s,revoked:a}}function Yo(e,t,n,r=zo){let i=mo(e,t,n);return r(i),i}var Xo=`enso-phone-push`;function Zo(e){return e.matchMedia(`(display-mode: standalone)`).matches||e.navigator.standalone===!0}function Qo(){if(Zo(window))return!0;try{return window.top!=null&&window.top!==window&&Zo(window.top)}catch{return!1}}function $o(){return`serviceWorker`in navigator&&`PushManager`in window&&`Notification`in window}function es(){return $o()?`ok`:/iphone|ipad|ipod/i.test(navigator.userAgent)&&!Qo()?`needs-install`:`unsupported`}async function ts(){if(!(`serviceWorker`in navigator))return null;try{return await navigator.serviceWorker.register(`/sw.js`)}catch{return null}}function ns(e){let t=e+`=`.repeat((4-e.length%4)%4),n=atob(t.replace(/-/g,`+`).replace(/_/g,`/`));return Uint8Array.from(n,e=>e.charCodeAt(0))}function rs(e){return e===`AbortError`?`service-unreachable`:e===`NotAllowedError`?`permission-denied`:`subscribe-failed`}async function is(e){if(!$o())return{ok:!1,reason:`unsupported`};if(await Notification.requestPermission()!==`granted`)return{ok:!1,reason:`permission-denied`};let t=await navigator.serviceWorker.ready;try{let n=(await t.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:ns(e)})).toJSON();return!n.endpoint||!n.keys?.p256dh||!n.keys?.auth?{ok:!1,reason:`subscribe-failed`}:{ok:!0,subscription:{endpoint:n.endpoint,keys:{p256dh:n.keys.p256dh,auth:n.keys.auth}}}}catch(e){return{ok:!1,reason:rs(e instanceof Error?e.name:``)}}}async function as(){if(`serviceWorker`in navigator)try{await(await(await navigator.serviceWorker.ready).pushManager.getSubscription())?.unsubscribe()}catch{}}function os(e){return{send:e,storage:localStorage,subscribe:is,unsubscribe:as}}function ss(e){e.storage.setItem(Xo,`off`),e.send({type:`push-unsubscribe`}),e.unsubscribe()}function cs(e,t){t.send({type:`push-subscribe`,subscription:e}),t.storage.setItem(Xo,`on`)}async function ls(e,t){let n=await t.subscribe(e);return n.ok&&cs(n.subscription,t),n}var us={unsupported:`当前浏览器不支持推送。`,"permission-denied":`通知权限被拒绝,请在浏览器站点设置中允许后重试。`,"service-unreachable":`无法连接 Google 推送服务(FCM),请检查网络或代理后重试。`,"subscribe-failed":`订阅失败,请稍后重试。`};function ds(e){let t=[];return e.busy&&t.push({text:`正在开启…`,error:!1}),e.error&&!e.busy&&t.push({text:us[e.error],error:!0}),e.availability===`ok`&&e.connected&&!e.configReady&&t.push({text:`需先升级桌面端 EnsoCode 才能开启推送。`,error:!1}),e.availability===`needs-install`&&t.push({text:`iOS 需先用分享菜单「添加到主屏幕」,从主屏幕打开后才能开启。`,error:!1}),e.availability===`unsupported`&&t.push({text:`当前浏览器不支持推送。`,error:!1}),t}var fs=`enso-phone-ui-mode`,ps=`/?mode=phone`,ms=`/?pair=desk`;function hs(){let e=new URLSearchParams(window.location.search);if(e.get(`pair`)!==`desk`)return!1;e.delete(`pair`);let t=e.toString();return history.replaceState(null,``,`${window.location.pathname}${t?`?${t}`:``}`),!0}function gs(){return localStorage.getItem(`enso-phone-ui-mode`)===`desk`?`desk`:`phone`}function _s(e){localStorage.setItem(fs,e)}function vs(e){return`/desk?device=${encodeURIComponent(e)}`}function ys(e,t,n,r){if(t!==`desk`)return null;let i=new URLSearchParams(e);if(i.get(`mode`)===`phone`||i.get(`pair`)===`desk`)return null;let a=ho(n,r);if(!a||a.scope===`read`)return null;let o=bo(i.get(`session`)),s=new URLSearchParams({device:a.pairId});return o&&s.set(`session`,o),`/desk?${s}`}var bs=`kb-open`;function xs(e){return!e.editing||!(e.height>0)||Math.abs(e.scale-1)>.01||e.layoutHeight-e.height<120?null:{top:Math.max(0,Math.round(e.offsetTop)),height:Math.round(e.height)}}var Ss=/^(text|search|url|tel|email|password|number|date|datetime-local|month|time|week)$/i;function Cs(e){let t=e.activeElement;for(let e=0;t&&t.tagName===`IFRAME`&&e<4;e++)try{t=t.contentDocument?.activeElement??null}catch{return!1}if(!t)return!1;if(t.tagName===`TEXTAREA`)return!t.readOnly;if(t.tagName===`INPUT`){let e=t;return Ss.test(e.type||`text`)&&!e.readOnly}return t.isContentEditable===!0}function ws(e){try{return e.matchMedia(`(hover: none) and (pointer: coarse)`).matches}catch{return!1}}function Ts(e){let t=e.visualViewport;if(!t||!ws(e))return null;let n=e.document,r=n.documentElement,i=0,a=!1,o=()=>{i=0;let o=xs({layoutHeight:e.innerHeight,height:t.height,offsetTop:t.offsetTop,scale:t.scale,editing:Cs(n)});if(o){r.style.setProperty(`--kb-top`,`${o.top}px`),r.style.setProperty(`--kb-height`,`${o.height}px`),r.classList.add(bs),a=!0;return}if(a){a=!1,r.classList.remove(bs);for(let e of[`--kb-top`,`--kb-height`])r.style.removeProperty(e);(e.scrollY!==0||e.scrollX!==0)&&e.scrollTo(0,0)}},s=()=>{i||=e.requestAnimationFrame(o)};t.addEventListener(`resize`,s),t.addEventListener(`scroll`,s);let c=new WeakSet,l=t=>{if(c.has(t))return;c.add(t);let n=()=>{s(),e.setTimeout(s,300)};t.addEventListener(`focusin`,n,!0),t.addEventListener(`focusout`,n,!0)};return l(n),{watchDocument:l,sync:s}}var Es=`enso-shell`,Ds=5e3,Os=18e5,ks=`enso-shell-reloaded`;function As(e){return!e.stale||e.alreadyReloaded?`none`:e.canReloadNow?`now`:`resume`}function js(e){let t=e.querySelector(`meta[name="${Es}"]`)?.getAttribute(`content`);return t&&/^[0-9a-f]{8,64}$/.test(t)?t:null}function Ms(e,t){return new Promise(n=>{let r=new MessageChannel,i=setTimeout(()=>{r.port1.close(),n(null)},Ds);r.port1.onmessage=e=>{clearTimeout(i),r.port1.close(),n(e.data??null)},e.postMessage({type:`shell-check`,version:t},[r.port2])})}function Ns(e){let t=js(e.doc);if(!t)return;let n=e.now??Date.now,r=!1,i=n(),a=()=>{try{e.storage.setItem(ks,t)}catch{}e.reload()},o=async()=>{let n=e.container.controller;if(!n||r)return;let i=await Ms(n,t),o=!1;try{o=e.storage.getItem(ks)===t}catch{}let s=As({stale:i?.stale===!0,alreadyReloaded:o,canReloadNow:e.canReloadNow()});s===`now`?a():s===`resume`&&(r=!0)};e.container.addEventListener(`message`,e=>{e.data?.type===`shell-ready`&&o()}),e.container.addEventListener(`controllerchange`,()=>void o()),e.doc.addEventListener(`visibilitychange`,()=>{if(e.doc.visibilityState===`visible`){if(r){a();return}n()-i<Os||(i=n(),e.container.getRegistration().then(e=>e?.update()).catch(()=>{}))}}),o()}export{_i as $,Oo as A,U as At,co as B,c as Bt,Jo as C,le as Ct,Vo as D,ee as Dt,Go as E,oe as Et,bo as F,B as Ft,to as G,$a as H,i as Ht,So as I,k as It,Ci as J,Va as K,ho as L,O as Lt,ko as M,M as Mt,Do as N,z as Nt,zo as O,K as Ot,xo as P,I as Pt,yi as Q,fo as R,T as Rt,Yo as S,Qt as St,Ro as T,re as Tt,no as U,ao as V,s as Vt,eo as W,hi as X,Si as Y,xi as Z,Qo as _,sn as _t,vs as a,Zn as at,is as b,nn as bt,_s as c,Kn as ct,os as d,Wn as dt,gi as et,ds as f,Un as ft,$o as g,cn as gt,Xo as h,xn as ht,ps as i,Xn as it,Eo as j,L as jt,Ko as k,W as kt,hs as l,qn as lt,ls as m,_n as mt,Ts as n,ri as nt,ys as o,nr as ot,ss as p,Pn as pt,Ha as q,ms as r,ei as rt,gs as s,Hn as st,Ns as t,si as tt,cs as u,Yn as ut,es as v,an as vt,Bo as w,ie as wt,qo as x,rn as xt,ts as y,tn as yt,so as z,v as zt};
|
package/out/phone/assets/{stateDiagram-D77RDMKH-DrBC05BN.js → stateDiagram-D77RDMKH-BO5MAjhs.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{m as t,p as n}from"./src-oBChb5qS.js";import{O as r,c as i,s as a,x as o}from"./chunk-DU6HZSFF-d5JZiOMy.js";import{et as s,g as c}from"./chunk-75Z2AOVW-Be2kq0FP.js";import{t as l}from"./line-CqyaArNm.js";import"./chunk-PWAF6VOD-Dben6plA.js";import"./chunk-GMAD6QVW-BatU6uXC.js";import"./chunk-P2QGCYS3-DUV9S_qP.js";import"./chunk-4HAMMTFA-Djg6ctlZ.js";import"./chunk-GVQU2GXP-CiyvoRIy.js";import"./chunk-OSK3NFVY-q4NiGH59.js";import{t as u}from"./graphlib-DS17s2tU.js";import{t as d}from"./dagre-PrKaheQc.js";import"./chunk-F27PBJKO-DHBQ6nrV.js";import"./chunk-XXDRQBXY-BvKO0v-W.js";import"./chunk-POPQ4Y6H-CjycswNE.js";import"./chunk-L3NEJ4N5-CPykFzBy.js";import{i as f,n as p,t as m}from"./chunk-IMKFNOWR-vOQaK90i.js";import"./mermaid.core-CbGP2wFn.js";var h=e(e=>e.append(`circle`).attr(`class`,`start-state`).attr(`r`,o().state.sizeUnit).attr(`cx`,o().state.padding+o().state.sizeUnit).attr(`cy`,o().state.padding+o().state.sizeUnit),`drawStartState`),g=e(e=>e.append(`line`).style(`stroke`,`grey`).style(`stroke-dasharray`,`3`).attr(`x1`,o().state.textHeight).attr(`class`,`divider`).attr(`x2`,o().state.textHeight*2).attr(`y1`,0).attr(`y2`,0),`drawDivider`),_=e((e,t)=>{let n=e.append(`text`).attr(`x`,2*o().state.padding).attr(`y`,o().state.textHeight+2*o().state.padding).attr(`font-size`,o().state.fontSize).attr(`class`,`state-title`).text(t.id),r=n.node().getBBox();return e.insert(`rect`,`:first-child`).attr(`x`,o().state.padding).attr(`y`,o().state.padding).attr(`width`,r.width+2*o().state.padding).attr(`height`,r.height+2*o().state.padding).attr(`rx`,o().state.radius),n},`drawSimpleState`),v=e((t,n)=>{let r=e(function(e,t,n){let r=e.append(`tspan`).attr(`x`,2*o().state.padding).text(t);n||r.attr(`dy`,o().state.textHeight)},`addTspan`),i=t.append(`text`).attr(`x`,2*o().state.padding).attr(`y`,o().state.textHeight+1.3*o().state.padding).attr(`font-size`,o().state.fontSize).attr(`class`,`state-title`).text(n.descriptions[0]).node().getBBox(),a=i.height,s=t.append(`text`).attr(`x`,o().state.padding).attr(`y`,a+o().state.padding*.4+o().state.dividerMargin+o().state.textHeight).attr(`class`,`state-description`),c=!0,l=!0;n.descriptions.forEach(function(e){c||(r(s,e,l),l=!1),c=!1});let u=t.append(`line`).attr(`x1`,o().state.padding).attr(`y1`,o().state.padding+a+o().state.dividerMargin/2).attr(`y2`,o().state.padding+a+o().state.dividerMargin/2).attr(`class`,`descr-divider`),d=s.node().getBBox(),f=Math.max(d.width,i.width);return u.attr(`x2`,f+3*o().state.padding),t.insert(`rect`,`:first-child`).attr(`x`,o().state.padding).attr(`y`,o().state.padding).attr(`width`,f+2*o().state.padding).attr(`height`,d.height+a+2*o().state.padding).attr(`rx`,o().state.radius),t},`drawDescrState`),y=e((e,t,n)=>{let r=o().state.padding,i=2*o().state.padding,a=e.node().getBBox(),s=a.width,c=a.x,l=e.append(`text`).attr(`x`,0).attr(`y`,o().state.titleShift).attr(`font-size`,o().state.fontSize).attr(`class`,`state-title`).text(t.id),u=l.node().getBBox().width+i,d=Math.max(u,s);d===s&&(d+=i);let f,p=e.node().getBBox();t.doc,f=c-r,u>s&&(f=(s-d)/2+r),Math.abs(c-p.x)<r&&u>s&&(f=c-(u-s)/2);let m=1-o().state.textHeight;return e.insert(`rect`,`:first-child`).attr(`x`,f).attr(`y`,m).attr(`class`,n?`alt-composit`:`composit`).attr(`width`,d).attr(`height`,p.height+o().state.textHeight+o().state.titleShift+1).attr(`rx`,`0`),l.attr(`x`,f+r),u<=s&&l.attr(`x`,c+(d-i)/2-u/2+r),e.insert(`rect`,`:first-child`).attr(`x`,f).attr(`y`,o().state.titleShift-o().state.textHeight-o().state.padding).attr(`width`,d).attr(`height`,o().state.textHeight*3).attr(`rx`,o().state.radius),e.insert(`rect`,`:first-child`).attr(`x`,f).attr(`y`,o().state.titleShift-o().state.textHeight-o().state.padding).attr(`width`,d).attr(`height`,p.height+3+2*o().state.textHeight).attr(`rx`,o().state.radius),e},`addTitleAndBox`),b=e(e=>(e.append(`circle`).attr(`class`,`end-state-outer`).attr(`r`,o().state.sizeUnit+o().state.miniPadding).attr(`cx`,o().state.padding+o().state.sizeUnit+o().state.miniPadding).attr(`cy`,o().state.padding+o().state.sizeUnit+o().state.miniPadding),e.append(`circle`).attr(`class`,`end-state-inner`).attr(`r`,o().state.sizeUnit).attr(`cx`,o().state.padding+o().state.sizeUnit+2).attr(`cy`,o().state.padding+o().state.sizeUnit+2)),`drawEndState`),x=e((e,t)=>{let n=o().state.forkWidth,r=o().state.forkHeight;if(t.parentId){let e=n;n=r,r=e}return e.append(`rect`).style(`stroke`,`black`).style(`fill`,`black`).attr(`width`,n).attr(`height`,r).attr(`x`,o().state.padding).attr(`y`,o().state.padding)},`drawForkJoinState`),S=e((e,t,n,r)=>{let i=0,s=r.append(`text`);s.style(`text-anchor`,`start`),s.attr(`class`,`noteText`);let c=e.replace(/\r\n/g,`<br/>`);c=c.replace(/\n/g,`<br/>`);let l=c.split(a.lineBreakRegex),u=1.25*o().state.noteMargin;for(let e of l){let r=e.trim();if(r.length>0){let e=s.append(`tspan`);if(e.text(r),u===0){let t=e.node().getBBox();u+=t.height}i+=u,e.attr(`x`,t+o().state.noteMargin),e.attr(`y`,n+i+1.25*o().state.noteMargin)}}return{textWidth:s.node().getBBox().width,textHeight:i}},`_drawLongText`),C=e((e,t)=>{t.attr(`class`,`state-note`);let n=t.append(`rect`).attr(`x`,0).attr(`y`,o().state.padding),{textWidth:r,textHeight:i}=S(e,0,0,t.append(`g`));return n.attr(`height`,i+2*o().state.noteMargin),n.attr(`width`,r+o().state.noteMargin*2),n},`drawNote`),w=e(function(e,t){let n=t.id,r={id:n,label:t.id,width:0,height:0},i=e.append(`g`).attr(`id`,n).attr(`class`,`stateGroup`);t.type===`start`&&h(i),t.type===`end`&&b(i),(t.type===`fork`||t.type===`join`)&&x(i,t),t.type===`note`&&C(t.note.text,i),t.type===`divider`&&g(i),t.type==="default"&&t.descriptions.length===0&&_(i,t),t.type==="default"&&t.descriptions.length>0&&v(i,t);let a=i.node().getBBox();return r.width=a.width+2*o().state.padding,r.height=a.height+2*o().state.padding,r},`drawState`),T=0,E=e(function(n,i,u){let d=e(function(e){switch(e){case m.relationType.AGGREGATION:return`aggregation`;case m.relationType.EXTENSION:return`extension`;case m.relationType.COMPOSITION:return`composition`;case m.relationType.DEPENDENCY:return`dependency`}},`getRelationType`);i.points=i.points.filter(e=>!Number.isNaN(e.y));let f=i.points,p=l().x(function(e){return e.x}).y(function(e){return e.y}).curve(s),h=n.append(`path`).attr(`d`,p(f)).attr(`id`,`edge`+T).attr(`class`,`transition`),g=``;if(o().state.arrowMarkerAbsolute&&(g=r(!0)),h.attr(`marker-end`,`url(`+g+`#`+d(m.relationType.DEPENDENCY)+`End)`),u.title!==void 0){let e=n.append(`g`).attr(`class`,`stateLabel`),{x:r,y:s}=c.calcLabelPosition(i.points),l=a.getRows(u.title),d=0,f=[],p=0,m=0;for(let n=0;n<=l.length;n++){let i=e.append(`text`).attr(`text-anchor`,`middle`).text(l[n]).attr(`x`,r).attr(`y`,s+d),a=i.node().getBBox();p=Math.max(p,a.width),m=Math.min(m,a.x),t.info(a.x,r,s+d),d===0&&(d=i.node().getBBox().height,t.info(`Title height`,d,s)),f.push(i)}let h=d*l.length;if(l.length>1){let e=(l.length-1)*d*.5;f.forEach((t,n)=>t.attr(`y`,s+n*d-e)),h=d*l.length}let g=e.node().getBBox();e.insert(`rect`,`:first-child`).attr(`class`,`box`).attr(`x`,r-p/2-o().state.padding/2).attr(`y`,s-h/2-o().state.padding/2-3.5).attr(`width`,p+o().state.padding).attr(`height`,h+o().state.padding),t.info(g)}T++},`drawEdge`),D,O={},k=e(function(){},`setConf`),A=e(function(e){e.append(`defs`).append(`marker`).attr(`id`,`dependencyEnd`).attr(`refX`,19).attr(`refY`,7).attr(`markerWidth`,20).attr(`markerHeight`,28).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 19,7 L9,13 L14,7 L9,1 Z`)},`insertMarkers`),j=e(function(e,r,a,s){D=o().state;let c=o().securityLevel,l;c===`sandbox`&&(l=n(`#i`+r));let u=n(c===`sandbox`?l.nodes()[0].contentDocument.body:`body`),d=c===`sandbox`?l.nodes()[0].contentDocument:document;t.debug(`Rendering diagram `+e);let f=u.select(`[id='${r}']`);A(f),N(s.db.getRootDoc(),f.append(`g`).attr(`id`,r+`-root`),void 0,!1,u,d,s);let p=D.padding,m=f.node().getBBox(),h=m.width+p*2,g=m.height+p*2,_=h*1.75;i(f,g,_,D.useMaxWidth),f.attr(`viewBox`,`${m.x-D.padding} ${m.y-D.padding} `+h+` `+g)},`draw`),M=e(e=>e?e.length*D.fontSizeFactor:1,`getLabelWidth`),N=e((e,n,r,i,o,s,c)=>{let l=new u({compound:!0,multigraph:!0}),f,p=!0;for(f=0;f<e.length;f++)if(e[f].stmt===`relation`){p=!1;break}r?l.setGraph({rankdir:`LR`,multigraph:!0,compound:!0,ranker:`tight-tree`,ranksep:p?1:D.edgeLengthFactor,nodeSep:p?1:50,isMultiGraph:!0}):l.setGraph({rankdir:`TB`,multigraph:!0,compound:!0,ranksep:p?1:D.edgeLengthFactor,nodeSep:p?1:50,ranker:`tight-tree`,isMultiGraph:!0}),l.setDefaultEdgeLabel(function(){return{}});let m=c.db.getStates(),h=c.db.getRelations(),g=Object.keys(m);for(let e of g){let t=m[e];r&&(t.parentId=r);let a;if(t.doc){let e=n.append(`g`).attr(`id`,t.id).attr(`class`,`stateGroup`);a=N(t.doc,e,t.id,!i,o,s,c);{e=y(e,t,i);let n=e.node().getBBox();a.width=n.width,a.height=n.height+D.padding/2,O[t.id]={y:D.compositTitleSize}}}else a=w(n,t,l);if(t.note){let e=w(n,{descriptions:[],id:t.id+`-note`,note:t.note,type:`note`},l);t.note.position===`left of`?(l.setNode(a.id+`-note`,e),l.setNode(a.id,a)):(l.setNode(a.id,a),l.setNode(a.id+`-note`,e)),l.setParent(a.id,a.id+`-group`),l.setParent(a.id+`-note`,a.id+`-group`)}else l.setNode(a.id,a)}t.debug(`Count=`,l.nodeCount(),l);let _=0;h.forEach(function(e){_++,t.debug(`Setting edge`,e),l.setEdge(e.id1,e.id2,{relation:e,width:M(e.title),height:D.labelHeight*a.getRows(e.title).length,labelpos:`c`},`id`+_)}),d(l),t.debug(`Graph after layout`,l.nodes());let v=n.node();l.nodes().forEach(function(e){e!==void 0&&l.node(e)!==void 0?(t.warn(`Node `+e+`: `+JSON.stringify(l.node(e))),o.select(`#`+v.id+` #`+e).attr(`transform`,`translate(`+(l.node(e).x-l.node(e).width/2)+`,`+(l.node(e).y+(O[e]?O[e].y:0)-l.node(e).height/2)+` )`),o.select(`#`+v.id+` #`+e).attr(`data-x-shift`,l.node(e).x-l.node(e).width/2),s.querySelectorAll(`#`+v.id+` #`+e+` .divider`).forEach(e=>{let t=e.parentElement,n=0,r=0;t&&(t.parentElement&&(n=t.parentElement.getBBox().width),r=parseInt(t.getAttribute(`data-x-shift`),10),Number.isNaN(r)&&(r=0)),e.setAttribute(`x1`,0-r+8),e.setAttribute(`x2`,n-r-8)})):t.debug(`No Node `+e+`: `+JSON.stringify(l.node(e)))});let b=v.getBBox();l.edges().forEach(function(e){e!==void 0&&l.edge(e)!==void 0&&(t.debug(`Edge `+e.v+` -> `+e.w+`: `+JSON.stringify(l.edge(e))),E(n,l.edge(e),l.edge(e).relation))}),b=v.getBBox();let x={id:r||`root`,label:r||`root`,width:0,height:0};return x.width=b.width+2*D.padding,x.height=b.height+2*D.padding,t.debug(`Doc rendered`,x,l),x},`renderDoc`),P={parser:p,get db(){return new m(1)},renderer:{setConf:k,draw:j},styles:f,init:e(e=>{e.state||={},e.state.arrowMarkerAbsolute=e.arrowMarkerAbsolute},`init`)};export{P as diagram};
|
|
1
|
+
import{n as e}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{m as t,p as n}from"./src-oBChb5qS.js";import{O as r,c as i,s as a,x as o}from"./chunk-DU6HZSFF-BpNlAs9R.js";import{et as s,g as c}from"./chunk-75Z2AOVW-BL_5b1Dw.js";import{t as l}from"./line-CkpKMiqK.js";import"./chunk-PWAF6VOD-DjwqZuIR.js";import"./chunk-GMAD6QVW-CxbljbtE.js";import"./chunk-P2QGCYS3-B-twI_Fz.js";import"./chunk-4HAMMTFA-gA-CzNGD.js";import"./chunk-GVQU2GXP-CTO3kTOF.js";import"./chunk-OSK3NFVY-Cj3ilTL-.js";import{t as u}from"./graphlib-DS17s2tU.js";import{t as d}from"./dagre-PrKaheQc.js";import"./chunk-F27PBJKO-lsKx96Nt.js";import"./chunk-XXDRQBXY-BvKO0v-W.js";import"./chunk-POPQ4Y6H-lPQttJ5s.js";import"./chunk-L3NEJ4N5-CvIm0JX7.js";import{i as f,n as p,t as m}from"./chunk-IMKFNOWR-Cq8XlkcB.js";import"./mermaid.core-D9LtIKua.js";var h=e(e=>e.append(`circle`).attr(`class`,`start-state`).attr(`r`,o().state.sizeUnit).attr(`cx`,o().state.padding+o().state.sizeUnit).attr(`cy`,o().state.padding+o().state.sizeUnit),`drawStartState`),g=e(e=>e.append(`line`).style(`stroke`,`grey`).style(`stroke-dasharray`,`3`).attr(`x1`,o().state.textHeight).attr(`class`,`divider`).attr(`x2`,o().state.textHeight*2).attr(`y1`,0).attr(`y2`,0),`drawDivider`),_=e((e,t)=>{let n=e.append(`text`).attr(`x`,2*o().state.padding).attr(`y`,o().state.textHeight+2*o().state.padding).attr(`font-size`,o().state.fontSize).attr(`class`,`state-title`).text(t.id),r=n.node().getBBox();return e.insert(`rect`,`:first-child`).attr(`x`,o().state.padding).attr(`y`,o().state.padding).attr(`width`,r.width+2*o().state.padding).attr(`height`,r.height+2*o().state.padding).attr(`rx`,o().state.radius),n},`drawSimpleState`),v=e((t,n)=>{let r=e(function(e,t,n){let r=e.append(`tspan`).attr(`x`,2*o().state.padding).text(t);n||r.attr(`dy`,o().state.textHeight)},`addTspan`),i=t.append(`text`).attr(`x`,2*o().state.padding).attr(`y`,o().state.textHeight+1.3*o().state.padding).attr(`font-size`,o().state.fontSize).attr(`class`,`state-title`).text(n.descriptions[0]).node().getBBox(),a=i.height,s=t.append(`text`).attr(`x`,o().state.padding).attr(`y`,a+o().state.padding*.4+o().state.dividerMargin+o().state.textHeight).attr(`class`,`state-description`),c=!0,l=!0;n.descriptions.forEach(function(e){c||(r(s,e,l),l=!1),c=!1});let u=t.append(`line`).attr(`x1`,o().state.padding).attr(`y1`,o().state.padding+a+o().state.dividerMargin/2).attr(`y2`,o().state.padding+a+o().state.dividerMargin/2).attr(`class`,`descr-divider`),d=s.node().getBBox(),f=Math.max(d.width,i.width);return u.attr(`x2`,f+3*o().state.padding),t.insert(`rect`,`:first-child`).attr(`x`,o().state.padding).attr(`y`,o().state.padding).attr(`width`,f+2*o().state.padding).attr(`height`,d.height+a+2*o().state.padding).attr(`rx`,o().state.radius),t},`drawDescrState`),y=e((e,t,n)=>{let r=o().state.padding,i=2*o().state.padding,a=e.node().getBBox(),s=a.width,c=a.x,l=e.append(`text`).attr(`x`,0).attr(`y`,o().state.titleShift).attr(`font-size`,o().state.fontSize).attr(`class`,`state-title`).text(t.id),u=l.node().getBBox().width+i,d=Math.max(u,s);d===s&&(d+=i);let f,p=e.node().getBBox();t.doc,f=c-r,u>s&&(f=(s-d)/2+r),Math.abs(c-p.x)<r&&u>s&&(f=c-(u-s)/2);let m=1-o().state.textHeight;return e.insert(`rect`,`:first-child`).attr(`x`,f).attr(`y`,m).attr(`class`,n?`alt-composit`:`composit`).attr(`width`,d).attr(`height`,p.height+o().state.textHeight+o().state.titleShift+1).attr(`rx`,`0`),l.attr(`x`,f+r),u<=s&&l.attr(`x`,c+(d-i)/2-u/2+r),e.insert(`rect`,`:first-child`).attr(`x`,f).attr(`y`,o().state.titleShift-o().state.textHeight-o().state.padding).attr(`width`,d).attr(`height`,o().state.textHeight*3).attr(`rx`,o().state.radius),e.insert(`rect`,`:first-child`).attr(`x`,f).attr(`y`,o().state.titleShift-o().state.textHeight-o().state.padding).attr(`width`,d).attr(`height`,p.height+3+2*o().state.textHeight).attr(`rx`,o().state.radius),e},`addTitleAndBox`),b=e(e=>(e.append(`circle`).attr(`class`,`end-state-outer`).attr(`r`,o().state.sizeUnit+o().state.miniPadding).attr(`cx`,o().state.padding+o().state.sizeUnit+o().state.miniPadding).attr(`cy`,o().state.padding+o().state.sizeUnit+o().state.miniPadding),e.append(`circle`).attr(`class`,`end-state-inner`).attr(`r`,o().state.sizeUnit).attr(`cx`,o().state.padding+o().state.sizeUnit+2).attr(`cy`,o().state.padding+o().state.sizeUnit+2)),`drawEndState`),x=e((e,t)=>{let n=o().state.forkWidth,r=o().state.forkHeight;if(t.parentId){let e=n;n=r,r=e}return e.append(`rect`).style(`stroke`,`black`).style(`fill`,`black`).attr(`width`,n).attr(`height`,r).attr(`x`,o().state.padding).attr(`y`,o().state.padding)},`drawForkJoinState`),S=e((e,t,n,r)=>{let i=0,s=r.append(`text`);s.style(`text-anchor`,`start`),s.attr(`class`,`noteText`);let c=e.replace(/\r\n/g,`<br/>`);c=c.replace(/\n/g,`<br/>`);let l=c.split(a.lineBreakRegex),u=1.25*o().state.noteMargin;for(let e of l){let r=e.trim();if(r.length>0){let e=s.append(`tspan`);if(e.text(r),u===0){let t=e.node().getBBox();u+=t.height}i+=u,e.attr(`x`,t+o().state.noteMargin),e.attr(`y`,n+i+1.25*o().state.noteMargin)}}return{textWidth:s.node().getBBox().width,textHeight:i}},`_drawLongText`),C=e((e,t)=>{t.attr(`class`,`state-note`);let n=t.append(`rect`).attr(`x`,0).attr(`y`,o().state.padding),{textWidth:r,textHeight:i}=S(e,0,0,t.append(`g`));return n.attr(`height`,i+2*o().state.noteMargin),n.attr(`width`,r+o().state.noteMargin*2),n},`drawNote`),w=e(function(e,t){let n=t.id,r={id:n,label:t.id,width:0,height:0},i=e.append(`g`).attr(`id`,n).attr(`class`,`stateGroup`);t.type===`start`&&h(i),t.type===`end`&&b(i),(t.type===`fork`||t.type===`join`)&&x(i,t),t.type===`note`&&C(t.note.text,i),t.type===`divider`&&g(i),t.type==="default"&&t.descriptions.length===0&&_(i,t),t.type==="default"&&t.descriptions.length>0&&v(i,t);let a=i.node().getBBox();return r.width=a.width+2*o().state.padding,r.height=a.height+2*o().state.padding,r},`drawState`),T=0,E=e(function(n,i,u){let d=e(function(e){switch(e){case m.relationType.AGGREGATION:return`aggregation`;case m.relationType.EXTENSION:return`extension`;case m.relationType.COMPOSITION:return`composition`;case m.relationType.DEPENDENCY:return`dependency`}},`getRelationType`);i.points=i.points.filter(e=>!Number.isNaN(e.y));let f=i.points,p=l().x(function(e){return e.x}).y(function(e){return e.y}).curve(s),h=n.append(`path`).attr(`d`,p(f)).attr(`id`,`edge`+T).attr(`class`,`transition`),g=``;if(o().state.arrowMarkerAbsolute&&(g=r(!0)),h.attr(`marker-end`,`url(`+g+`#`+d(m.relationType.DEPENDENCY)+`End)`),u.title!==void 0){let e=n.append(`g`).attr(`class`,`stateLabel`),{x:r,y:s}=c.calcLabelPosition(i.points),l=a.getRows(u.title),d=0,f=[],p=0,m=0;for(let n=0;n<=l.length;n++){let i=e.append(`text`).attr(`text-anchor`,`middle`).text(l[n]).attr(`x`,r).attr(`y`,s+d),a=i.node().getBBox();p=Math.max(p,a.width),m=Math.min(m,a.x),t.info(a.x,r,s+d),d===0&&(d=i.node().getBBox().height,t.info(`Title height`,d,s)),f.push(i)}let h=d*l.length;if(l.length>1){let e=(l.length-1)*d*.5;f.forEach((t,n)=>t.attr(`y`,s+n*d-e)),h=d*l.length}let g=e.node().getBBox();e.insert(`rect`,`:first-child`).attr(`class`,`box`).attr(`x`,r-p/2-o().state.padding/2).attr(`y`,s-h/2-o().state.padding/2-3.5).attr(`width`,p+o().state.padding).attr(`height`,h+o().state.padding),t.info(g)}T++},`drawEdge`),D,O={},k=e(function(){},`setConf`),A=e(function(e){e.append(`defs`).append(`marker`).attr(`id`,`dependencyEnd`).attr(`refX`,19).attr(`refY`,7).attr(`markerWidth`,20).attr(`markerHeight`,28).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 19,7 L9,13 L14,7 L9,1 Z`)},`insertMarkers`),j=e(function(e,r,a,s){D=o().state;let c=o().securityLevel,l;c===`sandbox`&&(l=n(`#i`+r));let u=n(c===`sandbox`?l.nodes()[0].contentDocument.body:`body`),d=c===`sandbox`?l.nodes()[0].contentDocument:document;t.debug(`Rendering diagram `+e);let f=u.select(`[id='${r}']`);A(f),N(s.db.getRootDoc(),f.append(`g`).attr(`id`,r+`-root`),void 0,!1,u,d,s);let p=D.padding,m=f.node().getBBox(),h=m.width+p*2,g=m.height+p*2,_=h*1.75;i(f,g,_,D.useMaxWidth),f.attr(`viewBox`,`${m.x-D.padding} ${m.y-D.padding} `+h+` `+g)},`draw`),M=e(e=>e?e.length*D.fontSizeFactor:1,`getLabelWidth`),N=e((e,n,r,i,o,s,c)=>{let l=new u({compound:!0,multigraph:!0}),f,p=!0;for(f=0;f<e.length;f++)if(e[f].stmt===`relation`){p=!1;break}r?l.setGraph({rankdir:`LR`,multigraph:!0,compound:!0,ranker:`tight-tree`,ranksep:p?1:D.edgeLengthFactor,nodeSep:p?1:50,isMultiGraph:!0}):l.setGraph({rankdir:`TB`,multigraph:!0,compound:!0,ranksep:p?1:D.edgeLengthFactor,nodeSep:p?1:50,ranker:`tight-tree`,isMultiGraph:!0}),l.setDefaultEdgeLabel(function(){return{}});let m=c.db.getStates(),h=c.db.getRelations(),g=Object.keys(m);for(let e of g){let t=m[e];r&&(t.parentId=r);let a;if(t.doc){let e=n.append(`g`).attr(`id`,t.id).attr(`class`,`stateGroup`);a=N(t.doc,e,t.id,!i,o,s,c);{e=y(e,t,i);let n=e.node().getBBox();a.width=n.width,a.height=n.height+D.padding/2,O[t.id]={y:D.compositTitleSize}}}else a=w(n,t,l);if(t.note){let e=w(n,{descriptions:[],id:t.id+`-note`,note:t.note,type:`note`},l);t.note.position===`left of`?(l.setNode(a.id+`-note`,e),l.setNode(a.id,a)):(l.setNode(a.id,a),l.setNode(a.id+`-note`,e)),l.setParent(a.id,a.id+`-group`),l.setParent(a.id+`-note`,a.id+`-group`)}else l.setNode(a.id,a)}t.debug(`Count=`,l.nodeCount(),l);let _=0;h.forEach(function(e){_++,t.debug(`Setting edge`,e),l.setEdge(e.id1,e.id2,{relation:e,width:M(e.title),height:D.labelHeight*a.getRows(e.title).length,labelpos:`c`},`id`+_)}),d(l),t.debug(`Graph after layout`,l.nodes());let v=n.node();l.nodes().forEach(function(e){e!==void 0&&l.node(e)!==void 0?(t.warn(`Node `+e+`: `+JSON.stringify(l.node(e))),o.select(`#`+v.id+` #`+e).attr(`transform`,`translate(`+(l.node(e).x-l.node(e).width/2)+`,`+(l.node(e).y+(O[e]?O[e].y:0)-l.node(e).height/2)+` )`),o.select(`#`+v.id+` #`+e).attr(`data-x-shift`,l.node(e).x-l.node(e).width/2),s.querySelectorAll(`#`+v.id+` #`+e+` .divider`).forEach(e=>{let t=e.parentElement,n=0,r=0;t&&(t.parentElement&&(n=t.parentElement.getBBox().width),r=parseInt(t.getAttribute(`data-x-shift`),10),Number.isNaN(r)&&(r=0)),e.setAttribute(`x1`,0-r+8),e.setAttribute(`x2`,n-r-8)})):t.debug(`No Node `+e+`: `+JSON.stringify(l.node(e)))});let b=v.getBBox();l.edges().forEach(function(e){e!==void 0&&l.edge(e)!==void 0&&(t.debug(`Edge `+e.v+` -> `+e.w+`: `+JSON.stringify(l.edge(e))),E(n,l.edge(e),l.edge(e).relation))}),b=v.getBBox();let x={id:r||`root`,label:r||`root`,width:0,height:0};return x.width=b.width+2*D.padding,x.height=b.height+2*D.padding,t.debug(`Doc rendered`,x,l),x},`renderDoc`),P={parser:p,get db(){return new m(1)},renderer:{setConf:k,draw:j},styles:f,init:e(e=>{e.state||={},e.state.arrowMarkerAbsolute=e.arrowMarkerAbsolute},`init`)};export{P as diagram};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import"./src-oBChb5qS.js";import"./chunk-DU6HZSFF-BpNlAs9R.js";import"./chunk-75Z2AOVW-BL_5b1Dw.js";import"./chunk-PWAF6VOD-DjwqZuIR.js";import"./chunk-GMAD6QVW-CxbljbtE.js";import"./chunk-P2QGCYS3-B-twI_Fz.js";import"./chunk-4HAMMTFA-gA-CzNGD.js";import"./chunk-GVQU2GXP-CTO3kTOF.js";import"./chunk-OSK3NFVY-Cj3ilTL-.js";import"./chunk-F27PBJKO-lsKx96Nt.js";import"./chunk-XXDRQBXY-BvKO0v-W.js";import"./chunk-POPQ4Y6H-lPQttJ5s.js";import"./chunk-L3NEJ4N5-CvIm0JX7.js";import{i as t,n,r,t as i}from"./chunk-IMKFNOWR-Cq8XlkcB.js";import"./mermaid.core-D9LtIKua.js";var a={parser:n,get db(){return new i(2)},renderer:r,styles:t,init:e(e=>{e.state||={},e.state.arrowMarkerAbsolute=e.arrowMarkerAbsolute},`init`)};export{a as diagram};
|