ryugi-artifacts 1.35.0 → 1.36.1
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/LICENSE +661 -0
- package/README.md +27 -0
- package/dist/cli.cjs +1 -1
- package/dist/server.cjs +6 -6
- package/dist/viewer/{CloudDocument-DXUMrVF3.js → CloudDocument-D4Bw9sjG.js} +1 -1
- package/dist/viewer/{CloudLiveDocument-Cf3IepYE.js → CloudLiveDocument-CKtC0hxG.js} +1 -1
- package/dist/viewer/{DocumentLayout-DGgUOrQt.js → DocumentLayout-GahQRhmU.js} +136 -136
- package/dist/viewer/DocumentPage-b6NDRkNZ.js +1 -0
- package/dist/viewer/RailSwitch-c7VziHg7.js +64 -0
- package/dist/viewer/{abnfDiagram-VCTEODGH-BbvtrFHm.js → abnfDiagram-VCTEODGH-DQsS-D5J.js} +1 -1
- package/dist/viewer/{ar-SA-G6X2FPQ2-BNJ_hzAP.js → ar-SA-G6X2FPQ2-8Eq55U7v.js} +1 -1
- package/dist/viewer/{architectureDiagram-5GKGNRK7-D2akTrGg.js → architectureDiagram-5GKGNRK7-Dsq20Xs2.js} +1 -1
- package/dist/viewer/{az-AZ-76LH7QW2-BZqZDkD_.js → az-AZ-76LH7QW2-C3KQwpSb.js} +1 -1
- package/dist/viewer/{bg-BG-XCXSNQG7-A-vQgPYl.js → bg-BG-XCXSNQG7-DvSeVzYD.js} +1 -1
- package/dist/viewer/{blockDiagram-I7D4REHJ-CVgXb1Ya.js → blockDiagram-I7D4REHJ-B-2NQk3R.js} +1 -1
- package/dist/viewer/{bn-BD-2XOGV67Q-DcSHjdtW.js → bn-BD-2XOGV67Q-D7k9bWze.js} +1 -1
- package/dist/viewer/{c4Diagram-7LVT6UL2-CYM88EWA.js → c4Diagram-7LVT6UL2-BdnKmpvI.js} +1 -1
- package/dist/viewer/{ca-ES-6MX7JW3Y-BV6Ur_nD.js → ca-ES-6MX7JW3Y-A3ROqP7q.js} +1 -1
- package/dist/viewer/{chunk-4HAMMTFA-D-8nHKEu.js → chunk-4HAMMTFA-VCusdN7t.js} +1 -1
- package/dist/viewer/{chunk-EIO257PC-C3Mcba7G.js → chunk-EIO257PC-BYt9oGLS.js} +1 -1
- package/dist/viewer/{chunk-GMAD6QVW-D_dKCDQ8.js → chunk-GMAD6QVW-Ct2KP0sk.js} +1 -1
- package/dist/viewer/{chunk-GVQU2GXP-CSREhIcn.js → chunk-GVQU2GXP-EfZquQyz.js} +1 -1
- package/dist/viewer/{chunk-IMKFNOWR-D8EImuZz.js → chunk-IMKFNOWR-DyliRjpS.js} +1 -1
- package/dist/viewer/{chunk-L3NEJ4N5-DmW6chfw.js → chunk-L3NEJ4N5-Ds8SmFQt.js} +1 -1
- package/dist/viewer/{chunk-OSK3NFVY-CVx68jC6.js → chunk-OSK3NFVY-CqhgFKDu.js} +1 -1
- package/dist/viewer/{chunk-PWAF6VOD-kUV_iou4.js → chunk-PWAF6VOD-BrPEMgI1.js} +1 -1
- package/dist/viewer/{chunk-SHT3W25Y-Bdjk9DiB.js → chunk-SHT3W25Y-BSjSZPkS.js} +1 -1
- package/dist/viewer/{chunk-SVP7TREG-B6hGF5-m.js → chunk-SVP7TREG-DXSk7afi.js} +1 -1
- package/dist/viewer/{chunk-TICWLB2K-Bbs16xtD.js → chunk-TICWLB2K-Bn0NDF9Z.js} +1 -1
- package/dist/viewer/{classDiagram-ZZMXUADV-VNR-Zxhs.js → classDiagram-ZZMXUADV-Cpar0mxt.js} +1 -1
- package/dist/viewer/{classDiagram-v2-VYDZK3BY-VNR-Zxhs.js → classDiagram-v2-VYDZK3BY-Cpar0mxt.js} +1 -1
- package/dist/viewer/{cs-CZ-2BRQDIVT-ermS-u0f.js → cs-CZ-2BRQDIVT-CT0-4Rcv.js} +1 -1
- package/dist/viewer/{cynefinDiagram-5FMLGOSQ-C93PPUcO.js → cynefinDiagram-5FMLGOSQ-C58eUmHx.js} +1 -1
- package/dist/viewer/{da-DK-5WZEPLOC-CQrRfk5D.js → da-DK-5WZEPLOC-CHMN_9WG.js} +1 -1
- package/dist/viewer/{dagre-GXQ25YYZ-Z49NKKAp.js → dagre-GXQ25YYZ-Pvf1xKYI.js} +1 -1
- package/dist/viewer/{de-DE-XR44H4JA-DkpXx_-W.js → de-DE-XR44H4JA-CPokeuGR.js} +1 -1
- package/dist/viewer/{diagram-S7CK7UJ4-ClEAPLG2.js → diagram-S7CK7UJ4-C3NdWUgI.js} +1 -1
- package/dist/viewer/{diagram-UQ7AKVKN-pxwN_Vbr.js → diagram-UQ7AKVKN-BFfltm3A.js} +1 -1
- package/dist/viewer/{diagram-VX7I27RA-DAoxeI4v.js → diagram-VX7I27RA-DhfpDDmk.js} +1 -1
- package/dist/viewer/{diagram-Z3DM3KII-CWhAzdNi.js → diagram-Z3DM3KII-BBlW1-ev.js} +1 -1
- package/dist/viewer/{dist-C2OM7p9E.js → dist-BEGLTbhk.js} +1 -1
- package/dist/viewer/{dist-BOqmEnxT.js → dist-C8FcAVnr.js} +4 -4
- package/dist/viewer/{dist-BKkkvkDp.js → dist-C8o_eIUQ.js} +1 -1
- package/dist/viewer/{dist-OWJEF8d-.js → dist-CCuKWVvA.js} +1 -1
- package/dist/viewer/{dist-BemRkt_j.js → dist-CJ3b9rsZ.js} +1 -1
- package/dist/viewer/{dist-B_ceHUW_.js → dist-CMDZmf6X.js} +1 -1
- package/dist/viewer/{dist-W-RvjOyO.js → dist-CgWRhxzA.js} +1 -1
- package/dist/viewer/{dist-CWIq9PBk.js → dist-CxMEBuVb.js} +1 -1
- package/dist/viewer/{dist-C81N4aRD.js → dist-D-BKli00.js} +1 -1
- package/dist/viewer/{dist-DA66k_03.js → dist-D1xivo6X.js} +1 -1
- package/dist/viewer/{dist-CuCgFBRo.js → dist-D7a5WR-_.js} +1 -1
- package/dist/viewer/{dist-geatm1o6.js → dist-DL-uu31X.js} +1 -1
- package/dist/viewer/{dist-Dlbt_skl.js → dist-Dl7jcmpR.js} +1 -1
- package/dist/viewer/{dist-BCQqgjUt.js → dist-DlcDWijN.js} +1 -1
- package/dist/viewer/{dist-bqjejTOV.js → dist-DmpyrK2R.js} +1 -1
- package/dist/viewer/{dist-BPMwGNVZ.js → dist-DrnbJ9a2.js} +1 -1
- package/dist/viewer/{dist-CElG0dlK.js → dist-Dy1TH9K7.js} +1 -1
- package/dist/viewer/{dist-BkZn3wpu.js → dist-Dyrx9JDa.js} +1 -1
- package/dist/viewer/{dist-CQDLS0J6.js → dist-HbmNTcJ8.js} +1 -1
- package/dist/viewer/{dist-BUPWHIgc.js → dist-bcdSzj8r.js} +1 -1
- package/dist/viewer/{dist-BEwO24pR.js → dist-ej_JCJsQ.js} +1 -1
- package/dist/viewer/{dist-Dslx8kf2.js → dist-naEFp6Ee.js} +1 -1
- package/dist/viewer/{dist-CqLLCAGp.js → dist-pgQAh0ZP.js} +1 -1
- package/dist/viewer/{dist-DyHZbwjg.js → dist-s4rGJVBW.js} +1 -1
- package/dist/viewer/{ebnfDiagram-PWID7BFC-D5sAcAEf.js → ebnfDiagram-PWID7BFC-qt9yhazn.js} +1 -1
- package/dist/viewer/{el-GR-BZB4AONW-DjXqw-p8.js → el-GR-BZB4AONW-cGbcHOyC.js} +1 -1
- package/dist/viewer/{en-B4ZKOASM-OorhQtvH.js → en-B4ZKOASM-D6CdXUyW.js} +1 -1
- package/dist/viewer/{erDiagram-RLTQ6QDP-OI09b7L5.js → erDiagram-RLTQ6QDP-DOSZ_dPZ.js} +1 -1
- package/dist/viewer/{es-ES-U4NZUMDT-Cv4Wakvx.js → es-ES-U4NZUMDT-BA2pZoBI.js} +1 -1
- package/dist/viewer/{eu-ES-A7QVB2H4-HxscWjuv.js → eu-ES-A7QVB2H4-B4hsNJtE.js} +1 -1
- package/dist/viewer/{fa-IR-HGAKTJCU-NTWNNmbK.js → fa-IR-HGAKTJCU-C-IMb4EE.js} +1 -1
- package/dist/viewer/{fi-FI-Z5N7JZ37-CAsxmtSa.js → fi-FI-Z5N7JZ37-BKO7hC_Z.js} +1 -1
- package/dist/viewer/flowDiagram-HODETNUW-7TxlDkNs.js +1 -0
- package/dist/viewer/{fr-FR-RHASNOE6-CLCleh9D.js → fr-FR-RHASNOE6-BevrQtCH.js} +1 -1
- package/dist/viewer/{ganttDiagram-EL5Y4UJY-D3BWedCS.js → ganttDiagram-EL5Y4UJY-0Ckki9uZ.js} +1 -1
- package/dist/viewer/{gl-ES-HMX3MZ6V-CngYNyWp.js → gl-ES-HMX3MZ6V-DwDuVoxe.js} +1 -1
- package/dist/viewer/{he-IL-6SHJWFNN-BgELyqL_.js → he-IL-6SHJWFNN-BI0siPVV.js} +1 -1
- package/dist/viewer/{hi-IN-IWLTKZ5I-Bn7_SJJk.js → hi-IN-IWLTKZ5I-6c_S-0ha.js} +1 -1
- package/dist/viewer/{hu-HU-A5ZG7DT2-uvw2QFBG.js → hu-HU-A5ZG7DT2-CjaqD2f0.js} +1 -1
- package/dist/viewer/{id-ID-SAP4L64H-Bo_ryCW5.js → id-ID-SAP4L64H-DVN_5mFn.js} +1 -1
- package/dist/viewer/{image-GAAHSSAO-DUbWA4vG.js → image-GAAHSSAO-9gIGZb9j.js} +1 -1
- package/dist/viewer/index.css +1 -1
- package/dist/viewer/index.html +1 -1
- package/dist/viewer/index.js +10 -10
- package/dist/viewer/index2.css +1 -1
- package/dist/viewer/{infoDiagram-27XIBGKW-BbmmQrFi.js → infoDiagram-27XIBGKW-Bsz3v6n1.js} +1 -1
- package/dist/viewer/{ishikawaDiagram-5VMMS53U-4OWFjF5n.js → ishikawaDiagram-5VMMS53U-CER3uilM.js} +1 -1
- package/dist/viewer/{it-IT-JPQ66NNP-B-ea52C3.js → it-IT-JPQ66NNP-DAJmOHGl.js} +1 -1
- package/dist/viewer/{ja-JP-DBVTYXUO-CN4xinAQ.js → ja-JP-DBVTYXUO-BxRfsQbv.js} +1 -1
- package/dist/viewer/{journeyDiagram-3NMN7TZE-B9ufNZ_Q.js → journeyDiagram-3NMN7TZE-CASZLvZW.js} +1 -1
- package/dist/viewer/{kaa-6HZHGXH3-aEhuJwba.js → kaa-6HZHGXH3-z0aHFfBG.js} +1 -1
- package/dist/viewer/{kab-KAB-ZGHBKWFO-BpIoh6VF.js → kab-KAB-ZGHBKWFO-D7HhqPfc.js} +1 -1
- package/dist/viewer/{kanban-definition-UXKFOSKX-BPHjIY4C.js → kanban-definition-UXKFOSKX-BQsg9BjE.js} +1 -1
- package/dist/viewer/{kk-KZ-P5N5QNE5-BmZpvlU8.js → kk-KZ-P5N5QNE5-CjVnoN94.js} +1 -1
- package/dist/viewer/{km-KH-HSX4SM5Z-CECd48Wo.js → km-KH-HSX4SM5Z-qJLkNAjt.js} +1 -1
- package/dist/viewer/{ko-KR-MTYHY66A-BymcDc3y.js → ko-KR-MTYHY66A-B4adb5tJ.js} +1 -1
- package/dist/viewer/{ku-TR-6OUDTVRD-oDAH_fKQ.js → ku-TR-6OUDTVRD-CwOkovpG.js} +1 -1
- package/dist/viewer/{lt-LT-XHIRWOB4-DERpooWJ.js → lt-LT-XHIRWOB4-BS3zGVpO.js} +1 -1
- package/dist/viewer/{lv-LV-5QDEKY6T-Bd9CeWD9.js → lv-LV-5QDEKY6T-HXg14KDf.js} +1 -1
- package/dist/viewer/{mindmap-definition-YA3MSWOX-CFmR43z5.js → mindmap-definition-YA3MSWOX-BgVY3vQs.js} +1 -1
- package/dist/viewer/{mr-IN-CRQNXWMA-CRzJof-q.js → mr-IN-CRQNXWMA-pkdkheri.js} +1 -1
- package/dist/viewer/{my-MM-5M5IBNSE-CEdbx3-v.js → my-MM-5M5IBNSE-DPVBDLkf.js} +1 -1
- package/dist/viewer/{nb-NO-T6EIAALU-CrPMuSgs.js → nb-NO-T6EIAALU-CdToSBiH.js} +1 -1
- package/dist/viewer/{nl-NL-IS3SIHDZ-DLP2Mn20.js → nl-NL-IS3SIHDZ-D5Mj49W2.js} +1 -1
- package/dist/viewer/{nn-NO-6E72VCQL-CpB7gthR.js → nn-NO-6E72VCQL-DNjQyL7A.js} +1 -1
- package/dist/viewer/{oc-FR-POXYY2M6-CNd1e7G8.js → oc-FR-POXYY2M6-D5X51Z4f.js} +1 -1
- package/dist/viewer/{pa-IN-N4M65BXN-BxsdXOZP.js → pa-IN-N4M65BXN--rvFSGA9.js} +1 -1
- package/dist/viewer/{pegDiagram-XKGWAZYB-Cttr-HAy.js → pegDiagram-XKGWAZYB-j4ql2y2o.js} +1 -1
- package/dist/viewer/percentages-BXMCSKIN-BqTMxKAF.js +1 -0
- package/dist/viewer/{pieDiagram-E7YTZNPT-DQbMQ0fS.js → pieDiagram-E7YTZNPT-B8UWw-i-.js} +1 -1
- package/dist/viewer/{pl-PL-T2D74RX3-B6mOoIS4.js → pl-PL-T2D74RX3-f1R7Rflr.js} +1 -1
- package/dist/viewer/{prod-yztwsjJ9.js → prod-SYJwmGMe.js} +8 -8
- package/dist/viewer/{pt-BR-5N22H2LF-e8MRyaFB.js → pt-BR-5N22H2LF-DW6DFN6x.js} +1 -1
- package/dist/viewer/{pt-PT-UZXXM6DQ-DiQRHYKx.js → pt-PT-UZXXM6DQ-BsUmbQ2H.js} +1 -1
- package/dist/viewer/{quadrantDiagram-AXDQQJYC-CTTDLujH.js → quadrantDiagram-AXDQQJYC-CQJVIlXG.js} +1 -1
- package/dist/viewer/{railroadDiagram-O6MQD6OU-BZxh1vjU.js → railroadDiagram-O6MQD6OU-DkBej74h.js} +1 -1
- package/dist/viewer/{requirementDiagram-BXWQKSXE-BqbFxMFo.js → requirementDiagram-BXWQKSXE-BEzaqWYf.js} +1 -1
- package/dist/viewer/{ro-RO-JPDTUUEW-D28alEeb.js → ro-RO-JPDTUUEW-7azfYL22.js} +1 -1
- package/dist/viewer/{ru-RU-B4JR7IUQ-BWNdh2TY.js → ru-RU-B4JR7IUQ-BxxfjjXk.js} +1 -1
- package/dist/viewer/{sequenceDiagram-WJ2MYXX4-DzXcEa-d.js → sequenceDiagram-WJ2MYXX4-BAHAZfBf.js} +1 -1
- package/dist/viewer/{si-LK-N5RQ5JYF-BVkTAyfr.js → si-LK-N5RQ5JYF-1uD24TOw.js} +1 -1
- package/dist/viewer/{sk-SK-C5VTKIMK-CVugsgCu.js → sk-SK-C5VTKIMK-DZVtaxzs.js} +1 -1
- package/dist/viewer/{sl-SI-NN7IZMDC-DH6VqqkE.js → sl-SI-NN7IZMDC-BLqC4_Rv.js} +1 -1
- package/dist/viewer/{stateDiagram-D77RDMKH-CaJFRGag.js → stateDiagram-D77RDMKH-BwinMdn-.js} +1 -1
- package/dist/viewer/{stateDiagram-v2-MP3YSRHH-CnkjmoCu.js → stateDiagram-v2-MP3YSRHH-DU3eN03e.js} +1 -1
- package/dist/viewer/subset-shared.chunk-Czb39EbM.js +1 -0
- package/dist/viewer/{subset-worker.chunk-BjXfN0n9.js → subset-worker.chunk-C4K-50FC.js} +1 -1
- package/dist/viewer/{sv-SE-XGPEYMSR-Bqd_zOdv.js → sv-SE-XGPEYMSR-nvfJY3TL.js} +1 -1
- package/dist/viewer/{swimlanes-42K2YHIH-aYPJtvP5.js → swimlanes-42K2YHIH-B7VqGFT_.js} +1 -1
- package/dist/viewer/{swimlanesDiagram-VR7AAH4N-D_YMoQ3x.js → swimlanesDiagram-VR7AAH4N-DJhNv6aL.js} +1 -1
- package/dist/viewer/{ta-IN-2NMHFXQM-CPg9jCwq.js → ta-IN-2NMHFXQM-Bd5cKAvA.js} +1 -1
- package/dist/viewer/{th-TH-HPSO5L25-BXl5lM2S.js → th-TH-HPSO5L25-BscKcFjJ.js} +1 -1
- package/dist/viewer/{timeline-definition-24CTP7MA-CEtg5PZx.js → timeline-definition-24CTP7MA-Dq1MsLW6.js} +1 -1
- package/dist/viewer/{tr-TR-DEFEU3FU-24N1Pd5W.js → tr-TR-DEFEU3FU-CUfMg_iN.js} +1 -1
- package/dist/viewer/{uk-UA-QMV73CPH-niMe0b4I.js → uk-UA-QMV73CPH-DwHoBxH-.js} +1 -1
- package/dist/viewer/{vennDiagram-4TSXK5OY-2lcS6R4Y.js → vennDiagram-4TSXK5OY-BYDgyIsA.js} +1 -1
- package/dist/viewer/{vi-VN-M7AON7JQ-D4yFvk8v.js → vi-VN-M7AON7JQ-Ex9c_LfG.js} +1 -1
- package/dist/viewer/{wardleyDiagram-VM6X3IG4-Bb_GQd1p.js → wardleyDiagram-VM6X3IG4-9hTXdxmD.js} +1 -1
- package/dist/viewer/{xychartDiagram-S5SC5T6Z-Brm8haam.js → xychartDiagram-S5SC5T6Z-CEocpGCW.js} +1 -1
- package/dist/viewer/{zh-CN-LNUGB5OW-Bp55FHAl.js → zh-CN-LNUGB5OW-CfwQ8tsT.js} +1 -1
- package/dist/viewer/{zh-HK-E62DVLB3-DIO0z-DO.js → zh-HK-E62DVLB3-CXNATDiZ.js} +1 -1
- package/dist/viewer/{zh-TW-RAJ6MFWO-Bw1rIrYu.js → zh-TW-RAJ6MFWO-B19OPumI.js} +1 -1
- package/package.json +20 -19
- package/dist/viewer/DocumentPage-D24rMAeS.js +0 -1
- package/dist/viewer/RailSwitch-C4gXiujT.js +0 -64
- package/dist/viewer/flowDiagram-HODETNUW-BbLzV7tI.js +0 -1
- package/dist/viewer/percentages-BXMCSKIN-eEXviY6a.js +0 -1
- package/dist/viewer/subset-shared.chunk-CeatEM_k.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./prod-
|
|
1
|
+
import"./prod-SYJwmGMe.js";var e={paste:`貼上`,pasteAsPlaintext:``,pasteCharts:`貼上圖表`,selectAll:`全選`,multiSelect:`多重選取`,moveCanvas:`移動畫布`,cut:`剪下`,copy:`複製`,copyAsPng:`以 PNG 格式複製`,copyAsSvg:`以 SVG 格式複製`,copyText:``,copySource:``,convertToCode:``,bringForward:`往上一層移動`,sendToBack:`移到最底層`,bringToFront:`移到最上層`,sendBackward:`往下一層移動`,delete:`刪除`,copyStyles:`複製樣式`,pasteStyles:`套用樣式`,stroke:`筆跡顏色`,background:`填充顏色`,fill:`背景樣式`,strokeWidth:`筆跡寬度`,strokeStyle:`筆跡線條`,strokeStyle_solid:`實線`,strokeStyle_dashed:`虛線(較密)`,strokeStyle_dotted:`虛線(較疏)`,sloppiness:`筆跡風格`,opacity:`透明度`,textAlign:`文字對齊`,edges:`邊角樣式`,sharp:`銳角`,round:`圓角`,arrowheads:`箭嘴`,arrowhead_none:`無箭嘴`,arrowhead_arrow:`普通箭嘴`,arrowhead_bar:`平頭條狀`,arrowhead_circle:``,arrowhead_circle_outline:``,arrowhead_triangle:`三角箭嘴`,arrowhead_triangle_outline:``,arrowhead_diamond:``,arrowhead_diamond_outline:``,fontSize:`字型大小`,fontFamily:`字體`,addWatermark:`加入「使用 Excalidraw 製圖」水印`,handDrawn:`手繪體`,normal:`電腦字體`,code:`等寬體`,small:`細`,medium:`中`,large:`大`,veryLarge:`勁大`,solid:`實心`,hachure:`斜線`,zigzag:``,crossHatch:`交叉格仔`,thin:`幼`,bold:`粗`,left:`靠左對齊`,center:`置中對齊`,right:`靠右對齊`,extraBold:`勁粗`,architect:`手繪風格`,artist:`藝術家風格`,cartoonist:`卡通風格`,fileTitle:`檔案名稱`,colorPicker:``,canvasColors:``,canvasBackground:`畫布背景顏色`,drawingCanvas:`畫布`,layers:`圖層`,actions:`動作`,language:`🌏 語言`,liveCollaboration:``,duplicateSelection:`製作副本`,untitled:`未命名的作品`,name:``,yourName:`你的名稱`,madeWithExcalidraw:`使用 Excalidraw 製圖`,group:`建立物件群組`,ungroup:`取消物件群組`,collaborators:`已連線的協作者`,showGrid:`顯示網格`,addToLibrary:`加入作品庫`,removeFromLibrary:`從作品庫中移除`,libraryLoadingMessage:`正在載入作品庫…`,libraries:`瀏覽作品庫`,loadingScene:`載入畫布中…`,align:`物件對齊`,alignTop:`水平置頂`,alignBottom:`水平置底`,alignLeft:`垂直靠左對齊`,alignRight:`垂直靠右對齊`,centerVertically:`垂直置中`,centerHorizontally:`水平置中`,distributeHorizontally:`左右等距`,distributeVertically:`上下等距`,flipHorizontal:`左右反轉`,flipVertical:`上下反轉`,viewMode:`唯讀模式`,share:``,showStroke:``,showBackground:``,toggleTheme:``,personalLib:``,excalidrawLib:``,decreaseFontSize:``,increaseFontSize:``,unbindText:``,bindText:``,createContainerFromText:``,link:{edit:``,editEmbed:``,create:``,createEmbed:``,label:``,labelEmbed:``,empty:``},lineEditor:{edit:``,exit:``},elementLock:{lock:``,unlock:``,lockAll:``,unlockAll:``},statusPublished:``,sidebarLock:``,selectAllElementsInFrame:``,removeAllElementsFromFrame:``,eyeDropper:``,textToDiagram:``,prompt:``},t={noItems:``,hint_emptyLibrary:``,hint_emptyPrivateLibrary:``},n={clearReset:`清空畫布`,exportJSON:``,exportImage:``,export:``,copyToClipboard:``,save:``,saveAs:``,load:``,getShareableLink:``,close:``,selectLanguage:``,scrollBackToContent:``,zoomIn:``,zoomOut:``,resetZoom:``,menu:``,done:``,edit:``,undo:``,redo:``,resetLibrary:``,createNewRoom:``,fullScreen:``,darkMode:``,lightMode:``,zenMode:``,objectsSnapMode:``,exitZenMode:``,cancel:``,clear:``,remove:``,embed:``,publishLibrary:``,submit:``,confirm:``,embeddableInteractionButton:``},r={clearReset:`【‼️ 警告 ‼️ 無法復原的動作】你確定要清空呢塊畫布嗎?`,couldNotCreateShareableLink:``,couldNotCreateShareableLinkTooBig:``,couldNotLoadInvalidFile:``,importBackendFailed:``,cannotExportEmptyCanvas:`無嘢可以匯出喎~畫吓嘢先?`,couldNotCopyToClipboard:``,decryptFailed:``,uploadedSecurly:``,loadSceneOverridePrompt:``,collabStopOverridePrompt:``,errorAddingToLibrary:``,errorRemovingFromLibrary:``,confirmAddLibrary:``,imageDoesNotContainScene:``,cannotRestoreFromImage:``,invalidSceneUrl:``,resetLibrary:``,removeItemsFromsLibrary:``,invalidEncryptionKey:``,collabOfflineWarning:``},i={unsupportedFileType:``,imageInsertError:``,fileTooBig:``,svgImageInsertError:``,failedToFetchImage:``,invalidSVGString:``,cannotResolveCollabServer:``,importLibraryError:``,collabSaveFailed:``,collabSaveFailed_sizeExceeded:``,imageToolNotSupported:``,brave_measure_text_error:{line1:``,line2:``,line3:``,line4:``},libraryElementTypeError:{embeddable:``,iframe:``,image:``},asyncPasteFailedOnRead:``,asyncPasteFailedOnParse:``,copyToSystemClipboardFailed:``},a={selection:``,image:``,rectangle:``,diamond:``,ellipse:``,arrow:``,line:``,freedraw:``,text:``,library:``,lock:``,penMode:``,link:``,eraser:``,frame:``,magicframe:``,embeddable:``,laser:``,hand:``,extraTools:``,mermaidToExcalidraw:``,magicSettings:``},o={canvasActions:`畫布動作`,selectedShapeActions:``,shapes:``},s={canvasPanning:``,linearElement:``,freeDraw:``,text:``,embeddable:``,text_selected:``,text_editing:``,linearElementMulti:``,lockAngle:``,resize:``,resizeImage:``,rotate:``,lineEditor_info:``,lineEditor_pointSelected:``,lineEditor_nothingSelected:``,placeImage:``,publishLibrary:``,bindTextToElement:``,deepBoxSelect:``,eraserRevert:``,firefox_clipboard_write:``,disableSnapping:``},c={cannotShowPreview:`無法顯示預覽`,canvasTooBig:`塊畫布太大啦,縮細啲先啦?`,canvasTooBigTip:``},l={headingMain:``,clearCanvasMessage:`如果重新整理頁面都係睇唔到,你可以<button>清空畫布</button>`,clearCanvasCaveat:`(注意:呢個動作會直接丟棄你嘅作品,並且無法復原)`,trackedToSentry:``,openIssueMessage:``,sceneContent:``},u={desc_intro:``,desc_privacy:``,button_startSession:``,button_stopSession:``,desc_inProgressIntro:``,desc_shareLink:``,desc_exitSession:``,shareTitle:``},d={title:``},f={disk_title:``,disk_details:``,disk_button:``,link_title:``,link_details:``,link_button:``,excalidrawplus_description:``,excalidrawplus_button:``,excalidrawplus_exportError:``},p={blog:``,click:``,deepSelect:``,deepBoxSelect:``,curvedArrow:``,curvedLine:``,documentation:``,doubleClick:``,drag:``,editor:``,editLineArrowPoints:``,editText:``,github:``,howto:``,or:``,preventBinding:``,tools:``,shortcuts:``,textFinish:``,textNewLine:``,title:``,view:``,zoomToFit:``,zoomToSelection:``,toggleElementLock:``,movePageUpDown:``,movePageLeftRight:``},m={title:``},h={title:``,itemName:``,authorName:``,githubUsername:``,twitterUsername:``,libraryName:``,libraryDesc:``,website:``,placeholder:{authorName:``,libraryName:``,libraryDesc:``,githubHandle:``,twitterHandle:``,website:``},errors:{required:``,website:``},noteDescription:``,noteGuidelines:``,noteLicense:``,noteItems:``,atleastOneLibItem:``,republishWarning:``},g={title:``,content:``},_={resetLibrary:``,removeItemsFromLib:``},v={header:``,label:{withBackground:``,onlySelected:``,darkMode:``,embedScene:``,scale:``,padding:``},tooltip:{embedScene:``},title:{exportToPng:``,exportToSvg:``,copyPngToClipboard:``},button:{exportToPng:``,exportToSvg:``,copyPngToClipboard:``}},y={tooltip:``,link:``},b={angle:``,element:``,elements:``,height:``,scene:``,selected:``,storage:``,title:``,total:``,version:``,versionCopy:``,versionNotAvailable:``,width:``},x={addedToLibrary:``,copyStyles:``,copyToClipboard:``,copyToClipboardAsPng:``,fileSaved:``,fileSavedToFilename:``,canvas:`畫布`,selection:``,pasteAsSingleElement:``,unableToEmbed:``,unrecognizedLinkFormat:``},S={transparent:``,black:``,white:``,red:``,pink:``,grape:``,violet:``,gray:``,blue:``,cyan:``,teal:``,green:``,yellow:``,orange:``,bronze:``},C={app:{center_heading:``,center_heading_plus:``,menuHint:``},defaults:{menuHint:``,center_heading:``,toolbarHint:``,helpHint:``}},w={mostUsedCustomColors:``,colors:``,shades:``,hexCode:``,noShades:``},T={action:{exportToImage:{title:``,button:``,description:``},saveToDisk:{title:``,button:``,description:``},excalidrawPlus:{title:``,button:``,description:``}},modal:{loadFromFile:{title:``,button:``,description:``},shareableLink:{title:``,button:``,description:``}}},E={title:``,button:``,description:``,syntax:``,preview:``},D={labels:e,library:t,buttons:n,alerts:r,errors:i,toolBar:a,headings:o,hints:s,canvasError:c,errorSplash:l,roomDialog:u,errorDialog:d,exportDialog:f,helpDialog:p,clearCanvasDialog:m,publishDialog:h,publishSuccessDialog:g,confirmDialog:_,imageExportDialog:v,encrypted:y,stats:b,toast:x,colors:S,welcomeScreen:C,colorPicker:w,overwriteConfirm:T,mermaid:E};export{r as alerts,n as buttons,c as canvasError,m as clearCanvasDialog,w as colorPicker,S as colors,_ as confirmDialog,D as default,y as encrypted,d as errorDialog,l as errorSplash,i as errors,f as exportDialog,o as headings,p as helpDialog,s as hints,v as imageExportDialog,e as labels,t as library,E as mermaid,T as overwriteConfirm,h as publishDialog,g as publishSuccessDialog,u as roomDialog,b as stats,x as toast,a as toolBar,C as welcomeScreen};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import"./prod-
|
|
1
|
+
import"./prod-SYJwmGMe.js";var e={paste:`貼上`,pasteAsPlaintext:`以純文字貼上`,pasteCharts:`貼上圖表`,selectAll:`全選`,multiSelect:`將物件加入選取範圍`,moveCanvas:`移動畫布`,cut:`剪下`,copy:`複製`,copyAsPng:`以PNG格式儲存到剪貼板`,copyAsSvg:`以SVG格式複製到剪貼板`,copyText:`以文字格式複製至剪貼簿`,copySource:`複製來源至剪貼簿`,convertToCode:`轉換為程式碼`,bringForward:`上移一層`,sendToBack:`移到最底層`,bringToFront:`置於最頂層`,sendBackward:`往後移一層`,delete:`刪除`,copyStyles:`複製樣式`,pasteStyles:`貼上樣式`,stroke:`筆畫`,background:`背景`,fill:`填滿`,strokeWidth:`筆跡寬度`,strokeStyle:`筆畫樣式`,strokeStyle_solid:`實線`,strokeStyle_dashed:`虛線`,strokeStyle_dotted:`點線`,sloppiness:`線條風格`,opacity:`透明度`,textAlign:`文字對齊`,edges:`邊緣`,sharp:`尖銳`,round:`平滑`,arrowheads:`箭頭`,arrowhead_none:`無`,arrowhead_arrow:`箭頭`,arrowhead_bar:`條狀箭頭`,arrowhead_circle:`圓形`,arrowhead_circle_outline:`圓形(外框)`,arrowhead_triangle:`三角形`,arrowhead_triangle_outline:`三角形(外框)`,arrowhead_diamond:`菱形`,arrowhead_diamond_outline:`菱形(外框)`,fontSize:`字型大小`,fontFamily:`字體集`,addWatermark:`加上 "Made with Excalidraw" 浮水印`,handDrawn:`手寫`,normal:`一般`,code:`代碼`,small:`小`,medium:`中`,large:`大`,veryLarge:`特大`,solid:`實心`,hachure:`斜線筆觸`,zigzag:`Z字形`,crossHatch:`交叉筆觸`,thin:`細`,bold:`粗`,left:`左側`,center:`置中`,right:`右側`,extraBold:`極粗`,architect:`精確`,artist:`藝術`,cartoonist:`卡通`,fileTitle:`檔案名稱`,colorPicker:`色彩選擇工具`,canvasColors:`使用於畫布`,canvasBackground:`Canvas 背景`,drawingCanvas:`繪圖 canvas`,layers:`圖層`,actions:`動作`,language:`語言`,liveCollaboration:`即時協作...`,duplicateSelection:`複製`,untitled:`無標題`,name:`名稱`,yourName:`你的名稱`,madeWithExcalidraw:`以 Excalidraw 製作`,group:`建立群組`,ungroup:`取消群組`,collaborators:`協作者`,showGrid:`顯示格線`,addToLibrary:`加入資料庫`,removeFromLibrary:`從資料庫中移除`,libraryLoadingMessage:`資料庫讀取中…`,libraries:`瀏覽資料庫`,loadingScene:`場景讀取中…`,align:`對齊`,alignTop:`對齊頂部`,alignBottom:`對齊底部`,alignLeft:`對齊左側`,alignRight:`對齊右側`,centerVertically:`垂直置中`,centerHorizontally:`水平置中`,distributeHorizontally:`水平分布`,distributeVertically:`垂直分布`,flipHorizontal:`水平翻轉`,flipVertical:`垂直翻轉`,viewMode:`檢視模式`,share:`共享`,showStroke:`顯示線條檢色器`,showBackground:`顯示背景檢色器`,toggleTheme:`切換主題`,personalLib:`個人資料庫`,excalidrawLib:`Excalidraw 資料庫`,decreaseFontSize:`縮小文字`,increaseFontSize:`放大文字`,unbindText:`取消綁定文字`,bindText:`結合文字至容器`,createContainerFromText:`將文字包於容器中`,link:{edit:`編輯連結`,editEmbed:`編輯連結&嵌入`,create:`建立連結`,createEmbed:`建立連結&嵌入`,label:`連結`,labelEmbed:`連結&嵌入`,empty:`未設定連結`},lineEditor:{edit:`編輯線條`,exit:`結束線條編輯`},elementLock:{lock:`鎖定`,unlock:`解鎖`,lockAll:`全部鎖定`,unlockAll:`全部解鎖`},statusPublished:`已發布`,sidebarLock:`側欄維持開啟`,selectAllElementsInFrame:`選取框架內的所有元素`,removeAllElementsFromFrame:`從框架內移除所有元素`,eyeDropper:`從畫布中選取顏色`,textToDiagram:`文字轉圖表`,prompt:`提示詞`},t={noItems:`尚未加入任何物件...`,hint_emptyLibrary:`選取畫布上的物件以加入,或從下方的公開 repository 中安裝資料庫`,hint_emptyPrivateLibrary:`選擇畫布上的物件以在此加入`},n={clearReset:`重置 canvas`,exportJSON:`匯出至檔案`,exportImage:`匯出圖片`,export:`儲存至...`,copyToClipboard:`複製至剪貼簿`,save:`儲存目前檔案`,saveAs:`儲存為`,load:`開啟`,getShareableLink:`取得共享連結`,close:`關閉`,selectLanguage:`選擇語言`,scrollBackToContent:`捲動回到內容`,zoomIn:`放大`,zoomOut:`縮小`,resetZoom:`重設縮放`,menu:`選單`,done:`完成`,edit:`編輯`,undo:`復原`,redo:`重做`,resetLibrary:`重設資料庫`,createNewRoom:`建立新協作會議室`,fullScreen:`全螢幕`,darkMode:`深色模式`,lightMode:`淺色模式`,zenMode:`專注模式`,objectsSnapMode:`吸附至物件`,exitZenMode:`離開專注模式`,cancel:`取消`,clear:`清除`,remove:`刪除`,embed:`切換嵌入`,publishLibrary:`發布`,submit:`送出`,confirm:`確認`,embeddableInteractionButton:`點擊以互動`},r={clearReset:`這將會清除整個 canvas。你確定嗎?`,couldNotCreateShareableLink:`無法建立共享連結。`,couldNotCreateShareableLinkTooBig:`無法建立共享連結:場景太大`,couldNotLoadInvalidFile:`無法讀取失效的檔案。`,importBackendFailed:`後端讀取失敗。`,cannotExportEmptyCanvas:`無法輸出空白的 canvas。`,couldNotCopyToClipboard:`無法複製到剪貼簿`,decryptFailed:`無法解密資料。`,uploadedSecurly:`上傳已通過 end-to-end 加密,Excalidraw 伺服器和第三方無法皆讀取其內容。`,loadSceneOverridePrompt:`讀取外部圖樣將取代目前的內容。是否要繼續?`,collabStopOverridePrompt:`停止連線將覆蓋您先前於本機儲存的繪圖進度,是否確認?
|
|
2
2
|
|
|
3
3
|
(如要保留原有的本機繪圖進度,直接關閉瀏覽器分頁即可。)`,errorAddingToLibrary:`無法於此資料庫加入項目`,errorRemovingFromLibrary:`無法由此資料庫移除項目`,confirmAddLibrary:`這將會將 {{numShapes}} 個圖形加入你的資料庫,你確定嗎?`,imageDoesNotContainScene:`此圖檔中未包含場景資料。輸出檔案時是否有包含場景資料?`,cannotRestoreFromImage:`無法由此檔案回復場景。`,invalidSceneUrl:`無法由提供的 URL 匯入場景。可能是發生異常,或未包含有效的 Excalidraw JSON 資料。`,resetLibrary:`這會清除您的資料庫,是否確定?`,removeItemsFromsLibrary:`從資料庫刪除 {{count}} 項?`,invalidEncryptionKey:`加密鍵必須為22字元。即時協作已停用。`,collabOfflineWarning:`沒有可用的網路連線。
|
|
4
4
|
變更無法儲存!`},i={unsupportedFileType:`不支援的檔案類型。`,imageInsertError:`無法插入圖片。請稍後再試…`,fileTooBig:`檔案過大。可接受的最大尺寸為 {{maxSize}} 。`,svgImageInsertError:`無法插入 SVG 圖片。此 SVG 檔案有問題。`,failedToFetchImage:`無法獲取圖片。`,invalidSVGString:`無效的 SVG。`,cannotResolveCollabServer:`無法連結至 collab 伺服器。請重新整理後再試一次。`,importLibraryError:`無法載入資料庫`,collabSaveFailed:`無法儲存至後端資料庫。若此問題持續發生,請將檔案儲存於本機以確保資料不會遺失。`,collabSaveFailed_sizeExceeded:`無法儲存至後端資料庫,可能的原因為畫布尺寸過大。請將檔案儲存於本機以確保資料不會遺失。`,imageToolNotSupported:`圖片已停用`,brave_measure_text_error:{line1:`看起來您開啟了 Brave 瀏覽器的 <bold>Aggressively Block Fingerprinting</bold> 設定。`,line2:`這可能造成您畫布中 <bold>文字元素</bold> 的異常。`,line3:`我們強烈建議您關閉此設定。您可以依照 <link>這些步驟</link> 來進行。`,line4:`若關閉此設定並未修復文字元素的顯示問題,請回報於我們 GitHub 上的 <issueLink>issue</issueLink>,或在 <discordLink>Discord</discordLink> 上告訴我們。`},libraryElementTypeError:{embeddable:`可嵌入元素無法加入資料庫`,iframe:`IFrame 元素無法加入資料庫`,image:`即將支援加入圖片至資料庫!`},asyncPasteFailedOnRead:`無法貼上(無法由系統剪貼簿讀入)`,asyncPasteFailedOnParse:`無法貼上`,copyToSystemClipboardFailed:`無法複製至剪貼簿`},a={selection:`選取`,image:`插入圖片`,rectangle:`長方形`,diamond:`菱形`,ellipse:`橢圓`,arrow:`箭頭`,line:`線條`,freedraw:`繪圖`,text:`文字`,library:`資料庫`,lock:`可連續使用選取的工具`,penMode:`筆模式 - 避免觸摸`,link:`為所選的形狀增加\b/更新連結`,eraser:`橡皮擦`,frame:`框架工具`,magicframe:`線框稿轉為程式碼`,embeddable:`嵌入網站`,laser:`雷射筆`,hand:`手形(平移工具)`,extraTools:`更多工具`,mermaidToExcalidraw:`Mermaid 至 Excalidraw`,magicSettings:`AI 設定`},o={canvasActions:`canvas 動作`,selectedShapeActions:`選取圖形動作`,shapes:`形狀`},s={canvasPanning:`若要移動畫布,請在拖曳時按住滑鼠滾輪或空白鍵,或使用手形工具`,linearElement:`點擊以繪製多點曲線;或拖曳以繪製直線`,freeDraw:`點擊並拖曳來繪圖,放開即結束`,text:`提示:亦可使用選取工具在任何地方雙擊來加入文字`,embeddable:`點擊並拖移以建立嵌入網站`,text_selected:`雙擊滑鼠或按 Enter 以編輯文字`,text_editing:`按跳脫鍵或 Ctrl 或 Cmd + Enter 以結束編輯`,linearElementMulti:`按下 Escape 或 Enter 以結束繪製`,lockAngle:`按住 SHIFT 可限制旋轉角度`,resize:`縮放時按住 Shift 可保持原比例縮放;\\n按住 Alt 可由中心點進行縮放`,resizeImage:`按住 SHIFT 可任意縮放,按住 ALT 可由中央縮放。`,rotate:`旋轉時按住 Shift 可限制旋轉角度`,lineEditor_info:`按住 Ctrl 或 Cmd 並雙擊或按住 Ctrl 或 Cmd + Enter 來編輯控制點`,lineEditor_pointSelected:`按下 Delete 可移除錨點;Ctrl 或 Cmd + D 可複製;或可拖曳來移動`,lineEditor_nothingSelected:`選擇要編輯的錨點(按住 SHIFT 可多選),
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ryugi-artifacts",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.36.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Server and viewer for the Ryugi artifacts app",
|
|
6
|
-
"license": "
|
|
6
|
+
"license": "AGPL-3.0-only",
|
|
7
7
|
"bin": {
|
|
8
8
|
"ryugi-artifacts": "bin/ryugi-artifacts.cjs"
|
|
9
9
|
},
|
|
@@ -37,23 +37,23 @@
|
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"@base-ui/react": "^1.9.0",
|
|
39
39
|
"@excalidraw/excalidraw": "^0.18.1",
|
|
40
|
-
"@haklex/rich-collab-loro": "0.
|
|
41
|
-
"@haklex/rich-compose": "0.
|
|
42
|
-
"@haklex/rich-diff-core": "0.
|
|
43
|
-
"@haklex/rich-editor": "0.
|
|
44
|
-
"@haklex/rich-editor-ui": "0.
|
|
45
|
-
"@haklex/rich-ext-chart": "0.
|
|
46
|
-
"@haklex/rich-ext-excalidraw": "0.
|
|
47
|
-
"@haklex/rich-ext-steps": "0.
|
|
48
|
-
"@haklex/rich-headless": "0.
|
|
49
|
-
"@haklex/rich-litexml": "0.
|
|
50
|
-
"@haklex/rich-plugin-link-edit": "0.
|
|
51
|
-
"@haklex/rich-renderer-alert": "0.
|
|
52
|
-
"@haklex/rich-renderer-codeblock": "0.
|
|
53
|
-
"@haklex/rich-renderer-image": "0.
|
|
54
|
-
"@haklex/rich-renderer-katex": "0.
|
|
55
|
-
"@haklex/rich-renderer-mermaid": "0.
|
|
56
|
-
"@haklex/rich-style-token": "0.
|
|
40
|
+
"@haklex/rich-collab-loro": "0.57.0",
|
|
41
|
+
"@haklex/rich-compose": "0.57.0",
|
|
42
|
+
"@haklex/rich-diff-core": "0.57.0",
|
|
43
|
+
"@haklex/rich-editor": "0.57.0",
|
|
44
|
+
"@haklex/rich-editor-ui": "0.57.0",
|
|
45
|
+
"@haklex/rich-ext-chart": "0.57.0",
|
|
46
|
+
"@haklex/rich-ext-excalidraw": "0.57.0",
|
|
47
|
+
"@haklex/rich-ext-steps": "0.57.0",
|
|
48
|
+
"@haklex/rich-headless": "0.57.0",
|
|
49
|
+
"@haklex/rich-litexml": "0.57.0",
|
|
50
|
+
"@haklex/rich-plugin-link-edit": "0.57.0",
|
|
51
|
+
"@haklex/rich-renderer-alert": "0.57.0",
|
|
52
|
+
"@haklex/rich-renderer-codeblock": "0.57.0",
|
|
53
|
+
"@haklex/rich-renderer-image": "0.57.0",
|
|
54
|
+
"@haklex/rich-renderer-katex": "0.57.0",
|
|
55
|
+
"@haklex/rich-renderer-mermaid": "0.57.0",
|
|
56
|
+
"@haklex/rich-style-token": "0.57.0",
|
|
57
57
|
"@lexical/extension": "0.52.0",
|
|
58
58
|
"@lexical/headless": "0.52.0",
|
|
59
59
|
"@lexical/link": "0.52.0",
|
|
@@ -89,6 +89,7 @@
|
|
|
89
89
|
"typescript": "~5.9.3",
|
|
90
90
|
"vite": "^8.3.4",
|
|
91
91
|
"vitest": "^5.0.5",
|
|
92
|
+
"wouter": "3.13.0",
|
|
92
93
|
"ws": "8.18.3"
|
|
93
94
|
}
|
|
94
95
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-COiEfhsA.js";import{n as t,t as n}from"./jsx-runtime-CldxteV5.js";import{A as r,Ba as i,D as a,E as o,Fa as s,M as c,O as l,Pa as u,es as d,j as f,k as p,m,o as h,p as g,s as _,t as v,u as y,w as b,ya as x}from"./RailSwitch-C4gXiujT.js";import{$ as S,A as C,B as w,C as ee,D as T,F as E,G as D,H as O,I as k,J as A,Jn as j,K as M,L as N,M as te,N as ne,O as re,P,Q as ie,R as F,S as I,T as L,U as ae,V as R,W as z,X as oe,Y as se,Z as ce,_ as B,a as le,b as ue,c as de,d as fe,et as pe,g as me,h as he,i as ge,j as _e,l as ve,m as V,n as ye,nt as H,o as be,p as xe,q as Se,qn as Ce,r as we,rt as Te,s as Ee,t as De,tt as Oe,u as ke,v as Ae,w as je,x as Me,y as Ne,z as Pe}from"./DocumentLayout-DGgUOrQt.js";import{_ as Fe,a as Ie,c as Le,d as Re,f as ze,g as Be,h as Ve,i as He,l as Ue,n as We,o as Ge,p as Ke,r as qe,s as Je,u as Ye}from"./index.js";var Xe={name:`message-square`,size:24,node:[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}]]};Xe.node;var Ze=i(Xe),Qe={name:`rotate-cw`,size:24,node:[[`path`,{d:`M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8`,key:`1p45f6`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}]]};Qe.node;var $e=i(Qe),U=e(t(),1);function et({streaming:e,pending:t,agentActiveAt:n,now:r}){if(e)return{kind:`editing`};if(t===0)return{kind:`idle`};if(n===void 0)return{kind:`working`,pending:t,idleMs:null};let i=Math.max(0,r-n);return i>3e5?{kind:`stale`,pending:t,idleMs:i}:{kind:`working`,pending:t,idleMs:i}}function tt(e){return e<6e4?r.t(`time.seconds`,{count:Math.floor(e/1e3)}):e<36e5?r.t(`time.minutes`,{count:Math.floor(e/6e4)}):r.t(`time.hours`,{count:Math.floor(e/36e5)})}function nt(e,t,n){switch(e.kind){case`editing`:return n?r.t(`activity.editingSection`,{agent:t,section:n}):r.t(`activity.editing`,{agent:t});case`idle`:return null;case`working`:{let n=r.t(`activity.pending`,{agent:t,count:e.pending});return e.idleMs===null?n:e.idleMs<1e4?r.t(`activity.updatedJustNow`,{left:n}):r.t(`activity.updatedAgo`,{left:n,duration:tt(e.idleMs)})}case`stale`:return r.t(`activity.stale`,{agent:t,duration:tt(e.idleMs),count:e.pending})}}async function rt(e){await new Promise(e=>setTimeout(e,0));let t=[...e.getAllChanges().values()].flat().sort((e,t)=>e.lamport-t.lamport||e.peer.localeCompare(t.peer)||e.counter-t.counter),n=e.shallowSinceFrontiers(),r=e.frontiersToVV(n),i=[],a=[];try{for(let n of t){r.setLast({peer:n.peer,counter:n.counter+n.length-1});let t={id:`${n.counter}@${n.peer}`,change:n,frontiers:e.vvToFrontiers(r)};i.push(t);let o=n.message===`human`?`human`:n.message?.startsWith(`agent:`)?`agent`:n.message?.startsWith(`session `)?`session`:`unknown`,s=a.at(-1),c=s?.entries.at(-1)?.change;s&&c&&o!==`unknown`&&s.source===o&&c.peer===n.peer&&c.timestamp>0&&n.timestamp>=c.timestamp&&n.timestamp-c.timestamp<=60?(s.entries.push(t),s.id=t.id):a.push({id:t.id,source:o,entries:[t]}),i.length%200==0&&await new Promise(e=>setTimeout(e,0))}}finally{r.free()}return{entries:i,groups:a.reverse(),shallow:n.length>0}}function it(e,t,n){let i=e.fork(),a;try{i.checkout(t);let e=i.getTree(me).roots();if(e.length!==1)throw Error(r.t(`history.contentUnavailable`));let o=M({nodes:n,editable:!1,onError:e=>{throw e}});a=B(o,i);let s=e[0].children()??[],c=new Map,l=(e,t)=>{c.set(e.id,t),e.children()?.forEach(e=>l(e,t))};return s.forEach(e=>l(e,e.id)),{value:o.getEditorState().toJSON(),ids:s.map(e=>e.id),owners:c}}finally{a?.dispose(),i.free()}}var at=/^cid:(\d+@\d+):Map$/;function ot(e,t,n){let r=new Map(n.flatMap(e=>[...e.owners])),i=e.getTree(me),a=new Map,o=new Map(t.map((e,t)=>[e,t])),s=(e,t)=>{let n=a.get(e);(!n||o.get(n)<o.get(t))&&a.set(e,t)};for(let n of t){let{peer:t,counter:i,length:a}=n.change;for(let o of e.getChangedContainersIn({peer:t,counter:i},a)){let t=e.getContainerById(o);for(;t;){let e=at.exec(t.id)?.[1],i=e&&r.get(e);if(i){s(i,n);break}t=t.parent()}}}let c=e=>e&&t.find(({change:t})=>t.peer===e.peer&&t.counter<=e.counter&&e.counter<t.counter+t.length);for(let e of new Set(r.values())){if(!i.isNodeDeleted(e))continue;let t=c(i.getNodeByID(e)?.getLastMoveId());t&&s(e,t)}return a}var st=5e4,ct=`background-color: color-mix(in srgb, var(--rc-alert-caution) 22%, transparent); text-decoration: line-through;`,lt=`background-color: color-mix(in srgb, var(--rc-alert-tip) 22%, transparent);`;function W(e){let t=e;return t.type===`heading`?`heading:${t.tag}`:t.type===`list`?`list:${t.listType}`:t.type||`unknown`}function ut(e,t){return JSON.stringify(e)===JSON.stringify(t)}function G(e){let t=e;return t.type===`text`&&typeof t.text==`string`}function K(e){let t=e;return Array.isArray(t.children)?t.children:null}function dt(e,t){let n=typeof e==`string`?e.trim():``;return n?`${n}${n.endsWith(`;`)?``:`;`} ${t}`:t}function q(e,t,n){let{style:r}=e;return n===`delete`?r=dt(r,ct):n===`insert`&&(r=dt(r,lt)),{...e,text:t,style:r}}function J(e,t){return{...e,children:t}}function Y(e,t){if(G(e))return q(e,e.text,t);let n=K(e);return n?J(e,n.map(e=>Y(e,t))):e}function ft(e){return Array.from(e).reverse().join(``)}function pt(e){let t=[];for(let n of e){if(!n.text)continue;let e=t.at(-1);e&&e.kind===n.kind?e.text+=n.text:t.push({...n})}return t}function mt(e,t){let n=e.length,r=t.length;if(n===0&&r===0)return[];if(n===0)return[{kind:`insert`,text:t.join(``)}];if(r===0)return[{kind:`delete`,text:e.join(``)}];if(n*r>st)return[{kind:`delete`,text:e.join(``)},{kind:`insert`,text:t.join(``)}];let i=Array.from({length:n+1},()=>Array.from({length:r+1}).fill(0));for(let a=1;a<=n;a++)for(let n=1;n<=r;n++)e[a-1]===t[n-1]?i[a][n]=i[a-1][n-1]+1:i[a][n]=Math.max(i[a-1][n],i[a][n-1]);let a=[],o=n,s=r;for(;o>0&&s>0;)if(e[o-1]===t[s-1]){let t=a.at(-1);t&&t.kind===`equal`?t.text+=e[o-1]:a.push({kind:`equal`,text:e[o-1]}),o--,s--}else if(i[o-1][s]>=i[o][s-1]){let t=a.at(-1);t&&t.kind===`delete`?t.text+=e[o-1]:a.push({kind:`delete`,text:e[o-1]}),o--}else{let e=a.at(-1);e&&e.kind===`insert`?e.text+=t[s-1]:a.push({kind:`insert`,text:t[s-1]}),s--}for(;o>0;){let t=a.at(-1);t&&t.kind===`delete`?t.text+=e[o-1]:a.push({kind:`delete`,text:e[o-1]}),o--}for(;s>0;){let e=a.at(-1);e&&e.kind===`insert`?e.text+=t[s-1]:a.push({kind:`insert`,text:t[s-1]}),s--}return pt(a.reverse().map(e=>({kind:e.kind,text:ft(e.text)})))}function ht(e,t){let n=Array.from(e),r=Array.from(t),i=0;for(;i<n.length&&i<r.length&&n[i]===r[i];)i++;let a=n.length-1,o=r.length-1;for(;a>=i&&o>=i&&n[a]===r[o];)a--,o--;let s=[];return i>0&&s.push({kind:`equal`,text:n.slice(0,i).join(``)}),s.push(...mt(n.slice(i,a+1),r.slice(i,o+1))),a<n.length-1&&s.push({kind:`equal`,text:n.slice(a+1).join(``)}),pt(s)}function gt(e,t){let n=ht(e.text,t.text),r=[],i=[],a=!1;for(let o of n)o.text&&(o.kind===`equal`?(r.push(q(e,o.text)),i.push(q(t,o.text))):(a=!0,o.kind===`delete`?r.push(q(e,o.text,`delete`)):i.push(q(t,o.text,`insert`))));return{oldNodes:r.length>0?r:[e],newNodes:i.length>0?i:[t],changed:a}}function _t(e,t){let n=e.length,r=t.length,i=Array.from({length:n+1},()=>Array.from({length:r+1}).fill(0));for(let a=1;a<=n;a++)for(let n=1;n<=r;n++){let r=Math.max(i[a-1][n],i[a][n-1]);if(W(e[a-1])===W(t[n-1])){let o=ut(e[a-1],t[n-1])?2:1;i[a][n]=Math.max(r,i[a-1][n-1]+o)}else i[a][n]=r}let a=[],o=n,s=r;for(;o>0&&s>0;){if(W(e[o-1])===W(t[s-1])){let n=ut(e[o-1],t[s-1]),r=n?2:1;if(i[o][s]===i[o-1][s-1]+r){a.push(n?{kind:`equal`,node:e[o-1]}:{kind:`modify`,oldNode:e[o-1],newNode:t[s-1]}),o--,s--;continue}}i[o-1][s]>=i[o][s-1]?(a.push({kind:`delete`,node:e[o-1]}),o--):(a.push({kind:`insert`,node:t[s-1]}),s--)}for(;o>0;)a.push({kind:`delete`,node:e[--o]});for(;s>0;)a.push({kind:`insert`,node:t[--s]});return a.reverse(),a}function vt(e,t){let n=_t(e,t),r=[],i=[],a=!1;for(let e of n)switch(e.kind){case`equal`:r.push(e.node),i.push(e.node);break;case`delete`:a=!0,r.push(Y(e.node,`delete`));break;case`insert`:a=!0,i.push(Y(e.node,`insert`));break;case`modify`:{if(a=!0,G(e.oldNode)&&G(e.newNode)){let t=gt(e.oldNode,e.newNode);r.push(...t.oldNodes),i.push(...t.newNodes);break}let t=yt(e.oldNode,e.newNode);t?(r.push(t.oldNode),i.push(t.newNode)):(r.push(Y(e.oldNode,`delete`)),i.push(Y(e.newNode,`insert`)));break}}return{oldChildren:r,newChildren:i,changed:a}}function yt(e,t){if(W(e)!==W(t))return null;if(ut(e,t))return{oldNode:e,newNode:t,changed:!1};let n=K(e),r=K(t);if(!n||!r)return null;let i=vt(n,r);return i.changed?{oldNode:J(e,i.oldChildren),newNode:J(t,i.newChildren),changed:!0}:{oldNode:e,newNode:t,changed:!1}}function bt(e,t){let n=yt(e,t);return n?{oldNode:n.oldNode,newNode:n.newNode}:{oldNode:Y(e,`delete`),newNode:Y(t,`insert`)}}function xt(e,t){let n=ht(e.text,t.text),r=[];for(let i of n)i.text&&(i.kind===`equal`?r.push(q(t,i.text)):i.kind===`delete`?r.push(q(e,i.text,`delete`)):r.push(q(t,i.text,`insert`)));return r}function St(e,t){let n=_t(e,t),r=[];for(let e of n)switch(e.kind){case`equal`:r.push(e.node);break;case`delete`:r.push(Y(e.node,`delete`));break;case`insert`:r.push(Y(e.node,`insert`));break;case`modify`:{if(G(e.oldNode)&&G(e.newNode)){r.push(...xt(e.oldNode,e.newNode));break}let t=K(e.oldNode),n=K(e.newNode);t&&n?r.push(J(e.newNode,St(t,n))):(r.push(Y(e.oldNode,`delete`)),r.push(Y(e.newNode,`insert`)));break}}return r}function Ct(e,t){if(W(e)!==W(t))return Y(t,`insert`);if(ut(e,t))return t;let n=K(e),r=K(t);return!n||!r?Y(t,`insert`):J(t,St(n,r))}function wt(e,t){let n=_t(e.root.children,t.root.children),r=[];for(let e of n)switch(e.kind){case`equal`:{let t=r.at(-1);t&&t.type===`equal`?t.nodes.push(e.node):r.push({type:`equal`,nodes:[e.node]});break}case`modify`:{let t=bt(e.oldNode,e.newNode);r.push({type:`delete`,nodes:[t.oldNode]},{type:`insert`,nodes:[t.newNode]})}break;case`delete`:r.push({type:`delete`,nodes:[Y(e.node,`delete`)]});break;case`insert`:r.push({type:`insert`,nodes:[Y(e.node,`insert`)]})}return r}function Tt(e){let t={...e};if(t.$){let{blockId:e,...n}=t.$;Object.keys(n).length?t.$=n:delete t.$}return t.children&&=t.children.map(Tt),t}function Et(e,t){let{children:n,text:r,...i}=e,{children:a,text:o,...s}=t;return JSON.stringify(i)!==JSON.stringify(s)||!!(n&&a&&At(n,a).some(e=>e.kind===`modify`&&Et(e.old[0],e.current[0])))}function Dt(e){let t=e;return t.type===`dynamic`||t.type===`pending`?{type:`paragraph`,version:1,direction:null,format:``,indent:0,children:[{type:`text`,version:1,text:t.type===`dynamic`?r.t(`history.dynamic`,{url:t.url,height:t.initialHeight??320,props:JSON.stringify(t.props??{})}):r.t(`history.pendingIntent`,{intent:t.intent??``}),format:0,detail:0,mode:`normal`,style:``}]}:t.children?{...t,children:t.children.map(Dt)}:t}function Ot(e){return kt(e.map(Dt))}function kt(e){return{root:{type:`root`,version:1,direction:null,format:``,indent:0,children:e}}}function At(e,t){let n=wt(kt(e),kt(t)),r=[],i=0,a=0;for(let o=0;o<n.length;o++){let s=n[o];if(s.type===`equal`){r.push({kind:`equal`,old:e.slice(i,i+s.nodes.length),current:t.slice(a,a+s.nodes.length),oldIndex:i,newIndex:a}),i+=s.nodes.length,a+=s.nodes.length;continue}let c=0,l=0;for(;o<n.length&&n[o].type!==`equal`;){let e=n[o++];e.type===`delete`?c+=e.nodes.length:l+=e.nodes.length}o--;for(let n=0;n<Math.max(c,l);n++){let o=n<c?[e[i+n]]:[],s=n<l?[t[a+n]]:[];r.push({kind:o.length&&s.length?`modify`:o.length?`delete`:`insert`,old:o,current:s,oldIndex:o.length?i+n:void 0,newIndex:s.length?a+n:void 0})}i+=c,a+=l}return r}function jt(e,t){return At(e.root.children.map(Tt),t.root.children.map(Tt)).map(e=>{let t={oldIndex:e.oldIndex,newIndex:e.newIndex};if(e.kind===`modify`){let n=e.old[0],r=e.current[0];return n.type===r.type&&!Et(n,r)?{kind:`modify`,value:Ot([Ct(n,r)]),...t}:{kind:`modify`,before:Ot(e.old),value:Ot(e.current),...t}}let n=e.kind===`delete`?e.old:e.current;return{kind:e.kind,value:Ot(e.kind===`equal`?n:n.map(t=>Y(t,e.kind))),...t}})}function Mt(e){let t=M(e);return t._headless=!0,[`registerDecoratorListener`,`registerRootListener`,`registerMutationListener`,`getRootElement`,`setRootElement`,`getElementByKey`,`focus`,`blur`].forEach(e=>{t[e]=()=>{(function(e,...t){throw function(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);return n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(e,...t)})(439,e)}}),t}var X=n();function Nt({text:e}){let t=(0,U.useRef)(null),n=(0,U.useRef)(null);return(0,U.useEffect)(()=>{let r=t.current;if(!r)return;let i=r.parentNode;if(!i)return;let a=n.current;return!a||a.parentNode!==i?(a=document.createComment(e),i.insertBefore(a,r),n.current=a):a.data!==e&&(a.data=e),()=>{n.current?.parentNode&&n.current.parentNode.removeChild(n.current),n.current=null}},[e]),(0,X.jsx)(`template`,{suppressHydrationWarning:!0,"data-rich-comment-anchor":``,ref:t})}var Z=e=>`${H[e]} ${Te[e]}`,Pt={h1:Z(`headingH1`),h2:Z(`headingH2`),h3:Z(`headingH3`),h4:Z(`headingH4`),h5:Z(`headingH5`),h6:Z(`headingH6`)};function Ft(e){return e.toLowerCase().trim().replaceAll(/[^\s\w\u3000-\u9FFF\uAC00-\uD7AF\uFF00-\uFFEF-]/g,``).replaceAll(/[\s_]+/g,`-`).replaceAll(/^-+|-+$/g,``)}function It(e){return e.type===`comment`?``:e.text?e.text:e.children?e.children.map(It).join(``):``}var Lt=/^["'«‘“‹「『"']/,Rt=/["'»’”›」』"']$/;function zt(e,t,n,r,i){switch(e.type){case`root`:return(0,X.jsx)(X.Fragment,{children:n});case`paragraph`:{let r=e.format?{textAlign:e.format}:void 0;return(0,X.jsx)(`p`,{className:Z(`paragraph`),style:r,children:n??(0,X.jsx)(`br`,{})},t)}case`heading`:{let a=e.tag,o=Ft(i||It(e)),s=o;if(o){let e=r.get(o);e===void 0?r.set(o,1):(s=`${o}-${e}`,r.set(o,e+1))}return(0,X.jsxs)(a,{className:Pt[a],id:s||void 0,children:[s&&(0,X.jsx)(`a`,{className:Z(`headingAnchor`),href:`#${s}`,tabIndex:0,children:(0,X.jsx)(j,{"aria-hidden":!0,size:14,strokeWidth:2})}),n]},t)}case`rich-quote`:case`quote`:{let r=(i||It(e)).trim(),a=Lt.test(r),o=Rt.test(r),s=e.attribution;return(0,X.jsxs)(`blockquote`,{className:Z(`quote`),"data-no-close-quote":o?``:void 0,"data-no-open-quote":a?``:void 0,children:[n,s&&(0,X.jsxs)(`footer`,{className:Z(`quoteAttribution`),children:[`— `,s]})]},t)}case`list`:{let r=e.listType===`number`?`ol`:`ul`,i=e.listType===`number`?Z(`listOl`):e.listType===`check`?`${Z(`checklist`)} ${Z(`listUl`)}`:Z(`listUl`);return(0,X.jsx)(r,{className:i,start:e.start===1?void 0:e.start,children:n},t)}case`listitem`:{let r=e.checked!==void 0,i=e.children?.some(e=>e.type===`list`),a=typeof e.value==`number`&&e.value>1?e.value:void 0,o;return o=i?Z(`listNestedItem`):r?e.checked?`${Z(`listItem`)} ${Z(`listItemChecked`)}`:`${Z(`listItem`)} ${Z(`listItemUnchecked`)}`:Z(`listItem`),(0,X.jsx)(`li`,{className:o,value:a,children:n},t)}case`link`:return(0,X.jsxs)(`a`,{className:Z(`link`),href:e.url,rel:e.rel||`noopener`,target:e.target||`_blank`,children:[(0,X.jsx)(C,{href:e.url}),n]},t);case`autolink`:return(0,X.jsxs)(`a`,{className:Z(`link`),href:e.url,rel:`noopener`,target:`_blank`,children:[(0,X.jsx)(C,{href:e.url}),n]},t);case`horizontalrule`:return(0,X.jsx)(`hr`,{className:Z(`hr`)},t);case`table`:return(0,X.jsx)(`div`,{className:Z(`tableScrollableWrapper`),children:(0,X.jsx)(`table`,{className:Z(`table`),children:n})},t);case`tablerow`:return(0,X.jsx)(`tr`,{children:n},t);case`tablecell`:{let r=e.headerState?`th`:`td`,i=e.headerState?Z(`tableCellHeader`):Z(`tableCell`);return(0,X.jsx)(r,{className:i,colSpan:e.colSpan>1?e.colSpan:void 0,children:n},t)}case`details`:{let r=e.summary||``;return(0,X.jsxs)(`details`,{className:`${k.details} ${N.details}`,open:e.open||void 0,children:[(0,X.jsxs)(`summary`,{className:`${k.summary} ${N.summary}`,children:[(0,X.jsx)(`span`,{"aria-hidden":`true`,className:`${k.chevron} ${N.chevron}`,children:(0,X.jsx)(`svg`,{fill:`none`,height:`20`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,viewBox:`0 0 20 20`,width:`20`,children:(0,X.jsx)(`path`,{d:`M8 6L12 10L8 14`})})}),(0,X.jsx)(`span`,{className:`${k.summaryText} ${N.summaryText}`,children:r})]}),(0,X.jsx)(`div`,{className:`${k.content} ${N.content}`,children:n})]},t)}case`spoiler`:return(0,X.jsx)(`span`,{className:Z(`spoiler`),role:`button`,tabIndex:0,children:n},t);case`tag`:return(0,X.jsx)(`span`,{className:Z(`tag`),style:{backgroundColor:O(e.text)},children:e.text},t);case`comment`:return(0,X.jsx)(Nt,{text:e.text??``},t);case`ruby`:return(0,U.createElement)(pe,{key:t,rendererKey:`Ruby`,defaultRenderer:re,props:{reading:e.reading??``,children:n}});case`code`:return(0,X.jsx)(`pre`,{className:`rich-code-block`,children:(0,X.jsx)(`code`,{children:n})},t);case`code-highlight`:return(0,X.jsx)(`span`,{children:e.text},t);case`linebreak`:return(0,X.jsx)(`br`,{},t);case`tab`:return(0,X.jsx)(`span`,{children:` `},t);default:return null}}var Bt=e=>`${H[e]} ${Te[e]}`,Vt=[[1,`textBold`],[2,`textItalic`],[4,`textStrikethrough`],[8,`textUnderline`],[16,`textCode`],[32,`textSubscript`],[64,`textSuperscript`],[128,`textHighlight`]];function Ht(e){let t={};for(let n of e.split(`;`)){let e=n.indexOf(`:`);if(e===-1)continue;let r=n.slice(0,e).trim(),i=n.slice(e+1).trim();if(!r||!i)continue;let a=r.replaceAll(/-([a-z])/g,(e,t)=>t.toUpperCase());t[a]=i}return t}function Ut(e,t){let n=e.text,r=e.format||0;for(let[e,i]of Vt)r&e&&(n=(0,X.jsx)(`span`,{className:Bt(i),children:n},`${t}-${e}`));return e.style&&(n=(0,X.jsx)(`span`,{style:Ht(e.style),children:n},t)),n}function Wt(e){let t={},n=new Set,r={},i=1;function a(e){if(e.type===`footnote`&&e.identifier){let t=e.identifier;n.has(t)||(n.add(t),r[t]=i++)}if(e.type===`footnote-section`&&e.definitions&&Object.assign(t,e.definitions),e.children)for(let t of e.children)a(t);if(e.root&&a(e.root),e.content&&typeof e.content==`object`&&e.content.root&&a(e.content),e.cells&&Array.isArray(e.cells))for(let t of e.cells)t&&t.root&&a(t)}a(e);for(let e of n)e in t||(t[e]=``);return{definitions:t,displayNumberMap:r}}var Gt=e=>`${H.alert} ${Te.alert} rich-alert-${e}`;function Kt(e,t,n){switch(e.type){case`alert-quote`:return(0,U.createElement)(`div`,{key:t,className:Gt(e.alertType)},n);case`banner`:return(0,U.createElement)(`div`,{key:t,className:`rich-banner rich-banner-${e.bannerType}`},n);case`grid-container`:return(0,U.createElement)(`div`,{key:t,className:`${F.container} ${Pe.container}`},n);default:return(0,U.isValidElement)(n)?(0,U.cloneElement)(n,{key:t}):n}}function qt(e,t,n){return(0,U.isValidElement)(e)&&typeof e.type==`string`?(0,U.cloneElement)(e,{"data-block-id":t}):(0,X.jsx)(`div`,{className:`rich-block-anchor`,"data-block-id":t,children:e},`${n}-block-anchor`)}function Jt(e,t,n,r){return t?(r.blockAnchor??qt)(e,t,n):e}function Yt(e,t,n,r,i,a,o){let s=e.getKey?e.getKey():i,{builtinNodeOverrides:c}=o;if(typeof e.decorate==`function`){let r=null;try{r=e.decorate(t,n)}catch{}if(r!=null){let t=e.exportJSON?e.exportJSON():{},n=c?.[t.type];return Jt(n?n(t,s,[r],()=>Kt(t,s,r)):Kt(t,s,r),a,s,o)}}let l=e.exportJSON?e.exportJSON():{};if(l.type===`text`){let e=c?.text;return e?e(l,s,null,()=>Ut(l,s)):Ut(l,s)}let u=typeof e.getChildren==`function`?e.getChildren():[];Array.isArray(l.children)&&l.children.length===0&&u.length>0&&(l.children=u.map(e=>({type:typeof e.getType==`function`?e.getType():e.__type})));let d=null;u.length>0&&(d=u.map((e,i)=>Yt(e,t,n,r,`${s}-${i}`,void 0,o)));let f=e.getTextContent?e.getTextContent():void 0,p=c?.[l.type];return Jt(p?p(l,s,d,()=>zt(l,s,d,r,f)):zt(l,s,d,r,f),a,s,o)}function Xt(e,t,n){let r=Mt({nodes:t,theme:R,editable:!1,onError:e=>{console.error(`[RichRenderer]`,e)}}),i={namespace:`ssr`,theme:R},a=te(e),o=r.parseEditorState(a);r.setEditorState(o);let s=Wt(a),c=a.root?.children,l=null;return o.read(()=>{let e=D(),t=new Map,a=e.getChildren().map((e,a)=>Yt(e,r,i,t,`ssr-${a}`,c?.[a]?.$?.blockId,n));l=(0,X.jsx)(X.Fragment,{children:a})}),{content:l,footnoteData:s,renderNestedContent:e=>{let r=Mt({nodes:t,theme:R,editable:!1,onError:e=>{console.error(`[RichRenderer:nested]`,e)}}),i={namespace:`ssr-nested`,theme:R},a=te(e),o=r.parseEditorState(a);r.setEditorState(o);let s=null,c=a.root?.children;return o.read(()=>{let e=D(),t=new Map,a=e.getChildren().map((e,a)=>Yt(e,r,i,t,`nested-${a}`,c?.[a]?.$?.blockId,n));s=(0,X.jsx)(X.Fragment,{children:a})}),s}}}function Zt({value:e,variant:t=`article`,theme:n=`light`,className:r,style:i,as:a=`div`,nested:o=!1,rendererConfig:s,extraNodes:c,builtinNodeOverrides:l,blockAnchor:u}){let d=Oe(t),f=ae(),{content:p,footnoteData:m,renderNestedContent:h}=(0,U.useMemo)(()=>Xt(e,c?[...E,...c]:E,{blockAnchor:u,builtinNodeOverrides:l}),[u,l,c,e]),g=[`rich-content`,d,r].filter(Boolean).join(` `),_=typeof a==`string`?{suppressHydrationWarning:!0,className:g,"data-rich-nested":o?`true`:void 0,"data-theme":n}:{};return(0,X.jsx)(ne,{className:d,theme:n,children:(0,X.jsx)(P,{colorScheme:n,children:(0,X.jsx)(S,{config:s,mode:`renderer`,variant:t,children:(0,X.jsx)(oe,{definitions:m.definitions,displayNumberMap:m.displayNumberMap,children:(0,X.jsx)(w,{value:f??h,children:(0,X.jsx)(a,{..._,style:i,children:p})})})})})})}var Qt=[ee],$t=864e5,en=e=>String(e).padStart(2,`0`),tn=e=>new Date(e.getFullYear(),e.getMonth(),e.getDate()).getTime();function nn(e,t=Date.now()){if(!(e>0))return r.t(`time.notRecorded`);let n=new Date(e*1e3),i=new Date(t),a=Math.round((tn(i)-tn(n))/$t);if(a===0)return r.t(`time.today`);if(a===1)return r.t(`time.yesterday`);let o=n.getFullYear()===i.getFullYear();return new Intl.DateTimeFormat(c[r.language],o?{month:`long`,day:`numeric`}:{year:`numeric`,month:`long`,day:`numeric`}).format(n)}function Q(e,t=!1){if(!(e>0))return`--:--`;let n=new Date(e*1e3),r=`${en(n.getHours())}:${en(n.getMinutes())}`;return t?`${r}:${en(n.getSeconds())}`:r}function $(e){return e>0?`${nn(e)} ${Q(e)}`:r.t(`time.notRecorded`)}var rn={human:`history.sourceHuman`,agent:`history.sourceAgent`,session:`history.sourceSession`,unknown:`history.sourceUnknown`};function an(e){let{session:t,selected:n}=e;return t&&n?t.history.groups.find(e=>e.entries.includes(n)):void 0}function on(e){return e.session?.history.entries.at(-1)?.change.timestamp??0}function sn({model:e}){let{count:t,changeIndex:n,loading:r}=e;return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`span`,{role:`status`,"aria-live":`polite`,className:`history-count`,children:[t?n+1:0,` / `,t]}),(0,X.jsx)(`button`,{type:`button`,className:`history-icon`,"aria-label":f(`history.previousChange`),disabled:n===0||r,onClick:()=>e.navigate(-1),children:(0,X.jsx)(Fe,{size:14,"aria-hidden":`true`})}),(0,X.jsx)(`button`,{type:`button`,className:`history-icon`,"aria-label":f(`history.nextChange`),disabled:n>=t-1||r,onClick:()=>e.navigate(1),children:(0,X.jsx)(s,{size:14,"aria-hidden":`true`})})]})}function cn({model:e}){return(0,X.jsx)(`button`,{type:`button`,className:`history-filter`,"aria-pressed":e.onlyChanges,onClick:e.toggleOnly,children:f(`history.onlyChanges`)})}function ln({model:e}){return e.pending?(0,X.jsxs)(`div`,{className:`history-update`,role:`status`,children:[(0,X.jsx)(`span`,{children:e.streaming?f(`history.waitingEdits`):f(`history.newContent`,{time:Q(on(e))})}),(0,X.jsxs)(`button`,{type:`button`,disabled:e.streaming||e.loading,onClick:e.refresh,children:[(0,X.jsx)($e,{size:12,"aria-hidden":`true`}),f(`history.refresh`)]})]}):null}function un({model:e}){let{selected:t,blocks:n,count:r}=e,i=an(e),a=n.filter(e=>e.kind===`insert`||e.kind===`modify`).length,o=n.filter(e=>e.kind===`delete`||e.kind===`modify`).length;return(0,X.jsxs)(`section`,{className:`history-compare`,"aria-label":f(`history.range`),children:[(0,X.jsxs)(`dl`,{children:[(0,X.jsx)(`dt`,{children:f(`history.from`)}),(0,X.jsxs)(`dd`,{children:[(0,X.jsx)(`strong`,{children:t?$(t.change.timestamp):f(`history.pickPoint`)}),i?(0,X.jsx)(`span`,{children:f(rn[i.source])}):null]}),(0,X.jsx)(`dt`,{children:f(`history.to`)}),(0,X.jsxs)(`dd`,{children:[(0,X.jsx)(`strong`,{children:f(`history.latestVersion`)}),(0,X.jsx)(`span`,{children:$(on(e))})]})]}),(0,X.jsxs)(`div`,{className:`history-controls`,children:[(0,X.jsx)(`span`,{children:f(`history.changes`,{count:r})}),(0,X.jsxs)(`span`,{className:`history-plus`,children:[`+`,a]}),(0,X.jsxs)(`span`,{className:`history-minus`,children:[`−`,o]}),(0,X.jsx)(`span`,{className:`history-spacer`}),(0,X.jsx)(cn,{model:e}),(0,X.jsx)(sn,{model:e})]})]})}function dn({model:e}){let[t,n]=(0,U.useState)(50),[r,i]=(0,U.useState)(()=>new Set),{session:a,selected:o,blocks:s}=e;if(!a)return null;let{groups:c,entries:l,shallow:d}=a.history,p=c.findIndex(e=>o!==null&&e.entries.includes(o)),m=new Map;for(let e of s)e.group&&m.set(e.group,(m.get(e.group)??0)+1);let h=c.slice(0,t),g=e=>nn(e.entries.at(-1).change.timestamp),_=e=>i(t=>{let n=new Set(t);return n.delete(e)||n.add(e),n});return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`ol`,{className:`history-timeline`,"aria-label":f(`history.timeline`),children:h.map((t,n)=>{let i=t.entries.at(-1),a=g(t),s=n===0||a!==g(h[n-1]),c=n===p?`selected`:n===0?`latest`:n<p?`range`:`outside`,l=r.has(t.id),d=n<p?m.get(t):void 0;return(0,X.jsxs)(`li`,{className:`history-node`,"data-state":c,"data-upper":n<=p?`in`:`out`,"data-lower":n<p?`in`:`out`,"data-day":s?``:void 0,children:[s?(0,X.jsx)(`div`,{className:`history-day`,children:a}):null,(0,X.jsxs)(`div`,{className:`history-row`,children:[(0,X.jsx)(`span`,{className:`history-dot`,"aria-hidden":`true`}),(0,X.jsxs)(`button`,{type:`button`,className:`history-select`,"aria-current":c===`selected`?`true`:void 0,onClick:()=>e.select(i),children:[(0,X.jsxs)(`span`,{className:`history-line`,children:[(0,X.jsx)(`strong`,{children:Q(i.change.timestamp)}),(0,X.jsx)(`span`,{children:f(rn[t.source])}),c===`latest`?(0,X.jsx)(`span`,{className:`history-tag`,children:f(`history.latest`)}):null,c===`selected`?(0,X.jsx)(`span`,{className:`history-tag history-start`,children:f(`history.start`)}):null]}),(0,X.jsxs)(`span`,{className:`history-meta`,children:[f(`history.commits`,{count:t.entries.length}),d?(0,X.jsx)(`span`,{className:`history-changed`,children:f(`history.changedSuffix`,{count:d})}):null]})]}),(0,X.jsx)(`button`,{type:`button`,className:`history-icon history-expand`,"aria-label":f(l?`history.collapseCommits`:`history.expandCommits`),"aria-expanded":l,onClick:()=>_(t.id),children:(0,X.jsx)(u,{size:14,"aria-hidden":`true`})})]}),l?(0,X.jsx)(`div`,{className:`history-raw`,children:[...t.entries].reverse().map(t=>(0,X.jsxs)(`button`,{type:`button`,title:t.change.message,"aria-current":t===o?`true`:void 0,onClick:()=>e.select(t),children:[(0,X.jsx)(`span`,{children:Q(t.change.timestamp,!0)}),(0,X.jsx)(`code`,{children:t.change.message||f(`history.sourceUnknown`)})]},t.id))}):null]},t.id)})}),t<c.length?(0,X.jsx)(`button`,{type:`button`,className:`history-more`,onClick:()=>n(e=>e+50),children:f(`history.loadEarlier`)}):(0,X.jsxs)(`p`,{className:`history-end`,children:[f(d?`history.shallow`:`history.earliest`),` · `,f(`history.summary`,{edits:f(`history.edits`,{count:c.length}),commits:f(`history.commits`,{count:l.length})}),(0,X.jsx)(`br`,{}),f(`history.clockNote`)]})]})}function fn({streaming:e}){return(0,X.jsxs)(`div`,{className:`history-waiting`,children:[(0,X.jsx)(`p`,{role:`status`,children:e?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`strong`,{children:f(`history.agentEditing`)}),(0,X.jsx)(`span`,{children:f(`history.agentEditingBody`)})]}):(0,X.jsx)(`strong`,{children:f(`history.loading`)})}),(0,X.jsx)(`div`,{className:`history-skeleton`,"aria-hidden":`true`,children:[150,130,160,120].map(e=>(0,X.jsx)(`span`,{style:{width:e}},e))})]})}function pn({model:e}){return(0,X.jsxs)(`div`,{role:`alert`,className:`history-failure`,children:[(0,X.jsxs)(`strong`,{children:[(0,X.jsx)(Be,{size:15,"aria-hidden":`true`}),f(`history.failed`)]}),(0,X.jsx)(`code`,{children:e.error}),(0,X.jsx)(`span`,{children:f(`history.failedBody`)}),(0,X.jsxs)(`span`,{className:`history-actions`,children:[(0,X.jsx)(`button`,{type:`button`,className:`history-button`,disabled:e.streaming,onClick:e.refresh,children:f(`common.retry`)}),(0,X.jsx)(`button`,{type:`button`,className:`history-quiet`,onClick:e.close,children:f(`history.backToComments`)})]})]})}function mn({model:e}){return(0,X.jsxs)(`aside`,{className:`history-panel`,"aria-label":f(`history.title`),children:[(0,X.jsxs)(`header`,{className:`history-panel-head`,children:[(0,X.jsx)(`h2`,{children:f(`history.title`)}),(0,X.jsx)(`button`,{type:`button`,className:`history-icon`,"aria-label":f(`history.close`),onClick:e.close,children:(0,X.jsx)(x,{size:14,"aria-hidden":`true`})})]}),(0,X.jsx)(ln,{model:e}),e.error?(0,X.jsx)(pn,{model:e}):e.session?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(un,{model:e}),(0,X.jsx)(dn,{model:e})]}):(0,X.jsx)(fn,{streaming:e.streaming})]})}function hn({model:e,onDismiss:t}){let n=(0,U.useRef)(null);(0,U.useEffect)(()=>{let e=document.activeElement,t=n.current,r=()=>[...t?.querySelectorAll(`button:not(:disabled), a[href], input:not(:disabled), [tabindex="0"]`)??[]];r()[0]?.focus();let i=e=>{if(e.key!==`Tab`)return;let t=r();e.shiftKey&&document.activeElement===t[0]?(e.preventDefault(),t.at(-1)?.focus()):!e.shiftKey&&document.activeElement===t.at(-1)&&(e.preventDefault(),t[0]?.focus())};return t?.addEventListener(`keydown`,i),()=>{t?.removeEventListener(`keydown`,i),e?.focus()}},[]);let r=(0,X.jsxs)(`div`,{className:`history-sheet-head`,children:[(0,X.jsxs)(`span`,{children:[(0,X.jsx)(`strong`,{children:f(`history.chooseStart`)}),(0,X.jsx)(`small`,{children:f(`history.compareWithLatest`,{time:$(on(e))})})]}),(0,X.jsx)(`button`,{type:`button`,onClick:t,children:f(`common.done`)})]});return(0,X.jsx)(`div`,{ref:n,className:`history-sheet`,role:`dialog`,"aria-modal":`true`,"aria-label":f(`history.chooseStart`),children:(0,X.jsx)(Le,{snaps:[0,.85],snap:.85,onSnap:e=>{e===0&&t()},onScrim:t,header:r,children:(0,X.jsx)(`div`,{className:`history-sheet-body`,children:(0,X.jsx)(dn,{model:e})})})})}var gn=[je,T,...Qt],_n={[A]:I,[se]:Me,[ce]:ue,[ie]:V},vn={insert:`history.kindInsert`,delete:`history.kindDelete`,modify:`history.kindModify`};function yn({model:e,theme:t,title:n,narrow:r,bodyRef:i,onPick:a}){let{session:o,selected:c,blocks:l,count:u,changeIndex:d,loading:p,error:m,streaming:h,onlyChanges:g}=e,_=e=>(0,X.jsx)(Zt,{value:e,variant:`article`,theme:t,extraNodes:gn,rendererConfig:_n}),v=-1;return(0,X.jsxs)(`div`,{className:`history-view`,children:[r?(0,X.jsxs)(`div`,{className:`history-strip`,children:[(0,X.jsxs)(`button`,{type:`button`,className:`history-pick`,onClick:a,children:[(0,X.jsx)(`span`,{children:f(`history.compareFrom`)}),(0,X.jsxs)(`strong`,{children:[f(`history.toLatest`,{from:c?$(c.change.timestamp):f(`history.pickPoint`)}),(0,X.jsx)(s,{size:12,"aria-hidden":`true`})]})]}),(0,X.jsx)(cn,{model:e}),(0,X.jsx)(sn,{model:e})]}):null,r?(0,X.jsx)(ln,{model:e}):null,m?r?(0,X.jsxs)(`div`,{role:`alert`,className:`history-message`,children:[f(`history.readFailed`,{error:m}),(0,X.jsx)(`button`,{type:`button`,disabled:h,onClick:e.refresh,children:f(`common.retry`)})]}):(0,X.jsx)(`p`,{className:`history-message`,children:f(`history.unreadable`)}):p||!o?(0,X.jsx)(`div`,{role:`status`,className:`history-message`,children:f(h?`history.waitingEdits`:`history.computing`)}):(0,X.jsxs)(`div`,{ref:i,"aria-label":f(`history.diffBody`),className:`history-content`,children:[o.latest.value.root.children.some(e=>e.type===`heading`&&e.tag===`h1`)?null:(0,X.jsx)(`h1`,{children:n}),u?null:(0,X.jsx)(`p`,{role:`status`,className:`history-note`,children:f(`history.noDiff`)}),l.map((t,n)=>{if(t.kind===`equal`)return g?(0,X.jsx)(`button`,{type:`button`,className:`history-fold`,onClick:e.showAll,children:(0,X.jsx)(`span`,{children:f(`history.unchanged`,{count:t.value.root.children.length})})},n):(0,X.jsx)(`section`,{className:`history-hunk history-equal`,children:_(t.value)},n);v++;let r=t.before?null:t.kind===`insert`?`history-after`:t.kind===`delete`?`history-before`:`history-merged`;return(0,X.jsxs)(`section`,{"data-history-change":``,"data-current":v===d?``:void 0,className:`history-hunk history-${t.kind}`,children:[(0,X.jsxs)(`div`,{className:`history-caption`,children:[(0,X.jsx)(`span`,{className:`history-kind`,children:f(vn[t.kind])}),t.author?(0,X.jsxs)(`span`,{children:[$(t.author.change.timestamp),t.group?` · ${f(rn[t.group.source])}`:``]}):null]}),t.before?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`div`,{className:`history-before`,children:_(t.before)}),(0,X.jsx)(`div`,{className:`history-after`,children:_(t.value)})]}):(0,X.jsx)(`div`,{className:r,children:_(t.value)})]},n)}),(0,X.jsx)(`p`,{className:`history-end`,children:f(`history.endOfDiff`)})]})]})}var bn=e=>JSON.stringify(e.frontiers()),xn=(e,t)=>t===void 0?void 0:e[t];function Sn({doc:e,nodes:t,streaming:n,theme:r,title:i,open:a,onClose:o}){let[s,c]=(0,U.useState)(null),[l,u]=(0,U.useState)(null),d=(0,U.useRef)(null),f=(0,U.useRef)(null),p=(0,U.useRef)(0),[h,g]=(0,U.useState)(!0),[_,v]=(0,U.useState)(null),[y,b]=(0,U.useState)(!1),[x,S]=(0,U.useState)([]),[C,w]=(0,U.useState)(!1),[ee,T]=(0,U.useState)(0),[E,D]=(0,U.useState)(!1),O=m(`(max-width: 1100px)`),k=(0,U.useRef)(null),A=(0,U.useCallback)(async()=>{if(!e)return;let n=++p.current;g(!0),v(null);let r=e.fork();try{let i=await rt(r),a=it(r,r.frontiers(),t);if(p.current!==n){r.free();return}let o=f.current;f.current=r;let s=(d.current&&i.entries.find(e=>e.id===d.current.id))??i.groups[1]?.entries.at(-1)??i.entries[0]??null;d.current=s,u(s),c({doc:r,history:i,latest:a}),b(bn(e)!==bn(r)),o?.free()}catch(e){r.free(),p.current===n&&v(e.message)}finally{p.current===n&&g(!1)}},[e,t]);if((0,U.useEffect)(()=>{if(a)return()=>{p.current++,f.current?.free(),f.current=null,d.current=null,c(null),u(null),S([]),b(!1),v(null),g(!0),D(!1),w(!1)}},[a,e]),(0,U.useEffect)(()=>{a&&!n&&!f.current&&A()},[a,A,n]),(0,U.useEffect)(()=>{if(a&&e)return e.subscribe(()=>b(f.current!==null&&bn(e)!==bn(f.current)))},[e,a]),(0,U.useEffect)(()=>{if(!a)return;let e=e=>{e.key===`Escape`&&(E?D(!1):o())};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[a,o,E]),(0,U.useEffect)(()=>{if(!s||!l)return;let e=!1;g(!0);let n=setTimeout(()=>{try{let n=it(s.doc,l.frontiers,t),{entries:r,groups:i}=s.history,a=ot(s.doc,r.slice(r.indexOf(l)+1),[n,s.latest]),o=new Map(i.flatMap(e=>e.entries.map(t=>[t,e]))),c=jt(n.value,s.latest.value).map(e=>{if(e.kind===`equal`)return e;let t=[xn(s.latest.ids,e.newIndex),xn(n.ids,e.oldIndex)].map(e=>e&&a.get(e)).find(Boolean);return t?{...e,author:t,group:o.get(t)}:e});e||(S(c),T(0),v(null))}catch(t){e||v(t.message)}finally{e||g(!1)}},0);return()=>{e=!0,clearTimeout(n)}},[s,l,t]),!a||!e)return null;let j=x.filter(e=>e.kind!==`equal`).length,M={session:s,selected:l,blocks:x,count:j,changeIndex:ee,loading:h,error:_,pending:y,streaming:n,onlyChanges:C,select:e=>{d.current=e,u(e),D(!1)},navigate:e=>{let t=Math.max(0,Math.min(j-1,ee+e));T(t),k.current?.querySelectorAll(`[data-history-change]`)[t]?.scrollIntoView?.({block:`center`,behavior:`instant`})},toggleOnly:()=>w(e=>!e),showAll:()=>w(!1),refresh:()=>void A(),close:o};return{content:(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(yn,{model:M,theme:r,title:i,narrow:O,bodyRef:k,onPick:()=>D(!0)}),O&&E?(0,X.jsx)(hn,{model:M,onDismiss:()=>D(!1)}):null]}),panel:O?null:(0,X.jsx)(mn,{model:M})}}function Cn({left:e,top:t,quote:n,initial:r,restored:i,leaving:a,onChange:o,onSubmit:s,onCancel:c,ref:l}){return(0,X.jsx)(`div`,{ref:l,...{0:{className:`x10l6tqk x1u8a7rm xj6ak53 xowlrko xllfotl xatqbsq x1u6ievf`},1:{className:`x10l6tqk x1u8a7rm xj6ak53 x1u6ievf xxp0q0x x12l1aco xn0cd8s x47corl`}}[!!a|0],style:{left:e,top:t},children:(0,X.jsxs)(ye,{active:!0,children:[(0,X.jsxs)(`div`,{className:`x78zum5 x1pha0wt x167g77z xz9dl7a x1hr3lfm xqfszdh x1j6dyjg`,children:[(0,X.jsxs)(`span`,{className:`x98rzlu xeuugli xb3r6kr xuxw1ft xlyipyv xddlp02`,children:[`“`,n,`”`]}),i?(0,X.jsx)(`span`,{className:`x2lah0s x7zghnd`,children:f(`document.draftRestored`)}):null]}),(0,X.jsx)(b,{autoFocus:!0,initial:r,placeholder:f(`document.draftPlaceholder`),onChange:o,onSubmit:s,onCancel:c})]})})}function wn({left:e,top:t,onComment:n,onCopy:r,ref:i}){return(0,X.jsxs)(`div`,{ref:i,className:`x10l6tqk x1u8a7rm x78zum5 x6s0dn4 x195vfkc xc9qbxq x9f619 x9ms5i6 xmkeg23 x1y0btm7 xgcsv5v x1q4ynmn x12ilycc x1d5q07e xi1bcxy x773k2o xa3vuyk`,style:{left:e,top:t},onMouseDown:e=>e.preventDefault(),children:[n?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`button`,{type:`button`,onClick:n,className:`x78zum5 x6s0dn4 x17d4w8g x1fgtraw xt970qd x1awh872 xc342km xu4hgxq xjbqb8w xj0l527 x2230gt xo2rkog xqfszdh xfifm61 xk50ysn x1ypdohk x1de99jn xaatb59 x1y3gkto x1uczgqu x1fkwv27`,children:[(0,X.jsx)(Ze,{size:14,className:`x2lah0s x17nrqe2`}),f(`common.comment`)]}),(0,X.jsx)(`span`,{"aria-hidden":`true`,className:`x2lah0s x1i1rx1s xlup9mm xj3msbq xcn5yip`})]}):null,(0,X.jsx)(`button`,{type:`button`,onClick:r,className:`x78zum5 x6s0dn4 x17d4w8g x1fgtraw xt970qd x1awh872 xc342km xu4hgxq xjbqb8w xj0l527 x2230gt xqfszdh xfifm61 xk50ysn x1ypdohk x1de99jn xaatb59 x1y3gkto x1uczgqu x1fkwv27 x1bo0w0s`,children:f(`document.copy`)})]})}var Tn=(e,t)=>`${e}\n${t}`;function En(){let e=new Map;return{save(t,n){n.trim()?e.set(t,n):e.delete(t)},take(t){return e.get(t)??``}}}function Dn(e){let t=(0,U.useMemo)(En,[]),[n,r]=(0,U.useState)(null),[i,a]=(0,U.useState)(!1),o=(0,U.useRef)(``),s=(0,U.useRef)(0),c=(0,U.useRef)(null),l=(0,U.useRef)(null);le(i?null:n?.target.range??null);let u=(0,U.useCallback)(n=>{window.clearTimeout(s.current);let i=t.take(Tn(n.blockId,n.quote));o.current=i,a(!1),r({target:n,initial:i}),window.getSelection()?.removeAllRanges(),e()},[t,e]),d=(0,U.useCallback)(e=>{n&&(t.save(Tn(n.target.blockId,n.target.quote),e?o.current:``),a(!0),s.current=window.setTimeout(()=>{r(null),a(!1)},120))},[n,t]);return(0,U.useEffect)(()=>{if(!n||i)return;let e=e=>{let t=e.target;c.current?.contains(t)||l.current?.contains(t)||d(!0)};return document.addEventListener(`pointerdown`,e,!0),()=>document.removeEventListener(`pointerdown`,e,!0)},[n,i,d]),(0,U.useEffect)(()=>()=>window.clearTimeout(s.current),[]),{draft:n,leaving:i,restored:!!n?.initial,open:u,close:d,onText:e=>{o.current=e},panelRef:c,toolbarRef:l}}function On(e){return{left:e.offsetLeft,right:Math.min(e.offsetLeft+e.offsetWidth,window.innerWidth-16)}}function kn({editor:e,threads:t,actions:n,agent:r,canComment:i,selection:a,clearSelection:o,onCreate:s,onMain:c,history:l,children:u}){let d=Dn(o),{draft:f}=d;return(0,X.jsx)(De,{editor:e,threads:t,actions:n,agent:r,onMain:c,history:l,overlay:e=>(0,X.jsxs)(X.Fragment,{children:[a&&!f?(0,X.jsx)(wn,{ref:d.toolbarRef,...ve(a,On(e),128,36,8),onComment:i?()=>d.open(a):void 0,onCopy:()=>{navigator.clipboard?.writeText(a.quote),window.getSelection()?.removeAllRanges(),o()}}):null,f?(0,X.jsx)(Cn,{ref:d.panelRef,...de(f.target,On(e),340,8),quote:f.target.quote,initial:f.initial,restored:d.restored,leaving:d.leaving,onChange:d.onText,onSubmit:e=>s(f.target,e).then(e=>(e&&d.close(!1),e)),onCancel:()=>d.close(!0)},`${f.target.blockId}:${f.target.quote}`):null]}),children:u})}function An({id:e,title:t,activity:n,agentSection:r,offline:i,openComments:a,cloud:o,compact:s=!1,onDone:c,agent:l=`Agent`,history:u}){let d=nt(n,l,r);return h(e,o?{...t?{title:t}:{},online:o.online,comments:a,activity:d,activityTone:n.kind===`stale`?`warning`:n.kind===`working`?`quiet`:`live`,retrying:i,reason:o.reason,history:u?.available,historyOpen:u?.open}:null)&&!s?null:(0,X.jsxs)(`header`,{...{0:{className:`x7wzq59 x13vifvy x1n327nk xdd8jsf x78zum5 x6s0dn4 x1v2ro7d x4l9tsp x1rozbrz xqfszdh`},1:{className:`x7wzq59 x13vifvy x1n327nk xdd8jsf x78zum5 x6s0dn4 x1rozbrz xqfszdh x1hr3lfm x883omv`}}[!!s|0],children:[s?null:(0,X.jsxs)(`span`,{className:`xddlp02 xfifm61 xuxw1ft`,children:[`document / `,(0,X.jsx)(`span`,{className:`xo2rkog x1s688f`,children:e})]}),d?(0,X.jsxs)(`span`,{...{0:{className:`x78zum5 x6s0dn4 x17d4w8g xj8oexa x1awh872 x1e6avla xlssvyo x19ay2w6 x1j6dyjg xuxw1ft xeuugli xb3r6kr xlyipyv`},2:{className:`x78zum5 x6s0dn4 x17d4w8g xj8oexa x1awh872 x1e6avla x1j6dyjg xuxw1ft xeuugli xb3r6kr xlyipyv xahzvm9 x1bo0w0s`},1:{className:`x78zum5 x6s0dn4 x17d4w8g xj8oexa x1awh872 x1e6avla x1j6dyjg xuxw1ft xeuugli xb3r6kr xlyipyv xqdcvd7 x7zghnd`},3:{className:`x78zum5 x6s0dn4 x17d4w8g xj8oexa x1awh872 x1e6avla x1j6dyjg xuxw1ft xeuugli xb3r6kr xlyipyv xqdcvd7 x7zghnd`}}[(n.kind===`working`)<<1|n.kind===`stale`],children:[n.kind===`stale`?null:(0,X.jsx)(`i`,{className:`x1v4s8kt xols6we x16rqkct xtwfq29`}),d]}):null,i?(0,X.jsx)(`span`,{className:`x78zum5 x6s0dn4 x17d4w8g xj8oexa x1awh872 x1e6avla x1j6dyjg xuxw1ft xeuugli xb3r6kr xlyipyv xqdcvd7 x7zghnd`,children:f(`document.notSynced`)}):null,u?.open?(0,X.jsxs)(`span`,{className:`x78zum5 x6s0dn4 x17d4w8g xj8oexa x1awh872 x1e6avla x1j6dyjg xuxw1ft xeuugli xb3r6kr xlyipyv xahzvm9 x1bo0w0s`,children:[(0,X.jsx)(Ve,{size:11,"aria-hidden":`true`}),f(`document.readOnlyHistory`)]}):null,o?.reason&&!s?(0,X.jsx)(`span`,{className:`xb3r6kr xddlp02 xfifm61 xuxw1ft xlyipyv`,children:o.reason}):null,(0,X.jsx)(`span`,{className:`x98rzlu`}),o?(0,X.jsxs)(`span`,{className:`x78zum5 x6s0dn4 x17d4w8g x1bo0w0s xfifm61 xuxw1ft`,children:[(0,X.jsx)(`i`,{...{0:{className:`xci0xqf x1hagigm x16rqkct xxwmxtg`},1:{className:`xci0xqf x1hagigm x16rqkct xux1nz0`}}[!!o.online|0]}),o.online?f(`share.computerOnline`):f(`share.computerOffline`)]}):null,u?(0,X.jsx)(v,{comments:a,open:u.open,available:u.available,onComments:u.close,onHistory:u.toggle}):null,c?(0,X.jsx)(`button`,{type:`button`,onClick:c,className:`x12ulsxz xaope02 xc342km x1kogg8i x19ckca5 xs0jrwl xqfszdh x4z9k3i x1s688f x1ypdohk`,children:f(`common.done`)}):o||s?null:(0,X.jsx)(ze,{artifact:`document/${e}`})]})}function jn(e,t,n){let[r,i]=t<=n?[t,n]:[n,t];return{blockIds:e.slice(r,i+1).flatMap(e=>e.id?[e.id]:[]).slice(0,Ye.blockIds),heading:e.slice(0,r+1).filter(e=>e.heading).pop()?.text??``}}var Mn=crypto.randomUUID(),Nn=300,Pn={quote:``,blockIds:[],heading:``};function Fn(e){let t=window.getSelection(),n=e.getRootElement();if(!t||t.isCollapsed||!n?.contains(t.anchorNode)||!n.contains(t.focusNode))return Pn;let r=t.toString().trim().slice(0,Ye.quote);return r?e.read(()=>{let e=D().getChildren(),n=t=>{let n=t&&z(t)?.getTopLevelElement();return n?e.findIndex(e=>e.is(n)):-1},i=n(t.anchorNode),a=n(t.focusNode);if(i<0||a<0)return{...Pn,quote:r};let o=e.map(e=>({id:Se(e,_e)||``,heading:e.getType()===`heading`,text:e.getTextContent().slice(0,Ye.heading)}));return{quote:r,...jn(o,i,a)}}):Pn}function In(e,t,n,r){let i=(0,U.useRef)(Pn);(0,U.useEffect)(()=>{if(!e)return;let n=0,a=()=>{let n=Fn(e);JSON.stringify(n)!==JSON.stringify(i.current)&&(i.current=n,r({type:`selection`,artifact:t,tab:Mn,human:!0,...n}))},o=()=>{clearTimeout(n),n=window.setTimeout(a,Nn)};return document.addEventListener(`selectionchange`,o),()=>{clearTimeout(n),document.removeEventListener(`selectionchange`,o)}},[e,t,r]),(0,U.useEffect)(()=>{n&&i.current.quote&&r({type:`selection`,artifact:t,tab:Mn,human:!1,...i.current})},[n,t,r])}var Ln=[`pending`],Rn=`x-ryugi-document-features`,zn=e=>{let t=``;for(let n=0;n<e.length;n+=32768)t+=String.fromCharCode(...e.subarray(n,n+32768));return btoa(t)};function Bn({id:e,channel:t,send:n}){let r=(t,n,r)=>fetch(`/api/document/${e}/${t}`,{method:`POST`,headers:{"Content-Type":r,[Rn]:Ln.join(`,`)},body:n});return{artifact:`document/${e}`,channel:t,send:n,async meta(){let t=await fetch(`/api/artifacts/document/${e}`,{cache:`no-store`});return t.ok?await t.json():null},async state(){let t=await fetch(`/api/document/${e}/state`,{cache:`no-store`}),n=await t.json();if(!t.ok||!n.snapshot)throw Error(n.error??`load failed (${t.status})`);return n},async update(e){let t=await r(`update`,e,`application/octet-stream`);if(!t.ok)throw Error(`update failed (${t.status})`)},async comment(e){let t=await r(`comments`,JSON.stringify(e),`application/json`);if(!t.ok)throw Error(`comment failed (${t.status})`);return(await t.json()).comments}}}function Vn(e){let t=L(),n=(e.connect??Ie)({url:e.url,artifact:e.artifact,WebSocket:e.WebSocket,retryMs:e.retryMs,onPresence:e.onPresence,onEvent:e=>t.emit(e),onOnline:()=>t.emit({type:`open`})});return{artifact:e.artifact,channel:t,close:n.close,async meta(){let t=await n.request({op:`meta`});return/^https?:\/\//.test(t.contentBase??``)?t:{...t,contentBase:e.contentBase}},state:()=>n.request({op:`state`}),async update(e){await n.request({op:`update`,bytes:zn(e),features:Ln})},async comment(e){return(await n.request({op:`comment`,comment:e})).comments},send(e){let{type:t}=e;t===`selection`?n.request({op:`selection`,selection:e}).catch(()=>{}):(t===`loaded`||t===`runtime-error`)&&n.request({op:`client`,message:e}).catch(()=>{})}}}function Hn(e){let t=(0,U.useMemo)(L,[]),n=`document/${e}`,{live:r,send:i}=Ke(e=>{e.artifact===n&&t.emit(e)},()=>t.emit({type:`open`}));return{transport:(0,U.useMemo)(()=>Bn({id:e,channel:t,send:i}),[e,t,i]),live:r}}function Un(e,t){let[n,r]=(0,U.useState)(null),[i,a]=(0,U.useState)(null);return(0,U.useEffect)(()=>{let n=Vn({url:We(e),artifact:`document/${e}`,contentBase:t,onPresence:a,connect:t=>qe(e,t,t=>He({...t,cloudId:e,known:Ge()}))});return r(n),()=>{n.close(),r(null),a(null)}},[e,t]),{transport:n,presence:i}}var Wn={count:0,firstKey:null},Gn=e=>e.read(()=>{let e=D().getChildren().filter(e=>e.getType()===`pending`).map(e=>e.getKey());return{count:e.length,firstKey:e[0]??null}});function Kn(e){let[t,n]=(0,U.useState)(Wn);return(0,U.useEffect)(()=>{if(!e){n(Wn);return}let t=e=>n(t=>t.count===e.count&&t.firstKey===e.firstKey?t:e);return t(Gn(e.getEditorState())),e.registerUpdateListener(({editorState:e})=>t(Gn(e)))},[e]),t}function qn(e,t=15e3){let[n,r]=(0,U.useState)(()=>Date.now());return(0,U.useEffect)(()=>{if(!e)return;r(Date.now());let n=setInterval(()=>r(Date.now()),t);return()=>clearInterval(n)},[e,t]),n}function Jn({left:e,top:t,placement:n,canComment:r,canEdit:i,onComment:a,onEdit:o}){let s=(0,U.useRef)(null),c=[r?{label:f(`common.comment`),Icon:Ze,run:a,primary:!0}:null,i?{label:f(`document.editText`),Icon:Ce,run:o,primary:!1}:null].filter(e=>e!==null);return(0,U.useLayoutEffect)(()=>{y(s.current,[{opacity:0,transform:`scale(0.96)`},{opacity:1,transform:`none`}],{duration:160,easing:_})},[]),c.length===0?null:(0,X.jsxs)(`div`,{ref:s,"data-edit-menu":!0,"data-placement":n,...{0:{className:`x10l6tqk x1u8a7rm x78zum5 xdt5ytf x1cy8zhl`},1:{className:`x10l6tqk x1u8a7rm x78zum5 x1cy8zhl x3ieub6`}}[n===`above`|0],style:{left:e,top:t,transformOrigin:n===`above`?`22px 100%`:`22px 0`},onMouseDown:e=>e.preventDefault(),children:[(0,X.jsx)(`span`,{className:`xsmyaan x1kpxq89 xyqm7xq x1qp53xl x1cum3z5 xf6xdpg x1158fpu`}),(0,X.jsx)(`div`,{className:`x78zum5 xn3w4p2 xfn1xvj x4pepcl xf6xdpg x1dam6yx`,children:c.map(({label:e,Icon:t,run:n,primary:r})=>(0,X.jsxs)(`button`,{type:`button`,onClick:n,...{0:{className:`x78zum5 x6s0dn4 x17d4w8g xn3w4p2 xt970qd xaope02 xc342km x1q4ynmn xjbqb8w x116urgp xqirfc3 xqfszdh xif65rj x1ypdohk`},1:{className:`x78zum5 x6s0dn4 x17d4w8g xn3w4p2 xt970qd xaope02 xc342km x1q4ynmn xjbqb8w x116urgp xqfszdh xif65rj x1ypdohk xfungia x1s688f`}}[!!r|0],children:[(0,X.jsx)(t,{size:16,"aria-hidden":!0}),e]},e))})]})}var Yn={state:{kmuXW:`x2lah0s`,kGuDYH:`xfifm61`,$$css:!0},waitingAgent:{kMwMTN:`x7zghnd`,$$css:!0},answered:{kMwMTN:`xh0clw4`,$$css:!0},resolved:{kMwMTN:`xddlp02`,$$css:!0}},Xn=e=>new Date(e).toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`});function Zn({thread:e,agent:t=`Agent`,actions:n,active:r=!1,offline:i=!1}){let s=p(e),c=e.status===`resolved`,l=c?{label:f(`common.resolved`),tone:Yn.resolved}:s===`agent`?{label:f(`document.waitingAgentReply`,{agent:t}),tone:Yn.waitingAgent}:s===`human`?{label:f(`document.agentReplied`,{agent:t}),tone:Yn.answered}:null;return(0,X.jsxs)(`div`,{"data-thread":e.id,...{0:{className:`xxlmvz2 x178xt8z x13fuv20 xxu5053 xqfszdh xo2rkog`},1:{className:`xxlmvz2 x178xt8z x13fuv20 xxu5053 xqfszdh xo2rkog xggygye`}}[!!r|0],children:[(0,X.jsxs)(`div`,{className:`x78zum5 x1pha0wt x167g77z x1lqa7cf x1vo0akb x19ypqd9 x13ym6ox x4z9k3i`,children:[(0,X.jsx)(`span`,{className:`x98rzlu xeuugli xb3r6kr xuxw1ft xlyipyv x1bo0w0s`,children:e.anchor.quote||f(`document.wholeBlock`)}),l?(0,X.jsx)(`span`,{...d(Yn.state,l.tone),children:l.label}):null]}),c&&!r?null:e.messages.map(e=>{let{label:t,initial:n}=a(e);return(0,X.jsxs)(`div`,{className:`x14vqqas`,children:[(0,X.jsxs)(`div`,{className:`x78zum5 x6s0dn4 x167g77z x4z9k3i x1s688f`,children:[(0,X.jsx)(o,{human:e.author===`human`,initial:n,name:e.name,src:e.avatar}),t,(0,X.jsx)(`span`,{className:`xddlp02 xo1l8bm xfifm61`,children:Xn(e.editedAt??e.at)})]}),(0,X.jsx)(`div`,{...{0:{className:`x1gslohp xxpkpgd x1jvydc1 x1dbl2gt x126k92a xj0a0fe`},1:{className:`x1gslohp xxpkpgd x1jvydc1 x1dbl2gt x126k92a xj0a0fe xc7n51q`}}[!!e.deleted|0],children:e.deleted?f(`common.deleted`):e.text})]},e.id)}),n?(0,X.jsxs)(`div`,{className:`x78zum5 x6s0dn4 xou54vl x1anpbxc xxpkpgd`,children:[c?null:(0,X.jsx)(`div`,{className:`x98rzlu xeuugli x1qyh8g1 xso031l x1q0q8m5 x1iz93xd`,children:(0,X.jsx)(b,{placeholder:f(`common.reply`),onSubmit:t=>n.reply(e.id,t)})}),i?null:(0,X.jsx)(`button`,{type:`button`,onClick:()=>c?n.reopen(e.id):n.resolve(e.id),className:`x2lah0s x1gg8mnh xt970qd xdqyycr x1w5wx5t xc342km xjbqb8w x1bo0w0s xqfszdh x4z9k3i x1ypdohk`,children:f(c?`common.reopen`:`common.resolve`)})]}):null]})}var Qn=.5,$n=e=>e===78?Qn:e;function er({threads:e,agent:t=`Agent`,actions:n,offline:r,draft:i,onCreate:a,onCancelDraft:o,activeId:s,snap:c,onSnap:l}){let u=(0,U.useRef)(null),d=e.filter(e=>!e.messages.every(e=>e.deleted)),m=d.filter(e=>p(e)===`agent`).length,h=r?f(`document.offlineNoComments`):m>0?f(`document.waitingCount`,{count:m,agent:t}):null;return(0,U.useEffect)(()=>{let e=s?u.current?.querySelector(`[data-thread="${CSS.escape(s)}"]`):null,t=e?.closest(`[data-sheet-body]`);e&&t&&(t.scrollTo({top:t.scrollTop+e.getBoundingClientRect().top-t.getBoundingClientRect().top-8,behavior:`smooth`}),y(e,[{backgroundColor:`rgba(232, 194, 74, 0.24)`},{backgroundColor:`transparent`}],{duration:600,delay:250,easing:_}))},[s]),(0,X.jsx)(Le,{snaps:[78,Qn,1],snap:c,onSnap:l,onScrim:()=>l(Qn),header:(0,X.jsxs)(`span`,{className:`x78zum5 x1pha0wt x17d4w8g xu0aao5 x17qtykl xwib8y2 xqfszdh x1jvydc1 x1s688f`,children:[f(`document.sheetComments`,{count:d.length}),h?(0,X.jsxs)(`span`,{className:`xddlp02 xfifm61 xo1l8bm`,children:[`· `,h]}):null]}),children:(0,X.jsxs)(`div`,{ref:u,className:`x17qtykl xwxc41k`,children:[i&&n?(0,X.jsxs)(`div`,{className:`x10dr8xq xqfszdh`,children:[(0,X.jsxs)(`div`,{className:`x78zum5 x1pha0wt x167g77z x4z9k3i`,children:[(0,X.jsx)(`span`,{className:`x98rzlu xeuugli x1lqa7cf x1vo0akb x19ypqd9 x13ym6ox xb3r6kr xuxw1ft xlyipyv x1bo0w0s`,children:i.quote}),(0,X.jsx)(`button`,{type:`button`,onClick:o,className:`x1717udv xc342km xjbqb8w xddlp02 x4z9k3i x1ypdohk`,children:f(`common.cancel`)})]}),(0,X.jsx)(`div`,{className:`x1xmf6yo x1qyh8g1 xso031l x1q0q8m5 x1iz93xd`,children:(0,X.jsx)(b,{autoFocus:!0,placeholder:f(`document.agentPlaceholder`),onSubmit:e=>a(i,e).then(e=>(e&&o(),e))})})]}):null,d.length===0&&!i?(0,X.jsx)(`div`,{className:`xr9q8rw xddlp02 xqfszdh x4z9k3i x2b8uid`,children:f(`document.noComments`)}):null,d.map(e=>(0,X.jsx)(Zn,{thread:e,agent:t,actions:n,active:e.id===s,offline:r},e.id))]})})}var tr=52;function nr({editor:e,threads:t,actions:n,agent:r,canComment:i,canEdit:a,offline:o,selection:s,clearSelection:c,onCreate:l,onEdit:u,onMain:d,history:f,children:p}){let[m,h]=(0,U.useState)(null),[g,_]=(0,U.useState)(null),[v,y]=(0,U.useState)(78),[b,x]=(0,U.useState)(null),S=ge(e,t,m);be(S,t,g),le(b?.range??null);let C=()=>{window.getSelection()?.removeAllRanges(),c()};return(0,X.jsxs)(`main`,{ref:e=>{h(e),d?.(e)},className:`x1n2onr6 x1cnzs8 x17qtykl x1ffnkcp`,children:[(0,X.jsxs)(`article`,{onClick:e=>{let t=we(S,e.clientX,e.clientY);_(t),t&&y($n)},children:[f?.content,(0,X.jsx)(`div`,{hidden:!!f,children:p})]}),s&&!b&&!f?(0,X.jsx)(Jn,{...Ee(s,{left:8,right:(m?.clientWidth??0)-8},170,44,{top:m?.getBoundingClientRect().top??0,height:window.innerHeight,reserved:Ue(v,window.innerHeight-tr)}),canComment:i,canEdit:a,onComment:()=>{x(s),y(Qn),C()},onEdit:()=>{u(s),c()}}):null,(0,X.jsx)(`div`,{hidden:!!f,className:`xixxii4 x1ozmhy9 xu96u03 x3m8u43 x1ey2m1c x1355qak x47corl`,children:(0,X.jsx)(er,{threads:t,agent:r,actions:n,offline:o,draft:b,onCreate:l,onCancelDraft:()=>x(null),activeId:g,snap:v,onSnap:y})})]})}var rr=200;function ir(e,t){let[n,r]=(0,U.useState)(null);return(0,U.useEffect)(()=>{if(!e||!t)return;let n=0,i=()=>{let n=window.getSelection(),i=e.getRootElement();if(!n||n.isCollapsed||n.rangeCount===0||!i?.contains(n.anchorNode)){r(null);return}let a=n.toString().trim(),o=e.read(()=>{let e=n.anchorNode&&z(n.anchorNode)?.getTopLevelElement(),t=n.focusNode&&z(n.focusNode)?.getTopLevelElement();return!e||!t||!e.is(t)?null:Se(e,_e)||null});if(!o||!a){r(null);return}let s=n.getRangeAt(0),c=[...s.getClientRects()],l=c[0]??s.getBoundingClientRect(),u=c.at(-1)??l,d=t.getBoundingClientRect();r({blockId:o,quote:a.slice(0,500),left:l.left-d.left,bottom:u.bottom-d.top,top:l.top-d.top,right:u.right-d.left,range:s.cloneRange()})},a=()=>{clearTimeout(n),n=window.setTimeout(i,rr)};return document.addEventListener(`selectionchange`,a),()=>{clearTimeout(n),document.removeEventListener(`selectionchange`,a)}},[e,t]),[n,()=>r(null)]}var ar=[...E.filter(e=>!fe.some(t=>t.getType()===(`getType`in e?e.getType():e.replace.getType()))),...fe];function or(){let e=(0,U.useMemo)(()=>window.matchMedia(`(prefers-color-scheme: dark)`),[]),[t,n]=(0,U.useState)(e.matches);return(0,U.useEffect)(()=>{let t=()=>n(e.matches);return e.addEventListener(`change`,t),()=>e.removeEventListener(`change`,t)},[e]),t}function sr(e){(0,U.useEffect)(()=>{if(!e)return;let t=document.createElement(`base`);return t.href=e,document.head.prepend(t),()=>t.remove()},[e])}function cr({id:e}){let{transport:t,live:n}=Hn(e);return(0,X.jsx)(lr,{id:e,transport:t,live:n})}function lr({id:e,transport:t,live:n,cloud:r,fallback:i}){let[a,o]=(0,U.useState)(null),[s,c]=(0,U.useState)(null),[u,d]=(0,U.useState)(l),[p,h]=(0,U.useState)(null),[_,v]=(0,U.useState)(!1),[y,b]=(0,U.useState)(void 0),[x,S]=(0,U.useState)(0),C=(0,U.useCallback)(e=>{e!==void 0&&S(e-Date.now())},[]),[w,ee]=(0,U.useState)(null),[T,E]=(0,U.useState)(!1),[D,O]=(0,U.useState)(!1),k=!r||r.online&&!T,A=D&&k;(0,U.useEffect)(()=>{k||O(!1)},[k]),(0,U.useEffect)(()=>{if(!r)return;let t=t=>{t.source===window.parent&&t.origin===location.origin&&t.data?.type===`ryugi:document-history`&&t.data.id===e&&(t.data.action===`close`?O(!1):t.data.action===`toggle`&&k&&O(e=>!e))};return window.addEventListener(`message`,t),()=>window.removeEventListener(`message`,t)},[e,r,k]);let[j,M]=(0,U.useState)(null),[N,te]=(0,U.useState)(null),ne=or(),{artifact:re,channel:P}=t,ie=!r||r.online,F=!r||r.canEdit,I=m(g),[L,ae]=(0,U.useState)(!1),R=I?L&&F:F,z=(0,U.useCallback)(async()=>{let e=await t.meta();e&&o(e)},[t]),oe=i!=null;(0,U.useEffect)(()=>{let e=!1;return(async()=>{try{await z();let n=await t.state();if(e)return;let r=new Ae;r.setRecordTimestamp(!0),r.setChangeMergeInterval(20),r.import(he(n.snapshot)),v(!!n.streaming),b(n.agentActiveAt),C(n.now),d(n.comments??l());let i=oe?{left:window.scrollX,top:window.scrollY,behavior:`instant`}:null;c(r),i&&requestAnimationFrame(()=>{e||window.scrollTo(i)})}catch(t){e||h(t.message)}})(),()=>{e=!0}},[t,z,C,oe]),(0,U.useEffect)(()=>P.subscribe(e=>{e.type===`change`?z():e.type===`doc-status`?(v(e.streaming),b(e.agentActiveAt),C(e.now)):e.type===`doc-comments`&&d(e.comments)}),[P,z,C]),(0,U.useEffect)(()=>{j?.setEditable(R&&!A)},[j,R,A]),(0,U.useEffect)(()=>{F||ae(!1)},[F]);let se=(0,U.useCallback)(e=>{v(!!e.streaming),b(e.agentActiveAt),C(e.now),e.comments&&d(e.comments)},[C]);sr(a?.contentBase),In(j,re,n&&!A,t.send);let ce=(0,U.useMemo)(()=>({artifact:re,contentBase:a?.contentBase??``,channel:P,send:t.send}),[re,a?.contentBase,P,t]);(0,U.useEffect)(()=>{document.title=a?.title||e},[a?.title,e]),Re(`document`);let B=Kn(j),le=qn(B.count>0&&!_),ue=et({streaming:_,pending:B.count,agentActiveAt:y,now:le+x}),de=a?.agent??`Agent`,fe=(0,U.useMemo)(()=>({nextKey:B.firstKey,agent:de,activity:ue.kind}),[B.firstKey,de,ue.kind]),pe=u.threads.filter(e=>e.status===`open`).length,[me,ge]=ir(j,N),_e=(0,U.useCallback)(()=>O(!1),[]),ve=Sn({doc:s,nodes:ar,streaming:_,theme:ne?`dark`:`light`,title:a?.title||e,open:A,onClose:_e}),V=(0,U.useCallback)(async e=>{try{return d(await t.comment(e)),!0}catch{return!1}},[t]),ye=(0,U.useMemo)(()=>({reply:(e,t)=>V({op:`reply`,threadId:e,text:t}),edit:(e,t,n)=>void V({op:`edit`,threadId:e,messageId:t,text:n}),remove:(e,t)=>void V({op:`delete`,threadId:e,messageId:t}),resolve:e=>void V({op:`resolve`,threadId:e}),reopen:e=>void V({op:`reopen`,threadId:e})}),[V]),H=(0,U.useCallback)((e,t)=>V({op:`create`,blockId:e.blockId,quote:e.quote,text:t}),[V]),be=(0,U.useCallback)(e=>{if(!j)return;j.setEditable(!0),ae(!0),j.getRootElement()?.focus({preventScroll:!0});let t=window.getSelection();t?.removeAllRanges(),t?.addRange(e.range)},[j]);if(p)return(0,X.jsx)(`div`,{className:`x1o8uwn5 x2b8uid x1bo0w0s xqfszdh xif65rj`,children:p});if(!s)return i??(0,X.jsx)(`div`,{className:`x1o8uwn5 x2b8uid x1bo0w0s xqfszdh xif65rj`,children:f(`common.loading`)});let Se=(0,X.jsx)(Ne.Provider,{value:ce,children:(0,X.jsx)(xe.Provider,{value:fe,children:(0,X.jsx)(ke,{transport:t,agent:a?.agent,doc:s,theme:ne?`dark`:`light`,onAgentSection:ee,onOffline:E,onState:se,onEditorReady:M})})});return(0,X.jsxs)(`div`,{className:`x1us19tq x1rozbrz xo2rkog`,className:`ryugi-doc ${{className:`x1us19tq x1rozbrz xo2rkog`}.className??``}`,children:[(0,X.jsx)(An,{id:e,title:a?.title||e,agent:a?.agent,activity:ue,agentSection:w,offline:T,openComments:pe,cloud:r,compact:I,onDone:I&&L?()=>ae(!1):void 0,history:{available:k,open:A,toggle:()=>O(e=>!e),close:_e}}),I?(0,X.jsx)(nr,{editor:j,threads:u.threads,actions:ye,agent:a?.agent,canComment:ie,canEdit:F,offline:!(!r||r.online),selection:L?null:me,clearSelection:ge,onCreate:H,onEdit:be,onMain:te,history:ve,children:Se}):(0,X.jsx)(kn,{editor:j,threads:u.threads,actions:ye,agent:a?.agent,canComment:ie,selection:me,clearSelection:ge,onCreate:H,onMain:te,history:ve,children:Se}),(0,X.jsx)(Je,{warnings:a?.warnings??[]})]})}export{lr as DocumentView,cr as default,Un as t};
|