excalidrop 0.2.13 → 0.2.15

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.
Files changed (149) hide show
  1. package/dist/cli.d.ts +1 -0
  2. package/dist/cli.d.ts.map +1 -1
  3. package/dist/cli.js +143 -50
  4. package/dist/cli.js.map +1 -1
  5. package/dist/frontend/assets/{advancedFormat-D_hAUGHx.js → advancedFormat-BI2QsyKs.js} +1 -1
  6. package/dist/frontend/assets/{ar-SA-G6X2FPQ2-C0cHHnYG.js → ar-SA-G6X2FPQ2-CaxtlU6V.js} +1 -1
  7. package/dist/frontend/assets/{arc-voAwz44g.js → arc-C4XPGgh1.js} +1 -1
  8. package/dist/frontend/assets/{az-AZ-76LH7QW2-Cjxzg4vI.js → az-AZ-76LH7QW2-DONe7hWP.js} +1 -1
  9. package/dist/frontend/assets/{bg-BG-XCXSNQG7-CE2Qd7cU.js → bg-BG-XCXSNQG7-C9Evwejq.js} +1 -1
  10. package/dist/frontend/assets/{blockDiagram-38ab4fdb-Bm_YLm4c.js → blockDiagram-38ab4fdb-CeGBx2IG.js} +1 -1
  11. package/dist/frontend/assets/{blockDiagram-68f4deed-BYexJ9l5.js → blockDiagram-68f4deed-BuFU62c1.js} +1 -1
  12. package/dist/frontend/assets/{bn-BD-2XOGV67Q-C3hztSh7.js → bn-BD-2XOGV67Q-A2u0B_YK.js} +1 -1
  13. package/dist/frontend/assets/{c4Diagram-15b5d702-DpvGNdb1.js → c4Diagram-15b5d702-BZOyxrhW.js} +1 -1
  14. package/dist/frontend/assets/{c4Diagram-3d4e48cf-Cex_37iq.js → c4Diagram-3d4e48cf-CtNeMwMI.js} +1 -1
  15. package/dist/frontend/assets/{ca-ES-6MX7JW3Y-DK0cMPVf.js → ca-ES-6MX7JW3Y-BJ2cOzQv.js} +1 -1
  16. package/dist/frontend/assets/channel-Bt1V_DY2.js +1 -0
  17. package/dist/frontend/assets/{classDiagram-70f12bd4-C-bM5szZ.js → classDiagram-70f12bd4-ffvmJhkT.js} +1 -1
  18. package/dist/frontend/assets/{classDiagram-d40c83e7-CNWHkFWX.js → classDiagram-d40c83e7-BKAqbPiT.js} +1 -1
  19. package/dist/frontend/assets/{classDiagram-v2-d5a6b087-CnoZ7UrM.js → classDiagram-v2-d5a6b087-B3I9-f1h.js} +1 -1
  20. package/dist/frontend/assets/{classDiagram-v2-f2320105-NEl1a8DW.js → classDiagram-v2-f2320105-ApA5rBIt.js} +1 -1
  21. package/dist/frontend/assets/clone-CverySyw.js +1 -0
  22. package/dist/frontend/assets/{createText-2e5e7dd3-CmOdNLlQ.js → createText-2e5e7dd3-Dz5JTn8-.js} +1 -1
  23. package/dist/frontend/assets/{createText-d213de94-BjNTFE-8.js → createText-d213de94-pvwHhTBT.js} +1 -1
  24. package/dist/frontend/assets/{cs-CZ-2BRQDIVT-DtnD7eNT.js → cs-CZ-2BRQDIVT-C1R2nrlZ.js} +1 -1
  25. package/dist/frontend/assets/{cytoscape-cose-bilkent-BrMrzgmp.js → cytoscape-cose-bilkent-HJBsCRy0.js} +1 -1
  26. package/dist/frontend/assets/{da-DK-5WZEPLOC-CQxH9pPs.js → da-DK-5WZEPLOC-uwpRmCSQ.js} +1 -1
  27. package/dist/frontend/assets/{de-DE-XR44H4JA--uxdtPKd.js → de-DE-XR44H4JA-DqNQykXn.js} +1 -1
  28. package/dist/frontend/assets/{edges-332bd1c7-CNic_93o.js → edges-332bd1c7-Dg01WbV7.js} +1 -1
  29. package/dist/frontend/assets/{edges-e0da2a9e-CDLrMOf-.js → edges-e0da2a9e-DrH5I7lw.js} +1 -1
  30. package/dist/frontend/assets/{el-GR-BZB4AONW-C0n5lsCo.js → el-GR-BZB4AONW-Fcd_Oynx.js} +1 -1
  31. package/dist/frontend/assets/{elk.bundled-BItCL1sO.js → elk.bundled-CCB9WSod.js} +1 -1
  32. package/dist/frontend/assets/{erDiagram-880f2ed8-DQ9hgik4.js → erDiagram-880f2ed8-DFHvELXS.js} +1 -1
  33. package/dist/frontend/assets/{erDiagram-9861fffd-16-nrx_I.js → erDiagram-9861fffd-BVYpHhLd.js} +1 -1
  34. package/dist/frontend/assets/{es-ES-U4NZUMDT-DR884pTc.js → es-ES-U4NZUMDT-dLw4wp8P.js} +1 -1
  35. package/dist/frontend/assets/{eu-ES-A7QVB2H4-CwGzoAb_.js → eu-ES-A7QVB2H4-OFvgphe5.js} +1 -1
  36. package/dist/frontend/assets/{fa-IR-HGAKTJCU-STUZS8sk.js → fa-IR-HGAKTJCU-DVwXzh2v.js} +1 -1
  37. package/dist/frontend/assets/{fi-FI-Z5N7JZ37-woRdrfKl.js → fi-FI-Z5N7JZ37-Munvd1SA.js} +1 -1
  38. package/dist/frontend/assets/{flowDb-7c981674-B4jwhc_8.js → flowDb-7c981674-Cgju3yay.js} +1 -1
  39. package/dist/frontend/assets/{flowDb-956e92f1-BMD1bhuC.js → flowDb-956e92f1-DmvPlEfa.js} +1 -1
  40. package/dist/frontend/assets/{flowDiagram-66a62f08-JlSVzRU0.js → flowDiagram-66a62f08-CXRe71xE.js} +1 -1
  41. package/dist/frontend/assets/{flowDiagram-cbd28bf7-i3WrrODz.js → flowDiagram-cbd28bf7-BpskBBZf.js} +1 -1
  42. package/dist/frontend/assets/flowDiagram-v2-96b9c2cf-QcN14kBk.js +1 -0
  43. package/dist/frontend/assets/flowDiagram-v2-ffc7f31a-DzLwKpgk.js +1 -0
  44. package/dist/frontend/assets/{flowchart-elk-definition-36e2d292-S2mocwzS.js → flowchart-elk-definition-36e2d292-CS7pfG05.js} +1 -1
  45. package/dist/frontend/assets/{flowchart-elk-definition-4a651766-CzLVoMj3.js → flowchart-elk-definition-4a651766-Cx-hM3BH.js} +1 -1
  46. package/dist/frontend/assets/{fr-FR-RHASNOE6-DEb_Iax4.js → fr-FR-RHASNOE6-B7uBhME6.js} +1 -1
  47. package/dist/frontend/assets/{ganttDiagram-04f9e578-VkIDQA63.js → ganttDiagram-04f9e578-BRI0m3iQ.js} +1 -1
  48. package/dist/frontend/assets/{ganttDiagram-c361ad54-GEDjodY6.js → ganttDiagram-c361ad54-DUIBD4rF.js} +1 -1
  49. package/dist/frontend/assets/{gitGraphDiagram-21fc4d3e-B4kyX168.js → gitGraphDiagram-21fc4d3e-BjD943_N.js} +1 -1
  50. package/dist/frontend/assets/{gitGraphDiagram-72cf32ee-BfZt9Uzr.js → gitGraphDiagram-72cf32ee-BPS4b8NG.js} +1 -1
  51. package/dist/frontend/assets/{gl-ES-HMX3MZ6V-DyLoL109.js → gl-ES-HMX3MZ6V-Divkg6yM.js} +1 -1
  52. package/dist/frontend/assets/{graph-5xNnc_2T.js → graph-Ye5fu1Py.js} +1 -1
  53. package/dist/frontend/assets/{graph-CJ5DL8Lf.js → graph-bxFPq5mp.js} +1 -1
  54. package/dist/frontend/assets/{he-IL-6SHJWFNN-B64T5I63.js → he-IL-6SHJWFNN-BHAX0Gxf.js} +1 -1
  55. package/dist/frontend/assets/{hi-IN-IWLTKZ5I-tu5bb-U9.js → hi-IN-IWLTKZ5I-BS5KD0eR.js} +1 -1
  56. package/dist/frontend/assets/{hu-HU-A5ZG7DT2-CbgcLTiz.js → hu-HU-A5ZG7DT2-BTZGcO35.js} +1 -1
  57. package/dist/frontend/assets/{id-ID-SAP4L64H-e2p7Zb_E.js → id-ID-SAP4L64H-D7X-a_Xl.js} +1 -1
  58. package/dist/frontend/assets/{index-3862675e-Bmm4Fc9s.js → index-3862675e--eWXWZQF.js} +1 -1
  59. package/dist/frontend/assets/{index-6079d271-CUioOh7n.js → index-6079d271-MAxNAr8f.js} +1 -1
  60. package/dist/frontend/assets/index-BVWcEKOQ.js +349 -0
  61. package/dist/frontend/assets/{index-Dkn7NkQE.js → index-BuQ5hb2w.js} +4 -4
  62. package/dist/frontend/assets/{infoDiagram-4a4f5b27-BhNHOwZA.js → infoDiagram-4a4f5b27-D0Gnhf0x.js} +1 -1
  63. package/dist/frontend/assets/{infoDiagram-f8f76790-BiNVg3cP.js → infoDiagram-f8f76790-CJcfYXU-.js} +1 -1
  64. package/dist/frontend/assets/{it-IT-JPQ66NNP-BZbWAY73.js → it-IT-JPQ66NNP-B7iPxEBG.js} +1 -1
  65. package/dist/frontend/assets/{ja-JP-DBVTYXUO-BTRvkLHp.js → ja-JP-DBVTYXUO-BE0v8MzJ.js} +1 -1
  66. package/dist/frontend/assets/{journeyDiagram-29694f62-Bh6lLjz4.js → journeyDiagram-29694f62-BJwkeuWK.js} +1 -1
  67. package/dist/frontend/assets/{journeyDiagram-49397b02-BS6zYMvG.js → journeyDiagram-49397b02-JC9lXhGe.js} +1 -1
  68. package/dist/frontend/assets/{kaa-6HZHGXH3-DVgbCgaP.js → kaa-6HZHGXH3-DFz38Q6C.js} +1 -1
  69. package/dist/frontend/assets/{kab-KAB-ZGHBKWFO-BjAPMX8e.js → kab-KAB-ZGHBKWFO-D-00Mjtt.js} +1 -1
  70. package/dist/frontend/assets/{kk-KZ-P5N5QNE5-CzxQzok2.js → kk-KZ-P5N5QNE5-Dm5igMCn.js} +1 -1
  71. package/dist/frontend/assets/{km-KH-HSX4SM5Z-Cp6ccIfb.js → km-KH-HSX4SM5Z-DpZYZnqU.js} +1 -1
  72. package/dist/frontend/assets/{ko-KR-MTYHY66A-F3PDpwD9.js → ko-KR-MTYHY66A-x7JVdXGx.js} +1 -1
  73. package/dist/frontend/assets/{ku-TR-6OUDTVRD-DqXhgZl-.js → ku-TR-6OUDTVRD-B7ow782Q.js} +1 -1
  74. package/dist/frontend/assets/{layout-DEauq2-V.js → layout-BtzmFPIx.js} +1 -1
  75. package/dist/frontend/assets/{layout-0oV3gk2v.js → layout-DHGBOueG.js} +1 -1
  76. package/dist/frontend/assets/{line-De4TmFEB.js → line-MN52CDfx.js} +1 -1
  77. package/dist/frontend/assets/{linear-B4mjEkfY.js → linear-Uzo-IsR2.js} +1 -1
  78. package/dist/frontend/assets/{lt-LT-XHIRWOB4-1eCe67Bl.js → lt-LT-XHIRWOB4-hNmxWFbJ.js} +1 -1
  79. package/dist/frontend/assets/{lv-LV-5QDEKY6T-CAsgjtjW.js → lv-LV-5QDEKY6T-Cudz98Yj.js} +1 -1
  80. package/dist/frontend/assets/{mindmap-definition-ac74a2e8-BqOdiX5M.js → mindmap-definition-ac74a2e8-z4UezY2y.js} +1 -1
  81. package/dist/frontend/assets/{mindmap-definition-fc14e90a-B8Rxhfa7.js → mindmap-definition-fc14e90a-4hiL1CmF.js} +1 -1
  82. package/dist/frontend/assets/{mr-IN-CRQNXWMA-DM2GvLsC.js → mr-IN-CRQNXWMA-CUblVYcb.js} +1 -1
  83. package/dist/frontend/assets/{my-MM-5M5IBNSE-Dz0p0cZk.js → my-MM-5M5IBNSE-Bf96t_sG.js} +1 -1
  84. package/dist/frontend/assets/{nb-NO-T6EIAALU-DJTgfL8G.js → nb-NO-T6EIAALU-BAa5-M-j.js} +1 -1
  85. package/dist/frontend/assets/{nl-NL-IS3SIHDZ-QXFgpjik.js → nl-NL-IS3SIHDZ-bgrTOFXJ.js} +1 -1
  86. package/dist/frontend/assets/{nn-NO-6E72VCQL-CupEMZo5.js → nn-NO-6E72VCQL-sKg1DMPp.js} +1 -1
  87. package/dist/frontend/assets/{oc-FR-POXYY2M6-DM3mK7_w.js → oc-FR-POXYY2M6-YnFHq8Ry.js} +1 -1
  88. package/dist/frontend/assets/{pa-IN-N4M65BXN-39D7GgUd.js → pa-IN-N4M65BXN-Cqsg9m3b.js} +1 -1
  89. package/dist/frontend/assets/{pica-BYbIcfPn.js → pica-cE5KMNox.js} +1 -1
  90. package/dist/frontend/assets/{pie-B1U0OQ26.js → pie-cQT28yIQ.js} +1 -1
  91. package/dist/frontend/assets/{pieDiagram-421022e6-BvT5PUN-.js → pieDiagram-421022e6-Dj1z_wDD.js} +1 -1
  92. package/dist/frontend/assets/{pieDiagram-8a3498a8-BVAWtEPp.js → pieDiagram-8a3498a8-Bjaxvjyi.js} +1 -1
  93. package/dist/frontend/assets/{pl-PL-T2D74RX3-BBmu2SjR.js → pl-PL-T2D74RX3-DcB1SCjx.js} +1 -1
  94. package/dist/frontend/assets/{pt-BR-5N22H2LF-BHGnlXVQ.js → pt-BR-5N22H2LF-CuXpjbkS.js} +1 -1
  95. package/dist/frontend/assets/{pt-PT-UZXXM6DQ-Bs9CAKkb.js → pt-PT-UZXXM6DQ-tHNUpzQf.js} +1 -1
  96. package/dist/frontend/assets/{quadrantDiagram-0957ecba-DEeyKHE8.js → quadrantDiagram-0957ecba-CFMyQ0mP.js} +1 -1
  97. package/dist/frontend/assets/{quadrantDiagram-120e2f19-DcJBH6EB.js → quadrantDiagram-120e2f19-1SJE472b.js} +1 -1
  98. package/dist/frontend/assets/{relay-DDrathjM.js → relay-1sEnjBCn.js} +2 -2
  99. package/dist/frontend/assets/{requirementDiagram-23d650b8-CVQ2ZP6m.js → requirementDiagram-23d650b8-JQ5Er2kb.js} +1 -1
  100. package/dist/frontend/assets/{requirementDiagram-deff3bca-hhOSwcyj.js → requirementDiagram-deff3bca-BpRNAAqo.js} +1 -1
  101. package/dist/frontend/assets/{ro-RO-JPDTUUEW-5j9Qcvxw.js → ro-RO-JPDTUUEW-BI7B7oOe.js} +1 -1
  102. package/dist/frontend/assets/{ru-RU-B4JR7IUQ-DicRcrKQ.js → ru-RU-B4JR7IUQ-zconPLrO.js} +1 -1
  103. package/dist/frontend/assets/{sankeyDiagram-04a897e0-BTt5fO25.js → sankeyDiagram-04a897e0-D31Or3lC.js} +1 -1
  104. package/dist/frontend/assets/{sankeyDiagram-23345273-CqrhI2Nl.js → sankeyDiagram-23345273-OXnSG5On.js} +1 -1
  105. package/dist/frontend/assets/{selectAll-qOHydfRB.js → selectAll-Bbco7MHs.js} +1 -1
  106. package/dist/frontend/assets/{sequenceDiagram-17ac3bff-Dioe6R0p.js → sequenceDiagram-17ac3bff-D44sltda.js} +1 -1
  107. package/dist/frontend/assets/{sequenceDiagram-704730f1-CwAM-8xD.js → sequenceDiagram-704730f1-SNpJuTGo.js} +1 -1
  108. package/dist/frontend/assets/{si-LK-N5RQ5JYF-Cvyi5caX.js → si-LK-N5RQ5JYF-GXylzPyi.js} +1 -1
  109. package/dist/frontend/assets/{sk-SK-C5VTKIMK-CVF6jp0N.js → sk-SK-C5VTKIMK-ByE-Je_t.js} +1 -1
  110. package/dist/frontend/assets/{sl-SI-NN7IZMDC-BUEZxlx3.js → sl-SI-NN7IZMDC-CkPRwE28.js} +1 -1
  111. package/dist/frontend/assets/{stateDiagram-587899a1-BScbzVlp.js → stateDiagram-587899a1-DilqgCTY.js} +1 -1
  112. package/dist/frontend/assets/{stateDiagram-9c5f0230-BRyfqsP4.js → stateDiagram-9c5f0230-CqJITn5b.js} +1 -1
  113. package/dist/frontend/assets/{stateDiagram-v2-51a3dcff-C_46txUS.js → stateDiagram-v2-51a3dcff-eBMZVGNY.js} +1 -1
  114. package/dist/frontend/assets/{stateDiagram-v2-d93cdb3a-fE8T9scw.js → stateDiagram-v2-d93cdb3a-BaylKhDX.js} +1 -1
  115. package/dist/frontend/assets/{styles-2ab5d517-BjYPsJFb.js → styles-2ab5d517-BIGHfmZe.js} +1 -1
  116. package/dist/frontend/assets/{styles-5f03d8d2-BxGvIUMy.js → styles-5f03d8d2-Dw55Rbpd.js} +1 -1
  117. package/dist/frontend/assets/{styles-6aaf32cf-C6EV3LU1.js → styles-6aaf32cf-BXUnVQLh.js} +1 -1
  118. package/dist/frontend/assets/{styles-9a916d00-D-fHYofd.js → styles-9a916d00-BYq8kLgA.js} +1 -1
  119. package/dist/frontend/assets/{styles-c10674c1-DJPAyH2i.js → styles-c10674c1-CIZGAqw9.js} +1 -1
  120. package/dist/frontend/assets/{styles-edf9a4b0-xaIyorjl.js → styles-edf9a4b0-JKycmYZL.js} +1 -1
  121. package/dist/frontend/assets/subset-shared.chunk.js +1 -1
  122. package/dist/frontend/assets/subset-worker.chunk.js +1 -1
  123. package/dist/frontend/assets/{sv-SE-XGPEYMSR-D9N-82r3.js → sv-SE-XGPEYMSR-zSyT8j9A.js} +1 -1
  124. package/dist/frontend/assets/{svgDrawCommon-08f97a94-lJ3gP-XD.js → svgDrawCommon-08f97a94-Cb5i4omb.js} +1 -1
  125. package/dist/frontend/assets/{svgDrawCommon-3ba9043b-BRyUvN8a.js → svgDrawCommon-3ba9043b-D-rnBjeC.js} +1 -1
  126. package/dist/frontend/assets/{ta-IN-2NMHFXQM-uCND4pry.js → ta-IN-2NMHFXQM-CkFuHV3V.js} +1 -1
  127. package/dist/frontend/assets/{th-TH-HPSO5L25-ZovlT-xD.js → th-TH-HPSO5L25-QIx9Ya2v.js} +1 -1
  128. package/dist/frontend/assets/{timeline-definition-7e6b55e7--QFtbYaW.js → timeline-definition-7e6b55e7-Cgy_R8Xc.js} +1 -1
  129. package/dist/frontend/assets/{timeline-definition-85554ec2-B3E_Lcbb.js → timeline-definition-85554ec2-27azWgNk.js} +1 -1
  130. package/dist/frontend/assets/{tr-TR-DEFEU3FU-DoPB0JUv.js → tr-TR-DEFEU3FU-B6BhZE1y.js} +1 -1
  131. package/dist/frontend/assets/{uk-UA-QMV73CPH-CFwy-mfZ.js → uk-UA-QMV73CPH-HB1GcgFG.js} +1 -1
  132. package/dist/frontend/assets/{union-DVy4cDRi.js → union-ClsoZ0JD.js} +1 -1
  133. package/dist/frontend/assets/{vi-VN-M7AON7JQ-CqHLJYoP.js → vi-VN-M7AON7JQ-2HLiH-NR.js} +1 -1
  134. package/dist/frontend/assets/{xychartDiagram-b6496bcd-DhEWj72p.js → xychartDiagram-b6496bcd-Dexwv94Q.js} +1 -1
  135. package/dist/frontend/assets/{xychartDiagram-e933f94c-DMJdoP4V.js → xychartDiagram-e933f94c-B1Ihwsmh.js} +1 -1
  136. package/dist/frontend/assets/{zh-CN-LNUGB5OW-CTW1RjkW.js → zh-CN-LNUGB5OW-XUBwWymm.js} +1 -1
  137. package/dist/frontend/assets/{zh-HK-E62DVLB3-CRHRMlEl.js → zh-HK-E62DVLB3-O0sNr9xc.js} +1 -1
  138. package/dist/frontend/assets/{zh-TW-RAJ6MFWO-D7-lWxxC.js → zh-TW-RAJ6MFWO-kz6UjkWj.js} +1 -1
  139. package/dist/frontend/assets/{zipObject-C2E0t_xQ.js → zipObject-BTD_n5-E.js} +1 -1
  140. package/dist/frontend/index.html +1 -1
  141. package/dist/mcp.d.ts.map +1 -1
  142. package/dist/mcp.js +61 -2
  143. package/dist/mcp.js.map +1 -1
  144. package/package.json +1 -1
  145. package/dist/frontend/assets/channel-C3hXDCqP.js +0 -1
  146. package/dist/frontend/assets/clone-B5s05voD.js +0 -1
  147. package/dist/frontend/assets/flowDiagram-v2-96b9c2cf-DXJYhZPJ.js +0 -1
  148. package/dist/frontend/assets/flowDiagram-v2-ffc7f31a-Dt9-YCmt.js +0 -1
  149. package/dist/frontend/assets/index-Dtc2YcdT.js +0 -349
@@ -1,349 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./subset-worker.chunk.js","./subset-shared.chunk.js","./pica-BYbIcfPn.js","./_commonjs-dynamic-modules-TDtrdbi3.js","./c4Diagram-15b5d702-DpvGNdb1.js","./svgDrawCommon-3ba9043b-BRyUvN8a.js","./flowDiagram-cbd28bf7-i3WrrODz.js","./flowDb-7c981674-B4jwhc_8.js","./graph-CJ5DL8Lf.js","./union-DVy4cDRi.js","./layout-DEauq2-V.js","./zipObject-C2E0t_xQ.js","./styles-2ab5d517-BjYPsJFb.js","./index-6079d271-CUioOh7n.js","./clone-B5s05voD.js","./edges-332bd1c7-CNic_93o.js","./createText-d213de94-BjNTFE-8.js","./index-DGmpr33w.js","./line-De4TmFEB.js","./array-BKyUJesY.js","./path-CbwjOpE9.js","./channel-C3hXDCqP.js","./selectAll-qOHydfRB.js","./xml-BOsq7VnW.js","./flowDiagram-v2-ffc7f31a-Dt9-YCmt.js","./erDiagram-880f2ed8-DQ9hgik4.js","./ganttDiagram-04f9e578-VkIDQA63.js","./advancedFormat-D_hAUGHx.js","./linear-B4mjEkfY.js","./init-Gi6I4Gst.js","./pieDiagram-421022e6-BvT5PUN-.js","./arc-voAwz44g.js","./ordinal-Cboi1Yqb.js","./pie-B1U0OQ26.js","./quadrantDiagram-0957ecba-DEeyKHE8.js","./xychartDiagram-b6496bcd-DhEWj72p.js","./band-dPffDWoQ.js","./requirementDiagram-23d650b8-CVQ2ZP6m.js","./sequenceDiagram-17ac3bff-Dioe6R0p.js","./classDiagram-d40c83e7-CNWHkFWX.js","./styles-5f03d8d2-BxGvIUMy.js","./classDiagram-v2-d5a6b087-CnoZ7UrM.js","./stateDiagram-9c5f0230-BRyfqsP4.js","./styles-edf9a4b0-xaIyorjl.js","./stateDiagram-v2-51a3dcff-C_46txUS.js","./journeyDiagram-29694f62-Bh6lLjz4.js","./flowchart-elk-definition-36e2d292-S2mocwzS.js","./elk.bundled-BItCL1sO.js","./timeline-definition-7e6b55e7--QFtbYaW.js","./mindmap-definition-ac74a2e8-BqOdiX5M.js","./cytoscape-cose-bilkent-BrMrzgmp.js","./sankeyDiagram-23345273-CqrhI2Nl.js","./sankeyLinkHorizontal-DgqkLiUE.js","./Tableau10-B-NsZVaP.js","./blockDiagram-68f4deed-BYexJ9l5.js"])))=>i.map(i=>d[i]);
2
- function rz(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in e)){const a=Object.getOwnPropertyDescriptor(r,i);a&&Object.defineProperty(e,i,a.get?a:{enumerable:!0,get:()=>r[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const a of i)if(a.type==="childList")for(const s of a.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).observe(document,{childList:!0,subtree:!0});function n(i){const a={};return i.integrity&&(a.integrity=i.integrity),i.referrerPolicy&&(a.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?a.credentials="include":i.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function r(i){if(i.ep)return;i.ep=!0;const a=n(i);fetch(i.href,a)}})();var Kl=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ya(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var hb={exports:{}},Af={},fb={exports:{}},Et={};/**
3
- * @license React
4
- * react.production.min.js
5
- *
6
- * Copyright (c) Facebook, Inc. and its affiliates.
7
- *
8
- * This source code is licensed under the MIT license found in the
9
- * LICENSE file in the root directory of this source tree.
10
- */var C9;function iz(){if(C9)return Et;C9=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),s=Symbol.for("react.context"),o=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),l=Symbol.for("react.lazy"),h=Symbol.iterator;function f(G){return G===null||typeof G!="object"?null:(G=h&&G[h]||G["@@iterator"],typeof G=="function"?G:null)}var g={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},U=Object.assign,y={};function v(G,ee,de){this.props=G,this.context=ee,this.refs=y,this.updater=de||g}v.prototype.isReactComponent={},v.prototype.setState=function(G,ee){if(typeof G!="object"&&typeof G!="function"&&G!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,G,ee,"setState")},v.prototype.forceUpdate=function(G){this.updater.enqueueForceUpdate(this,G,"forceUpdate")};function x(){}x.prototype=v.prototype;function w(G,ee,de){this.props=G,this.context=ee,this.refs=y,this.updater=de||g}var C=w.prototype=new x;C.constructor=w,U(C,v.prototype),C.isPureReactComponent=!0;var S=Array.isArray,k=Object.prototype.hasOwnProperty,M={current:null},T={key:!0,ref:!0,__self:!0,__source:!0};function R(G,ee,de){var xe,ve={},Me=null,Ce=null;if(ee!=null)for(xe in ee.ref!==void 0&&(Ce=ee.ref),ee.key!==void 0&&(Me=""+ee.key),ee)k.call(ee,xe)&&!T.hasOwnProperty(xe)&&(ve[xe]=ee[xe]);var ge=arguments.length-2;if(ge===1)ve.children=de;else if(1<ge){for(var $e=Array(ge),je=0;je<ge;je++)$e[je]=arguments[je+2];ve.children=$e}if(G&&G.defaultProps)for(xe in ge=G.defaultProps,ge)ve[xe]===void 0&&(ve[xe]=ge[xe]);return{$$typeof:e,type:G,key:Me,ref:Ce,props:ve,_owner:M.current}}function j(G,ee){return{$$typeof:e,type:G.type,key:ee,ref:G.ref,props:G.props,_owner:G._owner}}function P(G){return typeof G=="object"&&G!==null&&G.$$typeof===e}function N(G){var ee={"=":"=0",":":"=2"};return"$"+G.replace(/[=:]/g,function(de){return ee[de]})}var F=/\/+/g;function $(G,ee){return typeof G=="object"&&G!==null&&G.key!=null?N(""+G.key):ee.toString(36)}function q(G,ee,de,xe,ve){var Me=typeof G;(Me==="undefined"||Me==="boolean")&&(G=null);var Ce=!1;if(G===null)Ce=!0;else switch(Me){case"string":case"number":Ce=!0;break;case"object":switch(G.$$typeof){case e:case t:Ce=!0}}if(Ce)return Ce=G,ve=ve(Ce),G=xe===""?"."+$(Ce,0):xe,S(ve)?(de="",G!=null&&(de=G.replace(F,"$&/")+"/"),q(ve,ee,de,"",function(je){return je})):ve!=null&&(P(ve)&&(ve=j(ve,de+(!ve.key||Ce&&Ce.key===ve.key?"":(""+ve.key).replace(F,"$&/")+"/")+G)),ee.push(ve)),1;if(Ce=0,xe=xe===""?".":xe+":",S(G))for(var ge=0;ge<G.length;ge++){Me=G[ge];var $e=xe+$(Me,ge);Ce+=q(Me,ee,de,$e,ve)}else if($e=f(G),typeof $e=="function")for(G=$e.call(G),ge=0;!(Me=G.next()).done;)Me=Me.value,$e=xe+$(Me,ge++),Ce+=q(Me,ee,de,$e,ve);else if(Me==="object")throw ee=String(G),Error("Objects are not valid as a React child (found: "+(ee==="[object Object]"?"object with keys {"+Object.keys(G).join(", ")+"}":ee)+"). If you meant to render a collection of children, use an array instead.");return Ce}function W(G,ee,de){if(G==null)return G;var xe=[],ve=0;return q(G,xe,"","",function(Me){return ee.call(de,Me,ve++)}),xe}function V(G){if(G._status===-1){var ee=G._result;ee=ee(),ee.then(function(de){(G._status===0||G._status===-1)&&(G._status=1,G._result=de)},function(de){(G._status===0||G._status===-1)&&(G._status=2,G._result=de)}),G._status===-1&&(G._status=0,G._result=ee)}if(G._status===1)return G._result.default;throw G._result}var B={current:null},z={transition:null},Y={ReactCurrentDispatcher:B,ReactCurrentBatchConfig:z,ReactCurrentOwner:M};function K(){throw Error("act(...) is not supported in production builds of React.")}return Et.Children={map:W,forEach:function(G,ee,de){W(G,function(){ee.apply(this,arguments)},de)},count:function(G){var ee=0;return W(G,function(){ee++}),ee},toArray:function(G){return W(G,function(ee){return ee})||[]},only:function(G){if(!P(G))throw Error("React.Children.only expected to receive a single React element child.");return G}},Et.Component=v,Et.Fragment=n,Et.Profiler=i,Et.PureComponent=w,Et.StrictMode=r,Et.Suspense=c,Et.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Y,Et.act=K,Et.cloneElement=function(G,ee,de){if(G==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+G+".");var xe=U({},G.props),ve=G.key,Me=G.ref,Ce=G._owner;if(ee!=null){if(ee.ref!==void 0&&(Me=ee.ref,Ce=M.current),ee.key!==void 0&&(ve=""+ee.key),G.type&&G.type.defaultProps)var ge=G.type.defaultProps;for($e in ee)k.call(ee,$e)&&!T.hasOwnProperty($e)&&(xe[$e]=ee[$e]===void 0&&ge!==void 0?ge[$e]:ee[$e])}var $e=arguments.length-2;if($e===1)xe.children=de;else if(1<$e){ge=Array($e);for(var je=0;je<$e;je++)ge[je]=arguments[je+2];xe.children=ge}return{$$typeof:e,type:G.type,key:ve,ref:Me,props:xe,_owner:Ce}},Et.createContext=function(G){return G={$$typeof:s,_currentValue:G,_currentValue2:G,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},G.Provider={$$typeof:a,_context:G},G.Consumer=G},Et.createElement=R,Et.createFactory=function(G){var ee=R.bind(null,G);return ee.type=G,ee},Et.createRef=function(){return{current:null}},Et.forwardRef=function(G){return{$$typeof:o,render:G}},Et.isValidElement=P,Et.lazy=function(G){return{$$typeof:l,_payload:{_status:-1,_result:G},_init:V}},Et.memo=function(G,ee){return{$$typeof:d,type:G,compare:ee===void 0?null:ee}},Et.startTransition=function(G){var ee=z.transition;z.transition={};try{G()}finally{z.transition=ee}},Et.unstable_act=K,Et.useCallback=function(G,ee){return B.current.useCallback(G,ee)},Et.useContext=function(G){return B.current.useContext(G)},Et.useDebugValue=function(){},Et.useDeferredValue=function(G){return B.current.useDeferredValue(G)},Et.useEffect=function(G,ee){return B.current.useEffect(G,ee)},Et.useId=function(){return B.current.useId()},Et.useImperativeHandle=function(G,ee,de){return B.current.useImperativeHandle(G,ee,de)},Et.useInsertionEffect=function(G,ee){return B.current.useInsertionEffect(G,ee)},Et.useLayoutEffect=function(G,ee){return B.current.useLayoutEffect(G,ee)},Et.useMemo=function(G,ee){return B.current.useMemo(G,ee)},Et.useReducer=function(G,ee,de){return B.current.useReducer(G,ee,de)},Et.useRef=function(G){return B.current.useRef(G)},Et.useState=function(G){return B.current.useState(G)},Et.useSyncExternalStore=function(G,ee,de){return B.current.useSyncExternalStore(G,ee,de)},Et.useTransition=function(){return B.current.useTransition()},Et.version="18.3.1",Et}var S9;function P1(){return S9||(S9=1,fb.exports=iz()),fb.exports}/**
11
- * @license React
12
- * react-jsx-runtime.production.min.js
13
- *
14
- * Copyright (c) Facebook, Inc. and its affiliates.
15
- *
16
- * This source code is licensed under the MIT license found in the
17
- * LICENSE file in the root directory of this source tree.
18
- */var _9;function az(){if(_9)return Af;_9=1;var e=P1(),t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,i=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,a={key:!0,ref:!0,__self:!0,__source:!0};function s(o,c,d){var l,h={},f=null,g=null;d!==void 0&&(f=""+d),c.key!==void 0&&(f=""+c.key),c.ref!==void 0&&(g=c.ref);for(l in c)r.call(c,l)&&!a.hasOwnProperty(l)&&(h[l]=c[l]);if(o&&o.defaultProps)for(l in c=o.defaultProps,c)h[l]===void 0&&(h[l]=c[l]);return{$$typeof:t,type:o,key:f,ref:g,props:h,_owner:i.current}}return Af.Fragment=n,Af.jsx=s,Af.jsxs=s,Af}var k9;function sz(){return k9||(k9=1,hb.exports=az()),hb.exports}var m=sz(),I=P1();const ke=ya(I),tv=rz({__proto__:null,default:ke},[I]);var ym={},pb={exports:{}},ii={},mb={exports:{}},gb={};/**
19
- * @license React
20
- * scheduler.production.min.js
21
- *
22
- * Copyright (c) Facebook, Inc. and its affiliates.
23
- *
24
- * This source code is licensed under the MIT license found in the
25
- * LICENSE file in the root directory of this source tree.
26
- */var T9;function oz(){return T9||(T9=1,function(e){function t(z,Y){var K=z.length;z.push(Y);e:for(;0<K;){var G=K-1>>>1,ee=z[G];if(0<i(ee,Y))z[G]=Y,z[K]=ee,K=G;else break e}}function n(z){return z.length===0?null:z[0]}function r(z){if(z.length===0)return null;var Y=z[0],K=z.pop();if(K!==Y){z[0]=K;e:for(var G=0,ee=z.length,de=ee>>>1;G<de;){var xe=2*(G+1)-1,ve=z[xe],Me=xe+1,Ce=z[Me];if(0>i(ve,K))Me<ee&&0>i(Ce,ve)?(z[G]=Ce,z[Me]=K,G=Me):(z[G]=ve,z[xe]=K,G=xe);else if(Me<ee&&0>i(Ce,K))z[G]=Ce,z[Me]=K,G=Me;else break e}}return Y}function i(z,Y){var K=z.sortIndex-Y.sortIndex;return K!==0?K:z.id-Y.id}if(typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var s=Date,o=s.now();e.unstable_now=function(){return s.now()-o}}var c=[],d=[],l=1,h=null,f=3,g=!1,U=!1,y=!1,v=typeof setTimeout=="function"?setTimeout:null,x=typeof clearTimeout=="function"?clearTimeout:null,w=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function C(z){for(var Y=n(d);Y!==null;){if(Y.callback===null)r(d);else if(Y.startTime<=z)r(d),Y.sortIndex=Y.expirationTime,t(c,Y);else break;Y=n(d)}}function S(z){if(y=!1,C(z),!U)if(n(c)!==null)U=!0,V(k);else{var Y=n(d);Y!==null&&B(S,Y.startTime-z)}}function k(z,Y){U=!1,y&&(y=!1,x(R),R=-1),g=!0;var K=f;try{for(C(Y),h=n(c);h!==null&&(!(h.expirationTime>Y)||z&&!N());){var G=h.callback;if(typeof G=="function"){h.callback=null,f=h.priorityLevel;var ee=G(h.expirationTime<=Y);Y=e.unstable_now(),typeof ee=="function"?h.callback=ee:h===n(c)&&r(c),C(Y)}else r(c);h=n(c)}if(h!==null)var de=!0;else{var xe=n(d);xe!==null&&B(S,xe.startTime-Y),de=!1}return de}finally{h=null,f=K,g=!1}}var M=!1,T=null,R=-1,j=5,P=-1;function N(){return!(e.unstable_now()-P<j)}function F(){if(T!==null){var z=e.unstable_now();P=z;var Y=!0;try{Y=T(!0,z)}finally{Y?$():(M=!1,T=null)}}else M=!1}var $;if(typeof w=="function")$=function(){w(F)};else if(typeof MessageChannel<"u"){var q=new MessageChannel,W=q.port2;q.port1.onmessage=F,$=function(){W.postMessage(null)}}else $=function(){v(F,0)};function V(z){T=z,M||(M=!0,$())}function B(z,Y){R=v(function(){z(e.unstable_now())},Y)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(z){z.callback=null},e.unstable_continueExecution=function(){U||g||(U=!0,V(k))},e.unstable_forceFrameRate=function(z){0>z||125<z?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):j=0<z?Math.floor(1e3/z):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_getFirstCallbackNode=function(){return n(c)},e.unstable_next=function(z){switch(f){case 1:case 2:case 3:var Y=3;break;default:Y=f}var K=f;f=Y;try{return z()}finally{f=K}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(z,Y){switch(z){case 1:case 2:case 3:case 4:case 5:break;default:z=3}var K=f;f=z;try{return Y()}finally{f=K}},e.unstable_scheduleCallback=function(z,Y,K){var G=e.unstable_now();switch(typeof K=="object"&&K!==null?(K=K.delay,K=typeof K=="number"&&0<K?G+K:G):K=G,z){case 1:var ee=-1;break;case 2:ee=250;break;case 5:ee=1073741823;break;case 4:ee=1e4;break;default:ee=5e3}return ee=K+ee,z={id:l++,callback:Y,priorityLevel:z,startTime:K,expirationTime:ee,sortIndex:-1},K>G?(z.sortIndex=K,t(d,z),n(c)===null&&z===n(d)&&(y?(x(R),R=-1):y=!0,B(S,K-G))):(z.sortIndex=ee,t(c,z),U||g||(U=!0,V(k))),z},e.unstable_shouldYield=N,e.unstable_wrapCallback=function(z){var Y=f;return function(){var K=f;f=Y;try{return z.apply(this,arguments)}finally{f=K}}}}(gb)),gb}var M9;function lz(){return M9||(M9=1,mb.exports=oz()),mb.exports}/**
27
- * @license React
28
- * react-dom.production.min.js
29
- *
30
- * Copyright (c) Facebook, Inc. and its affiliates.
31
- *
32
- * This source code is licensed under the MIT license found in the
33
- * LICENSE file in the root directory of this source tree.
34
- */var I9;function cz(){if(I9)return ii;I9=1;var e=P1(),t=lz();function n(u){for(var p="https://reactjs.org/docs/error-decoder.html?invariant="+u,b=1;b<arguments.length;b++)p+="&args[]="+encodeURIComponent(arguments[b]);return"Minified React error #"+u+"; visit "+p+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var r=new Set,i={};function a(u,p){s(u,p),s(u+"Capture",p)}function s(u,p){for(i[u]=p,u=0;u<p.length;u++)r.add(p[u])}var o=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),c=Object.prototype.hasOwnProperty,d=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,l={},h={};function f(u){return c.call(h,u)?!0:c.call(l,u)?!1:d.test(u)?h[u]=!0:(l[u]=!0,!1)}function g(u,p,b,E){if(b!==null&&b.type===0)return!1;switch(typeof p){case"function":case"symbol":return!0;case"boolean":return E?!1:b!==null?!b.acceptsBooleans:(u=u.toLowerCase().slice(0,5),u!=="data-"&&u!=="aria-");default:return!1}}function U(u,p,b,E){if(p===null||typeof p>"u"||g(u,p,b,E))return!0;if(E)return!1;if(b!==null)switch(b.type){case 3:return!p;case 4:return p===!1;case 5:return isNaN(p);case 6:return isNaN(p)||1>p}return!1}function y(u,p,b,E,_,L,O){this.acceptsBooleans=p===2||p===3||p===4,this.attributeName=E,this.attributeNamespace=_,this.mustUseProperty=b,this.propertyName=u,this.type=p,this.sanitizeURL=L,this.removeEmptyString=O}var v={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(u){v[u]=new y(u,0,!1,u,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(u){var p=u[0];v[p]=new y(p,1,!1,u[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(u){v[u]=new y(u,2,!1,u.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(u){v[u]=new y(u,2,!1,u,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(u){v[u]=new y(u,3,!1,u.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(u){v[u]=new y(u,3,!0,u,null,!1,!1)}),["capture","download"].forEach(function(u){v[u]=new y(u,4,!1,u,null,!1,!1)}),["cols","rows","size","span"].forEach(function(u){v[u]=new y(u,6,!1,u,null,!1,!1)}),["rowSpan","start"].forEach(function(u){v[u]=new y(u,5,!1,u.toLowerCase(),null,!1,!1)});var x=/[\-:]([a-z])/g;function w(u){return u[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(u){var p=u.replace(x,w);v[p]=new y(p,1,!1,u,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(u){var p=u.replace(x,w);v[p]=new y(p,1,!1,u,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(u){var p=u.replace(x,w);v[p]=new y(p,1,!1,u,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(u){v[u]=new y(u,1,!1,u.toLowerCase(),null,!1,!1)}),v.xlinkHref=new y("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(u){v[u]=new y(u,1,!1,u.toLowerCase(),null,!0,!0)});function C(u,p,b,E){var _=v.hasOwnProperty(p)?v[p]:null;(_!==null?_.type!==0:E||!(2<p.length)||p[0]!=="o"&&p[0]!=="O"||p[1]!=="n"&&p[1]!=="N")&&(U(p,b,_,E)&&(b=null),E||_===null?f(p)&&(b===null?u.removeAttribute(p):u.setAttribute(p,""+b)):_.mustUseProperty?u[_.propertyName]=b===null?_.type===3?!1:"":b:(p=_.attributeName,E=_.attributeNamespace,b===null?u.removeAttribute(p):(_=_.type,b=_===3||_===4&&b===!0?"":""+b,E?u.setAttributeNS(E,p,b):u.setAttribute(p,b))))}var S=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,k=Symbol.for("react.element"),M=Symbol.for("react.portal"),T=Symbol.for("react.fragment"),R=Symbol.for("react.strict_mode"),j=Symbol.for("react.profiler"),P=Symbol.for("react.provider"),N=Symbol.for("react.context"),F=Symbol.for("react.forward_ref"),$=Symbol.for("react.suspense"),q=Symbol.for("react.suspense_list"),W=Symbol.for("react.memo"),V=Symbol.for("react.lazy"),B=Symbol.for("react.offscreen"),z=Symbol.iterator;function Y(u){return u===null||typeof u!="object"?null:(u=z&&u[z]||u["@@iterator"],typeof u=="function"?u:null)}var K=Object.assign,G;function ee(u){if(G===void 0)try{throw Error()}catch(b){var p=b.stack.trim().match(/\n( *(at )?)/);G=p&&p[1]||""}return`
35
- `+G+u}var de=!1;function xe(u,p){if(!u||de)return"";de=!0;var b=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(p)if(p=function(){throw Error()},Object.defineProperty(p.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(p,[])}catch(fe){var E=fe}Reflect.construct(u,[],p)}else{try{p.call()}catch(fe){E=fe}u.call(p.prototype)}else{try{throw Error()}catch(fe){E=fe}u()}}catch(fe){if(fe&&E&&typeof fe.stack=="string"){for(var _=fe.stack.split(`
36
- `),L=E.stack.split(`
37
- `),O=_.length-1,Q=L.length-1;1<=O&&0<=Q&&_[O]!==L[Q];)Q--;for(;1<=O&&0<=Q;O--,Q--)if(_[O]!==L[Q]){if(O!==1||Q!==1)do if(O--,Q--,0>Q||_[O]!==L[Q]){var J=`
38
- `+_[O].replace(" at new "," at ");return u.displayName&&J.includes("<anonymous>")&&(J=J.replace("<anonymous>",u.displayName)),J}while(1<=O&&0<=Q);break}}}finally{de=!1,Error.prepareStackTrace=b}return(u=u?u.displayName||u.name:"")?ee(u):""}function ve(u){switch(u.tag){case 5:return ee(u.type);case 16:return ee("Lazy");case 13:return ee("Suspense");case 19:return ee("SuspenseList");case 0:case 2:case 15:return u=xe(u.type,!1),u;case 11:return u=xe(u.type.render,!1),u;case 1:return u=xe(u.type,!0),u;default:return""}}function Me(u){if(u==null)return null;if(typeof u=="function")return u.displayName||u.name||null;if(typeof u=="string")return u;switch(u){case T:return"Fragment";case M:return"Portal";case j:return"Profiler";case R:return"StrictMode";case $:return"Suspense";case q:return"SuspenseList"}if(typeof u=="object")switch(u.$$typeof){case N:return(u.displayName||"Context")+".Consumer";case P:return(u._context.displayName||"Context")+".Provider";case F:var p=u.render;return u=u.displayName,u||(u=p.displayName||p.name||"",u=u!==""?"ForwardRef("+u+")":"ForwardRef"),u;case W:return p=u.displayName||null,p!==null?p:Me(u.type)||"Memo";case V:p=u._payload,u=u._init;try{return Me(u(p))}catch{}}return null}function Ce(u){var p=u.type;switch(u.tag){case 24:return"Cache";case 9:return(p.displayName||"Context")+".Consumer";case 10:return(p._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return u=p.render,u=u.displayName||u.name||"",p.displayName||(u!==""?"ForwardRef("+u+")":"ForwardRef");case 7:return"Fragment";case 5:return p;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Me(p);case 8:return p===R?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof p=="function")return p.displayName||p.name||null;if(typeof p=="string")return p}return null}function ge(u){switch(typeof u){case"boolean":case"number":case"string":case"undefined":return u;case"object":return u;default:return""}}function $e(u){var p=u.type;return(u=u.nodeName)&&u.toLowerCase()==="input"&&(p==="checkbox"||p==="radio")}function je(u){var p=$e(u)?"checked":"value",b=Object.getOwnPropertyDescriptor(u.constructor.prototype,p),E=""+u[p];if(!u.hasOwnProperty(p)&&typeof b<"u"&&typeof b.get=="function"&&typeof b.set=="function"){var _=b.get,L=b.set;return Object.defineProperty(u,p,{configurable:!0,get:function(){return _.call(this)},set:function(O){E=""+O,L.call(this,O)}}),Object.defineProperty(u,p,{enumerable:b.enumerable}),{getValue:function(){return E},setValue:function(O){E=""+O},stopTracking:function(){u._valueTracker=null,delete u[p]}}}}function Je(u){u._valueTracker||(u._valueTracker=je(u))}function ut(u){if(!u)return!1;var p=u._valueTracker;if(!p)return!0;var b=p.getValue(),E="";return u&&(E=$e(u)?u.checked?"true":"false":u.value),u=E,u!==b?(p.setValue(u),!0):!1}function zt(u){if(u=u||(typeof document<"u"?document:void 0),typeof u>"u")return null;try{return u.activeElement||u.body}catch{return u.body}}function Tn(u,p){var b=p.checked;return K({},p,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:b??u._wrapperState.initialChecked})}function On(u,p){var b=p.defaultValue==null?"":p.defaultValue,E=p.checked!=null?p.checked:p.defaultChecked;b=ge(p.value!=null?p.value:b),u._wrapperState={initialChecked:E,initialValue:b,controlled:p.type==="checkbox"||p.type==="radio"?p.checked!=null:p.value!=null}}function Fn(u,p){p=p.checked,p!=null&&C(u,"checked",p,!1)}function hn(u,p){Fn(u,p);var b=ge(p.value),E=p.type;if(b!=null)E==="number"?(b===0&&u.value===""||u.value!=b)&&(u.value=""+b):u.value!==""+b&&(u.value=""+b);else if(E==="submit"||E==="reset"){u.removeAttribute("value");return}p.hasOwnProperty("value")?fr(u,p.type,b):p.hasOwnProperty("defaultValue")&&fr(u,p.type,ge(p.defaultValue)),p.checked==null&&p.defaultChecked!=null&&(u.defaultChecked=!!p.defaultChecked)}function xa(u,p,b){if(p.hasOwnProperty("value")||p.hasOwnProperty("defaultValue")){var E=p.type;if(!(E!=="submit"&&E!=="reset"||p.value!==void 0&&p.value!==null))return;p=""+u._wrapperState.initialValue,b||p===u.value||(u.value=p),u.defaultValue=p}b=u.name,b!==""&&(u.name=""),u.defaultChecked=!!u._wrapperState.initialChecked,b!==""&&(u.name=b)}function fr(u,p,b){(p!=="number"||zt(u.ownerDocument)!==u)&&(b==null?u.defaultValue=""+u._wrapperState.initialValue:u.defaultValue!==""+b&&(u.defaultValue=""+b))}var xi=Array.isArray;function xr(u,p,b,E){if(u=u.options,p){p={};for(var _=0;_<b.length;_++)p["$"+b[_]]=!0;for(b=0;b<u.length;b++)_=p.hasOwnProperty("$"+u[b].value),u[b].selected!==_&&(u[b].selected=_),_&&E&&(u[b].defaultSelected=!0)}else{for(b=""+ge(b),p=null,_=0;_<u.length;_++){if(u[_].value===b){u[_].selected=!0,E&&(u[_].defaultSelected=!0);return}p!==null||u[_].disabled||(p=u[_])}p!==null&&(p.selected=!0)}}function fl(u,p){if(p.dangerouslySetInnerHTML!=null)throw Error(n(91));return K({},p,{value:void 0,defaultValue:void 0,children:""+u._wrapperState.initialValue})}function lo(u,p){var b=p.value;if(b==null){if(b=p.children,p=p.defaultValue,b!=null){if(p!=null)throw Error(n(92));if(xi(b)){if(1<b.length)throw Error(n(93));b=b[0]}p=b}p==null&&(p=""),b=p}u._wrapperState={initialValue:ge(b)}}function wa(u,p){var b=ge(p.value),E=ge(p.defaultValue);b!=null&&(b=""+b,b!==u.value&&(u.value=b),p.defaultValue==null&&u.defaultValue!==b&&(u.defaultValue=b)),E!=null&&(u.defaultValue=""+E)}function wi(u){var p=u.textContent;p===u._wrapperState.initialValue&&p!==""&&p!==null&&(u.value=p)}function Ei(u){switch(u){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function co(u,p){return u==null||u==="http://www.w3.org/1999/xhtml"?Ei(p):u==="http://www.w3.org/2000/svg"&&p==="foreignObject"?"http://www.w3.org/1999/xhtml":u}var us,Ea=function(u){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(p,b,E,_){MSApp.execUnsafeLocalFunction(function(){return u(p,b,E,_)})}:u}(function(u,p){if(u.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in u)u.innerHTML=p;else{for(us=us||document.createElement("div"),us.innerHTML="<svg>"+p.valueOf().toString()+"</svg>",p=us.firstChild;u.firstChild;)u.removeChild(u.firstChild);for(;p.firstChild;)u.appendChild(p.firstChild)}});function zi(u,p){if(p){var b=u.firstChild;if(b&&b===u.lastChild&&b.nodeType===3){b.nodeValue=p;return}}u.textContent=p}var Ca={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},hs=["Webkit","ms","Moz","O"];Object.keys(Ca).forEach(function(u){hs.forEach(function(p){p=p+u.charAt(0).toUpperCase()+u.substring(1),Ca[p]=Ca[u]})});function fs(u,p,b){return p==null||typeof p=="boolean"||p===""?"":b||typeof p!="number"||p===0||Ca.hasOwnProperty(u)&&Ca[u]?(""+p).trim():p+"px"}function Ci(u,p){u=u.style;for(var b in p)if(p.hasOwnProperty(b)){var E=b.indexOf("--")===0,_=fs(b,p[b],E);b==="float"&&(b="cssFloat"),E?u.setProperty(b,_):u[b]=_}}var ps=K({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Sa(u,p){if(p){if(ps[u]&&(p.children!=null||p.dangerouslySetInnerHTML!=null))throw Error(n(137,u));if(p.dangerouslySetInnerHTML!=null){if(p.children!=null)throw Error(n(60));if(typeof p.dangerouslySetInnerHTML!="object"||!("__html"in p.dangerouslySetInnerHTML))throw Error(n(61))}if(p.style!=null&&typeof p.style!="object")throw Error(n(62))}}function _a(u,p){if(u.indexOf("-")===-1)return typeof p.is=="string";switch(u){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var pl=null;function ka(u){return u=u.target||u.srcElement||window,u.correspondingUseElement&&(u=u.correspondingUseElement),u.nodeType===3?u.parentNode:u}var uo=null,ms=null,Qt=null;function Kr(u){if(u=gf(u)){if(typeof uo!="function")throw Error(n(280));var p=u.stateNode;p&&(p=D0(p),uo(u.stateNode,u.type,p))}}function _c(u){ms?Qt?Qt.push(u):Qt=[u]:ms=u}function gs(){if(ms){var u=ms,p=Qt;if(Qt=ms=null,Kr(u),p)for(u=0;u<p.length;u++)Kr(p[u])}}function ho(u,p){return u(p)}function Si(){}var fo=!1;function ml(u,p,b){if(fo)return u(p,b);fo=!0;try{return ho(u,p,b)}finally{fo=!1,(ms!==null||Qt!==null)&&(Si(),gs())}}function Hi(u,p){var b=u.stateNode;if(b===null)return null;var E=D0(b);if(E===null)return null;b=E[p];e:switch(p){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(E=!E.disabled)||(u=u.type,E=!(u==="button"||u==="input"||u==="select"||u==="textarea")),u=!E;break e;default:u=!1}if(u)return null;if(b&&typeof b!="function")throw Error(n(231,p,typeof b));return b}var Ta=!1;if(o)try{var Wi={};Object.defineProperty(Wi,"passive",{get:function(){Ta=!0}}),window.addEventListener("test",Wi,Wi),window.removeEventListener("test",Wi,Wi)}catch{Ta=!1}function Or(u,p,b,E,_,L,O,Q,J){var fe=Array.prototype.slice.call(arguments,3);try{p.apply(b,fe)}catch(Ee){this.onError(Ee)}}var Qr=!1,po=null,mo=!1,go=null,Us={onError:function(u){Qr=!0,po=u}};function _i(u,p,b,E,_,L,O,Q,J){Qr=!1,po=null,Or.apply(Us,arguments)}function Gd(u,p,b,E,_,L,O,Q,J){if(_i.apply(this,arguments),Qr){if(Qr){var fe=po;Qr=!1,po=null}else throw Error(n(198));mo||(mo=!0,go=fe)}}function Xi(u){var p=u,b=u;if(u.alternate)for(;p.return;)p=p.return;else{u=p;do p=u,(p.flags&4098)!==0&&(b=p.return),u=p.return;while(u)}return p.tag===3?b:null}function re(u){if(u.tag===13){var p=u.memoizedState;if(p===null&&(u=u.alternate,u!==null&&(p=u.memoizedState)),p!==null)return p.dehydrated}return null}function ue(u){if(Xi(u)!==u)throw Error(n(188))}function Ue(u){var p=u.alternate;if(!p){if(p=Xi(u),p===null)throw Error(n(188));return p!==u?null:u}for(var b=u,E=p;;){var _=b.return;if(_===null)break;var L=_.alternate;if(L===null){if(E=_.return,E!==null){b=E;continue}break}if(_.child===L.child){for(L=_.child;L;){if(L===b)return ue(_),u;if(L===E)return ue(_),p;L=L.sibling}throw Error(n(188))}if(b.return!==E.return)b=_,E=L;else{for(var O=!1,Q=_.child;Q;){if(Q===b){O=!0,b=_,E=L;break}if(Q===E){O=!0,E=_,b=L;break}Q=Q.sibling}if(!O){for(Q=L.child;Q;){if(Q===b){O=!0,b=L,E=_;break}if(Q===E){O=!0,E=L,b=_;break}Q=Q.sibling}if(!O)throw Error(n(189))}}if(b.alternate!==E)throw Error(n(190))}if(b.tag!==3)throw Error(n(188));return b.stateNode.current===b?u:p}function ae(u){return u=Ue(u),u!==null?X(u):null}function X(u){if(u.tag===5||u.tag===6)return u;for(u=u.child;u!==null;){var p=X(u);if(p!==null)return p;u=u.sibling}return null}var se=t.unstable_scheduleCallback,be=t.unstable_cancelCallback,Xe=t.unstable_shouldYield,De=t.unstable_requestPaint,_e=t.unstable_now,ze=t.unstable_getCurrentPriorityLevel,en=t.unstable_ImmediatePriority,Ht=t.unstable_UserBlockingPriority,sn=t.unstable_NormalPriority,p0=t.unstable_LowPriority,Zh=t.unstable_IdlePriority,m0=null,bs=null;function b$(u){if(bs&&typeof bs.onCommitFiberRoot=="function")try{bs.onCommitFiberRoot(m0,u,void 0,(u.current.flags&128)===128)}catch{}}var Ma=Math.clz32?Math.clz32:x$,y$=Math.log,v$=Math.LN2;function x$(u){return u>>>=0,u===0?32:31-(y$(u)/v$|0)|0}var g0=64,U0=4194304;function Kh(u){switch(u&-u){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return u&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return u&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return u}}function b0(u,p){var b=u.pendingLanes;if(b===0)return 0;var E=0,_=u.suspendedLanes,L=u.pingedLanes,O=b&268435455;if(O!==0){var Q=O&~_;Q!==0?E=Kh(Q):(L&=O,L!==0&&(E=Kh(L)))}else O=b&~_,O!==0?E=Kh(O):L!==0&&(E=Kh(L));if(E===0)return 0;if(p!==0&&p!==E&&(p&_)===0&&(_=E&-E,L=p&-p,_>=L||_===16&&(L&4194240)!==0))return p;if((E&4)!==0&&(E|=b&16),p=u.entangledLanes,p!==0)for(u=u.entanglements,p&=E;0<p;)b=31-Ma(p),_=1<<b,E|=u[b],p&=~_;return E}function w$(u,p){switch(u){case 1:case 2:case 4:return p+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return p+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function E$(u,p){for(var b=u.suspendedLanes,E=u.pingedLanes,_=u.expirationTimes,L=u.pendingLanes;0<L;){var O=31-Ma(L),Q=1<<O,J=_[O];J===-1?((Q&b)===0||(Q&E)!==0)&&(_[O]=w$(Q,p)):J<=p&&(u.expiredLanes|=Q),L&=~Q}}function R6(u){return u=u.pendingLanes&-1073741825,u!==0?u:u&1073741824?1073741824:0}function t4(){var u=g0;return g0<<=1,(g0&4194240)===0&&(g0=64),u}function D6(u){for(var p=[],b=0;31>b;b++)p.push(u);return p}function Qh(u,p,b){u.pendingLanes|=p,p!==536870912&&(u.suspendedLanes=0,u.pingedLanes=0),u=u.eventTimes,p=31-Ma(p),u[p]=b}function C$(u,p){var b=u.pendingLanes&~p;u.pendingLanes=p,u.suspendedLanes=0,u.pingedLanes=0,u.expiredLanes&=p,u.mutableReadLanes&=p,u.entangledLanes&=p,p=u.entanglements;var E=u.eventTimes;for(u=u.expirationTimes;0<b;){var _=31-Ma(b),L=1<<_;p[_]=0,E[_]=-1,u[_]=-1,b&=~L}}function j6(u,p){var b=u.entangledLanes|=p;for(u=u.entanglements;b;){var E=31-Ma(b),_=1<<E;_&p|u[E]&p&&(u[E]|=p),b&=~_}}var Wt=0;function n4(u){return u&=-u,1<u?4<u?(u&268435455)!==0?16:536870912:4:1}var r4,P6,i4,a4,s4,N6=!1,y0=[],gl=null,Ul=null,bl=null,Jh=new Map,ef=new Map,yl=[],S$="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function o4(u,p){switch(u){case"focusin":case"focusout":gl=null;break;case"dragenter":case"dragleave":Ul=null;break;case"mouseover":case"mouseout":bl=null;break;case"pointerover":case"pointerout":Jh.delete(p.pointerId);break;case"gotpointercapture":case"lostpointercapture":ef.delete(p.pointerId)}}function tf(u,p,b,E,_,L){return u===null||u.nativeEvent!==L?(u={blockedOn:p,domEventName:b,eventSystemFlags:E,nativeEvent:L,targetContainers:[_]},p!==null&&(p=gf(p),p!==null&&P6(p)),u):(u.eventSystemFlags|=E,p=u.targetContainers,_!==null&&p.indexOf(_)===-1&&p.push(_),u)}function _$(u,p,b,E,_){switch(p){case"focusin":return gl=tf(gl,u,p,b,E,_),!0;case"dragenter":return Ul=tf(Ul,u,p,b,E,_),!0;case"mouseover":return bl=tf(bl,u,p,b,E,_),!0;case"pointerover":var L=_.pointerId;return Jh.set(L,tf(Jh.get(L)||null,u,p,b,E,_)),!0;case"gotpointercapture":return L=_.pointerId,ef.set(L,tf(ef.get(L)||null,u,p,b,E,_)),!0}return!1}function l4(u){var p=kc(u.target);if(p!==null){var b=Xi(p);if(b!==null){if(p=b.tag,p===13){if(p=re(b),p!==null){u.blockedOn=p,s4(u.priority,function(){i4(b)});return}}else if(p===3&&b.stateNode.current.memoizedState.isDehydrated){u.blockedOn=b.tag===3?b.stateNode.containerInfo:null;return}}}u.blockedOn=null}function v0(u){if(u.blockedOn!==null)return!1;for(var p=u.targetContainers;0<p.length;){var b=F6(u.domEventName,u.eventSystemFlags,p[0],u.nativeEvent);if(b===null){b=u.nativeEvent;var E=new b.constructor(b.type,b);pl=E,b.target.dispatchEvent(E),pl=null}else return p=gf(b),p!==null&&P6(p),u.blockedOn=b,!1;p.shift()}return!0}function c4(u,p,b){v0(u)&&b.delete(p)}function k$(){N6=!1,gl!==null&&v0(gl)&&(gl=null),Ul!==null&&v0(Ul)&&(Ul=null),bl!==null&&v0(bl)&&(bl=null),Jh.forEach(c4),ef.forEach(c4)}function nf(u,p){u.blockedOn===p&&(u.blockedOn=null,N6||(N6=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,k$)))}function rf(u){function p(_){return nf(_,u)}if(0<y0.length){nf(y0[0],u);for(var b=1;b<y0.length;b++){var E=y0[b];E.blockedOn===u&&(E.blockedOn=null)}}for(gl!==null&&nf(gl,u),Ul!==null&&nf(Ul,u),bl!==null&&nf(bl,u),Jh.forEach(p),ef.forEach(p),b=0;b<yl.length;b++)E=yl[b],E.blockedOn===u&&(E.blockedOn=null);for(;0<yl.length&&(b=yl[0],b.blockedOn===null);)l4(b),b.blockedOn===null&&yl.shift()}var qd=S.ReactCurrentBatchConfig,x0=!0;function T$(u,p,b,E){var _=Wt,L=qd.transition;qd.transition=null;try{Wt=1,O6(u,p,b,E)}finally{Wt=_,qd.transition=L}}function M$(u,p,b,E){var _=Wt,L=qd.transition;qd.transition=null;try{Wt=4,O6(u,p,b,E)}finally{Wt=_,qd.transition=L}}function O6(u,p,b,E){if(x0){var _=F6(u,p,b,E);if(_===null)n5(u,p,E,w0,b),o4(u,E);else if(_$(_,u,p,b,E))E.stopPropagation();else if(o4(u,E),p&4&&-1<S$.indexOf(u)){for(;_!==null;){var L=gf(_);if(L!==null&&r4(L),L=F6(u,p,b,E),L===null&&n5(u,p,E,w0,b),L===_)break;_=L}_!==null&&E.stopPropagation()}else n5(u,p,E,null,b)}}var w0=null;function F6(u,p,b,E){if(w0=null,u=ka(E),u=kc(u),u!==null)if(p=Xi(u),p===null)u=null;else if(b=p.tag,b===13){if(u=re(p),u!==null)return u;u=null}else if(b===3){if(p.stateNode.current.memoizedState.isDehydrated)return p.tag===3?p.stateNode.containerInfo:null;u=null}else p!==u&&(u=null);return w0=u,null}function d4(u){switch(u){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(ze()){case en:return 1;case Ht:return 4;case sn:case p0:return 16;case Zh:return 536870912;default:return 16}default:return 16}}var vl=null,$6=null,E0=null;function u4(){if(E0)return E0;var u,p=$6,b=p.length,E,_="value"in vl?vl.value:vl.textContent,L=_.length;for(u=0;u<b&&p[u]===_[u];u++);var O=b-u;for(E=1;E<=O&&p[b-E]===_[L-E];E++);return E0=_.slice(u,1<E?1-E:void 0)}function C0(u){var p=u.keyCode;return"charCode"in u?(u=u.charCode,u===0&&p===13&&(u=13)):u=p,u===10&&(u=13),32<=u||u===13?u:0}function S0(){return!0}function h4(){return!1}function ki(u){function p(b,E,_,L,O){this._reactName=b,this._targetInst=_,this.type=E,this.nativeEvent=L,this.target=O,this.currentTarget=null;for(var Q in u)u.hasOwnProperty(Q)&&(b=u[Q],this[Q]=b?b(L):L[Q]);return this.isDefaultPrevented=(L.defaultPrevented!=null?L.defaultPrevented:L.returnValue===!1)?S0:h4,this.isPropagationStopped=h4,this}return K(p.prototype,{preventDefault:function(){this.defaultPrevented=!0;var b=this.nativeEvent;b&&(b.preventDefault?b.preventDefault():typeof b.returnValue!="unknown"&&(b.returnValue=!1),this.isDefaultPrevented=S0)},stopPropagation:function(){var b=this.nativeEvent;b&&(b.stopPropagation?b.stopPropagation():typeof b.cancelBubble!="unknown"&&(b.cancelBubble=!0),this.isPropagationStopped=S0)},persist:function(){},isPersistent:S0}),p}var Zd={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(u){return u.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},B6=ki(Zd),af=K({},Zd,{view:0,detail:0}),I$=ki(af),z6,H6,sf,_0=K({},af,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:X6,button:0,buttons:0,relatedTarget:function(u){return u.relatedTarget===void 0?u.fromElement===u.srcElement?u.toElement:u.fromElement:u.relatedTarget},movementX:function(u){return"movementX"in u?u.movementX:(u!==sf&&(sf&&u.type==="mousemove"?(z6=u.screenX-sf.screenX,H6=u.screenY-sf.screenY):H6=z6=0,sf=u),z6)},movementY:function(u){return"movementY"in u?u.movementY:H6}}),f4=ki(_0),A$=K({},_0,{dataTransfer:0}),L$=ki(A$),R$=K({},af,{relatedTarget:0}),W6=ki(R$),D$=K({},Zd,{animationName:0,elapsedTime:0,pseudoElement:0}),j$=ki(D$),P$=K({},Zd,{clipboardData:function(u){return"clipboardData"in u?u.clipboardData:window.clipboardData}}),N$=ki(P$),O$=K({},Zd,{data:0}),p4=ki(O$),F$={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},$$={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},B$={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function z$(u){var p=this.nativeEvent;return p.getModifierState?p.getModifierState(u):(u=B$[u])?!!p[u]:!1}function X6(){return z$}var H$=K({},af,{key:function(u){if(u.key){var p=F$[u.key]||u.key;if(p!=="Unidentified")return p}return u.type==="keypress"?(u=C0(u),u===13?"Enter":String.fromCharCode(u)):u.type==="keydown"||u.type==="keyup"?$$[u.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:X6,charCode:function(u){return u.type==="keypress"?C0(u):0},keyCode:function(u){return u.type==="keydown"||u.type==="keyup"?u.keyCode:0},which:function(u){return u.type==="keypress"?C0(u):u.type==="keydown"||u.type==="keyup"?u.keyCode:0}}),W$=ki(H$),X$=K({},_0,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),m4=ki(X$),V$=K({},af,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:X6}),Y$=ki(V$),G$=K({},Zd,{propertyName:0,elapsedTime:0,pseudoElement:0}),q$=ki(G$),Z$=K({},_0,{deltaX:function(u){return"deltaX"in u?u.deltaX:"wheelDeltaX"in u?-u.wheelDeltaX:0},deltaY:function(u){return"deltaY"in u?u.deltaY:"wheelDeltaY"in u?-u.wheelDeltaY:"wheelDelta"in u?-u.wheelDelta:0},deltaZ:0,deltaMode:0}),K$=ki(Z$),Q$=[9,13,27,32],V6=o&&"CompositionEvent"in window,of=null;o&&"documentMode"in document&&(of=document.documentMode);var J$=o&&"TextEvent"in window&&!of,g4=o&&(!V6||of&&8<of&&11>=of),U4=" ",b4=!1;function y4(u,p){switch(u){case"keyup":return Q$.indexOf(p.keyCode)!==-1;case"keydown":return p.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function v4(u){return u=u.detail,typeof u=="object"&&"data"in u?u.data:null}var Kd=!1;function eB(u,p){switch(u){case"compositionend":return v4(p);case"keypress":return p.which!==32?null:(b4=!0,U4);case"textInput":return u=p.data,u===U4&&b4?null:u;default:return null}}function tB(u,p){if(Kd)return u==="compositionend"||!V6&&y4(u,p)?(u=u4(),E0=$6=vl=null,Kd=!1,u):null;switch(u){case"paste":return null;case"keypress":if(!(p.ctrlKey||p.altKey||p.metaKey)||p.ctrlKey&&p.altKey){if(p.char&&1<p.char.length)return p.char;if(p.which)return String.fromCharCode(p.which)}return null;case"compositionend":return g4&&p.locale!=="ko"?null:p.data;default:return null}}var nB={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function x4(u){var p=u&&u.nodeName&&u.nodeName.toLowerCase();return p==="input"?!!nB[u.type]:p==="textarea"}function w4(u,p,b,E){_c(E),p=A0(p,"onChange"),0<p.length&&(b=new B6("onChange","change",null,b,E),u.push({event:b,listeners:p}))}var lf=null,cf=null;function rB(u){$4(u,0)}function k0(u){var p=nu(u);if(ut(p))return u}function iB(u,p){if(u==="change")return p}var E4=!1;if(o){var Y6;if(o){var G6="oninput"in document;if(!G6){var C4=document.createElement("div");C4.setAttribute("oninput","return;"),G6=typeof C4.oninput=="function"}Y6=G6}else Y6=!1;E4=Y6&&(!document.documentMode||9<document.documentMode)}function S4(){lf&&(lf.detachEvent("onpropertychange",_4),cf=lf=null)}function _4(u){if(u.propertyName==="value"&&k0(cf)){var p=[];w4(p,cf,u,ka(u)),ml(rB,p)}}function aB(u,p,b){u==="focusin"?(S4(),lf=p,cf=b,lf.attachEvent("onpropertychange",_4)):u==="focusout"&&S4()}function sB(u){if(u==="selectionchange"||u==="keyup"||u==="keydown")return k0(cf)}function oB(u,p){if(u==="click")return k0(p)}function lB(u,p){if(u==="input"||u==="change")return k0(p)}function cB(u,p){return u===p&&(u!==0||1/u===1/p)||u!==u&&p!==p}var Ia=typeof Object.is=="function"?Object.is:cB;function df(u,p){if(Ia(u,p))return!0;if(typeof u!="object"||u===null||typeof p!="object"||p===null)return!1;var b=Object.keys(u),E=Object.keys(p);if(b.length!==E.length)return!1;for(E=0;E<b.length;E++){var _=b[E];if(!c.call(p,_)||!Ia(u[_],p[_]))return!1}return!0}function k4(u){for(;u&&u.firstChild;)u=u.firstChild;return u}function T4(u,p){var b=k4(u);u=0;for(var E;b;){if(b.nodeType===3){if(E=u+b.textContent.length,u<=p&&E>=p)return{node:b,offset:p-u};u=E}e:{for(;b;){if(b.nextSibling){b=b.nextSibling;break e}b=b.parentNode}b=void 0}b=k4(b)}}function M4(u,p){return u&&p?u===p?!0:u&&u.nodeType===3?!1:p&&p.nodeType===3?M4(u,p.parentNode):"contains"in u?u.contains(p):u.compareDocumentPosition?!!(u.compareDocumentPosition(p)&16):!1:!1}function I4(){for(var u=window,p=zt();p instanceof u.HTMLIFrameElement;){try{var b=typeof p.contentWindow.location.href=="string"}catch{b=!1}if(b)u=p.contentWindow;else break;p=zt(u.document)}return p}function q6(u){var p=u&&u.nodeName&&u.nodeName.toLowerCase();return p&&(p==="input"&&(u.type==="text"||u.type==="search"||u.type==="tel"||u.type==="url"||u.type==="password")||p==="textarea"||u.contentEditable==="true")}function dB(u){var p=I4(),b=u.focusedElem,E=u.selectionRange;if(p!==b&&b&&b.ownerDocument&&M4(b.ownerDocument.documentElement,b)){if(E!==null&&q6(b)){if(p=E.start,u=E.end,u===void 0&&(u=p),"selectionStart"in b)b.selectionStart=p,b.selectionEnd=Math.min(u,b.value.length);else if(u=(p=b.ownerDocument||document)&&p.defaultView||window,u.getSelection){u=u.getSelection();var _=b.textContent.length,L=Math.min(E.start,_);E=E.end===void 0?L:Math.min(E.end,_),!u.extend&&L>E&&(_=E,E=L,L=_),_=T4(b,L);var O=T4(b,E);_&&O&&(u.rangeCount!==1||u.anchorNode!==_.node||u.anchorOffset!==_.offset||u.focusNode!==O.node||u.focusOffset!==O.offset)&&(p=p.createRange(),p.setStart(_.node,_.offset),u.removeAllRanges(),L>E?(u.addRange(p),u.extend(O.node,O.offset)):(p.setEnd(O.node,O.offset),u.addRange(p)))}}for(p=[],u=b;u=u.parentNode;)u.nodeType===1&&p.push({element:u,left:u.scrollLeft,top:u.scrollTop});for(typeof b.focus=="function"&&b.focus(),b=0;b<p.length;b++)u=p[b],u.element.scrollLeft=u.left,u.element.scrollTop=u.top}}var uB=o&&"documentMode"in document&&11>=document.documentMode,Qd=null,Z6=null,uf=null,K6=!1;function A4(u,p,b){var E=b.window===b?b.document:b.nodeType===9?b:b.ownerDocument;K6||Qd==null||Qd!==zt(E)||(E=Qd,"selectionStart"in E&&q6(E)?E={start:E.selectionStart,end:E.selectionEnd}:(E=(E.ownerDocument&&E.ownerDocument.defaultView||window).getSelection(),E={anchorNode:E.anchorNode,anchorOffset:E.anchorOffset,focusNode:E.focusNode,focusOffset:E.focusOffset}),uf&&df(uf,E)||(uf=E,E=A0(Z6,"onSelect"),0<E.length&&(p=new B6("onSelect","select",null,p,b),u.push({event:p,listeners:E}),p.target=Qd)))}function T0(u,p){var b={};return b[u.toLowerCase()]=p.toLowerCase(),b["Webkit"+u]="webkit"+p,b["Moz"+u]="moz"+p,b}var Jd={animationend:T0("Animation","AnimationEnd"),animationiteration:T0("Animation","AnimationIteration"),animationstart:T0("Animation","AnimationStart"),transitionend:T0("Transition","TransitionEnd")},Q6={},L4={};o&&(L4=document.createElement("div").style,"AnimationEvent"in window||(delete Jd.animationend.animation,delete Jd.animationiteration.animation,delete Jd.animationstart.animation),"TransitionEvent"in window||delete Jd.transitionend.transition);function M0(u){if(Q6[u])return Q6[u];if(!Jd[u])return u;var p=Jd[u],b;for(b in p)if(p.hasOwnProperty(b)&&b in L4)return Q6[u]=p[b];return u}var R4=M0("animationend"),D4=M0("animationiteration"),j4=M0("animationstart"),P4=M0("transitionend"),N4=new Map,O4="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function xl(u,p){N4.set(u,p),a(p,[u])}for(var J6=0;J6<O4.length;J6++){var e5=O4[J6],hB=e5.toLowerCase(),fB=e5[0].toUpperCase()+e5.slice(1);xl(hB,"on"+fB)}xl(R4,"onAnimationEnd"),xl(D4,"onAnimationIteration"),xl(j4,"onAnimationStart"),xl("dblclick","onDoubleClick"),xl("focusin","onFocus"),xl("focusout","onBlur"),xl(P4,"onTransitionEnd"),s("onMouseEnter",["mouseout","mouseover"]),s("onMouseLeave",["mouseout","mouseover"]),s("onPointerEnter",["pointerout","pointerover"]),s("onPointerLeave",["pointerout","pointerover"]),a("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),a("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),a("onBeforeInput",["compositionend","keypress","textInput","paste"]),a("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),a("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),a("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var hf="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),pB=new Set("cancel close invalid load scroll toggle".split(" ").concat(hf));function F4(u,p,b){var E=u.type||"unknown-event";u.currentTarget=b,Gd(E,p,void 0,u),u.currentTarget=null}function $4(u,p){p=(p&4)!==0;for(var b=0;b<u.length;b++){var E=u[b],_=E.event;E=E.listeners;e:{var L=void 0;if(p)for(var O=E.length-1;0<=O;O--){var Q=E[O],J=Q.instance,fe=Q.currentTarget;if(Q=Q.listener,J!==L&&_.isPropagationStopped())break e;F4(_,Q,fe),L=J}else for(O=0;O<E.length;O++){if(Q=E[O],J=Q.instance,fe=Q.currentTarget,Q=Q.listener,J!==L&&_.isPropagationStopped())break e;F4(_,Q,fe),L=J}}}if(mo)throw u=go,mo=!1,go=null,u}function on(u,p){var b=p[l5];b===void 0&&(b=p[l5]=new Set);var E=u+"__bubble";b.has(E)||(B4(p,u,2,!1),b.add(E))}function t5(u,p,b){var E=0;p&&(E|=4),B4(b,u,E,p)}var I0="_reactListening"+Math.random().toString(36).slice(2);function ff(u){if(!u[I0]){u[I0]=!0,r.forEach(function(b){b!=="selectionchange"&&(pB.has(b)||t5(b,!1,u),t5(b,!0,u))});var p=u.nodeType===9?u:u.ownerDocument;p===null||p[I0]||(p[I0]=!0,t5("selectionchange",!1,p))}}function B4(u,p,b,E){switch(d4(p)){case 1:var _=T$;break;case 4:_=M$;break;default:_=O6}b=_.bind(null,p,b,u),_=void 0,!Ta||p!=="touchstart"&&p!=="touchmove"&&p!=="wheel"||(_=!0),E?_!==void 0?u.addEventListener(p,b,{capture:!0,passive:_}):u.addEventListener(p,b,!0):_!==void 0?u.addEventListener(p,b,{passive:_}):u.addEventListener(p,b,!1)}function n5(u,p,b,E,_){var L=E;if((p&1)===0&&(p&2)===0&&E!==null)e:for(;;){if(E===null)return;var O=E.tag;if(O===3||O===4){var Q=E.stateNode.containerInfo;if(Q===_||Q.nodeType===8&&Q.parentNode===_)break;if(O===4)for(O=E.return;O!==null;){var J=O.tag;if((J===3||J===4)&&(J=O.stateNode.containerInfo,J===_||J.nodeType===8&&J.parentNode===_))return;O=O.return}for(;Q!==null;){if(O=kc(Q),O===null)return;if(J=O.tag,J===5||J===6){E=L=O;continue e}Q=Q.parentNode}}E=E.return}ml(function(){var fe=L,Ee=ka(b),Se=[];e:{var we=N4.get(u);if(we!==void 0){var Be=B6,Ye=u;switch(u){case"keypress":if(C0(b)===0)break e;case"keydown":case"keyup":Be=W$;break;case"focusin":Ye="focus",Be=W6;break;case"focusout":Ye="blur",Be=W6;break;case"beforeblur":case"afterblur":Be=W6;break;case"click":if(b.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Be=f4;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Be=L$;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Be=Y$;break;case R4:case D4:case j4:Be=j$;break;case P4:Be=q$;break;case"scroll":Be=I$;break;case"wheel":Be=K$;break;case"copy":case"cut":case"paste":Be=N$;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Be=m4}var qe=(p&4)!==0,Dn=!qe&&u==="scroll",oe=qe?we!==null?we+"Capture":null:we;qe=[];for(var te=fe,ce;te!==null;){ce=te;var Ie=ce.stateNode;if(ce.tag===5&&Ie!==null&&(ce=Ie,oe!==null&&(Ie=Hi(te,oe),Ie!=null&&qe.push(pf(te,Ie,ce)))),Dn)break;te=te.return}0<qe.length&&(we=new Be(we,Ye,null,b,Ee),Se.push({event:we,listeners:qe}))}}if((p&7)===0){e:{if(we=u==="mouseover"||u==="pointerover",Be=u==="mouseout"||u==="pointerout",we&&b!==pl&&(Ye=b.relatedTarget||b.fromElement)&&(kc(Ye)||Ye[Uo]))break e;if((Be||we)&&(we=Ee.window===Ee?Ee:(we=Ee.ownerDocument)?we.defaultView||we.parentWindow:window,Be?(Ye=b.relatedTarget||b.toElement,Be=fe,Ye=Ye?kc(Ye):null,Ye!==null&&(Dn=Xi(Ye),Ye!==Dn||Ye.tag!==5&&Ye.tag!==6)&&(Ye=null)):(Be=null,Ye=fe),Be!==Ye)){if(qe=f4,Ie="onMouseLeave",oe="onMouseEnter",te="mouse",(u==="pointerout"||u==="pointerover")&&(qe=m4,Ie="onPointerLeave",oe="onPointerEnter",te="pointer"),Dn=Be==null?we:nu(Be),ce=Ye==null?we:nu(Ye),we=new qe(Ie,te+"leave",Be,b,Ee),we.target=Dn,we.relatedTarget=ce,Ie=null,kc(Ee)===fe&&(qe=new qe(oe,te+"enter",Ye,b,Ee),qe.target=ce,qe.relatedTarget=Dn,Ie=qe),Dn=Ie,Be&&Ye)t:{for(qe=Be,oe=Ye,te=0,ce=qe;ce;ce=eu(ce))te++;for(ce=0,Ie=oe;Ie;Ie=eu(Ie))ce++;for(;0<te-ce;)qe=eu(qe),te--;for(;0<ce-te;)oe=eu(oe),ce--;for(;te--;){if(qe===oe||oe!==null&&qe===oe.alternate)break t;qe=eu(qe),oe=eu(oe)}qe=null}else qe=null;Be!==null&&z4(Se,we,Be,qe,!1),Ye!==null&&Dn!==null&&z4(Se,Dn,Ye,qe,!0)}}e:{if(we=fe?nu(fe):window,Be=we.nodeName&&we.nodeName.toLowerCase(),Be==="select"||Be==="input"&&we.type==="file")var Ze=iB;else if(x4(we))if(E4)Ze=lB;else{Ze=sB;var rt=aB}else(Be=we.nodeName)&&Be.toLowerCase()==="input"&&(we.type==="checkbox"||we.type==="radio")&&(Ze=oB);if(Ze&&(Ze=Ze(u,fe))){w4(Se,Ze,b,Ee);break e}rt&&rt(u,we,fe),u==="focusout"&&(rt=we._wrapperState)&&rt.controlled&&we.type==="number"&&fr(we,"number",we.value)}switch(rt=fe?nu(fe):window,u){case"focusin":(x4(rt)||rt.contentEditable==="true")&&(Qd=rt,Z6=fe,uf=null);break;case"focusout":uf=Z6=Qd=null;break;case"mousedown":K6=!0;break;case"contextmenu":case"mouseup":case"dragend":K6=!1,A4(Se,b,Ee);break;case"selectionchange":if(uB)break;case"keydown":case"keyup":A4(Se,b,Ee)}var it;if(V6)e:{switch(u){case"compositionstart":var ht="onCompositionStart";break e;case"compositionend":ht="onCompositionEnd";break e;case"compositionupdate":ht="onCompositionUpdate";break e}ht=void 0}else Kd?y4(u,b)&&(ht="onCompositionEnd"):u==="keydown"&&b.keyCode===229&&(ht="onCompositionStart");ht&&(g4&&b.locale!=="ko"&&(Kd||ht!=="onCompositionStart"?ht==="onCompositionEnd"&&Kd&&(it=u4()):(vl=Ee,$6="value"in vl?vl.value:vl.textContent,Kd=!0)),rt=A0(fe,ht),0<rt.length&&(ht=new p4(ht,u,null,b,Ee),Se.push({event:ht,listeners:rt}),it?ht.data=it:(it=v4(b),it!==null&&(ht.data=it)))),(it=J$?eB(u,b):tB(u,b))&&(fe=A0(fe,"onBeforeInput"),0<fe.length&&(Ee=new p4("onBeforeInput","beforeinput",null,b,Ee),Se.push({event:Ee,listeners:fe}),Ee.data=it))}$4(Se,p)})}function pf(u,p,b){return{instance:u,listener:p,currentTarget:b}}function A0(u,p){for(var b=p+"Capture",E=[];u!==null;){var _=u,L=_.stateNode;_.tag===5&&L!==null&&(_=L,L=Hi(u,b),L!=null&&E.unshift(pf(u,L,_)),L=Hi(u,p),L!=null&&E.push(pf(u,L,_))),u=u.return}return E}function eu(u){if(u===null)return null;do u=u.return;while(u&&u.tag!==5);return u||null}function z4(u,p,b,E,_){for(var L=p._reactName,O=[];b!==null&&b!==E;){var Q=b,J=Q.alternate,fe=Q.stateNode;if(J!==null&&J===E)break;Q.tag===5&&fe!==null&&(Q=fe,_?(J=Hi(b,L),J!=null&&O.unshift(pf(b,J,Q))):_||(J=Hi(b,L),J!=null&&O.push(pf(b,J,Q)))),b=b.return}O.length!==0&&u.push({event:p,listeners:O})}var mB=/\r\n?/g,gB=/\u0000|\uFFFD/g;function H4(u){return(typeof u=="string"?u:""+u).replace(mB,`
39
- `).replace(gB,"")}function L0(u,p,b){if(p=H4(p),H4(u)!==p&&b)throw Error(n(425))}function R0(){}var r5=null,i5=null;function a5(u,p){return u==="textarea"||u==="noscript"||typeof p.children=="string"||typeof p.children=="number"||typeof p.dangerouslySetInnerHTML=="object"&&p.dangerouslySetInnerHTML!==null&&p.dangerouslySetInnerHTML.__html!=null}var s5=typeof setTimeout=="function"?setTimeout:void 0,UB=typeof clearTimeout=="function"?clearTimeout:void 0,W4=typeof Promise=="function"?Promise:void 0,bB=typeof queueMicrotask=="function"?queueMicrotask:typeof W4<"u"?function(u){return W4.resolve(null).then(u).catch(yB)}:s5;function yB(u){setTimeout(function(){throw u})}function o5(u,p){var b=p,E=0;do{var _=b.nextSibling;if(u.removeChild(b),_&&_.nodeType===8)if(b=_.data,b==="/$"){if(E===0){u.removeChild(_),rf(p);return}E--}else b!=="$"&&b!=="$?"&&b!=="$!"||E++;b=_}while(b);rf(p)}function wl(u){for(;u!=null;u=u.nextSibling){var p=u.nodeType;if(p===1||p===3)break;if(p===8){if(p=u.data,p==="$"||p==="$!"||p==="$?")break;if(p==="/$")return null}}return u}function X4(u){u=u.previousSibling;for(var p=0;u;){if(u.nodeType===8){var b=u.data;if(b==="$"||b==="$!"||b==="$?"){if(p===0)return u;p--}else b==="/$"&&p++}u=u.previousSibling}return null}var tu=Math.random().toString(36).slice(2),ys="__reactFiber$"+tu,mf="__reactProps$"+tu,Uo="__reactContainer$"+tu,l5="__reactEvents$"+tu,vB="__reactListeners$"+tu,xB="__reactHandles$"+tu;function kc(u){var p=u[ys];if(p)return p;for(var b=u.parentNode;b;){if(p=b[Uo]||b[ys]){if(b=p.alternate,p.child!==null||b!==null&&b.child!==null)for(u=X4(u);u!==null;){if(b=u[ys])return b;u=X4(u)}return p}u=b,b=u.parentNode}return null}function gf(u){return u=u[ys]||u[Uo],!u||u.tag!==5&&u.tag!==6&&u.tag!==13&&u.tag!==3?null:u}function nu(u){if(u.tag===5||u.tag===6)return u.stateNode;throw Error(n(33))}function D0(u){return u[mf]||null}var c5=[],ru=-1;function El(u){return{current:u}}function ln(u){0>ru||(u.current=c5[ru],c5[ru]=null,ru--)}function tn(u,p){ru++,c5[ru]=u.current,u.current=p}var Cl={},wr=El(Cl),Jr=El(!1),Tc=Cl;function iu(u,p){var b=u.type.contextTypes;if(!b)return Cl;var E=u.stateNode;if(E&&E.__reactInternalMemoizedUnmaskedChildContext===p)return E.__reactInternalMemoizedMaskedChildContext;var _={},L;for(L in b)_[L]=p[L];return E&&(u=u.stateNode,u.__reactInternalMemoizedUnmaskedChildContext=p,u.__reactInternalMemoizedMaskedChildContext=_),_}function ei(u){return u=u.childContextTypes,u!=null}function j0(){ln(Jr),ln(wr)}function V4(u,p,b){if(wr.current!==Cl)throw Error(n(168));tn(wr,p),tn(Jr,b)}function Y4(u,p,b){var E=u.stateNode;if(p=p.childContextTypes,typeof E.getChildContext!="function")return b;E=E.getChildContext();for(var _ in E)if(!(_ in p))throw Error(n(108,Ce(u)||"Unknown",_));return K({},b,E)}function P0(u){return u=(u=u.stateNode)&&u.__reactInternalMemoizedMergedChildContext||Cl,Tc=wr.current,tn(wr,u),tn(Jr,Jr.current),!0}function G4(u,p,b){var E=u.stateNode;if(!E)throw Error(n(169));b?(u=Y4(u,p,Tc),E.__reactInternalMemoizedMergedChildContext=u,ln(Jr),ln(wr),tn(wr,u)):ln(Jr),tn(Jr,b)}var bo=null,N0=!1,d5=!1;function q4(u){bo===null?bo=[u]:bo.push(u)}function wB(u){N0=!0,q4(u)}function Sl(){if(!d5&&bo!==null){d5=!0;var u=0,p=Wt;try{var b=bo;for(Wt=1;u<b.length;u++){var E=b[u];do E=E(!0);while(E!==null)}bo=null,N0=!1}catch(_){throw bo!==null&&(bo=bo.slice(u+1)),se(en,Sl),_}finally{Wt=p,d5=!1}}return null}var au=[],su=0,O0=null,F0=0,Vi=[],Yi=0,Mc=null,yo=1,vo="";function Ic(u,p){au[su++]=F0,au[su++]=O0,O0=u,F0=p}function Z4(u,p,b){Vi[Yi++]=yo,Vi[Yi++]=vo,Vi[Yi++]=Mc,Mc=u;var E=yo;u=vo;var _=32-Ma(E)-1;E&=~(1<<_),b+=1;var L=32-Ma(p)+_;if(30<L){var O=_-_%5;L=(E&(1<<O)-1).toString(32),E>>=O,_-=O,yo=1<<32-Ma(p)+_|b<<_|E,vo=L+u}else yo=1<<L|b<<_|E,vo=u}function u5(u){u.return!==null&&(Ic(u,1),Z4(u,1,0))}function h5(u){for(;u===O0;)O0=au[--su],au[su]=null,F0=au[--su],au[su]=null;for(;u===Mc;)Mc=Vi[--Yi],Vi[Yi]=null,vo=Vi[--Yi],Vi[Yi]=null,yo=Vi[--Yi],Vi[Yi]=null}var Ti=null,Mi=null,fn=!1,Aa=null;function K4(u,p){var b=Ki(5,null,null,0);b.elementType="DELETED",b.stateNode=p,b.return=u,p=u.deletions,p===null?(u.deletions=[b],u.flags|=16):p.push(b)}function Q4(u,p){switch(u.tag){case 5:var b=u.type;return p=p.nodeType!==1||b.toLowerCase()!==p.nodeName.toLowerCase()?null:p,p!==null?(u.stateNode=p,Ti=u,Mi=wl(p.firstChild),!0):!1;case 6:return p=u.pendingProps===""||p.nodeType!==3?null:p,p!==null?(u.stateNode=p,Ti=u,Mi=null,!0):!1;case 13:return p=p.nodeType!==8?null:p,p!==null?(b=Mc!==null?{id:yo,overflow:vo}:null,u.memoizedState={dehydrated:p,treeContext:b,retryLane:1073741824},b=Ki(18,null,null,0),b.stateNode=p,b.return=u,u.child=b,Ti=u,Mi=null,!0):!1;default:return!1}}function f5(u){return(u.mode&1)!==0&&(u.flags&128)===0}function p5(u){if(fn){var p=Mi;if(p){var b=p;if(!Q4(u,p)){if(f5(u))throw Error(n(418));p=wl(b.nextSibling);var E=Ti;p&&Q4(u,p)?K4(E,b):(u.flags=u.flags&-4097|2,fn=!1,Ti=u)}}else{if(f5(u))throw Error(n(418));u.flags=u.flags&-4097|2,fn=!1,Ti=u}}}function J4(u){for(u=u.return;u!==null&&u.tag!==5&&u.tag!==3&&u.tag!==13;)u=u.return;Ti=u}function $0(u){if(u!==Ti)return!1;if(!fn)return J4(u),fn=!0,!1;var p;if((p=u.tag!==3)&&!(p=u.tag!==5)&&(p=u.type,p=p!=="head"&&p!=="body"&&!a5(u.type,u.memoizedProps)),p&&(p=Mi)){if(f5(u))throw ew(),Error(n(418));for(;p;)K4(u,p),p=wl(p.nextSibling)}if(J4(u),u.tag===13){if(u=u.memoizedState,u=u!==null?u.dehydrated:null,!u)throw Error(n(317));e:{for(u=u.nextSibling,p=0;u;){if(u.nodeType===8){var b=u.data;if(b==="/$"){if(p===0){Mi=wl(u.nextSibling);break e}p--}else b!=="$"&&b!=="$!"&&b!=="$?"||p++}u=u.nextSibling}Mi=null}}else Mi=Ti?wl(u.stateNode.nextSibling):null;return!0}function ew(){for(var u=Mi;u;)u=wl(u.nextSibling)}function ou(){Mi=Ti=null,fn=!1}function m5(u){Aa===null?Aa=[u]:Aa.push(u)}var EB=S.ReactCurrentBatchConfig;function Uf(u,p,b){if(u=b.ref,u!==null&&typeof u!="function"&&typeof u!="object"){if(b._owner){if(b=b._owner,b){if(b.tag!==1)throw Error(n(309));var E=b.stateNode}if(!E)throw Error(n(147,u));var _=E,L=""+u;return p!==null&&p.ref!==null&&typeof p.ref=="function"&&p.ref._stringRef===L?p.ref:(p=function(O){var Q=_.refs;O===null?delete Q[L]:Q[L]=O},p._stringRef=L,p)}if(typeof u!="string")throw Error(n(284));if(!b._owner)throw Error(n(290,u))}return u}function B0(u,p){throw u=Object.prototype.toString.call(p),Error(n(31,u==="[object Object]"?"object with keys {"+Object.keys(p).join(", ")+"}":u))}function tw(u){var p=u._init;return p(u._payload)}function nw(u){function p(oe,te){if(u){var ce=oe.deletions;ce===null?(oe.deletions=[te],oe.flags|=16):ce.push(te)}}function b(oe,te){if(!u)return null;for(;te!==null;)p(oe,te),te=te.sibling;return null}function E(oe,te){for(oe=new Map;te!==null;)te.key!==null?oe.set(te.key,te):oe.set(te.index,te),te=te.sibling;return oe}function _(oe,te){return oe=Rl(oe,te),oe.index=0,oe.sibling=null,oe}function L(oe,te,ce){return oe.index=ce,u?(ce=oe.alternate,ce!==null?(ce=ce.index,ce<te?(oe.flags|=2,te):ce):(oe.flags|=2,te)):(oe.flags|=1048576,te)}function O(oe){return u&&oe.alternate===null&&(oe.flags|=2),oe}function Q(oe,te,ce,Ie){return te===null||te.tag!==6?(te=sb(ce,oe.mode,Ie),te.return=oe,te):(te=_(te,ce),te.return=oe,te)}function J(oe,te,ce,Ie){var Ze=ce.type;return Ze===T?Ee(oe,te,ce.props.children,Ie,ce.key):te!==null&&(te.elementType===Ze||typeof Ze=="object"&&Ze!==null&&Ze.$$typeof===V&&tw(Ze)===te.type)?(Ie=_(te,ce.props),Ie.ref=Uf(oe,te,ce),Ie.return=oe,Ie):(Ie=um(ce.type,ce.key,ce.props,null,oe.mode,Ie),Ie.ref=Uf(oe,te,ce),Ie.return=oe,Ie)}function fe(oe,te,ce,Ie){return te===null||te.tag!==4||te.stateNode.containerInfo!==ce.containerInfo||te.stateNode.implementation!==ce.implementation?(te=ob(ce,oe.mode,Ie),te.return=oe,te):(te=_(te,ce.children||[]),te.return=oe,te)}function Ee(oe,te,ce,Ie,Ze){return te===null||te.tag!==7?(te=Oc(ce,oe.mode,Ie,Ze),te.return=oe,te):(te=_(te,ce),te.return=oe,te)}function Se(oe,te,ce){if(typeof te=="string"&&te!==""||typeof te=="number")return te=sb(""+te,oe.mode,ce),te.return=oe,te;if(typeof te=="object"&&te!==null){switch(te.$$typeof){case k:return ce=um(te.type,te.key,te.props,null,oe.mode,ce),ce.ref=Uf(oe,null,te),ce.return=oe,ce;case M:return te=ob(te,oe.mode,ce),te.return=oe,te;case V:var Ie=te._init;return Se(oe,Ie(te._payload),ce)}if(xi(te)||Y(te))return te=Oc(te,oe.mode,ce,null),te.return=oe,te;B0(oe,te)}return null}function we(oe,te,ce,Ie){var Ze=te!==null?te.key:null;if(typeof ce=="string"&&ce!==""||typeof ce=="number")return Ze!==null?null:Q(oe,te,""+ce,Ie);if(typeof ce=="object"&&ce!==null){switch(ce.$$typeof){case k:return ce.key===Ze?J(oe,te,ce,Ie):null;case M:return ce.key===Ze?fe(oe,te,ce,Ie):null;case V:return Ze=ce._init,we(oe,te,Ze(ce._payload),Ie)}if(xi(ce)||Y(ce))return Ze!==null?null:Ee(oe,te,ce,Ie,null);B0(oe,ce)}return null}function Be(oe,te,ce,Ie,Ze){if(typeof Ie=="string"&&Ie!==""||typeof Ie=="number")return oe=oe.get(ce)||null,Q(te,oe,""+Ie,Ze);if(typeof Ie=="object"&&Ie!==null){switch(Ie.$$typeof){case k:return oe=oe.get(Ie.key===null?ce:Ie.key)||null,J(te,oe,Ie,Ze);case M:return oe=oe.get(Ie.key===null?ce:Ie.key)||null,fe(te,oe,Ie,Ze);case V:var rt=Ie._init;return Be(oe,te,ce,rt(Ie._payload),Ze)}if(xi(Ie)||Y(Ie))return oe=oe.get(ce)||null,Ee(te,oe,Ie,Ze,null);B0(te,Ie)}return null}function Ye(oe,te,ce,Ie){for(var Ze=null,rt=null,it=te,ht=te=0,ar=null;it!==null&&ht<ce.length;ht++){it.index>ht?(ar=it,it=null):ar=it.sibling;var jt=we(oe,it,ce[ht],Ie);if(jt===null){it===null&&(it=ar);break}u&&it&&jt.alternate===null&&p(oe,it),te=L(jt,te,ht),rt===null?Ze=jt:rt.sibling=jt,rt=jt,it=ar}if(ht===ce.length)return b(oe,it),fn&&Ic(oe,ht),Ze;if(it===null){for(;ht<ce.length;ht++)it=Se(oe,ce[ht],Ie),it!==null&&(te=L(it,te,ht),rt===null?Ze=it:rt.sibling=it,rt=it);return fn&&Ic(oe,ht),Ze}for(it=E(oe,it);ht<ce.length;ht++)ar=Be(it,oe,ht,ce[ht],Ie),ar!==null&&(u&&ar.alternate!==null&&it.delete(ar.key===null?ht:ar.key),te=L(ar,te,ht),rt===null?Ze=ar:rt.sibling=ar,rt=ar);return u&&it.forEach(function(Dl){return p(oe,Dl)}),fn&&Ic(oe,ht),Ze}function qe(oe,te,ce,Ie){var Ze=Y(ce);if(typeof Ze!="function")throw Error(n(150));if(ce=Ze.call(ce),ce==null)throw Error(n(151));for(var rt=Ze=null,it=te,ht=te=0,ar=null,jt=ce.next();it!==null&&!jt.done;ht++,jt=ce.next()){it.index>ht?(ar=it,it=null):ar=it.sibling;var Dl=we(oe,it,jt.value,Ie);if(Dl===null){it===null&&(it=ar);break}u&&it&&Dl.alternate===null&&p(oe,it),te=L(Dl,te,ht),rt===null?Ze=Dl:rt.sibling=Dl,rt=Dl,it=ar}if(jt.done)return b(oe,it),fn&&Ic(oe,ht),Ze;if(it===null){for(;!jt.done;ht++,jt=ce.next())jt=Se(oe,jt.value,Ie),jt!==null&&(te=L(jt,te,ht),rt===null?Ze=jt:rt.sibling=jt,rt=jt);return fn&&Ic(oe,ht),Ze}for(it=E(oe,it);!jt.done;ht++,jt=ce.next())jt=Be(it,oe,ht,jt.value,Ie),jt!==null&&(u&&jt.alternate!==null&&it.delete(jt.key===null?ht:jt.key),te=L(jt,te,ht),rt===null?Ze=jt:rt.sibling=jt,rt=jt);return u&&it.forEach(function(nz){return p(oe,nz)}),fn&&Ic(oe,ht),Ze}function Dn(oe,te,ce,Ie){if(typeof ce=="object"&&ce!==null&&ce.type===T&&ce.key===null&&(ce=ce.props.children),typeof ce=="object"&&ce!==null){switch(ce.$$typeof){case k:e:{for(var Ze=ce.key,rt=te;rt!==null;){if(rt.key===Ze){if(Ze=ce.type,Ze===T){if(rt.tag===7){b(oe,rt.sibling),te=_(rt,ce.props.children),te.return=oe,oe=te;break e}}else if(rt.elementType===Ze||typeof Ze=="object"&&Ze!==null&&Ze.$$typeof===V&&tw(Ze)===rt.type){b(oe,rt.sibling),te=_(rt,ce.props),te.ref=Uf(oe,rt,ce),te.return=oe,oe=te;break e}b(oe,rt);break}else p(oe,rt);rt=rt.sibling}ce.type===T?(te=Oc(ce.props.children,oe.mode,Ie,ce.key),te.return=oe,oe=te):(Ie=um(ce.type,ce.key,ce.props,null,oe.mode,Ie),Ie.ref=Uf(oe,te,ce),Ie.return=oe,oe=Ie)}return O(oe);case M:e:{for(rt=ce.key;te!==null;){if(te.key===rt)if(te.tag===4&&te.stateNode.containerInfo===ce.containerInfo&&te.stateNode.implementation===ce.implementation){b(oe,te.sibling),te=_(te,ce.children||[]),te.return=oe,oe=te;break e}else{b(oe,te);break}else p(oe,te);te=te.sibling}te=ob(ce,oe.mode,Ie),te.return=oe,oe=te}return O(oe);case V:return rt=ce._init,Dn(oe,te,rt(ce._payload),Ie)}if(xi(ce))return Ye(oe,te,ce,Ie);if(Y(ce))return qe(oe,te,ce,Ie);B0(oe,ce)}return typeof ce=="string"&&ce!==""||typeof ce=="number"?(ce=""+ce,te!==null&&te.tag===6?(b(oe,te.sibling),te=_(te,ce),te.return=oe,oe=te):(b(oe,te),te=sb(ce,oe.mode,Ie),te.return=oe,oe=te),O(oe)):b(oe,te)}return Dn}var lu=nw(!0),rw=nw(!1),z0=El(null),H0=null,cu=null,g5=null;function U5(){g5=cu=H0=null}function b5(u){var p=z0.current;ln(z0),u._currentValue=p}function y5(u,p,b){for(;u!==null;){var E=u.alternate;if((u.childLanes&p)!==p?(u.childLanes|=p,E!==null&&(E.childLanes|=p)):E!==null&&(E.childLanes&p)!==p&&(E.childLanes|=p),u===b)break;u=u.return}}function du(u,p){H0=u,g5=cu=null,u=u.dependencies,u!==null&&u.firstContext!==null&&((u.lanes&p)!==0&&(ti=!0),u.firstContext=null)}function Gi(u){var p=u._currentValue;if(g5!==u)if(u={context:u,memoizedValue:p,next:null},cu===null){if(H0===null)throw Error(n(308));cu=u,H0.dependencies={lanes:0,firstContext:u}}else cu=cu.next=u;return p}var Ac=null;function v5(u){Ac===null?Ac=[u]:Ac.push(u)}function iw(u,p,b,E){var _=p.interleaved;return _===null?(b.next=b,v5(p)):(b.next=_.next,_.next=b),p.interleaved=b,xo(u,E)}function xo(u,p){u.lanes|=p;var b=u.alternate;for(b!==null&&(b.lanes|=p),b=u,u=u.return;u!==null;)u.childLanes|=p,b=u.alternate,b!==null&&(b.childLanes|=p),b=u,u=u.return;return b.tag===3?b.stateNode:null}var _l=!1;function x5(u){u.updateQueue={baseState:u.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function aw(u,p){u=u.updateQueue,p.updateQueue===u&&(p.updateQueue={baseState:u.baseState,firstBaseUpdate:u.firstBaseUpdate,lastBaseUpdate:u.lastBaseUpdate,shared:u.shared,effects:u.effects})}function wo(u,p){return{eventTime:u,lane:p,tag:0,payload:null,callback:null,next:null}}function kl(u,p,b){var E=u.updateQueue;if(E===null)return null;if(E=E.shared,(Mt&2)!==0){var _=E.pending;return _===null?p.next=p:(p.next=_.next,_.next=p),E.pending=p,xo(u,b)}return _=E.interleaved,_===null?(p.next=p,v5(E)):(p.next=_.next,_.next=p),E.interleaved=p,xo(u,b)}function W0(u,p,b){if(p=p.updateQueue,p!==null&&(p=p.shared,(b&4194240)!==0)){var E=p.lanes;E&=u.pendingLanes,b|=E,p.lanes=b,j6(u,b)}}function sw(u,p){var b=u.updateQueue,E=u.alternate;if(E!==null&&(E=E.updateQueue,b===E)){var _=null,L=null;if(b=b.firstBaseUpdate,b!==null){do{var O={eventTime:b.eventTime,lane:b.lane,tag:b.tag,payload:b.payload,callback:b.callback,next:null};L===null?_=L=O:L=L.next=O,b=b.next}while(b!==null);L===null?_=L=p:L=L.next=p}else _=L=p;b={baseState:E.baseState,firstBaseUpdate:_,lastBaseUpdate:L,shared:E.shared,effects:E.effects},u.updateQueue=b;return}u=b.lastBaseUpdate,u===null?b.firstBaseUpdate=p:u.next=p,b.lastBaseUpdate=p}function X0(u,p,b,E){var _=u.updateQueue;_l=!1;var L=_.firstBaseUpdate,O=_.lastBaseUpdate,Q=_.shared.pending;if(Q!==null){_.shared.pending=null;var J=Q,fe=J.next;J.next=null,O===null?L=fe:O.next=fe,O=J;var Ee=u.alternate;Ee!==null&&(Ee=Ee.updateQueue,Q=Ee.lastBaseUpdate,Q!==O&&(Q===null?Ee.firstBaseUpdate=fe:Q.next=fe,Ee.lastBaseUpdate=J))}if(L!==null){var Se=_.baseState;O=0,Ee=fe=J=null,Q=L;do{var we=Q.lane,Be=Q.eventTime;if((E&we)===we){Ee!==null&&(Ee=Ee.next={eventTime:Be,lane:0,tag:Q.tag,payload:Q.payload,callback:Q.callback,next:null});e:{var Ye=u,qe=Q;switch(we=p,Be=b,qe.tag){case 1:if(Ye=qe.payload,typeof Ye=="function"){Se=Ye.call(Be,Se,we);break e}Se=Ye;break e;case 3:Ye.flags=Ye.flags&-65537|128;case 0:if(Ye=qe.payload,we=typeof Ye=="function"?Ye.call(Be,Se,we):Ye,we==null)break e;Se=K({},Se,we);break e;case 2:_l=!0}}Q.callback!==null&&Q.lane!==0&&(u.flags|=64,we=_.effects,we===null?_.effects=[Q]:we.push(Q))}else Be={eventTime:Be,lane:we,tag:Q.tag,payload:Q.payload,callback:Q.callback,next:null},Ee===null?(fe=Ee=Be,J=Se):Ee=Ee.next=Be,O|=we;if(Q=Q.next,Q===null){if(Q=_.shared.pending,Q===null)break;we=Q,Q=we.next,we.next=null,_.lastBaseUpdate=we,_.shared.pending=null}}while(!0);if(Ee===null&&(J=Se),_.baseState=J,_.firstBaseUpdate=fe,_.lastBaseUpdate=Ee,p=_.shared.interleaved,p!==null){_=p;do O|=_.lane,_=_.next;while(_!==p)}else L===null&&(_.shared.lanes=0);Dc|=O,u.lanes=O,u.memoizedState=Se}}function ow(u,p,b){if(u=p.effects,p.effects=null,u!==null)for(p=0;p<u.length;p++){var E=u[p],_=E.callback;if(_!==null){if(E.callback=null,E=b,typeof _!="function")throw Error(n(191,_));_.call(E)}}}var bf={},vs=El(bf),yf=El(bf),vf=El(bf);function Lc(u){if(u===bf)throw Error(n(174));return u}function w5(u,p){switch(tn(vf,p),tn(yf,u),tn(vs,bf),u=p.nodeType,u){case 9:case 11:p=(p=p.documentElement)?p.namespaceURI:co(null,"");break;default:u=u===8?p.parentNode:p,p=u.namespaceURI||null,u=u.tagName,p=co(p,u)}ln(vs),tn(vs,p)}function uu(){ln(vs),ln(yf),ln(vf)}function lw(u){Lc(vf.current);var p=Lc(vs.current),b=co(p,u.type);p!==b&&(tn(yf,u),tn(vs,b))}function E5(u){yf.current===u&&(ln(vs),ln(yf))}var vn=El(0);function V0(u){for(var p=u;p!==null;){if(p.tag===13){var b=p.memoizedState;if(b!==null&&(b=b.dehydrated,b===null||b.data==="$?"||b.data==="$!"))return p}else if(p.tag===19&&p.memoizedProps.revealOrder!==void 0){if((p.flags&128)!==0)return p}else if(p.child!==null){p.child.return=p,p=p.child;continue}if(p===u)break;for(;p.sibling===null;){if(p.return===null||p.return===u)return null;p=p.return}p.sibling.return=p.return,p=p.sibling}return null}var C5=[];function S5(){for(var u=0;u<C5.length;u++)C5[u]._workInProgressVersionPrimary=null;C5.length=0}var Y0=S.ReactCurrentDispatcher,_5=S.ReactCurrentBatchConfig,Rc=0,xn=null,Gn=null,rr=null,G0=!1,xf=!1,wf=0,CB=0;function Er(){throw Error(n(321))}function k5(u,p){if(p===null)return!1;for(var b=0;b<p.length&&b<u.length;b++)if(!Ia(u[b],p[b]))return!1;return!0}function T5(u,p,b,E,_,L){if(Rc=L,xn=p,p.memoizedState=null,p.updateQueue=null,p.lanes=0,Y0.current=u===null||u.memoizedState===null?TB:MB,u=b(E,_),xf){L=0;do{if(xf=!1,wf=0,25<=L)throw Error(n(301));L+=1,rr=Gn=null,p.updateQueue=null,Y0.current=IB,u=b(E,_)}while(xf)}if(Y0.current=K0,p=Gn!==null&&Gn.next!==null,Rc=0,rr=Gn=xn=null,G0=!1,p)throw Error(n(300));return u}function M5(){var u=wf!==0;return wf=0,u}function xs(){var u={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return rr===null?xn.memoizedState=rr=u:rr=rr.next=u,rr}function qi(){if(Gn===null){var u=xn.alternate;u=u!==null?u.memoizedState:null}else u=Gn.next;var p=rr===null?xn.memoizedState:rr.next;if(p!==null)rr=p,Gn=u;else{if(u===null)throw Error(n(310));Gn=u,u={memoizedState:Gn.memoizedState,baseState:Gn.baseState,baseQueue:Gn.baseQueue,queue:Gn.queue,next:null},rr===null?xn.memoizedState=rr=u:rr=rr.next=u}return rr}function Ef(u,p){return typeof p=="function"?p(u):p}function I5(u){var p=qi(),b=p.queue;if(b===null)throw Error(n(311));b.lastRenderedReducer=u;var E=Gn,_=E.baseQueue,L=b.pending;if(L!==null){if(_!==null){var O=_.next;_.next=L.next,L.next=O}E.baseQueue=_=L,b.pending=null}if(_!==null){L=_.next,E=E.baseState;var Q=O=null,J=null,fe=L;do{var Ee=fe.lane;if((Rc&Ee)===Ee)J!==null&&(J=J.next={lane:0,action:fe.action,hasEagerState:fe.hasEagerState,eagerState:fe.eagerState,next:null}),E=fe.hasEagerState?fe.eagerState:u(E,fe.action);else{var Se={lane:Ee,action:fe.action,hasEagerState:fe.hasEagerState,eagerState:fe.eagerState,next:null};J===null?(Q=J=Se,O=E):J=J.next=Se,xn.lanes|=Ee,Dc|=Ee}fe=fe.next}while(fe!==null&&fe!==L);J===null?O=E:J.next=Q,Ia(E,p.memoizedState)||(ti=!0),p.memoizedState=E,p.baseState=O,p.baseQueue=J,b.lastRenderedState=E}if(u=b.interleaved,u!==null){_=u;do L=_.lane,xn.lanes|=L,Dc|=L,_=_.next;while(_!==u)}else _===null&&(b.lanes=0);return[p.memoizedState,b.dispatch]}function A5(u){var p=qi(),b=p.queue;if(b===null)throw Error(n(311));b.lastRenderedReducer=u;var E=b.dispatch,_=b.pending,L=p.memoizedState;if(_!==null){b.pending=null;var O=_=_.next;do L=u(L,O.action),O=O.next;while(O!==_);Ia(L,p.memoizedState)||(ti=!0),p.memoizedState=L,p.baseQueue===null&&(p.baseState=L),b.lastRenderedState=L}return[L,E]}function cw(){}function dw(u,p){var b=xn,E=qi(),_=p(),L=!Ia(E.memoizedState,_);if(L&&(E.memoizedState=_,ti=!0),E=E.queue,L5(fw.bind(null,b,E,u),[u]),E.getSnapshot!==p||L||rr!==null&&rr.memoizedState.tag&1){if(b.flags|=2048,Cf(9,hw.bind(null,b,E,_,p),void 0,null),ir===null)throw Error(n(349));(Rc&30)!==0||uw(b,p,_)}return _}function uw(u,p,b){u.flags|=16384,u={getSnapshot:p,value:b},p=xn.updateQueue,p===null?(p={lastEffect:null,stores:null},xn.updateQueue=p,p.stores=[u]):(b=p.stores,b===null?p.stores=[u]:b.push(u))}function hw(u,p,b,E){p.value=b,p.getSnapshot=E,pw(p)&&mw(u)}function fw(u,p,b){return b(function(){pw(p)&&mw(u)})}function pw(u){var p=u.getSnapshot;u=u.value;try{var b=p();return!Ia(u,b)}catch{return!0}}function mw(u){var p=xo(u,1);p!==null&&ja(p,u,1,-1)}function gw(u){var p=xs();return typeof u=="function"&&(u=u()),p.memoizedState=p.baseState=u,u={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Ef,lastRenderedState:u},p.queue=u,u=u.dispatch=kB.bind(null,xn,u),[p.memoizedState,u]}function Cf(u,p,b,E){return u={tag:u,create:p,destroy:b,deps:E,next:null},p=xn.updateQueue,p===null?(p={lastEffect:null,stores:null},xn.updateQueue=p,p.lastEffect=u.next=u):(b=p.lastEffect,b===null?p.lastEffect=u.next=u:(E=b.next,b.next=u,u.next=E,p.lastEffect=u)),u}function Uw(){return qi().memoizedState}function q0(u,p,b,E){var _=xs();xn.flags|=u,_.memoizedState=Cf(1|p,b,void 0,E===void 0?null:E)}function Z0(u,p,b,E){var _=qi();E=E===void 0?null:E;var L=void 0;if(Gn!==null){var O=Gn.memoizedState;if(L=O.destroy,E!==null&&k5(E,O.deps)){_.memoizedState=Cf(p,b,L,E);return}}xn.flags|=u,_.memoizedState=Cf(1|p,b,L,E)}function bw(u,p){return q0(8390656,8,u,p)}function L5(u,p){return Z0(2048,8,u,p)}function yw(u,p){return Z0(4,2,u,p)}function vw(u,p){return Z0(4,4,u,p)}function xw(u,p){if(typeof p=="function")return u=u(),p(u),function(){p(null)};if(p!=null)return u=u(),p.current=u,function(){p.current=null}}function ww(u,p,b){return b=b!=null?b.concat([u]):null,Z0(4,4,xw.bind(null,p,u),b)}function R5(){}function Ew(u,p){var b=qi();p=p===void 0?null:p;var E=b.memoizedState;return E!==null&&p!==null&&k5(p,E[1])?E[0]:(b.memoizedState=[u,p],u)}function Cw(u,p){var b=qi();p=p===void 0?null:p;var E=b.memoizedState;return E!==null&&p!==null&&k5(p,E[1])?E[0]:(u=u(),b.memoizedState=[u,p],u)}function Sw(u,p,b){return(Rc&21)===0?(u.baseState&&(u.baseState=!1,ti=!0),u.memoizedState=b):(Ia(b,p)||(b=t4(),xn.lanes|=b,Dc|=b,u.baseState=!0),p)}function SB(u,p){var b=Wt;Wt=b!==0&&4>b?b:4,u(!0);var E=_5.transition;_5.transition={};try{u(!1),p()}finally{Wt=b,_5.transition=E}}function _w(){return qi().memoizedState}function _B(u,p,b){var E=Al(u);if(b={lane:E,action:b,hasEagerState:!1,eagerState:null,next:null},kw(u))Tw(p,b);else if(b=iw(u,p,b,E),b!==null){var _=$r();ja(b,u,E,_),Mw(b,p,E)}}function kB(u,p,b){var E=Al(u),_={lane:E,action:b,hasEagerState:!1,eagerState:null,next:null};if(kw(u))Tw(p,_);else{var L=u.alternate;if(u.lanes===0&&(L===null||L.lanes===0)&&(L=p.lastRenderedReducer,L!==null))try{var O=p.lastRenderedState,Q=L(O,b);if(_.hasEagerState=!0,_.eagerState=Q,Ia(Q,O)){var J=p.interleaved;J===null?(_.next=_,v5(p)):(_.next=J.next,J.next=_),p.interleaved=_;return}}catch{}finally{}b=iw(u,p,_,E),b!==null&&(_=$r(),ja(b,u,E,_),Mw(b,p,E))}}function kw(u){var p=u.alternate;return u===xn||p!==null&&p===xn}function Tw(u,p){xf=G0=!0;var b=u.pending;b===null?p.next=p:(p.next=b.next,b.next=p),u.pending=p}function Mw(u,p,b){if((b&4194240)!==0){var E=p.lanes;E&=u.pendingLanes,b|=E,p.lanes=b,j6(u,b)}}var K0={readContext:Gi,useCallback:Er,useContext:Er,useEffect:Er,useImperativeHandle:Er,useInsertionEffect:Er,useLayoutEffect:Er,useMemo:Er,useReducer:Er,useRef:Er,useState:Er,useDebugValue:Er,useDeferredValue:Er,useTransition:Er,useMutableSource:Er,useSyncExternalStore:Er,useId:Er,unstable_isNewReconciler:!1},TB={readContext:Gi,useCallback:function(u,p){return xs().memoizedState=[u,p===void 0?null:p],u},useContext:Gi,useEffect:bw,useImperativeHandle:function(u,p,b){return b=b!=null?b.concat([u]):null,q0(4194308,4,xw.bind(null,p,u),b)},useLayoutEffect:function(u,p){return q0(4194308,4,u,p)},useInsertionEffect:function(u,p){return q0(4,2,u,p)},useMemo:function(u,p){var b=xs();return p=p===void 0?null:p,u=u(),b.memoizedState=[u,p],u},useReducer:function(u,p,b){var E=xs();return p=b!==void 0?b(p):p,E.memoizedState=E.baseState=p,u={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:u,lastRenderedState:p},E.queue=u,u=u.dispatch=_B.bind(null,xn,u),[E.memoizedState,u]},useRef:function(u){var p=xs();return u={current:u},p.memoizedState=u},useState:gw,useDebugValue:R5,useDeferredValue:function(u){return xs().memoizedState=u},useTransition:function(){var u=gw(!1),p=u[0];return u=SB.bind(null,u[1]),xs().memoizedState=u,[p,u]},useMutableSource:function(){},useSyncExternalStore:function(u,p,b){var E=xn,_=xs();if(fn){if(b===void 0)throw Error(n(407));b=b()}else{if(b=p(),ir===null)throw Error(n(349));(Rc&30)!==0||uw(E,p,b)}_.memoizedState=b;var L={value:b,getSnapshot:p};return _.queue=L,bw(fw.bind(null,E,L,u),[u]),E.flags|=2048,Cf(9,hw.bind(null,E,L,b,p),void 0,null),b},useId:function(){var u=xs(),p=ir.identifierPrefix;if(fn){var b=vo,E=yo;b=(E&~(1<<32-Ma(E)-1)).toString(32)+b,p=":"+p+"R"+b,b=wf++,0<b&&(p+="H"+b.toString(32)),p+=":"}else b=CB++,p=":"+p+"r"+b.toString(32)+":";return u.memoizedState=p},unstable_isNewReconciler:!1},MB={readContext:Gi,useCallback:Ew,useContext:Gi,useEffect:L5,useImperativeHandle:ww,useInsertionEffect:yw,useLayoutEffect:vw,useMemo:Cw,useReducer:I5,useRef:Uw,useState:function(){return I5(Ef)},useDebugValue:R5,useDeferredValue:function(u){var p=qi();return Sw(p,Gn.memoizedState,u)},useTransition:function(){var u=I5(Ef)[0],p=qi().memoizedState;return[u,p]},useMutableSource:cw,useSyncExternalStore:dw,useId:_w,unstable_isNewReconciler:!1},IB={readContext:Gi,useCallback:Ew,useContext:Gi,useEffect:L5,useImperativeHandle:ww,useInsertionEffect:yw,useLayoutEffect:vw,useMemo:Cw,useReducer:A5,useRef:Uw,useState:function(){return A5(Ef)},useDebugValue:R5,useDeferredValue:function(u){var p=qi();return Gn===null?p.memoizedState=u:Sw(p,Gn.memoizedState,u)},useTransition:function(){var u=A5(Ef)[0],p=qi().memoizedState;return[u,p]},useMutableSource:cw,useSyncExternalStore:dw,useId:_w,unstable_isNewReconciler:!1};function La(u,p){if(u&&u.defaultProps){p=K({},p),u=u.defaultProps;for(var b in u)p[b]===void 0&&(p[b]=u[b]);return p}return p}function D5(u,p,b,E){p=u.memoizedState,b=b(E,p),b=b==null?p:K({},p,b),u.memoizedState=b,u.lanes===0&&(u.updateQueue.baseState=b)}var Q0={isMounted:function(u){return(u=u._reactInternals)?Xi(u)===u:!1},enqueueSetState:function(u,p,b){u=u._reactInternals;var E=$r(),_=Al(u),L=wo(E,_);L.payload=p,b!=null&&(L.callback=b),p=kl(u,L,_),p!==null&&(ja(p,u,_,E),W0(p,u,_))},enqueueReplaceState:function(u,p,b){u=u._reactInternals;var E=$r(),_=Al(u),L=wo(E,_);L.tag=1,L.payload=p,b!=null&&(L.callback=b),p=kl(u,L,_),p!==null&&(ja(p,u,_,E),W0(p,u,_))},enqueueForceUpdate:function(u,p){u=u._reactInternals;var b=$r(),E=Al(u),_=wo(b,E);_.tag=2,p!=null&&(_.callback=p),p=kl(u,_,E),p!==null&&(ja(p,u,E,b),W0(p,u,E))}};function Iw(u,p,b,E,_,L,O){return u=u.stateNode,typeof u.shouldComponentUpdate=="function"?u.shouldComponentUpdate(E,L,O):p.prototype&&p.prototype.isPureReactComponent?!df(b,E)||!df(_,L):!0}function Aw(u,p,b){var E=!1,_=Cl,L=p.contextType;return typeof L=="object"&&L!==null?L=Gi(L):(_=ei(p)?Tc:wr.current,E=p.contextTypes,L=(E=E!=null)?iu(u,_):Cl),p=new p(b,L),u.memoizedState=p.state!==null&&p.state!==void 0?p.state:null,p.updater=Q0,u.stateNode=p,p._reactInternals=u,E&&(u=u.stateNode,u.__reactInternalMemoizedUnmaskedChildContext=_,u.__reactInternalMemoizedMaskedChildContext=L),p}function Lw(u,p,b,E){u=p.state,typeof p.componentWillReceiveProps=="function"&&p.componentWillReceiveProps(b,E),typeof p.UNSAFE_componentWillReceiveProps=="function"&&p.UNSAFE_componentWillReceiveProps(b,E),p.state!==u&&Q0.enqueueReplaceState(p,p.state,null)}function j5(u,p,b,E){var _=u.stateNode;_.props=b,_.state=u.memoizedState,_.refs={},x5(u);var L=p.contextType;typeof L=="object"&&L!==null?_.context=Gi(L):(L=ei(p)?Tc:wr.current,_.context=iu(u,L)),_.state=u.memoizedState,L=p.getDerivedStateFromProps,typeof L=="function"&&(D5(u,p,L,b),_.state=u.memoizedState),typeof p.getDerivedStateFromProps=="function"||typeof _.getSnapshotBeforeUpdate=="function"||typeof _.UNSAFE_componentWillMount!="function"&&typeof _.componentWillMount!="function"||(p=_.state,typeof _.componentWillMount=="function"&&_.componentWillMount(),typeof _.UNSAFE_componentWillMount=="function"&&_.UNSAFE_componentWillMount(),p!==_.state&&Q0.enqueueReplaceState(_,_.state,null),X0(u,b,_,E),_.state=u.memoizedState),typeof _.componentDidMount=="function"&&(u.flags|=4194308)}function hu(u,p){try{var b="",E=p;do b+=ve(E),E=E.return;while(E);var _=b}catch(L){_=`
40
- Error generating stack: `+L.message+`
41
- `+L.stack}return{value:u,source:p,stack:_,digest:null}}function P5(u,p,b){return{value:u,source:null,stack:b??null,digest:p??null}}function N5(u,p){try{console.error(p.value)}catch(b){setTimeout(function(){throw b})}}var AB=typeof WeakMap=="function"?WeakMap:Map;function Rw(u,p,b){b=wo(-1,b),b.tag=3,b.payload={element:null};var E=p.value;return b.callback=function(){am||(am=!0,Q5=E),N5(u,p)},b}function Dw(u,p,b){b=wo(-1,b),b.tag=3;var E=u.type.getDerivedStateFromError;if(typeof E=="function"){var _=p.value;b.payload=function(){return E(_)},b.callback=function(){N5(u,p)}}var L=u.stateNode;return L!==null&&typeof L.componentDidCatch=="function"&&(b.callback=function(){N5(u,p),typeof E!="function"&&(Ml===null?Ml=new Set([this]):Ml.add(this));var O=p.stack;this.componentDidCatch(p.value,{componentStack:O!==null?O:""})}),b}function jw(u,p,b){var E=u.pingCache;if(E===null){E=u.pingCache=new AB;var _=new Set;E.set(p,_)}else _=E.get(p),_===void 0&&(_=new Set,E.set(p,_));_.has(b)||(_.add(b),u=XB.bind(null,u,p,b),p.then(u,u))}function Pw(u){do{var p;if((p=u.tag===13)&&(p=u.memoizedState,p=p!==null?p.dehydrated!==null:!0),p)return u;u=u.return}while(u!==null);return null}function Nw(u,p,b,E,_){return(u.mode&1)===0?(u===p?u.flags|=65536:(u.flags|=128,b.flags|=131072,b.flags&=-52805,b.tag===1&&(b.alternate===null?b.tag=17:(p=wo(-1,1),p.tag=2,kl(b,p,1))),b.lanes|=1),u):(u.flags|=65536,u.lanes=_,u)}var LB=S.ReactCurrentOwner,ti=!1;function Fr(u,p,b,E){p.child=u===null?rw(p,null,b,E):lu(p,u.child,b,E)}function Ow(u,p,b,E,_){b=b.render;var L=p.ref;return du(p,_),E=T5(u,p,b,E,L,_),b=M5(),u!==null&&!ti?(p.updateQueue=u.updateQueue,p.flags&=-2053,u.lanes&=~_,Eo(u,p,_)):(fn&&b&&u5(p),p.flags|=1,Fr(u,p,E,_),p.child)}function Fw(u,p,b,E,_){if(u===null){var L=b.type;return typeof L=="function"&&!ab(L)&&L.defaultProps===void 0&&b.compare===null&&b.defaultProps===void 0?(p.tag=15,p.type=L,$w(u,p,L,E,_)):(u=um(b.type,null,E,p,p.mode,_),u.ref=p.ref,u.return=p,p.child=u)}if(L=u.child,(u.lanes&_)===0){var O=L.memoizedProps;if(b=b.compare,b=b!==null?b:df,b(O,E)&&u.ref===p.ref)return Eo(u,p,_)}return p.flags|=1,u=Rl(L,E),u.ref=p.ref,u.return=p,p.child=u}function $w(u,p,b,E,_){if(u!==null){var L=u.memoizedProps;if(df(L,E)&&u.ref===p.ref)if(ti=!1,p.pendingProps=E=L,(u.lanes&_)!==0)(u.flags&131072)!==0&&(ti=!0);else return p.lanes=u.lanes,Eo(u,p,_)}return O5(u,p,b,E,_)}function Bw(u,p,b){var E=p.pendingProps,_=E.children,L=u!==null?u.memoizedState:null;if(E.mode==="hidden")if((p.mode&1)===0)p.memoizedState={baseLanes:0,cachePool:null,transitions:null},tn(pu,Ii),Ii|=b;else{if((b&1073741824)===0)return u=L!==null?L.baseLanes|b:b,p.lanes=p.childLanes=1073741824,p.memoizedState={baseLanes:u,cachePool:null,transitions:null},p.updateQueue=null,tn(pu,Ii),Ii|=u,null;p.memoizedState={baseLanes:0,cachePool:null,transitions:null},E=L!==null?L.baseLanes:b,tn(pu,Ii),Ii|=E}else L!==null?(E=L.baseLanes|b,p.memoizedState=null):E=b,tn(pu,Ii),Ii|=E;return Fr(u,p,_,b),p.child}function zw(u,p){var b=p.ref;(u===null&&b!==null||u!==null&&u.ref!==b)&&(p.flags|=512,p.flags|=2097152)}function O5(u,p,b,E,_){var L=ei(b)?Tc:wr.current;return L=iu(p,L),du(p,_),b=T5(u,p,b,E,L,_),E=M5(),u!==null&&!ti?(p.updateQueue=u.updateQueue,p.flags&=-2053,u.lanes&=~_,Eo(u,p,_)):(fn&&E&&u5(p),p.flags|=1,Fr(u,p,b,_),p.child)}function Hw(u,p,b,E,_){if(ei(b)){var L=!0;P0(p)}else L=!1;if(du(p,_),p.stateNode===null)em(u,p),Aw(p,b,E),j5(p,b,E,_),E=!0;else if(u===null){var O=p.stateNode,Q=p.memoizedProps;O.props=Q;var J=O.context,fe=b.contextType;typeof fe=="object"&&fe!==null?fe=Gi(fe):(fe=ei(b)?Tc:wr.current,fe=iu(p,fe));var Ee=b.getDerivedStateFromProps,Se=typeof Ee=="function"||typeof O.getSnapshotBeforeUpdate=="function";Se||typeof O.UNSAFE_componentWillReceiveProps!="function"&&typeof O.componentWillReceiveProps!="function"||(Q!==E||J!==fe)&&Lw(p,O,E,fe),_l=!1;var we=p.memoizedState;O.state=we,X0(p,E,O,_),J=p.memoizedState,Q!==E||we!==J||Jr.current||_l?(typeof Ee=="function"&&(D5(p,b,Ee,E),J=p.memoizedState),(Q=_l||Iw(p,b,Q,E,we,J,fe))?(Se||typeof O.UNSAFE_componentWillMount!="function"&&typeof O.componentWillMount!="function"||(typeof O.componentWillMount=="function"&&O.componentWillMount(),typeof O.UNSAFE_componentWillMount=="function"&&O.UNSAFE_componentWillMount()),typeof O.componentDidMount=="function"&&(p.flags|=4194308)):(typeof O.componentDidMount=="function"&&(p.flags|=4194308),p.memoizedProps=E,p.memoizedState=J),O.props=E,O.state=J,O.context=fe,E=Q):(typeof O.componentDidMount=="function"&&(p.flags|=4194308),E=!1)}else{O=p.stateNode,aw(u,p),Q=p.memoizedProps,fe=p.type===p.elementType?Q:La(p.type,Q),O.props=fe,Se=p.pendingProps,we=O.context,J=b.contextType,typeof J=="object"&&J!==null?J=Gi(J):(J=ei(b)?Tc:wr.current,J=iu(p,J));var Be=b.getDerivedStateFromProps;(Ee=typeof Be=="function"||typeof O.getSnapshotBeforeUpdate=="function")||typeof O.UNSAFE_componentWillReceiveProps!="function"&&typeof O.componentWillReceiveProps!="function"||(Q!==Se||we!==J)&&Lw(p,O,E,J),_l=!1,we=p.memoizedState,O.state=we,X0(p,E,O,_);var Ye=p.memoizedState;Q!==Se||we!==Ye||Jr.current||_l?(typeof Be=="function"&&(D5(p,b,Be,E),Ye=p.memoizedState),(fe=_l||Iw(p,b,fe,E,we,Ye,J)||!1)?(Ee||typeof O.UNSAFE_componentWillUpdate!="function"&&typeof O.componentWillUpdate!="function"||(typeof O.componentWillUpdate=="function"&&O.componentWillUpdate(E,Ye,J),typeof O.UNSAFE_componentWillUpdate=="function"&&O.UNSAFE_componentWillUpdate(E,Ye,J)),typeof O.componentDidUpdate=="function"&&(p.flags|=4),typeof O.getSnapshotBeforeUpdate=="function"&&(p.flags|=1024)):(typeof O.componentDidUpdate!="function"||Q===u.memoizedProps&&we===u.memoizedState||(p.flags|=4),typeof O.getSnapshotBeforeUpdate!="function"||Q===u.memoizedProps&&we===u.memoizedState||(p.flags|=1024),p.memoizedProps=E,p.memoizedState=Ye),O.props=E,O.state=Ye,O.context=J,E=fe):(typeof O.componentDidUpdate!="function"||Q===u.memoizedProps&&we===u.memoizedState||(p.flags|=4),typeof O.getSnapshotBeforeUpdate!="function"||Q===u.memoizedProps&&we===u.memoizedState||(p.flags|=1024),E=!1)}return F5(u,p,b,E,L,_)}function F5(u,p,b,E,_,L){zw(u,p);var O=(p.flags&128)!==0;if(!E&&!O)return _&&G4(p,b,!1),Eo(u,p,L);E=p.stateNode,LB.current=p;var Q=O&&typeof b.getDerivedStateFromError!="function"?null:E.render();return p.flags|=1,u!==null&&O?(p.child=lu(p,u.child,null,L),p.child=lu(p,null,Q,L)):Fr(u,p,Q,L),p.memoizedState=E.state,_&&G4(p,b,!0),p.child}function Ww(u){var p=u.stateNode;p.pendingContext?V4(u,p.pendingContext,p.pendingContext!==p.context):p.context&&V4(u,p.context,!1),w5(u,p.containerInfo)}function Xw(u,p,b,E,_){return ou(),m5(_),p.flags|=256,Fr(u,p,b,E),p.child}var $5={dehydrated:null,treeContext:null,retryLane:0};function B5(u){return{baseLanes:u,cachePool:null,transitions:null}}function Vw(u,p,b){var E=p.pendingProps,_=vn.current,L=!1,O=(p.flags&128)!==0,Q;if((Q=O)||(Q=u!==null&&u.memoizedState===null?!1:(_&2)!==0),Q?(L=!0,p.flags&=-129):(u===null||u.memoizedState!==null)&&(_|=1),tn(vn,_&1),u===null)return p5(p),u=p.memoizedState,u!==null&&(u=u.dehydrated,u!==null)?((p.mode&1)===0?p.lanes=1:u.data==="$!"?p.lanes=8:p.lanes=1073741824,null):(O=E.children,u=E.fallback,L?(E=p.mode,L=p.child,O={mode:"hidden",children:O},(E&1)===0&&L!==null?(L.childLanes=0,L.pendingProps=O):L=hm(O,E,0,null),u=Oc(u,E,b,null),L.return=p,u.return=p,L.sibling=u,p.child=L,p.child.memoizedState=B5(b),p.memoizedState=$5,u):z5(p,O));if(_=u.memoizedState,_!==null&&(Q=_.dehydrated,Q!==null))return RB(u,p,O,E,Q,_,b);if(L){L=E.fallback,O=p.mode,_=u.child,Q=_.sibling;var J={mode:"hidden",children:E.children};return(O&1)===0&&p.child!==_?(E=p.child,E.childLanes=0,E.pendingProps=J,p.deletions=null):(E=Rl(_,J),E.subtreeFlags=_.subtreeFlags&14680064),Q!==null?L=Rl(Q,L):(L=Oc(L,O,b,null),L.flags|=2),L.return=p,E.return=p,E.sibling=L,p.child=E,E=L,L=p.child,O=u.child.memoizedState,O=O===null?B5(b):{baseLanes:O.baseLanes|b,cachePool:null,transitions:O.transitions},L.memoizedState=O,L.childLanes=u.childLanes&~b,p.memoizedState=$5,E}return L=u.child,u=L.sibling,E=Rl(L,{mode:"visible",children:E.children}),(p.mode&1)===0&&(E.lanes=b),E.return=p,E.sibling=null,u!==null&&(b=p.deletions,b===null?(p.deletions=[u],p.flags|=16):b.push(u)),p.child=E,p.memoizedState=null,E}function z5(u,p){return p=hm({mode:"visible",children:p},u.mode,0,null),p.return=u,u.child=p}function J0(u,p,b,E){return E!==null&&m5(E),lu(p,u.child,null,b),u=z5(p,p.pendingProps.children),u.flags|=2,p.memoizedState=null,u}function RB(u,p,b,E,_,L,O){if(b)return p.flags&256?(p.flags&=-257,E=P5(Error(n(422))),J0(u,p,O,E)):p.memoizedState!==null?(p.child=u.child,p.flags|=128,null):(L=E.fallback,_=p.mode,E=hm({mode:"visible",children:E.children},_,0,null),L=Oc(L,_,O,null),L.flags|=2,E.return=p,L.return=p,E.sibling=L,p.child=E,(p.mode&1)!==0&&lu(p,u.child,null,O),p.child.memoizedState=B5(O),p.memoizedState=$5,L);if((p.mode&1)===0)return J0(u,p,O,null);if(_.data==="$!"){if(E=_.nextSibling&&_.nextSibling.dataset,E)var Q=E.dgst;return E=Q,L=Error(n(419)),E=P5(L,E,void 0),J0(u,p,O,E)}if(Q=(O&u.childLanes)!==0,ti||Q){if(E=ir,E!==null){switch(O&-O){case 4:_=2;break;case 16:_=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:_=32;break;case 536870912:_=268435456;break;default:_=0}_=(_&(E.suspendedLanes|O))!==0?0:_,_!==0&&_!==L.retryLane&&(L.retryLane=_,xo(u,_),ja(E,u,_,-1))}return ib(),E=P5(Error(n(421))),J0(u,p,O,E)}return _.data==="$?"?(p.flags|=128,p.child=u.child,p=VB.bind(null,u),_._reactRetry=p,null):(u=L.treeContext,Mi=wl(_.nextSibling),Ti=p,fn=!0,Aa=null,u!==null&&(Vi[Yi++]=yo,Vi[Yi++]=vo,Vi[Yi++]=Mc,yo=u.id,vo=u.overflow,Mc=p),p=z5(p,E.children),p.flags|=4096,p)}function Yw(u,p,b){u.lanes|=p;var E=u.alternate;E!==null&&(E.lanes|=p),y5(u.return,p,b)}function H5(u,p,b,E,_){var L=u.memoizedState;L===null?u.memoizedState={isBackwards:p,rendering:null,renderingStartTime:0,last:E,tail:b,tailMode:_}:(L.isBackwards=p,L.rendering=null,L.renderingStartTime=0,L.last=E,L.tail=b,L.tailMode=_)}function Gw(u,p,b){var E=p.pendingProps,_=E.revealOrder,L=E.tail;if(Fr(u,p,E.children,b),E=vn.current,(E&2)!==0)E=E&1|2,p.flags|=128;else{if(u!==null&&(u.flags&128)!==0)e:for(u=p.child;u!==null;){if(u.tag===13)u.memoizedState!==null&&Yw(u,b,p);else if(u.tag===19)Yw(u,b,p);else if(u.child!==null){u.child.return=u,u=u.child;continue}if(u===p)break e;for(;u.sibling===null;){if(u.return===null||u.return===p)break e;u=u.return}u.sibling.return=u.return,u=u.sibling}E&=1}if(tn(vn,E),(p.mode&1)===0)p.memoizedState=null;else switch(_){case"forwards":for(b=p.child,_=null;b!==null;)u=b.alternate,u!==null&&V0(u)===null&&(_=b),b=b.sibling;b=_,b===null?(_=p.child,p.child=null):(_=b.sibling,b.sibling=null),H5(p,!1,_,b,L);break;case"backwards":for(b=null,_=p.child,p.child=null;_!==null;){if(u=_.alternate,u!==null&&V0(u)===null){p.child=_;break}u=_.sibling,_.sibling=b,b=_,_=u}H5(p,!0,b,null,L);break;case"together":H5(p,!1,null,null,void 0);break;default:p.memoizedState=null}return p.child}function em(u,p){(p.mode&1)===0&&u!==null&&(u.alternate=null,p.alternate=null,p.flags|=2)}function Eo(u,p,b){if(u!==null&&(p.dependencies=u.dependencies),Dc|=p.lanes,(b&p.childLanes)===0)return null;if(u!==null&&p.child!==u.child)throw Error(n(153));if(p.child!==null){for(u=p.child,b=Rl(u,u.pendingProps),p.child=b,b.return=p;u.sibling!==null;)u=u.sibling,b=b.sibling=Rl(u,u.pendingProps),b.return=p;b.sibling=null}return p.child}function DB(u,p,b){switch(p.tag){case 3:Ww(p),ou();break;case 5:lw(p);break;case 1:ei(p.type)&&P0(p);break;case 4:w5(p,p.stateNode.containerInfo);break;case 10:var E=p.type._context,_=p.memoizedProps.value;tn(z0,E._currentValue),E._currentValue=_;break;case 13:if(E=p.memoizedState,E!==null)return E.dehydrated!==null?(tn(vn,vn.current&1),p.flags|=128,null):(b&p.child.childLanes)!==0?Vw(u,p,b):(tn(vn,vn.current&1),u=Eo(u,p,b),u!==null?u.sibling:null);tn(vn,vn.current&1);break;case 19:if(E=(b&p.childLanes)!==0,(u.flags&128)!==0){if(E)return Gw(u,p,b);p.flags|=128}if(_=p.memoizedState,_!==null&&(_.rendering=null,_.tail=null,_.lastEffect=null),tn(vn,vn.current),E)break;return null;case 22:case 23:return p.lanes=0,Bw(u,p,b)}return Eo(u,p,b)}var qw,W5,Zw,Kw;qw=function(u,p){for(var b=p.child;b!==null;){if(b.tag===5||b.tag===6)u.appendChild(b.stateNode);else if(b.tag!==4&&b.child!==null){b.child.return=b,b=b.child;continue}if(b===p)break;for(;b.sibling===null;){if(b.return===null||b.return===p)return;b=b.return}b.sibling.return=b.return,b=b.sibling}},W5=function(){},Zw=function(u,p,b,E){var _=u.memoizedProps;if(_!==E){u=p.stateNode,Lc(vs.current);var L=null;switch(b){case"input":_=Tn(u,_),E=Tn(u,E),L=[];break;case"select":_=K({},_,{value:void 0}),E=K({},E,{value:void 0}),L=[];break;case"textarea":_=fl(u,_),E=fl(u,E),L=[];break;default:typeof _.onClick!="function"&&typeof E.onClick=="function"&&(u.onclick=R0)}Sa(b,E);var O;b=null;for(fe in _)if(!E.hasOwnProperty(fe)&&_.hasOwnProperty(fe)&&_[fe]!=null)if(fe==="style"){var Q=_[fe];for(O in Q)Q.hasOwnProperty(O)&&(b||(b={}),b[O]="")}else fe!=="dangerouslySetInnerHTML"&&fe!=="children"&&fe!=="suppressContentEditableWarning"&&fe!=="suppressHydrationWarning"&&fe!=="autoFocus"&&(i.hasOwnProperty(fe)?L||(L=[]):(L=L||[]).push(fe,null));for(fe in E){var J=E[fe];if(Q=_!=null?_[fe]:void 0,E.hasOwnProperty(fe)&&J!==Q&&(J!=null||Q!=null))if(fe==="style")if(Q){for(O in Q)!Q.hasOwnProperty(O)||J&&J.hasOwnProperty(O)||(b||(b={}),b[O]="");for(O in J)J.hasOwnProperty(O)&&Q[O]!==J[O]&&(b||(b={}),b[O]=J[O])}else b||(L||(L=[]),L.push(fe,b)),b=J;else fe==="dangerouslySetInnerHTML"?(J=J?J.__html:void 0,Q=Q?Q.__html:void 0,J!=null&&Q!==J&&(L=L||[]).push(fe,J)):fe==="children"?typeof J!="string"&&typeof J!="number"||(L=L||[]).push(fe,""+J):fe!=="suppressContentEditableWarning"&&fe!=="suppressHydrationWarning"&&(i.hasOwnProperty(fe)?(J!=null&&fe==="onScroll"&&on("scroll",u),L||Q===J||(L=[])):(L=L||[]).push(fe,J))}b&&(L=L||[]).push("style",b);var fe=L;(p.updateQueue=fe)&&(p.flags|=4)}},Kw=function(u,p,b,E){b!==E&&(p.flags|=4)};function Sf(u,p){if(!fn)switch(u.tailMode){case"hidden":p=u.tail;for(var b=null;p!==null;)p.alternate!==null&&(b=p),p=p.sibling;b===null?u.tail=null:b.sibling=null;break;case"collapsed":b=u.tail;for(var E=null;b!==null;)b.alternate!==null&&(E=b),b=b.sibling;E===null?p||u.tail===null?u.tail=null:u.tail.sibling=null:E.sibling=null}}function Cr(u){var p=u.alternate!==null&&u.alternate.child===u.child,b=0,E=0;if(p)for(var _=u.child;_!==null;)b|=_.lanes|_.childLanes,E|=_.subtreeFlags&14680064,E|=_.flags&14680064,_.return=u,_=_.sibling;else for(_=u.child;_!==null;)b|=_.lanes|_.childLanes,E|=_.subtreeFlags,E|=_.flags,_.return=u,_=_.sibling;return u.subtreeFlags|=E,u.childLanes=b,p}function jB(u,p,b){var E=p.pendingProps;switch(h5(p),p.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Cr(p),null;case 1:return ei(p.type)&&j0(),Cr(p),null;case 3:return E=p.stateNode,uu(),ln(Jr),ln(wr),S5(),E.pendingContext&&(E.context=E.pendingContext,E.pendingContext=null),(u===null||u.child===null)&&($0(p)?p.flags|=4:u===null||u.memoizedState.isDehydrated&&(p.flags&256)===0||(p.flags|=1024,Aa!==null&&(tb(Aa),Aa=null))),W5(u,p),Cr(p),null;case 5:E5(p);var _=Lc(vf.current);if(b=p.type,u!==null&&p.stateNode!=null)Zw(u,p,b,E,_),u.ref!==p.ref&&(p.flags|=512,p.flags|=2097152);else{if(!E){if(p.stateNode===null)throw Error(n(166));return Cr(p),null}if(u=Lc(vs.current),$0(p)){E=p.stateNode,b=p.type;var L=p.memoizedProps;switch(E[ys]=p,E[mf]=L,u=(p.mode&1)!==0,b){case"dialog":on("cancel",E),on("close",E);break;case"iframe":case"object":case"embed":on("load",E);break;case"video":case"audio":for(_=0;_<hf.length;_++)on(hf[_],E);break;case"source":on("error",E);break;case"img":case"image":case"link":on("error",E),on("load",E);break;case"details":on("toggle",E);break;case"input":On(E,L),on("invalid",E);break;case"select":E._wrapperState={wasMultiple:!!L.multiple},on("invalid",E);break;case"textarea":lo(E,L),on("invalid",E)}Sa(b,L),_=null;for(var O in L)if(L.hasOwnProperty(O)){var Q=L[O];O==="children"?typeof Q=="string"?E.textContent!==Q&&(L.suppressHydrationWarning!==!0&&L0(E.textContent,Q,u),_=["children",Q]):typeof Q=="number"&&E.textContent!==""+Q&&(L.suppressHydrationWarning!==!0&&L0(E.textContent,Q,u),_=["children",""+Q]):i.hasOwnProperty(O)&&Q!=null&&O==="onScroll"&&on("scroll",E)}switch(b){case"input":Je(E),xa(E,L,!0);break;case"textarea":Je(E),wi(E);break;case"select":case"option":break;default:typeof L.onClick=="function"&&(E.onclick=R0)}E=_,p.updateQueue=E,E!==null&&(p.flags|=4)}else{O=_.nodeType===9?_:_.ownerDocument,u==="http://www.w3.org/1999/xhtml"&&(u=Ei(b)),u==="http://www.w3.org/1999/xhtml"?b==="script"?(u=O.createElement("div"),u.innerHTML="<script><\/script>",u=u.removeChild(u.firstChild)):typeof E.is=="string"?u=O.createElement(b,{is:E.is}):(u=O.createElement(b),b==="select"&&(O=u,E.multiple?O.multiple=!0:E.size&&(O.size=E.size))):u=O.createElementNS(u,b),u[ys]=p,u[mf]=E,qw(u,p,!1,!1),p.stateNode=u;e:{switch(O=_a(b,E),b){case"dialog":on("cancel",u),on("close",u),_=E;break;case"iframe":case"object":case"embed":on("load",u),_=E;break;case"video":case"audio":for(_=0;_<hf.length;_++)on(hf[_],u);_=E;break;case"source":on("error",u),_=E;break;case"img":case"image":case"link":on("error",u),on("load",u),_=E;break;case"details":on("toggle",u),_=E;break;case"input":On(u,E),_=Tn(u,E),on("invalid",u);break;case"option":_=E;break;case"select":u._wrapperState={wasMultiple:!!E.multiple},_=K({},E,{value:void 0}),on("invalid",u);break;case"textarea":lo(u,E),_=fl(u,E),on("invalid",u);break;default:_=E}Sa(b,_),Q=_;for(L in Q)if(Q.hasOwnProperty(L)){var J=Q[L];L==="style"?Ci(u,J):L==="dangerouslySetInnerHTML"?(J=J?J.__html:void 0,J!=null&&Ea(u,J)):L==="children"?typeof J=="string"?(b!=="textarea"||J!=="")&&zi(u,J):typeof J=="number"&&zi(u,""+J):L!=="suppressContentEditableWarning"&&L!=="suppressHydrationWarning"&&L!=="autoFocus"&&(i.hasOwnProperty(L)?J!=null&&L==="onScroll"&&on("scroll",u):J!=null&&C(u,L,J,O))}switch(b){case"input":Je(u),xa(u,E,!1);break;case"textarea":Je(u),wi(u);break;case"option":E.value!=null&&u.setAttribute("value",""+ge(E.value));break;case"select":u.multiple=!!E.multiple,L=E.value,L!=null?xr(u,!!E.multiple,L,!1):E.defaultValue!=null&&xr(u,!!E.multiple,E.defaultValue,!0);break;default:typeof _.onClick=="function"&&(u.onclick=R0)}switch(b){case"button":case"input":case"select":case"textarea":E=!!E.autoFocus;break e;case"img":E=!0;break e;default:E=!1}}E&&(p.flags|=4)}p.ref!==null&&(p.flags|=512,p.flags|=2097152)}return Cr(p),null;case 6:if(u&&p.stateNode!=null)Kw(u,p,u.memoizedProps,E);else{if(typeof E!="string"&&p.stateNode===null)throw Error(n(166));if(b=Lc(vf.current),Lc(vs.current),$0(p)){if(E=p.stateNode,b=p.memoizedProps,E[ys]=p,(L=E.nodeValue!==b)&&(u=Ti,u!==null))switch(u.tag){case 3:L0(E.nodeValue,b,(u.mode&1)!==0);break;case 5:u.memoizedProps.suppressHydrationWarning!==!0&&L0(E.nodeValue,b,(u.mode&1)!==0)}L&&(p.flags|=4)}else E=(b.nodeType===9?b:b.ownerDocument).createTextNode(E),E[ys]=p,p.stateNode=E}return Cr(p),null;case 13:if(ln(vn),E=p.memoizedState,u===null||u.memoizedState!==null&&u.memoizedState.dehydrated!==null){if(fn&&Mi!==null&&(p.mode&1)!==0&&(p.flags&128)===0)ew(),ou(),p.flags|=98560,L=!1;else if(L=$0(p),E!==null&&E.dehydrated!==null){if(u===null){if(!L)throw Error(n(318));if(L=p.memoizedState,L=L!==null?L.dehydrated:null,!L)throw Error(n(317));L[ys]=p}else ou(),(p.flags&128)===0&&(p.memoizedState=null),p.flags|=4;Cr(p),L=!1}else Aa!==null&&(tb(Aa),Aa=null),L=!0;if(!L)return p.flags&65536?p:null}return(p.flags&128)!==0?(p.lanes=b,p):(E=E!==null,E!==(u!==null&&u.memoizedState!==null)&&E&&(p.child.flags|=8192,(p.mode&1)!==0&&(u===null||(vn.current&1)!==0?qn===0&&(qn=3):ib())),p.updateQueue!==null&&(p.flags|=4),Cr(p),null);case 4:return uu(),W5(u,p),u===null&&ff(p.stateNode.containerInfo),Cr(p),null;case 10:return b5(p.type._context),Cr(p),null;case 17:return ei(p.type)&&j0(),Cr(p),null;case 19:if(ln(vn),L=p.memoizedState,L===null)return Cr(p),null;if(E=(p.flags&128)!==0,O=L.rendering,O===null)if(E)Sf(L,!1);else{if(qn!==0||u!==null&&(u.flags&128)!==0)for(u=p.child;u!==null;){if(O=V0(u),O!==null){for(p.flags|=128,Sf(L,!1),E=O.updateQueue,E!==null&&(p.updateQueue=E,p.flags|=4),p.subtreeFlags=0,E=b,b=p.child;b!==null;)L=b,u=E,L.flags&=14680066,O=L.alternate,O===null?(L.childLanes=0,L.lanes=u,L.child=null,L.subtreeFlags=0,L.memoizedProps=null,L.memoizedState=null,L.updateQueue=null,L.dependencies=null,L.stateNode=null):(L.childLanes=O.childLanes,L.lanes=O.lanes,L.child=O.child,L.subtreeFlags=0,L.deletions=null,L.memoizedProps=O.memoizedProps,L.memoizedState=O.memoizedState,L.updateQueue=O.updateQueue,L.type=O.type,u=O.dependencies,L.dependencies=u===null?null:{lanes:u.lanes,firstContext:u.firstContext}),b=b.sibling;return tn(vn,vn.current&1|2),p.child}u=u.sibling}L.tail!==null&&_e()>mu&&(p.flags|=128,E=!0,Sf(L,!1),p.lanes=4194304)}else{if(!E)if(u=V0(O),u!==null){if(p.flags|=128,E=!0,b=u.updateQueue,b!==null&&(p.updateQueue=b,p.flags|=4),Sf(L,!0),L.tail===null&&L.tailMode==="hidden"&&!O.alternate&&!fn)return Cr(p),null}else 2*_e()-L.renderingStartTime>mu&&b!==1073741824&&(p.flags|=128,E=!0,Sf(L,!1),p.lanes=4194304);L.isBackwards?(O.sibling=p.child,p.child=O):(b=L.last,b!==null?b.sibling=O:p.child=O,L.last=O)}return L.tail!==null?(p=L.tail,L.rendering=p,L.tail=p.sibling,L.renderingStartTime=_e(),p.sibling=null,b=vn.current,tn(vn,E?b&1|2:b&1),p):(Cr(p),null);case 22:case 23:return rb(),E=p.memoizedState!==null,u!==null&&u.memoizedState!==null!==E&&(p.flags|=8192),E&&(p.mode&1)!==0?(Ii&1073741824)!==0&&(Cr(p),p.subtreeFlags&6&&(p.flags|=8192)):Cr(p),null;case 24:return null;case 25:return null}throw Error(n(156,p.tag))}function PB(u,p){switch(h5(p),p.tag){case 1:return ei(p.type)&&j0(),u=p.flags,u&65536?(p.flags=u&-65537|128,p):null;case 3:return uu(),ln(Jr),ln(wr),S5(),u=p.flags,(u&65536)!==0&&(u&128)===0?(p.flags=u&-65537|128,p):null;case 5:return E5(p),null;case 13:if(ln(vn),u=p.memoizedState,u!==null&&u.dehydrated!==null){if(p.alternate===null)throw Error(n(340));ou()}return u=p.flags,u&65536?(p.flags=u&-65537|128,p):null;case 19:return ln(vn),null;case 4:return uu(),null;case 10:return b5(p.type._context),null;case 22:case 23:return rb(),null;case 24:return null;default:return null}}var tm=!1,Sr=!1,NB=typeof WeakSet=="function"?WeakSet:Set,He=null;function fu(u,p){var b=u.ref;if(b!==null)if(typeof b=="function")try{b(null)}catch(E){Mn(u,p,E)}else b.current=null}function X5(u,p,b){try{b()}catch(E){Mn(u,p,E)}}var Qw=!1;function OB(u,p){if(r5=x0,u=I4(),q6(u)){if("selectionStart"in u)var b={start:u.selectionStart,end:u.selectionEnd};else e:{b=(b=u.ownerDocument)&&b.defaultView||window;var E=b.getSelection&&b.getSelection();if(E&&E.rangeCount!==0){b=E.anchorNode;var _=E.anchorOffset,L=E.focusNode;E=E.focusOffset;try{b.nodeType,L.nodeType}catch{b=null;break e}var O=0,Q=-1,J=-1,fe=0,Ee=0,Se=u,we=null;t:for(;;){for(var Be;Se!==b||_!==0&&Se.nodeType!==3||(Q=O+_),Se!==L||E!==0&&Se.nodeType!==3||(J=O+E),Se.nodeType===3&&(O+=Se.nodeValue.length),(Be=Se.firstChild)!==null;)we=Se,Se=Be;for(;;){if(Se===u)break t;if(we===b&&++fe===_&&(Q=O),we===L&&++Ee===E&&(J=O),(Be=Se.nextSibling)!==null)break;Se=we,we=Se.parentNode}Se=Be}b=Q===-1||J===-1?null:{start:Q,end:J}}else b=null}b=b||{start:0,end:0}}else b=null;for(i5={focusedElem:u,selectionRange:b},x0=!1,He=p;He!==null;)if(p=He,u=p.child,(p.subtreeFlags&1028)!==0&&u!==null)u.return=p,He=u;else for(;He!==null;){p=He;try{var Ye=p.alternate;if((p.flags&1024)!==0)switch(p.tag){case 0:case 11:case 15:break;case 1:if(Ye!==null){var qe=Ye.memoizedProps,Dn=Ye.memoizedState,oe=p.stateNode,te=oe.getSnapshotBeforeUpdate(p.elementType===p.type?qe:La(p.type,qe),Dn);oe.__reactInternalSnapshotBeforeUpdate=te}break;case 3:var ce=p.stateNode.containerInfo;ce.nodeType===1?ce.textContent="":ce.nodeType===9&&ce.documentElement&&ce.removeChild(ce.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(Ie){Mn(p,p.return,Ie)}if(u=p.sibling,u!==null){u.return=p.return,He=u;break}He=p.return}return Ye=Qw,Qw=!1,Ye}function _f(u,p,b){var E=p.updateQueue;if(E=E!==null?E.lastEffect:null,E!==null){var _=E=E.next;do{if((_.tag&u)===u){var L=_.destroy;_.destroy=void 0,L!==void 0&&X5(p,b,L)}_=_.next}while(_!==E)}}function nm(u,p){if(p=p.updateQueue,p=p!==null?p.lastEffect:null,p!==null){var b=p=p.next;do{if((b.tag&u)===u){var E=b.create;b.destroy=E()}b=b.next}while(b!==p)}}function V5(u){var p=u.ref;if(p!==null){var b=u.stateNode;switch(u.tag){case 5:u=b;break;default:u=b}typeof p=="function"?p(u):p.current=u}}function Jw(u){var p=u.alternate;p!==null&&(u.alternate=null,Jw(p)),u.child=null,u.deletions=null,u.sibling=null,u.tag===5&&(p=u.stateNode,p!==null&&(delete p[ys],delete p[mf],delete p[l5],delete p[vB],delete p[xB])),u.stateNode=null,u.return=null,u.dependencies=null,u.memoizedProps=null,u.memoizedState=null,u.pendingProps=null,u.stateNode=null,u.updateQueue=null}function e9(u){return u.tag===5||u.tag===3||u.tag===4}function t9(u){e:for(;;){for(;u.sibling===null;){if(u.return===null||e9(u.return))return null;u=u.return}for(u.sibling.return=u.return,u=u.sibling;u.tag!==5&&u.tag!==6&&u.tag!==18;){if(u.flags&2||u.child===null||u.tag===4)continue e;u.child.return=u,u=u.child}if(!(u.flags&2))return u.stateNode}}function Y5(u,p,b){var E=u.tag;if(E===5||E===6)u=u.stateNode,p?b.nodeType===8?b.parentNode.insertBefore(u,p):b.insertBefore(u,p):(b.nodeType===8?(p=b.parentNode,p.insertBefore(u,b)):(p=b,p.appendChild(u)),b=b._reactRootContainer,b!=null||p.onclick!==null||(p.onclick=R0));else if(E!==4&&(u=u.child,u!==null))for(Y5(u,p,b),u=u.sibling;u!==null;)Y5(u,p,b),u=u.sibling}function G5(u,p,b){var E=u.tag;if(E===5||E===6)u=u.stateNode,p?b.insertBefore(u,p):b.appendChild(u);else if(E!==4&&(u=u.child,u!==null))for(G5(u,p,b),u=u.sibling;u!==null;)G5(u,p,b),u=u.sibling}var pr=null,Ra=!1;function Tl(u,p,b){for(b=b.child;b!==null;)n9(u,p,b),b=b.sibling}function n9(u,p,b){if(bs&&typeof bs.onCommitFiberUnmount=="function")try{bs.onCommitFiberUnmount(m0,b)}catch{}switch(b.tag){case 5:Sr||fu(b,p);case 6:var E=pr,_=Ra;pr=null,Tl(u,p,b),pr=E,Ra=_,pr!==null&&(Ra?(u=pr,b=b.stateNode,u.nodeType===8?u.parentNode.removeChild(b):u.removeChild(b)):pr.removeChild(b.stateNode));break;case 18:pr!==null&&(Ra?(u=pr,b=b.stateNode,u.nodeType===8?o5(u.parentNode,b):u.nodeType===1&&o5(u,b),rf(u)):o5(pr,b.stateNode));break;case 4:E=pr,_=Ra,pr=b.stateNode.containerInfo,Ra=!0,Tl(u,p,b),pr=E,Ra=_;break;case 0:case 11:case 14:case 15:if(!Sr&&(E=b.updateQueue,E!==null&&(E=E.lastEffect,E!==null))){_=E=E.next;do{var L=_,O=L.destroy;L=L.tag,O!==void 0&&((L&2)!==0||(L&4)!==0)&&X5(b,p,O),_=_.next}while(_!==E)}Tl(u,p,b);break;case 1:if(!Sr&&(fu(b,p),E=b.stateNode,typeof E.componentWillUnmount=="function"))try{E.props=b.memoizedProps,E.state=b.memoizedState,E.componentWillUnmount()}catch(Q){Mn(b,p,Q)}Tl(u,p,b);break;case 21:Tl(u,p,b);break;case 22:b.mode&1?(Sr=(E=Sr)||b.memoizedState!==null,Tl(u,p,b),Sr=E):Tl(u,p,b);break;default:Tl(u,p,b)}}function r9(u){var p=u.updateQueue;if(p!==null){u.updateQueue=null;var b=u.stateNode;b===null&&(b=u.stateNode=new NB),p.forEach(function(E){var _=YB.bind(null,u,E);b.has(E)||(b.add(E),E.then(_,_))})}}function Da(u,p){var b=p.deletions;if(b!==null)for(var E=0;E<b.length;E++){var _=b[E];try{var L=u,O=p,Q=O;e:for(;Q!==null;){switch(Q.tag){case 5:pr=Q.stateNode,Ra=!1;break e;case 3:pr=Q.stateNode.containerInfo,Ra=!0;break e;case 4:pr=Q.stateNode.containerInfo,Ra=!0;break e}Q=Q.return}if(pr===null)throw Error(n(160));n9(L,O,_),pr=null,Ra=!1;var J=_.alternate;J!==null&&(J.return=null),_.return=null}catch(fe){Mn(_,p,fe)}}if(p.subtreeFlags&12854)for(p=p.child;p!==null;)i9(p,u),p=p.sibling}function i9(u,p){var b=u.alternate,E=u.flags;switch(u.tag){case 0:case 11:case 14:case 15:if(Da(p,u),ws(u),E&4){try{_f(3,u,u.return),nm(3,u)}catch(qe){Mn(u,u.return,qe)}try{_f(5,u,u.return)}catch(qe){Mn(u,u.return,qe)}}break;case 1:Da(p,u),ws(u),E&512&&b!==null&&fu(b,b.return);break;case 5:if(Da(p,u),ws(u),E&512&&b!==null&&fu(b,b.return),u.flags&32){var _=u.stateNode;try{zi(_,"")}catch(qe){Mn(u,u.return,qe)}}if(E&4&&(_=u.stateNode,_!=null)){var L=u.memoizedProps,O=b!==null?b.memoizedProps:L,Q=u.type,J=u.updateQueue;if(u.updateQueue=null,J!==null)try{Q==="input"&&L.type==="radio"&&L.name!=null&&Fn(_,L),_a(Q,O);var fe=_a(Q,L);for(O=0;O<J.length;O+=2){var Ee=J[O],Se=J[O+1];Ee==="style"?Ci(_,Se):Ee==="dangerouslySetInnerHTML"?Ea(_,Se):Ee==="children"?zi(_,Se):C(_,Ee,Se,fe)}switch(Q){case"input":hn(_,L);break;case"textarea":wa(_,L);break;case"select":var we=_._wrapperState.wasMultiple;_._wrapperState.wasMultiple=!!L.multiple;var Be=L.value;Be!=null?xr(_,!!L.multiple,Be,!1):we!==!!L.multiple&&(L.defaultValue!=null?xr(_,!!L.multiple,L.defaultValue,!0):xr(_,!!L.multiple,L.multiple?[]:"",!1))}_[mf]=L}catch(qe){Mn(u,u.return,qe)}}break;case 6:if(Da(p,u),ws(u),E&4){if(u.stateNode===null)throw Error(n(162));_=u.stateNode,L=u.memoizedProps;try{_.nodeValue=L}catch(qe){Mn(u,u.return,qe)}}break;case 3:if(Da(p,u),ws(u),E&4&&b!==null&&b.memoizedState.isDehydrated)try{rf(p.containerInfo)}catch(qe){Mn(u,u.return,qe)}break;case 4:Da(p,u),ws(u);break;case 13:Da(p,u),ws(u),_=u.child,_.flags&8192&&(L=_.memoizedState!==null,_.stateNode.isHidden=L,!L||_.alternate!==null&&_.alternate.memoizedState!==null||(K5=_e())),E&4&&r9(u);break;case 22:if(Ee=b!==null&&b.memoizedState!==null,u.mode&1?(Sr=(fe=Sr)||Ee,Da(p,u),Sr=fe):Da(p,u),ws(u),E&8192){if(fe=u.memoizedState!==null,(u.stateNode.isHidden=fe)&&!Ee&&(u.mode&1)!==0)for(He=u,Ee=u.child;Ee!==null;){for(Se=He=Ee;He!==null;){switch(we=He,Be=we.child,we.tag){case 0:case 11:case 14:case 15:_f(4,we,we.return);break;case 1:fu(we,we.return);var Ye=we.stateNode;if(typeof Ye.componentWillUnmount=="function"){E=we,b=we.return;try{p=E,Ye.props=p.memoizedProps,Ye.state=p.memoizedState,Ye.componentWillUnmount()}catch(qe){Mn(E,b,qe)}}break;case 5:fu(we,we.return);break;case 22:if(we.memoizedState!==null){o9(Se);continue}}Be!==null?(Be.return=we,He=Be):o9(Se)}Ee=Ee.sibling}e:for(Ee=null,Se=u;;){if(Se.tag===5){if(Ee===null){Ee=Se;try{_=Se.stateNode,fe?(L=_.style,typeof L.setProperty=="function"?L.setProperty("display","none","important"):L.display="none"):(Q=Se.stateNode,J=Se.memoizedProps.style,O=J!=null&&J.hasOwnProperty("display")?J.display:null,Q.style.display=fs("display",O))}catch(qe){Mn(u,u.return,qe)}}}else if(Se.tag===6){if(Ee===null)try{Se.stateNode.nodeValue=fe?"":Se.memoizedProps}catch(qe){Mn(u,u.return,qe)}}else if((Se.tag!==22&&Se.tag!==23||Se.memoizedState===null||Se===u)&&Se.child!==null){Se.child.return=Se,Se=Se.child;continue}if(Se===u)break e;for(;Se.sibling===null;){if(Se.return===null||Se.return===u)break e;Ee===Se&&(Ee=null),Se=Se.return}Ee===Se&&(Ee=null),Se.sibling.return=Se.return,Se=Se.sibling}}break;case 19:Da(p,u),ws(u),E&4&&r9(u);break;case 21:break;default:Da(p,u),ws(u)}}function ws(u){var p=u.flags;if(p&2){try{e:{for(var b=u.return;b!==null;){if(e9(b)){var E=b;break e}b=b.return}throw Error(n(160))}switch(E.tag){case 5:var _=E.stateNode;E.flags&32&&(zi(_,""),E.flags&=-33);var L=t9(u);G5(u,L,_);break;case 3:case 4:var O=E.stateNode.containerInfo,Q=t9(u);Y5(u,Q,O);break;default:throw Error(n(161))}}catch(J){Mn(u,u.return,J)}u.flags&=-3}p&4096&&(u.flags&=-4097)}function FB(u,p,b){He=u,a9(u)}function a9(u,p,b){for(var E=(u.mode&1)!==0;He!==null;){var _=He,L=_.child;if(_.tag===22&&E){var O=_.memoizedState!==null||tm;if(!O){var Q=_.alternate,J=Q!==null&&Q.memoizedState!==null||Sr;Q=tm;var fe=Sr;if(tm=O,(Sr=J)&&!fe)for(He=_;He!==null;)O=He,J=O.child,O.tag===22&&O.memoizedState!==null?l9(_):J!==null?(J.return=O,He=J):l9(_);for(;L!==null;)He=L,a9(L),L=L.sibling;He=_,tm=Q,Sr=fe}s9(u)}else(_.subtreeFlags&8772)!==0&&L!==null?(L.return=_,He=L):s9(u)}}function s9(u){for(;He!==null;){var p=He;if((p.flags&8772)!==0){var b=p.alternate;try{if((p.flags&8772)!==0)switch(p.tag){case 0:case 11:case 15:Sr||nm(5,p);break;case 1:var E=p.stateNode;if(p.flags&4&&!Sr)if(b===null)E.componentDidMount();else{var _=p.elementType===p.type?b.memoizedProps:La(p.type,b.memoizedProps);E.componentDidUpdate(_,b.memoizedState,E.__reactInternalSnapshotBeforeUpdate)}var L=p.updateQueue;L!==null&&ow(p,L,E);break;case 3:var O=p.updateQueue;if(O!==null){if(b=null,p.child!==null)switch(p.child.tag){case 5:b=p.child.stateNode;break;case 1:b=p.child.stateNode}ow(p,O,b)}break;case 5:var Q=p.stateNode;if(b===null&&p.flags&4){b=Q;var J=p.memoizedProps;switch(p.type){case"button":case"input":case"select":case"textarea":J.autoFocus&&b.focus();break;case"img":J.src&&(b.src=J.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(p.memoizedState===null){var fe=p.alternate;if(fe!==null){var Ee=fe.memoizedState;if(Ee!==null){var Se=Ee.dehydrated;Se!==null&&rf(Se)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(n(163))}Sr||p.flags&512&&V5(p)}catch(we){Mn(p,p.return,we)}}if(p===u){He=null;break}if(b=p.sibling,b!==null){b.return=p.return,He=b;break}He=p.return}}function o9(u){for(;He!==null;){var p=He;if(p===u){He=null;break}var b=p.sibling;if(b!==null){b.return=p.return,He=b;break}He=p.return}}function l9(u){for(;He!==null;){var p=He;try{switch(p.tag){case 0:case 11:case 15:var b=p.return;try{nm(4,p)}catch(J){Mn(p,b,J)}break;case 1:var E=p.stateNode;if(typeof E.componentDidMount=="function"){var _=p.return;try{E.componentDidMount()}catch(J){Mn(p,_,J)}}var L=p.return;try{V5(p)}catch(J){Mn(p,L,J)}break;case 5:var O=p.return;try{V5(p)}catch(J){Mn(p,O,J)}}}catch(J){Mn(p,p.return,J)}if(p===u){He=null;break}var Q=p.sibling;if(Q!==null){Q.return=p.return,He=Q;break}He=p.return}}var $B=Math.ceil,rm=S.ReactCurrentDispatcher,q5=S.ReactCurrentOwner,Zi=S.ReactCurrentBatchConfig,Mt=0,ir=null,$n=null,mr=0,Ii=0,pu=El(0),qn=0,kf=null,Dc=0,im=0,Z5=0,Tf=null,ni=null,K5=0,mu=1/0,Co=null,am=!1,Q5=null,Ml=null,sm=!1,Il=null,om=0,Mf=0,J5=null,lm=-1,cm=0;function $r(){return(Mt&6)!==0?_e():lm!==-1?lm:lm=_e()}function Al(u){return(u.mode&1)===0?1:(Mt&2)!==0&&mr!==0?mr&-mr:EB.transition!==null?(cm===0&&(cm=t4()),cm):(u=Wt,u!==0||(u=window.event,u=u===void 0?16:d4(u.type)),u)}function ja(u,p,b,E){if(50<Mf)throw Mf=0,J5=null,Error(n(185));Qh(u,b,E),((Mt&2)===0||u!==ir)&&(u===ir&&((Mt&2)===0&&(im|=b),qn===4&&Ll(u,mr)),ri(u,E),b===1&&Mt===0&&(p.mode&1)===0&&(mu=_e()+500,N0&&Sl()))}function ri(u,p){var b=u.callbackNode;E$(u,p);var E=b0(u,u===ir?mr:0);if(E===0)b!==null&&be(b),u.callbackNode=null,u.callbackPriority=0;else if(p=E&-E,u.callbackPriority!==p){if(b!=null&&be(b),p===1)u.tag===0?wB(d9.bind(null,u)):q4(d9.bind(null,u)),bB(function(){(Mt&6)===0&&Sl()}),b=null;else{switch(n4(E)){case 1:b=en;break;case 4:b=Ht;break;case 16:b=sn;break;case 536870912:b=Zh;break;default:b=sn}b=b9(b,c9.bind(null,u))}u.callbackPriority=p,u.callbackNode=b}}function c9(u,p){if(lm=-1,cm=0,(Mt&6)!==0)throw Error(n(327));var b=u.callbackNode;if(gu()&&u.callbackNode!==b)return null;var E=b0(u,u===ir?mr:0);if(E===0)return null;if((E&30)!==0||(E&u.expiredLanes)!==0||p)p=dm(u,E);else{p=E;var _=Mt;Mt|=2;var L=h9();(ir!==u||mr!==p)&&(Co=null,mu=_e()+500,Pc(u,p));do try{HB();break}catch(Q){u9(u,Q)}while(!0);U5(),rm.current=L,Mt=_,$n!==null?p=0:(ir=null,mr=0,p=qn)}if(p!==0){if(p===2&&(_=R6(u),_!==0&&(E=_,p=eb(u,_))),p===1)throw b=kf,Pc(u,0),Ll(u,E),ri(u,_e()),b;if(p===6)Ll(u,E);else{if(_=u.current.alternate,(E&30)===0&&!BB(_)&&(p=dm(u,E),p===2&&(L=R6(u),L!==0&&(E=L,p=eb(u,L))),p===1))throw b=kf,Pc(u,0),Ll(u,E),ri(u,_e()),b;switch(u.finishedWork=_,u.finishedLanes=E,p){case 0:case 1:throw Error(n(345));case 2:Nc(u,ni,Co);break;case 3:if(Ll(u,E),(E&130023424)===E&&(p=K5+500-_e(),10<p)){if(b0(u,0)!==0)break;if(_=u.suspendedLanes,(_&E)!==E){$r(),u.pingedLanes|=u.suspendedLanes&_;break}u.timeoutHandle=s5(Nc.bind(null,u,ni,Co),p);break}Nc(u,ni,Co);break;case 4:if(Ll(u,E),(E&4194240)===E)break;for(p=u.eventTimes,_=-1;0<E;){var O=31-Ma(E);L=1<<O,O=p[O],O>_&&(_=O),E&=~L}if(E=_,E=_e()-E,E=(120>E?120:480>E?480:1080>E?1080:1920>E?1920:3e3>E?3e3:4320>E?4320:1960*$B(E/1960))-E,10<E){u.timeoutHandle=s5(Nc.bind(null,u,ni,Co),E);break}Nc(u,ni,Co);break;case 5:Nc(u,ni,Co);break;default:throw Error(n(329))}}}return ri(u,_e()),u.callbackNode===b?c9.bind(null,u):null}function eb(u,p){var b=Tf;return u.current.memoizedState.isDehydrated&&(Pc(u,p).flags|=256),u=dm(u,p),u!==2&&(p=ni,ni=b,p!==null&&tb(p)),u}function tb(u){ni===null?ni=u:ni.push.apply(ni,u)}function BB(u){for(var p=u;;){if(p.flags&16384){var b=p.updateQueue;if(b!==null&&(b=b.stores,b!==null))for(var E=0;E<b.length;E++){var _=b[E],L=_.getSnapshot;_=_.value;try{if(!Ia(L(),_))return!1}catch{return!1}}}if(b=p.child,p.subtreeFlags&16384&&b!==null)b.return=p,p=b;else{if(p===u)break;for(;p.sibling===null;){if(p.return===null||p.return===u)return!0;p=p.return}p.sibling.return=p.return,p=p.sibling}}return!0}function Ll(u,p){for(p&=~Z5,p&=~im,u.suspendedLanes|=p,u.pingedLanes&=~p,u=u.expirationTimes;0<p;){var b=31-Ma(p),E=1<<b;u[b]=-1,p&=~E}}function d9(u){if((Mt&6)!==0)throw Error(n(327));gu();var p=b0(u,0);if((p&1)===0)return ri(u,_e()),null;var b=dm(u,p);if(u.tag!==0&&b===2){var E=R6(u);E!==0&&(p=E,b=eb(u,E))}if(b===1)throw b=kf,Pc(u,0),Ll(u,p),ri(u,_e()),b;if(b===6)throw Error(n(345));return u.finishedWork=u.current.alternate,u.finishedLanes=p,Nc(u,ni,Co),ri(u,_e()),null}function nb(u,p){var b=Mt;Mt|=1;try{return u(p)}finally{Mt=b,Mt===0&&(mu=_e()+500,N0&&Sl())}}function jc(u){Il!==null&&Il.tag===0&&(Mt&6)===0&&gu();var p=Mt;Mt|=1;var b=Zi.transition,E=Wt;try{if(Zi.transition=null,Wt=1,u)return u()}finally{Wt=E,Zi.transition=b,Mt=p,(Mt&6)===0&&Sl()}}function rb(){Ii=pu.current,ln(pu)}function Pc(u,p){u.finishedWork=null,u.finishedLanes=0;var b=u.timeoutHandle;if(b!==-1&&(u.timeoutHandle=-1,UB(b)),$n!==null)for(b=$n.return;b!==null;){var E=b;switch(h5(E),E.tag){case 1:E=E.type.childContextTypes,E!=null&&j0();break;case 3:uu(),ln(Jr),ln(wr),S5();break;case 5:E5(E);break;case 4:uu();break;case 13:ln(vn);break;case 19:ln(vn);break;case 10:b5(E.type._context);break;case 22:case 23:rb()}b=b.return}if(ir=u,$n=u=Rl(u.current,null),mr=Ii=p,qn=0,kf=null,Z5=im=Dc=0,ni=Tf=null,Ac!==null){for(p=0;p<Ac.length;p++)if(b=Ac[p],E=b.interleaved,E!==null){b.interleaved=null;var _=E.next,L=b.pending;if(L!==null){var O=L.next;L.next=_,E.next=O}b.pending=E}Ac=null}return u}function u9(u,p){do{var b=$n;try{if(U5(),Y0.current=K0,G0){for(var E=xn.memoizedState;E!==null;){var _=E.queue;_!==null&&(_.pending=null),E=E.next}G0=!1}if(Rc=0,rr=Gn=xn=null,xf=!1,wf=0,q5.current=null,b===null||b.return===null){qn=1,kf=p,$n=null;break}e:{var L=u,O=b.return,Q=b,J=p;if(p=mr,Q.flags|=32768,J!==null&&typeof J=="object"&&typeof J.then=="function"){var fe=J,Ee=Q,Se=Ee.tag;if((Ee.mode&1)===0&&(Se===0||Se===11||Se===15)){var we=Ee.alternate;we?(Ee.updateQueue=we.updateQueue,Ee.memoizedState=we.memoizedState,Ee.lanes=we.lanes):(Ee.updateQueue=null,Ee.memoizedState=null)}var Be=Pw(O);if(Be!==null){Be.flags&=-257,Nw(Be,O,Q,L,p),Be.mode&1&&jw(L,fe,p),p=Be,J=fe;var Ye=p.updateQueue;if(Ye===null){var qe=new Set;qe.add(J),p.updateQueue=qe}else Ye.add(J);break e}else{if((p&1)===0){jw(L,fe,p),ib();break e}J=Error(n(426))}}else if(fn&&Q.mode&1){var Dn=Pw(O);if(Dn!==null){(Dn.flags&65536)===0&&(Dn.flags|=256),Nw(Dn,O,Q,L,p),m5(hu(J,Q));break e}}L=J=hu(J,Q),qn!==4&&(qn=2),Tf===null?Tf=[L]:Tf.push(L),L=O;do{switch(L.tag){case 3:L.flags|=65536,p&=-p,L.lanes|=p;var oe=Rw(L,J,p);sw(L,oe);break e;case 1:Q=J;var te=L.type,ce=L.stateNode;if((L.flags&128)===0&&(typeof te.getDerivedStateFromError=="function"||ce!==null&&typeof ce.componentDidCatch=="function"&&(Ml===null||!Ml.has(ce)))){L.flags|=65536,p&=-p,L.lanes|=p;var Ie=Dw(L,Q,p);sw(L,Ie);break e}}L=L.return}while(L!==null)}p9(b)}catch(Ze){p=Ze,$n===b&&b!==null&&($n=b=b.return);continue}break}while(!0)}function h9(){var u=rm.current;return rm.current=K0,u===null?K0:u}function ib(){(qn===0||qn===3||qn===2)&&(qn=4),ir===null||(Dc&268435455)===0&&(im&268435455)===0||Ll(ir,mr)}function dm(u,p){var b=Mt;Mt|=2;var E=h9();(ir!==u||mr!==p)&&(Co=null,Pc(u,p));do try{zB();break}catch(_){u9(u,_)}while(!0);if(U5(),Mt=b,rm.current=E,$n!==null)throw Error(n(261));return ir=null,mr=0,qn}function zB(){for(;$n!==null;)f9($n)}function HB(){for(;$n!==null&&!Xe();)f9($n)}function f9(u){var p=U9(u.alternate,u,Ii);u.memoizedProps=u.pendingProps,p===null?p9(u):$n=p,q5.current=null}function p9(u){var p=u;do{var b=p.alternate;if(u=p.return,(p.flags&32768)===0){if(b=jB(b,p,Ii),b!==null){$n=b;return}}else{if(b=PB(b,p),b!==null){b.flags&=32767,$n=b;return}if(u!==null)u.flags|=32768,u.subtreeFlags=0,u.deletions=null;else{qn=6,$n=null;return}}if(p=p.sibling,p!==null){$n=p;return}$n=p=u}while(p!==null);qn===0&&(qn=5)}function Nc(u,p,b){var E=Wt,_=Zi.transition;try{Zi.transition=null,Wt=1,WB(u,p,b,E)}finally{Zi.transition=_,Wt=E}return null}function WB(u,p,b,E){do gu();while(Il!==null);if((Mt&6)!==0)throw Error(n(327));b=u.finishedWork;var _=u.finishedLanes;if(b===null)return null;if(u.finishedWork=null,u.finishedLanes=0,b===u.current)throw Error(n(177));u.callbackNode=null,u.callbackPriority=0;var L=b.lanes|b.childLanes;if(C$(u,L),u===ir&&($n=ir=null,mr=0),(b.subtreeFlags&2064)===0&&(b.flags&2064)===0||sm||(sm=!0,b9(sn,function(){return gu(),null})),L=(b.flags&15990)!==0,(b.subtreeFlags&15990)!==0||L){L=Zi.transition,Zi.transition=null;var O=Wt;Wt=1;var Q=Mt;Mt|=4,q5.current=null,OB(u,b),i9(b,u),dB(i5),x0=!!r5,i5=r5=null,u.current=b,FB(b),De(),Mt=Q,Wt=O,Zi.transition=L}else u.current=b;if(sm&&(sm=!1,Il=u,om=_),L=u.pendingLanes,L===0&&(Ml=null),b$(b.stateNode),ri(u,_e()),p!==null)for(E=u.onRecoverableError,b=0;b<p.length;b++)_=p[b],E(_.value,{componentStack:_.stack,digest:_.digest});if(am)throw am=!1,u=Q5,Q5=null,u;return(om&1)!==0&&u.tag!==0&&gu(),L=u.pendingLanes,(L&1)!==0?u===J5?Mf++:(Mf=0,J5=u):Mf=0,Sl(),null}function gu(){if(Il!==null){var u=n4(om),p=Zi.transition,b=Wt;try{if(Zi.transition=null,Wt=16>u?16:u,Il===null)var E=!1;else{if(u=Il,Il=null,om=0,(Mt&6)!==0)throw Error(n(331));var _=Mt;for(Mt|=4,He=u.current;He!==null;){var L=He,O=L.child;if((He.flags&16)!==0){var Q=L.deletions;if(Q!==null){for(var J=0;J<Q.length;J++){var fe=Q[J];for(He=fe;He!==null;){var Ee=He;switch(Ee.tag){case 0:case 11:case 15:_f(8,Ee,L)}var Se=Ee.child;if(Se!==null)Se.return=Ee,He=Se;else for(;He!==null;){Ee=He;var we=Ee.sibling,Be=Ee.return;if(Jw(Ee),Ee===fe){He=null;break}if(we!==null){we.return=Be,He=we;break}He=Be}}}var Ye=L.alternate;if(Ye!==null){var qe=Ye.child;if(qe!==null){Ye.child=null;do{var Dn=qe.sibling;qe.sibling=null,qe=Dn}while(qe!==null)}}He=L}}if((L.subtreeFlags&2064)!==0&&O!==null)O.return=L,He=O;else e:for(;He!==null;){if(L=He,(L.flags&2048)!==0)switch(L.tag){case 0:case 11:case 15:_f(9,L,L.return)}var oe=L.sibling;if(oe!==null){oe.return=L.return,He=oe;break e}He=L.return}}var te=u.current;for(He=te;He!==null;){O=He;var ce=O.child;if((O.subtreeFlags&2064)!==0&&ce!==null)ce.return=O,He=ce;else e:for(O=te;He!==null;){if(Q=He,(Q.flags&2048)!==0)try{switch(Q.tag){case 0:case 11:case 15:nm(9,Q)}}catch(Ze){Mn(Q,Q.return,Ze)}if(Q===O){He=null;break e}var Ie=Q.sibling;if(Ie!==null){Ie.return=Q.return,He=Ie;break e}He=Q.return}}if(Mt=_,Sl(),bs&&typeof bs.onPostCommitFiberRoot=="function")try{bs.onPostCommitFiberRoot(m0,u)}catch{}E=!0}return E}finally{Wt=b,Zi.transition=p}}return!1}function m9(u,p,b){p=hu(b,p),p=Rw(u,p,1),u=kl(u,p,1),p=$r(),u!==null&&(Qh(u,1,p),ri(u,p))}function Mn(u,p,b){if(u.tag===3)m9(u,u,b);else for(;p!==null;){if(p.tag===3){m9(p,u,b);break}else if(p.tag===1){var E=p.stateNode;if(typeof p.type.getDerivedStateFromError=="function"||typeof E.componentDidCatch=="function"&&(Ml===null||!Ml.has(E))){u=hu(b,u),u=Dw(p,u,1),p=kl(p,u,1),u=$r(),p!==null&&(Qh(p,1,u),ri(p,u));break}}p=p.return}}function XB(u,p,b){var E=u.pingCache;E!==null&&E.delete(p),p=$r(),u.pingedLanes|=u.suspendedLanes&b,ir===u&&(mr&b)===b&&(qn===4||qn===3&&(mr&130023424)===mr&&500>_e()-K5?Pc(u,0):Z5|=b),ri(u,p)}function g9(u,p){p===0&&((u.mode&1)===0?p=1:(p=U0,U0<<=1,(U0&130023424)===0&&(U0=4194304)));var b=$r();u=xo(u,p),u!==null&&(Qh(u,p,b),ri(u,b))}function VB(u){var p=u.memoizedState,b=0;p!==null&&(b=p.retryLane),g9(u,b)}function YB(u,p){var b=0;switch(u.tag){case 13:var E=u.stateNode,_=u.memoizedState;_!==null&&(b=_.retryLane);break;case 19:E=u.stateNode;break;default:throw Error(n(314))}E!==null&&E.delete(p),g9(u,b)}var U9;U9=function(u,p,b){if(u!==null)if(u.memoizedProps!==p.pendingProps||Jr.current)ti=!0;else{if((u.lanes&b)===0&&(p.flags&128)===0)return ti=!1,DB(u,p,b);ti=(u.flags&131072)!==0}else ti=!1,fn&&(p.flags&1048576)!==0&&Z4(p,F0,p.index);switch(p.lanes=0,p.tag){case 2:var E=p.type;em(u,p),u=p.pendingProps;var _=iu(p,wr.current);du(p,b),_=T5(null,p,E,u,_,b);var L=M5();return p.flags|=1,typeof _=="object"&&_!==null&&typeof _.render=="function"&&_.$$typeof===void 0?(p.tag=1,p.memoizedState=null,p.updateQueue=null,ei(E)?(L=!0,P0(p)):L=!1,p.memoizedState=_.state!==null&&_.state!==void 0?_.state:null,x5(p),_.updater=Q0,p.stateNode=_,_._reactInternals=p,j5(p,E,u,b),p=F5(null,p,E,!0,L,b)):(p.tag=0,fn&&L&&u5(p),Fr(null,p,_,b),p=p.child),p;case 16:E=p.elementType;e:{switch(em(u,p),u=p.pendingProps,_=E._init,E=_(E._payload),p.type=E,_=p.tag=qB(E),u=La(E,u),_){case 0:p=O5(null,p,E,u,b);break e;case 1:p=Hw(null,p,E,u,b);break e;case 11:p=Ow(null,p,E,u,b);break e;case 14:p=Fw(null,p,E,La(E.type,u),b);break e}throw Error(n(306,E,""))}return p;case 0:return E=p.type,_=p.pendingProps,_=p.elementType===E?_:La(E,_),O5(u,p,E,_,b);case 1:return E=p.type,_=p.pendingProps,_=p.elementType===E?_:La(E,_),Hw(u,p,E,_,b);case 3:e:{if(Ww(p),u===null)throw Error(n(387));E=p.pendingProps,L=p.memoizedState,_=L.element,aw(u,p),X0(p,E,null,b);var O=p.memoizedState;if(E=O.element,L.isDehydrated)if(L={element:E,isDehydrated:!1,cache:O.cache,pendingSuspenseBoundaries:O.pendingSuspenseBoundaries,transitions:O.transitions},p.updateQueue.baseState=L,p.memoizedState=L,p.flags&256){_=hu(Error(n(423)),p),p=Xw(u,p,E,b,_);break e}else if(E!==_){_=hu(Error(n(424)),p),p=Xw(u,p,E,b,_);break e}else for(Mi=wl(p.stateNode.containerInfo.firstChild),Ti=p,fn=!0,Aa=null,b=rw(p,null,E,b),p.child=b;b;)b.flags=b.flags&-3|4096,b=b.sibling;else{if(ou(),E===_){p=Eo(u,p,b);break e}Fr(u,p,E,b)}p=p.child}return p;case 5:return lw(p),u===null&&p5(p),E=p.type,_=p.pendingProps,L=u!==null?u.memoizedProps:null,O=_.children,a5(E,_)?O=null:L!==null&&a5(E,L)&&(p.flags|=32),zw(u,p),Fr(u,p,O,b),p.child;case 6:return u===null&&p5(p),null;case 13:return Vw(u,p,b);case 4:return w5(p,p.stateNode.containerInfo),E=p.pendingProps,u===null?p.child=lu(p,null,E,b):Fr(u,p,E,b),p.child;case 11:return E=p.type,_=p.pendingProps,_=p.elementType===E?_:La(E,_),Ow(u,p,E,_,b);case 7:return Fr(u,p,p.pendingProps,b),p.child;case 8:return Fr(u,p,p.pendingProps.children,b),p.child;case 12:return Fr(u,p,p.pendingProps.children,b),p.child;case 10:e:{if(E=p.type._context,_=p.pendingProps,L=p.memoizedProps,O=_.value,tn(z0,E._currentValue),E._currentValue=O,L!==null)if(Ia(L.value,O)){if(L.children===_.children&&!Jr.current){p=Eo(u,p,b);break e}}else for(L=p.child,L!==null&&(L.return=p);L!==null;){var Q=L.dependencies;if(Q!==null){O=L.child;for(var J=Q.firstContext;J!==null;){if(J.context===E){if(L.tag===1){J=wo(-1,b&-b),J.tag=2;var fe=L.updateQueue;if(fe!==null){fe=fe.shared;var Ee=fe.pending;Ee===null?J.next=J:(J.next=Ee.next,Ee.next=J),fe.pending=J}}L.lanes|=b,J=L.alternate,J!==null&&(J.lanes|=b),y5(L.return,b,p),Q.lanes|=b;break}J=J.next}}else if(L.tag===10)O=L.type===p.type?null:L.child;else if(L.tag===18){if(O=L.return,O===null)throw Error(n(341));O.lanes|=b,Q=O.alternate,Q!==null&&(Q.lanes|=b),y5(O,b,p),O=L.sibling}else O=L.child;if(O!==null)O.return=L;else for(O=L;O!==null;){if(O===p){O=null;break}if(L=O.sibling,L!==null){L.return=O.return,O=L;break}O=O.return}L=O}Fr(u,p,_.children,b),p=p.child}return p;case 9:return _=p.type,E=p.pendingProps.children,du(p,b),_=Gi(_),E=E(_),p.flags|=1,Fr(u,p,E,b),p.child;case 14:return E=p.type,_=La(E,p.pendingProps),_=La(E.type,_),Fw(u,p,E,_,b);case 15:return $w(u,p,p.type,p.pendingProps,b);case 17:return E=p.type,_=p.pendingProps,_=p.elementType===E?_:La(E,_),em(u,p),p.tag=1,ei(E)?(u=!0,P0(p)):u=!1,du(p,b),Aw(p,E,_),j5(p,E,_,b),F5(null,p,E,!0,u,b);case 19:return Gw(u,p,b);case 22:return Bw(u,p,b)}throw Error(n(156,p.tag))};function b9(u,p){return se(u,p)}function GB(u,p,b,E){this.tag=u,this.key=b,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=p,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=E,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ki(u,p,b,E){return new GB(u,p,b,E)}function ab(u){return u=u.prototype,!(!u||!u.isReactComponent)}function qB(u){if(typeof u=="function")return ab(u)?1:0;if(u!=null){if(u=u.$$typeof,u===F)return 11;if(u===W)return 14}return 2}function Rl(u,p){var b=u.alternate;return b===null?(b=Ki(u.tag,p,u.key,u.mode),b.elementType=u.elementType,b.type=u.type,b.stateNode=u.stateNode,b.alternate=u,u.alternate=b):(b.pendingProps=p,b.type=u.type,b.flags=0,b.subtreeFlags=0,b.deletions=null),b.flags=u.flags&14680064,b.childLanes=u.childLanes,b.lanes=u.lanes,b.child=u.child,b.memoizedProps=u.memoizedProps,b.memoizedState=u.memoizedState,b.updateQueue=u.updateQueue,p=u.dependencies,b.dependencies=p===null?null:{lanes:p.lanes,firstContext:p.firstContext},b.sibling=u.sibling,b.index=u.index,b.ref=u.ref,b}function um(u,p,b,E,_,L){var O=2;if(E=u,typeof u=="function")ab(u)&&(O=1);else if(typeof u=="string")O=5;else e:switch(u){case T:return Oc(b.children,_,L,p);case R:O=8,_|=8;break;case j:return u=Ki(12,b,p,_|2),u.elementType=j,u.lanes=L,u;case $:return u=Ki(13,b,p,_),u.elementType=$,u.lanes=L,u;case q:return u=Ki(19,b,p,_),u.elementType=q,u.lanes=L,u;case B:return hm(b,_,L,p);default:if(typeof u=="object"&&u!==null)switch(u.$$typeof){case P:O=10;break e;case N:O=9;break e;case F:O=11;break e;case W:O=14;break e;case V:O=16,E=null;break e}throw Error(n(130,u==null?u:typeof u,""))}return p=Ki(O,b,p,_),p.elementType=u,p.type=E,p.lanes=L,p}function Oc(u,p,b,E){return u=Ki(7,u,E,p),u.lanes=b,u}function hm(u,p,b,E){return u=Ki(22,u,E,p),u.elementType=B,u.lanes=b,u.stateNode={isHidden:!1},u}function sb(u,p,b){return u=Ki(6,u,null,p),u.lanes=b,u}function ob(u,p,b){return p=Ki(4,u.children!==null?u.children:[],u.key,p),p.lanes=b,p.stateNode={containerInfo:u.containerInfo,pendingChildren:null,implementation:u.implementation},p}function ZB(u,p,b,E,_){this.tag=p,this.containerInfo=u,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=D6(0),this.expirationTimes=D6(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=D6(0),this.identifierPrefix=E,this.onRecoverableError=_,this.mutableSourceEagerHydrationData=null}function lb(u,p,b,E,_,L,O,Q,J){return u=new ZB(u,p,b,Q,J),p===1?(p=1,L===!0&&(p|=8)):p=0,L=Ki(3,null,null,p),u.current=L,L.stateNode=u,L.memoizedState={element:E,isDehydrated:b,cache:null,transitions:null,pendingSuspenseBoundaries:null},x5(L),u}function KB(u,p,b){var E=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:M,key:E==null?null:""+E,children:u,containerInfo:p,implementation:b}}function y9(u){if(!u)return Cl;u=u._reactInternals;e:{if(Xi(u)!==u||u.tag!==1)throw Error(n(170));var p=u;do{switch(p.tag){case 3:p=p.stateNode.context;break e;case 1:if(ei(p.type)){p=p.stateNode.__reactInternalMemoizedMergedChildContext;break e}}p=p.return}while(p!==null);throw Error(n(171))}if(u.tag===1){var b=u.type;if(ei(b))return Y4(u,b,p)}return p}function v9(u,p,b,E,_,L,O,Q,J){return u=lb(b,E,!0,u,_,L,O,Q,J),u.context=y9(null),b=u.current,E=$r(),_=Al(b),L=wo(E,_),L.callback=p??null,kl(b,L,_),u.current.lanes=_,Qh(u,_,E),ri(u,E),u}function fm(u,p,b,E){var _=p.current,L=$r(),O=Al(_);return b=y9(b),p.context===null?p.context=b:p.pendingContext=b,p=wo(L,O),p.payload={element:u},E=E===void 0?null:E,E!==null&&(p.callback=E),u=kl(_,p,O),u!==null&&(ja(u,_,O,L),W0(u,_,O)),O}function pm(u){if(u=u.current,!u.child)return null;switch(u.child.tag){case 5:return u.child.stateNode;default:return u.child.stateNode}}function x9(u,p){if(u=u.memoizedState,u!==null&&u.dehydrated!==null){var b=u.retryLane;u.retryLane=b!==0&&b<p?b:p}}function cb(u,p){x9(u,p),(u=u.alternate)&&x9(u,p)}function QB(){return null}var w9=typeof reportError=="function"?reportError:function(u){console.error(u)};function db(u){this._internalRoot=u}mm.prototype.render=db.prototype.render=function(u){var p=this._internalRoot;if(p===null)throw Error(n(409));fm(u,p,null,null)},mm.prototype.unmount=db.prototype.unmount=function(){var u=this._internalRoot;if(u!==null){this._internalRoot=null;var p=u.containerInfo;jc(function(){fm(null,u,null,null)}),p[Uo]=null}};function mm(u){this._internalRoot=u}mm.prototype.unstable_scheduleHydration=function(u){if(u){var p=a4();u={blockedOn:null,target:u,priority:p};for(var b=0;b<yl.length&&p!==0&&p<yl[b].priority;b++);yl.splice(b,0,u),b===0&&l4(u)}};function ub(u){return!(!u||u.nodeType!==1&&u.nodeType!==9&&u.nodeType!==11)}function gm(u){return!(!u||u.nodeType!==1&&u.nodeType!==9&&u.nodeType!==11&&(u.nodeType!==8||u.nodeValue!==" react-mount-point-unstable "))}function E9(){}function JB(u,p,b,E,_){if(_){if(typeof E=="function"){var L=E;E=function(){var fe=pm(O);L.call(fe)}}var O=v9(p,E,u,0,null,!1,!1,"",E9);return u._reactRootContainer=O,u[Uo]=O.current,ff(u.nodeType===8?u.parentNode:u),jc(),O}for(;_=u.lastChild;)u.removeChild(_);if(typeof E=="function"){var Q=E;E=function(){var fe=pm(J);Q.call(fe)}}var J=lb(u,0,!1,null,null,!1,!1,"",E9);return u._reactRootContainer=J,u[Uo]=J.current,ff(u.nodeType===8?u.parentNode:u),jc(function(){fm(p,J,b,E)}),J}function Um(u,p,b,E,_){var L=b._reactRootContainer;if(L){var O=L;if(typeof _=="function"){var Q=_;_=function(){var J=pm(O);Q.call(J)}}fm(p,O,u,_)}else O=JB(b,p,u,_,E);return pm(O)}r4=function(u){switch(u.tag){case 3:var p=u.stateNode;if(p.current.memoizedState.isDehydrated){var b=Kh(p.pendingLanes);b!==0&&(j6(p,b|1),ri(p,_e()),(Mt&6)===0&&(mu=_e()+500,Sl()))}break;case 13:jc(function(){var E=xo(u,1);if(E!==null){var _=$r();ja(E,u,1,_)}}),cb(u,1)}},P6=function(u){if(u.tag===13){var p=xo(u,134217728);if(p!==null){var b=$r();ja(p,u,134217728,b)}cb(u,134217728)}},i4=function(u){if(u.tag===13){var p=Al(u),b=xo(u,p);if(b!==null){var E=$r();ja(b,u,p,E)}cb(u,p)}},a4=function(){return Wt},s4=function(u,p){var b=Wt;try{return Wt=u,p()}finally{Wt=b}},uo=function(u,p,b){switch(p){case"input":if(hn(u,b),p=b.name,b.type==="radio"&&p!=null){for(b=u;b.parentNode;)b=b.parentNode;for(b=b.querySelectorAll("input[name="+JSON.stringify(""+p)+'][type="radio"]'),p=0;p<b.length;p++){var E=b[p];if(E!==u&&E.form===u.form){var _=D0(E);if(!_)throw Error(n(90));ut(E),hn(E,_)}}}break;case"textarea":wa(u,b);break;case"select":p=b.value,p!=null&&xr(u,!!b.multiple,p,!1)}},ho=nb,Si=jc;var ez={usingClientEntryPoint:!1,Events:[gf,nu,D0,_c,gs,nb]},If={findFiberByHostInstance:kc,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},tz={bundleType:If.bundleType,version:If.version,rendererPackageName:If.rendererPackageName,rendererConfig:If.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:S.ReactCurrentDispatcher,findHostInstanceByFiber:function(u){return u=ae(u),u===null?null:u.stateNode},findFiberByHostInstance:If.findFiberByHostInstance||QB,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var bm=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!bm.isDisabled&&bm.supportsFiber)try{m0=bm.inject(tz),bs=bm}catch{}}return ii.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=ez,ii.createPortal=function(u,p){var b=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!ub(p))throw Error(n(200));return KB(u,p,null,b)},ii.createRoot=function(u,p){if(!ub(u))throw Error(n(299));var b=!1,E="",_=w9;return p!=null&&(p.unstable_strictMode===!0&&(b=!0),p.identifierPrefix!==void 0&&(E=p.identifierPrefix),p.onRecoverableError!==void 0&&(_=p.onRecoverableError)),p=lb(u,1,!1,null,null,b,!1,E,_),u[Uo]=p.current,ff(u.nodeType===8?u.parentNode:u),new db(p)},ii.findDOMNode=function(u){if(u==null)return null;if(u.nodeType===1)return u;var p=u._reactInternals;if(p===void 0)throw typeof u.render=="function"?Error(n(188)):(u=Object.keys(u).join(","),Error(n(268,u)));return u=ae(p),u=u===null?null:u.stateNode,u},ii.flushSync=function(u){return jc(u)},ii.hydrate=function(u,p,b){if(!gm(p))throw Error(n(200));return Um(null,u,p,!0,b)},ii.hydrateRoot=function(u,p,b){if(!ub(u))throw Error(n(405));var E=b!=null&&b.hydratedSources||null,_=!1,L="",O=w9;if(b!=null&&(b.unstable_strictMode===!0&&(_=!0),b.identifierPrefix!==void 0&&(L=b.identifierPrefix),b.onRecoverableError!==void 0&&(O=b.onRecoverableError)),p=v9(p,null,u,1,b??null,_,!1,L,O),u[Uo]=p.current,ff(u),E)for(u=0;u<E.length;u++)b=E[u],_=b._getVersion,_=_(b._source),p.mutableSourceEagerHydrationData==null?p.mutableSourceEagerHydrationData=[b,_]:p.mutableSourceEagerHydrationData.push(b,_);return new mm(p)},ii.render=function(u,p,b){if(!gm(p))throw Error(n(200));return Um(null,u,p,!1,b)},ii.unmountComponentAtNode=function(u){if(!gm(u))throw Error(n(40));return u._reactRootContainer?(jc(function(){Um(null,null,u,!1,function(){u._reactRootContainer=null,u[Uo]=null})}),!0):!1},ii.unstable_batchedUpdates=nb,ii.unstable_renderSubtreeIntoContainer=function(u,p,b,E){if(!gm(b))throw Error(n(200));if(u==null||u._reactInternals===void 0)throw Error(n(38));return Um(u,p,b,!1,E)},ii.version="18.3.1-next-f1338f8080-20240426",ii}var A9;function dM(){if(A9)return pb.exports;A9=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),pb.exports=cz(),pb.exports}var L9;function dz(){if(L9)return ym;L9=1;var e=dM();return ym.createRoot=e.createRoot,ym.hydrateRoot=e.hydrateRoot,ym}var uz=dz();const hz=ya(uz),fz="modulepreload",pz=function(e,t){return new URL(e,t).href},R9={},ye=function(t,n,r){let i=Promise.resolve();if(n&&n.length>0){let s=function(l){return Promise.all(l.map(h=>Promise.resolve(h).then(f=>({status:"fulfilled",value:f}),f=>({status:"rejected",reason:f}))))};const o=document.getElementsByTagName("link"),c=document.querySelector("meta[property=csp-nonce]"),d=(c==null?void 0:c.nonce)||(c==null?void 0:c.getAttribute("nonce"));i=s(n.map(l=>{if(l=pz(l,r),l in R9)return;R9[l]=!0;const h=l.endsWith(".css"),f=h?'[rel="stylesheet"]':"";if(!!r)for(let y=o.length-1;y>=0;y--){const v=o[y];if(v.href===l&&(!h||v.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${l}"]${f}`))return;const U=document.createElement("link");if(U.rel=h?"stylesheet":fz,h||(U.as="script"),U.crossOrigin="",U.href=l,d&&U.setAttribute("nonce",d),document.head.appendChild(U),h)return new Promise((y,v)=>{U.addEventListener("load",y),U.addEventListener("error",()=>v(new Error(`Unable to preload CSS for ${l}`)))})}))}function a(s){const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=s,window.dispatchEvent(o),!o.defaultPrevented)throw s}return i.then(s=>{for(const o of s||[])o.status==="rejected"&&a(o.reason);return t().catch(a)})};var Jn=dM();const mz=ya(Jn);var mt={VITE_APP_BACKEND_V2_GET_URL:"https://json.excalidraw.com/api/v2/",VITE_APP_BACKEND_V2_POST_URL:"https://json.excalidraw.com/api/v2/post/",VITE_APP_LIBRARY_URL:"https://libraries.excalidraw.com",VITE_APP_LIBRARY_BACKEND:"https://us-central1-excalidraw-room-persistence.cloudfunctions.net/libraries",VITE_APP_PLUS_LP:"https://plus.excalidraw.com",VITE_APP_PLUS_APP:"https://app.excalidraw.com",VITE_APP_AI_BACKEND:"https://oss-ai.excalidraw.com",VITE_APP_WS_SERVER_URL:"https://oss-collab.excalidraw.com",VITE_APP_FIREBASE_CONFIG:'{"apiKey":"AIzaSyAd15pYlMci_xIp9ko6wkEsDzAAA0Dn0RU","authDomain":"excalidraw-room-persistence.firebaseapp.com","databaseURL":"https://excalidraw-room-persistence.firebaseio.com","projectId":"excalidraw-room-persistence","storageBucket":"excalidraw-room-persistence.appspot.com","messagingSenderId":"654800341332","appId":"1:654800341332:web:4a692de832b55bd57ce0c1"}',VITE_APP_ENABLE_TRACKING:"false",VITE_APP_PLUS_EXPORT_PUBLIC_KEY:`MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEApQ0jM9Qz8TdFLzcuAZZX
42
- /WvuKSOJxiw6AR/ZcE3eFQWM/mbFdhQgyK8eHGkKQifKzH1xUZjCxyXcxW6ZO02t
43
- kPOPxhz+nxUrIoWCD/V4NGmUA1lxwHuO21HN1gzKrN3xHg5EGjyouR9vibT9VDGF
44
- gq6+4Ic/kJX+AD2MM7Yre2+FsOdysrmuW2Fu3ahuC1uQE7pOe1j0k7auNP0y1q53
45
- PrB8Ts2LUpepWC1l7zIXFm4ViDULuyWXTEpUcHSsEH8vpd1tckjypxCwkipfZsXx
46
- iPszy0o0Dx2iArPfWMXlFAI9mvyFCyFC3+nSvfyAUb2C4uZgCwAuyFh/ydPF4DEE
47
- PQIDAQAB`,VITE_APP_DEBUG_ENABLE_TEXT_CONTAINER_BOUNDING_BOX:"false",VITE_APP_COLLAPSE_OVERLAY:"false",VITE_APP_ENABLE_ESLINT:"false",PKG_NAME:"@excalidraw/excalidraw",PKG_VERSION:"0.18.0",PROD:!0},uM=Object.defineProperty,gz=(e,t,n)=>t in e?uM(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,l4e=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,n)=>(typeof require<"u"?require:t)[n]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')}),Uz=e=>t=>{var n=e[t];if(n)return n();throw new Error("Module not found in bundle: "+t)},hM=(e,t)=>{for(var n in t)uM(e,n,{get:t[n],enumerable:!0})},H=(e,t,n)=>(gz(e,typeof t!="symbol"?t+"":t,n),n),Ub={},D9;function fM(){return D9||(D9=1,function(e){(function(t){t(typeof DO_NOT_EXPORT_CRC>"u"?e:{})})(function(t){t.version="0.3.0";function n(){for(var d=0,l=new Array(256),h=0;h!=256;++h)d=h,d=d&1?-306674912^d>>>1:d>>>1,d=d&1?-306674912^d>>>1:d>>>1,d=d&1?-306674912^d>>>1:d>>>1,d=d&1?-306674912^d>>>1:d>>>1,d=d&1?-306674912^d>>>1:d>>>1,d=d&1?-306674912^d>>>1:d>>>1,d=d&1?-306674912^d>>>1:d>>>1,d=d&1?-306674912^d>>>1:d>>>1,l[h]=d;return typeof Int32Array<"u"?new Int32Array(l):l}var r=n(),i=typeof Buffer<"u";function a(d){if(d.length>32768&&i)return o(new Buffer(d));for(var l=-1,h=d.length-1,f=0;f<h;)l=r[(l^d.charCodeAt(f++))&255]^l>>>8,l=r[(l^d.charCodeAt(f++))&255]^l>>>8;return f===h&&(l=l>>>8^r[(l^d.charCodeAt(f))&255]),l^-1}function s(d){if(d.length>1e4)return o(d);for(var l=-1,h=0,f=d.length-3;h<f;)l=l>>>8^r[(l^d[h++])&255],l=l>>>8^r[(l^d[h++])&255],l=l>>>8^r[(l^d[h++])&255],l=l>>>8^r[(l^d[h++])&255];for(;h<f+3;)l=l>>>8^r[(l^d[h++])&255];return l^-1}function o(d){for(var l=-1,h=0,f=d.length-7;h<f;)l=l>>>8^r[(l^d[h++])&255],l=l>>>8^r[(l^d[h++])&255],l=l>>>8^r[(l^d[h++])&255],l=l>>>8^r[(l^d[h++])&255],l=l>>>8^r[(l^d[h++])&255],l=l>>>8^r[(l^d[h++])&255],l=l>>>8^r[(l^d[h++])&255],l=l>>>8^r[(l^d[h++])&255];for(;h<f+7;)l=l>>>8^r[(l^d[h++])&255];return l^-1}function c(d){for(var l=-1,h=0,f=d.length,g,U;h<f;)g=d.charCodeAt(h++),g<128?l=l>>>8^r[(l^g)&255]:g<2048?(l=l>>>8^r[(l^(192|g>>6&31))&255],l=l>>>8^r[(l^(128|g&63))&255]):g>=55296&&g<57344?(g=(g&1023)+64,U=d.charCodeAt(h++)&1023,l=l>>>8^r[(l^(240|g>>8&7))&255],l=l>>>8^r[(l^(128|g>>2&63))&255],l=l>>>8^r[(l^(128|U>>6&15|g&3))&255],l=l>>>8^r[(l^(128|U&63))&255]):(l=l>>>8^r[(l^(224|g>>12&15))&255],l=l>>>8^r[(l^(128|g>>6&63))&255],l=l>>>8^r[(l^(128|g&63))&255]);return l^-1}t.table=r,t.bstr=a,t.buf=s,t.str=c})}(Ub)),Ub}var bb,j9;function bz(){if(j9)return bb;j9=1;var e=fM();bb=i;var t=new Uint8Array(4),n=new Int32Array(t.buffer),r=new Uint32Array(t.buffer);function i(a){if(a[0]!==137)throw new Error("Invalid .png file header");if(a[1]!==80)throw new Error("Invalid .png file header");if(a[2]!==78)throw new Error("Invalid .png file header");if(a[3]!==71)throw new Error("Invalid .png file header");if(a[4]!==13)throw new Error("Invalid .png file header: possibly caused by DOS-Unix line ending conversion?");if(a[5]!==10)throw new Error("Invalid .png file header: possibly caused by DOS-Unix line ending conversion?");if(a[6]!==26)throw new Error("Invalid .png file header");if(a[7]!==10)throw new Error("Invalid .png file header: possibly caused by DOS-Unix line ending conversion?");for(var s=!1,o=[],c=8;c<a.length;){t[3]=a[c++],t[2]=a[c++],t[1]=a[c++],t[0]=a[c++];var d=r[0]+4,l=new Uint8Array(d);l[0]=a[c++],l[1]=a[c++],l[2]=a[c++],l[3]=a[c++];var h=String.fromCharCode(l[0])+String.fromCharCode(l[1])+String.fromCharCode(l[2])+String.fromCharCode(l[3]);if(!o.length&&h!=="IHDR")throw new Error("IHDR header missing");if(h==="IEND"){s=!0,o.push({name:h,data:new Uint8Array(0)});break}for(var f=4;f<d;f++)l[f]=a[c++];t[3]=a[c++],t[2]=a[c++],t[1]=a[c++],t[0]=a[c++];var g=n[0],U=e.buf(l);if(U!==g)throw new Error("CRC values for "+h+" header do not match, PNG file is likely corrupted");var y=new Uint8Array(l.buffer.slice(4));o.push({name:h,data:y})}if(!s)throw new Error(".png file ended prematurely: no IEND header was found");return o}return bb}var yz=bz();const pM=ya(yz);var vm={},yb,P9;function vz(){if(P9)return yb;P9=1,yb=e;function e(t,n){if(t=String(t),n=String(n),!/^[\x00-\xFF]+$/.test(t)||!/^[\x00-\xFF]+$/.test(n))throw new Error("Only Latin-1 characters are permitted in PNG tEXt chunks. You might want to consider base64 encoding and/or zEXt compression");if(t.length>=80)throw new Error('Keyword "'+t+'" is longer than the 79-character limit imposed by the PNG specification');for(var r=t.length+n.length+1,i=new Uint8Array(r),a=0,s,o=0;o<t.length;o++){if(!(s=t.charCodeAt(o)))throw new Error("0x00 character is not permitted in tEXt keywords");i[a++]=s}i[a++]=0;for(var c=0;c<n.length;c++){if(!(s=n.charCodeAt(c)))throw new Error("0x00 character is not permitted in tEXt content");i[a++]=s}return{name:"tEXt",data:i}}return yb}var vb,N9;function xz(){if(N9)return vb;N9=1,vb=e;function e(t){t.data&&t.name&&(t=t.data);for(var n=!0,r="",i="",a=0;a<t.length;a++){var s=t[a];if(n)s?i+=String.fromCharCode(s):n=!1;else if(s)r+=String.fromCharCode(s);else throw new Error("Invalid NULL character found. 0x00 character is not permitted in tEXt content")}return{keyword:i,text:r}}return vb}var O9;function wz(){return O9||(O9=1,vm.encode=vz(),vm.decode=xz()),vm}var Ez=wz();const mM=ya(Ez);var xb,F9;function Cz(){return F9||(F9=1,xb=function(e,t,n){var r=[],i=e.length;if(i===0)return r;var a=t<0?Math.max(0,t+i):t||0;for(n!==void 0&&(i=n<0?n+i:n);i-- >a;)r[i-a]=e[i];return r}),xb}var wb,$9;function Sz(){if($9)return wb;$9=1;var e=Cz(),t=fM();wb=a;var n=new Uint8Array(4),r=new Int32Array(n.buffer),i=new Uint32Array(n.buffer);function a(s){var o=8,c=o,d;for(d=0;d<s.length;d++)o+=s[d].data.length,o+=12;var l=new Uint8Array(o);for(l[0]=137,l[1]=80,l[2]=78,l[3]=71,l[4]=13,l[5]=10,l[6]=26,l[7]=10,d=0;d<s.length;d++){var h=s[d],f=h.name,g=h.data,U=g.length,y=[f.charCodeAt(0),f.charCodeAt(1),f.charCodeAt(2),f.charCodeAt(3)];i[0]=U,l[c++]=n[3],l[c++]=n[2],l[c++]=n[1],l[c++]=n[0],l[c++]=y[0],l[c++]=y[1],l[c++]=y[2],l[c++]=y[3];for(var v=0;v<U;)l[c++]=g[v++];var x=y.concat(e(g)),w=t.buf(x);r[0]=w,l[c++]=n[3],l[c++]=n[2],l[c++]=n[1],l[c++]=n[0]}return l}return wb}var _z=Sz();const kz=ya(_z);/*! pako 2.0.3 https://github.com/nodeca/pako @license (MIT AND Zlib) */const Tz=4,B9=0,z9=1,Mz=2;function Ph(e){let t=e.length;for(;--t>=0;)e[t]=0}const Iz=0,gM=1,Az=2,Lz=3,Rz=258,nv=29,N1=256,Zp=N1+1+nv,Yu=30,rv=19,UM=2*Zp+1,td=15,Eb=16,Dz=7,iv=256,bM=16,yM=17,vM=18,o3=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),ag=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),jz=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),xM=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Pz=512,jo=new Array((Zp+2)*2);Ph(jo);const Sp=new Array(Yu*2);Ph(Sp);const Kp=new Array(Pz);Ph(Kp);const Qp=new Array(Rz-Lz+1);Ph(Qp);const av=new Array(nv);Ph(av);const Yg=new Array(Yu);Ph(Yg);function Cb(e,t,n,r,i){this.static_tree=e,this.extra_bits=t,this.extra_base=n,this.elems=r,this.max_length=i,this.has_stree=e&&e.length}let wM,EM,CM;function Sb(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}const SM=e=>e<256?Kp[e]:Kp[256+(e>>>7)],Jp=(e,t)=>{e.pending_buf[e.pending++]=t&255,e.pending_buf[e.pending++]=t>>>8&255},hi=(e,t,n)=>{e.bi_valid>Eb-n?(e.bi_buf|=t<<e.bi_valid&65535,Jp(e,e.bi_buf),e.bi_buf=t>>Eb-e.bi_valid,e.bi_valid+=n-Eb):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=n)},js=(e,t,n)=>{hi(e,n[t*2],n[t*2+1])},_M=(e,t)=>{let n=0;do n|=e&1,e>>>=1,n<<=1;while(--t>0);return n>>>1},Nz=e=>{e.bi_valid===16?(Jp(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=e.bi_buf&255,e.bi_buf>>=8,e.bi_valid-=8)},Oz=(e,t)=>{const n=t.dyn_tree,r=t.max_code,i=t.stat_desc.static_tree,a=t.stat_desc.has_stree,s=t.stat_desc.extra_bits,o=t.stat_desc.extra_base,c=t.stat_desc.max_length;let d,l,h,f,g,U,y=0;for(f=0;f<=td;f++)e.bl_count[f]=0;for(n[e.heap[e.heap_max]*2+1]=0,d=e.heap_max+1;d<UM;d++)l=e.heap[d],f=n[n[l*2+1]*2+1]+1,f>c&&(f=c,y++),n[l*2+1]=f,!(l>r)&&(e.bl_count[f]++,g=0,l>=o&&(g=s[l-o]),U=n[l*2],e.opt_len+=U*(f+g),a&&(e.static_len+=U*(i[l*2+1]+g)));if(y!==0){do{for(f=c-1;e.bl_count[f]===0;)f--;e.bl_count[f]--,e.bl_count[f+1]+=2,e.bl_count[c]--,y-=2}while(y>0);for(f=c;f!==0;f--)for(l=e.bl_count[f];l!==0;)h=e.heap[--d],!(h>r)&&(n[h*2+1]!==f&&(e.opt_len+=(f-n[h*2+1])*n[h*2],n[h*2+1]=f),l--)}},kM=(e,t,n)=>{const r=new Array(td+1);let i=0,a,s;for(a=1;a<=td;a++)r[a]=i=i+n[a-1]<<1;for(s=0;s<=t;s++){let o=e[s*2+1];o!==0&&(e[s*2]=_M(r[o]++,o))}},Fz=()=>{let e,t,n,r,i;const a=new Array(td+1);for(n=0,r=0;r<nv-1;r++)for(av[r]=n,e=0;e<1<<o3[r];e++)Qp[n++]=r;for(Qp[n-1]=r,i=0,r=0;r<16;r++)for(Yg[r]=i,e=0;e<1<<ag[r];e++)Kp[i++]=r;for(i>>=7;r<Yu;r++)for(Yg[r]=i<<7,e=0;e<1<<ag[r]-7;e++)Kp[256+i++]=r;for(t=0;t<=td;t++)a[t]=0;for(e=0;e<=143;)jo[e*2+1]=8,e++,a[8]++;for(;e<=255;)jo[e*2+1]=9,e++,a[9]++;for(;e<=279;)jo[e*2+1]=7,e++,a[7]++;for(;e<=287;)jo[e*2+1]=8,e++,a[8]++;for(kM(jo,Zp+1,a),e=0;e<Yu;e++)Sp[e*2+1]=5,Sp[e*2]=_M(e,5);wM=new Cb(jo,o3,N1+1,Zp,td),EM=new Cb(Sp,ag,0,Yu,td),CM=new Cb(new Array(0),jz,0,rv,Dz)},TM=e=>{let t;for(t=0;t<Zp;t++)e.dyn_ltree[t*2]=0;for(t=0;t<Yu;t++)e.dyn_dtree[t*2]=0;for(t=0;t<rv;t++)e.bl_tree[t*2]=0;e.dyn_ltree[iv*2]=1,e.opt_len=e.static_len=0,e.last_lit=e.matches=0},MM=e=>{e.bi_valid>8?Jp(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0},$z=(e,t,n,r)=>{MM(e),Jp(e,n),Jp(e,~n),e.pending_buf.set(e.window.subarray(t,t+n),e.pending),e.pending+=n},H9=(e,t,n,r)=>{const i=t*2,a=n*2;return e[i]<e[a]||e[i]===e[a]&&r[t]<=r[n]},_b=(e,t,n)=>{const r=e.heap[n];let i=n<<1;for(;i<=e.heap_len&&(i<e.heap_len&&H9(t,e.heap[i+1],e.heap[i],e.depth)&&i++,!H9(t,r,e.heap[i],e.depth));)e.heap[n]=e.heap[i],n=i,i<<=1;e.heap[n]=r},W9=(e,t,n)=>{let r,i,a=0,s,o;if(e.last_lit!==0)do r=e.pending_buf[e.d_buf+a*2]<<8|e.pending_buf[e.d_buf+a*2+1],i=e.pending_buf[e.l_buf+a],a++,r===0?js(e,i,t):(s=Qp[i],js(e,s+N1+1,t),o=o3[s],o!==0&&(i-=av[s],hi(e,i,o)),r--,s=SM(r),js(e,s,n),o=ag[s],o!==0&&(r-=Yg[s],hi(e,r,o)));while(a<e.last_lit);js(e,iv,t)},l3=(e,t)=>{const n=t.dyn_tree,r=t.stat_desc.static_tree,i=t.stat_desc.has_stree,a=t.stat_desc.elems;let s,o,c=-1,d;for(e.heap_len=0,e.heap_max=UM,s=0;s<a;s++)n[s*2]!==0?(e.heap[++e.heap_len]=c=s,e.depth[s]=0):n[s*2+1]=0;for(;e.heap_len<2;)d=e.heap[++e.heap_len]=c<2?++c:0,n[d*2]=1,e.depth[d]=0,e.opt_len--,i&&(e.static_len-=r[d*2+1]);for(t.max_code=c,s=e.heap_len>>1;s>=1;s--)_b(e,n,s);d=a;do s=e.heap[1],e.heap[1]=e.heap[e.heap_len--],_b(e,n,1),o=e.heap[1],e.heap[--e.heap_max]=s,e.heap[--e.heap_max]=o,n[d*2]=n[s*2]+n[o*2],e.depth[d]=(e.depth[s]>=e.depth[o]?e.depth[s]:e.depth[o])+1,n[s*2+1]=n[o*2+1]=d,e.heap[1]=d++,_b(e,n,1);while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],Oz(e,t),kM(n,c,e.bl_count)},X9=(e,t,n)=>{let r,i=-1,a,s=t[0*2+1],o=0,c=7,d=4;for(s===0&&(c=138,d=3),t[(n+1)*2+1]=65535,r=0;r<=n;r++)a=s,s=t[(r+1)*2+1],!(++o<c&&a===s)&&(o<d?e.bl_tree[a*2]+=o:a!==0?(a!==i&&e.bl_tree[a*2]++,e.bl_tree[bM*2]++):o<=10?e.bl_tree[yM*2]++:e.bl_tree[vM*2]++,o=0,i=a,s===0?(c=138,d=3):a===s?(c=6,d=3):(c=7,d=4))},V9=(e,t,n)=>{let r,i=-1,a,s=t[0*2+1],o=0,c=7,d=4;for(s===0&&(c=138,d=3),r=0;r<=n;r++)if(a=s,s=t[(r+1)*2+1],!(++o<c&&a===s)){if(o<d)do js(e,a,e.bl_tree);while(--o!==0);else a!==0?(a!==i&&(js(e,a,e.bl_tree),o--),js(e,bM,e.bl_tree),hi(e,o-3,2)):o<=10?(js(e,yM,e.bl_tree),hi(e,o-3,3)):(js(e,vM,e.bl_tree),hi(e,o-11,7));o=0,i=a,s===0?(c=138,d=3):a===s?(c=6,d=3):(c=7,d=4)}},Bz=e=>{let t;for(X9(e,e.dyn_ltree,e.l_desc.max_code),X9(e,e.dyn_dtree,e.d_desc.max_code),l3(e,e.bl_desc),t=rv-1;t>=3&&e.bl_tree[xM[t]*2+1]===0;t--);return e.opt_len+=3*(t+1)+5+5+4,t},zz=(e,t,n,r)=>{let i;for(hi(e,t-257,5),hi(e,n-1,5),hi(e,r-4,4),i=0;i<r;i++)hi(e,e.bl_tree[xM[i]*2+1],3);V9(e,e.dyn_ltree,t-1),V9(e,e.dyn_dtree,n-1)},Hz=e=>{let t=4093624447,n;for(n=0;n<=31;n++,t>>>=1)if(t&1&&e.dyn_ltree[n*2]!==0)return B9;if(e.dyn_ltree[9*2]!==0||e.dyn_ltree[10*2]!==0||e.dyn_ltree[13*2]!==0)return z9;for(n=32;n<N1;n++)if(e.dyn_ltree[n*2]!==0)return z9;return B9};let Y9=!1;const Wz=e=>{Y9||(Fz(),Y9=!0),e.l_desc=new Sb(e.dyn_ltree,wM),e.d_desc=new Sb(e.dyn_dtree,EM),e.bl_desc=new Sb(e.bl_tree,CM),e.bi_buf=0,e.bi_valid=0,TM(e)},IM=(e,t,n,r)=>{hi(e,(Iz<<1)+(r?1:0),3),$z(e,t,n)},Xz=e=>{hi(e,gM<<1,3),js(e,iv,jo),Nz(e)},Vz=(e,t,n,r)=>{let i,a,s=0;e.level>0?(e.strm.data_type===Mz&&(e.strm.data_type=Hz(e)),l3(e,e.l_desc),l3(e,e.d_desc),s=Bz(e),i=e.opt_len+3+7>>>3,a=e.static_len+3+7>>>3,a<=i&&(i=a)):i=a=n+5,n+4<=i&&t!==-1?IM(e,t,n,r):e.strategy===Tz||a===i?(hi(e,(gM<<1)+(r?1:0),3),W9(e,jo,Sp)):(hi(e,(Az<<1)+(r?1:0),3),zz(e,e.l_desc.max_code+1,e.d_desc.max_code+1,s+1),W9(e,e.dyn_ltree,e.dyn_dtree)),TM(e),r&&MM(e)},Yz=(e,t,n)=>(e.pending_buf[e.d_buf+e.last_lit*2]=t>>>8&255,e.pending_buf[e.d_buf+e.last_lit*2+1]=t&255,e.pending_buf[e.l_buf+e.last_lit]=n&255,e.last_lit++,t===0?e.dyn_ltree[n*2]++:(e.matches++,t--,e.dyn_ltree[(Qp[n]+N1+1)*2]++,e.dyn_dtree[SM(t)*2]++),e.last_lit===e.lit_bufsize-1);var Gz=Wz,qz=IM,Zz=Vz,Kz=Yz,Qz=Xz,Jz={_tr_init:Gz,_tr_stored_block:qz,_tr_flush_block:Zz,_tr_tally:Kz,_tr_align:Qz};const eH=(e,t,n,r)=>{let i=e&65535|0,a=e>>>16&65535|0,s=0;for(;n!==0;){s=n>2e3?2e3:n,n-=s;do i=i+t[r++]|0,a=a+i|0;while(--s);i%=65521,a%=65521}return i|a<<16|0};var e1=eH;const tH=()=>{let e,t=[];for(var n=0;n<256;n++){e=n;for(var r=0;r<8;r++)e=e&1?3988292384^e>>>1:e>>>1;t[n]=e}return t},nH=new Uint32Array(tH()),rH=(e,t,n,r)=>{const i=nH,a=r+n;e^=-1;for(let s=r;s<a;s++)e=e>>>8^i[(e^t[s])&255];return e^-1};var or=rH,bd={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},hU={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_UNKNOWN:2,Z_DEFLATED:8};const{_tr_init:iH,_tr_stored_block:aH,_tr_flush_block:sH,_tr_tally:ic,_tr_align:oH}=Jz,{Z_NO_FLUSH:$d,Z_PARTIAL_FLUSH:lH,Z_FULL_FLUSH:cH,Z_FINISH:ac,Z_BLOCK:G9,Z_OK:Ps,Z_STREAM_END:q9,Z_STREAM_ERROR:ca,Z_DATA_ERROR:dH,Z_BUF_ERROR:kb,Z_DEFAULT_COMPRESSION:uH,Z_FILTERED:hH,Z_HUFFMAN_ONLY:xm,Z_RLE:fH,Z_FIXED:pH,Z_DEFAULT_STRATEGY:mH,Z_UNKNOWN:gH,Z_DEFLATED:fU}=hU,UH=9,bH=15,yH=8,vH=29,xH=256,c3=xH+1+vH,wH=30,EH=19,CH=2*c3+1,SH=15,_t=3,Ql=258,Ka=Ql+_t+1,_H=32,pU=42,d3=69,sg=73,og=91,lg=103,nd=113,op=666,er=1,O1=2,yd=3,Nh=4,kH=3,Jl=(e,t)=>(e.msg=bd[t],t),Z9=e=>(e<<1)-(e>4?9:0),Zl=e=>{let t=e.length;for(;--t>=0;)e[t]=0};let TH=(e,t,n)=>(t<<e.hash_shift^n)&e.hash_mask,sc=TH;const $l=e=>{const t=e.state;let n=t.pending;n>e.avail_out&&(n=e.avail_out),n!==0&&(e.output.set(t.pending_buf.subarray(t.pending_out,t.pending_out+n),e.next_out),e.next_out+=n,t.pending_out+=n,e.total_out+=n,e.avail_out-=n,t.pending-=n,t.pending===0&&(t.pending_out=0))},br=(e,t)=>{sH(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,$l(e.strm)},Pt=(e,t)=>{e.pending_buf[e.pending++]=t},Lf=(e,t)=>{e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=t&255},MH=(e,t,n,r)=>{let i=e.avail_in;return i>r&&(i=r),i===0?0:(e.avail_in-=i,t.set(e.input.subarray(e.next_in,e.next_in+i),n),e.state.wrap===1?e.adler=e1(e.adler,t,i,n):e.state.wrap===2&&(e.adler=or(e.adler,t,i,n)),e.next_in+=i,e.total_in+=i,i)},AM=(e,t)=>{let n=e.max_chain_length,r=e.strstart,i,a,s=e.prev_length,o=e.nice_match;const c=e.strstart>e.w_size-Ka?e.strstart-(e.w_size-Ka):0,d=e.window,l=e.w_mask,h=e.prev,f=e.strstart+Ql;let g=d[r+s-1],U=d[r+s];e.prev_length>=e.good_match&&(n>>=2),o>e.lookahead&&(o=e.lookahead);do if(i=t,!(d[i+s]!==U||d[i+s-1]!==g||d[i]!==d[r]||d[++i]!==d[r+1])){r+=2,i++;do;while(d[++r]===d[++i]&&d[++r]===d[++i]&&d[++r]===d[++i]&&d[++r]===d[++i]&&d[++r]===d[++i]&&d[++r]===d[++i]&&d[++r]===d[++i]&&d[++r]===d[++i]&&r<f);if(a=Ql-(f-r),r=f-Ql,a>s){if(e.match_start=t,s=a,a>=o)break;g=d[r+s-1],U=d[r+s]}}while((t=h[t&l])>c&&--n!==0);return s<=e.lookahead?s:e.lookahead},vd=e=>{const t=e.w_size;let n,r,i,a,s;do{if(a=e.window_size-e.lookahead-e.strstart,e.strstart>=t+(t-Ka)){e.window.set(e.window.subarray(t,t+t),0),e.match_start-=t,e.strstart-=t,e.block_start-=t,r=e.hash_size,n=r;do i=e.head[--n],e.head[n]=i>=t?i-t:0;while(--r);r=t,n=r;do i=e.prev[--n],e.prev[n]=i>=t?i-t:0;while(--r);a+=t}if(e.strm.avail_in===0)break;if(r=MH(e.strm,e.window,e.strstart+e.lookahead,a),e.lookahead+=r,e.lookahead+e.insert>=_t)for(s=e.strstart-e.insert,e.ins_h=e.window[s],e.ins_h=sc(e,e.ins_h,e.window[s+1]);e.insert&&(e.ins_h=sc(e,e.ins_h,e.window[s+_t-1]),e.prev[s&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=s,s++,e.insert--,!(e.lookahead+e.insert<_t)););}while(e.lookahead<Ka&&e.strm.avail_in!==0)},IH=(e,t)=>{let n=65535;for(n>e.pending_buf_size-5&&(n=e.pending_buf_size-5);;){if(e.lookahead<=1){if(vd(e),e.lookahead===0&&t===$d)return er;if(e.lookahead===0)break}e.strstart+=e.lookahead,e.lookahead=0;const r=e.block_start+n;if((e.strstart===0||e.strstart>=r)&&(e.lookahead=e.strstart-r,e.strstart=r,br(e,!1),e.strm.avail_out===0)||e.strstart-e.block_start>=e.w_size-Ka&&(br(e,!1),e.strm.avail_out===0))return er}return e.insert=0,t===ac?(br(e,!0),e.strm.avail_out===0?yd:Nh):(e.strstart>e.block_start&&(br(e,!1),e.strm.avail_out===0),er)},Tb=(e,t)=>{let n,r;for(;;){if(e.lookahead<Ka){if(vd(e),e.lookahead<Ka&&t===$d)return er;if(e.lookahead===0)break}if(n=0,e.lookahead>=_t&&(e.ins_h=sc(e,e.ins_h,e.window[e.strstart+_t-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),n!==0&&e.strstart-n<=e.w_size-Ka&&(e.match_length=AM(e,n)),e.match_length>=_t)if(r=ic(e,e.strstart-e.match_start,e.match_length-_t),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=_t){e.match_length--;do e.strstart++,e.ins_h=sc(e,e.ins_h,e.window[e.strstart+_t-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart;while(--e.match_length!==0);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=sc(e,e.ins_h,e.window[e.strstart+1]);else r=ic(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(r&&(br(e,!1),e.strm.avail_out===0))return er}return e.insert=e.strstart<_t-1?e.strstart:_t-1,t===ac?(br(e,!0),e.strm.avail_out===0?yd:Nh):e.last_lit&&(br(e,!1),e.strm.avail_out===0)?er:O1},Uu=(e,t)=>{let n,r,i;for(;;){if(e.lookahead<Ka){if(vd(e),e.lookahead<Ka&&t===$d)return er;if(e.lookahead===0)break}if(n=0,e.lookahead>=_t&&(e.ins_h=sc(e,e.ins_h,e.window[e.strstart+_t-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=_t-1,n!==0&&e.prev_length<e.max_lazy_match&&e.strstart-n<=e.w_size-Ka&&(e.match_length=AM(e,n),e.match_length<=5&&(e.strategy===hH||e.match_length===_t&&e.strstart-e.match_start>4096)&&(e.match_length=_t-1)),e.prev_length>=_t&&e.match_length<=e.prev_length){i=e.strstart+e.lookahead-_t,r=ic(e,e.strstart-1-e.prev_match,e.prev_length-_t),e.lookahead-=e.prev_length-1,e.prev_length-=2;do++e.strstart<=i&&(e.ins_h=sc(e,e.ins_h,e.window[e.strstart+_t-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart);while(--e.prev_length!==0);if(e.match_available=0,e.match_length=_t-1,e.strstart++,r&&(br(e,!1),e.strm.avail_out===0))return er}else if(e.match_available){if(r=ic(e,0,e.window[e.strstart-1]),r&&br(e,!1),e.strstart++,e.lookahead--,e.strm.avail_out===0)return er}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(r=ic(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<_t-1?e.strstart:_t-1,t===ac?(br(e,!0),e.strm.avail_out===0?yd:Nh):e.last_lit&&(br(e,!1),e.strm.avail_out===0)?er:O1},AH=(e,t)=>{let n,r,i,a;const s=e.window;for(;;){if(e.lookahead<=Ql){if(vd(e),e.lookahead<=Ql&&t===$d)return er;if(e.lookahead===0)break}if(e.match_length=0,e.lookahead>=_t&&e.strstart>0&&(i=e.strstart-1,r=s[i],r===s[++i]&&r===s[++i]&&r===s[++i])){a=e.strstart+Ql;do;while(r===s[++i]&&r===s[++i]&&r===s[++i]&&r===s[++i]&&r===s[++i]&&r===s[++i]&&r===s[++i]&&r===s[++i]&&i<a);e.match_length=Ql-(a-i),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=_t?(n=ic(e,1,e.match_length-_t),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(n=ic(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),n&&(br(e,!1),e.strm.avail_out===0))return er}return e.insert=0,t===ac?(br(e,!0),e.strm.avail_out===0?yd:Nh):e.last_lit&&(br(e,!1),e.strm.avail_out===0)?er:O1},LH=(e,t)=>{let n;for(;;){if(e.lookahead===0&&(vd(e),e.lookahead===0)){if(t===$d)return er;break}if(e.match_length=0,n=ic(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,n&&(br(e,!1),e.strm.avail_out===0))return er}return e.insert=0,t===ac?(br(e,!0),e.strm.avail_out===0?yd:Nh):e.last_lit&&(br(e,!1),e.strm.avail_out===0)?er:O1};function Es(e,t,n,r,i){this.good_length=e,this.max_lazy=t,this.nice_length=n,this.max_chain=r,this.func=i}const lp=[new Es(0,0,0,0,IH),new Es(4,4,8,4,Tb),new Es(4,5,16,8,Tb),new Es(4,6,32,32,Tb),new Es(4,4,16,16,Uu),new Es(8,16,32,32,Uu),new Es(8,16,128,128,Uu),new Es(8,32,128,256,Uu),new Es(32,128,258,1024,Uu),new Es(32,258,258,4096,Uu)],RH=e=>{e.window_size=2*e.w_size,Zl(e.head),e.max_lazy_match=lp[e.level].max_lazy,e.good_match=lp[e.level].good_length,e.nice_match=lp[e.level].nice_length,e.max_chain_length=lp[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=_t-1,e.match_available=0,e.ins_h=0};function DH(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=fU,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(CH*2),this.dyn_dtree=new Uint16Array((2*wH+1)*2),this.bl_tree=new Uint16Array((2*EH+1)*2),Zl(this.dyn_ltree),Zl(this.dyn_dtree),Zl(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(SH+1),this.heap=new Uint16Array(2*c3+1),Zl(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(2*c3+1),Zl(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}const LM=e=>{if(!e||!e.state)return Jl(e,ca);e.total_in=e.total_out=0,e.data_type=gH;const t=e.state;return t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap?pU:nd,e.adler=t.wrap===2?0:1,t.last_flush=$d,iH(t),Ps},RM=e=>{const t=LM(e);return t===Ps&&RH(e.state),t},jH=(e,t)=>!e||!e.state||e.state.wrap!==2?ca:(e.state.gzhead=t,Ps),DM=(e,t,n,r,i,a)=>{if(!e)return ca;let s=1;if(t===uH&&(t=6),r<0?(s=0,r=-r):r>15&&(s=2,r-=16),i<1||i>UH||n!==fU||r<8||r>15||t<0||t>9||a<0||a>pH)return Jl(e,ca);r===8&&(r=9);const o=new DH;return e.state=o,o.strm=e,o.wrap=s,o.gzhead=null,o.w_bits=r,o.w_size=1<<o.w_bits,o.w_mask=o.w_size-1,o.hash_bits=i+7,o.hash_size=1<<o.hash_bits,o.hash_mask=o.hash_size-1,o.hash_shift=~~((o.hash_bits+_t-1)/_t),o.window=new Uint8Array(o.w_size*2),o.head=new Uint16Array(o.hash_size),o.prev=new Uint16Array(o.w_size),o.lit_bufsize=1<<i+6,o.pending_buf_size=o.lit_bufsize*4,o.pending_buf=new Uint8Array(o.pending_buf_size),o.d_buf=1*o.lit_bufsize,o.l_buf=3*o.lit_bufsize,o.level=t,o.strategy=a,o.method=n,RM(e)},PH=(e,t)=>DM(e,t,fU,bH,yH,mH),NH=(e,t)=>{let n,r;if(!e||!e.state||t>G9||t<0)return e?Jl(e,ca):ca;const i=e.state;if(!e.output||!e.input&&e.avail_in!==0||i.status===op&&t!==ac)return Jl(e,e.avail_out===0?kb:ca);i.strm=e;const a=i.last_flush;if(i.last_flush=t,i.status===pU)if(i.wrap===2)e.adler=0,Pt(i,31),Pt(i,139),Pt(i,8),i.gzhead?(Pt(i,(i.gzhead.text?1:0)+(i.gzhead.hcrc?2:0)+(i.gzhead.extra?4:0)+(i.gzhead.name?8:0)+(i.gzhead.comment?16:0)),Pt(i,i.gzhead.time&255),Pt(i,i.gzhead.time>>8&255),Pt(i,i.gzhead.time>>16&255),Pt(i,i.gzhead.time>>24&255),Pt(i,i.level===9?2:i.strategy>=xm||i.level<2?4:0),Pt(i,i.gzhead.os&255),i.gzhead.extra&&i.gzhead.extra.length&&(Pt(i,i.gzhead.extra.length&255),Pt(i,i.gzhead.extra.length>>8&255)),i.gzhead.hcrc&&(e.adler=or(e.adler,i.pending_buf,i.pending,0)),i.gzindex=0,i.status=d3):(Pt(i,0),Pt(i,0),Pt(i,0),Pt(i,0),Pt(i,0),Pt(i,i.level===9?2:i.strategy>=xm||i.level<2?4:0),Pt(i,kH),i.status=nd);else{let s=fU+(i.w_bits-8<<4)<<8,o=-1;i.strategy>=xm||i.level<2?o=0:i.level<6?o=1:i.level===6?o=2:o=3,s|=o<<6,i.strstart!==0&&(s|=_H),s+=31-s%31,i.status=nd,Lf(i,s),i.strstart!==0&&(Lf(i,e.adler>>>16),Lf(i,e.adler&65535)),e.adler=1}if(i.status===d3)if(i.gzhead.extra){for(n=i.pending;i.gzindex<(i.gzhead.extra.length&65535)&&!(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>n&&(e.adler=or(e.adler,i.pending_buf,i.pending-n,n)),$l(e),n=i.pending,i.pending===i.pending_buf_size));)Pt(i,i.gzhead.extra[i.gzindex]&255),i.gzindex++;i.gzhead.hcrc&&i.pending>n&&(e.adler=or(e.adler,i.pending_buf,i.pending-n,n)),i.gzindex===i.gzhead.extra.length&&(i.gzindex=0,i.status=sg)}else i.status=sg;if(i.status===sg)if(i.gzhead.name){n=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>n&&(e.adler=or(e.adler,i.pending_buf,i.pending-n,n)),$l(e),n=i.pending,i.pending===i.pending_buf_size)){r=1;break}i.gzindex<i.gzhead.name.length?r=i.gzhead.name.charCodeAt(i.gzindex++)&255:r=0,Pt(i,r)}while(r!==0);i.gzhead.hcrc&&i.pending>n&&(e.adler=or(e.adler,i.pending_buf,i.pending-n,n)),r===0&&(i.gzindex=0,i.status=og)}else i.status=og;if(i.status===og)if(i.gzhead.comment){n=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>n&&(e.adler=or(e.adler,i.pending_buf,i.pending-n,n)),$l(e),n=i.pending,i.pending===i.pending_buf_size)){r=1;break}i.gzindex<i.gzhead.comment.length?r=i.gzhead.comment.charCodeAt(i.gzindex++)&255:r=0,Pt(i,r)}while(r!==0);i.gzhead.hcrc&&i.pending>n&&(e.adler=or(e.adler,i.pending_buf,i.pending-n,n)),r===0&&(i.status=lg)}else i.status=lg;if(i.status===lg&&(i.gzhead.hcrc?(i.pending+2>i.pending_buf_size&&$l(e),i.pending+2<=i.pending_buf_size&&(Pt(i,e.adler&255),Pt(i,e.adler>>8&255),e.adler=0,i.status=nd)):i.status=nd),i.pending!==0){if($l(e),e.avail_out===0)return i.last_flush=-1,Ps}else if(e.avail_in===0&&Z9(t)<=Z9(a)&&t!==ac)return Jl(e,kb);if(i.status===op&&e.avail_in!==0)return Jl(e,kb);if(e.avail_in!==0||i.lookahead!==0||t!==$d&&i.status!==op){let s=i.strategy===xm?LH(i,t):i.strategy===fH?AH(i,t):lp[i.level].func(i,t);if((s===yd||s===Nh)&&(i.status=op),s===er||s===yd)return e.avail_out===0&&(i.last_flush=-1),Ps;if(s===O1&&(t===lH?oH(i):t!==G9&&(aH(i,0,0,!1),t===cH&&(Zl(i.head),i.lookahead===0&&(i.strstart=0,i.block_start=0,i.insert=0))),$l(e),e.avail_out===0))return i.last_flush=-1,Ps}return t!==ac?Ps:i.wrap<=0?q9:(i.wrap===2?(Pt(i,e.adler&255),Pt(i,e.adler>>8&255),Pt(i,e.adler>>16&255),Pt(i,e.adler>>24&255),Pt(i,e.total_in&255),Pt(i,e.total_in>>8&255),Pt(i,e.total_in>>16&255),Pt(i,e.total_in>>24&255)):(Lf(i,e.adler>>>16),Lf(i,e.adler&65535)),$l(e),i.wrap>0&&(i.wrap=-i.wrap),i.pending!==0?Ps:q9)},OH=e=>{if(!e||!e.state)return ca;const t=e.state.status;return t!==pU&&t!==d3&&t!==sg&&t!==og&&t!==lg&&t!==nd&&t!==op?Jl(e,ca):(e.state=null,t===nd?Jl(e,dH):Ps)},FH=(e,t)=>{let n=t.length;if(!e||!e.state)return ca;const r=e.state,i=r.wrap;if(i===2||i===1&&r.status!==pU||r.lookahead)return ca;if(i===1&&(e.adler=e1(e.adler,t,n,0)),r.wrap=0,n>=r.w_size){i===0&&(Zl(r.head),r.strstart=0,r.block_start=0,r.insert=0);let c=new Uint8Array(r.w_size);c.set(t.subarray(n-r.w_size,n),0),t=c,n=r.w_size}const a=e.avail_in,s=e.next_in,o=e.input;for(e.avail_in=n,e.next_in=0,e.input=t,vd(r);r.lookahead>=_t;){let c=r.strstart,d=r.lookahead-(_t-1);do r.ins_h=sc(r,r.ins_h,r.window[c+_t-1]),r.prev[c&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=c,c++;while(--d);r.strstart=c,r.lookahead=_t-1,vd(r)}return r.strstart+=r.lookahead,r.block_start=r.strstart,r.insert=r.lookahead,r.lookahead=0,r.match_length=r.prev_length=_t-1,r.match_available=0,e.next_in=s,e.input=o,e.avail_in=a,r.wrap=i,Ps};var $H=PH,BH=DM,zH=RM,HH=LM,WH=jH,XH=NH,VH=OH,YH=FH,GH="pako deflate (from Nodeca project)",_p={deflateInit:$H,deflateInit2:BH,deflateReset:zH,deflateResetKeep:HH,deflateSetHeader:WH,deflate:XH,deflateEnd:VH,deflateSetDictionary:YH,deflateInfo:GH};const qH=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var ZH=function(e){const t=Array.prototype.slice.call(arguments,1);for(;t.length;){const n=t.shift();if(n){if(typeof n!="object")throw new TypeError(n+"must be non-object");for(const r in n)qH(n,r)&&(e[r]=n[r])}}return e},KH=e=>{let t=0;for(let r=0,i=e.length;r<i;r++)t+=e[r].length;const n=new Uint8Array(t);for(let r=0,i=0,a=e.length;r<a;r++){let s=e[r];n.set(s,i),i+=s.length}return n},mU={assign:ZH,flattenChunks:KH};let jM=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{jM=!1}const t1=new Uint8Array(256);for(let e=0;e<256;e++)t1[e]=e>=252?6:e>=248?5:e>=240?4:e>=224?3:e>=192?2:1;t1[254]=t1[254]=1;var QH=e=>{let t,n,r,i,a,s=e.length,o=0;for(i=0;i<s;i++)n=e.charCodeAt(i),(n&64512)===55296&&i+1<s&&(r=e.charCodeAt(i+1),(r&64512)===56320&&(n=65536+(n-55296<<10)+(r-56320),i++)),o+=n<128?1:n<2048?2:n<65536?3:4;for(t=new Uint8Array(o),a=0,i=0;a<o;i++)n=e.charCodeAt(i),(n&64512)===55296&&i+1<s&&(r=e.charCodeAt(i+1),(r&64512)===56320&&(n=65536+(n-55296<<10)+(r-56320),i++)),n<128?t[a++]=n:n<2048?(t[a++]=192|n>>>6,t[a++]=128|n&63):n<65536?(t[a++]=224|n>>>12,t[a++]=128|n>>>6&63,t[a++]=128|n&63):(t[a++]=240|n>>>18,t[a++]=128|n>>>12&63,t[a++]=128|n>>>6&63,t[a++]=128|n&63);return t};const JH=(e,t)=>{if(t<65534&&e.subarray&&jM)return String.fromCharCode.apply(null,e.length===t?e:e.subarray(0,t));let n="";for(let r=0;r<t;r++)n+=String.fromCharCode(e[r]);return n};var eW=(e,t)=>{let n,r;const i=t||e.length,a=new Array(i*2);for(r=0,n=0;n<i;){let s=e[n++];if(s<128){a[r++]=s;continue}let o=t1[s];if(o>4){a[r++]=65533,n+=o-1;continue}for(s&=o===2?31:o===3?15:7;o>1&&n<i;)s=s<<6|e[n++]&63,o--;if(o>1){a[r++]=65533;continue}s<65536?a[r++]=s:(s-=65536,a[r++]=55296|s>>10&1023,a[r++]=56320|s&1023)}return JH(a,r)},tW=(e,t)=>{t=t||e.length,t>e.length&&(t=e.length);let n=t-1;for(;n>=0&&(e[n]&192)===128;)n--;return n<0||n===0?t:n+t1[e[n]]>t?n:t},n1={string2buf:QH,buf2string:eW,utf8border:tW};function nW(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}var PM=nW;const NM=Object.prototype.toString,{Z_NO_FLUSH:rW,Z_SYNC_FLUSH:iW,Z_FULL_FLUSH:aW,Z_FINISH:sW,Z_OK:Gg,Z_STREAM_END:oW,Z_DEFAULT_COMPRESSION:lW,Z_DEFAULT_STRATEGY:cW,Z_DEFLATED:dW}=hU;function gU(e){this.options=mU.assign({level:lW,method:dW,chunkSize:16384,windowBits:15,memLevel:8,strategy:cW},e||{});let t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new PM,this.strm.avail_out=0;let n=_p.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(n!==Gg)throw new Error(bd[n]);if(t.header&&_p.deflateSetHeader(this.strm,t.header),t.dictionary){let r;if(typeof t.dictionary=="string"?r=n1.string2buf(t.dictionary):NM.call(t.dictionary)==="[object ArrayBuffer]"?r=new Uint8Array(t.dictionary):r=t.dictionary,n=_p.deflateSetDictionary(this.strm,r),n!==Gg)throw new Error(bd[n]);this._dict_set=!0}}gU.prototype.push=function(e,t){const n=this.strm,r=this.options.chunkSize;let i,a;if(this.ended)return!1;for(t===~~t?a=t:a=t===!0?sW:rW,typeof e=="string"?n.input=n1.string2buf(e):NM.call(e)==="[object ArrayBuffer]"?n.input=new Uint8Array(e):n.input=e,n.next_in=0,n.avail_in=n.input.length;;){if(n.avail_out===0&&(n.output=new Uint8Array(r),n.next_out=0,n.avail_out=r),(a===iW||a===aW)&&n.avail_out<=6){this.onData(n.output.subarray(0,n.next_out)),n.avail_out=0;continue}if(i=_p.deflate(n,a),i===oW)return n.next_out>0&&this.onData(n.output.subarray(0,n.next_out)),i=_p.deflateEnd(this.strm),this.onEnd(i),this.ended=!0,i===Gg;if(n.avail_out===0){this.onData(n.output);continue}if(a>0&&n.next_out>0){this.onData(n.output.subarray(0,n.next_out)),n.avail_out=0;continue}if(n.avail_in===0)break}return!0};gU.prototype.onData=function(e){this.chunks.push(e)};gU.prototype.onEnd=function(e){e===Gg&&(this.result=mU.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function uW(e,t){const n=new gU(t);if(n.push(e,!0),n.err)throw n.msg||bd[n.err];return n.result}var hW=uW,fW={deflate:hW};const wm=30,pW=12;var mW=function(t,n){let r,i,a,s,o,c,d,l,h,f,g,U,y,v,x,w,C,S,k,M,T,R,j,P;const N=t.state;r=t.next_in,j=t.input,i=r+(t.avail_in-5),a=t.next_out,P=t.output,s=a-(n-t.avail_out),o=a+(t.avail_out-257),c=N.dmax,d=N.wsize,l=N.whave,h=N.wnext,f=N.window,g=N.hold,U=N.bits,y=N.lencode,v=N.distcode,x=(1<<N.lenbits)-1,w=(1<<N.distbits)-1;e:do{U<15&&(g+=j[r++]<<U,U+=8,g+=j[r++]<<U,U+=8),C=y[g&x];t:for(;;){if(S=C>>>24,g>>>=S,U-=S,S=C>>>16&255,S===0)P[a++]=C&65535;else if(S&16){k=C&65535,S&=15,S&&(U<S&&(g+=j[r++]<<U,U+=8),k+=g&(1<<S)-1,g>>>=S,U-=S),U<15&&(g+=j[r++]<<U,U+=8,g+=j[r++]<<U,U+=8),C=v[g&w];n:for(;;){if(S=C>>>24,g>>>=S,U-=S,S=C>>>16&255,S&16){if(M=C&65535,S&=15,U<S&&(g+=j[r++]<<U,U+=8,U<S&&(g+=j[r++]<<U,U+=8)),M+=g&(1<<S)-1,M>c){t.msg="invalid distance too far back",N.mode=wm;break e}if(g>>>=S,U-=S,S=a-s,M>S){if(S=M-S,S>l&&N.sane){t.msg="invalid distance too far back",N.mode=wm;break e}if(T=0,R=f,h===0){if(T+=d-S,S<k){k-=S;do P[a++]=f[T++];while(--S);T=a-M,R=P}}else if(h<S){if(T+=d+h-S,S-=h,S<k){k-=S;do P[a++]=f[T++];while(--S);if(T=0,h<k){S=h,k-=S;do P[a++]=f[T++];while(--S);T=a-M,R=P}}}else if(T+=h-S,S<k){k-=S;do P[a++]=f[T++];while(--S);T=a-M,R=P}for(;k>2;)P[a++]=R[T++],P[a++]=R[T++],P[a++]=R[T++],k-=3;k&&(P[a++]=R[T++],k>1&&(P[a++]=R[T++]))}else{T=a-M;do P[a++]=P[T++],P[a++]=P[T++],P[a++]=P[T++],k-=3;while(k>2);k&&(P[a++]=P[T++],k>1&&(P[a++]=P[T++]))}}else if((S&64)===0){C=v[(C&65535)+(g&(1<<S)-1)];continue n}else{t.msg="invalid distance code",N.mode=wm;break e}break}}else if((S&64)===0){C=y[(C&65535)+(g&(1<<S)-1)];continue t}else if(S&32){N.mode=pW;break e}else{t.msg="invalid literal/length code",N.mode=wm;break e}break}}while(r<i&&a<o);k=U>>3,r-=k,U-=k<<3,g&=(1<<U)-1,t.next_in=r,t.next_out=a,t.avail_in=r<i?5+(i-r):5-(r-i),t.avail_out=a<o?257+(o-a):257-(a-o),N.hold=g,N.bits=U};const bu=15,K9=852,Q9=592,J9=0,Mb=1,eE=2,gW=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),UW=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),bW=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),yW=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]),vW=(e,t,n,r,i,a,s,o)=>{const c=o.bits;let d=0,l=0,h=0,f=0,g=0,U=0,y=0,v=0,x=0,w=0,C,S,k,M,T,R=null,j=0,P;const N=new Uint16Array(bu+1),F=new Uint16Array(bu+1);let $=null,q=0,W,V,B;for(d=0;d<=bu;d++)N[d]=0;for(l=0;l<r;l++)N[t[n+l]]++;for(g=c,f=bu;f>=1&&N[f]===0;f--);if(g>f&&(g=f),f===0)return i[a++]=1<<24|64<<16|0,i[a++]=1<<24|64<<16|0,o.bits=1,0;for(h=1;h<f&&N[h]===0;h++);for(g<h&&(g=h),v=1,d=1;d<=bu;d++)if(v<<=1,v-=N[d],v<0)return-1;if(v>0&&(e===J9||f!==1))return-1;for(F[1]=0,d=1;d<bu;d++)F[d+1]=F[d]+N[d];for(l=0;l<r;l++)t[n+l]!==0&&(s[F[t[n+l]]++]=l);if(e===J9?(R=$=s,P=19):e===Mb?(R=gW,j-=257,$=UW,q-=257,P=256):(R=bW,$=yW,P=-1),w=0,l=0,d=h,T=a,U=g,y=0,k=-1,x=1<<g,M=x-1,e===Mb&&x>K9||e===eE&&x>Q9)return 1;for(;;){W=d-y,s[l]<P?(V=0,B=s[l]):s[l]>P?(V=$[q+s[l]],B=R[j+s[l]]):(V=96,B=0),C=1<<d-y,S=1<<U,h=S;do S-=C,i[T+(w>>y)+S]=W<<24|V<<16|B|0;while(S!==0);for(C=1<<d-1;w&C;)C>>=1;if(C!==0?(w&=C-1,w+=C):w=0,l++,--N[d]===0){if(d===f)break;d=t[n+s[l]]}if(d>g&&(w&M)!==k){for(y===0&&(y=g),T+=h,U=d-y,v=1<<U;U+y<f&&(v-=N[U+y],!(v<=0));)U++,v<<=1;if(x+=1<<U,e===Mb&&x>K9||e===eE&&x>Q9)return 1;k=w&M,i[k]=g<<24|U<<16|T-a|0}}return w!==0&&(i[T+w]=d-y<<24|64<<16|0),o.bits=g,0};var kp=vW;const xW=0,OM=1,FM=2,{Z_FINISH:tE,Z_BLOCK:wW,Z_TREES:Em,Z_OK:xd,Z_STREAM_END:EW,Z_NEED_DICT:CW,Z_STREAM_ERROR:ha,Z_DATA_ERROR:$M,Z_MEM_ERROR:BM,Z_BUF_ERROR:SW,Z_DEFLATED:nE}=hU,zM=1,rE=2,iE=3,aE=4,sE=5,oE=6,lE=7,cE=8,dE=9,uE=10,qg=11,So=12,Ib=13,hE=14,Ab=15,fE=16,pE=17,mE=18,gE=19,Cm=20,Sm=21,UE=22,bE=23,yE=24,vE=25,xE=26,Lb=27,wE=28,EE=29,pn=30,HM=31,_W=32,kW=852,TW=592,MW=15,IW=MW,CE=e=>(e>>>24&255)+(e>>>8&65280)+((e&65280)<<8)+((e&255)<<24);function AW(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const WM=e=>{if(!e||!e.state)return ha;const t=e.state;return e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=t.wrap&1),t.mode=zM,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new Int32Array(kW),t.distcode=t.distdyn=new Int32Array(TW),t.sane=1,t.back=-1,xd},XM=e=>{if(!e||!e.state)return ha;const t=e.state;return t.wsize=0,t.whave=0,t.wnext=0,WM(e)},VM=(e,t)=>{let n;if(!e||!e.state)return ha;const r=e.state;return t<0?(n=0,t=-t):(n=(t>>4)+1,t<48&&(t&=15)),t&&(t<8||t>15)?ha:(r.window!==null&&r.wbits!==t&&(r.window=null),r.wrap=n,r.wbits=t,XM(e))},YM=(e,t)=>{if(!e)return ha;const n=new AW;e.state=n,n.window=null;const r=VM(e,t);return r!==xd&&(e.state=null),r},LW=e=>YM(e,IW);let SE=!0,Rb,Db;const RW=e=>{if(SE){Rb=new Int32Array(512),Db=new Int32Array(32);let t=0;for(;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(kp(OM,e.lens,0,288,Rb,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;kp(FM,e.lens,0,32,Db,0,e.work,{bits:5}),SE=!1}e.lencode=Rb,e.lenbits=9,e.distcode=Db,e.distbits=5},GM=(e,t,n,r)=>{let i;const a=e.state;return a.window===null&&(a.wsize=1<<a.wbits,a.wnext=0,a.whave=0,a.window=new Uint8Array(a.wsize)),r>=a.wsize?(a.window.set(t.subarray(n-a.wsize,n),0),a.wnext=0,a.whave=a.wsize):(i=a.wsize-a.wnext,i>r&&(i=r),a.window.set(t.subarray(n-r,n-r+i),a.wnext),r-=i,r?(a.window.set(t.subarray(n-r,n),0),a.wnext=r,a.whave=a.wsize):(a.wnext+=i,a.wnext===a.wsize&&(a.wnext=0),a.whave<a.wsize&&(a.whave+=i))),0},DW=(e,t)=>{let n,r,i,a,s,o,c,d,l,h,f,g,U,y,v=0,x,w,C,S,k,M,T,R;const j=new Uint8Array(4);let P,N;const F=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(!e||!e.state||!e.output||!e.input&&e.avail_in!==0)return ha;n=e.state,n.mode===So&&(n.mode=Ib),s=e.next_out,i=e.output,c=e.avail_out,a=e.next_in,r=e.input,o=e.avail_in,d=n.hold,l=n.bits,h=o,f=c,R=xd;e:for(;;)switch(n.mode){case zM:if(n.wrap===0){n.mode=Ib;break}for(;l<16;){if(o===0)break e;o--,d+=r[a++]<<l,l+=8}if(n.wrap&2&&d===35615){n.check=0,j[0]=d&255,j[1]=d>>>8&255,n.check=or(n.check,j,2,0),d=0,l=0,n.mode=rE;break}if(n.flags=0,n.head&&(n.head.done=!1),!(n.wrap&1)||(((d&255)<<8)+(d>>8))%31){e.msg="incorrect header check",n.mode=pn;break}if((d&15)!==nE){e.msg="unknown compression method",n.mode=pn;break}if(d>>>=4,l-=4,T=(d&15)+8,n.wbits===0)n.wbits=T;else if(T>n.wbits){e.msg="invalid window size",n.mode=pn;break}n.dmax=1<<n.wbits,e.adler=n.check=1,n.mode=d&512?uE:So,d=0,l=0;break;case rE:for(;l<16;){if(o===0)break e;o--,d+=r[a++]<<l,l+=8}if(n.flags=d,(n.flags&255)!==nE){e.msg="unknown compression method",n.mode=pn;break}if(n.flags&57344){e.msg="unknown header flags set",n.mode=pn;break}n.head&&(n.head.text=d>>8&1),n.flags&512&&(j[0]=d&255,j[1]=d>>>8&255,n.check=or(n.check,j,2,0)),d=0,l=0,n.mode=iE;case iE:for(;l<32;){if(o===0)break e;o--,d+=r[a++]<<l,l+=8}n.head&&(n.head.time=d),n.flags&512&&(j[0]=d&255,j[1]=d>>>8&255,j[2]=d>>>16&255,j[3]=d>>>24&255,n.check=or(n.check,j,4,0)),d=0,l=0,n.mode=aE;case aE:for(;l<16;){if(o===0)break e;o--,d+=r[a++]<<l,l+=8}n.head&&(n.head.xflags=d&255,n.head.os=d>>8),n.flags&512&&(j[0]=d&255,j[1]=d>>>8&255,n.check=or(n.check,j,2,0)),d=0,l=0,n.mode=sE;case sE:if(n.flags&1024){for(;l<16;){if(o===0)break e;o--,d+=r[a++]<<l,l+=8}n.length=d,n.head&&(n.head.extra_len=d),n.flags&512&&(j[0]=d&255,j[1]=d>>>8&255,n.check=or(n.check,j,2,0)),d=0,l=0}else n.head&&(n.head.extra=null);n.mode=oE;case oE:if(n.flags&1024&&(g=n.length,g>o&&(g=o),g&&(n.head&&(T=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Uint8Array(n.head.extra_len)),n.head.extra.set(r.subarray(a,a+g),T)),n.flags&512&&(n.check=or(n.check,r,g,a)),o-=g,a+=g,n.length-=g),n.length))break e;n.length=0,n.mode=lE;case lE:if(n.flags&2048){if(o===0)break e;g=0;do T=r[a+g++],n.head&&T&&n.length<65536&&(n.head.name+=String.fromCharCode(T));while(T&&g<o);if(n.flags&512&&(n.check=or(n.check,r,g,a)),o-=g,a+=g,T)break e}else n.head&&(n.head.name=null);n.length=0,n.mode=cE;case cE:if(n.flags&4096){if(o===0)break e;g=0;do T=r[a+g++],n.head&&T&&n.length<65536&&(n.head.comment+=String.fromCharCode(T));while(T&&g<o);if(n.flags&512&&(n.check=or(n.check,r,g,a)),o-=g,a+=g,T)break e}else n.head&&(n.head.comment=null);n.mode=dE;case dE:if(n.flags&512){for(;l<16;){if(o===0)break e;o--,d+=r[a++]<<l,l+=8}if(d!==(n.check&65535)){e.msg="header crc mismatch",n.mode=pn;break}d=0,l=0}n.head&&(n.head.hcrc=n.flags>>9&1,n.head.done=!0),e.adler=n.check=0,n.mode=So;break;case uE:for(;l<32;){if(o===0)break e;o--,d+=r[a++]<<l,l+=8}e.adler=n.check=CE(d),d=0,l=0,n.mode=qg;case qg:if(n.havedict===0)return e.next_out=s,e.avail_out=c,e.next_in=a,e.avail_in=o,n.hold=d,n.bits=l,CW;e.adler=n.check=1,n.mode=So;case So:if(t===wW||t===Em)break e;case Ib:if(n.last){d>>>=l&7,l-=l&7,n.mode=Lb;break}for(;l<3;){if(o===0)break e;o--,d+=r[a++]<<l,l+=8}switch(n.last=d&1,d>>>=1,l-=1,d&3){case 0:n.mode=hE;break;case 1:if(RW(n),n.mode=Cm,t===Em){d>>>=2,l-=2;break e}break;case 2:n.mode=pE;break;case 3:e.msg="invalid block type",n.mode=pn}d>>>=2,l-=2;break;case hE:for(d>>>=l&7,l-=l&7;l<32;){if(o===0)break e;o--,d+=r[a++]<<l,l+=8}if((d&65535)!==(d>>>16^65535)){e.msg="invalid stored block lengths",n.mode=pn;break}if(n.length=d&65535,d=0,l=0,n.mode=Ab,t===Em)break e;case Ab:n.mode=fE;case fE:if(g=n.length,g){if(g>o&&(g=o),g>c&&(g=c),g===0)break e;i.set(r.subarray(a,a+g),s),o-=g,a+=g,c-=g,s+=g,n.length-=g;break}n.mode=So;break;case pE:for(;l<14;){if(o===0)break e;o--,d+=r[a++]<<l,l+=8}if(n.nlen=(d&31)+257,d>>>=5,l-=5,n.ndist=(d&31)+1,d>>>=5,l-=5,n.ncode=(d&15)+4,d>>>=4,l-=4,n.nlen>286||n.ndist>30){e.msg="too many length or distance symbols",n.mode=pn;break}n.have=0,n.mode=mE;case mE:for(;n.have<n.ncode;){for(;l<3;){if(o===0)break e;o--,d+=r[a++]<<l,l+=8}n.lens[F[n.have++]]=d&7,d>>>=3,l-=3}for(;n.have<19;)n.lens[F[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,P={bits:n.lenbits},R=kp(xW,n.lens,0,19,n.lencode,0,n.work,P),n.lenbits=P.bits,R){e.msg="invalid code lengths set",n.mode=pn;break}n.have=0,n.mode=gE;case gE:for(;n.have<n.nlen+n.ndist;){for(;v=n.lencode[d&(1<<n.lenbits)-1],x=v>>>24,w=v>>>16&255,C=v&65535,!(x<=l);){if(o===0)break e;o--,d+=r[a++]<<l,l+=8}if(C<16)d>>>=x,l-=x,n.lens[n.have++]=C;else{if(C===16){for(N=x+2;l<N;){if(o===0)break e;o--,d+=r[a++]<<l,l+=8}if(d>>>=x,l-=x,n.have===0){e.msg="invalid bit length repeat",n.mode=pn;break}T=n.lens[n.have-1],g=3+(d&3),d>>>=2,l-=2}else if(C===17){for(N=x+3;l<N;){if(o===0)break e;o--,d+=r[a++]<<l,l+=8}d>>>=x,l-=x,T=0,g=3+(d&7),d>>>=3,l-=3}else{for(N=x+7;l<N;){if(o===0)break e;o--,d+=r[a++]<<l,l+=8}d>>>=x,l-=x,T=0,g=11+(d&127),d>>>=7,l-=7}if(n.have+g>n.nlen+n.ndist){e.msg="invalid bit length repeat",n.mode=pn;break}for(;g--;)n.lens[n.have++]=T}}if(n.mode===pn)break;if(n.lens[256]===0){e.msg="invalid code -- missing end-of-block",n.mode=pn;break}if(n.lenbits=9,P={bits:n.lenbits},R=kp(OM,n.lens,0,n.nlen,n.lencode,0,n.work,P),n.lenbits=P.bits,R){e.msg="invalid literal/lengths set",n.mode=pn;break}if(n.distbits=6,n.distcode=n.distdyn,P={bits:n.distbits},R=kp(FM,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,P),n.distbits=P.bits,R){e.msg="invalid distances set",n.mode=pn;break}if(n.mode=Cm,t===Em)break e;case Cm:n.mode=Sm;case Sm:if(o>=6&&c>=258){e.next_out=s,e.avail_out=c,e.next_in=a,e.avail_in=o,n.hold=d,n.bits=l,mW(e,f),s=e.next_out,i=e.output,c=e.avail_out,a=e.next_in,r=e.input,o=e.avail_in,d=n.hold,l=n.bits,n.mode===So&&(n.back=-1);break}for(n.back=0;v=n.lencode[d&(1<<n.lenbits)-1],x=v>>>24,w=v>>>16&255,C=v&65535,!(x<=l);){if(o===0)break e;o--,d+=r[a++]<<l,l+=8}if(w&&(w&240)===0){for(S=x,k=w,M=C;v=n.lencode[M+((d&(1<<S+k)-1)>>S)],x=v>>>24,w=v>>>16&255,C=v&65535,!(S+x<=l);){if(o===0)break e;o--,d+=r[a++]<<l,l+=8}d>>>=S,l-=S,n.back+=S}if(d>>>=x,l-=x,n.back+=x,n.length=C,w===0){n.mode=xE;break}if(w&32){n.back=-1,n.mode=So;break}if(w&64){e.msg="invalid literal/length code",n.mode=pn;break}n.extra=w&15,n.mode=UE;case UE:if(n.extra){for(N=n.extra;l<N;){if(o===0)break e;o--,d+=r[a++]<<l,l+=8}n.length+=d&(1<<n.extra)-1,d>>>=n.extra,l-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=bE;case bE:for(;v=n.distcode[d&(1<<n.distbits)-1],x=v>>>24,w=v>>>16&255,C=v&65535,!(x<=l);){if(o===0)break e;o--,d+=r[a++]<<l,l+=8}if((w&240)===0){for(S=x,k=w,M=C;v=n.distcode[M+((d&(1<<S+k)-1)>>S)],x=v>>>24,w=v>>>16&255,C=v&65535,!(S+x<=l);){if(o===0)break e;o--,d+=r[a++]<<l,l+=8}d>>>=S,l-=S,n.back+=S}if(d>>>=x,l-=x,n.back+=x,w&64){e.msg="invalid distance code",n.mode=pn;break}n.offset=C,n.extra=w&15,n.mode=yE;case yE:if(n.extra){for(N=n.extra;l<N;){if(o===0)break e;o--,d+=r[a++]<<l,l+=8}n.offset+=d&(1<<n.extra)-1,d>>>=n.extra,l-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){e.msg="invalid distance too far back",n.mode=pn;break}n.mode=vE;case vE:if(c===0)break e;if(g=f-c,n.offset>g){if(g=n.offset-g,g>n.whave&&n.sane){e.msg="invalid distance too far back",n.mode=pn;break}g>n.wnext?(g-=n.wnext,U=n.wsize-g):U=n.wnext-g,g>n.length&&(g=n.length),y=n.window}else y=i,U=s-n.offset,g=n.length;g>c&&(g=c),c-=g,n.length-=g;do i[s++]=y[U++];while(--g);n.length===0&&(n.mode=Sm);break;case xE:if(c===0)break e;i[s++]=n.length,c--,n.mode=Sm;break;case Lb:if(n.wrap){for(;l<32;){if(o===0)break e;o--,d|=r[a++]<<l,l+=8}if(f-=c,e.total_out+=f,n.total+=f,f&&(e.adler=n.check=n.flags?or(n.check,i,f,s-f):e1(n.check,i,f,s-f)),f=c,(n.flags?d:CE(d))!==n.check){e.msg="incorrect data check",n.mode=pn;break}d=0,l=0}n.mode=wE;case wE:if(n.wrap&&n.flags){for(;l<32;){if(o===0)break e;o--,d+=r[a++]<<l,l+=8}if(d!==(n.total&4294967295)){e.msg="incorrect length check",n.mode=pn;break}d=0,l=0}n.mode=EE;case EE:R=EW;break e;case pn:R=$M;break e;case HM:return BM;case _W:default:return ha}return e.next_out=s,e.avail_out=c,e.next_in=a,e.avail_in=o,n.hold=d,n.bits=l,(n.wsize||f!==e.avail_out&&n.mode<pn&&(n.mode<Lb||t!==tE))&&GM(e,e.output,e.next_out,f-e.avail_out),h-=e.avail_in,f-=e.avail_out,e.total_in+=h,e.total_out+=f,n.total+=f,n.wrap&&f&&(e.adler=n.check=n.flags?or(n.check,i,f,e.next_out-f):e1(n.check,i,f,e.next_out-f)),e.data_type=n.bits+(n.last?64:0)+(n.mode===So?128:0)+(n.mode===Cm||n.mode===Ab?256:0),(h===0&&f===0||t===tE)&&R===xd&&(R=SW),R},jW=e=>{if(!e||!e.state)return ha;let t=e.state;return t.window&&(t.window=null),e.state=null,xd},PW=(e,t)=>{if(!e||!e.state)return ha;const n=e.state;return(n.wrap&2)===0?ha:(n.head=t,t.done=!1,xd)},NW=(e,t)=>{const n=t.length;let r,i,a;return!e||!e.state||(r=e.state,r.wrap!==0&&r.mode!==qg)?ha:r.mode===qg&&(i=1,i=e1(i,t,n,0),i!==r.check)?$M:(a=GM(e,t,n,n),a?(r.mode=HM,BM):(r.havedict=1,xd))};var OW=XM,FW=VM,$W=WM,BW=LW,zW=YM,HW=DW,WW=jW,XW=PW,VW=NW,YW="pako inflate (from Nodeca project)",Po={inflateReset:OW,inflateReset2:FW,inflateResetKeep:$W,inflateInit:BW,inflateInit2:zW,inflate:HW,inflateEnd:WW,inflateGetHeader:XW,inflateSetDictionary:VW,inflateInfo:YW};function GW(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}var qW=GW;const qM=Object.prototype.toString,{Z_NO_FLUSH:ZW,Z_FINISH:KW,Z_OK:r1,Z_STREAM_END:jb,Z_NEED_DICT:Pb,Z_STREAM_ERROR:QW,Z_DATA_ERROR:_E,Z_MEM_ERROR:JW}=hU;function UU(e){this.options=mU.assign({chunkSize:1024*64,windowBits:15,to:""},e||{});const t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,t.windowBits===0&&(t.windowBits=-15)),t.windowBits>=0&&t.windowBits<16&&!(e&&e.windowBits)&&(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&(t.windowBits&15)===0&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new PM,this.strm.avail_out=0;let n=Po.inflateInit2(this.strm,t.windowBits);if(n!==r1)throw new Error(bd[n]);if(this.header=new qW,Po.inflateGetHeader(this.strm,this.header),t.dictionary&&(typeof t.dictionary=="string"?t.dictionary=n1.string2buf(t.dictionary):qM.call(t.dictionary)==="[object ArrayBuffer]"&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(n=Po.inflateSetDictionary(this.strm,t.dictionary),n!==r1)))throw new Error(bd[n])}UU.prototype.push=function(e,t){const n=this.strm,r=this.options.chunkSize,i=this.options.dictionary;let a,s,o;if(this.ended)return!1;for(t===~~t?s=t:s=t===!0?KW:ZW,qM.call(e)==="[object ArrayBuffer]"?n.input=new Uint8Array(e):n.input=e,n.next_in=0,n.avail_in=n.input.length;;){for(n.avail_out===0&&(n.output=new Uint8Array(r),n.next_out=0,n.avail_out=r),a=Po.inflate(n,s),a===Pb&&i&&(a=Po.inflateSetDictionary(n,i),a===r1?a=Po.inflate(n,s):a===_E&&(a=Pb));n.avail_in>0&&a===jb&&n.state.wrap>0&&e[n.next_in]!==0;)Po.inflateReset(n),a=Po.inflate(n,s);switch(a){case QW:case _E:case Pb:case JW:return this.onEnd(a),this.ended=!0,!1}if(o=n.avail_out,n.next_out&&(n.avail_out===0||a===jb))if(this.options.to==="string"){let c=n1.utf8border(n.output,n.next_out),d=n.next_out-c,l=n1.buf2string(n.output,c);n.next_out=d,n.avail_out=r-d,d&&n.output.set(n.output.subarray(c,c+d),0),this.onData(l)}else this.onData(n.output.length===n.next_out?n.output:n.output.subarray(0,n.next_out));if(!(a===r1&&o===0)){if(a===jb)return a=Po.inflateEnd(this.strm),this.onEnd(a),this.ended=!0,!0;if(n.avail_in===0)break}}return!0};UU.prototype.onData=function(e){this.chunks.push(e)};UU.prototype.onEnd=function(e){e===r1&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=mU.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function eX(e,t){const n=new UU(t);if(n.push(e),n.err)throw n.msg||bd[n.err];return n.result}var tX=eX,nX={inflate:tX};const{deflate:rX}=fW,{inflate:iX}=nX;var aX=rX,sX=iX;const oX="#ffffff",lX="#000000",cX=["#f8f9fa","#f1f3f5","#e9ecef","#dee2e6","#ced4da","#adb5bd","#868e96","#495057","#343a40","#212529"],dX=["#fff5f5","#ffe3e3","#ffc9c9","#ffa8a8","#ff8787","#ff6b6b","#fa5252","#f03e3e","#e03131","#c92a2a"],uX=["#fff0f6","#ffdeeb","#fcc2d7","#faa2c1","#f783ac","#f06595","#e64980","#d6336c","#c2255c","#a61e4d"],hX=["#f8f0fc","#f3d9fa","#eebefa","#e599f7","#da77f2","#cc5de8","#be4bdb","#ae3ec9","#9c36b5","#862e9c"],fX=["#f3f0ff","#e5dbff","#d0bfff","#b197fc","#9775fa","#845ef7","#7950f2","#7048e8","#6741d9","#5f3dc4"],pX=["#edf2ff","#dbe4ff","#bac8ff","#91a7ff","#748ffc","#5c7cfa","#4c6ef5","#4263eb","#3b5bdb","#364fc7"],mX=["#e7f5ff","#d0ebff","#a5d8ff","#74c0fc","#4dabf7","#339af0","#228be6","#1c7ed6","#1971c2","#1864ab"],gX=["#e3fafc","#c5f6fa","#99e9f2","#66d9e8","#3bc9db","#22b8cf","#15aabf","#1098ad","#0c8599","#0b7285"],UX=["#e6fcf5","#c3fae8","#96f2d7","#63e6be","#38d9a9","#20c997","#12b886","#0ca678","#099268","#087f5b"],bX=["#ebfbee","#d3f9d8","#b2f2bb","#8ce99a","#69db7c","#51cf66","#40c057","#37b24d","#2f9e44","#2b8a3e"],yX=["#f4fce3","#e9fac8","#d8f5a2","#c0eb75","#a9e34b","#94d82d","#82c91e","#74b816","#66a80f","#5c940d"],vX=["#fff9db","#fff3bf","#ffec99","#ffe066","#ffd43b","#fcc419","#fab005","#f59f00","#f08c00","#e67700"],xX=["#fff4e6","#ffe8cc","#ffd8a8","#ffc078","#ffa94d","#ff922b","#fd7e14","#f76707","#e8590c","#d9480f"],dr={white:oX,black:lX,gray:cX,red:dX,pink:uX,grape:hX,violet:fX,indigo:pX,blue:mX,cyan:gX,teal:UX,green:bX,lime:yX,yellow:vX,orange:xX};let sv=(e=21)=>crypto.getRandomValues(new Uint8Array(e)).reduce((t,n)=>(n&=63,n<36?t+=n.toString(36):n<62?t+=(n-26).toString(36).toUpperCase():n>62?t+="-":t+="_",t),"");var Nb,kE;function wX(){if(kE)return Nb;kE=1;var e="Expected a function",t=NaN,n="[object Symbol]",r=/^\s+|\s+$/g,i=/^[-+]0x[0-9a-f]+$/i,a=/^0b[01]+$/i,s=/^0o[0-7]+$/i,o=parseInt,c=typeof Kl=="object"&&Kl&&Kl.Object===Object&&Kl,d=typeof self=="object"&&self&&self.Object===Object&&self,l=c||d||Function("return this")(),h=Object.prototype,f=h.toString,g=Math.max,U=Math.min,y=function(){return l.Date.now()};function v(M,T,R){var j,P,N,F,$,q,W=0,V=!1,B=!1,z=!0;if(typeof M!="function")throw new TypeError(e);T=k(T)||0,w(R)&&(V=!!R.leading,B="maxWait"in R,N=B?g(k(R.maxWait)||0,T):N,z="trailing"in R?!!R.trailing:z);function Y(ge){var $e=j,je=P;return j=P=void 0,W=ge,F=M.apply(je,$e),F}function K(ge){return W=ge,$=setTimeout(de,T),V?Y(ge):F}function G(ge){var $e=ge-q,je=ge-W,Je=T-$e;return B?U(Je,N-je):Je}function ee(ge){var $e=ge-q,je=ge-W;return q===void 0||$e>=T||$e<0||B&&je>=N}function de(){var ge=y();if(ee(ge))return xe(ge);$=setTimeout(de,G(ge))}function xe(ge){return $=void 0,z&&j?Y(ge):(j=P=void 0,F)}function ve(){$!==void 0&&clearTimeout($),W=0,j=q=P=$=void 0}function Me(){return $===void 0?F:xe(y())}function Ce(){var ge=y(),$e=ee(ge);if(j=arguments,P=this,q=ge,$e){if($===void 0)return K(q);if(B)return $=setTimeout(de,T),Y(q)}return $===void 0&&($=setTimeout(de,T)),F}return Ce.cancel=ve,Ce.flush=Me,Ce}function x(M,T,R){var j=!0,P=!0;if(typeof M!="function")throw new TypeError(e);return w(R)&&(j="leading"in R?!!R.leading:j,P="trailing"in R?!!R.trailing:P),v(M,T,{leading:j,maxWait:T,trailing:P})}function w(M){var T=typeof M;return!!M&&(T=="object"||T=="function")}function C(M){return!!M&&typeof M=="object"}function S(M){return typeof M=="symbol"||C(M)&&f.call(M)==n}function k(M){if(typeof M=="number")return M;if(S(M))return t;if(w(M)){var T=typeof M.valueOf=="function"?M.valueOf():M;M=w(T)?T+"":T}if(typeof M!="string")return M===0?M:+M;M=M.replace(r,"");var R=a.test(M);return R||s.test(M)?o(M.slice(2),R?2:8):i.test(M)?t:+M}return Nb=x,Nb}var EX=wX();const F1=ya(EX);var cg={exports:{}},CX=cg.exports,TE;function SX(){return TE||(TE=1,function(e,t){(function(n,r){e.exports=r()})(CX,function(){var n=function(){this._listeners={}};n.prototype.addEventListener=function(d,l){this._listeners[d]=this._listeners[d]||[],this._listeners[d].indexOf(l)<0&&this._listeners[d].push(l)},n.prototype.removeEventListener=function(d,l){if(this._listeners[d]){var h=this._listeners[d].indexOf(l);h>=0&&this._listeners[d].splice(h,1)}},n.prototype.dispatchEvent=function(d){if(this._listeners[d.type]&&this._listeners[d.type].length)for(var l=this._listeners[d.type].slice(),h=0,f=l.length;h<f;++h)l[h].call(this,d)};var r=function(d){return typeof d.constructor=="function"&&d.constructor.name==="GeneratorFunction"},i=function(d){return{next:function(){var l=d();return l?{value:l}:{done:!0}}}},a=function(d){var l=!1;return{next:function(){return l?{done:!0}:(l=!0,{value:d})}}},s=function(d,l){var h=typeof d;if(h==="object"){if(typeof d.next=="function")return d;if(typeof d.then=="function")return a(d)}return h==="function"?r(d)?d():i(d):a(l.resolve(d))},o=function(d,l,h){this.target=d,this.type=l,this.data=h},c=function(d,l,h){if(n.call(this),typeof l!="number"||Math.floor(l)!==l||l<1)throw new Error("Invalid concurrency");this._concurrency=l,this._options=h||{},this._options.promise=this._options.promise||Promise,this._iterator=s(d,this._options.promise),this._done=!1,this._size=0,this._promise=null,this._callbacks=null};return c.prototype=new n,c.prototype.constructor=c,c.prototype.concurrency=function(d){return typeof d<"u"&&(this._concurrency=d,this.active()&&this._proceed()),this._concurrency},c.prototype.size=function(){return this._size},c.prototype.active=function(){return!!this._promise},c.prototype.promise=function(){return this._promise},c.prototype.start=function(){var d=this,l=this._options.promise;return this._promise=new l(function(h,f){d._callbacks={reject:f,resolve:h},d._proceed()}),this._promise},c.prototype._fireEvent=function(d,l){this.dispatchEvent(new o(this,d,l))},c.prototype._settle=function(d){d?this._callbacks.reject(d):this._callbacks.resolve(),this._promise=null,this._callbacks=null},c.prototype._onPooledPromiseFulfilled=function(d,l){this._size--,this.active()&&(this._fireEvent("fulfilled",{promise:d,result:l}),this._proceed())},c.prototype._onPooledPromiseRejected=function(d,l){this._size--,this.active()&&(this._fireEvent("rejected",{promise:d,error:l}),this._settle(l||new Error("Unknown error")))},c.prototype._trackPromise=function(d){var l=this;d.then(function(h){l._onPooledPromiseFulfilled(d,h)},function(h){l._onPooledPromiseRejected(d,h)}).catch(function(h){l._settle(new Error("Promise processing failed: "+h))})},c.prototype._proceed=function(){if(!this._done){for(var d={done:!1};this._size<this._concurrency&&!(d=this._iterator.next()).done;)this._size++,this._trackPromise(d.value);this._done=d===null||!!d.done}this._done&&this._size===0&&this._settle()},c.PromisePoolEvent=o,c.PromisePool=c,c})}(cg)),cg.exports}var _X=SX();const kX=ya(_X);function u3(e,t,n){if(e&&e.length){const[r,i]=t,a=Math.PI/180*n,s=Math.cos(a),o=Math.sin(a);for(const c of e){const[d,l]=c;c[0]=(d-r)*s-(l-i)*o+r,c[1]=(d-r)*o+(l-i)*s+i}}}function TX(e,t,n){const r=[];e.forEach(i=>r.push(...i)),u3(r,t,n)}function MX(e,t){return e[0]===t[0]&&e[1]===t[1]}function IX(e,t,n,r=1){const i=n,a=Math.max(t,.1),s=e[0]&&e[0][0]&&typeof e[0][0]=="number"?[e]:e,o=[0,0];if(i)for(const d of s)u3(d,o,i);const c=AX(s,a,r);if(i){for(const d of s)u3(d,o,-i);TX(c,o,-i)}return c}function AX(e,t,n){const r=[];for(const d of e){const l=[...d];MX(l[0],l[l.length-1])||l.push([l[0][0],l[0][1]]),l.length>2&&r.push(l)}const i=[];t=Math.max(t,.1);const a=[];for(const d of r)for(let l=0;l<d.length-1;l++){const h=d[l],f=d[l+1];if(h[1]!==f[1]){const g=Math.min(h[1],f[1]);a.push({ymin:g,ymax:Math.max(h[1],f[1]),x:g===h[1]?h[0]:f[0],islope:(f[0]-h[0])/(f[1]-h[1])})}}if(a.sort((d,l)=>d.ymin<l.ymin?-1:d.ymin>l.ymin?1:d.x<l.x?-1:d.x>l.x?1:d.ymax===l.ymax?0:(d.ymax-l.ymax)/Math.abs(d.ymax-l.ymax)),!a.length)return i;let s=[],o=a[0].ymin,c=0;for(;s.length||a.length;){if(a.length){let d=-1;for(let h=0;h<a.length&&!(a[h].ymin>o);h++)d=h;a.splice(0,d+1).forEach(h=>{s.push({s:o,edge:h})})}if(s=s.filter(d=>!(d.edge.ymax<=o)),s.sort((d,l)=>d.edge.x===l.edge.x?0:(d.edge.x-l.edge.x)/Math.abs(d.edge.x-l.edge.x)),(n!==1||c%t===0)&&s.length>1)for(let d=0;d<s.length;d=d+2){const l=d+1;if(l>=s.length)break;const h=s[d].edge,f=s[l].edge;i.push([[Math.round(h.x),o],[Math.round(f.x),o]])}o+=n,s.forEach(d=>{d.edge.x=d.edge.x+n*d.edge.islope}),c++}return i}function $1(e,t){var n;const r=t.hachureAngle+90;let i=t.hachureGap;i<0&&(i=t.strokeWidth*4),i=Math.max(i,.1);let a=1;return t.roughness>=1&&(((n=t.randomizer)===null||n===void 0?void 0:n.next())||Math.random())>.7&&(a=i),IX(e,i,r,a||1)}class ov{constructor(t){this.helper=t}fillPolygons(t,n){return this._fillPolygons(t,n)}_fillPolygons(t,n){const r=$1(t,n);return{type:"fillSketch",ops:this.renderLines(r,n)}}renderLines(t,n){const r=[];for(const i of t)r.push(...this.helper.doubleLineOps(i[0][0],i[0][1],i[1][0],i[1][1],n));return r}}function bU(e){const t=e[0],n=e[1];return Math.sqrt(Math.pow(t[0]-n[0],2)+Math.pow(t[1]-n[1],2))}class LX extends ov{fillPolygons(t,n){let r=n.hachureGap;r<0&&(r=n.strokeWidth*4),r=Math.max(r,.1);const i=Object.assign({},n,{hachureGap:r}),a=$1(t,i),s=Math.PI/180*n.hachureAngle,o=[],c=r*.5*Math.cos(s),d=r*.5*Math.sin(s);for(const[h,f]of a)bU([h,f])&&o.push([[h[0]-c,h[1]+d],[...f]],[[h[0]+c,h[1]-d],[...f]]);return{type:"fillSketch",ops:this.renderLines(o,n)}}}class RX extends ov{fillPolygons(t,n){const r=this._fillPolygons(t,n),i=Object.assign({},n,{hachureAngle:n.hachureAngle+90}),a=this._fillPolygons(t,i);return r.ops=r.ops.concat(a.ops),r}}class DX{constructor(t){this.helper=t}fillPolygons(t,n){n=Object.assign({},n,{hachureAngle:0});const r=$1(t,n);return this.dotsOnLines(r,n)}dotsOnLines(t,n){const r=[];let i=n.hachureGap;i<0&&(i=n.strokeWidth*4),i=Math.max(i,.1);let a=n.fillWeight;a<0&&(a=n.strokeWidth/2);const s=i/4;for(const o of t){const c=bU(o),d=c/i,l=Math.ceil(d)-1,h=c-l*i,f=(o[0][0]+o[1][0])/2-i/4,g=Math.min(o[0][1],o[1][1]);for(let U=0;U<l;U++){const y=g+h+U*i,v=f-s+Math.random()*2*s,x=y-s+Math.random()*2*s,w=this.helper.ellipse(v,x,a,a,n);r.push(...w.ops)}}return{type:"fillSketch",ops:r}}}class jX{constructor(t){this.helper=t}fillPolygons(t,n){const r=$1(t,n);return{type:"fillSketch",ops:this.dashedLine(r,n)}}dashedLine(t,n){const r=n.dashOffset<0?n.hachureGap<0?n.strokeWidth*4:n.hachureGap:n.dashOffset,i=n.dashGap<0?n.hachureGap<0?n.strokeWidth*4:n.hachureGap:n.dashGap,a=[];return t.forEach(s=>{const o=bU(s),c=Math.floor(o/(r+i)),d=(o+i-c*(r+i))/2;let l=s[0],h=s[1];l[0]>h[0]&&(l=s[1],h=s[0]);const f=Math.atan((h[1]-l[1])/(h[0]-l[0]));for(let g=0;g<c;g++){const U=g*(r+i),y=U+r,v=[l[0]+U*Math.cos(f)+d*Math.cos(f),l[1]+U*Math.sin(f)+d*Math.sin(f)],x=[l[0]+y*Math.cos(f)+d*Math.cos(f),l[1]+y*Math.sin(f)+d*Math.sin(f)];a.push(...this.helper.doubleLineOps(v[0],v[1],x[0],x[1],n))}}),a}}class PX{constructor(t){this.helper=t}fillPolygons(t,n){const r=n.hachureGap<0?n.strokeWidth*4:n.hachureGap,i=n.zigzagOffset<0?r:n.zigzagOffset;n=Object.assign({},n,{hachureGap:r+i});const a=$1(t,n);return{type:"fillSketch",ops:this.zigzagLines(a,i,n)}}zigzagLines(t,n,r){const i=[];return t.forEach(a=>{const s=bU(a),o=Math.round(s/(2*n));let c=a[0],d=a[1];c[0]>d[0]&&(c=a[1],d=a[0]);const l=Math.atan((d[1]-c[1])/(d[0]-c[0]));for(let h=0;h<o;h++){const f=h*2*n,g=(h+1)*2*n,U=Math.sqrt(2*Math.pow(n,2)),y=[c[0]+f*Math.cos(l),c[1]+f*Math.sin(l)],v=[c[0]+g*Math.cos(l),c[1]+g*Math.sin(l)],x=[y[0]+U*Math.cos(l+Math.PI/4),y[1]+U*Math.sin(l+Math.PI/4)];i.push(...this.helper.doubleLineOps(y[0],y[1],x[0],x[1],r),...this.helper.doubleLineOps(x[0],x[1],v[0],v[1],r))}}),i}}const ai={};function NX(e,t){let n=e.fillStyle||"hachure";if(!ai[n])switch(n){case"zigzag":ai[n]||(ai[n]=new LX(t));break;case"cross-hatch":ai[n]||(ai[n]=new RX(t));break;case"dots":ai[n]||(ai[n]=new DX(t));break;case"dashed":ai[n]||(ai[n]=new jX(t));break;case"zigzag-line":ai[n]||(ai[n]=new PX(t));break;case"hachure":default:n="hachure",ai[n]||(ai[n]=new ov(t));break}return ai[n]}function OX(){return Math.floor(Math.random()*2**31)}class ZM{constructor(t){this.seed=t}next(){return this.seed?(2**31-1&(this.seed=Math.imul(48271,this.seed)))/2**31:Math.random()}}const FX=0,h3=1,KM=2,_m={A:7,a:7,C:6,c:6,H:1,h:1,L:2,l:2,M:2,m:2,Q:4,q:4,S:4,s:4,T:2,t:2,V:1,v:1,Z:0,z:0};function $X(e){const t=new Array;for(;e!=="";)if(e.match(/^([ \t\r\n,]+)/))e=e.substr(RegExp.$1.length);else if(e.match(/^([aAcChHlLmMqQsStTvVzZ])/))t[t.length]={type:FX,text:RegExp.$1},e=e.substr(RegExp.$1.length);else if(e.match(/^(([-+]?[0-9]+(\.[0-9]*)?|[-+]?\.[0-9]+)([eE][-+]?[0-9]+)?)/))t[t.length]={type:h3,text:`${parseFloat(RegExp.$1)}`},e=e.substr(RegExp.$1.length);else return[];return t[t.length]={type:KM,text:""},t}function Ob(e,t){return e.type===t}function lv(e){const t=[],n=$X(e);let r="BOD",i=0,a=n[i];for(;!Ob(a,KM);){let s=0;const o=[];if(r==="BOD")if(a.text==="M"||a.text==="m")i++,s=_m[a.text],r=a.text;else return lv("M0,0"+e);else Ob(a,h3)?s=_m[r]:(i++,s=_m[a.text],r=a.text);if(i+s<n.length){for(let c=i;c<i+s;c++){const d=n[c];if(Ob(d,h3))o[o.length]=+d.text;else throw new Error("Param not a number: "+r+","+d.text)}if(typeof _m[r]=="number"){const c={key:r,data:o};t.push(c),i+=s,a=n[i],r==="M"&&(r="L"),r==="m"&&(r="l")}else throw new Error("Bad segment: "+r)}else throw new Error("Path data ended short")}return t}function QM(e){let t=0,n=0,r=0,i=0;const a=[];for(const{key:s,data:o}of e)switch(s){case"M":a.push({key:"M",data:[...o]}),[t,n]=o,[r,i]=o;break;case"m":t+=o[0],n+=o[1],a.push({key:"M",data:[t,n]}),r=t,i=n;break;case"L":a.push({key:"L",data:[...o]}),[t,n]=o;break;case"l":t+=o[0],n+=o[1],a.push({key:"L",data:[t,n]});break;case"C":a.push({key:"C",data:[...o]}),t=o[4],n=o[5];break;case"c":{const c=o.map((d,l)=>l%2?d+n:d+t);a.push({key:"C",data:c}),t=c[4],n=c[5];break}case"Q":a.push({key:"Q",data:[...o]}),t=o[2],n=o[3];break;case"q":{const c=o.map((d,l)=>l%2?d+n:d+t);a.push({key:"Q",data:c}),t=c[2],n=c[3];break}case"A":a.push({key:"A",data:[...o]}),t=o[5],n=o[6];break;case"a":t+=o[5],n+=o[6],a.push({key:"A",data:[o[0],o[1],o[2],o[3],o[4],t,n]});break;case"H":a.push({key:"H",data:[...o]}),t=o[0];break;case"h":t+=o[0],a.push({key:"H",data:[t]});break;case"V":a.push({key:"V",data:[...o]}),n=o[0];break;case"v":n+=o[0],a.push({key:"V",data:[n]});break;case"S":a.push({key:"S",data:[...o]}),t=o[2],n=o[3];break;case"s":{const c=o.map((d,l)=>l%2?d+n:d+t);a.push({key:"S",data:c}),t=c[2],n=c[3];break}case"T":a.push({key:"T",data:[...o]}),t=o[0],n=o[1];break;case"t":t+=o[0],n+=o[1],a.push({key:"T",data:[t,n]});break;case"Z":case"z":a.push({key:"Z",data:[]}),t=r,n=i;break}return a}function JM(e){const t=[];let n="",r=0,i=0,a=0,s=0,o=0,c=0;for(const{key:d,data:l}of e){switch(d){case"M":t.push({key:"M",data:[...l]}),[r,i]=l,[a,s]=l;break;case"C":t.push({key:"C",data:[...l]}),r=l[4],i=l[5],o=l[2],c=l[3];break;case"L":t.push({key:"L",data:[...l]}),[r,i]=l;break;case"H":r=l[0],t.push({key:"L",data:[r,i]});break;case"V":i=l[0],t.push({key:"L",data:[r,i]});break;case"S":{let h=0,f=0;n==="C"||n==="S"?(h=r+(r-o),f=i+(i-c)):(h=r,f=i),t.push({key:"C",data:[h,f,...l]}),o=l[0],c=l[1],r=l[2],i=l[3];break}case"T":{const[h,f]=l;let g=0,U=0;n==="Q"||n==="T"?(g=r+(r-o),U=i+(i-c)):(g=r,U=i);const y=r+2*(g-r)/3,v=i+2*(U-i)/3,x=h+2*(g-h)/3,w=f+2*(U-f)/3;t.push({key:"C",data:[y,v,x,w,h,f]}),o=g,c=U,r=h,i=f;break}case"Q":{const[h,f,g,U]=l,y=r+2*(h-r)/3,v=i+2*(f-i)/3,x=g+2*(h-g)/3,w=U+2*(f-U)/3;t.push({key:"C",data:[y,v,x,w,g,U]}),o=h,c=f,r=g,i=U;break}case"A":{const h=Math.abs(l[0]),f=Math.abs(l[1]),g=l[2],U=l[3],y=l[4],v=l[5],x=l[6];h===0||f===0?(t.push({key:"C",data:[r,i,v,x,v,x]}),r=v,i=x):(r!==v||i!==x)&&(eI(r,i,v,x,h,f,g,U,y).forEach(function(C){t.push({key:"C",data:C})}),r=v,i=x);break}case"Z":t.push({key:"Z",data:[]}),r=a,i=s;break}n=d}return t}function BX(e){return Math.PI*e/180}function Rf(e,t,n){const r=e*Math.cos(n)-t*Math.sin(n),i=e*Math.sin(n)+t*Math.cos(n);return[r,i]}function eI(e,t,n,r,i,a,s,o,c,d){const l=BX(s);let h=[],f=0,g=0,U=0,y=0;if(d)[f,g,U,y]=d;else{[e,t]=Rf(e,t,-l),[n,r]=Rf(n,r,-l);const F=(e-n)/2,$=(t-r)/2;let q=F*F/(i*i)+$*$/(a*a);q>1&&(q=Math.sqrt(q),i=q*i,a=q*a);const W=o===c?-1:1,V=i*i,B=a*a,z=V*B-V*$*$-B*F*F,Y=V*$*$+B*F*F,K=W*Math.sqrt(Math.abs(z/Y));U=K*i*$/a+(e+n)/2,y=K*-a*F/i+(t+r)/2,f=Math.asin(parseFloat(((t-y)/a).toFixed(9))),g=Math.asin(parseFloat(((r-y)/a).toFixed(9))),e<U&&(f=Math.PI-f),n<U&&(g=Math.PI-g),f<0&&(f=Math.PI*2+f),g<0&&(g=Math.PI*2+g),c&&f>g&&(f=f-Math.PI*2),!c&&g>f&&(g=g-Math.PI*2)}let v=g-f;if(Math.abs(v)>Math.PI*120/180){const F=g,$=n,q=r;c&&g>f?g=f+Math.PI*120/180*1:g=f+Math.PI*120/180*-1,n=U+i*Math.cos(g),r=y+a*Math.sin(g),h=eI(n,r,$,q,i,a,s,0,c,[g,F,U,y])}v=g-f;const x=Math.cos(f),w=Math.sin(f),C=Math.cos(g),S=Math.sin(g),k=Math.tan(v/4),M=4/3*i*k,T=4/3*a*k,R=[e,t],j=[e+M*w,t-T*x],P=[n+M*S,r-T*C],N=[n,r];if(j[0]=2*R[0]-j[0],j[1]=2*R[1]-j[1],d)return[j,P,N].concat(h);{h=[j,P,N].concat(h);const F=[];for(let $=0;$<h.length;$+=3){const q=Rf(h[$][0],h[$][1],l),W=Rf(h[$+1][0],h[$+1][1],l),V=Rf(h[$+2][0],h[$+2][1],l);F.push([q[0],q[1],W[0],W[1],V[0],V[1]])}return F}}const zX={randOffset:YX,randOffsetWithRange:GX,ellipse:XX,doubleLineOps:qX};function tI(e,t,n,r,i){return{type:"path",ops:Yo(e,t,n,r,i)}}function dg(e,t,n){const r=(e||[]).length;if(r>2){const i=[];for(let a=0;a<r-1;a++)i.push(...Yo(e[a][0],e[a][1],e[a+1][0],e[a+1][1],n));return t&&i.push(...Yo(e[r-1][0],e[r-1][1],e[0][0],e[0][1],n)),{type:"path",ops:i}}else if(r===2)return tI(e[0][0],e[0][1],e[1][0],e[1][1],n);return{type:"path",ops:[]}}function HX(e,t){return dg(e,!0,t)}function WX(e,t,n,r,i){const a=[[e,t],[e+n,t],[e+n,t+r],[e,t+r]];return HX(a,i)}function ME(e,t){let n=RE(e,1*(1+t.roughness*.2),t);if(!t.disableMultiStroke){const r=RE(e,1.5*(1+t.roughness*.22),ZX(t));n=n.concat(r)}return{type:"path",ops:n}}function XX(e,t,n,r,i){const a=nI(n,r,i);return f3(e,t,i,a).opset}function nI(e,t,n){const r=Math.sqrt(Math.PI*2*Math.sqrt((Math.pow(e/2,2)+Math.pow(t/2,2))/2)),i=Math.ceil(Math.max(n.curveStepCount,n.curveStepCount/Math.sqrt(200)*r)),a=Math.PI*2/i;let s=Math.abs(e/2),o=Math.abs(t/2);const c=1-n.curveFitting;return s+=ot(s*c,n),o+=ot(o*c,n),{increment:a,rx:s,ry:o}}function f3(e,t,n,r){const[i,a]=DE(r.increment,e,t,r.rx,r.ry,1,r.increment*Zg(.1,Zg(.4,1,n),n),n);let s=Kg(i,null,n);if(!n.disableMultiStroke&&n.roughness!==0){const[o]=DE(r.increment,e,t,r.rx,r.ry,1.5,0,n),c=Kg(o,null,n);s=s.concat(c)}return{estimatedPoints:a,opset:{type:"path",ops:s}}}function IE(e,t,n,r,i,a,s,o,c){const d=e,l=t;let h=Math.abs(n/2),f=Math.abs(r/2);h+=ot(h*.01,c),f+=ot(f*.01,c);let g=i,U=a;for(;g<0;)g+=Math.PI*2,U+=Math.PI*2;U-g>Math.PI*2&&(g=0,U=Math.PI*2);const y=Math.PI*2/c.curveStepCount,v=Math.min(y/2,(U-g)/2),x=jE(v,d,l,h,f,g,U,1,c);if(!c.disableMultiStroke){const w=jE(v,d,l,h,f,g,U,1.5,c);x.push(...w)}return s&&(o?x.push(...Yo(d,l,d+h*Math.cos(g),l+f*Math.sin(g),c),...Yo(d,l,d+h*Math.cos(U),l+f*Math.sin(U),c)):x.push({op:"lineTo",data:[d,l]},{op:"lineTo",data:[d+h*Math.cos(g),l+f*Math.sin(g)]})),{type:"path",ops:x}}function AE(e,t){const n=JM(QM(lv(e))),r=[];let i=[0,0],a=[0,0];for(const{key:s,data:o}of n)switch(s){case"M":{a=[o[0],o[1]],i=[o[0],o[1]];break}case"L":r.push(...Yo(a[0],a[1],o[0],o[1],t)),a=[o[0],o[1]];break;case"C":{const[c,d,l,h,f,g]=o;r.push(...KX(c,d,l,h,f,g,a,t)),a=[f,g];break}case"Z":r.push(...Yo(a[0],a[1],i[0],i[1],t)),a=[i[0],i[1]];break}return{type:"path",ops:r}}function Fb(e,t){const n=[];for(const r of e)if(r.length){const i=t.maxRandomnessOffset||0,a=r.length;if(a>2){n.push({op:"move",data:[r[0][0]+ot(i,t),r[0][1]+ot(i,t)]});for(let s=1;s<a;s++)n.push({op:"lineTo",data:[r[s][0]+ot(i,t),r[s][1]+ot(i,t)]})}}return{type:"fillPath",ops:n}}function Au(e,t){return NX(t,zX).fillPolygons(e,t)}function VX(e,t,n,r,i,a,s){const o=e,c=t;let d=Math.abs(n/2),l=Math.abs(r/2);d+=ot(d*.01,s),l+=ot(l*.01,s);let h=i,f=a;for(;h<0;)h+=Math.PI*2,f+=Math.PI*2;f-h>Math.PI*2&&(h=0,f=Math.PI*2);const g=(f-h)/s.curveStepCount,U=[];for(let y=h;y<=f;y=y+g)U.push([o+d*Math.cos(y),c+l*Math.sin(y)]);return U.push([o+d*Math.cos(f),c+l*Math.sin(f)]),U.push([o,c]),Au([U],s)}function YX(e,t){return ot(e,t)}function GX(e,t,n){return Zg(e,t,n)}function qX(e,t,n,r,i){return Yo(e,t,n,r,i,!0)}function ZX(e){const t=Object.assign({},e);return t.randomizer=void 0,e.seed&&(t.seed=e.seed+1),t}function rI(e){return e.randomizer||(e.randomizer=new ZM(e.seed||0)),e.randomizer.next()}function Zg(e,t,n,r=1){return n.roughness*r*(rI(n)*(t-e)+e)}function ot(e,t,n=1){return Zg(-e,e,t,n)}function Yo(e,t,n,r,i,a=!1){const s=a?i.disableMultiStrokeFill:i.disableMultiStroke,o=LE(e,t,n,r,i,!0,!1);if(s)return o;const c=LE(e,t,n,r,i,!0,!0);return o.concat(c)}function LE(e,t,n,r,i,a,s){const o=Math.pow(e-n,2)+Math.pow(t-r,2),c=Math.sqrt(o);let d=1;c<200?d=1:c>500?d=.4:d=-.0016668*c+1.233334;let l=i.maxRandomnessOffset||0;l*l*100>o&&(l=c/10);const h=l/2,f=.2+rI(i)*.2;let g=i.bowing*i.maxRandomnessOffset*(r-t)/200,U=i.bowing*i.maxRandomnessOffset*(e-n)/200;g=ot(g,i,d),U=ot(U,i,d);const y=[],v=()=>ot(h,i,d),x=()=>ot(l,i,d),w=i.preserveVertices;return s?y.push({op:"move",data:[e+(w?0:v()),t+(w?0:v())]}):y.push({op:"move",data:[e+(w?0:ot(l,i,d)),t+(w?0:ot(l,i,d))]}),s?y.push({op:"bcurveTo",data:[g+e+(n-e)*f+v(),U+t+(r-t)*f+v(),g+e+2*(n-e)*f+v(),U+t+2*(r-t)*f+v(),n+(w?0:v()),r+(w?0:v())]}):y.push({op:"bcurveTo",data:[g+e+(n-e)*f+x(),U+t+(r-t)*f+x(),g+e+2*(n-e)*f+x(),U+t+2*(r-t)*f+x(),n+(w?0:x()),r+(w?0:x())]}),y}function RE(e,t,n){const r=[];r.push([e[0][0]+ot(t,n),e[0][1]+ot(t,n)]),r.push([e[0][0]+ot(t,n),e[0][1]+ot(t,n)]);for(let i=1;i<e.length;i++)r.push([e[i][0]+ot(t,n),e[i][1]+ot(t,n)]),i===e.length-1&&r.push([e[i][0]+ot(t,n),e[i][1]+ot(t,n)]);return Kg(r,null,n)}function Kg(e,t,n){const r=e.length,i=[];if(r>3){const a=[],s=1-n.curveTightness;i.push({op:"move",data:[e[1][0],e[1][1]]});for(let o=1;o+2<r;o++){const c=e[o];a[0]=[c[0],c[1]],a[1]=[c[0]+(s*e[o+1][0]-s*e[o-1][0])/6,c[1]+(s*e[o+1][1]-s*e[o-1][1])/6],a[2]=[e[o+1][0]+(s*e[o][0]-s*e[o+2][0])/6,e[o+1][1]+(s*e[o][1]-s*e[o+2][1])/6],a[3]=[e[o+1][0],e[o+1][1]],i.push({op:"bcurveTo",data:[a[1][0],a[1][1],a[2][0],a[2][1],a[3][0],a[3][1]]})}}else r===3?(i.push({op:"move",data:[e[1][0],e[1][1]]}),i.push({op:"bcurveTo",data:[e[1][0],e[1][1],e[2][0],e[2][1],e[2][0],e[2][1]]})):r===2&&i.push(...Yo(e[0][0],e[0][1],e[1][0],e[1][1],n));return i}function DE(e,t,n,r,i,a,s,o){const c=o.roughness===0,d=[],l=[];if(c){e=e/4,l.push([t+r*Math.cos(-e),n+i*Math.sin(-e)]);for(let h=0;h<=Math.PI*2;h=h+e){const f=[t+r*Math.cos(h),n+i*Math.sin(h)];d.push(f),l.push(f)}l.push([t+r*Math.cos(0),n+i*Math.sin(0)]),l.push([t+r*Math.cos(e),n+i*Math.sin(e)])}else{const h=ot(.5,o)-Math.PI/2;l.push([ot(a,o)+t+.9*r*Math.cos(h-e),ot(a,o)+n+.9*i*Math.sin(h-e)]);const f=Math.PI*2+h-.01;for(let g=h;g<f;g=g+e){const U=[ot(a,o)+t+r*Math.cos(g),ot(a,o)+n+i*Math.sin(g)];d.push(U),l.push(U)}l.push([ot(a,o)+t+r*Math.cos(h+Math.PI*2+s*.5),ot(a,o)+n+i*Math.sin(h+Math.PI*2+s*.5)]),l.push([ot(a,o)+t+.98*r*Math.cos(h+s),ot(a,o)+n+.98*i*Math.sin(h+s)]),l.push([ot(a,o)+t+.9*r*Math.cos(h+s*.5),ot(a,o)+n+.9*i*Math.sin(h+s*.5)])}return[l,d]}function jE(e,t,n,r,i,a,s,o,c){const d=a+ot(.1,c),l=[];l.push([ot(o,c)+t+.9*r*Math.cos(d-e),ot(o,c)+n+.9*i*Math.sin(d-e)]);for(let h=d;h<=s;h=h+e)l.push([ot(o,c)+t+r*Math.cos(h),ot(o,c)+n+i*Math.sin(h)]);return l.push([t+r*Math.cos(s),n+i*Math.sin(s)]),l.push([t+r*Math.cos(s),n+i*Math.sin(s)]),Kg(l,null,c)}function KX(e,t,n,r,i,a,s,o){const c=[],d=[o.maxRandomnessOffset||1,(o.maxRandomnessOffset||1)+.3];let l=[0,0];const h=o.disableMultiStroke?1:2,f=o.preserveVertices;for(let g=0;g<h;g++)g===0?c.push({op:"move",data:[s[0],s[1]]}):c.push({op:"move",data:[s[0]+(f?0:ot(d[0],o)),s[1]+(f?0:ot(d[0],o))]}),l=f?[i,a]:[i+ot(d[g],o),a+ot(d[g],o)],c.push({op:"bcurveTo",data:[e+ot(d[g],o),t+ot(d[g],o),n+ot(d[g],o),r+ot(d[g],o),l[0],l[1]]});return c}function Df(e){return[...e]}function QX(e,t=0){const n=e.length;if(n<3)throw new Error("A curve must have at least three points.");const r=[];if(n===3)r.push(Df(e[0]),Df(e[1]),Df(e[2]),Df(e[2]));else{const i=[];i.push(e[0],e[0]);for(let o=1;o<e.length;o++)i.push(e[o]),o===e.length-1&&i.push(e[o]);const a=[],s=1-t;r.push(Df(i[0]));for(let o=1;o+2<i.length;o++){const c=i[o];a[0]=[c[0],c[1]],a[1]=[c[0]+(s*i[o+1][0]-s*i[o-1][0])/6,c[1]+(s*i[o+1][1]-s*i[o-1][1])/6],a[2]=[i[o+1][0]+(s*i[o][0]-s*i[o+2][0])/6,i[o+1][1]+(s*i[o][1]-s*i[o+2][1])/6],a[3]=[i[o+1][0],i[o+1][1]],r.push(a[1],a[2],a[3])}}return r}function JX(e,t){return Math.sqrt(ug(e,t))}function ug(e,t){return Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2)}function eV(e,t,n){const r=ug(t,n);if(r===0)return ug(e,t);let i=((e[0]-t[0])*(n[0]-t[0])+(e[1]-t[1])*(n[1]-t[1]))/r;return i=Math.max(0,Math.min(1,i)),ug(e,Hc(t,n,i))}function Hc(e,t,n){return[e[0]+(t[0]-e[0])*n,e[1]+(t[1]-e[1])*n]}function tV(e,t){const n=e[t+0],r=e[t+1],i=e[t+2],a=e[t+3];let s=3*r[0]-2*n[0]-a[0];s*=s;let o=3*r[1]-2*n[1]-a[1];o*=o;let c=3*i[0]-2*a[0]-n[0];c*=c;let d=3*i[1]-2*a[1]-n[1];return d*=d,s<c&&(s=c),o<d&&(o=d),s+o}function p3(e,t,n,r){const i=r||[];if(tV(e,t)<n){const a=e[t+0];i.length?JX(i[i.length-1],a)>1&&i.push(a):i.push(a),i.push(e[t+3])}else{const s=e[t+0],o=e[t+1],c=e[t+2],d=e[t+3],l=Hc(s,o,.5),h=Hc(o,c,.5),f=Hc(c,d,.5),g=Hc(l,h,.5),U=Hc(h,f,.5),y=Hc(g,U,.5);p3([s,l,g,y],0,n,i),p3([y,U,f,d],0,n,i)}return i}function m3(e,t,n,r,i){const a=i||[],s=e[t],o=e[n-1];let c=0,d=1;for(let l=t+1;l<n-1;++l){const h=eV(e[l],s,o);h>c&&(c=h,d=l)}return Math.sqrt(c)>r?(m3(e,t,d+1,r,a),m3(e,d,n,r,a)):(a.length||a.push(s),a.push(o)),a}function nV(e,t=.15,n){const r=[],i=(e.length-1)/3;for(let a=0;a<i;a++){const s=a*3;p3(e,s,t,r)}return n&&n>0?m3(r,0,r.length,n):r}function rV(e,t){return Math.sqrt(hg(e,t))}function hg(e,t){return Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2)}function iV(e,t,n){const r=hg(t,n);if(r===0)return hg(e,t);let i=((e[0]-t[0])*(n[0]-t[0])+(e[1]-t[1])*(n[1]-t[1]))/r;return i=Math.max(0,Math.min(1,i)),hg(e,Wc(t,n,i))}function Wc(e,t,n){return[e[0]+(t[0]-e[0])*n,e[1]+(t[1]-e[1])*n]}function aV(e,t){const n=e[t+0],r=e[t+1],i=e[t+2],a=e[t+3];let s=3*r[0]-2*n[0]-a[0];s*=s;let o=3*r[1]-2*n[1]-a[1];o*=o;let c=3*i[0]-2*a[0]-n[0];c*=c;let d=3*i[1]-2*a[1]-n[1];return d*=d,s<c&&(s=c),o<d&&(o=d),s+o}function g3(e,t,n,r){const i=r||[];if(aV(e,t)<n){const a=e[t+0];i.length?rV(i[i.length-1],a)>1&&i.push(a):i.push(a),i.push(e[t+3])}else{const s=e[t+0],o=e[t+1],c=e[t+2],d=e[t+3],l=Wc(s,o,.5),h=Wc(o,c,.5),f=Wc(c,d,.5),g=Wc(l,h,.5),U=Wc(h,f,.5),y=Wc(g,U,.5);g3([s,l,g,y],0,n,i),g3([y,U,f,d],0,n,i)}return i}function sV(e,t){return U3(e,0,e.length,t)}function U3(e,t,n,r,i){const a=i||[],s=e[t],o=e[n-1];let c=0,d=1;for(let l=t+1;l<n-1;++l){const h=iV(e[l],s,o);h>c&&(c=h,d=l)}return Math.sqrt(c)>r?(U3(e,t,d+1,r,a),U3(e,d,n,r,a)):(a.length||a.push(s),a.push(o)),a}function oV(e,t=.15,n){const r=[],i=(e.length-1)/3;for(let a=0;a<i;a++){const s=a*3;g3(e,s,t,r)}return r}function lV(e,t,n){const r=lv(e),i=JM(QM(r)),a=[];let s=[],o=[0,0],c=[];const d=()=>{c.length>=4&&s.push(...oV(c,t)),c=[]},l=()=>{d(),s.length&&(a.push(s),s=[])};for(const{key:f,data:g}of i)switch(f){case"M":l(),o=[g[0],g[1]],s.push(o);break;case"L":d(),s.push([g[0],g[1]]);break;case"C":if(!c.length){const U=s.length?s[s.length-1]:o;c.push([U[0],U[1]])}c.push([g[0],g[1]]),c.push([g[2],g[3]]),c.push([g[4],g[5]]);break;case"Z":d(),s.push([o[0],o[1]]);break}if(l(),!n)return a;const h=[];for(const f of a){const g=sV(f,n);g.length&&h.push(g)}return h}const Ai="none";class i1{constructor(t){this.defaultOptions={maxRandomnessOffset:2,roughness:1,bowing:1,stroke:"#000",strokeWidth:1,curveTightness:0,curveFitting:.95,curveStepCount:9,fillStyle:"hachure",fillWeight:-1,hachureAngle:-41,hachureGap:-1,dashOffset:-1,dashGap:-1,zigzagOffset:-1,seed:0,disableMultiStroke:!1,disableMultiStrokeFill:!1,preserveVertices:!1,fillShapeRoughnessGain:.8},this.config=t||{},this.config.options&&(this.defaultOptions=this._o(this.config.options))}static newSeed(){return OX()}_o(t){return t?Object.assign({},this.defaultOptions,t):this.defaultOptions}_d(t,n,r){return{shape:t,sets:n||[],options:r||this.defaultOptions}}line(t,n,r,i,a){const s=this._o(a);return this._d("line",[tI(t,n,r,i,s)],s)}rectangle(t,n,r,i,a){const s=this._o(a),o=[],c=WX(t,n,r,i,s);if(s.fill){const d=[[t,n],[t+r,n],[t+r,n+i],[t,n+i]];s.fillStyle==="solid"?o.push(Fb([d],s)):o.push(Au([d],s))}return s.stroke!==Ai&&o.push(c),this._d("rectangle",o,s)}ellipse(t,n,r,i,a){const s=this._o(a),o=[],c=nI(r,i,s),d=f3(t,n,s,c);if(s.fill)if(s.fillStyle==="solid"){const l=f3(t,n,s,c).opset;l.type="fillPath",o.push(l)}else o.push(Au([d.estimatedPoints],s));return s.stroke!==Ai&&o.push(d.opset),this._d("ellipse",o,s)}circle(t,n,r,i){const a=this.ellipse(t,n,r,r,i);return a.shape="circle",a}linearPath(t,n){const r=this._o(n);return this._d("linearPath",[dg(t,!1,r)],r)}arc(t,n,r,i,a,s,o=!1,c){const d=this._o(c),l=[],h=IE(t,n,r,i,a,s,o,!0,d);if(o&&d.fill)if(d.fillStyle==="solid"){const f=Object.assign({},d);f.disableMultiStroke=!0;const g=IE(t,n,r,i,a,s,!0,!1,f);g.type="fillPath",l.push(g)}else l.push(VX(t,n,r,i,a,s,d));return d.stroke!==Ai&&l.push(h),this._d("arc",l,d)}curve(t,n){const r=this._o(n),i=[],a=ME(t,r);if(r.fill&&r.fill!==Ai&&t.length>=3)if(r.fillStyle==="solid"){const s=ME(t,Object.assign(Object.assign({},r),{disableMultiStroke:!0,roughness:r.roughness?r.roughness+r.fillShapeRoughnessGain:0}));i.push({type:"fillPath",ops:this._mergedShape(s.ops)})}else{const s=QX(t),o=nV(s,10,(1+r.roughness)/2);i.push(Au([o],r))}return r.stroke!==Ai&&i.push(a),this._d("curve",i,r)}polygon(t,n){const r=this._o(n),i=[],a=dg(t,!0,r);return r.fill&&(r.fillStyle==="solid"?i.push(Fb([t],r)):i.push(Au([t],r))),r.stroke!==Ai&&i.push(a),this._d("polygon",i,r)}path(t,n){const r=this._o(n),i=[];if(!t)return this._d("path",i,r);t=(t||"").replace(/\n/g," ").replace(/(-\s)/g,"-").replace("/(ss)/g"," ");const a=r.fill&&r.fill!=="transparent"&&r.fill!==Ai,s=r.stroke!==Ai,o=!!(r.simplification&&r.simplification<1),c=o?4-4*(r.simplification||1):(1+r.roughness)/2,d=lV(t,1,c),l=AE(t,r);if(a)if(r.fillStyle==="solid")if(d.length===1){const h=AE(t,Object.assign(Object.assign({},r),{disableMultiStroke:!0,roughness:r.roughness?r.roughness+r.fillShapeRoughnessGain:0}));i.push({type:"fillPath",ops:this._mergedShape(h.ops)})}else i.push(Fb(d,r));else i.push(Au(d,r));return s&&(o?d.forEach(h=>{i.push(dg(h,!1,r))}):i.push(l)),this._d("path",i,r)}opsToPath(t,n){let r="";for(const i of t.ops){const a=typeof n=="number"&&n>=0?i.data.map(s=>+s.toFixed(n)):i.data;switch(i.op){case"move":r+=`M${a[0]} ${a[1]} `;break;case"bcurveTo":r+=`C${a[0]} ${a[1]}, ${a[2]} ${a[3]}, ${a[4]} ${a[5]} `;break;case"lineTo":r+=`L${a[0]} ${a[1]} `;break}}return r.trim()}toPaths(t){const n=t.sets||[],r=t.options||this.defaultOptions,i=[];for(const a of n){let s=null;switch(a.type){case"path":s={d:this.opsToPath(a),stroke:r.stroke,strokeWidth:r.strokeWidth,fill:Ai};break;case"fillPath":s={d:this.opsToPath(a),stroke:Ai,strokeWidth:0,fill:r.fill||Ai};break;case"fillSketch":s=this.fillSketch(a,r);break}s&&i.push(s)}return i}fillSketch(t,n){let r=n.fillWeight;return r<0&&(r=n.strokeWidth/2),{d:this.opsToPath(t),stroke:n.fill||Ai,strokeWidth:r,fill:Ai}}_mergedShape(t){return t.filter((n,r)=>r===0?!0:n.op!=="move")}}class cV{constructor(t,n){this.canvas=t,this.ctx=this.canvas.getContext("2d"),this.gen=new i1(n)}draw(t){const n=t.sets||[],r=t.options||this.getDefaultOptions(),i=this.ctx,a=t.options.fixedDecimalPlaceDigits;for(const s of n)switch(s.type){case"path":i.save(),i.strokeStyle=r.stroke==="none"?"transparent":r.stroke,i.lineWidth=r.strokeWidth,r.strokeLineDash&&i.setLineDash(r.strokeLineDash),r.strokeLineDashOffset&&(i.lineDashOffset=r.strokeLineDashOffset),this._drawToContext(i,s,a),i.restore();break;case"fillPath":{i.save(),i.fillStyle=r.fill||"";const o=t.shape==="curve"||t.shape==="polygon"||t.shape==="path"?"evenodd":"nonzero";this._drawToContext(i,s,a,o),i.restore();break}case"fillSketch":this.fillSketch(i,s,r);break}}fillSketch(t,n,r){let i=r.fillWeight;i<0&&(i=r.strokeWidth/2),t.save(),r.fillLineDash&&t.setLineDash(r.fillLineDash),r.fillLineDashOffset&&(t.lineDashOffset=r.fillLineDashOffset),t.strokeStyle=r.fill||"",t.lineWidth=i,this._drawToContext(t,n,r.fixedDecimalPlaceDigits),t.restore()}_drawToContext(t,n,r,i="nonzero"){t.beginPath();for(const a of n.ops){const s=typeof r=="number"&&r>=0?a.data.map(o=>+o.toFixed(r)):a.data;switch(a.op){case"move":t.moveTo(s[0],s[1]);break;case"bcurveTo":t.bezierCurveTo(s[0],s[1],s[2],s[3],s[4],s[5]);break;case"lineTo":t.lineTo(s[0],s[1]);break}}n.type==="fillPath"?t.fill(i):t.stroke()}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}line(t,n,r,i,a){const s=this.gen.line(t,n,r,i,a);return this.draw(s),s}rectangle(t,n,r,i,a){const s=this.gen.rectangle(t,n,r,i,a);return this.draw(s),s}ellipse(t,n,r,i,a){const s=this.gen.ellipse(t,n,r,i,a);return this.draw(s),s}circle(t,n,r,i){const a=this.gen.circle(t,n,r,i);return this.draw(a),a}linearPath(t,n){const r=this.gen.linearPath(t,n);return this.draw(r),r}polygon(t,n){const r=this.gen.polygon(t,n);return this.draw(r),r}arc(t,n,r,i,a,s,o=!1,c){const d=this.gen.arc(t,n,r,i,a,s,o,c);return this.draw(d),d}curve(t,n){const r=this.gen.curve(t,n);return this.draw(r),r}path(t,n){const r=this.gen.path(t,n);return this.draw(r),r}}const km="http://www.w3.org/2000/svg";class dV{constructor(t,n){this.svg=t,this.gen=new i1(n)}draw(t){const n=t.sets||[],r=t.options||this.getDefaultOptions(),i=this.svg.ownerDocument||window.document,a=i.createElementNS(km,"g"),s=t.options.fixedDecimalPlaceDigits;for(const o of n){let c=null;switch(o.type){case"path":{c=i.createElementNS(km,"path"),c.setAttribute("d",this.opsToPath(o,s)),c.setAttribute("stroke",r.stroke),c.setAttribute("stroke-width",r.strokeWidth+""),c.setAttribute("fill","none"),r.strokeLineDash&&c.setAttribute("stroke-dasharray",r.strokeLineDash.join(" ").trim()),r.strokeLineDashOffset&&c.setAttribute("stroke-dashoffset",`${r.strokeLineDashOffset}`);break}case"fillPath":{c=i.createElementNS(km,"path"),c.setAttribute("d",this.opsToPath(o,s)),c.setAttribute("stroke","none"),c.setAttribute("stroke-width","0"),c.setAttribute("fill",r.fill||""),(t.shape==="curve"||t.shape==="polygon")&&c.setAttribute("fill-rule","evenodd");break}case"fillSketch":{c=this.fillSketch(i,o,r);break}}c&&a.appendChild(c)}return a}fillSketch(t,n,r){let i=r.fillWeight;i<0&&(i=r.strokeWidth/2);const a=t.createElementNS(km,"path");return a.setAttribute("d",this.opsToPath(n,r.fixedDecimalPlaceDigits)),a.setAttribute("stroke",r.fill||""),a.setAttribute("stroke-width",i+""),a.setAttribute("fill","none"),r.fillLineDash&&a.setAttribute("stroke-dasharray",r.fillLineDash.join(" ").trim()),r.fillLineDashOffset&&a.setAttribute("stroke-dashoffset",`${r.fillLineDashOffset}`),a}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}opsToPath(t,n){return this.gen.opsToPath(t,n)}line(t,n,r,i,a){const s=this.gen.line(t,n,r,i,a);return this.draw(s)}rectangle(t,n,r,i,a){const s=this.gen.rectangle(t,n,r,i,a);return this.draw(s)}ellipse(t,n,r,i,a){const s=this.gen.ellipse(t,n,r,i,a);return this.draw(s)}circle(t,n,r,i){const a=this.gen.circle(t,n,r,i);return this.draw(a)}linearPath(t,n){const r=this.gen.linearPath(t,n);return this.draw(r)}polygon(t,n){const r=this.gen.polygon(t,n);return this.draw(r)}arc(t,n,r,i,a,s,o=!1,c){const d=this.gen.arc(t,n,r,i,a,s,o,c);return this.draw(d)}curve(t,n){const r=this.gen.curve(t,n);return this.draw(r)}path(t,n){const r=this.gen.path(t,n);return this.draw(r)}}const vc={canvas(e,t){return new cV(e,t)},svg(e,t){return new dV(e,t)},generator(e){return new i1(e)},newSeed(){return i1.newSeed()}};function PE(e,t,n,r=i=>i){return e*r(.5-t*(.5-n))}function uV(e){return[-e[0],-e[1]]}function za(e,t){return[e[0]+t[0],e[1]+t[1]]}function na(e,t){return[e[0]-t[0],e[1]-t[1]]}function Fa(e,t){return[e[0]*t,e[1]*t]}function hV(e,t){return[e[0]/t,e[1]/t]}function jf(e){return[e[1],-e[0]]}function NE(e,t){return e[0]*t[0]+e[1]*t[1]}function fV(e,t){return e[0]===t[0]&&e[1]===t[1]}function pV(e){return Math.hypot(e[0],e[1])}function mV(e){return e[0]*e[0]+e[1]*e[1]}function OE(e,t){return mV(na(e,t))}function iI(e){return hV(e,pV(e))}function gV(e,t){return Math.hypot(e[1]-t[1],e[0]-t[0])}function Pf(e,t,n){let r=Math.sin(n),i=Math.cos(n),a=e[0]-t[0],s=e[1]-t[1],o=a*i-s*r,c=a*r+s*i;return[o+t[0],c+t[1]]}function b3(e,t,n){return za(e,Fa(na(t,e),n))}function FE(e,t,n){return za(e,Fa(t,n))}var{min:yu,PI:UV}=Math,$E=.275,Nf=UV+1e-4;function bV(e,t={}){let{size:n=16,smoothing:r=.5,thinning:i=.5,simulatePressure:a=!0,easing:s=B=>B,start:o={},end:c={},last:d=!1}=t,{cap:l=!0,easing:h=B=>B*(2-B)}=o,{cap:f=!0,easing:g=B=>--B*B*B+1}=c;if(e.length===0||n<=0)return[];let U=e[e.length-1].runningLength,y=o.taper===!1?0:o.taper===!0?Math.max(n,U):o.taper,v=c.taper===!1?0:c.taper===!0?Math.max(n,U):c.taper,x=Math.pow(n*r,2),w=[],C=[],S=e.slice(0,10).reduce((B,z)=>{let Y=z.pressure;if(a){let K=yu(1,z.distance/n),G=yu(1,1-K);Y=yu(1,B+(G-B)*(K*$E))}return(B+Y)/2},e[0].pressure),k=PE(n,i,e[e.length-1].pressure,s),M,T=e[0].vector,R=e[0].point,j=R,P=R,N=j,F=!1;for(let B=0;B<e.length;B++){let{pressure:z}=e[B],{point:Y,vector:K,distance:G,runningLength:ee}=e[B];if(B<e.length-1&&U-ee<3)continue;if(i){if(a){let je=yu(1,G/n),Je=yu(1,1-je);z=yu(1,S+(Je-S)*(je*$E))}k=PE(n,i,z,s)}else k=n/2;M===void 0&&(M=k);let de=ee<y?h(ee/y):1,xe=U-ee<v?g((U-ee)/v):1;k=Math.max(.01,k*Math.min(de,xe));let ve=(B<e.length-1?e[B+1]:e[B]).vector,Me=B<e.length-1?NE(K,ve):1,Ce=NE(K,T)<0&&!F,ge=Me!==null&&Me<0;if(Ce||ge){let je=Fa(jf(T),k);for(let Je=1/13,ut=0;ut<=1;ut+=Je)P=Pf(na(Y,je),Y,Nf*ut),w.push(P),N=Pf(za(Y,je),Y,Nf*-ut),C.push(N);R=P,j=N,ge&&(F=!0);continue}if(F=!1,B===e.length-1){let je=Fa(jf(K),k);w.push(na(Y,je)),C.push(za(Y,je));continue}let $e=Fa(jf(b3(ve,K,Me)),k);P=na(Y,$e),(B<=1||OE(R,P)>x)&&(w.push(P),R=P),N=za(Y,$e),(B<=1||OE(j,N)>x)&&(C.push(N),j=N),S=z,T=K}let $=e[0].point.slice(0,2),q=e.length>1?e[e.length-1].point.slice(0,2):za(e[0].point,[1,1]),W=[],V=[];if(e.length===1){if(!(y||v)||d){let B=FE($,iI(jf(na($,q))),-(M||k)),z=[];for(let Y=1/13,K=Y;K<=1;K+=Y)z.push(Pf(B,$,Nf*2*K));return z}}else{if(!(y||v&&e.length===1))if(l)for(let z=1/13,Y=z;Y<=1;Y+=z){let K=Pf(C[0],$,Nf*Y);W.push(K)}else{let z=na(w[0],C[0]),Y=Fa(z,.5),K=Fa(z,.51);W.push(na($,Y),na($,K),za($,K),za($,Y))}let B=jf(uV(e[e.length-1].vector));if(v||y&&e.length===1)V.push(q);else if(f){let z=FE(q,B,k);for(let Y=1/29,K=Y;K<1;K+=Y)V.push(Pf(z,q,Nf*3*K))}else V.push(za(q,Fa(B,k)),za(q,Fa(B,k*.99)),na(q,Fa(B,k*.99)),na(q,Fa(B,k)))}return w.concat(V,C.reverse(),W)}function yV(e,t={}){var n;let{streamline:r=.5,size:i=16,last:a=!1}=t;if(e.length===0)return[];let s=.15+(1-r)*.85,o=Array.isArray(e[0])?e:e.map(({x:g,y:U,pressure:y=.5})=>[g,U,y]);if(o.length===2){let g=o[1];o=o.slice(0,-1);for(let U=1;U<5;U++)o.push(b3(o[0],g,U/4))}o.length===1&&(o=[...o,[...za(o[0],[1,1]),...o[0].slice(2)]]);let c=[{point:[o[0][0],o[0][1]],pressure:o[0][2]>=0?o[0][2]:.25,vector:[1,1],distance:0,runningLength:0}],d=!1,l=0,h=c[0],f=o.length-1;for(let g=1;g<o.length;g++){let U=a&&g===f?o[g].slice(0,2):b3(h.point,o[g],s);if(fV(h.point,U))continue;let y=gV(U,h.point);if(l+=y,g<f&&!d){if(l<i)continue;d=!0}h={point:U,pressure:o[g][2]>=0?o[g][2]:.5,vector:iI(na(h.point,U)),distance:y,runningLength:l},c.push(h)}return c[0].vector=((n=c[1])==null?void 0:n.vector)||[0,0],c}function vV(e,t={}){return bV(yV(e,t),t)}function aI(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=aI(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function Fe(){for(var e=0,t,n,r="";e<arguments.length;)(t=arguments[e++])&&(n=aI(t))&&(r&&(r+=" "),r+=n);return r}function xV(e,t){return Math.sqrt(fg(e,t))}function fg(e,t){return Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2)}function wV(e,t,n){const r=fg(t,n);if(r===0)return fg(e,t);let i=((e[0]-t[0])*(n[0]-t[0])+(e[1]-t[1])*(n[1]-t[1]))/r;return i=Math.max(0,Math.min(1,i)),fg(e,Xc(t,n,i))}function Xc(e,t,n){return[e[0]+(t[0]-e[0])*n,e[1]+(t[1]-e[1])*n]}function EV(e,t){const n=e[t+0],r=e[t+1],i=e[t+2],a=e[t+3];let s=3*r[0]-2*n[0]-a[0];s*=s;let o=3*r[1]-2*n[1]-a[1];o*=o;let c=3*i[0]-2*a[0]-n[0];c*=c;let d=3*i[1]-2*a[1]-n[1];return d*=d,s<c&&(s=c),o<d&&(o=d),s+o}function y3(e,t,n,r){const i=r||[];if(EV(e,t)<n){const a=e[t+0];i.length?xV(i[i.length-1],a)>1&&i.push(a):i.push(a),i.push(e[t+3])}else{const s=e[t+0],o=e[t+1],c=e[t+2],d=e[t+3],l=Xc(s,o,.5),h=Xc(o,c,.5),f=Xc(c,d,.5),g=Xc(l,h,.5),U=Xc(h,f,.5),y=Xc(g,U,.5);y3([s,l,g,y],0,n,i),y3([y,U,f,d],0,n,i)}return i}function CV(e,t){return Qg(e,0,e.length,t)}function Qg(e,t,n,r,i){const a=i||[],s=e[t],o=e[n-1];let c=0,d=1;for(let l=t+1;l<n-1;++l){const h=wV(e[l],s,o);h>c&&(c=h,d=l)}return Math.sqrt(c)>r?(Qg(e,t,d+1,r,a),Qg(e,d,n,r,a)):(a.length||a.push(s),a.push(o)),a}function SV(e,t=.15,n){const r=[],i=(e.length-1)/3;for(let a=0;a<i;a++){const s=a*3;y3(e,s,t,r)}return Qg(r,0,r.length,n)}var Of={},BE;function _V(){if(BE)return Of;BE=1,Object.defineProperty(Of,"__esModule",{value:!0}),Of.sanitizeUrl=void 0;var e=/^([^\w]*)(javascript|data|vbscript)/im,t=/&#(\w+)(^\w|;)?/g,n=/&(newline|tab);/gi,r=/[\u0000-\u001F\u007F-\u009F\u2000-\u200D\uFEFF]/gim,i=/^.+(:|&colon;)/gim,a=[".","/"];function s(d){return a.indexOf(d[0])>-1}function o(d){return d.replace(t,function(l,h){return String.fromCharCode(h)})}function c(d){var l=o(d||"").replace(n,"").replace(r,"").trim();if(!l)return"about:blank";if(s(l))return l;var h=l.match(i);if(!h)return l;var f=h[0];return e.test(f)?"about:blank":l}return Of.sanitizeUrl=c,Of}var sI=_V();const oI="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";function Du(e,t,n){const r=n[0];if(t!=null&&e>=t)throw new Error(e+" >= "+t);if(e.slice(-1)===r||t&&t.slice(-1)===r)throw new Error("trailing zero");if(t){let s=0;for(;(e[s]||r)===t[s];)s++;if(s>0)return t.slice(0,s)+Du(e.slice(s),t.slice(s),n)}const i=e?n.indexOf(e[0]):0,a=t!=null?n.indexOf(t[0]):n.length;if(a-i>1){const s=Math.round(.5*(i+a));return n[s]}else return t&&t.length>1?t.slice(0,1):n[i]+Du(e.slice(1),null,n)}function lI(e){if(e.length!==cI(e[0]))throw new Error("invalid integer part of order key: "+e)}function cI(e){if(e>="a"&&e<="z")return e.charCodeAt(0)-97+2;if(e>="A"&&e<="Z")return 90-e.charCodeAt(0)+2;throw new Error("invalid order key head: "+e)}function cp(e){const t=cI(e[0]);if(t>e.length)throw new Error("invalid order key: "+e);return e.slice(0,t)}function zE(e,t){if(e==="A"+t[0].repeat(26))throw new Error("invalid order key: "+e);const n=cp(e);if(e.slice(n.length).slice(-1)===t[0])throw new Error("invalid order key: "+e)}function HE(e,t){lI(e);const[n,...r]=e.split("");let i=!0;for(let a=r.length-1;i&&a>=0;a--){const s=t.indexOf(r[a])+1;s===t.length?r[a]=t[0]:(r[a]=t[s],i=!1)}if(i){if(n==="Z")return"a"+t[0];if(n==="z")return null;const a=String.fromCharCode(n.charCodeAt(0)+1);return a>"a"?r.push(t[0]):r.pop(),a+r.join("")}else return n+r.join("")}function kV(e,t){lI(e);const[n,...r]=e.split("");let i=!0;for(let a=r.length-1;i&&a>=0;a--){const s=t.indexOf(r[a])-1;s===-1?r[a]=t.slice(-1):(r[a]=t[s],i=!1)}if(i){if(n==="a")return"Z"+t.slice(-1);if(n==="A")return null;const a=String.fromCharCode(n.charCodeAt(0)-1);return a<"Z"?r.push(t.slice(-1)):r.pop(),a+r.join("")}else return n+r.join("")}function vu(e,t,n=oI){if(e!=null&&zE(e,n),t!=null&&zE(t,n),e!=null&&t!=null&&e>=t)throw new Error(e+" >= "+t);if(e==null){if(t==null)return"a"+n[0];const c=cp(t),d=t.slice(c.length);if(c==="A"+n[0].repeat(26))return c+Du("",d,n);if(c<t)return c;const l=kV(c,n);if(l==null)throw new Error("cannot decrement any more");return l}if(t==null){const c=cp(e),d=e.slice(c.length),l=HE(c,n);return l??c+Du(d,null,n)}const r=cp(e),i=e.slice(r.length),a=cp(t),s=t.slice(a.length);if(r===a)return r+Du(i,s,n);const o=HE(r,n);if(o==null)throw new Error("cannot increment any more");return o<t?o:r+Du(i,null,n)}function v3(e,t,n,r=oI){if(n===0)return[];if(n===1)return[vu(e,t,r)];if(t==null){let s=vu(e,t,r);const o=[s];for(let c=0;c<n-1;c++)s=vu(s,t,r),o.push(s);return o}if(e==null){let s=vu(e,t,r);const o=[s];for(let c=0;c<n-1;c++)s=vu(e,s,r),o.push(s);return o.reverse(),o}const i=Math.floor(n/2),a=vu(e,t,r);return[...v3(e,a,i,r),a,...v3(a,t,n-i-1,r)]}const Bd=(()=>{if(typeof self>"u")return!1;if(!("top"in self&&self!==top)){if("showOpenFilePicker"in self)return"showOpenFilePicker"}return!1})(),TV=Bd?ye(()=>import("./file-open-002ab408-DIuFHtCF.js"),[],import.meta.url):ye(()=>import("./file-open-7c801643-684qeFg4.js"),[],import.meta.url);async function MV(...e){return(await TV).default(...e)}Bd?ye(()=>import("./directory-open-4ed118d0-BzWybGaI.js"),[],import.meta.url):ye(()=>import("./directory-open-01563666-DWU9wJ6I.js"),[],import.meta.url);const IV=Bd?ye(()=>import("./file-save-745eba88-Bb9F9Kg7.js"),[],import.meta.url):ye(()=>import("./file-save-3189631c-x92wctJd.js"),[],import.meta.url);async function AV(...e){return(await IV).default(...e)}var LV=(e,t)=>t.reduce((n,r)=>(r in e&&(n[r]=e[r]),n),{}),RV=5,Lu=5,DV=4,dp=4,up=1,Pa=[0,2,4,6,8],Na=(e,t)=>t.map(n=>dr[e][n]),yt={transparent:"transparent",black:"#1e1e1e",white:"#ffffff",gray:Na("gray",Pa),red:Na("red",Pa),pink:Na("pink",Pa),grape:Na("grape",Pa),violet:Na("violet",Pa),blue:Na("blue",Pa),cyan:Na("cyan",Pa),teal:Na("teal",Pa),green:Na("green",Pa),yellow:Na("yellow",Pa),orange:Na("orange",Pa),bronze:["#f8f1ee","#eaddd7","#d2bab0","#a18072","#846358"]},dI=LV(yt,["cyan","blue","violet","grape","pink","green","teal","yellow","orange","red"]),uI=[yt.black,yt.red[dp],yt.green[dp],yt.blue[dp],yt.yellow[dp]],hI=[yt.transparent,yt.red[up],yt.green[up],yt.blue[up],yt.yellow[up]],fI=[yt.white,"#f8f9fa","#f5faff","#fffce8","#fdf8f6"],jV={transparent:yt.transparent,white:yt.white,gray:yt.gray,black:yt.black,bronze:yt.bronze,...dI},PV={transparent:yt.transparent,white:yt.white,gray:yt.gray,black:yt.black,bronze:yt.bronze,...dI},NV=e=>[yt.cyan[e],yt.blue[e],yt.violet[e],yt.grape[e],yt.pink[e],yt.green[e],yt.teal[e],yt.yellow[e],yt.orange[e],yt.red[e]],OV=(e,t,n)=>`#${((1<<24)+(e<<16)+(t<<8)+n).toString(16).slice(1)}`,Xs=/Mac|iPod|iPhone|iPad/.test(navigator.platform),pI=/^Win/.test(navigator.platform),FV=/\b(android)\b/i.test(navigator.userAgent),a1="netscape"in window&&navigator.userAgent.indexOf("rv:")>1&&navigator.userAgent.indexOf("Gecko")>1,$V=navigator.userAgent.indexOf("Chrome")!==-1,BV=!$V&&navigator.userAgent.indexOf("Safari")!==-1,mI=/iPad|iPhone/.test(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document,zV=()=>{var e,t;return((t=(e=navigator.brave)==null?void 0:e.isBrave)==null?void 0:t.name)==="isBrave"},x3=typeof window<"u"&&"ResizeObserver"in window,HV="Excalidraw",WV=36,Vc=10,pg=8,XV=5,WE=1,VV=30,uc=Math.PI/12,gI="red",Ot={TEXT:"text",CROSSHAIR:"crosshair",GRABBING:"grabbing",GRAB:"grab",POINTER:"pointer",MOVE:"move",AUTO:""},Bl={MAIN:0,WHEEL:1,SECONDARY:2,TOUCH:-1,ERASER:5},xu={enabled:"all",disabled:"none"},Tm={UNSTARTED:-1,ENDED:0,PLAYING:1,PAUSED:2,BUFFERING:3,CUED:5},fi={TEST:"test"},oh={SHAPE_ACTIONS_MENU:"App-menu__left",ZOOM_ACTIONS:"zoom-actions",SEARCH_MENU_INPUT_WRAPPER:"layer-ui__search-inputWrapper"},ju="Xiaolai",s1="Segoe UI Emoji",un={Virgil:1,Helvetica:2,Cascadia:3,Excalifont:5,Nunito:6,"Lilita One":7,"Comic Shanns":8,"Liberation Sans":9},Pu={[ju]:100,[s1]:1e3},UI=e=>{switch(e){case un.Excalifont:return[ju,s1];default:return[s1]}},wt={LIGHT:"light",DARK:"dark"},Un={strokeColor:"#bbb",strokeWidth:2,strokeStyle:"solid",fillStyle:"solid",roughness:0,roundness:null,backgroundColor:"transparent",radius:8,nameOffsetY:3,nameColorLightTheme:"#999999",nameColorDarkTheme:"#7a7a7a",nameFontSize:14,nameLineHeight:1.25},cv=1,ol=20,xc=un.Excalifont,B1="left",Jg="top",wd=2,e2=2*wd,YV=1e-5,GV=2*e2-YV,Mm="#ffffff",qV="#1e1e1e",ZV="#a2f1a6",t2=20,bI=5,lh={svg:"image/svg+xml",png:"image/png",jpg:"image/jpeg",gif:"image/gif",webp:"image/webp",bmp:"image/bmp",ico:"image/x-icon",avif:"image/avif",jfif:"image/jfif"},We={text:"text/plain",html:"text/html",json:"application/json",excalidraw:"application/vnd.excalidraw+json",excalidrawlib:"application/vnd.excalidrawlib+json","excalidraw.svg":"image/svg+xml","excalidraw.png":"image/png",binary:"application/octet-stream",...lh},KV=[We.text,We.html,...Object.values(lh)],$b={png:"png",svg:"svg",clipboard:"clipboard"},da={excalidraw:"excalidraw",excalidrawClipboard:"excalidraw/clipboard",excalidrawLibrary:"excalidrawlib",excalidrawClipboardWithAPI:"excalidraw-api/clipboard"},dv=window.EXCALIDRAW_EXPORT_SOURCE||window.location.origin,QV=500,JV=300,eY=500,tY=100,yU=.1,uv=.1,hv=30,nY=300,fv="invert(93%) hue-rotate(180deg)",XE={canvasActions:{changeViewBackgroundColor:!0,clearCanvas:!0,export:{saveFileToDisk:!0},loadScene:!0,saveToActiveFile:!0,toggleTheme:null,saveAsImage:!0}},rY=730,iY=1e3,aY=500,sY=1229,Ff=2,pv=[1,2,3],Oh=10,oY=1440,VE=4*1024*1024,Tt="http://www.w3.org/2000/svg",vU={excalidraw:2,excalidrawLibrary:2},Xn=5,lY=.7,cY=11,ji={TOP:"top",MIDDLE:"middle",BOTTOM:"bottom"},o1={LEFT:"left",CENTER:"center",RIGHT:"right"},dY=20,Bb=.25,uY=32,Nn={LEGACY:1,PROPORTIONAL_RADIUS:2,ADAPTIVE_RADIUS:3},yI={artist:1,cartoonist:2},zb={thin:1,bold:2,extraBold:4},En={strokeColor:yt.black,backgroundColor:yt.transparent,fillStyle:"solid",strokeWidth:2,strokeStyle:"solid",roughness:yI.artist,opacity:100,locked:!1},n2="library",Gu="search",Qa={name:"default",defaultTab:n2},vI=new Set(["iframe","embeddable","image"]),Qn={selection:"selection",rectangle:"rectangle",diamond:"diamond",ellipse:"ellipse",text:"text",image:"image",eraser:"eraser",frame:"frame",magicframe:"magicframe",laser:"laser"},Tp={MERMAID_TO_EXCALIDRAW:"mermaid-to-excalidraw",PUBLISH_LIBRARY:"publish-library-data"},xI="Untitled",Nu={generalStats:1,elementProperties:2},ra=1,lr={sharp:"sharp",round:"round",elbow:"elbow"},wI=.3,r2="element",hY=Symbol.for("__test__originalId__"),EI=(e=>(e.ACTIVE="active",e.AWAY="away",e.IDLE="idle",e))(EI||{}),fY=pv.includes(devicePixelRatio)?devicePixelRatio:1,Vs=()=>({showWelcomeScreen:!1,theme:wt.LIGHT,collaborators:new Map,currentChartType:"bar",currentItemBackgroundColor:En.backgroundColor,currentItemEndArrowhead:"arrow",currentItemFillStyle:En.fillStyle,currentItemFontFamily:xc,currentItemFontSize:ol,currentItemOpacity:En.opacity,currentItemRoughness:En.roughness,currentItemStartArrowhead:null,currentItemStrokeColor:En.strokeColor,currentItemRoundness:"round",currentItemArrowType:lr.round,currentItemStrokeStyle:En.strokeStyle,currentItemStrokeWidth:En.strokeWidth,currentItemTextAlign:B1,currentHoveredFontFamily:null,cursorButton:"up",activeEmbeddable:null,newElement:null,editingTextElement:null,editingGroupId:null,editingLinearElement:null,activeTool:{type:"selection",customType:null,locked:En.locked,lastActiveTool:null},penMode:!1,penDetected:!1,errorMessage:null,exportBackground:!0,exportScale:fY,exportEmbedScene:!1,exportWithDarkMode:!1,fileHandle:null,gridSize:t2,gridStep:bI,gridModeEnabled:!1,isBindingEnabled:!0,defaultSidebarDockedPreference:!1,isLoading:!1,isResizing:!1,isRotating:!1,lastPointerDownWith:"mouse",multiElement:null,name:null,contextMenu:null,openMenu:null,openPopup:null,openSidebar:null,openDialog:null,pasteDialog:{shown:!1,data:null},previousSelectedElementIds:{},resizingElement:null,scrolledOutside:!1,scrollX:0,scrollY:0,selectedElementIds:{},hoveredElementIds:{},selectedGroupIds:{},selectedElementsAreBeingDragged:!1,selectionElement:null,shouldCacheIgnoreZoom:!1,stats:{open:!1,panels:Nu.generalStats|Nu.elementProperties},startBoundElement:null,suggestedBindings:[],frameRendering:{enabled:!0,clip:!0,name:!0,outline:!0},frameToHighlight:null,editingFrame:null,elementsToHighlight:null,toast:null,viewBackgroundColor:yt.white,zenModeEnabled:!1,zoom:{value:1},viewModeEnabled:!1,pendingImageElementId:null,showHyperlinkPopup:!1,selectedLinearElement:null,snapLines:[],originSnapOffset:{x:0,y:0},objectsSnapModeEnabled:!1,userToFollow:null,followedBy:new Set,isCropping:!1,croppingElementId:null,searchMatches:[]}),pY=(e=>e)({showWelcomeScreen:{browser:!0,export:!1,server:!1},theme:{browser:!0,export:!1,server:!1},collaborators:{browser:!1,export:!1,server:!1},currentChartType:{browser:!0,export:!1,server:!1},currentItemBackgroundColor:{browser:!0,export:!1,server:!1},currentItemEndArrowhead:{browser:!0,export:!1,server:!1},currentItemFillStyle:{browser:!0,export:!1,server:!1},currentItemFontFamily:{browser:!0,export:!1,server:!1},currentItemFontSize:{browser:!0,export:!1,server:!1},currentItemRoundness:{browser:!0,export:!1,server:!1},currentItemArrowType:{browser:!0,export:!1,server:!1},currentItemOpacity:{browser:!0,export:!1,server:!1},currentItemRoughness:{browser:!0,export:!1,server:!1},currentItemStartArrowhead:{browser:!0,export:!1,server:!1},currentItemStrokeColor:{browser:!0,export:!1,server:!1},currentItemStrokeStyle:{browser:!0,export:!1,server:!1},currentItemStrokeWidth:{browser:!0,export:!1,server:!1},currentItemTextAlign:{browser:!0,export:!1,server:!1},currentHoveredFontFamily:{browser:!1,export:!1,server:!1},cursorButton:{browser:!0,export:!1,server:!1},activeEmbeddable:{browser:!1,export:!1,server:!1},newElement:{browser:!1,export:!1,server:!1},editingTextElement:{browser:!1,export:!1,server:!1},editingGroupId:{browser:!0,export:!1,server:!1},editingLinearElement:{browser:!1,export:!1,server:!1},activeTool:{browser:!0,export:!1,server:!1},penMode:{browser:!0,export:!1,server:!1},penDetected:{browser:!0,export:!1,server:!1},errorMessage:{browser:!1,export:!1,server:!1},exportBackground:{browser:!0,export:!1,server:!1},exportEmbedScene:{browser:!0,export:!1,server:!1},exportScale:{browser:!0,export:!1,server:!1},exportWithDarkMode:{browser:!0,export:!1,server:!1},fileHandle:{browser:!1,export:!1,server:!1},gridSize:{browser:!0,export:!0,server:!0},gridStep:{browser:!0,export:!0,server:!0},gridModeEnabled:{browser:!0,export:!0,server:!0},height:{browser:!1,export:!1,server:!1},isBindingEnabled:{browser:!1,export:!1,server:!1},defaultSidebarDockedPreference:{browser:!0,export:!1,server:!1},isLoading:{browser:!1,export:!1,server:!1},isResizing:{browser:!1,export:!1,server:!1},isRotating:{browser:!1,export:!1,server:!1},lastPointerDownWith:{browser:!0,export:!1,server:!1},multiElement:{browser:!1,export:!1,server:!1},name:{browser:!0,export:!1,server:!1},offsetLeft:{browser:!1,export:!1,server:!1},offsetTop:{browser:!1,export:!1,server:!1},contextMenu:{browser:!1,export:!1,server:!1},openMenu:{browser:!0,export:!1,server:!1},openPopup:{browser:!1,export:!1,server:!1},openSidebar:{browser:!0,export:!1,server:!1},openDialog:{browser:!1,export:!1,server:!1},pasteDialog:{browser:!1,export:!1,server:!1},previousSelectedElementIds:{browser:!0,export:!1,server:!1},resizingElement:{browser:!1,export:!1,server:!1},scrolledOutside:{browser:!0,export:!1,server:!1},scrollX:{browser:!0,export:!1,server:!1},scrollY:{browser:!0,export:!1,server:!1},selectedElementIds:{browser:!0,export:!1,server:!1},hoveredElementIds:{browser:!1,export:!1,server:!1},selectedGroupIds:{browser:!0,export:!1,server:!1},selectedElementsAreBeingDragged:{browser:!1,export:!1,server:!1},selectionElement:{browser:!1,export:!1,server:!1},shouldCacheIgnoreZoom:{browser:!0,export:!1,server:!1},stats:{browser:!0,export:!1,server:!1},startBoundElement:{browser:!1,export:!1,server:!1},suggestedBindings:{browser:!1,export:!1,server:!1},frameRendering:{browser:!1,export:!1,server:!1},frameToHighlight:{browser:!1,export:!1,server:!1},editingFrame:{browser:!1,export:!1,server:!1},elementsToHighlight:{browser:!1,export:!1,server:!1},toast:{browser:!1,export:!1,server:!1},viewBackgroundColor:{browser:!0,export:!0,server:!0},width:{browser:!1,export:!1,server:!1},zenModeEnabled:{browser:!0,export:!1,server:!1},zoom:{browser:!0,export:!1,server:!1},viewModeEnabled:{browser:!1,export:!1,server:!1},pendingImageElementId:{browser:!1,export:!1,server:!1},showHyperlinkPopup:{browser:!1,export:!1,server:!1},selectedLinearElement:{browser:!0,export:!1,server:!1},snapLines:{browser:!1,export:!1,server:!1},originSnapOffset:{browser:!1,export:!1,server:!1},objectsSnapModeEnabled:{browser:!0,export:!1,server:!1},userToFollow:{browser:!1,export:!1,server:!1},followedBy:{browser:!1,export:!1,server:!1},isCropping:{browser:!1,export:!1,server:!1},croppingElementId:{browser:!1,export:!1,server:!1},searchMatches:{browser:!1,export:!1,server:!1}}),mY=(e,t)=>{var r;let n={};for(let i of Object.keys(e))if((r=pY[i])!=null&&r[t]){let a=e[i];n[i]=a}return n},CI=e=>mY(e,"export"),Is=({activeTool:e})=>e.type==="eraser",ch=({activeTool:e})=>e.type==="hand",vt=(e,t,n)=>Math.min(Math.max(e,t),n),Bs=(e,t,n="round")=>{let r=Math.pow(10,t);return Math[n]((e+Number.EPSILON)*r)/r},gY=(e,t,n="round")=>{let r=1/t;return Math[n](e*r)/r},Im=(e,t)=>(e+t)/2,Mp=e=>typeof e=="number"&&Number.isFinite(e),YE=(e,t,n=1e-4)=>Math.abs(e-t)<n,i2=e=>e<0?e+2*Math.PI:e>=2*Math.PI?e-2*Math.PI:e;function cd(e){return e*Math.PI/180}function z1(e){return e*180/Math.PI}function UY(e){return Math.abs(Math.sin(2*e))<1e-4}function gr(e,t,n=0,r=0){return[e-n,t-r]}function Ve(e,t=[0,0]){return gr(e[0]-t[0],e[1]-t[1])}function Kn(e,t){return e[0]*t[1]-t[0]*e[1]}function GE(e,t){return e[0]*t[0]+e[1]*t[1]}function ec(e,t){return[e[0]+t[0],e[1]+t[1]]}function a2(e,t){return[e[0]-t[0],e[1]-t[1]]}function Sn(e,t){return gr(e[0]*t,e[1]*t)}function bY(e){return e[0]*e[0]+e[1]*e[1]}function yY(e){return Math.sqrt(bY(e))}var Lr=e=>{let t=yY(e);return t===0?gr(0,0):gr(e[0]/t,e[1]/t)};function A(e,t){return[e,t]}function mv(e){return e.length===2?A(e[0],e[1]):void 0}function xt(e,t=A(0,0)){return A(t[0]+e[0],t[1]+e[1])}function vY(e){return Array.isArray(e)&&e.length===2&&typeof e[0]=="number"&&!isNaN(e[0])&&typeof e[1]=="number"&&!isNaN(e[1])}function rs(e,t){let n=Math.abs;return n(e[0]-t[0])<1e-4&&n(e[1]-t[1])<1e-4}function he([e,t],[n,r],i){return A((e-n)*Math.cos(i)-(t-r)*Math.sin(i)+n,(e-n)*Math.sin(i)+(t-r)*Math.cos(i)+r)}function s2(e,t=[0,0]){return A(e[0]+t[0],e[1]+t[1])}function H1(e,t){return A((e[0]+t[0])/2,(e[1]+t[1])/2)}function Rt(e,t){return Math.hypot(t[0]-e[0],t[1]-e[1])}function l1(e,t){let n=t[0]-e[0],r=t[1]-e[1];return n*n+r*r}var Lo=(e,t,n)=>s2(t,Sn(Ve(e,t),n)),SI=(e,t,n)=>t[0]<=Math.max(e[0],n[0])&&t[0]>=Math.min(e[0],n[0])&&t[1]<=Math.max(e[1],n[1])&&t[1]>=Math.min(e[1],n[1]);function w3(e,t){return[e,t]}function xY(e,t){let n=e[1][1]-e[0][1],r=e[0][0]-e[1][0],i=t[1][1]-t[0][1],a=t[0][0]-t[1][0],s=n*a-i*r;if(s!==0){let o=n*e[0][0]+r*e[0][1],c=i*t[0][0]+a*t[0][1];return A((o*a-c*r)/s,(n*c-i*o)/s)}return null}function Ge(e,t){return[e,t]}var Ed=(e,t,n=1e-4)=>{let r=gv(e,t);return r===0?!0:r<n},gv=(e,t)=>{let[n,r]=e,[[i,a],[s,o]]=t,c=n-i,d=r-a,l=s-i,h=o-a,f=c*l+d*h,g=l*l+h*h,U=-1;g!==0&&(U=f/g);let y,v;U<0?(y=i,v=a):U>1?(y=s,v=o):(y=i+U*l,v=a+U*h);let x=n-y,w=r-v;return Math.sqrt(x*x+w*w)};function c1(e,t){let n=xY(w3(e[0],e[1]),w3(t[0],t[1]));return!n||!Ed(n,t)||!Ed(n,e)?null:n}function E3(e,t){return[e,t]}function wY(e,t){return[Ge(e[0],A(e[1][0],e[0][1])),Ge(A(e[1][0],e[0][1]),e[1]),Ge(e[1],A(e[0][0],e[1][1])),Ge(A(e[0][0],e[1][1]),e[0])].map(n=>c1(t,n)).filter(n=>!!n)}function $o(e,t,n,r){return[e,t,n,r]}function qE(e,t,n,r=1e-6){return[(e(t+r,n)-e(t-r,n))/(2*r),(e(t,n+r)-e(t,n-r))/(2*r)]}function EY(e,t,n,r=.001,i=10){let a=1/0,s=0;for(;a>=r;){if(s>=i)return null;let o=e(t,n),c=[qE((y,v)=>e(y,v)[0],t,n),qE((y,v)=>e(y,v)[1],t,n)],d=[[-o[0]],[-o[1]]],l=c[0][0]*c[1][1]-c[0][1]*c[1][0];if(l===0)return null;let h=[[c[1][1]/l,-c[0][1]/l],[-c[1][0]/l,c[0][0]/l]],f=[[h[0][0]*d[0][0]+h[0][1]*d[1][0]],[h[1][0]*d[0][0]+h[1][1]*d[1][0]]];t=t+f[0][0],n=n+f[1][0];let[g,U]=e(t,n);a=Math.max(Math.abs(g),Math.abs(U)),s+=1}return[t,n]}var Ip=(e,t)=>A((1-t)**3*e[0][0]+3*(1-t)**2*t*e[1][0]+3*(1-t)*t**2*e[2][0]+t**3*e[3][0],(1-t)**3*e[0][1]+3*(1-t)**2*t*e[1][1]+3*(1-t)*t**2*e[2][1]+t**3*e[3][1]);function _I(e,t){let n=SY(e);if(wY(E3(A(n[0],n[1]),A(n[2],n[3])),t).length===0)return[];let r=o=>A(t[0][0]+o*(t[1][0]-t[0][0]),t[0][1]+o*(t[1][1]-t[0][1])),i=[[.5,0],[.2,0],[.8,0]],a=([o,c])=>{let d=EY((f,g)=>{let U=Ip(e,f),y=r(g);return[U[0]-y[0],U[1]-y[1]]},o,c);if(!d)return null;let[l,h]=d;return l<0||l>1||h<0||h>1?null:Ip(e,l)},s=a(i[0]);return s?[s]:(s=a(i[1]),s?[s]:(s=a(i[2]),s?[s]:[]))}function CY(e,t,n=.001){let r=(c,d,l,h=n)=>{let f=c,g=d,U;for(;g-f>h;)U=(g+f)/2,l(U-h)<l(U+h)?g=U:f=U;return U},i=0;for(let c=1/0,d=0;d<30;d++){let l=Rt(t,Ip(e,d/30));l<c&&(c=l,i=d)}let a=Math.max((i-1)/30,0),s=Math.min((i+1)/30,1),o=r(a,s,c=>Rt(t,Ip(e,c)));return o?Ip(e,o):null}function kI(e,t){let n=CY(e,t);return n?Rt(t,n):0}function SY(e){let[t,n,r,i]=e,a=[t[0],n[0],r[0],i[0]],s=[t[1],n[1],r[1],i[1]];return[Math.min(...a),Math.min(...s),Math.max(...a),Math.max(...s)]}function ZE(...e){return TI(e)}function o2(e){return TI(e)}var KE=(e,t)=>{let n=e[0],r=e[1],i=!1;for(let a=0,s=t.length-1;a<t.length;s=a++){let o=t[a][0],c=t[a][1],d=t[s][0],l=t[s][1];(c>r&&l<=r||c<=r&&l>r)&&n<(d-o)*(r-c)/(l-c)+o&&(i=!i)}return i},_Y=(e,t,n=1e-4)=>{let r=!1;for(let i=0,a=t.length-1;i<a;i++)if(Ed(e,Ge(t[i],t[i+1]),n)){r=!0;break}return r};function TI(e){return kY(e)?e:[...e,e[0]]}function kY(e){return rs(e[0],e[e.length-1])}function Tr(e,t){return fa([e,t])}var l2=([e,t],[n,r])=>e<=n?t>=n:e>=n?r>=e:!1,c2=([e,t],[n,r])=>{let i=Math.max(e,n),a=Math.min(t,r);return i<=a?fa([i,a]):null},Am=(e,[t,n])=>e>=t&&e<=n;function wu([e,t,n],r){let i=(l,h,f)=>(l[0]-f[0])*(h[1]-f[1])-(h[0]-f[0])*(l[1]-f[1]),a=i(r,e,t),s=i(r,t,n),o=i(r,n,e),c=a<0||s<0||o<0,d=a>0||s>0||o>0;return!(c&&d)}var QE=()=>{let e=new Date,t=e.getFullYear(),n=`${e.getMonth()+1}`.padStart(2,"0"),r=`${e.getDate()}`.padStart(2,"0"),i=`${e.getHours()}`.padStart(2,"0"),a=`${e.getMinutes()}`.padStart(2,"0");return`${t}-${n}-${r}-${i}${a}`},Ap=e=>e.charAt(0).toUpperCase()+e.slice(1),TY=e=>e instanceof HTMLElement&&e.className.includes("ToolIcon"),C3=e=>e instanceof HTMLElement&&e.dataset.type==="wysiwyg"||e instanceof HTMLBRElement||e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e instanceof HTMLSelectElement,MY=e=>C3(e)||e instanceof Element&&!!e.closest("label, button"),Zc=e=>e instanceof HTMLElement&&e.dataset.type==="wysiwyg"||e instanceof HTMLBRElement||e instanceof HTMLTextAreaElement||e instanceof HTMLInputElement&&(e.type==="text"||e.type==="number"||e.type==="password"),dh=({fontFamily:e})=>{for(let[t,n]of Object.entries(un))if(n===e)return`${t}${UI(n).map(r=>`, ${r}`).join("")}`;return s1},Bt=({fontSize:e,fontFamily:t})=>`${e}px ${dh({fontFamily:t})}`,uh=(e,t)=>{let n=0,r=null,i=(...a)=>{r=a,clearTimeout(n),n=window.setTimeout(()=>{r=null,e(...a)},t)};return i.flush=()=>{if(clearTimeout(n),r){let a=r;r=null,e(...a)}},i.cancel=()=>{r=null,clearTimeout(n)},i},xU=(e,t)=>{let n=null,r=null,i=null,a=o=>{n=window.requestAnimationFrame(()=>{n=null,e(...o),r=null,i&&(r=i,i=null,a(r))})},s=(...o)=>{if(mt.MODE==="test"){e(...o);return}r=o,n===null?a(r):t!=null&&t.trailing&&(i=o)};return s.flush=()=>{n!==null&&(cancelAnimationFrame(n),n=null),r&&(e(...i||r),r=i=null)},s.cancel=()=>{r=i=null,n!==null&&(cancelAnimationFrame(n),n=null)},s},dd=e=>1-Math.pow(1-e,4),JE=(e,t,n)=>(t-e)*dd(n)+e,IY=({fromValues:e,toValues:t,onStep:n,duration:r=250,interpolateValue:i,onStart:a,onEnd:s,onCancel:o})=>{let c=!1,d=0,l;function h(f){if(c)return;l===void 0&&(l=f,a==null||a());let g=Math.min(f-l,r),U=dd(g/r),y={};if(Object.keys(e).forEach(v=>{let x=v,w=(t[x]-e[x])*U+e[x];y[x]=w}),n(y),g<r){let v=g/r,x={};Object.keys(e).forEach(w=>{let C=w,S=e[C],k=t[C],M;M=i?i(S,k,v,C):JE(S,k,v),M==null&&(M=JE(S,k,v)),x[C]=M}),n(x),d=window.requestAnimationFrame(h)}else n(t),s==null||s()}return d=window.requestAnimationFrame(h),()=>{o==null||o(),c=!0,window.cancelAnimationFrame(d)}},AY=(e,t)=>{if(!e.length||t<1)return[];let n=0,r=0,i=Array(Math.ceil(e.length/t));for(;n<e.length;)i[r++]=e.slice(n,n+=t);return i},Mr=(e,t)=>Math.abs(e-t),Pn=(e,t)=>t.type==="custom"?{...e.activeTool,type:"custom",customType:t.customType,locked:t.locked??e.activeTool.locked}:{...e.activeTool,lastActiveTool:t.lastActiveToolBeforeEraser===void 0?e.activeTool.lastActiveTool:t.lastActiveToolBeforeEraser,type:t.type,customType:null,locked:t.locked??e.activeTool.locked},pe=e=>(e=e.replace(/\bAlt\b/i,"Alt").replace(/\bShift\b/i,"Shift").replace(/\b(Enter|Return)\b/i,"Enter"),Xs?e.replace(/\bCtrlOrCmd\b/gi,"Cmd").replace(/\bAlt\b/i,"Option"):e.replace(/\bCtrlOrCmd\b/gi,"Ctrl")),Yt=({clientX:e,clientY:t},{zoom:n,offsetLeft:r,offsetTop:i,scrollX:a,scrollY:s})=>{let o=(e-r)/n.value-a,c=(t-i)/n.value-s;return{x:o,y:c}},oa=({sceneX:e,sceneY:t},{zoom:n,offsetLeft:r,offsetTop:i,scrollX:a,scrollY:s})=>{let o=(e+a)*n.value+r,c=(t+s)*n.value+i;return{x:o,y:c}},Lm=e=>getComputedStyle(document.documentElement).getPropertyValue(`--${e}`),LY="A-Za-zÀ-ÖØ-öø-ʸ̀-֐ࠀ-῿Ⰰ-﬜﷾-﹯﻽-￿",RY="֑-߿יִ-﷽ﹰ-ﻼ",DY=new RegExp(`^[^${LY}]*[${RY}]`),MI=e=>DY.test(e),Ya=e=>{let[t,n]=e;return{x:t,y:n}},II=e=>{if((e==null?void 0:e.name)==="AbortError"){console.warn(e);return}throw e},AI=(e,t,n=0)=>{n<0&&(n=e.length+n),n=Math.min(e.length,Math.max(n,0));let r=n-1;for(;++r<e.length;)if(t(e[r],r,e))return r;return-1},Kc=(e,t,n=e.length-1)=>{n<0&&(n=e.length+n),n=Math.min(e.length-1,Math.max(n,0));let r=n+1;for(;--r>-1;)if(t(e[r],r,e))return r;return-1},Ga=e=>{let t=e.length===5&&e.substr(4,1)==="0",n=e.length===9&&e.substr(7,2)==="00";return t||n||e===yt.transparent},Hb=e=>e.fillStyle!=="solid"||Ga(e.backgroundColor),jY=()=>{let e,t,n=new Promise((r,i)=>{e=r,t=i});return n.resolve=e,n.reject=t,n},PY=e=>{let t=e.parentElement;for(;t;){if(t===document.body)return document;let{overflowY:n}=window.getComputedStyle(t);if(t.scrollHeight>t.clientHeight&&(n==="auto"||n==="scroll"||n==="overlay"))return t;t=t.parentElement}return document},NY=e=>{let t=e.parentElement;for(;t;){if(t.tabIndex>-1){t.focus();return}t=t.parentElement}},OY=e=>Array.from(e).map(t=>`0${t.toString(16)}`.slice(-2)).join(""),Fh=()=>Go()?1:Date.now(),nt=e=>e instanceof Map?e:e.reduce((t,n)=>(t.set(typeof n=="string"?n:n.id,n),t),new Map),FY=e=>e.reduce((t,n,r)=>(t.set(n.id,[n,r]),t),new Map),_o=(e,t)=>e.reduce((n,r)=>(n[t?t(r):String(r)]=r,n),{}),$Y=e=>e.reduce((t,n,r)=>{let i={...n,prev:null,next:null};if(r!==0){let a=t[r-1];if(i.prev=a,a.next=i,r===e.length-1){let s=t[0];i.next=s,s.prev=i}}return t.push(i),t},[]),Go=()=>mt.MODE==="test",LI=()=>mt.MODE==="development",BY=()=>typeof process<"u"&&!0,RI=(e,t)=>new CustomEvent(e,{detail:{nativeEvent:t},cancelable:!0}),mg=(e,t)=>{let n=!1;for(let r in t){let i=t[r];if(typeof i<"u"){if(e[r]===i&&(typeof i!="object"||i===null))continue;n=!0}}return n?{...e,...t}:e},zY=()=>{try{return window.self===window.top?"top":"iframe"}catch{return"iframe"}},W1=e=>!!e&&typeof e=="object"&&"then"in e&&"catch"in e&&"finally"in e,S3=e=>{let t=e==null?void 0:e.querySelectorAll("button, a, input, select, textarea, div[tabindex], label[tabindex]");return t?Array.from(t).filter(n=>n.tabIndex>-1&&!n.disabled):[]},eC=(e,t)=>Array.isArray(e)&&Array.isArray(t)&&e.length===0&&t.length===0?!0:e===t,yr=(e,t,n,r=!1)=>{let i=Object.keys(e),a=Object.keys(t);if(i.length!==a.length)return r&&console.warn("%cisShallowEqual: objects don't have same properties ->","color: #8B4000",e,t),!1;if(n&&Array.isArray(n)){for(let s of n)if(!(e[s]===t[s]||eC(e[s],t[s])))return r&&console.warn(`%cisShallowEqual: ${s} not equal ->`,"color: #8B4000",e[s],t[s]),!1;return!0}return i.every(s=>{let o=n==null?void 0:n[s],c=o?o(e[s],t[s]):e[s]===t[s]||eC(e[s],t[s]);return!c&&r&&console.warn(`%cisShallowEqual: ${s} not equal ->`,"color: #8B4000",e[s],t[s]),c})},wU=(e,t,{checkForDefaultPrevented:n=!0}={})=>function(r){if(e==null||e(r),!n||!(r!=null&&r.defaultPrevented))return t==null?void 0:t(r)},Cd=(e,t,n)=>{if(!t)return e;if(n)return console.error(t),e;throw new Error(t)};function Dr(e,t){if(!e)throw new Error(t)}var HY=e=>{let t,n,r=function(i){let a=Object.entries(i);if(t){let o=!0;for(let[c,d]of a)if(t.get(c)!==d){o=!1;break}if(o)return n}let s=e(i);return t=new Map(a),n=s,s};return r.clear=()=>{t=void 0,n=void 0},r},DI=(e,t)=>e instanceof Set||e instanceof Map?e.has(t):"includes"in e?e.includes(t):e.hasOwnProperty(t),Ho=e=>JSON.parse(JSON.stringify(e)),$f=(e,t)=>yr(e,t)?e:t;function mn(e,t,n,r){var i;return e?((i=e==null?void 0:e.addEventListener)==null||i.call(e,t,n,r),()=>{var a;(a=e==null?void 0:e.removeEventListener)==null||a.call(e,t,n,r)}):()=>{}}function WY(e,t=!0){let n=e.length;if(n<4)return"";let r=e[0],i=e[1],a=e[2],s=`M${r[0].toFixed(2)},${r[1].toFixed(2)} Q${i[0].toFixed(2)},${i[1].toFixed(2)} ${Im(i[0],a[0]).toFixed(2)},${Im(i[1],a[1]).toFixed(2)} T`;for(let o=2,c=n-1;o<c;o++)r=e[o],i=e[o+1],s+=`${Im(r[0],i[0]).toFixed(2)},${Im(r[1],i[1]).toFixed(2)} `;return t&&(s+="Z"),s}var jI=e=>e.replace(/\r?\n|\r/g,`
48
- `),fa=e=>e,hh=async(e,...t)=>new Promise(n=>{n(e(...t))}),XY=(...e)=>Math.max(...e.map(t=>t?1:0))>0,tC=class{constructor(e,t){H(this,"pool"),H(this,"entries",{}),this.pool=new kX(e,t)}all(){let e=t=>{if(t.data.result){let[n,r]=t.data.result;this.entries[n]=r}};return this.pool.addEventListener("fulfilled",e),this.pool.start().then(()=>(setTimeout(()=>{this.pool.removeEventListener("fulfilled",e)}),Object.values(this.entries)))}},gg=e=>e.replace(/"/g,"&quot;"),nC=e=>Array.isArray(e)?e:[e],aa=e=>!!e&&e.type==="image"&&!!e.fileId,Lt=e=>!!e&&e.type==="image",li=e=>!!e&&e.type==="embeddable",Yl=e=>!!e&&e.type==="iframe",sa=e=>!!e&&(e.type==="iframe"||e.type==="embeddable"),Le=e=>e!=null&&e.type==="text",PI=e=>e!=null&&e.type==="frame",Ug=e=>e!=null&&e.type==="magicframe",tt=e=>e!=null&&(e.type==="frame"||e.type==="magicframe"),pa=e=>e!=null&&VY(e.type),VY=e=>e==="freedraw",st=e=>e!=null&&Uv(e.type),Ut=e=>e!=null&&e.type==="arrow",Pe=e=>Ut(e)&&e.elbowed,Uv=e=>e==="arrow"||e==="line",Ns=(e,t=!0)=>e!=null&&(!e.locked||t===!0)&&NI(e.type),NI=e=>e==="arrow",is=(e,t=!0)=>e!=null&&(!e.locked||t===!0)&&(e.type==="rectangle"||e.type==="diamond"||e.type==="ellipse"||e.type==="image"||e.type==="iframe"||e.type==="embeddable"||e.type==="frame"||e.type==="magicframe"||e.type==="text"&&!e.containerId),YY=e=>e!=null&&(e.type==="rectangle"||e.type==="diamond"||e.type==="image"||e.type==="iframe"||e.type==="embeddable"||e.type==="frame"||e.type==="magicframe"||e.type==="text"&&!e.containerId),ud=(e,t=!0)=>e!=null&&(!e.locked||t===!0)&&(e.type==="rectangle"||e.type==="diamond"||e.type==="ellipse"||Ut(e)),OI=e=>{let t=e==null?void 0:e.type;if(!t)return!1;switch(t){case"text":case"diamond":case"rectangle":case"iframe":case"embeddable":case"ellipse":case"arrow":case"freedraw":case"line":case"frame":case"magicframe":case"image":case"selection":return!0;default:return Cd(t,null),!1}},EU=e=>e.type==="rectangle"||e.type==="ellipse"||e.type==="diamond",ma=e=>{var t;return ud(e)&&!!((t=e.boundElements)!=null&&t.some(({type:n})=>n==="text"))},an=e=>e!==null&&"containerId"in e&&e.containerId!==null&&Le(e),$h=e=>e==="rectangle"||e==="embeddable"||e==="iframe"||e==="image",FI=e=>e==="line"||e==="arrow"||e==="diamond",GY=(e,t)=>!!((e===Nn.ADAPTIVE_RADIUS||e===Nn.LEGACY)&&$h(t.type)||e===Nn.PROPORTIONAL_RADIUS&&FI(t.type)),qY=e=>FI(e.type)?{type:Nn.PROPORTIONAL_RADIUS}:$h(e.type)?{type:Nn.ADAPTIVE_RADIUS}:null,d2=e=>Object.hasOwn(e,"fixedPoint")&&e.fixedPoint!=null,jr=(e,t,n)=>{let r=e.split(`
49
- `).map(s=>s||" ").join(`
50
- `),i=parseFloat(t),a=JY(r,i,n);return{width:vv(r,t),height:a}},$I="ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789".toLocaleUpperCase(),BI=(e,t)=>{let n=eG(e);return n===0?jr($I.split("").join(`
51
- `),e,t).width+Xn*2:n+Xn*2},bv=(e,t)=>jr("",e,t).width+Xn*2,ZY=()=>vv($I,Bt({fontSize:ol,fontFamily:xc}))>0,fh=e=>jI(e).replace(/\t/g," "),yv=e=>fh(e).split(`
52
- `),KY=e=>{let t=yv(e.text).length;return e.height/t/e.fontSize},X1=(e,t)=>e*t,zI=(e,t)=>X1(e,t)+Xn*2,Wb,QY=class{constructor(){H(this,"canvas"),this.canvas=document.createElement("canvas")}getLineWidth(e,t){let n=this.canvas.getContext("2d");n.font=t;let r=n.measureText(e).width;return Go()?r*10:r}},Sd=(e,t)=>(Wb||(Wb=new QY),Wb.getLineWidth(e,t)),vv=(e,t)=>{let n=yv(e),r=0;return n.forEach(i=>{r=Math.max(r,Sd(i,t))}),r},JY=(e,t,n)=>{let r=yv(e).length;return X1(t,n)*r},V1=(()=>{let e={};return{calculate:(t,n)=>{let r=t.charCodeAt(0);if(e[n]||(e[n]=[]),!e[n][r]){let i=Sd(t,n);e[n][r]=i}return e[n][r]},getCache:t=>e[t],clearCache:t=>{e[t]=[]}}})(),eG=e=>{let t=V1.getCache(e);if(!t)return 0;let n=t.filter(r=>r!==void 0);return Math.max(...n)},Xb,Rm,Vb,tG=e=>(Xb||(Xb=Nt.class(...Object.values(Ro))),Xb.test(e)),nG=()=>{if(!Rm)try{Rm=iG()}catch{Rm=rG()}return Rm},xv=()=>(Vb||(Vb=aG()),Vb),ea={WHITESPACE:/\s/u,HYPHEN:/-/u,OPENING:/<\(\[\{/u,CLOSING:/>\)\]\}.,:;!\?…\//u},Ro={CHAR:new RegExp("\\p{Script=Han}\\p{Script=Hiragana}\\p{Script=Katakana}\\p{Script=Hangul}`'^〃〰〆#&*+-ー/\=|¦〒¬ ̄","u"),OPENING:/([{〈《⦅「「『【〖〔〘〚<〝/u,CLOSING:/)]}〉》⦆」」』】〗〕〙〛>。.,、〟‥?!:;・〜〞/u,CURRENCY:/¥₩£¢$/u},Fc={FLAG:new RegExp("\\p{RI}\\p{RI}","u"),JOINER:new RegExp("(?:\\p{Emoji_Modifier}|\\uFE0F\\u20E3?|[\\u{E0020}-\\u{E007E}]+\\u{E007F})?","u"),ZWJ:/\u200D/u,ANY:/[\p{Emoji}]/u,MOST:/[\p{Extended_Pictographic}\p{Emoji_Presentation}]/u},rG=()=>Nt.or(xv(),Rn.On(ea.HYPHEN,ea.WHITESPACE,Ro.CHAR)),iG=()=>Nt.or(xv(),Rn.Before(ea.WHITESPACE).Build(),Rn.After(ea.WHITESPACE,ea.HYPHEN).Build(),Rn.Before(Ro.CHAR,Ro.CURRENCY).NotPrecededBy(ea.OPENING,Ro.OPENING).Build(),Rn.After(Ro.CHAR).NotFollowedBy(ea.HYPHEN,ea.CLOSING,Ro.CLOSING).Build(),Rn.BeforeMany(Ro.OPENING).NotPrecededBy(ea.OPENING).Build(),Rn.AfterMany(Ro.CLOSING).NotFollowedBy(ea.CLOSING).Build(),Rn.AfterMany(ea.CLOSING).FollowedBy(ea.OPENING).Build()),aG=()=>Nt.group(Nt.or(Fc.FLAG,Nt.and(Fc.MOST,Fc.JOINER,Nt.build(`(?:${Fc.ZWJ.source}(?:${Fc.FLAG.source}|${Fc.ANY.source}${Fc.JOINER.source}))*`)))),Nt={build:e=>new RegExp(e,"u"),join:(...e)=>e.map(t=>t.source).join(""),and:(...e)=>Nt.build(Nt.join(...e)),or:(...e)=>Nt.build(e.map(t=>t.source).join("|")),group:(...e)=>Nt.build(`(${Nt.join(...e)})`),class:(...e)=>Nt.build(`[${Nt.join(...e)}]`)},Rn={On:(...e)=>{let t=Nt.join(...e);return Nt.build(`([${t}])`)},Before:(...e)=>{let t=Nt.join(...e),n=()=>Nt.build(`(?=[${t}])`);return Rn.Chain(n)},After:(...e)=>{let t=Nt.join(...e),n=()=>Nt.build(`(?<=[${t}])`);return Rn.Chain(n)},BeforeMany:(...e)=>{let t=Nt.join(...e),n=()=>Nt.build(`(?<![${t}])(?=[${t}])`);return Rn.Chain(n)},AfterMany:(...e)=>{let t=Nt.join(...e),n=()=>Nt.build(`(?<=[${t}])(?![${t}])`);return Rn.Chain(n)},NotBefore:(...e)=>{let t=Nt.join(...e),n=()=>Nt.build(`(?![${t}])`);return Rn.Chain(n)},NotAfter:(...e)=>{let t=Nt.join(...e),n=()=>Nt.build(`(?<![${t}])`);return Rn.Chain(n)},Chain:e=>({Build:e,PreceededBy:(...t)=>{let n=e(),r=Rn.After(...t).Build(),i=()=>Nt.and(r,n);return Rn.Chain(i)},FollowedBy:(...t)=>{let n=e(),r=Rn.Before(...t).Build(),i=()=>Nt.and(n,r);return Rn.Chain(i)},NotPrecededBy:(...t)=>{let n=e(),r=Rn.NotAfter(...t).Build(),i=()=>Nt.and(r,n);return Rn.Chain(i)},NotFollowedBy:(...t)=>{let n=e(),r=Rn.NotBefore(...t).Build(),i=()=>Nt.and(n,r);return Rn.Chain(i)}})},sG=e=>{let t=nG();return e.normalize("NFC").split(t).filter(Boolean)},zd=(e,t,n)=>{if(!Number.isFinite(n)||n<0)return e;let r=[],i=e.split(`
53
- `);for(let a of i){if(Sd(a,t)<=n){r.push(a);continue}let s=oG(a,t,n);r.push(...s)}return r.join(`
54
- `)},oG=(e,t,n)=>{let r=[],i=sG(e)[Symbol.iterator](),a="",s=0,o=i.next();for(;!o.done;){let c=o.value,d=a+c,l=dG(c)?s+V1.calculate(c,t):Sd(d,t);if(/\s/.test(c)||l<=n){a=d,s=l,o=i.next();continue}if(a)r.push(a.trimEnd()),a="",s=0;else{let h=lG(c,t,n),f=h[h.length-1]??"",g=h.slice(0,-1);r.push(...g),a=f,s=Sd(f,t),o=i.next()}}if(a){let c=cG(a,t,n);r.push(c)}return r},lG=(e,t,n)=>{if(xv().test(e))return[e];uG(e);let r=[],i=Array.from(e),a="",s=0;for(let o of i){let c=V1.calculate(o,t),d=s+c;if(d<=n){a=a+o,s=d;continue}a&&r.push(a),a=o,s=c}return a&&r.push(a),r},cG=(e,t,n)=>{if(!(Sd(e,t)>n))return e;let[,r,i]=e.match(/^(.+?)(\s+)$/)??[e,e.trimEnd(),""],a=Sd(r,t);for(let s of Array.from(i)){let o=V1.calculate(s,t),c=a+o;if(c>n)break;r=r+s,a=c}return r},dG=e=>e.codePointAt(0)!==void 0&&e.codePointAt(1)===void 0,uG=e=>{if((mt.MODE===fi.TEST||mt.DEV)&&/\s/.test(e))throw new Error("Word should not contain any whitespaces!")},Hr=class{};H(Hr,"rg",new i1),H(Hr,"cache",new WeakMap),H(Hr,"get",e=>Hr.cache.get(e)),H(Hr,"set",(e,t)=>Hr.cache.set(e,t)),H(Hr,"delete",e=>Hr.cache.delete(e)),H(Hr,"destroy",()=>{Hr.cache=new WeakMap}),H(Hr,"generateElementShape",(e,t)=>{let n=t!=null&&t.isExporting?void 0:Hr.get(e);if(n!==void 0)return n;D3.delete(e);let r=bte(e,Hr.rg,t||{isExporting:!1,canvasBackgroundColor:yt.white,embedsValidationStatus:null});return Hr.cache.set(e,r),r});var yn=Hr,Xa=e=>"var(--icon-fill-color)",HI=e=>e===wt.LIGHT?dr.white:"#1e1e1e",ne=(e,t=512)=>{let{width:n=512,height:r=n,mirror:i,style:a,...s}=typeof t=="number"?{width:t}:t;return m.jsx("svg",{"aria-hidden":"true",focusable:"false",role:"img",viewBox:`0 0 ${n} ${r}`,className:Fe({"rtl-mirror":i}),style:a,...s,children:typeof e=="string"?m.jsx("path",{fill:"currentColor",d:e}):e})},Ae={width:24,height:24,fill:"none",strokeWidth:2,stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"},dt={width:20,height:20,fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"};ne(m.jsxs("g",{strokeWidth:"1.5",children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("rect",{x:3,y:8,width:18,height:4,rx:1}),m.jsx("line",{x1:12,y1:8,x2:12,y2:21}),m.jsx("path",{d:"M19 12v7a2 2 0 0 1 -2 2h-10a2 2 0 0 1 -2 -2v-7"}),m.jsx("path",{d:"M7.5 8a2.5 2.5 0 0 1 0 -5a4.8 8 0 0 1 4.5 5a4.8 8 0 0 1 4.5 -5a2.5 2.5 0 0 1 0 5"})]}),Ae);var wv=ne(m.jsxs("g",{strokeWidth:"1.25",children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("path",{d:"M3 19a9 9 0 0 1 9 0a9 9 0 0 1 9 0"}),m.jsx("path",{d:"M3 6a9 9 0 0 1 9 0a9 9 0 0 1 9 0"}),m.jsx("line",{x1:"3",y1:"6",x2:"3",y2:"19"}),m.jsx("line",{x1:"12",y1:"6",x2:"12",y2:"19"}),m.jsx("line",{x1:"21",y1:"6",x2:"21",y2:"19"})]}),Ae),hG=ne(m.jsxs("svg",{strokeWidth:"1.5",children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),m.jsx("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]}),Ae),fG=ne(m.jsxs("g",{strokeWidth:"1.5",children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("circle",{cx:"12",cy:"12",r:"1"}),m.jsx("circle",{cx:"12",cy:"19",r:"1"}),m.jsx("circle",{cx:"12",cy:"5",r:"1"})]}),Ae),pG=ne(m.jsxs("svg",{strokeWidth:"1.5",children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("path",{d:"M9 4v6l-2 4v2h10v-2l-2 -4v-6"}),m.jsx("line",{x1:"12",y1:"16",x2:"12",y2:"21"}),m.jsx("line",{x1:"8",y1:"4",x2:"16",y2:"4"})]}),Ae),CU=ne(m.jsxs("g",{children:[m.jsx("path",{d:"M13.542 8.542H6.458a2.5 2.5 0 0 0-2.5 2.5v3.75a2.5 2.5 0 0 0 2.5 2.5h7.084a2.5 2.5 0 0 0 2.5-2.5v-3.75a2.5 2.5 0 0 0-2.5-2.5Z",stroke:"currentColor",strokeWidth:"1.25"}),m.jsx("path",{d:"M10 13.958a1.042 1.042 0 1 0 0-2.083 1.042 1.042 0 0 0 0 2.083Z",stroke:"currentColor",strokeWidth:"1.25"}),m.jsx("mask",{id:"UnlockedIcon",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:6,y:1,width:9,height:9,children:m.jsx("path",{stroke:"none",d:"M6.399 9.561V5.175c0-.93.401-1.823 1.116-2.48a3.981 3.981 0 0 1 2.693-1.028c1.01 0 1.98.37 2.694 1.027.715.658 1.116 1.55 1.116 2.481",fill:"#fff"})}),m.jsx("g",{mask:"url(#UnlockedIcon)",children:m.jsx("path",{stroke:"none",d:"M5.149 9.561v1.25h2.5v-1.25h-2.5Zm5.06-7.894V.417v1.25Zm2.559 3.508v1.25h2.5v-1.25h-2.5ZM7.648 8.51V5.175h-2.5V8.51h2.5Zm0-3.334c0-.564.243-1.128.713-1.561L6.668 1.775c-.959.883-1.52 2.104-1.52 3.4h2.5Zm.713-1.561a2.732 2.732 0 0 1 1.847-.697v-2.5c-1.31 0-2.585.478-3.54 1.358L8.36 3.614Zm1.847-.697c.71 0 1.374.26 1.847.697l1.694-1.839a5.231 5.231 0 0 0-3.54-1.358v2.5Zm1.847.697c.47.433.713.997.713 1.561h2.5c0-1.296-.56-2.517-1.52-3.4l-1.693 1.839Z",fill:"currentColor"})})]}),dt),Ev=ne(m.jsxs("g",{strokeWidth:"1.25",children:[m.jsx("path",{d:"M13.542 8.542H6.458a2.5 2.5 0 0 0-2.5 2.5v3.75a2.5 2.5 0 0 0 2.5 2.5h7.084a2.5 2.5 0 0 0 2.5-2.5v-3.75a2.5 2.5 0 0 0-2.5-2.5Z"}),m.jsx("path",{d:"M10 13.958a1.042 1.042 0 1 0 0-2.083 1.042 1.042 0 0 0 0 2.083Z"}),m.jsx("path",{d:"M6.667 8.333V5.417C6.667 3.806 8.159 2.5 10 2.5c1.841 0 3.333 1.306 3.333 2.917v2.916"})]}),dt),mG=ne(m.jsxs(m.Fragment,{children:[m.jsx("path",{d:"M38.5 83.5c-14-2-17.833-10.473-21-22.5C14.333 48.984 12 22 12 12.5",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round"}),m.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"m12.005 10.478 7.905 14.423L6 25.75l6.005-15.273Z",fill:"currentColor"}),m.jsx("path",{d:"M12.005 10.478c1.92 3.495 3.838 7 7.905 14.423m-7.905-14.423c3.11 5.683 6.23 11.368 7.905 14.423m0 0c-3.68.226-7.35.455-13.91.85m13.91-.85c-5.279.33-10.566.647-13.91.85m0 0c1.936-4.931 3.882-9.86 6.005-15.273M6 25.75c2.069-5.257 4.135-10.505 6.005-15.272",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round"})]}),{width:41,height:94,fill:"none"}),gG=ne(m.jsxs(m.Fragment,{children:[m.jsx("path",{d:"M18.026 1.232c-5.268 13.125-5.548 33.555 3.285 42.311 8.823 8.75 33.31 12.304 42.422 13.523",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round"}),m.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"m72.181 59.247-13.058-10-2.948 13.62 16.006-3.62Z",fill:"currentColor"}),m.jsx("path",{d:"M72.181 59.247c-3.163-2.429-6.337-4.856-13.058-10m13.058 10c-5.145-3.936-10.292-7.882-13.058-10m0 0c-.78 3.603-1.563 7.196-2.948 13.62m2.948-13.62c-1.126 5.168-2.24 10.346-2.948 13.62m0 0c5.168-1.166 10.334-2.343 16.006-3.62m-16.006 3.62c5.51-1.248 11.01-2.495 16.006-3.62",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round"})]}),{width:85,height:71,fill:"none"}),UG=ne(m.jsxs(m.Fragment,{children:[m.jsx("path",{d:"M1 77c14-2 31.833-11.973 35-24 3.167-12.016-6-35-9.5-43.5",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round"}),m.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"m24.165 1.093-2.132 16.309 13.27-4.258-11.138-12.05Z",fill:"currentColor"}),m.jsx("path",{d:"M24.165 1.093c-.522 3.953-1.037 7.916-2.132 16.309m2.131-16.309c-.835 6.424-1.68 12.854-2.13 16.308m0 0c3.51-1.125 7.013-2.243 13.27-4.257m-13.27 4.257c5.038-1.608 10.08-3.232 13.27-4.257m0 0c-3.595-3.892-7.197-7.777-11.14-12.05m11.14 12.05c-3.837-4.148-7.667-8.287-11.14-12.05",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round"})]}),{width:38,height:78,fill:"none"});ne(m.jsx("g",{fill:"currentColor",children:m.jsx("path",{d:"M39.9 32.889a.326.326 0 0 0-.279-.056c-2.094-3.083-4.774-6-7.343-8.833l-.419-.472a.212.212 0 0 0-.056-.139.586.586 0 0 0-.167-.111l-.084-.083-.056-.056c-.084-.167-.28-.278-.475-.167-.782.39-1.507.973-2.206 1.528-.92.722-1.842 1.445-2.708 2.25a8.405 8.405 0 0 0-.977 1.028c-.14.194-.028.361.14.444-.615.611-1.23 1.223-1.843 1.861a.315.315 0 0 0-.084.223c0 .083.056.166.111.194l1.09.833v.028c1.535 1.528 4.244 3.611 7.12 5.861.418.334.865.667 1.284 1 .195.223.39.473.558.695.084.11.28.139.391.055.056.056.14.111.196.167a.398.398 0 0 0 .167.056.255.255 0 0 0 .224-.111.394.394 0 0 0 .055-.167c.029 0 .028.028.056.028a.318.318 0 0 0 .224-.084l5.082-5.528a.309.309 0 0 0 0-.444Zm-14.63-1.917a.485.485 0 0 0 .111.14c.586.5 1.2 1 1.843 1.555l-2.569-1.945-.251-.166c-.056-.028-.112-.084-.168-.111l-.195-.167.056-.056.055-.055.112-.111c.866-.861 2.346-2.306 3.1-3.028-.81.805-2.43 3.167-2.095 3.944Zm8.767 6.89-2.122-1.612a44.713 44.713 0 0 0-2.625-2.5c1.145.861 2.122 1.611 2.262 1.75 1.117.972 1.06.806 1.815 1.445l.921.666a1.06 1.06 0 0 1-.251.25Zm.558.416-.056-.028c.084-.055.168-.111.252-.194l-.196.222ZM1.089 5.75c.055.361.14.722.195 1.056.335 1.833.67 3.5 1.284 4.75l.252.944c.084.361.223.806.363.917 1.424 1.25 3.602 3.11 5.947 4.889a.295.295 0 0 0 .363 0s0 .027.028.027a.254.254 0 0 0 .196.084.318.318 0 0 0 .223-.084c2.988-3.305 5.221-6.027 6.813-8.305.112-.111.14-.278.14-.417.111-.111.195-.25.307-.333.111-.111.111-.306 0-.39l-.028-.027c0-.055-.028-.139-.084-.167-.698-.666-1.2-1.138-1.731-1.638-.922-.862-1.871-1.75-3.881-3.75l-.028-.028c-.028-.028-.056-.056-.112-.056-.558-.194-1.703-.389-3.127-.639C6.087 2.223 3.21 1.723.614.944c0 0-.168 0-.196.028l-.083.084c-.028.027-.056.055-.224.11h.056-.056c.028.167.028.278.084.473 0 .055.112.5.112.555l.782 3.556Zm15.496 3.278-.335-.334c.084.112.196.195.335.334Zm-3.546 4.666-.056.056c0-.028.028-.056.056-.056Zm-2.038-10c.168.167.866.834 1.033.973-.726-.334-2.54-1.167-3.379-1.445.838.167 1.983.334 2.346.472ZM1.424 2.306c.419.722.754 3.222 1.089 5.666-.196-.778-.335-1.555-.503-2.278-.251-1.277-.503-2.416-.838-3.416.056 0 .14 0 .252.028Zm-.168-.584c-.112 0-.223-.028-.307-.028 0-.027 0-.055-.028-.055.14 0 .223.028.335.083Zm-1.089.222c0-.027 0-.027 0 0ZM39.453 1.333c.028-.11-.558-.61-.363-.639.42-.027.42-.666 0-.666-.558.028-1.144.166-1.675.25-.977.194-1.982.389-2.96.61-2.205.473-4.383.973-6.561 1.557-.67.194-1.424.333-2.066.666-.224.111-.196.333-.084.472-.056.028-.084.028-.14.056-.195.028-.363.056-.558.083-.168.028-.252.167-.224.334 0 .027.028.083.028.11-1.173 1.556-2.485 3.195-3.909 4.945-1.396 1.611-2.876 3.306-4.356 5.056-4.719 5.5-10.052 11.75-15.943 17.25a.268.268 0 0 0 0 .389c.028.027.056.055.084.055-.084.084-.168.14-.252.222-.056.056-.084.111-.084.167a.605.605 0 0 0-.111.139c-.112.111-.112.305.028.389.111.11.307.11.39-.028.029-.028.029-.056.056-.056a.44.44 0 0 1 .615 0c.335.362.67.723.977 1.028l-.698-.583c-.112-.111-.307-.083-.39.028-.113.11-.085.305.027.389l7.427 6.194c.056.056.112.056.196.056s.14-.028.195-.084l.168-.166c.028.027.083.027.111.027.084 0 .14-.027.196-.083 10.052-10.055 18.15-17.639 27.42-24.417.083-.055.111-.166.111-.25.112 0 .196-.083.251-.194 1.704-5.194 2.039-9.806 2.15-12.083v-.028c0-.028.028-.056.028-.083.028-.056.028-.084.028-.084a1.626 1.626 0 0 0-.111-1.028ZM21.472 9.5c.446-.5.893-1.028 1.34-1.5-2.876 3.778-7.65 9.583-14.408 16.5 4.607-5.083 9.242-10.333 13.068-15ZM5.193 35.778h.084-.084Zm3.462 3.194c-.027-.028-.027-.028 0-.028v.028Zm4.16-3.583c.224-.25.448-.472.699-.722 0 0 0 .027.028.027-.252.223-.475.445-.726.695Zm1.146-1.111c.14-.14.279-.334.446-.5l.028-.028c1.648-1.694 3.351-3.389 5.082-5.111l.028-.028c.419-.333.921-.694 1.368-1.028a379.003 379.003 0 0 0-6.952 6.695ZM24.794 6.472c-.921 1.195-1.954 2.778-2.82 4.028-2.736 3.944-11.532 13.583-11.727 13.75a1976.983 1976.983 0 0 1-8.042 7.639l-.167.167c-.14-.167-.14-.417.028-.556C14.49 19.861 22.03 10.167 25.074 5.917c-.084.194-.14.36-.28.555Zm4.83 5.695c-1.116-.64-1.646-1.64-1.34-2.611l.084-.334c.028-.083.084-.194.14-.277.307-.5.754-.917 1.257-1.167.027 0 .055 0 .083-.028-.028-.056-.028-.139-.028-.222.028-.167.14-.278.335-.278.335 0 1.369.306 1.76.639.111.083.223.194.335.305.14.167.363.445.474.667.056.028.112.306.196.445.056.222.111.472.084.694-.028.028 0 .194-.028.194a2.668 2.668 0 0 1-.363 1.028c-.028.028-.028.056-.056.084l-.028.027c-.14.223-.335.417-.53.556-.643.444-1.369.583-2.095.389 0 0-.195-.084-.28-.111Zm8.154-.834a39.098 39.098 0 0 1-.893 3.167c0 .028-.028.083 0 .111-.056 0-.084.028-.14.056-2.206 1.61-4.356 3.305-6.506 5.028 1.843-1.64 3.686-3.306 5.613-4.945.558-.5.949-1.139 1.06-1.861l.28-1.667v-.055c.14-.334.67-.195.586.166Z",fill:"currentColor"})}),{width:40,height:40,fill:"none"});var bG=ne(m.jsxs("g",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("path",{d:"M6 6l4.153 11.793a0.365 .365 0 0 0 .331 .207a0.366 .366 0 0 0 .332 -.207l2.184 -4.793l4.787 -1.994a0.355 .355 0 0 0 .213 -.323a0.355 .355 0 0 0 -.213 -.323l-11.787 -4.36z"}),m.jsx("path",{d:"M13.5 13.5l4.5 4.5"})]}),{fill:"none",width:22,height:22,strokeWidth:1.25}),yG=ne(m.jsxs("g",{strokeWidth:"1.5",children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("rect",{x:"4",y:"4",width:"16",height:"16",rx:"2"})]}),Ae),vG=ne(m.jsxs("g",{strokeWidth:"1.5",children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("path",{d:"M10.5 20.4l-6.9 -6.9c-.781 -.781 -.781 -2.219 0 -3l6.9 -6.9c.781 -.781 2.219 -.781 3 0l6.9 6.9c.781 .781 .781 2.219 0 3l-6.9 6.9c-.781 .781 -2.219 .781 -3 0z"})]}),Ae),xG=ne(m.jsxs("g",{strokeWidth:"1.5",children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("circle",{cx:"12",cy:"12",r:"9"})]}),Ae),wG=ne(m.jsxs("g",{strokeWidth:"1.5",children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("line",{x1:"5",y1:"12",x2:"19",y2:"12"}),m.jsx("line",{x1:"15",y1:"16",x2:"19",y2:"12"}),m.jsx("line",{x1:"15",y1:"8",x2:"19",y2:"12"})]}),Ae),EG=ne(m.jsx("path",{d:"M4.167 10h11.666",strokeWidth:"1.5"}),dt),CG=ne(m.jsxs("g",{strokeWidth:"1.25",children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("path",{d:"M20 17v-12c0 -1.121 -.879 -2 -2 -2s-2 .879 -2 2v12l2 2l2 -2z"}),m.jsx("path",{d:"M16 7h4"}),m.jsx("path",{d:"M18 19h-13a2 2 0 1 1 0 -4h4a2 2 0 1 0 0 -4h-3"})]}),Ae),d1=ne(m.jsxs("g",{strokeWidth:"1.25",children:[m.jsx("path",{clipRule:"evenodd",d:"m7.643 15.69 7.774-7.773a2.357 2.357 0 1 0-3.334-3.334L4.31 12.357a3.333 3.333 0 0 0-.977 2.357v1.953h1.953c.884 0 1.732-.352 2.357-.977Z"}),m.jsx("path",{d:"m11.25 5.417 3.333 3.333"})]}),dt),WI=ne(m.jsxs("g",{strokeWidth:"1.5",children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("line",{x1:"4",y1:"20",x2:"7",y2:"20"}),m.jsx("line",{x1:"14",y1:"20",x2:"21",y2:"20"}),m.jsx("line",{x1:"6.9",y1:"15",x2:"13.8",y2:"15"}),m.jsx("line",{x1:"10.2",y1:"6.3",x2:"16",y2:"20"}),m.jsx("polyline",{points:"5 20 11 4 13 4 20 20"})]}),Ae),SG=ne(m.jsxs("g",{strokeWidth:"1.25",children:[m.jsx("path",{d:"M12.5 6.667h.01"}),m.jsx("path",{d:"M4.91 2.625h10.18a2.284 2.284 0 0 1 2.285 2.284v10.182a2.284 2.284 0 0 1-2.284 2.284H4.909a2.284 2.284 0 0 1-2.284-2.284V4.909a2.284 2.284 0 0 1 2.284-2.284Z"}),m.jsx("path",{d:"m3.333 12.5 3.334-3.333c.773-.745 1.726-.745 2.5 0l4.166 4.166"}),m.jsx("path",{d:"m11.667 11.667.833-.834c.774-.744 1.726-.744 2.5 0l1.667 1.667"})]}),dt),_G=ne(m.jsxs("g",{strokeWidth:"1.5",children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("path",{d:"M19 20h-10.5l-4.21 -4.3a1 1 0 0 1 0 -1.41l10 -10a1 1 0 0 1 1.41 0l5 5a1 1 0 0 1 0 1.41l-9.2 9.3"}),m.jsx("path",{d:"M18 13.3l-6.3 -6.3"})]}),Ae),rC=ne(m.jsx("path",{strokeWidth:"1.25",d:"M10 4.167v11.666M4.167 10h11.666"}),dt),iC=ne(m.jsx("path",{d:"M5 10h10",strokeWidth:"1.25"}),dt),kG=ne(m.jsxs("g",{strokeWidth:1.25,children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("path",{d:"M21 21l-6 -6"}),m.jsx("path",{d:"M3.268 12.043a7.017 7.017 0 0 0 6.634 4.957a7.012 7.012 0 0 0 7.043 -6.131a7 7 0 0 0 -5.314 -7.672a7.021 7.021 0 0 0 -8.241 4.403"}),m.jsx("path",{d:"M3 4v4h4"})]}),Ae),_d=ne(m.jsx("path",{strokeWidth:"1.25",d:"M3.333 5.833h13.334M8.333 9.167v5M11.667 9.167v5M4.167 5.833l.833 10c0 .92.746 1.667 1.667 1.667h6.666c.92 0 1.667-.746 1.667-1.667l.833-10M7.5 5.833v-2.5c0-.46.373-.833.833-.833h3.334c.46 0 .833.373.833.833v2.5"}),dt),TG=ne(m.jsxs("g",{strokeWidth:"1.25",children:[m.jsx("polyline",{points:"12 16 18 10 12 4"}),m.jsx("polyline",{points:"8 4 2 10 8 16"})]}),dt),_3=ne(m.jsxs("g",{strokeWidth:"1.25",children:[m.jsx("path",{d:"M14.375 6.458H8.958a2.5 2.5 0 0 0-2.5 2.5v5.417a2.5 2.5 0 0 0 2.5 2.5h5.417a2.5 2.5 0 0 0 2.5-2.5V8.958a2.5 2.5 0 0 0-2.5-2.5Z"}),m.jsx("path",{clipRule:"evenodd",d:"M11.667 3.125c.517 0 .986.21 1.325.55.34.338.55.807.55 1.325v1.458H8.333c-.485 0-.927.185-1.26.487-.343.312-.57.75-.609 1.24l-.005 5.357H5a1.87 1.87 0 0 1-1.326-.55 1.87 1.87 0 0 1-.549-1.325V5c0-.518.21-.987.55-1.326.338-.34.807-.549 1.325-.549h6.667Z"})]}),dt),k3=ne(m.jsx("path",{clipRule:"evenodd",d:"M10 2.5h.328a6.25 6.25 0 0 0 6.6 10.372A7.5 7.5 0 1 1 10 2.493V2.5Z",stroke:"currentColor"}),dt),T3=ne(m.jsx("g",{stroke:"currentColor",strokeLinejoin:"round",children:m.jsx("path",{d:"M10 12.5a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5ZM10 4.167V2.5M14.167 5.833l1.166-1.166M15.833 10H17.5M14.167 14.167l1.166 1.166M10 15.833V17.5M5.833 14.167l-1.166 1.166M5 10H3.333M5.833 5.833 4.667 4.667"})}),{...dt,strokeWidth:1.5}),XI=ne(m.jsxs("g",{strokeWidth:"1.5",children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("line",{x1:"4",y1:"6",x2:"20",y2:"6"}),m.jsx("line",{x1:"4",y1:"12",x2:"20",y2:"12"}),m.jsx("line",{x1:"4",y1:"18",x2:"20",y2:"18"})]}),Ae),SU=ne(m.jsx("path",{strokeWidth:"1.25",d:"M3.333 14.167v1.666c0 .92.747 1.667 1.667 1.667h10c.92 0 1.667-.746 1.667-1.667v-1.666M5.833 9.167 10 13.333l4.167-4.166M10 3.333v10"}),dt),Cv=ne(m.jsxs("g",{strokeWidth:"1.5",children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("circle",{cx:"12",cy:"12",r:"9"}),m.jsx("line",{x1:"12",y1:"17",x2:"12",y2:"17.01"}),m.jsx("path",{d:"M12 13.5a1.5 1.5 0 0 1 1 -1.5a2.6 2.6 0 1 0 -3 -4"})]}),Ae),MG=ne(m.jsxs("g",{strokeWidth:"1.25",children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("circle",{cx:"12",cy:"12",r:"9"}),m.jsx("line",{x1:"12",y1:"17",x2:"12",y2:"17.01"}),m.jsx("path",{d:"M12 13.5a1.5 1.5 0 0 1 1 -1.5a2.6 2.6 0 1 0 -3 -4"})]}),Ae),aC=ne(m.jsx("path",{strokeWidth:"1.25",d:"M9.167 5.833H5.833c-1.254 0-2.5 1.282-2.5 2.5v5.834c0 1.283 1.252 2.5 2.5 2.5h5.834c1.251 0 2.5-1.25 2.5-2.5v-3.334M8.333 11.667l8.334-8.334M12.5 3.333h4.167V7.5"}),dt),VI=ne(m.jsx("path",{d:"M7.5 15.833c-3.583 1.167-3.583-2.083-5-2.5m10 4.167v-2.917c0-.833.083-1.166-.417-1.666 2.334-.25 4.584-1.167 4.584-5a3.833 3.833 0 0 0-1.084-2.667 3.5 3.5 0 0 0-.083-2.667s-.917-.25-2.917 1.084a10.25 10.25 0 0 0-5.166 0C5.417 2.333 4.5 2.583 4.5 2.583a3.5 3.5 0 0 0-.083 2.667 3.833 3.833 0 0 0-1.084 2.667c0 3.833 2.25 4.75 4.584 5-.5.5-.5 1-.417 1.666V17.5",strokeWidth:"1.25"}),dt),IG=ne(m.jsxs("g",{strokeWidth:"1.25",children:[m.jsx("path",{d:"M7.5 10.833a.833.833 0 1 0 0-1.666.833.833 0 0 0 0 1.666ZM12.5 10.833a.833.833 0 1 0 0-1.666.833.833 0 0 0 0 1.666ZM6.25 6.25c2.917-.833 4.583-.833 7.5 0M5.833 13.75c2.917.833 5.417.833 8.334 0"}),m.jsx("path",{d:"M12.917 14.167c0 .833 1.25 2.5 1.666 2.5 1.25 0 2.361-1.39 2.917-2.5.556-1.39.417-4.861-1.25-9.584-1.214-.846-2.5-1.116-3.75-1.25l-.833 2.084M7.083 14.167c0 .833-1.13 2.5-1.526 2.5-1.191 0-2.249-1.39-2.778-2.5-.529-1.39-.397-4.861 1.19-9.584 1.157-.846 2.318-1.116 3.531-1.25l.833 2.084"})]}),dt),AG=ne(m.jsxs("g",{strokeWidth:"1.25",children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("path",{d:"M4 4l11.733 16h4.267l-11.733 -16z"}),m.jsx("path",{d:"M4 20l6.768 -6.768m2.46 -2.46l6.772 -6.772"})]}),Ae),LG=ne(m.jsx("polyline",{fill:"none",stroke:"currentColor",points:"20 6 9 17 4 12"}),{width:24,height:24}),M3=ne(m.jsxs("g",{strokeWidth:"1.25",children:[m.jsx("path",{d:"M8.333 11.667a2.917 2.917 0 0 0 4.167 0l3.333-3.334a2.946 2.946 0 1 0-4.166-4.166l-.417.416"}),m.jsx("path",{d:"M11.667 8.333a2.917 2.917 0 0 0-4.167 0l-3.333 3.334a2.946 2.946 0 0 0 4.166 4.166l.417-.416"})]}),dt),RG=ne("M433.941 129.941l-83.882-83.882A48 48 0 0 0 316.118 32H48C21.49 32 0 53.49 0 80v352c0 26.51 21.49 48 48 48h352c26.51 0 48-21.49 48-48V163.882a48 48 0 0 0-14.059-33.941zM224 416c-35.346 0-64-28.654-64-64 0-35.346 28.654-64 64-64s64 28.654 64 64c0 35.346-28.654 64-64 64zm96-304.52V212c0 6.627-5.373 12-12 12H76c-6.627 0-12-5.373-12-12V108c0-6.627 5.373-12 12-12h228.52c3.183 0 6.235 1.264 8.485 3.515l3.48 3.48A11.996 11.996 0 0 1 320 111.48z",{width:448,height:512}),DG=ne("M252 54L203 8a28 27 0 00-20-8H28C12 0 0 12 0 27v195c0 15 12 26 28 26h204c15 0 28-11 28-26V73a28 27 0 00-8-19zM130 213c-21 0-37-16-37-36 0-19 16-35 37-35 20 0 37 16 37 35 0 20-17 36-37 36zm56-169v56c0 4-4 6-7 6H44c-4 0-7-2-7-6V42c0-4 3-7 7-7h133l4 2 3 2a7 7 0 012 5z M296 201l87 95-188 205-78 9c-10 1-19-8-18-20l9-84zm141-14l-41-44a31 31 0 00-46 0l-38 41 87 95 38-42c13-14 13-36 0-50z",{width:448,height:512}),Sv=ne(m.jsx("path",{d:"m9.257 6.351.183.183H15.819c.34 0 .727.182 1.051.506.323.323.505.708.505 1.05v5.819c0 .316-.183.7-.52 1.035-.337.338-.723.522-1.037.522H4.182c-.352 0-.74-.181-1.058-.5-.318-.318-.499-.705-.499-1.057V5.182c0-.351.181-.736.5-1.054.32-.321.71-.503 1.057-.503H6.53l2.726 2.726Z",strokeWidth:"1.25"}),dt);ne("M384 112v352c0 26.51-21.49 48-48 48H48c-26.51 0-48-21.49-48-48V112c0-26.51 21.49-48 48-48h80c0-35.29 28.71-64 64-64s64 28.71 64 64h80c26.51 0 48 21.49 48 48zM192 40c-13.255 0-24 10.745-24 24s10.745 24 24 24 24-10.745 24-24-10.745-24-24-24m96 114v-20a6 6 0 0 0-6-6H102a6 6 0 0 0-6 6v20a6 6 0 0 0 6 6h180a6 6 0 0 0 6-6z",{width:384,height:512});var jG=ne("M204.3 5C104.9 24.4 24.8 104.3 5.2 203.4c-37 187 131.7 326.4 258.8 306.7 41.2-6.4 61.4-54.6 42.5-91.7-23.1-45.4 9.9-98.4 60.9-98.4h79.7c35.8 0 64.8-29.6 64.9-65.3C511.5 97.1 368.1-26.9 204.3 5zM96 320c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32zm32-128c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32zm128-64c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32zm128 64c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32z"),Yb=ne(m.jsxs("g",{strokeWidth:1.25,children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("path",{d:"M5 16l1.465 1.638a2 2 0 1 1 -3.015 .099l1.55 -1.737z"}),m.jsx("path",{d:"M13.737 9.737c2.299 -2.3 3.23 -5.095 2.081 -6.245c-1.15 -1.15 -3.945 -.217 -6.244 2.082c-2.3 2.299 -3.231 5.095 -2.082 6.244c1.15 1.15 3.946 .218 6.245 -2.081z"}),m.jsx("path",{d:"M7.492 11.818c.362 .362 .768 .676 1.208 .934l6.895 4.047c1.078 .557 2.255 -.075 3.692 -1.512c1.437 -1.437 2.07 -2.614 1.512 -3.692c-.372 -.718 -1.72 -3.017 -4.047 -6.895a6.015 6.015 0 0 0 -.934 -1.208"})]}),Ae),YI=ne(m.jsxs("g",{strokeWidth:"1.25",children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("path",{d:"M15 8h.01"}),m.jsx("path",{d:"M12 20h-5a3 3 0 0 1 -3 -3v-10a3 3 0 0 1 3 -3h10a3 3 0 0 1 3 3v5"}),m.jsx("path",{d:"M4 15l4 -4c.928 -.893 2.072 -.893 3 0l4 4"}),m.jsx("path",{d:"M14 14l1 -1c.617 -.593 1.328 -.793 2.009 -.598"}),m.jsx("path",{d:"M19 16v6"}),m.jsx("path",{d:"M22 19l-3 3l-3 -3"})]}),Ae),PG=ne("M216 0h80c13.3 0 24 10.7 24 24v168h87.7c17.8 0 26.7 21.5 14.1 34.1L269.7 378.3c-7.5 7.5-19.8 7.5-27.3 0L90.1 226.1c-12.6-12.6-3.7-34.1 14.1-34.1H192V24c0-13.3 10.7-24 24-24zm296 376v112c0 13.3-10.7 24-24 24H24c-13.3 0-24-10.7-24-24V376c0-13.3 10.7-24 24-24h146.7l49 49c20.1 20.1 52.5 20.1 72.6 0l49-49H488c13.3 0 24 10.7 24 24zm-124 88c0-11-9-20-20-20s-20 9-20 20 9 20 20 20 20-9 20-20zm64 0c0-11-9-20-20-20s-20 9-20 20 9 20 20 20 20-9 20-20z",{width:512,height:512});ne("M416 208H272V64c0-17.67-14.33-32-32-32h-32c-17.67 0-32 14.33-32 32v144H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h144v144c0 17.67 14.33 32 32 32h32c17.67 0 32-14.33 32-32V304h144c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z",{width:448,height:512});ne("M416 208H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h384c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z",{width:448,height:512});var NG=ne("M173.898 439.404l-166.4-166.4c-9.997-9.997-9.997-26.206 0-36.204l36.203-36.204c9.997-9.998 26.207-9.998 36.204 0L192 312.69 432.095 72.596c9.997-9.997 26.207-9.997 36.204 0l36.203 36.204c9.997 9.997 9.997 26.206 0 36.204l-294.4 294.401c-9.998 9.997-26.207 9.997-36.204-.001z");ne("M16 132h416c8.837 0 16-7.163 16-16V76c0-8.837-7.163-16-16-16H16C7.163 60 0 67.163 0 76v40c0 8.837 7.163 16 16 16zm0 160h416c8.837 0 16-7.163 16-16v-40c0-8.837-7.163-16-16-16H16c-8.837 0-16 7.163-16 16v40c0 8.837 7.163 16 16 16zm0 160h416c8.837 0 16-7.163 16-16v-40c0-8.837-7.163-16-16-16H16c-8.837 0-16 7.163-16 16v40c0 8.837 7.163 16 16 16z");var sC=ne(m.jsx("path",{d:"M7.5 10.833 4.167 7.5 7.5 4.167M4.167 7.5h9.166a3.333 3.333 0 0 1 0 6.667H12.5",strokeWidth:"1.25"}),dt),oC=ne(m.jsx("path",{d:"M12.5 10.833 15.833 7.5 12.5 4.167M15.833 7.5H6.667a3.333 3.333 0 1 0 0 6.667H7.5",strokeWidth:"1.25"}),dt),OG=ne("M504 256c0 136.997-111.043 248-248 248S8 392.997 8 256C8 119.083 119.043 8 256 8s248 111.083 248 248zM262.655 90c-54.497 0-89.255 22.957-116.549 63.758-3.536 5.286-2.353 12.415 2.715 16.258l34.699 26.31c5.205 3.947 12.621 3.008 16.665-2.122 17.864-22.658 30.113-35.797 57.303-35.797 20.429 0 45.698 13.148 45.698 32.958 0 14.976-12.363 22.667-32.534 33.976C247.128 238.528 216 254.941 216 296v4c0 6.627 5.373 12 12 12h56c6.627 0 12-5.373 12-12v-1.333c0-28.462 83.186-29.647 83.186-106.667 0-58.002-60.165-102-116.531-102zM256 338c-25.365 0-46 20.635-46 46 0 25.364 20.635 46 46 46s46-20.636 46-46c0-25.365-20.635-46-46-46z",{mirror:!0});ne(m.jsx("path",{d:"M5 12.5a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5ZM15 7.5a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5ZM15 17.5a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5ZM7.25 8.917l5.5-2.834M7.25 11.083l5.5 2.834",strokeWidth:"1.5"}),dt);ne("M256 32c14.2 0 27.3 7.5 34.5 19.8l216 368c7.3 12.4 7.3 27.7 .2 40.1S486.3 480 472 480H40c-14.3 0-27.6-7.7-34.7-20.1s-7-27.8 .2-40.1l216-368C228.7 39.5 241.8 32 256 32zm0 128c-13.3 0-24 10.7-24 24V296c0 13.3 10.7 24 24 24s24-10.7 24-24V184c0-13.3-10.7-24-24-24zm32 224a32 32 0 1 0 -64 0 32 32 0 1 0 64 0z");ne("M16 5l-1.42 1.42-1.59-1.59V16h-1.98V4.83L9.42 6.42 8 5l4-4 4 4zm4 5v11c0 1.1-.9 2-2 2H6c-1.11 0-2-.9-2-2V10c0-1.11.89-2 2-2h3v2H6v11h12V10h-3V8h3c1.1 0 2 .89 2 2z",{width:24,height:24});ne(m.jsxs("g",{strokeWidth:1.25,children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("path",{d:"M8 9h-1a2 2 0 0 0 -2 2v8a2 2 0 0 0 2 2h10a2 2 0 0 0 2 -2v-8a2 2 0 0 0 -2 -2h-1"}),m.jsx("path",{d:"M12 14v-11"}),m.jsx("path",{d:"M9 6l3 -3l3 3"})]}),Ae);ne(m.jsxs(m.Fragment,{children:[m.jsx("path",{fill:"currentColor",d:"M40 5.6v6.1l-4.1.7c-8.9 1.4-16.5 6.9-20.6 15C13 32 10.9 43 12.4 43c.4 0 2.4-1.3 4.4-3 5-3.9 12.1-7 18.2-7.7l5-.6v12.8l11.2-11.3L62.5 22 51.2 10.8 40-.5v6.1zm10.2 22.6L44 34.5v-6.8l-6.9.6c-3.9.3-9.8 1.7-13.2 3.1-3.5 1.4-6.5 2.4-6.7 2.2-.9-1 3-7.5 6.4-10.8C28 18.6 34.4 16 40.1 16c3.7 0 3.9-.1 3.9-3.2V9.5l6.2 6.3 6.3 6.2-6.3 6.2z"}),m.jsx("path",{stroke:"currentColor",fill:"currentColor",d:"M0 36v20h48v-6.2c0-6 0-6.1-2-4.3-1.1 1-2 2.9-2 4.2V52H4V34c0-17.3-.1-18-2-18s-2 .7-2 20z"})]}),{width:64,height:64});ne(m.jsx("path",{stroke:"currentColor",strokeWidth:"40",fill:"currentColor",d:"M148 560a318 318 0 0 0 522 110 316 316 0 0 0 0-450 316 316 0 0 0-450 0c-11 11-21 22-30 34v4h47c25 0 46 21 46 46s-21 45-46 45H90c-13 0-25-6-33-14-9-9-14-20-14-33V156c0-25 20-45 45-45s45 20 45 45v32l1 1a401 401 0 0 1 623 509l212 212a42 42 0 0 1-59 59L698 757A401 401 0 0 1 65 570a42 42 0 0 1 83-10z"}),{width:1024});var GI=m.jsxs("g",{strokeWidth:1.5,children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("path",{d:"M12 10l0 10"}),m.jsx("path",{d:"M12 10l4 4"}),m.jsx("path",{d:"M12 10l-4 4"}),m.jsx("path",{d:"M4 4l16 0"})]}),qI=m.jsxs("g",{strokeWidth:1.5,children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("path",{d:"M12 5l0 14"}),m.jsx("path",{d:"M16 9l-4 -4"}),m.jsx("path",{d:"M8 9l4 -4"})]}),lC=ne(qI,Ae),cC=ne(qI,{...Ae,style:{transform:"rotate(180deg)"}}),dC=ne(GI,Ae),uC=ne(GI,{...Ae,style:{transform:"rotate(180deg)"}}),hC=ne(m.jsxs(m.Fragment,{children:[m.jsxs("g",{clipPath:"url(#a)",stroke:"currentColor",strokeWidth:"1.25",children:[m.jsx("path",{d:"M3.333 3.333h13.334",strokeLinecap:"round",strokeLinejoin:"round"}),m.jsx("path",{d:"M13.542 6.458h-.417c-.92 0-1.667.747-1.667 1.667v7.083c0 .92.746 1.667 1.667 1.667h.417c.92 0 1.666-.746 1.666-1.667V8.125c0-.92-.746-1.667-1.666-1.667ZM6.875 6.458h-.417c-.92 0-1.666.747-1.666 1.667v3.75c0 .92.746 1.667 1.666 1.667h.417c.92 0 1.667-.746 1.667-1.667v-3.75c0-.92-.747-1.667-1.667-1.667Z"})]}),m.jsx("defs",{children:m.jsx("clipPath",{id:"a",children:m.jsx("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),dt),fC=ne(m.jsxs(m.Fragment,{children:[m.jsxs("g",{clipPath:"url(#a)",stroke:"currentColor",strokeWidth:"1.25",children:[m.jsx("path",{d:"M3.333 16.667h13.334",strokeLinecap:"round",strokeLinejoin:"round"}),m.jsx("path",{d:"M6.875 3.125h-.417c-.92 0-1.666.746-1.666 1.667v7.083c0 .92.746 1.667 1.666 1.667h.417c.92 0 1.667-.746 1.667-1.667V4.792c0-.92-.747-1.667-1.667-1.667ZM13.542 5.817h-.417c-.92 0-1.667.747-1.667 1.667v4.391c0 .92.746 1.667 1.667 1.667h.417c.92 0 1.666-.746 1.666-1.667V7.484c0-.92-.746-1.667-1.666-1.667Z"})]}),m.jsx("defs",{children:m.jsx("clipPath",{id:"a",children:m.jsx("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),dt),pC=ne(m.jsxs(m.Fragment,{children:[m.jsxs("g",{clipPath:"url(#a)",stroke:"currentColor",strokeWidth:"1.25",children:[m.jsx("path",{d:"M3.333 3.333v13.334",strokeLinecap:"round",strokeLinejoin:"round"}),m.jsx("path",{d:"M15.208 4.792H8.125c-.92 0-1.667.746-1.667 1.666v.417c0 .92.747 1.667 1.667 1.667h7.083c.92 0 1.667-.747 1.667-1.667v-.417c0-.92-.746-1.666-1.667-1.666ZM12.516 11.458H8.125c-.92 0-1.667.746-1.667 1.667v.417c0 .92.747 1.666 1.667 1.666h4.391c.92 0 1.667-.746 1.667-1.666v-.417c0-.92-.746-1.667-1.667-1.667Z"})]}),m.jsx("defs",{children:m.jsx("clipPath",{id:"a",children:m.jsx("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),dt),mC=ne(m.jsxs(m.Fragment,{children:[m.jsxs("g",{clipPath:"url(#a)",stroke:"currentColor",strokeWidth:"1.25",children:[m.jsx("path",{d:"M16.667 3.333v13.334",strokeLinecap:"round",strokeLinejoin:"round"}),m.jsx("path",{d:"M11.875 4.792H4.792c-.92 0-1.667.746-1.667 1.666v.417c0 .92.746 1.667 1.667 1.667h7.083c.92 0 1.667-.747 1.667-1.667v-.417c0-.92-.746-1.666-1.667-1.666ZM11.683 11.458H7.292c-.92 0-1.667.746-1.667 1.667v.417c0 .92.746 1.666 1.667 1.666h4.39c.921 0 1.667-.746 1.667-1.666v-.417c0-.92-.746-1.667-1.666-1.667Z"})]}),m.jsx("defs",{children:m.jsx("clipPath",{id:"a",children:m.jsx("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),dt),FG=ne(m.jsxs(m.Fragment,{children:[m.jsxs("g",{clipPath:"url(#a)",stroke:"currentColor",strokeWidth:"1.25",children:[m.jsx("path",{d:"M16.667 3.333v13.334M3.333 3.333v13.334",strokeLinecap:"round",strokeLinejoin:"round"}),m.jsx("path",{d:"M14.375 10.208v-.416c0-.92-.746-1.667-1.667-1.667H7.292c-.92 0-1.667.746-1.667 1.667v.416c0 .92.746 1.667 1.667 1.667h5.416c.92 0 1.667-.746 1.667-1.667Z"})]}),m.jsx("defs",{children:m.jsx("clipPath",{id:"a",children:m.jsx("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),dt),$G=ne(m.jsxs(m.Fragment,{children:[m.jsxs("g",{clipPath:"url(#a)",stroke:"currentColor",strokeWidth:"1.25",children:[m.jsx("path",{d:"M3.333 3.333h13.334M3.333 16.667h13.334",strokeLinecap:"round",strokeLinejoin:"round"}),m.jsx("path",{d:"M10.208 5.625h-.416c-.92 0-1.667.746-1.667 1.667v5.416c0 .92.746 1.667 1.667 1.667h.416c.92 0 1.667-.746 1.667-1.667V7.292c0-.92-.746-1.667-1.667-1.667Z"})]}),m.jsx("defs",{children:m.jsx("clipPath",{id:"a",children:m.jsx("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),dt),gC=ne(m.jsxs("g",{stroke:"currentColor",strokeWidth:"1.25",children:[m.jsx("path",{d:"M1.667 10h2.916",strokeLinecap:"round",strokeLinejoin:"round"}),m.jsx("path",{d:"M8.333 10h3.334",strokeLinejoin:"round"}),m.jsx("path",{d:"M15.417 10h2.916",strokeLinecap:"round",strokeLinejoin:"round"}),m.jsx("path",{d:"M6.875 4.792h-.417c-.92 0-1.666.746-1.666 1.666v7.084c0 .92.746 1.666 1.666 1.666h.417c.92 0 1.667-.746 1.667-1.666V6.458c0-.92-.747-1.666-1.667-1.666ZM13.542 6.458h-.417c-.92 0-1.667.747-1.667 1.667v3.75c0 .92.746 1.667 1.667 1.667h.417c.92 0 1.666-.746 1.666-1.667v-3.75c0-.92-.746-1.667-1.666-1.667Z"})]}),dt),UC=ne(m.jsxs("g",{stroke:"currentColor",strokeWidth:"1.25",children:[m.jsx("path",{d:"M10 18.333v-2.916",strokeLinecap:"round",strokeLinejoin:"round"}),m.jsx("path",{d:"M10 11.667V8.333",strokeLinejoin:"round"}),m.jsx("path",{d:"M10 4.583V1.667",strokeLinecap:"round",strokeLinejoin:"round"}),m.jsx("path",{d:"M4.792 13.125v.417c0 .92.746 1.666 1.666 1.666h7.084c.92 0 1.666-.746 1.666-1.666v-.417c0-.92-.746-1.667-1.666-1.667H6.458c-.92 0-1.666.746-1.666 1.667ZM6.458 6.458v.417c0 .92.747 1.667 1.667 1.667h3.75c.92 0 1.667-.747 1.667-1.667v-.417c0-.92-.746-1.666-1.667-1.666h-3.75c-.92 0-1.667.746-1.667 1.666Z"})]}),dt),ZI=ne(m.jsxs("g",{strokeWidth:"1.5",children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("circle",{cx:"9",cy:"7",r:"4"}),m.jsx("path",{d:"M3 21v-2a4 4 0 0 1 4 -4h4a4 4 0 0 1 4 4v2"}),m.jsx("path",{d:"M16 3.13a4 4 0 0 1 0 7.75"}),m.jsx("path",{d:"M21 21v-2a4 4 0 0 0 -3 -3.85"})]}),Ae);ne("M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm115.7 272l-176 101c-15.8 8.8-35.7-2.5-35.7-21V152c0-18.4 19.8-29.8 35.7-21l176 107c16.4 9.2 16.4 32.9 0 42z");ne("M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm96 328c0 8.8-7.2 16-16 16H176c-8.8 0-16-7.2-16-16V176c0-8.8 7.2-16 16-16h160c8.8 0 16 7.2 16 16v160z");var Bh=ne(m.jsxs(m.Fragment,{children:[m.jsx("g",{clipPath:"url(#a)",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round",children:m.jsx("path",{d:"M15 5 5 15M5 5l10 10"})}),m.jsx("defs",{children:m.jsx("clipPath",{id:"a",children:m.jsx("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),dt);ne("M464 0c26.51 0 48 21.49 48 48v288c0 26.51-21.49 48-48 48H176c-26.51 0-48-21.49-48-48V48c0-26.51 21.49-48 48-48h288M176 416c-44.112 0-80-35.888-80-80V128H48c-26.51 0-48 21.49-48 48v288c0 26.51 21.49 48 48 48h288c26.51 0 48-21.49 48-48v-48H176z",{mirror:!0});ne("M11.553 22.894a.998.998 0 00.894 0s3.037-1.516 5.465-4.097C19.616 16.987 21 14.663 21 12V5a1 1 0 00-.649-.936l-8-3a.998.998 0 00-.702 0l-8 3A1 1 0 003 5v7c0 2.663 1.384 4.987 3.088 6.797 2.428 2.581 5.465 4.097 5.465 4.097zm-1.303-8.481l6.644-6.644a.856.856 0 111.212 1.212l-7.25 7.25a.856.856 0 01-1.212 0l-3.75-3.75a.856.856 0 111.212-1.212l3.144 3.144z",{width:24});ne("M369.9 97.9L286 14C277 5 264.8-.1 252.1-.1H48C21.5 0 0 21.5 0 48v416c0 26.5 21.5 48 48 48h288c26.5 0 48-21.5 48-48V131.9c0-12.7-5.1-25-14.1-34zM332.1 128H256V51.9l76.1 76.1zM48 464V48h160v104c0 13.3 10.7 24 24 24h104v288H48zm32-48h224V288l-23.5-23.5c-4.7-4.7-12.3-4.7-17 0L176 352l-39.5-39.5c-4.7-4.7-12.3-4.7-17 0L80 352v64zm48-240c-26.5 0-48 21.5-48 48s21.5 48 48 48 48-21.5 48-48-21.5-48-48-48z",{width:384,height:512});var bC=ke.memo(({theme:e})=>ne(m.jsxs(m.Fragment,{children:[m.jsx("path",{d:"M25 26H111V111H25",fill:Xa()}),m.jsx("path",{d:"M25 111C25 80.2068 25 49.4135 25 26M25 26C48.6174 26 72.2348 26 111 26H25ZM25 26C53.3671 26 81.7343 26 111 26H25ZM111 26C111 52.303 111 78.606 111 111V26ZM111 26C111 51.2947 111 76.5893 111 111V26ZM111 111C87.0792 111 63.1585 111 25 111H111ZM111 111C87.4646 111 63.9293 111 25 111H111ZM25 111C25 81.1514 25 51.3028 25 26V111Z",stroke:Xa(),strokeWidth:"2"}),m.jsx("path",{d:"M100 100H160V160H100",fill:Xa()}),m.jsx("path",{d:"M100 160C100 144.106 100 128.211 100 100M100 100C117.706 100 135.412 100 160 100H100ZM100 100C114.214 100 128.428 100 160 100H100ZM160 100C160 120.184 160 140.369 160 160V100ZM160 100C160 113.219 160 126.437 160 160V100ZM160 160C145.534 160 131.068 160 100 160H160ZM160 160C143.467 160 126.934 160 100 160H160ZM100 160C100 143.661 100 127.321 100 100V160Z",stroke:Xa(),strokeWidth:"2"}),m.jsxs("g",{fill:HI(e),stroke:Xa(),strokeWidth:"6",children:[m.jsx("rect",{x:"2.5",y:"2.5",width:"30",height:"30"}),m.jsx("rect",{x:"2.5",y:"149.5",width:"30",height:"30"}),m.jsx("rect",{x:"147.5",y:"149.5",width:"30",height:"30"}),m.jsx("rect",{x:"147.5",y:"2.5",width:"30",height:"30"})]})]}),{width:182,height:182,mirror:!0})),yC=ke.memo(({theme:e})=>ne(m.jsxs(m.Fragment,{children:[m.jsx("path",{d:"M25 26H111V111H25",fill:Xa()}),m.jsx("path",{d:"M25 111C25 80.2068 25 49.4135 25 26M25 26C48.6174 26 72.2348 26 111 26H25ZM25 26C53.3671 26 81.7343 26 111 26H25ZM111 26C111 52.303 111 78.606 111 111V26ZM111 26C111 51.2947 111 76.5893 111 111V26ZM111 111C87.0792 111 63.1585 111 25 111H111ZM111 111C87.4646 111 63.9293 111 25 111H111ZM25 111C25 81.1514 25 51.3028 25 26V111Z",stroke:Xa(),strokeWidth:"2"}),m.jsx("path",{d:"M100 100H160V160H100",fill:Xa()}),m.jsx("path",{d:"M100 160C100 144.106 100 128.211 100 100M100 100C117.706 100 135.412 100 160 100H100ZM100 100C114.214 100 128.428 100 160 100H100ZM160 100C160 120.184 160 140.369 160 160V100ZM160 100C160 113.219 160 126.437 160 160V100ZM160 160C145.534 160 131.068 160 100 160H160ZM160 160C143.467 160 126.934 160 100 160H160ZM100 160C100 143.661 100 127.321 100 100V160Z",stroke:Xa(),strokeWidth:"2"}),m.jsxs("g",{fill:HI(e),stroke:Xa(),strokeWidth:"6",children:[m.jsx("rect",{x:"2.5",y:"2.5",width:"30",height:"30"}),m.jsx("rect",{x:"78.5",y:"149.5",width:"30",height:"30"}),m.jsx("rect",{x:"147.5",y:"149.5",width:"30",height:"30"}),m.jsx("rect",{x:"147.5",y:"78.5",width:"30",height:"30"}),m.jsx("rect",{x:"105.5",y:"2.5",width:"30",height:"30"}),m.jsx("rect",{x:"2.5",y:"102.5",width:"30",height:"30"})]})]}),{width:182,height:182,mirror:!0})),BG=ne(m.jsx("g",{strokeWidth:1.25,children:m.jsx("path",{d:"M5.879 2.625h8.242a3.27 3.27 0 0 1 3.254 3.254v8.242a3.27 3.27 0 0 1-3.254 3.254H5.88a3.27 3.27 0 0 1-3.254-3.254V5.88A3.27 3.27 0 0 1 5.88 2.626l-.001-.001ZM4.518 16.118l7.608-12.83m.198 13.934 5.051-9.897M2.778 9.675l9.348-6.387m-7.608 12.83 12.857-8.793"})}),dt),zG=ne(m.jsxs(m.Fragment,{children:[m.jsx("path",{d:"M5.879 2.625h8.242a3.254 3.254 0 0 1 3.254 3.254v8.242a3.254 3.254 0 0 1-3.254 3.254H5.88a3.254 3.254 0 0 1-3.254-3.254V5.88a3.254 3.254 0 0 1 3.254-3.254Z",stroke:"currentColor",strokeWidth:"1.25"}),m.jsx("mask",{id:"FillHachureIcon",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:2,y:2,width:16,height:16,children:m.jsx("path",{d:"M5.879 2.625h8.242a3.254 3.254 0 0 1 3.254 3.254v8.242a3.254 3.254 0 0 1-3.254 3.254H5.88a3.254 3.254 0 0 1-3.254-3.254V5.88a3.254 3.254 0 0 1 3.254-3.254Z",fill:"currentColor",stroke:"currentColor",strokeWidth:"1.25"})}),m.jsx("g",{mask:"url(#FillHachureIcon)",children:m.jsx("path",{d:"M2.258 15.156 15.156 2.258M7.324 20.222 20.222 7.325m-20.444 5.35L12.675-.222m-8.157 18.34L17.416 5.22",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})})]}),dt),HG=ne(m.jsxs(m.Fragment,{children:[m.jsxs("g",{clipPath:"url(#a)",children:[m.jsx("path",{d:"M5.879 2.625h8.242a3.254 3.254 0 0 1 3.254 3.254v8.242a3.254 3.254 0 0 1-3.254 3.254H5.88a3.254 3.254 0 0 1-3.254-3.254V5.88a3.254 3.254 0 0 1 3.254-3.254Z",stroke:"currentColor",strokeWidth:"1.25"}),m.jsx("mask",{id:"FillCrossHatchIcon",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:-1,y:-1,width:22,height:22,children:m.jsx("path",{d:"M2.426 15.044 15.044 2.426M7.383 20 20 7.383M0 12.617 12.617 0m-7.98 17.941L17.256 5.324m-2.211 12.25L2.426 4.956M20 12.617 7.383 0m5.234 20L0 7.383m17.941 7.98L5.324 2.745",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})}),m.jsx("g",{mask:"url(#FillCrossHatchIcon)",children:m.jsx("path",{d:"M14.121 2H5.88A3.879 3.879 0 0 0 2 5.879v8.242A3.879 3.879 0 0 0 5.879 18h8.242A3.879 3.879 0 0 0 18 14.121V5.88A3.879 3.879 0 0 0 14.121 2Z",fill:"currentColor"})})]}),m.jsx("defs",{children:m.jsx("clipPath",{id:"a",children:m.jsx("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),dt),WG=ne(m.jsxs(m.Fragment,{children:[m.jsx("g",{clipPath:"url(#a)",children:m.jsx("path",{d:"M4.91 2.625h10.18a2.284 2.284 0 0 1 2.285 2.284v10.182a2.284 2.284 0 0 1-2.284 2.284H4.909a2.284 2.284 0 0 1-2.284-2.284V4.909a2.284 2.284 0 0 1 2.284-2.284Z",stroke:"currentColor",strokeWidth:"1.25"})}),m.jsx("defs",{children:m.jsx("clipPath",{id:"a",children:m.jsx("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),{...dt,fill:"currentColor"}),KI=ne(m.jsx(m.Fragment,{children:m.jsx("path",{d:"M4.167 10h11.666",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})}),dt),XG=ne(m.jsx("path",{d:"M5 10h10",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round"}),dt),VG=ne(m.jsx("path",{d:"M5 10h10",stroke:"currentColor",strokeWidth:"3.75",strokeLinecap:"round",strokeLinejoin:"round"}),dt);ke.memo(({theme:e})=>ne(m.jsx("path",{d:"M6 10H34",stroke:Xa(),strokeWidth:2,fill:"none",strokeLinecap:"round"}),{width:40,height:20}));var YG=ne(m.jsxs("g",{strokeWidth:"2",children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("path",{d:"M5 12h2"}),m.jsx("path",{d:"M17 12h2"}),m.jsx("path",{d:"M11 12h2"})]}),Ae),GG=ne(m.jsxs("g",{strokeWidth:"2",children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("path",{d:"M4 12v.01"}),m.jsx("path",{d:"M8 12v.01"}),m.jsx("path",{d:"M12 12v.01"}),m.jsx("path",{d:"M16 12v.01"}),m.jsx("path",{d:"M20 12v.01"})]}),Ae),qG=ne(m.jsx("path",{d:"M2.5 12.038c1.655-.885 5.9-3.292 8.568-4.354 2.668-1.063.101 2.821 1.32 3.104 1.218.283 5.112-1.814 5.112-1.814",strokeWidth:"1.25"}),dt),ZG=ne(m.jsx("path",{d:"M2.5 12.563c1.655-.886 5.9-3.293 8.568-4.355 2.668-1.062.101 2.822 1.32 3.105 1.218.283 5.112-1.814 5.112-1.814m-13.469 2.23c2.963-1.586 6.13-5.62 7.468-4.998 1.338.623-1.153 4.11-.132 5.595 1.02 1.487 6.133-1.43 6.133-1.43",strokeWidth:"1.25"}),dt),KG=ne(m.jsx("path",{d:"M2.5 11.936c1.737-.879 8.627-5.346 10.42-5.268 1.795.078-.418 5.138.345 5.736.763.598 3.53-1.789 4.235-2.147M2.929 9.788c1.164-.519 5.47-3.28 6.987-3.114 1.519.165 1 3.827 2.121 4.109 1.122.281 3.839-2.016 4.606-2.42",strokeWidth:"1.25"}),dt),QG=ne(m.jsxs("svg",{strokeWidth:"1.5",children:[m.jsx("path",{d:"M3.33334 9.99998V6.66665C3.33334 6.04326 3.33403 4.9332 3.33539 3.33646C4.95233 3.33436 6.06276 3.33331 6.66668 3.33331H10"}),m.jsx("path",{d:"M13.3333 3.33331V3.34331"}),m.jsx("path",{d:"M16.6667 3.33331V3.34331"}),m.jsx("path",{d:"M16.6667 6.66669V6.67669"}),m.jsx("path",{d:"M16.6667 10V10.01"}),m.jsx("path",{d:"M3.33334 13.3333V13.3433"}),m.jsx("path",{d:"M16.6667 13.3333V13.3433"}),m.jsx("path",{d:"M3.33334 16.6667V16.6767"}),m.jsx("path",{d:"M6.66666 16.6667V16.6767"}),m.jsx("path",{d:"M10 16.6667V16.6767"}),m.jsx("path",{d:"M13.3333 16.6667V16.6767"}),m.jsx("path",{d:"M16.6667 16.6667V16.6767"})]}),dt),JG=ne(m.jsxs("g",{strokeWidth:"1.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("path",{d:"M4 12v-4a4 4 0 0 1 4 -4h4"}),m.jsx("line",{x1:"16",y1:"4",x2:"16",y2:"4.01"}),m.jsx("line",{x1:"20",y1:"4",x2:"20",y2:"4.01"}),m.jsx("line",{x1:"20",y1:"8",x2:"20",y2:"8.01"}),m.jsx("line",{x1:"20",y1:"12",x2:"20",y2:"12.01"}),m.jsx("line",{x1:"4",y1:"16",x2:"4",y2:"16.01"}),m.jsx("line",{x1:"20",y1:"16",x2:"20",y2:"16.01"}),m.jsx("line",{x1:"4",y1:"20",x2:"4",y2:"20.01"}),m.jsx("line",{x1:"8",y1:"20",x2:"8",y2:"20.01"}),m.jsx("line",{x1:"12",y1:"20",x2:"12",y2:"20.01"}),m.jsx("line",{x1:"16",y1:"20",x2:"16",y2:"20.01"}),m.jsx("line",{x1:"20",y1:"20",x2:"20",y2:"20.01"})]}),Ae),eq=ne(m.jsxs("g",{stroke:"currentColor",opacity:.3,strokeWidth:2,children:[m.jsx("path",{d:"M12 12l9 0"}),m.jsx("path",{d:"M3 9l6 6"}),m.jsx("path",{d:"M3 15l6 -6"})]}),Ae),tq=ke.memo(({flip:e=!1})=>ne(m.jsxs("g",{transform:e?"translate(40, 0) scale(-1, 1)":"",stroke:"currentColor",strokeWidth:2,fill:"none",children:[m.jsx("path",{d:"M34 10H6M34 10L27 5M34 10L27 15"}),m.jsx("path",{d:"M27.5 5L34.5 10L27.5 15"})]}),{width:40,height:20})),nq=ke.memo(({flip:e=!1})=>ne(m.jsxs("g",{stroke:"currentColor",fill:"currentColor",transform:e?"translate(40, 0) scale(-1, 1)":"",children:[m.jsx("path",{d:"M32 10L6 10",strokeWidth:2}),m.jsx("circle",{r:"4",transform:"matrix(-1 0 0 1 30 10)"})]}),{width:40,height:20})),rq=ke.memo(({flip:e=!1})=>ne(m.jsxs("g",{stroke:"currentColor",fill:"none",transform:e?"translate(40, 0) scale(-1, 1)":"",strokeWidth:2,children:[m.jsx("path",{d:"M26 10L6 10"}),m.jsx("circle",{r:"4",transform:"matrix(-1 0 0 1 30 10)"})]}),{width:40,height:20})),iq=ke.memo(({flip:e=!1})=>ne(m.jsx("g",{transform:e?"translate(40, 0) scale(-1, 1)":"",children:m.jsx("path",{d:"M34 10H5.99996M34 10L34 5M34 10L34 15",stroke:"currentColor",strokeWidth:2,fill:"none"})}),{width:40,height:20})),aq=ke.memo(({flip:e=!1})=>ne(m.jsxs("g",{stroke:"currentColor",fill:"currentColor",transform:e?"translate(40, 0) scale(-1, 1)":"",children:[m.jsx("path",{d:"M32 10L6 10",strokeWidth:2}),m.jsx("path",{d:"M27.5 5.5L34.5 10L27.5 14.5L27.5 5.5"})]}),{width:40,height:20})),sq=ke.memo(({flip:e=!1})=>ne(m.jsxs("g",{stroke:"currentColor",fill:"none",transform:e?"translate(40, 0) scale(-1, 1)":"",strokeWidth:2,strokeLinejoin:"round",children:[m.jsx("path",{d:"M6,9.5H27"}),m.jsx("path",{d:"M27,5L34,10L27,14Z",fill:"none"})]}),{width:40,height:20})),oq=ke.memo(({flip:e=!1})=>ne(m.jsxs("g",{stroke:"currentColor",fill:"currentColor",transform:e?"translate(40, 0) scale(-1, 1)":"",strokeLinejoin:"round",strokeWidth:2,children:[m.jsx("path",{d:"M6,9.5H20"}),m.jsx("path",{d:"M27,5L34,10L27,14L20,9.5Z"})]}),{width:40,height:20})),lq=ke.memo(({flip:e=!1})=>ne(m.jsxs("g",{stroke:"currentColor",fill:"none",transform:e?"translate(40, 0) scale(-1, 1)":"",strokeLinejoin:"round",strokeWidth:2,children:[m.jsx("path",{d:"M6,9.5H20"}),m.jsx("path",{d:"M27,5L34,10L27,14L20,9.5Z"})]}),{width:40,height:20})),cq=ke.memo(({flip:e=!1})=>ne(m.jsx("g",{stroke:"currentColor",fill:"none",transform:e?"":"translate(40, 0) scale(-1, 1)",strokeLinejoin:"round",strokeWidth:2,children:m.jsx("path",{d:"M34,10 H6 M15,10 L7,5 M15,10 L7,15"})}),{width:40,height:20})),dq=ke.memo(({flip:e=!1})=>ne(m.jsx("g",{stroke:"currentColor",fill:"none",transform:e?"":"translate(40, 0) scale(-1, 1)",strokeLinejoin:"round",strokeWidth:2,children:m.jsx("path",{d:"M34,10 H6 M15,10 L15,15 L15,5"})}),{width:40,height:20})),uq=ke.memo(({flip:e=!1})=>ne(m.jsx("g",{stroke:"currentColor",fill:"none",transform:e?"":"translate(40, 0) scale(-1, 1)",strokeLinejoin:"round",strokeWidth:2,children:m.jsx("path",{d:"M34,10 H6 M15,10 L15,16 L15,4 M15,10 L7,5 M15,10 L7,15"})}),{width:40,height:20})),hq=ne(m.jsxs(m.Fragment,{children:[m.jsx("g",{clipPath:"url(#a)",children:m.jsx("path",{d:"M14.167 6.667a3.333 3.333 0 0 0-3.334-3.334H9.167a3.333 3.333 0 0 0 0 6.667h1.666a3.333 3.333 0 0 1 0 6.667H9.167a3.333 3.333 0 0 1-3.334-3.334",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})}),m.jsx("defs",{children:m.jsx("clipPath",{id:"a",children:m.jsx("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),dt),fq=ne(m.jsxs(m.Fragment,{children:[m.jsx("g",{clipPath:"url(#a)",children:m.jsx("path",{d:"M5 16.667V3.333L10 15l5-11.667v13.334",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})}),m.jsx("defs",{children:m.jsx("clipPath",{id:"a",children:m.jsx("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),dt),pq=ne(m.jsxs(m.Fragment,{children:[m.jsx("g",{clipPath:"url(#a)",children:m.jsx("path",{d:"M5.833 3.333v13.334h8.334",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})}),m.jsx("defs",{children:m.jsx("clipPath",{id:"a",children:m.jsx("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),dt),mq=ne(m.jsx(m.Fragment,{children:m.jsx("path",{d:"m1.667 3.333 6.666 13.334M8.333 3.333 1.667 16.667M11.667 3.333v13.334h6.666",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})}),dt),_U=ne(m.jsxs("g",{strokeWidth:1.25,children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("path",{d:"M3 7v-2h13v2"}),m.jsx("path",{d:"M10 5v14"}),m.jsx("path",{d:"M12 19h-4"}),m.jsx("path",{d:"M15 13v-1h6v1"}),m.jsx("path",{d:"M18 12v7"}),m.jsx("path",{d:"M17 19h2"})]}),Ae),gq=ne(m.jsx(m.Fragment,{children:m.jsxs("g",{stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round",children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("path",{d:"M7 12h10"}),m.jsx("path",{d:"M7 5v14"}),m.jsx("path",{d:"M17 5v14"}),m.jsx("path",{d:"M15 19h4"}),m.jsx("path",{d:"M15 5h4"}),m.jsx("path",{d:"M5 19h4"}),m.jsx("path",{d:"M5 5h4"})]})}),Ae),u2=ne(m.jsx(m.Fragment,{children:m.jsx("g",{stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round",children:m.jsx("path",{d:"M5.833 16.667v-10a3.333 3.333 0 0 1 3.334-3.334h1.666a3.333 3.333 0 0 1 3.334 3.334v10M5.833 10.833h8.334"})})}),dt),I3=ne(m.jsxs(m.Fragment,{children:[m.jsx("g",{clipPath:"url(#a)",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round",children:m.jsx("path",{d:"M5.833 6.667 2.5 10l3.333 3.333M14.167 6.667 17.5 10l-3.333 3.333M11.667 3.333 8.333 16.667"})}),m.jsx("defs",{children:m.jsx("clipPath",{id:"a",children:m.jsx("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),dt),Uq=ne(m.jsxs("g",{stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("line",{x1:"4",y1:"8",x2:"20",y2:"8"}),m.jsx("line",{x1:"4",y1:"12",x2:"12",y2:"12"}),m.jsx("line",{x1:"4",y1:"16",x2:"16",y2:"16"})]}),Ae),bq=ne(m.jsxs("g",{stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("line",{x1:"4",y1:"8",x2:"20",y2:"8"}),m.jsx("line",{x1:"8",y1:"12",x2:"16",y2:"12"}),m.jsx("line",{x1:"6",y1:"16",x2:"18",y2:"16"})]}),Ae),yq=ne(m.jsxs("g",{stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("line",{x1:"4",y1:"8",x2:"20",y2:"8"}),m.jsx("line",{x1:"10",y1:"12",x2:"20",y2:"12"}),m.jsx("line",{x1:"8",y1:"16",x2:"20",y2:"16"})]}),Ae),vq=ke.memo(({theme:e})=>ne(m.jsxs("g",{strokeWidth:"1.5",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("line",{x1:"4",y1:"4",x2:"20",y2:"4"}),m.jsx("rect",{x:"9",y:"8",width:"6",height:"12",rx:"2"})]}),Ae)),xq=ke.memo(({theme:e})=>ne(m.jsxs("g",{strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("line",{x1:"4",y1:"20",x2:"20",y2:"20"}),m.jsx("rect",{x:"9",y:"4",width:"6",height:"12",rx:"2"})]}),Ae)),wq=ke.memo(({theme:e})=>ne(m.jsxs("g",{strokeWidth:"1.5",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("line",{x1:"4",y1:"12",x2:"9",y2:"12"}),m.jsx("line",{x1:"15",y1:"12",x2:"20",y2:"12"}),m.jsx("rect",{x:"9",y:"6",width:"6",height:"12",rx:"2"})]}),Ae)),QI=ne(m.jsxs("g",{children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("path",{d:"M21 19h-18l9 -15"}),m.jsx("path",{d:"M20.615 15.171h.015"}),m.jsx("path",{d:"M19.515 11.771h.015"}),m.jsx("path",{d:"M17.715 8.671h.015"}),m.jsx("path",{d:"M15.415 5.971h.015"})]}),Ae),Eq=ne(m.jsx("path",{d:"M537.6 226.6c4.1-10.7 6.4-22.4 6.4-34.6 0-53-43-96-96-96-19.7 0-38.1 6-53.3 16.2C367 64.2 315.3 32 256 32c-88.4 0-160 71.6-160 160 0 2.7.1 5.4.2 8.1C40.2 219.8 0 273.2 0 336c0 79.5 64.5 144 144 144h368c70.7 0 128-57.3 128-128 0-61.9-44-113.6-102.4-125.4zM393.4 288H328v112c0 8.8-7.2 16-16 16h-48c-8.8 0-16-7.2-16-16V288h-65.4c-14.3 0-21.4-17.2-11.3-27.3l105.4-105.4c6.2-6.2 16.4-6.2 22.6 0l105.4 105.4c10.1 10.1 2.9 27.3-11.3 27.3z",fill:"currentColor"}),{width:640,height:512});ne(m.jsx("path",{d:"M480 416C497.7 416 512 430.3 512 448C512 465.7 497.7 480 480 480H150.6C133.7 480 117.4 473.3 105.4 461.3L25.37 381.3C.3786 356.3 .3786 315.7 25.37 290.7L258.7 57.37C283.7 32.38 324.3 32.38 349.3 57.37L486.6 194.7C511.6 219.7 511.6 260.3 486.6 285.3L355.9 416H480zM265.4 416L332.7 348.7L195.3 211.3L70.63 336L150.6 416L265.4 416z"}));var JI=ne(m.jsxs("g",{strokeWidth:1.25,children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("path",{d:"M8 13v-7.5a1.5 1.5 0 0 1 3 0v6.5"}),m.jsx("path",{d:"M11 5.5v-2a1.5 1.5 0 1 1 3 0v8.5"}),m.jsx("path",{d:"M14 5.5a1.5 1.5 0 0 1 3 0v6.5"}),m.jsx("path",{d:"M17 7.5a1.5 1.5 0 0 1 3 0v8.5a6 6 0 0 1 -6 6h-2h.208a6 6 0 0 1 -5.012 -2.7a69.74 69.74 0 0 1 -.196 -.3c-.312 -.479 -1.407 -2.388 -3.286 -5.728a1.5 1.5 0 0 1 .536 -2.022a1.867 1.867 0 0 1 2.28 .28l1.47 1.47"})]}),Ae),vC=ne(m.jsxs(m.Fragment,{children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("path",{d:"M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2"}),m.jsx("path",{d:"M7 11l5 5l5 -5"}),m.jsx("path",{d:"M12 4l0 12"})]}),Ae),_v=ne(m.jsxs(m.Fragment,{children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("path",{d:"M8 8m0 2a2 2 0 0 1 2 -2h8a2 2 0 0 1 2 2v8a2 2 0 0 1 -2 2h-8a2 2 0 0 1 -2 -2z"}),m.jsx("path",{d:"M16 8v-2a2 2 0 0 0 -2 -2h-8a2 2 0 0 0 -2 2v8a2 2 0 0 0 2 2h2"})]}),Ae),Cq=ne(m.jsxs("g",{strokeWidth:1.25,children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("path",{d:"M7 17m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0"}),m.jsx("path",{d:"M17 17m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0"}),m.jsx("path",{d:"M9.15 14.85l8.85 -10.85"}),m.jsx("path",{d:"M6 4l8.85 10.85"})]}),Ae),Sq=ne(m.jsxs(m.Fragment,{children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("path",{d:"M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0"}),m.jsx("path",{d:"M12 17l0 .01"}),m.jsx("path",{d:"M12 13.5a1.5 1.5 0 0 1 1 -1.5a2.6 2.6 0 1 0 -3 -4"})]}),Ae);ne(m.jsxs(m.Fragment,{children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("path",{d:"M7 4v16l13 -8z"})]}),Ae);ne(m.jsxs(m.Fragment,{children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("path",{d:"M17 4h-10a3 3 0 0 0 -3 3v10a3 3 0 0 0 3 3h10a3 3 0 0 0 3 -3v-10a3 3 0 0 0 -3 -3z",strokeWidth:"0",fill:"currentColor"})]}),Ae);var _q=ne(m.jsxs(m.Fragment,{children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("path",{d:"M5 12l5 5l10 -10"})]}),Ae),kq=ne(m.jsxs(m.Fragment,{children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("path",{d:"M10.24 3.957l-8.422 14.06a1.989 1.989 0 0 0 1.7 2.983h16.845a1.989 1.989 0 0 0 1.7 -2.983l-8.423 -14.06a1.989 1.989 0 0 0 -3.4 0z"}),m.jsx("path",{d:"M12 9v4"}),m.jsx("path",{d:"M12 17h.01"})]}),Ae),Tq=ne(m.jsxs("g",{strokeWidth:1.25,children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("path",{d:"M11 7l6 6"}),m.jsx("path",{d:"M4 16l11.7 -11.7a1 1 0 0 1 1.4 0l2.6 2.6a1 1 0 0 1 0 1.4l-11.7 11.7h-4v-4z"})]}),Ae),Mq=ne(m.jsxs("g",{strokeWidth:1.5,children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("path",{d:"M12 3l-4 7h8z"}),m.jsx("path",{d:"M17 17m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0"}),m.jsx("path",{d:"M4 14m0 1a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v4a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1z"})]}),Ae),eA=ne(m.jsxs("g",{strokeWidth:1.5,children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("path",{d:"M4 7l16 0"}),m.jsx("path",{d:"M4 17l16 0"}),m.jsx("path",{d:"M7 4l0 16"}),m.jsx("path",{d:"M17 4l0 16"})]}),Ae),tA=ne(m.jsx("path",{fill:"currentColor",d:"M407.48,111.18C335.587,108.103 269.573,152.338 245.08,220C220.587,152.338 154.573,108.103 82.68,111.18C80.285,168.229 107.577,222.632 154.74,254.82C178.908,271.419 193.35,298.951 193.27,328.27L193.27,379.13L296.9,379.13L296.9,328.27C296.816,298.953 311.255,271.42 335.42,254.82C382.596,222.644 409.892,168.233 407.48,111.18Z"})),bg=ne(m.jsxs("g",{strokeWidth:"1.25",children:[m.jsx("path",{d:"M4.16602 10H15.8327"}),m.jsx("path",{d:"M12.5 13.3333L15.8333 10"}),m.jsx("path",{d:"M12.5 6.66666L15.8333 9.99999"})]}),dt),nA=ne(m.jsxs("g",{fill:"none",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round",transform:"rotate(90 10 10)",children:[m.jsx("path",{clipRule:"evenodd",d:"m9.644 13.69 7.774-7.773a2.357 2.357 0 0 0-3.334-3.334l-7.773 7.774L8 12l1.643 1.69Z"}),m.jsx("path",{d:"m13.25 3.417 3.333 3.333M10 10l2-2M5 15l3-3M2.156 17.894l1-1M5.453 19.029l-.144-1.407M2.377 11.887l.866 1.118M8.354 17.273l-1.194-.758M.953 14.652l1.408.13"})]}),20),rA=ne(m.jsxs("g",{stroke:"currentColor",fill:"none",children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z"}),m.jsx("path",{d:"M6 21l15 -15l-3 -3l-15 15l3 3"}),m.jsx("path",{d:"M15 6l3 3"}),m.jsx("path",{d:"M9 3a2 2 0 0 0 2 2a2 2 0 0 0 -2 2a2 2 0 0 0 -2 -2a2 2 0 0 0 2 -2"}),m.jsx("path",{d:"M19 13a2 2 0 0 0 2 2a2 2 0 0 0 -2 2a2 2 0 0 0 -2 -2a2 2 0 0 0 2 -2"})]}),Ae);ne(m.jsxs("g",{strokeWidth:1.25,children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z"}),m.jsx("path",{d:"M6 21l15 -15l-3 -3l-15 15l3 3"}),m.jsx("path",{d:"M15 6l3 3"}),m.jsx("path",{d:"M9 3a2 2 0 0 0 2 2a2 2 0 0 0 -2 2a2 2 0 0 0 -2 -2a2 2 0 0 0 2 -2"}),m.jsx("path",{d:"M19 13a2 2 0 0 0 2 2a2 2 0 0 0 -2 2a2 2 0 0 0 -2 -2a2 2 0 0 0 2 -2"})]}),Ae);ne(m.jsxs("g",{stroke:"currentColor",fill:"none",children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("path",{d:"M11.217 19.384a3.501 3.501 0 0 0 6.783 -1.217v-5.167l-6 -3.35"}),m.jsx("path",{d:"M5.214 15.014a3.501 3.501 0 0 0 4.446 5.266l4.34 -2.534v-6.946"}),m.jsx("path",{d:"M6 7.63c-1.391 -.236 -2.787 .395 -3.534 1.689a3.474 3.474 0 0 0 1.271 4.745l4.263 2.514l6 -3.348"}),m.jsx("path",{d:"M12.783 4.616a3.501 3.501 0 0 0 -6.783 1.217v5.067l6 3.45"}),m.jsx("path",{d:"M18.786 8.986a3.501 3.501 0 0 0 -4.446 -5.266l-4.34 2.534v6.946"}),m.jsx("path",{d:"M18 16.302c1.391 .236 2.787 -.395 3.534 -1.689a3.474 3.474 0 0 0 -1.271 -4.745l-4.308 -2.514l-5.955 3.42"})]}),Ae);var Iq=ne(m.jsxs("g",{stroke:"currentColor",fill:"none",children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("path",{d:"M4 8v-2a2 2 0 0 1 2 -2h2"}),m.jsx("path",{d:"M4 16v2a2 2 0 0 0 2 2h2"}),m.jsx("path",{d:"M16 4h2a2 2 0 0 1 2 2v2"}),m.jsx("path",{d:"M16 20h2a2 2 0 0 0 2 -2v-2"})]}),Ae),kv=ne(m.jsxs("g",{stroke:"currentColor",fill:"none",strokeWidth:1.5,children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("path",{d:"M10 12a2 2 0 1 0 4 0a2 2 0 0 0 -4 0"}),m.jsx("path",{d:"M21 12c-2.4 4 -5.4 6 -9 6c-3.6 0 -6.6 -2 -9 -6c2.4 -4 5.4 -6 9 -6c3.6 0 6.6 2 9 6"})]}),Ae),Aq=ne(m.jsxs("g",{stroke:"currentColor",fill:"none",children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("path",{d:"M10.585 10.587a2 2 0 0 0 2.829 2.828"}),m.jsx("path",{d:"M16.681 16.673a8.717 8.717 0 0 1 -4.681 1.327c-3.6 0 -6.6 -2 -9 -6c1.272 -2.12 2.712 -3.678 4.32 -4.674m2.86 -1.146a9.055 9.055 0 0 1 1.82 -.18c3.6 0 6.6 2 9 6c-.666 1.11 -1.379 2.067 -2.138 2.87"}),m.jsx("path",{d:"M3 3l18 18"})]}),Ae);ne(m.jsxs("g",{stroke:"currentColor",fill:"none",children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("path",{d:"M15.5 13a3.5 3.5 0 0 0 -3.5 3.5v1a3.5 3.5 0 0 0 7 0v-1.8"}),m.jsx("path",{d:"M8.5 13a3.5 3.5 0 0 1 3.5 3.5v1a3.5 3.5 0 0 1 -7 0v-1.8"}),m.jsx("path",{d:"M17.5 16a3.5 3.5 0 0 0 0 -7h-.5"}),m.jsx("path",{d:"M19 9.3v-2.8a3.5 3.5 0 0 0 -7 0"}),m.jsx("path",{d:"M6.5 16a3.5 3.5 0 0 1 0 -7h.5"}),m.jsx("path",{d:"M5 9.3v-2.8a3.5 3.5 0 0 1 7 0v10"})]}),Ae);var Lq=ne(m.jsxs("g",{strokeWidth:1.25,children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("path",{d:"M15.5 13a3.5 3.5 0 0 0 -3.5 3.5v1a3.5 3.5 0 0 0 7 0v-1.8"}),m.jsx("path",{d:"M8.5 13a3.5 3.5 0 0 1 3.5 3.5v1a3.5 3.5 0 0 1 -7 0v-1.8"}),m.jsx("path",{d:"M17.5 16a3.5 3.5 0 0 0 0 -7h-.5"}),m.jsx("path",{d:"M19 9.3v-2.8a3.5 3.5 0 0 0 -7 0"}),m.jsx("path",{d:"M6.5 16a3.5 3.5 0 0 1 0 -7h.5"}),m.jsx("path",{d:"M5 9.3v-2.8a3.5 3.5 0 0 1 7 0v10"})]}),Ae),kd=ne(m.jsxs("g",{strokeWidth:1.5,children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("path",{d:"M10 10m-7 0a7 7 0 1 0 14 0a7 7 0 1 0 -14 0"}),m.jsx("path",{d:"M21 21l-6 -6"})]}),Ae),Rq=ne(m.jsxs("g",{strokeWidth:1.5,children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("path",{d:"M20.984 12.53a9 9 0 1 0 -7.552 8.355"}),m.jsx("path",{d:"M12 7v5l3 3"}),m.jsx("path",{d:"M19 16l-2 3h4l-2 3"})]}),Ae),Dq=ne(m.jsxs("g",{strokeWidth:1.5,children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("path",{d:"M9 2m0 3a3 3 0 0 1 3 -3h0a3 3 0 0 1 3 3v5a3 3 0 0 1 -3 3h0a3 3 0 0 1 -3 -3z"}),m.jsx("path",{d:"M5 10a7 7 0 0 0 14 0"}),m.jsx("path",{d:"M8 21l8 0"}),m.jsx("path",{d:"M12 17l0 4"})]}),Ae),jq=ne(m.jsxs("g",{strokeWidth:1.5,children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("path",{d:"M3 3l18 18"}),m.jsx("path",{d:"M9 5a3 3 0 0 1 6 0v5a3 3 0 0 1 -.13 .874m-2 2a3 3 0 0 1 -3.87 -2.872v-1"}),m.jsx("path",{d:"M5 10a7 7 0 0 0 10.846 5.85m2 -2a6.967 6.967 0 0 0 1.152 -3.85"}),m.jsx("path",{d:"M8 21l8 0"}),m.jsx("path",{d:"M12 17l0 4"})]}),Ae),iA=ne(m.jsxs("g",{strokeWidth:1.25,children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("path",{d:"M13 3l0 7l6 0l-8 11l0 -7l-6 0l8 -11"})]}),Ae),Pq=ne(m.jsxs("g",{children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("path",{d:"M8 8m0 1a1 1 0 0 1 1 -1h6a1 1 0 0 1 1 1v6a1 1 0 0 1 -1 1h-6a1 1 0 0 1 -1 -1z"}),m.jsx("path",{d:"M12 20v.01"}),m.jsx("path",{d:"M16 20v.01"}),m.jsx("path",{d:"M8 20v.01"}),m.jsx("path",{d:"M4 20v.01"}),m.jsx("path",{d:"M4 16v.01"}),m.jsx("path",{d:"M4 12v.01"}),m.jsx("path",{d:"M4 8v.01"}),m.jsx("path",{d:"M4 4v.01"}),m.jsx("path",{d:"M8 4v.01"}),m.jsx("path",{d:"M12 4v.01"}),m.jsx("path",{d:"M16 4v.01"}),m.jsx("path",{d:"M20 4v.01"}),m.jsx("path",{d:"M20 8v.01"}),m.jsx("path",{d:"M20 12v.01"}),m.jsx("path",{d:"M20 16v.01"}),m.jsx("path",{d:"M20 20v.01"})]}),Ae),Nq=ne(m.jsxs("g",{strokeWidth:1.25,children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("path",{d:"M5 3v18"}),m.jsx("path",{d:"M19 21v-18"}),m.jsx("path",{d:"M5 7h14"}),m.jsx("path",{d:"M5 15h14"}),m.jsx("path",{d:"M8 13v4"}),m.jsx("path",{d:"M11 13v4"}),m.jsx("path",{d:"M16 13v4"}),m.jsx("path",{d:"M14 5v4"}),m.jsx("path",{d:"M11 5v4"}),m.jsx("path",{d:"M8 5v4"}),m.jsx("path",{d:"M3 21h18"})]}),Ae),Oq=ne(m.jsxs("g",{strokeWidth:1.25,children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("path",{d:"M3 12l18 0"}),m.jsx("path",{d:"M7 16l10 0l-10 5l0 -5"}),m.jsx("path",{d:"M7 8l10 0l-10 -5l0 5"})]}),Ae),Fq=ne(m.jsxs("g",{strokeWidth:1.25,children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("path",{d:"M12 3l0 18"}),m.jsx("path",{d:"M16 7l0 10l5 0l-5 -10"}),m.jsx("path",{d:"M8 7l0 10l-5 0l5 -10"})]}),Ae),aA=ne(m.jsxs("g",{strokeWidth:1.25,children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("path",{d:"M5 3m0 2a2 2 0 0 1 2 -2h10a2 2 0 0 1 2 2v2a2 2 0 0 1 -2 2h-10a2 2 0 0 1 -2 -2z"}),m.jsx("path",{d:"M19 6h1a2 2 0 0 1 2 2a5 5 0 0 1 -5 5l-5 0v2"}),m.jsx("path",{d:"M10 15m0 1a1 1 0 0 1 1 -1h2a1 1 0 0 1 1 1v4a1 1 0 0 1 -1 1h-2a1 1 0 0 1 -1 -1z"})]}),Ae),Tv=ne(m.jsxs("g",{strokeWidth:1.25,children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("path",{d:"M15 15m-5 0a5 5 0 1 0 10 0a5 5 0 1 0 -10 0"}),m.jsx("path",{d:"M22 22l-3 -3"}),m.jsx("path",{d:"M6 18h-1a2 2 0 0 1 -2 -2v-1"}),m.jsx("path",{d:"M3 11v-1"}),m.jsx("path",{d:"M3 6v-1a2 2 0 0 1 2 -2h1"}),m.jsx("path",{d:"M10 3h1"}),m.jsx("path",{d:"M15 3h1a2 2 0 0 1 2 2v1"})]}),Ae),$q=ne(m.jsxs("g",{strokeWidth:1.25,children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("path",{d:"M14 3v4a1 1 0 0 0 1 1h4"}),m.jsx("path",{d:"M5 12v-7a2 2 0 0 1 2 -2h7l5 5v4"}),m.jsx("path",{d:"M4 20.25c0 .414 .336 .75 .75 .75h1.25a1 1 0 0 0 1 -1v-1a1 1 0 0 0 -1 -1h-1a1 1 0 0 1 -1 -1v-1a1 1 0 0 1 1 -1h1.25a.75 .75 0 0 1 .75 .75"}),m.jsx("path",{d:"M10 15l2 6l2 -6"}),m.jsx("path",{d:"M20 15h-1a2 2 0 0 0 -2 2v2a2 2 0 0 0 2 2h1v-3"})]}),Ae),Bq=ne(m.jsxs("g",{strokeWidth:1.25,children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("path",{d:"M14 3v4a1 1 0 0 0 1 1h4"}),m.jsx("path",{d:"M5 12v-7a2 2 0 0 1 2 -2h7l5 5v4"}),m.jsx("path",{d:"M20 15h-1a2 2 0 0 0 -2 2v2a2 2 0 0 0 2 2h1v-3"}),m.jsx("path",{d:"M5 18h1.5a1.5 1.5 0 0 0 0 -3h-1.5v6"}),m.jsx("path",{d:"M11 21v-6l3 6v-6"})]}),Ae),zq=ne(m.jsxs("g",{strokeWidth:1.25,children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("path",{d:"M4 13v-8a2 2 0 0 1 2 -2h1a2 2 0 0 1 2 2v8a2 2 0 0 0 6 0v-8a2 2 0 0 1 2 -2h1a2 2 0 0 1 2 2v8a8 8 0 0 1 -16 0"}),m.jsx("path",{d:"M4 8l5 0"}),m.jsx("path",{d:"M15 8l4 0"})]}),Ae),Hq=ne(m.jsxs("g",{strokeWidth:1.25,children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("path",{d:"M3 14c.83 .642 2.077 1.017 3.5 1c1.423 .017 2.67 -.358 3.5 -1c.83 -.642 2.077 -1.017 3.5 -1c1.423 -.017 2.67 .358 3.5 1"}),m.jsx("path",{d:"M8 3a2.4 2.4 0 0 0 -1 2a2.4 2.4 0 0 0 1 2"}),m.jsx("path",{d:"M12 3a2.4 2.4 0 0 0 -1 2a2.4 2.4 0 0 0 1 2"}),m.jsx("path",{d:"M3 10h14v5a6 6 0 0 1 -6 6h-2a6 6 0 0 1 -6 -6v-5z"}),m.jsx("path",{d:"M16.746 16.726a3 3 0 1 0 .252 -5.555"})]}),Ae),Wq=ne(m.jsxs("g",{stroke:"currentColor",children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("path",{d:"M3 5a1 1 0 0 1 1-1h16a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1h-16a1 1 0 0 1-1-1v-10zM7 20h10M9 16v4M15 16v4"})]}),{...Ae,strokeWidth:1.5});ne(m.jsxs("g",{strokeWidth:1.5,children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("path",{d:"M15 8v-2a2 2 0 0 0 -2 -2h-7a2 2 0 0 0 -2 2v12a2 2 0 0 0 2 2h7a2 2 0 0 0 2 -2v-2"}),m.jsx("path",{d:"M21 12h-13l3 -3"}),m.jsx("path",{d:"M11 15l-3 -3"})]}),Ae);var Xq=ne(m.jsxs("g",{children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("path",{d:"M2 8a4 4 0 0 1 4 -4h12a4 4 0 0 1 4 4v8a4 4 0 0 1 -4 4h-12a4 4 0 0 1 -4 -4v-8z"}),m.jsx("path",{d:"M10 9l5 3l-5 3z"})]}),Ae),Vq=ne(m.jsxs("g",{strokeWidth:1.5,children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("path",{d:"M3 6h18"}),m.jsx("path",{d:"M3 12h18"}),m.jsx("path",{d:"M3 18h18"}),m.jsx("path",{d:"M6 3v18"}),m.jsx("path",{d:"M12 3v18"}),m.jsx("path",{d:"M18 3v18"})]}),Ae),Yq=ne(m.jsxs("g",{strokeWidth:1.5,children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("path",{d:"M17 3m0 1a1 1 0 0 1 1 -1h2a1 1 0 0 1 1 1v2a1 1 0 0 1 -1 1h-2a1 1 0 0 1 -1 -1z"}),m.jsx("path",{d:"M3 17m0 1a1 1 0 0 1 1 -1h2a1 1 0 0 1 1 1v2a1 1 0 0 1 -1 1h-2a1 1 0 0 1 -1 -1z"}),m.jsx("path",{d:"M17 5c-6.627 0 -12 5.373 -12 12"})]}),Ae),Gq=ne(m.jsxs("g",{children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("path",{d:"M6 18l12 -12"}),m.jsx("path",{d:"M18 10v-4h-4"})]}),Ae),qq=ne(m.jsxs("g",{children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("path",{d:"M4,19L10,19C11.097,19 12,18.097 12,17L12,9C12,7.903 12.903,7 14,7L21,7"}),m.jsx("path",{d:"M18 4l3 3l-3 3"})]}),Ae),Zq=ne(m.jsxs("g",{children:[m.jsx("path",{d:"M16,12L20,9L16,6"}),m.jsx("path",{d:"M6 20c0 -6.075 4.925 -11 11 -11h3"})]}),Ae),sA=ne(m.jsxs("g",{children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("path",{d:"M6 9l6 6l6 -6"})]}),Ae),Kq=ne(m.jsxs("g",{children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("path",{d:"M6 15l6 -6l6 6"})]}),Ae),Qq=ne(m.jsxs("g",{children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("path",{d:"M6 15l6 -6l6 6"})]}),Ae),xC=ne(m.jsxs("g",{strokeWidth:"1.25",children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("path",{d:"M8 5v10a1 1 0 0 0 1 1h10"}),m.jsx("path",{d:"M5 8h10a1 1 0 0 1 1 1v10"})]}),Ae),oA=ne(m.jsxs("g",{children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("path",{d:"M5 5m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"}),m.jsx("path",{d:"M19 5m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"}),m.jsx("path",{d:"M5 19m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"}),m.jsx("path",{d:"M19 19m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"}),m.jsx("path",{d:"M5 7l0 10"}),m.jsx("path",{d:"M7 5l10 0"}),m.jsx("path",{d:"M7 19l10 0"}),m.jsx("path",{d:"M19 7l0 10"})]}),Ae),h2={[un.Excalifont]:{metrics:{unitsPerEm:1e3,ascender:886,descender:-374,lineHeight:1.25},icon:d1},[un.Nunito]:{metrics:{unitsPerEm:1e3,ascender:1011,descender:-353,lineHeight:1.35},icon:u2},[un["Lilita One"]]:{metrics:{unitsPerEm:1e3,ascender:923,descender:-220,lineHeight:1.15},icon:gq},[un["Comic Shanns"]]:{metrics:{unitsPerEm:1e3,ascender:750,descender:-250,lineHeight:1.25},icon:I3},[un.Virgil]:{metrics:{unitsPerEm:1e3,ascender:886,descender:-374,lineHeight:1.25},icon:d1,deprecated:!0},[un.Helvetica]:{metrics:{unitsPerEm:2048,ascender:1577,descender:-471,lineHeight:1.15},icon:u2,deprecated:!0,local:!0},[un.Cascadia]:{metrics:{unitsPerEm:2048,ascender:1900,descender:-480,lineHeight:1.2},icon:I3,deprecated:!0},[un["Liberation Sans"]]:{metrics:{unitsPerEm:2048,ascender:1854,descender:-434,lineHeight:1.15},serverSide:!0},[Pu.Xiaolai]:{metrics:{unitsPerEm:1e3,ascender:880,descender:-144,lineHeight:1.15},fallback:!0},[Pu["Segoe UI Emoji"]]:{metrics:{unitsPerEm:1e3,ascender:886,descender:-374,lineHeight:1.25},local:!0,fallback:!0}},Qc={LATIN:"U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD",LATIN_EXT:"U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF",CYRILIC_EXT:"U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F",CYRILIC:"U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116",VIETNAMESE:"U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB"},Mv="local:",Jq=class extends Error{constructor(e="Couldn't export canvas.",t="CANVAS_ERROR"){super(),this.name=t,this.message=e}},kU=class extends DOMException{constructor(e="Request Aborted"){super(e,"AbortError")}},rd=class extends Error{constructor(e="Image Scene Data Error",t="IMAGE_SCENE_DATA_ERROR"){super(e),H(this,"code"),this.name="EncodingError",this.code=t}},eZ=class extends Error{constructor(){super(...arguments),H(this,"code","ELEMENT_HAS_INVALID_INDEX")}},lA=class extends Error{constructor(e="Worker URL is not defined!",t="WORKER_URL_NOT_DEFINED"){super(e),H(this,"code"),this.name="WorkerUrlNotDefinedError",this.code=t}},cA=class extends Error{constructor(e="Worker has to be in a separate chunk!",t="WORKER_IN_THE_MAIN_CHUNK"){super(e),H(this,"code"),this.name="WorkerInTheMainChunkError",this.code=t}},wC=class extends Error{constructor(e){super(e),this.name="ExcalidrawError"}},tZ=class{constructor(e){H(this,"instance"),H(this,"debounceTerminate"),this.instance=new Worker(e,{type:"module"})}},nZ=class dA{constructor(t,n){H(this,"idleWorkers",new Set),H(this,"workerUrl"),H(this,"workerTTL"),this.workerUrl=t,this.workerTTL=n.ttl||1e3}static create(t,n={}){if(!t)throw new lA;if(!import.meta.url||t.toString()===import.meta.url)throw new cA;return new dA(t,n)}async postMessage(t,n){let r,i=Array.from(this.idleWorkers).shift();return i?(this.idleWorkers.delete(i),r=i):r=await this.createWorker(),new Promise((a,s)=>{r.instance.onmessage=this.onMessageHandler(r,a),r.instance.onerror=this.onErrorHandler(r,s),r.instance.postMessage(t,n),r.debounceTerminate(()=>s(new Error(`Active worker did not respond for ${this.workerTTL}ms!`)))})}async clear(){for(let t of this.idleWorkers)t.debounceTerminate.cancel(),t.instance.terminate();this.idleWorkers.clear()}async createWorker(){let t=new tZ(this.workerUrl);return t.debounceTerminate=uh(n=>{t.instance.terminate(),this.idleWorkers.has(t)?(this.idleWorkers.delete(t),console.debug("Job finished! Idle worker has been released from the pool.")):n?n():console.error("Worker has been terminated!")},this.workerTTL),t}onMessageHandler(t,n){return r=>{t.debounceTerminate(),this.idleWorkers.add(t),n(r.data)}}onErrorHandler(t,n){return r=>{t.debounceTerminate(()=>n(r)),t.debounceTerminate.flush(),this.clear()}}},EC=typeof Worker<"u",rZ=async(e,t)=>{let{Commands:n,subsetToBase64:r,toBase64:i}=await aZ();return EC?hh(async()=>{try{let a=await sZ(),s=e.slice(0),o=await a.postMessage({command:n.Subset,arrayBuffer:s,codePoints:t},{transfer:[s]});return i(o)}catch(a){return EC=!1,BY()&&(a instanceof lA||a instanceof cA)||console.error("Failed to use workers for subsetting, falling back to the main thread.",a),r(e,t)}}):r(e,t)},Gb=null,qb=null,iZ=async()=>(Gb||(Gb=ye(()=>import("./subset-worker.chunk.js"),__vite__mapDeps([0,1]),import.meta.url)),Gb),aZ=async()=>(qb||(qb=ye(()=>import("./subset-shared.chunk.js"),[],import.meta.url)),qb),Zb=null,sZ=()=>(Zb||(Zb=hh(async()=>{let{WorkerUrl:e}=await iZ();return nZ.create(e)})),Zb),uA=class yg{constructor(t,n,r){H(this,"urls"),H(this,"fontFace"),this.urls=yg.createUrls(n);let i=this.urls.map(a=>`url(${a}) ${yg.getFormat(a)}`).join(", ");this.fontFace=new FontFace(t,i,{display:"swap",style:"normal",weight:"400",...r})}toCSS(t){if(!this.getUnicodeRangeRegex().test(t))return;let n=Array.from(t).map(r=>r.codePointAt(0));return this.getContent(n).then(r=>`@font-face { font-family: ${this.fontFace.family}; src: url(${r}); }`)}async getContent(t){let n=0,r=[];for(;n<this.urls.length;){let i=this.urls[n];try{let a=await this.fetchFont(i);return await rZ(a,t)}catch(a){r.push(`"${i.toString()}" returned error "${a}"`)}n++}return console.error(`Failed to fetch font family "${this.fontFace.family}"`,JSON.stringify(r,void 0,2)),this.urls.length?this.urls[this.urls.length-1].toString():""}fetchFont(t){return hh(async()=>{let n=await fetch(t,{cache:"force-cache",headers:{Accept:"font/woff2"}});if(!n.ok){let r=t instanceof URL?t.toString():"dataurl";throw new Error(`Failed to fetch "${r}": ${n.statusText}`)}return await n.arrayBuffer()})}getUnicodeRangeRegex(){let t=this.fontFace.unicodeRange.split(/,\s*/).map(n=>{let[r,i]=n.replace("U+","").split("-");return i?`\\u{${r}}-\\u{${i}}`:`\\u{${r}}`}).join("");return new RegExp(`[${t}]`,"u")}static createUrls(t){if(t.startsWith("data"))return[t];if(t.startsWith(Mv))return[];if(t.startsWith("http"))return[new URL(t)];let n=t.replace(/^\/+/,""),r=[];if(typeof window.EXCALIDRAW_ASSET_PATH=="string"){let i=this.normalizeBaseUrl(window.EXCALIDRAW_ASSET_PATH);r.push(new URL(n,i))}else Array.isArray(window.EXCALIDRAW_ASSET_PATH)&&window.EXCALIDRAW_ASSET_PATH.forEach(i=>{let a=this.normalizeBaseUrl(i);r.push(new URL(n,a))});return r.push(new URL(n,yg.ASSETS_FALLBACK_URL)),r}static getFormat(t){if(!(t instanceof URL))return"";try{let n=new URL(t).pathname.split(".");return n.length===1?"":`format('${n.pop()}')`}catch{return""}}static normalizeBaseUrl(t){var r;let n=t;return/^\.?\//.test(n)&&(n=new URL(n.replace(/^\.?\/+/,""),(r=window==null?void 0:window.location)==null?void 0:r.origin).toString()),n=`${n.replace(/\/+$/,"")}/`,n}};H(uA,"ASSETS_FALLBACK_URL",`https://esm.sh/${`${mt.PKG_NAME}@${mt.PKG_VERSION}`}/dist/prod/`);var oZ=uA,lZ="./fonts/Cascadia/CascadiaCode-Regular.woff2",cZ=[{uri:lZ}],dZ="./fonts/ComicShanns/ComicShanns-Regular-279a7b317d12eb88de06167bd672b4b4.woff2",uZ="./fonts/ComicShanns/ComicShanns-Regular-fcb0fc02dcbee4c9846b3e2508668039.woff2",hZ="./fonts/ComicShanns/ComicShanns-Regular-dc6a8806fa96795d7b3be5026f989a17.woff2",fZ="./fonts/ComicShanns/ComicShanns-Regular-6e066e8de2ac57ea9283adb9c24d7f0c.woff2",pZ=[{uri:dZ,descriptors:{unicodeRange:"U+20-7e,U+a1-a6,U+a8,U+ab-ac,U+af-b1,U+b4,U+b8,U+bb-bc,U+bf-cf,U+d1-d7,U+d9-de,U+e0-ef,U+f1-f7,U+f9-ff,U+131,U+152-153,U+2c6,U+2da,U+2dc,U+2013-2014,U+2018-201a,U+201c-201d,U+2020-2022,U+2026,U+2039-203a,U+2044,U+20ac,U+2191,U+2193,U+2212"}},{uri:uZ,descriptors:{unicodeRange:"U+100-10f,U+112-125,U+128-130,U+134-137,U+139-13c,U+141-148,U+14c-151,U+154-161,U+164-165,U+168-17f,U+1bf,U+1f7,U+218-21b,U+237,U+1e80-1e85,U+1ef2-1ef3,U+a75b"}},{uri:hZ,descriptors:{unicodeRange:"U+2c7,U+2d8-2d9,U+2db,U+2dd,U+315,U+2190,U+2192,U+2200,U+2203-2204,U+2264-2265,U+f6c3"}},{uri:fZ,descriptors:{unicodeRange:"U+3bb"}}],mZ=[{uri:Mv}],gZ="./fonts/Excalifont/Excalifont-Regular-a88b72a24fb54c9f94e3b5fdaa7481c9.woff2",UZ="./fonts/Excalifont/Excalifont-Regular-be310b9bcd4f1a43f571c46df7809174.woff2",bZ="./fonts/Excalifont/Excalifont-Regular-b9dcf9d2e50a1eaf42fc664b50a3fd0d.woff2",yZ="./fonts/Excalifont/Excalifont-Regular-41b173a47b57366892116a575a43e2b6.woff2",vZ="./fonts/Excalifont/Excalifont-Regular-3f2c5db56cc93c5a6873b1361d730c16.woff2",xZ="./fonts/Excalifont/Excalifont-Regular-349fac6ca4700ffec595a7150a0d1e1d.woff2",wZ="./fonts/Excalifont/Excalifont-Regular-623ccf21b21ef6b3a0d87738f77eb071.woff2",EZ=[{uri:gZ,descriptors:{unicodeRange:"U+20-7e,U+a0-a3,U+a5-a6,U+a8-ab,U+ad-b1,U+b4,U+b6-b8,U+ba-ff,U+131,U+152-153,U+2bc,U+2c6,U+2da,U+2dc,U+304,U+308,U+2013-2014,U+2018-201a,U+201c-201e,U+2020,U+2022,U+2024-2026,U+2030,U+2039-203a,U+20ac,U+2122,U+2212"}},{uri:UZ,descriptors:{unicodeRange:"U+100-130,U+132-137,U+139-149,U+14c-151,U+154-17e,U+192,U+1fc-1ff,U+218-21b,U+237,U+1e80-1e85,U+1ef2-1ef3,U+2113"}},{uri:bZ,descriptors:{unicodeRange:"U+400-45f,U+490-491,U+2116"}},{uri:yZ,descriptors:{unicodeRange:"U+37e,U+384-38a,U+38c,U+38e-393,U+395-3a1,U+3a3-3a8,U+3aa-3cf,U+3d7"}},{uri:vZ,descriptors:{unicodeRange:"U+2c7,U+2d8-2d9,U+2db,U+2dd,U+302,U+306-307,U+30a-30c,U+326-328,U+212e,U+2211,U+fb01-fb02"}},{uri:xZ,descriptors:{unicodeRange:"U+462-463,U+472-475,U+4d8-4d9,U+4e2-4e3,U+4e6-4e9,U+4ee-4ef"}},{uri:wZ,descriptors:{unicodeRange:"U+300-301,U+303"}}],CZ=[{uri:Mv}],SZ="./fonts/Liberation/LiberationSans-Regular.woff2",_Z=[{uri:SZ}],kZ="./fonts/Lilita/Lilita-Regular-i7dPIFZ9Zz-WBtRtedDbYEF8RXi4EwQ.woff2",TZ="./fonts/Lilita/Lilita-Regular-i7dPIFZ9Zz-WBtRtedDbYE98RXi4EwSsbg.woff2",MZ=[{uri:TZ,descriptors:{unicodeRange:Qc.LATIN_EXT}},{uri:kZ,descriptors:{unicodeRange:Qc.LATIN}}],IZ="./fonts/Nunito/Nunito-Regular-XRXI3I6Li01BKofiOc5wtlZ2di8HDIkhdTQ3j6zbXWjgeg.woff2",AZ="./fonts/Nunito/Nunito-Regular-XRXI3I6Li01BKofiOc5wtlZ2di8HDIkhdTo3j6zbXWjgevT5.woff2",LZ="./fonts/Nunito/Nunito-Regular-XRXI3I6Li01BKofiOc5wtlZ2di8HDIkhdTA3j6zbXWjgevT5.woff2",RZ="./fonts/Nunito/Nunito-Regular-XRXI3I6Li01BKofiOc5wtlZ2di8HDIkhdTk3j6zbXWjgevT5.woff2",DZ="./fonts/Nunito/Nunito-Regular-XRXI3I6Li01BKofiOc5wtlZ2di8HDIkhdTs3j6zbXWjgevT5.woff2",jZ=[{uri:RZ,descriptors:{unicodeRange:Qc.CYRILIC_EXT,weight:"500"}},{uri:LZ,descriptors:{unicodeRange:Qc.CYRILIC,weight:"500"}},{uri:DZ,descriptors:{unicodeRange:Qc.VIETNAMESE,weight:"500"}},{uri:AZ,descriptors:{unicodeRange:Qc.LATIN_EXT,weight:"500"}},{uri:IZ,descriptors:{unicodeRange:Qc.LATIN,weight:"500"}}],PZ="./fonts/Virgil/Virgil-Regular.woff2",NZ=[{uri:PZ}],OZ="./fonts/Xiaolai/Xiaolai-Regular-09850c4077f3fffe707905872e0e2460.woff2",FZ="./fonts/Xiaolai/Xiaolai-Regular-7eb9fffd1aa890d07d0f88cc82e6cfe4.woff2",$Z="./fonts/Xiaolai/Xiaolai-Regular-60a3089806700d379f11827ee9843b6b.woff2",BZ="./fonts/Xiaolai/Xiaolai-Regular-6fe5c5973cc06f74b2387a631ea36b88.woff2",zZ="./fonts/Xiaolai/Xiaolai-Regular-b96d9226ce77ec94ceca043d712182e6.woff2",HZ="./fonts/Xiaolai/Xiaolai-Regular-6ae5b42180ad70b971c91e7eefb8eba2.woff2",WZ="./fonts/Xiaolai/Xiaolai-Regular-a4c34be6d42152e64b0df90bc4607f64.woff2",XZ="./fonts/Xiaolai/Xiaolai-Regular-c69f61a4ab18d0488c8d1fc12e7028e8.woff2",VZ="./fonts/Xiaolai/Xiaolai-Regular-e3fcf5180fd466c8915c4e8069491054.woff2",YZ="./fonts/Xiaolai/Xiaolai-Regular-c1f94158256bb1f3bf665b053d895af9.woff2",GZ="./fonts/Xiaolai/Xiaolai-Regular-544fc28abe2c5c30e62383fd4dac255f.woff2",qZ="./fonts/Xiaolai/Xiaolai-Regular-7197d6fda6cba7c3874c53d6381ca239.woff2",ZZ="./fonts/Xiaolai/Xiaolai-Regular-70c2eb8d64e71a42a834eb857ea9df51.woff2",KZ="./fonts/Xiaolai/Xiaolai-Regular-069e77aac84590e2e991d0a0176d34f2.woff2",QZ="./fonts/Xiaolai/Xiaolai-Regular-41521fade99856108931b4768b1b2648.woff2",JZ="./fonts/Xiaolai/Xiaolai-Regular-a004ddfcb26e67bd6e678c8ed19e25ce.woff2",eK="./fonts/Xiaolai/Xiaolai-Regular-04b718e5623574919c8b0dea5f301444.woff2",tK="./fonts/Xiaolai/Xiaolai-Regular-7e4bde7e9c7f84cd34d8a845e384c746.woff2",nK="./fonts/Xiaolai/Xiaolai-Regular-23686f7f29da6e8008c36dd3a80c83d6.woff2",rK="./fonts/Xiaolai/Xiaolai-Regular-69c09cc5fa3e55c74fc4821f76909cc3.woff2",iK="./fonts/Xiaolai/Xiaolai-Regular-25b7f38e18f035f96cb5e547bd2bd08c.woff2",aK="./fonts/Xiaolai/Xiaolai-Regular-ba3de316d63c7e339987b16f41a0b879.woff2",sK="./fonts/Xiaolai/Xiaolai-Regular-12b52b58eb3df36804b9a654ec9ee194.woff2",oK="./fonts/Xiaolai/Xiaolai-Regular-b1220a3c61f85cc0408deedb4c5f57a2.woff2",lK="./fonts/Xiaolai/Xiaolai-Regular-4535823663ad81405188a528d8f2b1a2.woff2",cK="./fonts/Xiaolai/Xiaolai-Regular-3eaa538115d76932653c21d8dc28f207.woff2",dK="./fonts/Xiaolai/Xiaolai-Regular-7e929f262f30c8ee78bf398150b1a7cd.woff2",uK="./fonts/Xiaolai/Xiaolai-Regular-73e309718fd16cea44b4d54a33581811.woff2",hK="./fonts/Xiaolai/Xiaolai-Regular-9eb5a99df4e76ac3363453ac9ca288b1.woff2",fK="./fonts/Xiaolai/Xiaolai-Regular-3e63ed8162808a9e425ed80a8bc79114.woff2",pK="./fonts/Xiaolai/Xiaolai-Regular-cb17fc3db95f6d139afc9d31a8e93293.woff2",mK="./fonts/Xiaolai/Xiaolai-Regular-c8b71798409ccc126ee264a00aadcf21.woff2",gK="./fonts/Xiaolai/Xiaolai-Regular-11c345711937f0ba4b8f7b6b919c8440.woff2",UK="./fonts/Xiaolai/Xiaolai-Regular-e480d9c614742d05f0e78f274f1e69e6.woff2",bK="./fonts/Xiaolai/Xiaolai-Regular-95429962233afd82db1c27df1500a28c.woff2",yK="./fonts/Xiaolai/Xiaolai-Regular-2cf96d082d35ea3d8106851223ad0d16.woff2",vK="./fonts/Xiaolai/Xiaolai-Regular-2d43040e86ff03ba677f6f9c04cd0805.woff2",xK="./fonts/Xiaolai/Xiaolai-Regular-2a26d20a23b00898ce82f09d2ee47c3f.woff2",wK="./fonts/Xiaolai/Xiaolai-Regular-a365e82ed54697a52f27adcea1315fe8.woff2",EK="./fonts/Xiaolai/Xiaolai-Regular-f5d079153c99a25b9be5b8583c4cc8a7.woff2",CK="./fonts/Xiaolai/Xiaolai-Regular-10a7ae9a371830a80c3d844acf1c02d7.woff2",SK="./fonts/Xiaolai/Xiaolai-Regular-e4bca6cfa53e499cae0a6be4894a90e9.woff2",_K="./fonts/Xiaolai/Xiaolai-Regular-60a41c7e1c68f22424e6d22df544bc82.woff2",kK="./fonts/Xiaolai/Xiaolai-Regular-7ab2bed91166a9dca83a5ebfbe2a7f38.woff2",TK="./fonts/Xiaolai/Xiaolai-Regular-670ba603758d94268e8606f240a42e12.woff2",MK="./fonts/Xiaolai/Xiaolai-Regular-e656f091b9dc4709722c9f4b84d3c797.woff2",IK="./fonts/Xiaolai/Xiaolai-Regular-15dc6d811c9cd078f9086a740d5a1038.woff2",AK="./fonts/Xiaolai/Xiaolai-Regular-f0f13b5c60e0af5553bd359f5513be1b.woff2",LK="./fonts/Xiaolai/Xiaolai-Regular-8c2f33cee3993174f7e87c28e4bf42ee.woff2",RK="./fonts/Xiaolai/Xiaolai-Regular-761d05e3cd968cf574166867998ef06a.woff2",DK="./fonts/Xiaolai/Xiaolai-Regular-642b26e2e5f5fb780b51b593dbc8c851.woff2",jK="./fonts/Xiaolai/Xiaolai-Regular-5572b3513ba8df57a3d5d7303ee6b11b.woff2",PK="./fonts/Xiaolai/Xiaolai-Regular-3c9de2ae0ea4bc91a510942dfa4be8d2.woff2",NK="./fonts/Xiaolai/Xiaolai-Regular-671a2c20b1eb9e4ef8a192833940e319.woff2",OK="./fonts/Xiaolai/Xiaolai-Regular-4dc6d5f188d5c96d44815cd1e81aa885.woff2",FK="./fonts/Xiaolai/Xiaolai-Regular-ce4884f96f11589608b76b726a755803.woff2",$K="./fonts/Xiaolai/Xiaolai-Regular-8f476c4c99813d57cbe6eca4727388ad.woff2",BK="./fonts/Xiaolai/Xiaolai-Regular-5935a5775af3d5c6307ac667bd9ae74e.woff2",zK="./fonts/Xiaolai/Xiaolai-Regular-79f007c1c6d07557120982951ea67998.woff2",HK="./fonts/Xiaolai/Xiaolai-Regular-bafff7a14c27403dcc6cf1432e8ea836.woff2",WK="./fonts/Xiaolai/Xiaolai-Regular-543fa46ace099a7099dad69123399400.woff2",XK="./fonts/Xiaolai/Xiaolai-Regular-4ddc14ed3eb0c3e46364317dfc0144a3.woff2",VK="./fonts/Xiaolai/Xiaolai-Regular-0fa55a080fcd0f9dc2e0b0058b793df8.woff2",YK="./fonts/Xiaolai/Xiaolai-Regular-66493ba5a8367f2928812f446f47b56a.woff2",GK="./fonts/Xiaolai/Xiaolai-Regular-57862b464a55b18c7bf234ce22907d73.woff2",qK="./fonts/Xiaolai/Xiaolai-Regular-8d3bcabb847b56243b16afe62adaaf21.woff2",ZK="./fonts/Xiaolai/Xiaolai-Regular-2b77e8ebfb2367ab2662396a60e7d320.woff2",KK="./fonts/Xiaolai/Xiaolai-Regular-0b5d723fdc4e249c140f0909e87d03b4.woff2",QK="./fonts/Xiaolai/Xiaolai-Regular-cdbce89e82cc1ab53a2decbf5819278f.woff2",JK="./fonts/Xiaolai/Xiaolai-Regular-739bc1a567439c7cffcd1614644593d2.woff2",eQ="./fonts/Xiaolai/Xiaolai-Regular-72252d73220fa3cd856677888cee1635.woff2",tQ="./fonts/Xiaolai/Xiaolai-Regular-08e0dc436ad0ad61ba5558db0674d762.woff2",nQ="./fonts/Xiaolai/Xiaolai-Regular-cf6ff4e0f491ca0cf3038187a997b9b4.woff2",rQ="./fonts/Xiaolai/Xiaolai-Regular-9cfb2a77a4e45025105ad29a1748b90d.woff2",iQ="./fonts/Xiaolai/Xiaolai-Regular-450da755d5bcb70906e1295e559b9602.woff2",aQ="./fonts/Xiaolai/Xiaolai-Regular-0986d134c05864f5025962eef9f994a0.woff2",sQ="./fonts/Xiaolai/Xiaolai-Regular-1ee544f0f1dac422545c505baa788992.woff2",oQ="./fonts/Xiaolai/Xiaolai-Regular-4806e761d750087c2d734fc64596eaff.woff2",lQ="./fonts/Xiaolai/Xiaolai-Regular-33432927cd87d40cfe393c7482bf221f.woff2",cQ="./fonts/Xiaolai/Xiaolai-Regular-be549ab72f0719d606a5c01e2c0219b6.woff2",dQ="./fonts/Xiaolai/Xiaolai-Regular-019d66dcad46dc156b162d267f981c20.woff2",uQ="./fonts/Xiaolai/Xiaolai-Regular-b5c1596551c256e0e9cf02028595b092.woff2",hQ="./fonts/Xiaolai/Xiaolai-Regular-e5f453bb04da18eed01675eeebd88bf8.woff2",fQ="./fonts/Xiaolai/Xiaolai-Regular-cf2cc71752631e579e35b0e423bf2638.woff2",pQ="./fonts/Xiaolai/Xiaolai-Regular-6f3256af8454371776bc46670d33cc65.woff2",mQ="./fonts/Xiaolai/Xiaolai-Regular-23f228f3999c01983860012330e4be08.woff2",gQ="./fonts/Xiaolai/Xiaolai-Regular-21430ee05a1248901da8d0de08744d47.woff2",UQ="./fonts/Xiaolai/Xiaolai-Regular-5330a2119a716e4e7224ed108b085dac.woff2",bQ="./fonts/Xiaolai/Xiaolai-Regular-cd145ce4a0ea18469358df53c207bc1b.woff2",yQ="./fonts/Xiaolai/Xiaolai-Regular-36925dfe329a45086cbb7fc5c20d45ac.woff2",vQ="./fonts/Xiaolai/Xiaolai-Regular-4bfaa8ffa64c5ee560aa2daba7c9cbd3.woff2",xQ="./fonts/Xiaolai/Xiaolai-Regular-112c051027b2d766c19a519f6ee1f4f7.woff2",wQ="./fonts/Xiaolai/Xiaolai-Regular-5b0ed6971aaab9c8ad563230bd5471a7.woff2",EQ="./fonts/Xiaolai/Xiaolai-Regular-98f2ad84457de7f3740d9920b8fa8667.woff2",CQ="./fonts/Xiaolai/Xiaolai-Regular-733171b4ffcd17ea1fe1c0ba627173bf.woff2",SQ="./fonts/Xiaolai/Xiaolai-Regular-684d65f1793cac449dde5d59cb3c47fb.woff2",_Q="./fonts/Xiaolai/Xiaolai-Regular-cbaaefaaf326668277aa24dfa93c4d28.woff2",kQ="./fonts/Xiaolai/Xiaolai-Regular-58fd02350d0bc52cf1ca3bb32ce9766e.woff2",TQ="./fonts/Xiaolai/Xiaolai-Regular-7ccce86603f80a099ddb0cb21d4ae3e3.woff2",MQ="./fonts/Xiaolai/Xiaolai-Regular-3717077e38f98d89eae729b6c14e56dc.woff2",IQ="./fonts/Xiaolai/Xiaolai-Regular-dbea1af6dcd9860be40c3d18254338f5.woff2",AQ="./fonts/Xiaolai/Xiaolai-Regular-4a0fdb40036e87b40aa08dd30584cb85.woff2",LQ="./fonts/Xiaolai/Xiaolai-Regular-0f626226ba1272e832aea87bafd9720e.woff2",RQ="./fonts/Xiaolai/Xiaolai-Regular-938d90c10ff8c20386af7f242c05d6b0.woff2",DQ="./fonts/Xiaolai/Xiaolai-Regular-b6d128682ee29e471486354d486a1b90.woff2",jQ="./fonts/Xiaolai/Xiaolai-Regular-e51ef413167c6e14e0c0fdcc585f2fc9.woff2",PQ="./fonts/Xiaolai/Xiaolai-Regular-9d81066dd2b337c938df6e90380a00dc.woff2",NQ="./fonts/Xiaolai/Xiaolai-Regular-20e7bf72fa05de9adf7dbcc7bf51dde6.woff2",OQ="./fonts/Xiaolai/Xiaolai-Regular-4095eb84ef3874e2600247bee0b04026.woff2",FQ="./fonts/Xiaolai/Xiaolai-Regular-4ee10ae43505e2e0bc62656ced49c0fa.woff2",$Q="./fonts/Xiaolai/Xiaolai-Regular-7494dc504ae00ee9cd0505f990f88c5d.woff2",BQ="./fonts/Xiaolai/Xiaolai-Regular-8de5b863cb50dfefdd07cb11c774d579.woff2",zQ="./fonts/Xiaolai/Xiaolai-Regular-3e1f8f654357353bf0e04ba5c34b5f7f.woff2",HQ="./fonts/Xiaolai/Xiaolai-Regular-2e33e8dc771ef5e1d9127d60a6b73679.woff2",WQ="./fonts/Xiaolai/Xiaolai-Regular-173945821411c09f70c95f98d590e697.woff2",XQ="./fonts/Xiaolai/Xiaolai-Regular-b358f7a51ece39a3247942b1feabdb29.woff2",VQ="./fonts/Xiaolai/Xiaolai-Regular-23ad2d71b280f00b1363b95b7bea94eb.woff2",YQ="./fonts/Xiaolai/Xiaolai-Regular-5882ffa04f32584d26109137e2da4352.woff2",GQ="./fonts/Xiaolai/Xiaolai-Regular-a203b91dad570bf05a58c3c3ddb529bf.woff2",qQ="./fonts/Xiaolai/Xiaolai-Regular-bd77e3c7f9e0b072d96af37f73d1aa32.woff2",ZQ="./fonts/Xiaolai/Xiaolai-Regular-5a45d991244d4c7140217e1e5f5ca4f4.woff2",KQ="./fonts/Xiaolai/Xiaolai-Regular-f56414bf9bced67990def8660e306759.woff2",QQ="./fonts/Xiaolai/Xiaolai-Regular-583d166e56ba0de4b77eabb47ef67839.woff2",JQ="./fonts/Xiaolai/Xiaolai-Regular-7f855356ab893b0d2b9c1c83b8116f0e.woff2",eJ="./fonts/Xiaolai/Xiaolai-Regular-b57aaedfd8ebdf3931f25119dc6a5eb2.woff2",tJ="./fonts/Xiaolai/Xiaolai-Regular-b6fd38ca30869792244804b04bc058da.woff2",nJ="./fonts/Xiaolai/Xiaolai-Regular-452225341522a7942f0f6aab1a5c91a3.woff2",rJ="./fonts/Xiaolai/Xiaolai-Regular-866fa7613df6b3fd272bcfd4530c0bb9.woff2",iJ="./fonts/Xiaolai/Xiaolai-Regular-52a84a22fd1369bffeaf21da2d6158dc.woff2",aJ="./fonts/Xiaolai/Xiaolai-Regular-829615148e6357d826b9242eb7fbbd1e.woff2",sJ="./fonts/Xiaolai/Xiaolai-Regular-c99eda15fc26a2941579560f76c3a5cf.woff2",oJ="./fonts/Xiaolai/Xiaolai-Regular-395c35dd584b56b0789f58a0559beaf1.woff2",lJ="./fonts/Xiaolai/Xiaolai-Regular-203b0e569e3b14aac86a003dc3fa523e.woff2",cJ="./fonts/Xiaolai/Xiaolai-Regular-51a0e808bbc8361236ac521a119758a3.woff2",dJ="./fonts/Xiaolai/Xiaolai-Regular-6e092f71c1e634059ada0e52abadce67.woff2",uJ="./fonts/Xiaolai/Xiaolai-Regular-0f7fb1e0d5015bb1371343153ecf7ce3.woff2",hJ="./fonts/Xiaolai/Xiaolai-Regular-d0cf73942fea1c74edbdf0b3011f4656.woff2",fJ="./fonts/Xiaolai/Xiaolai-Regular-968cffdc8ee679da094e77ebf50f58ef.woff2",pJ="./fonts/Xiaolai/Xiaolai-Regular-7a07ddc0f0c0f5f4a9bad6ee3dda66b5.woff2",mJ="./fonts/Xiaolai/Xiaolai-Regular-ec181b795ac1fb5a50d700b6e996d745.woff2",gJ="./fonts/Xiaolai/Xiaolai-Regular-cfb211578629b7e8153b37240de6a9d5.woff2",UJ="./fonts/Xiaolai/Xiaolai-Regular-59e9ff77b0efaf684bc09274fb6908c9.woff2",bJ="./fonts/Xiaolai/Xiaolai-Regular-2adbc89c11e65905393d3dfc468b9d5b.woff2",yJ="./fonts/Xiaolai/Xiaolai-Regular-70e811fd7994e61f408c923de6ddd078.woff2",vJ="./fonts/Xiaolai/Xiaolai-Regular-c4a687ac4f0c2766eefc9f77ed99cddf.woff2",xJ="./fonts/Xiaolai/Xiaolai-Regular-51502f1206be09c565f1547c406e9558.woff2",wJ="./fonts/Xiaolai/Xiaolai-Regular-1fdc0c67ed57263a80fd108c1f6ccf24.woff2",EJ="./fonts/Xiaolai/Xiaolai-Regular-e11567fd2accf9957cd0d3c2be937d87.woff2",CJ="./fonts/Xiaolai/Xiaolai-Regular-20cc1bbf50e7efb442756cb605672c1f.woff2",SJ="./fonts/Xiaolai/Xiaolai-Regular-5d2898fbc097a7e24c6f38d80587621e.woff2",_J="./fonts/Xiaolai/Xiaolai-Regular-ac9ceb44437becc3e9c4dbfebab7fc2d.woff2",kJ="./fonts/Xiaolai/Xiaolai-Regular-c16ed9740b85badf16e86ea782a3062f.woff2",TJ="./fonts/Xiaolai/Xiaolai-Regular-aa0d470430e6391eca720c7cfa44446f.woff2",MJ="./fonts/Xiaolai/Xiaolai-Regular-f2b54d4e7be0eaefe1c2c56836fa5368.woff2",IJ="./fonts/Xiaolai/Xiaolai-Regular-99a16ef6a64934d5781933dbd9c46b2e.woff2",AJ="./fonts/Xiaolai/Xiaolai-Regular-c40533fdf4cc57177b12803598af7e59.woff2",LJ="./fonts/Xiaolai/Xiaolai-Regular-91ddb2969bf2d31ba02ad82998d1314c.woff2",RJ="./fonts/Xiaolai/Xiaolai-Regular-774d4f764a1299da5d28ec2f2ffe0d69.woff2",DJ="./fonts/Xiaolai/Xiaolai-Regular-7718fe60986d8b42b1be9c5ace5ccf25.woff2",jJ="./fonts/Xiaolai/Xiaolai-Regular-aa5c9ca6cf4fba00433b7aa3fa10671a.woff2",PJ="./fonts/Xiaolai/Xiaolai-Regular-4f50e5136e136527280bc902c5817561.woff2",NJ="./fonts/Xiaolai/Xiaolai-Regular-093b9ef39a46ceae95a1df18a0a3a326.woff2",OJ="./fonts/Xiaolai/Xiaolai-Regular-a0ca5df4258213d7fc9fce80f65ce760.woff2",FJ="./fonts/Xiaolai/Xiaolai-Regular-d2666cbed13462c5dc36fa2f15c202ca.woff2",$J="./fonts/Xiaolai/Xiaolai-Regular-1e6fd68f1f3902ce48ce8c69df385622.woff2",BJ="./fonts/Xiaolai/Xiaolai-Regular-87599f94b6cc129d505b375798d0d751.woff2",zJ="./fonts/Xiaolai/Xiaolai-Regular-06c77b8c66e51ed6c63ccb502dd8b8af.woff2",HJ="./fonts/Xiaolai/Xiaolai-Regular-13ae07ed2e272d26d59bc0691cd7117a.woff2",WJ="./fonts/Xiaolai/Xiaolai-Regular-353f33792a8f60dc69323ddf635a269e.woff2",XJ="./fonts/Xiaolai/Xiaolai-Regular-0facdf1ea213ba40261022f5d5ed4493.woff2",VJ="./fonts/Xiaolai/Xiaolai-Regular-f8ee5d36068a42b51d0e4a1116cfcec1.woff2",YJ="./fonts/Xiaolai/Xiaolai-Regular-79d494361ae093b69e74ee9dbe65bfd4.woff2",GJ="./fonts/Xiaolai/Xiaolai-Regular-74e2263a91439c25b91d5132ce9f4d62.woff2",qJ="./fonts/Xiaolai/Xiaolai-Regular-ee8bae97908d5147b423f77ad0d3c1bb.woff2",ZJ="./fonts/Xiaolai/Xiaolai-Regular-56467a5c8840c4d23a60b2f935114848.woff2",KJ="./fonts/Xiaolai/Xiaolai-Regular-145aa02cdd91946e67dc934e1acffe75.woff2",QJ="./fonts/Xiaolai/Xiaolai-Regular-54acdfc2166ad7fcbd074f75fd4a56ba.woff2",JJ="./fonts/Xiaolai/Xiaolai-Regular-29cec36cd205b211da97acabaa62f055.woff2",eee="./fonts/Xiaolai/Xiaolai-Regular-3756e81d3e149cf6099163ee79944fec.woff2",tee="./fonts/Xiaolai/Xiaolai-Regular-8e9f97f01034820170065b2921b4fb5e.woff2",nee="./fonts/Xiaolai/Xiaolai-Regular-13d2887ec8ee73c43acdabc52a05af7b.woff2",ree="./fonts/Xiaolai/Xiaolai-Regular-72536a3d71b694a0d53dd90ddceae41e.woff2",iee="./fonts/Xiaolai/Xiaolai-Regular-603aefd23e350ba7eb124273e3c9bcf1.woff2",aee="./fonts/Xiaolai/Xiaolai-Regular-095c169f3314805276f603a362766abd.woff2",see="./fonts/Xiaolai/Xiaolai-Regular-9544732d2e62d1a429674f8ee41b5d3a.woff2",oee="./fonts/Xiaolai/Xiaolai-Regular-d3716376641d615e2995605b29bca7b6.woff2",lee="./fonts/Xiaolai/Xiaolai-Regular-5a1ce3117cfe90c48e8fb4a9a00f694d.woff2",cee="./fonts/Xiaolai/Xiaolai-Regular-b7d203b051eff504ff59ddca7576b6a9.woff2",dee="./fonts/Xiaolai/Xiaolai-Regular-4a38cc3e9cf104e69ba246d37f8cf135.woff2",uee="./fonts/Xiaolai/Xiaolai-Regular-982b630266d87db93d2539affb1275c6.woff2",hee="./fonts/Xiaolai/Xiaolai-Regular-9592bfc861f07bcb8d75c196b370e548.woff2",fee="./fonts/Xiaolai/Xiaolai-Regular-a7accba310e821da5505f71c03b76bdb.woff2",pee="./fonts/Xiaolai/Xiaolai-Regular-dac48066b5883d8b4551fc584f0c2a3e.woff2",mee="./fonts/Xiaolai/Xiaolai-Regular-a1f916d6039285c4ffb900cd654e418f.woff2",gee="./fonts/Xiaolai/Xiaolai-Regular-95bfd249da4902577b4b7d76ebdd0b44.woff2",Uee="./fonts/Xiaolai/Xiaolai-Regular-93fc8f28a33234bcadf1527cafabd502.woff2",bee="./fonts/Xiaolai/Xiaolai-Regular-903bb6865f3452e2fda42e3a25547bc5.woff2",yee="./fonts/Xiaolai/Xiaolai-Regular-4aca6a43e59aceee2166b0c7e4e85ef1.woff2",vee="./fonts/Xiaolai/Xiaolai-Regular-24476a126f129212beb33f66853ea151.woff2",xee="./fonts/Xiaolai/Xiaolai-Regular-1b611157cd46bb184d4fa4dae2d6a2b8.woff2",wee="./fonts/Xiaolai/Xiaolai-Regular-56a32a7689abd0326e57c10c6c069bb4.woff2",Eee="./fonts/Xiaolai/Xiaolai-Regular-3cc70dbb64df5b21f1326cc24dee2195.woff2",Cee="./fonts/Xiaolai/Xiaolai-Regular-f6032fc06eb20480f096199713f70885.woff2",See="./fonts/Xiaolai/Xiaolai-Regular-e2ead7ea7da0437f085f42ffc05f8d13.woff2",_ee="./fonts/Xiaolai/Xiaolai-Regular-97f7f48ce90c9429bf32ae51469db74d.woff2",kee="./fonts/Xiaolai/Xiaolai-Regular-24a21c1e4449222e8d1898d69ff3a404.woff2",Tee="./fonts/Xiaolai/Xiaolai-Regular-726303e0774b4e678bff8c2deb6ca603.woff2",Mee="./fonts/Xiaolai/Xiaolai-Regular-5a7fac4b8b23a6e4e5ba0c9bf1756c91.woff2",Iee="./fonts/Xiaolai/Xiaolai-Regular-2b7441d46298788ac94e610ffcc709b6.woff2",Aee=[{uri:OZ,descriptors:{unicodeRange:"U+f9b8-fa6d,U+fe32,U+fe45-fe4f,U+ff02-ff0b,U+ff0d-ff1e,U+ff20-ff2a"}},{uri:FZ,descriptors:{unicodeRange:"U+20dd-20de,U+25ef,U+ff2b-ffbe,U+ffc2-ffc7,U+ffca-ffcf,U+ffd2-ffd7,U+ffda-ffdc,U+ffe0-ffe6,U+ffe8-ffee"}},{uri:$Z,descriptors:{unicodeRange:"U+d7eb-d7fb,U+f900-f9b7"}},{uri:BZ,descriptors:{unicodeRange:"U+d6f2-d7a3,U+d7b0-d7c6,U+d7cb-d7ea"}},{uri:zZ,descriptors:{unicodeRange:"U+d609-d6f1"}},{uri:HZ,descriptors:{unicodeRange:"U+d520-d608"}},{uri:WZ,descriptors:{unicodeRange:"U+d437-d51f"}},{uri:XZ,descriptors:{unicodeRange:"U+d34e-d436"}},{uri:VZ,descriptors:{unicodeRange:"U+d265-d34d"}},{uri:YZ,descriptors:{unicodeRange:"U+d17c-d264"}},{uri:GZ,descriptors:{unicodeRange:"U+d093-d17b"}},{uri:qZ,descriptors:{unicodeRange:"U+cfaa-d092"}},{uri:ZZ,descriptors:{unicodeRange:"U+cec1-cfa9"}},{uri:KZ,descriptors:{unicodeRange:"U+cdd8-cec0"}},{uri:QZ,descriptors:{unicodeRange:"U+ccf1-cdd7"}},{uri:JZ,descriptors:{unicodeRange:"U+cc08-ccf0"}},{uri:eK,descriptors:{unicodeRange:"U+cb43-cc07"}},{uri:tK,descriptors:{unicodeRange:"U+ca83-cb42"}},{uri:nK,descriptors:{unicodeRange:"U+c9a1-ca82"}},{uri:rK,descriptors:{unicodeRange:"U+c8b8-c9a0"}},{uri:iK,descriptors:{unicodeRange:"U+c7cf-c8b7"}},{uri:aK,descriptors:{unicodeRange:"U+c6e6-c7ce"}},{uri:sK,descriptors:{unicodeRange:"U+c5fd-c6e5"}},{uri:oK,descriptors:{unicodeRange:"U+c514-c5fc"}},{uri:lK,descriptors:{unicodeRange:"U+c42b-c513"}},{uri:cK,descriptors:{unicodeRange:"U+c341-c34e,U+c350-c42a"}},{uri:dK,descriptors:{unicodeRange:"U+c258-c340"}},{uri:uK,descriptors:{unicodeRange:"U+c16f-c257"}},{uri:hK,descriptors:{unicodeRange:"U+c086-c16e"}},{uri:fK,descriptors:{unicodeRange:"U+bf9d-c085"}},{uri:pK,descriptors:{unicodeRange:"U+beb4-bf9c"}},{uri:mK,descriptors:{unicodeRange:"U+bdcb-beb3"}},{uri:gK,descriptors:{unicodeRange:"U+bce2-bdca"}},{uri:UK,descriptors:{unicodeRange:"U+bbf9-bce1"}},{uri:bK,descriptors:{unicodeRange:"U+bb10-bbf8"}},{uri:yK,descriptors:{unicodeRange:"U+ba27-bb0f"}},{uri:vK,descriptors:{unicodeRange:"U+b93e-ba26"}},{uri:xK,descriptors:{unicodeRange:"U+b855-b93d"}},{uri:wK,descriptors:{unicodeRange:"U+b76c-b854"}},{uri:EK,descriptors:{unicodeRange:"U+b683-b76b"}},{uri:CK,descriptors:{unicodeRange:"U+b59a-b682"}},{uri:SK,descriptors:{unicodeRange:"U+b4b1-b599"}},{uri:_K,descriptors:{unicodeRange:"U+11fb-11ff,U+b3cd-b4b0"}},{uri:kK,descriptors:{unicodeRange:"U+11e6-11fa,U+b2f9-b3cc"}},{uri:TK,descriptors:{unicodeRange:"U+11d1-11e5,U+b225-b2f8"}},{uri:MK,descriptors:{unicodeRange:"U+11bc-11d0,U+b151-b224"}},{uri:IK,descriptors:{unicodeRange:"U+11a7-11bb,U+b07d-b150"}},{uri:AK,descriptors:{unicodeRange:"U+1191-11a6,U+afaa-b07c"}},{uri:LK,descriptors:{unicodeRange:"U+117c-1190,U+aed6-afa9"}},{uri:RK,descriptors:{unicodeRange:"U+1167-117b,U+ae02-aed5"}},{uri:DK,descriptors:{unicodeRange:"U+1152-115e,U+1160-1166,U+ad2d-ae01"}},{uri:jK,descriptors:{unicodeRange:"U+113d-1151,U+ac59-ad2c"}},{uri:PK,descriptors:{unicodeRange:"U+1100-113c,U+9f95-9f98,U+9f9c-9f9e,U+9fa1-9fce,U+9fd0,U+a960-a97c,U+ac00-ac58"}},{uri:NK,descriptors:{unicodeRange:"U+9771-9772,U+9775,U+9777-977b,U+977d-9784,U+9786-978a,U+978c,U+978e-9790,U+9793,U+9795-9797,U+9799-979f,U+97a1-97a2,U+97a4-97aa,U+97ac,U+97ae,U+97b0-97b1,U+97b3,U+97b5-97e5,U+97e8,U+97ee-97f2,U+97f4,U+97f7-982d"}},{uri:OK,descriptors:{unicodeRange:"U+9491,U+9496,U+9498,U+94c7,U+94cf,U+94d3-94d4,U+94da,U+94e6,U+94fb,U+951c,U+9520,U+9527,U+9533,U+953d,U+9543,U+9548,U+954b,U+9555,U+955a,U+9560,U+956e,U+9574-9575,U+9577-957e,U+9580-95e7,U+95ec,U+95ff,U+9607,U+9613,U+9618,U+961b,U+961e,U+9620,U+9623-9629,U+962b-962d,U+962f-9630,U+9637-963a,U+963e,U+9641,U+9643,U+964a,U+964e-964f,U+9651-9653,U+9656-965a,U+965c-965e,U+9660,U+9663,U+9665-9666,U+966b,U+966d-9671,U+9673,U+9678-9684,U+9687,U+9689-968a,U+968c,U+968e,U+9691-9693"}},{uri:FK,descriptors:{unicodeRange:"U+923c-9273,U+9275-928d,U+928f-92ad,U+92af-92c7,U+92c9-92ee"}},{uri:$K,descriptors:{unicodeRange:"U+9159,U+915b-915c,U+915f-9160,U+9166-9168,U+916b,U+916d,U+9173,U+917a-917c,U+9180-9184,U+9186,U+9188,U+918a,U+918e-918f,U+9193-9199,U+919c-91a1,U+91a4-91a9,U+91ab-91ac,U+91b0-91b3,U+91b6-91b9,U+91bb-91c6,U+91c8,U+91cb,U+91d0,U+91d2-91db,U+91dd-923b"}},{uri:BK,descriptors:{unicodeRange:"U+902b-902c,U+9030-9034,U+9037,U+9039-903a,U+903d,U+903f-9040,U+9043,U+9045-9046,U+9048-904c,U+904e,U+9054-9056,U+9059-905a,U+905c-9061,U+9064,U+9066-9067,U+9069-906c,U+906f-9073,U+9076-907c,U+907e,U+9081,U+9084-9087,U+9089-908a,U+908c-9090,U+9092,U+9094,U+9096,U+9098,U+909a,U+909c,U+909e-90a0,U+90a4-90a5,U+90a7-90a9,U+90ab,U+90ad,U+90b2,U+90b7,U+90bc-90bd,U+90bf-90c0,U+90c2-90c3,U+90c6,U+90c8-90c9,U+90cb-90cd,U+90d2,U+90d4-90d6,U+90d8-90da,U+90de-90e0,U+90e3-90e5,U+90e9-90ea,U+90ec,U+90ee,U+90f0-90f3,U+90f5-90f7,U+90f9-90fc,U+90ff-9101,U+9103,U+9105-9118,U+911a-911d,U+911f-9121,U+9124-912e,U+9130,U+9132-9138,U+913a-9142,U+9144-9145,U+9147-9148,U+9151,U+9153-9156,U+9158"}},{uri:zK,descriptors:{unicodeRange:"U+8f03-8f65,U+8f6a,U+8f80,U+8f8c,U+8f92,U+8f9d,U+8fa0-8fa2,U+8fa4-8fa7,U+8faa,U+8fac-8faf,U+8fb2-8fb5,U+8fb7-8fb8,U+8fba-8fbc,U+8fbf-8fc0,U+8fc3,U+8fc6,U+8fc9-8fcd,U+8fcf,U+8fd2,U+8fd6-8fd7,U+8fda,U+8fe0-8fe1,U+8fe3,U+8fe7,U+8fec,U+8fef,U+8ff1-8ff2,U+8ff4-8ff6,U+8ffa-8ffc,U+8ffe-8fff,U+9007-9008,U+900c,U+900e,U+9013,U+9015,U+9018-9019,U+901c,U+9023-9025,U+9027-902a"}},{uri:HK,descriptors:{unicodeRange:"U+8d03-8d1c,U+8d20,U+8d51-8d52,U+8d57,U+8d5f,U+8d65,U+8d68-8d6a,U+8d6c,U+8d6e-8d6f,U+8d71-8d72,U+8d78-8d80,U+8d82-8d83,U+8d86-8d89,U+8d8c-8d90,U+8d92-8d93,U+8d95-8d9e,U+8da0-8da2,U+8da4-8db0,U+8db2,U+8db6-8db7,U+8db9,U+8dbb,U+8dbd,U+8dc0-8dc2,U+8dc5,U+8dc7-8dca,U+8dcd,U+8dd0,U+8dd2-8dd5,U+8dd8-8dd9,U+8ddc,U+8de0-8de2,U+8de5-8de7,U+8de9,U+8ded-8dee,U+8df0-8df2,U+8df4,U+8df6,U+8dfc,U+8dfe-8e04,U+8e06-8e08,U+8e0b,U+8e0d-8e0e,U+8e10-8e13,U+8e15-8e1c,U+8e20-8e21,U+8e24-8e28,U+8e2b,U+8e2d,U+8e30,U+8e32-8e34,U+8e36-8e38,U+8e3b-8e3c,U+8e3e-8e3f,U+8e43,U+8e45-8e46"}},{uri:WK,descriptors:{unicodeRange:"U+8bea,U+8c09,U+8c1e,U+8c38-8c40,U+8c42-8c45,U+8c48,U+8c4a-8c4b,U+8c4d-8c54,U+8c56-8c59,U+8c5b-8c60,U+8c63-8c69,U+8c6c-8c72,U+8c74-8c77,U+8c7b-8c81,U+8c83-8c84,U+8c86-8c88,U+8c8b,U+8c8d-8c93,U+8c95-8c97,U+8c99-8d02"}},{uri:XK,descriptors:{unicodeRange:"U+8a64-8a78,U+8a7a-8a88,U+8a8b-8a92,U+8a94-8b06,U+8b08-8b1b"}},{uri:VK,descriptors:{unicodeRange:"U+8987-89c0,U+89c3,U+89cd,U+89d3-89d5,U+89d7-89d9,U+89db,U+89dd,U+89df-89e2,U+89e4,U+89e7-89ea,U+89ec-89ee,U+89f0-89f2,U+89f4-89ff,U+8a01-8a06,U+8a08-8a3d,U+8a3f-8a47,U+8a49-8a63"}},{uri:YK,descriptors:{unicodeRange:"U+87e3-87e4,U+87e6-87e9,U+87eb-87ed,U+87ef-87f8,U+87fa-87fd,U+87ff-8802,U+8804-8809,U+880b-8812,U+8814,U+8817-881a,U+881c-8820,U+8823-8831,U+8833-8838,U+883a-883b,U+883d-883f,U+8841-8843,U+8846-884b,U+884e-8853,U+8855-8856,U+8858,U+885a-8860,U+8866-8867,U+886a,U+886d,U+886f,U+8871,U+8873-8876,U+8878-887c,U+8880,U+8883,U+8886-8887,U+8889-888a,U+888c,U+888e-8891,U+8893-8895,U+8897-889b,U+889d-88a1,U+88a3,U+88a5-88aa,U+88ac,U+88ae-88b0,U+88b2-88b6,U+88b8-88bb"}},{uri:GK,descriptors:{unicodeRange:"U+86e7-86e8,U+86ea-86ec,U+86ef,U+86f5-86f7,U+86fa-86fd,U+86ff,U+8701,U+8704-8706,U+870b-870c,U+870e-8711,U+8714,U+8716,U+8719,U+871b,U+871d,U+871f-8720,U+8724,U+8726-8728,U+872a-872d,U+872f-8730,U+8732-8733,U+8735-8736,U+8738-873a,U+873c-873d,U+8740-8746,U+874a-874b,U+874d,U+874f-8752,U+8754-8756,U+8758,U+875a-875f,U+8761-8762,U+8766-876d,U+876f,U+8771-8773,U+8775,U+8777-877a,U+877f-8781,U+8784,U+8786-8787,U+8789-878a,U+878c,U+878e-8792,U+8794-8796,U+8798-879e,U+87a0-87a7,U+87a9-87aa,U+87ae,U+87b0-87b2,U+87b4,U+87b6-87b9,U+87bb-87bc,U+87be-87bf,U+87c1-87c5,U+87c7-87c9,U+87cc-87d0,U+87d4-87da,U+87dc-87df,U+87e1-87e2"}},{uri:qK,descriptors:{unicodeRange:"U+8604,U+8606-8610,U+8612-8615,U+8617-8626,U+8628,U+862a-8637,U+8639-863b,U+863d-864c,U+8652-8653,U+8655-8659,U+865b-865d,U+865f-8661,U+8663-866a,U+866d,U+866f-8670,U+8672-8678,U+8683-8689,U+868e-8692,U+8694,U+8696-869b,U+869e-86a2,U+86a5-86a6,U+86ab,U+86ad-86ae,U+86b2-86b3,U+86b7-86b9,U+86bb-86bf,U+86c1-86c3,U+86c5,U+86c8,U+86cc-86cd,U+86d2-86d3,U+86d5-86d7,U+86da,U+86dc-86dd,U+86e0-86e3,U+86e5-86e6"}},{uri:ZK,descriptors:{unicodeRange:"U+8456,U+8458,U+845d-8460,U+8462,U+8464-8468,U+846a,U+846e-8470,U+8472,U+8474,U+8477,U+8479,U+847b-8481,U+8483-8486,U+848a,U+848d,U+848f-8496,U+8498,U+849a-849b,U+849d-84a0,U+84a2-84ae,U+84b0-84b1,U+84b3,U+84b5-84b7,U+84bb-84bc,U+84be,U+84c0,U+84c2-84c3,U+84c5-84c8,U+84cb-84cc,U+84ce-84cf,U+84d2,U+84d4-84d5,U+84d7-84dc,U+84de,U+84e1-84e2,U+84e4,U+84e7-84eb,U+84ed-84ef,U+84f1-84fb,U+84fd-84fe,U+8500-850b,U+850d-8510,U+8512,U+8514-8516,U+8518-8519,U+851b-851e,U+8520,U+8522-852a,U+852d-8536,U+853e-8542,U+8544-8547,U+854b-854f"}},{uri:KK,descriptors:{unicodeRange:"U+82c2-82c3,U+82c5-82c6,U+82c9,U+82d0,U+82d6,U+82d9-82da,U+82dd,U+82e2,U+82e7-82ea,U+82ec-82ee,U+82f0,U+82f2-82f3,U+82f5-82f6,U+82f8,U+82fa,U+82fc-8300,U+830a-830b,U+830d,U+8310,U+8312-8313,U+8316,U+8318-8319,U+831d-8326,U+8329-832a,U+832e,U+8330,U+8332,U+8337,U+833b,U+833d-833f,U+8341-8342,U+8344-8345,U+8348,U+834a-834e,U+8353,U+8355-8359,U+835d,U+8362,U+8370-8376,U+8379-837a,U+837e-8384,U+8387-8388,U+838a-838d,U+838f-8391,U+8394-8397,U+8399-839a,U+839d,U+839f,U+83a1-83a7,U+83ac-83af,U+83b5,U+83bb,U+83be-83bf,U+83c2-83c4,U+83c6,U+83c8-83c9,U+83cb,U+83cd-83ce,U+83d0-83d3,U+83d5,U+83d7,U+83d9-83db,U+83de,U+83e2-83e4,U+83e6-83e8,U+83eb-83ef,U+83f3-83f7,U+83fa-83fc,U+83fe-8400,U+8402,U+8405,U+8407-840a,U+8410,U+8412-8417,U+8419-841b,U+841e-8423,U+8429-8430,U+8432-8437,U+8439-843b,U+843e-8445,U+8447-8450,U+8452-8455"}},{uri:QK,descriptors:{unicodeRange:"U+81a4-81a5,U+81a7,U+81a9,U+81ab-81b2,U+81b4-81b9,U+81bc-81bf,U+81c4-81c5,U+81c7-81c9,U+81cb,U+81cd-81e2,U+81e4-81e6,U+81e8-81e9,U+81eb,U+81ee-81f2,U+81f5-81fa,U+81fd,U+81ff,U+8203,U+8207-820b,U+820e-820f,U+8211,U+8213,U+8215-821a,U+821d,U+8220,U+8224-8227,U+8229,U+822e,U+8232,U+823a,U+823c-823d,U+823f-8243,U+8245-8246,U+8248,U+824a,U+824c-824e,U+8250-8257,U+8259,U+825b-825e,U+8260-8267,U+8269-826d,U+8271,U+8275-8278,U+827b-827c,U+8280-8281,U+8283,U+8285-8287,U+8289,U+828c,U+8290,U+8293-8296,U+829a-829b,U+829e,U+82a0,U+82a2-82a3,U+82a7,U+82b2,U+82b5-82b6,U+82ba-82bc,U+82bf-82c0"}},{uri:JK,descriptors:{unicodeRange:"U+8059,U+805b-8068,U+806b-8070,U+8072-807e,U+8081-8082,U+8085,U+8088,U+808a,U+808d-8092,U+8094-8095,U+8097,U+8099,U+809e,U+80a3,U+80a6-80a8,U+80ac,U+80b0,U+80b3,U+80b5-80b6,U+80b8-80b9,U+80bb,U+80c5,U+80c7-80cb,U+80cf-80d5,U+80d8,U+80df-80e0,U+80e2-80e3,U+80e6,U+80ee,U+80f5,U+80f7,U+80f9,U+80fb,U+80fe-8101,U+8103-8105,U+8107-8108,U+810b-810c,U+8115,U+8117,U+8119,U+811b-811d,U+811f-812b,U+812d-812e,U+8130,U+8133-8135,U+8137,U+8139-813d,U+813f-8145,U+8147,U+8149,U+814d-814f,U+8152,U+8156-8158,U+815b-815f,U+8161-8164,U+8166,U+8168,U+816a-816c,U+816f,U+8172-8173,U+8175-8178,U+8181,U+8183-8187,U+8189,U+818b-818e,U+8190,U+8192-8197,U+8199-819a,U+819e-81a2"}},{uri:eQ,descriptors:{unicodeRange:"U+7f3c-7f41,U+7f43,U+7f46-7f4f,U+7f52-7f53,U+7f56,U+7f59,U+7f5b-7f5e,U+7f60,U+7f63-7f67,U+7f6b-7f6d,U+7f6f-7f70,U+7f73,U+7f75-7f78,U+7f7a-7f7d,U+7f7f-7f80,U+7f82-7f89,U+7f8b,U+7f8d,U+7f8f-7f93,U+7f95-7f99,U+7f9b-7f9c,U+7fa0,U+7fa2-7fa3,U+7fa5-7fa6,U+7fa8-7fae,U+7fb1,U+7fb3-7fb7,U+7fba-7fbb,U+7fbe,U+7fc0,U+7fc2-7fc4,U+7fc6-7fc9,U+7fcb,U+7fcd,U+7fcf-7fd3,U+7fd6-7fd7,U+7fd9-7fde,U+7fe2-7fe4,U+7fe7-7fe8,U+7fea-7fed,U+7fef,U+7ff2,U+7ff4-7ffa,U+7ffd-7fff,U+8002,U+8007-800a,U+800e-800f,U+8011,U+8013,U+801a-801b,U+801d-801f,U+8021,U+8023-8024,U+802b-8030,U+8032,U+8034,U+8039-803a,U+803c,U+803e,U+8040-8041,U+8044-8045,U+8047-8049,U+804e-8051,U+8053,U+8055-8057"}},{uri:tQ,descriptors:{unicodeRange:"U+7cd8,U+7cda-7cdb,U+7cdd-7cde,U+7ce1-7ce7,U+7ce9-7cee,U+7cf0-7cf7,U+7cf9-7cfa,U+7cfc-7d09,U+7d0b-7d1f,U+7d21,U+7d23-7d26,U+7d28-7d2a,U+7d2c-7d2e,U+7d30-7d6d,U+7d6f-7d76,U+7d78-7d94"}},{uri:nQ,descriptors:{unicodeRange:"U+7afe,U+7b00-7b02,U+7b05,U+7b07,U+7b09,U+7b0c-7b0e,U+7b10,U+7b12-7b13,U+7b16-7b18,U+7b1a,U+7b1c-7b1d,U+7b1f,U+7b21-7b23,U+7b27,U+7b29,U+7b2d,U+7b2f-7b30,U+7b32,U+7b34-7b37,U+7b39,U+7b3b,U+7b3d,U+7b3f-7b44,U+7b46,U+7b48,U+7b4a,U+7b4d-7b4e,U+7b53,U+7b55,U+7b57,U+7b59,U+7b5c,U+7b5e-7b5f,U+7b61,U+7b63-7b6d,U+7b6f-7b70,U+7b73-7b74,U+7b76,U+7b78,U+7b7a,U+7b7c-7b7d,U+7b7f,U+7b81-7b84,U+7b86-7b8c,U+7b8e-7b8f,U+7b91-7b93,U+7b96,U+7b98-7b9b,U+7b9e-7ba0,U+7ba3-7ba5,U+7bae-7bb0,U+7bb2-7bb3,U+7bb5-7bb7,U+7bb9-7bc0,U+7bc2-7bc5,U+7bc8-7bcb,U+7bcd-7bd0,U+7bd2,U+7bd4-7bd8,U+7bdb-7bdc,U+7bde-7be0,U+7be2-7be4,U+7be7-7be9,U+7beb-7bed,U+7bef-7bf0,U+7bf2-7bf6,U+7bf8-7bfb,U+7bfd,U+7bff-7c06,U+7c08-7c0a,U+7c0d-7c0e,U+7c10-7c13"}},{uri:rQ,descriptors:{unicodeRange:"U+7a10-7a13,U+7a15-7a16,U+7a18-7a19,U+7a1b-7a1d,U+7a1f,U+7a21-7a22,U+7a24-7a32,U+7a34-7a36,U+7a38,U+7a3a,U+7a3e,U+7a40-7a45,U+7a47-7a50,U+7a52-7a56,U+7a58-7a6f,U+7a71-7a73,U+7a75,U+7a7b-7a7e,U+7a82,U+7a85,U+7a87,U+7a89-7a8c,U+7a8e-7a90,U+7a93-7a94,U+7a99-7a9b,U+7a9e,U+7aa1-7aa4,U+7aa7,U+7aa9-7aab,U+7aae-7ab2,U+7ab4-7abe,U+7ac0-7aca,U+7acc-7ad5,U+7ad7-7ad8,U+7ada-7add,U+7ae1-7ae2,U+7ae4,U+7ae7-7aec,U+7aee,U+7af0-7af8,U+7afb-7afc"}},{uri:iQ,descriptors:{unicodeRange:"U+790d-7912,U+7914-791d,U+791f-7923,U+7925-7933,U+7935-7939,U+793d,U+793f,U+7942-7945,U+7947,U+794a-7952,U+7954-7955,U+7958-7959,U+7961,U+7963-7964,U+7966,U+7969-796c,U+796e,U+7970-7976,U+7979,U+797b-797f,U+7982-7983,U+7986-7989,U+798b-798e,U+7990-7999,U+799b-79a6,U+79a8-79b2,U+79b4-79b8,U+79bc,U+79bf,U+79c2,U+79c4-79c5,U+79c7-79c8,U+79ca,U+79cc,U+79ce-79d0,U+79d3-79d4,U+79d6-79d7,U+79d9-79de,U+79e0-79e2,U+79e5,U+79e8,U+79ea,U+79ec,U+79ee,U+79f1-79f7,U+79f9-79fa,U+79fc,U+79fe-79ff,U+7a01,U+7a04-7a05,U+7a07-7a0a,U+7a0c,U+7a0f"}},{uri:aQ,descriptors:{unicodeRange:"U+77d8-77da,U+77dd-77e1,U+77e4,U+77e6,U+77e8,U+77ea,U+77ef-77f2,U+77f4-77f5,U+77f7,U+77f9-77fc,U+7803-7808,U+780a-780b,U+780e-7810,U+7813,U+7815,U+7819,U+781b,U+781e,U+7820-7822,U+7824,U+7828,U+782a-782b,U+782e-782f,U+7831-7833,U+7835-7836,U+783d,U+783f,U+7841-7844,U+7846,U+7848-784b,U+784d,U+784f,U+7851,U+7853-7854,U+7858-785c,U+785e-7869,U+786f-7876,U+7878-787b,U+787d-7886,U+7888,U+788a-788b,U+788f-7890,U+7892,U+7894-7896,U+7899,U+789d-789e,U+78a0,U+78a2,U+78a4,U+78a6,U+78a8-78af,U+78b5-78b8,U+78ba-78bd,U+78bf-78c0,U+78c2-78c4,U+78c6-78c8,U+78cc-78cf,U+78d1-78d3,U+78d6-78d8,U+78da-78e7,U+78e9-78eb,U+78ed-78f1,U+78f3,U+78f5-78f6,U+78f8-78f9,U+78fb-7900,U+7902-7904,U+7906-790c"}},{uri:sQ,descriptors:{unicodeRange:"U+76af-76b0,U+76b3,U+76b5-76be,U+76c0-76c1,U+76c3-76c4,U+76c7,U+76c9,U+76cb-76cc,U+76d3,U+76d5,U+76d9-76da,U+76dc-76de,U+76e0-76e4,U+76e6-76ed,U+76f0,U+76f3,U+76f5-76f7,U+76fa-76fb,U+76fd,U+76ff-7703,U+7705-7706,U+770a,U+770c,U+770e-7718,U+771b-771e,U+7721,U+7723-7725,U+7727,U+772a-772c,U+772e,U+7730-7734,U+7739,U+773b,U+773d-773f,U+7742,U+7744-7746,U+7748-774f,U+7752-7759,U+775c-7760,U+7764,U+7767,U+7769-776a,U+776d-7778,U+777a-777c,U+7781-7783,U+7786-778b,U+778f-7790,U+7793-779e,U+77a1,U+77a3-77a4,U+77a6,U+77a8,U+77ab,U+77ad-77af,U+77b1-77b2,U+77b4,U+77b6-77ba,U+77bc,U+77be,U+77c0-77cc,U+77ce-77d6"}},{uri:oQ,descriptors:{unicodeRange:"U+7589-758a,U+758c-758e,U+7590,U+7593,U+7595,U+7598,U+759b-759c,U+759e,U+75a2,U+75a6-75aa,U+75ad,U+75b6-75b7,U+75ba-75bb,U+75bf-75c1,U+75c6,U+75cb-75cc,U+75ce-75d1,U+75d3,U+75d7,U+75d9-75da,U+75dc-75dd,U+75df-75e1,U+75e5,U+75e9,U+75ec-75ef,U+75f2-75f3,U+75f5-75f8,U+75fa-75fb,U+75fd-75fe,U+7602,U+7604,U+7606-7609,U+760b,U+760d-760f,U+7611-7614,U+7616,U+761a,U+761c-761e,U+7621,U+7623,U+7627-7628,U+762c,U+762e-762f,U+7631-7632,U+7636-7637,U+7639-763b,U+763d,U+7641-7642,U+7644-764b,U+764e-7653,U+7655,U+7657-765b,U+765d,U+765f-7662,U+7664-766a,U+766c-766e,U+7670-7677,U+7679-767a,U+767c,U+767f-7681,U+7683,U+7685,U+7689-768a,U+768c-768d,U+768f-7690,U+7692,U+7694-7695,U+7697-7698,U+769a-76a3,U+76a5-76ad"}},{uri:lQ,descriptors:{unicodeRange:"U+7492-749b,U+749d,U+749f-74a6,U+74aa-74b9,U+74bb-74d1,U+74d3-74db,U+74dd,U+74df,U+74e1,U+74e5,U+74e7-74ed,U+74f0-74f3,U+74f5,U+74f8-74fe,U+7500-7503,U+7505-750c,U+750e,U+7510,U+7512,U+7514-7517,U+751b,U+751d-751e,U+7520-7524,U+7526-7527,U+752a,U+752e,U+7534,U+7536,U+7539,U+753c-753d,U+753f,U+7541-7544,U+7546-7547,U+7549-754a,U+754d,U+7550-7553,U+7555-7558,U+755d-7564,U+7567-7569,U+756b-7571,U+7573,U+7575-7577,U+757a-757e,U+7580-7582,U+7584-7585,U+7587-7588"}},{uri:cQ,descriptors:{unicodeRange:"U+7372-737d,U+737f-7383,U+7385-7386,U+7388,U+738a,U+738c-738d,U+738f-7390,U+7392-7395,U+7397-739a,U+739c-739e,U+73a0-73a1,U+73a3-73a8,U+73aa,U+73ac-73ad,U+73b1,U+73b4-73b6,U+73b8-73b9,U+73bc-73bf,U+73c1,U+73c3-73c7,U+73cb-73cc,U+73ce,U+73d2-73d8,U+73da-73dd,U+73df,U+73e1-73e4,U+73e6,U+73e8,U+73ea-73ec,U+73ee-73f1,U+73f3-7402,U+7404,U+7407-7408,U+740b-740e,U+7411-7419,U+741c-7421,U+7423-7424,U+7427,U+7429,U+742b,U+742d,U+742f,U+7431-7432,U+7437-743b,U+743d-7440,U+7442-7454,U+7456,U+7458,U+745d,U+7460-746c,U+746e-746f,U+7471-7475,U+7478-747d,U+747f,U+7482,U+7484-7486,U+7488-748a,U+748c-748d,U+748f,U+7491"}},{uri:dQ,descriptors:{unicodeRange:"U+7054-705d,U+705f-706a,U+706e,U+7071-7074,U+7077,U+7079-707b,U+707d,U+7081-7084,U+7086-7088,U+708b-708d,U+708f-7091,U+7093,U+7097-7098,U+709a-709b,U+709e-70aa,U+70b0,U+70b2,U+70b4-70b6,U+70ba,U+70be-70bf,U+70c4-70c7,U+70c9,U+70cb-70d7,U+70da,U+70dc-70de,U+70e0-70e3,U+70e5,U+70ea,U+70ee,U+70f0-70f6,U+70f8,U+70fa-70fc,U+70fe-7108,U+710b-710f,U+7111-7112,U+7114,U+7117,U+711b-7125,U+7127-712e,U+7132-7135,U+7137-7144,U+7146-7149,U+714b,U+714d,U+714f-715b,U+715d,U+715f-7163,U+7165,U+7169-716d,U+716f-7171,U+7174-7177"}},{uri:uQ,descriptors:{unicodeRange:"U+722e-722f,U+7232-7234,U+723a,U+723c,U+723e,U+7240-7246,U+7249-724b,U+724e-7251,U+7253-7255,U+7257-7258,U+725a,U+725c,U+725e,U+7260,U+7263-7265,U+7268,U+726a-726d,U+7270-7271,U+7273-7274,U+7276-7278,U+727b-727d,U+7282-7283,U+7285-7289,U+728c,U+728e,U+7290-7291,U+7293-729e,U+72a0-72ab,U+72ae,U+72b1-72b3,U+72b5,U+72ba-72c0,U+72c5-72c7,U+72c9-72cc,U+72cf,U+72d1,U+72d3-72d6,U+72d8,U+72da-72dd,U+72df,U+72e2-72e7,U+72ea-72eb,U+72f5-72f6,U+72f9,U+72fd-7300,U+7302,U+7304-7309,U+730b-730d,U+730f-7312,U+7314,U+7318-731a,U+731f-7320,U+7323-7324,U+7326-7328,U+732d,U+732f-7330,U+7332-7333,U+7335-7336,U+733a-733d,U+7340-734c,U+734e-734f,U+7351,U+7353-7356,U+7358-735f,U+7361-736b,U+736e,U+7370-7371"}},{uri:hQ,descriptors:{unicodeRange:"U+6ec5-6ec6,U+6ec8-6eca,U+6ecc-6ece,U+6ed0,U+6ed2,U+6ed6,U+6ed8-6ed9,U+6edb-6edd,U+6ee3,U+6ee7,U+6eea-6ef3,U+6ef5-6ef8,U+6efa-6f01,U+6f03-6f05,U+6f07-6f08,U+6f0a-6f0e,U+6f10-6f12,U+6f16-6f1f,U+6f21-6f23,U+6f25-6f28,U+6f2c,U+6f2e,U+6f30,U+6f32,U+6f34-6f35,U+6f37-6f3d,U+6f3f-6f45,U+6f48-6f4a,U+6f4c,U+6f4e-6f57,U+6f59-6f5b,U+6f5d,U+6f5f-6f61,U+6f63-6f65,U+6f67-6f6c,U+6f6f-6f71,U+6f73,U+6f75-6f77,U+6f79,U+6f7b,U+6f7d-6f83,U+6f85-6f87,U+6f8a-6f8b,U+6f8f-6f9b,U+6f9d-6fa0,U+6fa2-6fa6,U+6fa8-6fb1"}},{uri:fQ,descriptors:{unicodeRange:"U+6d73,U+6d75-6d76,U+6d79-6d7b,U+6d7d-6d81,U+6d83-6d84,U+6d86-6d87,U+6d8a-6d8b,U+6d8d,U+6d8f-6d90,U+6d92,U+6d96-6d9a,U+6d9c,U+6da2,U+6da5,U+6dac-6dad,U+6db0-6db1,U+6db3-6db4,U+6db6-6db7,U+6db9-6dbe,U+6dc1-6dc3,U+6dc8-6dca,U+6dcd-6dd0,U+6dd2-6dd5,U+6dd7,U+6dda-6ddc,U+6ddf,U+6de2-6de3,U+6de5,U+6de7-6dea,U+6ded,U+6def-6df0,U+6df2,U+6df4-6df6,U+6df8,U+6dfa,U+6dfd-6e04,U+6e06-6e09,U+6e0b,U+6e0f,U+6e12-6e13,U+6e15,U+6e18-6e19,U+6e1b-6e1c,U+6e1e-6e1f,U+6e22,U+6e26-6e28,U+6e2a,U+6e2c,U+6e2e,U+6e30-6e31,U+6e33,U+6e35-6e37,U+6e39,U+6e3b-6e42,U+6e45-6e4c,U+6e4f-6e52,U+6e55,U+6e57,U+6e59-6e5a,U+6e5c-6e5e,U+6e60-6e6a,U+6e6c-6e6d,U+6e6f-6e7d,U+6e80-6e82,U+6e84,U+6e87-6e88,U+6e8a-6e8e,U+6e91-6e97,U+6e99-6e9b,U+6e9d-6e9e,U+6ea0-6ea1,U+6ea3-6ea4,U+6ea6,U+6ea8-6ea9,U+6eab-6eae,U+6eb0,U+6eb3,U+6eb5,U+6eb8-6eb9,U+6ebc,U+6ebe-6ec0,U+6ec3-6ec4"}},{uri:pQ,descriptors:{unicodeRange:"U+6bbb-6bbe,U+6bc0,U+6bc3-6bc4,U+6bc6-6bca,U+6bcc,U+6bce,U+6bd0-6bd1,U+6bd8,U+6bda,U+6bdc-6be0,U+6be2-6be9,U+6bec-6bee,U+6bf0-6bf2,U+6bf4,U+6bf6-6bf8,U+6bfa-6bfc,U+6bfe-6c04,U+6c08-6c0c,U+6c0e,U+6c12,U+6c17,U+6c1c-6c1e,U+6c20,U+6c23,U+6c25,U+6c2b-6c2d,U+6c31,U+6c33,U+6c36-6c37,U+6c39-6c3c,U+6c3e-6c3f,U+6c43-6c45,U+6c48,U+6c4b-6c4f,U+6c51-6c53,U+6c56,U+6c58-6c5a,U+6c62-6c63,U+6c65-6c67,U+6c6b-6c6f,U+6c71,U+6c73,U+6c75,U+6c77-6c78,U+6c7a-6c7c,U+6c7f-6c80,U+6c84,U+6c87,U+6c8a-6c8b,U+6c8d-6c8e,U+6c91-6c92,U+6c95-6c98,U+6c9a,U+6c9c-6c9e,U+6ca0,U+6ca2,U+6ca8,U+6cac,U+6caf-6cb0,U+6cb4-6cb7,U+6cba,U+6cc0-6cc3,U+6cc6-6cc8,U+6ccb,U+6ccd-6ccf,U+6cd1-6cd2,U+6cd8-6cda,U+6cdc-6cdd,U+6cdf,U+6ce4,U+6ce6-6ce7,U+6ce9,U+6cec-6ced,U+6cf2,U+6cf4,U+6cf9,U+6cff-6d00,U+6d02-6d03,U+6d05-6d06,U+6d08-6d0a,U+6d0d,U+6d0f-6d11,U+6d13-6d16,U+6d18,U+6d1c-6d1d,U+6d1f-6d24,U+6d26,U+6d28-6d29,U+6d2c-6d2d,U+6d2f-6d30,U+6d34,U+6d36-6d38,U+6d3a,U+6d3f-6d40,U+6d42,U+6d44,U+6d49,U+6d4c,U+6d50,U+6d55-6d58,U+6d5b,U+6d5d,U+6d5f,U+6d61-6d62,U+6d64-6d65,U+6d67-6d68,U+6d6b-6d6d,U+6d70-6d72"}},{uri:mQ,descriptors:{unicodeRange:"U+6967-696a,U+696c-696d,U+696f-6970,U+6972-6976,U+697a-697b,U+697d-697f,U+6981,U+6983,U+6985,U+698a-698c,U+698e-6993,U+6996-6997,U+6999-699a,U+699d-69a6,U+69a9-69aa,U+69ac,U+69ae-69b0,U+69b2-69b3,U+69b5-69b6,U+69b8-69ba,U+69bc-69c0,U+69c2-69c9,U+69cb,U+69cd,U+69cf,U+69d1-69d3,U+69d5-69da,U+69dc-69de,U+69e1-69ec,U+69ee-69f1,U+69f3-69fc,U+69fe,U+6a00-6a09,U+6a0b-6a16,U+6a19-6a1e,U+6a20,U+6a22-6a27,U+6a29,U+6a2b-6a2e,U+6a30,U+6a32-6a34,U+6a36-6a3c,U+6a3f-6a43,U+6a45-6a46,U+6a48-6a4a"}},{uri:gQ,descriptors:{unicodeRange:"U+6830-6831,U+6834-6836,U+683a-683b,U+683f,U+6847,U+684b,U+684d,U+684f,U+6852,U+6856-685f,U+686a,U+686c-6873,U+6875,U+6878-6880,U+6882,U+6884,U+6887-688e,U+6890-6892,U+6894-6896,U+6898-68a1,U+68a3-68a5,U+68a9-68ac,U+68ae,U+68b1-68b2,U+68b4,U+68b6-68bf,U+68c1,U+68c3-68c8,U+68ca,U+68cc,U+68ce-68d1,U+68d3-68d4,U+68d6-68d7,U+68d9,U+68db-68df,U+68e1-68e2,U+68e4-68ed,U+68ef,U+68f2-68f4,U+68f6-68f8,U+68fb,U+68fd-6900,U+6902-6904,U+6906-690a,U+690c,U+690f,U+6911,U+6913-691e,U+6921-6923,U+6925-692c,U+692e-692f,U+6931-6933,U+6935-6938,U+693a-693c,U+693e,U+6940-6941,U+6943-6953,U+6955-6956,U+6958-6959,U+695b-695c,U+695f,U+6961-6962,U+6964-6965"}},{uri:UQ,descriptors:{unicodeRange:"U+66b8,U+66ba-66bd,U+66bf-66d8,U+66da,U+66de-66e5,U+66e7-66e8,U+66ea-66ef,U+66f1,U+66f5-66f6,U+66f8,U+66fa-66fb,U+66fd,U+6701-6707,U+670c,U+670e-670f,U+6711-6713,U+6716,U+6718-671a,U+671c,U+671e,U+6720-6725,U+6727,U+6729,U+672e,U+6730,U+6732-6733,U+6736-6739,U+673b-673c,U+673e-673f,U+6741,U+6744-6745,U+6747,U+674a-674b,U+674d,U+6752,U+6754-6755,U+6757-675b,U+675d,U+6762-6764,U+6766-6767,U+676b-676c,U+676e,U+6771,U+6774,U+6776,U+6778-677b,U+677d,U+6780,U+6782-6783,U+6785-6786,U+6788,U+678a,U+678c-678f,U+6791-6794,U+6796,U+6799,U+679b,U+679f-67a1,U+67a4,U+67a6,U+67a9,U+67ac,U+67ae,U+67b1-67b2,U+67b4,U+67b9-67c0,U+67c2,U+67c5-67ce,U+67d5-67d7,U+67db,U+67df,U+67e1,U+67e3-67e4,U+67e6-67e8,U+67ea-67eb,U+67ed-67ee,U+67f2,U+67f5-67fc,U+67fe,U+6801-6804,U+6806,U+680d,U+6810,U+6812,U+6814-6815,U+6818-681c,U+681e-6820,U+6822-6828,U+682b-682f"}},{uri:bQ,descriptors:{unicodeRange:"U+6569-656a,U+656d-656f,U+6571,U+6573,U+6575-6576,U+6578-6586,U+6588-658a,U+658d-658f,U+6592,U+6594-6596,U+6598,U+659a,U+659d-659e,U+65a0,U+65a2-65a3,U+65a6,U+65a8,U+65aa,U+65ac,U+65ae,U+65b1-65b8,U+65ba-65bb,U+65be-65c0,U+65c2,U+65c7-65ca,U+65cd,U+65d0-65d1,U+65d3-65d5,U+65d8-65df,U+65e1,U+65e3-65e4,U+65ea-65eb,U+65f2-65f5,U+65f8-65f9,U+65fb-65ff,U+6601,U+6604-6605,U+6607-6609,U+660b,U+660d,U+6610-6612,U+6616-6618,U+661a-661c,U+661e,U+6621-6624,U+6626,U+6629-662c,U+662e,U+6630,U+6632-6633,U+6637-663b,U+663d,U+663f-6640,U+6642,U+6644-664a,U+664d-664e,U+6650-6651,U+6658-6659,U+665b-665e,U+6660,U+6662-6663,U+6665,U+6667,U+6669-666d,U+6671-6673,U+6675,U+6678-6679,U+667b-667d,U+667f-6681,U+6683,U+6685-6686,U+6688-668b,U+668d-6690,U+6692-6695,U+6698-669c,U+669e-66a6,U+66a9-66ad,U+66af-66b3,U+66b5-66b7"}},{uri:yQ,descriptors:{unicodeRange:"U+5f30,U+5f32-5f38,U+5f3b,U+5f3d-5f3f,U+5f41-5f4f,U+5f51,U+5f54,U+5f59-5f5c,U+5f5e-5f60,U+5f63,U+5f65,U+5f67-5f68,U+5f6b,U+5f6e-5f6f,U+5f72,U+5f74-5f76,U+5f78,U+5f7a,U+5f7d-5f7f,U+5f83,U+5f86,U+5f8d-5f8f,U+5f91,U+5f93-5f94,U+5f96,U+5f9a-5f9b,U+5f9d-5fa0,U+5fa2-5fa7,U+5fa9,U+5fab-5fac,U+5faf-5fb4,U+5fb6,U+5fb8-5fbb,U+5fbe-5fc2,U+5fc7-5fc8,U+5fca-5fcb,U+5fce,U+5fd3-5fd5,U+5fda-5fdc,U+5fde-5fdf,U+5fe2-5fe3,U+5fe5-5fe6,U+5fe8-5fe9,U+5fec,U+5fef-5ff0,U+5ff2-5ff4,U+5ff6-5ff7,U+5ff9-5ffa,U+5ffc,U+6007-6009,U+600b-600c,U+6010-6011,U+6013,U+6017-6018,U+601a,U+601e-601f,U+6022-6024,U+602c-602e,U+6030-6034,U+6036-603a,U+603d-603e,U+6040,U+6044-604a,U+604c,U+604e-604f,U+6051,U+6053-6054,U+6056-6058,U+605b-605c,U+605e-6061,U+6065-6066,U+606e,U+6071-6072,U+6074-6075,U+6077,U+607e,U+6080-6082,U+6085-6088,U+608a-608b,U+608e-6091,U+6093,U+6095,U+6097-6099,U+609c,U+609e,U+60a1-60a2,U+60a4-60a5,U+60a7,U+60a9-60aa,U+60ae,U+60b0,U+60b3,U+60b5-60b7,U+60b9-60ba,U+60bd-60c4,U+60c7-60c9,U+60cc"}},{uri:vQ,descriptors:{unicodeRange:"U+635a-635d,U+6360,U+6364-6366,U+6368,U+636a-636c,U+636f-6370,U+6372-6375,U+6378-6379,U+637c-637f,U+6381,U+6383-6386,U+638b,U+638d,U+6391,U+6393-6395,U+6397,U+6399-639f,U+63a1,U+63a4,U+63a6,U+63ab,U+63af,U+63b1-63b2,U+63b5-63b6,U+63b9,U+63bb,U+63bd,U+63bf-63c3,U+63c5,U+63c7-63c8,U+63ca-63cc,U+63d1,U+63d3-63d5,U+63d7-63dd,U+63df,U+63e2,U+63e4-63e8,U+63eb-63ec,U+63ee-63f1,U+63f3,U+63f5,U+63f7,U+63f9-63fc,U+63fe,U+6403-6404,U+6406-640a,U+640d-640e,U+6411-6412,U+6415-641a,U+641d,U+641f,U+6422-6425,U+6427-6429,U+642b,U+642e-6433,U+6435-6439,U+643b-643c,U+643e,U+6440,U+6442-6443,U+6449,U+644b-6451,U+6453,U+6455-6457,U+6459-645d,U+645f-6466,U+6468,U+646a-646c,U+646e-6477,U+647b-6481,U+6483,U+6486,U+6488-648f"}},{uri:xQ,descriptors:{unicodeRange:"U+61c5-61c7,U+61c9,U+61cc-61d0,U+61d3,U+61d5-61e5,U+61e7-61f4,U+61f6-61fe,U+6200-6205,U+6207,U+6209,U+6213-6214,U+6219,U+621c-621e,U+6220,U+6223,U+6226-6229,U+622b,U+622d,U+622f-6232,U+6235-6236,U+6238-623c,U+6242,U+6244-6246,U+624a,U+624f-6250,U+6255-6257,U+6259-625a,U+625c-6262,U+6264-6265,U+6268,U+6271-6272,U+6274-6275,U+6277-6278,U+627a-627b,U+627d,U+6281-6283,U+6285-6288,U+628b-6290,U+6294,U+6299,U+629c-629e,U+62a3,U+62a6-62a7,U+62a9-62aa,U+62ad-62b0,U+62b2-62b4,U+62b6-62b8,U+62ba,U+62be,U+62c0-62c1,U+62c3,U+62cb,U+62cf,U+62d1,U+62d5,U+62dd-62de,U+62e0-62e1,U+62e4,U+62ea-62eb,U+62f0,U+62f2,U+62f5,U+62f8-62fb,U+6300,U+6303-6306,U+630a-630d,U+630f-6310,U+6312-6315,U+6317-6319,U+631c,U+6326-6327,U+6329,U+632c-632e,U+6330-6331,U+6333-6338,U+633b-633c,U+633e-6341,U+6344,U+6347-6348,U+634a,U+6351-6354,U+6356-6359"}},{uri:wQ,descriptors:{unicodeRange:"U+5dd0-5dda,U+5ddc,U+5ddf-5de0,U+5de3-5de4,U+5dea,U+5dec-5ded,U+5df0,U+5df5-5df6,U+5df8-5dfc,U+5dff-5e00,U+5e04,U+5e07,U+5e09-5e0b,U+5e0d-5e0e,U+5e12-5e13,U+5e17,U+5e1e-5e25,U+5e28-5e2c,U+5e2f-5e30,U+5e32-5e36,U+5e39-5e3a,U+5e3e-5e41,U+5e43,U+5e46-5e4b,U+5e4d-5e53,U+5e56-5e5a,U+5e5c-5e5d,U+5e5f-5e60,U+5e63-5e71,U+5e75,U+5e77,U+5e79,U+5e7e,U+5e81-5e83,U+5e85,U+5e88-5e89,U+5e8c-5e8e,U+5e92,U+5e98,U+5e9b,U+5e9d,U+5ea1-5ea4,U+5ea8-5eac,U+5eae-5eb2,U+5eb4,U+5eba-5ebd,U+5ebf-5ec8,U+5ecb-5ed0,U+5ed4-5ed5,U+5ed7-5eda,U+5edc-5ee7,U+5ee9,U+5eeb-5ef3,U+5ef5,U+5ef8-5ef9,U+5efb-5efd,U+5f05-5f07,U+5f09,U+5f0c-5f0e,U+5f10,U+5f12,U+5f14,U+5f16,U+5f19-5f1a,U+5f1c-5f1e,U+5f21-5f24,U+5f28,U+5f2b-5f2c,U+5f2e"}},{uri:EQ,descriptors:{unicodeRange:"U+60cd-60d0,U+60d2-60d4,U+60d6-60d7,U+60d9,U+60db,U+60de,U+60e1-60e5,U+60ea,U+60f1-60f2,U+60f5,U+60f7-60f8,U+60fb-60ff,U+6102-6105,U+6107,U+610a-610c,U+6110-6114,U+6116-6119,U+611b-611e,U+6121-6122,U+6125,U+6128-612a,U+612c-613e,U+6140-6147,U+6149,U+614b,U+614d,U+614f-6150,U+6152-6154,U+6156-615c,U+615e-6161,U+6163-6166,U+6169-616f,U+6171-6174,U+6176,U+6178-618a,U+618c-618d,U+618f-6193,U+6195-619c,U+619e-61a6,U+61aa-61ab,U+61ad-61b6,U+61b8-61bd,U+61bf-61c1,U+61c3-61c4"}},{uri:CQ,descriptors:{unicodeRange:"U+5cf4-5cfa,U+5cfc-5d01,U+5d04-5d05,U+5d08-5d0d,U+5d0f-5d13,U+5d15,U+5d17-5d1a,U+5d1c-5d1d,U+5d1f-5d23,U+5d25,U+5d28,U+5d2a-5d2c,U+5d2f-5d33,U+5d35-5d3c,U+5d3f-5d46,U+5d48-5d49,U+5d4d-5d57,U+5d59-5d5a,U+5d5c,U+5d5e-5d68,U+5d6a,U+5d6d-5d6e,U+5d70-5d73,U+5d75-5d81,U+5d83-5d98,U+5d9a-5d9c,U+5d9e-5db6,U+5db8-5dc4,U+5dc6-5dcc,U+5dce-5dcf"}},{uri:SQ,descriptors:{unicodeRange:"U+5b52,U+5b56,U+5b5e,U+5b60-5b61,U+5b67-5b68,U+5b6b,U+5b6d-5b6f,U+5b72,U+5b74,U+5b76-5b79,U+5b7b-5b7c,U+5b7e-5b7f,U+5b82,U+5b86,U+5b8a,U+5b8d-5b8e,U+5b90-5b92,U+5b94,U+5b96,U+5b9f,U+5ba7-5ba9,U+5bac-5baf,U+5bb1-5bb2,U+5bb7,U+5bba-5bbc,U+5bc0-5bc1,U+5bc3,U+5bc8-5bcb,U+5bcd-5bcf,U+5bd1,U+5bd4-5bdc,U+5be0,U+5be2-5be3,U+5be6-5be7,U+5be9-5bed,U+5bef,U+5bf1-5bf7,U+5bfd-5bfe,U+5c00,U+5c02-5c03,U+5c05,U+5c07-5c08,U+5c0b-5c0e,U+5c10,U+5c12-5c13,U+5c17,U+5c19,U+5c1b,U+5c1e-5c21,U+5c23,U+5c26,U+5c28-5c2b,U+5c2d-5c30,U+5c32-5c33,U+5c35-5c37,U+5c43-5c44,U+5c46-5c47,U+5c4c-5c4d,U+5c52-5c54,U+5c56-5c58,U+5c5a-5c5d,U+5c5f,U+5c62,U+5c64,U+5c67-5c6d,U+5c70,U+5c72-5c78,U+5c7b-5c7e,U+5c80,U+5c83-5c87,U+5c89-5c8b,U+5c8e-5c8f,U+5c92-5c93,U+5c95,U+5c9d-5ca1,U+5ca4-5ca8,U+5caa,U+5cae-5cb0,U+5cb2,U+5cb4,U+5cb6,U+5cb9-5cbc,U+5cbe,U+5cc0,U+5cc2-5cc3,U+5cc5-5cca,U+5ccc-5cd1,U+5cd3-5cd8,U+5cda-5ce0,U+5ce2-5ce3,U+5ce7,U+5ce9,U+5ceb-5cec,U+5cee-5cef,U+5cf1-5cf3"}},{uri:_Q,descriptors:{unicodeRange:"U+593b,U+593d-5940,U+5943,U+5945-5946,U+594a,U+594c-594d,U+5950,U+5952-5953,U+5959,U+595b-595f,U+5961,U+5963-5964,U+5966-5972,U+5975,U+5977,U+597a-597c,U+597e-5980,U+5985,U+5989,U+598b-598c,U+598e-5991,U+5994-5995,U+5998,U+599a-599d,U+599f-59a2,U+59a6-59a7,U+59ac-59ad,U+59b0-59b1,U+59b3-59b8,U+59ba,U+59bc-59bd,U+59bf-59c5,U+59c7-59c9,U+59cc-59cf,U+59d5-59d6,U+59d9,U+59db,U+59de-59e2,U+59e4,U+59e6-59e7,U+59e9-59eb,U+59ed-59f8,U+59fa,U+59fc-59fe,U+5a00,U+5a02,U+5a0a-5a0b,U+5a0d-5a10,U+5a12,U+5a14-5a17,U+5a19-5a1b,U+5a1d-5a1e,U+5a21-5a22,U+5a24,U+5a26-5a28,U+5a2a-5a30,U+5a33,U+5a35,U+5a37-5a3b,U+5a3d-5a3f,U+5a41-5a45,U+5a47-5a48,U+5a4b-5a54,U+5a56-5a59,U+5a5b-5a61,U+5a63-5a66,U+5a68-5a69,U+5a6b-5a73,U+5a78-5a79,U+5a7b-5a7e,U+5a80-5a90"}},{uri:kQ,descriptors:{unicodeRange:"U+5a91,U+5a93-5a99,U+5a9c-5aa9,U+5aab-5ab1,U+5ab4,U+5ab6-5ab7,U+5ab9-5abd,U+5abf-5ac0,U+5ac3-5ac8,U+5aca-5acb,U+5acd-5ad1,U+5ad3,U+5ad5,U+5ad7,U+5ad9-5adb,U+5add-5adf,U+5ae2,U+5ae4-5ae5,U+5ae7-5ae8,U+5aea,U+5aec-5af0,U+5af2-5b08,U+5b0a-5b15,U+5b18-5b31,U+5b33,U+5b35-5b36,U+5b38-5b3f,U+5b41-5b4f"}},{uri:TQ,descriptors:{unicodeRange:"U+5843,U+5845-584b,U+584e-5850,U+5852-5853,U+5855-5857,U+5859-585d,U+585f-5864,U+5866-586a,U+586d-587d,U+587f,U+5882,U+5884,U+5886-5888,U+588a-5891,U+5894-5898,U+589b-589d,U+58a0-58a7,U+58aa-58bb,U+58bd-58c0,U+58c2-58c4,U+58c6-58d0,U+58d2-58d4,U+58d6-58e3,U+58e5-58ea,U+58ed,U+58ef,U+58f1-58f2,U+58f4-58f5,U+58f7-58f8,U+58fa-5901,U+5903,U+5905-5906,U+5908-590c,U+590e,U+5910-5913,U+5917-5918,U+591b,U+591d-591e,U+5920-5923,U+5926,U+5928,U+592c,U+5930,U+5932-5933,U+5935-5936"}},{uri:MQ,descriptors:{unicodeRange:"U+56d0-56d3,U+56d5-56d6,U+56d8-56d9,U+56dc,U+56e3,U+56e5-56ea,U+56ec,U+56ee-56ef,U+56f2-56f3,U+56f6-56f8,U+56fb-56fc,U+5700-5702,U+5705,U+5707,U+570b-571b,U+571d-571e,U+5720-5722,U+5724-5727,U+572b,U+5731-5732,U+5734-5738,U+573c-573d,U+573f,U+5741,U+5743-5746,U+5748-5749,U+574b,U+5752-5756,U+5758-5759,U+5762-5763,U+5765,U+5767,U+576c,U+576e,U+5770-5772,U+5774-5775,U+5778-577a,U+577d-5781,U+5787-578a,U+578d-5791,U+5794-579a,U+579c-579f,U+57a5,U+57a8,U+57aa,U+57ac,U+57af-57b1,U+57b3,U+57b5-57b7,U+57b9-57c1,U+57c4-57ca,U+57cc-57cd,U+57d0-57d1,U+57d3,U+57d6-57d7,U+57db-57dc,U+57de,U+57e1-57e3,U+57e5-57ec,U+57ee,U+57f0-57f3,U+57f5-57f7,U+57fb-57fc,U+57fe-57ff,U+5801,U+5803-5805,U+5808-580a,U+580c,U+580e-5810,U+5812-5814,U+5816-5818,U+581a-581d,U+581f,U+5822-5823,U+5825-5829,U+582b-582f,U+5831-5834,U+5836-5842"}},{uri:IQ,descriptors:{unicodeRange:"U+55f9-55fc,U+55ff,U+5602-5607,U+560a-560b,U+560d,U+5610-5617,U+5619-561a,U+561c-561d,U+5620-5622,U+5625-5626,U+5628-562b,U+562e-5630,U+5633,U+5635,U+5637-5638,U+563a,U+563c-563e,U+5640-564b,U+564f-5653,U+5655-5656,U+565a-565b,U+565d-5661,U+5663,U+5665-5667,U+566d-5670,U+5672-5675,U+5677-567a,U+567d-5684,U+5687-568d,U+5690-5692,U+5694-56a2,U+56a4-56ae,U+56b0-56b6,U+56b8-56bb,U+56bd-56c9,U+56cb-56cf"}},{uri:AQ,descriptors:{unicodeRange:"U+5286-5287,U+5289-528f,U+5291-5292,U+5294-529a,U+529c,U+52a4-52a7,U+52ae-52b0,U+52b4-52bd,U+52c0-52c2,U+52c4-52c6,U+52c8,U+52ca,U+52cc-52cf,U+52d1,U+52d3-52d5,U+52d7,U+52d9-52de,U+52e0-52e3,U+52e5-52ef,U+52f1-52f8,U+52fb-52fd,U+5301-5304,U+5307,U+5309-530c,U+530e,U+5311-5314,U+5318,U+531b-531c,U+531e-531f,U+5322,U+5324-5325,U+5327-5329,U+532b-532d,U+532f-5338,U+533c-533d,U+5340,U+5342,U+5344,U+5346,U+534b-534d,U+5350,U+5354,U+5358-5359,U+535b,U+535d,U+5365,U+5368,U+536a,U+536c-536d,U+5372,U+5376,U+5379,U+537b-537e,U+5380-5381,U+5383,U+5387-5388,U+538a,U+538e-5394,U+5396-5397,U+5399,U+539b-539c,U+539e,U+53a0-53a1,U+53a4,U+53a7,U+53aa-53ad,U+53af-53b5,U+53b7-53ba,U+53bc-53be,U+53c0,U+53c3-53c7,U+53ce-53d0,U+53d2-53d3,U+53d5,U+53da,U+53dc-53de,U+53e1-53e2,U+53e7,U+53f4,U+53fa,U+53fe-5400,U+5402,U+5405,U+5407,U+540b,U+5414,U+5418-541a,U+541c,U+5422,U+5424-5425,U+542a,U+5430,U+5433,U+5436-5437,U+543a"}},{uri:LQ,descriptors:{unicodeRange:"U+5101-5105,U+5108-510a,U+510c-5111,U+5113-5120,U+5122-513e,U+5142,U+5147,U+514a,U+514c,U+514e-5150,U+5152-5153,U+5157-5159,U+515b,U+515d-5161,U+5163-5164,U+5166-5167,U+5169-516a,U+516f,U+5172,U+517a,U+517e-517f,U+5183-5184,U+5186-5187,U+518a-518b,U+518e-5191,U+5193-5194,U+5198,U+519a,U+519d-519f,U+51a1,U+51a3,U+51a6-51aa,U+51ad-51ae,U+51b4,U+51b8-51ba,U+51be-51bf,U+51c1-51c3,U+51c5,U+51c8,U+51ca,U+51cd-51ce,U+51d0,U+51d2-51da,U+51dc,U+51de-51df,U+51e2-51e3,U+51e5-51ea,U+51ec,U+51ee,U+51f1-51f2,U+51f4,U+51f7,U+51fe,U+5204-5205,U+5209,U+520b-520c,U+520f-5210,U+5213-5215,U+521c,U+521e-521f,U+5221-5223,U+5225-5227,U+522a,U+522c,U+522f,U+5231-5232,U+5234-5235,U+523c,U+523e,U+5244-5249,U+524b,U+524e-524f,U+5252-5253,U+5255,U+5257-525b,U+525d,U+525f-5260,U+5262-5264,U+5266,U+5268,U+526b-526e,U+5270-5271,U+5273-527c,U+527e,U+5280,U+5283-5285"}},{uri:RQ,descriptors:{unicodeRange:"U+543d,U+543f,U+5441-5442,U+5444-5445,U+5447,U+5449,U+544c-544f,U+5451,U+545a,U+545d-5461,U+5463,U+5465,U+5467,U+5469-5470,U+5474,U+5479-547a,U+547e-547f,U+5481,U+5483,U+5485,U+5487-548a,U+548d,U+5491,U+5493,U+5497-5498,U+549c,U+549e-54a2,U+54a5,U+54ae,U+54b0,U+54b2,U+54b5-54b7,U+54b9-54ba,U+54bc,U+54be,U+54c3,U+54c5,U+54ca-54cb,U+54d6,U+54d8,U+54db,U+54e0-54e4,U+54eb-54ec,U+54ef-54f1,U+54f4-54f9,U+54fb,U+54fe,U+5500,U+5502-5505,U+5508,U+550a-550e,U+5512-5513,U+5515-551a,U+551c-551f,U+5521,U+5525-5526,U+5528-5529,U+552b,U+552d,U+5532,U+5534-5536,U+5538-553b,U+553d,U+5540,U+5542,U+5545,U+5547-5548,U+554b-554f,U+5551-5554,U+5557-555b,U+555d-5560,U+5562-5563,U+5568-5569,U+556b,U+556f-5574,U+5579-557a,U+557d,U+557f,U+5585-5586,U+558c-558e,U+5590,U+5592-5593,U+5595-5597,U+559a-559b,U+559e,U+55a0-55a6,U+55a8-55b0,U+55b2,U+55b4,U+55b6,U+55b8,U+55ba,U+55bc,U+55bf-55c3,U+55c6-55c8,U+55ca-55cb,U+55ce-55d0,U+55d5,U+55d7-55db,U+55de,U+55e0,U+55e2,U+55e7,U+55e9,U+55ed-55ee,U+55f0-55f1,U+55f4,U+55f6,U+55f8"}},{uri:DQ,descriptors:{unicodeRange:"U+4fe0,U+4fe2,U+4fe4-4fe5,U+4fe7,U+4feb-4fec,U+4ff0,U+4ff2,U+4ff4-4ff7,U+4ff9,U+4ffb-4ffd,U+4fff-500b,U+500e,U+5010-5011,U+5013,U+5015-5017,U+501b,U+501d-501e,U+5020,U+5022-5024,U+5027,U+502b,U+502f-5039,U+503b,U+503d,U+503f-5042,U+5044-5046,U+5049-504b,U+504d,U+5050-5054,U+5056-5059,U+505b,U+505d-5064,U+5066-506b,U+506d-5075,U+5078-507a,U+507c-507d,U+5081-5084,U+5086-5087,U+5089-508c,U+508e-50a2,U+50a4,U+50a6,U+50aa-50ab,U+50ad-50b1,U+50b3-50b9,U+50bc-50ce,U+50d0-50d5,U+50d7-50d9,U+50db-50e5,U+50e8-50eb,U+50ef-50f2,U+50f4,U+50f6-50fa,U+50fc-5100"}},{uri:jQ,descriptors:{unicodeRange:"U+49d5-4a77"}},{uri:PQ,descriptors:{unicodeRange:"U+4dac-4dad,U+4daf-4db5,U+4e02,U+4e04-4e06,U+4e0f,U+4e12,U+4e17,U+4e1f-4e21,U+4e23,U+4e26,U+4e29,U+4e2e-4e2f,U+4e31,U+4e33,U+4e35,U+4e37,U+4e3c,U+4e40-4e42,U+4e44,U+4e46,U+4e4a,U+4e51,U+4e55,U+4e57,U+4e5a-4e5b,U+4e62-4e65,U+4e67-4e68,U+4e6a-4e6f,U+4e72,U+4e74-4e7d,U+4e7f-4e85,U+4e87,U+4e8a,U+4e90,U+4e96-4e97,U+4e99,U+4e9c-4e9e,U+4ea3,U+4eaa,U+4eaf-4eb1,U+4eb4,U+4eb6-4eb9,U+4ebc-4ebe,U+4ec8,U+4ecc,U+4ecf-4ed0,U+4ed2,U+4eda-4edc,U+4ee0,U+4ee2,U+4ee6-4ee7,U+4ee9,U+4eed-4eef,U+4ef1,U+4ef4,U+4ef8-4efa,U+4efc,U+4efe,U+4f00,U+4f02-4f08,U+4f0b-4f0c,U+4f12-4f16,U+4f1c-4f1d,U+4f21,U+4f23,U+4f28-4f29,U+4f2c-4f2e,U+4f31,U+4f33,U+4f35,U+4f37,U+4f39,U+4f3b,U+4f3e-4f42,U+4f44-4f45,U+4f47-4f4c,U+4f52,U+4f54,U+4f56,U+4f61-4f62,U+4f66,U+4f68,U+4f6a-4f6b,U+4f6d-4f6e,U+4f71-4f72,U+4f75,U+4f77-4f7a,U+4f7d,U+4f80-4f82,U+4f85-4f87,U+4f8a,U+4f8c,U+4f8e,U+4f90,U+4f92-4f93,U+4f95-4f96,U+4f98-4f9a,U+4f9c,U+4f9e-4f9f,U+4fa1-4fa2,U+4fa4,U+4fab,U+4fad,U+4fb0-4fb4,U+4fb6-4fbe,U+4fc0-4fc2,U+4fc6-4fc9,U+4fcb-4fcd,U+4fd2-4fd6,U+4fd9,U+4fdb"}},{uri:NQ,descriptors:{unicodeRange:"U+4933-49d4"}},{uri:OQ,descriptors:{unicodeRange:"U+487a-4932"}},{uri:FQ,descriptors:{unicodeRange:"U+47d2-4879,U+2ce7c,U+2ce88,U+2ce93"}},{uri:$Q,descriptors:{unicodeRange:"U+4756-47d1,U+2ca02,U+2ca0e,U+2ca7d,U+2caa9,U+2cb29,U+2cb2e,U+2cb31,U+2cb38-2cb39,U+2cb3f,U+2cb41,U+2cb4e,U+2cb5a,U+2cb64,U+2cb69,U+2cb6c,U+2cb6f,U+2cb76,U+2cb78,U+2cb7c,U+2cbb1,U+2cbbf-2cbc0,U+2cbce,U+2cc5f,U+2ccf5-2ccf6,U+2ccfd,U+2ccff,U+2cd02-2cd03,U+2cd0a,U+2cd8b,U+2cd8d,U+2cd8f-2cd90,U+2cd9f-2cda0,U+2cda8,U+2cdad-2cdae,U+2cdd5,U+2ce18,U+2ce1a,U+2ce23,U+2ce26,U+2ce2a"}},{uri:BQ,descriptors:{unicodeRange:"U+46c3-4755,U+2c488,U+2c494,U+2c497,U+2c542,U+2c613,U+2c618,U+2c621,U+2c629,U+2c62b-2c62d,U+2c62f,U+2c642,U+2c64a-2c64b,U+2c72c,U+2c72f,U+2c79f,U+2c7c1,U+2c7fd,U+2c8d9,U+2c8de,U+2c8e1,U+2c8f3,U+2c907,U+2c90a,U+2c91d"}},{uri:zQ,descriptors:{unicodeRange:"U+4629-46c2,U+2bdf7,U+2be29,U+2c029-2c02a,U+2c0a9,U+2c0ca,U+2c1d5,U+2c1d9,U+2c1f9,U+2c27c,U+2c288,U+2c2a4,U+2c317,U+2c35b,U+2c361,U+2c364"}},{uri:HQ,descriptors:{unicodeRange:"U+458e-4628,U+2b7a9,U+2b7c5,U+2b7e6,U+2b7f9,U+2b806,U+2b80a,U+2b81c,U+2b8b8,U+2bac7,U+2bb5f,U+2bb62,U+2bb7c,U+2bb83,U+2bc1b,U+2bd77,U+2bd87"}},{uri:WQ,descriptors:{unicodeRange:"U+4449-4511,U+2afa2,U+2b127-2b128,U+2b137-2b138,U+2b1ed"}},{uri:XQ,descriptors:{unicodeRange:"U+439b-4448,U+2a437,U+2a5f1,U+2a602,U+2a61a,U+2a6b2,U+2a7dd,U+2a8fb,U+2a917,U+2aa30,U+2aa36,U+2aa58"}},{uri:VQ,descriptors:{unicodeRange:"U+4275-430d,U+298c6,U+29a72,U+29d98,U+29ddb,U+29e15,U+29e3d,U+29e49"}},{uri:YQ,descriptors:{unicodeRange:"U+4132-41de,U+28bef,U+28c47,U+28c4f,U+28c51,U+28c54,U+28d10,U+28d71,U+28dfb,U+28e1f,U+28e36,U+28e89,U+28e99,U+28eeb,U+28f32,U+28ff8,U+292a0"}},{uri:GQ,descriptors:{unicodeRange:"U+41df-4274,U+292b1,U+29490,U+295cf,U+2967f,U+296f0,U+29719,U+29750"}},{uri:qQ,descriptors:{unicodeRange:"U+408e-4131,U+285c8-285c9,U+28678,U+28695,U+286d7,U+286fa,U+287e0,U+28946,U+28949,U+2896b,U+28987-28988,U+289ba-289bb,U+28a1e,U+28a29,U+28a43,U+28a71,U+28a99,U+28acd,U+28add,U+28ae4,U+28b49,U+28bc1"}},{uri:ZQ,descriptors:{unicodeRange:"U+3e83-3f2f,U+27139,U+273da-273db,U+273fe,U+27410,U+27449,U+27614-27615,U+27631,U+27684,U+27693,U+2770e,U+27723,U+27752"}},{uri:KQ,descriptors:{unicodeRange:"U+3f30-3fdb,U+27985,U+27a84,U+27bb3,U+27bbe,U+27bc7,U+27cb8,U+27da0,U+27e10"}},{uri:QQ,descriptors:{unicodeRange:"U+3fdc-408d,U+27fb7,U+27ff9,U+2808a,U+280bb,U+2815d,U+28277,U+28282,U+282e2,U+282f3,U+283cd,U+28408,U+2840c,U+28455,U+28468,U+2856b"}},{uri:JQ,descriptors:{unicodeRange:"U+3dd2-3e82,U+26a58,U+26a8c,U+26ab7,U+26aff,U+26b5c,U+26c21,U+26c29,U+26c73,U+26cdd,U+26e40,U+26e65,U+26f94,U+26ff6-26ff8,U+270f4,U+2710d"}},{uri:eJ,descriptors:{unicodeRange:"U+3d34-3dd1,U+2648d,U+26676,U+2667e,U+266b0,U+2671d,U+2677c,U+267cc,U+268dd,U+268ea,U+26951,U+2696f,U+269dd,U+269fa,U+26a1e"}},{uri:tJ,descriptors:{unicodeRange:"U+3c76-3d33,U+25d0a,U+25da1,U+25e2e,U+25e56,U+25e62,U+25e65,U+25ec2,U+25ed7-25ed8,U+25ee8,U+25f23,U+25f5c,U+25fd4,U+25fe0,U+25ffb,U+2600c,U+26017,U+26060,U+260ed,U+26221,U+26270,U+26286,U+2634c,U+26402"}},{uri:nJ,descriptors:{unicodeRange:"U+3bda-3c75,U+25771,U+257a9,U+257b4,U+259c4,U+259d4,U+25ae3-25ae4,U+25af1,U+25bb2,U+25c14,U+25c4b,U+25c64"}},{uri:rJ,descriptors:{unicodeRange:"U+3b25-3bd9,U+2504a,U+25055,U+25122,U+2512b,U+251a9,U+251cd,U+251e5,U+2521e,U+2524c,U+2542e,U+2548e,U+254d9,U+2550e,U+25532,U+25562,U+255a7-255a8"}},{uri:iJ,descriptors:{unicodeRange:"U+3a6b-3b24,U+24896,U+249db,U+24a4d,U+24a7d,U+24ac9,U+24b56,U+24b6f,U+24c16,U+24d14,U+24dea,U+24e0e,U+24e37,U+24e6a,U+24e8b,U+24eaa"}},{uri:aJ,descriptors:{unicodeRange:"U+39a9-3a6a,U+24096,U+24103,U+241ac,U+241c6,U+241fe,U+243bc,U+243f8,U+244d3,U+24629,U+246a5,U+247f1"}},{uri:sJ,descriptors:{unicodeRange:"U+38e3-39a8,U+23a98,U+23c7f,U+23c97-23c98,U+23cfe,U+23d00,U+23d0e,U+23d40,U+23dd3,U+23df9-23dfa,U+23e23,U+23f7e"}},{uri:oJ,descriptors:{unicodeRange:"U+3760-382a,U+22ab8,U+22b43,U+22b46,U+22b4f-22b50,U+22ba6,U+22bca,U+22c1d,U+22c24,U+22c55,U+22d4c,U+22de1"}},{uri:lJ,descriptors:{unicodeRange:"U+382b-38e2,U+231b6,U+231c3-231c4,U+231f5,U+23350,U+23372,U+233d0,U+233d2-233d3,U+233d5,U+233da,U+233df,U+233e4,U+2344a-2344b,U+23451,U+23465,U+234e4,U+2355a,U+23594,U+235c4,U+235cb,U+23638-2363a,U+23647,U+2370c,U+2371c,U+2373f,U+23763-23764,U+237e7,U+237ff,U+23824,U+2383d"}},{uri:cJ,descriptors:{unicodeRange:"U+3698-375f,U+22218,U+2231e,U+223ad,U+224dc,U+226f3,U+2285b,U+228ab,U+2298f"}},{uri:dJ,descriptors:{unicodeRange:"U+35e6-3697,U+21c56,U+21cde,U+21d2d,U+21d45,U+21d62,U+21d78,U+21d92,U+21d9c,U+21da1,U+21db7,U+21de0,U+21e33-21e34,U+21f1e,U+21f76,U+21ffa,U+2217b"}},{uri:uJ,descriptors:{unicodeRange:"U+3444-350e,U+20ad3,U+20b1d,U+20b9f,U+20c41,U+20cbf,U+20cd0,U+20d45,U+20de1,U+20e64,U+20e6d,U+20e95,U+20e9d,U+20ea2,U+20f5f,U+210c1,U+21201,U+2123d,U+21255,U+21274,U+2127b"}},{uri:hJ,descriptors:{unicodeRange:"U+350f-35e5,U+212d7,U+212e4,U+212fd,U+2131b,U+21336,U+21344,U+2139a,U+213c4,U+21413,U+2146d-2146e,U+215d7,U+21647,U+216b4,U+21706,U+21742,U+218bd,U+219c3"}},{uri:fJ,descriptors:{unicodeRange:"U+336d-3443,U+2032b,U+20371,U+20381,U+203f9,U+2044a,U+20509,U+20547,U+205d6,U+20628,U+20676,U+2074f,U+20779,U+20807,U+2083a,U+20895,U+208b9,U+2097c,U+2099d"}},{uri:pJ,descriptors:{unicodeRange:"U+328b-336c,U+2000b,U+20089,U+200a2,U+200a4,U+20164,U+201a2,U+20213"}},{uri:mJ,descriptors:{unicodeRange:"U+3192-31ba,U+31c0-31e3,U+31f0-321e,U+3220-328a,U+1f250-1f251"}},{uri:gJ,descriptors:{unicodeRange:"U+2f74-2fd5,U+3000,U+3003-3007,U+3012-3013,U+3018-301c,U+3020-3029,U+302f-303f,U+3041-3096,U+3099-30a1"}},{uri:UJ,descriptors:{unicodeRange:"U+30a2-30ff,U+3105-312f,U+3131-318e,U+3190-3191"}},{uri:bJ,descriptors:{unicodeRange:"U+4e36,U+4ea0,U+4f74,U+4f91,U+4f94,U+4fc5,U+507e,U+50ed,U+5182,U+51f5,U+525e,U+5282,U+52f9,U+5326,U+537a,U+53a3,U+5423,U+5459,U+54b4,U+54d9,U+55c9,U+57f4,U+580b,U+5902,U+5925,U+5a08,U+5ab5,U+5b84,U+5be4,U+5c22,U+5cb5,U+5cbd,U+5d3e,U+5e31,U+5e5e,U+5e80,U+5ee8,U+5f82,U+5fc9,U+5fed,U+600a,U+605d,U+609b,U+609d,U+60dd,U+6243,U+6322,U+63ce,U+640c,U+643f,U+6445,U+64d7,U+6534,U+6549,U+656b,U+6603,U+674c,U+680a,U+6864,U+69d4,U+6a65,U+6c2a,U+6c46,U+6c5c,U+6d0e,U+6d48,U+6e2b,U+6eb2,U+6eb7,U+6f89,U+706c,U+70b1,U+7113,U+71d4,U+727f,U+72f3,U+7303,U+7321,U+736c,U+736f,U+74a9,U+74de,U+750d,U+7513,U+7592,U+75c4,U+7605,U+760a,U+761b,U+7625,U+762d,U+7643,U+7707,U+7747,U+77b5,U+7839,U+784e,U+78a5,U+7924,U+793b,U+798a,U+7a03,U+7a06,U+7a78,U+7a80,U+7aad,U+7ba8,U+7be5,U+7cc8,U+7ec1,U+7f0b,U+7f0f,U+7f12,U+7f68,U+7f9d,U+8025,U+809c,U+80ad,U+80b7,U+80e8,U+811e,U+8204,U+8223,U+822d,U+823b,U+824b,U+825a,U+827d,U+827f,U+828f,U+82c8,U+8307,U+831b,U+8347,U+837d,U+839b,U+83a9,U+83f9,U+84b9,U+8579,U+864d,U+867f,U+86b0,U+86d1,U+86d8,U+86f2,U+8764,U+8770,U+8788,U+8797,U+87ac-87ad,U+87b5,U+881b,U+8844,U+88bc,U+88fc,U+8930,U+89cf,U+89d6,U+8ba0,U+8bd4,U+8c02,U+8c2b,U+8c85,U+8e23,U+8f81-8f82,U+8fd5,U+90b6,U+90db,U+914e,U+9164,U+91ad,U+943e,U+94b7-94b8,U+94eb,U+950d,U+9514,U+9516,U+9518,U+9529,U+9538,U+953f,U+954e,U+955f,U+95fc,U+9667,U+96b3,U+9792,U+97b2,U+98a1,U+9969,U+9987,U+9998,U+9a80,U+9a92,U+9a96,U+9adf,U+9cb4,U+9cbd,U+9cd0,U+9cd4,U+9e31,U+9e3a,U+9e71,U+9ee5,U+9eea,U+9ef9,U+9fa0"}},{uri:yJ,descriptors:{unicodeRange:"U+4e0c,U+4e28,U+4e3f,U+4ec2,U+502e,U+50ba,U+5155,U+5181,U+522d,U+5281,U+5290,U+5369,U+53b6,U+54d5,U+54dc,U+54ff,U+552a,U+553c,U+5588,U+55b5,U+5686,U+570a,U+5776,U+5786,U+57a4,U+5820,U+5865,U+58bc,U+5b32,U+5b65,U+5c1c,U+5c66,U+5c6e,U+5c8d,U+5ddb,U+5f2a,U+5f50,U+5f61,U+6067,U+614a,U+615d,U+619d,U+61d4,U+620b,U+6224-6225,U+6343,U+63ad,U+63f2,U+640b,U+6420,U+6434,U+6496,U+64d0,U+6509,U+652e,U+67a8,U+6833,U+6844,U+684a,U+6920,U+6957,U+6971,U+6a8e,U+6a91,U+6aa0,U+6b43,U+6bea,U+6bf5,U+6c15,U+6cd0,U+6ee0,U+6f24,U+6f2d,U+70c0,U+721d,U+728b,U+72c3,U+72e8,U+730a,U+7338-7339,U+734d,U+746d,U+752f,U+754e,U+770d,U+7735,U+778d,U+77a2,U+77e7,U+7857,U+786d,U+78c9,U+78f2,U+791e,U+7953,U+7b58,U+7b9d,U+7bda,U+7cd7,U+7f32-7f33,U+8022,U+8028-8029,U+8035,U+804d,U+8080,U+80c2,U+80e9,U+80ec,U+80f2,U+810e,U+8221,U+8274,U+82b0,U+82e0,U+83b0,U+8487-8488,U+848e,U+84cd,U+84d0,U+8539,U+857a,U+85a8,U+85b7,U+867c,U+871e,U+8723,U+877e,U+878b,U+8793,U+8803,U+88d2,U+8966,U+89cc,U+89eb,U+8b26,U+8c8a,U+8c98,U+8d33,U+8d47,U+8d55,U+8dbc,U+8e40,U+8e94,U+8f77,U+8f79,U+9058,U+91a2,U+91b5,U+928e,U+9494,U+94b6,U+94de,U+94f4,U+94f9,U+950a,U+950e,U+951e,U+952b,U+953c,U+953e,U+9544,U+9561,U+9564,U+9569,U+95f6,U+9603,U+960d,U+963d,U+9674,U+9794,U+97ab,U+98a5,U+9a9f,U+9ab1,U+9ad1,U+9b0f,U+9b2f,U+9c92,U+9c95,U+9cba,U+9cbc,U+9cc6,U+9ccb,U+9cd8,U+9e32,U+9e38,U+9e5b,U+9e7e,U+9eb4,U+9efb-9efc,U+9f3d"}},{uri:vJ,descriptors:{unicodeRange:"U+2e3b,U+2e80-2e99,U+2e9b-2ef3,U+2f00-2f73,U+ffffd"}},{uri:xJ,descriptors:{unicodeRange:"U+4e69,U+4f1b,U+4f67,U+4f7e,U+4fdc,U+50e6,U+5196,U+5202,U+5233,U+523f,U+52a2,U+536e,U+5476,U+54ad,U+54cf,U+5537,U+561e,U+56dd,U+56df,U+5709,U+572c,U+57cf,U+57f8,U+580d,U+5881,U+589a,U+5941,U+59b2,U+5c25,U+5d24,U+5d74,U+5e42,U+5e8b,U+5eb3,U+5ed2,U+5fad,U+6003,U+603c,U+6083,U+6100,U+6126,U+6206,U+62ca,U+638e,U+63b4,U+6426,U+646d,U+6535,U+65c4,U+66db,U+6715,U+6769,U+6798,U+67c3,U+6861,U+698d,U+69ca,U+69ed,U+69f2,U+69ff,U+6a18,U+6b39,U+6bb3,U+6c0d,U+6cb2,U+6cd6,U+6cf7,U+6cfa,U+6d33,U+6e16,U+6e53-6e54,U+6ebb,U+6fb6,U+709d,U+72ad,U+72f7,U+72fb,U+7313,U+739f,U+74ba,U+754b,U+755b,U+758b,U+75ac,U+75d6,U+7617,U+7635,U+7640,U+76a4,U+76b2,U+775a,U+77bd,U+781f,U+79b3,U+7b2b,U+7b31,U+7b3e,U+7b6e,U+7b9c,U+7c0b,U+7c9e,U+7cc1,U+7ce8,U+7ea5,U+7f21,U+7f27,U+7f74,U+7fb0,U+8031,U+8071,U+80ea,U+8114,U+8160,U+81a6,U+81c1,U+829f,U+82a4,U+82fb,U+831a,U+8333,U+836c,U+83b6,U+83f8,U+8411,U+841c,U+8489,U+848c,U+85a4,U+8627,U+8629,U+866e,U+86b5,U+872e,U+8731,U+877b,U+877d,U+87ea,U+8813,U+8816,U+8864,U+88ce,U+88e5,U+897b,U+89cb,U+89f3,U+8bfc,U+8c35,U+8d46,U+8d4d,U+8dba,U+8e3a,U+8f75,U+8f7e,U+8fd3,U+9161,U+9179,U+917e,U+91a3,U+94ac,U+94d7,U+94e5,U+952a,U+952c,U+9545,U+9565,U+9568,U+956a,U+961d,U+96e0,U+972a,U+9730,U+989f,U+98e7,U+990d,U+9967,U+9993,U+9aa3,U+9ac0,U+9ae1,U+9aeb,U+9af9,U+9c86,U+9c8b,U+9ca0-9ca1,U+9ca3,U+9ce2,U+9e48,U+9e6a,U+9e87,U+9ee2,U+9ee9,U+9f17,U+9f19,U+9f2c,U+9f80"}},{uri:wJ,descriptors:{unicodeRange:"U+4ef3,U+50d6,U+50ec,U+51ab,U+51b1,U+52d6,U+54a9,U+54da,U+55be,U+55cd,U+564d,U+572f,U+574c,U+576b,U+57d8,U+57fd,U+5844,U+59d2,U+5ae0,U+5b16,U+5b37,U+5b5b,U+5b80,U+5d1e,U+5d6b,U+5efe,U+5f11,U+5f56,U+5f58,U+5f73,U+5f8c,U+5fc4,U+5fe4,U+602b,U+6106,U+610d,U+63de,U+63f8,U+641b,U+64e4,U+6634,U+676a,U+67b5,U+681d,U+6883,U+69b1,U+69e0,U+6b37,U+6b9b,U+6d7c,U+6ed7,U+6f36,U+6f72,U+6f8c,U+7035,U+7039,U+7173,U+7178,U+7228,U+728f,U+72b4,U+72ef,U+72f4,U+7331,U+7481,U+74e0,U+7540,U+75c3,U+75e6,U+763c,U+764d,U+76cd,U+7704,U+7743,U+7780,U+7847,U+786a,U+78b9,U+7962,U+7a02,U+7aac,U+7ab3,U+7b0a,U+7b4c,U+7b7b,U+7bfc,U+7c0f,U+7c16,U+7c40,U+7ca2,U+7cc7,U+7cf8,U+7d77,U+7e3b,U+7ea1,U+7ea9,U+7ef2,U+7f02,U+7f07,U+7f0c,U+7f23,U+7f2f,U+7fbc,U+8016,U+8020,U+812c,U+8136,U+8182,U+822f,U+8233,U+825f,U+8268,U+8284,U+8288,U+8291,U+8308,U+8311,U+835b,U+836d,U+83dd,U+8406,U+840f,U+845c,U+84b4,U+84e3,U+850c,U+855e,U+863c,U+86ba,U+86c4,U+86de,U+86f1,U+873e,U+87bd,U+87db,U+880a,U+883c,U+887f,U+88f0,U+890a,U+892b,U+895e,U+89ef,U+8a48,U+8bdc,U+8c18,U+8c33,U+8c94,U+8db1,U+8dcf,U+8dd6,U+8de3,U+8e6f,U+8e90,U+8f7a,U+8fb6,U+902d,U+90be,U+91af,U+936a,U+948b,U+94d8,U+9513,U+953a,U+956c,U+963c,U+9654,U+966c,U+9688,U+97b4,U+996b,U+9a75,U+9a7a,U+9aba,U+9aed,U+9b08,U+9b43,U+9c8e,U+9c94,U+9c9a,U+9e2b,U+9e36,U+9e4b,U+9e4e,U+9e55,U+9e63,U+9e68-9e69,U+9ebd,U+9ec9,U+9f0d,U+9f37,U+9f51"}},{uri:EJ,descriptors:{unicodeRange:"U+50a7,U+5240,U+5261,U+52ac,U+531a,U+5363,U+5432,U+5452,U+5456,U+5472,U+5478,U+553f,U+5575,U+5581,U+55cc,U+55fe,U+5601,U+572e,U+57d2,U+57ef,U+581e,U+5924,U+5981,U+5997,U+59a3,U+5aaa,U+5ab8,U+5b34,U+5d5d,U+5def,U+5e11,U+5e91,U+5ed1,U+5ef4,U+5f40,U+600d,U+6019,U+601b,U+605a,U+6092,U+60ab,U+6217,U+623d,U+6369,U+65d2,U+6661,U+670a,U+6753,U+67a7,U+6855,U+68f9,U+6939,U+696e,U+6980,U+6a7c,U+6aab,U+6b82,U+6bf3,U+6bf9,U+6c05,U+6c19-6c1a,U+6ca9,U+6cf6,U+6d1a,U+6dab,U+6f74,U+7085,U+7198,U+71b5,U+7256,U+725d,U+727e,U+72fa,U+7322,U+738e,U+73e5,U+750f,U+755a,U+7594,U+75b3,U+760c,U+7615,U+7630,U+763f,U+77ec,U+7817,U+78a1,U+78d9,U+7905,U+7b2a,U+7b2e,U+7b62,U+7b85,U+7bcc,U+7bea,U+7c26,U+7c74,U+7c9c-7c9d,U+7e47,U+7e9b,U+7e9f,U+7ee0,U+7ee8,U+7ef1,U+7f01,U+7f11,U+7f17,U+7f36,U+7f7e,U+7fee,U+802a,U+80cd,U+8112,U+8169,U+8234,U+8279,U+8298,U+82ca,U+82d8,U+82e1,U+83c0,U+83d4,U+83df,U+8401,U+8451,U+845a,U+8476,U+8478,U+84ba,U+84bd,U+84e0,U+851f,U+8548,U+8556,U+8585,U+868d,U+86e9,U+86f4,U+86f8,U+8765,U+8785,U+87ab,U+87ee,U+8832,U+8872,U+88b7,U+88e2-88e3,U+89da,U+8bce,U+8bd3,U+8bd6,U+8bf9,U+8c16,U+8c73,U+8d5c,U+8dde,U+8f6d,U+8f94,U+8fe8,U+9011,U+915e,U+9185,U+918c,U+94ab,U+94d1,U+94f3,U+9515,U+951d,U+9558,U+9567,U+96ce,U+96e9,U+9785,U+9878,U+987c,U+9883,U+98d1,U+9954,U+9963,U+9a93,U+9ac1,U+9acc,U+9b1f,U+9b49,U+9b4d,U+9b51,U+9ca7,U+9cae,U+9cce,U+9cd3,U+9e37,U+9e39,U+9e41,U+9e46,U+9f22,U+9f2f,U+9f39,U+9f85"}},{uri:CJ,descriptors:{unicodeRange:"U+4e5c,U+4edf,U+4f25,U+4f32,U+4f5e,U+4f76,U+4faa,U+4fe6,U+5028,U+5048,U+5250,U+535f,U+538d,U+53c1,U+5412,U+5443,U+54d4,U+54dd,U+5541,U+5550,U+5577,U+55dd,U+55f3,U+560f,U+562c,U+5657-5658,U+5664,U+56af,U+575c,U+577c,U+57b2,U+57da,U+5800,U+5a62,U+5aeb,U+5c3b,U+5ca3,U+5d26,U+5d9d,U+5f01,U+5fb5,U+5fdd,U+5ff8,U+6029,U+6041,U+6079,U+60b1,U+6222,U+629f,U+6332,U+63bc,U+63e0,U+6485,U+65ab,U+65c3,U+65c6,U+668c,U+669d,U+66be,U+67fd,U+6800,U+68fc,U+690b,U+6924,U+6978,U+69a7,U+6a3e,U+6a50,U+6a5b,U+6a97,U+6b24,U+6b8d,U+6baa,U+6c10,U+6c54,U+6ceb,U+6d04,U+6d4d,U+6eb1,U+6ebd,U+7110,U+71b3,U+71f9,U+7230,U+728d,U+7292,U+72b8,U+72d2,U+7360,U+73a2,U+7511,U+75a0,U+75c8,U+779f,U+7826,U+7877,U+7a39,U+7aa8,U+7ae6,U+7b04,U+7b0f,U+7baa,U+7bac,U+7c1f,U+7ccd,U+7ecb,U+7ed4,U+7ed7,U+7efb,U+7f0d,U+7f5f,U+7faf,U+7fd5,U+7fe5,U+8027,U+80bc,U+80dd,U+80fc,U+8132,U+815a,U+8167,U+816d,U+81ca,U+8228,U+82a1,U+82a9,U+82ab,U+82cc,U+8351,U+8368,U+83b8,U+83d8,U+83ea,U+83f0,U+8497,U+84c1,U+858f,U+85ff,U+867b,U+86a8-86a9,U+870a,U+8722,U+876e,U+877c,U+87e5,U+8888,U+88df,U+8919,U+8bcc,U+8bdf,U+8be8,U+8bee,U+8c20,U+8c2f,U+8d36,U+8df8,U+8e05,U+8e2f,U+8f9a,U+9021,U+908b,U+90b4,U+90ba,U+90d0,U+90eb,U+90fe,U+91aa,U+933e,U+9486-9487,U+948d,U+9490,U+94ad,U+94bd,U+94d6,U+94d9,U+9507,U+9546,U+955e,U+956b,U+95e9,U+9604,U+960b,U+9612,U+9615,U+9617,U+96b9,U+989a-989b,U+989e,U+9a78,U+9a7d,U+9aa0,U+9aa2,U+9ac2,U+9b23,U+9b3b,U+9c82,U+9cca,U+9cd9,U+9e28,U+9e5a,U+9e5e,U+9e6c,U+9efe,U+9f0b"}},{uri:SJ,descriptors:{unicodeRange:"U+4e47,U+4e8d,U+4f65,U+4f89,U+50ee,U+520e,U+5416,U+5454,U+54bb,U+54c2,U+54d3,U+54de,U+5591,U+55e5,U+560c,U+566b,U+5769,U+578c,U+5793,U+57e4,U+5889,U+593c,U+59ab,U+5ad4,U+5ad8,U+5af1,U+5b53,U+5ba5,U+5c59,U+5c63,U+5d5b,U+5e0f,U+5e14,U+5edb,U+5fbc,U+6004,U+60ad,U+610e,U+61b7,U+624c,U+634c,U+647a,U+64ba,U+65f0,U+6600,U+66f7,U+67e2,U+67f0,U+680c,U+686b,U+6874,U+691f,U+6989,U+6a17,U+6b81,U+6b84,U+6c06-6c07,U+6c3d,U+6d07,U+6d27,U+6d2b,U+6d91,U+6e6b,U+6e8f,U+6fde,U+70bb,U+723b,U+726e,U+72b0,U+72ce,U+72f2,U+7301,U+731e,U+737e,U+7477,U+748e,U+74ff,U+7633,U+7654,U+771a,U+7726,U+7765,U+7768,U+781c,U+7829,U+78d4,U+7913,U+7957,U+79d5,U+79eb,U+7a70,U+7a86,U+7b25,U+7b38,U+7b47,U+7b72,U+7ba6-7ba7,U+7dae,U+7ee1,U+7efe,U+7f26,U+7f31,U+7f35,U+801c,U+8043,U+809f,U+80ab,U+80d7,U+8118,U+8188,U+81cc,U+823e,U+8244,U+824f,U+82b4,U+82c1,U+82e4,U+82f4,U+8306,U+833a,U+835c,U+839c,U+83b3,U+83bc,U+846d,U+867a,U+868b,U+8734,U+87ca,U+886e,U+887e,U+88a2,U+88c9,U+8921,U+8bb5,U+8bf3,U+8c04,U+8c17,U+8c1d,U+8c25,U+8c36,U+8c55,U+8c78,U+8d3d,U+8d40,U+8d59,U+8d67,U+8d91,U+8dbf,U+8deb-8dec,U+8dfd,U+8e14,U+8e41,U+8f8e,U+900b,U+9044,U+9062,U+90cf,U+9123,U+9146,U+9162,U+9172,U+918d,U+9190,U+92c8,U+93ca,U+948c,U+94aa,U+94b2,U+94c8,U+94ca,U+94d5,U+94df,U+94e9-94ea,U+94f7,U+94fc-94fd,U+951b,U+954f,U+9554,U+9559,U+9566,U+9571-9572,U+95f1,U+9608,U+960f,U+97af,U+988f,U+98d5,U+992e,U+9955,U+9ab0,U+9b32,U+9c90,U+9c9e,U+9ca5,U+9ca9,U+9cad,U+9cb1,U+9cc3,U+9e47,U+9ee7,U+9f87"}},{uri:_J,descriptors:{unicodeRange:"U+4e93,U+4ec4,U+4ef5,U+4f27,U+4f7b,U+4fe3,U+5080,U+5121,U+51eb,U+5208,U+52f0,U+53f5,U+5453,U+5466,U+54a6,U+54bf,U+54d0,U+5533,U+5549,U+5556,U+556d,U+558f,U+55f2,U+55f5,U+5627,U+567b,U+56d4,U+571c,U+5739,U+57b4,U+5807,U+58c5,U+59a4,U+59af,U+59d8,U+5a09,U+5a0c,U+5a4a,U+5ad2,U+5b6c,U+5ca2,U+5cac,U+5d03,U+5d6c,U+5db7,U+5ebe,U+5f2d,U+5fea,U+6042,U+6120,U+6175,U+6221,U+623e,U+6339,U+638a,U+643d,U+64b8,U+64e2,U+66e9,U+67b3,U+67c1,U+67d2,U+6832,U+6877,U+68f0,U+6934,U+6966,U+6987,U+6998,U+69c1,U+69ce,U+6a3d,U+6a84,U+6aa9,U+6b87,U+6bd6,U+6c16,U+6c18,U+6cd4,U+6cee,U+6de0,U+6e0c,U+6ecf,U+6f4b,U+70b7,U+7168,U+72d9,U+7352,U+73b3,U+73d0,U+7441,U+74d2,U+75a5,U+75e7-75e8,U+7610,U+7619,U+765e,U+772d,U+7812,U+782c,U+784c,U+7850,U+7856,U+789b,U+78f4,U+7a51,U+7b15,U+7b1e,U+7b24,U+7b5a,U+7bb8,U+7bc1,U+7bd9,U+7ed0,U+7ee6,U+7efa,U+7f1b,U+7f1f,U+7f22,U+7f45,U+7f71,U+7fa7,U+7fbf,U+7ff3,U+8052,U+80b1,U+80db,U+80f4,U+81bb,U+81ec,U+8202,U+8210,U+8249,U+828a,U+828e,U+82e3,U+8315,U+8369,U+8378,U+83a8,U+83aa,U+83b4,U+83e1,U+84fc,U+8538,U+853b,U+859c,U+85ae,U+86b4,U+86c9,U+86cf,U+8725,U+879f,U+87b3,U+887d,U+88fe,U+8a8a,U+8ba7,U+8c07,U+8c14,U+8c30,U+8c47,U+8db5,U+8dd7,U+8e1f,U+8e69,U+8e70,U+8e85,U+8f78,U+8f87,U+8f8b,U+8f8f,U+90c4,U+9143,U+917d,U+948f,U+94cd,U+94d2,U+94ef,U+954a,U+9609-960a,U+96d2,U+9708,U+9765,U+97ea,U+9880,U+98a7,U+996c,U+9980,U+9991,U+9a88,U+9ab6,U+9afb,U+9b47,U+9c87,U+9c9b,U+9cb5,U+9cc7,U+9e2c,U+9e42,U+9e58,U+9ecd,U+9ecf,U+9f8a,U+9f8c"}},{uri:kJ,descriptors:{unicodeRange:"U+4ebb,U+4edd,U+4fa9,U+502c,U+50a5,U+51c7,U+51fc,U+523d,U+5241,U+530f,U+5464,U+549d,U+54a3,U+5514,U+5527,U+555c,U+556e,U+5576,U+55b1,U+55b9,U+55eb,U+5624,U+564c,U+5671,U+5685,U+568f,U+56d7,U+56e1,U+57a1,U+57d9,U+5942,U+5a67,U+5c50,U+5c7a,U+5c98,U+5d06,U+5d27,U+5d6f,U+5df3,U+5dfd,U+5e19,U+5ea0,U+5eb9,U+5eea,U+5ffe,U+600f,U+606b,U+6215,U+622c,U+6266,U+62bb,U+62bf,U+6308,U+6387,U+63b8,U+63c4,U+63c6,U+63f6,U+6441,U+6555,U+659b,U+6677,U+66a7,U+6775,U+678b,U+679e,U+6840,U+6849,U+6860,U+68c2,U+6910,U+6a28,U+6a2f,U+6a79,U+6b92-6b93,U+6bc2,U+6bfd,U+6c29,U+6c32,U+6c86,U+6cc5,U+6d0c,U+6d60,U+6da0,U+6ddd,U+6e86,U+6ed3,U+6edf,U+6fb9,U+6fd1,U+6fef,U+7023,U+7080,U+70ca,U+712f,U+7145,U+7284,U+732c,U+73c8,U+73d9,U+740a,U+7457,U+7596,U+759d,U+75a3,U+75d8,U+75e3-75e4,U+75ff,U+7622,U+7688,U+76b4,U+76e5,U+7818,U+7887,U+789a,U+78b2,U+7b08,U+7b33,U+7c2a,U+7ccc,U+7ea8,U+7ec0,U+7fe6,U+8012,U+8084,U+8093,U+80e4,U+80ef,U+8297,U+82a8,U+82be,U+8331,U+8366,U+83c5,U+83fd,U+8473,U+84a1,U+84ca,U+84d1,U+857b,U+85c1,U+85d3,U+8605,U+8662,U+86aa,U+86b1,U+86d4,U+86ed,U+86f3,U+8709,U+8748,U+874c,U+8763,U+89c7,U+89de,U+89e5,U+8a3e,U+8ba6,U+8c00,U+8c21,U+8c49,U+8c7a,U+8d30,U+8df9,U+8e51,U+8e59,U+8f6b,U+8f73,U+8ff3,U+9016,U+9026,U+902f,U+9099,U+909b,U+90c7,U+914a,U+91ae,U+91ba,U+9495,U+94a3,U+94af,U+94ba,U+94bf,U+94cc,U+94e1,U+94f0,U+9531,U+955d,U+95f3,U+9697,U+96bc,U+975b,U+977c,U+98a2,U+998a,U+9994-9995,U+9a9b,U+9ab7,U+9ac5,U+9c91,U+9ccf,U+9cd5,U+9e29,U+9edc,U+9edf,U+9f83,U+9f88-9f89"}},{uri:TJ,descriptors:{unicodeRange:"U+4ee8,U+4f22,U+4f43,U+4f57,U+4f5d,U+4f6f,U+4ff8,U+502d,U+507b,U+5345,U+53df,U+53fb,U+544b,U+5482,U+54a7,U+54cc,U+550f,U+5544,U+5555,U+5594,U+55e8,U+55ec,U+55ef,U+564e,U+56f9,U+5704,U+576d,U+5785,U+57ad,U+5914,U+5958,U+599e,U+59aa,U+59be,U+5a06,U+5abe,U+5ae1,U+5b40,U+5bee,U+5cbf,U+5cc4,U+5ccb,U+5d47,U+603f,U+6078,U+607d,U+607f,U+608c,U+609a,U+60fa,U+61ff,U+621b,U+622e,U+626a,U+6371,U+63ae,U+63cd,U+63d6,U+6410,U+6414,U+6421,U+6448,U+64d8,U+6710,U+6748,U+6772,U+680e,U+6954,U+69ab,U+6c68,U+6c8f,U+6ca4,U+6d2e,U+6e4e,U+6e98,U+6fe0,U+7094,U+70e9,U+7116,U+7119,U+723f,U+73c9,U+74e4,U+753e,U+7548,U+75bd,U+75cd,U+7618,U+7634,U+76c5,U+76f1,U+7708,U+7719,U+777e,U+7791,U+77b3,U+7823,U+7827,U+7830,U+7889,U+7893,U+7949,U+795c,U+79e3,U+7a14,U+7a88,U+7a95,U+7aa0,U+7afd,U+7b90,U+7bd1,U+7bfe,U+7da6,U+7ec2,U+7eef,U+7f03-7f04,U+7f08,U+7f58,U+7f61,U+7f9f,U+8174,U+8200,U+828d,U+82c4,U+82d5,U+82dc,U+82f7,U+832d,U+835a,U+840b,U+8438,U+852b,U+869d,U+86ac,U+86d0,U+86f0,U+8782,U+87a8,U+87d1-87d2,U+87e0,U+8839,U+8913,U+891b,U+8934,U+8941,U+89ca,U+89ce,U+8a07,U+8ba3,U+8bc5,U+8bcb,U+8bdb,U+8c11,U+8c15,U+8c29,U+8c32,U+8dc4,U+8dce,U+8ddb,U+8dfa,U+8e09,U+8e1d,U+8e39,U+8e42,U+8e49,U+8e4b,U+8e8f,U+8f71-8f72,U+9004,U+9036,U+9097,U+90dc,U+90e2,U+90e6,U+90ef,U+9104,U+919a,U+91b4,U+938f,U+9497,U+950f,U+9557,U+9562-9563,U+9573,U+9606,U+9649,U+972d,U+973e,U+97a3,U+97eb,U+988c,U+9894,U+98a6,U+9974,U+9977,U+997d,U+9a90,U+9a9d,U+9aef,U+9ca2,U+9ccd,U+9cdf,U+9e20,U+9e4c,U+9e6b,U+9f3e"}},{uri:MJ,descriptors:{unicodeRange:"U+4ede,U+4ee1,U+4eeb,U+4fda,U+4ffe,U+5025,U+506c,U+50f3,U+5106,U+520d,U+525c,U+52ad,U+530d,U+5310,U+539d,U+53a9,U+53fc,U+5421,U+5477,U+54e7,U+551b,U+5530,U+557e,U+5599,U+55c4,U+55d1,U+55d4,U+55df,U+55e4,U+55ea,U+5623,U+562d,U+5654,U+56eb,U+56f5,U+57a7,U+57d5,U+57dd,U+584d,U+5880,U+58ec,U+59dd,U+5a32,U+5a55,U+5a75,U+5b51,U+5b71,U+5b73,U+5cd2,U+5ce4,U+5e5b,U+5e96,U+5fd2,U+607b,U+61d1,U+634b,U+636d,U+63b3,U+63ff,U+64c0,U+661d,U+6657,U+66dc,U+67a5,U+6841,U+6867,U+6901,U+699b,U+6a47,U+6b46,U+6c21,U+6c24,U+6c35,U+6c4a,U+6c94,U+6ca3,U+6d39,U+6d63,U+6d6f,U+6d94,U+705e,U+71e7,U+726f,U+72cd,U+72de,U+72f0,U+7325,U+7350,U+7391,U+741a,U+757f,U+7583,U+75b1,U+75b4,U+75b8,U+75c2,U+75f1,U+766f,U+7699,U+7751,U+789c,U+7a17,U+7be6,U+7cb2,U+7ea3,U+7eb0,U+7ebe,U+7eeb,U+7f25,U+7f2c,U+7fb8,U+8026,U+8037,U+8153,U+8171,U+8191,U+8214,U+821b,U+8222,U+826e,U+82eb,U+830c,U+8314,U+8334,U+83d6,U+8418,U+843c,U+84ff,U+8564,U+8572,U+8616,U+866c,U+8693,U+86a3,U+86a7,U+86af,U+86b6,U+86c6,U+86ca,U+8708,U+870d,U+8759,U+8760,U+87af,U+87c6,U+8869,U+88c6,U+89d0,U+8b07,U+8baa-8bab,U+8bc2,U+8be4,U+8bf0,U+8c2a,U+8c62,U+8c89,U+8d49,U+8d6d,U+8d84,U+8d94,U+8db8,U+8dc6,U+8e2e,U+8e3d,U+8e47,U+8e7f,U+9005,U+9051,U+907d,U+9082,U+9088,U+90b0,U+90d3,U+9150,U+949c,U+94a4,U+94b9,U+94cb,U+94e0,U+9509,U+9512,U+951f,U+9534,U+9552-9553,U+965f,U+96b0,U+9791,U+9889,U+9990,U+9a9c,U+9aa7,U+9c88,U+9cb2-9cb3,U+9cb6-9cb7,U+9cc5,U+9cdc,U+9e22,U+9e2a,U+9e57,U+9e67,U+9e73,U+9e82,U+9eb8,U+9ee0,U+9f9b"}},{uri:IJ,descriptors:{unicodeRange:"U+4eb5,U+4f09,U+4f5a,U+4f8f,U+4fce,U+4fdf,U+4fea,U+4ff3,U+500c,U+500f,U+504e,U+5088,U+52be,U+5420,U+5457,U+5499,U+549b,U+54c6,U+54d2,U+558b,U+559f,U+55bd,U+55d6,U+565c,U+567c,U+568e,U+5768,U+577b,U+57a9,U+57ed,U+59f9,U+5a11,U+5a40,U+5ae6,U+5b6a,U+5b93,U+5bb8,U+5c15,U+5c99,U+5c9c,U+5cc1,U+5d2e,U+5d4b,U+5d99,U+5e54,U+5e61,U+5fcf-5fd1,U+6002,U+6006,U+6014,U+60af,U+60c6,U+60da,U+60f4,U+621f,U+62c8,U+631b,U+631e,U+63e9,U+64b5,U+655d,U+6619,U+6635,U+6641,U+67ad,U+67b0,U+67b7,U+67e9,U+684e,U+688f,U+695d,U+696b,U+69b7,U+6a58,U+6c26,U+6d35,U+6d43,U+6d9e,U+6dd9,U+6dec,U+6e11,U+6e6e,U+6e9f,U+6ec2,U+6ee2,U+6ef9,U+6f09,U+6f66,U+6f8d,U+6fc2,U+6fc9,U+729f,U+72c8,U+73de,U+7430,U+7566,U+7579,U+75c9,U+75e2,U+75fc,U+762a,U+7638,U+7678,U+76c2,U+76f9,U+778c,U+77cd,U+77dc,U+7800,U+781d,U+782d,U+783b-783c,U+78a3,U+78ec,U+7980,U+7a23,U+7b95,U+7bdd,U+7c0c,U+7c41,U+7c91,U+7cb3,U+7cc5,U+7ecc,U+7f19,U+7fca,U+8006,U+8069,U+807f,U+80bd,U+80ed,U+814b,U+8198,U+82cb,U+82d2,U+834f,U+8360,U+847a,U+84d6,U+84e5,U+8537,U+85d0,U+8671,U+86a4,U+86ce,U+86f9,U+8703,U+8707,U+8737,U+873b,U+8815,U+8936,U+8bc3,U+8bcf,U+8bd2,U+8bd8,U+8be9,U+8c0c,U+8c0f,U+8c4c,U+8d45,U+8d5d,U+8d73,U+8e31,U+8e6d,U+8e76,U+8fe4,U+9041,U+90d7,U+9169,U+92ae,U+94a1,U+94c4,U+94c9,U+94db,U+94e7,U+9503,U+9506,U+9517,U+9528,U+9537,U+9542,U+9549,U+95fe,U+9616,U+961a,U+96c9,U+96f3,U+9701,U+970e,U+9739,U+9753,U+9798,U+98d2-98d3,U+98d9-98da,U+9968,U+996f,U+9984,U+9997,U+9acb,U+9b03,U+9c85,U+9ca8,U+9cab,U+9e49,U+9e51,U+9e66,U+9f10"}},{uri:AJ,descriptors:{unicodeRange:"U+4e15,U+4e1e,U+4e2b,U+4eb3,U+4ec9,U+4f0e,U+4f64,U+501c,U+50a9,U+510b,U+51a2,U+51bc,U+527d,U+52d0,U+53fd,U+5429,U+542e,U+5486,U+54af,U+5506,U+5511,U+5522,U+552c,U+556c,U+55b3,U+55d2,U+55e6,U+55fd,U+561f,U+5639,U+5659,U+5662,U+5693,U+572a,U+5892,U+598a,U+5992,U+59a9,U+5a20,U+5ae3,U+5b17,U+5b7d,U+5d34,U+5d3d,U+5d4a,U+5d82,U+5e1a-5e1b,U+5ea5,U+5f0b,U+5f77,U+5fd6,U+5fff,U+6026,U+6035,U+6063,U+60b4,U+60bb,U+60ee,U+612b,U+6194,U+61ca,U+61e6,U+61f5,U+620a,U+6248,U+62a1,U+62d7,U+6376,U+637b,U+652b,U+65bc,U+65cc,U+65ce,U+65d6,U+664c,U+665f,U+6666,U+6684,U+66b9,U+6773,U+6777,U+6787,U+67de,U+6845,U+693d,U+6994,U+6a35,U+6d54,U+6d5c,U+6d8e,U+6dd6,U+6eb4,U+6f2a,U+6f78,U+704f,U+70ec,U+7118,U+714a,U+7172,U+71b9,U+724d,U+728a,U+7337,U+733e,U+7396,U+73b7,U+73cf,U+7428,U+742c,U+742e,U+74ee,U+74f4,U+7525,U+753a,U+7572,U+75d4,U+765c,U+768e,U+7762,U+777d,U+77fd,U+7825,U+7837,U+78b4,U+795f,U+79ed,U+7a1e,U+7b06,U+7b20,U+7ba9,U+7bab,U+7c7c,U+7cbd,U+7cdc,U+7ec9,U+7ef6,U+7f30,U+7f42,U+7f44,U+7f54,U+7f94,U+8004,U+800b,U+8019,U+809b,U+80ae,U+80c4,U+80f1,U+8146,U+816e,U+817c,U+81c0,U+81fc,U+81fe,U+822b,U+830f,U+832f,U+8340,U+8365,U+8385,U+8392,U+83a0,U+8424,U+84af,U+869c,U+8713,U+8717-8718,U+87c0,U+87cb,U+87fe,U+8821,U+8902,U+89d1,U+8bb9,U+8c12,U+8d32,U+8d53,U+8df7,U+8e7c,U+8f7c,U+8f95,U+8fab,U+9052,U+905b,U+9095,U+909d,U+90c5,U+911e,U+9122,U+916a,U+919b,U+948e,U+9492,U+949a,U+94b5,U+94bc,U+94c6,U+94f1,U+9502,U+9511,U+9536,U+956f-9570,U+9602,U+9621,U+9631,U+998b,U+99a5,U+9a81,U+9a9e,U+9ebe,U+9f8b"}},{uri:LJ,descriptors:{unicodeRange:"U+4f2b,U+4f3d,U+4fac,U+5043,U+5055,U+5140,U+5156,U+51cb,U+5243,U+531d,U+536f,U+53a5,U+53ae,U+53f1,U+541d,U+5431,U+547b,U+5492,U+5494,U+54a4,U+54aa,U+54ce,U+54fd,U+5509,U+5520,U+553e,U+557b,U+55c5,U+55e1,U+55f7,U+5608,U+5636,U+563b,U+5773,U+57a0,U+5811,U+587e,U+58d5,U+59e3,U+5a29,U+5a6a,U+5a76,U+5a7a,U+5ac9,U+5b62,U+5b95,U+5c49,U+5c8c,U+5cab,U+5cb7,U+5d02,U+5d58,U+5e44,U+5e7a,U+5eff,U+5f29,U+5f89,U+5f9c,U+5fa8,U+6005,U+6043,U+60b8,U+60d8,U+60ec,U+60f0,U+6115,U+618e,U+630e,U+637a,U+6390,U+63ac,U+63b0,U+64de,U+6525,U+6538,U+65ee-65ef,U+6631,U+6636,U+6654,U+677c,U+67b8,U+67d8,U+683e,U+6886,U+68b5,U+692d,U+6963,U+6979,U+6988,U+6b59,U+6b9a,U+6c69,U+6c74,U+6cae,U+6ce0,U+6cef,U+6d95,U+6dc5,U+6dde,U+6de6,U+6dfc,U+6ea7,U+6f15,U+6f29,U+7096,U+70c3,U+7131,U+715c,U+7166,U+7266,U+7317,U+731d,U+7329,U+73e9,U+7425,U+7455,U+7490,U+74ef,U+7519,U+75b5,U+75b9,U+75de,U+7656,U+7663,U+7691,U+7729,U+77fe,U+783e,U+787c,U+795a,U+7a79,U+7abf,U+7b3a,U+7b4f,U+7b60,U+7b75,U+7b8d,U+7bb4,U+7bd3,U+7be1,U+7cbc,U+7edb,U+7f1c,U+7f8c,U+7fb2,U+7fb9,U+7fce,U+7ff1,U+810d,U+81c6,U+82a5,U+82aa,U+82de,U+8317,U+8343,U+835e,U+8364,U+836a,U+853a,U+8543,U+854a,U+8559,U+8568,U+85b0,U+85b9,U+864f,U+86e4,U+8715,U+8845,U+8884,U+88e8,U+88f1,U+8983,U+8be1,U+8c1f,U+8c27,U+8c5a,U+8c82,U+8d58,U+8dbe,U+8f98,U+9035,U+9074,U+90a1,U+9149,U+9157,U+93d6,U+949d,U+94c2,U+94e3-94e4,U+95eb,U+95f0,U+9611,U+9619,U+9642,U+968d,U+9706,U+970f,U+97ed,U+988a,U+9893,U+98e8,U+9a77,U+9a87,U+9aa1,U+9abc,U+9cdd,U+9e2f,U+9e33,U+9e44,U+9e5c,U+9e9d,U+9edd"}},{uri:RJ,descriptors:{unicodeRange:"U+4f58,U+4f6c,U+4f70,U+4fd0,U+5014,U+51bd,U+524c,U+5315,U+5323,U+535e,U+540f,U+542d,U+545b,U+548e,U+549a,U+54ab,U+54fc,U+5567,U+556a,U+5600,U+5618,U+563f,U+5669,U+56f1,U+56ff,U+573b,U+574d,U+579b,U+57b8,U+57c2,U+586c,U+58f9,U+595a,U+598d,U+5993,U+5996,U+59d7,U+5b7a,U+5ba6,U+5c4e,U+5c96,U+5ce5,U+5eb6,U+5f08,U+5f99,U+602f,U+6059,U+606c,U+607a,U+60ed,U+61a9,U+620c,U+6249,U+62a8,U+62c4,U+62ed,U+62fd,U+6342,U+6345,U+6396,U+63a3,U+6402,U+6413,U+642a,U+6487,U+64a9,U+64ac,U+64ae,U+64b7,U+659f,U+65a1,U+667e,U+66f3,U+67e0,U+69db,U+69df,U+6aac,U+6b86,U+6c50,U+6c5e,U+6c76,U+6c85,U+6c8c,U+6cde,U+6d19,U+6d52,U+6da7,U+6db8,U+6e1a,U+6e25,U+6e4d,U+6e5f,U+6ec1,U+6f31,U+6f7a,U+6fa7,U+6fe1,U+701b,U+70ab,U+70f7,U+717d,U+71a8,U+7252,U+72c4,U+72e1,U+7315,U+736d,U+73ae,U+73c0,U+73c2,U+740f,U+75a4,U+7600-7601,U+768b,U+76bf,U+76d4,U+7728,U+772f,U+776c,U+77a0,U+77b0,U+77f8,U+783a,U+78d0,U+78fa,U+7977,U+7a37,U+7a92,U+7afa,U+7b71,U+7b94,U+7cef,U+7f28,U+7fe1,U+808b,U+80e5,U+80eb,U+8110,U+8113,U+812f,U+814c,U+81c3,U+8235,U+82d4,U+8309,U+83c1,U+8431,U+8469,U+84bf,U+84d3,U+84df,U+84e6,U+8511,U+8638,U+86c0,U+86db,U+86fe,U+8757,U+8822,U+8882,U+8885,U+8892,U+88f3,U+892a,U+8ba5,U+8bd9,U+8be0,U+8be7,U+8bfd,U+8c1a,U+8d4a,U+8d4e,U+8d66,U+8dda,U+8e0c,U+8e52,U+8e74,U+8e87,U+8f76,U+8fc2,U+8fe6,U+900d,U+9068,U+90ac,U+90b3,U+90b8,U+90e7,U+9119,U+9131,U+915a,U+916e,U+94b4,U+94d0,U+94e2,U+94ec,U+94ff,U+9522,U+9535,U+9556,U+965b,U+96f9,U+9774,U+9981,U+998d,U+998f,U+9a6e,U+9a7f,U+9a8a,U+9b13,U+9c9f,U+9e3e,U+9e43,U+9e6d,U+9e8b,U+9e92,U+9edb,U+9eef"}},{uri:DJ,descriptors:{unicodeRange:"U+4e10,U+4e56,U+4e98,U+4ec3,U+4f3a,U+4f5f,U+4f88,U+4f97,U+4fa5,U+4fe8,U+504c,U+5197,U+52fa,U+5364,U+53e8,U+5406,U+543c,U+545c,U+5471,U+5480,U+5495,U+54b3,U+54df,U+54e6,U+54ee,U+557c,U+5583,U+55dc,U+55e3,U+566c,U+592f,U+5944,U+5983,U+59ca,U+59e5,U+5a13,U+5a7f,U+5b09,U+5bd0,U+5e4c,U+5eb5,U+5f1b,U+5f3c,U+608d,U+60cb,U+61a7,U+61ac,U+61cb,U+6233,U+62a0,U+62e7,U+62ee,U+62f4,U+62f7,U+634e,U+6382,U+63c9,U+63ea,U+6400,U+645e,U+6482,U+6556,U+6593,U+6615,U+664f,U+66e6,U+672d,U+675e,U+67da,U+6805,U+6808,U+6868,U+68a2,U+695e,U+69ad,U+6a80,U+6a90,U+6b83,U+6be1,U+6c30,U+6cad,U+6cb1,U+6cf1,U+6d31,U+6d93,U+6dae,U+6dbf,U+6dc6-6dc7,U+6e0d,U+6e32,U+6e3a,U+6e85,U+6eba,U+6f3e,U+6f5e,U+6f7c,U+6fee,U+71ee,U+722a,U+72b7,U+72e9,U+73ba,U+73d1,U+7409,U+7435-7436,U+7459-745a,U+747e,U+7487,U+74e2,U+7504,U+752c-752d,U+7599,U+759f,U+75a1,U+75ca,U+75f0,U+761f,U+7629,U+777f,U+7785,U+77a5,U+77bf,U+78d5,U+7934,U+7940,U+79a7,U+7b19,U+7c38,U+7c95,U+7cb1,U+7ce0,U+7eca,U+7ef7,U+7f2b,U+7f81,U+7fcc,U+8046,U+8148,U+8165,U+819b,U+81ba,U+828b,U+82ae,U+82b7,U+82d3,U+8301,U+830e,U+831c,U+8338,U+837c,U+8393,U+8398,U+83ba,U+83e0,U+83e9,U+853c,U+8654,U+86df,U+8712,U+873f,U+874e,U+8783,U+8859,U+88a4,U+8925,U+8bb7,U+8bff,U+8c19,U+8c1b,U+8c24,U+8c2c,U+8d61,U+8db4,U+8e6c,U+8f8a,U+8fe5,U+8ff8,U+901e,U+90f4,U+912f,U+9163,U+9170,U+91dc,U+949b,U+94a8,U+94b3,U+94c0,U+94e8,U+9525,U+9530,U+9539,U+954c-954d,U+9550,U+955b,U+962a,U+9685,U+96cc,U+9776,U+988d,U+9975,U+9985,U+9a6f,U+9aa5,U+9ab8,U+9c7f,U+9ca4,U+9cb8,U+9e25,U+9e35,U+9e4a"}},{uri:jJ,descriptors:{unicodeRange:"U+4ea2,U+4ea5,U+4f36,U+4f84,U+4f8d,U+501a,U+5029,U+516e,U+51a5,U+51c4,U+51f8,U+5201,U+527f,U+5321,U+5352,U+5366,U+53e9,U+54c7,U+5632,U+5676,U+56b7,U+56bc,U+56da,U+56e4,U+5703,U+5729,U+5742,U+57a2-57a3,U+5815,U+58d1,U+5919,U+592d,U+5955,U+5a05,U+5a25,U+5a34,U+5b70,U+5b75,U+5bdd,U+5bf0,U+5c41,U+5c79,U+5c91,U+5c94,U+5ce6,U+5ced,U+5d69,U+5dc5,U+5e16,U+5e27,U+5f27,U+5f95,U+5ffb,U+6020,U+604d,U+6055,U+60e6,U+60eb,U+6123,U+618b,U+61a8,U+620d,U+62c7,U+62ce,U+62d9,U+631f,U+634d,U+6452,U+6479,U+64ce,U+64d2,U+655b,U+660a,U+6726,U+67c4,U+6809,U+6853,U+68e3,U+68f1,U+68fa,U+693f,U+6942,U+6995,U+69a8,U+69b4,U+6a71,U+6b89,U+6bcb,U+6bd3,U+6bd9,U+6c40,U+6cf8,U+6cfe,U+6d85,U+6da3,U+6daa,U+6e0e,U+6e43-6e44,U+6f88,U+7078,U+7099,U+70bd,U+70d9,U+70fd,U+7109,U+7184,U+7239,U+733f,U+73f2,U+748b,U+749c,U+749e,U+759a,U+75d2,U+75eb,U+7620,U+766b,U+7693,U+76cf,U+7738,U+773a,U+776b,U+778e,U+77aa,U+7852,U+78be,U+7948,U+795b,U+7960,U+796f,U+79ba,U+7a20,U+7a96,U+7aa5,U+7b03,U+7b28,U+7b50,U+7b77,U+7bc6,U+7bf1,U+7c27,U+7d0a,U+7ead,U+7ec5,U+7ee2,U+7ef0,U+7efd,U+7f0e,U+7f2e,U+7f79,U+7f9a,U+8098,U+80da,U+80e7,U+80f0,U+80f3,U+80fa,U+818a,U+81e7,U+8237-8238,U+8299,U+82b8,U+82ce,U+837b,U+83bd,U+83cf,U+8426,U+8475,U+85c9,U+85d5,U+85dc,U+85e9,U+871a,U+8747,U+8749,U+888d,U+8910,U+891a,U+8bb4,U+8be3,U+8bec,U+8bf2,U+8c06,U+8c0d,U+8d31,U+8d48,U+8de4,U+8e1e,U+8e4a,U+8e66,U+8f84,U+8f97,U+9083,U+90e1,U+9165,U+91c9,U+94b0,U+94f5,U+9504,U+9532,U+956d,U+95f5,U+95fa,U+9668,U+9698,U+96bd,U+9704,U+9773,U+9890,U+996a,U+997a,U+9a74,U+9a8b,U+9cc4,U+9ccc"}},{uri:PJ,descriptors:{unicodeRange:"U+4ea8,U+4f1e,U+4f51,U+4f63,U+4f7c,U+4f83,U+4fa0,U+4fd1,U+4ffa,U+5018,U+5026,U+508d,U+50bb,U+50f5,U+50fb,U+5162,U+5319,U+5320,U+538c,U+5413,U+541f,U+5475,U+54bd,U+54d1,U+5589,U+5598,U+575f,U+57ae,U+57e0,U+5937,U+5974,U+5978,U+59ae,U+5a1f,U+5a49,U+5ab3,U+5b99,U+5b9b,U+5ba0,U+5be1,U+5be5,U+5c09,U+5c27,U+5de2,U+5e9a,U+5f26,U+5f8a,U+5f98,U+6021,U+606d,U+60bc,U+60d5,U+60e7,U+611a,U+614c,U+6254,U+626f,U+6292,U+6296,U+62b9,U+62e2,U+631a,U+631d,U+6320,U+6346,U+63ba,U+6467,U+64bc,U+658b,U+663c,U+6643,U+6652,U+6656,U+6687,U+66d9,U+66dd,U+66f0,U+673d,U+67ab,U+6816-6817,U+68a7,U+68ad,U+68cd,U+68e0,U+6986,U+69fd,U+6b47,U+6bd7,U+6c1f,U+6c2e-6c2f,U+6cbe,U+6de4,U+6e1d,U+6e83,U+6e9c,U+6ed4-6ed5,U+6f4d,U+70f9,U+7130,U+716e,U+718f,U+71ac,U+71e5,U+72fc,U+731c,U+7334,U+73ca,U+7422,U+7426,U+745f,U+7470,U+75af,U+75f4,U+762b,U+763e,U+7696,U+7737,U+7741,U+77a7,U+77bb,U+77ee,U+785d,U+788c,U+78ca,U+7901,U+796d,U+7985,U+79fd,U+7a3c,U+7a57,U+7a74,U+7b5b,U+7caa,U+7cb9,U+7cd5,U+7eac,U+7eb6,U+7ed1,U+7ee5,U+7f20,U+7f2a,U+7f38,U+7f69,U+7fa1,U+8018,U+8038,U+803f,U+804b,U+80a2,U+80be,U+80d6,U+817a,U+81fb,U+820c,U+82ad,U+82af,U+82bd,U+8327,U+8354,U+835f,U+8367,U+836b,U+840c,U+841d,U+8471,U+849c,U+84b2,U+84c9,U+8517,U+851a,U+8549,U+8681,U+8721,U+8776,U+88d9,U+88f9,U+89c5,U+8c1c,U+8c34,U+8d81,U+8d9f,U+8e0a,U+8e72,U+8eb2,U+8fed,U+901b,U+902e,U+906e,U+9091,U+90aa,U+90af,U+915d,U+9171,U+946b,U+9489,U+9499,U+94a5,U+9508,U+9524,U+952d,U+9551,U+9576,U+95f7,U+9600,U+96b6,U+96c0,U+9756,U+97f6,U+98a0,U+98a4,U+997f,U+9a73,U+9a86,U+9ad3,U+9e3d,U+9ed4"}},{uri:NJ,descriptors:{unicodeRange:"U+4e4d,U+4e5e,U+4ec7,U+4ed5,U+50da,U+50e7,U+515c,U+51a4,U+51ff,U+5203,U+5254,U+5300,U+533e,U+5375,U+53ee,U+5435,U+543b,U+5455,U+548b,U+548f,U+54d7,U+54fa,U+5578,U+5587,U+55a7,U+560e,U+5760,U+576f,U+5777,U+5830,U+58a9,U+5962,U+59e8,U+5a07,U+5a23,U+5a3c,U+5b5a,U+5bb5,U+5bc5,U+5bde,U+5c7f,U+5cb1,U+5ce8,U+5cea,U+5d29,U+5d4c,U+5e18,U+5f57,U+5f5d,U+5f87,U+5ff1,U+6016,U+601c,U+6064,U+6177,U+61d2,U+625b,U+62e3,U+62f1,U+634f,U+63a0,U+6401,U+6405,U+6495,U+64c2,U+6512,U+6577,U+6590,U+65a7,U+65a9,U+65f7,U+6627,U+6655,U+6714,U+6795,U+67d1,U+67ff,U+68b3,U+68d5,U+68d8,U+6930,U+6960,U+6977,U+69bb,U+69d0,U+6a31,U+6b7c,U+6bb4,U+6c22,U+6c72,U+6c79,U+6c7e,U+6c81,U+6c93,U+6ca5,U+6cbc,U+6ce3,U+6cfb,U+6d3c,U+6da9,U+6df3,U+6e2d,U+6eaf,U+6ec7,U+6f13,U+6f33,U+6f62,U+6fa1,U+7011,U+707c,U+708a,U+70c1,U+70d8,U+70eb,U+711a,U+7194,U+7281,U+7316,U+7357,U+7384,U+7405,U+742a,U+745b,U+7574,U+7578,U+75ea,U+7682,U+7792,U+77d7,U+77e9,U+77eb,U+77f6,U+780c,U+78c5,U+7941,U+79e4,U+7a1a,U+7a9c,U+7ad6,U+7b5d,U+7bf7,U+7c07,U+7c3f,U+7c9f,U+7ca5,U+7cdf,U+7e82,U+7eab,U+7ece,U+7eda,U+7f09,U+7f15,U+7f9e,U+7fdf,U+7fe9,U+803b,U+803d,U+80aa,U+80b4,U+813e,U+8155,U+817b,U+819d,U+821c,U+82b9,U+82df,U+82ef,U+8304,U+83b9,U+8446,U+853d,U+85af,U+85fb,U+8650,U+865e,U+86d9,U+86ee,U+8700,U+8862,U+889c,U+88d4,U+88f8,U+895f,U+8a79,U+8bb3,U+8bb6,U+8bc0,U+8beb,U+8bf5,U+8c23,U+8c79,U+8d1e,U+8dcb,U+8e29,U+8e44,U+8e81,U+8eac,U+8eaf,U+8f8d,U+9050,U+90f8,U+914b,U+948a,U+94be,U+94ee,U+950c,U+9540,U+962e,U+9647,U+9661,U+9699,U+96cf,U+9716,U+9761,U+97a0,U+97e7,U+9a7c,U+9a8f,U+9ae6,U+9cd6,U+9e26"}},{uri:OJ,descriptors:{unicodeRange:"U+4fa3,U+4fae,U+4fd8,U+4fef,U+50a3,U+5189,U+5195,U+51db,U+51f3,U+51f9,U+5220,U+5228,U+5288,U+52ff,U+532e,U+533f,U+5351,U+53db,U+53ed,U+5450,U+5484,U+5490,U+54c9,U+54e9,U+5501,U+5507,U+5543,U+55d3,U+56a3,U+575e,U+589f,U+5984,U+59ec,U+5a04,U+5a36,U+5a77,U+5a9a-5a9b,U+5ab2,U+5ac2,U+5ad6,U+5bc7,U+5c2c,U+5c34,U+5c51,U+5cd9,U+5d0e,U+5deb,U+5e3c,U+5e87,U+5ed3,U+5f13,U+5f64,U+5fe1,U+606a,U+6096,U+60df,U+60f6,U+60f9,U+6151,U+620e,U+6241,U+6252,U+6273,U+627c,U+6289,U+62c2,U+62cc,U+62ef,U+6361,U+6363,U+63b7,U+63e3,U+6518,U+66ae,U+6756,U+6789,U+6813,U+6829,U+6862,U+6866,U+6893,U+6897,U+690e,U+6984,U+69cc,U+6a1f,U+6a44,U+6a59,U+6ba1,U+6c13,U+6c90,U+6ca6,U+6cbd,U+6ccc,U+6cd3,U+6cd7,U+6d4a,U+6d4f,U+6d5a,U+6d9f,U+6da1,U+6dcc,U+6ea5,U+6ee4,U+6ee6,U+6f2f,U+6f8e,U+701a,U+7095,U+709c,U+70af,U+70db,U+70e8,U+714e,U+715e,U+71a0,U+71ce,U+7235,U+7280,U+72d0,U+72f8,U+73ab,U+7410,U+745c,U+7480,U+74a7-74a8,U+74e3,U+75ae,U+75f9,U+76b1,U+76ce,U+7736,U+77e2-77e3,U+781a,U+789f,U+797a,U+79be,U+79c3,U+79c6,U+79f8,U+7a8d,U+7a98,U+7aa6,U+7aff,U+7b1b,U+7cd9,U+7d6e,U+7ede,U+7eee,U+7f00,U+7f24,U+7f2d,U+7fd8,U+800d,U+8116,U+8151,U+81b3,U+8205,U+82c7,U+82db,U+832c,U+8335,U+8339,U+8386,U+846b,U+8587,U+8611,U+8682,U+868a,U+868c,U+8774,U+88d8,U+88f4,U+8912,U+8b6c,U+8bbd,U+8c0e,U+8c41,U+8d26,U+8d3b-8d3c,U+8d50,U+8dea,U+8e35,U+8f99,U+8fe2,U+8fe9,U+9017,U+914c,U+916f,U+9175-9176,U+918b,U+94a0,U+94ae,U+94ce,U+94f2,U+951a,U+952f,U+9541,U+9640,U+9672,U+968b,U+96cd,U+96ef,U+9713,U+97ec,U+9885,U+9992,U+9a6d,U+9a79,U+9a85,U+9cbb,U+9cd7,U+9cde,U+9e93,U+9f9f"}},{uri:FJ,descriptors:{unicodeRange:"U+4e11,U+4ed7,U+4fcf,U+4fe9,U+4fed,U+50ac,U+50b2,U+5112,U+5180,U+5188,U+51f6,U+522e,U+5265,U+52cb,U+52df,U+5349,U+5367,U+5378,U+537f,U+5395,U+5398,U+53d4,U+543e,U+5440,U+5446,U+54b8,U+5565-5566,U+5580,U+55bb,U+56ca,U+572d,U+573e,U+574e,U+5782-5784,U+58f3,U+5938-5939,U+5948,U+594e,U+5a1c,U+5a74,U+5ae9,U+5b55,U+5b5c,U+5bb0,U+5bd3,U+5bf8,U+5c3f,U+5d14,U+5d2d,U+5df7,U+5dfe,U+5e05-5e06,U+5e1c,U+5e62,U+5e7b,U+5e7d,U+5ed6,U+5f2f,U+5f66,U+5f6c,U+5fa1,U+604b,U+609f,U+60a6,U+60e8,U+6101,U+6124,U+6127,U+6148,U+61be,U+6247,U+62d8,U+62da,U+633d,U+635e,U+6367,U+6380,U+638f,U+63a9,U+63fd,U+641c,U+64e6,U+655e,U+6572,U+6591,U+65a5,U+6691,U+6735,U+67a2-67a3,U+67ef,U+680b,U+6876,U+6905,U+6a0a,U+6a61,U+6b79,U+6bb7,U+6bbf,U+6c41,U+6c55,U+6c83,U+6c9b,U+6ca7,U+6cfc,U+6d46,U+6d51,U+6d74,U+6d9d,U+6daf,U+6dc0,U+6deb,U+6e17,U+6e24,U+6e89,U+6ea2,U+6ef4,U+6f6d,U+707f,U+70b3,U+70e4,U+70ef,U+710a,U+722c,U+725f,U+7261,U+72ee,U+72f1,U+730e,U+732b,U+7433,U+7538,U+75bc,U+7624,U+7709,U+7750,U+7779,U+7802,U+7898,U+78a7,U+78b1,U+78cb,U+78f7,U+7984,U+7a83,U+7aed,U+7b3c,U+7b4b,U+7c92,U+7c98,U+7ca4,U+7eb9,U+7ee3,U+7ef3,U+7ef5,U+7f05,U+7f55,U+7f62,U+7fc1,U+7fd4,U+7fe0,U+8042,U+806a,U+80a0,U+80a4,U+80c3,U+8102,U+8106,U+814a,U+8154,U+8247,U+8258,U+82cd,U+8328,U+832b,U+8389,U+83ca,U+845b,U+846c,U+84b8,U+8574,U+859b,U+8680,U+8695,U+86c7,U+8702,U+886c,U+8896,U+88b1,U+88e4,U+8bc8,U+8c10,U+8c26,U+8c28,U+8c2d,U+8d4c,U+8d63,U+8f67,U+8f74,U+8fc4,U+9006,U+9063,U+90a2,U+90b1,U+90c1,U+9177,U+9189,U+9493,U+949e,U+94fe,U+9610,U+961c,U+96a7,U+96fe,U+978d,U+97f5,U+9888,U+997c,U+9a84,U+9b3c,U+9b44-9b45,U+9b54,U+9e64,U+9f0e,U+9f9a"}},{uri:$J,descriptors:{unicodeRange:"U+4e19,U+4e38,U+4e53,U+4e7e,U+4e9f,U+4ec6,U+4f50,U+4fde,U+502a,U+5154,U+517d,U+51d1,U+51f0,U+5239,U+5256,U+52c9,U+52fe,U+5308,U+532a,U+535c,U+5384,U+53a2,U+53a8,U+53c9,U+53e0,U+5496,U+54ac,U+54c0,U+54c4,U+54e8,U+5561,U+5582,U+561b,U+5631,U+566a,U+5764,U+576a,U+5792,U+57ab,U+584c,U+5885,U+58f6,U+59a8,U+5acc,U+5bc2,U+5c38-5c39,U+5c60,U+5c6f,U+5c82,U+5c90,U+5d16,U+5dcd,U+5e37,U+5e90,U+5eb8,U+5f6a,U+5fcc,U+6012,U+6068,U+6073,U+607c,U+6094,U+6109,U+621a,U+626e,U+6284,U+62d0,U+62e6,U+62fe,U+6321,U+6328,U+632b,U+6349,U+6454,U+65ed,U+660f,U+6674,U+66a8,U+6749,U+674f,U+6760,U+67af,U+6850,U+6854,U+6869,U+68a8,U+68d2,U+68f5,U+6912,U+6b49,U+6b6a,U+6bef,U+6c28,U+6c5d,U+6c82,U+6cab,U+6cb8,U+6cc4,U+6cf5,U+6d47,U+6d78,U+6da4,U+6dc4,U+6dcb,U+6df9,U+6e0a,U+6e23,U+6e5b,U+6eb6,U+6f06,U+6f47,U+6f84,U+6f9c,U+6fd2,U+7076,U+70ac,U+7199,U+723d,U+72ac,U+72ed,U+7476,U+7529,U+752b,U+754f,U+7554,U+75d5,U+7626,U+76ef,U+7720,U+7766,U+7784,U+77ac,U+780d,U+7838,U+7845,U+786b,U+78b3,U+7978,U+79b9,U+79c9,U+79e7,U+7a3d,U+7a84,U+7a9f,U+7b0b,U+7b52,U+7c7d,U+7f1a,U+7fc5,U+7ff0,U+804a,U+8086-8087,U+808c,U+809a,U+80ba,U+810a,U+8180,U+818f,U+81c2,U+81ed,U+8231,U+8292,U+829c,U+82a6,U+82d1,U+8346,U+838e,U+839e,U+83c7,U+83f1,U+8403,U+840e,U+8513,U+857e,U+85e4,U+867e,U+871c,U+87ba,U+87f9,U+884d,U+8944,U+8a93,U+8c05,U+8d2c,U+8d2e,U+8d42-8d43,U+8dfb,U+8e22,U+8eba,U+8f69,U+8f9c,U+8fa3,U+8fa8,U+8fb1,U+900a,U+9038,U+903b,U+9042,U+904f,U+90b5,U+90dd,U+9102,U+9187,U+94a7,U+94c5,U+9523,U+95f8,U+95fd,U+960e,U+964b-964c,U+96c1,U+9709,U+971c,U+97ad,U+9882,U+9965,U+9976,U+9988,U+99a8,U+9a82,U+9a9a,U+9b41,U+9c8d,U+9e45,U+9e70,U+9e9f,U+9f3b,U+9f7f"}},{uri:BJ,descriptors:{unicodeRange:"U+4e08,U+4e18,U+4e1b,U+4e22,U+4e27,U+4e32,U+4e52,U+4e73,U+4ead,U+4ed4,U+4ed9,U+4ef0,U+4fa6,U+5076,U+5179,U+51bb,U+51c9,U+51ef,U+51fd,U+524a,U+526a,U+529d,U+52ab,U+5306,U+5339,U+53d9,U+540a,U+5410,U+541e,U+5439,U+54b1,U+54ed,U+5564,U+558a,U+55b7,U+5634,U+574a,U+5751,U+57a6,U+57cb,U+57d4,U+5824,U+582a,U+5835,U+5858,U+5893,U+58e4,U+5951,U+5986,U+59da,U+59fb,U+59ff,U+5a03,U+5a46,U+5ac1,U+5b5d,U+5bfa,U+5c18,U+5c3a,U+5c48,U+5c4f,U+5c61,U+5cb3,U+5d1b,U+5e15,U+5e3d,U+5e99,U+5e9e,U+5eca,U+5f0a,U+5f17-5f18,U+5f25,U+5f7c,U+5fcd,U+6028,U+60a0,U+60ac,U+60d1,U+614e,U+6155,U+6168,U+61c8,U+6208,U+6212,U+6251,U+629a-629b,U+62ab-62ac,U+62fc,U+6323,U+632a,U+63d2,U+643a,U+6491-6492,U+649e,U+64b0,U+64c5,U+659c,U+6614,U+662d,U+6664,U+6670,U+6676,U+6746,U+67cf,U+67d4,U+682a,U+6843,U+6846,U+68da,U+6b3a,U+6b67,U+6c27,U+6c5b,U+6c64,U+6c70,U+6caa,U+6cca,U+6ce1,U+6d12,U+6d45,U+6dd1,U+6dd8,U+6e34,U+6e7f,U+6ee5,U+6f02,U+7092,U+70c2,U+70e6,U+7115,U+7237,U+7272,U+727a,U+72c2,U+739b,U+73b2,U+743c,U+751c,U+758f,U+75b2,U+7686,U+76c6,U+76d2,U+76fc,U+775b,U+77a9,U+7816,U+788e,U+7897,U+78b0,U+79bd,U+7a0d,U+7a91,U+7a9d,U+7ae3,U+7bad,U+7cca,U+7d2b,U+7eb1,U+7f06,U+7f14,U+7f1d,U+7f50,U+7ffc,U+8036,U+80bf,U+80c1,U+80ce,U+80f8,U+8109,U+810f,U+8170,U+8179,U+819c,U+821f,U+8230,U+8236,U+8273,U+829d,U+82f9,U+8305,U+8350,U+83b2,U+83cc,U+8404,U+840d,U+8427,U+8482,U+8679,U+8854,U+886b,U+8bbc,U+8be6,U+8c31,U+8c6b,U+8d4b,U+8dcc,U+8e2a,U+8e48,U+8f90,U+8fb0,U+9022,U+903c,U+903e,U+9065,U+916c,U+917f,U+94a9,U+94c3,U+94dd,U+94ed,U+9510,U+953b,U+96c7,U+970d,U+9738,U+9877,U+987d,U+989c,U+98d8,U+9a70,U+9a91,U+9aa4,U+9b42,U+9b4f,U+9e2d,U+9e3f,U+9e7f,U+9f20"}},{uri:zJ,descriptors:{unicodeRange:"U+4e59,U+4ed3,U+4f0f,U+4f38,U+4f69,U+4fa7,U+4faf,U+4ff1,U+5077,U+5085,U+5144,U+5151,U+51af,U+51b6,U+51cc,U+523a,U+5251,U+5269,U+5272,U+52d8,U+5353,U+5389,U+53f9,U+5401,U+5415,U+541b,U+54f2,U+5524,U+554a,U+559d,U+5609,U+5740,U+575d,U+5806,U+5821,U+586b,U+5915,U+594f,U+5960,U+5999,U+59a5,U+59b9,U+59c6,U+59d1,U+59dc,U+5b5f,U+5b64,U+5b87,U+5bb4,U+5bbf,U+5c16,U+5c1d,U+5c3e,U+5c9a,U+5ca9,U+5cad,U+5cfb,U+5de1,U+5de7,U+5de9,U+5ef7,U+5f04,U+5f70,U+5f79,U+5fc6,U+602a,U+6050,U+6052,U+6070,U+6084,U+60b2,U+60dc,U+60e9,U+6167,U+6170,U+61c2,U+6270,U+6291,U+62b1,U+62bc,U+62dc,U+62df,U+62f3,U+6324,U+633a,U+6377,U+6398,U+63cf,U+640f,U+642c-642d,U+6458,U+6478,U+6500,U+654c,U+6566,U+658c,U+65c1,U+65cb,U+65e8,U+65ec,U+6696-6697,U+6734,U+679a,U+679d,U+67dc,U+67f3-67f4,U+680f,U+683d,U+684c,U+68af,U+699c,U+6bc1,U+6c0f,U+6c1b,U+6c57,U+6c6a,U+6d3d,U+6d6e,U+6d82,U+6db5,U+6dee,U+6e58,U+6eaa,U+6ecb,U+6ede,U+6ee9,U+6f0f,U+6f20,U+6f58,U+704c,U+7070,U+70b8,U+718a,U+7238,U+7262,U+7275,U+72b9,U+72d7,U+72e0,U+741b,U+7434,U+7483,U+74f6-74f7,U+75ab,U+764c,U+7761,U+7855,U+7891,U+78c1,U+79d2,U+7a00,U+7a3b,U+7c97,U+7ea4,U+7eb2,U+7ed2,U+7eea,U+7ef8,U+7f18,U+7fbd,U+8000,U+8010,U+8096,U+809d,U+80a9,U+817f,U+81e3,U+8206,U+8212,U+82ac,U+8302,U+8361,U+8377,U+83f2,U+8461,U+848b,U+84ec,U+8521,U+85aa,U+8870,U+8877,U+8881,U+888b,U+88ad,U+88c2,U+8986,U+8bd1,U+8bf1,U+8d24,U+8d2a,U+8d3e-8d3f,U+8d41,U+8d56,U+8d64,U+8d6b,U+8e0f,U+8f70,U+8f85,U+8f88,U+8fa9,U+9003,U+901d,U+90b9,U+90ce,U+94a6,U+94f8,U+9505,U+95ea,U+95ef,U+95f2,U+95f9,U+9601,U+9605,U+9634,U+966a,U+9677,U+9690,U+9694,U+96d5,U+971e,U+9896-9897,U+9972,U+9a71,U+9a76,U+9a7e,U+9e1f,U+9e23"}},{uri:HJ,descriptors:{unicodeRange:"U+4e01,U+4e43,U+4ea6,U+4ef2,U+4eff,U+4f26,U+4f2a,U+4f2f,U+4f5b,U+4fa8,U+4fca,U+4fd7,U+5021,U+504f,U+5141,U+51c0,U+51dd,U+51e4,U+51ed,U+5200,U+5237,U+5427,U+5448,U+54a8,U+5706,U+5708,U+5723,U+575b,U+57c3,U+5899,U+58a8,U+58c1,U+5976,U+5988,U+59bb,U+59d0,U+59d3,U+5a18,U+5a31,U+5a92,U+5b54,U+5b85,U+5baa-5bab,U+5bc4,U+5bd2,U+5be8,U+5bff,U+5c65,U+5d07,U+5e1d,U+5e78,U+5e7c,U+5f03,U+5f1f,U+5f39,U+5f6d,U+5f92,U+5faa,U+5fbd,U+5fe7,U+5ffd,U+60a8,U+60ef,U+6108,U+6162,U+622a,U+6234,U+626b,U+626d,U+62c6,U+62d2,U+62d4,U+62d6,U+62e8,U+6316,U+6355,U+63ed,U+6447,U+64a4,U+65f1,U+6606,U+6628,U+664b,U+6668,U+6682,U+66f9,U+66fc,U+66ff,U+6717,U+6740,U+676d,U+67aa,U+67ec,U+67f1,U+6842,U+6851,U+695a,U+6982,U+6a2a,U+6b20,U+6b23,U+6b32,U+6b96,U+6bc5,U+6beb,U+6c60,U+6c9f,U+6cea,U+6cf3,U+6d1e,U+6d53,U+6d66,U+6d69,U+6d8c,U+6d9b,U+6db2,U+6de1,U+6dfb,U+6e14,U+6ed1,U+6eda,U+6ee8,U+6f2b,U+706d,U+7089,U+708e,U+70ad-70ae,U+70e7,U+7126,U+714c,U+71c3,U+71d5,U+7206,U+7259,U+731b,U+73a9,U+73bb,U+74dc,U+7532,U+7545,U+755c,U+75c7,U+7687,U+76d7,U+76f2,U+788d,U+78e8,U+79e6,U+79e9,U+7a3f,U+7a46,U+7a97,U+7af9,U+7bee,U+7c4d,U+7c89,U+7cd6,U+7eb5,U+7ebd,U+7ed8,U+8017,U+8033,U+80c0,U+80de,U+80f6,U+8138,U+817e,U+81a8,U+820d,U+827e,U+82b3,U+82d7,U+83b1,U+84c4,U+84dd,U+8584,U+864e,U+865a,U+866b,U+86cb,U+88d5,U+89e6,U+8bca,U+8bde,U+8bfa,U+8c0a,U+8c37,U+8c46,U+8c6a,U+8c8c,U+8d1d,U+8d29,U+8d4f,U+8d54,U+8d5a,U+8d60,U+8d62,U+8f7f,U+8f96,U+8f9e-8f9f,U+8fc1,U+8fdf,U+8fea,U+8ff7,U+9012,U+906d,U+9075,U+90a6,U+90bb,U+90ca,U+9178,U+9192,U+91ca,U+94bb,U+94dc,U+94fa,U+9501,U+950b,U+9521,U+955c,U+963b,U+9655,U+9675-9676,U+9887,U+9891,U+9971,U+9a97,U+9ece,U+9ed8"}},{uri:WJ,descriptors:{unicodeRange:"U+4e1d,U+4e39,U+4e4c,U+4e4f,U+4e54,U+4e58,U+4e95,U+4ea1,U+4eab,U+4eae,U+4ec1,U+4f10,U+4f19,U+4f30,U+4f34,U+4fb5,U+503e,U+518c,U+5192,U+51a0,U+51ac,U+51b0,U+51e1,U+5211,U+5242,U+52a3,U+52b2,U+52c3,U+52c7,U+52d2,U+52e4,U+5377,U+539a,U+53a6,U+53e5,U+5417,U+5510,U+552f,U+5531,U+574f-5750,U+5761,U+5851,U+5854,U+58ee,U+593a,U+5949,U+5954,U+5a5a,U+5b8b,U+5bbd,U+5c04,U+5c0a,U+5c4b,U+5ce1,U+5cf0,U+5e10,U+5e8a,U+5e9f,U+5ec9,U+5f31,U+5f84,U+5fd8-5fd9,U+5fe0,U+6015,U+6062,U+6069,U+6076,U+6089,U+60a3,U+60ca,U+620f,U+624e,U+6263,U+6298,U+62a2,U+62bd,U+6311,U+6350,U+6389,U+638c,U+63f4,U+6446,U+644a,U+6469,U+64cd,U+654f,U+6562,U+656c,U+65d7,U+65e6,U+65fa,U+660c,U+6653,U+66b4,U+670b,U+672b,U+676f-6770,U+6881,U+6885,U+68a6,U+68cb,U+68ee,U+6b8a,U+6c88-6c89,U+6cc9,U+6ce5,U+6d01,U+6d17,U+6d1b,U+6d59,U+6d6a,U+6da8,U+6df7,U+6e10,U+6e20-6e21,U+6f5c,U+706f,U+70bc,U+719f,U+7267,U+732a,U+73cd,U+7518,U+756a,U+7586,U+7591,U+75db,U+76c8,U+76d0,U+76d6,U+76d8,U+76df,U+76fe,U+77db,U+7801,U+786c,U+795d,U+7965,U+79cb,U+7a77,U+7a7f,U+7aef,U+7b11,U+7bb1,U+7bc7,U+7ea0,U+7eaf,U+7ed5,U+7edc,U+7f13,U+7f29,U+7f34,U+7f8a,U+7ffb,U+8015,U+8058,U+805a,U+8083,U+80af,U+80c6,U+80cc,U+811a,U+8150,U+82e5,U+8336,U+8352,U+83ab,U+8428,U+8463,U+852c,U+8861,U+89c8,U+8bcd,U+8bd7,U+8bda,U+8be2,U+8bef,U+8bf8,U+8c0b,U+8c13,U+8d34,U+8d3a,U+8d74,U+8d76,U+8da3,U+8dd1,U+8ddd,U+8ddf,U+8df3,U+8f68,U+8f6f,U+8f7d,U+8f91,U+8f9b,U+8fbd,U+8fc8,U+8fd4,U+8feb,U+8ff9,U+900f,U+9057,U+907f-9080,U+90d1,U+90ed,U+91ce,U+9519,U+9526,U+95ed,U+9614,U+9635,U+9644,U+9686,U+96c5,U+96ea,U+9707,U+9732,U+9759,U+978b,U+9876,U+9881,U+9910,U+996e,U+9970,U+9c81,U+9e21,U+9ebb,U+9f84"}},{uri:XJ,descriptors:{unicodeRange:"U+4e3d,U+4e4e,U+4e71,U+4e8f,U+4ed8,U+4eea,U+4f0a,U+4f0d,U+4f11,U+4f1f,U+4f24,U+4f3c,U+4f73,U+4fc4,U+500d,U+5012,U+501f,U+503a,U+505c,U+507f,U+50a8,U+514d,U+5178,U+517c,U+51b2,U+51b7,U+520a,U+5238,U+523b,U+52b1,U+535a,U+5371,U+5385,U+53eb-53ec,U+53f3,U+53f6,U+5409,U+542b,U+542f,U+5434,U+5462,U+5473,U+547c,U+54c8,U+54ea,U+56fa,U+5733,U+5757,U+5766,U+5802,U+585e,U+590f,U+591c,U+591f,U+5947,U+594b,U+5987,U+5a01,U+5b59,U+5b63,U+5b88,U+5b97,U+5b9c,U+5bbe,U+5bfb,U+5c01,U+5c1a,U+5c24,U+5c3c,U+5c97,U+5c9b,U+5cb8,U+5de6,U+5e01,U+5e2e,U+5e45,U+5e55,U+5e84,U+5ef6,U+5f02,U+5f52,U+5f69,U+5f7b,U+5f90,U+5fae,U+6000,U+600e,U+6025,U+60e0,U+6276,U+6297,U+62b5,U+62cd,U+62d3,U+62e5,U+62e9,U+62ff,U+6302,U+632f,U+63e1,U+6444,U+64ad,U+653b,U+6551,U+6563,U+65a4,U+65e7,U+6620,U+667a,U+66f2,U+671d,U+6731,U+6742,U+675f,U+6768,U+677e-677f,U+6790,U+67b6,U+67d3,U+6863,U+68b0,U+68c9,U+690d,U+6b8b,U+6bcd,U+6bd2,U+6bd5,U+6c38,U+6c61,U+6cbf,U+6cdb,U+6cf0,U+6d2a,U+6d89,U+6da6,U+6f6e,U+6fb3,U+7075,U+707e,U+70df,U+7164,U+7236,U+725b,U+7389,U+73e0,U+745e,U+74e6,U+751a,U+7537,U+75be,U+76ae,U+76db,U+793c,U+7956,U+7981,U+79d8,U+79df,U+79fb,U+7adf,U+7ae5,U+7b14,U+7b26,U+7b54,U+7b79,U+7d2f,U+7eb8,U+7eba,U+7ec6,U+7ee9,U+7eff,U+7f5a,U+7f6a,U+7f72,U+8089,U+80a5,U+80e1,U+8111,U+8131,U+821e,U+822c,U+8270,U+8499,U+8651,U+867d,U+8840,U+8857,U+8863,U+88c1,U+89c9,U+89d2,U+8a89,U+8bed,U+8bfe,U+8c01,U+8c22,U+8d21,U+8d25,U+8d2f,U+8d5e,U+8d75,U+8d8b,U+8dc3,U+8de8,U+8df5,U+8f6e,U+8f86,U+8f89,U+8fc5,U+8ff0,U+8ffd,U+9014,U+904d,U+90ae,U+9274,U+949f,U+952e,U+969c,U+96c4,U+96e8,U+96f6-96f7,U+97e9,U+987f,U+996d,U+9a7b,U+9aa8,U+9c7c,U+9c9c,U+9e4f,U+9f13,U+9f50"}},{uri:VJ,descriptors:{unicodeRange:"U+4e13,U+4e16,U+4e1c,U+4e24,U+4e3e,U+4e49,U+4e61,U+4e66,U+4e89,U+4e8c,U+4e94,U+4e9b,U+4ea4,U+4eac,U+4ebf,U+4eca,U+4ef6-4ef7,U+4efb,U+4f18,U+4f20,U+4f46,U+4f7f,U+4fe1,U+503c,U+505a,U+5146,U+5148,U+515a,U+5171,U+5177,U+519b,U+51b3,U+51c6,U+51e0,U+5212,U+521b,U+522b,U+529e,U+52bf,U+534e-534f,U+5355,U+5357,U+5382,U+539f,U+53bb,U+53bf,U+53c2,U+53c8,U+53ca,U+53d6-53d8,U+53e3,U+53ea,U+53f0,U+540d,U+5411,U+56db,U+56de,U+56e0,U+56e2,U+578b,U+57ce,U+57fa,U+589e,U+5904,U+5934,U+5982,U+5b89,U+5b8c,U+5bfc,U+5c06,U+5c11,U+5c40,U+5c71,U+5e38,U+5e72,U+5e76,U+5e7f,U+5e94,U+5e9c,U+5f0f,U+5f15,U+5f20,U+5f3a,U+5f62,U+5f88,U+5fc5,U+5fd7,U+5feb,U+601d,U+6027,U+60c5,U+60f3,U+610f,U+6216,U+6218,U+624b,U+624d,U+6279,U+628a,U+6295,U+6301,U+6307,U+636e,U+63a5,U+63a8,U+652f,U+6536,U+653e,U+6548,U+6559,U+6570,U+65bd,U+65e0,U+6602,U+660e,U+6613,U+66f4,U+6700,U+670d,U+671f,U+672f,U+6743,U+674e,U+6751,U+6761,U+6784,U+6797,U+679c,U+67e5,U+6807,U+6837,U+683c,U+6b21,U+6b63-6b65,U+6bcf,U+6bd4,U+6c42,U+6c5f,U+6ca1,U+6cbb,U+6d3b,U+6d41,U+6d88,U+6df1,U+70b9,U+7136,U+7269,U+7279,U+7531,U+754c,U+767e,U+76ca,U+76f8,U+770b,U+7740,U+7814,U+79ef,U+7a0b,U+7a0e,U+7a76,U+7b80,U+7cbe,U+7cfb,U+7e41,U+7ea7,U+7ec4,U+7ec7,U+7ed3,U+7ed9,U+7edf,U+7f8e,U+8001,U+804c,U+8054,U+80b2,U+81f3,U+8425,U+8868,U+88ab,U+897f,U+89c1-89c2,U+89c4,U+89c6,U+89e3,U+8ba1,U+8ba4,U+8bae,U+8bb0,U+8bba,U+8bc1,U+8c03,U+8d28,U+8d39,U+8def,U+8f66,U+8f6c,U+8fd0-8fd1,U+9020,U+9053,U+90a3,U+90fd,U+91cc,U+9500,U+9547,U+95e8,U+95f4,U+961f,U+9645,U+9662,U+96be,U+96c6,U+9700,U+9769,U+97e6,U+9875,U+9879,U+9886,U+9898,U+98ce,U+9996,U+2b5af,U+2cc56,U+2e9f5,U+30edd-30ede"}},{uri:YJ,descriptors:{unicodeRange:"U+4e03,U+4e30,U+4e34,U+4e45,U+4e60,U+4e70,U+4e88,U+4e91-4e92,U+4ea9,U+4eb2,U+4ec0,U+4ecb,U+4ecd,U+4ee4,U+4fee,U+5019,U+5047,U+50cf,U+5145,U+516d,U+5170,U+5175,U+5199,U+51cf,U+51fb,U+521a,U+5224,U+5267,U+52aa,U+5347-5348,U+534a,U+5356,U+5361,U+536b,U+5370,U+538b,U+53e4,U+53e6,U+5403,U+5426,U+5428,U+542c,U+5438,U+5668,U+56ed,U+56f4,U+56fe,U+57df,U+592a,U+5957,U+5b69,U+5b81,U+5b8f,U+5b98,U+5b9d,U+5ba1,U+5ba4,U+5bb3,U+5bc6,U+5bdf,U+5c3d,U+5c5e,U+5c81,U+5ddd,U+5de8,U+5dee,U+5e0c,U+5e86,U+5e8f,U+5e93,U+5e95,U+5e97,U+5ea7,U+5ead,U+5eb7,U+5f55,U+5f81,U+5f85,U+5ff5,U+6001,U+613f,U+6258,U+6267,U+6269,U+626c,U+627e,U+62db,U+62ec,U+6325,U+635f,U+6362,U+6388,U+6392,U+63a2,U+63a7,U+63aa,U+641e,U+6545,U+6597,U+65e2,U+65e9,U+661f,U+665a,U+666e-666f,U+66fe,U+6728,U+67d0,U+6811,U+6838,U+6865,U+697c,U+6b22,U+6b27,U+6b4c,U+6b62,U+6b66,U+6b7b,U+6bdb,U+6c47,U+6c49,U+6c7d,U+6c99,U+6cfd,U+6d0b,U+6d25,U+6d32,U+6d3e,U+6d4b,U+6e29,U+6e56,U+6e7e,U+6f14,U+6fc0,U+706b,U+70c8,U+7247,U+72af,U+72b6,U+72ec,U+732e,U+73ed,U+7403,U+7533,U+753b,U+7559,U+7565,U+7597,U+767b,U+773c,U+7763,U+77ed,U+77ff,U+7968,U+798f,U+79bb,U+79c0-79c1,U+7ad9,U+7ae0,U+7b51,U+7b7e,U+7cae,U+7d22,U+7ea2,U+7eb3,U+7eb7,U+7ec3,U+7ec8,U+7ecd,U+7edd,U+7efc,U+7f16,U+7f3a,U+7f51,U+7f57,U+7f6e,U+80dc,U+822a,U+8239,U+826f,U+82cf,U+82e6,U+8349,U+8363,U+83dc,U+8457,U+85cf,U+878d,U+8865,U+8a00,U+8b66,U+8ba2,U+8ba8,U+8bad,U+8bb2,U+8bc9,U+8bd5,U+8bfb,U+8d2b,U+8d35,U+8d37,U+8f7b,U+8f93,U+8fce,U+8fdd,U+9000-9002,U+9010,U+9047,U+9093,U+9152,U+9488,U+94a2,U+9633,U+9636,U+963f,U+9646,U+9648,U+964d,U+9664,U+9669,U+9760,U+97f3,U+987a,U+987e,U+9884,U+98de,U+9986,U+9ed1"}},{uri:GJ,descriptors:{unicodeRange:"U+4e14,U+4e25,U+4e48,U+4e50,U+4e5d,U+4e9a,U+4ec5,U+4efd,U+4f17,U+4f4e-4f4f,U+4f55,U+4f59,U+4f60,U+4f8b,U+4f9b,U+4f9d,U+4fbf,U+4fc3,U+5065,U+513f,U+5149,U+514b,U+516b,U+5174,U+517b,U+518d,U+51b5,U+5207,U+5217-5219,U+521d,U+526f,U+529f,U+52a9,U+52b3,U+5305,U+533b,U+5343,U+5360,U+5373-5374,U+5386,U+53cb-53cd,U+53f2,U+53f7,U+544a,U+5468,U+547d,U+54cd,U+552e,U+5584,U+56f0,U+571f,U+5747,U+575a,U+57f9,U+5883,U+58eb,U+58f0,U+5907,U+590d,U+592e,U+5931,U+5956,U+5965,U+5973,U+5979,U+59cb,U+5b57-5b58,U+5b83,U+5ba2-5ba3,U+5bb9,U+5bcc,U+5c42,U+5c45,U+5c4a,U+5dde,U+5df1,U+5df4,U+5e03,U+5e08,U+5e26,U+5e2d,U+5f71,U+5f80,U+5f8b,U+5fb7,U+606f,U+611f,U+6237,U+623f,U+6253,U+627f,U+6293,U+62a4,U+62c5,U+62c9,U+6309,U+6574,U+6599,U+65ad,U+65af,U+65c5,U+65cf,U+6625,U+663e,U+671b,U+672a,U+6750,U+6781,U+6821,U+6839,U+6848,U+68c0,U+6a21,U+6b3e,U+6bb5,U+6c14,U+6cb3,U+6cb9,U+6ce8,U+6e05,U+6e2f,U+6e38,U+6e90,U+6ee1,U+70ed,U+7167,U+7231,U+7248,U+724c,U+7387,U+738b,U+73af,U+7530,U+75c5,U+767d,U+76d1,U+76f4,U+771f,U+77e5,U+77f3,U+7834,U+7840,U+786e,U+793a,U+795e,U+79f0,U+7a33,U+7a7a,U+7a81,U+7ade,U+7b56,U+7b97,U+7c73,U+7c7b,U+7d20,U+7d27,U+7ea6,U+7eaa,U+7ebf,U+7ee7,U+7eed,U+7ef4,U+7fa4,U+8003,U+80a1,U+81f4,U+8272,U+827a,U+8282,U+82b1,U+82f1,U+8303,U+836f,U+83b7,U+843d,U+88c5,U+8ba9,U+8baf,U+8bb8,U+8bbf,U+8bc4,U+8bc6,U+8bdd,U+8be5,U+8bf7,U+8c08,U+8c61,U+8d1f,U+8d22-8d23,U+8d27,U+8d2d,U+8d38,U+8d5b,U+8d70,U+8d85,U+8d8a,U+8db3,U+8eab,U+8f83,U+8fb9,U+8fdc,U+8fde,U+9009,U+901f,U+914d,U+91c7,U+94b1,U+94c1,U+94f6,U+95fb,U+9632,U+9650,U+968f,U+9752,U+975e,U+987b,U+989d,U+98df,U+9999,U+9a6c,U+9a8c,U+9ec4,U+9feb-9fec"}},{uri:qJ,descriptors:{unicodeRange:"U+98fb-990c,U+990e-990f,U+9911-992d,U+992f-9953,U+9956-9962,U+9964,U+9966,U+9973,U+9978-9979,U+997b,U+997e,U+9982-9983,U+9989,U+998c,U+998e,U+999a-99a4,U+99a6-99a7,U+99a9-99c8"}},{uri:ZJ,descriptors:{unicodeRange:"U+8e4c-8e50,U+8e53-8e58,U+8e5a-8e65,U+8e67-8e68,U+8e6a-8e6b,U+8e6e,U+8e71,U+8e73,U+8e75,U+8e77-8e7b,U+8e7d-8e7e,U+8e80,U+8e82-8e84,U+8e86,U+8e88-8e8e,U+8e91-8e93,U+8e95-8e9b,U+8e9d,U+8e9f-8eaa,U+8ead-8eae,U+8eb0-8eb1,U+8eb3-8eb9,U+8ebb-8ecd,U+8ecf-8f02"}},{uri:KJ,descriptors:{unicodeRange:"U+2e3a,U+3001-3002,U+3008-3011,U+3014-3017,U+301d-301f,U+4dae,U+4e00,U+4e07,U+4e09-4e0b,U+4e0d-4e0e,U+4e1a,U+4e2a,U+4e2d,U+4e3a-4e3b,U+4e4b,U+4e5f,U+4e86,U+4e8b,U+4e8e,U+4ea7,U+4eba,U+4ece,U+4ed1,U+4ed6,U+4ee3,U+4ee5,U+4eec,U+4f01,U+4f1a,U+4f4d,U+4f53,U+4f5c,U+4fdd,U+5143,U+5165,U+5168,U+516c,U+5173,U+5176,U+5185,U+519c,U+51fa,U+5206,U+5229,U+5230,U+5236,U+524d,U+529b,U+52a0-52a1,U+52a8,U+5316-5317,U+533a,U+5341,U+5362,U+53d1,U+53ef,U+53f8,U+5404,U+5408,U+540c,U+540e,U+5458,U+548c,U+54c1,U+54e5,U+5546,U+559c,U+56fd,U+5728,U+5730,U+573a,U+5916,U+591a,U+5927,U+5929,U+592b,U+597d,U+59d4,U+5b50,U+5b66,U+5b9a,U+5b9e,U+5bb6,U+5bf9,U+5c0f,U+5c14,U+5c31,U+5c55,U+5de5,U+5df2,U+5e02,U+5e73-5e74,U+5ea6,U+5efa,U+5f00,U+5f53,U+5f97,U+5fc3,U+603b,U+6210-6211,U+6240,U+6280,U+62a5,U+63d0,U+6539,U+653f,U+6587,U+65b0,U+65b9,U+65e5,U+65f6,U+662f,U+6708-6709,U+672c,U+673a,U+675c,U+6765,U+6c11,U+6c34,U+6cd5,U+6ce2,U+6d4e,U+6d77,U+73b0,U+7406,U+751f,U+7528,U+7535,U+7684,U+76ee,U+793e,U+79cd,U+79d1,U+7acb,U+7b2c,U+7b49,U+7ba1,U+7ecf,U+8005,U+800c,U+80fd,U+81ea,U+884c,U+8981,U+8bbe,U+8bf4,U+8d44,U+8d77,U+8fbe,U+8fc7,U+8fd8-8fd9,U+8fdb,U+901a,U+90e8,U+91cd,U+91cf,U+91d1,U+9485,U+957f,U+95ee,U+9762,U+9ad8,U+9ea6,U+9f99,U+9fcf,U+9fd4,U+9fed,U+fe10-fe19,U+fe30-fe31,U+fe33-fe44,U+ff01,U+ff0c,U+ff1f,U+2b4e7,U+2b7f7,U+2b7fc,U+2cb2d,U+2cb3b,U+2cb4a,U+2cb5b,U+2cb73"}},{uri:QJ,descriptors:{unicodeRange:"U+6490,U+6493-6494,U+6497-6498,U+649a-649d,U+649f-64a3,U+64a5-64a8,U+64aa-64ab,U+64af,U+64b1-64b4,U+64b6,U+64b9,U+64bb,U+64bd-64bf,U+64c1,U+64c3-64c4,U+64c6-64cc,U+64cf,U+64d1,U+64d3-64d6,U+64d9-64dd,U+64df-64e1,U+64e3,U+64e5,U+64e7-64ff,U+6501-6508,U+650a-6511,U+6513-6517,U+6519-6524,U+6526-652a,U+652c-652d,U+6530-6533,U+6537,U+653a,U+653c-653d,U+6540-6544,U+6546-6547,U+654a-654b,U+654d-654e,U+6550,U+6552-6554,U+6557-6558,U+655a,U+655c,U+655f-6561,U+6564-6565,U+6567-6568"}},{uri:JJ,descriptors:{unicodeRange:"U+9695-9696,U+969a-969b,U+969d-96a6,U+96a8-96af,U+96b1-96b2,U+96b4-96b5,U+96b7-96b8,U+96ba-96bb,U+96bf,U+96c2-96c3,U+96c8,U+96ca-96cb,U+96d0-96d1,U+96d3-96d4,U+96d6-96df,U+96e1-96e7,U+96eb-96ee,U+96f0-96f2,U+96f4-96f5,U+96f8,U+96fa-96fd,U+96ff,U+9702-9703,U+9705,U+970a-970c,U+9710-9712,U+9714-9715,U+9717-971b,U+971d,U+971f-9729,U+972b-972c,U+972e-972f,U+9731,U+9733-9737,U+973a-973d,U+973f-9751,U+9754-9755,U+9757-9758,U+975a,U+975c-975d,U+975f,U+9763-9764,U+9766-9768,U+976a-9770"}},{uri:eee,descriptors:{unicodeRange:"U+6af0-6b1f,U+6b25-6b26,U+6b28-6b31,U+6b33-6b36,U+6b38,U+6b3b-6b3d,U+6b3f-6b42,U+6b44-6b45,U+6b48,U+6b4a-6b4b,U+6b4d-6b58,U+6b5a-6b61,U+6b68-6b69,U+6b6b-6b78,U+6b7a,U+6b7d-6b80,U+6b85,U+6b88,U+6b8c,U+6b8e-6b91,U+6b94-6b95,U+6b97-6b99,U+6b9c-6ba0,U+6ba2-6ba9,U+6bab-6bb2,U+6bb6,U+6bb8-6bba"}},{uri:tee,descriptors:{unicodeRange:"U+430e-439a,U+29e8a,U+29ec4,U+29edb,U+29ee9,U+29f7e,U+29f83,U+29f8c,U+29fce,U+2a01a,U+2a02f,U+2a082,U+2a0f9,U+2a190,U+2a38c"}},{uri:nee,descriptors:{unicodeRange:"U+92ef-933d,U+933f-9369,U+936b-9388"}},{uri:ree,descriptors:{unicodeRange:"U+4512-458d,U+2b300,U+2b363,U+2b36f,U+2b372,U+2b37d,U+2b404,U+2b410,U+2b413,U+2b461,U+2b4ef,U+2b4f6,U+2b4f9,U+2b50d-2b50e,U+2b536,U+2b5ae,U+2b5b3,U+2b5e7,U+2b5f4,U+2b61c-2b61d,U+2b626-2b628,U+2b62a,U+2b62c,U+2b695-2b696,U+2b6ad,U+2b6ed"}},{uri:iee,descriptors:{unicodeRange:"U+88bd-88c0,U+88c3-88c4,U+88c7-88c8,U+88ca-88cd,U+88cf-88d1,U+88d3,U+88d6-88d7,U+88da-88de,U+88e0-88e1,U+88e6-88e7,U+88e9-88ef,U+88f2,U+88f5-88f7,U+88fa-88fb,U+88fd,U+88ff-8901,U+8903-8909,U+890b-890f,U+8911,U+8914-8918,U+891c-8920,U+8922-8924,U+8926-8929,U+892c-892f,U+8931-8933,U+8935,U+8937-8940,U+8942-8943,U+8945-895d,U+8960-8965,U+8967-897a,U+897c-897e,U+8980,U+8982,U+8984-8985"}},{uri:aee,descriptors:{unicodeRange:"U+4b0b-4ba0"}},{uri:see,descriptors:{unicodeRange:"U+7179,U+717b-717c,U+717e-7183,U+7185-7189,U+718b-718e,U+7190-7193,U+7195-7197,U+719a-719e,U+71a1-71a7,U+71a9-71ab,U+71ad-71b2,U+71b4,U+71b6-71b8,U+71ba-71c2,U+71c4-71cd,U+71cf-71d3,U+71d6-71df,U+71e1-71e4,U+71e6,U+71e8-71ed,U+71ef-71f8,U+71fa-7205,U+7207-721c,U+721e-7227,U+7229,U+722b,U+722d"}},{uri:oee,descriptors:{unicodeRange:"U+982e-9874,U+988b,U+988e,U+9892,U+9895,U+9899,U+98a3,U+98a8-98cd,U+98cf-98d0,U+98d4,U+98d6-98d7,U+98db-98dd,U+98e0-98e6,U+98e9-98fa"}},{uri:lee,descriptors:{unicodeRange:"U+7c14-7c15,U+7c17-7c1e,U+7c20-7c25,U+7c28-7c29,U+7c2b-7c37,U+7c39-7c3e,U+7c42-7c4c,U+7c4e-7c72,U+7c75-7c7a,U+7c7e-7c88,U+7c8a-7c90,U+7c93-7c94,U+7c96,U+7c99-7c9b,U+7ca0-7ca1,U+7ca3,U+7ca6-7ca9,U+7cab-7cad,U+7caf-7cb0,U+7cb4-7cb8,U+7cba-7cbb,U+7cbf-7cc0,U+7cc2-7cc4,U+7cc6,U+7cc9,U+7ccb,U+7cce-7cd4"}},{uri:cee,descriptors:{unicodeRange:"U+7d95-7da5,U+7da7-7dad,U+7daf-7e2a"}},{uri:dee,descriptors:{unicodeRange:"U+4a78-4b0a"}},{uri:uee,descriptors:{unicodeRange:"U+9b30-9b31,U+9b33-9b3a,U+9b3d-9b40,U+9b46,U+9b4a-9b4c,U+9b4e,U+9b50,U+9b52-9b53,U+9b55-9bcf"}},{uri:hee,descriptors:{unicodeRange:"U+6a4b-6a4f,U+6a51-6a57,U+6a5a,U+6a5c-6a60,U+6a62-6a64,U+6a66-6a70,U+6a72-6a78,U+6a7a-6a7b,U+6a7d-6a7f,U+6a81-6a83,U+6a85-6a8d,U+6a8f,U+6a92-6a96,U+6a98-6a9f,U+6aa1-6aa8,U+6aaa,U+6aad-6aef"}},{uri:fee,descriptors:{unicodeRange:"U+99c9-9a53"}},{uri:pee,descriptors:{unicodeRange:"U+8550-8555,U+8557-8558,U+855a-855d,U+855f-8563,U+8565-8567,U+8569-8571,U+8573,U+8575-8578,U+857c-857d,U+857f-8583,U+8586,U+8588-858e,U+8590-859a,U+859d-85a3,U+85a5-85a7,U+85a9,U+85ab-85ad,U+85b1-85b6,U+85b8,U+85ba-85c0,U+85c2-85c8,U+85ca-85ce,U+85d1-85d2,U+85d4,U+85d6-85db,U+85dd-85e3,U+85e5-85e8,U+85ea-85fa,U+85fc-85fe,U+8600-8603"}},{uri:mee,descriptors:{unicodeRange:"U+6fb2,U+6fb4-6fb5,U+6fb7-6fb8,U+6fba-6fbf,U+6fc1,U+6fc3-6fc8,U+6fca-6fd0,U+6fd3-6fdd,U+6fdf,U+6fe2-6fed,U+6ff0-7010,U+7012-7019,U+701c-7022,U+7024-7034,U+7036-7038,U+703a-704b,U+704d-704e,U+7050-7053"}},{uri:gee,descriptors:{unicodeRange:"U+4ba1-4c2c"}},{uri:Uee,descriptors:{unicodeRange:"U+9a54-9a6b,U+9a72,U+9a83,U+9a89,U+9a8d-9a8e,U+9a94-9a95,U+9a99,U+9aa6,U+9aa9-9aaf,U+9ab2-9ab5,U+9ab9,U+9abb,U+9abd-9abf,U+9ac3-9ac4,U+9ac6-9aca,U+9acd-9ad0,U+9ad2,U+9ad4-9ad7,U+9ad9-9ade,U+9ae0,U+9ae2-9ae5,U+9ae7-9aea,U+9aec,U+9aee,U+9af0-9af8,U+9afa,U+9afc-9b02,U+9b04-9b07,U+9b09-9b0e,U+9b10-9b12,U+9b14-9b1e,U+9b20-9b22,U+9b24-9b2e"}},{uri:bee,descriptors:{unicodeRange:"U+9d1a-9da1"}},{uri:yee,descriptors:{unicodeRange:"U+9e13-9e1e,U+9e24,U+9e27,U+9e2e,U+9e30,U+9e34,U+9e3b-9e3c,U+9e40,U+9e4d,U+9e50,U+9e52-9e54,U+9e56,U+9e59,U+9e5d,U+9e5f-9e62,U+9e65,U+9e6e-9e6f,U+9e72,U+9e74-9e7d,U+9e80-9e81,U+9e83-9e86,U+9e89-9e8a,U+9e8c-9e91,U+9e94-9e9c,U+9e9e,U+9ea0-9ea5,U+9ea7-9eb3,U+9eb5-9eb7,U+9eb9-9eba,U+9ebc,U+9ebf-9ec3,U+9ec5-9ec8,U+9eca-9ecc,U+9ed0,U+9ed2-9ed3,U+9ed5-9ed7,U+9ed9-9eda,U+9ede,U+9ee1,U+9ee3-9ee4,U+9ee6,U+9ee8,U+9eeb-9eee,U+9ef0-9ef8"}},{uri:vee,descriptors:{unicodeRange:"U+8b1c-8b25,U+8b27-8b65,U+8b67-8b6b,U+8b6d-8b9f,U+8bac,U+8bb1,U+8bbb,U+8bc7,U+8bd0"}},{uri:xee,descriptors:{unicodeRange:"U+4cad-4d2f"}},{uri:wee,descriptors:{unicodeRange:"U+9c4b-9c7b,U+9c7d-9c7e,U+9c80,U+9c83-9c84,U+9c89-9c8a,U+9c8c,U+9c8f,U+9c93,U+9c96-9c99,U+9c9d,U+9caa,U+9cac,U+9caf,U+9cb9,U+9cbe-9cc2,U+9cc8-9cc9,U+9cd1-9cd2,U+9cda-9cdb,U+9ce0-9ce1,U+9ce3-9d19"}},{uri:Eee,descriptors:{unicodeRange:"U+9389-938e,U+9390-93c9,U+93cb-93d5,U+93d7-9410"}},{uri:Cee,descriptors:{unicodeRange:"U+20a0-20b5,U+20b9-20ba,U+20bc-20bd,U+4e2c,U+5107,U+5216,U+5293,U+54f3,U+5523,U+5819,U+5adc,U+5c88,U+5e3b,U+5fee,U+62f6,U+63be,U+6484,U+6499,U+67d9,U+67dd,U+6d5e,U+6f46,U+717a,U+71e0,U+72c1,U+73e7,U+75b0,U+7603,U+7722,U+7809,U+7811,U+7946,U+7967,U+799a,U+7b45,U+7ba2,U+8014,U+80d9,U+8159,U+817d,U+81a3,U+81aa,U+8201,U+833c,U+836e,U+83e5,U+8459,U+84f0,U+8729,U+8753,U+87d3,U+89dc,U+8bf6,U+8c2e,U+8e2c,U+8e9c,U+8e9e,U+8ece,U+8fee,U+9139,U+914f,U+9174,U+9191,U+960c,U+9622,U+9a98,U+9b48,U+9ca6,U+9cb0,U+9da2-9e12,U+9e88,U+9f44,U+9f86"}},{uri:See,descriptors:{unicodeRange:"U+9bd0-9c4a"}},{uri:_ee,descriptors:{unicodeRange:"U+4c2d-4cac"}},{uri:kee,descriptors:{unicodeRange:"U+4d30-4dab"}},{uri:Tee,descriptors:{unicodeRange:"U+9411-943d,U+943f-946a,U+946c-9484"}},{uri:Mee,descriptors:{unicodeRange:"U+9efa,U+9efd,U+9eff-9f0a,U+9f0c,U+9f0f,U+9f11-9f12,U+9f14-9f16,U+9f18,U+9f1a-9f1f,U+9f21,U+9f23-9f2b,U+9f2d-9f2e,U+9f30-9f36,U+9f38,U+9f3a,U+9f3c,U+9f3f-9f43,U+9f45-9f4f,U+9f52-9f7e,U+9f81-9f82,U+9f8d-9f94"}},{uri:Iee,descriptors:{unicodeRange:"U+7e2b-7e3a,U+7e3c-7e40,U+7e42-7e46,U+7e48-7e81,U+7e83-7e9a,U+7e9c-7e9e,U+7eae,U+7eb4,U+7ebb-7ebc,U+7ed6,U+7ee4,U+7eec,U+7ef9,U+7f0a,U+7f10,U+7f1e,U+7f37,U+7f39,U+7f3b"}}],zl=class Xt{constructor(t){H(this,"scene"),H(this,"getSceneFamilies",()=>Xt.getUniqueFamilies(this.scene.getNonDeletedElements())),H(this,"onLoaded",n=>{let r=!0;for(let s of n){let o=`${s.family}-${s.style}-${s.weight}-${s.unicodeRange}`;Xt.loadedFontsCache.has(o)||(Xt.loadedFontsCache.add(o),r=!1)}if(r)return;let i=!1,a=this.scene.getNonDeletedElementsMap();for(let s of this.scene.getNonDeletedElements())if(Le(s)){i=!0,yn.delete(s),V1.clearCache(Bt(s));let o=ur(s,a);o&&yn.delete(o)}i&&this.scene.triggerUpdate()}),H(this,"loadSceneFonts",async()=>{let n=this.getSceneFamilies(),r=Xt.getCharsPerFamily(this.scene.getNonDeletedElements());return Xt.loadFontFaces(n,r)}),this.scene=t}static get registered(){return Xt._registered?Xt._initialized||(Xt._registered=new Map([...Xt.init().entries(),...Xt._registered.entries()])):Xt._registered=Xt.init(),Xt._registered}get registered(){return Xt.registered}static async generateFontFaceDeclarations(t){let n=Xt.getUniqueFamilies(t),r=Xt.getCharsPerFamily(t),i=n.find(c=>UI(c).includes(ju));if(i){let c=Xt.getCharacters(r,i);if(tG(c)){let d=Pu[ju];r[d]=new Set(c),n.unshift(Pu[ju])}}let a=Xt.fontFacesStylesGenerator(n,r),s=3,o=await new tC(a,s).all();return Array.from(new Set(o))}static async loadFontFaces(t,n){for(let{fontFaces:a,metadata:s}of Xt.registered.values())if(!s.local)for(let{fontFace:o}of a)window.document.fonts.has(o)||window.document.fonts.add(o);let r=Xt.fontFacesLoader(t,n),i=10;return(await new tC(r,i).all()).flat().filter(Boolean)}static*fontFacesLoader(t,n){for(let[r,i]of t.entries()){let a=Bt({fontFamily:i,fontSize:16}),s=Xt.getCharacters(n,i);window.document.fonts.check(a,s)||(yield hh(async()=>{var o;try{let c=await window.document.fonts.load(a,s);return[r,c]}catch(c){console.error(`Failed to load font "${a}" from urls "${(o=Xt.registered.get(i))==null?void 0:o.fontFaces.map(d=>d.urls)}"`,c)}}))}}static*fontFacesStylesGenerator(t,n){for(let[r,i]of t.entries()){let{fontFaces:a,metadata:s}=Xt.registered.get(i)??{};if(!Array.isArray(a)){console.error(`Couldn't find registered fonts for font-family "${i}"`,Xt.registered);continue}if(!(s!=null&&s.local))for(let[o,c]of a.entries())yield hh(async()=>{try{let d=Xt.getCharacters(n,i),l=await c.toCSS(d);return l?[r*1e4+o,l]:void 0}catch(d){console.error(`Couldn't transform font-face to css for family "${c.fontFace.family}"`,d)}})}}static register(t,n,...r){let i=un[t]??Pu[t];return this.registered.get(i)||this.registered.set(i,{metadata:n,fontFaces:r.map(({uri:a,descriptors:s})=>new oZ(t,a,s))}),this.registered}static init(){let t={registered:new Map},n=(r,...i)=>{let a=un[r]??Pu[r],s=h2[a]??h2[un.Excalifont];Xt.register.call(t,r,s,...i)};return n("Cascadia",...cZ),n("Comic Shanns",...pZ),n("Excalifont",...EZ),n("Helvetica",...CZ),n("Liberation Sans",..._Z),n("Lilita One",...MZ),n("Nunito",...jZ),n("Virgil",...NZ),n(ju,...Aee),n(s1,...mZ),Xt._initialized=!0,t.registered}static getUniqueFamilies(t){return Array.from(t.reduce((n,r)=>(Le(r)&&n.add(r.fontFamily),n),new Set))}static getCharsPerFamily(t){let n={};for(let r of t)if(Le(r))for(let i of r.originalText)n[r.fontFamily]||(n[r.fontFamily]=new Set),n[r.fontFamily].add(i);return n}static getCharacters(t,n){return t[n]?Array.from(t[n]).join(""):""}static getAllFamilies(){return Array.from(Xt.registered.keys())}};H(zl,"loadedFontsCache",new Set),H(zl,"_registered"),H(zl,"_initialized",!1),H(zl,"loadElementsFonts",async e=>{let t=zl.getUniqueFamilies(e),n=zl.getCharsPerFamily(e);return zl.loadFontFaces(t,n)});var Wo=zl,hA=(e,t,n)=>{var c;let{unitsPerEm:r,ascender:i,descender:a}=((c=Wo.registered.get(e))==null?void 0:c.metadata.metrics)||h2[un.Virgil].metrics,s=t/r,o=(n-s*i+s*a)/2;return s*i+o},Td=e=>{var n;let{lineHeight:t}=((n=Wo.registered.get(e))==null?void 0:n.metadata.metrics)||h2[un.Excalifont].metrics;return t},fA=e=>{let{angle:t,width:n,height:r,x:i,y:a}=e,s=i+n/2,o=a+r/2,c=A(s,o),d;return e.type==="diamond"?d=ZE(he(A(s,a),c,t),he(A(i+n,o),c,t),he(A(s,a+r),c,t),he(A(i,o),c,t)):d=ZE(he(A(i,a),c,t),he(A(i+n,a),c,t),he(A(i+n,a+r),c,t),he(A(i,a+r),c,t)),{type:"polygon",data:d}},Lee=(e,t,n=10)=>{let[r,i,a,s,o,c]=lt(e,t,!0);r-=n,a+=n,i-=n,s+=n;let d=A(o,c),l=he(A(r,i),d,e.angle),h=he(A(a,i),d,e.angle),f=he(A(r,s),d,e.angle),g=he(A(a,s),d,e.angle);return{type:"polygon",data:[l,h,g,f]}},Ree=e=>{let{width:t,height:n,angle:r,x:i,y:a}=e;return{type:"ellipse",data:{center:A(i+t/2,a+n/2),angle:r,halfWidth:t/2,halfHeight:n/2}}},wc=e=>{if(!e)return[];for(let t of e.sets)if(t.type==="path")return t.ops;return e.sets[0].ops},Dee=(e,t=A(0,0),n,r)=>{let i=c=>he(A(c[0]+t[0],c[1]+t[1]),r,n),a=wc(e),s=[],o=A(0,0);for(let c of a){if(c.op==="move"){let d=mv(c.data);Dr(d!=null,"Ops data is not a point"),o=i(d)}if(c.op==="bcurveTo"){let d=i(A(c.data[0],c.data[1])),l=i(A(c.data[2],c.data[3])),h=i(A(c.data[4],c.data[5]));s.push($o(o,d,l,h)),o=h}}return{type:"polycurve",data:s}},jee=e=>{let t=e[0],n=[];for(let r=1;r<e.length;r++){let i=e[r];n.push(Ge(t,i)),t=i}return n},Pee=(e,t,n=!1)=>{let r=a=>he(xt(ec(Ve(a),gr(e.x,e.y))),t,e.angle),i=jee(e.points.map(a=>r(a)));return n?{type:"polygon",data:o2(i.flat())}:{type:"polyline",data:i}},Nee=(e,t,n=A(0,0),r,i)=>{let a=l=>he(A(l[0]+n[0],l[1]+n[1]),i,r);if(e.roundness===null)return{type:"polygon",data:o2(e.points.map(l=>a(l)))};let s=wc(t),o=[],c=!1;for(let l of s)l.op==="move"?(c=!c,c&&o.push(A(l.data[0],l.data[1]))):l.op==="bcurveTo"?c&&(o.push(A(l.data[0],l.data[1])),o.push(A(l.data[2],l.data[3])),o.push(A(l.data[4],l.data[5]))):l.op==="lineTo"&&c&&o.push(A(l.data[0],l.data[1]));let d=SV(o,10,5).map(l=>a(l));return{type:"polygon",data:o2(d)}},Oee=(e,t)=>{let{angle:n,halfWidth:r,halfHeight:i,center:a}=t,s=r,o=i,c=ec(Ve(e),Sn(Ve(a),-1)),[d,l]=he(xt(c),A(0,0),-n),h=Math.abs(d),f=Math.abs(l),g=.707,U=.707;for(let x=0;x<3;x++){let w=s*g,C=o*U,S=(s*s-o*o)*g**3/s,k=(o*o-s*s)*U**3/o,M=w-S,T=C-k,R=h-S,j=f-k,P=Math.hypot(T,M),N=Math.hypot(j,R);g=Math.min(1,Math.max(0,(R*P/N+S)/s)),U=Math.min(1,Math.max(0,(j*P/N+k)/o));let F=Math.hypot(U,g);g/=F,U/=F}let[y,v]=[s*g*Math.sign(d),o*U*Math.sign(l)];return Rt(A(d,l),A(y,v))},Fee=(e,t,n=1e-4)=>Oee(e,t)<=n,$ee=(e,t)=>{let{center:n,angle:r,halfWidth:i,halfHeight:a}=t,s=ec(Ve(e),Sn(Ve(n),-1)),[o,c]=he(xt(s),A(0,0),-r);return o/i*(o/i)+c/a*(c/a)<=1},A3=(e,t,n=0)=>{switch(t.type){case"polygon":return _Y(e,t.data,n);case"ellipse":return Fee(e,t.data,n);case"line":return Ed(e,t.data,n);case"polyline":return mA(e,t.data,n);case"curve":return pA(e,t.data,n);case"polycurve":return Bee(e,t.data,n);default:throw Error(`shape ${t} is not implemented`)}},f2=(e,t)=>{switch(t.type){case"polygon":return KE(e,t.data);case"line":return!1;case"curve":return!1;case"ellipse":return $ee(e,t.data);case"polyline":{let n=o2(t.data.flat());return KE(e,n)}case"polycurve":return!1;default:throw Error(`shape ${t} is not implemented`)}},Bee=(e,t,n)=>t.some(r=>pA(e,r,n)),zee=e=>{let[t,n,r,i]=e;return(a,s)=>Math.pow(1-a,3)*i[s]+3*a*Math.pow(1-a,2)*r[s]+3*Math.pow(a,2)*(1-a)*n[s]+t[s]*Math.pow(a,3)},Hee=(e,t=10)=>{let n=zee(e),r=[n(0,0),n(0,1)],i=[],a=0,s=1/t;for(let o=0;o<t;o++)if(a+=s,a<=1){let c=A(n(a,0),n(a,1));i.push(Ge(r,c)),r=c}return i},pA=(e,t,n)=>mA(e,Hee(t),n),mA=(e,t,n=1e-4)=>t.some(r=>Ed(e,r,n));function gA(e,t,n){return{center:e,halfWidth:t,halfHeight:n}}var Wee=(e,t)=>{let{halfWidth:n,halfHeight:r,center:i}=t,a=n,s=r,o=ec(Ve(e),Sn(Ve(i),-1)),c=Math.abs(o[0]),d=Math.abs(o[1]),l=.707,h=.707;for(let U=0;U<3;U++){let y=a*l,v=s*h,x=(a*a-s*s)*l**3/a,w=(s*s-a*a)*h**3/s,C=y-x,S=v-w,k=c-x,M=d-w,T=Math.hypot(S,C),R=Math.hypot(M,k);l=Math.min(1,Math.max(0,(k*T/R+x)/a)),h=Math.min(1,Math.max(0,(M*T/R+w)/s));let j=Math.hypot(h,l);l/=j,h/=j}let[f,g]=[a*l*Math.sign(o[0]),s*h*Math.sign(o[1])];return Rt(xt(o),A(f,g))};function Xee({center:e,halfWidth:t,halfHeight:n},[r,i]){let[a,s]=e,o=r[0]-a,c=r[1]-s,d=i[0]-a,l=i[1]-s,h=Math.pow(d-o,2)/Math.pow(t,2)+Math.pow(l-c,2)/Math.pow(n,2),f=2*(o*(d-o)/Math.pow(t,2)+c*(l-c)/Math.pow(n,2)),g=Math.pow(o,2)/Math.pow(t,2)+Math.pow(c,2)/Math.pow(n,2)-1,U=(-f+Math.sqrt(Math.pow(f,2)-4*h*g))/(2*h),y=(-f-Math.sqrt(Math.pow(f,2)-4*h*g))/(2*h),v=[A(o+U*(d-o)+a,c+U*(l-c)+s),A(o+y*(d-o)+a,c+y*(l-c)+s)].filter(x=>!isNaN(x[0])&&!isNaN(x[1]));return v.length===2&&rs(v[0],v[1])?[v[0]]:v}function UA(e,t=0){let n=Ja(Math.min(e.width,e.height),e);if(n<=0){let h=E3(A(e.x-t,e.y-t),A(e.x+e.width+t,e.y+e.height+t)),f=Ge(A(h[0][0]+n,h[0][1]),A(h[1][0]-n,h[0][1])),g=Ge(A(h[1][0],h[0][1]+n),A(h[1][0],h[1][1]-n)),U=Ge(A(h[0][0]+n,h[1][1]),A(h[1][0]-n,h[1][1])),y=Ge(A(h[0][0],h[1][1]-n),A(h[0][0],h[0][1]+n));return[[f,g,U,y],[]]}let r=A(e.x+e.width/2,e.y+e.height/2),i=E3(A(e.x,e.y),A(e.x+e.width,e.y+e.height)),a=Ge(A(i[0][0]+n,i[0][1]),A(i[1][0]-n,i[0][1])),s=Ge(A(i[1][0],i[0][1]+n),A(i[1][0],i[1][1]-n)),o=Ge(A(i[0][0]+n,i[1][1]),A(i[1][0]-n,i[1][1])),c=Ge(A(i[0][0],i[1][1]-n),A(i[0][0],i[0][1]+n)),d=[Sn(Lr(Ve(A(i[0][0]-t,i[0][1]-t),r)),t),Sn(Lr(Ve(A(i[1][0]+t,i[0][1]-t),r)),t),Sn(Lr(Ve(A(i[1][0]+t,i[1][1]+t),r)),t),Sn(Lr(Ve(A(i[0][0]-t,i[1][1]+t),r)),t)],l=[$o(xt(d[0],c[1]),xt(d[0],A(c[1][0]+2/3*(i[0][0]-c[1][0]),c[1][1]+2/3*(i[0][1]-c[1][1]))),xt(d[0],A(a[0][0]+2/3*(i[0][0]-a[0][0]),a[0][1]+2/3*(i[0][1]-a[0][1]))),xt(d[0],a[0])),$o(xt(d[1],a[1]),xt(d[1],A(a[1][0]+2/3*(i[1][0]-a[1][0]),a[1][1]+2/3*(i[0][1]-a[1][1]))),xt(d[1],A(s[0][0]+2/3*(i[1][0]-s[0][0]),s[0][1]+2/3*(i[0][1]-s[0][1]))),xt(d[1],s[0])),$o(xt(d[2],s[1]),xt(d[2],A(s[1][0]+2/3*(i[1][0]-s[1][0]),s[1][1]+2/3*(i[1][1]-s[1][1]))),xt(d[2],A(o[1][0]+2/3*(i[1][0]-o[1][0]),o[1][1]+2/3*(i[1][1]-o[1][1]))),xt(d[2],o[1])),$o(xt(d[3],o[0]),xt(d[3],A(o[0][0]+2/3*(i[0][0]-o[0][0]),o[0][1]+2/3*(i[1][1]-o[0][1]))),xt(d[3],A(c[0][0]+2/3*(i[0][0]-c[0][0]),c[0][1]+2/3*(i[1][1]-c[0][1]))),xt(d[3],c[0]))];return[[Ge(l[0][3],l[1][0]),Ge(l[1][3],l[2][0]),Ge(l[2][3],l[3][0]),Ge(l[3][3],l[0][0])],l]}function bA(e,t=0){var C;let[n,r,i,a,s,o,c,d]=NA(e),l=Ja(Math.abs(n-c),e),h=Ja(Math.abs(a-r),e);if(((C=e.roundness)==null?void 0:C.type)==null){let[S,k,M,T]=[A(e.x+n,e.y+r-t),A(e.x+i+t,e.y+a),A(e.x+s,e.y+o+t),A(e.x+c-t,e.y+d)],R=Ge(A(S[0]+l,S[1]+h),A(k[0]-l,k[1]-h)),j=Ge(A(k[0]-l,k[1]+h),A(M[0]+l,M[1]-h)),P=Ge(A(M[0]-l,M[1]-h),A(T[0]+l,T[1]+h)),N=Ge(A(T[0]+l,T[1]-h),A(S[0]-l,S[1]+h));return[[R,j,P,N],[]]}let f=A(e.x+e.width/2,e.y+e.height/2),[g,U,y,v]=[A(e.x+n,e.y+r),A(e.x+i,e.y+a),A(e.x+s,e.y+o),A(e.x+c,e.y+d)],x=[Sn(Lr(Ve(U,f)),t),Sn(Lr(Ve(y,f)),t),Sn(Lr(Ve(v,f)),t),Sn(Lr(Ve(g,f)),t)],w=[$o(xt(x[0],A(U[0]-l,U[1]-h)),xt(x[0],U),xt(x[0],U),xt(x[0],A(U[0]-l,U[1]+h))),$o(xt(x[1],A(y[0]+l,y[1]-h)),xt(x[1],y),xt(x[1],y),xt(x[1],A(y[0]-l,y[1]-h))),$o(xt(x[2],A(v[0]+l,v[1]+h)),xt(x[2],v),xt(x[2],v),xt(x[2],A(v[0]+l,v[1]-h))),$o(xt(x[3],A(g[0]-l,g[1]+h)),xt(x[3],g),xt(x[3],g),xt(x[3],A(g[0]+l,g[1]+h)))];return[[Ge(w[0][3],w[1][0]),Ge(w[1][3],w[2][0]),Ge(w[2][3],w[3][0]),Ge(w[3][3],w[0][0])],w]}var L3=e=>{if(e.type==="arrow")return!1;let t=!Ga(e.backgroundColor)||ma(e)||sa(e)||Le(e);return e.type==="line"||e.type==="freedraw"?t&&qo(e.points):t||Lt(e)},Ru=({x:e,y:t,element:n,shape:r,threshold:i=10,frameNameBound:a=null})=>{let s=L3(n)&&f2(A(e,t),r)||A3(A(e,t),r,i);return!s&&a&&(s=f2(A(e,t),{type:"polygon",data:fA(a).data})),s},Iv=(e,t,n,r,i=0)=>{let[a,s,o,c]=as(n,r);return a-=i,s-=i,o+=i,c+=i,SI(A(a,s),A(e,t),A(o,c))},Vee=(e,t)=>!Ru(e)&&!yA(e.x,e.y,xA(e.element,t))&&Iv(e.x,e.y,e.element,t),yA=(e,t,n)=>!!n&&f2(A(e,t),n),vA=(e,t,n=0)=>{switch(e.type){case"rectangle":case"image":case"text":case"iframe":case"embeddable":case"frame":case"magicframe":return Yee(e,t,n);case"diamond":return Gee(e,t,n);case"ellipse":return qee(e,t,n);default:throw new Error(`Unimplemented element type '${e.type}'`)}},Yee=(e,t,n=0)=>{let r=A(e.x+e.width/2,e.y+e.height/2),i=he(t[0],r,-e.angle),a=he(t[1],r,-e.angle),[s,o]=UA(e,n);return[...s.map(c=>c1(Ge(i,a),c)).filter(c=>c!=null).map(c=>he(c,r,e.angle)),...o.flatMap(c=>_I(c,Ge(i,a))).filter(c=>c!=null).map(c=>he(c,r,e.angle))].filter((c,d,l)=>l.findIndex(h=>rs(c,h))===d)},Gee=(e,t,n=0)=>{let r=A(e.x+e.width/2,e.y+e.height/2),i=he(t[0],r,-e.angle),a=he(t[1],r,-e.angle),[s,o]=bA(e,n);return[...s.map(c=>c1(Ge(i,a),c)).filter(c=>c!=null).map(c=>he(c,r,e.angle)),...o.flatMap(c=>_I(c,Ge(i,a))).filter(c=>c!=null).map(c=>he(c,r,e.angle))].filter((c,d,l)=>l.findIndex(h=>rs(c,h))===d)},qee=(e,t,n=0)=>{let r=A(e.x+e.width/2,e.y+e.height/2),i=he(t[0],r,-e.angle),a=he(t[1],r,-e.angle);return Xee(gA(r,e.width/2+n,e.height/2+n),w3(i,a)).map(s=>he(s,r,e.angle))},kt={EQUAL:"Equal",MINUS:"Minus",NUM_ADD:"NumpadAdd",NUM_SUBTRACT:"NumpadSubtract",NUM_ZERO:"Numpad0",BRACKET_RIGHT:"BracketRight",BRACKET_LEFT:"BracketLeft",ONE:"Digit1",TWO:"Digit2",THREE:"Digit3",QUOTE:"Quote",ZERO:"Digit0",SLASH:"Slash",C:"KeyC",D:"KeyD",H:"KeyH",V:"KeyV",Z:"KeyZ",Y:"KeyY",R:"KeyR",S:"KeyS"},Z={ARROW_DOWN:"ArrowDown",ARROW_LEFT:"ArrowLeft",ARROW_RIGHT:"ArrowRight",ARROW_UP:"ArrowUp",PAGE_UP:"PageUp",PAGE_DOWN:"PageDown",BACKSPACE:"Backspace",ALT:"Alt",CTRL_OR_CMD:Xs?"metaKey":"ctrlKey",DELETE:"Delete",ENTER:"Enter",ESCAPE:"Escape",QUESTION_MARK:"?",SPACE:" ",TAB:"Tab",CHEVRON_LEFT:"<",CHEVRON_RIGHT:">",PERIOD:".",COMMA:",",SLASH:"/",A:"a",D:"d",E:"e",F:"f",G:"g",H:"h",I:"i",L:"l",O:"o",P:"p",Q:"q",R:"r",S:"s",T:"t",V:"v",X:"x",Y:"y",Z:"z",K:"k",0:"0",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9"},Zee=new Map([[Z.Z,kt.Z],[Z.Y,kt.Y]]),Kee=e=>/^[a-z]$/.test(e.toLowerCase()),R3=(e,t)=>{if(t===e.key.toLowerCase())return!0;let n=Zee.get(t);return!!(n&&!Kee(e.key)&&e.code===n)},hp=e=>e===Z.ARROW_LEFT||e===Z.ARROW_RIGHT||e===Z.ARROW_DOWN||e===Z.ARROW_UP,Kb=e=>e.altKey,Bf=e=>e.shiftKey,Lp=e=>e.shiftKey,Av=[{icon:bG,value:"selection",key:Z.V,numericKey:Z[1],fillable:!0},{icon:yG,value:"rectangle",key:Z.R,numericKey:Z[2],fillable:!0},{icon:vG,value:"diamond",key:Z.D,numericKey:Z[3],fillable:!0},{icon:xG,value:"ellipse",key:Z.O,numericKey:Z[4],fillable:!0},{icon:wG,value:"arrow",key:Z.A,numericKey:Z[5],fillable:!0},{icon:EG,value:"line",key:Z.L,numericKey:Z[6],fillable:!0},{icon:d1,value:"freedraw",key:[Z.P,Z.X],numericKey:Z[7],fillable:!1},{icon:WI,value:"text",key:Z.T,numericKey:Z[8],fillable:!1},{icon:SG,value:"image",key:null,numericKey:Z[9],fillable:!1},{icon:_G,value:"eraser",key:Z.E,numericKey:Z[0],fillable:!1}],Qee=e=>{var t;return((t=Av.find((n,r)=>n.numericKey!=null&&e===n.numericKey.toString()||n.key&&(typeof n.key=="string"?n.key===e:n.key.includes(e))))==null?void 0:t.value)||null},No=(e,t)=>{var n;switch(e.type){case"rectangle":case"diamond":case"frame":case"magicframe":case"embeddable":case"image":case"iframe":case"text":case"selection":return fA(e);case"arrow":case"line":{let r=((n=yn.get(e))==null?void 0:n[0])??yn.generateElementShape(e,null)[0],[,,,,i,a]=lt(e,t);return L3(e)?Nee(e,r,A(e.x,e.y),e.angle,A(i,a)):Dee(r,A(e.x,e.y),e.angle,A(i,a))}case"ellipse":return Ree(e);case"freedraw":{let[,,,,r,i]=lt(e,t);return Pee(e,A(r,i),L3(e))}}},xA=(e,t)=>{let n=pt(e,t);return n?e.type==="arrow"?No({...n,...Re.getBoundTextElementPosition(e,n,t)},t):No(n,t):null},wA=(e,t)=>{let n=yn.generateElementShape(e,null);if(!n)return null;let r=wc(n[0]),i=A(0,0),a=0,s=1/0,o=null;for(;a<r.length;){let{op:c,data:d}=r[a];if(c==="move"&&(Dr(vY(d),"The returned ops is not compatible with a point"),i=d),c==="bcurveTo"){let l=i,h=A(d[0],d[1]),f=A(d[2],d[3]),g=A(d[4],d[5]),U=Rt(g,t);U<s&&(s=U,o=[l,h,f,g]),i=g}a++}return o},EA=(e,t,n,r,i)=>{let a=(c,d)=>Math.pow(1-c,3)*r[d]+3*c*Math.pow(1-c,2)*n[d]+3*Math.pow(c,2)*(1-c)*t[d]+e[d]*Math.pow(c,3),s=a(i,0),o=a(i,1);return A(s,o)},Jee=(e,t)=>{let n=wA(e,t);if(!n)return[];let r=[],i=1;for(;i>0;){let a=EA(n[0],n[1],n[2],n[3],i);r.push(A(a[0],a[1])),i-=.05}return r.length&&rs(r.at(-1),t)&&r.push(A(t[0],t[1])),r},CA=(e,t)=>{let n=[];n[0]=0;let r=Jee(e,t),i=0,a=0;for(;i<r.length-1;){let s=Rt(r[i],r[i+1]);a+=s,n.push(a),i++}return n},ete=(e,t)=>CA(e,t).at(-1),tte=(e,t,n)=>{let r=CA(e,t),i=r.length-1,a=r.at(-1),s=n*a,o=0,c=i,d=0;for(;o<c;)d=Math.floor(o+(c-o)/2),r[d]<s?o=d+1:c=d;return r[d]>s&&d--,r[d]===s?d/i:1-(d+(s-r[d])/(r[d+1]-r[d]))/i},Ds=(e,t)=>{let n={minX:e.x,minY:e.y,maxX:e.x+e.width,maxY:e.y+e.height,midX:e.x+e.width/2,midY:e.y+e.height/2},r=A(n.midX,n.midY),[i,a]=he(A(n.minX,n.minY),r,e.angle),[s,o]=he(A(n.maxX,n.minY),r,e.angle),[c,d]=he(A(n.maxX,n.maxY),r,e.angle),[l,h]=he(A(n.minX,n.maxY),r,e.angle),f=[Math.min(i,s,c,l),Math.min(a,o,d,h),Math.max(i,s,c,l),Math.max(a,o,d,h)];if(t){let[g,U,y,v]=t;return[f[0]-v,f[1]-g,f[2]+U,f[3]+y]}return f},ph=(e,t)=>e[0]>t[0]&&e[0]<t[2]&&e[1]>t[1]&&e[1]<t[3],Ja=(e,t)=>{var n,r,i,a;if(((n=t.roundness)==null?void 0:n.type)===Nn.PROPORTIONAL_RADIUS||((r=t.roundness)==null?void 0:r.type)===Nn.LEGACY)return e*Bb;if(((i=t.roundness)==null?void 0:i.type)===Nn.ADAPTIVE_RADIUS){let s=((a=t.roundness)==null?void 0:a.value)??uY,o=s/Bb;return e<=o?e*Bb:s}return 0},qo=(e,t=1)=>{if(e.length>=3){let[n,r]=[e[0],e[e.length-1]];return Rt(n,r)<=pg/t}return!1},sr=10,nte=(e,t,n,r,i,a,s)=>{var P,N;let{width:o,height:c}=Zo(e),d=n/o,l=r/c,h=(((P=e.crop)==null?void 0:P.x)??0)/d,f=(((N=e.crop)==null?void 0:N.y)??0)/l,g=he(A(i,a),A(e.x+e.width/2,e.y+e.height/2),-e.angle);i=g[0],a=g[1];let U=e.width,y=e.height,v=e.crop??{x:0,y:0,width:n,height:r,naturalWidth:n,naturalHeight:r},x=v.height,w=v.width,C=e.scale[0]===-1,S=e.scale[1]===-1,k=a-e.y,M=i-e.x;t.includes("n")&&(y=vt(e.height-k,sr,S?c-f:e.height+f)),t.includes("s")&&(k=a-e.y-e.height,y=vt(e.height+k,sr,S?e.height+f:c-f)),t.includes("e")&&(M=i-e.x-e.width,U=vt(e.width+M,sr,C?e.width+h:o-h)),t.includes("w")&&(U=vt(e.width-M,sr,C?o-h:e.width+h));let T=F=>{F.height=y*l,F.width=U*d};T(v);let R=(F,$)=>{T($),F.includes("n")&&(S||($.y+=x-$.height)),F.includes("s")&&S&&($.y+=x-$.height),F.includes("e")&&C&&($.x+=w-$.width),F.includes("w")&&(C||($.x+=w-$.width))};switch(t){case"n":{if(s){let F=h+e.width/2,$=o-h-e.width/2,q=Math.min(F,$)*2;U=vt(y*s,sr,q),y=U/s}R(t,v),s&&(v.x+=(w-v.width)/2);break}case"s":{if(s){let F=h+e.width/2,$=o-h-e.width/2,q=Math.min(F,$)*2;U=vt(y*s,sr,q),y=U/s}R(t,v),s&&(v.x+=(w-v.width)/2);break}case"w":{if(s){let F=f+e.height/2,$=c-f-e.height/2,q=Math.min(F,$)*2;y=vt(U/s,sr,q),U=y*s}R(t,v),s&&(v.y+=(x-v.height)/2);break}case"e":{if(s){let F=f+e.height/2,$=c-f-e.height/2,q=Math.min(F,$)*2;y=vt(U/s,sr,q),U=y*s}R(t,v),s&&(v.y+=(x-v.height)/2);break}case"ne":{if(s)if(M>-k){let F=S?c-f:f+e.height;y=vt(U/s,sr,F),U=y*s}else{let F=C?h+e.width:o-h;U=vt(y*s,sr,F),y=U/s}R(t,v);break}case"nw":{if(s)if(M<k){let F=S?c-f:f+e.height;y=vt(U/s,sr,F),U=y*s}else{let F=C?o-h:h+e.width;U=vt(y*s,sr,F),y=U/s}R(t,v);break}case"se":{if(s)if(M>k){let F=S?f+e.height:c-f;y=vt(U/s,sr,F),U=y*s}else{let F=C?h+e.width:o-h;U=vt(y*s,sr,F),y=U/s}R(t,v);break}case"sw":{if(s)if(-M>k){let F=S?f+e.height:c-f;y=vt(U/s,sr,F),U=y*s}else{let F=C?o-h:h+e.width;U=vt(y*s,sr,F),y=U/s}R(t,v);break}}let j=rte(e,t,U,y,!!s);return YE(v.width,v.naturalWidth)&&YE(v.height,v.naturalHeight)&&(v=null),{x:j[0],y:j[1],width:U,height:y,crop:v}},rte=(e,t,n,r,i)=>{let[a,s,o,c]=oc(e,e.width,e.height,!0),d=A(a,s),l=A(o,c),h=H1(d,l),[f,g,U,y]=oc(e,n,r,!0),v=U-f,x=y-g,w=[...d];if(["n","w","nw"].includes(t)&&(w=[l[0]-Math.abs(v),l[1]-Math.abs(x)]),t==="ne"){let R=[d[0],l[1]];w=[R[0],R[1]-Math.abs(x)]}if(t==="sw"){let R=[l[0],d[1]];w=[R[0]-Math.abs(v),R[1]]}i&&(["s","n"].includes(t)&&(w[0]=h[0]-v/2),["e","w"].includes(t)&&(w[1]=h[1]-x/2));let C=e.angle,S=he(w,h,C),k=[w[0]+Math.abs(v)/2,w[1]+Math.abs(x)/2],M=he(k,h,C);w=he(S,M,-C);let T=[...w];return T[0]+=e.x-f,T[1]+=e.y-g,T},ite=(e,t)=>{if(e.crop){let{width:n,height:r}=Zo(e),[i,a,s,o,c,d]=lt(e,t),l=Ve(he(A(i,a),A(c,d),e.angle)),h=Ve(he(A(s,a),A(c,d),e.angle)),f=Lr(a2(h,l)),g=Ve(he(A(i,o),A(c,d),e.angle)),U=a2(g,l),y=Lr(U),{cropX:v,cropY:x}=ate(e.crop,e.scale),w=ec(ec(l,Sn(f,-v*n/e.crop.naturalWidth)),Sn(y,-x*r/e.crop.naturalHeight)),C=xt(ec(ec(w,Sn(f,n/2)),Sn(y,r/2))),S=he(xt(w),C,-e.angle);return{...e,x:S[0],y:S[1],width:n,height:r,crop:null}}return e},Zo=e=>{if(e.crop){let t=e.width/(e.crop.width/e.crop.naturalWidth),n=e.height/(e.crop.height/e.crop.naturalHeight);return{width:t,height:n}}return{width:e.width,height:e.height}},ate=(e,t)=>{let n=e.x,r=e.y,i=t[0]===-1,a=t[1]===-1;return i&&(n=e.naturalWidth-Math.abs(n)-e.width),a&&(r=e.naturalHeight-Math.abs(r)-e.height),{cropX:n,cropY:r}},ste=(e,t=!1)=>{let n=e.crop;if(!n)return null;let r=e.scale[0]===-1,i=e.scale[1]===-1,a=n.x,s=n.y;if(r&&(a=n.naturalWidth-n.width-n.x),i&&(s=n.naturalHeight-n.height-n.y),t)return{x:a,y:s};let{width:o,height:c}=Zo(e);return{x:a/(n.naturalWidth/o),y:s/(n.naturalHeight/c)}},SA="invert(100%) hue-rotate(180deg) saturate(1.25)",ote=Vs(),_A=(e,t)=>aa(e)&&!t.imageCache.has(e.fileId),kA=(e,t,n)=>{var r;return n.theme===wt.DARK&&aa(e)&&!_A(e,t)&&((r=t.imageCache.get(e.fileId))==null?void 0:r.mimeType)!==We.svg},TU=e=>{switch(e.type){case"freedraw":return e.strokeWidth*12;case"text":return e.fontSize/2;default:return 20}},TA=(e,t,n,r,i=1)=>{let a=((t==null?void 0:t.opacity)??100)*e.opacity/1e4*i;return(n.has(e.id)||r&&r.some(s=>s.id===e.id)||t&&n.has(t.id))&&(a*=dY/100),a},lte=(e,t,n)=>{let r=TU(e),[i,a,s,o]=lt(e,t),c=st(e)||pa(e)?Mr(i,s):e.width,d=st(e)||pa(e)?Mr(a,o):e.height,l=c*window.devicePixelRatio+r*2,h=d*window.devicePixelRatio+r*2,f=n.value;return(l*f>32767||h*f>32767)&&(f=Math.min(32767/l,32767/h)),l*h*f*f>16777216&&(f=Math.sqrt(16777216/(l*h))),l=Math.floor(l*f),h=Math.floor(h*f),{width:l,height:h,scale:f}},MA=(e,t,n,r,i)=>{var x,w;let a=document.createElement("canvas"),s=a.getContext("2d"),o=TU(e),{width:c,height:d,scale:l}=lte(e,t,n);if(!c||!d)return null;a.width=c,a.height=d;let h=-100,f=0;if(st(e)||pa(e)){let[C,S]=lt(e,t);h=e.x>C?Mr(e.x,C)*window.devicePixelRatio*l:0,f=e.y>S?Mr(e.y,S)*window.devicePixelRatio*l:0,s.translate(h,f)}s.save(),s.translate(o*l,o*l),s.scale(window.devicePixelRatio*l,window.devicePixelRatio*l);let g=vc.canvas(a);kA(e,r,i)&&(s.filter=SA),vg(e,g,s,r),s.restore();let U=pt(e,t),y=document.createElement("canvas"),v=y.getContext("2d");if(Ut(e)&&U){let[C,S,k,M]=lt(e,t),T=Math.max(Mr(C,k),Mr(S,M));y.width=T*window.devicePixelRatio*l+o*l*10,y.height=T*window.devicePixelRatio*l+o*l*10,v.translate(y.width/2,y.height/2),v.rotate(e.angle),v.drawImage(a,-a.width/2,-a.height/2,a.width,a.height);let[,,,,R,j]=lt(U,t);v.rotate(-e.angle);let P=(y.width-a.width)/2,N=(y.height-a.height)/2,F=y.width/2-(R-C)*window.devicePixelRatio*l-P-o*l,$=y.height/2-(j-S)*window.devicePixelRatio*l-N-o*l;v.translate(-F,-$),v.clearRect(-(U.width/2+Xn)*window.devicePixelRatio*l,-(U.height/2+Xn)*window.devicePixelRatio*l,(U.width+Xn*2)*window.devicePixelRatio*l,(U.height+Xn*2)*window.devicePixelRatio*l)}return{element:e,canvas:a,theme:i.theme,scale:l,zoomValue:n.value,canvasOffsetX:h,canvasOffsetY:f,boundTextElementVersion:((x=pt(e,t))==null?void 0:x.version)||null,containingFrameOpacity:((w=bi(e,t))==null?void 0:w.opacity)||100,boundTextCanvas:y,angle:e.angle,imageCrop:Lt(e)?e.crop:null}},cte=14,IA=document.createElement("img");IA.src=`data:${We.svg},${encodeURIComponent('<svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="image" class="svg-inline--fa fa-image fa-w-16" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="#888" d="M464 448H48c-26.51 0-48-21.49-48-48V112c0-26.51 21.49-48 48-48h416c26.51 0 48 21.49 48 48v288c0 26.51-21.49 48-48 48zM112 120c-30.928 0-56 25.072-56 56s25.072 56 56 56 56-25.072 56-56-25.072-56-56-56zM64 384h384V272l-87.515-87.515c-4.686-4.686-12.284-4.686-16.971 0L208 320l-55.515-55.515c-4.686-4.686-12.284-4.686-16.971 0L64 336v48z"></path></svg>')}`;var AA=document.createElement("img");AA.src=`data:${We.svg},${encodeURIComponent('<svg viewBox="0 0 668 668" xmlns="http://www.w3.org/2000/svg" xml:space="preserve" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2"><path d="M464 448H48c-26.51 0-48-21.49-48-48V112c0-26.51 21.49-48 48-48h416c26.51 0 48 21.49 48 48v288c0 26.51-21.49 48-48 48ZM112 120c-30.928 0-56 25.072-56 56s25.072 56 56 56 56-25.072 56-56-25.072-56-56-56ZM64 384h384V272l-87.515-87.515c-4.686-4.686-12.284-4.686-16.971 0L208 320l-55.515-55.515c-4.686-4.686-12.284-4.686-16.971 0L64 336v48Z" style="fill:#888;fill-rule:nonzero" transform="matrix(.81709 0 0 .81709 124.825 145.825)"/><path d="M256 8C119.034 8 8 119.033 8 256c0 136.967 111.034 248 248 248s248-111.034 248-248S392.967 8 256 8Zm130.108 117.892c65.448 65.448 70 165.481 20.677 235.637L150.47 105.216c70.204-49.356 170.226-44.735 235.638 20.676ZM125.892 386.108c-65.448-65.448-70-165.481-20.677-235.637L361.53 406.784c-70.203 49.356-170.226 44.736-235.638-20.676Z" style="fill:#888;fill-rule:nonzero" transform="matrix(.30366 0 0 .30366 506.822 60.065)"/></svg>')}`;var dte=(e,t)=>{t.fillStyle="#E7E7E7",t.fillRect(0,0,e.width,e.height);let n=Math.min(e.width,e.height),r=Math.min(n,Math.min(n*.4,100));t.drawImage(e.status==="error"?AA:IA,e.width/2-r/2,e.height/2-r/2,r,r)},vg=(e,t,n,r,i)=>{var a;switch(e.type){case"rectangle":case"iframe":case"embeddable":case"diamond":case"ellipse":{n.lineJoin="round",n.lineCap="round",t.draw(yn.get(e));break}case"arrow":case"line":{n.lineJoin="round",n.lineCap="round",yn.get(e).forEach(s=>{t.draw(s)});break}case"freedraw":{n.save(),n.fillStyle=e.strokeColor;let s=fte(e),o=yn.get(e);o&&t.draw(o),n.fillStyle=e.strokeColor,n.fill(s),n.restore();break}case"image":{let s=aa(e)?(a=r.imageCache.get(e.fileId))==null?void 0:a.image:void 0;if(s!=null&&!(s instanceof Promise)){e.roundness&&n.roundRect&&(n.beginPath(),n.roundRect(0,0,e.width,e.height,Ja(Math.min(e.width,e.height),e)),n.clip());let{x:o,y:c,width:d,height:l}=e.crop?e.crop:{x:0,y:0,width:s.naturalWidth,height:s.naturalHeight};n.drawImage(s,o,c,d,l,0,0,e.width,e.height)}else dte(e,n);break}default:if(Le(e)){let s=MI(e.text),o=s&&!n.canvas.isConnected;o&&document.body.appendChild(n.canvas),n.canvas.setAttribute("dir",s?"rtl":"ltr"),n.save(),n.font=Bt(e),n.fillStyle=e.strokeColor,n.textAlign=e.textAlign;let c=e.text.replace(/\r\n?/g,`
55
- `).split(`
56
- `),d=e.textAlign==="center"?e.width/2:e.textAlign==="right"?e.width:0,l=X1(e.fontSize,e.lineHeight),h=hA(e.fontFamily,e.fontSize,l);for(let f=0;f<c.length;f++)n.fillText(c[f],d,f*l+h);n.restore(),o&&n.canvas.remove()}else throw new Error(`Unimplemented type ${e.type}`)}},D3=new WeakMap,CC=(e,t,n,r)=>{var h;let i=n?r.zoom:ote.zoom,a=D3.get(e),s=a&&a.zoomValue!==i.value&&!(r!=null&&r.shouldCacheIgnoreZoom),o=pt(e,t),c=(o==null?void 0:o.version)||null,d=Lt(e)?e.crop:null,l=((h=bi(e,t))==null?void 0:h.opacity)||100;if(!a||s||a.theme!==r.theme||a.boundTextElementVersion!==c||a.imageCrop!==d||a.containingFrameOpacity!==l||Ut(e)&&o&&e.angle!==a.angle){let f=MA(e,t,i,n,r);return f?(D3.set(e,f),f):null}return a},Qb=(e,t,n,r,i)=>{let a=e.element,s=TU(a),o=e.scale,[c,d,l,h]=lt(a,i),f=((c+l)/2+r.scrollX)*window.devicePixelRatio,g=((d+h)/2+r.scrollY)*window.devicePixelRatio;t.save(),t.scale(1/window.devicePixelRatio,1/window.devicePixelRatio);let U=pt(a,i);if(Ut(a)&&U){let y=(e.boundTextCanvas.width-e.canvas.width)/2,v=(e.boundTextCanvas.height-e.canvas.height)/2;t.translate(f,g),t.drawImage(e.boundTextCanvas,-(l-c)/2*window.devicePixelRatio-y/o-s,-(h-d)/2*window.devicePixelRatio-v/o-s,e.boundTextCanvas.width/o,e.boundTextCanvas.height/o)}else t.translate(f,g),t.rotate(a.angle),"scale"in e.element&&!_A(a,n)&&t.scale(e.element.scale[0],e.element.scale[1]),t.translate(-f,-g),t.drawImage(e.canvas,(c+r.scrollX)*window.devicePixelRatio-s*e.scale/e.scale,(d+r.scrollY)*window.devicePixelRatio-s*e.scale/e.scale,e.canvas.width/e.scale,e.canvas.height/e.scale),mt.VITE_APP_DEBUG_ENABLE_TEXT_CONTAINER_BOUNDING_BOX;t.restore()},ute=(e,t,n,r)=>{t.save(),t.translate(e.x+n.scrollX,e.y+n.scrollY),t.fillStyle="rgba(0, 0, 200, 0.04)";let i=.5/n.zoom.value;t.fillRect(i,i,e.width,e.height),t.lineWidth=1/n.zoom.value,t.strokeStyle=r,t.strokeRect(i,i,e.width,e.height),t.restore()},Yc=(e,t,n,r,i,a,s)=>{var c;let o=((c=s.openDialog)==null?void 0:c.name)==="elementLinkSelector"&&!s.selectedElementIds[e.id]&&!s.hoveredElementIds[e.id];switch(i.globalAlpha=TA(e,bi(e,t),a.elementsPendingErasure,a.pendingFlowchartNodes,o?wI:1),e.type){case"magicframe":case"frame":{s.frameRendering.enabled&&s.frameRendering.outline&&(i.save(),i.translate(e.x+s.scrollX,e.y+s.scrollY),i.fillStyle="rgba(0, 0, 200, 0.04)",i.lineWidth=Un.strokeWidth/s.zoom.value,i.strokeStyle=Un.strokeColor,Ug(e)&&(i.strokeStyle=s.theme===wt.LIGHT?"#7affd7":"#1d8264"),i.roundRect?(i.beginPath(),i.roundRect(0,0,e.width,e.height,Un.radius/s.zoom.value),i.stroke(),i.closePath()):i.strokeRect(0,0,e.width,e.height),i.restore());break}case"freedraw":{if(yn.generateElementShape(e,null),a.isExporting){let[d,l,h,f]=lt(e,t),g=(d+h)/2+s.scrollX,U=(l+f)/2+s.scrollY,y=(h-d)/2-(e.x-d),v=(f-l)/2-(e.y-l);i.save(),i.translate(g,U),i.rotate(e.angle),i.translate(-y,-v),vg(e,r,i,a),i.restore()}else{let d=CC(e,n,a,s);if(!d)return;Qb(d,i,a,s,n)}break}case"rectangle":case"diamond":case"ellipse":case"line":case"arrow":case"image":case"text":case"iframe":case"embeddable":{if(yn.generateElementShape(e,a),a.isExporting){let[d,l,h,f]=lt(e,t),g=(d+h)/2+s.scrollX,U=(l+f)/2+s.scrollY,y=(h-d)/2-(e.x-d),v=(f-l)/2-(e.y-l);if(Le(e)){let w=ur(e,t);if(Ut(w)){let C=Re.getBoundTextElementPosition(w,e,t);y=(h-d)/2-(C.x-d),v=(f-l)/2-(C.y-l)}}i.save(),i.translate(g,U),kA(e,a,s)&&(i.filter="none");let x=pt(e,t);if(Ut(e)&&x){let w=document.createElement("canvas"),C=w.getContext("2d"),S=Math.max(Mr(d,h),Mr(l,f)),k=TU(e);w.width=S*s.exportScale+k*10*s.exportScale,w.height=S*s.exportScale+k*10*s.exportScale,C.translate(w.width/2,w.height/2),C.scale(s.exportScale,s.exportScale),y=e.width/2-(e.x-d),v=e.height/2-(e.y-l),C.rotate(e.angle);let M=vc.canvas(w);C.translate(-y,-v),vg(e,M,C,a),C.translate(y,v),C.rotate(-e.angle);let[,,,,T,R]=lt(x,t),j=(d+h)/2-T,P=(l+f)/2-R;C.translate(-j,-P),C.clearRect(-x.width/2,-x.height/2,x.width,x.height),i.scale(1/s.exportScale,1/s.exportScale),i.drawImage(w,-w.width/2,-w.height/2,w.width,w.height)}else i.rotate(e.angle),e.type==="image"&&i.scale(e.scale[0],e.scale[1]),i.translate(-y,-v),vg(e,r,i,a);i.restore()}else{let d=CC(e,n,a,s);if(!d)return;let l=i.imageSmoothingEnabled;if(!(s!=null&&s.shouldCacheIgnoreZoom)&&(!e.angle||UY(e.angle))&&(i.imageSmoothingEnabled=!1),e.id===s.croppingElementId&&Lt(d.element)&&d.element.crop!==null){i.save(),i.globalAlpha=.1;let h=MA(ite(d.element,t),n,s.zoom,a,s);h&&Qb(h,i,a,s,n),i.restore()}Qb(d,i,a,s,n),i.imageSmoothingEnabled=l}break}default:throw new Error(`Unimplemented type ${e.type}`)}i.globalAlpha=1},LA=new WeakMap([]);function hte(e){let t=Lv(e),n=new Path2D(t);return LA.set(e,n),n}function fte(e){return LA.get(e)}function Lv(e){let t=e.simulatePressure?e.points:e.points.length?e.points.map(([r,i],a)=>[r,i,e.pressures[a]]):[[0,0,.5]],n={simulatePressure:e.simulatePressure,size:e.strokeWidth*4.25,thinning:.6,smoothing:.5,streamline:.5,easing:r=>Math.sin(r*Math.PI/2),last:!!e.lastCommittedPoint};return mte(vV(t,n))}function SC(e,t){return[(e[0]+t[0])/2,(e[1]+t[1])/2]}var pte=/(\s?[A-Z]?,?-?[0-9]*\.[0-9]{0,2})(([0-9]|e|-)*)/g;function mte(e){if(!e.length)return"";let t=e.length-1;return e.reduce((n,r,i,a)=>(i===t?n.push(r,SC(r,a[0]),"L",a[0],"Z"):n.push(r,SC(r,a[i+1])),n),["M",e[0],"Q"]).join(" ").replace(pte,"$1")}var mh=e=>e==="rectangle"||e==="iframe"||e==="embeddable"||e==="ellipse"||e==="diamond"||e==="line"||e==="freedraw",j3=e=>e!=="image"&&e!=="frame"&&e!=="magicframe",_C=e=>e==="rectangle"||e==="iframe"||e==="embeddable"||e==="ellipse"||e==="diamond"||e==="freedraw"||e==="arrow"||e==="line",kC=e=>e==="rectangle"||e==="iframe"||e==="embeddable"||e==="ellipse"||e==="diamond"||e==="arrow"||e==="line",P3=e=>e==="rectangle"||e==="iframe"||e==="embeddable"||e==="line"||e==="diamond"||e==="image",TC=e=>e==="arrow",p2=e=>e==="arrow",Cn=[1,0],cr=[0,1],di=[-1,0],ui=[0,-1],Dm=(e,t)=>{let n=z1(Math.atan2(t[1]-e[1],t[0]-e[0]));return n>=315||n<45?ui:n>=45&&n<135?Cn:n>=135&&n<225?cr:di},Md=e=>{let[t,n]=e,r=Math.abs(t),i=Math.abs(n);return t>i?Cn:t<=-i?di:n>r?cr:ui},u1=(e,t)=>Md(Ve(e,t)),Oo=(e,t)=>Bo(u1(e,t)),_n=(e,t)=>e[0]===t[0]&&e[1]===t[1],Bo=e=>_n(e,Cn)||_n(e,di),RA=(e,t,n)=>{let r=jv(t);if(e.type==="diamond"){if(n[0]<e.x)return di;if(n[1]<e.y)return ui;if(n[0]>e.x+e.width)return Cn;if(n[1]>e.y+e.height)return cr;let c=he(Lo(A(e.x+e.width/2,e.y),r,2),r,e.angle),d=he(Lo(A(e.x+e.width,e.y+e.height/2),r,2),r,e.angle),l=he(Lo(A(e.x+e.width/2,e.y+e.height),r,2),r,e.angle),h=he(Lo(A(e.x,e.y+e.height/2),r,2),r,e.angle);return wu([c,d,r],n)?Dm(c,d):wu([d,l,r],n)?Dm(d,l):wu([l,h,r],n)?Dm(l,h):Dm(h,c)}let i=Lo(A(t[0],t[1]),r,2),a=Lo(A(t[2],t[1]),r,2),s=Lo(A(t[0],t[3]),r,2),o=Lo(A(t[2],t[3]),r,2);return wu([i,a,r],n)?ui:wu([a,o,r],n)?Cn:wu([o,s,r],n)?cr:di},DA=e=>[e[0]===0?0:e[0]>0?-1:1,e[1]===0?0:e[1]>0?-1:1],gte=e=>[8,8+e],jA=e=>[1.5,6+e];function Ute(e){let t=e.roughness,n=Math.max(e.width,e.height),r=Math.min(e.width,e.height);return r>=20&&n>=50||r>=15&&e.roundness&&P3(e.type)||st(e)&&n>=50?t:Math.min(t/(n<10?3:2),2.5)}var Ri=(e,t=!1)=>{let n={seed:e.seed,strokeLineDash:e.strokeStyle==="dashed"?gte(e.strokeWidth):e.strokeStyle==="dotted"?jA(e.strokeWidth):void 0,disableMultiStroke:e.strokeStyle!=="solid",strokeWidth:e.strokeStyle!=="solid"?e.strokeWidth+.5:e.strokeWidth,fillWeight:e.strokeWidth/2,hachureGap:e.strokeWidth*4,roughness:Ute(e),stroke:e.strokeColor,preserveVertices:t||e.roughness<yI.cartoonist};switch(e.type){case"rectangle":case"iframe":case"embeddable":case"diamond":case"ellipse":return n.fillStyle=e.fillStyle,n.fill=Ga(e.backgroundColor)?void 0:e.backgroundColor,e.type==="ellipse"&&(n.curveFitting=1),n;case"line":case"freedraw":return qo(e.points)&&(n.fillStyle=e.fillStyle,n.fill=e.backgroundColor==="transparent"?void 0:e.backgroundColor),n;case"arrow":return n;default:throw new Error(`Unimplemented type ${e.type}`)}},MC=(e,t,n)=>sa(e)&&(t||li(e)&&(n==null?void 0:n.get(e.id))!==!0)&&Ga(e.backgroundColor)&&Ga(e.strokeColor)?{...e,roughness:0,backgroundColor:"#d3d3d3",fillStyle:"solid"}:Yl(e)?{...e,strokeColor:Ga(e.strokeColor)?"#000000":e.strokeColor,backgroundColor:Ga(e.backgroundColor)?"#f4f4f6":e.backgroundColor}:e,IC=(e,t,n,r,i,a,s)=>{let o=DC(e,t,n,r);if(o===null)return[];let c=(d,l)=>{if(d===null)return[];let[,,h,f,g,U]=d;return[i.line(h,f,g,U,l)]};switch(r){case"dot":case"circle":case"circle_outline":{let[d,l,h]=o;return delete a.strokeLineDash,[i.circle(d,l,h,{...a,fill:r==="circle_outline"?s:e.strokeColor,fillStyle:"solid",stroke:e.strokeColor,roughness:Math.min(.5,a.roughness||0)})]}case"triangle":case"triangle_outline":{let[d,l,h,f,g,U]=o;return delete a.strokeLineDash,[i.polygon([[d,l],[h,f],[g,U],[d,l]],{...a,fill:r==="triangle_outline"?s:e.strokeColor,fillStyle:"solid",roughness:Math.min(1,a.roughness||0)})]}case"diamond":case"diamond_outline":{let[d,l,h,f,g,U,y,v]=o;return delete a.strokeLineDash,[i.polygon([[d,l],[h,f],[g,U],[y,v],[d,l]],{...a,fill:r==="diamond_outline"?s:e.strokeColor,fillStyle:"solid",roughness:Math.min(1,a.roughness||0)})]}case"crowfoot_one":return c(o,a);case"bar":case"arrow":case"crowfoot_many":case"crowfoot_one_or_many":default:{let[d,l,h,f,g,U]=o;if(e.strokeStyle==="dotted"){let y=jA(e.strokeWidth-1);a.strokeLineDash=[y[0],y[1]-1]}else delete a.strokeLineDash;return a.roughness=Math.min(1,a.roughness||0),[i.line(h,f,d,l,a),i.line(g,U,d,l,a),...r==="crowfoot_one_or_many"?c(DC(e,t,n,"crowfoot_one"),a):[]]}}},bte=(e,t,{isExporting:n,canvasBackgroundColor:r,embedsValidationStatus:i})=>{switch(e.type){case"rectangle":case"iframe":case"embeddable":{let a;if(e.roundness){let s=e.width,o=e.height,c=Ja(Math.min(s,o),e);a=t.path(`M ${c} 0 L ${s-c} 0 Q ${s} 0, ${s} ${c} L ${s} ${o-c} Q ${s} ${o}, ${s-c} ${o} L ${c} ${o} Q 0 ${o}, 0 ${o-c} L 0 ${c} Q 0 0, ${c} 0`,Ri(MC(e,n,i),!0))}else a=t.rectangle(0,0,e.width,e.height,Ri(MC(e,n,i),!1));return a}case"diamond":{let a,[s,o,c,d,l,h,f,g]=NA(e);if(e.roundness){let U=Ja(Math.abs(s-f),e),y=Ja(Math.abs(d-o),e);a=t.path(`M ${s+U} ${o+y} L ${c-U} ${d-y}
57
- C ${c} ${d}, ${c} ${d}, ${c-U} ${d+y}
58
- L ${l+U} ${h-y}
59
- C ${l} ${h}, ${l} ${h}, ${l-U} ${h-y}
60
- L ${f+U} ${g+y}
61
- C ${f} ${g}, ${f} ${g}, ${f+U} ${g-y}
62
- L ${s-U} ${o+y}
63
- C ${s} ${o}, ${s} ${o}, ${s+U} ${o+y}`,Ri(e,!0))}else a=t.polygon([[s,o],[c,d],[l,h],[f,g]],Ri(e));return a}case"ellipse":return t.ellipse(e.width/2,e.height/2,e.width,e.height,Ri(e));case"line":case"arrow":{let a,s=Ri(e),o=e.points.length?e.points:[A(0,0)];if(Pe(e)?o.every(c=>Math.abs(c[0])<=1e6&&Math.abs(c[1])<=1e6)?a=[t.path(yte(o,16),Ri(e,!0))]:(console.error("Elbow arrow with extreme point positions detected. Arrow not rendered.",e.id,JSON.stringify(o)),a=[]):e.roundness?a=[t.curve(o,s)]:s.fill?a=[t.polygon(o,s)]:a=[t.linearPath(o,s)],e.type==="arrow"){let{startArrowhead:c=null,endArrowhead:d="arrow"}=e;if(c!==null){let l=IC(e,a,"start",c,t,s,r);a.push(...l)}if(d!==null){let l=IC(e,a,"end",d,t,s,r);a.push(...l)}}return a}case"freedraw":{let a;if(hte(e),qo(e.points)){let s=CV(e.points,.75);a=t.curve(s,{...Ri(e),stroke:"none"})}else a=null;return a}case"frame":case"magicframe":case"text":case"image":return null;default:return Cd(e,`generateElementShape(): Unimplemented type ${e==null?void 0:e.type}`),null}},yte=(e,t)=>{let n=[];for(let i=1;i<e.length-1;i+=1){let a=e[i-1],s=e[i+1],o=e[i],c=Oo(o,a),d=Oo(s,o),l=Math.min(t,Rt(e[i],s)/2,Rt(e[i],a)/2);c?a[0]<o[0]?n.push([e[i][0]-l,e[i][1]]):n.push([e[i][0]+l,e[i][1]]):a[1]<o[1]?n.push([e[i][0],e[i][1]-l]):n.push([e[i][0],e[i][1]+l]),n.push(e[i]),d?s[0]<o[0]?n.push([e[i][0]-l,e[i][1]]):n.push([e[i][0]+l,e[i][1]]):s[1]<o[1]?n.push([e[i][0],e[i][1]-l]):n.push([e[i][0],e[i][1]+l])}let r=[`M ${e[0][0]} ${e[0][1]}`];for(let i=0;i<n.length;i+=3)r.push(`L ${n[i][0]} ${n[i][1]}`),r.push(`Q ${n[i+1][0]} ${n[i+1][1]}, ${n[i+2][0]} ${n[i+2][1]}`);return r.push(`L ${e[e.length-1][0]} ${e[e.length-1][1]}`),r.join(" ")},gh=e=>{let t=e.map(r=>r[0]),n=e.map(r=>r[1]);return{width:Math.max(...t)-Math.min(...t),height:Math.max(...n)-Math.min(...n)}},m2=(e,t,n,r)=>{let i=n.map(f=>f[e]),a=Math.max(...i),s=Math.min(...i),o=a-s,c=o===0?1:t/o,d=1/0,l=n.map(f=>{let g=f[e]*c,U=[...f];return U[e]=g,g<d&&(d=g),U});if(!r||l.length===2)return l;let h=s-d;return l.map(f=>f.map((g,U)=>U===e?g+h:g))},PA=class xg{static getBounds(t,n){let r=xg.boundsCache.get(t);if(r!=null&&r.version&&r.version===t.version&&!an(t))return r.bounds;let i=xg.calculateBounds(t,n);return xg.boundsCache.set(t,{version:t.version,bounds:i}),i}static calculateBounds(t,n){let r,[i,a,s,o,c,d]=lt(t,n);if(pa(t)){let[l,h,f,g]=Rv(t.points.map(([U,y])=>he(A(U,y),A(c-t.x,d-t.y),t.angle)));return[l+t.x,h+t.y,f+t.x,g+t.y]}else if(st(t))r=_te(t,c,d,n);else if(t.type==="diamond"){let[l,h]=he(A(c,a),A(c,d),t.angle),[f,g]=he(A(c,o),A(c,d),t.angle),[U,y]=he(A(i,d),A(c,d),t.angle),[v,x]=he(A(s,d),A(c,d),t.angle),w=Math.min(l,f,U,v),C=Math.min(h,g,y,x),S=Math.max(l,f,U,v),k=Math.max(h,g,y,x);r=[w,C,S,k]}else if(t.type==="ellipse"){let l=(s-i)/2,h=(o-a)/2,f=Math.cos(t.angle),g=Math.sin(t.angle),U=Math.hypot(l*f,h*g),y=Math.hypot(h*f,l*g);r=[c-U,d-y,c+U,d+y]}else{let[l,h]=he(A(i,a),A(c,d),t.angle),[f,g]=he(A(i,o),A(c,d),t.angle),[U,y]=he(A(s,o),A(c,d),t.angle),[v,x]=he(A(s,a),A(c,d),t.angle),w=Math.min(l,f,U,v),C=Math.min(h,g,y,x),S=Math.max(l,f,U,v),k=Math.max(h,g,y,x);r=[w,C,S,k]}return r}};H(PA,"boundsCache",new WeakMap);var vte=PA,lt=(e,t,n=!1)=>{if(pa(e))return wte(e);if(st(e))return Re.getElementAbsoluteCoords(e,t,n);if(Le(e)){let r=t?ur(e,t):null;if(Ut(r)){let{x:i,y:a}=Re.getBoundTextElementPosition(r,e,t);return[i,a,i+e.width,a+e.height,i+e.width/2,a+e.height/2]}}return[e.x,e.y,e.x+e.width,e.y+e.height,e.x+e.width/2,e.y+e.height/2]},AC=(e,t)=>{let[n,r,i,a,s,o]=lt(e,t),c=A(s,o);if(st(e)||pa(e)){let x=[],w=0;for(;w<e.points.length-1;)x.push(Ge(he(A(e.points[w][0]+e.x,e.points[w][1]+e.y),c,e.angle),he(A(e.points[w+1][0]+e.x,e.points[w+1][1]+e.y),c,e.angle))),w++;return x}let[d,l,h,f,g,U,y,v]=[[n,r],[i,r],[n,a],[i,a],[s,r],[s,a],[n,o],[i,o]].map(x=>he(x,c,e.angle));return e.type==="diamond"?[Ge(g,y),Ge(g,v),Ge(U,y),Ge(U,v)]:e.type==="ellipse"?[Ge(g,y),Ge(g,v),Ge(U,y),Ge(U,v),Ge(g,y),Ge(g,v),Ge(U,y),Ge(U,v)]:[Ge(d,l),Ge(h,f),Ge(d,h),Ge(l,f),Ge(d,v),Ge(h,v),Ge(l,y),Ge(f,y)]},NA=e=>{let t=Math.floor(e.width/2)+1,n=0,r=e.width,i=Math.floor(e.height/2)+1,a=t,s=e.height;return[t,n,r,i,a,s,0,i]},LC=(e,t,n,r,i)=>{let a=1-e;return Math.pow(a,3)*t+3*Math.pow(a,2)*e*n+3*a*Math.pow(e,2)*r+Math.pow(e,3)*i},RC=(e,t,n,r)=>{let i=t-e,a=n-t,s=r-n,o=3*i-6*a+3*s,c=6*a-6*i,d=3*i,l=c*c-4*o*d;if(!(l>=0))return!1;let h=null,f=null,g=1/0,U=1/0;return o===0?g=U=-d/c:(g=(-c+Math.sqrt(l))/(2*o),U=(-c-Math.sqrt(l))/(2*o)),g>=0&&g<=1&&(h=LC(g,e,t,n,r)),U>=0&&U<=1&&(f=LC(U,e,t,n,r)),[h,f]},xte=(e,t,n,r)=>{let i=RC(e[0],t[0],n[0],r[0]),a=RC(e[1],t[1],n[1],r[1]),s=Math.min(e[0],r[0]),o=Math.max(e[0],r[0]);if(i){let l=i.filter(h=>h!==null);s=Math.min(s,...l),o=Math.max(o,...l)}let c=Math.min(e[1],r[1]),d=Math.max(e[1],r[1]);if(a){let l=a.filter(h=>h!==null);c=Math.min(c,...l),d=Math.max(d,...l)}return[s,c,o,d]},MU=(e,t)=>{let n=A(0,0),{minX:r,minY:i,maxX:a,maxY:s}=e.reduce((o,{op:c,data:d})=>{if(c==="move"){let l=mv(d);Dr(l!=null,"Op data is not a point"),n=l}else if(c==="bcurveTo"){let l=A(d[0],d[1]),h=A(d[2],d[3]),f=A(d[4],d[5]),g=t?t(l):l,U=t?t(h):h,y=t?t(f):f,v=t?t(n):n;n=f;let[x,w,C,S]=xte(v,g,U,y);o.minX=Math.min(o.minX,x),o.minY=Math.min(o.minY,w),o.maxX=Math.max(o.maxX,C),o.maxY=Math.max(o.maxY,S)}return o},{minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0});return[r,i,a,s]},Rv=e=>{let t=1/0,n=1/0,r=-1/0,i=-1/0;for(let[a,s]of e)t=Math.min(t,a),n=Math.min(n,s),r=Math.max(r,a),i=Math.max(i,s);return[t,n,r,i]},wte=e=>{let[t,n,r,i]=Rv(e.points),a=t+e.x,s=n+e.y,o=r+e.x,c=i+e.y;return[a,s,o,c,(a+o)/2,(s+c)/2]},Ete=e=>{switch(e){case"arrow":return 25;case"diamond":case"diamond_outline":return 12;case"crowfoot_many":case"crowfoot_one":case"crowfoot_one_or_many":return 20;default:return 15}},Cte=e=>{switch(e){case"bar":return 90;case"arrow":return 20;default:return 25}},DC=(e,t,n,r)=>{if(t.length<1)return null;let i=wc(t[0]);if(i.length<1)return null;let a=n==="start"?1:i.length-1,s=i[a].data;Dr(s.length===6,"Op data length is not 6");let o=A(s[4],s[5]),c=A(s[2],s[3]),d=A(s[0],s[1]),l=i[a-1],h=A(0,0);if(l.op==="move"){let q=mv(l.data);Dr(q!=null,"Op data is not a point"),h=q}else l.op==="bcurveTo"&&(h=A(l.data[4],l.data[5]));let f=(q,W)=>Math.pow(1-q,3)*o[W]+3*q*Math.pow(1-q,2)*c[W]+3*Math.pow(q,2)*(1-q)*d[W]+h[W]*Math.pow(q,3),[g,U]=n==="start"?h:o,[y,v]=[f(.3,0),f(.3,1)],x=Math.hypot(g-y,U-v),w=(g-y)/x,C=(U-v)/x,S=Ete(r),k=0;{let[q,W]=n==="end"?e.points[e.points.length-1]:e.points[0],[V,B]=e.points.length>1?n==="end"?e.points[e.points.length-2]:e.points[1]:[0,0];k=Math.hypot(q-V,W-B)}let M=Math.min(S,k*(r==="diamond"||r==="diamond_outline"?.25:.5)),T=g-w*M,R=U-C*M;if(r==="dot"||r==="circle"||r==="circle_outline"){let q=Math.hypot(R-U,T-g)+e.strokeWidth-2;return[g,U,q]}let j=Cte(r);if(r==="crowfoot_many"||r==="crowfoot_one_or_many"){let[q,W]=he(A(g,U),A(T,R),cd(-j)),[V,B]=he(A(g,U),A(T,R),cd(j));return[T,R,q,W,V,B]}let[P,N]=he(A(T,R),A(g,U),-j*Math.PI/180),[F,$]=he(A(T,R),A(g,U),cd(j));if(r==="diamond"||r==="diamond_outline"){let q,W;if(n==="start"){let[V,B]=e.points.length>1?e.points[1]:[0,0];[q,W]=he(A(g+M*2,U),A(g,U),Math.atan2(B-U,V-g))}else{let[V,B]=e.points.length>1?e.points[e.points.length-2]:[0,0];[q,W]=he(A(g-M*2,U),A(g,U),Math.atan2(U-B,g-V))}return[g,U,P,N,q,W,F,$]}return[g,U,P,N,F,$]},Ste=e=>{let t=vc.generator(),n=Ri(e),r=e.roundness?"curve":n.fill?"polygon":"linearPath";return t[r](e.points,n)},_te=(e,t,n,r)=>{var d;let i=pt(e,r);if(e.points.length<2){let[l,h]=e.points[0],[f,g]=he(A(e.x+l,e.y+h),A(t,n),e.angle),U=[f,g,f,g];if(i){let y=Re.getMinMaxXYWithBoundText(e,r,[f,g,f,g],i);U=[y[0],y[1],y[2],y[3]]}return U}let a=((d=yn.get(e))==null?void 0:d[0])??Ste(e),s=wc(a),o=MU(s,([l,h])=>he(A(e.x+l,e.y+h),A(t,n),e.angle)),c=[o[0],o[1],o[2],o[3]];if(i){let l=Re.getMinMaxXYWithBoundText(e,r,c,i);c=[l[0],l[1],l[2],l[3]]}return c},as=(e,t)=>vte.getBounds(e,t),Dt=(e,t)=>{if(!e.length)return[0,0,0,0];let n=1/0,r=-1/0,i=1/0,a=-1/0,s=t||nt(e);return e.forEach(o=>{let[c,d,l,h]=as(o,s);n=Math.min(n,c),i=Math.min(i,d),r=Math.max(r,l),a=Math.max(a,h)}),[n,i,r,a]},Dv=(e,t)=>{let[n,r,i,a]=Dt(e);return[n+t.x,r+t.y,i+t.x,a+t.y]},oc=(e,t,n,r)=>{if(!(st(e)||pa(e)))return[e.x,e.y,e.x+t,e.y+n];let i=m2(0,t,m2(1,n,e.points,r),r),a;if(pa(e))a=Rv(i);else{let l=vc.generator(),h=e.roundness?l.curve(i,Ri(e)):l.linearPath(i,Ri(e)),f=wc(h);a=MU(f)}let[s,o,c,d]=a;return[s+e.x,o+e.y,c+e.x,d+e.y]},jC=(e,t)=>{let n=vc.generator(),r=e.roundness==null?n.linearPath(t,Ri(e)):n.curve(t,Ri(e)),i=wc(r),[a,s,o,c]=MU(i);return[a+e.x,s+e.y,o+e.x,c+e.y]},kte=(e,t)=>{if(!e.length)return[0,0,0,0];let n=1/0,r=e[0],i=nt(e);return e.forEach(a=>{let[s,o,c,d]=as(a,i),l=Rt(A((s+c)/2,(o+d)/2),A(t.x,t.y));l<n&&(n=l,r=a)}),as(r,i)},es=e=>{let[t,n,r,i]=Dt(e);return{minX:t,minY:n,maxX:r,maxY:i,width:r-t,height:i-n,midX:(t+r)/2,midY:(n+i)/2}},OA=({scrollX:e,scrollY:t,width:n,height:r,zoom:i})=>[-e,-t,-e+n/i.value,-t+r/i.value],jv=e=>A(e[0]+(e[2]-e[0])/2,e[1]+(e[3]-e[1])/2),Tte=(e,t)=>{if(e==null||t==null)return!1;let[n,r,i,a]=e,[s,o,c,d]=t;return n<c&&i>s&&r<d&&a>o},IU=(e,t)=>{switch(e.type){case"rectangle":case"image":case"text":case"iframe":case"embeddable":case"frame":case"magicframe":return Mte(e,t);case"diamond":return Ite(e,t);case"ellipse":return Ate(e,t)}},Mte=(e,t)=>{let n=A(e.x+e.width/2,e.y+e.height/2),r=he(t,n,-e.angle),[i,a]=UA(e);return Math.min(...i.map(s=>gv(r,s)),...a.map(s=>kI(s,r)).filter(s=>s!==null))},Ite=(e,t)=>{let n=A(e.x+e.width/2,e.y+e.height/2),r=he(t,n,-e.angle),[i,a]=bA(e);return Math.min(...i.map(s=>gv(r,s)),...a.map(s=>kI(s,r)).filter(s=>s!==null))},Ate=(e,t)=>{let n=A(e.x+e.width/2,e.y+e.height/2);return Wee(he(t,n,-e.angle),gA(n,e.width/2,e.height/2))},Lte=e=>!e[Z.CTRL_OR_CMD],id=e=>e.isBindingEnabled,Kt=5,Pv=10,Nv=4,Rte=(e,t)=>{let n=[];return t.forEach(r=>{let i=e.getNonDeletedElement(r);i!=null&&n.push(i)}),n},AU=(e,t,n,r,i)=>{let a=new Set,s=new Set;PC(e,t,n,"start",a,s,r),PC(e,n,t,"end",a,s,r);let o=Array.from(s).filter(c=>!a.has(c));Rte(i,o).forEach(c=>{var d;me(c,{boundElements:(d=c.boundElements)==null?void 0:d.filter(l=>l.type!=="arrow"||l.id!==e.id)})})},PC=(e,t,n,r,i,a,s)=>{if(t!=="keep"){if(t===null){let o=Ote(e,r);o!=null&&a.add(o);return}zA(e)?(n==null||(n==="keep"?!$A(e,t,r):r==="start"||n.id!==t.id))&&(Ys(e,t,r,s),i.add(t.id)):(Ys(e,t,r,s),i.add(t.id))}},Dte=(e,t,n,r)=>{var s,o;let i=HA(e,t,n),a=t==="start"?(s=e.startBinding)==null?void 0:s.elementId:(o=e.endBinding)==null?void 0:o.elementId;if(a){let c=n.get(a);if(is(c)&&wg(c,i,n,r))return c}return null},FA=(e,t,n)=>["start","end"].map(r=>Dte(e,r,t,n)),jte=(e,t,n,r,i,a)=>{let s=e.points.length-1,o=n.findIndex(h=>h===0)>-1,c=n.findIndex(h=>h===s)>-1,d=o?t?Ou(e,"start",r,i,a):null:Pe(e)?"keep":Ou(e,"start",r,i,a),l=c?t?Ou(e,"end",r,i,a):null:Pe(e)?"keep":Ou(e,"end",r,i,a);return[d,l]},Pte=(e,t,n,r,i)=>{if(Pe(e))return["keep","keep"];let[a,s]=FA(e,t,i),o=a&&r?Ou(e,"start",t,n,i):null,c=s&&r?Ou(e,"end",t,n,i):null;return[o,c]},g2=(e,t,n,r,i,a,s)=>{e.forEach(o=>{let[c,d]=a!=null&&a.length?jte(o,i,a??[],t,n,s):Pte(o,t,n,i,s);AU(o,c,d,t,r)})},Jb=(e,t,n)=>e.length>50?[]:e.filter(st).flatMap(r=>FA(r,t,n)).filter(r=>r!==null).filter(r=>e.filter(i=>i.id===(r==null?void 0:r.id)).length===0),N3=(e,t,n,r,i)=>{t.startBoundElement!=null&&Ys(e,t.startBoundElement,"start",r);let a=qa(n,i,r,t.zoom,Pe(e),Pe(e));a!==null&&($A(e,a,"end")||Ys(e,a,"end",r))},Nte=(e,t)=>{let n=e.gap,r=Y1(t,t.width,t.height);return n>r&&(n=Pv+Nv),{...e,gap:n}},Ys=(e,t,n,r)=>{if(!Ut(e))return;let i={elementId:t.id,...Pe(e)?{...U2(e,t,n),focus:0,gap:0}:{...Nte(Bte(e,t,n,r),t)}};me(e,{[n==="start"?"startBinding":"endBinding"]:i}),nt(t.boundElements||[]).has(e.id)||me(t,{boundElements:(t.boundElements||[]).concat({id:e.id,type:"arrow"})})},$A=(e,t,n)=>{let r=e[n==="start"?"endBinding":"startBinding"];return BA(e,r==null?void 0:r.elementId,t)},BA=(e,t,n)=>t===n.id&&zA(e),zA=e=>e.points.length<3,Ote=(e,t)=>{let n=t==="start"?"startBinding":"endBinding",r=e[n];return r==null?null:(me(e,{[n]:null}),r.elementId)},qa=(e,t,n,r,i,a)=>{if(a){let s=!1,o=$te(t,d=>is(d,!1)&&wg(d,e,n,r,(i||!Hb(d))&&!tt(d))).filter(d=>s?!1:(Hb(d)||(s=!0),!0));if(!o||o.length===0)return null;if(o.length===1)return o[0];let c=o.filter(d=>wg(d,e,n,r,!1));return c.length===1?c[0]:o.sort((d,l)=>l.width**2+l.height**2-(d.width**2+d.height**2)).pop()}return Fte(t,s=>is(s,!1)&&wg(s,e,n,r,(i||!Hb(s))&&!tt(s)))},Fte=(e,t)=>{let n=null;for(let r=e.length-1;r>=0;--r){let i=e[r];if(!i.isDeleted&&t(i)){n=i;break}}return n},$te=(e,t)=>{let n=[];for(let r=e.length-1;r>=0;--r){let i=e[r];i.isDeleted||t(i)&&n.push(i)}return n},Bte=(e,t,n,r)=>{let i=n==="start"?-1:1,a=i===-1?0:e.points.length-1,s=a-i,o=Re.getPointAtIndexGlobalCoordinates(e,a,r),c=Re.getPointAtIndexGlobalCoordinates(e,s,r);return{focus:Zte(t,c,o),gap:Math.max(1,IU(t,o))}},gi=(e,t,n)=>{let{newSize:r,simultaneouslyUpdated:i}=n??{},a=Hte(i);is(e)&&LU(t,e,s=>{var U,y;if(!st(s)||s.isDeleted||!zte(s,e))return;let o=s.startBinding?t.get(s.startBinding.elementId):null,c=s.endBinding?t.get(s.endBinding.elementId):null,d=null,l=null;o&&c&&(d=as(o,t),l=as(c,t));let h={startBinding:NC(e,s.startBinding,r),endBinding:NC(e,s.endBinding,r)};if(a.has(s.id)){me(s,h,!0);return}let f=RU(t,s,(v,x)=>{var w,C;if(v&&is(v)&&(x==="startBinding"||x==="endBinding")&&(e.id===((w=s[x])==null?void 0:w.elementId)||e.id===((C=s[x==="startBinding"?"endBinding":"startBinding"])==null?void 0:C.elementId)&&!Tte(d,l))){let S=qte(s,x,h[x],v,t);if(S)return{index:x==="startBinding"?0:s.points.length-1,point:S}}return null}).filter(v=>v!==null);Re.movePoints(s,f,{...e.id===((U=s.startBinding)==null?void 0:U.elementId)?{startBinding:h.startBinding}:{},...e.id===((y=s.endBinding)==null?void 0:y.elementId)?{endBinding:h.endBinding}:{}});let g=pt(s,t);g&&!g.isDeleted&&G1(s,t,!1)})},zte=(e,t)=>{var n,r;return((n=e.startBinding)==null?void 0:n.elementId)===t.id||((r=e.endBinding)==null?void 0:r.elementId)===t.id},Hte=e=>new Set((e||[]).map(t=>t.id)),Wte=(e,t,n,r,i,a,s)=>{let o=Md(Ve(t,e));return!n||!r?o:Xte(a,n,i,s)?RA(n,r,e):Md(Ve(e,A(n.x+n.width/2,n.y+n.height/2)))},Xte=(e,t,n,r)=>{let i=IU(t,e),a=Y1(t,t.width,t.height,r);return i>a?null:i},h1=(e,t,n)=>{let r=t&&Ds(t),i=e.points[n==="start"?0:e.points.length-1],a=A(e.x+i[0],e.y+i[1]),s=YY(t)?Yte(t,a):a;if(t&&r){let o=jv(r),c=vA(t,Ge(o,xt(Sn(Lr(Ve(s,o)),Math.max(t.width,t.height)),o)))[0],d=Rt(s,o),l=Math.max(Rt(c??s,o),1e-4),h=Bs(d/l,6);switch(!0){case h>.9:return d-l>Kt||l1(s,c)<1e-4?s:xt(Sn(Lr(Ve(s,c??o)),h>1?Kt:-Kt),c??o);default:return Vte(s,t,r)}}return s},Vte=(e,t,n)=>{let r=jv(n),i=Md(Ve(e,r));switch(!0){case _n(i,ui):return he(A((n[0]+n[2])/2+.1,n[1]),r,t.angle);case _n(i,Cn):return he(A(n[2],(n[1]+n[3])/2+.1),r,t.angle);case _n(i,cr):return he(A((n[0]+n[2])/2-.1,n[3]),r,t.angle);default:return he(A(n[0],(n[1]+n[3])/2-.1),r,t.angle)}},Yte=(e,t)=>{let n=A(e.x+e.width/2,e.y+e.height/2),r=he(t,n,-e.angle);return r[0]<e.x&&r[1]<e.y?r[1]-e.y>-Kt?he(A(e.x-Kt,e.y),n,e.angle):he(A(e.x,e.y-Kt),n,e.angle):r[0]<e.x&&r[1]>e.y+e.height?r[0]-e.x>-Kt?he(A(e.x,e.y+e.height+Kt),n,e.angle):he(A(e.x-Kt,e.y+e.height),n,e.angle):r[0]>e.x+e.width&&r[1]>e.y+e.height?r[0]-e.x<e.width+Kt?he(A(e.x+e.width,e.y+e.height+Kt),n,e.angle):he(A(e.x+e.width+Kt,e.y+e.height),n,e.angle):r[0]>e.x+e.width&&r[1]<e.y?r[0]-e.x<e.width+Kt?he(A(e.x+e.width,e.y-Kt),n,e.angle):he(A(e.x+e.width+Kt,e.y),n,e.angle):t},Gte=(e,t,n=.05)=>{let{x:r,y:i,width:a,height:s,angle:o}=e,c=A(r+a/2-.1,i+s/2-.1),d=he(t,c,-o),l=vt(n*s,5,80),h=vt(n*a,5,80);return d[0]<=r+a/2&&d[1]>c[1]-l&&d[1]<c[1]+l?he(A(r-Kt,c[1]),c,o):d[1]<=i+s/2&&d[0]>c[0]-h&&d[0]<c[0]+h?he(A(c[0],i-Kt),c,o):d[0]>=r+a/2&&d[1]>c[1]-l&&d[1]<c[1]+l?he(A(r+a+Kt,c[1]),c,o):d[1]>=i+s/2&&d[0]>c[0]-h&&d[0]<c[0]+h?he(A(c[0],i+s+Kt),c,o):t},qte=(e,t,n,r,i)=>{if(n==null||n.elementId!==r.id&&e.points.length>2)return null;let a=t==="startBinding"?-1:1,s=a===-1?0:e.points.length-1;if(Pe(e)&&d2(n)){let h=DU(n.fixedPoint)??U2(e,r,t==="startBinding"?"start":"end").fixedPoint,f=A(r.x+r.width/2,r.y+r.height/2),g=A(r.x+h[0]*r.width,r.y+h[1]*r.height),U=he(g,f,r.angle);return Re.pointFromAbsoluteCoords(e,U,i)}let o=s-a,c=Re.getPointAtIndexGlobalCoordinates(e,o,i),d=Kte(r,n.focus,c),l;if(n.gap===0)l=d;else{let h=Re.getPointAtIndexGlobalCoordinates(e,s,i),f=A(r.x+r.width/2,r.y+r.height/2),g=Rt(c,h)+Rt(c,f)+Math.max(r.width,r.height)*2,U=vA(r,Ge(c,xt(Sn(Lr(Ve(d,c)),g),c)),n.gap).sort((y,v)=>l1(y,c)-l1(v,c));U.length>1?l=U[0]:U.length===1?l=d:l=h}return Re.pointFromAbsoluteCoords(e,l,i)},U2=(e,t,n,r)=>{let i=[t.x,t.y,t.x+t.width,t.y+t.height],a=h1(e,t,n),s=A(i[0]+(i[2]-i[0])/2,i[1]+(i[3]-i[1])/2),o=he(a,s,-t.angle);return{fixedPoint:DU([(o[0]-t.x)/t.width,(o[1]-t.y)/t.height])}},NC=(e,t,n)=>{if(t==null||n==null)return t;let{width:r,height:i}=n,{width:a,height:s}=e,o=Math.max(1,Math.min(Y1(e,r,i),t.gap*(r<i?r/a:i/s)));return{...t,gap:o}},Ou=(e,t,n,r,i)=>qa(HA(e,t,n),r,n,i,Pe(e),Pe(e)),HA=(e,t,n)=>{let r=t==="start"?0:-1;return Ya(Re.getPointAtIndexGlobalCoordinates(e,r,n))},WA=(e,t,n,r)=>{let i=new Set,a=new Set,s=r==="duplicatesServeAsOld",o=new Map([...n].map(([c,d])=>[d,c]));t.forEach(c=>{let{boundElements:d}=c;if(d!=null&&d.length>0&&(d.forEach(l=>{s&&!n.has(l.id)&&i.add(l.id)}),a.add(n.get(c.id))),Ns(c)){if(c.startBinding!=null){let{elementId:l}=c.startBinding;s&&!n.has(l)&&a.add(l)}if(c.endBinding!=null){let{elementId:l}=c.endBinding;s&&!n.has(l)&&a.add(l)}(c.startBinding!=null||c.endBinding!=null)&&i.add(n.get(c.id))}}),e.filter(({id:c})=>i.has(c)).forEach(c=>{let{startBinding:d,endBinding:l}=c;me(c,{startBinding:OC(d,n),endBinding:OC(l,n)})}),e.filter(({id:c})=>a.has(c)).forEach(c=>{var h;let d=o.get(c.id),l=(h=e.find(({id:f})=>f===d))==null?void 0:h.boundElements;l&&l.length>0&&me(c,{boundElements:l.map(f=>n.has(f.id)?{id:n.get(f.id),type:f.type}:f)})})},OC=(e,t)=>e==null?null:{...e,elementId:t.get(e.elementId)??e.elementId},XA=(e,t)=>{let n=nt(e);for(let r of t)Fu.unbindAffected(n,r,me),$u.unbindAffected(n,r,me)},f1=(e,t,n=[])=>{if(!e)return null;let r=e.filter(i=>!t.has(i.id));return r.push(...n.map(i=>({id:i.id,type:i.type}))),r},wg=(e,{x:t,y:n},r,i,a)=>{let s=Y1(e,e.width,e.height,i),o=No(e,r);return A3(A(t,n),o,s)||a===!0&&ph(A(t,n),Ds(e))},Y1=(e,t,n,r)=>{let i=r!=null&&r.value&&r.value<1?r.value:1,a=(e.type==="diamond"?1/Math.sqrt(2):1)*Math.min(t,n);return Math.max(16,Math.min(.25*a,32),Pv/i+Nv)},Zte=(e,t,n)=>{let r=A(e.x+e.width/2,e.y+e.height/2);if(rs(t,n))return 0;let i=he(t,r,-e.angle),a=he(n,r,-e.angle),s=Math.sign(Kn(Ve(a,t),Ve(a,r)))*-1,o=Ge(a,xt(Sn(Lr(Ve(a,i)),Math.max(e.width*2,e.height*2)),a)),c=e.type==="diamond"?[Ge(A(e.x+e.width/2,e.y),A(e.x+e.width/2,e.y+e.height)),Ge(A(e.x,e.y+e.height/2),A(e.x+e.width,e.y+e.height/2))]:[Ge(A(e.x,e.y),A(e.x+e.width,e.y+e.height)),Ge(A(e.x+e.width,e.y),A(e.x,e.y+e.height))],d=e.type==="diamond"?[Ge(A(e.x+e.width/2,e.y-e.height),A(e.x+e.width/2,e.y+e.height*2)),Ge(A(e.x-e.width,e.y+e.height/2),A(e.x+e.width*2,e.y+e.height/2))]:[Ge(A(e.x-e.width,e.y-e.height),A(e.x+e.width*2,e.y+e.height*2)),Ge(A(e.x+e.width*2,e.y-e.height),A(e.x-e.width,e.y+e.height*2))];return[c1(o,d[0]),c1(o,d[1])].filter(l=>l!==null).sort((l,h)=>l1(l,n)-l1(h,n)).map((l,h)=>s*Rt(r,l)/(e.type==="diamond"?Rt(c[h][0],c[h][1])/2:Math.sqrt(e.width**2+e.height**2)/2)).sort((l,h)=>Math.abs(l)-Math.abs(h))[0]??0},Kte=(e,t,n)=>{let r=A(e.x+e.width/2,e.y+e.height/2);if(t===0)return r;let i=(e.type==="diamond"?[A(e.x,e.y+e.height/2),A(e.x+e.width/2,e.y),A(e.x+e.width,e.y+e.height/2),A(e.x+e.width/2,e.y+e.height)]:[A(e.x,e.y),A(e.x+e.width,e.y),A(e.x+e.width,e.y+e.height),A(e.x,e.y+e.height)]).map(s=>xt(Sn(Ve(s,r),Math.abs(t)),r)).map(s=>he(s,r,e.angle)),a=[Kn(Ve(n,i[0]),Ve(i[1],i[0]))>0&&(t>0?Kn(Ve(n,i[1]),Ve(i[2],i[1]))<0:Kn(Ve(n,i[3]),Ve(i[0],i[3]))<0),Kn(Ve(n,i[1]),Ve(i[2],i[1]))>0&&(t>0?Kn(Ve(n,i[2]),Ve(i[3],i[2]))<0:Kn(Ve(n,i[0]),Ve(i[1],i[0]))<0),Kn(Ve(n,i[2]),Ve(i[3],i[2]))>0&&(t>0?Kn(Ve(n,i[3]),Ve(i[0],i[3]))<0:Kn(Ve(n,i[1]),Ve(i[2],i[1]))<0),Kn(Ve(n,i[3]),Ve(i[0],i[3]))>0&&(t>0?Kn(Ve(n,i[0]),Ve(i[1],i[0]))<0:Kn(Ve(n,i[2]),Ve(i[3],i[2]))<0)];return a[0]?t>0?i[1]:i[0]:a[1]?t>0?i[2]:i[1]:a[2]?t>0?i[3]:i[2]:t>0?i[0]:i[3]},Qte=new Set(["boundElements","frameId","containerId","startBinding","endBinding"]),LU=(e,t,n)=>{var r;is(t)&&(((r=t.boundElements)==null?void 0:r.slice())??[]).forEach(({id:i})=>{n(e.get(i),"boundElements",i)})},RU=(e,t,n)=>{let r=[];if(t.frameId){let i=t.frameId;r.push(n(e.get(i),"frameId",i))}if(an(t)){let i=t.containerId;r.push(n(e.get(i),"containerId",i))}if(Ut(t)){if(t.startBinding){let i=t.startBinding.elementId;r.push(n(e.get(i),"startBinding",i))}if(t.endBinding){let i=t.endBinding.elementId;r.push(n(e.get(i),"endBinding",i))}}return r},Fu=class{static unbindAffected(e,t,n){t&&RU(e,t,r=>{!r||r.isDeleted||LU(e,r,(i,a,s)=>{s===t.id&&n(r,{boundElements:f1(r.boundElements,new Set([s]))})})})}};H(Fu,"rebindAffected",(e,t,n)=>{!t||t.isDeleted||RU(e,t,(r,i)=>{var a,s;if(!r||r.isDeleted){n(t,{[i]:null});return}i!=="frameId"&&((a=r.boundElements)!=null&&a.find(o=>o.id===t.id)||(Ut(t)&&n(r,{boundElements:f1(r.boundElements,new Set,new Array(t))}),Le(t)&&((s=r.boundElements)!=null&&s.find(o=>o.type==="text")?n(t,{[i]:null}):n(r,{boundElements:f1(r.boundElements,new Set,new Array(t))}))))})});var $u=class{static unbindAffected(e,t,n){t&&LU(e,t,r=>{!r||r.isDeleted||RU(e,r,(i,a,s)=>{s===t.id&&n(r,{[a]:null})})})}};H($u,"rebindAffected",(e,t,n)=>{!t||t.isDeleted||LU(e,t,(r,i,a)=>{var s,o;if(!r||r.isDeleted){n(t,{boundElements:f1(t.boundElements,new Set([a]))});return}Le(r)&&(((o=(((s=t.boundElements)==null?void 0:s.slice())??[]).reverse().find(c=>c.type==="text"))==null?void 0:o.id)===r.id?r.containerId!==t.id&&n(r,{containerId:t.id}):(r.containerId!==null&&n(r,{containerId:null}),n(t,{boundElements:f1(t.boundElements,new Set([r.id]))})))})});var O3=(e,t)=>{let[n,r]=DU(e);return he(A(t.x+t.width*n,t.y+t.height*r),A(t.x+t.width/2,t.y+t.height/2),t.angle)},Jte=(e,t)=>{let n=e.startBinding&&t.get(e.startBinding.elementId),r=e.endBinding&&t.get(e.endBinding.elementId),i=n&&e.startBinding?O3(e.startBinding.fixedPoint,n):A(e.x+e.points[0][0],e.y+e.points[0][1]),a=r&&e.endBinding?O3(e.endBinding.fixedPoint,r):A(e.x+e.points[e.points.length-1][0],e.y+e.points[e.points.length-1][1]);return[i,a]},ene=(e,t)=>{let[n,r]=Jte(e,t);return[Re.pointFromAbsoluteCoords(e,n,t),Re.pointFromAbsoluteCoords(e,r,t)]},DU=e=>e&&(Math.abs(e[0]-.5)<1e-4||Math.abs(e[1]-.5)<1e-4)?e.map(t=>Math.abs(t-.5)<1e-4?.5001:t):e,tne=(e,t)=>{let[n,r,i,a]=t,{x:s,y:o}=oa({sceneX:n,sceneY:r},e),{x:c,y:d}=oa({sceneX:i,sceneY:a},e);return c-s>e.width||d-o>e.height},VA=({scenePoint:e,viewportDimensions:t,zoom:n,offsets:r})=>{let i=(t.width-((r==null?void 0:r.right)??0))/2/n.value-e.x;i+=((r==null?void 0:r.left)??0)/2/n.value;let a=(t.height-((r==null?void 0:r.bottom)??0))/2/n.value-e.y;return a+=((r==null?void 0:r.top)??0)/2/n.value,{scrollX:i,scrollY:a}},p1=(e,t)=>{if(e=Eie(e),!e.length)return{scrollX:0,scrollY:0};let[n,r,i,a]=Dt(e);tne(t,[n,r,i,a])&&([n,r,i,a]=kte(e,Yt({clientX:t.scrollX,clientY:t.scrollY},t)));let s=(n+i)/2,o=(r+a)/2;return VA({scenePoint:{x:s,y:o},viewportDimensions:{width:t.width,height:t.height},zoom:t.zoom})},zo=e=>vt(Bs(e,6),uv,hv),nne=e=>vt(Math.round(e),1,100),YA=e=>vt(Math.round(e),1,100),GA=(e,t,n)=>{let r=n.reduce((i,a)=>(a.groupIds.includes(e)&&(i[a.id]=!0),i),{});return Object.keys(r).length<2?t.selectedGroupIds[e]||t.editingGroupId===e?{selectedElementIds:t.selectedElementIds,selectedGroupIds:{...t.selectedGroupIds,[e]:!1},editingGroupId:null}:t:{editingGroupId:t.editingGroupId,selectedGroupIds:{...t.selectedGroupIds,[e]:!0},selectedElementIds:{...t.selectedElementIds,...r}}},Wr=function(){let e=null,t=null,n=null,r=(a,s,o,c)=>{if(n!==void 0&&s===t&&a===e&&o.editingGroupId===(n==null?void 0:n.editingGroupId))return n;let d={};for(let f of a){let g=f.groupIds;if(o.editingGroupId){let U=g.indexOf(o.editingGroupId);U>-1&&(g=g.slice(0,U))}if(g.length>0){let U=g[g.length-1];d[U]=!0}}let l={},h=s.reduce((f,g)=>{if(g.isDeleted)return f;let U=g.groupIds.find(y=>d[y]);return U&&(f[g.id]=!0,Array.isArray(l[U])?l[U].push(g.id):l[U]=[g.id]),f},{});for(let f of Object.keys(l))l[f].length<2&&d[f]&&(d[f]=!1);return t=s,e=a,n={editingGroupId:o.editingGroupId,selectedGroupIds:d,selectedElementIds:At({...o.selectedElementIds,...h},c)},n},i=(a,s,o,c)=>{let d=c?c.scene.getSelectedElements({selectedElementIds:a.selectedElementIds,elements:s}):gt(s,a);return d.length?r(d,s,a,o):{selectedGroupIds:{},editingGroupId:null,selectedElementIds:At(a.selectedElementIds,o)}};return i.clearCache=()=>{t=null,e=null,n=null},i}(),qA=(e,t)=>ZA(e,t)!=null,ZA=(e,t)=>t.groupIds.filter(n=>n!==e.editingGroupId).find(n=>e.selectedGroupIds[n]),hd=e=>Object.entries(e.selectedGroupIds).filter(([t,n])=>n).map(([t,n])=>t),KA=(e,t)=>{let n={...t,selectedGroupIds:{}};for(let r of e){let i=r.groupIds;if(t.editingGroupId){let a=i.indexOf(t.editingGroupId);a>-1&&(i=i.slice(0,a))}if(i.length>0){let a=i[i.length-1];n={...n,...GA(a,n,e)}}}return n.selectedGroupIds},rne=(e,t)=>({...e,editingGroupId:t.groupIds.length?t.groupIds[0]:null,selectedGroupIds:{},selectedElementIds:{[t.id]:!0}}),m1=(e,t)=>e.groupIds.includes(t),rn=(e,t)=>{let n=[];for(let r of e.values())m1(r,t)&&n.push(r);return n},ine=(e,t)=>e.groupIds.find(n=>t[n]),ane=(e,t,n)=>{let r=[...e],i=t?e.indexOf(t):-1,a=i>-1?i:e.length;for(let s=0;s<a;s++)r[s]=n(r[s]);return r},sne=(e,t,n)=>{let r=[...e],i=n?r.indexOf(n):-1,a=i>-1?i:r.length;return r.splice(a,0,t),r},one=(e,t)=>e.filter(n=>!t[n]),jU=(e,t)=>{let n=new Map;return e.forEach(r=>{let i=r.groupIds.length===0?r.id:r.groupIds[r.groupIds.length-1],a=n.get(i)||[],s=pt(r,t);s&&a.push(s),n.set(i,[...a,r])}),Array.from(n.values())},lne=e=>{let t=new Set;for(let[,n]of e)if(!n.isDeleted)for(let r of n.groupIds??[])t.add(r);return t},QA=e=>{let t=e.flatMap(i=>i.groupIds),n=new Map,r=0;for(let i of t)n.set(i,(n.get(i)??0)+1),n.get(i)>r&&(r=n.get(i));return r===e.length},Uh=e=>e.groupIds.length>0,cne=8,FC=99999,PU=e=>cne/e,si=class{};H(si,"referenceSnapPoints",null),H(si,"visibleGaps",null),H(si,"setReferenceSnapPoints",e=>{si.referenceSnapPoints=e}),H(si,"getReferenceSnapPoints",()=>si.referenceSnapPoints),H(si,"setVisibleGaps",e=>{si.visibleGaps=e}),H(si,"getVisibleGaps",()=>si.visibleGaps),H(si,"destroy",()=>{si.referenceSnapPoints=null,si.visibleGaps=null});var Do=si,g1=e=>e.props.gridModeEnabled??e.state.gridModeEnabled,hc=({event:e,app:t,selectedElements:n})=>e?t.state.objectsSnapModeEnabled&&!e[Z.CTRL_OR_CMD]||!t.state.objectsSnapModeEnabled&&e[Z.CTRL_OR_CMD]&&!g1(t):n.length===1&&n[0].type==="arrow"?!1:t.state.objectsSnapModeEnabled,dne=(e,t,n=.01)=>Math.abs(e-t)<=n,U1=(e,t,{omitCenter:n,boundingBoxCorners:r,dragOffset:i}={omitCenter:!1,boundingBoxCorners:!1})=>{let a=[];if(e.length===1){let s=e[0],[o,c,d,l,h,f]=lt(s,t);i&&(o+=i.x,d+=i.x,h+=i.x,c+=i.y,l+=i.y,f+=i.y);let g=(d-o)/2,U=(l-c)/2;if((s.type==="diamond"||s.type==="ellipse")&&!r){let y=he(A(o,c+U),A(h,f),s.angle),v=he(A(o+g,c),A(h,f),s.angle),x=he(A(d,c+U),A(h,f),s.angle),w=he(A(o+g,l),A(h,f),s.angle),C=A(h,f);a=n?[y,v,x,w]:[y,v,x,w,C]}else{let y=he(A(o,c),A(h,f),s.angle),v=he(A(d,c),A(h,f),s.angle),x=he(A(o,l),A(h,f),s.angle),w=he(A(d,l),A(h,f),s.angle),C=A(h,f);a=n?[y,v,x,w]:[y,v,x,w,C]}}else if(e.length>1){let[s,o,c,d]=Dv(e,i??{x:0,y:0}),l=c-s,h=d-o,f=A(s,o),g=A(c,o),U=A(s,d),y=A(c,d),v=A(s+l/2,o+h/2);a=n?[f,g,U,y]:[f,g,U,y,v]}return a.map(s=>A(bn(s[0]),bn(s[1])))},JA=(e,t,n,r)=>{let i=t.filter(a=>tt(a)).map(a=>a.id);return qL(e,t,n,r).filter(a=>!(a.frameId&&i.includes(a.frameId)))},une=(e,t,n,r)=>{let i=JA(e,t,n,r),a=jU(i,r).filter(h=>!(h.length===1&&an(h[0]))).map(h=>Dt(h).map(f=>bn(f))),s=a.sort((h,f)=>h[0]-f[0]),o=[],c=0;e:for(let h=0;h<s.length;h++){let f=s[h];for(let g=h+1;g<s.length;g++){if(++c>FC)break e;let U=s[g],[,y,v,x]=f,[w,C,,S]=U;v<w&&l2(Tr(y,x),Tr(C,S))&&o.push({startBounds:f,endBounds:U,startSide:[A(v,y),A(v,x)],endSide:[A(w,C),A(w,S)],length:w-v,overlap:c2(Tr(y,x),Tr(C,S))})}}let d=a.sort((h,f)=>h[1]-f[1]),l=[];c=0;e:for(let h=0;h<d.length;h++){let f=d[h];for(let g=h+1;g<d.length;g++){if(++c>FC)break e;let U=d[g],[y,,v,x]=f,[w,C,S]=U;x<C&&l2(Tr(y,v),Tr(w,S))&&l.push({startBounds:f,endBounds:U,startSide:[A(y,x),A(v,x)],endSide:[A(w,C),A(S,C)],length:C-x,overlap:c2(Tr(y,v),Tr(w,S))})}}return{horizontalGaps:o,verticalGaps:l}},$C=(e,t,n,r,i,a,s)=>{if(!hc({app:n,event:r,selectedElements:e}))return[];if(e.length===0)return[];let o=Do.getVisibleGaps();if(o){let{horizontalGaps:c,verticalGaps:d}=o,[l,h,f,g]=Dv(e,t).map(v=>bn(v)),U=(l+f)/2,y=(h+g)/2;for(let v of c){if(!l2(Tr(h,g),v.overlap))continue;let x=v.startSide[0][0]+v.length/2,w=bn(x-U);if(v.length>f-l&&Math.abs(w)<=s.x){Math.abs(w)<s.x&&(i.length=0),s.x=Math.abs(w);let j={type:"gap",direction:"center_horizontal",gap:v,offset:w};i.push(j);continue}let[,,C]=v.endBounds,S=l-C,k=bn(v.length-S);if(Math.abs(k)<=s.x){Math.abs(k)<s.x&&(i.length=0),s.x=Math.abs(k);let j={type:"gap",direction:"side_right",gap:v,offset:k};i.push(j);continue}let[M,,,]=v.startBounds,T=M-f,R=bn(T-v.length);if(Math.abs(R)<=s.x){Math.abs(R)<s.x&&(i.length=0),s.x=Math.abs(R);let j={type:"gap",direction:"side_left",gap:v,offset:R};i.push(j);continue}}for(let v of d){if(!l2(Tr(l,f),v.overlap))continue;let x=v.startSide[0][1]+v.length/2,w=bn(x-y);if(v.length>g-h&&Math.abs(w)<=s.y){Math.abs(w)<s.y&&(a.length=0),s.y=Math.abs(w);let j={type:"gap",direction:"center_vertical",gap:v,offset:w};a.push(j);continue}let[,C,,]=v.startBounds,S=C-g,k=bn(S-v.length);if(Math.abs(k)<=s.y){Math.abs(k)<s.y&&(a.length=0),s.y=Math.abs(k);let j={type:"gap",direction:"side_top",gap:v,offset:k};a.push(j);continue}let[,,,M]=v.endBounds,T=bn(h-M),R=v.length-T;if(Math.abs(R)<=s.y){Math.abs(R)<s.y&&(a.length=0),s.y=Math.abs(R);let j={type:"gap",direction:"side_bottom",gap:v,offset:R};a.push(j);continue}}}},hne=(e,t,n,r)=>{let i=JA(e,t,n,r);return jU(i,r).filter(a=>!(a.length===1&&an(a[0]))).flatMap(a=>U1(a,r))},bh=(e,t,n,r,i,a,s)=>{if(!hc({app:n,event:r,selectedElements:e})||e.length===0&&t.length===0)return[];let o=Do.getReferenceSnapPoints();if(o)for(let c of t)for(let d of o){let l=d[0]-c[0],h=d[1]-c[1];Math.abs(l)<=s.x&&(Math.abs(l)<s.x&&(i.length=0),i.push({type:"point",points:[c,d],offset:l}),s.x=Math.abs(l)),Math.abs(h)<=s.y&&(Math.abs(h)<s.y&&(a.length=0),a.push({type:"point",points:[c,d],offset:h}),s.y=Math.abs(h))}},fne=(e,t,n,r,i)=>{var v,x;let a=n.state,s=gt(e,a);if(!hc({app:n,event:r,selectedElements:s})||s.length===0)return{snapOffset:{x:0,y:0},snapLines:[]};t.x=bn(t.x),t.y=bn(t.y);let o=[],c=[],d=PU(a.zoom.value),l={x:d,y:d},h=U1(s,i,{dragOffset:t});bh(s,h,n,r,o,c,l),$C(s,t,n,r,o,c,l);let f={x:((v=o[0])==null?void 0:v.offset)??0,y:((x=c[0])==null?void 0:x.offset)??0};l.x=0,l.y=0,o.length=0,c.length=0;let g={x:bn(t.x+f.x),y:bn(t.y+f.y)};bh(s,U1(s,i,{dragOffset:g}),n,r,o,c,l),$C(s,g,n,r,o,c,l);let U=Ov(o,c),y=mne(s,g,[...o,...c].filter(w=>w.type==="gap"));return{snapOffset:f,snapLines:[...U,...y]}},bn=e=>Math.round(e*10**6)/10**6,BC=e=>{let t=new Map;for(let n of e){let r=n.join(",");t.has(r)||t.set(r,n)}return Array.from(t.values())},Ov=(e,t)=>{let n={},r={};if(e.length>0){for(let i of e)if(i.type==="point"){let a=bn(i.points[0][0]);n[a]||(n[a]=[]),n[a].push(...i.points.map(s=>A(bn(s[0]),bn(s[1]))))}}if(t.length>0){for(let i of t)if(i.type==="point"){let a=bn(i.points[0][1]);r[a]||(r[a]=[]),r[a].push(...i.points.map(s=>A(bn(s[0]),bn(s[1]))))}}return Object.entries(n).map(([i,a])=>({type:"points",points:BC(a.map(s=>A(Number(i),s[1])).sort((s,o)=>s[1]-o[1]))})).concat(Object.entries(r).map(([i,a])=>({type:"points",points:BC(a.map(s=>A(s[0],Number(i))).sort((s,o)=>s[0]-o[0]))})))},pne=e=>{let t=new Map;for(let n of e){let r=n.points.flat().map(i=>[bn(i)]).join(",");t.has(r)||t.set(r,n)}return Array.from(t.values())},mne=(e,t,n)=>{let[r,i,a,s]=Dv(e,t),o=[];for(let c of n){let[d,l,h,f]=c.gap.startBounds,[g,U,y,v]=c.gap.endBounds,x=c2(Tr(i,s),c.gap.overlap),w=c2(Tr(r,a),c.gap.overlap);switch(c.direction){case"center_horizontal":{if(x){let C=(x[0]+x[1])/2;o.push({type:"gap",direction:"horizontal",points:[A(c.gap.startSide[0][0],C),A(r,C)]},{type:"gap",direction:"horizontal",points:[A(a,C),A(c.gap.endSide[0][0],C)]})}break}case"center_vertical":{if(w){let C=(w[0]+w[1])/2;o.push({type:"gap",direction:"vertical",points:[A(C,c.gap.startSide[0][1]),A(C,i)]},{type:"gap",direction:"vertical",points:[A(C,s),A(C,c.gap.endSide[0][1])]})}break}case"side_right":{if(x){let C=(x[0]+x[1])/2;o.push({type:"gap",direction:"horizontal",points:[A(h,C),A(g,C)]},{type:"gap",direction:"horizontal",points:[A(y,C),A(r,C)]})}break}case"side_left":{if(x){let C=(x[0]+x[1])/2;o.push({type:"gap",direction:"horizontal",points:[A(a,C),A(d,C)]},{type:"gap",direction:"horizontal",points:[A(h,C),A(g,C)]})}break}case"side_top":{if(w){let C=(w[0]+w[1])/2;o.push({type:"gap",direction:"vertical",points:[A(C,s),A(C,l)]},{type:"gap",direction:"vertical",points:[A(C,f),A(C,U)]})}break}case"side_bottom":{if(w){let C=(w[0]+w[1])/2;o.push({type:"gap",direction:"vertical",points:[A(C,f),A(C,U)]},{type:"gap",direction:"vertical",points:[A(C,v),A(C,i)]})}break}}}return pne(o.map(c=>({...c,points:c.points.map(d=>A(bn(d[0]),bn(d[1])))})))},zC=(e,t,n,r,i,a)=>{var M,T;if(!hc({event:r,selectedElements:e,app:n})||e.length===0||e.length===1&&!dne(e[0].angle,0))return{snapOffset:{x:0,y:0},snapLines:[]};let[s,o,c,d]=Dt(t);a&&(a.includes("e")?c+=i.x:a.includes("w")&&(s+=i.x),a.includes("n")?o+=i.y:a.includes("s")&&(d+=i.y));let l=[];if(a)switch(a){case"e":{l.push(A(c,o),A(c,d));break}case"w":{l.push(A(s,o),A(s,d));break}case"n":{l.push(A(s,o),A(c,o));break}case"s":{l.push(A(s,d),A(c,d));break}case"ne":{l.push(A(c,o));break}case"nw":{l.push(A(s,o));break}case"se":{l.push(A(c,d));break}case"sw":{l.push(A(s,d));break}}let h=PU(n.state.zoom.value),f={x:h,y:h},g=[],U=[];bh(t,l,n,r,g,U,f);let y={x:((M=g[0])==null?void 0:M.offset)??0,y:((T=U[0])==null?void 0:T.offset)??0};f.x=0,f.y=0,g.length=0,U.length=0;let[v,x,w,C]=Dt(e).map(R=>bn(R)),S=[A(v,x),A(v,C),A(w,x),A(w,C)];bh(e,S,n,r,g,U,f);let k=Ov(g,U);return{snapOffset:y,snapLines:k}},gne=(e,t,n,r,i,a)=>{var U,y;if(!hc({event:n,selectedElements:[e],app:t}))return{snapOffset:{x:0,y:0},snapLines:[]};let s=[A(r.x+i.x,r.y+i.y)],o=PU(t.state.zoom.value),c={x:o,y:o},d=[],l=[];bh([e],s,t,n,d,l,c);let h={x:((U=d[0])==null?void 0:U.offset)??0,y:((y=l[0])==null?void 0:y.offset)??0};c.x=0,c.y=0,d.length=0,l.length=0;let f=U1([e],a,{boundingBoxCorners:!0,omitCenter:!0});bh([e],f,t,n,d,l,c);let g=Ov(d,l);return{snapOffset:h,snapLines:g}},Une=(e,t,n,r,i)=>{if(!hc({event:r,selectedElements:[],app:t}))return{originOffset:{x:0,y:0},snapLines:[]};let a=qL(e,[],t.state,i),s=PU(t.state.zoom.value),o={x:s,y:s},c=[],d=[];for(let l of a){let h=U1([l],i);for(let f of h){let g=f[0]-n.x;Math.abs(g)<=Math.abs(o.x)&&(Math.abs(g)<Math.abs(o.x)&&(d.length=0),d.push({type:"pointer",points:[f,A(f[0],n.y)],direction:"vertical"}),o.x=g);let U=f[1]-n.y;Math.abs(U)<=Math.abs(o.y)&&(Math.abs(U)<Math.abs(o.y)&&(c.length=0),c.push({type:"pointer",points:[f,A(n.x,f[1])],direction:"horizontal"}),o.y=U)}}return{originOffset:{x:d.length>0?d[0].points[0][0]-n.x:0,y:c.length>0?c[0].points[0][1]-n.y:0},snapLines:[...d,...c]}},bne=e=>e===Qn.rectangle||e===Qn.ellipse||e===Qn.diamond||e===Qn.frame||e===Qn.magicframe||e===Qn.image||e===Qn.text,zn=(e,t,n)=>n?[Math.round(e/n)*n,Math.round(t/n)*n]:[e,t],jl={version:null,points:[],zoom:null},In=class bt{constructor(t){H(this,"elementId"),H(this,"selectedPointsIndices"),H(this,"pointerDownState"),H(this,"isDragging"),H(this,"lastUncommittedPoint"),H(this,"pointerOffset"),H(this,"startBindingElement"),H(this,"endBindingElement"),H(this,"hoverPointIndex"),H(this,"segmentMidPointHoveredCoords"),H(this,"elbowed"),this.elementId=t.id,rs(t.points[0],A(0,0))||console.error("Linear element is not normalized",Error().stack),this.selectedPointsIndices=null,this.lastUncommittedPoint=null,this.isDragging=!1,this.pointerOffset={x:0,y:0},this.startBindingElement="keep",this.endBindingElement="keep",this.pointerDownState={prevSelectedPointsIndices:null,lastClickedPoint:-1,lastClickedIsEndPoint:!1,origin:null,segmentMidpoint:{value:null,index:null,added:!1}},this.hoverPointIndex=-1,this.segmentMidPointHoveredCoords=null,this.elbowed=Pe(t)&&t.elbowed}static getElement(t,n){return n.get(t)||null}static handleBoxSelection(t,n,r,i){if(!n.editingLinearElement||!n.selectionElement)return!1;let{editingLinearElement:a}=n,{selectedPointsIndices:s,elementId:o}=a,c=bt.getElement(o,i);if(!c)return!1;let[d,l,h,f]=lt(n.selectionElement,i),g=bt.getPointsGlobalCoordinates(c,i).reduce((U,y,v)=>((y[0]>=d&&y[0]<=h&&y[1]>=l&&y[1]<=f||t.shiftKey&&(s!=null&&s.includes(v)))&&U.push(v),U),[]).filter(U=>!(Pe(c)&&U!==0&&U!==c.points.length-1));r({editingLinearElement:{...a,selectedPointsIndices:g.length?g:null}})}static handlePointDragging(t,n,r,i,a,s,o){var U;if(!s)return!1;let{elementId:c}=s,d=o.getNonDeletedElementsMap(),l=bt.getElement(c,d);if(!l||Pe(l)&&!s.pointerDownState.lastClickedIsEndPoint&&s.pointerDownState.lastClickedPoint!==0)return!1;let h=Pe(l)?(U=s.selectedPointsIndices)==null?void 0:U.reduce((y,v)=>v===0?[0,y[1]]:[y[0],l.points.length-1],[!1,!1]).filter(y=>typeof y=="number"):s.selectedPointsIndices,f=Pe(l)?s.pointerDownState.lastClickedPoint>0?l.points.length-1:0:s.pointerDownState.lastClickedPoint,g=l.points[f];if(h&&g){if(Lp(t)&&h.length===1&&l.points.length>1){let y=h[0],v=l.points[y===0?1:y-1],[x,w]=bt._getShiftLockedDelta(l,d,v,A(r,i),t[Z.CTRL_OR_CMD]?null:n.getEffectiveGridSize());bt.movePoints(l,[{index:y,point:A(x+v[0],w+v[1]),isDragging:y===f}])}else{let y=bt.createPointAt(l,d,r-s.pointerOffset.x,i-s.pointerOffset.y,t[Z.CTRL_OR_CMD]?null:n.getEffectiveGridSize()),v=y[0]-g[0],x=y[1]-g[1];bt.movePoints(l,h.map(w=>{let C=w===f?bt.createPointAt(l,d,r-s.pointerOffset.x,i-s.pointerOffset.y,t[Z.CTRL_OR_CMD]?null:n.getEffectiveGridSize()):A(l.points[w][0]+v,l.points[w][1]+x);return{index:w,point:C,isDragging:w===f}}))}if(pt(l,d)&&G1(l,d,!1),Ns(l,!1)){let y=[];h[0]===0&&y.push(Ya(bt.getPointGlobalCoordinates(l,l.points[0],d)));let v=h[h.length-1];v===l.points.length-1&&y.push(Ya(bt.getPointGlobalCoordinates(l,l.points[v],d))),y.length&&a(l,y)}return!0}return!1}static handlePointerUp(t,n,r,i){var g;let a=i.getNonDeletedElementsMap(),s=i.getNonDeletedElements(),{elementId:o,selectedPointsIndices:c,isDragging:d,pointerDownState:l}=n,h=bt.getElement(o,a);if(!h)return n;let f={};if(d&&c){for(let U of c)if(U===0||U===h.points.length-1){qo(h.points,r.zoom.value)&&bt.movePoints(h,[{index:U,point:U===0?h.points[h.points.length-1]:h.points[0]}]);let y=id(r)?qa(Ya(bt.getPointAtIndexGlobalCoordinates(h,U,a)),s,a,r.zoom,Pe(h),Pe(h)):null;f[U===0?"startBindingElement":"endBindingElement"]=y}}return{...n,...f,selectedPointsIndices:d||t.shiftKey?!d&&t.shiftKey&&((g=l.prevSelectedPointsIndices)!=null&&g.includes(l.lastClickedPoint))?c&&c.filter(U=>U!==l.lastClickedPoint):c:c!=null&&c.includes(l.lastClickedPoint)?[l.lastClickedPoint]:c,isDragging:!1,pointerOffset:{x:0,y:0}}}static isSegmentTooShort(t,n,r,i,a){if(Pe(t))return i>=0&&i<t.points.length?Rt(n,r)*a.value<bt.POINT_HANDLE_SIZE/2:!1;let s=Rt(n,r);return t.points.length>2&&t.roundness&&(s=ete(t,r)),s*a.value<bt.POINT_HANDLE_SIZE*4}static getSegmentMidPoint(t,n,r,i,a){let s=H1(n,r);if(t.points.length>2&&t.roundness){let o=wA(t,t.points[i]);if(o){let c=tte(t,t.points[i],.5);s=bt.getPointGlobalCoordinates(t,EA(o[0],o[1],o[2],o[3],c),a)}}return s}static getSegmentMidPointIndex(t,n,r,i){let a=bt.getElement(t.elementId,i);if(!a)return-1;let s=bt.getEditorMidPoints(a,i,n),o=0;for(;o<s.length;){if(bt.arePointsEqual(r,s[o]))return o+1;o++}return-1}static handlePointerDown(t,n,r,i,a,s){var R;let o=n.state,c=s.getNonDeletedElementsMap(),d=s.getNonDeletedElements(),l={didAddPoint:!1,hitElement:null,linearElementEditor:null};if(!a)return l;let{elementId:h}=a,f=bt.getElement(h,c);if(!f)return l;let g=bt.getSegmentMidpointHitCoords(a,i,o,c),U=null;if(g)U=bt.getSegmentMidPointIndex(a,o,g,c);else if(t.altKey&&o.editingLinearElement)return a.lastUncommittedPoint==null&&(me(f,{points:[...f.points,bt.createPointAt(f,c,i.x,i.y,t[Z.CTRL_OR_CMD]?null:n.getEffectiveGridSize())]}),l.didAddPoint=!0),r.shouldCaptureIncrement(),l.linearElementEditor={...a,pointerDownState:{prevSelectedPointsIndices:a.selectedPointsIndices,lastClickedPoint:-1,lastClickedIsEndPoint:!1,origin:{x:i.x,y:i.y},segmentMidpoint:{value:g,index:U,added:!1}},selectedPointsIndices:[f.points.length-1],lastUncommittedPoint:null,endBindingElement:qa(i,d,c,n.state.zoom,a.elbowed)},l.didAddPoint=!0,l;let y=bt.getPointIndexUnderCursor(f,c,o.zoom,i.x,i.y);if(y>=0||g)l.hitElement=f;else{let{startBindingElement:j,endBindingElement:P}=a;id(o)&&Ns(f)&&AU(f,j,P,c,s)}let[v,x,w,C]=lt(f,c),S=(v+w)/2,k=(x+C)/2,M=y>-1&&he(A(f.x+f.points[y][0],f.y+f.points[y][1]),A(S,k),f.angle),T=y>-1||t.shiftKey?t.shiftKey||(R=a.selectedPointsIndices)!=null&&R.includes(y)?yne([...a.selectedPointsIndices||[],y]):[y]:null;return l.linearElementEditor={...a,pointerDownState:{prevSelectedPointsIndices:a.selectedPointsIndices,lastClickedPoint:y,lastClickedIsEndPoint:y===f.points.length-1,origin:{x:i.x,y:i.y},segmentMidpoint:{value:g,index:U,added:!1}},selectedPointsIndices:T,pointerOffset:M?{x:i.x-M[0],y:i.y-M[1]}:{x:0,y:0}},l}static arePointsEqual(t,n){return!t&&!n?!0:!t||!n?!1:rs(t,n)}static handlePointerMove(t,n,r,i,a){let s=i.state;if(!s.editingLinearElement)return null;let{elementId:o,lastUncommittedPoint:c}=s.editingLinearElement,d=bt.getElement(o,a);if(!d)return s.editingLinearElement;let{points:l}=d,h=l[l.length-1];if(!t.altKey)return h===c&&bt.deletePoints(d,[l.length-1]),{...s.editingLinearElement,lastUncommittedPoint:null};let f;if(Lp(t)&&l.length>=2){let g=l[l.length-2],[U,y]=bt._getShiftLockedDelta(d,a,g,A(n,r),t[Z.CTRL_OR_CMD]?null:i.getEffectiveGridSize());f=A(U+g[0],y+g[1])}else f=bt.createPointAt(d,a,n-s.editingLinearElement.pointerOffset.x,r-s.editingLinearElement.pointerOffset.y,t[Z.CTRL_OR_CMD]||Pe(d)?null:i.getEffectiveGridSize());return h===c?bt.movePoints(d,[{index:d.points.length-1,point:f}]):bt.addPoints(d,[{point:f}]),{...s.editingLinearElement,lastUncommittedPoint:d.points[d.points.length-1]}}static getPointGlobalCoordinates(t,n,r){let[i,a,s,o]=lt(t,r),c=(i+s)/2,d=(a+o)/2,{x:l,y:h}=t;return he(A(l+n[0],h+n[1]),A(c,d),t.angle)}static getPointsGlobalCoordinates(t,n){let[r,i,a,s]=lt(t,n),o=(r+a)/2,c=(i+s)/2;return t.points.map(d=>{let{x:l,y:h}=t;return he(A(l+d[0],h+d[1]),A(o,c),t.angle)})}static getPointAtIndexGlobalCoordinates(t,n,r){let i=n<0?t.points.length+n:n,[a,s,o,c]=lt(t,r),d=(a+o)/2,l=(s+c)/2,h=t.points[i],{x:f,y:g}=t;return he(h?A(f+h[0],g+h[1]):A(f,g),A(d,l),t.angle)}static pointFromAbsoluteCoords(t,n,r){if(Pe(t))return A(n[0]-t.x,n[1]-t.y);let[i,a,s,o]=lt(t,r),c=(i+s)/2,d=(a+o)/2,[l,h]=he(A(n[0],n[1]),A(c,d),-t.angle);return A(l-t.x,h-t.y)}static getPointIndexUnderCursor(t,n,r,i,a){let s=bt.getPointsGlobalCoordinates(t,n),o=s.length;for(;--o>-1;){let c=s[o];if(Rt(A(i,a),A(c[0],c[1]))*r.value<bt.POINT_HANDLE_SIZE+1)return o}return-1}static createPointAt(t,n,r,i,a){let s=zn(r,i,a),[o,c,d,l]=lt(t,n),h=(o+d)/2,f=(c+l)/2,[g,U]=he(A(s[0],s[1]),A(h,f),-t.angle);return A(g-t.x,U-t.y)}static getNormalizedPoints(t){let{points:n}=t,r=n[0][0],i=n[0][1];return{points:n.map(a=>A(a[0]-r,a[1]-i)),x:t.x+r,y:t.y+i}}static normalizePoints(t){me(t,bt.getNormalizedPoints(t))}static duplicateSelectedPoints(t,n){Dr(t.editingLinearElement,"Not currently editing a linear element");let{selectedPointsIndices:r,elementId:i}=t.editingLinearElement,a=bt.getElement(i,n);Dr(a,"The linear element does not exist in the provided Scene"),Dr(r!=null,"There are no selected points to duplicate");let{points:s}=a,o=[],c=!1,d=-1,l=s.reduce((h,f,g)=>{if(++d,h.push(f),r.includes(g)){let U=s[g+1];U||(c=!0),h.push(U?A((f[0]+U[0])/2,(f[1]+U[1])/2):A(f[0],f[1])),o.push(d+1),++d}return h},[]);if(me(a,{points:l}),c){let h=a.points[a.points.length-1];bt.movePoints(a,[{index:a.points.length-1,point:A(h[0]+30,h[1]+30)}])}return{...t,editingLinearElement:{...t.editingLinearElement,selectedPointsIndices:o}}}static deletePoints(t,n){let r=0,i=0;if(n.includes(0)){let s=t.points.find((o,c)=>!n.includes(c));s&&(r=s[0],i=s[1])}let a=t.points.reduce((s,o,c)=>(n.includes(c)||s.push(s.length?A(o[0]-r,o[1]-i):A(0,0)),s),[]);bt._updatePoints(t,a,r,i)}static addPoints(t,n){let r=[...t.points,...n.map(i=>i.point)];bt._updatePoints(t,r,0,0)}static movePoints(t,n,r){var l,h,f;let{points:i}=t,[a,s]=((l=n.find(({index:g})=>g===0))==null?void 0:l.point)??A(0,0),[o,c]=A(a-i[0][0],s-i[0][1]),d=Pe(t)?[((h=n.find(g=>g.index===0))==null?void 0:h.point)??i[0],((f=n.find(g=>g.index===i.length-1))==null?void 0:f.point)??i[i.length-1]]:i.map((g,U)=>{var v;let y=((v=n.find(x=>x.index===U))==null?void 0:v.point)??g;return A(y[0]-o,y[1]-c)});bt._updatePoints(t,d,o,c,r,{isDragging:n.reduce((g,U)=>g||U.isDragging===!0,!1)})}static shouldAddMidpoint(t,n,r,i){let a=bt.getElement(t.elementId,i);if(a&&Pe(a)||!a)return!1;let{segmentMidpoint:s}=t.pointerDownState;if(s.added||s.value===null||s.index===null||t.pointerDownState.origin===null)return!1;let o=t.pointerDownState.origin,c=Rt(A(o.x,o.y),A(n.x,n.y));return!(!r.editingLinearElement&&c<Vc/r.zoom.value)}static addMidpoint(t,n,r,i,a){let s=bt.getElement(t.elementId,a);if(!s)return;let{segmentMidpoint:o}=t.pointerDownState,c={pointerDownState:t.pointerDownState,selectedPointsIndices:t.selectedPointsIndices},d=bt.createPointAt(s,a,n.x,n.y,i&&!Pe(s)?r.getEffectiveGridSize():null),l=[...s.points.slice(0,o.index),d,...s.points.slice(o.index)];return me(s,{points:l}),c.pointerDownState={...t.pointerDownState,segmentMidpoint:{...t.pointerDownState.segmentMidpoint,added:!0},lastClickedPoint:o.index},c.selectedPointsIndices=[o.index],c}static _updatePoints(t,n,r,i,a,s){if(Pe(t)){let o={};(a==null?void 0:a.startBinding)!==void 0&&(o.startBinding=a.startBinding!==null&&d2(a.startBinding)?a.startBinding:null),(a==null?void 0:a.endBinding)!==void 0&&(o.endBinding=a.endBinding!==null&&d2(a.endBinding)?a.endBinding:null),o.points=Array.from(n),me(t,o,!0,{isDragging:s==null?void 0:s.isDragging})}else{let o=jC(t,n),c=jC(t,t.points),d=(o[0]+o[2])/2,l=(o[1]+o[3])/2,h=(c[0]+c[2])/2,f=(c[1]+c[3])/2,g=h-d,U=f-l,y=he(A(r,i),A(g,U),t.angle);me(t,{...a,points:n,x:t.x+y[0],y:t.y+y[1]})}}static _getShiftLockedDelta(t,n,r,i,a){let s=bt.getPointGlobalCoordinates(t,r,n);if(Pe(t))return[i[0]-s[0],i[1]-s[1]];let[o,c]=zn(i[0],i[1],a),{width:d,height:l}=Y3(s[0],s[1],o,c);return he(A(d,l),A(0,0),-t.angle)}static moveFixedSegment(t,n,r,i,a){let s=bt.getElement(t.elementId,a);if(!s||!Pe(s))return t;if(n&&n>0&&n<s.points.length){let o=Bo(Md(Ve(s.points[n],s.points[n-1]))),c=(s.fixedSegments??[]).reduce((f,g)=>(f[g.index]=g,f),{});c[n]={index:n,start:A(o?s.points[n-1][0]:r-s.x,o?i-s.y:s.points[n-1][1]),end:A(o?s.points[n][0]:r-s.x,o?i-s.y:s.points[n][1])};let d=Object.values(c).sort((f,g)=>f.index-g.index),l=d.map(f=>f.index).reduce((f,g)=>g<n?f+1:f,0);me(s,{fixedSegments:d});let h=A(s.x+(s.fixedSegments[l].start[0]+s.fixedSegments[l].end[0])/2,s.y+(s.fixedSegments[l].start[1]+s.fixedSegments[l].end[1])/2);return{...t,segmentMidPointHoveredCoords:h,pointerDownState:{...t.pointerDownState,segmentMidpoint:{added:!1,index:s.fixedSegments[l].index,value:h}}}}return t}static deleteFixedSegment(t,n){var r;me(t,{fixedSegments:(r=t.fixedSegments)==null?void 0:r.filter(i=>i.index!==n)}),me(t,{},!0)}};H(In,"POINT_HANDLE_SIZE",10),H(In,"getEditorMidPoints",(e,t,n)=>{let r=pt(e,t);return!Pe(e)&&!n.editingLinearElement&&e.points.length>2&&!r?[]:(jl.version===e.version&&jl.zoom===n.zoom.value||In.updateEditorMidPointsCache(e,t,n),jl.points)}),H(In,"updateEditorMidPointsCache",(e,t,n)=>{let r=In.getPointsGlobalCoordinates(e,t),i=0,a=[];for(;i<r.length-1;){if(In.isSegmentTooShort(e,e.points[i],e.points[i+1],i,n.zoom)){a.push(null),i++;continue}let s=In.getSegmentMidPoint(e,r[i],r[i+1],i+1,t);a.push(s),i++}jl.points=a,jl.version=e.version,jl.zoom=n.zoom.value}),H(In,"getSegmentMidpointHitCoords",(e,t,n,r)=>{let{elementId:i}=e,a=In.getElement(i,r);if(!a)return null;let s=In.getPointIndexUnderCursor(a,r,n.zoom,t.x,t.y);if(!Pe(a)&&s>=0||In.getPointsGlobalCoordinates(a,r).length>=3&&!n.editingLinearElement&&!Pe(a))return null;let o=(In.POINT_HANDLE_SIZE+1)/n.zoom.value,c=e.segmentMidPointHoveredCoords;if(c&&Rt(A(c[0],c[1]),A(t.x,t.y))<=o)return c;let d=0,l=In.getEditorMidPoints(a,r,n);for(;d<l.length;){if(l[d]!==null&&Rt(l[d],A(t.x,t.y))<=o)return l[d];d++}return null}),H(In,"getBoundTextElementPosition",(e,t,n)=>{let r=In.getPointsGlobalCoordinates(e,n);r.length<2&&me(t,{isDeleted:!0});let i=0,a=0;if(e.points.length%2===1){let s=Math.floor(e.points.length/2),o=In.getPointGlobalCoordinates(e,e.points[s],n);i=o[0]-t.width/2,a=o[1]-t.height/2}else{let s=e.points.length/2-1,o=jl.points[s];e.points.length===2&&(o=H1(r[0],r[1])),(!o||jl.version!==e.version)&&(o=In.getSegmentMidPoint(e,r[s],r[s+1],s+1,n)),i=o[0]-t.width/2,a=o[1]-t.height/2}return{x:i,y:a}}),H(In,"getMinMaxXYWithBoundText",(e,t,n,r)=>{let[i,a,s,o]=n,c=(i+s)/2,d=(a+o)/2,{x:l,y:h}=In.getBoundTextElementPosition(e,r,t),f=l+r.width,g=h+r.height,U=A(c,d),y=he(A(i,a),U,e.angle),v=he(A(s,a),U,e.angle),x=he(A(l,h),U,-e.angle),w=he(A(f,h),U,-e.angle),C=he(A(l,g),U,-e.angle),S=he(A(f,g),U,-e.angle);return y[0]<v[0]&&y[1]>=v[1]?(i=Math.min(i,C[0]),s=Math.max(s,Math.max(w[0],S[0])),a=Math.min(a,x[1]),o=Math.max(o,S[1])):y[0]>=v[0]&&y[1]>v[1]?(i=Math.min(i,S[0]),s=Math.max(s,Math.max(x[0],w[0])),a=Math.min(a,C[1]),o=Math.max(o,w[1])):y[0]>=v[0]?(i=Math.min(i,w[0]),s=Math.max(s,C[0]),a=Math.min(a,S[1]),o=Math.max(o,x[1])):y[1]<=v[1]&&(i=Math.min(i,Math.min(w[0],x[0])),s=Math.max(s,S[0]),a=Math.min(a,w[1]),o=Math.max(o,C[1])),[i,a,s,o,c,d]}),H(In,"getElementAbsoluteCoords",(e,t,n=!1)=>{let r,i,a,s,o;if(e.points.length<2||!yn.get(e)){let{minX:h,minY:f,maxX:g,maxY:U}=e.points.reduce((y,[v,x])=>(y.minY=Math.min(y.minY,x),y.minX=Math.min(y.minX,v),y.maxX=Math.max(y.maxX,v),y.maxY=Math.max(y.maxY,x),y),{minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0});i=h+e.x,a=f+e.y,s=g+e.x,o=U+e.y}else{let h=yn.generateElementShape(e,null),f=wc(h[0]),[g,U,y,v]=MU(f);i=g+e.x,a=U+e.y,s=y+e.x,o=v+e.y}let c=(i+s)/2,d=(a+o)/2;if(r=[i,a,s,o,c,d],!n)return r;let l=pt(e,t);return l&&(r=In.getMinMaxXYWithBoundText(e,t,[i,a,s,o],l)),r});var Re=In,yne=e=>{let t=[...new Set(e.filter(n=>n!==null&&n!==-1))];return t=t.sort((n,r)=>n-r),t.length?t:null},yh={},b2=(e,t)=>{let n=yh[e]||(yh[e]={height:t});return n.height=t,n},eL=e=>{yh[e]&&delete yh[e]},vne=e=>{var t;return((t=yh[e])==null?void 0:t.height)??null},Yr=(e,t,n,r=!0)=>{let i,a={x:e.x,y:e.y,text:e.text,width:e.width,height:e.height,angle:(t==null?void 0:t.angle)??e.angle};a.text=e.text,(t||!e.autoResize)&&(i=t?Qo(t,e):e.width,a.text=zd(e.originalText,Bt(e),i));let s=jr(a.text,Bt(e),e.lineHeight);if(e.autoResize&&(a.width=s.width),a.height=s.height,t){let o=OU(t,e),c=Qo(t,e);if(!Ut(t)&&s.height>o){let f=Id(s.height,t.type);me(t,{height:f},r),b2(t.id,f)}if(s.width>c){let f=Id(s.width,t.type);me(t,{width:f},r)}let d={...e,...a},{x:l,y:h}=NU(t,d,n);a.x=l,a.y=h}me(e,a,r)},tL=(e,t,n)=>{let r=nt(e);t.forEach(i=>{let a=n.get(i.id),s=Ko(i);if(s){let o=n.get(s);if(o){let c=r.get(a);c&&me(c,{boundElements:(i.boundElements||[]).filter(l=>l.id!==o&&l.id!==s).concat({type:"text",id:o})});let d=r.get(o);d&&Le(d)&&me(d,{containerId:c?a:null})}}})},G1=(e,t,n,r=!1)=>{if(!Ko(e))return;eL(e.id);let i=pt(e,t);if(i&&i.text){if(!e)return;let a=i.text,s=i.height,o=i.width,c=Qo(e,i),d=OU(e,i),l=e.height;if(r||n!=="n"&&n!=="s"){a&&(a=zd(i.originalText,Bt(i),c));let h=jr(a,Bt(i),i.lineHeight);s=h.height,o=h.width}if(s>d){l=Id(s,e.type);let h=l-e.height,f=!Ut(e)&&(n==="ne"||n==="nw"||n==="n")?e.y-h:e.y;me(e,{height:l,y:f})}me(i,{text:a,width:o,height:s}),Ut(e)||me(i,NU(e,i,t))}},NU=(e,t,n)=>{if(Ut(e))return Re.getBoundTextElementPosition(e,t,n);let r=xne(e),i=OU(e,t),a=Qo(e,t),s,o;return t.verticalAlign===ji.TOP?o=r.y:t.verticalAlign===ji.BOTTOM?o=r.y+(i-t.height):o=r.y+(i/2-t.height/2),t.textAlign===o1.LEFT?s=r.x:t.textAlign===o1.RIGHT?s=r.x+(a-t.width):s=r.x+(a/2-t.width/2),{x:s,y:o}},Ko=e=>{var t,n,r;return((t=e==null?void 0:e.boundElements)==null?void 0:t.length)&&((r=(n=e==null?void 0:e.boundElements)==null?void 0:n.find(i=>i.type==="text"))==null?void 0:r.id)||null},pt=(e,t)=>{if(!e)return null;let n=Ko(e);return n&&t.get(n)||null},ur=(e,t)=>e&&e.containerId&&t.get(e.containerId)||null,ey=(e,t,n)=>{if(!Ut(e))return{x:e.x+e.width/2,y:e.y+e.height/2};let r=Re.getPointsGlobalCoordinates(e,n);if(r.length%2===1){let s=Math.floor(e.points.length/2),o=Re.getPointGlobalCoordinates(e,e.points[s],n);return{x:o[0],y:o[1]}}let i=e.points.length/2-1,a=Re.getEditorMidPoints(e,n,t)[i];return a||(a=Re.getSegmentMidPoint(e,r[i],r[i+1],i+1,n)),{x:a[0],y:a[1]}},xne=e=>{let t=Xn,n=Xn;return e.type==="ellipse"&&(t+=e.width/2*(1-Math.sqrt(2)/2),n+=e.height/2*(1-Math.sqrt(2)/2)),e.type==="diamond"&&(t+=e.width/4,n+=e.height/4),{x:e.x+t,y:e.y+n}},wne=(e,t)=>!t||Ut(t)?e.angle:t.angle,Ene=(e,t)=>e.some(n=>{if(an(n)){let r=ur(n,t);return!Ut(r)}return!1}),Cne=(e,t)=>e.some(n=>{if(an(n)){let r=ur(n,t);return!Ut(r)}return Le(n)}),Sne=new Set(["rectangle","ellipse","diamond","arrow"]),_ne=e=>Sne.has(e.type),Id=(e,t)=>{e=Math.ceil(e);let n=Xn*2;return t==="ellipse"?Math.round((e+n)/Math.sqrt(2)*2):t==="arrow"?e+n*8:t==="diamond"?2*(e+n):e+n},Qo=(e,t)=>{let{width:n}=e;if(Ut(e)){let r=((t==null?void 0:t.fontSize)??ol)*cY;return Math.max(lY*n,r)}return e.type==="ellipse"?Math.round(n/2*Math.sqrt(2))-Xn*2:e.type==="diamond"?Math.round(n/2)-Xn*2:n-Xn*2},OU=(e,t)=>{let{height:n}=e;return Ut(e)?n-Xn*8*2<=0?t.height:n:e.type==="ellipse"?Math.round(n/2*Math.sqrt(2))-Xn*2:e.type==="diamond"?Math.round(n/2)-Xn*2:n-Xn*2},nL=(e,t=`
64
-
65
- `)=>e.reduce((n,r)=>(Le(r)&&n.push(r.text),n),[]).join(t),Ui=e=>(e=e.trim(),e&&sI.sanitizeUrl(gg(e))),rL=e=>!!(e!=null&&e.includes(location.origin)||e!=null&&e.startsWith("/")),iL=e=>{if(e=Ui(e),e.startsWith("/"))return`${location.origin}${e}`;try{new URL(e)}catch{return"about:blank"}return e},F3=[],Te=e=>(F3=F3.concat(e),e),aL='<svg viewBox="0 0 24 24" stroke-width="1" width="28" height="28" xmlns="http://www.w3.org/2000/svg">',kne='<path d="M6.164 11.755a5.314 5.314 0 0 1-4.932-5.298 5.314 5.314 0 0 1 5.311-5.311 5.314 5.314 0 0 1 5.307 5.113l8.773 8.773a3.322 3.322 0 0 1 0 4.696l-.895.895a3.322 3.322 0 0 1-4.696 0l-8.868-8.868Z" style="fill:#fff"/>',sL='<path stroke="#1b1b1f" fill="#fff" d="m7.868 11.113 7.773 7.774a2.359 2.359 0 0 0 1.667.691 2.368 2.368 0 0 0 2.357-2.358c0-.625-.248-1.225-.69-1.667L11.201 7.78 9.558 9.469l-1.69 1.643v.001Zm10.273 3.606-3.333 3.333m-3.25-6.583 2 2m-7-7 3 3M3.664 3.625l1 1M2.529 6.922l1.407-.144m5.735-2.932-1.118.866M4.285 9.823l.758-1.194m1.863-6.207-.13 1.408"/>',Tne=`data:${We.svg},${encodeURIComponent(`${aL}${sL}</svg>`)}`,Mne=`data:${We.svg},${encodeURIComponent(`${aL}${kne}${sL}</svg>`)}`,$a=e=>{e&&(e.style.cursor="")},$t=(e,t)=>{e&&(e.style.cursor=t)},Cs,HC,oL=(e,t)=>{let n=()=>{let r=t===wt.DARK;Cs=document.createElement("canvas"),Cs.theme=t,Cs.height=20,Cs.width=20;let i=Cs.getContext("2d");i.lineWidth=1,i.beginPath(),i.arc(Cs.width/2,Cs.height/2,5,0,2*Math.PI),i.fillStyle=r?dr.black:dr.white,i.fill(),i.strokeStyle=r?dr.white:dr.black,i.stroke(),HC=Cs.toDataURL(We.svg)};(!Cs||Cs.theme!==t)&&n(),$t(e,`url(${HC}) ${20/2} ${20/2}, auto`)},Ts=(e,t)=>{if(e)if(t.activeTool.type==="selection")$a(e);else if(ch(t))e.style.cursor=Ot.GRAB;else if(Is(t))oL(e,t.theme);else if(t.activeTool.type==="laser"){let n=t.theme===wt.LIGHT?Tne:Mne;e.style.cursor=`url(${n}), auto`}else["image","custom"].includes(t.activeTool.type)?t.activeTool.type!=="image"&&(e.style.cursor=Ot.AUTO):e.style.cursor=Ot.CROSSHAIR},Ine=new ZM(Date.now()),Ane=0,Gs=()=>Math.floor(Ine.next()*2**31),ga=()=>Go()?`id${Ane++}`:sv(),ss=(e,{x:t,y:n,strokeColor:r=En.strokeColor,backgroundColor:i=En.backgroundColor,fillStyle:a=En.fillStyle,strokeWidth:s=En.strokeWidth,strokeStyle:o=En.strokeStyle,roughness:c=En.roughness,opacity:d=En.opacity,width:l=0,height:h=0,angle:f=0,groupIds:g=[],frameId:U=null,index:y=null,roundness:v=null,boundElements:x=null,link:w=null,locked:C=En.locked,...S})=>((t<-1e6||t>1e6||n<-1e6||n>1e6||l<-1e6||l>1e6||h<-1e6||h>1e6)&&console.error("New element size or position is too large",{x:t,y:n,width:l,height:h,points:S.points}),{id:S.id||ga(),type:e,x:t,y:n,width:l,height:h,angle:f,strokeColor:r,backgroundColor:i,fillStyle:a,strokeWidth:s,strokeStyle:o,roughness:c,opacity:d,groupIds:g,frameId:U,index:y,roundness:v,seed:S.seed??Gs(),version:S.version||1,versionNonce:S.versionNonce??0,isDeleted:!1,boundElements:x,updated:Fh(),link:w,locked:C,customData:S.customData}),qs=e=>ss(e.type,e),WC=e=>ss("embeddable",e),Lne=e=>({...ss("iframe",e)}),Fv=e=>ct({...ss("frame",e),type:"frame",name:(e==null?void 0:e.name)||null},{}),$3=e=>ct({...ss("magicframe",e),type:"magicframe",name:(e==null?void 0:e.name)||null},{}),lL=(e,t)=>({x:e.textAlign==="center"?t.width/2:e.textAlign==="right"?t.width:0,y:e.verticalAlign==="middle"?t.height/2:0}),Oi=e=>{let t=e.fontFamily||xc,n=e.fontSize||ol,r=e.lineHeight||Td(t),i=fh(e.text),a=jr(i,Bt({fontFamily:t,fontSize:n}),r),s=e.textAlign||B1,o=e.verticalAlign||Jg,c=lL({textAlign:s,verticalAlign:o},a),d={...ss("text",e),text:i,fontSize:n,fontFamily:t,textAlign:s,verticalAlign:o,x:e.x-c.x,y:e.y-c.y,width:a.width,height:a.height,containerId:e.containerId||null,originalText:e.originalText??i,autoResize:e.autoResize??!0,lineHeight:r};return ct(d,{})},Rne=(e,t,n)=>{let{width:r,height:i}=jr(n,Bt(e),e.lineHeight);e.autoResize||(r=e.width);let{textAlign:a,verticalAlign:s}=e,o,c;if(a==="center"&&s===ji.MIDDLE&&!e.containerId&&e.autoResize){let d=jr(e.text,Bt(e),e.lineHeight),l=lL(e,{width:r-d.width,height:i-d.height});o=e.x-l.x,c=e.y-l.y}else{let[d,l,h,f]=lt(e,t),[g,U,y,v]=oc(e,r,i,!1),x=(d-g)/2,w=(l-U)/2,C=(h-y)/2,S=(f-v)/2;[o,c]=Dne({s:!0,e:a==="center"||a==="left",w:a==="center"||a==="right"},e.x,e.y,e.angle,x,w,C,S)}return{width:r,height:i,x:Number.isFinite(o)?o:e.x,y:Number.isFinite(c)?c:e.y}},Dne=(e,t,n,r,i,a,s,o)=>{let c=Math.cos(r),d=Math.sin(r);return e.e&&e.w?t+=i+s:e.e?(t+=i*(1+c),n+=i*d,t+=s*(1-c),n+=s*-d):e.w&&(t+=i*(1-c),n+=i*-d,t+=s*(1+c),n+=s*d),e.n&&e.s?n+=a+o:e.n?(t+=a*d,n+=a*(1-c),t+=o*-d,n+=o*(1+c)):(t+=a*-d,n+=a*(1+c),t+=o*d,n+=o*(1-c)),[t,n]},cL=(e,t,n,r=e.text)=>{if(e.isDeleted)return;(t||!e.autoResize)&&(r=zd(r,Bt(e),t?Qo(t,e):e.width));let i=Rne(e,n,r);return{text:r,...i}},jne=e=>({...ss(e.type,e),points:e.points||[],pressures:e.pressures||[],simulatePressure:e.simulatePressure,lastCommittedPoint:null}),fd=e=>({...ss(e.type,e),points:e.points||[],lastCommittedPoint:null,startBinding:null,endBinding:null,startArrowhead:null,endArrowhead:null}),$v=e=>e.elbowed?{...ss(e.type,e),points:e.points||[],lastCommittedPoint:null,startBinding:null,endBinding:null,startArrowhead:e.startArrowhead||null,endArrowhead:e.endArrowhead||null,elbowed:!0,fixedSegments:e.fixedSegments||[],startIsSpecial:!1,endIsSpecial:!1}:{...ss(e.type,e),points:e.points||[],lastCommittedPoint:null,startBinding:null,endBinding:null,startArrowhead:e.startArrowhead||null,endArrowhead:e.endArrowhead||null,elbowed:!1},dL=e=>({...ss("image",e),strokeColor:"transparent",status:e.status??"pending",fileId:e.fileId??null,scale:e.scale??[1,1],crop:e.crop??null}),y2=(e,t=0)=>{if(e==null||typeof e!="object")return e;let n=Object.prototype.toString.call(e);if(n==="[object Object]"){let r=typeof e.constructor=="function"?Object.create(Object.getPrototypeOf(e)):{};for(let i in e)if(e.hasOwnProperty(i)){if(t===0&&(i==="shape"||i==="canvas"))continue;r[i]=y2(e[i],t+1)}return r}if(Array.isArray(e)){let r=e.length,i=new Array(r);for(;r--;)i[r]=y2(e[r],t+1);return i}return mt.DEV&&n!=="[object Object]"&&n!=="[object Array]"&&n.startsWith("[object ")&&console.warn(`_deepCloneElement: unexpected object type ${n}. This value will not be cloned!`),e},Hd=e=>y2(e),uL=(e,t)=>{Object.defineProperty(e,hY,{value:t,writable:!1,enumerable:!1})},v2=()=>ga(),hL=(e,t,n,r)=>{let i=Hd(n);return Go()&&uL(i,n.id),i.id=v2(),i.boundElements=null,i.updated=Fh(),i.seed=Gs(),i.groupIds=ane(i.groupIds,e,a=>(t.has(a)||t.set(a,v2()),t.get(a))),r&&(i=Object.assign(i,r)),i},fL=(e,t)=>{let n=[],r=nt(e),i=new Map,a=o=>{if(i.has(o))return i.get(o);if(r.has(o)){let c=v2();return i.set(o,c),c}return null},s=new Map;for(let o of e){let c=y2(o);if(c.id=a(o.id),Go()&&uL(c,o.id),t!=null&&t.randomizeSeed&&(c.seed=Gs(),e0(c)),c.groupIds&&(c.groupIds=c.groupIds.map(d=>(s.has(d)||s.set(d,v2()),s.get(d)))),"containerId"in c&&c.containerId){let d=a(c.containerId);c.containerId=d}if("boundElements"in c&&c.boundElements&&(c.boundElements=c.boundElements.reduce((d,l)=>{let h=a(l.id);return h&&d.push({...l,id:h}),d},[])),"endBinding"in c&&c.endBinding){let d=a(c.endBinding.elementId);c.endBinding=d?{...c.endBinding,elementId:d}:null}if("startBinding"in c&&c.startBinding){let d=a(c.startBinding.elementId);c.startBinding=d?{...c.startBinding,elementId:d}:null}c.frameId&&(c.frameId=a(c.frameId)),n.push(c)}return n},Bv=(e,{shouldThrow:t=!1,includeBoundTextValidation:n=!1,ignoreLogs:r,reconciliationContext:i})=>{let a=[],s=c=>`${c==null?void 0:c.index}:${c==null?void 0:c.id}:${c==null?void 0:c.type}:${c==null?void 0:c.isDeleted}:${c==null?void 0:c.version}:${c==null?void 0:c.versionNonce}`,o=e.map(c=>c.index);for(let[c,d]of o.entries()){let l=o[c-1],h=o[c+1];if(B3(d,l,h)||a.push(`Fractional indices invariant has been compromised: "${s(e[c-1])}", "${s(e[c])}", "${s(e[c+1])}"`),n&&ma(e[c])){let f=e[c],g=pt(f,nt(e));g&&g.index<=f.index&&a.push(`Fractional indices invariant for bound elements has been compromised: "${s(g)}", "${s(f)}"`)}}if(a.length){let c=new eZ,d=[];if(i&&(d.push("Additional reconciliation context:"),d.push(i.localElements.map(l=>s(l))),d.push(i.remoteElements.map(l=>s(l)))),r||console.error(a.join(`
66
-
67
- `),c.stack,e.map(l=>s(l)),...d),t)throw c}},Pne=e=>e.sort((t,n)=>XC(t)&&XC(n)?t.index<n.index?-1:t.index>n.index?1:t.id<n.id?-1:1:1),Zs=(e,t)=>{try{let n=Nne(e,t),r=pL(e,n),i=e.map(a=>r.has(a)?{...a,...r.get(a)}:a);Bv(i,{includeBoundTextValidation:!1,shouldThrow:!0,ignoreLogs:!0});for(let[a,s]of r)me(a,s,!1)}catch{Jo(e)}return e},Jo=e=>{let t=One(e),n=pL(e,t);for(let[r,i]of n)me(r,i,!1);return e},Nne=(e,t)=>{let n=[],r=0;for(;r<e.length;)if(t.has(e[r].id)){let i=[r-1,r];for(;++r<e.length&&t.has(e[r].id);)i.push(r);i.push(r),n.push(i)}else r++;return n},One=e=>{let t=[],n,r,i=-1,a=0,s=d=>{var f;let l=e[i]?e[i].index:void 0,h=(f=e[d-1])==null?void 0:f.index;return!l&&h||l&&h&&h>l?[h,d-1]:[l,i]},o=d=>{var f;let l=e[a]?e[a].index:void 0;if(l&&d<a)return[l,a];let h=a;for(;++h<e.length;){let g=(f=e[h])==null?void 0:f.index;if(!l&&g||l&&g&&g>l)return[g,h]}return[void 0,h]},c=0;for(;c<e.length;){let d=e[c].index;if([n,i]=s(c),[r,a]=o(c),B3(d,n,r))c++;else{let l=[i,c];for(;++c<e.length;){let h=e[c].index,[f,g]=s(c),[U,y]=o(c);if(B3(h,f,U))break;[n,i]=[f,g],[r,a]=[U,y],l.push(c)}l.push(a),t.push(l)}}return t},B3=(e,t,n)=>e?t&&n?t<e&&e<n:!t&&n?e<n:t&&!n?t<e:!!e:!1,pL=(e,t)=>{var r,i;let n=new Map;for(let a of t){let s=a.shift(),o=a.pop(),c=v3((r=e[s])==null?void 0:r.index,(i=e[o])==null?void 0:i.index,a.length);for(let d=0;d<a.length;d++){let l=e[a[d]];n.set(l,{index:c[d]})}}return n},XC=e=>!!e.index,jn=class ks{constructor(t,n){this.deleted=t,this.inserted=n}static create(t,n,r,i){let a=r&&i!=="inserted"?r(t):t,s=r&&i!=="deleted"?r(n):n;return new ks(a,s)}static calculate(t,n,r,i){if(t===n)return ks.empty();let a={},s={};for(let d of this.distinctKeysIterator("full",t,n))a[d]=t[d],s[d]=n[d];let[o,c]=i?i(a,s):[a,s];return ks.create(o,c,r)}static empty(){return new ks({},{})}static isEmpty(t){return!Object.keys(t.deleted).length&&!Object.keys(t.inserted).length}static mergeObjects(t,n,r){let i={...t};for(let a of Object.keys(r))delete i[a];return{...i,...n}}static mergeArrays(t,n,r,i){return Object.values(ks.mergeObjects(_o(t??[],i),_o(n??[],i),_o(r??[],i)))}static diffObjects(t,n,r,i){if(!(!t[r]&&!n[r])&&(typeof t[r]=="object"||typeof n[r]=="object")){let a=t[r]??{},s=n[r]??{},o=ks.getLeftDifferences(a,s).reduce((d,l)=>(d[l]=i(a[l]),d),{}),c=ks.getRightDifferences(a,s).reduce((d,l)=>(d[l]=i(s[l]),d),{});Object.keys(o).length||Object.keys(c).length?(Reflect.set(t,r,o),Reflect.set(n,r,c)):(Reflect.deleteProperty(t,r),Reflect.deleteProperty(n,r))}}static diffArrays(t,n,r,i){if(!(!t[r]&&!n[r])&&(Array.isArray(t[r])||Array.isArray(n[r]))){let a=Array.isArray(t[r])?t[r]:[],s=Array.isArray(n[r])?n[r]:[],o=_o(ks.getLeftDifferences(_o(a,i),_o(s,i))),c=_o(ks.getRightDifferences(_o(a,i),_o(s,i)));if(Object.keys(o).length||Object.keys(c).length){let d=a.filter(h=>o[i?i(h):String(h)]),l=s.filter(h=>c[i?i(h):String(h)]);Reflect.set(t,r,d),Reflect.set(n,r,l)}else Reflect.deleteProperty(t,r),Reflect.deleteProperty(n,r)}}static isLeftDifferent(t,n,r=!1){return!!this.distinctKeysIterator("left",t,n,r).next().value}static isRightDifferent(t,n,r=!1){return!!this.distinctKeysIterator("right",t,n,r).next().value}static getLeftDifferences(t,n,r=!1){return Array.from(this.distinctKeysIterator("left",t,n,r))}static getRightDifferences(t,n,r=!1){return Array.from(this.distinctKeysIterator("right",t,n,r))}static*distinctKeysIterator(t,n,r,i=!1){if(n===r)return;let a=[];t==="left"?a=Object.keys(n):t==="right"?a=Object.keys(r):t==="full"?a=Array.from(new Set([...Object.keys(n),...Object.keys(r)])):Cd(t,`Unknown distinctKeysIterator's join param "${t}"`,!0);for(let s of a){let o=n[s],c=r[s];if(o!==c){if(!i&&typeof o=="object"&&typeof c=="object"&&o!==null&&c!==null&&yr(o,c))continue;yield s}}}},VC=class oi{constructor(t){this.delta=t}static calculate(t,n){let r=jn.calculate(t,n,void 0,oi.postProcess);return new oi(r)}static empty(){return new oi(jn.create({},{}))}inverse(){let t=jn.create(this.delta.inserted,this.delta.deleted);return new oi(t)}applyTo(t,n){try{let{selectedElementIds:r={},selectedGroupIds:i={}}=this.delta.deleted,{selectedElementIds:a={},selectedGroupIds:s={},selectedLinearElementId:o,editingLinearElementId:c,...d}=this.delta.inserted,l=jn.mergeObjects(t.selectedElementIds,a,r),h=jn.mergeObjects(t.selectedGroupIds,s,i),f=o&&n.has(o)?new Re(n.get(o)):null,g=c&&n.has(c)?new Re(n.get(c)):null,U={...t,...d,selectedElementIds:l,selectedGroupIds:h,selectedLinearElement:typeof o<"u"?f:t.selectedLinearElement,editingLinearElement:typeof c<"u"?g:t.editingLinearElement},y=this.filterInvisibleChanges(t,U,n);return[U,y]}catch(r){if(console.error("Couldn't apply appstate change",r),mt.DEV||mt.MODE===fi.TEST)throw r;return[t,!1]}}isEmpty(){return jn.isEmpty(this.delta)}static postProcess(t,n){try{jn.diffObjects(t,n,"selectedElementIds",r=>!0),jn.diffObjects(t,n,"selectedGroupIds",r=>r??!1)}catch(r){if(console.error("Couldn't postprocess appstate change deltas."),mt.DEV||mt.MODE===fi.TEST)throw r}finally{return[t,n]}}filterInvisibleChanges(t,n,r){let i=x2(t),a=x2(n),s=jn.isRightDifferent(oi.stripElementsProps(i),oi.stripElementsProps(a)),o=jn.isRightDifferent(oi.stripStandaloneProps(i),oi.stripStandaloneProps(a));if(!s&&!o)return!1;let c={value:s};if(o){let d=jn.getRightDifferences(oi.stripStandaloneProps(i),oi.stripStandaloneProps(a)),l=new Set;(d.includes("editingGroupId")||d.includes("selectedGroupIds"))&&(l=lne(r));for(let h of d)switch(h){case"selectedElementIds":n[h]=oi.filterSelectedElements(n[h],r,c);break;case"selectedGroupIds":n[h]=oi.filterSelectedGroups(n[h],l,c);break;case"croppingElementId":{let y=n[h],v=y&&r.get(y);v&&!v.isDeleted?c.value=!0:n[h]=null;break}case"editingGroupId":let f=n[h];f?l.has(f)?c.value=!0:n[h]=null:c.value=!0;break;case"selectedLinearElementId":case"editingLinearElementId":let g=oi.convertToAppStateKey(h),U=n[g];if(!U)c.value=!0;else{let y=r.get(U.elementId);y&&!y.isDeleted?c.value=!0:n[g]=null}break;default:Cd(h,`Unknown ObservedElementsAppState's key "${h}"`,!0)}}return c.value}static convertToAppStateKey(t){switch(t){case"selectedLinearElementId":return"selectedLinearElement";case"editingLinearElementId":return"editingLinearElement"}}static filterSelectedElements(t,n,r){let i=Object.keys(t);if(!i.length)return r.value=!0,t;let a={...t};for(let s of i){let o=n.get(s);o&&!o.isDeleted?r.value=!0:delete a[s]}return a}static filterSelectedGroups(t,n,r){if(!Object.keys(t).length)return r.value=!0,t;let i={...t};for(let a of Object.keys(i))n.has(a)?r.value=!0:delete i[a];return i}static stripElementsProps(t){let{editingGroupId:n,selectedGroupIds:r,selectedElementIds:i,editingLinearElementId:a,selectedLinearElementId:s,croppingElementId:o,...c}=t;return c}static stripStandaloneProps(t){let{name:n,viewBackgroundColor:r,...i}=t;return i}},Hl=class gn{constructor(t,n,r){this.added=t,this.removed=n,this.updated=r}static create(t,n,r,i={shouldRedistribute:!1}){let a;if(i.shouldRedistribute){let s=new Map,o=new Map,c=new Map,d=[...t,...n,...r];for(let[l,h]of d)this.satisfiesAddition(h)?s.set(l,h):this.satisfiesRemoval(h)?o.set(l,h):c.set(l,h);a=new gn(s,o,c)}else a=new gn(t,n,r);return(mt.DEV||mt.MODE===fi.TEST)&&(gn.validate(a,"added",this.satisfiesAddition),gn.validate(a,"removed",this.satisfiesRemoval),gn.validate(a,"updated",this.satisfiesUpdate)),a}static validate(t,n,r){for(let[i,a]of t[n].entries())if(!r(a))throw console.error(`Broken invariant for "${n}" delta, element "${i}", delta:`,a),new Error(`ElementsChange invariant broken for element "${i}".`)}static calculate(t,n){if(t===n)return gn.empty();let r=new Map,i=new Map,a=new Map;for(let s of t.values())if(!n.get(s.id)){let o={...s,isDeleted:!1},c={isDeleted:!0},d=jn.create(o,c,gn.stripIrrelevantProps);i.set(s.id,d)}for(let s of n.values()){let o=t.get(s.id);if(!o){let c={isDeleted:!0},d={...s,isDeleted:!1},l=jn.create(c,d,gn.stripIrrelevantProps);r.set(s.id,l);continue}if(o.versionNonce!==s.versionNonce){let c=jn.calculate(o,s,gn.stripIrrelevantProps,gn.postProcess);if(typeof o.isDeleted=="boolean"&&typeof s.isDeleted=="boolean"&&o.isDeleted!==s.isDeleted){o.isDeleted&&!s.isDeleted?r.set(s.id,c):i.set(s.id,c);continue}jn.isEmpty(c)||a.set(s.id,c)}}return gn.create(r,i,a)}static empty(){return gn.create(new Map,new Map,new Map)}inverse(){let t=a=>{let s=new Map;for(let[o,c]of a.entries())s.set(o,jn.create(c.inserted,c.deleted));return s},n=t(this.added),r=t(this.removed),i=t(this.updated);return gn.create(r,n,i)}isEmpty(){return this.added.size===0&&this.removed.size===0&&this.updated.size===0}applyLatestChanges(t){let n=o=>c=>{let d={};for(let l of Object.keys(c))switch(l){case"boundElements":d[l]=c[l];break;default:d[l]=o[l]}return d},r=o=>{let c=new Map;for(let[d,l]of o.entries()){let h=t.get(d);if(h){let f=jn.create(l.deleted,l.inserted,n(h),"inserted");c.set(d,f)}else c.set(d,l)}return c},i=r(this.added),a=r(this.removed),s=r(this.updated);return gn.create(i,a,s,{shouldRedistribute:!0})}applyTo(t,n){let r=fa(new Map(t)),i,a={containsVisibleDifference:!1,containsZindexDifference:!1};try{let s=gn.createApplier(r,n,a),o=s(this.added),c=s(this.removed),d=s(this.updated),l=this.resolveConflicts(t,r);i=new Map([...o,...c,...d,...l])}catch(s){if(console.error("Couldn't apply elements change",s),mt.DEV||mt.MODE===fi.TEST)throw s;return[t,!0]}try{gn.redrawTextBoundingBoxes(r,i),r=gn.reorderElements(r,i,a),gn.redrawBoundArrows(r,i)}catch(s){if(console.error("Couldn't mutate elements after applying elements change",s),mt.DEV||mt.MODE===fi.TEST)throw s}finally{return[r,a.containsVisibleDifference]}}static applyDelta(t,n,r={containsVisibleDifference:!0,containsZindexDifference:!0}){var s,o;let{boundElements:i,...a}=n.inserted;if((s=n.deleted.boundElements)!=null&&s.length||(o=n.inserted.boundElements)!=null&&o.length){let c=jn.mergeArrays(t.boundElements,n.inserted.boundElements,n.deleted.boundElements,d=>d.id);Object.assign(a,{boundElements:c})}if(Lt(t)){let c=n;(c.deleted.crop||c.inserted.crop)&&Object.assign(a,{crop:c.inserted.crop??null})}if(!r.containsVisibleDifference){let{index:c,...d}=a,l=gn.checkForVisibleDifference(t,d);r.containsVisibleDifference=l}return r.containsZindexDifference||(r.containsZindexDifference=n.deleted.index!==n.inserted.index),ct(t,a)}static checkForVisibleDifference(t,n){return t.isDeleted&&n.isDeleted!==!1?!1:t.isDeleted&&n.isDeleted===!1||t.isDeleted===!1&&n.isDeleted?!0:jn.isRightDifferent(t,n)}resolveConflicts(t,n){let r=new Map,i=(d,l)=>{let h=n.get(d.id);if(!h)return;let f;t.get(d.id)===h?f=ct(h,l):f=me(h,l),r.set(f.id,f),n.set(f.id,f)};for(let[d]of this.removed)gn.unbindAffected(t,n,d,i);for(let[d]of this.added)gn.rebindAffected(t,n,d,i);for(let[d]of Array.from(this.updated).filter(([l,h])=>Object.keys({...h.deleted,...h.inserted}).find(f=>Qte.has(f)))){let l=n.get(d);!l||l.isDeleted||gn.rebindAffected(t,n,d,i)}let a=new Map(Array.from(t).filter(([d])=>r.has(d))),{added:s,removed:o,updated:c}=gn.calculate(a,r);for(let[d,l]of s)this.added.set(d,l);for(let[d,l]of o)this.removed.set(d,l);for(let[d,l]of c)this.updated.set(d,l);return r}static unbindAffected(t,n,r,i){let a=()=>t.get(r),s=()=>n.get(r);Fu.unbindAffected(n,a(),i),Fu.unbindAffected(n,s(),i),$u.unbindAffected(n,a(),i),$u.unbindAffected(n,s(),i)}static rebindAffected(t,n,r,i){let a=()=>t.get(r),s=()=>n.get(r);Fu.unbindAffected(n,a(),i),Fu.rebindAffected(n,s(),i),$u.unbindAffected(n,a(),(o,c)=>{Le(o)&&i(o,c)}),$u.rebindAffected(n,s(),i)}static redrawTextBoundingBoxes(t,n){let r=new Map;for(let i of n.values()){if(an(i)){let{containerId:a}=i,s=a?t.get(a):void 0;s&&r.set(s.id,{container:s,boundText:i})}if(ma(i)){let a=Ko(i),s=a?t.get(a):void 0;s&&r.set(i.id,{container:i,boundText:s})}}for(let{container:i,boundText:a}of r.values())i.isDeleted||a.isDeleted||Yr(a,i,t,!1)}static redrawBoundArrows(t,n){for(let r of n.values())!r.isDeleted&&is(r)&&gi(r,t,{})}static reorderElements(t,n,r){if(!r.containsZindexDifference)return t;let i=Array.from(t.values()),a=Pne([...i]),s=jn.getRightDifferences(i,a,!0).reduce((o,c)=>{let d=i[Number(c)];return d&&n.has(d.id)&&o.set(d.id,d),o},new Map);return!r.containsVisibleDifference&&s.size&&(r.containsVisibleDifference=!0),nt(Zs(a,s))}static postProcess(t,n){try{jn.diffArrays(t,n,"boundElements",r=>r.id)}catch(r){if(console.error("Couldn't postprocess elements change deltas."),mt.DEV||mt.MODE===fi.TEST)throw r}finally{return[t,n]}}static stripIrrelevantProps(t){let{id:n,updated:r,version:i,versionNonce:a,seed:s,...o}=t;return o}};H(Hl,"satisfiesAddition",({deleted:e,inserted:t})=>e.isDeleted===!0&&!t.isDeleted),H(Hl,"satisfiesRemoval",({deleted:e,inserted:t})=>!e.isDeleted&&t.isDeleted===!0),H(Hl,"satisfiesUpdate",({deleted:e,inserted:t})=>!!e.isDeleted==!!t.isDeleted),H(Hl,"createApplier",(e,t,n)=>{let r=Hl.createGetter(e,t,n);return i=>Array.from(i.entries()).reduce((a,[s,o])=>{let c=r(s,o.inserted);if(c){let d=Hl.applyDelta(c,o,n);e.set(d.id,d),a.set(d.id,d)}return a},new Map)}),H(Hl,"createGetter",(e,t,n)=>(r,i)=>{let a=e.get(r);return a||(a=t.get(r),a&&(n.containsZindexDifference=!0,(i.isDeleted===!1||i.isDeleted!==!0&&a.isDeleted===!1)&&(n.containsVisibleDifference=!0))),a});var YC=Hl,As=class{constructor(){H(this,"subscribers",[])}on(...e){let t=e.flat().filter(n=>typeof n=="function");return this.subscribers.push(...t),()=>this.off(t)}once(...e){let t=e.flat().filter(r=>typeof r=="function");t.push(()=>n());let n=this.on(...t);return n}off(...e){let t=e.flat();this.subscribers=this.subscribers.filter(n=>!t.includes(n))}trigger(...e){for(let t of this.subscribers)t(...e);return this}clear(){this.subscribers=[]}},mL="__observedAppState",x2=e=>{var n,r;let t={name:e.name,editingGroupId:e.editingGroupId,viewBackgroundColor:e.viewBackgroundColor,selectedElementIds:e.selectedElementIds,selectedGroupIds:e.selectedGroupIds,editingLinearElementId:((n=e.editingLinearElement)==null?void 0:n.elementId)||null,selectedLinearElementId:((r=e.selectedLinearElement)==null?void 0:r.elementId)||null,croppingElementId:e.croppingElementId};return Reflect.defineProperty(t,mL,{value:!0,enumerable:!1}),t},Fne=e=>!!Reflect.get(e,mL),le={IMMEDIATELY:"IMMEDIATELY",NEVER:"NEVER",EVENTUALLY:"EVENTUALLY"},$ne=class{constructor(e,t){this.elementsChange=e,this.appStateChange=t}},Bne=class{constructor(){H(this,"onStoreIncrementEmitter",new As),H(this,"scheduledActions",new Set),H(this,"_snapshot",GC.empty()),H(this,"shouldCaptureIncrement",()=>{this.scheduleAction(le.IMMEDIATELY)}),H(this,"shouldUpdateSnapshot",()=>{this.scheduleAction(le.NEVER)}),H(this,"scheduleAction",e=>{this.scheduledActions.add(e),this.satisfiesScheduledActionsInvariant()}),H(this,"commit",(e,t)=>{try{this.scheduledActions.has(le.IMMEDIATELY)?this.captureIncrement(e,t):this.scheduledActions.has(le.NEVER)&&this.updateSnapshot(e,t)}finally{this.satisfiesScheduledActionsInvariant(),this.scheduledActions=new Set}}),H(this,"captureIncrement",(e,t)=>{let n=this.snapshot,r=this.snapshot.maybeClone(e,t);if(n!==r){let i=r.meta.didElementsChange?YC.calculate(n.elements,r.elements):YC.empty(),a=r.meta.didAppStateChange?VC.calculate(n.appState,r.appState):VC.empty();(!i.isEmpty()||!a.isEmpty())&&this.onStoreIncrementEmitter.trigger(new $ne(i,a)),this.snapshot=r}}),H(this,"updateSnapshot",(e,t)=>{let n=this.snapshot.maybeClone(e,t);this.snapshot!==n&&(this.snapshot=n)}),H(this,"filterUncomittedElements",(e,t)=>{for(let[n,r]of e.entries()){if(!t.get(n))continue;let i=this.snapshot.elements.get(n);i?i.version<r.version&&t.set(n,i):t.delete(n)}return t}),H(this,"clear",()=>{this.snapshot=GC.empty(),this.scheduledActions=new Set}),H(this,"satisfiesScheduledActionsInvariant",()=>{if(!(this.scheduledActions.size>=0&&this.scheduledActions.size<=3)){let e=`There can be at most three store actions scheduled at the same time, but there are "${this.scheduledActions.size}".`;if(console.error(e,this.scheduledActions.values()),mt.DEV||mt.MODE===fi.TEST)throw new Error(e)}})}get snapshot(){return this._snapshot}set snapshot(e){this._snapshot=e}},GC=class z3{constructor(t,n,r={didElementsChange:!1,didAppStateChange:!1,isEmpty:!1}){this.elements=t,this.appState=n,this.meta=r}static empty(){return new z3(new Map,x2(Vs()),{didElementsChange:!1,didAppStateChange:!1,isEmpty:!0})}isEmpty(){return this.meta.isEmpty}maybeClone(t,n){let r=this.maybeCreateElementsSnapshot(t),i=this.maybeCreateAppStateSnapshot(n),a=!1,s=!1;return this.elements!==r&&(a=!0),this.appState!==i&&(s=!0),!a&&!s?this:new z3(r,i,{didElementsChange:a,didAppStateChange:s})}maybeCreateAppStateSnapshot(t){if(!t)return this.appState;let n=Fne(t)?t:x2(t);return this.detectChangedAppState(n)?n:this.appState}detectChangedAppState(t){return!yr(this.appState,t,{selectedElementIds:yr,selectedGroupIds:yr})}maybeCreateElementsSnapshot(t){return t?this.detectChangedElements(t)?this.createElementsSnapshot(t):this.elements:this.elements}detectChangedElements(t){if(this.elements===t)return!1;if(this.elements.size!==t.size)return!0;let n=Array.from(t.keys());for(let r=n.length-1;r>=0;r--){let i=this.elements.get(n[r]),a=t.get(n[r]);if(!i||!a||i.id!==a.id||i.versionNonce!==a.versionNonce)return!0}return!1}createElementsSnapshot(t){let n=new Map;for(let[r,i]of this.elements.entries())t.get(r)?n.set(r,i):n.set(r,ct(i,{isDeleted:!0}));for(let[r,i]of t.entries()){let a=n.get(r);(!a||a&&a.versionNonce!==i.versionNonce)&&n.set(r,Hd(i))}return n}},Ss=new Map,zne=/^(?:http(?:s)?:\/\/)?(?:www\.)?youtu(?:be\.com|\.be)\/(embed\/|watch\?v=|shorts\/|playlist\?list=|embed\/videoseries\?list=)?([a-zA-Z0-9_-]+)(?:\?t=|&t=|\?start=|&start=)?([a-zA-Z0-9_-]+)?[^\s]*$/,Hne=/^(?:http(?:s)?:\/\/)?(?:(?:w){3}\.)?(?:player\.)?vimeo\.com\/(?:video\/)?([^?\s]+)(?:\?.*)?$/,Wne=/^https:\/\/(?:www\.)?figma\.com/,qC=/^https:\/\/gist\.github\.com\/([\w_-]+)\/([\w_-]+)/,Xne=/^<script[\s\S]*?\ssrc=["'](https:\/\/gist\.github\.com\/.*?)\.js["']/i,ZC=/(?:https?:\/\/)?(?:(?:w){3}\.)?(?:twitter|x)\.com\/[^/]+\/status\/(\d+)/,Vne=/^<blockquote[\s\S]*?\shref=["'](https?:\/\/(?:twitter|x)\.com\/[^"']*)/i,Yne=/^https:\/\/(?:www\.)?val\.town\/(v|embed)\/[a-zA-Z_$][0-9a-zA-Z_$]+\.[a-zA-Z_$][0-9a-zA-Z_$]+/,Gne=/^<(?:iframe|blockquote)[\s\S]*?\s(?:src|href)=["']([^"']*)["'][\s\S]*?>$/i,KC=/giphy.com\/(?:clips|embed|gifs)\/[a-zA-Z0-9]*?-?([a-zA-Z0-9]+)(?:[^a-zA-Z0-9]|$)/,QC=/^(?:http(?:s)?:\/\/)?(?:www\.)?reddit\.com\/r\/([a-zA-Z0-9_]+)\/comments\/([a-zA-Z0-9_]+)\/([a-zA-Z0-9_]+)\/?(?:\?[^#\s]*)?(?:#[^\s]*)?$/,qne=/^<blockquote[\s\S]*?\shref=["'](https?:\/\/(?:www\.)?reddit\.com\/[^"']*)/i,H3=new Set(["youtube.com","youtu.be","vimeo.com","player.vimeo.com","figma.com","link.excalidraw.com","gist.github.com","twitter.com","x.com","*.simplepdf.eu","stackblitz.com","val.town","giphy.com","reddit.com"]),JC=new Set(["youtube.com","youtu.be","vimeo.com","player.vimeo.com","figma.com","twitter.com","x.com","*.simplepdf.eu","stackblitz.com","reddit.com"]),Rp=e=>`<html><body>${e}</body></html>`,Bu=e=>{if(!e)return null;if(Ss.has(e))return Ss.get(e);let t=e,n=JC.has(W3(e,JC)||""),r="generic",i={w:560,h:840},a=e.match(zne);if(a!=null&&a[2]){let c=a[3]?`&start=${a[3]}`:"",d=e.includes("shorts");switch(r="video",a[1]){case"embed/":case"watch?v=":case"shorts/":e=`https://www.youtube.com/embed/${a[2]}?enablejsapi=1${c}`;break;case"playlist?list=":case"embed/videoseries?list=":e=`https://www.youtube.com/embed/videoseries?list=${a[2]}&enablejsapi=1${c}`;break;default:e=`https://www.youtube.com/embed/${a[2]}?enablejsapi=1${c}`;break}return i=d?{w:315,h:560}:{w:560,h:315},Ss.set(t,{link:e,intrinsicSize:i,type:r,sandbox:{allowSameOrigin:n}}),{link:e,intrinsicSize:i,type:r,sandbox:{allowSameOrigin:n}}}let s=e.match(Hne);if(s!=null&&s[1]){let c=s==null?void 0:s[1],d=/^\d+$/.test(c)?void 0:new URIError("Invalid embed link format");return r="video",e=`https://player.vimeo.com/video/${c}?api=1`,i={w:560,h:315},Ss.set(t,{link:e,intrinsicSize:i,type:r,sandbox:{allowSameOrigin:n}}),{link:e,intrinsicSize:i,type:r,error:d,sandbox:{allowSameOrigin:n}}}if(e.match(Wne))return r="generic",e=`https://www.figma.com/embed?embed_host=share&url=${encodeURIComponent(e)}`,i={w:550,h:550},Ss.set(t,{link:e,intrinsicSize:i,type:r,sandbox:{allowSameOrigin:n}}),{link:e,intrinsicSize:i,type:r,sandbox:{allowSameOrigin:n}};let o=e.match(Yne);if(o)return e=o[1]==="embed"?o[0]:o[0].replace("/v","/embed"),Ss.set(t,{link:e,intrinsicSize:i,type:r,sandbox:{allowSameOrigin:n}}),{link:e,intrinsicSize:i,type:r,sandbox:{allowSameOrigin:n}};if(ZC.test(e)){let c=e.match(ZC)[1],d=gg(`https://twitter.com/x/status/${c}`),l={type:"document",srcdoc:h=>Rp(`<blockquote class="twitter-tweet" data-dnt="true" data-theme="${h}"><a href="${d}"></a></blockquote> <script async src="https://platform.twitter.com/widgets.js" charset="utf-8"><\/script>`),intrinsicSize:{w:480,h:480},sandbox:{allowSameOrigin:n}};return Ss.set(t,l),l}if(QC.test(e)){let[,c,d,l]=e.match(QC),h=gg(`https://reddit.com/r/${c}/comments/${d}/${l}`),f={type:"document",srcdoc:g=>Rp(`<blockquote class="reddit-embed-bq" data-embed-theme="${g}"><a href="${h}"></a><br></blockquote><script async="" src="https://embed.reddit.com/widgets.js" charset="UTF-8"><\/script>`),intrinsicSize:{w:480,h:480},sandbox:{allowSameOrigin:n}};return Ss.set(t,f),f}if(qC.test(e)){let[,c,d]=e.match(qC),l=gg(`https://gist.github.com/${c}/${d}`),h={type:"document",srcdoc:()=>Rp(`
68
- <script src="${l}.js"><\/script>
69
- <style type="text/css">
70
- * { margin: 0px; }
71
- table, .gist { height: 100%; }
72
- .gist .gist-file { height: calc(100vh - 2px); padding: 0px; display: grid; grid-template-rows: 1fr auto; }
73
- </style>
74
- `),intrinsicSize:{w:550,h:720},sandbox:{allowSameOrigin:n}};return Ss.set(e,h),h}return Ss.set(e,{link:e,intrinsicSize:i,type:r,sandbox:{allowSameOrigin:n}}),{link:e,intrinsicSize:i,type:r,sandbox:{allowSameOrigin:n}}},gL=e=>{let t;Yl(e)?t="IFrame element":t=!e.link||(e==null?void 0:e.link)===""?"Empty Web-Embed":e.link;let n=Math.max(Math.min(e.width/2,e.width/t.length),e.width/30),r=un.Helvetica,i=Bt({fontSize:n,fontFamily:r});return Oi({x:e.x+e.width/2,y:e.y+e.height/2,strokeColor:e.strokeColor!=="transparent"?e.strokeColor:"black",backgroundColor:"transparent",fontFamily:r,fontSize:n,text:zd(t,i,e.width-20),textAlign:"center",verticalAlign:ji.MIDDLE,angle:e.angle??0})};Te({name:"setEmbeddableAsActiveTool",trackEvent:{category:"toolbar"},target:"Tool",label:"toolBar.embeddable",perform:(e,t,n,r)=>{let i=Pn(t,{type:"embeddable"});return Ts(r.canvas,{...t,activeTool:i}),{elements:e,appState:{...t,activeTool:Pn(t,{type:"embeddable"})},captureUpdate:le.EVENTUALLY}}});var W3=(e,t)=>{try{let{hostname:n}=new URL(e),r=n.replace(/^www\./,"");if(t instanceof Set){if(H3.has(r))return r;let a=r.replace(/^([^.]+)/,"*");return H3.has(a)?a:null}let i=t.replace(/^www\./,"");if(r===i)return i}catch{}return null},Zne=e=>{let t=e.match(Vne);if(t&&t.length===2)return t[1];let n=e.match(qne);if(n&&n.length===2)return n[1];let r=e.match(Xne);if(r&&r.length===2)return r[1];if(KC.test(e))return`https://giphy.com/embed/${KC.exec(e)[1]}`;let i=e.match(Gne);return i&&i.length===2?i[1]:e},Eg=(e,t)=>{if(!e)return!1;if(t!=null)if(typeof t=="function"){let n=t(e);if(typeof n=="boolean")return n}else{if(typeof t=="boolean")return t;if(t instanceof RegExp)return t.test(e);if(Array.isArray(t)){for(let n of t)if(n instanceof RegExp){if(e.match(n))return!0}else if(W3(e,n))return!0;return!1}}return!!W3(e,H3)},zf=(e,t,n)=>{let r={sets:t.sets,shape:t.shape,options:{...t.options,fixedDecimalPlaceDigits:n}};return e.draw(r)},Hf=(e,t,n,r,i)=>{if(!r.enabled||!r.clip)return null;let a=bi(e,i);if(a){let s=t.ownerDocument.createElementNS(Tt,"g");return s.setAttributeNS(Tt,"clip-path",`url(#${a.id})`),n.forEach(o=>s.appendChild(o)),s}return null},Cg=(e,t,n,r,i,a,s,o)=>{var C;let c={x:a,y:s},[d,l,h,f]=lt(e,t),g=(h-d)/2-(e.x-d),U=(f-l)/2-(e.y-l);if(Le(e)){let S=ur(e,t);if(Ut(S)){let[k,M,T,R]=lt(S,t),j=Re.getBoundTextElementPosition(S,e,t);g=(T-k)/2-(j.x-k),U=(R-M)/2-(j.y-M),a=a+j.x-e.x,s=s+j.y-e.y}}let y=180*e.angle/Math.PI,v=r;if(e.link){let S=r.ownerDocument.createElementNS(Tt,"a");S.setAttribute("href",Ui(e.link)),v.appendChild(S),v=S}let x=(S,k)=>{Go()&&S.setAttribute("data-id",k.id),v.appendChild(S)},w=(((C=bi(e,t))==null?void 0:C.opacity)??100)*e.opacity/1e4;switch(e.type){case"selection":throw new Error("Selection rendering is not supported for SVG");case"rectangle":case"diamond":case"ellipse":{let S=yn.generateElementShape(e,null),k=zf(n,S,Ff);w!==1&&(k.setAttribute("stroke-opacity",`${w}`),k.setAttribute("fill-opacity",`${w}`)),k.setAttribute("stroke-linecap","round"),k.setAttribute("transform",`translate(${a||0} ${s||0}) rotate(${y} ${g} ${U})`);let M=Hf(e,v,[k],o.frameRendering,t);x(M||k,e);break}case"iframe":case"embeddable":{let S=yn.generateElementShape(e,o),k=zf(n,S,Ff),M=e.opacity/100;M!==1&&(k.setAttribute("stroke-opacity",`${M}`),k.setAttribute("fill-opacity",`${M}`)),k.setAttribute("stroke-linecap","round"),k.setAttribute("transform",`translate(${a||0} ${s||0}) rotate(${y} ${g} ${U})`),x(k,e);let T=gL(e);Cg(T,t,n,v,i,T.x+c.x-e.x,T.y+c.y-e.y,o);let R=zf(n,S,Ff);for(R.setAttribute("stroke-linecap","round"),R.setAttribute("transform",`translate(${a||0} ${s||0}) rotate(${y} ${g} ${U})`);R.firstChild;)R.removeChild(R.firstChild);let j=Ja(Math.min(e.width,e.height),e),P=Bu(iL(e.link||""));if(o.renderEmbeddables===!1||(P==null?void 0:P.type)==="document"){let N=r.ownerDocument.createElementNS(Tt,"a");N.setAttribute("href",Ui(e.link||"")),N.setAttribute("target","_blank"),N.setAttribute("rel","noopener noreferrer"),N.style.borderRadius=`${j}px`,R.appendChild(N)}else{let N=r.ownerDocument.createElementNS(Tt,"foreignObject");N.style.width=`${e.width}px`,N.style.height=`${e.height}px`,N.style.border="none";let F=N.ownerDocument.createElementNS(Tt,"div");F.setAttribute("xmlns","http://www.w3.org/1999/xhtml"),F.style.width="100%",F.style.height="100%";let $=F.ownerDocument.createElement("iframe");$.src=(P==null?void 0:P.link)??"",$.style.width="100%",$.style.height="100%",$.style.border="none",$.style.borderRadius=`${j}px`,$.style.top="0",$.style.left="0",$.allowFullscreen=!0,F.appendChild($),N.appendChild(F),R.appendChild(N)}x(R,e);break}case"line":case"arrow":{let S=pt(e,t),k=r.ownerDocument.createElementNS(Tt,"mask");if(S){k.setAttribute("id",`mask-${e.id}`);let R=r.ownerDocument.createElementNS(Tt,"rect");a=a||0,s=s||0,R.setAttribute("x","0"),R.setAttribute("y","0"),R.setAttribute("fill","#fff"),R.setAttribute("width",`${e.width+100+a}`),R.setAttribute("height",`${e.height+100+s}`),k.appendChild(R);let j=r.ownerDocument.createElementNS(Tt,"rect"),P=Re.getBoundTextElementPosition(e,S,t),N=a+P.x-e.x,F=s+P.y-e.y;j.setAttribute("x",N.toString()),j.setAttribute("y",F.toString()),j.setAttribute("fill","#000"),j.setAttribute("width",`${S.width}`),j.setAttribute("height",`${S.height}`),j.setAttribute("opacity","1"),k.appendChild(j)}let M=r.ownerDocument.createElementNS(Tt,"g");S&&M.setAttribute("mask",`url(#mask-${e.id})`),M.setAttribute("stroke-linecap","round"),yn.generateElementShape(e,o).forEach(R=>{let j=zf(n,R,Ff);w!==1&&(j.setAttribute("stroke-opacity",`${w}`),j.setAttribute("fill-opacity",`${w}`)),j.setAttribute("transform",`translate(${a||0} ${s||0}) rotate(${y} ${g} ${U})`),e.type==="line"&&qo(e.points)&&e.backgroundColor!=="transparent"&&j.setAttribute("fill-rule","evenodd"),M.appendChild(j)});let T=Hf(e,v,[M,k],o.frameRendering,t);T?(x(T,e),v.appendChild(T)):(x(M,e),v.append(k));break}case"freedraw":{let S=yn.generateElementShape(e,o),k=S?zf(n,S,Ff):r.ownerDocument.createElementNS(Tt,"g");w!==1&&(k.setAttribute("stroke-opacity",`${w}`),k.setAttribute("fill-opacity",`${w}`)),k.setAttribute("transform",`translate(${a||0} ${s||0}) rotate(${y} ${g} ${U})`),k.setAttribute("stroke","none");let M=r.ownerDocument.createElementNS(Tt,"path");M.setAttribute("fill",e.strokeColor),M.setAttribute("d",Lv(e)),k.appendChild(M);let T=Hf(e,v,[k],o.frameRendering,t);x(T||k,e);break}case"image":{let S=Math.round(e.width),k=Math.round(e.height),M=aa(e)&&i[e.fileId];if(M){let{reuseImages:T=!0}=o,R=`image-${M.id}`,j=e.width,P=e.height;e.crop&&({width:j,height:P}=Zo(e),R=`image-crop-${M.id}-${rR(`${j}x${P}`)}`),T||(R=`image-${e.id}`);let N=r.querySelector(`#${R}`);if(!N){N=r.ownerDocument.createElementNS(Tt,"symbol"),N.id=R;let Y=r.ownerDocument.createElementNS(Tt,"image");Y.setAttribute("href",M.dataURL),Y.setAttribute("preserveAspectRatio","none"),e.crop||!T?(Y.setAttribute("width",`${j}`),Y.setAttribute("height",`${P}`)):(Y.setAttribute("width","100%"),Y.setAttribute("height","100%")),N.appendChild(Y),(v.querySelector("defs")||v).prepend(N)}let F=r.ownerDocument.createElementNS(Tt,"use");F.setAttribute("href",`#${R}`),o.exportWithDarkMode&&M.mimeType!==We.svg&&F.setAttribute("filter",SA);let $=0,q=0;if(e.crop){let{width:Y,height:K}=Zo(e);$=e.crop.x/(e.crop.naturalWidth/Y),q=e.crop.y/(e.crop.naturalHeight/K)}let W=g+$,V=U+q;F.setAttribute("width",`${S+$}`),F.setAttribute("height",`${k+q}`),F.setAttribute("opacity",`${w}`),(e.scale[0]!==1||e.scale[1]!==1)&&F.setAttribute("transform",`translate(${W} ${V}) scale(${e.scale[0]} ${e.scale[1]}) translate(${-W} ${-V})`);let B=r.ownerDocument.createElementNS(Tt,"g");if(e.crop){let Y=r.ownerDocument.createElementNS(Tt,"mask");Y.setAttribute("id",`mask-image-crop-${e.id}`),Y.setAttribute("fill","#fff");let K=r.ownerDocument.createElementNS(Tt,"rect");K.setAttribute("x",`${$}`),K.setAttribute("y",`${q}`),K.setAttribute("width",`${S}`),K.setAttribute("height",`${k}`),Y.appendChild(K),v.appendChild(Y),B.setAttribute("mask",`url(#${Y.id})`)}if(B.appendChild(F),B.setAttribute("transform",`translate(${a-$} ${s-q}) rotate(${y} ${W} ${V})`),e.roundness){let Y=r.ownerDocument.createElementNS(Tt,"clipPath");Y.id=`image-clipPath-${e.id}`;let K=r.ownerDocument.createElementNS(Tt,"rect"),G=Ja(Math.min(e.width,e.height),e);K.setAttribute("width",`${e.width}`),K.setAttribute("height",`${e.height}`),K.setAttribute("rx",`${G}`),K.setAttribute("ry",`${G}`),Y.appendChild(K),x(Y,e),B.setAttributeNS(Tt,"clip-path",`url(#${Y.id})`)}let z=Hf(e,v,[B],o.frameRendering,t);x(z||B,e)}break}case"frame":case"magicframe":{if(o.frameRendering.enabled&&o.frameRendering.outline){let S=document.createElementNS(Tt,"rect");S.setAttribute("transform",`translate(${a||0} ${s||0}) rotate(${y} ${g} ${U})`),S.setAttribute("width",`${e.width}px`),S.setAttribute("height",`${e.height}px`),S.setAttribute("rx",Un.radius.toString()),S.setAttribute("ry",Un.radius.toString()),S.setAttribute("fill","none"),S.setAttribute("stroke",Un.strokeColor),S.setAttribute("stroke-width",Un.strokeWidth.toString()),x(S,e)}break}default:if(Le(e)){let S=r.ownerDocument.createElementNS(Tt,"g");w!==1&&(S.setAttribute("stroke-opacity",`${w}`),S.setAttribute("fill-opacity",`${w}`)),S.setAttribute("transform",`translate(${a||0} ${s||0}) rotate(${y} ${g} ${U})`);let k=e.text.replace(/\r\n?/g,`
75
- `).split(`
76
- `),M=X1(e.fontSize,e.lineHeight),T=e.textAlign==="center"?e.width/2:e.textAlign==="right"?e.width:0,R=hA(e.fontFamily,e.fontSize,M),j=MI(e.text)?"rtl":"ltr",P=e.textAlign==="center"?"middle":e.textAlign==="right"||j==="rtl"?"end":"start";for(let F=0;F<k.length;F++){let $=r.ownerDocument.createElementNS(Tt,"text");$.textContent=k[F],$.setAttribute("x",`${T}`),$.setAttribute("y",`${F*M+R}`),$.setAttribute("font-family",dh(e)),$.setAttribute("font-size",`${e.fontSize}px`),$.setAttribute("fill",e.strokeColor),$.setAttribute("text-anchor",P),$.setAttribute("style","white-space: pre;"),$.setAttribute("direction",j),$.setAttribute("dominant-baseline","alphabetic"),S.appendChild($)}let N=Hf(e,v,[S],o.frameRendering,t);x(N||S,e)}else throw new Error(`Unimplemented type ${e.type}`)}},Kne=(e,t,n,r,i,a)=>{r&&(e.filter(s=>!sa(s)).forEach(s=>{if(!s.isDeleted){if(Le(s)&&s.containerId&&t.has(s.containerId))return;try{Cg(s,t,n,r,i,s.x+a.offsetX,s.y+a.offsetY,a);let o=pt(s,t);o&&Cg(o,t,n,r,i,o.x+a.offsetX,o.y+a.offsetY,a)}catch(o){console.error(o)}}}),e.filter(s=>sa(s)).forEach(s=>{if(!s.isDeleted)try{Cg(s,t,n,r,i,s.x+a.offsetX,s.y+a.offsetY,a)}catch(o){console.error(o)}}))},eS=500,zv=e=>{var r,i;let t=(r=e.extensions)==null?void 0:r.reduce((a,s)=>(a.push(We[s]),a),[]),n=(i=e.extensions)==null?void 0:i.reduce((a,s)=>s==="jpg"?a.concat(".jpg",".jpeg"):a.concat(`.${s}`),[]);return MV({description:e.description,extensions:n,mimeTypes:t,multiple:e.multiple??!1,legacySetup:(a,s,o)=>{let c=uh(s,eS),d=()=>{l(),document.addEventListener("keyup",c),document.addEventListener("pointerup",c),c()},l=()=>{var f;if((f=o.files)!=null&&f.length){let g=e.multiple?[...o.files]:o.files[0];a(g)}};requestAnimationFrame(()=>{window.addEventListener("focus",d)});let h=window.setInterval(()=>{l()},eS);return f=>{clearInterval(h),c.cancel(),window.removeEventListener("focus",d),document.removeEventListener("keyup",c),document.removeEventListener("pointerup",c),f&&(console.warn("Opening the file was canceled (legacy-fs)."),f(new kU))}}})},w2=(e,t)=>AV(e,{fileName:`${t.name}.${t.extension}`,description:t.description,extensions:[`.${t.extension}`],mimeTypes:t.mimeTypes},t.fileHandle),Qne=(e,t)=>{let n={};for(let r of e)!r.isDeleted&&"fileId"in r&&r.fileId&&t[r.fileId]&&(n[r.fileId]=t[r.fileId]);return n},q1=(e,t,n,r)=>{let i={type:da.excalidraw,version:vU.excalidraw,source:dv,elements:iR(e),appState:CI(t),files:Qne(e,n)};return JSON.stringify(i,null,2)},UL=async(e,t,n,r=t.name||xI)=>{let i=q1(e,t,n),a=new Blob([i],{type:We.excalidraw});return{fileHandle:await w2(a,{name:r,extension:"excalidraw",description:"Excalidraw file",fileHandle:g7(t.fileHandle)?null:t.fileHandle})}},Jne=async(e,t)=>{let n=await zv({description:"Excalidraw files"});return b7(await y7(n),e,t,n.handle)},ere=e=>(e==null?void 0:e.type)===da.excalidraw&&(!e.elements||Array.isArray(e.elements)&&(!e.appState||typeof e.appState=="object")),bL=e=>typeof e=="object"&&e&&e.type===da.excalidrawLibrary&&(e.version===1||e.version===2),Hv=e=>{let t={type:da.excalidrawLibrary,version:vU.excalidrawLibrary,source:dv,libraryItems:e};return JSON.stringify(t,null,2)},tre=async e=>{let t=Hv(e);await w2(new Blob([t],{type:We.excalidrawlib}),{name:"library",extension:"excalidrawlib",description:"Excalidraw library file"})},yL=e=>new Promise((t,n)=>{let r=new Image;r.onload=()=>{t(r)},r.onerror=i=>{n(i)},r.src=e}),vL=async({fileIds:e,files:t,imageCache:n})=>{let r=new Map,i=new Map;return await Promise.all(e.reduce((a,s)=>{let o=t[s];return o&&!r.has(s)?(r.set(s,!0),a.concat((async()=>{try{if(o.mimeType===We.binary)throw new Error("Only images can be added to ImageCache");let c=yL(o.dataURL),d={image:c,mimeType:o.mimeType};n.set(s,d);let l=await c;n.set(s,{...d,image:l})}catch{i.set(s,!0)}})())):a},[])),{imageCache:n,updatedFiles:r,erroredFiles:i}},xL=e=>e.filter(t=>aa(t)),nre=e=>(e==null?void 0:e.nodeName.toLowerCase())==="svg",tS=e=>{let t=new DOMParser().parseFromString(e,We.svg),n=t.querySelector("svg");if(t.querySelector("parsererror")||!nre(n))throw new Error("Invalid SVG");{n.hasAttribute("xmlns")||n.setAttribute("xmlns",Tt);let r=n.getAttribute("width"),i=n.getAttribute("height");(r!=null&&r.includes("%")||r==="auto")&&(r=null),(i!=null&&i.includes("%")||i==="auto")&&(i=null);let a=n.getAttribute("viewBox");if(!r||!i){if(r=r||"50",i=i||"50",a){let s=a.match(/\d+ +\d+ +(\d+(?:\.\d+)?) +(\d+(?:\.\d+)?)/);s&&([,r,i]=s)}n.setAttribute("width",r),n.setAttribute("height",i)}return a||n.setAttribute("viewBox",`0 0 ${r} ${i}`),n.outerHTML}},wL=document.createElement("img");wL.src=`data:${We.svg}, ${encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="#1971c2" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-external-link"><path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"></path><polyline points="15 3 21 3 21 9"></polyline><line x1="10" y1="14" x2="21" y2="3"></line></svg>')}`;var EL=document.createElement("img");EL.src=`data:${We.svg}, ${encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="#1971c2" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-tabler icons-tabler-outline icon-tabler-arrow-big-right-line"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M12 9v-3.586a1 1 0 0 1 1.707 -.707l6.586 6.586a1 1 0 0 1 0 1.414l-6.586 6.586a1 1 0 0 1 -1.707 -.707v-3.586h-6v-6h6z" /><path d="M3 9v6" /></svg>')}`;var Wv=([e,t,n,r],i,a)=>{let s=cte,o=s/a.zoom.value,c=s/a.zoom.value,d=s/a.zoom.value,l=(e+n)/2,h=(t+r)/2,f=(s-8)/(2*a.zoom.value),g=4/a.zoom.value,U=n+g-f,y=t-g-d+f,[v,x]=he(A(U+o/2,y+c/2),A(l,h),i);return[v-o/2,x-c/2,o,c]},CL=(e,t,n,[r,i])=>{let a=4/n.zoom.value,[s,o,c,d]=lt(e,t),[l,h,f,g]=Wv([s,o,c,d],e.angle,n);return r>l-a&&r<l+a+f&&i>h-a&&i<h+g+a},ty=(e,t,n,[r,i],a)=>!e.link||n.selectedElementIds[e.id]?!1:!a&&n.viewModeEnabled&&Iv(r,i,e,t)?!0:CL(e,t,n,A(r,i)),FU=(e,t,n,r,i=!0)=>{e.beginPath(),e.arc(t,n,r,0,Math.PI*2),e.fill(),i&&e.stroke()},Xv=(e,t)=>[e.width/t,e.height/t],Vv=({canvas:e,scale:t,normalizedWidth:n,normalizedHeight:r,theme:i,isExporting:a,viewBackgroundColor:s})=>{let o=e.getContext("2d");return o.setTransform(1,0,0,1,0,0),o.scale(t,t),a&&i===wt.DARK&&(o.filter=fv),typeof s=="string"?((s==="transparent"||s.length===5||s.length===9||/(hsla|rgba)\(/.test(s))&&o.clearRect(0,0,n,r),o.save(),o.fillStyle=s,o.fillRect(0,0,n,r),o.restore()):o.clearRect(0,0,n,r),o},SL=(e,t)=>{let n=window.location.href;try{let r=new URL(n);return r.searchParams.set(r2,e),Ui(r.toString())}catch(r){console.error(r)}return Ui(n)},_L=(e,t)=>{if(e.length>0&&E2(e)){if(e.length===1)return{id:e[0].id,type:"element"};if(e.length>1){let n=Object.keys(t.selectedGroupIds)[0];return n?{id:n,type:"group"}:{id:e[0].groupIds[0],type:"group"}}}return null},E2=e=>!!(e.length===1||e.length>1&&QA(e)),qu=e=>{try{let t=new URL(e);return t.searchParams.has(r2)&&t.host===window.location.host}catch{return!1}},rre=e=>{try{let{searchParams:t}=new URL(e);if(t.has(r2))return t.get(r2)}catch{}return null},jm={Bold:"#dddddd",Regular:"#e5e5e5"},ire=(e,t,n,r,i,a,s,o)=>{let c=r%t-t,d=i%t-t,l=t*a.value,h=1/a.value;e.save(),a.value===1&&e.translate(c%1?0:.5,d%1?0:.5);for(let f=c;f<c+s+t*2;f+=t){let g=n>1&&Math.round(f-r)%(n*t)===0;if(!g&&l<10)continue;let U=Math.min(1/a.value,g?4:1);e.lineWidth=U;let y=[U*3,h+(U+h)];e.beginPath(),e.setLineDash(g?[]:y),e.strokeStyle=g?jm.Bold:jm.Regular,e.moveTo(f,d-t),e.lineTo(f,Math.ceil(d+o+t*2)),e.stroke()}for(let f=d;f<d+o+t*2;f+=t){let g=n>1&&Math.round(f-i)%(n*t)===0;if(!g&&l<10)continue;let U=Math.min(1/a.value,g?4:1);e.lineWidth=U;let y=[U*3,h+(U+h)];e.beginPath(),e.setLineDash(g?[]:y),e.strokeStyle=g?jm.Bold:jm.Regular,e.moveTo(c-t,f),e.lineTo(Math.ceil(c+s+t*2),f),e.stroke()}e.restore()},nS=(e,t,n,r)=>{t.translate(e.x+r.scrollX,e.y+r.scrollY),t.beginPath(),t.roundRect?t.roundRect(0,0,e.width,e.height,Un.radius/r.zoom.value):t.rect(0,0,e.width,e.height),t.clip(),t.translate(-(e.x+r.scrollX),-(e.y+r.scrollY))},rS={regularLink:null,elementLink:null},iS=(e,t,n,r)=>{if(e.link&&!n.selectedElementIds[e.id]){let[i,a,s,o]=lt(e,r),[c,d,l,h]=Wv([i,a,s,o],e.angle,n),f=c+l/2,g=d+h/2;t.save(),t.translate(n.scrollX+f,n.scrollY+g),t.rotate(e.angle);let U=qu(e.link)?"elementLink":"regularLink",y=rS[U];if(!y||y.zoom!==n.zoom.value){y=Object.assign(document.createElement("canvas"),{zoom:n.zoom.value}),y.width=l*window.devicePixelRatio*n.zoom.value,y.height=h*window.devicePixelRatio*n.zoom.value,rS[U]=y;let v=y.getContext("2d");v.scale(window.devicePixelRatio*n.zoom.value,window.devicePixelRatio*n.zoom.value),v.fillStyle="#fff",v.fillRect(0,0,l,h),U==="elementLink"?v.drawImage(EL,0,0,l,h):v.drawImage(wL,0,0,l,h),v.restore()}t.drawImage(y,c-f,d-g,l,h),t.restore()}},kL=({canvas:e,rc:t,elementsMap:n,allElementsMap:r,visibleElements:i,scale:a,appState:s,renderConfig:o})=>{var y;if(e===null)return;let{renderGrid:c=!0,isExporting:d}=o,[l,h]=Xv(e,a),f=Vv({canvas:e,scale:a,normalizedWidth:l,normalizedHeight:h,theme:s.theme,isExporting:d,viewBackgroundColor:s.viewBackgroundColor});f.scale(s.zoom.value,s.zoom.value),c&&ire(f,s.gridSize,s.gridStep,s.scrollX,s.scrollY,s.zoom,l/s.zoom.value,h/s.zoom.value);let g=new Set;i.forEach(v=>{v.groupIds.length>0&&s.frameToHighlight&&s.selectedElementIds[v.id]&&(pc(v,s.frameToHighlight,n)||v.groupIds.find(x=>g.has(x)))&&v.groupIds.forEach(x=>g.add(x))});let U=new Map;i.filter(v=>!sa(v)).forEach(v=>{var x;try{let w=v.frameId||((x=s.frameToHighlight)==null?void 0:x.id);if(Le(v)&&v.containerId&&n.has(v.containerId))return;if(f.save(),w&&s.frameRendering.enabled&&s.frameRendering.clip){let S=X3(v,n,s);S&&bS(v,S,s,n,U)&&nS(S,f,o,s),Yc(v,n,r,t,f,o,s)}else Yc(v,n,r,t,f,o,s);let C=pt(v,n);C&&Yc(C,n,r,t,f,o,s),f.restore(),d||iS(v,f,s,n)}catch(w){console.error(w,v.id,v.x,v.y,v.width,v.height)}}),i.filter(v=>sa(v)).forEach(v=>{var x;try{let w=()=>{if(Yc(v,n,r,t,f,o,s),sa(v)&&(d||li(v)&&o.embedsValidationStatus.get(v.id)!==!0)&&v.width&&v.height){let C=gL(v);Yc(C,n,r,t,f,o,s)}d||iS(v,f,s,n)};if((v.frameId||(x=s.frameToHighlight)!=null&&x.id)&&s.frameRendering.enabled&&s.frameRendering.clip){f.save();let C=X3(v,n,s);C&&bS(v,C,s,n,U)&&nS(C,f,o,s),w(),f.restore()}else w()}catch(w){console.error(w)}}),(y=o.pendingFlowchartNodes)==null||y.forEach(v=>{try{Yc(v,n,r,t,f,o,s)}catch(x){console.error(x)}})},TL=xU(e=>{kL(e)},{trailing:!0}),ML=(e,t)=>{if(t){TL(e);return}kL(e)},are=(e,t)=>{if(e.width<=t)return e;let n=document.createElement("canvas").getContext("2d");n.font=Bt({fontFamily:e.fontFamily,fontSize:e.fontSize});let r=e.text;if(n.measureText(r).width>t)for(let i=r.length;i>0;i--){let a=`${r.slice(0,i)}...`;if(n.measureText(a).width<=t){r=a;break}}return ct(e,{text:r,width:t})},sre=(e,t)=>{let n=[];for(let r of e){if(tt(r)){let i=Oi({x:r.x,y:r.y-Un.nameOffsetY,fontFamily:un.Helvetica,fontSize:Un.nameFontSize,lineHeight:Un.nameLineHeight,strokeColor:t.exportWithDarkMode?Un.nameColorDarkTheme:Un.nameColorLightTheme,text:YL(r)});i.y-=i.height,i=are(i,r.width),n.push(i)}n.push(r)}return n},IL=(e,t)=>(t=t||Vs().frameRendering,{enabled:e?!0:t.enabled,outline:e?!1:t.outline,name:e?!1:t.name,clip:e?!0:t.clip}),AL=({elements:e,exportingFrame:t,frameRendering:n,exportWithDarkMode:r})=>{let i;return t?i=l7(e,t):n.enabled&&n.name?i=sre(e,{exportWithDarkMode:r}):i=e,i},LL=async(e,t,n,{exportBackground:r,exportPadding:i=Oh,viewBackgroundColor:a,exportingFrame:s},o=(d,l)=>{let h=document.createElement("canvas");return h.width=d*t.exportScale,h.height=l*t.exportScale,{canvas:h,scale:t.exportScale}},c=async()=>{await Wo.loadElementsFonts(e)})=>{await c();let d=IL(s??null,t.frameRendering??null);s&&(d.clip=!1);let l=AL({elements:e,exportingFrame:s,exportWithDarkMode:t.exportWithDarkMode,frameRendering:d});s&&(i=0);let[h,f,g,U]=Gv(s?[s]:o7(l),i),{canvas:y,scale:v=1}=o(g,U),x=Vs(),{imageCache:w}=await vL({imageCache:new Map,fileIds:xL(l).map(C=>C.fileId),files:n});return ML({canvas:y,rc:vc.canvas(y),elementsMap:fa(nt(l)),allElementsMap:fa(nt(Jo(e))),visibleElements:l,scale:v,appState:{...t,frameRendering:d,viewBackgroundColor:r?a:null,scrollX:-h+i,scrollY:-f+i,zoom:x.zoom,shouldCacheIgnoreZoom:!1,theme:t.exportWithDarkMode?wt.DARK:wt.LIGHT},renderConfig:{canvasBackgroundColor:a,imageCache:w,renderGrid:!1,isExporting:!0,embedsValidationStatus:new Map,elementsPendingErasure:new Set,pendingFlowchartNodes:null}}),y},fp=e=>document.createComment(` ${e} `),Yv=async(e,t,n,r)=>{let i=IL((r==null?void 0:r.exportingFrame)??null,t.frameRendering??null),{exportPadding:a=Oh,exportWithDarkMode:s=!1,viewBackgroundColor:o,exportScale:c=1,exportEmbedScene:d}=t,{exportingFrame:l=null}=r||{},h=AL({elements:e,exportingFrame:l,exportWithDarkMode:s,frameRendering:i});l&&(a=0);let[f,g,U,y]=Gv(l?[l]:o7(h),a),v=-f+a,x=-g+a,w=document.createElementNS(Tt,"svg");w.setAttribute("version","1.1"),w.setAttribute("xmlns",Tt),w.setAttribute("viewBox",`0 0 ${U} ${y}`),w.setAttribute("width",`${U*c}`),w.setAttribute("height",`${y*c}`),s&&w.setAttribute("filter",fv);let C=w.ownerDocument.createElementNS(Tt,"defs"),S=w.ownerDocument.createElementNS(Tt,"metadata");if(w.appendChild(fp("svg-source:excalidraw")),w.appendChild(S),w.appendChild(C),d)try{ore({metadataElement:S,payload:q1(e,t,n||{},"local")})}catch(N){console.error(N)}let k=s7(e);if(k.length){let N=nt(e);for(let F of k){let $=w.ownerDocument.createElementNS(Tt,"clipPath");$.setAttribute("id",F.id);let[q,W,V,B]=lt(F,N),z=(V-q)/2-(F.x-q),Y=(B-W)/2-(F.y-W),K=w.ownerDocument.createElementNS(Tt,"rect");K.setAttribute("transform",`translate(${F.x+v} ${F.y+x}) rotate(${F.angle} ${z} ${Y})`),K.setAttribute("width",`${F.width}`),K.setAttribute("height",`${F.height}`),l||(K.setAttribute("rx",`${Un.radius}`),K.setAttribute("ry",`${Un.radius}`)),$.appendChild(K),C.appendChild($)}}let M=r!=null&&r.skipInliningFonts?[]:await Wo.generateFontFaceDeclarations(e),T=`
77
- `,R=w.ownerDocument.createElementNS(Tt,"style");if(R.classList.add("style-fonts"),R.appendChild(document.createTextNode(`${T}${M.join(T)}`)),C.appendChild(R),t.exportBackground&&o){let N=w.ownerDocument.createElementNS(Tt,"rect");N.setAttribute("x","0"),N.setAttribute("y","0"),N.setAttribute("width",`${U}`),N.setAttribute("height",`${y}`),N.setAttribute("fill",o),w.appendChild(N)}let j=vc.svg(w),P=(r==null?void 0:r.renderEmbeddables)??!1;return Kne(h,fa(nt(h)),j,w,n||{},{offsetX:v,offsetY:x,isExporting:!0,exportWithDarkMode:s,renderEmbeddables:P,frameRendering:i,canvasBackgroundColor:o,embedsValidationStatus:P?new Map(h.filter(N=>tt(N)).map(N=>[N.id,!0])):new Map,reuseImages:(r==null?void 0:r.reuseImages)??!0}),w},ore=({payload:e,metadataElement:t})=>{let n=hR(JSON.stringify(pR({text:e})),!0);t.appendChild(fp(`payload-type:${We.excalidraw}`)),t.appendChild(fp("payload-version:2")),t.appendChild(fp("payload-start")),t.appendChild(document.createTextNode(n)),t.appendChild(fp("payload-end"))},lre=({svg:e})=>{var t;if(e.includes(`payload-type:${We.excalidraw}`)){let n=e.match(/<!-- payload-start -->\s*(.+?)\s*<!-- payload-end -->/);if(!n)throw new Error("INVALID");let r=(((t=e.match(/<!-- payload-version:(\d+) -->/))==null?void 0:t[1])||"1")!=="1";try{let i=fR(n[1],r),a=JSON.parse(i);if(!("encoded"in a)){if("type"in a&&a.type===da.excalidraw)return i;throw new Error("FAILED")}return mR(a)}catch(i){throw console.error(i),new Error("FAILED")}}throw new Error("INVALID")},Gv=(e,t)=>{let[n,r,i,a]=Dt(e),s=Mr(n,i)+t*2,o=Mr(r,a)+t*2;return[n,r,s,o]},cre=(e,t,n)=>{let[,,r,i]=Gv(e,t).map(a=>Math.trunc(a*n));return[r,i]},dre=class{constructor(t){this.scoreFunction=t,H(this,"content",[])}sinkDown(t){let n=this.content[t];for(;t>0;){let r=(t+1>>1)-1,i=this.content[r];if(this.scoreFunction(n)<this.scoreFunction(i))this.content[r]=n,this.content[t]=i,t=r;else break}}bubbleUp(t){let n=this.content.length,r=this.content[t],i=this.scoreFunction(r);for(;;){let a=t+1<<1,s=a-1,o=null,c=0;if(s<n){let d=this.content[s];c=this.scoreFunction(d),c<i&&(o=s)}if(a<n){let d=this.content[a];this.scoreFunction(d)<(o===null?i:c)&&(o=a)}if(o!==null)this.content[t]=this.content[o],this.content[o]=r,t=o;else break}}push(t){this.content.push(t),this.sinkDown(this.content.length-1)}pop(){if(this.content.length===0)return null;let t=this.content[0],n=this.content.pop();return this.content.length>0&&(this.content[0]=n,this.bubbleUp(0)),t}remove(t){if(this.content.length===0)return;let n=this.content.indexOf(t),r=this.content.pop();n<this.content.length&&(this.content[n]=r,this.scoreFunction(r)<this.scoreFunction(t)?this.sinkDown(n):this.bubbleUp(n))}size(){return this.content.length}rescoreElement(t){this.sinkDown(this.content.indexOf(t))}},qv=1,Ft=40,ure=(e,t)=>{let n=e.fixedSegments?e.fixedSegments.slice():null;if(n){let r=[];e.points.map(s=>A(e.x+s[0],e.y+s[1])).forEach((s,o,c)=>{if(o<2)return r.push(s);let d=u1(s,c[o-1]),l=u1(c[o-1],c[o-2]);if(_n(d,l)){let h=(n==null?void 0:n.findIndex(g=>g.index===o-1))??-1,f=(n==null?void 0:n.findIndex(g=>g.index===o))??-1;f!==-1&&(n[f].start=A(c[o-2][0]-e.x,c[o-2][1]-e.y)),h!==-1&&n.splice(h,1),r.splice(-1,1),n.forEach(g=>{g.index>o-1&&(g.index-=1)})}return r.push(s)});let i=[];r.forEach((s,o,c)=>{if(o<3)return i.push(s);if(Rt(c[o-2],c[o-1])<qv){let d=(n==null?void 0:n.findIndex(f=>f.index===o-2))??-1,l=(n==null?void 0:n.findIndex(f=>f.index===o-1))??-1;l!==-1&&n.splice(l,1),d!==-1&&n.splice(d,1),i.splice(-2,2),n.forEach(f=>{f.index>o-2&&(f.index-=2)});let h=Oo(s,c[o-1]);return i.push(A(h?s[0]:c[o-2][0],h?c[o-2][1]:s[1]))}i.push(s)});let a=n.filter(s=>s.index!==1&&s.index!==i.length-1);return a.length===0?fc(Jv(e7(Qv(e,Kv(e,t,i.map(s=>A(s[0]-e.x,s[1]-e.y)),e.startBinding&&vh(e.startBinding.elementId,t),e.endBinding&&vh(e.endBinding.elementId,t)))??[])),a,null,null):(mt.DEV&&Dr(t7(i),"Invalid elbow points with fixed segments"),fc(i,a,e.startIsSpecial,e.endIsSpecial))}return{x:e.x,y:e.y,points:e.points,fixedSegments:e.fixedSegments,startIsSpecial:e.startIsSpecial,endIsSpecial:e.endIsSpecial}},hre=(e,t,n)=>{var R,j;let r=t.map(P=>P.index),i=(((R=e.fixedSegments)==null?void 0:R.map(P=>P.index))??[]).findIndex(P=>!r.includes(P));if(i===-1||!((j=e.fixedSegments)!=null&&j[i]))return{points:e.points};let a=e.fixedSegments[i].index,s=e.fixedSegments[i-1],o=e.fixedSegments[i+1],c=e.x+(s?s.end[0]:0),d=e.y+(s?s.end[1]:0),l=s?null:e.startBinding,h=o?null:e.endBinding,{startHeading:f,endHeading:g,startGlobalPoint:U,endGlobalPoint:y,hoveredStartElement:v,hoveredEndElement:x,...w}=Kv({x:c,y:d,startBinding:l,endBinding:h,startArrowhead:null,endArrowhead:null,points:e.points},n,[A(0,0),A(e.x+((o==null?void 0:o.start[0])??e.points[e.points.length-1][0])-c,e.y+((o==null?void 0:o.start[1])??e.points[e.points.length-1][1])-d)],l&&vh(l.elementId,n),h&&vh(h.elementId,n),{isDragging:!1}),{points:C}=fc(Jv(e7(Qv(e,{startHeading:f,endHeading:g,startGlobalPoint:U,endGlobalPoint:y,hoveredEndElement:x,...w})??[])),t,null,null),S=[];if(s)for(let P=0;P<s.index;P++)S.push(A(e.x+e.points[P][0],e.y+e.points[P][1]));if(C.forEach(P=>{S.push(A(e.x+(s?s.end[0]:0)+P[0],e.y+(s?s.end[1]:0)+P[1]))}),o)for(let P=o.index;P<e.points.length;P++)S.push(A(e.x+e.points[P][0],e.y+e.points[P][1]));let k=((o==null?void 0:o.index)??e.points.length)-((s==null?void 0:s.index)??0)-1,M=t.map(P=>P.index>a?{...P,index:P.index-k+(C.length-1)}:P),T=S.flatMap((P,N)=>{let F=S[N-1],$=S[N+1];if(F&&$){let q=u1(P,F),W=u1($,P);if(_n(q,W))return M.forEach(V=>{V.index>N&&(V.index-=1)}),[];if(_n(q,DA(W)))return M.forEach(V=>{V.index>N&&(V.index+=1)}),[P,P]}return[P]});return fc(T,M,!1,!1)},fre=(e,t,n,r,i,a)=>{var k,M;let s=t.map((T,R)=>e.fixedSegments==null||e.fixedSegments[R]===void 0||e.fixedSegments[R].index!==T.index||(T.start[0]!==e.fixedSegments[R].start[0]&&T.end[0]!==e.fixedSegments[R].end[0])!=(T.start[1]!==e.fixedSegments[R].start[1]&&T.end[1]!==e.fixedSegments[R].end[1])?R:null).filter(T=>T!==null).shift();if(s==null)return{points:e.points};let o=((k=e.fixedSegments)==null?void 0:k.findIndex(T=>T.index===1))??-1,c=((M=e.fixedSegments)==null?void 0:M.findIndex(T=>T.index===e.points.length-1))??-1,d=Rt(t[s].start,t[s].end),l=d<Ft+5;if(o===-1&&t[s].index===1&&i){let T=Bo(n),R=(T?_n(n,Cn):_n(n,cr))?l?d/2:Ft:l?-d/2:-Ft;t[s].start=A(t[s].start[0]+(T?R:0),t[s].start[1]+(T?0:R))}if(c===-1&&t[s].index===e.points.length-1&&a){let T=Bo(r),R=(T?_n(r,Cn):_n(r,cr))?l?d/2:Ft:l?-d/2:-Ft;t[s].end=A(t[s].end[0]+(T?R:0),t[s].end[1]+(T?0:R))}let h=t.map(T=>({...T,start:A(e.x+T.start[0],e.y+T.start[1]),end:A(e.x+T.end[0],e.y+T.end[1])})),f=e.points.map((T,R)=>A(e.x+T[0],e.y+T[1])),g=h[s].index-1,U=h[s].index,y=h[s].start,v=h[s].end,x=f[g-1]&&!rs(f[g],f[g-1])?Oo(f[g-1],f[g]):void 0,w=f[U+1]&&!rs(f[U],f[U+1])?Oo(f[U+1],f[U]):void 0;if(x!==void 0){let T=x?1:0;f[g-1][T]=y[T]}if(f[g]=y,f[U]=v,w!==void 0){let T=w?1:0;f[U+1][T]=v[T]}let C=h.findIndex(T=>T.index===g);if(C!==-1){let T=Oo(h[C].end,h[C].start)?1:0;h[C].start[T]=y[T],h[C].end=y}let S=h.findIndex(T=>T.index===U+1);if(S!==-1){let T=Oo(h[S].end,h[S].start)?1:0;h[S].end[T]=v[T],h[S].start=v}if(o===-1&&g===0){let T=i?Bo(n):Oo(f[1],f[0]);f.unshift(A(T?y[0]:e.x+e.points[0][0],T?e.y+e.points[0][1]:y[1])),i&&f.unshift(A(e.x+e.points[0][0],e.y+e.points[0][1]));for(let R of h)R.index+=i?2:1}if(c===-1&&U===e.points.length-1){let T=Bo(r);f.push(A(T?v[0]:e.x+e.points[e.points.length-1][0],T?e.y+e.points[e.points.length-1][1]:v[1])),a&&f.push(A(e.x+e.points[e.points.length-1][0],e.y+e.points[e.points.length-1][1]))}return fc(f,h.map(T=>({...T,start:A(T.start[0]-e.x,T.start[1]-e.y),end:A(T.end[0]-e.x,T.end[1]-e.y)})),!1,!1)},pre=(e,t,n,r,i,a,s,o,c)=>{let d=e.startIsSpecial??null,l=e.endIsSpecial??null,h=t.map((v,x)=>x===0||x===t.length-1?A(e.x+v[0],e.y+v[1]):A(e.x+e.points[x][0],e.y+e.points[x][1])),f=n.map(v=>({...v,start:A(e.x+(v.start[0]-t[0][0]),e.y+(v.start[1]-t[0][1])),end:A(e.x+(v.end[0]-t[0][0]),e.y+(v.end[1]-t[0][1]))})),g=[],U=2+(d?1:0),y=2+(l?1:0);for(;g.length+U<h.length-y;)g.push(h[g.length+U]);{let v=h[d?2:1],x=h[d?3:2],w=Bo(r),C=Bo(Md(Ve(v,x)));if(o&&w===C){let S=w?_n(r,Cn):_n(r,cr);if(g.unshift(A(C?a[0]+(S?Ft:-Ft):x[0],C?x[1]:a[1]+(S?Ft:-Ft))),g.unshift(A(w?a[0]+(S?Ft:-Ft):a[0],w?a[1]:a[1]+(S?Ft:-Ft))),!d){d=!0;for(let k of f)k.index>1&&(k.index+=1)}}else if(g.unshift(A(C?a[0]:v[0],C?v[1]:a[1])),d){d=!1;for(let S of f)S.index>1&&(S.index-=1)}g.unshift(a)}{let v=h[h.length-(l?3:2)],x=h[h.length-(l?4:3)],w=Bo(i),C=Oo(x,v);if(c&&w===C){let S=w?_n(i,Cn):_n(i,cr);g.push(A(C?s[0]+(S?Ft:-Ft):x[0],C?x[1]:s[1]+(S?Ft:-Ft))),g.push(A(w?s[0]+(S?Ft:-Ft):s[0],w?s[1]:s[1]+(S?Ft:-Ft))),l||(l=!0)}else g.push(A(C?s[0]:v[0],C?v[1]:s[1])),l&&(l=!1)}return g.push(s),fc(g,f.map(({index:v})=>({index:v,start:g[v-1],end:g[v]})).map(v=>({...v,start:A(v.start[0]-a[0],v.start[1]-a[1]),end:A(v.end[0]-a[0],v.end[1]-a[1])})),d,l)},Gt=1e6,Zv=(e,t,n,r)=>{var x,w,C,S,k,M,T,R,j,P,N,F,$,q,W,V,B,z,Y,K,G,ee,de,xe,ve;if(e.points.length<2)return{points:n.points??e.points};(e.x<-Gt||e.x>Gt||e.y<-Gt||e.y>Gt||e.x+(((C=(w=n==null?void 0:n.points)==null?void 0:w[((x=n==null?void 0:n.points)==null?void 0:x.length)-1])==null?void 0:C[0])??0)<-Gt||e.x+(((M=(k=n==null?void 0:n.points)==null?void 0:k[((S=n==null?void 0:n.points)==null?void 0:S.length)-1])==null?void 0:M[0])??0)>Gt||e.y+(((j=(R=n==null?void 0:n.points)==null?void 0:R[((T=n==null?void 0:n.points)==null?void 0:T.length)-1])==null?void 0:j[1])??0)<-Gt||e.y+(((F=(N=n==null?void 0:n.points)==null?void 0:N[((P=n==null?void 0:n.points)==null?void 0:P.length)-1])==null?void 0:F[1])??0)>Gt||e.x+(((W=(q=e==null?void 0:e.points)==null?void 0:q[(($=e==null?void 0:e.points)==null?void 0:$.length)-1])==null?void 0:W[0])??0)<-Gt||e.x+(((z=(B=e==null?void 0:e.points)==null?void 0:B[((V=e==null?void 0:e.points)==null?void 0:V.length)-1])==null?void 0:z[0])??0)>Gt||e.y+(((G=(K=e==null?void 0:e.points)==null?void 0:K[((Y=e==null?void 0:e.points)==null?void 0:Y.length)-1])==null?void 0:G[1])??0)<-Gt||e.y+(((xe=(de=e==null?void 0:e.points)==null?void 0:de[((ee=e==null?void 0:e.points)==null?void 0:ee.length)-1])==null?void 0:xe[1])??0)>Gt)&&console.error("Elbow arrow (or update) is outside reasonable bounds (> 1e6)",{arrow:e,updates:n}),e.x=vt(e.x,-Gt,Gt),e.y=vt(e.y,-Gt,Gt),n.points&&(n.points=n.points.map(([Me,Ce])=>A(vt(Me,-Gt,Gt),vt(Ce,-Gt,Gt))));let i=n.points?n.points&&n.points.length===2?e.points.map((Me,Ce)=>Ce===0?n.points[0]:Ce===e.points.length-1?n.points[1]:Me):n.points.slice():e.points.slice(),a=typeof n.startBinding<"u"?n.startBinding:e.startBinding,s=typeof n.endBinding<"u"?n.endBinding:e.endBinding,o=a&&vh(a.elementId,t),c=s&&vh(s.elementId,t);if(t.size===0&&t7(i)||(o==null?void 0:o.id)!==(a==null?void 0:a.elementId)||(c==null?void 0:c.id)!==(s==null?void 0:s.elementId))return fc(i.map(Me=>A(e.x+Me[0],e.y+Me[1])),e.fixedSegments,e.startIsSpecial,e.endIsSpecial);let{startHeading:d,endHeading:l,startGlobalPoint:h,endGlobalPoint:f,hoveredStartElement:g,hoveredEndElement:U,...y}=Kv({x:e.x,y:e.y,startBinding:a,endBinding:s,startArrowhead:e.startArrowhead,endArrowhead:e.endArrowhead,points:e.points},t,i,o,c,r),v=n.fixedSegments??e.fixedSegments??[];return!n.points&&!n.fixedSegments&&!n.startBinding&&!n.endBinding?ure(e,t):n.startBinding===e.startBinding&&n.endBinding===e.endBinding&&(n.points??[]).every((Me,Ce)=>rs(Me,e.points[Ce]??A(1/0,1/0)))?{}:v.length===0?fc(Jv(e7(Qv(e,{startHeading:d,endHeading:l,startGlobalPoint:h,endGlobalPoint:f,hoveredEndElement:U,...y})??[])),v,null,null):(((ve=e.fixedSegments)==null?void 0:ve.length)??0)>v.length?hre(e,v,t):n.points?n.points&&n.fixedSegments?n:pre(e,i,v,d,l,h,f,g,U):fre(e,v,d,l,g,U)},Kv=(e,t,n,r,i,a)=>{var T,R;let s=s2(n[0],gr(e.x,e.y)),o=s2(n[n.length-1],gr(e.x,e.y)),c=r,d=i;if(a!=null&&a.isDragging){let j=Array.from(t.values());c=lS(s,t,j,a==null?void 0:a.zoom)||r,d=lS(o,t,j,a==null?void 0:a.zoom)||i}let l=sS({...e,points:n},"start",(T=e.startBinding)==null?void 0:T.fixedPoint,s,r,c,a==null?void 0:a.isDragging),h=sS({...e,points:n},"end",(R=e.endBinding)==null?void 0:R.fixedPoint,o,i,d,a==null?void 0:a.isDragging),f=oS(l,h,t,c,s),g=oS(h,l,t,d,o),U=[l[0]-2,l[1]-2,l[0]+2,l[1]+2],y=[h[0]-2,h[1]-2,h[0]+2,h[1]+2],v=c?Ds(c,Pl(f,e.startArrowhead?Kt*6:Kt*2,1)):U,x=d?Ds(d,Pl(g,e.endArrowhead?Kt*6:Kt*2,1)):y,w=ph(l,d?Ds(d,Pl(g,Ft,Ft)):y)||ph(h,c?Ds(c,Pl(f,Ft,Ft)):U),C=RL(w?[U,y]:[v,x]),S=Ure(w?U:v,w?y:x,C,w?Pl(f,!c&&!d?0:Ft,0):Pl(f,!c&&!d?0:Ft-(e.startArrowhead?Kt*6:Kt*2),Ft),w?Pl(g,!c&&!d?0:Ft,0):Pl(g,!c&&!d?0:Ft-(e.endArrowhead?Kt*6:Kt*2),Ft),w,c&&Ds(c),d&&Ds(d)),k=aS(S[0],f,l),M=aS(S[1],g,h);return{dynamicAABBs:S,startDonglePosition:k,startGlobalPoint:l,startHeading:f,endDonglePosition:M,endGlobalPoint:h,endHeading:g,commonBounds:C,hoveredStartElement:c,hoveredEndElement:d,boundsOverlap:w,startElementBounds:v,endElementBounds:x}},Qv=(e,t)=>{let{dynamicAABBs:n,startDonglePosition:r,startGlobalPoint:i,startHeading:a,endDonglePosition:s,endGlobalPoint:o,endHeading:c,commonBounds:d,hoveredEndElement:l}=t,h=bre(n,r||i,a,s||o,c,d),f=r&&Pm(r,h),g=s&&Pm(s,h),U=Pm(o,h);U&&l&&(U.closed=!0);let y=Pm(i,h);y&&e.startBinding&&(y.closed=!0);let v=f&&g&&(ph(f.pos,n[1])||ph(g.pos,n[0])),x=mre(f||y,g||U,h,a||Cn,c||Cn,v?[]:n);if(x){let w=x.map(C=>[C.pos[0],C.pos[1]]);return f&&w.unshift(i),g&&w.push(o),w}return null},Pl=(e,t,n)=>{switch(e){case ui:return[t,n,n,n];case Cn:return[n,t,n,n];case cr:return[n,n,t,n]}return[n,n,n,t]},mre=(e,t,n,r,i,a)=>{let s=ny(e.pos,t.pos),o=new dre(c=>c.f);for(o.push(e);o.size()>0;){let c=o.pop();if(!c||c.closed)continue;if(c===t)return gre(e,c);c.closed=!0;let d=vre(c.addr,n);for(let l=0;l<4;l++){let h=d[l];if(!h||h.closed)continue;let f=Lo(h.pos,c.pos,.5);if(XY(...a.map(C=>ph(f,C))))continue;let g=xre(l),U=c.parent?Md(Ve(c.pos,c.parent.pos)):r,y=DA(U);if(_n(y,g)||cS(e.addr,h.addr)&&_n(g,r)||cS(t.addr,h.addr)&&_n(g,i))continue;let v=U!==g,x=c.g+ny(h.pos,c.pos)+(v?Math.pow(s,3):0),w=h.visited;if(!w||x<h.g){let C=yre(h,t,g,i);h.visited=!0,h.parent=c,h.h=ny(t.pos,h.pos)+C*Math.pow(s,2),h.g=x,h.f=h.g+h.h,w?o.rescoreElement(h):o.push(h)}}}return null},gre=(e,t)=>{let n=t,r=[];for(;n.parent;)r.unshift(n),n=n.parent;return r.unshift(e),r},ny=(e,t)=>Math.abs(e[0]-t[0])+Math.abs(e[1]-t[1]),Ure=(e,t,n,r,i,a,s,o)=>{let c=s??e,d=o??t,[l,h,f,g]=r??[0,0,0,0],[U,y,v,x]=i??[0,0,0,0],w=[e[0]>t[2]?e[1]>t[3]||e[3]<t[1]?Math.min((c[0]+d[2])/2,e[0]-g):(c[0]+d[2])/2:e[0]>t[0]?e[0]-g:n[0]-g,e[1]>t[3]?e[0]>t[2]||e[2]<t[0]?Math.min((c[1]+d[3])/2,e[1]-l):(c[1]+d[3])/2:e[1]>t[1]?e[1]-l:n[1]-l,e[2]<t[0]?e[1]>t[3]||e[3]<t[1]?Math.max((c[2]+d[0])/2,e[2]+h):(c[2]+d[0])/2:e[2]<t[2]?e[2]+h:n[2]+h,e[3]<t[1]?e[0]>t[2]||e[2]<t[0]?Math.max((c[3]+d[1])/2,e[3]+f):(c[3]+d[1])/2:e[3]<t[3]?e[3]+f:n[3]+f],C=[t[0]>e[2]?t[1]>e[3]||t[3]<e[1]?Math.min((d[0]+c[2])/2,t[0]-x):(d[0]+c[2])/2:t[0]>e[0]?t[0]-x:n[0]-x,t[1]>e[3]?t[0]>e[2]||t[2]<e[0]?Math.min((d[1]+c[3])/2,t[1]-U):(d[1]+c[3])/2:t[1]>e[1]?t[1]-U:n[1]-U,t[2]<e[0]?t[1]>e[3]||t[3]<e[1]?Math.max((d[2]+c[0])/2,t[2]+y):(d[2]+c[0])/2:t[2]<e[2]?t[2]+y:n[2]+y,t[3]<e[1]?t[0]>e[2]||t[2]<e[0]?Math.max((d[3]+c[1])/2,t[3]+v):(d[3]+c[1])/2:t[3]<e[3]?t[3]+v:n[3]+v],S=RL([w,C]);if(!a&&w[2]-w[0]+C[2]-C[0]>S[2]-S[0]+1e-11&&w[3]-w[1]+C[3]-C[1]>S[3]-S[1]+1e-11){let[k,M]=[(C[0]+C[2])/2,(C[1]+C[3])/2];if(t[0]>e[2]&&e[1]>t[3]){let T=w[2]+(C[0]-w[2])/2,R=C[3]+(w[1]-C[3])/2;return Kn(gr(e[2]-k,e[1]-M),gr(e[0]-k,e[3]-M))>0?[[w[0],w[1],T,w[3]],[T,C[1],C[2],C[3]]]:[[w[0],R,w[2],w[3]],[C[0],C[1],C[2],R]]}else if(e[2]<t[0]&&e[3]<t[1]){let T=w[2]+(C[0]-w[2])/2,R=w[3]+(C[1]-w[3])/2;return Kn(gr(e[0]-k,e[1]-M),gr(e[2]-k,e[3]-M))>0?[[w[0],w[1],w[2],R],[C[0],R,C[2],C[3]]]:[[w[0],w[1],T,w[3]],[T,C[1],C[2],C[3]]]}else if(e[0]>t[2]&&e[3]<t[1]){let T=C[2]+(w[0]-C[2])/2,R=w[3]+(C[1]-w[3])/2;return Kn(gr(e[2]-k,e[1]-M),gr(e[0]-k,e[3]-M))>0?[[T,w[1],w[2],w[3]],[C[0],C[1],T,C[3]]]:[[w[0],w[1],w[2],R],[C[0],R,C[2],C[3]]]}else if(e[0]>t[2]&&e[1]>t[3]){let T=C[2]+(w[0]-C[2])/2,R=C[3]+(w[1]-C[3])/2;return Kn(gr(e[0]-k,e[1]-M),gr(e[2]-k,e[3]-M))>0?[[T,w[1],w[2],w[3]],[C[0],C[1],T,C[3]]]:[[w[0],R,w[2],w[3]],[C[0],C[1],C[2],R]]}}return[w,C]},bre=(e,t,n,r,i,a)=>{let s=new Set,o=new Set;n===di||n===Cn?o.add(t[1]):s.add(t[0]),i===di||i===Cn?o.add(r[1]):s.add(r[0]),e.forEach(l=>{s.add(l[0]),s.add(l[2]),o.add(l[1]),o.add(l[3])}),s.add(a[0]),s.add(a[2]),o.add(a[1]),o.add(a[3]);let c=Array.from(o).sort((l,h)=>l-h),d=Array.from(s).sort((l,h)=>l-h);return{row:c.length,col:d.length,data:c.flatMap((l,h)=>d.map((f,g)=>({f:0,g:0,h:0,closed:!1,visited:!1,parent:null,addr:[g,h],pos:[f,l]})))}},aS=(e,t,n)=>{switch(t){case ui:return A(n[0],e[1]);case Cn:return A(e[2],n[1]);case cr:return A(n[0],e[3])}return A(e[0],n[1])},yre=(e,t,n,r)=>{if(r===Cn)switch(n){case Cn:return e.pos[0]>=t.pos[0]?4:e.pos[1]===t.pos[1]?0:2;case ui:return e.pos[1]>t.pos[1]&&e.pos[0]<t.pos[0]?1:3;case cr:return e.pos[1]<t.pos[1]&&e.pos[0]<t.pos[0]?1:3;case di:return e.pos[1]===t.pos[1]?4:2}else if(r===di)switch(n){case Cn:return e.pos[1]===t.pos[1]?4:2;case ui:return e.pos[1]>t.pos[1]&&e.pos[0]>t.pos[0]?1:3;case cr:return e.pos[1]<t.pos[1]&&e.pos[0]>t.pos[0]?1:3;case di:return e.pos[0]<=t.pos[0]?4:e.pos[1]===t.pos[1]?0:2}else if(r===ui)switch(n){case Cn:return e.pos[1]>t.pos[1]&&e.pos[0]<t.pos[0]?1:3;case ui:return e.pos[1]>=t.pos[1]?4:e.pos[0]===t.pos[0]?0:2;case cr:return e.pos[0]===t.pos[0]?4:2;case di:return e.pos[1]>t.pos[1]&&e.pos[0]>t.pos[0]?1:3}else if(r===cr)switch(n){case Cn:return e.pos[1]<t.pos[1]&&e.pos[0]<t.pos[0]?1:3;case ui:return e.pos[0]===t.pos[0]?4:2;case cr:return e.pos[1]<=t.pos[1]?4:e.pos[0]===t.pos[0]?0:2;case di:return e.pos[1]<t.pos[1]&&e.pos[0]>t.pos[0]?1:3}return 0},vre=([e,t],n)=>[pp([e,t-1],n),pp([e+1,t],n),pp([e,t+1],n),pp([e-1,t],n)],pp=([e,t],n)=>e<0||e>=n.col||t<0||t>=n.row?null:n.data[t*n.col+e]??null,Pm=(e,t)=>{for(let n=0;n<t.col;n++)for(let r=0;r<t.row;r++){let i=pp([n,r],t);if(i&&e[0]===i.pos[0]&&e[1]===i.pos[1])return i}return null},RL=e=>[Math.min(...e.map(t=>t[0])),Math.min(...e.map(t=>t[1])),Math.max(...e.map(t=>t[2])),Math.max(...e.map(t=>t[3]))],vh=(e,t)=>{let n=t.get(e);return n&&is(n)?n:null},fc=(e,t,n,r)=>{let i=e[0][0],a=e[0][1],s=e.map(o=>s2(o,Sn(Ve(e[0]),-1)));return(i<-Gt||i>Gt||a<-Gt||a>Gt||i+s[s.length-1][0]<-Gt||a+s[s.length-1][0]>Gt||i+s[s.length-1][1]<-Gt||a+s[s.length-1][1]>Gt)&&console.error("Elbow arrow normalization is outside reasonable bounds (> 1e6)",{x:i,y:a,points:s,...gh(s)}),s=s.map(([o,c])=>A(vt(o,-1e6,1e6),vt(c,-1e6,1e6))),{points:s,x:vt(i,-1e6,1e6),y:vt(a,-1e6,1e6),fixedSegments:((t==null?void 0:t.length)??0)>0?t:null,...gh(s),startIsSpecial:n,endIsSpecial:r}},Jv=e=>{if(e.length>1){let t=Math.abs(e[0][1]-e[1][1])<Math.abs(e[0][0]-e[1][0]);return e.filter((n,r)=>{if(r===0||r===e.length-1)return!0;let i=e[r+1],a=Math.abs(n[1]-i[1])<Math.abs(n[0]-i[0]);return t===a?(t=a,!1):(t=a,!0)})}return e},e7=e=>e.length>=4?e.filter((t,n)=>{if(n===0||n===e.length-1)return!0;let r=e[n-1];return Rt(r,t)>qv}):e,xre=e=>{switch(e){case 0:return ui;case 1:return Cn;case 2:return cr}return di},sS=(e,t,n,r,i,a,s)=>{if(s){if(a){let o=h1(e,a,t);return Gte(a,o)}return r}if(i){let o=O3(n||[0,0],i);return Math.abs(IU(i,o)-Kt)>.01?h1(e,i,t):o}return r},oS=(e,t,n,r,i)=>Wte(e,t,r,r&&Ds(r,Array(4).fill(IU(r,e))),n,i),lS=(e,t,n,r)=>qa(Ya(e),n,t,r,!0,!0),cS=(e,t)=>e[0]===t[0]&&e[1]===t[1],t7=(e,t=qv)=>e.slice(1).map((n,r)=>Math.abs(n[0]-e[r][0])<t||Math.abs(n[1]-e[r][1])<t).every(Boolean),wre={selection:!0,text:!0,rectangle:!0,diamond:!0,ellipse:!0,line:!0,image:!0,arrow:!0,freedraw:!0,eraser:!1,custom:!0,frame:!0,embeddable:!0,hand:!0,laser:!1,magicframe:!1},Ere=e=>Object.keys(un).includes(e)?un[e]:xc,Eu=(e,t)=>{if(!t)return null;let n=t.focus||0;return Pe(e)?d2(t)?{...t,focus:n,fixedPoint:DU(t.fixedPoint??[0,0])}:null:{...t,focus:n}},Nl=(e,t)=>{let n={type:t.type||e.type,version:e.version||1,versionNonce:e.versionNonce??0,index:e.index??null,isDeleted:e.isDeleted??!1,id:e.id||ga(),fillStyle:e.fillStyle||En.fillStyle,strokeWidth:e.strokeWidth||En.strokeWidth,strokeStyle:e.strokeStyle??En.strokeStyle,roughness:e.roughness??En.roughness,opacity:e.opacity==null?En.opacity:e.opacity,angle:e.angle||0,x:t.x??e.x??0,y:t.y??e.y??0,strokeColor:e.strokeColor||En.strokeColor,backgroundColor:e.backgroundColor||En.backgroundColor,width:e.width||0,height:e.height||0,seed:e.seed??1,groupIds:e.groupIds??[],frameId:e.frameId??null,roundness:e.roundness?e.roundness:e.strokeSharpness==="round"?{type:$h(e.type)?Nn.LEGACY:Nn.PROPORTIONAL_RADIUS}:null,boundElements:e.boundElementIds?e.boundElementIds.map(r=>({type:"arrow",id:r})):e.boundElements??[],updated:e.updated??Fh(),link:e.link?Ui(e.link):null,locked:e.locked??!1};return("customData"in e||"customData"in t)&&(n.customData="customData"in t?t.customData:e.customData),{...e,...n,...KL(n),...t}},Cre=e=>{switch(e={...e},e.type){case"text":delete e.rawText;let t=e.fontSize,n=e.fontFamily;if("font"in e){let[l,h]=e.font.split(" ");t=parseFloat(l),n=Ere(h)}let r=typeof e.text=="string"&&e.text||"",i=e.lineHeight||(e.height?KY(e):Td(e.fontFamily));return e=Nl(e,{fontSize:t,fontFamily:n,text:r,textAlign:e.textAlign||B1,verticalAlign:e.verticalAlign||Jg,containerId:e.containerId??null,originalText:e.originalText||r,autoResize:e.autoResize??!0,lineHeight:i}),!r&&!e.isDeleted&&(e={...e,originalText:r,isDeleted:!0},e=e0(e)),e;case"freedraw":return Nl(e,{points:e.points,lastCommittedPoint:null,simulatePressure:e.simulatePressure,pressures:e.pressures});case"image":return Nl(e,{status:e.status||"pending",fileId:e.fileId,scale:e.scale||[1,1],crop:e.crop??null});case"line":case"draw":let{startArrowhead:a=null,endArrowhead:s=null}=e,o=e.x,c=e.y,d=!Array.isArray(e.points)||e.points.length<2?[A(0,0),A(e.width,e.height)]:e.points;return(d[0][0]!==0||d[0][1]!==0)&&({points:d,x:o,y:c}=Re.getNormalizedPoints(e)),Nl(e,{type:e.type==="draw"?"line":e.type,startBinding:Eu(e,e.startBinding),endBinding:Eu(e,e.endBinding),lastCommittedPoint:null,startArrowhead:a,endArrowhead:s,points:d,x:o,y:c,...gh(d)});case"arrow":{let{startArrowhead:l=null,endArrowhead:h="arrow"}=e,f=e.x,g=e.y,U=!Array.isArray(e.points)||e.points.length<2?[A(0,0),A(e.width,e.height)]:e.points;(U[0][0]!==0||U[0][1]!==0)&&({points:U,x:f,y:g}=Re.getNormalizedPoints(e));let y={type:e.type,startBinding:Eu(e,e.startBinding),endBinding:Eu(e,e.endBinding),lastCommittedPoint:null,startArrowhead:l,endArrowhead:h,points:U,x:f,y:g,elbowed:e.elbowed,...gh(U)};return Pe(e)?Nl(e,{...y,elbowed:!0,startBinding:Eu(e,e.startBinding),endBinding:Eu(e,e.endBinding),fixedSegments:e.fixedSegments,startIsSpecial:e.startIsSpecial,endIsSpecial:e.endIsSpecial}):Nl(e,y)}case"ellipse":case"rectangle":case"diamond":case"iframe":case"embeddable":return Nl(e,{});case"magicframe":case"frame":return Nl(e,{name:e.name??null})}return null},Sre=(e,t)=>{if(e.boundElements){let n=e.boundElements.slice(),r=new Set;e.boundElements=n.reduce((i,a)=>{let s=t.get(a.id);if(s&&!r.has(a.id)){if(r.add(a.id),s.isDeleted)return i;i.push(a),Le(s)&&!s.containerId&&(s.containerId=e.id)}return i},[])}},_re=(e,t)=>{let n=e.containerId?t.get(e.containerId):null;if(!n){e.containerId=null;return}if(!e.isDeleted&&n.boundElements&&!n.boundElements.find(r=>r.id===e.id)){let r=(n.boundElements||(n.boundElements=[])).slice();r.push({type:"text",id:e.id}),n.boundElements=r}},kre=(e,t)=>{e.frameId&&(t.get(e.frameId)||(e.frameId=null))},$U=(e,t,n)=>{let r=new Set,i=t?nt(t):null,a=Jo((e||[]).reduce((o,c)=>{if(c.type!=="selection"&&!Ad(c)){let d=Cre(c);if(d){let l=i==null?void 0:i.get(c.id);l&&l.version>d.version&&(d=e0(d,l.version)),r.has(d.id)&&(d={...d,id:ga()}),r.add(d.id),o.push(d)}}return o},[]));if(!(n!=null&&n.repairBindings))return a;let s=nt(a);for(let o of a)o.frameId&&kre(o,s),Le(o)&&o.containerId?_re(o,s):o.boundElements&&Sre(o,s),n.refreshDimensions&&Le(o)&&Object.assign(o,cL(o,ur(o,s),s)),st(o)&&(o.startBinding&&(!s.has(o.startBinding.elementId)||!Ut(o))&&(o.startBinding=null),o.endBinding&&(!s.has(o.endBinding.elementId)||!Ut(o))&&(o.endBinding=null));return a.map(o=>{if(Pe(o)&&o.startBinding==null&&o.endBinding==null&&!t7(o.points))return{...o,...Zv(o,s,{points:[A(0,0),o.points[o.points.length-1]]}),index:o.index};if(Pe(o)&&o.startBinding&&o.endBinding&&o.startBinding.elementId===o.endBinding.elementId&&o.points.length>1&&o.points.some(([c,d])=>Math.abs(c)>1e6||Math.abs(d)>1e6)){console.error("Fixing self-bound elbow arrow",o.id);let c=s.get(o.startBinding.elementId);return c?{...o,x:c.x+c.width/2,y:c.y-5,width:c.width,height:c.height,points:[A(0,0),A(0,-10),A(c.width/2+5,-10),A(c.width/2+5,c.height/2+5)]}:(console.error("Bound element not found",o.startBinding.elementId),o)}return o})},Tre=(e,t,n)=>{let r=t[e];return r!==void 0?r:n[e]},dS={isSidebarDocked:(e,t)=>["defaultSidebarDockedPreference",e.isSidebarDocked??Tre("defaultSidebarDockedPreference",e,t)]},DL=(e,t)=>{var i;e=e||{};let n=Vs(),r={};for(let a of Object.keys(dS))if(a in e){let[s,o]=dS[a](e,n);r[s]=o}for(let[a,s]of Object.entries(n)){let o=e[a],c=t?t[a]:void 0;r[a]=o!==void 0?o:c!==void 0?c:s}return{...r,cursorButton:(t==null?void 0:t.cursorButton)||"up",penDetected:(t==null?void 0:t.penDetected)??(e.penMode?e.penDetected??!1:!1),activeTool:{...Pn(n,r.activeTool.type&&wre[r.activeTool.type]?r.activeTool:{type:"selection"}),lastActiveTool:null,locked:r.activeTool.locked??!1},zoom:{value:zo(Mp(e.zoom)?e.zoom:((i=e.zoom)==null?void 0:i.value)??n.zoom.value)},openSidebar:typeof e.openSidebar=="string"?{name:Qa.name}:r.openSidebar,gridSize:nne(Mp(e.gridSize)?e.gridSize:t2),gridStep:YA(Mp(e.gridStep)?e.gridStep:bI),editingFrame:null}},Z1=(e,t,n,r)=>({elements:$U(e==null?void 0:e.elements,n,r),appState:DL(e==null?void 0:e.appState,t||null),files:(e==null?void 0:e.files)||{}}),uS=e=>{let t=$U(Vt(e.elements),null);return t.length?{...e,elements:t}:null},BU=(e=[],t)=>{let n=[];for(let r of e)if(Array.isArray(r)){let i=uS({status:t,elements:r,id:ga(),created:Date.now()});i&&n.push(i)}else{let i=r,a=uS({...i,id:i.id||ga(),status:i.status||t,created:i.created||Date.now()});a&&n.push(a)}return n},Wa=32,qt=12,lc=256,jL=50,Jc="NOT_SPREADSHEET",b1="VALID_SPREADSHEET",mp=e=>{let t=/^([-+]?)[$€£¥₩]?([-+]?)([\d.,]+)[%]?$/.exec(e);return t?parseFloat(`${(t[1]||t[2])+t[3]}`.replace(/,/g,"")):null},ry=(e,t)=>e.slice(1).every(n=>mp(n[t])!==null),hS=e=>{let t=e[0].length;if(t>2)return{type:Jc,reason:"More than 2 columns"};if(t===1){if(!ry(e,0))return{type:Jc,reason:"Value is not numeric"};let c=mp(e[0][0])===null,d=(c?e.slice(1):e).map(l=>mp(l[0]));return d.length<2?{type:Jc,reason:"Less than two rows"}:{type:b1,spreadsheet:{title:c?e[0][0]:null,labels:null,values:d}}}let n=ry(e,0),r=ry(e,1);if(!n&&!r)return{type:Jc,reason:"Value is not numeric"};let[i,a]=r?[0,1]:[1,0],s=mp(e[0][a])===null,o=s?e.slice(1):e;return o.length<2?{type:Jc,reason:"Less than 2 rows"}:{type:b1,spreadsheet:{title:s?e[0][a]:null,labels:o.map(c=>c[i]),values:o.map(c=>mp(c[a]))}}},Mre=e=>{let t=[];for(let n=0;n<e[0].length;n++){let r=[];for(let i=0;i<e.length;i++)r.push(e[i][n]);t.push(r)}return t},Ire=e=>{let t=e.trim().split(`
78
- `).map(i=>i.trim().split(" "));if(t.length&&t[0].length!==2&&(t=e.trim().split(`
79
- `).map(i=>i.trim().split(","))),t.length===0)return{type:Jc,reason:"No values"};let n=t[0].length;if(!t.every(i=>i.length===n))return{type:Jc,reason:"All rows don't have same number of columns"};let r=hS(t);if(r.type!==b1){let i=hS(Mre(t));if(i.type===b1)return i}return r},C2=NV(DV),ua={fillStyle:"hachure",fontFamily:xc,fontSize:ol,opacity:100,roughness:1,strokeColor:yt.black,roundness:null,strokeStyle:"solid",strokeWidth:1,verticalAlign:ji.MIDDLE,locked:!1},PL=e=>{let t=(Wa+qt)*e.values.length+qt,n=lc+qt*2;return{chartWidth:t,chartHeight:n}},Are=(e,t,n,r,i)=>{var a;return((a=e.labels)==null?void 0:a.map((s,o)=>Oi({groupIds:[r],backgroundColor:i,...ua,text:s.length>8?`${s.slice(0,5)}...`:s,x:t+o*(Wa+qt)+qt*2,y:n+qt/2,width:Wa,angle:5.87,fontSize:16,textAlign:"center",verticalAlign:"top"})))||[]},Lre=(e,t,n,r,i)=>{let a=Oi({groupIds:[r],backgroundColor:i,...ua,x:t-qt,y:n-qt,text:"0",textAlign:"right"}),s=Oi({groupIds:[r],backgroundColor:i,...ua,x:t-qt,y:n-lc-a.height/2,text:Math.max(...e.values).toLocaleString(),textAlign:"right"});return[a,s]},Rre=(e,t,n,r,i)=>{let{chartWidth:a,chartHeight:s}=PL(e),o=fd({backgroundColor:i,groupIds:[r],...ua,type:"line",x:t,y:n,width:a,points:[A(0,0),A(a,0)]}),c=fd({backgroundColor:i,groupIds:[r],...ua,type:"line",x:t,y:n,height:s,points:[A(0,0),A(0,-s)]}),d=fd({backgroundColor:i,groupIds:[r],...ua,type:"line",x:t,y:n-lc-qt,strokeStyle:"dotted",width:a,opacity:jL,points:[A(0,0),A(a,0)]});return[o,c,d]},NL=(e,t,n,r,i,a)=>{let{chartWidth:s,chartHeight:o}=PL(e),c=e.title?Oi({backgroundColor:i,groupIds:[r],...ua,text:e.title,x:t+s/2,y:n-lc-qt*2-ol,roundness:null,textAlign:"center"}):null,d=a?qs({backgroundColor:i,groupIds:[r],...ua,type:"rectangle",x:t,y:n-o,width:s,height:o,strokeColor:yt.black,fillStyle:"solid",opacity:6}):null;return[...d?[d]:[],...c?[c]:[],...Are(e,t,n,r,i),...Lre(e,t,n,r,i),...Rre(e,t,n,r,i)]},Dre=(e,t,n)=>{let r=Math.max(...e.values),i=ga(),a=C2[Math.floor(Math.random()*C2.length)];return[...e.values.map((s,o)=>{let c=s/r*lc;return qs({backgroundColor:a,groupIds:[i],...ua,type:"rectangle",x:t+o*(Wa+qt)+qt,y:n-c-qt,width:Wa,height:c})}),...NL(e,t,n,i,a,mt.DEV)]},jre=(e,t,n)=>{let r=Math.max(...e.values),i=ga(),a=C2[Math.floor(Math.random()*C2.length)],s=0,o=[];for(let y of e.values){let v=s*(Wa+qt),x=-(y/r)*lc;o.push([v,x]),s++}let c=Math.max(...o.map(y=>y[0])),d=Math.max(...o.map(y=>y[1])),l=Math.min(...o.map(y=>y[0])),h=Math.min(...o.map(y=>y[1])),f=fd({backgroundColor:a,groupIds:[i],...ua,type:"line",x:t+qt+Wa/2,y:n-qt,height:d-h,width:c-l,strokeWidth:2,points:o}),g=e.values.map((y,v)=>{let x=v*(Wa+qt)+qt/2,w=-(y/r)*lc+qt/2;return qs({backgroundColor:a,groupIds:[i],...ua,fillStyle:"solid",strokeWidth:2,type:"ellipse",x:t+x+Wa/2,y:n+w-qt*2,width:qt,height:qt})}),U=e.values.map((y,v)=>{let x=v*(Wa+qt)+qt/2,w=y/r*lc+qt/2+qt;return fd({backgroundColor:a,groupIds:[i],...ua,type:"line",x:t+x+Wa/2+qt/2,y:n-w,height:w,strokeStyle:"dotted",opacity:jL,points:[A(0,0),A(0,w)]})});return[...NL(e,t,n,i,a,mt.DEV),f,...U,...g]},Pre=(e,t,n,r)=>e==="line"?jre(t,n,r):Dre(t,n,r),n7="clipboard"in navigator&&"writeText"in navigator.clipboard,r7="clipboard"in navigator&&"write"in navigator.clipboard&&"ClipboardItem"in window&&"toBlob"in HTMLCanvasElement.prototype,Nre=e=>!!([da.excalidraw,da.excalidrawClipboard,da.excalidrawClipboardWithAPI].includes(e==null?void 0:e.type)&&Array.isArray(e.elements)),Ore=({types:e,files:t})=>{var r,i,a,s;!e&&!t&&console.warn("createPasteEvent: no types or files provided");let n=new ClipboardEvent("paste",{clipboardData:new DataTransfer});if(e)for(let[o,c]of Object.entries(e)){if(typeof c!="string"){t=t||[],t.push(c);continue}try{if((r=n.clipboardData)==null||r.setData(o,c),((i=n.clipboardData)==null?void 0:i.getData(o))!==c)throw new Error(`Failed to set "${o}" as clipboardData item`)}catch(d){throw new Error(d.message)}}if(t){let o=-1;for(let c of t){o++;try{if((a=n.clipboardData)==null||a.items.add(c),((s=n.clipboardData)==null?void 0:s.files[o])!==c)throw new Error(`Failed to set file "${c.name}" as clipboardData item`)}catch(d){throw new Error(d.message)}}}return n},Fre=({elements:e,files:t})=>{let n=nt(e),r=new Set(e.filter(o=>tt(o))),i=!1,a=e.reduce((o,c)=>(aa(c)&&(i=!0,t&&t[c.fileId]&&(o[c.fileId]=t[c.fileId])),o),{});i&&!t&&console.warn("copyToClipboard: attempting to file element(s) without providing associated `files` object.");let s={type:da.excalidrawClipboard,elements:e.map(o=>{if(bi(o,n)&&!r.has(bi(o,n))){let c=Hd(o);return me(c,{frameId:null}),c}return o}),files:t?a:void 0};return JSON.stringify(s)},$re=async(e,t,n)=>{await K1(Fre({elements:e,files:t}),n)},Bre=e=>{let t=Ire(e);return t.type===b1?{spreadsheet:t.spreadsheet}:null};function OL(e){var n;let t=[];for(let r of e.childNodes)if(r.nodeType===3){let i=(n=r.textContent)==null?void 0:n.trim();i&&t.push({type:"text",value:i})}else if(r instanceof HTMLImageElement){let i=r.getAttribute("src");i&&i.startsWith("http")&&t.push({type:"imageUrl",value:i})}else t=t.concat(OL(r));return t}var zre=e=>{var n;let t=(n=e.clipboardData)==null?void 0:n.getData(We.html);if(!t)return null;try{let r=new DOMParser().parseFromString(t,We.html),i=OL(r.body);if(i.length)return{type:"mixedContent",value:i}}catch(r){console.error(`error in parseHTMLFromPaste: ${r.message}`)}return null},Hre=async()=>{var n,r,i,a;let e={},t;try{t=await((n=navigator.clipboard)==null?void 0:n.read())}catch(s){try{if((r=navigator.clipboard)!=null&&r.readText){console.warn(`navigator.clipboard.readText() failed (${s.message}). Failling back to navigator.clipboard.read()`);let o=await((i=navigator.clipboard)==null?void 0:i.readText());if(o)return{[We.text]:o}}}catch(o){if((a=navigator.clipboard)!=null&&a.read)console.warn(`navigator.clipboard.readText() failed (${o.message}). Failling back to navigator.clipboard.read()`);else{if(o.name==="DataError")return console.warn(`navigator.clipboard.read() error, clipboard is probably empty: ${o.message}`),e;throw o}}throw s}for(let s of t)for(let o of s.types)if(DI(KV,o))try{if(o===We.text||o===We.html)e[o]=await(await s.getType(o)).text();else if(oR(o)){let c=await s.getType(o),d=gp(c,o,void 0);e[o]=d}else throw new wC(`Unsupported clipboard type: ${o}`)}catch(c){console.warn(c instanceof wC?c.message:`Cannot retrieve ${o} from clipboardItem: ${c.message}`)}return Object.keys(e).length===0&&console.warn("No clipboard data found from clipboard.read()."),e},Wre=async(e,t=!1)=>{var n,r;try{let i=!t&&e&&zre(e);return i?i.value.every(a=>a.type==="text")?{type:"text",value:((n=e.clipboardData)==null?void 0:n.getData(We.text))||i.value.map(a=>a.value).join(`
80
- `).trim()}:i:{type:"text",value:(((r=e.clipboardData)==null?void 0:r.getData(We.text))||"").trim()}}catch{return{type:"text",value:""}}},FL=async(e,t=!1)=>{let n=await Wre(e,t);if(n.type==="mixedContent")return{mixedContent:n.value};try{let r=!t&&Bre(n.value);if(r)return r}catch(r){console.error(r)}try{let r=JSON.parse(n.value),i=r.type===da.excalidrawClipboardWithAPI;if(Nre(r))return{elements:r.elements,files:r.files,text:t?JSON.stringify(r.elements,null,2):void 0,programmaticAPI:i}}catch{}return{text:n.value}},Xre=async e=>{try{await navigator.clipboard.write([new window.ClipboardItem({[We.png]:e})])}catch(t){if(W1(e))await navigator.clipboard.write([new window.ClipboardItem({[We.png]:await e})]);else throw t}},K1=async(e,t)=>{var n,r;if(n7)try{await navigator.clipboard.writeText(e||"");return}catch(i){console.error(i)}try{if(t){if((n=t.clipboardData)==null||n.setData(We.text,e||""),((r=t.clipboardData)==null?void 0:r.getData(We.text))!==e)throw new Error("Failed to setData on clipboardEvent");return}}catch(i){console.error(i)}if(!Vre(e))throw new Error("Error copying to clipboard.")},Vre=e=>{e||(e=" ");let t=document.documentElement.getAttribute("dir")==="rtl",n=document.createElement("textarea");n.style.border="0",n.style.padding="0",n.style.margin="0",n.style.position="absolute",n.style[t?"right":"left"]="-9999px";let r=window.pageYOffset||document.documentElement.scrollTop;n.style.top=`${r}px`,n.style.fontSize="12pt",n.setAttribute("readonly",""),n.value=e,document.body.appendChild(n);let i=!1;try{n.select(),n.setSelectionRange(0,n.value.length),i=document.execCommand("copy")}catch(a){console.error(a)}return n.remove(),i},Q1=({elements:e,appState:t,files:n,maxWidthOrHeight:r,getDimensions:i,exportPadding:a,exportingFrame:s})=>{let{elements:o,appState:c}=Z1({elements:e,appState:t},null,null),{exportBackground:d,viewBackgroundColor:l}=c;return LL(o,{...c,offsetTop:0,offsetLeft:0,width:0,height:0},n||{},{exportBackground:d,exportPadding:a,viewBackgroundColor:l,exportingFrame:s},(h,f)=>{let g=document.createElement("canvas");if(r){typeof i=="function"&&console.warn("`getDimensions()` is ignored when `maxWidthOrHeight` is supplied.");let y=Math.max(h,f),v=r<y?r/y:(t==null?void 0:t.exportScale)??1;return g.width=h*v,g.height=f*v,{canvas:g,scale:v}}let U=(i==null?void 0:i(h,f))||{width:h,height:f};return g.width=U.width,g.height=U.height,{canvas:g,scale:U.scale??1}})},$L=async e=>{var i;let{mimeType:t=We.png,quality:n}=e;t===We.png&&typeof n=="number"&&console.warn(`"quality" will be ignored for "${We.png}" mimeType`),t==="image/jpg"&&(t=We.jpg),t===We.jpg&&!((i=e.appState)!=null&&i.exportBackground)&&(console.warn(`Defaulting "exportBackground" to "true" for "${We.jpg}" mimeType`),e={...e,appState:{...e.appState,exportBackground:!0}});let r=await Q1(e);return n=n||(/image\/jpe?g/.test(t)?.92:.8),new Promise((a,s)=>{r.toBlob(async o=>{var c;if(!o)return s(new Error("couldn't export to blob"));o&&t===We.png&&((c=e.appState)!=null&&c.exportEmbedScene)&&(o=await UR({blob:o,metadata:q1(e.elements,e.appState,e.files||{})})),a(o)},t,n)})},zU=async({elements:e,appState:t=Vs(),files:n={},exportPadding:r,renderEmbeddables:i,exportingFrame:a,skipInliningFonts:s,reuseImages:o})=>{let{elements:c,appState:d}=Z1({elements:e,appState:t},null,null),l={...d,exportPadding:r};return Yv(c,l,n,{exportingFrame:a,renderEmbeddables:i,skipInliningFonts:s,reuseImages:o})},Yre=e=>e.type==="diamond"?[A(e.width/2,0),A(e.width,e.height/2),A(e.width/2,e.height),A(0,e.height/2)]:[A(0,0),A(0+e.width,0),A(0+e.width,e.height),A(0,e.height)],Gre=e=>st(e)||pa(e)?e.points:Yre(e),fS=e=>{let t=e.reduce((n,[r,i])=>(n.minY=Math.min(n.minY,i),n.minX=Math.min(n.minX,r),n.maxX=Math.max(n.maxX,r),n.maxY=Math.max(n.maxY,i),n),{minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0,cx:0,cy:0});return t.cx=(t.maxX+t.minX)/2,t.cy=(t.maxY+t.minY)/2,t},qre=e=>{let t=Gre(e),{cx:n,cy:r}=fS(t),i=A(n,r),a=t.map(l=>he(l,i,e.angle)),{minX:s,minY:o,maxX:c,maxY:d}=fS(a);return[s+e.x,o+e.y,c+e.x,d+e.y]},BL=(e,t)=>{let n=qre(e);return(Am(n[0],Tr(t[0],t[2]))||Am(t[0],Tr(n[0],n[2])))&&(Am(n[1],Tr(t[1],t[3]))||Am(t[1],Tr(n[1],n[3])))},zL=({elements:e,bounds:t,type:n,errorMargin:r=0})=>{var s;OI(t)&&(t=as(t,nt(e)));let i=[t[0]-r,t[1]-r,t[2]+r,t[3]+r],a=new Set;for(let o of e)if(!a.has(o.id)&&BL(o,i)){if(a.add(o.id),o.boundElements)for(let c of o.boundElements)a.add(c.id);Le(o)&&o.containerId&&a.add(o.containerId),Ut(o)&&(o.startBinding&&a.add(o.startBinding.elementId),o.endBinding&&a.add((s=o.endBinding)==null?void 0:s.elementId))}return e.filter(o=>a.has(o.id))};function pS(e){return[Math.min(e[0][0],e[1][0]),Math.min(e[0][1],e[1][1]),Math.max(e[0][0],e[1][0]),Math.max(e[0][1],e[1][1])]}function Zre(e,t){return e[0]<=t[2]&&e[2]>=t[0]&&e[1]<=t[3]&&e[3]>=t[1]}var Kre=1e-6;function mS(e,t){let n=Ve(e[1],e[0]),r=Ve(t,e[0]),i=Kn(n,r);return Math.abs(i)<Kre}function iy(e,t){let n=Ve(e[1],e[0]),r=Ve(t,e[0]);return Kn(n,r)<0}function gS(e,t){return mS(e,t[0])||mS(e,t[1])||(iy(e,t[0])?!iy(e,t[1]):iy(e,t[1]))}function Qre(e,t){return Zre(pS(e),pS(t))&&gS(e,t)&&gS(t,e)}var HL=(e,t,n)=>{let r=nt(e);for(let i of t)if(i.frameId){let a=n.get(i.id),s=n.get(i.frameId);if(a){let o=r.get(a);o&&me(o,{frameId:s??i.frameId},!1)}}};function i7(e,t,n){let r=AC(t,n),i=AC(e,n);return r.some(a=>i.some(s=>Qre(a,s)))}var WL=(e,t,n)=>WU(d7(e,t,n,!1)).filter(r=>!tt(r)&&!r.frameId||r.frameId===t.id),a7=(e,t,n)=>d7([t],e,n).some(r=>r.id===t.id),J1=(e,t,n)=>{let[r,i,a,s]=lt(t,n),[o,c,d,l]=Dt(e);return r<=o&&i<=c&&a>=d&&s>=l},pc=(e,t,n)=>J1([e],t,n)||i7(e,t,n)||a7(e,t,n),US=(e,t,n)=>{let[r,i,a,s]=lt(t,n);return SI(A(r,i),A(e.x,e.y),A(a,s))},Jre=e=>{let t=new Map;for(let n of e){let r=tt(n)?n.id:n.frameId;r&&!t.has(r)&&t.set(r,Ks(e,r))}return t},Ks=(e,t)=>{let n=[];for(let r of e.values())r.frameId===t&&n.push(r);return n},s7=e=>e.filter(t=>tt(t)),o7=e=>{let t=nt(s7(e));return e.filter(n=>t.has(n.id)||!n.frameId||!t.has(n.frameId))},Sg=(e,t,n,r)=>{let i=Ks(e,t.id),a=new Set(i),s=new Set([...WL(e,t,r),...i.filter(f=>a7(f,t,r))]),o=i.filter(f=>!s.has(f)),c=new Set(Array.from(s).flatMap(f=>f.groupIds));for(let f of o)if(!i7(f,t,r))f.groupIds.length===0&&a.delete(f);else if(f.groupIds.length>0)for(let g of f.groupIds)c.add(g);for(let f of o)if(f.groupIds.length>0){let g=!0;for(let U of f.groupIds)c.has(U)&&(g=!1);g&&a.delete(f)}let d=Array.from(s).filter(f=>f.groupIds.length===0);for(let f of d)a.add(f);let l=Array.from(s).filter(f=>f.groupIds.length>0),h=KA(l,n);for(let[f,g]of Object.entries(h))if(g){let U=rn(e,f);if(J1(U,t,r))for(let y of U)a.add(y)}return[...a].filter(f=>!(Le(f)&&f.containerId))},eie=(e,t,n)=>tie(WU(e,WL(e,t,n)),t,n),tie=(e,t,n)=>{let r=[],i=new Map;for(let a of e){let s=!1;if(a.groupIds.length>0){if(a.groupIds.some(o=>i.get(o)))s=!0;else{let o=new Set(a.groupIds.flatMap(c=>rn(n,c)));s=!J1(Array.from(o),t,n)}a.groupIds.forEach(o=>{i.set(o,s)})}s||r.push(a)}return r},bi=(e,t)=>e.frameId&&t.get(e.frameId)||null,nie=(e,t)=>{let n=new Set,r=nt(e);e=WU(e);for(let s of e)tt(s)&&s.id!==t.id&&n.add(s.id);let i=new Set,a=[];for(let s of e)if(!(tt(s)||s.frameId&&n.has(s.frameId)))if(s.groupIds.length){let o=s.groupIds.at(-1);if(!i.has(o)){i.add(o);let c=rn(e,o);if(c.some(d=>pc(d,t,r)))for(let d of c)a.push(d)}}else pc(s,t,r)&&a.push(s);return a},Dp=(e,t,n,r)=>{let i=nt(e),a=new Map;for(let d of e.values())d.frameId===n.id&&a.set(d.id,!0);let s=new Set(t.map(d=>d.id)),o=[],c=new Set;for(let d of t)tt(d)&&d.id!==n.id&&c.add(d.id);for(let d of WU(e,t)){if(tt(d)||d.frameId&&c.has(d.frameId)||d.frameId&&r.selectedElementIds[d.id]&&r.selectedElementIds[d.frameId])continue;a.has(d.id)||o.push(d);let l=pt(d,i);l&&!s.has(l.id)&&!a.has(l.id)&&o.push(l)}for(let d of o)me(d,{frameId:n.id},!1);return e},HU=(e,t)=>{let n=new Map,r=new Map;for(let i of e)if(i.frameId){n.set(i.id,i);let a=r.get(i.frameId)||[];a.push(i);let s=pt(i,t);s&&(n.set(s.id,s),a.push(s)),r.set(i.frameId,a)}for(let[,i]of n)me(i,{frameId:null},!1)},XL=(e,t)=>{let n=Ks(e,t.id);return HU(n,nt(e)),e},VL=(e,t,n,r)=>Dp(XL(e,n),t,n,r.state).slice(),xh=(e,t,n)=>{let r=n.scene.getSelectedElements({selectedElementIds:t.selectedElementIds,elements:e}),i=new Set(r);if(t.editingGroupId)for(let o of r)o.groupIds.length===0?i.add(o):o.groupIds.flatMap(c=>rn(e,c)).forEach(c=>i.add(c));let a=new Set,s=nt(e);return i.forEach(o=>{o.frameId&&!tt(o)&&!S2(o,s,t)&&a.add(o)}),a.size>0&&HU(a,s),e},WU=(e,t)=>{let n=new Set,r=t||e;for(let s of r.values()){let o=s.groupIds[s.groupIds.length-1];o&&n.add(o)}let i=new Set;for(let s of n)rn(e,s).some(o=>tt(o))&&i.add(s);let a=[];for(let s of r.values())i.has(s.groupIds[s.groupIds.length-1])||a.push(s);return a},X3=(e,t,n)=>{let r=Le(e)&&ur(e,t)||e;return r.frameId&&n.selectedElementIds[r.id]&&n.selectedElementIds[r.frameId]?bi(r,t):n.selectedElementIds[r.id]&&n.selectedElementsAreBeingDragged?n.frameToHighlight:bi(r,t)},S2=(e,t,n,r)=>{var c;let i=(r==null?void 0:r.targetFrame)??X3(e,t,n);if(!i)return!1;let a=Le(e)&&ur(e,t)||e,s=d=>{r!=null&&r.checkedGroups&&a.groupIds.forEach(l=>{var h;(h=r.checkedGroups)==null||h.set(l,d)})};if(!n.selectedElementIds[a.id]||!n.selectedElementsAreBeingDragged||n.selectedElementIds[a.id]&&n.selectedElementIds[i.id])return!0;if(a.groupIds.length===0)return pc(a,i,t);for(let d of a.groupIds)if((c=r==null?void 0:r.checkedGroups)!=null&&c.has(d))return r.checkedGroups.get(d);let o=new Set(a.groupIds.filter(d=>r!=null&&r.checkedGroups?!r.checkedGroups.has(d):!0).flatMap(d=>rn(t,d)));if(n.editingGroupId&&n.selectedElementsAreBeingDragged){let d=new Set(gt(t,n));if(n.frameToHighlight!==null)return!0;d.forEach(l=>{o.delete(l)})}for(let d of o)if(tt(d))return s(!1),!1;for(let d of o)if(pc(d,i,t))return s(!0),!0;return!1},bS=(e,t,n,r,i)=>{if(!n.frameRendering||!n.frameRendering.clip)return!1;let a=i7(e,t,r)||a7(e,t,r);if(a){for(let s of e.groupIds)i==null||i.set(s,!0);return!0}if(!a&&e.groupIds.length>0&&!J1([e],t,r)){let s=!1;if(n.selectedElementsAreBeingDragged)s=S2(e,r,n,{targetFrame:t,checkedGroups:i});else{s=e.frameId===t.id;for(let o of e.groupIds)i==null||i.set(o,s)}for(let o of e.groupIds)i==null||i.set(o,s);return s}return!1},YL=e=>e.name===null?PI(e)?"Frame":"AI Frame":e.name,l7=(e,t)=>zL({elements:e,bounds:t,type:"overlap"}).filter(n=>!n.frameId||n.frameId===t.id),GL=e=>{let t=nt(e);return e.length>1&&e.some(n=>n.frameId&&t.has(n.frameId))},c7=e=>{let t=new Set;return e.forEach(n=>{tt(n)&&t.add(n.id)}),e.filter(n=>!(n.frameId&&t.has(n.frameId)))},d7=(e,t,n,r=!0)=>{let[i,a,s,o]=lt(t,n),c=e.filter(d=>{let[l,h,f,g]=as(d,n),U=bi(d,n);if(U){let[y,v,x,w]=as(U,n);l=Math.max(y,l),h=Math.max(v,h),f=Math.min(x,f),g=Math.min(w,g)}return d.locked===!1&&d.type!=="selection"&&!an(d)&&i<=l&&a<=h&&s>=f&&o>=g});return c=r?c7(c):c,c=c.filter(d=>{let l=bi(d,n);return l?pc(d,l,n):!0}),c},qL=(e,t,n,r)=>{let i=new Set(t.map(a=>a.id));return e.filter(a=>{let s=_2(a,n.width,n.height,n,r);return!i.has(a.id)&&s})},Vn=function(){let e=null,t=null,n=null,r=(i,a)=>(n!=null&&i===e&&a.selectedElementIds===t||(n=i.some(s=>a.selectedElementIds[s.id]),e=i,t=a.selectedElementIds),n);return r.clearCache=()=>{e=null,t=null,n=null},r}(),rie=(e,t,n)=>{let r=Array.from(new Set(gt(e,t).map(i=>n(i))));return r.length===1?r[0]:null},gt=(e,t,n)=>{let r=new Set,i=[];for(let a of e.values()){if(t.selectedElementIds[a.id]){i.push(a),r.add(a.id);continue}if(n!=null&&n.includeBoundTextElement&&an(a)&&t.selectedElementIds[a==null?void 0:a.containerId]){i.push(a),r.add(a.id);continue}}if(n!=null&&n.includeElementsInFrames){let a=[];return i.forEach(s=>{tt(s)&&Ks(e,s.id).forEach(o=>!r.has(o.id)&&a.push(o)),a.push(s)}),a}return i},ZL=(e,t)=>t.editingTextElement?[t.editingTextElement]:t.newElement?[t.newElement]:gt(e,t,{includeBoundTextElement:!0}),At=(e,t)=>yr(t.selectedElementIds,e)?t.selectedElementIds:e,yS=e=>{let t=new Map,n=[];for(let r of e)r.isDeleted||(n.push(r),t.set(r.id,r));return{elementsMap:t,elements:n}},iie=F1(e=>{(mt.DEV||mt.MODE===fi.TEST||window!=null&&window.DEBUG_FRACTIONAL_INDICES)&&Bv(e,{shouldThrow:mt.DEV||mt.MODE===fi.TEST,includeBoundTextValidation:!0})},1e3*60,{leading:!0,trailing:!1}),aie=e=>{let t=["includeBoundTextElement","includeElementsInFrames"],n="";for(let r of t)n+=`${r}:${e[r]?"1":"0"}`;return n},vS=e=>typeof e=="string",V3=class _g{constructor(){H(this,"callbacks",new Set),H(this,"nonDeletedElements",[]),H(this,"nonDeletedElementsMap",fa(new Map)),H(this,"elements",[]),H(this,"nonDeletedFramesLikes",[]),H(this,"frames",[]),H(this,"elementsMap",fa(new Map)),H(this,"selectedElementsCache",{selectedElementIds:null,elements:null,cache:new Map}),H(this,"sceneNonce"),H(this,"insertElement",t=>{let n=t.frameId?this.getElementIndex(t.frameId):this.elements.length;this.insertElementAtIndex(t,n)}),H(this,"insertElements",t=>{var r;if(!t.length)return;let n=(r=t[0])!=null&&r.frameId?this.getElementIndex(t[0].frameId):this.elements.length;this.insertElementsAtIndex(t,n)}),H(this,"getContainerElement",t=>t&&t.containerId&&this.getElement(t.containerId)||null),H(this,"getElementsFromId",t=>{let n=this.getNonDeletedElementsMap(),r=n.get(t);return r?[r]:rn(n,t)})}static mapElementToScene(t,n){vS(t)?this.sceneMapById.set(t,n):(this.sceneMapByElement.set(t,n),this.sceneMapById.set(t.id,n))}static getScene(t){return vS(t)?this.sceneMapById.get(t)||null:this.sceneMapByElement.get(t)||null}getSceneNonce(){return this.sceneNonce}getNonDeletedElementsMap(){return this.nonDeletedElementsMap}getElementsIncludingDeleted(){return this.elements}getElementsMapIncludingDeleted(){return this.elementsMap}getNonDeletedElements(){return this.nonDeletedElements}getFramesIncludingDeleted(){return this.frames}getSelectedElements(t){let n=aie(t),r=(t==null?void 0:t.elements)||this.nonDeletedElements;if(this.selectedElementsCache.elements===r&&this.selectedElementsCache.selectedElementIds===t.selectedElementIds){let a=this.selectedElementsCache.cache.get(n);if(a)return a}else(t==null?void 0:t.elements)==null&&this.selectedElementsCache.cache.clear();let i=gt(r,{selectedElementIds:t.selectedElementIds},t);return(t==null?void 0:t.elements)==null&&(this.selectedElementsCache.selectedElementIds=t.selectedElementIds,this.selectedElementsCache.elements=this.nonDeletedElements,this.selectedElementsCache.cache.set(n,i)),i}getNonDeletedFramesLikes(){return this.nonDeletedFramesLikes}getElement(t){return this.elementsMap.get(t)||null}getNonDeletedElement(t){let n=this.getElement(t);return n&&q3(n)?n:null}mapElements(t){let n=!1,r=this.elements.map(i=>{let a=t(i);return a!==i&&(n=!0),a});return n&&this.replaceAllElements(r),n}replaceAllElements(t){let n=t instanceof Array?t:Array.from(t.values()),r=[];iie(n),this.elements=Jo(n),this.elementsMap.clear(),this.elements.forEach(a=>{tt(a)&&r.push(a),this.elementsMap.set(a.id,a),_g.mapElementToScene(a,this)});let i=yS(this.elements);this.nonDeletedElements=i.elements,this.nonDeletedElementsMap=i.elementsMap,this.frames=r,this.nonDeletedFramesLikes=yS(this.frames).elements,this.triggerUpdate()}triggerUpdate(){this.sceneNonce=Gs();for(let t of Array.from(this.callbacks))t()}onUpdate(t){if(this.callbacks.has(t))throw new Error;return this.callbacks.add(t),()=>{if(!this.callbacks.has(t))throw new Error;this.callbacks.delete(t)}}destroy(){this.elements=[],this.nonDeletedElements=[],this.nonDeletedFramesLikes=[],this.frames=[],this.elementsMap.clear(),this.selectedElementsCache.selectedElementIds=null,this.selectedElementsCache.elements=null,this.selectedElementsCache.cache.clear(),_g.sceneMapById.forEach((t,n)=>{t===this&&_g.sceneMapById.delete(n)}),this.callbacks.clear()}insertElementAtIndex(t,n){if(!Number.isFinite(n)||n<0)throw new Error("insertElementAtIndex can only be called with index >= 0");let r=[...this.elements.slice(0,n),t,...this.elements.slice(n)];Zs(r,nt([t])),this.replaceAllElements(r)}insertElementsAtIndex(t,n){if(!t.length)return;if(!Number.isFinite(n)||n<0)throw new Error("insertElementAtIndex can only be called with index >= 0");let r=[...this.elements.slice(0,n),...t,...this.elements.slice(n)];Zs(r,nt(t)),this.replaceAllElements(r)}getElementIndex(t){return this.elements.findIndex(n=>n.id===t)}};H(V3,"sceneMapByElement",new WeakMap),H(V3,"sceneMapById",new Map);var sie=V3,el=sie,me=(e,t,n=!0,r)=>{var l,h;let i=!1,{points:a,fixedSegments:s,fileId:o,startBinding:c,endBinding:d}=t;if(Pe(e)&&(Object.keys(t).length===0||typeof a<"u"||typeof s<"u"||typeof c<"u"||typeof d<"u")){let f=fa(((l=el.getScene(e))==null?void 0:l.getNonDeletedElementsMap())??new Map);t={...t,angle:0,...Zv({...e,x:t.x||e.x,y:t.y||e.y},f,{fixedSegments:s,points:a,startBinding:c,endBinding:d},{isDragging:r==null?void 0:r.isDragging})}}else typeof a<"u"&&(t={...gh(a),...t});for(let f in t){let g=t[f];if(typeof g<"u"){if(e[f]===g&&(typeof g!="object"||g===null||f==="groupIds"||f==="scale"))continue;if(f==="scale"){let U=e[f],y=g;if(U[0]===y[0]&&U[1]===y[1])continue}else if(f==="points"){let U=e[f],y=g;if(U.length===y.length){let v=!1,x=U.length;for(;--x;){let w=U[x],C=y[x];if(w[0]!==C[0]||w[1]!==C[1]){v=!0;break}}if(!v)continue}}e[f]=g,i=!0}}return i&&((typeof t.height<"u"||typeof t.width<"u"||typeof o<"u"||typeof a<"u")&&yn.delete(e),e.version++,e.versionNonce=Gs(),e.updated=Fh(),n&&((h=el.getScene(e))==null||h.triggerUpdate())),e},ct=(e,t,n=!1)=>{let r=!1;for(let i in t){let a=t[i];if(typeof a<"u"){if(e[i]===a&&(typeof a!="object"||a===null))continue;r=!0}}return!r&&!n?e:{...e,...t,updated:Fh(),version:e.version+1,versionNonce:Gs()}},e0=(e,t)=>(e.version=(t??e.version)+1,e.versionNonce=Gs(),e.updated=Fh(),e),Ad=e=>st(e)||pa(e)?e.points.length<2:e.width===0&&e.height===0,_2=(e,t,n,r,i)=>{let[a,s,o,c]=as(e,i),d=Yt({clientX:r.offsetLeft,clientY:r.offsetTop},r),l=Yt({clientX:r.offsetLeft+t,clientY:r.offsetTop+n},r);return d.x<=o&&d.y<=c&&l.x>=a&&l.y>=s},kg=(e,t,n,r,i,a)=>{let[s,o,c,d]=Dt(e,i),l=Yt({clientX:r.offsetLeft+((a==null?void 0:a.left)||0),clientY:r.offsetTop+((a==null?void 0:a.top)||0)},r),h=Yt({clientX:r.offsetLeft+t-((a==null?void 0:a.right)||0),clientY:r.offsetTop+n-((a==null?void 0:a.bottom)||0)},r);return s>=l.x&&o>=l.y&&c<=h.x&&d<=h.y},xS=(e,t,n)=>{let r=Math.abs(t),i=Math.abs(n);if(e==="line"||e==="arrow"||e==="freedraw"){let a=Math.round(Math.atan(i/r)/uc)*uc;a===0?n=0:a===Math.PI/2?t=0:n=r*Math.tan(a)*Math.sign(n)||n}else e!=="selection"&&(n=r*Math.sign(n));return{width:t,height:n}},Y3=(e,t,n,r)=>{let i=n-e,a=r-t,s=Math.round(Math.atan(a/i)/uc)*uc;if(s===0)a=0;else if(s===Math.PI/2)i=0;else{let o=Math.tan(s),c=-1,d=t-o*e,l=-1/o,h=-1,f=r-l*n,g=(c*f-h*d)/(o*h-l*c),U=(d*l-f*o)/(o*h-l*c);i=g-e,a=U-t}return{width:i,height:a}},KL=e=>{let t={width:e.width,height:e.height,x:e.x,y:e.y};if(e.width<0){let n=Math.abs(e.width);t.width=n,t.x=e.x-n}if(e.height<0){let n=Math.abs(e.height);t.height=n,t.y=e.y-n}return t},wS={mouse:8,pen:16,touch:28},oie=16,QL={e:!0,s:!0,n:!0,w:!0},ES={e:!0,s:!0,n:!0,w:!0,nw:!0,se:!0},ay={e:!0,s:!0,n:!0,w:!0},ko=(e,t,n,r,i,a,s)=>{let[o,c]=he(A(e+n/2,t+r/2),A(i,a),s);return[o-n/2,c-r/2,n,r]},u7=e=>!(e.viewport.isMobile||e.isTouchScreen&&(FV||mI)),jp=e=>u7(e)?QL:{},h7=([e,t,n,r,i,a],s,o,c,d={},l=4,h=wd)=>{let f=wS[c],g=f/o.value,U=f/o.value,y=f/o.value,v=f/o.value,x=n-e,w=r-t,C=l/o.value,S=(f-h*2)/(2*o.value),k={nw:d.nw?void 0:ko(e-C-y+S,t-C-v+S,g,U,i,a,s),ne:d.ne?void 0:ko(n+C-S,t-C-v+S,g,U,i,a,s),sw:d.sw?void 0:ko(e-C-y+S,r+C-S,g,U,i,a,s),se:d.se?void 0:ko(n+C-S,r+C-S,g,U,i,a,s),rotation:d.rotation?void 0:ko(e+x/2-g/2,t-C-v+S-oie/o.value,g,U,i,a,s)},M=5*wS.mouse/o.value;return Math.abs(x)>M&&(d.n||(k.n=ko(e+x/2-g/2,t-C-v+S,g,U,i,a,s)),d.s||(k.s=ko(e+x/2-g/2,r+C-S,g,U,i,a,s))),Math.abs(w)>M&&(d.w||(k.w=ko(e-C-y+S,t+w/2-U/2,g,U,i,a,s)),d.e||(k.e=ko(n+C-S,t+w/2-U/2,g,U,i,a,s))),k},JL=(e,t,n,r="mouse",i=QL)=>{if(e.locked||Pe(e))return{};if(e.type==="freedraw"||st(e)){if(e.points.length===2){let[,s]=e.points;s[0]===0||s[1]===0?i=ay:s[0]>0&&s[1]<0?i=ES:s[0]>0&&s[1]>0?i=ay:s[0]<0&&s[1]>0?i=ES:s[0]<0&&s[1]<0&&(i=ay)}}else tt(e)&&(i={...i,rotation:!0});let a=st(e)?wd+8:Lt(e)?0:wd;return h7(lt(e,n,!0),e.angle,t,r,i,a,Lt(e)?0:void 0)},eR=(e,t)=>{if(t.editingLinearElement)return!1;if(e.length>1)return!0;let n=e[0];return Pe(n)?!1:st(n)?n.points.length>2:!0},G3=(e,t,n)=>t>=e[0]&&t<=e[0]+e[2]&&n>=e[1]&&n<=e[1]+e[3],lie=(e,t,n,r,i,a,s,o)=>{if(!n.selectedElementIds[e.id])return!1;let{rotation:c,...d}=JL(e,a,t,s,jp(o));if(c&&G3(c,r,i))return"rotation";let l=Object.keys(d).filter(h=>{let f=d[h];return f?G3(f,r,i):!1});if(l.length>0)return l[0];if(u7(o)){let[h,f,g,U,y,v]=lt(e,t);if(!(st(e)&&e.points.length<=2)){let x=Lt(e)?0:e2/a.value,w=e2/a.value,C=tR(A(h-x,f-x),A(g+x,U+x),A(y,v),e.angle);for(let[S,k]of Object.entries(C))if(Ed(A(r,i),k,w))return S}}return!1},CS=(e,t,n,r,i,a,s,o)=>e.reduce((c,d)=>{if(c)return c;let l=lie(d,s,t,n,r,i,a,o);return l?{element:d,transformHandleType:l}:null},null),SS=([e,t,n,r],i,a,s,o,c)=>{let d=h7([e,t,n,r,(e+n)/2,(t+r)/2],0,s,o,jp(c)),l=Object.keys(d).find(h=>{let f=d[h];return f&&G3(f,i,a)});if(l)return l;if(u7(c)){let h=(e+n)/2,f=(t+r)/2,g=e2/s.value,U=tR(A(e-g,t-g),A(n+g,r+g),A(h,f),0);for(let[y,v]of Object.entries(U))if(Ed(A(i,a),v,g))return y}return!1},sy=["ns","nesw","ew","nwse"],cie=(e,t)=>{let n=sy.indexOf(e);if(n>=0){let r=Math.round(t/(Math.PI/4));e=sy[(n+r)%sy.length]}return e},_S=e=>{let{element:t,transformHandleType:n}=e,r=t&&Math.sign(t.height)*Math.sign(t.width)===-1,i=null;switch(n){case"n":case"s":i="ns";break;case"w":case"e":i="ew";break;case"nw":case"se":r?i="nesw":i="nwse";break;case"ne":case"sw":r?i="nwse":i="nesw";break;case"rotation":return"grab"}return i&&t&&(i=cie(i,t.angle)),i?`${i}-resize`:""},tR=([e,t],[n,r],i,a)=>{let s=he(A(e,t),i,a),o=he(A(n,t),i,a),c=he(A(e,r),i,a),d=he(A(n,r),i,a);return{n:[s,o],e:[o,d],s:[d,c],w:[c,s]}},die=(e,t,n,r,i,a,s,o,c,d,l,h)=>{if(n.length===1){let[f]=n;if(t==="rotation")Pe(f)||(uie(f,r,i,c,d,a),gi(f,r));else{if(Le(f)&&t)return hie(e,f,r,t,s,c,d),gi(f,r),!0;if(t){let g=n[0].id,U=r.get(g),y=e.get(g);if(U&&y){let{nextWidth:v,nextHeight:x}=bie(U,y,r,e,t,c,d,{shouldMaintainAspectRatio:o,shouldResizeFromCenter:s});y1(v,x,U,y,r,e,t,{shouldMaintainAspectRatio:o,shouldResizeFromCenter:s})}}}return!0}else if(n.length>1){if(t==="rotation")return fie(e,n,r,i,c,d,a,l,h),!0;if(t){let{nextWidth:f,nextHeight:g,flipByX:U,flipByY:y,originalBoundingBox:v}=yie(n,e,r,t,c,d,{shouldMaintainAspectRatio:o,shouldResizeFromCenter:s});return nR(n,r,t,i,e,{shouldResizeFromCenter:s,shouldMaintainAspectRatio:o,flipByX:U,flipByY:y,nextWidth:f,nextHeight:g,originalBoundingBox:v}),!0}}return!1},uie=(e,t,n,r,i,a)=>{let[s,o,c,d]=lt(e,t),l=(s+c)/2,h=(o+d)/2,f;tt(e)?f=0:(f=5*Math.PI/2+Math.atan2(i-h,r-l),a&&(f=f+uc/2,f=f-f%uc),f=i2(f));let g=Ko(e);if(me(e,{angle:f}),g){let U=n.getElement(g);U&&!Ut(e)&&me(U,{angle:f})}},f7=(e,t,n,r)=>st(e)||pa(e)?{points:m2(0,t,m2(1,n,e.points,r),r)}:{},p7=(e,t,n)=>{let r=e.width;if(an(e)){let a=ur(e,t);a&&(r=Qo(a,e))}let i=e.fontSize*(n/r);return i<cv?null:{size:i}},hie=(e,t,n,r,i,a,s)=>{let[o,c,d,l,h,f]=lt(t,n),[g,U]=he(A(a,s),A(h,f),-t.angle),y=0,v=0;r!=="e"&&r!=="w"&&(r.includes("e")&&(y=(g-o)/(d-o)),r.includes("w")&&(y=(d-g)/(d-o)),r.includes("n")&&(v=(l-U)/(l-c)),r.includes("s")&&(v=(U-c)/(l-c)));let x=Math.max(y,v);if(x>0){let w=t.width*x,C=t.height*x,S=p7(t,n,w);if(S===null)return;let k=[o,c],M=[d,l],T=[h,f],R=A(o,c);if(["n","w","nw"].includes(r)&&(R=A(M[0]-Math.abs(w),M[1]-Math.abs(C))),r==="ne"){let W=[k[0],M[1]];R=A(W[0],W[1]-Math.abs(C))}if(r==="sw"){let W=[M[0],k[1]];R=A(W[0]-Math.abs(w),W[1])}["s","n"].includes(r)&&(R[0]=T[0]-w/2),["e","w"].includes(r)&&(R[1]=T[1]-C/2),i&&(R[0]=T[0]-Math.abs(w)/2,R[1]=T[1]-Math.abs(C)/2);let j=t.angle,P=he(R,A(h,f),j),N=A(R[0]+Math.abs(w)/2,R[1]+Math.abs(C)/2),F=he(N,A(h,f),j);R=he(P,F,-j);let[$,q]=R;me(t,{fontSize:S.size,width:w,height:C,x:$,y:q})}if(r==="e"||r==="w"){let w=e.get(t.id),[C,S,k,M]=oc(w,w.width,w.height,!0),T=A(C,S),R=A(k,M),j=H1(T,R),P=he(A(a,s),j,-w.angle),[N,,F]=oc(t,t.width,t.height,!0),$=F-N,q=R[0]-T[0],W=bv(Bt({fontSize:t.fontSize,fontFamily:t.fontFamily}),t.lineHeight),V=q/$;r.includes("e")&&(V=(P[0]-T[0])/$),r.includes("w")&&(V=(R[0]-P[0])/$);let B=t.width*V<W?W:t.width*V,z=zd(t.originalText,Bt(t),Math.abs(B)),Y=jr(z,Bt(t),t.lineHeight),K=Y.height,[G,ee,de,xe]=oc(w,B,K,!0),ve=de-G,Me=xe-ee,Ce=[...T];["n","w","nw"].includes(r)&&(Ce=[R[0]-Math.abs(ve),T[1]]);let ge=w.angle,$e=he(Ce,j,ge),je=A(Ce[0]+Math.abs(ve)/2,Ce[1]+Math.abs(Me)/2),Je=he(je,j,ge);Ce=he($e,Je,-ge);let ut={width:Math.abs(B),height:Math.abs(Y.height),x:Ce[0],y:Ce[1],text:z,autoResize:!1};me(t,ut)}},fie=(e,t,n,r,i,a,s,o,c)=>{var l;let d=5*Math.PI/2+Math.atan2(a-c,i-o);s&&(d+=uc/2,d-=d%uc);for(let h of t)if(!tt(h)){let[f,g,U,y]=lt(h,n),v=(f+U)/2,x=(g+y)/2,w=((l=e.get(h.id))==null?void 0:l.angle)??h.angle,[C,S]=he(A(v,x),A(o,c),d+w-h.angle);Pe(h)?me(h,{points:ene(h,n)}):me(h,{x:h.x+(C-v),y:h.y+(S-x),angle:i2(d+w)},!1),gi(h,n,{simultaneouslyUpdated:t});let k=pt(h,n);k&&!Ut(h)&&me(k,{x:k.x+(C-v),y:k.y+(S-x),angle:i2(d+w)},!1)}r.triggerUpdate()},pie=(e,t,n,r,i)=>{let[a,s,o,c]=t.length===1?lt(t[0],n):Dt(t),d=(a+o)/2,l=(s+c)/2,h=t.length===1?t[0].angle:0;switch([r,i]=he(A(r,i),A(d,l),-h),e){case"n":return he(A(r-(a+o)/2,i-s),A(0,0),h);case"s":return he(A(r-(a+o)/2,i-c),A(0,0),h);case"w":return he(A(r-a,i-(s+c)/2),A(0,0),h);case"e":return he(A(r-o,i-(s+c)/2),A(0,0),h);case"nw":return he(A(r-a,i-s),A(0,0),h);case"ne":return he(A(r-o,i-s),A(0,0),h);case"sw":return he(A(r-a,i-c),A(0,0),h);case"se":return he(A(r-o,i-c),A(0,0),h);default:return[0,0]}},mie=(e,t)=>{let[,[n,r]]=t.points;return e==="nw"&&(n<0||r<0)||e==="ne"&&n>=0||e==="sw"&&n<=0||e==="se"&&(n>0||r>0)?"end":"origin"},gie=(e,t,n)=>{if(n)return"center";if(t)switch(e){case"n":return"south-side";case"e":return"west-side";case"s":return"north-side";case"w":return"east-side";case"ne":return"bottom-left";case"nw":return"bottom-right";case"se":return"top-left";case"sw":return"top-right"}return["e","se","s"].includes(e)?"top-left":["n","nw","w"].includes(e)?"bottom-right":e==="ne"?"bottom-left":"top-right"},Uie=(e,t,n,r,i,a,s,o,c)=>{let d=gie(s,o,c),[l,h]=e;switch(d){case"top-left":return{x:l+(t-r)/2+(r-t)/2*Math.cos(a)+(n-i)/2*Math.sin(a),y:h+(n-i)/2+(r-t)/2*Math.sin(a)+(i-n)/2*Math.cos(a)};case"top-right":return{x:l+(t-r)/2*(Math.cos(a)+1)+(n-i)/2*Math.sin(a),y:h+(n-i)/2+(t-r)/2*Math.sin(a)+(i-n)/2*Math.cos(a)};case"bottom-left":return{x:l+(t-r)/2*(1-Math.cos(a))+(i-n)/2*Math.sin(a),y:h+(n-i)/2*(Math.cos(a)+1)+(r-t)/2*Math.sin(a)};case"bottom-right":return{x:l+(t-r)/2*(Math.cos(a)+1)+(i-n)/2*Math.sin(a),y:h+(n-i)/2*(Math.cos(a)+1)+(t-r)/2*Math.sin(a)};case"center":return{x:l-(r-t)/2,y:h-(i-n)/2};case"east-side":return{x:l+(t-r)/2*(Math.cos(a)+1),y:h+(t-r)/2*Math.sin(a)+(n-i)/2};case"west-side":return{x:l+(t-r)/2*(1-Math.cos(a)),y:h+(r-t)/2*Math.sin(a)+(n-i)/2};case"north-side":return{x:l+(t-r)/2+(n-i)/2*Math.sin(a),y:h+(i-n)/2*(Math.cos(a)-1)};case"south-side":return{x:l+(t-r)/2+(i-n)/2*Math.sin(a),y:h+(n-i)/2*(Math.cos(a)+1)}}},y1=(e,t,n,r,i,a,s,{shouldInformMutation:o=!0,shouldMaintainAspectRatio:c=!1,shouldResizeFromCenter:d=!1}={})=>{let l={},h=pt(n,i);if(h){let y=a.get(h.id);if(y&&(l={fontSize:y.fontSize}),c){let v={...n,width:e},x=p7(h,i,Qo(v,h));if(x===null)return;l={fontSize:x.size}}else{let v=BI(Bt(h),h.lineHeight),x=zI(h.fontSize,h.lineHeight);e=Math.max(e,v),t=Math.max(t,x)}}let f=f7(r,e,t,!0),g=A(r.x,r.y);if(st(r)){let[y,v]=as(r,a);g=A(y,v)}let U=Uie(g,r.width,r.height,e,t,r.angle,s,c,d);if(st(r)&&f.points){let y=r.x-g[0],v=r.y-g[1];U.x+=y,U.y+=v;let x=f.points[0][0],w=f.points[0][1];U.x+=x,U.y+=w,f.points=f.points.map(C=>A(C[0]-x,C[1]-w))}if(e<0&&(U.x=U.x+e),t<0&&(U.y=U.y+t),"scale"in n&&"scale"in r&&me(n,{scale:[(Math.sign(e)||r.scale[0])*r.scale[0],(Math.sign(t)||r.scale[1])*r.scale[1]]}),Ut(n)&&h&&c){let y=e/n.width*h.fontSize;if(y<cv)return;l.fontSize=y}if(e!==0&&t!==0&&Number.isFinite(U.x)&&Number.isFinite(U.y)){let y={...U,width:Math.abs(e),height:Math.abs(t),...f};me(n,y,o),gi(n,i,{newSize:{width:e,height:t}}),h&&l!=null&&me(h,{fontSize:l.fontSize}),G1(n,i,s,c)}},bie=(e,t,n,r,i,a,s,{shouldMaintainAspectRatio:o=!1,shouldResizeFromCenter:c=!1}={})=>{let[d,l,h,f]=oc(t,t.width,t.height,!0),g=A(d,l),U=A(h,f),y=H1(g,U),v=he(A(a,s),y,-t.angle),[x,w,C,S]=oc(e,e.width,e.height,!0),k=C-x,M=S-w,T=U[0]-g[0],R=U[1]-g[1],j=T/k,P=R/M;i.includes("e")&&(j=(v[0]-g[0])/k),i.includes("s")&&(P=(v[1]-g[1])/M),i.includes("w")&&(j=(U[0]-v[0])/k),i.includes("n")&&(P=(U[1]-v[1])/M);let N=e.width*j,F=e.height*P;if(c&&(N=2*N-t.width,F=2*F-t.height),o){let $=Math.abs(N)/t.width,q=Math.abs(F)/t.height;if(i.length===1&&(F*=$,N*=q),i.length===2){let W=Math.max($,q);N=t.width*W*Math.sign(N),F=t.height*W*Math.sign(F)}}return{nextWidth:N,nextHeight:F}},yie=(e,t,n,r,i,a,{shouldMaintainAspectRatio:s=!1,shouldResizeFromCenter:o=!1}={})=>{let c=e.map($=>t.get($.id)),d=c.reduce(($,q)=>{if(!st(q))return $;let W=Ko(q);if(!W)return $;let V=t.get(W)??null;return an(V)?[...$,{...V,...Re.getBoundTextElementPosition(q,V,n)}]:$},[]),l=es(c.map($=>$).concat(d)),{minX:h,minY:f,maxX:g,maxY:U,midX:y,midY:v}=l,x=g-h,w=U-f,C={ne:[h,U],se:[h,f],sw:[g,f],nw:[g,U],e:[h,f+w/2],w:[g,f+w/2],n:[h+x/2,U],s:[h+x/2,f]},[S,k]=o?[y,v]:C[r],M=o?2:1,T=Math.max(Math.abs(i-S)/x||0,Math.abs(a-k)/w||0)*M,R=r.includes("e")||r.includes("w")?Math.abs(i-S)*M:x,j=r.includes("n")||r.includes("s")?Math.abs(a-k)*M:w;s&&(R=x*T*Math.sign(i-S),j=w*T*Math.sign(a-k));let P={ne:[i<S,a>k],se:[i<S,a<k],sw:[i>S,a<k],nw:[i>S,a>k],e:[i<S,!1],w:[i>S,!1],n:[!1,a>k],s:[!1,a<k]},[N,F]=P[r].map($=>$);return{originalBoundingBox:l,nextWidth:R,nextHeight:j,flipByX:N,flipByY:F}},nR=(e,t,n,r,i,{shouldMaintainAspectRatio:a=!1,shouldResizeFromCenter:s=!1,flipByX:o=!1,flipByY:c=!1,nextHeight:d,nextWidth:l,originalBoundingBox:h}={})=>{if(l===void 0&&d===void 0&&o===void 0&&c===void 0||d===0||l===0)return;i||(i=t);let f=e.reduce((M,T)=>{let R=i.get(T.id);return R&&M.push({orig:R,latest:T}),M},[]),g;if(h)g=h;else{let M=f.reduce((T,{orig:R})=>{if(!st(R))return T;let j=Ko(R);if(!j)return T;let P=i.get(j)??null;return an(P)?[...T,{...P,...Re.getBoundTextElementPosition(R,P,t)}]:T},[]);g=es(f.map(({orig:T})=>T).concat(M))}let{minX:U,minY:y,maxX:v,maxY:x,midX:w,midY:C}=g,S=v-U,k=x-y;if(l===void 0&&d===void 0&&(l=S,d=k),a&&(l===void 0?l=d*(S/k):d===void 0?d=l*(k/S):Math.abs(l/d-S/k)>.001&&(l=d*(S/k))),l&&d){let M=n.includes("e")||n.includes("w")?Math.abs(l)/S:1,T=n.includes("n")||n.includes("s")?Math.abs(d)/k:1,R;n.length===1?R=n.includes("e")||n.includes("w")?M:T:R=Math.max(Math.abs(l)/S||0,Math.abs(d)/k||0);let j={ne:[U,x],se:[U,y],sw:[v,y],nw:[v,x],e:[U,y+k/2],w:[v,y+k/2],n:[U+S/2,x],s:[U+S/2,y]},[P,N]=s?[w,C]:j[n],F=a||f.some(B=>B.latest.angle!==0||Le(B.latest)||Uh(B.latest));F&&(M=R,T=R);let[$,q]=[o?-1:1,c?-1:1],W=[];for(let{orig:B,latest:z}of f){if(Le(B)&&an(B))continue;let Y=B.width*M,K=B.height*T,G=i2(B.angle*$*q),ee=st(B)||pa(B),de=B.x-P,xe=B.y-N,ve=o&&!ee?Y:0,Me=c&&!ee?K:0,Ce=P+$*(de*M+ve),ge=N+q*(xe*T+Me),$e=f7(B,Y*$,K*q,!1),je={x:Ce,y:ge,width:Y,height:K,angle:G,...$e};if(Pe(B)&&(B.startBinding&&(je.startBinding={...B.startBinding,fixedPoint:[o?-B.startBinding.fixedPoint[0]+1:B.startBinding.fixedPoint[0],c?-B.startBinding.fixedPoint[1]+1:B.startBinding.fixedPoint[1]]}),B.endBinding&&(je.endBinding={...B.endBinding,fixedPoint:[o?-B.endBinding.fixedPoint[0]+1:B.endBinding.fixedPoint[0],c?-B.endBinding.fixedPoint[1]+1:B.endBinding.fixedPoint[1]]}),B.fixedSegments&&$e.points&&(je.fixedSegments=B.fixedSegments.map(ut=>({...ut,start:$e.points[ut.index-1],end:$e.points[ut.index]})))),Lt(B)&&(je.scale=[B.scale[0]*$,B.scale[1]*q]),Le(B)){let ut=p7(B,t,Y);if(!ut)return;je.fontSize=ut.size}let Je=i.get(Ko(B)??"");if(Je)if(F){let ut=Je.fontSize*R;if(ut<cv)return;je.boundTextFontSize=ut}else je.boundTextFontSize=Je.fontSize;W.push({element:z,update:je})}let V=W.map(({element:B})=>B);for(let{element:B,update:{boundTextFontSize:z,...Y}}of W){let{width:K,height:G,angle:ee}=Y;me(B,Y,!1,{isDragging:!0}),gi(B,t,{simultaneouslyUpdated:V,newSize:{width:K,height:G}});let de=pt(B,t);de&&z&&(me(de,{fontSize:z,angle:st(B)?void 0:ee},!1),G1(B,t,n,!0))}r.triggerUpdate()}},vie=(e,t,n,r,i,a)=>{if(t.length===1&&Pe(t[0])&&(t[0].startBinding||t[0].endBinding))return;let s=t.filter(h=>{if(Pe(h)&&h.startBinding&&h.endBinding){let f=t.find(U=>{var y;return U.id===((y=h.startBinding)==null?void 0:y.elementId)}),g=t.find(U=>{var y;return U.id===((y=h.endBinding)==null?void 0:y.elementId)});return f&&g}return!0}),o=new Set(s),c=s.filter(h=>tt(h)).map(h=>h.id);if(c.length>0)for(let h of r.getNonDeletedElements())h.frameId!==null&&c.includes(h.frameId)&&o.add(h);let d=Dt(Array.from(o).map(h=>e.originalElements.get(h.id)??h)),l=xie(d,n,i,a);o.forEach(h=>{if(kS(e,h,l),!Ut(h)){let f=pt(h,r.getNonDeletedElementsMap());f&&kS(e,f,l),gi(h,r.getElementsMapIncludingDeleted(),{simultaneouslyUpdated:Array.from(o)})}})},xie=(e,t,n,r)=>{let[i,a]=e,s=i+t.x+n.x,o=a+t.y+n.y;if(n.x===0||n.y===0){let[c,d]=zn(i+t.x,a+t.y,r);n.x===0&&(s=c),n.y===0&&(o=d)}return{x:s-i,y:o-a}},kS=(e,t,n)=>{let r=e.originalElements.get(t.id)??t,i=r.x+n.x,a=r.y+n.y;me(t,{x:i,y:a})},wie=(e,t,n)=>{let[r,i]=Dt(e);return[t-r,n-i]},TS=({newElement:e,elementType:t,originX:n,originY:r,x:i,y:a,width:s,height:o,shouldMaintainAspectRatio:c,shouldResizeFromCenter:d,zoom:l,widthAspectRatio:h=null,originOffset:f=null,informMutation:g=!0})=>{c&&e.type!=="selection"&&(h?o=s/h:(Math.abs(a-r)>Math.abs(i-n)?{width:s,height:o}=xS(t,o,i<n?-s:s):{width:s,height:o}=xS(t,s,a<r?-o:o),o<0&&(o=-o)));let U=i<n?n-s:n,y=a<r?r-o:r;d&&(s+=s,o+=o,U=n-s/2,y=r-o/2);let v=null;if(Le(e)){o=e.height;let x=bv(Bt({fontSize:e.fontSize,fontFamily:e.fontFamily}),e.lineHeight);s=Math.max(s,x),Math.abs(i-n)>WV/l&&(v={autoResize:!1}),y=r,d&&(U=n-s/2)}if(s!==0&&o!==0){let x=null;Lt(e)&&(x={initialWidth:s,initialHeight:o}),me(e,{x:U+((f==null?void 0:f.x)??0),y:y+((f==null?void 0:f.y)??0),width:s,height:o,...v,...x},g)}},m7=(e,t)=>{var n;return!!(!e.viewModeEnabled&&((n=e.openDialog)==null?void 0:n.name)!=="elementLinkSelector"&&(e.activeTool.type!=="custom"&&(e.editingTextElement||e.activeTool.type!=="selection"&&e.activeTool.type!=="eraser"&&e.activeTool.type!=="hand"&&e.activeTool.type!=="laser")||gt(t,e).length))},rR=e=>{let t=5381;for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);t=(t<<5)+t+r}return t>>>0},Eie=e=>e.filter(t=>!t.isDeleted&&!Ad(t)),Vt=e=>e.filter(t=>!t.isDeleted),q3=e=>!e.isDeleted,Cie=e=>Vt(e).map(t=>Uv(t.type)?{...t,lastCommittedPoint:null}:t),iR=e=>Cie(e),aR=async e=>{let t;if(e.type===We.png)try{return await(await ye(async()=>{const{decodePngMetadata:n}=await Promise.resolve().then(()=>U$);return{decodePngMetadata:n}},void 0,import.meta.url)).decodePngMetadata(e)}catch(n){throw n.message==="INVALID"?new rd("Image doesn't contain scene","IMAGE_NOT_CONTAINS_SCENE_DATA"):new rd("Error: cannot restore image")}else if("text"in Blob?t=await e.text():t=await new Promise(n=>{let r=new FileReader;r.readAsText(e,"utf8"),r.onloadend=()=>{r.readyState===FileReader.DONE&&n(r.result)}}),e.type===We.svg)try{return lre({svg:t})}catch(n){throw n.message==="INVALID"?new rd("Image doesn't contain scene","IMAGE_NOT_CONTAINS_SCENE_DATA"):new rd("Error: cannot restore image")}return t},sR=e=>{var t;return e&&((t=e.name.match(/\.(json|excalidraw|png|svg)$/))==null?void 0:t[1])||null},Sie=e=>e==="png"||e==="svg",g7=e=>{let t=sR(e);return t==="png"||t==="svg"},oR=e=>!!e&&Object.values(lh).includes(e),pd=e=>{let{type:t}=e||{};return oR(t)},U7=async(e,t,n,r)=>{let i=await aR(e),a;try{try{a=JSON.parse(i)}catch(s){throw pd(e)?new rd("Image doesn't contain scene","IMAGE_NOT_CONTAINS_SCENE_DATA"):s}if(ere(a))return{type:We.excalidraw,data:Z1({elements:iR(a.elements||[]),appState:{theme:t==null?void 0:t.theme,fileHandle:r||e.handle||null,...CI(a.appState||{}),...t?p1(a.elements||[],t):{}},files:a.files},t,n,{repairBindings:!0,refreshDimensions:!1})};if(bL(a))return{type:We.excalidrawlib,data:a};throw new Error("Error: invalid file")}catch(s){throw s instanceof rd?s:new Error("Error: invalid file")}},b7=async(e,t,n,r)=>{let i=await U7(e,t,n,r);if(i.type!==We.excalidraw)throw new Error("Error: invalid file");return i.data},lR=(e,t="unpublished")=>{let n=JSON.parse(e);if(!bL(n))throw new Error("Invalid library");let r=n.libraryItems||n.library;return BU(r,t)},cR=async(e,t="unpublished")=>lR(await aR(e),t),v1=async e=>new Promise(async(t,n)=>{try{W1(e)&&(e=await e),e.toBlob(r=>{if(!r)return n(new Jq("Error: Canvas too big","CANVAS_POSSIBLY_TOO_BIG"));t(r)})}catch(r){n(r)}}),_ie=async e=>{try{let t=await window.crypto.subtle.digest("SHA-1",await ad(e));return OY(new Uint8Array(t))}catch(t){return console.error(t),sv(40)}},Z3=async e=>new Promise((t,n)=>{let r=new FileReader;r.onload=()=>{let i=r.result;t(i)},r.onerror=i=>n(i),r.readAsDataURL(e)}),kie=(e,t)=>`data:${t};base64,${hR(k2(e),!0)}`,Tie=(e,t="")=>{let n=e.indexOf(","),r=atob(e.slice(n+1)),i=e.slice(0,n).split(":")[1].split(";")[0],a=new ArrayBuffer(r.length),s=new Uint8Array(a);for(let o=0;o<r.length;o++)s[o]=r.charCodeAt(o);return new File([a],t,{type:i})},Mie=e=>fR(e.slice(e.indexOf(",")+1)),K3=async(e,t)=>{if(e.type===We.svg)return e;let[n,r]=await Promise.all([ye(()=>import("./pica-BYbIcfPn.js").then(a=>a.p),__vite__mapDeps([2,3]),import.meta.url).then(a=>a.default),ye(()=>import("./image-blob-reduce.esm-B6b2_-a4.js"),[],import.meta.url).then(a=>a.default)]),i=r({pica:n({features:["js","wasm"]})});if(t.outputType){let{outputType:a}=t;i._create_blob=function(s){return this.pica.toBlob(s.out_canvas,a,.8).then(o=>(s.out_blob=o,s))}}if(!pd(e))throw new Error("Error: unsupported file type",{cause:"UNSUPPORTED"});return new File([await i.toBlob(e,{max:t.maxWidthOrHeight,alpha:!0})],e.name,{type:t.outputType||e.type})},MS=(e,t="")=>new File([new TextEncoder().encode(e)],t,{type:We.svg}),Iie=async(e,t="")=>{let n;try{n=await fetch(e)}catch{throw new Error("Error: failed to fetch image",{cause:"FETCH_ERROR"})}if(!n.ok)throw new Error("Error: failed to fetch image",{cause:"FETCH_ERROR"});let r=await n.blob();if(r.type&&pd(r)){let i=t||r.name||"";return new File([r],i,{type:r.type})}throw new Error("Error: unsupported file type",{cause:"UNSUPPORTED"})},Aie=async e=>{let t=e.dataTransfer.files.item(0),n=await Lie(e);return{file:t?await y7(t):null,fileHandle:n}},Lie=async e=>{if(Bd)try{return await e.dataTransfer.items[0].getAsFileSystemHandle()||null}catch(t){return console.warn(t.name,t.message),null}return null},IS=e=>{let t=null,n=`${[...new Uint8Array(e).slice(0,8)].join(" ")} `,r={png:"137 80 78 71 13 10 26 10 ",jpg:"255 216 255 ",gif:"71 73 70 56 57 97 "};return n===r.png?t=We.png:n.startsWith(r.jpg)?t=We.jpg:n.startsWith(r.gif)&&(t=We.gif),t},gp=(e,t,n)=>new File([e],n||"",{type:t}),y7=async e=>{var t,n;if(e.type){if(pd(e)){let r=await ad(e),i=IS(r);i&&i!==e.type&&(e=gp(r,i,e.name))}}else if((t=e==null?void 0:e.name)!=null&&t.endsWith(".excalidrawlib"))e=gp(await ad(e),We.excalidrawlib,e.name);else if((n=e==null?void 0:e.name)!=null&&n.endsWith(".excalidraw"))e=gp(await ad(e),We.excalidraw,e.name);else{let r=await ad(e),i=IS(r);i&&(e=gp(r,i,e.name))}return e},ad=e=>"arrayBuffer"in e?e.arrayBuffer():new Promise((t,n)=>{let r=new FileReader;r.onload=i=>{var a;if(!((a=i.target)!=null&&a.result))return n(new Error("Couldn't convert blob to ArrayBuffer"));t(i.target.result)},r.readAsArrayBuffer(e)}),k2=e=>{let t=typeof e=="string"?new TextEncoder().encode(e):e instanceof Uint8Array?e:new Uint8Array(e),n="";for(let r of t)n+=String.fromCharCode(r);return n},dR=e=>{let t=new ArrayBuffer(e.length),n=new Uint8Array(t);for(let r=0,i=e.length;r<i;r++)n[r]=e.charCodeAt(r);return t},uR=e=>new TextDecoder("utf-8").decode(dR(e)),hR=(e,t=!1)=>t?window.btoa(e):window.btoa(k2(e)),fR=(e,t=!1)=>t?window.atob(e):uR(window.atob(e)),pR=({text:e,compress:t})=>{let n;if(t!==!1)try{n=k2(aX(e))}catch(r){console.error("encode: cannot deflate",r)}return{version:"1",encoding:"bstring",compressed:!!n,encoded:n||k2(e)}},mR=e=>{let t;switch(e.encoding){case"bstring":t=e.compressed?e.encoded:uR(e.encoded);break;default:throw new Error(`decode: unknown encoding "${e.encoding}"`)}return e.compressed?sX(new Uint8Array(dR(t)),{to:"string"}):t},gR=async e=>{let t=pM(new Uint8Array(await ad(e))).find(n=>n.name==="tEXt");return t?mM.decode(t.data):null},UR=async({blob:e,metadata:t})=>{let n=pM(new Uint8Array(await ad(e))),r=mM.encode(We.excalidraw,JSON.stringify(pR({text:t,compress:!0})));return n.splice(-1,0,r),new Blob([kz(n)],{type:We.png})},Rie=async e=>{let t=await gR(e);if((t==null?void 0:t.keyword)===We.excalidraw)try{let n=JSON.parse(t.text);if(!("encoded"in n)){if("type"in n&&n.type===da.excalidraw)return t.text;throw new Error("FAILED")}return mR(n)}catch(n){throw console.error(n),new Error("FAILED")}throw new Error("INVALID")},bR={paste:"Paste",pasteAsPlaintext:"Paste as plaintext",pasteCharts:"Paste charts",selectAll:"Select all",multiSelect:"Add element to selection",moveCanvas:"Move canvas",cut:"Cut",copy:"Copy",copyAsPng:"Copy to clipboard as PNG",copyAsSvg:"Copy to clipboard as SVG",copyText:"Copy to clipboard as text",copySource:"Copy source to clipboard",convertToCode:"Convert to code",bringForward:"Bring forward",sendToBack:"Send to back",bringToFront:"Bring to front",sendBackward:"Send backward",delete:"Delete",copyStyles:"Copy styles",pasteStyles:"Paste styles",stroke:"Stroke",changeStroke:"Change stroke color",background:"Background",changeBackground:"Change background color",fill:"Fill",strokeWidth:"Stroke width",strokeStyle:"Stroke style",strokeStyle_solid:"Solid",strokeStyle_dashed:"Dashed",strokeStyle_dotted:"Dotted",sloppiness:"Sloppiness",opacity:"Opacity",textAlign:"Text align",edges:"Edges",sharp:"Sharp",round:"Round",arrowheads:"Arrowheads",arrowhead_none:"None",arrowhead_arrow:"Arrow",arrowhead_bar:"Bar",arrowhead_circle:"Circle",arrowhead_circle_outline:"Circle (outline)",arrowhead_triangle:"Triangle",arrowhead_triangle_outline:"Triangle (outline)",arrowhead_diamond:"Diamond",arrowhead_diamond_outline:"Diamond (outline)",arrowhead_crowfoot_many:"Crow's foot (many)",arrowhead_crowfoot_one:"Crow's foot (one)",arrowhead_crowfoot_one_or_many:"Crow's foot (one or many)",more_options:"More options",arrowtypes:"Arrow type",arrowtype_sharp:"Sharp arrow",arrowtype_round:"Curved arrow",arrowtype_elbowed:"Elbow arrow",fontSize:"Font size",fontFamily:"Font family",addWatermark:'Add "Made with Excalidraw"',handDrawn:"Hand-drawn",normal:"Normal",code:"Code",small:"Small",medium:"Medium",large:"Large",veryLarge:"Very large",solid:"Solid",hachure:"Hachure",zigzag:"Zigzag",crossHatch:"Cross-hatch",thin:"Thin",bold:"Bold",left:"Left",center:"Center",right:"Right",extraBold:"Extra bold",architect:"Architect",artist:"Artist",cartoonist:"Cartoonist",fileTitle:"File name",colorPicker:"Color picker",canvasColors:"Used on canvas",canvasBackground:"Canvas background",drawingCanvas:"Drawing canvas",clearCanvas:"Clear canvas",layers:"Layers",actions:"Actions",language:"Language",liveCollaboration:"Live collaboration...",duplicateSelection:"Duplicate",untitled:"Untitled",name:"Name",yourName:"Your name",madeWithExcalidraw:"Made with Excalidraw",group:"Group selection",ungroup:"Ungroup selection",collaborators:"Collaborators",toggleGrid:"Toggle grid",addToLibrary:"Add to library",removeFromLibrary:"Remove from library",libraryLoadingMessage:"Loading library…",libraries:"Browse libraries",loadingScene:"Loading scene…",loadScene:"Load scene from file",align:"Align",alignTop:"Align top",alignBottom:"Align bottom",alignLeft:"Align left",alignRight:"Align right",centerVertically:"Center vertically",centerHorizontally:"Center horizontally",distributeHorizontally:"Distribute horizontally",distributeVertically:"Distribute vertically",flipHorizontal:"Flip horizontal",flipVertical:"Flip vertical",viewMode:"View mode",share:"Share",showStroke:"Show stroke color picker",showBackground:"Show background color picker",showFonts:"Show font picker",toggleTheme:"Toggle light/dark theme",theme:"Theme",personalLib:"Personal Library",excalidrawLib:"Excalidraw Library",decreaseFontSize:"Decrease font size",increaseFontSize:"Increase font size",unbindText:"Unbind text",bindText:"Bind text to the container",createContainerFromText:"Wrap text in a container",link:{edit:"Edit link",editEmbed:"Edit embeddable link",create:"Add link",label:"Link",labelEmbed:"Link & embed",empty:"No link is set",hint:"Type or paste your link here",goToElement:"Go to target element"},lineEditor:{edit:"Edit line",editArrow:"Edit arrow"},elementLock:{lock:"Lock",unlock:"Unlock",lockAll:"Lock all",unlockAll:"Unlock all"},statusPublished:"Published",sidebarLock:"Keep sidebar open",selectAllElementsInFrame:"Select all elements in frame",removeAllElementsFromFrame:"Remove all elements from frame",eyeDropper:"Pick color from canvas",textToDiagram:"Text to diagram",prompt:"Prompt",followUs:"Follow us",discordChat:"Discord chat",zoomToFitViewport:"Zoom to fit in viewport",zoomToFitSelection:"Zoom to fit selection",zoomToFit:"Zoom to fit all elements",installPWA:"Install Excalidraw locally (PWA)",autoResize:"Enable text auto-resizing",imageCropping:"Image cropping",unCroppedDimension:"Uncropped dimension",copyElementLink:"Copy link to object",linkToElement:"Link to object",wrapSelectionInFrame:"Wrap selection in frame"},yR={title:"Link to object",desc:"Click on a shape on canvas or paste a link.",notFound:"Linked object wasn't found on canvas."},vR={noItems:"No items added yet...",hint_emptyLibrary:"Select an item on canvas to add it here, or install a library from the public repository, below.",hint_emptyPrivateLibrary:"Select an item on canvas to add it here."},xR={title:"Find on canvas",noMatch:"No matches found...",singleResult:"result",multipleResults:"results",placeholder:"Find text on canvas..."},wR={clearReset:"Reset the canvas",exportJSON:"Export to file",exportImage:"Export image...",export:"Save to...",copyToClipboard:"Copy to clipboard",copyLink:"Copy link",save:"Save to current file",saveAs:"Save as",load:"Open",getShareableLink:"Get shareable link",close:"Close",selectLanguage:"Select language",scrollBackToContent:"Scroll back to content",zoomIn:"Zoom in",zoomOut:"Zoom out",resetZoom:"Reset zoom",menu:"Menu",done:"Done",edit:"Edit",undo:"Undo",redo:"Redo",resetLibrary:"Reset library",createNewRoom:"Create new room",fullScreen:"Full screen",darkMode:"Dark mode",lightMode:"Light mode",systemMode:"System mode",zenMode:"Zen mode",objectsSnapMode:"Snap to objects",exitZenMode:"Exit zen mode",cancel:"Cancel",clear:"Clear",remove:"Remove",embed:"Toggle embedding",publishLibrary:"Publish",submit:"Submit",confirm:"Confirm",embeddableInteractionButton:"Click to interact"},ER={clearReset:"This will clear the whole canvas. Are you sure?",couldNotCreateShareableLink:"Couldn't create shareable link.",couldNotCreateShareableLinkTooBig:"Couldn't create shareable link: the scene is too big",couldNotLoadInvalidFile:"Couldn't load invalid file",importBackendFailed:"Importing from backend failed.",cannotExportEmptyCanvas:"Cannot export empty canvas.",couldNotCopyToClipboard:"Couldn't copy to clipboard.",decryptFailed:"Couldn't decrypt data.",uploadedSecurly:"The upload has been secured with end-to-end encryption, which means that Excalidraw server and third parties can't read the content.",loadSceneOverridePrompt:"Loading external drawing will replace your existing content. Do you wish to continue?",collabStopOverridePrompt:`Stopping the session will overwrite your previous, locally stored drawing. Are you sure?
81
-
82
- (If you want to keep your local drawing, simply close the browser tab instead.)`,errorAddingToLibrary:"Couldn't add item to the library",errorRemovingFromLibrary:"Couldn't remove item from the library",confirmAddLibrary:"This will add {{numShapes}} shape(s) to your library. Are you sure?",imageDoesNotContainScene:"This image does not seem to contain any scene data. Have you enabled scene embedding during export?",cannotRestoreFromImage:"Scene couldn't be restored from this image file",invalidSceneUrl:"Couldn't import scene from the supplied URL. It's either malformed, or doesn't contain valid Excalidraw JSON data.",resetLibrary:"This will clear your library. Are you sure?",removeItemsFromsLibrary:"Delete {{count}} item(s) from library?",invalidEncryptionKey:"Encryption key must be of 22 characters. Live collaboration is disabled.",collabOfflineWarning:`No internet connection available.
83
- Your changes will not be saved!`},CR={unsupportedFileType:"Unsupported file type.",imageInsertError:"Couldn't insert image. Try again later...",fileTooBig:"File is too big. Maximum allowed size is {{maxSize}}.",svgImageInsertError:"Couldn't insert SVG image. The SVG markup looks invalid.",failedToFetchImage:"Failed to fetch image.",cannotResolveCollabServer:"Couldn't connect to the collab server. Please reload the page and try again.",importLibraryError:"Couldn't load library",saveLibraryError:"Couldn't save library to storage. Please save your library to a file locally to make sure you don't lose changes.",collabSaveFailed:"Couldn't save to the backend database. If problems persist, you should save your file locally to ensure you don't lose your work.",collabSaveFailed_sizeExceeded:"Couldn't save to the backend database, the canvas seems to be too big. You should save the file locally to ensure you don't lose your work.",imageToolNotSupported:"Images are disabled.",brave_measure_text_error:{line1:"Looks like you are using Brave browser with the <bold>Aggressively Block Fingerprinting</bold> setting enabled.",line2:"This could result in breaking the <bold>Text Elements</bold> in your drawings.",line3:"We strongly recommend disabling this setting. You can follow <link>these steps</link> on how to do so.",line4:"If disabling this setting doesn't fix the display of text elements, please open an <issueLink>issue</issueLink> on our GitHub, or write us on <discordLink>Discord</discordLink>"},libraryElementTypeError:{embeddable:"Embeddable elements cannot be added to the library.",iframe:"IFrame elements cannot be added to the library.",image:"Support for adding images to the library coming soon!"},asyncPasteFailedOnRead:"Couldn't paste (couldn't read from system clipboard).",asyncPasteFailedOnParse:"Couldn't paste.",copyToSystemClipboardFailed:"Couldn't copy to clipboard."},SR={selection:"Selection",image:"Insert image",rectangle:"Rectangle",diamond:"Diamond",ellipse:"Ellipse",arrow:"Arrow",line:"Line",freedraw:"Draw",text:"Text",library:"Library",lock:"Keep selected tool active after drawing",penMode:"Pen mode - prevent touch",link:"Add / Update link for a selected shape",eraser:"Eraser",frame:"Frame tool",magicframe:"Wireframe to code",embeddable:"Web Embed",laser:"Laser pointer",hand:"Hand (panning tool)",extraTools:"More tools",mermaidToExcalidraw:"Mermaid to Excalidraw"},_R={rectangle:"Rectangle",diamond:"Diamond",ellipse:"Ellipse",arrow:"Arrow",line:"Line",freedraw:"Freedraw",text:"Text",image:"Image",group:"Group",frame:"Frame",magicframe:"Wireframe to code",embeddable:"Web Embed",selection:"Selection",iframe:"IFrame"},kR={canvasActions:"Canvas actions",selectedShapeActions:"Selected shape actions",shapes:"Shapes"},TR={dismissSearch:"Escape to dismiss search",canvasPanning:"To move canvas, hold mouse wheel or spacebar while dragging, or use the hand tool",linearElement:"Click to start multiple points, drag for single line",arrowTool:"Click to start multiple points, drag for single line. Press {{arrowShortcut}} again to change arrow type.",freeDraw:"Click and drag, release when you're finished",text:"Tip: you can also add text by double-clicking anywhere with the selection tool",embeddable:"Click-drag to create a website embed",text_selected:"Double-click or press ENTER to edit text",text_editing:"Press Escape or CtrlOrCmd+ENTER to finish editing",linearElementMulti:"Click on last point or press Escape or Enter to finish",lockAngle:"You can constrain angle by holding SHIFT",resize:`You can constrain proportions by holding SHIFT while resizing,
84
- hold ALT to resize from the center`,resizeImage:`You can resize freely by holding SHIFT,
85
- hold ALT to resize from the center`,rotate:"You can constrain angles by holding SHIFT while rotating",lineEditor_info:"Hold CtrlOrCmd and Double-click or press CtrlOrCmd + Enter to edit points",lineEditor_pointSelected:`Press Delete to remove point(s),
86
- CtrlOrCmd+D to duplicate, or drag to move`,lineEditor_nothingSelected:`Select a point to edit (hold SHIFT to select multiple),
87
- or hold Alt and click to add new points`,placeImage:"Click to place the image, or click and drag to set its size manually",publishLibrary:"Publish your own library",bindTextToElement:"Press enter to add text",createFlowchart:"Hold CtrlOrCmd and Arrow key to create a flowchart",deepBoxSelect:"Hold CtrlOrCmd to deep select, and to prevent dragging",eraserRevert:"Hold Alt to revert the elements marked for deletion",firefox_clipboard_write:'This feature can likely be enabled by setting the "dom.events.asyncClipboard.clipboardItem" flag to "true". To change the browser flags in Firefox, visit the "about:config" page.',disableSnapping:"Hold CtrlOrCmd to disable snapping",enterCropEditor:"Double click the image or press ENTER to crop the image",leaveCropEditor:"Click outside the image or press ENTER or ESCAPE to finish cropping"},MR={cannotShowPreview:"Cannot show preview",canvasTooBig:"The canvas may be too big.",canvasTooBigTip:"Tip: try moving the farthest elements a bit closer together."},IR={headingMain:"Encountered an error. Try <button>reloading the page</button>.",clearCanvasMessage:"If reloading doesn't work, try <button>clearing the canvas</button>.",clearCanvasCaveat:" This will result in loss of work ",trackedToSentry:"The error with identifier {{eventId}} was tracked on our system.",openIssueMessage:"We were very cautious not to include your scene information on the error. If your scene is not private, please consider following up on our <button>bug tracker</button>. Please include information below by copying and pasting into the GitHub issue.",sceneContent:"Scene content:"},AR={or:"Or"},LR={desc_intro:"Invite people to collaborate on your drawing.",desc_privacy:"Don't worry, the session is end-to-end encrypted, and fully private. Not even our server can see what you draw.",button_startSession:"Start session",button_stopSession:"Stop session",desc_inProgressIntro:"Live-collaboration session is now in progress.",desc_shareLink:"Share this link with anyone you want to collaborate with:",desc_exitSession:"Stopping the session will disconnect you from the room, but you'll be able to continue working with the scene, locally. Note that this won't affect other people, and they'll still be able to collaborate on their version.",shareTitle:"Join a live collaboration session on Excalidraw"},RR={title:"Error"},DR={disk_title:"Save to disk",disk_details:"Export the scene data to a file from which you can import later.",disk_button:"Save to file",link_title:"Shareable link",link_details:"Export as a read-only link.",link_button:"Export to Link",excalidrawplus_description:"Save the scene to your Excalidraw+ workspace.",excalidrawplus_button:"Export",excalidrawplus_exportError:"Couldn't export to Excalidraw+ at this moment..."},jR={blog:"Read our blog",click:"click",deepSelect:"Deep select",deepBoxSelect:"Deep select within box, and prevent dragging",createFlowchart:"Create a flowchart from a generic element",navigateFlowchart:"Navigate a flowchart",curvedArrow:"Curved arrow",curvedLine:"Curved line",documentation:"Documentation",doubleClick:"double-click",drag:"drag",editor:"Editor",editLineArrowPoints:"Edit line/arrow points",editText:"Edit text / add label",github:"Found an issue? Submit",howto:"Follow our guides",or:"or",preventBinding:"Prevent arrow binding",tools:"Tools",shortcuts:"Keyboard shortcuts",textFinish:"Finish editing (text editor)",textNewLine:"Add new line (text editor)",title:"Help",view:"View",zoomToFit:"Zoom to fit all elements",zoomToSelection:"Zoom to selection",toggleElementLock:"Lock/unlock selection",movePageUpDown:"Move page up/down",movePageLeftRight:"Move page left/right",cropStart:"Crop image",cropFinish:"Finish image cropping"},PR={title:"Clear canvas"},NR={title:"Publish library",itemName:"Item name",authorName:"Author name",githubUsername:"GitHub username",twitterUsername:"Twitter username",libraryName:"Library name",libraryDesc:"Library description",website:"Website",placeholder:{authorName:"Your name or username",libraryName:"Name of your library",libraryDesc:"Description of your library to help people understand its usage",githubHandle:"GitHub handle (optional), so you can edit the library once submitted for review",twitterHandle:"Twitter username (optional), so we know who to credit when promoting over Twitter",website:"Link to your personal website or elsewhere (optional)"},errors:{required:"Required",website:"Enter a valid URL"},noteDescription:"Submit your library to be included in the <link>public library repository</link> for other people to use in their drawings.",noteGuidelines:"The library needs to be manually approved first. Please read the <link>guidelines</link> before submitting. You will need a GitHub account to communicate and make changes if requested, but it is not strictly required.",noteLicense:"By submitting, you agree the library will be published under the <link>MIT License</link>, which in short means anyone can use them without restrictions.",noteItems:"Each library item must have its own name so it's filterable. The following library items will be included:",atleastOneLibItem:"Please select at least one library item to get started",republishWarning:"Note: some of the selected items are marked as already published/submitted. You should only resubmit items when updating an existing library or submission."},OR={title:"Library submitted",content:"Thank you {{authorName}}. Your library has been submitted for review. You can track the status <link>here</link>"},FR={resetLibrary:"Reset library",removeItemsFromLib:"Remove selected items from library"},$R={header:"Export image",label:{withBackground:"Background",onlySelected:"Only selected",darkMode:"Dark mode",embedScene:"Embed scene",scale:"Scale",padding:"Padding"},tooltip:{embedScene:`Scene data will be saved into the exported PNG/SVG file so that the scene can be restored from it.
88
- Will increase exported file size.`},title:{exportToPng:"Export to PNG",exportToSvg:"Export to SVG",copyPngToClipboard:"Copy PNG to clipboard"},button:{exportToPng:"PNG",exportToSvg:"SVG",copyPngToClipboard:"Copy to clipboard"}},BR={tooltip:"Your drawings are end-to-end encrypted so Excalidraw's servers will never see them.",link:"Blog post on end-to-end encryption in Excalidraw"},zR={angle:"Angle",shapes:"Shapes",height:"Height",scene:"Scene",selected:"Selected",storage:"Storage",fullTitle:"Canvas & Shape properties",title:"Properties",generalStats:"General",elementProperties:"Shape properties",total:"Total",version:"Version",versionCopy:"Click to copy",versionNotAvailable:"Version not available",width:"Width"},HR={addedToLibrary:"Added to library",copyStyles:"Copied styles.",copyToClipboard:"Copied to clipboard.",copyToClipboardAsPng:`Copied {{exportSelection}} to clipboard as PNG
89
- ({{exportColorScheme}})`,copyToClipboardAsSvg:`Copied {{exportSelection}} to clipboard as SVG
90
- ({{exportColorScheme}})`,fileSaved:"File saved.",fileSavedToFilename:"Saved to {filename}",canvas:"canvas",selection:"selection",pasteAsSingleElement:`Use {{shortcut}} to paste as a single element,
91
- or paste into an existing text editor`,unableToEmbed:"Embedding this url is currently not allowed. Raise an issue on GitHub to request the url whitelisted",unrecognizedLinkFormat:"The link you embedded does not match the expected format. Please try to paste the 'embed' string provided by the source site",elementLinkCopied:"Link copied to clipboard"},WR={transparent:"Transparent",black:"Black",white:"White",red:"Red",pink:"Pink",grape:"Grape",violet:"Violet",gray:"Gray",blue:"Blue",cyan:"Cyan",teal:"Teal",green:"Green",yellow:"Yellow",orange:"Orange",bronze:"Bronze"},XR={app:{center_heading:"All your data is saved locally in your browser.",center_heading_plus:"Did you want to go to the Excalidraw+ instead?",menuHint:"Export, preferences, languages, ..."},defaults:{menuHint:"Export, preferences, and more...",center_heading:"Diagrams. Made. Simple.",toolbarHint:"Pick a tool & Start drawing!",helpHint:"Shortcuts & help"}},VR={mostUsedCustomColors:"Most used custom colors",colors:"Colors",shades:"Shades",hexCode:"Hex code",noShades:"No shades available for this color"},YR={action:{exportToImage:{title:"Export as image",button:"Export as image",description:"Export the scene data as an image from which you can import later."},saveToDisk:{title:"Save to disk",button:"Save to disk",description:"Export the scene data to a file from which you can import later."},excalidrawPlus:{title:"Excalidraw+",button:"Export to Excalidraw+",description:"Save the scene to your Excalidraw+ workspace."}},modal:{loadFromFile:{title:"Load from file",button:"Load from file",description:"Loading from a file will <bold>replace your existing content</bold>.<br></br>You can back up your drawing first using one of the options below."},shareableLink:{title:"Load from link",button:"Replace my content",description:"Loading external drawing will <bold>replace your existing content</bold>.<br></br>You can back up your drawing first by using one of the options below."}}},GR={title:"Mermaid to Excalidraw",button:"Insert",description:"Currently only <flowchartLink>Flowchart</flowchartLink>,<sequenceLink> Sequence, </sequenceLink> and <classLink>Class </classLink>Diagrams are supported. The other types will be rendered as image in Excalidraw.",syntax:"Mermaid Syntax",preview:"Preview"},qR={placeholder:"Quick search"},ZR={badge:{old:"old"},sceneFonts:"In this scene",availableFonts:"Available fonts",empty:"No fonts found"},KR={empty:"No users found",hint:{text:"Click on user to follow",followStatus:"You're currently following this user",inCall:"User is in a voice call",micMuted:"User's microphone is muted",isSpeaking:"User is speaking"}},QR={title:"Command palette",shortcuts:{select:"Select",confirm:"Confirm",close:"Close"},recents:"Recently used",search:{placeholder:"Search menus, commands, and discover hidden gems",noMatch:"No matching commands..."},itemNotAvailable:"Command is not available...",shortcutHint:"For Command palette, use {{shortcut}}"},v7={labels:bR,elementLink:yR,library:vR,search:xR,buttons:wR,alerts:ER,errors:CR,toolBar:SR,element:_R,headings:kR,hints:TR,canvasError:MR,errorSplash:IR,shareDialog:AR,roomDialog:LR,errorDialog:RR,exportDialog:DR,helpDialog:jR,clearCanvasDialog:PR,publishDialog:NR,publishSuccessDialog:OR,confirmDialog:FR,imageExportDialog:$R,encrypted:BR,stats:zR,toast:HR,colors:WR,welcomeScreen:XR,colorPicker:VR,overwriteConfirm:YR,mermaid:GR,quickSearch:qR,fontList:ZR,userList:KR,commandPalette:QR},JR=100,eD=36,tD={"ar-SA":94,"az-AZ":17,"bg-BG":71,"bn-BD":52,"ca-ES":83,"cs-CZ":86,"da-DK":61,"de-DE":100,"el-GR":80,en:JR,"es-ES":96,"eu-ES":97,"fa-IR":84,"fi-FI":76,"fr-FR":99,"gl-ES":86,"he-IL":77,"hi-IN":76,"hu-HU":76,"id-ID":91,"it-IT":98,"ja-JP":90,kaa:eD,"kab-KAB":76,"kk-KZ":18,"km-KH":83,"ko-KR":100,"ku-TR":87,"lt-LT":48,"lv-LV":77,"mr-IN":98,"my-MM":35,"nb-NO":93,"nl-NL":75,"nn-NO":67,"oc-FR":92,"pa-IN":78,"pl-PL":99,"pt-BR":91,"pt-PT":83,"ro-RO":99,"ru-RU":92,"si-LK":7,"sk-SK":100,"sl-SI":100,"sv-SE":100,"ta-IN":81,"th-TH":44,"tr-TR":87,"uk-UA":93,"vi-VN":49,"zh-CN":100,"zh-HK":22,"zh-TW":100};const tl={};let Die=0;function hr(e,t){const n=`atom${++Die}`,r={toString(){return(tl?"production":void 0)!=="production"&&this.debugLabel?n+":"+this.debugLabel:n}};return typeof e=="function"?r.read=e:(r.init=e,r.read=jie,r.write=Pie),r}function jie(e){return e(this)}function Pie(e,t,n){return t(this,typeof n=="function"?n(e(this)):n)}const AS=(e,t)=>e.unstable_is?e.unstable_is(t):t===e,Q3=e=>"init"in e,oy=e=>!!e.write,T2=new WeakMap,J3=e=>{var t;return e8(e)&&!((t=T2.get(e))!=null&&t[1])},Nie=(e,t)=>{const n=T2.get(e);if(n)n[1]=!0,n[0].forEach(r=>r(t));else if((tl?"production":void 0)!=="production")throw new Error("[Bug] cancelable promise not found")},Oie=e=>{if(T2.has(e))return;const t=[new Set,!1];T2.set(e,t);const n=()=>{t[1]=!0};e.then(n,n),e.onCancel=r=>{t[0].add(r)}},e8=e=>typeof(e==null?void 0:e.then)=="function",LS=e=>"v"in e||"e"in e,Nm=e=>{if("e"in e)throw e.e;if((tl?"production":void 0)!=="production"&&!("v"in e))throw new Error("[Bug] atom state is not initialized");return e.v},nD=(e,t,n)=>{n.p.has(e)||(n.p.add(e),t.then(()=>{n.p.delete(e)},()=>{n.p.delete(e)}))},RS=(e,t,n,r,i)=>{var a;if((tl?"production":void 0)!=="production"&&r===t)throw new Error("[Bug] atom cannot depend on itself");n.d.set(r,i.n),J3(n.v)&&nD(t,n.v,i),(a=i.m)==null||a.t.add(t),e&&Fie(e,r,t)},Wf=()=>({D:new Map,H:new Set,M:new Set,L:new Set}),Pp=(e,t,n)=>{e[t].add(n)},DS=(e,t,n)=>{e.D.has(t)||(e.D.set(t,new Set),Pp(e,"M",()=>{var r;(r=n.m)==null||r.l.forEach(i=>Pp(e,"M",i))}))},Fie=(e,t,n)=>{const r=e.D.get(t);r&&r.add(n)},$ie=(e,t)=>e.D.get(t),$c=e=>{let t,n=!1;const r=i=>{try{i()}catch(a){n||(t=a,n=!0)}};for(;e.H.size||e.M.size||e.L.size;)e.D.clear(),e.H.forEach(r),e.H.clear(),e.M.forEach(r),e.M.clear(),e.L.forEach(r),e.L.clear();if(n)throw t},rD=(...[e,t,n,r])=>{const i=(x,w,C)=>{const S="v"in w,k=w.v,M=J3(w.v)?w.v:null;if(e8(C)){Oie(C);for(const T of w.d.keys())nD(x,C,e(T));w.v=C}else w.v=C;delete w.e,delete w.x,(!S||!Object.is(k,w.v))&&(++w.n,M&&Nie(M,C))},a=(x,w)=>{var C;const S=e(w);if(LS(S)&&(S.m&&!S.x||Array.from(S.d).every(([P,N])=>a(x,P).n===N)))return S;S.d.clear();let k=!0;const M=P=>{if(AS(w,P)){const F=e(P);if(!LS(F))if(Q3(P))i(P,F,P.init);else throw new Error("no atom init");return Nm(F)}const N=a(x,P);try{return Nm(N)}finally{if(k)RS(x,w,S,P,N);else{const F=Wf();RS(F,w,S,P,N),h(F,w,S),$c(F)}}};let T,R;const j={get signal(){return T||(T=new AbortController),T.signal},get setSelf(){return(tl?"production":void 0)!=="production"&&!oy(w)&&console.warn("setSelf function cannot be used with read-only atom"),!R&&oy(w)&&(R=(...P)=>{if((tl?"production":void 0)!=="production"&&k&&console.warn("setSelf function cannot be called in sync"),!k)return l(w,...P)}),R}};try{const P=t(w,M,j);if(i(w,S,P),e8(P)){(C=P.onCancel)==null||C.call(P,()=>T==null?void 0:T.abort());const N=()=>{if(S.m){const F=Wf();h(F,w,S),$c(F)}};P.then(N,N)}return S}catch(P){return delete S.v,S.e=P,delete S.x,++S.n,S}finally{k=!1}},s=x=>Nm(a(void 0,x)),o=(x,w,C)=>{var S,k;const M=new Map;for(const T of((S=C.m)==null?void 0:S.t)||[]){const R=e(T);R.m&&M.set(T,R)}for(const T of C.p)M.set(T,e(T));return(k=$ie(x,w))==null||k.forEach(T=>{M.set(T,e(T))}),M},c=(x,w,C)=>{const S=[],k=new Set,M=new Set,T=[[w,C]];for(;T.length>0;){const[R,j]=T[T.length-1];if(M.has(R)){T.pop();continue}if(k.has(R)){S.push([R,j,j.n]),M.add(R),j.x=!0,T.pop();continue}k.add(R);for(const[P,N]of o(x,R,j))R!==P&&!k.has(P)&&T.push([P,N])}Pp(x,"H",()=>{const R=new Set([w]);for(let j=S.length-1;j>=0;--j){const[P,N,F]=S[j];let $=!1;for(const q of N.d.keys())if(q!==P&&R.has(q)){$=!0;break}$&&(a(x,P),h(x,P,N),F!==N.n&&(DS(x,P,N),R.add(P))),delete N.x}})},d=(x,w,...C)=>{let S=!0;const k=T=>Nm(a(x,T)),M=(T,...R)=>{const j=e(T);try{if(AS(w,T)){if(!Q3(T))throw new Error("atom not writable");const P=j.n,N=R[0];i(T,j,N),h(x,T,j),P!==j.n&&(DS(x,T,j),c(x,T,j));return}else return d(x,T,...R)}finally{S||$c(x)}};try{return n(w,k,M,...C)}finally{S=!1}},l=(x,...w)=>{const C=Wf();try{return d(C,x,...w)}finally{$c(C)}},h=(x,w,C)=>{if(C.m&&!J3(C.v)){for(const S of C.d.keys())C.m.d.has(S)||(f(x,S,e(S)).t.add(w),C.m.d.add(S));for(const S of C.m.d||[])if(!C.d.has(S)){C.m.d.delete(S);const k=g(x,S,e(S));k==null||k.t.delete(w)}}},f=(x,w,C)=>{if(!C.m){a(x,w);for(const S of C.d.keys())f(x,S,e(S)).t.add(w);if(C.m={l:new Set,d:new Set(C.d.keys()),t:new Set},oy(w)){const S=C.m;let k;const M=(T,R)=>{let j=!0;k=(...P)=>{try{return d(T,w,...P)}finally{j||$c(T)}};try{return R()}finally{j=!1}};Pp(x,"L",()=>{const T=M(x,()=>r(w,(...R)=>k(...R)));T&&(S.u=R=>M(R,T))})}}return C.m},g=(x,w,C)=>{if(C.m&&!C.m.l.size&&!Array.from(C.m.t).some(S=>{var k;return(k=e(S).m)==null?void 0:k.d.has(w)})){const S=C.m.u;S&&Pp(x,"L",()=>S(x)),delete C.m;for(const k of C.d.keys()){const M=g(x,k,e(k));M==null||M.t.delete(w)}return}return C.m};return{get:s,set:l,sub:(x,w)=>{const C=Wf(),S=e(x),M=f(C,x,S).l;return M.add(w),$c(C),()=>{M.delete(w);const T=Wf();g(T,x,S),$c(T)}},unstable_derive:x=>rD(...x(e,t,n,r))}},Bie=e=>{const t=new WeakMap,n=new Set;let r,i=0;const a=e.unstable_derive((c,d,l,h)=>(r=c,[f=>{let g=t.get(f);if(!g){const U=c(f);g=new Proxy(U,{set(y,v,x){return v==="m"&&n.add(f),Reflect.set(y,v,x)},deleteProperty(y,v){return v==="m"&&n.delete(f),Reflect.deleteProperty(y,v)}}),t.set(f,g)}return g},d,(f,g,U,...y)=>i?U(f,...y):l(f,g,U,...y),h])),s=a.set;return Object.assign(a,{dev4_get_internal_weak_map:()=>({get:c=>{const d=r(c);if(d.n!==0)return d}}),dev4_get_mounted_atoms:()=>n,dev4_restore_atoms:c=>{s({read:()=>null,write:(l,h)=>{++i;try{for(const[f,g]of c)Q3(f)&&h(f,g)}finally{--i}}})}})},x7=()=>{const e=new WeakMap,n=rD(r=>{if((tl?"production":void 0)!=="production"&&!r)throw new Error("Atom is undefined or null");let i=e.get(r);return i||(i={d:new Map,p:new Set,n:0},e.set(r,i)),i},(r,...i)=>r.read(...i),(r,...i)=>r.write(...i),(r,...i)=>{var a;return(a=r.onMount)==null?void 0:a.call(r,...i)});return(tl?"production":void 0)!=="production"?Bie(n):n};let Xf;const zie=()=>(Xf||(Xf=x7(),(tl?"production":void 0)!=="production"&&(globalThis.__JOTAI_DEFAULT_STORE__||(globalThis.__JOTAI_DEFAULT_STORE__=Xf),globalThis.__JOTAI_DEFAULT_STORE__!==Xf&&console.warn("Detected multiple Jotai instances. It may cause unexpected behavior with the default store. https://github.com/pmndrs/jotai/discussions/2044"))),Xf),iD={},Hie=I.createContext(void 0),XU=e=>{const t=I.useContext(Hie);return(e==null?void 0:e.store)||t||zie()},t8=e=>typeof(e==null?void 0:e.then)=="function",aD=e=>{e.status="pending",e.then(t=>{e.status="fulfilled",e.value=t},t=>{e.status="rejected",e.reason=t})},Wie=ke.use||(e=>{if(e.status==="pending")throw e;if(e.status==="fulfilled")return e.value;throw e.status==="rejected"?e.reason:(aD(e),e)}),ly=new WeakMap,jS=e=>{let t=ly.get(e);return t||(t=new Promise((n,r)=>{let i=e;const a=c=>d=>{i===c&&n(d)},s=c=>d=>{i===c&&r(d)},o=c=>{"onCancel"in c&&typeof c.onCancel=="function"&&c.onCancel(d=>{if((iD?"production":void 0)!=="production"&&d===c)throw new Error("[Bug] p is not updated even after cancelation");t8(d)?(ly.set(d,t),i=d,d.then(a(d),s(d)),o(d)):n(d)})};e.then(a(e),s(e)),o(e)}),ly.set(e,t)),t};function sD(e,t){const n=XU(t),[[r,i,a],s]=I.useReducer(d=>{const l=n.get(e);return Object.is(d[0],l)&&d[1]===n&&d[2]===e?d:[l,n,e]},void 0,()=>[n.get(e),n,e]);let o=r;(i!==n||a!==e)&&(s(),o=n.get(e));const c=t==null?void 0:t.delay;if(I.useEffect(()=>{const d=n.sub(e,()=>{if(typeof c=="number"){const l=n.get(e);t8(l)&&aD(jS(l)),setTimeout(s,c);return}s()});return s(),d},[n,e,c]),I.useDebugValue(o),t8(o)){const d=jS(o);return Wie(d)}return o}function oD(e,t){const n=XU(t);return I.useCallback((...i)=>{if((iD?"production":void 0)!=="production"&&!("write"in e))throw new Error("not writable atom");return n.set(e,...i)},[n,e])}function Xie(e,t){return[sD(e,t),oD(e,t)]}const PS=new WeakMap;function Vie(e,t){const n=XU(t),r=Yie(n);for(const[i,a]of e)(!r.has(i)||t!=null&&t.dangerouslyForceHydrate)&&(r.add(i),n.set(i,a))}const Yie=e=>{let t=PS.get(e);return t||(t=new WeakSet,PS.set(e,t)),t};function zu(){return zu=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},zu.apply(this,arguments)}function lD(){const e=I.createContext(null);function t({store:s,initialValues:o=[],children:c}){const d=I.useRef(s);return d.current||(d.current=x7()),Vie(o,{store:d.current}),m.jsx(e.Provider,{value:d.current,children:c})}const n=s=>{const o=I.useContext(e);if(!o)throw new Error("Missing Provider from createIsolation");return XU(zu({store:o},s))};return{Provider:t,useStore:n,useAtom:(s,o)=>{const c=n();return Xie(s,zu({store:c},o))},useAtomValue:(s,o)=>{const c=n();return sD(s,zu({store:c},o))},useSetAtom:(s,o)=>{const c=n();return oD(s,zu({store:c},o))}}}const{read:h4e,write:f4e}=hr(null);I.createContext({scope:void 0,baseStore:void 0});function cc(e,t,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e==null||e(i),n===!1||!i.defaultPrevented)return t==null?void 0:t(i)}}function NS(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function cD(...e){return t=>{let n=!1;const r=e.map(i=>{const a=NS(i,t);return!n&&typeof a=="function"&&(n=!0),a});if(n)return()=>{for(let i=0;i<r.length;i++){const a=r[i];typeof a=="function"?a():NS(e[i],null)}}}}function Ec(...e){return I.useCallback(cD(...e),e)}function dD(e,t=[]){let n=[];function r(a,s){const o=I.createContext(s),c=n.length;n=[...n,s];const d=h=>{var x;const{scope:f,children:g,...U}=h,y=((x=f==null?void 0:f[e])==null?void 0:x[c])||o,v=I.useMemo(()=>U,Object.values(U));return m.jsx(y.Provider,{value:v,children:g})};d.displayName=a+"Provider";function l(h,f){var y;const g=((y=f==null?void 0:f[e])==null?void 0:y[c])||o,U=I.useContext(g);if(U)return U;if(s!==void 0)return s;throw new Error(`\`${h}\` must be used within \`${a}\``)}return[d,l]}const i=()=>{const a=n.map(s=>I.createContext(s));return function(o){const c=(o==null?void 0:o[e])||a;return I.useMemo(()=>({[`__scope${e}`]:{...o,[e]:c}}),[o,c])}};return i.scopeName=e,[r,Gie(i,...t)]}function Gie(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(a){const s=r.reduce((o,{useScope:c,scopeName:d})=>{const h=c(a)[`__scope${d}`];return{...o,...h}},{});return I.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}var w7=I.forwardRef((e,t)=>{const{children:n,...r}=e,i=I.Children.toArray(n),a=i.find(Zie);if(a){const s=a.props.children,o=i.map(c=>c===a?I.Children.count(s)>1?I.Children.only(null):I.isValidElement(s)?s.props.children:null:c);return m.jsx(n8,{...r,ref:t,children:I.isValidElement(s)?I.cloneElement(s,void 0,o):null})}return m.jsx(n8,{...r,ref:t,children:n})});w7.displayName="Slot";var n8=I.forwardRef((e,t)=>{const{children:n,...r}=e;if(I.isValidElement(n)){const i=Qie(n),a=Kie(r,n.props);return n.type!==I.Fragment&&(a.ref=t?cD(t,i):i),I.cloneElement(n,a)}return I.Children.count(n)>1?I.Children.only(null):null});n8.displayName="SlotClone";var qie=({children:e})=>m.jsx(m.Fragment,{children:e});function Zie(e){return I.isValidElement(e)&&e.type===qie}function Kie(e,t){const n={...t};for(const r in t){const i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...o)=>{a(...o),i(...o)}:i&&(n[r]=i):r==="style"?n[r]={...i,...a}:r==="className"&&(n[r]=[i,a].filter(Boolean).join(" "))}return{...e,...n}}function Qie(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Jie=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],ll=Jie.reduce((e,t)=>{const n=I.forwardRef((r,i)=>{const{asChild:a,...s}=r,o=a?w7:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),m.jsx(o,{...s,ref:i})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function eae(e,t){e&&Jn.flushSync(()=>e.dispatchEvent(t))}function mc(e){const t=I.useRef(e);return I.useEffect(()=>{t.current=e}),I.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function tae(e,t=globalThis==null?void 0:globalThis.document){const n=mc(e);I.useEffect(()=>{const r=i=>{i.key==="Escape"&&n(i)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var nae="DismissableLayer",r8="dismissableLayer.update",rae="dismissableLayer.pointerDownOutside",iae="dismissableLayer.focusOutside",OS,uD=I.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),hD=I.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:a,onInteractOutside:s,onDismiss:o,...c}=e,d=I.useContext(uD),[l,h]=I.useState(null),f=(l==null?void 0:l.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,g]=I.useState({}),U=Ec(t,T=>h(T)),y=Array.from(d.layers),[v]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),x=y.indexOf(v),w=l?y.indexOf(l):-1,C=d.layersWithOutsidePointerEventsDisabled.size>0,S=w>=x,k=oae(T=>{const R=T.target,j=[...d.branches].some(P=>P.contains(R));!S||j||(i==null||i(T),s==null||s(T),T.defaultPrevented||o==null||o())},f),M=lae(T=>{const R=T.target;[...d.branches].some(P=>P.contains(R))||(a==null||a(T),s==null||s(T),T.defaultPrevented||o==null||o())},f);return tae(T=>{w===d.layers.size-1&&(r==null||r(T),!T.defaultPrevented&&o&&(T.preventDefault(),o()))},f),I.useEffect(()=>{if(l)return n&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(OS=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(l)),d.layers.add(l),FS(),()=>{n&&d.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=OS)}},[l,f,n,d]),I.useEffect(()=>()=>{l&&(d.layers.delete(l),d.layersWithOutsidePointerEventsDisabled.delete(l),FS())},[l,d]),I.useEffect(()=>{const T=()=>g({});return document.addEventListener(r8,T),()=>document.removeEventListener(r8,T)},[]),m.jsx(ll.div,{...c,ref:U,style:{pointerEvents:C?S?"auto":"none":void 0,...e.style},onFocusCapture:cc(e.onFocusCapture,M.onFocusCapture),onBlurCapture:cc(e.onBlurCapture,M.onBlurCapture),onPointerDownCapture:cc(e.onPointerDownCapture,k.onPointerDownCapture)})});hD.displayName=nae;var aae="DismissableLayerBranch",sae=I.forwardRef((e,t)=>{const n=I.useContext(uD),r=I.useRef(null),i=Ec(t,r);return I.useEffect(()=>{const a=r.current;if(a)return n.branches.add(a),()=>{n.branches.delete(a)}},[n.branches]),m.jsx(ll.div,{...e,ref:i})});sae.displayName=aae;function oae(e,t=globalThis==null?void 0:globalThis.document){const n=mc(e),r=I.useRef(!1),i=I.useRef(()=>{});return I.useEffect(()=>{const a=o=>{if(o.target&&!r.current){let c=function(){fD(rae,n,d,{discrete:!0})};const d={originalEvent:o};o.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=c,t.addEventListener("click",i.current,{once:!0})):c()}else t.removeEventListener("click",i.current);r.current=!1},s=window.setTimeout(()=>{t.addEventListener("pointerdown",a)},0);return()=>{window.clearTimeout(s),t.removeEventListener("pointerdown",a),t.removeEventListener("click",i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function lae(e,t=globalThis==null?void 0:globalThis.document){const n=mc(e),r=I.useRef(!1);return I.useEffect(()=>{const i=a=>{a.target&&!r.current&&fD(iae,n,{originalEvent:a},{discrete:!1})};return t.addEventListener("focusin",i),()=>t.removeEventListener("focusin",i)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function FS(){const e=new CustomEvent(r8);document.dispatchEvent(e)}function fD(e,t,n,{discrete:r}){const i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?eae(i,a):i.dispatchEvent(a)}var cy=0;function cae(){I.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??$S()),document.body.insertAdjacentElement("beforeend",e[1]??$S()),cy++,()=>{cy===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),cy--}},[])}function $S(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var dy="focusScope.autoFocusOnMount",uy="focusScope.autoFocusOnUnmount",BS={bubbles:!1,cancelable:!0},dae="FocusScope",pD=I.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...s}=e,[o,c]=I.useState(null),d=mc(i),l=mc(a),h=I.useRef(null),f=Ec(t,y=>c(y)),g=I.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;I.useEffect(()=>{if(r){let y=function(C){if(g.paused||!o)return;const S=C.target;o.contains(S)?h.current=S:Wl(h.current,{select:!0})},v=function(C){if(g.paused||!o)return;const S=C.relatedTarget;S!==null&&(o.contains(S)||Wl(h.current,{select:!0}))},x=function(C){if(document.activeElement===document.body)for(const k of C)k.removedNodes.length>0&&Wl(o)};document.addEventListener("focusin",y),document.addEventListener("focusout",v);const w=new MutationObserver(x);return o&&w.observe(o,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",y),document.removeEventListener("focusout",v),w.disconnect()}}},[r,o,g.paused]),I.useEffect(()=>{if(o){HS.add(g);const y=document.activeElement;if(!o.contains(y)){const x=new CustomEvent(dy,BS);o.addEventListener(dy,d),o.dispatchEvent(x),x.defaultPrevented||(uae(gae(mD(o)),{select:!0}),document.activeElement===y&&Wl(o))}return()=>{o.removeEventListener(dy,d),setTimeout(()=>{const x=new CustomEvent(uy,BS);o.addEventListener(uy,l),o.dispatchEvent(x),x.defaultPrevented||Wl(y??document.body,{select:!0}),o.removeEventListener(uy,l),HS.remove(g)},0)}}},[o,d,l,g]);const U=I.useCallback(y=>{if(!n&&!r||g.paused)return;const v=y.key==="Tab"&&!y.altKey&&!y.ctrlKey&&!y.metaKey,x=document.activeElement;if(v&&x){const w=y.currentTarget,[C,S]=hae(w);C&&S?!y.shiftKey&&x===S?(y.preventDefault(),n&&Wl(C,{select:!0})):y.shiftKey&&x===C&&(y.preventDefault(),n&&Wl(S,{select:!0})):x===w&&y.preventDefault()}},[n,r,g.paused]);return m.jsx(ll.div,{tabIndex:-1,...s,ref:f,onKeyDown:U})});pD.displayName=dae;function uae(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Wl(r,{select:t}),document.activeElement!==n)return}function hae(e){const t=mD(e),n=zS(t,e),r=zS(t.reverse(),e);return[n,r]}function mD(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function zS(e,t){for(const n of e)if(!fae(n,{upTo:t}))return n}function fae(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function pae(e){return e instanceof HTMLInputElement&&"select"in e}function Wl(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&pae(e)&&t&&e.select()}}var HS=mae();function mae(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=WS(e,t),e.unshift(t)},remove(t){var n;e=WS(e,t),(n=e[0])==null||n.resume()}}}function WS(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function gae(e){return e.filter(t=>t.tagName!=="A")}var Ld=globalThis!=null&&globalThis.document?I.useLayoutEffect:()=>{},Uae=tv.useId||(()=>{}),bae=0;function yae(e){const[t,n]=I.useState(Uae());return Ld(()=>{n(r=>r??String(bae++))},[e]),e||(t?`radix-${t}`:"")}const vae=["top","right","bottom","left"],gc=Math.min,Di=Math.max,M2=Math.round,Om=Math.floor,zs=e=>({x:e,y:e}),xae={left:"right",right:"left",bottom:"top",top:"bottom"},wae={start:"end",end:"start"};function i8(e,t,n){return Di(e,gc(t,n))}function nl(e,t){return typeof e=="function"?e(t):e}function rl(e){return e.split("-")[0]}function zh(e){return e.split("-")[1]}function E7(e){return e==="x"?"y":"x"}function C7(e){return e==="y"?"height":"width"}const Eae=new Set(["top","bottom"]);function Fs(e){return Eae.has(rl(e))?"y":"x"}function S7(e){return E7(Fs(e))}function Cae(e,t,n){n===void 0&&(n=!1);const r=zh(e),i=S7(e),a=C7(i);let s=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[a]>t.floating[a]&&(s=I2(s)),[s,I2(s)]}function Sae(e){const t=I2(e);return[a8(e),t,a8(t)]}function a8(e){return e.replace(/start|end/g,t=>wae[t])}const XS=["left","right"],VS=["right","left"],_ae=["top","bottom"],kae=["bottom","top"];function Tae(e,t,n){switch(e){case"top":case"bottom":return n?t?VS:XS:t?XS:VS;case"left":case"right":return t?_ae:kae;default:return[]}}function Mae(e,t,n,r){const i=zh(e);let a=Tae(rl(e),n==="start",r);return i&&(a=a.map(s=>s+"-"+i),t&&(a=a.concat(a.map(a8)))),a}function I2(e){return e.replace(/left|right|bottom|top/g,t=>xae[t])}function Iae(e){return{top:0,right:0,bottom:0,left:0,...e}}function gD(e){return typeof e!="number"?Iae(e):{top:e,right:e,bottom:e,left:e}}function A2(e){const{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function YS(e,t,n){let{reference:r,floating:i}=e;const a=Fs(t),s=S7(t),o=C7(s),c=rl(t),d=a==="y",l=r.x+r.width/2-i.width/2,h=r.y+r.height/2-i.height/2,f=r[o]/2-i[o]/2;let g;switch(c){case"top":g={x:l,y:r.y-i.height};break;case"bottom":g={x:l,y:r.y+r.height};break;case"right":g={x:r.x+r.width,y:h};break;case"left":g={x:r.x-i.width,y:h};break;default:g={x:r.x,y:r.y}}switch(zh(t)){case"start":g[s]-=f*(n&&d?-1:1);break;case"end":g[s]+=f*(n&&d?-1:1);break}return g}const Aae=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:a=[],platform:s}=n,o=a.filter(Boolean),c=await(s.isRTL==null?void 0:s.isRTL(t));let d=await s.getElementRects({reference:e,floating:t,strategy:i}),{x:l,y:h}=YS(d,r,c),f=r,g={},U=0;for(let y=0;y<o.length;y++){const{name:v,fn:x}=o[y],{x:w,y:C,data:S,reset:k}=await x({x:l,y:h,initialPlacement:r,placement:f,strategy:i,middlewareData:g,rects:d,platform:s,elements:{reference:e,floating:t}});l=w??l,h=C??h,g={...g,[v]:{...g[v],...S}},k&&U<=50&&(U++,typeof k=="object"&&(k.placement&&(f=k.placement),k.rects&&(d=k.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:i}):k.rects),{x:l,y:h}=YS(d,f,c)),y=-1)}return{x:l,y:h,placement:f,strategy:i,middlewareData:g}};async function x1(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:a,rects:s,elements:o,strategy:c}=e,{boundary:d="clippingAncestors",rootBoundary:l="viewport",elementContext:h="floating",altBoundary:f=!1,padding:g=0}=nl(t,e),U=gD(g),v=o[f?h==="floating"?"reference":"floating":h],x=A2(await a.getClippingRect({element:(n=await(a.isElement==null?void 0:a.isElement(v)))==null||n?v:v.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(o.floating)),boundary:d,rootBoundary:l,strategy:c})),w=h==="floating"?{x:r,y:i,width:s.floating.width,height:s.floating.height}:s.reference,C=await(a.getOffsetParent==null?void 0:a.getOffsetParent(o.floating)),S=await(a.isElement==null?void 0:a.isElement(C))?await(a.getScale==null?void 0:a.getScale(C))||{x:1,y:1}:{x:1,y:1},k=A2(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:w,offsetParent:C,strategy:c}):w);return{top:(x.top-k.top+U.top)/S.y,bottom:(k.bottom-x.bottom+U.bottom)/S.y,left:(x.left-k.left+U.left)/S.x,right:(k.right-x.right+U.right)/S.x}}const Lae=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:i,rects:a,platform:s,elements:o,middlewareData:c}=t,{element:d,padding:l=0}=nl(e,t)||{};if(d==null)return{};const h=gD(l),f={x:n,y:r},g=S7(i),U=C7(g),y=await s.getDimensions(d),v=g==="y",x=v?"top":"left",w=v?"bottom":"right",C=v?"clientHeight":"clientWidth",S=a.reference[U]+a.reference[g]-f[g]-a.floating[U],k=f[g]-a.reference[g],M=await(s.getOffsetParent==null?void 0:s.getOffsetParent(d));let T=M?M[C]:0;(!T||!await(s.isElement==null?void 0:s.isElement(M)))&&(T=o.floating[C]||a.floating[U]);const R=S/2-k/2,j=T/2-y[U]/2-1,P=gc(h[x],j),N=gc(h[w],j),F=P,$=T-y[U]-N,q=T/2-y[U]/2+R,W=i8(F,q,$),V=!c.arrow&&zh(i)!=null&&q!==W&&a.reference[U]/2-(q<F?P:N)-y[U]/2<0,B=V?q<F?q-F:q-$:0;return{[g]:f[g]+B,data:{[g]:W,centerOffset:q-W-B,...V&&{alignmentOffset:B}},reset:V}}}),Rae=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:i,middlewareData:a,rects:s,initialPlacement:o,platform:c,elements:d}=t,{mainAxis:l=!0,crossAxis:h=!0,fallbackPlacements:f,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:U="none",flipAlignment:y=!0,...v}=nl(e,t);if((n=a.arrow)!=null&&n.alignmentOffset)return{};const x=rl(i),w=Fs(o),C=rl(o)===o,S=await(c.isRTL==null?void 0:c.isRTL(d.floating)),k=f||(C||!y?[I2(o)]:Sae(o)),M=U!=="none";!f&&M&&k.push(...Mae(o,y,U,S));const T=[o,...k],R=await x1(t,v),j=[];let P=((r=a.flip)==null?void 0:r.overflows)||[];if(l&&j.push(R[x]),h){const q=Cae(i,s,S);j.push(R[q[0]],R[q[1]])}if(P=[...P,{placement:i,overflows:j}],!j.every(q=>q<=0)){var N,F;const q=(((N=a.flip)==null?void 0:N.index)||0)+1,W=T[q];if(W&&(!(h==="alignment"?w!==Fs(W):!1)||P.every(z=>z.overflows[0]>0&&Fs(z.placement)===w)))return{data:{index:q,overflows:P},reset:{placement:W}};let V=(F=P.filter(B=>B.overflows[0]<=0).sort((B,z)=>B.overflows[1]-z.overflows[1])[0])==null?void 0:F.placement;if(!V)switch(g){case"bestFit":{var $;const B=($=P.filter(z=>{if(M){const Y=Fs(z.placement);return Y===w||Y==="y"}return!0}).map(z=>[z.placement,z.overflows.filter(Y=>Y>0).reduce((Y,K)=>Y+K,0)]).sort((z,Y)=>z[1]-Y[1])[0])==null?void 0:$[0];B&&(V=B);break}case"initialPlacement":V=o;break}if(i!==V)return{reset:{placement:V}}}return{}}}};function GS(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function qS(e){return vae.some(t=>e[t]>=0)}const Dae=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...i}=nl(e,t);switch(r){case"referenceHidden":{const a=await x1(t,{...i,elementContext:"reference"}),s=GS(a,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:qS(s)}}}case"escaped":{const a=await x1(t,{...i,altBoundary:!0}),s=GS(a,n.floating);return{data:{escapedOffsets:s,escaped:qS(s)}}}default:return{}}}}},UD=new Set(["left","top"]);async function jae(e,t){const{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),s=rl(n),o=zh(n),c=Fs(n)==="y",d=UD.has(s)?-1:1,l=a&&c?-1:1,h=nl(t,e);let{mainAxis:f,crossAxis:g,alignmentAxis:U}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return o&&typeof U=="number"&&(g=o==="end"?U*-1:U),c?{x:g*l,y:f*d}:{x:f*d,y:g*l}}const Pae=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:i,y:a,placement:s,middlewareData:o}=t,c=await jae(t,e);return s===((n=o.offset)==null?void 0:n.placement)&&(r=o.arrow)!=null&&r.alignmentOffset?{}:{x:i+c.x,y:a+c.y,data:{...c,placement:s}}}}},Nae=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i}=t,{mainAxis:a=!0,crossAxis:s=!1,limiter:o={fn:v=>{let{x,y:w}=v;return{x,y:w}}},...c}=nl(e,t),d={x:n,y:r},l=await x1(t,c),h=Fs(rl(i)),f=E7(h);let g=d[f],U=d[h];if(a){const v=f==="y"?"top":"left",x=f==="y"?"bottom":"right",w=g+l[v],C=g-l[x];g=i8(w,g,C)}if(s){const v=h==="y"?"top":"left",x=h==="y"?"bottom":"right",w=U+l[v],C=U-l[x];U=i8(w,U,C)}const y=o.fn({...t,[f]:g,[h]:U});return{...y,data:{x:y.x-n,y:y.y-r,enabled:{[f]:a,[h]:s}}}}}},Oae=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:i,rects:a,middlewareData:s}=t,{offset:o=0,mainAxis:c=!0,crossAxis:d=!0}=nl(e,t),l={x:n,y:r},h=Fs(i),f=E7(h);let g=l[f],U=l[h];const y=nl(o,t),v=typeof y=="number"?{mainAxis:y,crossAxis:0}:{mainAxis:0,crossAxis:0,...y};if(c){const C=f==="y"?"height":"width",S=a.reference[f]-a.floating[C]+v.mainAxis,k=a.reference[f]+a.reference[C]-v.mainAxis;g<S?g=S:g>k&&(g=k)}if(d){var x,w;const C=f==="y"?"width":"height",S=UD.has(rl(i)),k=a.reference[h]-a.floating[C]+(S&&((x=s.offset)==null?void 0:x[h])||0)+(S?0:v.crossAxis),M=a.reference[h]+a.reference[C]+(S?0:((w=s.offset)==null?void 0:w[h])||0)-(S?v.crossAxis:0);U<k?U=k:U>M&&(U=M)}return{[f]:g,[h]:U}}}},Fae=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:i,rects:a,platform:s,elements:o}=t,{apply:c=()=>{},...d}=nl(e,t),l=await x1(t,d),h=rl(i),f=zh(i),g=Fs(i)==="y",{width:U,height:y}=a.floating;let v,x;h==="top"||h==="bottom"?(v=h,x=f===(await(s.isRTL==null?void 0:s.isRTL(o.floating))?"start":"end")?"left":"right"):(x=h,v=f==="end"?"top":"bottom");const w=y-l.top-l.bottom,C=U-l.left-l.right,S=gc(y-l[v],w),k=gc(U-l[x],C),M=!t.middlewareData.shift;let T=S,R=k;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(R=C),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(T=w),M&&!f){const P=Di(l.left,0),N=Di(l.right,0),F=Di(l.top,0),$=Di(l.bottom,0);g?R=U-2*(P!==0||N!==0?P+N:Di(l.left,l.right)):T=y-2*(F!==0||$!==0?F+$:Di(l.top,l.bottom))}await c({...t,availableWidth:R,availableHeight:T});const j=await s.getDimensions(o.floating);return U!==j.width||y!==j.height?{reset:{rects:!0}}:{}}}};function VU(){return typeof window<"u"}function Hh(e){return bD(e)?(e.nodeName||"").toLowerCase():"#document"}function Pi(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function no(e){var t;return(t=(bD(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function bD(e){return VU()?e instanceof Node||e instanceof Pi(e).Node:!1}function os(e){return VU()?e instanceof Element||e instanceof Pi(e).Element:!1}function Qs(e){return VU()?e instanceof HTMLElement||e instanceof Pi(e).HTMLElement:!1}function ZS(e){return!VU()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Pi(e).ShadowRoot}const $ae=new Set(["inline","contents"]);function t0(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=ls(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!$ae.has(i)}const Bae=new Set(["table","td","th"]);function zae(e){return Bae.has(Hh(e))}const Hae=[":popover-open",":modal"];function YU(e){return Hae.some(t=>{try{return e.matches(t)}catch{return!1}})}const Wae=["transform","translate","scale","rotate","perspective"],Xae=["transform","translate","scale","rotate","perspective","filter"],Vae=["paint","layout","strict","content"];function _7(e){const t=k7(),n=os(e)?ls(e):e;return Wae.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||Xae.some(r=>(n.willChange||"").includes(r))||Vae.some(r=>(n.contain||"").includes(r))}function Yae(e){let t=Uc(e);for(;Qs(t)&&!wh(t);){if(_7(t))return t;if(YU(t))return null;t=Uc(t)}return null}function k7(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Gae=new Set(["html","body","#document"]);function wh(e){return Gae.has(Hh(e))}function ls(e){return Pi(e).getComputedStyle(e)}function GU(e){return os(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Uc(e){if(Hh(e)==="html")return e;const t=e.assignedSlot||e.parentNode||ZS(e)&&e.host||no(e);return ZS(t)?t.host:t}function yD(e){const t=Uc(e);return wh(t)?e.ownerDocument?e.ownerDocument.body:e.body:Qs(t)&&t0(t)?t:yD(t)}function w1(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=yD(e),a=i===((r=e.ownerDocument)==null?void 0:r.body),s=Pi(i);if(a){const o=s8(s);return t.concat(s,s.visualViewport||[],t0(i)?i:[],o&&n?w1(o):[])}return t.concat(i,w1(i,[],n))}function s8(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function vD(e){const t=ls(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=Qs(e),a=i?e.offsetWidth:n,s=i?e.offsetHeight:r,o=M2(n)!==a||M2(r)!==s;return o&&(n=a,r=s),{width:n,height:r,$:o}}function T7(e){return os(e)?e:e.contextElement}function Zu(e){const t=T7(e);if(!Qs(t))return zs(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:a}=vD(t);let s=(a?M2(n.width):n.width)/r,o=(a?M2(n.height):n.height)/i;return(!s||!Number.isFinite(s))&&(s=1),(!o||!Number.isFinite(o))&&(o=1),{x:s,y:o}}const qae=zs(0);function xD(e){const t=Pi(e);return!k7()||!t.visualViewport?qae:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Zae(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Pi(e)?!1:t}function Rd(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),a=T7(e);let s=zs(1);t&&(r?os(r)&&(s=Zu(r)):s=Zu(e));const o=Zae(a,n,r)?xD(a):zs(0);let c=(i.left+o.x)/s.x,d=(i.top+o.y)/s.y,l=i.width/s.x,h=i.height/s.y;if(a){const f=Pi(a),g=r&&os(r)?Pi(r):r;let U=f,y=s8(U);for(;y&&r&&g!==U;){const v=Zu(y),x=y.getBoundingClientRect(),w=ls(y),C=x.left+(y.clientLeft+parseFloat(w.paddingLeft))*v.x,S=x.top+(y.clientTop+parseFloat(w.paddingTop))*v.y;c*=v.x,d*=v.y,l*=v.x,h*=v.y,c+=C,d+=S,U=Pi(y),y=s8(U)}}return A2({width:l,height:h,x:c,y:d})}function M7(e,t){const n=GU(e).scrollLeft;return t?t.left+n:Rd(no(e)).left+n}function wD(e,t,n){n===void 0&&(n=!1);const r=e.getBoundingClientRect(),i=r.left+t.scrollLeft-(n?0:M7(e,r)),a=r.top+t.scrollTop;return{x:i,y:a}}function Kae(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const a=i==="fixed",s=no(r),o=t?YU(t.floating):!1;if(r===s||o&&a)return n;let c={scrollLeft:0,scrollTop:0},d=zs(1);const l=zs(0),h=Qs(r);if((h||!h&&!a)&&((Hh(r)!=="body"||t0(s))&&(c=GU(r)),Qs(r))){const g=Rd(r);d=Zu(r),l.x=g.x+r.clientLeft,l.y=g.y+r.clientTop}const f=s&&!h&&!a?wD(s,c,!0):zs(0);return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-c.scrollLeft*d.x+l.x+f.x,y:n.y*d.y-c.scrollTop*d.y+l.y+f.y}}function Qae(e){return Array.from(e.getClientRects())}function Jae(e){const t=no(e),n=GU(e),r=e.ownerDocument.body,i=Di(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=Di(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+M7(e);const o=-n.scrollTop;return ls(r).direction==="rtl"&&(s+=Di(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:s,y:o}}function ese(e,t){const n=Pi(e),r=no(e),i=n.visualViewport;let a=r.clientWidth,s=r.clientHeight,o=0,c=0;if(i){a=i.width,s=i.height;const d=k7();(!d||d&&t==="fixed")&&(o=i.offsetLeft,c=i.offsetTop)}return{width:a,height:s,x:o,y:c}}const tse=new Set(["absolute","fixed"]);function nse(e,t){const n=Rd(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=Qs(e)?Zu(e):zs(1),s=e.clientWidth*a.x,o=e.clientHeight*a.y,c=i*a.x,d=r*a.y;return{width:s,height:o,x:c,y:d}}function KS(e,t,n){let r;if(t==="viewport")r=ese(e,n);else if(t==="document")r=Jae(no(e));else if(os(t))r=nse(t,n);else{const i=xD(e);r={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return A2(r)}function ED(e,t){const n=Uc(e);return n===t||!os(n)||wh(n)?!1:ls(n).position==="fixed"||ED(n,t)}function rse(e,t){const n=t.get(e);if(n)return n;let r=w1(e,[],!1).filter(o=>os(o)&&Hh(o)!=="body"),i=null;const a=ls(e).position==="fixed";let s=a?Uc(e):e;for(;os(s)&&!wh(s);){const o=ls(s),c=_7(s);!c&&o.position==="fixed"&&(i=null),(a?!c&&!i:!c&&o.position==="static"&&!!i&&tse.has(i.position)||t0(s)&&!c&&ED(e,s))?r=r.filter(l=>l!==s):i=o,s=Uc(s)}return t.set(e,r),r}function ise(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const s=[...n==="clippingAncestors"?YU(t)?[]:rse(t,this._c):[].concat(n),r],o=s[0],c=s.reduce((d,l)=>{const h=KS(t,l,i);return d.top=Di(h.top,d.top),d.right=gc(h.right,d.right),d.bottom=gc(h.bottom,d.bottom),d.left=Di(h.left,d.left),d},KS(t,o,i));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function ase(e){const{width:t,height:n}=vD(e);return{width:t,height:n}}function sse(e,t,n){const r=Qs(t),i=no(t),a=n==="fixed",s=Rd(e,!0,a,t);let o={scrollLeft:0,scrollTop:0};const c=zs(0);function d(){c.x=M7(i)}if(r||!r&&!a)if((Hh(t)!=="body"||t0(i))&&(o=GU(t)),r){const g=Rd(t,!0,a,t);c.x=g.x+t.clientLeft,c.y=g.y+t.clientTop}else i&&d();a&&!r&&i&&d();const l=i&&!r&&!a?wD(i,o):zs(0),h=s.left+o.scrollLeft-c.x-l.x,f=s.top+o.scrollTop-c.y-l.y;return{x:h,y:f,width:s.width,height:s.height}}function hy(e){return ls(e).position==="static"}function QS(e,t){if(!Qs(e)||ls(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return no(e)===n&&(n=n.ownerDocument.body),n}function CD(e,t){const n=Pi(e);if(YU(e))return n;if(!Qs(e)){let i=Uc(e);for(;i&&!wh(i);){if(os(i)&&!hy(i))return i;i=Uc(i)}return n}let r=QS(e,t);for(;r&&zae(r)&&hy(r);)r=QS(r,t);return r&&wh(r)&&hy(r)&&!_7(r)?n:r||Yae(e)||n}const ose=async function(e){const t=this.getOffsetParent||CD,n=this.getDimensions,r=await n(e.floating);return{reference:sse(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function lse(e){return ls(e).direction==="rtl"}const cse={convertOffsetParentRelativeRectToViewportRelativeRect:Kae,getDocumentElement:no,getClippingRect:ise,getOffsetParent:CD,getElementRects:ose,getClientRects:Qae,getDimensions:ase,getScale:Zu,isElement:os,isRTL:lse};function SD(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function dse(e,t){let n=null,r;const i=no(e);function a(){var o;clearTimeout(r),(o=n)==null||o.disconnect(),n=null}function s(o,c){o===void 0&&(o=!1),c===void 0&&(c=1),a();const d=e.getBoundingClientRect(),{left:l,top:h,width:f,height:g}=d;if(o||t(),!f||!g)return;const U=Om(h),y=Om(i.clientWidth-(l+f)),v=Om(i.clientHeight-(h+g)),x=Om(l),C={rootMargin:-U+"px "+-y+"px "+-v+"px "+-x+"px",threshold:Di(0,gc(1,c))||1};let S=!0;function k(M){const T=M[0].intersectionRatio;if(T!==c){if(!S)return s();T?s(!1,T):r=setTimeout(()=>{s(!1,1e-7)},1e3)}T===1&&!SD(d,e.getBoundingClientRect())&&s(),S=!1}try{n=new IntersectionObserver(k,{...C,root:i.ownerDocument})}catch{n=new IntersectionObserver(k,C)}n.observe(e)}return s(!0),a}function use(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:o=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,d=T7(e),l=i||a?[...d?w1(d):[],...w1(t)]:[];l.forEach(x=>{i&&x.addEventListener("scroll",n,{passive:!0}),a&&x.addEventListener("resize",n)});const h=d&&o?dse(d,n):null;let f=-1,g=null;s&&(g=new ResizeObserver(x=>{let[w]=x;w&&w.target===d&&g&&(g.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var C;(C=g)==null||C.observe(t)})),n()}),d&&!c&&g.observe(d),g.observe(t));let U,y=c?Rd(e):null;c&&v();function v(){const x=Rd(e);y&&!SD(y,x)&&n(),y=x,U=requestAnimationFrame(v)}return n(),()=>{var x;l.forEach(w=>{i&&w.removeEventListener("scroll",n),a&&w.removeEventListener("resize",n)}),h==null||h(),(x=g)==null||x.disconnect(),g=null,c&&cancelAnimationFrame(U)}}const hse=Pae,fse=Nae,pse=Rae,mse=Fae,gse=Dae,JS=Lae,Use=Oae,bse=(e,t,n)=>{const r=new Map,i={platform:cse,...n},a={...i.platform,_c:r};return Aae(e,t,{...i,platform:a})};var yse=typeof document<"u",vse=function(){},Tg=yse?I.useLayoutEffect:vse;function L2(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!L2(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){const a=i[r];if(!(a==="_owner"&&e.$$typeof)&&!L2(e[a],t[a]))return!1}return!0}return e!==e&&t!==t}function _D(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function e_(e,t){const n=_D(e);return Math.round(t*n)/n}function fy(e){const t=I.useRef(e);return Tg(()=>{t.current=e}),t}function xse(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:a,floating:s}={},transform:o=!0,whileElementsMounted:c,open:d}=e,[l,h]=I.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,g]=I.useState(r);L2(f,r)||g(r);const[U,y]=I.useState(null),[v,x]=I.useState(null),w=I.useCallback(z=>{z!==M.current&&(M.current=z,y(z))},[]),C=I.useCallback(z=>{z!==T.current&&(T.current=z,x(z))},[]),S=a||U,k=s||v,M=I.useRef(null),T=I.useRef(null),R=I.useRef(l),j=c!=null,P=fy(c),N=fy(i),F=fy(d),$=I.useCallback(()=>{if(!M.current||!T.current)return;const z={placement:t,strategy:n,middleware:f};N.current&&(z.platform=N.current),bse(M.current,T.current,z).then(Y=>{const K={...Y,isPositioned:F.current!==!1};q.current&&!L2(R.current,K)&&(R.current=K,Jn.flushSync(()=>{h(K)}))})},[f,t,n,N,F]);Tg(()=>{d===!1&&R.current.isPositioned&&(R.current.isPositioned=!1,h(z=>({...z,isPositioned:!1})))},[d]);const q=I.useRef(!1);Tg(()=>(q.current=!0,()=>{q.current=!1}),[]),Tg(()=>{if(S&&(M.current=S),k&&(T.current=k),S&&k){if(P.current)return P.current(S,k,$);$()}},[S,k,$,P,j]);const W=I.useMemo(()=>({reference:M,floating:T,setReference:w,setFloating:C}),[w,C]),V=I.useMemo(()=>({reference:S,floating:k}),[S,k]),B=I.useMemo(()=>{const z={position:n,left:0,top:0};if(!V.floating)return z;const Y=e_(V.floating,l.x),K=e_(V.floating,l.y);return o?{...z,transform:"translate("+Y+"px, "+K+"px)",..._D(V.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:Y,top:K}},[n,o,V.floating,l.x,l.y]);return I.useMemo(()=>({...l,update:$,refs:W,elements:V,floatingStyles:B}),[l,$,W,V,B])}const wse=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:i}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?JS({element:r.current,padding:i}).fn(n):{}:r?JS({element:r,padding:i}).fn(n):{}}}},Ese=(e,t)=>({...hse(e),options:[e,t]}),Cse=(e,t)=>({...fse(e),options:[e,t]}),Sse=(e,t)=>({...Use(e),options:[e,t]}),_se=(e,t)=>({...pse(e),options:[e,t]}),kse=(e,t)=>({...mse(e),options:[e,t]}),Tse=(e,t)=>({...gse(e),options:[e,t]}),Mse=(e,t)=>({...wse(e),options:[e,t]});var Ise="Arrow",kD=I.forwardRef((e,t)=>{const{children:n,width:r=10,height:i=5,...a}=e;return m.jsx(ll.svg,{...a,ref:t,width:r,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:m.jsx("polygon",{points:"0,0 30,0 15,10"})})});kD.displayName=Ise;var Ase=kD;function Lse(e){const[t,n]=I.useState(void 0);return Ld(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const a=i[0];let s,o;if("borderBoxSize"in a){const c=a.borderBoxSize,d=Array.isArray(c)?c[0]:c;s=d.inlineSize,o=d.blockSize}else s=e.offsetWidth,o=e.offsetHeight;n({width:s,height:o})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var I7="Popper",[TD,MD]=dD(I7),[Rse,ID]=TD(I7),AD=e=>{const{__scopePopper:t,children:n}=e,[r,i]=I.useState(null);return m.jsx(Rse,{scope:t,anchor:r,onAnchorChange:i,children:n})};AD.displayName=I7;var LD="PopperAnchor",RD=I.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...i}=e,a=ID(LD,n),s=I.useRef(null),o=Ec(t,s);return I.useEffect(()=>{a.onAnchorChange((r==null?void 0:r.current)||s.current)}),r?null:m.jsx(ll.div,{...i,ref:o})});RD.displayName=LD;var A7="PopperContent",[Dse,jse]=TD(A7),DD=I.forwardRef((e,t)=>{var Ce,ge,$e,je,Je,ut;const{__scopePopper:n,side:r="bottom",sideOffset:i=0,align:a="center",alignOffset:s=0,arrowPadding:o=0,avoidCollisions:c=!0,collisionBoundary:d=[],collisionPadding:l=0,sticky:h="partial",hideWhenDetached:f=!1,updatePositionStrategy:g="optimized",onPlaced:U,...y}=e,v=ID(A7,n),[x,w]=I.useState(null),C=Ec(t,zt=>w(zt)),[S,k]=I.useState(null),M=Lse(S),T=(M==null?void 0:M.width)??0,R=(M==null?void 0:M.height)??0,j=r+(a!=="center"?"-"+a:""),P=typeof l=="number"?l:{top:0,right:0,bottom:0,left:0,...l},N=Array.isArray(d)?d:[d],F=N.length>0,$={padding:P,boundary:N.filter(Nse),altBoundary:F},{refs:q,floatingStyles:W,placement:V,isPositioned:B,middlewareData:z}=xse({strategy:"fixed",placement:j,whileElementsMounted:(...zt)=>use(...zt,{animationFrame:g==="always"}),elements:{reference:v.anchor},middleware:[Ese({mainAxis:i+R,alignmentAxis:s}),c&&Cse({mainAxis:!0,crossAxis:!1,limiter:h==="partial"?Sse():void 0,...$}),c&&_se({...$}),kse({...$,apply:({elements:zt,rects:Tn,availableWidth:On,availableHeight:Fn})=>{const{width:hn,height:xa}=Tn.reference,fr=zt.floating.style;fr.setProperty("--radix-popper-available-width",`${On}px`),fr.setProperty("--radix-popper-available-height",`${Fn}px`),fr.setProperty("--radix-popper-anchor-width",`${hn}px`),fr.setProperty("--radix-popper-anchor-height",`${xa}px`)}}),S&&Mse({element:S,padding:o}),Ose({arrowWidth:T,arrowHeight:R}),f&&Tse({strategy:"referenceHidden",...$})]}),[Y,K]=ND(V),G=mc(U);Ld(()=>{B&&(G==null||G())},[B,G]);const ee=(Ce=z.arrow)==null?void 0:Ce.x,de=(ge=z.arrow)==null?void 0:ge.y,xe=(($e=z.arrow)==null?void 0:$e.centerOffset)!==0,[ve,Me]=I.useState();return Ld(()=>{x&&Me(window.getComputedStyle(x).zIndex)},[x]),m.jsx("div",{ref:q.setFloating,"data-radix-popper-content-wrapper":"",style:{...W,transform:B?W.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ve,"--radix-popper-transform-origin":[(je=z.transformOrigin)==null?void 0:je.x,(Je=z.transformOrigin)==null?void 0:Je.y].join(" "),...((ut=z.hide)==null?void 0:ut.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:m.jsx(Dse,{scope:n,placedSide:Y,onArrowChange:k,arrowX:ee,arrowY:de,shouldHideArrow:xe,children:m.jsx(ll.div,{"data-side":Y,"data-align":K,...y,ref:C,style:{...y.style,animation:B?void 0:"none"}})})})});DD.displayName=A7;var jD="PopperArrow",Pse={top:"bottom",right:"left",bottom:"top",left:"right"},PD=I.forwardRef(function(t,n){const{__scopePopper:r,...i}=t,a=jse(jD,r),s=Pse[a.placedSide];return m.jsx("span",{ref:a.onArrowChange,style:{position:"absolute",left:a.arrowX,top:a.arrowY,[s]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[a.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[a.placedSide],visibility:a.shouldHideArrow?"hidden":void 0},children:m.jsx(Ase,{...i,ref:n,style:{...i.style,display:"block"}})})});PD.displayName=jD;function Nse(e){return e!==null}var Ose=e=>({name:"transformOrigin",options:e,fn(t){var v,x,w;const{placement:n,rects:r,middlewareData:i}=t,s=((v=i.arrow)==null?void 0:v.centerOffset)!==0,o=s?0:e.arrowWidth,c=s?0:e.arrowHeight,[d,l]=ND(n),h={start:"0%",center:"50%",end:"100%"}[l],f=(((x=i.arrow)==null?void 0:x.x)??0)+o/2,g=(((w=i.arrow)==null?void 0:w.y)??0)+c/2;let U="",y="";return d==="bottom"?(U=s?h:`${f}px`,y=`${-c}px`):d==="top"?(U=s?h:`${f}px`,y=`${r.floating.height+c}px`):d==="right"?(U=`${-c}px`,y=s?h:`${g}px`):d==="left"&&(U=`${r.floating.width+c}px`,y=s?h:`${g}px`),{data:{x:U,y}}}});function ND(e){const[t,n="center"]=e.split("-");return[t,n]}var Fse=AD,OD=RD,$se=DD,Bse=PD,zse="Portal",FD=I.forwardRef((e,t)=>{var o;const{container:n,...r}=e,[i,a]=I.useState(!1);Ld(()=>a(!0),[]);const s=n||i&&((o=globalThis==null?void 0:globalThis.document)==null?void 0:o.body);return s?mz.createPortal(m.jsx(ll.div,{...r,ref:t}),s):null});FD.displayName=zse;function Hse(e,t){return I.useReducer((n,r)=>t[n][r]??n,e)}var L7=e=>{const{present:t,children:n}=e,r=Wse(t),i=typeof n=="function"?n({present:r.isPresent}):I.Children.only(n),a=Ec(r.ref,Xse(i));return typeof n=="function"||r.isPresent?I.cloneElement(i,{ref:a}):null};L7.displayName="Presence";function Wse(e){const[t,n]=I.useState(),r=I.useRef({}),i=I.useRef(e),a=I.useRef("none"),s=e?"mounted":"unmounted",[o,c]=Hse(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return I.useEffect(()=>{const d=Fm(r.current);a.current=o==="mounted"?d:"none"},[o]),Ld(()=>{const d=r.current,l=i.current;if(l!==e){const f=a.current,g=Fm(d);e?c("MOUNT"):g==="none"||(d==null?void 0:d.display)==="none"?c("UNMOUNT"):c(l&&f!==g?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,c]),Ld(()=>{if(t){let d;const l=t.ownerDocument.defaultView??window,h=g=>{const y=Fm(r.current).includes(g.animationName);if(g.target===t&&y&&(c("ANIMATION_END"),!i.current)){const v=t.style.animationFillMode;t.style.animationFillMode="forwards",d=l.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=v)})}},f=g=>{g.target===t&&(a.current=Fm(r.current))};return t.addEventListener("animationstart",f),t.addEventListener("animationcancel",h),t.addEventListener("animationend",h),()=>{l.clearTimeout(d),t.removeEventListener("animationstart",f),t.removeEventListener("animationcancel",h),t.removeEventListener("animationend",h)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(o),ref:I.useCallback(d=>{d&&(r.current=getComputedStyle(d)),n(d)},[])}}function Fm(e){return(e==null?void 0:e.animationName)||"none"}function Xse(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function Vse({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,i]=Yse({defaultProp:t,onChange:n}),a=e!==void 0,s=a?e:r,o=mc(n),c=I.useCallback(d=>{if(a){const h=typeof d=="function"?d(e):d;h!==e&&o(h)}else i(d)},[a,e,i,o]);return[s,c]}function Yse({defaultProp:e,onChange:t}){const n=I.useState(e),[r]=n,i=I.useRef(r),a=mc(t);return I.useEffect(()=>{i.current!==r&&(a(r),i.current=r)},[r,i,a]),n}var Gse=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Cu=new WeakMap,$m=new WeakMap,Bm={},py=0,$D=function(e){return e&&(e.host||$D(e.parentNode))},qse=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=$D(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},Zse=function(e,t,n,r){var i=qse(t,Array.isArray(e)?e:[e]);Bm[n]||(Bm[n]=new WeakMap);var a=Bm[n],s=[],o=new Set,c=new Set(i),d=function(h){!h||o.has(h)||(o.add(h),d(h.parentNode))};i.forEach(d);var l=function(h){!h||c.has(h)||Array.prototype.forEach.call(h.children,function(f){if(o.has(f))l(f);else try{var g=f.getAttribute(r),U=g!==null&&g!=="false",y=(Cu.get(f)||0)+1,v=(a.get(f)||0)+1;Cu.set(f,y),a.set(f,v),s.push(f),y===1&&U&&$m.set(f,!0),v===1&&f.setAttribute(n,"true"),U||f.setAttribute(r,"true")}catch(x){console.error("aria-hidden: cannot operate on ",f,x)}})};return l(t),o.clear(),py++,function(){s.forEach(function(h){var f=Cu.get(h)-1,g=a.get(h)-1;Cu.set(h,f),a.set(h,g),f||($m.has(h)||h.removeAttribute(r),$m.delete(h)),g||h.removeAttribute(n)}),py--,py||(Cu=new WeakMap,Cu=new WeakMap,$m=new WeakMap,Bm={})}},Kse=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),i=Gse(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live], script"))),Zse(r,i,n,"aria-hidden")):function(){return null}},Os=function(){return Os=Object.assign||function(t){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(t[a]=n[a])}return t},Os.apply(this,arguments)};function BD(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function Qse(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||(a=Array.prototype.slice.call(t,0,r)),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var Mg="right-scroll-bar-position",Ig="width-before-scroll-bar",Jse="with-scroll-bars-hidden",eoe="--removed-body-scroll-bar-size";function my(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function toe(e,t){var n=I.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var i=n.value;i!==r&&(n.value=r,n.callback(r,i))}}}})[0];return n.callback=t,n.facade}var noe=typeof window<"u"?I.useLayoutEffect:I.useEffect,t_=new WeakMap;function roe(e,t){var n=toe(null,function(r){return e.forEach(function(i){return my(i,r)})});return noe(function(){var r=t_.get(n);if(r){var i=new Set(r),a=new Set(e),s=n.current;i.forEach(function(o){a.has(o)||my(o,null)}),a.forEach(function(o){i.has(o)||my(o,s)})}t_.set(n,e)},[e]),n}function ioe(e){return e}function aoe(e,t){t===void 0&&(t=ioe);var n=[],r=!1,i={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(a){var s=t(a,r);return n.push(s),function(){n=n.filter(function(o){return o!==s})}},assignSyncMedium:function(a){for(r=!0;n.length;){var s=n;n=[],s.forEach(a)}n={push:function(o){return a(o)},filter:function(){return n}}},assignMedium:function(a){r=!0;var s=[];if(n.length){var o=n;n=[],o.forEach(a),s=n}var c=function(){var l=s;s=[],l.forEach(a)},d=function(){return Promise.resolve().then(c)};d(),n={push:function(l){s.push(l),d()},filter:function(l){return s=s.filter(l),n}}}};return i}function soe(e){e===void 0&&(e={});var t=aoe(null);return t.options=Os({async:!0,ssr:!1},e),t}var zD=function(e){var t=e.sideCar,n=BD(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return I.createElement(r,Os({},n))};zD.isSideCarExport=!0;function ooe(e,t){return e.useMedium(t),zD}var HD=soe(),gy=function(){},qU=I.forwardRef(function(e,t){var n=I.useRef(null),r=I.useState({onScrollCapture:gy,onWheelCapture:gy,onTouchMoveCapture:gy}),i=r[0],a=r[1],s=e.forwardProps,o=e.children,c=e.className,d=e.removeScrollBar,l=e.enabled,h=e.shards,f=e.sideCar,g=e.noRelative,U=e.noIsolation,y=e.inert,v=e.allowPinchZoom,x=e.as,w=x===void 0?"div":x,C=e.gapMode,S=BD(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),k=f,M=roe([n,t]),T=Os(Os({},S),i);return I.createElement(I.Fragment,null,l&&I.createElement(k,{sideCar:HD,removeScrollBar:d,shards:h,noRelative:g,noIsolation:U,inert:y,setCallbacks:a,allowPinchZoom:!!v,lockRef:n,gapMode:C}),s?I.cloneElement(I.Children.only(o),Os(Os({},T),{ref:M})):I.createElement(w,Os({},T,{className:c,ref:M}),o))});qU.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};qU.classNames={fullWidth:Ig,zeroRight:Mg};var loe=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function coe(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=loe();return t&&e.setAttribute("nonce",t),e}function doe(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function uoe(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var hoe=function(){var e=0,t=null;return{add:function(n){e==0&&(t=coe())&&(doe(t,n),uoe(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},foe=function(){var e=hoe();return function(t,n){I.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},WD=function(){var e=foe(),t=function(n){var r=n.styles,i=n.dynamic;return e(r,i),null};return t},poe={left:0,top:0,right:0,gap:0},Uy=function(e){return parseInt(e||"",10)||0},moe=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],i=t[e==="padding"?"paddingRight":"marginRight"];return[Uy(n),Uy(r),Uy(i)]},goe=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return poe;var t=moe(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},Uoe=WD(),Ku="data-scroll-locked",boe=function(e,t,n,r){var i=e.left,a=e.top,s=e.right,o=e.gap;return n===void 0&&(n="margin"),`
92
- .`.concat(Jse,` {
93
- overflow: hidden `).concat(r,`;
94
- padding-right: `).concat(o,"px ").concat(r,`;
95
- }
96
- body[`).concat(Ku,`] {
97
- overflow: hidden `).concat(r,`;
98
- overscroll-behavior: contain;
99
- `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
100
- padding-left: `.concat(i,`px;
101
- padding-top: `).concat(a,`px;
102
- padding-right: `).concat(s,`px;
103
- margin-left:0;
104
- margin-top:0;
105
- margin-right: `).concat(o,"px ").concat(r,`;
106
- `),n==="padding"&&"padding-right: ".concat(o,"px ").concat(r,";")].filter(Boolean).join(""),`
107
- }
108
-
109
- .`).concat(Mg,` {
110
- right: `).concat(o,"px ").concat(r,`;
111
- }
112
-
113
- .`).concat(Ig,` {
114
- margin-right: `).concat(o,"px ").concat(r,`;
115
- }
116
-
117
- .`).concat(Mg," .").concat(Mg,` {
118
- right: 0 `).concat(r,`;
119
- }
120
-
121
- .`).concat(Ig," .").concat(Ig,` {
122
- margin-right: 0 `).concat(r,`;
123
- }
124
-
125
- body[`).concat(Ku,`] {
126
- `).concat(eoe,": ").concat(o,`px;
127
- }
128
- `)},n_=function(){var e=parseInt(document.body.getAttribute(Ku)||"0",10);return isFinite(e)?e:0},yoe=function(){I.useEffect(function(){return document.body.setAttribute(Ku,(n_()+1).toString()),function(){var e=n_()-1;e<=0?document.body.removeAttribute(Ku):document.body.setAttribute(Ku,e.toString())}},[])},voe=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?"margin":r;yoe();var a=I.useMemo(function(){return goe(i)},[i]);return I.createElement(Uoe,{styles:boe(a,!t,i,n?"":"!important")})},o8=!1;if(typeof window<"u")try{var zm=Object.defineProperty({},"passive",{get:function(){return o8=!0,!0}});window.addEventListener("test",zm,zm),window.removeEventListener("test",zm,zm)}catch{o8=!1}var Su=o8?{passive:!1}:!1,xoe=function(e){return e.tagName==="TEXTAREA"},XD=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!xoe(e)&&n[t]==="visible")},woe=function(e){return XD(e,"overflowY")},Eoe=function(e){return XD(e,"overflowX")},r_=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var i=VD(e,r);if(i){var a=YD(e,r),s=a[1],o=a[2];if(s>o)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Coe=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},Soe=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},VD=function(e,t){return e==="v"?woe(t):Eoe(t)},YD=function(e,t){return e==="v"?Coe(t):Soe(t)},_oe=function(e,t){return e==="h"&&t==="rtl"?-1:1},koe=function(e,t,n,r,i){var a=_oe(e,window.getComputedStyle(t).direction),s=a*r,o=n.target,c=t.contains(o),d=!1,l=s>0,h=0,f=0;do{if(!o)break;var g=YD(e,o),U=g[0],y=g[1],v=g[2],x=y-v-a*U;(U||x)&&VD(e,o)&&(h+=x,f+=U);var w=o.parentNode;o=w&&w.nodeType===Node.DOCUMENT_FRAGMENT_NODE?w.host:w}while(!c&&o!==document.body||c&&(t.contains(o)||t===o));return(l&&Math.abs(h)<1||!l&&Math.abs(f)<1)&&(d=!0),d},Hm=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},i_=function(e){return[e.deltaX,e.deltaY]},a_=function(e){return e&&"current"in e?e.current:e},Toe=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Moe=function(e){return`
129
- .block-interactivity-`.concat(e,` {pointer-events: none;}
130
- .allow-interactivity-`).concat(e,` {pointer-events: all;}
131
- `)},Ioe=0,_u=[];function Aoe(e){var t=I.useRef([]),n=I.useRef([0,0]),r=I.useRef(),i=I.useState(Ioe++)[0],a=I.useState(WD)[0],s=I.useRef(e);I.useEffect(function(){s.current=e},[e]),I.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var y=Qse([e.lockRef.current],(e.shards||[]).map(a_),!0).filter(Boolean);return y.forEach(function(v){return v.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),y.forEach(function(v){return v.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var o=I.useCallback(function(y,v){if("touches"in y&&y.touches.length===2||y.type==="wheel"&&y.ctrlKey)return!s.current.allowPinchZoom;var x=Hm(y),w=n.current,C="deltaX"in y?y.deltaX:w[0]-x[0],S="deltaY"in y?y.deltaY:w[1]-x[1],k,M=y.target,T=Math.abs(C)>Math.abs(S)?"h":"v";if("touches"in y&&T==="h"&&M.type==="range")return!1;var R=r_(T,M);if(!R)return!0;if(R?k=T:(k=T==="v"?"h":"v",R=r_(T,M)),!R)return!1;if(!r.current&&"changedTouches"in y&&(C||S)&&(r.current=k),!k)return!0;var j=r.current||k;return koe(j,v,y,j==="h"?C:S)},[]),c=I.useCallback(function(y){var v=y;if(!(!_u.length||_u[_u.length-1]!==a)){var x="deltaY"in v?i_(v):Hm(v),w=t.current.filter(function(k){return k.name===v.type&&(k.target===v.target||v.target===k.shadowParent)&&Toe(k.delta,x)})[0];if(w&&w.should){v.cancelable&&v.preventDefault();return}if(!w){var C=(s.current.shards||[]).map(a_).filter(Boolean).filter(function(k){return k.contains(v.target)}),S=C.length>0?o(v,C[0]):!s.current.noIsolation;S&&v.cancelable&&v.preventDefault()}}},[]),d=I.useCallback(function(y,v,x,w){var C={name:y,delta:v,target:x,should:w,shadowParent:Loe(x)};t.current.push(C),setTimeout(function(){t.current=t.current.filter(function(S){return S!==C})},1)},[]),l=I.useCallback(function(y){n.current=Hm(y),r.current=void 0},[]),h=I.useCallback(function(y){d(y.type,i_(y),y.target,o(y,e.lockRef.current))},[]),f=I.useCallback(function(y){d(y.type,Hm(y),y.target,o(y,e.lockRef.current))},[]);I.useEffect(function(){return _u.push(a),e.setCallbacks({onScrollCapture:h,onWheelCapture:h,onTouchMoveCapture:f}),document.addEventListener("wheel",c,Su),document.addEventListener("touchmove",c,Su),document.addEventListener("touchstart",l,Su),function(){_u=_u.filter(function(y){return y!==a}),document.removeEventListener("wheel",c,Su),document.removeEventListener("touchmove",c,Su),document.removeEventListener("touchstart",l,Su)}},[]);var g=e.removeScrollBar,U=e.inert;return I.createElement(I.Fragment,null,U?I.createElement(a,{styles:Moe(i)}):null,g?I.createElement(voe,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Loe(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Roe=ooe(HD,Aoe);var GD=I.forwardRef(function(e,t){return I.createElement(qU,Os({},e,{ref:t,sideCar:Roe}))});GD.classNames=qU.classNames;var R7="Popover",[qD,p4e]=dD(R7,[MD]),n0=MD(),[Doe,Cc]=qD(R7),ZD=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:s=!1}=e,o=n0(t),c=I.useRef(null),[d,l]=I.useState(!1),[h=!1,f]=Vse({prop:r,defaultProp:i,onChange:a});return m.jsx(Fse,{...o,children:m.jsx(Doe,{scope:t,contentId:yae(),triggerRef:c,open:h,onOpenChange:f,onOpenToggle:I.useCallback(()=>f(g=>!g),[f]),hasCustomAnchor:d,onCustomAnchorAdd:I.useCallback(()=>l(!0),[]),onCustomAnchorRemove:I.useCallback(()=>l(!1),[]),modal:s,children:n})})};ZD.displayName=R7;var KD="PopoverAnchor",joe=I.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,i=Cc(KD,n),a=n0(n),{onCustomAnchorAdd:s,onCustomAnchorRemove:o}=i;return I.useEffect(()=>(s(),()=>o()),[s,o]),m.jsx(OD,{...a,...r,ref:t})});joe.displayName=KD;var QD="PopoverTrigger",JD=I.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,i=Cc(QD,n),a=n0(n),s=Ec(t,i.triggerRef),o=m.jsx(ll.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":aj(i.open),...r,ref:s,onClick:cc(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?o:m.jsx(OD,{asChild:!0,...a,children:o})});JD.displayName=QD;var D7="PopoverPortal",[Poe,Noe]=qD(D7,{forceMount:void 0}),ej=e=>{const{__scopePopover:t,forceMount:n,children:r,container:i}=e,a=Cc(D7,t);return m.jsx(Poe,{scope:t,forceMount:n,children:m.jsx(L7,{present:n||a.open,children:m.jsx(FD,{asChild:!0,container:i,children:r})})})};ej.displayName=D7;var Eh="PopoverContent",tj=I.forwardRef((e,t)=>{const n=Noe(Eh,e.__scopePopover),{forceMount:r=n.forceMount,...i}=e,a=Cc(Eh,e.__scopePopover);return m.jsx(L7,{present:r||a.open,children:a.modal?m.jsx(Ooe,{...i,ref:t}):m.jsx(Foe,{...i,ref:t})})});tj.displayName=Eh;var Ooe=I.forwardRef((e,t)=>{const n=Cc(Eh,e.__scopePopover),r=I.useRef(null),i=Ec(t,r),a=I.useRef(!1);return I.useEffect(()=>{const s=r.current;if(s)return Kse(s)},[]),m.jsx(GD,{as:w7,allowPinchZoom:!0,children:m.jsx(nj,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:cc(e.onCloseAutoFocus,s=>{var o;s.preventDefault(),a.current||(o=n.triggerRef.current)==null||o.focus()}),onPointerDownOutside:cc(e.onPointerDownOutside,s=>{const o=s.detail.originalEvent,c=o.button===0&&o.ctrlKey===!0,d=o.button===2||c;a.current=d},{checkForDefaultPrevented:!1}),onFocusOutside:cc(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1})})})}),Foe=I.forwardRef((e,t)=>{const n=Cc(Eh,e.__scopePopover),r=I.useRef(!1),i=I.useRef(!1);return m.jsx(nj,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{var s,o;(s=e.onCloseAutoFocus)==null||s.call(e,a),a.defaultPrevented||(r.current||(o=n.triggerRef.current)==null||o.focus(),a.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:a=>{var c,d;(c=e.onInteractOutside)==null||c.call(e,a),a.defaultPrevented||(r.current=!0,a.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const s=a.target;((d=n.triggerRef.current)==null?void 0:d.contains(s))&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&i.current&&a.preventDefault()}})}),nj=I.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:s,onEscapeKeyDown:o,onPointerDownOutside:c,onFocusOutside:d,onInteractOutside:l,...h}=e,f=Cc(Eh,n),g=n0(n);return cae(),m.jsx(pD,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:m.jsx(hD,{asChild:!0,disableOutsidePointerEvents:s,onInteractOutside:l,onEscapeKeyDown:o,onPointerDownOutside:c,onFocusOutside:d,onDismiss:()=>f.onOpenChange(!1),children:m.jsx($se,{"data-state":aj(f.open),role:"dialog",id:f.contentId,...g,...h,ref:t,style:{...h.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),rj="PopoverClose",$oe=I.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,i=Cc(rj,n);return m.jsx(ll.button,{type:"button",...r,ref:t,onClick:cc(e.onClick,()=>i.onOpenChange(!1))})});$oe.displayName=rj;var Boe="PopoverArrow",ij=I.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,i=n0(n);return m.jsx(Bse,{...i,...r,ref:t})});ij.displayName=Boe;function aj(e){return e?"open":"closed"}var ZU=ZD,KU=JD,zoe=ej,j7=tj,sj=ij,by={exports:{}},s_;function Hoe(){return s_||(s_=1,function(e,t){(function(){var n={};e.exports=n,n.simpleFilter=function(r,i){return i.filter(function(a){return n.test(r,a)})},n.test=function(r,i){return n.match(r,i)!==null},n.match=function(r,i,a){a=a||{};var s=0,o=[],c=i.length,d=0,l=0,h=a.pre||"",f=a.post||"",g=a.caseSensitive&&i||i.toLowerCase(),U;r=a.caseSensitive&&r||r.toLowerCase();for(var y=0;y<c;y++)U=i[y],g[y]===r[s]?(U=h+U+f,s+=1,l+=1+l):l=0,d+=l,o[o.length]=U;return s===r.length?(d=g===r?1/0:d,{rendered:o.join(""),score:d}):null},n.filter=function(r,i,a){return!i||i.length===0?[]:typeof r!="string"?i:(a=a||{},i.reduce(function(s,o,c,d){var l=o;a.extract&&(l=a.extract(o));var h=n.match(r,l,a);return h!=null&&(s[s.length]={string:h.rendered,score:h.score,index:c,original:o}),s},[]).sort(function(s,o){var c=o.score-s.score;return c||s.index-o.index}))}})()}(by)),by.exports}var Woe=Hoe();const Xoe=ya(Woe),Voe={},o_=e=>{let t;const n=new Set,r=(l,h)=>{const f=typeof l=="function"?l(t):l;if(!Object.is(f,t)){const g=t;t=h??(typeof f!="object"||f===null)?f:Object.assign({},t,f),n.forEach(U=>U(t,g))}},i=()=>t,c={setState:r,getState:i,getInitialState:()=>d,subscribe:l=>(n.add(l),()=>n.delete(l)),destroy:()=>{(Voe?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},d=t=e(r,i,c);return c},Yoe=e=>e?o_(e):o_;var yy={exports:{}},vy={},xy={exports:{}},wy={};/**
132
- * @license React
133
- * use-sync-external-store-shim.production.js
134
- *
135
- * Copyright (c) Meta Platforms, Inc. and affiliates.
136
- *
137
- * This source code is licensed under the MIT license found in the
138
- * LICENSE file in the root directory of this source tree.
139
- */var l_;function Goe(){if(l_)return wy;l_=1;var e=P1();function t(h,f){return h===f&&(h!==0||1/h===1/f)||h!==h&&f!==f}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,i=e.useEffect,a=e.useLayoutEffect,s=e.useDebugValue;function o(h,f){var g=f(),U=r({inst:{value:g,getSnapshot:f}}),y=U[0].inst,v=U[1];return a(function(){y.value=g,y.getSnapshot=f,c(y)&&v({inst:y})},[h,g,f]),i(function(){return c(y)&&v({inst:y}),h(function(){c(y)&&v({inst:y})})},[h]),s(g),g}function c(h){var f=h.getSnapshot;h=h.value;try{var g=f();return!n(h,g)}catch{return!0}}function d(h,f){return f()}var l=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?d:o;return wy.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:l,wy}var c_;function qoe(){return c_||(c_=1,xy.exports=Goe()),xy.exports}/**
140
- * @license React
141
- * use-sync-external-store-shim/with-selector.production.js
142
- *
143
- * Copyright (c) Meta Platforms, Inc. and affiliates.
144
- *
145
- * This source code is licensed under the MIT license found in the
146
- * LICENSE file in the root directory of this source tree.
147
- */var d_;function Zoe(){if(d_)return vy;d_=1;var e=P1(),t=qoe();function n(d,l){return d===l&&(d!==0||1/d===1/l)||d!==d&&l!==l}var r=typeof Object.is=="function"?Object.is:n,i=t.useSyncExternalStore,a=e.useRef,s=e.useEffect,o=e.useMemo,c=e.useDebugValue;return vy.useSyncExternalStoreWithSelector=function(d,l,h,f,g){var U=a(null);if(U.current===null){var y={hasValue:!1,value:null};U.current=y}else y=U.current;U=o(function(){function x(M){if(!w){if(w=!0,C=M,M=f(M),g!==void 0&&y.hasValue){var T=y.value;if(g(T,M))return S=T}return S=M}if(T=S,r(C,M))return T;var R=f(M);return g!==void 0&&g(T,R)?(C=M,T):(C=M,S=R)}var w=!1,C,S,k=h===void 0?null:h;return[function(){return x(l())},k===null?void 0:function(){return x(k())}]},[l,h,f,g]);var v=i(d,U[0],U[1]);return s(function(){y.hasValue=!0,y.value=v},[v]),c(v),v},vy}var u_;function Koe(){return u_||(u_=1,yy.exports=Zoe()),yy.exports}var Qoe=Koe();const Joe=ya(Qoe),oj={},{useDebugValue:ele}=ke,{useSyncExternalStoreWithSelector:tle}=Joe;let h_=!1;const nle=e=>e;function rle(e,t=nle,n){(oj?"production":void 0)!=="production"&&n&&!h_&&(console.warn("[DEPRECATED] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`. They can be imported from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937"),h_=!0);const r=tle(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return ele(r),r}const f_=e=>{(oj?"production":void 0)!=="production"&&typeof e!="function"&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");const t=typeof e=="function"?Yoe(e):e,n=(r,i)=>rle(t,r,i);return Object.assign(n,t),n},ile=e=>e?f_(e):f_;var p_,m_;const g_=typeof window<"u"&&((p_=window.document)!=null&&p_.createElement||((m_=window.navigator)==null?void 0:m_.product)==="ReactNative")?ke.useLayoutEffect:ke.useEffect;function _s(){const e=ile(t=>({current:new Array,version:0,set:t}));return{In:({children:t})=>{const n=e(i=>i.set),r=e(i=>i.version);return g_(()=>{n(i=>({version:i.version+1}))},[]),g_(()=>(n(({current:i})=>({current:[...i,t]})),()=>n(({current:i})=>({current:i.filter(a=>a!==t)}))),[t,r]),null},Out:()=>{const t=e(n=>n.current);return ke.createElement(ke.Fragment,null,t)}}}function tr(){return tr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},tr.apply(null,arguments)}function Ey(e,t,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e==null||e(i),n===!1||!i.defaultPrevented)return t==null?void 0:t(i)}}function ale(e,t=[]){let n=[];function r(a,s){const o=I.createContext(s),c=n.length;n=[...n,s];function d(h){const{scope:f,children:g,...U}=h,y=(f==null?void 0:f[e][c])||o,v=I.useMemo(()=>U,Object.values(U));return I.createElement(y.Provider,{value:v},g)}function l(h,f){const g=(f==null?void 0:f[e][c])||o,U=I.useContext(g);if(U)return U;if(s!==void 0)return s;throw new Error(`\`${h}\` must be used within \`${a}\``)}return d.displayName=a+"Provider",[d,l]}const i=()=>{const a=n.map(s=>I.createContext(s));return function(o){const c=(o==null?void 0:o[e])||a;return I.useMemo(()=>({[`__scope${e}`]:{...o,[e]:c}}),[o,c])}};return i.scopeName=e,[r,sle(i,...t)]}function sle(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(a){const s=r.reduce((o,{useScope:c,scopeName:d})=>{const h=c(a)[`__scope${d}`];return{...o,...h}},{});return I.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}function Qu(e,t,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e==null||e(i),n===!1||!i.defaultPrevented)return t==null?void 0:t(i)}}function ole(e,t=[]){let n=[];function r(a,s){const o=I.createContext(s),c=n.length;n=[...n,s];function d(h){const{scope:f,children:g,...U}=h,y=(f==null?void 0:f[e][c])||o,v=I.useMemo(()=>U,Object.values(U));return I.createElement(y.Provider,{value:v},g)}function l(h,f){const g=(f==null?void 0:f[e][c])||o,U=I.useContext(g);if(U)return U;if(s!==void 0)return s;throw new Error(`\`${h}\` must be used within \`${a}\``)}return d.displayName=a+"Provider",[d,l]}const i=()=>{const a=n.map(s=>I.createContext(s));return function(o){const c=(o==null?void 0:o[e])||a;return I.useMemo(()=>({[`__scope${e}`]:{...o,[e]:c}}),[o,c])}};return i.scopeName=e,[r,lle(i,...t)]}function lle(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(a){const s=r.reduce((o,{useScope:c,scopeName:d})=>{const h=c(a)[`__scope${d}`];return{...o,...h}},{});return I.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}function cle(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function lj(...e){return t=>e.forEach(n=>cle(n,t))}function U_(...e){return I.useCallback(lj(...e),e)}const l8=I.forwardRef((e,t)=>{const{children:n,...r}=e,i=I.Children.toArray(n),a=i.find(ule);if(a){const s=a.props.children,o=i.map(c=>c===a?I.Children.count(s)>1?I.Children.only(null):I.isValidElement(s)?s.props.children:null:c);return I.createElement(c8,tr({},r,{ref:t}),I.isValidElement(s)?I.cloneElement(s,void 0,o):null)}return I.createElement(c8,tr({},r,{ref:t}),n)});l8.displayName="Slot";const c8=I.forwardRef((e,t)=>{const{children:n,...r}=e;return I.isValidElement(n)?I.cloneElement(n,{...hle(r,n.props),ref:lj(t,n.ref)}):I.Children.count(n)>1?I.Children.only(null):null});c8.displayName="SlotClone";const dle=({children:e})=>I.createElement(I.Fragment,null,e);function ule(e){return I.isValidElement(e)&&e.type===dle}function hle(e,t){const n={...t};for(const r in t){const i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...o)=>{a(...o),i(...o)}:i&&(n[r]=i):r==="style"?n[r]={...i,...a}:r==="className"&&(n[r]=[i,a].filter(Boolean).join(" "))}return{...e,...n}}function fle(e){const t=e+"CollectionProvider",[n,r]=ole(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),s=g=>{const{scope:U,children:y}=g,v=ke.useRef(null),x=ke.useRef(new Map).current;return ke.createElement(i,{scope:U,itemMap:x,collectionRef:v},y)},o=e+"CollectionSlot",c=ke.forwardRef((g,U)=>{const{scope:y,children:v}=g,x=a(o,y),w=U_(U,x.collectionRef);return ke.createElement(l8,{ref:w},v)}),d=e+"CollectionItemSlot",l="data-radix-collection-item",h=ke.forwardRef((g,U)=>{const{scope:y,children:v,...x}=g,w=ke.useRef(null),C=U_(U,w),S=a(d,y);return ke.useEffect(()=>(S.itemMap.set(w,{ref:w,...x}),()=>void S.itemMap.delete(w))),ke.createElement(l8,{[l]:"",ref:C},v)});function f(g){const U=a(e+"CollectionConsumer",g);return ke.useCallback(()=>{const v=U.collectionRef.current;if(!v)return[];const x=Array.from(v.querySelectorAll(`[${l}]`));return Array.from(U.itemMap.values()).sort((S,k)=>x.indexOf(S.ref.current)-x.indexOf(k.ref.current))},[U.collectionRef,U.itemMap])}return[{Provider:s,Slot:c,ItemSlot:h},f,r]}function ple(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function cj(...e){return t=>e.forEach(n=>ple(n,t))}function mle(...e){return I.useCallback(cj(...e),e)}function gle(e,t=[]){let n=[];function r(a,s){const o=I.createContext(s),c=n.length;n=[...n,s];function d(h){const{scope:f,children:g,...U}=h,y=(f==null?void 0:f[e][c])||o,v=I.useMemo(()=>U,Object.values(U));return I.createElement(y.Provider,{value:v},g)}function l(h,f){const g=(f==null?void 0:f[e][c])||o,U=I.useContext(g);if(U)return U;if(s!==void 0)return s;throw new Error(`\`${h}\` must be used within \`${a}\``)}return d.displayName=a+"Provider",[d,l]}const i=()=>{const a=n.map(s=>I.createContext(s));return function(o){const c=(o==null?void 0:o[e])||a;return I.useMemo(()=>({[`__scope${e}`]:{...o,[e]:c}}),[o,c])}};return i.scopeName=e,[r,Ule(i,...t)]}function Ule(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(a){const s=r.reduce((o,{useScope:c,scopeName:d})=>{const h=c(a)[`__scope${d}`];return{...o,...h}},{});return I.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}const ble=globalThis!=null&&globalThis.document?I.useLayoutEffect:()=>{},yle=tv.useId||(()=>{});let vle=0;function xle(e){const[t,n]=I.useState(yle());return ble(()=>{n(r=>r??String(vle++))},[e]),t?`radix-${t}`:""}const dj=I.forwardRef((e,t)=>{const{children:n,...r}=e,i=I.Children.toArray(n),a=i.find(Ele);if(a){const s=a.props.children,o=i.map(c=>c===a?I.Children.count(s)>1?I.Children.only(null):I.isValidElement(s)?s.props.children:null:c);return I.createElement(d8,tr({},r,{ref:t}),I.isValidElement(s)?I.cloneElement(s,void 0,o):null)}return I.createElement(d8,tr({},r,{ref:t}),n)});dj.displayName="Slot";const d8=I.forwardRef((e,t)=>{const{children:n,...r}=e;return I.isValidElement(n)?I.cloneElement(n,{...Cle(r,n.props),ref:cj(t,n.ref)}):I.Children.count(n)>1?I.Children.only(null):null});d8.displayName="SlotClone";const wle=({children:e})=>I.createElement(I.Fragment,null,e);function Ele(e){return I.isValidElement(e)&&e.type===wle}function Cle(e,t){const n={...t};for(const r in t){const i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...o)=>{a(...o),i(...o)}:i&&(n[r]=i):r==="style"?n[r]={...i,...a}:r==="className"&&(n[r]=[i,a].filter(Boolean).join(" "))}return{...e,...n}}const Sle=["a","button","div","h2","h3","img","label","li","nav","ol","p","span","svg","ul"],uj=Sle.reduce((e,t)=>{const n=I.forwardRef((r,i)=>{const{asChild:a,...s}=r,o=a?dj:t;return I.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),I.createElement(o,tr({},s,{ref:i}))});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function P7(e){const t=I.useRef(e);return I.useEffect(()=>{t.current=e}),I.useMemo(()=>(...n)=>{var r;return(r=t.current)===null||r===void 0?void 0:r.call(t,...n)},[])}function _le({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,i]=kle({defaultProp:t,onChange:n}),a=e!==void 0,s=a?e:r,o=P7(n),c=I.useCallback(d=>{if(a){const h=typeof d=="function"?d(e):d;h!==e&&o(h)}else i(d)},[a,e,i,o]);return[s,c]}function kle({defaultProp:e,onChange:t}){const n=I.useState(e),[r]=n,i=I.useRef(r),a=P7(t);return I.useEffect(()=>{i.current!==r&&(a(r),i.current=r)},[r,i,a]),n}const Tle=I.createContext(void 0);function hj(e){const t=I.useContext(Tle);return e||t||"ltr"}const Cy="rovingFocusGroup.onEntryFocus",Mle={bubbles:!1,cancelable:!0},N7="RovingFocusGroup",[u8,fj,Ile]=fle(N7),[Ale,pj]=gle(N7,[Ile]),[Lle,Rle]=Ale(N7),Dle=I.forwardRef((e,t)=>I.createElement(u8.Provider,{scope:e.__scopeRovingFocusGroup},I.createElement(u8.Slot,{scope:e.__scopeRovingFocusGroup},I.createElement(jle,tr({},e,{ref:t}))))),jle=I.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:a,currentTabStopId:s,defaultCurrentTabStopId:o,onCurrentTabStopIdChange:c,onEntryFocus:d,...l}=e,h=I.useRef(null),f=mle(t,h),g=hj(a),[U=null,y]=_le({prop:s,defaultProp:o,onChange:c}),[v,x]=I.useState(!1),w=P7(d),C=fj(n),S=I.useRef(!1),[k,M]=I.useState(0);return I.useEffect(()=>{const T=h.current;if(T)return T.addEventListener(Cy,w),()=>T.removeEventListener(Cy,w)},[w]),I.createElement(Lle,{scope:n,orientation:r,dir:g,loop:i,currentTabStopId:U,onItemFocus:I.useCallback(T=>y(T),[y]),onItemShiftTab:I.useCallback(()=>x(!0),[]),onFocusableItemAdd:I.useCallback(()=>M(T=>T+1),[]),onFocusableItemRemove:I.useCallback(()=>M(T=>T-1),[])},I.createElement(uj.div,tr({tabIndex:v||k===0?-1:0,"data-orientation":r},l,{ref:f,style:{outline:"none",...e.style},onMouseDown:Qu(e.onMouseDown,()=>{S.current=!0}),onFocus:Qu(e.onFocus,T=>{const R=!S.current;if(T.target===T.currentTarget&&R&&!v){const j=new CustomEvent(Cy,Mle);if(T.currentTarget.dispatchEvent(j),!j.defaultPrevented){const P=C().filter(W=>W.focusable),N=P.find(W=>W.active),F=P.find(W=>W.id===U),q=[N,F,...P].filter(Boolean).map(W=>W.ref.current);mj(q)}}S.current=!1}),onBlur:Qu(e.onBlur,()=>x(!1))})))}),Ple="RovingFocusGroupItem",Nle=I.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:a,...s}=e,o=xle(),c=a||o,d=Rle(Ple,n),l=d.currentTabStopId===c,h=fj(n),{onFocusableItemAdd:f,onFocusableItemRemove:g}=d;return I.useEffect(()=>{if(r)return f(),()=>g()},[r,f,g]),I.createElement(u8.ItemSlot,{scope:n,id:c,focusable:r,active:i},I.createElement(uj.span,tr({tabIndex:l?0:-1,"data-orientation":d.orientation},s,{ref:t,onMouseDown:Qu(e.onMouseDown,U=>{r?d.onItemFocus(c):U.preventDefault()}),onFocus:Qu(e.onFocus,()=>d.onItemFocus(c)),onKeyDown:Qu(e.onKeyDown,U=>{if(U.key==="Tab"&&U.shiftKey){d.onItemShiftTab();return}if(U.target!==U.currentTarget)return;const y=$le(U,d.orientation,d.dir);if(y!==void 0){U.preventDefault();let x=h().filter(w=>w.focusable).map(w=>w.ref.current);if(y==="last")x.reverse();else if(y==="prev"||y==="next"){y==="prev"&&x.reverse();const w=x.indexOf(U.currentTarget);x=d.loop?Ble(x,w+1):x.slice(w+1)}setTimeout(()=>mj(x))}})})))}),Ole={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Fle(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function $le(e,t,n){const r=Fle(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return Ole[r]}function mj(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function Ble(e,t){return e.map((n,r)=>e[(t+r)%e.length])}const zle=Dle,Hle=Nle;function Wle(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function gj(...e){return t=>e.forEach(n=>Wle(n,t))}function Xle(...e){return I.useCallback(gj(...e),e)}const h8=globalThis!=null&&globalThis.document?I.useLayoutEffect:()=>{};function Vle(e,t){return I.useReducer((n,r)=>{const i=t[n][r];return i??n},e)}const Uj=e=>{const{present:t,children:n}=e,r=Yle(t),i=typeof n=="function"?n({present:r.isPresent}):I.Children.only(n),a=Xle(r.ref,i.ref);return typeof n=="function"||r.isPresent?I.cloneElement(i,{ref:a}):null};Uj.displayName="Presence";function Yle(e){const[t,n]=I.useState(),r=I.useRef({}),i=I.useRef(e),a=I.useRef("none"),s=e?"mounted":"unmounted",[o,c]=Vle(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return I.useEffect(()=>{const d=Wm(r.current);a.current=o==="mounted"?d:"none"},[o]),h8(()=>{const d=r.current,l=i.current;if(l!==e){const f=a.current,g=Wm(d);e?c("MOUNT"):g==="none"||(d==null?void 0:d.display)==="none"?c("UNMOUNT"):c(l&&f!==g?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,c]),h8(()=>{if(t){const d=h=>{const g=Wm(r.current).includes(h.animationName);h.target===t&&g&&Jn.flushSync(()=>c("ANIMATION_END"))},l=h=>{h.target===t&&(a.current=Wm(r.current))};return t.addEventListener("animationstart",l),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{t.removeEventListener("animationstart",l),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(o),ref:I.useCallback(d=>{d&&(r.current=getComputedStyle(d)),n(d)},[])}}function Wm(e){return(e==null?void 0:e.animationName)||"none"}const bj=I.forwardRef((e,t)=>{const{children:n,...r}=e,i=I.Children.toArray(n),a=i.find(qle);if(a){const s=a.props.children,o=i.map(c=>c===a?I.Children.count(s)>1?I.Children.only(null):I.isValidElement(s)?s.props.children:null:c);return I.createElement(f8,tr({},r,{ref:t}),I.isValidElement(s)?I.cloneElement(s,void 0,o):null)}return I.createElement(f8,tr({},r,{ref:t}),n)});bj.displayName="Slot";const f8=I.forwardRef((e,t)=>{const{children:n,...r}=e;return I.isValidElement(n)?I.cloneElement(n,{...Zle(r,n.props),ref:gj(t,n.ref)}):I.Children.count(n)>1?I.Children.only(null):null});f8.displayName="SlotClone";const Gle=({children:e})=>I.createElement(I.Fragment,null,e);function qle(e){return I.isValidElement(e)&&e.type===Gle}function Zle(e,t){const n={...t};for(const r in t){const i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...o)=>{a(...o),i(...o)}:i&&(n[r]=i):r==="style"?n[r]={...i,...a}:r==="className"&&(n[r]=[i,a].filter(Boolean).join(" "))}return{...e,...n}}const Kle=["a","button","div","h2","h3","img","label","li","nav","ol","p","span","svg","ul"],QU=Kle.reduce((e,t)=>{const n=I.forwardRef((r,i)=>{const{asChild:a,...s}=r,o=a?bj:t;return I.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),I.createElement(o,tr({},s,{ref:i}))});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function yj(e){const t=I.useRef(e);return I.useEffect(()=>{t.current=e}),I.useMemo(()=>(...n)=>{var r;return(r=t.current)===null||r===void 0?void 0:r.call(t,...n)},[])}function Qle({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,i]=Jle({defaultProp:t,onChange:n}),a=e!==void 0,s=a?e:r,o=yj(n),c=I.useCallback(d=>{if(a){const h=typeof d=="function"?d(e):d;h!==e&&o(h)}else i(d)},[a,e,i,o]);return[s,c]}function Jle({defaultProp:e,onChange:t}){const n=I.useState(e),[r]=n,i=I.useRef(r),a=yj(t);return I.useEffect(()=>{i.current!==r&&(a(r),i.current=r)},[r,i,a]),n}const ece=tv.useId||(()=>{});let tce=0;function nce(e){const[t,n]=I.useState(ece());return h8(()=>{n(r=>r??String(tce++))},[e]),e||(t?`radix-${t}`:"")}const vj="Tabs",[rce,m4e]=ale(vj,[pj]),xj=pj(),[ice,O7]=rce(vj),ace=I.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:i,defaultValue:a,orientation:s="horizontal",dir:o,activationMode:c="automatic",...d}=e,l=hj(o),[h,f]=Qle({prop:r,onChange:i,defaultProp:a});return I.createElement(ice,{scope:n,baseId:nce(),value:h,onValueChange:f,orientation:s,dir:l,activationMode:c},I.createElement(QU.div,tr({dir:l,"data-orientation":s},d,{ref:t})))}),sce="TabsList",oce=I.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...i}=e,a=O7(sce,n),s=xj(n);return I.createElement(zle,tr({asChild:!0},s,{orientation:a.orientation,dir:a.dir,loop:r}),I.createElement(QU.div,tr({role:"tablist","aria-orientation":a.orientation},i,{ref:t})))}),lce="TabsTrigger",cce=I.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:i=!1,...a}=e,s=O7(lce,n),o=xj(n),c=wj(s.baseId,r),d=Ej(s.baseId,r),l=r===s.value;return I.createElement(Hle,tr({asChild:!0},o,{focusable:!i,active:l}),I.createElement(QU.button,tr({type:"button",role:"tab","aria-selected":l,"aria-controls":d,"data-state":l?"active":"inactive","data-disabled":i?"":void 0,disabled:i,id:c},a,{ref:t,onMouseDown:Ey(e.onMouseDown,h=>{!i&&h.button===0&&h.ctrlKey===!1?s.onValueChange(r):h.preventDefault()}),onKeyDown:Ey(e.onKeyDown,h=>{[" ","Enter"].includes(h.key)&&s.onValueChange(r)}),onFocus:Ey(e.onFocus,()=>{const h=s.activationMode!=="manual";!l&&!i&&h&&s.onValueChange(r)})})))}),dce="TabsContent",uce=I.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:i,children:a,...s}=e,o=O7(dce,n),c=wj(o.baseId,r),d=Ej(o.baseId,r),l=r===o.value,h=I.useRef(l);return I.useEffect(()=>{const f=requestAnimationFrame(()=>h.current=!1);return()=>cancelAnimationFrame(f)},[]),I.createElement(Uj,{present:i||l},({present:f})=>I.createElement(QU.div,tr({"data-state":l?"active":"inactive","data-orientation":o.orientation,role:"tabpanel","aria-labelledby":c,hidden:!f,id:d,tabIndex:0},s,{ref:t,style:{...e.style,animationDuration:h.current?"0s":void 0}}),f&&a))});function wj(e,t){return`${e}-trigger-${t}`}function Ej(e,t){return`${e}-content-${t}`}const Cj=ace,Sj=oce,_j=cce,kj=uce;var Sy,b_;function hce(){if(b_)return Sy;b_=1;var e="Expected a function",t=NaN,n="[object Symbol]",r=/^\s+|\s+$/g,i=/^[-+]0x[0-9a-f]+$/i,a=/^0b[01]+$/i,s=/^0o[0-7]+$/i,o=parseInt,c=typeof Kl=="object"&&Kl&&Kl.Object===Object&&Kl,d=typeof self=="object"&&self&&self.Object===Object&&self,l=c||d||Function("return this")(),h=Object.prototype,f=h.toString,g=Math.max,U=Math.min,y=function(){return l.Date.now()};function v(k,M,T){var R,j,P,N,F,$,q=0,W=!1,V=!1,B=!0;if(typeof k!="function")throw new TypeError(e);M=S(M)||0,x(T)&&(W=!!T.leading,V="maxWait"in T,P=V?g(S(T.maxWait)||0,M):P,B="trailing"in T?!!T.trailing:B);function z(Ce){var ge=R,$e=j;return R=j=void 0,q=Ce,N=k.apply($e,ge),N}function Y(Ce){return q=Ce,F=setTimeout(ee,M),W?z(Ce):N}function K(Ce){var ge=Ce-$,$e=Ce-q,je=M-ge;return V?U(je,P-$e):je}function G(Ce){var ge=Ce-$,$e=Ce-q;return $===void 0||ge>=M||ge<0||V&&$e>=P}function ee(){var Ce=y();if(G(Ce))return de(Ce);F=setTimeout(ee,K(Ce))}function de(Ce){return F=void 0,B&&R?z(Ce):(R=j=void 0,N)}function xe(){F!==void 0&&clearTimeout(F),q=0,R=$=j=F=void 0}function ve(){return F===void 0?N:de(y())}function Me(){var Ce=y(),ge=G(Ce);if(R=arguments,j=this,$=Ce,ge){if(F===void 0)return Y($);if(V)return F=setTimeout(ee,M),z($)}return F===void 0&&(F=setTimeout(ee,M)),N}return Me.cancel=xe,Me.flush=ve,Me}function x(k){var M=typeof k;return!!k&&(M=="object"||M=="function")}function w(k){return!!k&&typeof k=="object"}function C(k){return typeof k=="symbol"||w(k)&&f.call(k)==n}function S(k){if(typeof k=="number")return k;if(C(k))return t;if(x(k)){var M=typeof k.valueOf=="function"?k.valueOf():k;k=x(M)?M+"":M}if(typeof k!="string")return k===0?k:+k;k=k.replace(r,"");var T=a.test(k);return T||s.test(k)?o(k.slice(2),T?2:8):i.test(k)?t:+k}return Sy=v,Sy}var fce=hce();const pce=ya(fce);function mce(e,t,n,r){Object.defineProperty(e,t,{get:n,set:r,enumerable:!0,configurable:!0})}var gce={};mce(gce,"LaserPointer",()=>D2);function An([e,t,n],[r,i,a]){return[e+r,t+i,n+a]}function Up([e,t,n],[r,i,a]){return[e-r,t-i,n-a]}function Bn([e,t,n],r){return[e*r,t*r,n*r]}function ku([e,t,n]){return[e/Math.sqrt(e**2+t**2),t/Math.sqrt(e**2+t**2),n]}function _r([e,t,n],r){return[Math.cos(r)*e-Math.sin(r)*t,Math.sin(r)*e+Math.cos(r)*t,n]}function Uce(e,t,n){return An(e,Bn(Up(t,e),n))}function y_(e,t,n){return Math.atan2(n[1]-e[1],n[0]-e[0])-Math.atan2(t[1]-e[1],t[0]-e[0])}function v_(e){return Math.atan2(Math.sin(e),Math.cos(e))}function x_([e,t]){return Math.sqrt(e**2+t**2)}function Ju([e,t],[n,r]){return Math.sqrt((n-e)**2+(r-t)**2)}function bce(e){if(e.length<2)return 0;let t=0;for(let n=1;n<=e.length-1;n++)t+=Ju(e[n-1],e[n]);return t+=Ju(e[e.length-2],e[e.length-1]),t}const yce=(e,t,n)=>Math.max(t,Math.min(n,e));function vce(e,t,n){const r=Ju(t,n);if(r===0)return Ju(e,t);const i=yce(((e[0]-t[0])*(n[0]-t[0])+(e[1]-t[1])*(n[1]-t[1]))/r**2,0,1),a=[t[0]+i*(n[0]-t[0]),t[1]+i*(n[1]-t[1]),e[2]];return Ju(a,e)}function R2(e,t){if(t===0||e.length<=2)return e;const n=e[0],r=e[e.length-1],[i,a]=e.reduce(([s,o],c,d)=>{const l=vce(c,n,r);return l>s?[l,d]:[s,o]},[0,-1]);if(i>=t){const s=e[a];return[...R2([n,...e.slice(1,a),s],t).slice(0,-1),s,...R2([s,...e.slice(a,-1),r],t).slice(1)]}else return[n,r]}const ql=class ql{constructor(t){this.originalPoints=[],this.stablePoints=[],this.tailPoints=[],this.isFresh=!0,this.options=Object.assign({},ql.defaults,t)}get lastPoint(){return this.tailPoints[this.tailPoints.length-1]??this.stablePoints[this.stablePoints.length-1]}addPoint(t){const n=this.originalPoints[this.originalPoints.length-1];if(!(n&&n[0]===t[0]&&n[1]===t[1])){if(this.originalPoints.push(t),this.isFresh){this.isFresh=!1,this.stablePoints.push(t);return}this.options.streamline>0&&(t=Uce(this.lastPoint,t,1-this.options.streamline)),this.tailPoints.push(t),bce(this.tailPoints)>ql.constants.maxTailLength&&this.stabilizeTail()}}close(){this.stabilizeTail()}stabilizeTail(){if(this.options.simplify>0&&this.options.simplifyPhase=="tail")throw new Error("Not implemented yet");this.stablePoints.push(...this.tailPoints),this.tailPoints=[]}getSize(t,n,r,i,a){return(t??this.options.size)*this.options.sizeMapping({pressure:n,runningLength:a,currentIndex:r,totalLength:i})}getStrokeOutline(t){if(this.isFresh)return[];let n=[...this.stablePoints,...this.tailPoints];this.options.simplify>0&&this.options.simplifyPhase==="input"&&(n=R2(n,this.options.simplify));const r=n.length;if(r===0)return[];if(r===1){const T=n[0],R=this.getSize(t,T[2],0,r,0);if(R<.5)return[];const j=[];for(let P=0;P<=Math.PI*2;P+=Math.PI/16)j.push(An(T,Bn(_r([1,0,0],P),R)));return j.push(An(T,Bn([1,0,0],this.getSize(t,T[2],0,r,0)))),j}if(r===2){const T=n[0],R=n[1],j=this.getSize(t,T[2],0,r,0),P=this.getSize(t,R[2],0,r,0);if(j<.5||P<.5)return[];const N=[],F=y_(T,[T[0],T[1]-100,T[2]],R);for(let $=F;$<=Math.PI+F;$+=Math.PI/16)N.push(An(T,Bn(_r([1,0,0],$),j)));for(let $=Math.PI+F;$<=Math.PI*2+F;$+=Math.PI/16)N.push(An(R,Bn(_r([1,0,0],$),P)));return N.push(N[0]),N}const i=[],a=[];let s=0,o=0,c=0,d=0;for(let T=1;T<r-1;T++){const R=n[T-1],j=n[T],P=n[T+1];let N=j[2];const F=Ju(R,j);d+=F,s=o+(F-o)*.2;const $=this.getSize(t,N,T,r,d);if($===0){c=T+1;continue}const q=ku(Up(R,j)),W=ku(Up(P,j)),V=_r(q,Math.PI/2),B=_r(q,-Math.PI/2),z=_r(W,Math.PI/2),Y=_r(W,-Math.PI/2),K=An(j,Bn(V,$)),G=An(j,Bn(B,$)),ee=An(j,Bn(z,$)),de=An(j,Bn(Y,$)),xe=An(V,Y),ve=An(B,z),Me=An(j,Bn(x_(xe)===0?q:ku(xe),$)),Ce=An(j,Bn(x_(ve)===0?W:ku(ve),$)),ge=v_(y_(j,R,P)),$e=ql.constants.cornerDetectionMaxAngle/180*Math.PI*ql.constants.cornerDetectionVariance(s);if(Math.abs(ge)<$e){const je=Math.abs(v_(Math.PI-ge));if(je===0)continue;if(ge<0){a.push(G,Ce);for(let Je=0;Je<=je;Je+=je/4)i.push(An(j,_r(Bn(V,$),Je)));for(let Je=je;Je>=0;Je-=je/4)a.push(An(j,_r(Bn(V,$),Je)));a.push(Ce,ee)}else{i.push(K,Me);for(let Je=0;Je<=je;Je+=je/4)a.push(An(j,_r(Bn(V,-$),-Je)));for(let Je=je;Je>=0;Je-=je/4)i.push(An(j,_r(Bn(V,-$),-Je)));i.push(Me,de)}}else i.push(Me),a.push(Ce);o=s}if(c>=r-2)if(this.options.keepHead){const T=n[r-1],R=[];for(let j=0;j<=Math.PI*2;j+=Math.PI/16)R.push(An(T,Bn(_r([1,0,0],j),this.options.size)));return R.push(An(T,Bn([1,0,0],this.options.size))),R}else return[];const l=n[c],h=n[c+1],f=n[r-2],g=n[r-1],U=ku(Up(h,l)),y=ku(Up(f,g)),v=_r(U,-Math.PI/2),x=_r(y,Math.PI/2),w=this.getSize(t,l[2],0,r,0),C=[],S=this.options.keepHead?this.options.size:this.getSize(t,f[2],r-2,r,d),k=[];if(w>1){for(let T=0;T<=Math.PI;T+=Math.PI/16)C.unshift(An(l,_r(Bn(v,w),-T)));C.unshift(An(l,Bn(v,-w)))}else C.push(l);for(let T=0;T<=Math.PI*3;T+=Math.PI/16)k.push(An(g,_r(Bn(x,-S),-T)));const M=[...C,...i,...k.reverse(),...a.reverse()];return C.length>0&&M.push(C[0]),this.options.simplify>0&&this.options.simplifyPhase==="output"?R2(M,this.options.simplify):M}};ql.defaults={size:2,streamline:.45,simplify:.1,simplifyPhase:"output",keepHead:!1,sizeMapping:()=>1},ql.constants={cornerDetectionMaxAngle:75,cornerDetectionVariance:t=>t>35?.5:1,maxTailLength:50};let D2=ql;var Tj=lD(),{useAtom:kn,useSetAtom:JU,useAtomValue:Mj,useStore:g4e}=Tj,xce=Tj.Provider,Za=x7(),wce=Uz({"./locales/ar-SA.json":()=>ye(()=>import("./ar-SA-G6X2FPQ2-C0cHHnYG.js"),[],import.meta.url),"./locales/az-AZ.json":()=>ye(()=>import("./az-AZ-76LH7QW2-Cjxzg4vI.js"),[],import.meta.url),"./locales/bg-BG.json":()=>ye(()=>import("./bg-BG-XCXSNQG7-CE2Qd7cU.js"),[],import.meta.url),"./locales/bn-BD.json":()=>ye(()=>import("./bn-BD-2XOGV67Q-C3hztSh7.js"),[],import.meta.url),"./locales/ca-ES.json":()=>ye(()=>import("./ca-ES-6MX7JW3Y-DK0cMPVf.js"),[],import.meta.url),"./locales/cs-CZ.json":()=>ye(()=>import("./cs-CZ-2BRQDIVT-DtnD7eNT.js"),[],import.meta.url),"./locales/da-DK.json":()=>ye(()=>import("./da-DK-5WZEPLOC-CQxH9pPs.js"),[],import.meta.url),"./locales/de-DE.json":()=>ye(()=>import("./de-DE-XR44H4JA--uxdtPKd.js"),[],import.meta.url),"./locales/el-GR.json":()=>ye(()=>import("./el-GR-BZB4AONW-C0n5lsCo.js"),[],import.meta.url),"./locales/en.json":()=>ye(()=>Promise.resolve().then(()=>s4e),void 0,import.meta.url),"./locales/es-ES.json":()=>ye(()=>import("./es-ES-U4NZUMDT-DR884pTc.js"),[],import.meta.url),"./locales/eu-ES.json":()=>ye(()=>import("./eu-ES-A7QVB2H4-CwGzoAb_.js"),[],import.meta.url),"./locales/fa-IR.json":()=>ye(()=>import("./fa-IR-HGAKTJCU-STUZS8sk.js"),[],import.meta.url),"./locales/fi-FI.json":()=>ye(()=>import("./fi-FI-Z5N7JZ37-woRdrfKl.js"),[],import.meta.url),"./locales/fr-FR.json":()=>ye(()=>import("./fr-FR-RHASNOE6-DEb_Iax4.js"),[],import.meta.url),"./locales/gl-ES.json":()=>ye(()=>import("./gl-ES-HMX3MZ6V-DyLoL109.js"),[],import.meta.url),"./locales/he-IL.json":()=>ye(()=>import("./he-IL-6SHJWFNN-B64T5I63.js"),[],import.meta.url),"./locales/hi-IN.json":()=>ye(()=>import("./hi-IN-IWLTKZ5I-tu5bb-U9.js"),[],import.meta.url),"./locales/hu-HU.json":()=>ye(()=>import("./hu-HU-A5ZG7DT2-CbgcLTiz.js"),[],import.meta.url),"./locales/id-ID.json":()=>ye(()=>import("./id-ID-SAP4L64H-e2p7Zb_E.js"),[],import.meta.url),"./locales/it-IT.json":()=>ye(()=>import("./it-IT-JPQ66NNP-BZbWAY73.js"),[],import.meta.url),"./locales/ja-JP.json":()=>ye(()=>import("./ja-JP-DBVTYXUO-BTRvkLHp.js"),[],import.meta.url),"./locales/kaa.json":()=>ye(()=>import("./kaa-6HZHGXH3-DVgbCgaP.js"),[],import.meta.url),"./locales/kab-KAB.json":()=>ye(()=>import("./kab-KAB-ZGHBKWFO-BjAPMX8e.js"),[],import.meta.url),"./locales/kk-KZ.json":()=>ye(()=>import("./kk-KZ-P5N5QNE5-CzxQzok2.js"),[],import.meta.url),"./locales/km-KH.json":()=>ye(()=>import("./km-KH-HSX4SM5Z-Cp6ccIfb.js"),[],import.meta.url),"./locales/ko-KR.json":()=>ye(()=>import("./ko-KR-MTYHY66A-F3PDpwD9.js"),[],import.meta.url),"./locales/ku-TR.json":()=>ye(()=>import("./ku-TR-6OUDTVRD-DqXhgZl-.js"),[],import.meta.url),"./locales/lt-LT.json":()=>ye(()=>import("./lt-LT-XHIRWOB4-1eCe67Bl.js"),[],import.meta.url),"./locales/lv-LV.json":()=>ye(()=>import("./lv-LV-5QDEKY6T-CAsgjtjW.js"),[],import.meta.url),"./locales/mr-IN.json":()=>ye(()=>import("./mr-IN-CRQNXWMA-DM2GvLsC.js"),[],import.meta.url),"./locales/my-MM.json":()=>ye(()=>import("./my-MM-5M5IBNSE-Dz0p0cZk.js"),[],import.meta.url),"./locales/nb-NO.json":()=>ye(()=>import("./nb-NO-T6EIAALU-DJTgfL8G.js"),[],import.meta.url),"./locales/nl-NL.json":()=>ye(()=>import("./nl-NL-IS3SIHDZ-QXFgpjik.js"),[],import.meta.url),"./locales/nn-NO.json":()=>ye(()=>import("./nn-NO-6E72VCQL-CupEMZo5.js"),[],import.meta.url),"./locales/oc-FR.json":()=>ye(()=>import("./oc-FR-POXYY2M6-DM3mK7_w.js"),[],import.meta.url),"./locales/pa-IN.json":()=>ye(()=>import("./pa-IN-N4M65BXN-39D7GgUd.js"),[],import.meta.url),"./locales/percentages.json":()=>ye(()=>Promise.resolve().then(()=>o4e),void 0,import.meta.url),"./locales/pl-PL.json":()=>ye(()=>import("./pl-PL-T2D74RX3-BBmu2SjR.js"),[],import.meta.url),"./locales/pt-BR.json":()=>ye(()=>import("./pt-BR-5N22H2LF-BHGnlXVQ.js"),[],import.meta.url),"./locales/pt-PT.json":()=>ye(()=>import("./pt-PT-UZXXM6DQ-Bs9CAKkb.js"),[],import.meta.url),"./locales/ro-RO.json":()=>ye(()=>import("./ro-RO-JPDTUUEW-5j9Qcvxw.js"),[],import.meta.url),"./locales/ru-RU.json":()=>ye(()=>import("./ru-RU-B4JR7IUQ-DicRcrKQ.js"),[],import.meta.url),"./locales/si-LK.json":()=>ye(()=>import("./si-LK-N5RQ5JYF-Cvyi5caX.js"),[],import.meta.url),"./locales/sk-SK.json":()=>ye(()=>import("./sk-SK-C5VTKIMK-CVF6jp0N.js"),[],import.meta.url),"./locales/sl-SI.json":()=>ye(()=>import("./sl-SI-NN7IZMDC-BUEZxlx3.js"),[],import.meta.url),"./locales/sv-SE.json":()=>ye(()=>import("./sv-SE-XGPEYMSR-D9N-82r3.js"),[],import.meta.url),"./locales/ta-IN.json":()=>ye(()=>import("./ta-IN-2NMHFXQM-uCND4pry.js"),[],import.meta.url),"./locales/th-TH.json":()=>ye(()=>import("./th-TH-HPSO5L25-ZovlT-xD.js"),[],import.meta.url),"./locales/tr-TR.json":()=>ye(()=>import("./tr-TR-DEFEU3FU-DoPB0JUv.js"),[],import.meta.url),"./locales/uk-UA.json":()=>ye(()=>import("./uk-UA-QMV73CPH-CFwy-mfZ.js"),[],import.meta.url),"./locales/vi-VN.json":()=>ye(()=>import("./vi-VN-M7AON7JQ-CqHLJYoP.js"),[],import.meta.url),"./locales/zh-CN.json":()=>ye(()=>import("./zh-CN-LNUGB5OW-CTW1RjkW.js"),[],import.meta.url),"./locales/zh-HK.json":()=>ye(()=>import("./zh-HK-E62DVLB3-CRHRMlEl.js"),[],import.meta.url),"./locales/zh-TW.json":()=>ye(()=>import("./zh-TW-RAJ6MFWO-D7-lWxxC.js"),[],import.meta.url)}),Ece=85,Wd={code:"en",label:"English"},e6=[Wd,...[{code:"ar-SA",label:"العربية",rtl:!0},{code:"bg-BG",label:"Български"},{code:"ca-ES",label:"Català"},{code:"cs-CZ",label:"Česky"},{code:"de-DE",label:"Deutsch"},{code:"el-GR",label:"Ελληνικά"},{code:"es-ES",label:"Español"},{code:"eu-ES",label:"Euskara"},{code:"fa-IR",label:"فارسی",rtl:!0},{code:"fi-FI",label:"Suomi"},{code:"fr-FR",label:"Français"},{code:"gl-ES",label:"Galego"},{code:"he-IL",label:"עברית",rtl:!0},{code:"hi-IN",label:"हिन्दी"},{code:"hu-HU",label:"Magyar"},{code:"id-ID",label:"Bahasa Indonesia"},{code:"it-IT",label:"Italiano"},{code:"ja-JP",label:"日本語"},{code:"kab-KAB",label:"Taqbaylit"},{code:"kk-KZ",label:"Қазақ тілі"},{code:"ko-KR",label:"한국어"},{code:"ku-TR",label:"Kurdî"},{code:"lt-LT",label:"Lietuvių"},{code:"lv-LV",label:"Latviešu"},{code:"my-MM",label:"Burmese"},{code:"nb-NO",label:"Norsk bokmål"},{code:"nl-NL",label:"Nederlands"},{code:"nn-NO",label:"Norsk nynorsk"},{code:"oc-FR",label:"Occitan"},{code:"pa-IN",label:"ਪੰਜਾਬੀ"},{code:"pl-PL",label:"Polski"},{code:"pt-BR",label:"Português Brasileiro"},{code:"pt-PT",label:"Português"},{code:"ro-RO",label:"Română"},{code:"ru-RU",label:"Русский"},{code:"sk-SK",label:"Slovenčina"},{code:"sv-SE",label:"Svenska"},{code:"sl-SI",label:"Slovenščina"},{code:"tr-TR",label:"Türkçe"},{code:"uk-UA",label:"Українська"},{code:"zh-CN",label:"简体中文"},{code:"zh-TW",label:"繁體中文"},{code:"vi-VN",label:"Tiếng Việt"},{code:"mr-IN",label:"मराठी"}].filter(e=>tD[e.code]>=Ece).sort((e,t)=>e.label>t.label?1:-1)],j2="__test__";mt.DEV&&e6.unshift({code:j2,label:"test language"},{code:`${j2}.rtl`,label:"‪test language (rtl)‬",rtl:!0});var Hu=Wd,Ag={},Ij=async e=>{if(Hu=e,document.documentElement.dir=Hu.rtl?"rtl":"ltr",document.documentElement.lang=Hu.code,e.code.startsWith(j2))Ag={};else try{Ag=await wce(`./locales/${Hu.code}.json`)}catch(t){console.error(`Failed to load language ${e.code}:`,t.message),Ag=v7}Za.set(Aj,e.code)},E1=()=>Hu,w_=(e,t)=>{for(let n=0;n<t.length;++n){let r=t[n];if(e[r]===void 0)return;e=e[r]}if(typeof e=="string")return e},D=(e,t,n)=>{if(Hu.code.startsWith(j2))return`‪[[${t?`${e}(${JSON.stringify(t).slice(1,-1)})`:e}]]‬`;let r=e.split("."),i=w_(Ag,r)||w_(v7,r)||n;if(i===void 0){let a=`Can't find translation for ${e}`;return console.warn(a),""}if(t)for(let a in t)i=i.replace(`{{${a}}}`,String(t[a]));return i},Aj=hr(Wd.code),vr=()=>{let e=Mj(Aj);return{t:D,langCode:e}},Cce=({size:e="1em",circleWidth:t=8,synchronized:n=!1,className:r=""})=>{let i=-(ke.useRef(Date.now()).current%1600);return m.jsx("div",{className:`Spinner ${r}`,children:m.jsx("svg",{viewBox:"0 0 100 100",style:{width:e,height:e,"--spinner-delay":n?`${i}ms`:0},children:m.jsx("circle",{cx:"50",cy:"50",r:50-t/2,strokeWidth:t,fill:"none",strokeMiterlimit:"10"})})})},il=Cce,Lj=({delay:e,theme:t})=>{let[n,r]=I.useState(!!e);return I.useEffect(()=>{if(!e)return;let i=setTimeout(()=>{r(!1)},e);return()=>clearTimeout(i)},[e]),n?null:m.jsxs("div",{className:Fe("LoadingMessage",{"LoadingMessage--dark":t===wt.DARK}),children:[m.jsx("div",{children:m.jsx(il,{})}),m.jsx("div",{className:"LoadingMessage-text",children:D("labels.loadingScene")})]})},Sce=e=>{let[t,n]=I.useState(!0);return I.useEffect(()=>{let r=async()=>{await Ij(i),n(!1)},i=e6.find(a=>a.code===e.langCode)||Wd;r()},[e.langCode]),t?m.jsx(Lj,{theme:e.theme}):e.children},Ct=ke.forwardRef(({size:e="medium",visible:t=!0,className:n="",...r},i)=>{let{id:a}=ao(),s=ke.useRef(null);ke.useImperativeHandle(i,()=>s.current);let o=`ToolIcon_size_${e}`,[c,d]=I.useState(!1),l=I.useRef(!0),h=async g=>{var y;let U="onClick"in r&&((y=r.onClick)==null?void 0:y.call(r,g));if(W1(U))try{d(!0),await U}catch(v){if(v instanceof kU)console.warn(v);else throw v}finally{l.current&&d(!1)}};I.useEffect(()=>(l.current=!0,()=>{l.current=!1}),[]);let f=I.useRef(null);if(r.type==="button"||r.type==="icon"||r.type==="submit"){let g=r.type==="icon"?"button":r.type;return m.jsxs("button",{className:Fe("ToolIcon_type_button",o,n,t&&!r.hidden?"ToolIcon_type_button--show":"ToolIcon_type_button--hide",{ToolIcon:!r.hidden,"ToolIcon--selected":r.selected,"ToolIcon--plain":r.type==="icon"}),style:r.style,"data-testid":r["data-testid"],hidden:r.hidden,title:r.title,"aria-label":r["aria-label"],type:g,onClick:h,ref:s,disabled:c||r.isLoading||!!r.disabled,children:[(r.icon||r.label)&&m.jsxs("div",{className:"ToolIcon__icon","aria-hidden":"true","aria-disabled":!!r.disabled,children:[r.icon||r.label,r.keyBindingLabel&&m.jsx("span",{className:"ToolIcon__keybinding",children:r.keyBindingLabel}),r.isLoading&&m.jsx(il,{})]}),r.showAriaLabel&&m.jsxs("div",{className:"ToolIcon__label",children:[r["aria-label"]," ",c&&m.jsx(il,{})]}),r.children]})}return m.jsxs("label",{className:Fe("ToolIcon",n),title:r.title,onPointerDown:g=>{var U;f.current=g.pointerType||null,(U=r.onPointerDown)==null||U.call(r,{pointerType:g.pointerType||null})},onPointerUp:()=>{requestAnimationFrame(()=>{f.current=null})},children:[m.jsx("input",{className:`ToolIcon_type_radio ${o}`,type:"radio",name:r.name,"aria-label":r["aria-label"],"aria-keyshortcuts":r["aria-keyshortcuts"],"data-testid":r["data-testid"],id:`${a}-${r.id}`,onChange:()=>{var g;(g=r.onChange)==null||g.call(r,{pointerType:f.current})},checked:r.checked,ref:s}),m.jsxs("div",{className:"ToolIcon__icon",children:[r.icon,r.keyBindingLabel&&m.jsx("span",{className:"ToolIcon__keybinding",children:r.keyBindingLabel})]})]})});Ct.displayName="ToolButton";var _ce=(e,t,n)=>{let r=new Set(gt(e.filter(l=>tt(l)),t).map(l=>l.id)),i={},a=n.scene.getNonDeletedElementsMap(),s=new Set;for(let l of r){let h=Ks(e,l);for(let f of h)if(!s.has(f.id)){if(an(f)){let g=ur(f,a);g&&(i[g.id]=!0)}else i[f.id]=!0;s.add(f.id)}}let o=!0,c=e.map(l=>{if(t.selectedElementIds[l.id]){let h=an(l)?ur(l,a):null;return l.frameId&&r.has(l.frameId)?(o=!1,i[l.id]=!0,l):h!=null&&h.frameId&&r.has(h==null?void 0:h.frameId)?l:(l.boundElements&&l.boundElements.forEach(f=>{var U,y;let g=n.scene.getNonDeletedElementsMap().get(f.id);g&&Pe(g)&&(me(g,{startBinding:l.id===((U=g.startBinding)==null?void 0:U.elementId)?null:g.startBinding,endBinding:l.id===((y=g.endBinding)==null?void 0:y.elementId)?null:g.endBinding}),me(g,{points:g.points}))}),ct(l,{isDeleted:!0}))}return l.frameId&&r.has(l.frameId)?(o=!1,an(l)||(i[l.id]=!0),ct(l,{frameId:null})):an(l)&&t.selectedElementIds[l.containerId]?ct(l,{isDeleted:!0}):l}),d=t.editingGroupId;if(o&&t.editingGroupId){let l=rn(c,t.editingGroupId).filter(h=>!h.isDeleted);if(l.length>1)l[0]&&(i[l[0].id]=!0);else{d=null,l[0]&&(i[l[0].id]=!0);let h=l[0];if(h){let f=h.groupIds.findIndex(U=>U===t.editingGroupId),g=h.groupIds[f+1];if(g){let U=rn(c,g).filter(y=>!y.isDeleted);U.length>1&&(d=g,U.forEach(y=>{i[y.id]=!0}))}}}}return{elements:c,appState:{...t,...Wr({selectedElementIds:i,editingGroupId:d},c,t,null)}}},E_=(e,t)=>{if(e.editingGroupId){let n=rn(Vt(t),e.editingGroupId);if(n.length)return{...e,selectedElementIds:{[n[0].id]:!0}}}return e},Rj=Te({name:"deleteSelectedElements",label:"labels.delete",icon:_d,trackEvent:{category:"element",action:"delete"},perform:(e,t,n,r)=>{if(t.editingLinearElement){let{elementId:s,selectedPointsIndices:o,startBindingElement:c,endBindingElement:d}=t.editingLinearElement,l=r.scene.getNonDeletedElementsMap(),h=Re.getElement(s,l);if(!h||o==null)return!1;if(h.points.length<2){let g=e.map(y=>y.id===h.id?ct(y,{isDeleted:!0}):y),U=E_(t,g);return{elements:g,appState:{...U,editingLinearElement:null},captureUpdate:le.IMMEDIATELY}}let f={startBindingElement:o!=null&&o.includes(0)?null:c,endBindingElement:o!=null&&o.includes(h.points.length-1)?null:d};return Re.deletePoints(h,o),{elements:e,appState:{...t,editingLinearElement:{...t.editingLinearElement,...f,selectedPointsIndices:(o==null?void 0:o[0])>0?[o[0]-1]:[0]}},captureUpdate:le.IMMEDIATELY}}let{elements:i,appState:a}=_ce(e,t,r);return XA(i,i.filter(s=>s.isDeleted)),a=E_(a,i),{elements:i,appState:{...a,activeTool:Pn(t,{type:"selection"}),multiElement:null,activeEmbeddable:null},captureUpdate:Vn(Vt(e),t)?le.IMMEDIATELY:le.EVENTUALLY}},keyTest:(e,t,n)=>(e.key===Z.BACKSPACE||e.key===Z.DELETE)&&!e[Z.CTRL_OR_CMD],PanelComponent:({elements:e,appState:t,updateData:n})=>m.jsx(Ct,{type:"button",icon:_d,title:D("labels.delete"),"aria-label":D("labels.delete"),onClick:()=>n(null),visible:Vn(Vt(e),t)})}),p8=(e,t)=>e.frameId===t||e.id===t,Dj=(e,t,n)=>{let r=[],i=[],a=null,s=-1,o=nt(n||gt(e,t,{includeBoundTextElement:!0,includeElementsInFrames:!0}));for(;++s<e.length;){let c=e[s];o.get(c.id)?(i.length&&(r=r.concat(i),i=[]),r.push(s),a=s+1):c.isDeleted&&a===s?(a=s+1,i.push(s)):i=[]}return r},kce=e=>{let t=0;return e.reduce((n,r,i)=>(i>0&&e[i-1]!==r-1&&(t=++t),(n[t]||(n[t]=[])).push(r),n),[])},C_=(e,t,n)=>{var r,i;if("containerId"in e&&e.containerId){let a=el.getScene(e).getElement(e.containerId);if(a)return n==="left"?Math.min(t.indexOf(a),t.indexOf(e)):Math.max(t.indexOf(a),t.indexOf(e))}else{let a=(i=(r=e.boundElements)==null?void 0:r.find(s=>s.type!=="arrow"))==null?void 0:i.id;if(a){let s=el.getScene(e).getElement(a);if(s)return n==="left"?Math.min(t.indexOf(s),t.indexOf(e)):Math.max(t.indexOf(s),t.indexOf(e))}}},Tce=(e,t)=>{let n=-1,r=-1;return e.forEach((i,a)=>{p8(i,t)&&(n===-1&&(n=a),r=a)}),n===-1?[]:e.slice(n,r+1)},Mce=(e,t,n,r,i)=>{let a=t[n],s=h=>h.isDeleted?!1:i?h.frameId===i:e.editingGroupId?h.groupIds.includes(e.editingGroupId):!0,o=r==="left"?Kc(t,h=>s(h),Math.max(0,n-1)):AI(t,h=>s(h),n+1),c=t[o];if(!c)return-1;if(e.editingGroupId){if((a==null?void 0:a.groupIds.join(""))===(c==null?void 0:c.groupIds.join("")))return C_(c,t,r)??o;if(!(c!=null&&c.groupIds.includes(e.editingGroupId)))return-1}if(!i&&(c.frameId||tt(c))){let h=Tce(t,c.frameId||c.id);return r==="left"?t.indexOf(h[0]):t.indexOf(h[h.length-1])}if(!c.groupIds.length)return C_(c,t,r)??o;let d=e.editingGroupId?c.groupIds[c.groupIds.indexOf(e.editingGroupId)-1]:c.groupIds[c.groupIds.length-1],l=rn(t,d);return l.length?r==="left"?t.indexOf(l[0]):t.indexOf(l[l.length-1]):o},jj=(e,t)=>t.reduce((n,r)=>{let i=e[r];return n.set(i.id,i),n},new Map),Pj=(e,t,n)=>{let r=Dj(e,t),i=jj(e,r),a=kce(r);n==="right"&&(a=a.reverse());let s=new Set(r.filter(o=>tt(e[o])).map(o=>e[o].id));return a.forEach((o,c)=>{var w;let d=o[0],l=o[o.length-1],h=n==="left"?d:l,f=o.some(C=>{let S=e[C];return S.frameId&&s.has(S.frameId)})?null:(w=e[h])==null?void 0:w.frameId,g=Mce(t,e,h,n,f);if(g===-1||h===g)return;let U=n==="left"?e.slice(0,g):e.slice(0,d),y=e.slice(d,l+1),v=n==="left"?e.slice(g,d):e.slice(l+1,g+1),x=n==="left"?e.slice(l+1):e.slice(g+1);e=n==="left"?[...U,...y,...v,...x]:[...U,...v,...y,...x]}),Zs(e,i),e},Nj=(e,t,n,r,i)=>{let a=Dj(e,t,i),s=jj(e,a),o=[],c,d;if(n==="left"){if(r)c=AI(e,U=>p8(U,r));else if(t.editingGroupId){let U=rn(e,t.editingGroupId);if(!U.length)return e;c=e.indexOf(U[0])}else c=0;d=a[a.length-1]}else{if(r)d=Kc(e,U=>p8(U,r));else if(t.editingGroupId){let U=rn(e,t.editingGroupId);if(!U.length)return e;d=e.indexOf(U[U.length-1])}else d=e.length-1;c=a[0]}c===-1&&(c=0);for(let U=c;U<d+1;U++)a.includes(U)||o.push(e[U]);let l=Array.from(s.values()),h=e.slice(0,c),f=e.slice(d+1),g=n==="left"?[...h,...l,...o,...f]:[...h,...o,...l,...f];return Zs(g,s),g};function Oj(e,t,n,r){let i=nt(gt(e,t,{includeBoundTextElement:!0,includeElementsInFrames:!0})),a={regularElements:[],frameChildren:new Map},s=new Set;for(let d of e)i.has(d.id)&&tt(d)&&s.add(d.id);for(let d of e)if(i.has(d.id))if(tt(d)||d.frameId&&s.has(d.frameId))a.regularElements.push(d);else if(!d.frameId)a.regularElements.push(d);else{let l=a.frameChildren.get(d.frameId)||[];l.push(d),a.frameChildren.set(d.frameId,l)}let o=e,c=Array.from(a.frameChildren.entries());for(let[d,l]of c)o=r(e,t,n,d,l);return r(o,t,n,null,a.regularElements)}var Ice=(e,t)=>Pj(e,t,"left"),Ace=(e,t)=>Pj(e,t,"right"),Lce=(e,t)=>Oj(e,t,"left",Nj),Rce=(e,t)=>Oj(e,t,"right",Nj),Dce=Te({name:"sendBackward",label:"labels.sendBackward",keywords:["move down","zindex","layer"],icon:cC,trackEvent:{category:"element"},perform:(e,t)=>({elements:Ice(e,t),appState:t,captureUpdate:le.IMMEDIATELY}),keyPriority:40,keyTest:e=>e[Z.CTRL_OR_CMD]&&!e.shiftKey&&e.code===kt.BRACKET_LEFT,PanelComponent:({updateData:e,appState:t})=>m.jsx("button",{type:"button",className:"zIndexButton",onClick:()=>e(null),title:`${D("labels.sendBackward")} — ${pe("CtrlOrCmd+[")}`,children:cC})}),jce=Te({name:"bringForward",label:"labels.bringForward",keywords:["move up","zindex","layer"],icon:lC,trackEvent:{category:"element"},perform:(e,t)=>({elements:Ace(e,t),appState:t,captureUpdate:le.IMMEDIATELY}),keyPriority:40,keyTest:e=>e[Z.CTRL_OR_CMD]&&!e.shiftKey&&e.code===kt.BRACKET_RIGHT,PanelComponent:({updateData:e,appState:t})=>m.jsx("button",{type:"button",className:"zIndexButton",onClick:()=>e(null),title:`${D("labels.bringForward")} — ${pe("CtrlOrCmd+]")}`,children:lC})}),Pce=Te({name:"sendToBack",label:"labels.sendToBack",keywords:["move down","zindex","layer"],icon:uC,trackEvent:{category:"element"},perform:(e,t)=>({elements:Lce(e,t),appState:t,captureUpdate:le.IMMEDIATELY}),keyTest:e=>Xs?e[Z.CTRL_OR_CMD]&&e.altKey&&e.code===kt.BRACKET_LEFT:e[Z.CTRL_OR_CMD]&&e.shiftKey&&e.code===kt.BRACKET_LEFT,PanelComponent:({updateData:e,appState:t})=>m.jsx("button",{type:"button",className:"zIndexButton",onClick:()=>e(null),title:`${D("labels.sendToBack")} — ${pe(Xs?"CtrlOrCmd+Alt+[":"CtrlOrCmd+Shift+[")}`,children:uC})}),Nce=Te({name:"bringToFront",label:"labels.bringToFront",keywords:["move up","zindex","layer"],icon:dC,trackEvent:{category:"element"},perform:(e,t)=>({elements:Rce(e,t),appState:t,captureUpdate:le.IMMEDIATELY}),keyTest:e=>Xs?e[Z.CTRL_OR_CMD]&&e.altKey&&e.code===kt.BRACKET_RIGHT:e[Z.CTRL_OR_CMD]&&e.shiftKey&&e.code===kt.BRACKET_RIGHT,PanelComponent:({updateData:e,appState:t})=>m.jsx("button",{type:"button",className:"zIndexButton",onClick:n=>e(null),title:`${D("labels.bringToFront")} — ${pe(Xs?"CtrlOrCmd+Alt+]":"CtrlOrCmd+Shift+]")}`,children:dC})}),Oce=Te({name:"selectAll",label:"labels.selectAll",icon:Pq,trackEvent:{category:"canvas"},viewMode:!1,perform:(e,t,n,r)=>{if(t.editingLinearElement)return!1;let i=e.filter(a=>!a.isDeleted&&!(Le(a)&&a.containerId)&&!a.locked).reduce((a,s)=>(a[s.id]=!0,a),{});return{appState:{...t,...Wr({editingGroupId:null,selectedElementIds:i},Vt(e),t,r),selectedLinearElement:Object.keys(i).length===1&&st(e[0])?new Re(e[0]):null},captureUpdate:le.IMMEDIATELY}},keyTest:e=>e[Z.CTRL_OR_CMD]&&e.key===Z.A}),Fce=e=>{let t=e.slice(),n=new Set,r=a=>{var d,l,h;let s=(l=(d=a[0])==null?void 0:d.groupIds)==null?void 0:l.join(""),o=[a[0]],c=[];for(let f of a.slice(1))((h=f.groupIds)==null?void 0:h.join(""))===s?o.push(f):c.push(f);return c.length?[...o,...r(c)]:o},i=new Map;return t.forEach((a,s)=>{var o;if(!i.has(a.id))if((o=a.groupIds)!=null&&o.length){let c=a.groupIds[a.groupIds.length-1],d=t.slice(s).filter(l=>{var f;let h=(f=l==null?void 0:l.groupIds)==null?void 0:f.some(g=>g===c);return h&&i.set(l.id,!0),h});for(let l of r(d))n.add(l)}else n.add(a)}),n.size!==e.length?(console.error("normalizeGroupElementOrder: lost some elements... bailing!"),e):[...n]},$ce=e=>{let t=FY(e),n=e.slice(),r=new Set;return n.forEach((i,a)=>{var s,o,c;i&&((s=i.boundElements)!=null&&s.length?(r.add(i),n[a]=null,i.boundElements.forEach(d=>{let l=t.get(d.id);l&&d.type==="text"&&(r.add(l[0]),n[l[1]]=null)})):i.type==="text"&&i.containerId&&((c=(o=t.get(i.containerId))==null?void 0:o[0].boundElements)!=null&&c.find(d=>d.id===i.id))||(r.add(i),n[a]=null))}),r.size!==e.length?(console.error("normalizeBoundElementsOrder: lost some elements... bailing!"),e):[...r]},Bce=e=>$ce(Fce(e)),zce=Te({name:"duplicateSelection",label:"labels.duplicateSelection",icon:_3,trackEvent:{category:"element"},perform:(e,t,n,r)=>{if(t.editingLinearElement)try{let a=Re.duplicateSelectedPoints(t,r.scene.getNonDeletedElementsMap());return{elements:e,appState:a,captureUpdate:le.IMMEDIATELY}}catch{return!1}let i=Hce(e,t);if(r.props.onDuplicate&&i.elements){let a=r.props.onDuplicate(i.elements,e);a&&(i.elements=a)}return{...i,captureUpdate:le.IMMEDIATELY}},keyTest:e=>e[Z.CTRL_OR_CMD]&&e.key===Z.D,PanelComponent:({elements:e,appState:t,updateData:n})=>m.jsx(Ct,{type:"button",icon:_3,title:`${D("labels.duplicateSelection")} — ${pe("CtrlOrCmd+D")}`,"aria-label":D("labels.duplicateSelection"),onClick:()=>n(null),visible:Vn(Vt(e),t)})}),Hce=(e,t)=>{let n=new Map,r=[],i=[],a=new Map,s=new Map,o=nt(e),c=y=>{let v=nC(y).reduce((x,w)=>{if(l.has(w.id))return x;l.set(w.id,!0);let C=hL(t.editingGroupId,n,w,{x:w.x+t2/2,y:w.y+t2/2});return l.set(C.id,!0),s.set(C.id,C),a.set(w.id,C.id),i.push(w),r.push(C),x.push(C),x},[]);return Array.isArray(y)?v:v[0]||null};e=Bce(e);let d=nt(gt(e,t,{includeBoundTextElement:!0,includeElementsInFrames:!0})),l=new Map,h=e.slice(),f=(y,v)=>{Dr(y!==-1,"targetIndex === -1 "),!(!Array.isArray(v)&&!v)&&h.splice(y+1,0,...nC(v))},g=new Set(e.filter(y=>d.has(y.id)&&tt(y)).map(y=>y.id));for(let y of e){if(l.has(y.id)||!d.has(y.id))continue;let v=ZA(t,y);if(v){let x=rn(e,v).flatMap(C=>tt(C)?[...Ks(e,C.id),C]:[C]),w=Kc(h,C=>{var S;return(S=C.groupIds)==null?void 0:S.includes(v)});f(w,c(x));continue}if(!(y.frameId&&g.has(y.frameId))){if(tt(y)){let x=y.id,w=Ks(e,x),C=Kc(h,S=>S.frameId===x||S.id===x);f(C,c([...w,y]));continue}if(ma(y)){let x=pt(y,o),w=Kc(h,C=>C.id===y.id||"containerId"in C&&C.containerId===y.id);x?f(w,c([y,x])):f(w,c(y));continue}if(an(y)){let x=ur(y,o),w=Kc(h,C=>C.id===y.id||C.id===(x==null?void 0:x.id));x?f(w,c([x,y])):f(w,c(y));continue}f(Kc(h,x=>x.id===y.id),c(y))}}tL(h,i,a),WA(h,i,a),HL(h,i,a);let U=c7(r);return{elements:h,appState:{...t,...Wr({editingGroupId:t.editingGroupId,selectedElementIds:U.reduce((y,v)=>(an(v)||(y[v.id]=!0),y),{})},Vt(h),t,null)}}},Wce=new Set(["command_palette","export"]),Jt=(e,t,n,r)=>{try{if(typeof window>"u"||mt.VITE_WORKER_ID||mt.VITE_APP_ENABLE_TRACKING!=="true"||!Wce.has(e)||mt.DEV)return;mt.PROD||console.info("trackEvent",{category:e,action:t,label:n,value:r}),window.sa_event&&window.sa_event(t,{category:e,label:n,value:r})}catch(i){console.error("error during analytics",i)}},Fj=I.forwardRef((e,t)=>{let{title:n,className:r,testId:i,active:a,standalone:s,icon:o,onClick:c}=e;return m.jsx("button",{type:"button",ref:t,title:n,"data-testid":i,className:Fe(r,{standalone:s,active:a}),onClick:c,children:o},n)}),ro=e=>m.jsx("div",{className:"buttonList",children:e.options.map(t=>e.type==="button"?m.jsx(Fj,{icon:t.icon,title:t.text,testId:t.testId,active:t.active??e.value===t.value,onClick:n=>e.onClick(t.value,n)},t.text):m.jsxs("label",{className:Fe({active:e.value===t.value}),title:t.text,children:[m.jsx("input",{type:"radio",name:e.group,onChange:()=>e.onChange(t.value),checked:e.value===t.value,"data-testid":t.testId}),t.icon]},t.text))}),Xce=({onChange:e,type:t,activeColor:n,topPicks:r})=>{let i;return t==="elementStroke"&&(i=uI),t==="elementBackground"&&(i=hI),t==="canvasBackground"&&(i=fI),r&&(i=r),i?m.jsx("div",{className:"color-picker__top-picks",children:i.map(a=>m.jsx("button",{className:Fe("color-picker__button",{active:a===n,"is-transparent":a==="transparent"||!a}),style:{"--swatch-color":a},type:"button",title:a,onClick:()=>e(a),"data-testid":`color-top-pick-${a}`,children:m.jsx("div",{className:"color-picker__button-outline"})},a))}):(console.error("Invalid type for TopPicks"),null)},$j=()=>m.jsx("div",{style:{width:1,height:"1rem",backgroundColor:"var(--default-border-color)",margin:"0 auto"}}),t6=({palette:e,color:t})=>{for(let[n,r]of Object.entries(e))if(Array.isArray(r)){let i=r.indexOf(t);if(i>-1)return{colorName:n,shade:i}}else if(r===t)return{colorName:n,shade:null};return null},m8=[["q","w","e","r","t"],["a","s","d","f","g"],["z","x","c","v","b"]].flat(),Bj=({color:e,palette:t})=>!Object.values(t).flat().includes(e),Vce=(e,t,n)=>{let r={elementBackground:"backgroundColor",elementStroke:"strokeColor"},i=e.filter(s=>{if(s.isDeleted)return!1;let o=s[r[t]];return Bj({color:o,palette:n})}),a=new Map;return i.forEach(s=>{let o=s[r[t]];a.has(o)?a.set(o,a.get(o)+1):a.set(o,1)}),[...a.entries()].sort((s,o)=>o[1]-s[1]).map(s=>s[0]).slice(0,RV)},Wh=hr(null),S_=(e,t,n)=>(e*299+t*587+n*114)/1e3>=160?"black":"white",Yce=(e,t)=>{if(t){let a=new Option().style;if(a.color=e,a.color){let s=a.color.replace(/^(rgb|rgba)\(/,"").replace(/\)$/,"").replace(/\s/g,"").split(","),o=parseInt(s[0]),c=parseInt(s[1]),d=parseInt(s[2]);return S_(o,c,d)}}if(e==="transparent")return"black";let n=parseInt(e.substring(1,3),16),r=parseInt(e.substring(3,5),16),i=parseInt(e.substring(5,7),16);return S_(n,r,i)},Gce=({color:e,keyLabel:t,isCustomColor:n=!1,isShade:r=!1})=>m.jsxs("div",{className:"color-picker__button__hotkey-label",style:{color:Yce(e,n)},children:[r&&"⇧",t]}),F7=Gce,qce=({hex:e,onChange:t,palette:n})=>{let r=t6({color:e||"transparent",palette:n}),[i,a]=kn(Wh),s=I.useRef(null);if(I.useEffect(()=>{s.current&&i==="shades"&&s.current.focus()},[r,i]),r){let{colorName:o,shade:c}=r,d=n[o];if(Array.isArray(d))return m.jsx("div",{className:"color-picker-content--default shades",children:d.map((l,h)=>m.jsxs("button",{ref:h===c&&i==="shades"?s:void 0,tabIndex:-1,type:"button",className:Fe("color-picker__button color-picker__button--large",{active:h===c}),"aria-label":"Shade",title:`${o} - ${h+1}`,style:l?{"--swatch-color":l}:void 0,onClick:()=>{t(l),a("shades")},children:[m.jsx("div",{className:"color-picker__button-outline"}),m.jsx(F7,{color:l,keyLabel:h+1,isShade:!0})]},h))})}return m.jsxs("div",{className:"color-picker-content--default",style:{position:"relative"},tabIndex:-1,children:[m.jsx("button",{type:"button",tabIndex:-1,className:"color-picker__button color-picker__button--large color-picker__button--no-focus-visible"}),m.jsx("div",{tabIndex:-1,style:{position:"absolute",top:0,left:0,right:0,bottom:0,display:"flex",alignItems:"center",justifyContent:"center",textAlign:"center",fontSize:"0.75rem"},children:D("colorPicker.noShades")})]})},Zce=({palette:e,color:t,onChange:n,label:r,activeShade:i})=>{let a=t6({color:t||"transparent",palette:e}),[s,o]=kn(Wh),c=I.useRef(null);return I.useEffect(()=>{c.current&&s==="baseColors"&&c.current.focus()},[a==null?void 0:a.colorName,s]),m.jsx("div",{className:"color-picker-content--default",children:Object.entries(e).map(([d,l],h)=>{let f=(Array.isArray(l)?l[i]:l)||"transparent",g=m8[h],U=D(`colors.${d.replace(/\d+/,"")}`,null,"");return m.jsxs("button",{ref:(a==null?void 0:a.colorName)===d?c:void 0,tabIndex:-1,type:"button",className:Fe("color-picker__button color-picker__button--large",{active:(a==null?void 0:a.colorName)===d,"is-transparent":f==="transparent"||!f}),onClick:()=>{n(f),o("baseColors")},title:`${U}${f.startsWith("#")?` ${f}`:""} — ${g}`,"aria-label":`${U} — ${g}`,style:{"--swatch-color":f},"data-testid":`color-${d}`,children:[m.jsx("div",{className:"color-picker__button-outline"}),m.jsx(F7,{color:f,keyLabel:g})]},d)})})},Kce=Zce,Qce=({colors:e,color:t,onChange:n,label:r})=>{let[i,a]=kn(Wh),s=I.useRef(null);return I.useEffect(()=>{s.current&&s.current.focus()},[t,i]),m.jsx("div",{className:"color-picker-content--default",children:e.map((o,c)=>m.jsxs("button",{ref:t===o?s:void 0,tabIndex:-1,type:"button",className:Fe("color-picker__button color-picker__button--large",{active:t===o,"is-transparent":o==="transparent"||!o}),onClick:()=>{n(o),a("custom")},title:o,"aria-label":r,style:{"--swatch-color":o},children:[m.jsx("div",{className:"color-picker__button-outline"}),m.jsx(F7,{color:o,keyLabel:c+1,isCustomColor:!0})]},c))})},_y=(e,t,n)=>{let r=Math.ceil(n/Lu);switch(t=t??-1,e){case"ArrowLeft":{let i=t-1;return i<0?n-1:i}case"ArrowRight":return(t+1)%n;case"ArrowDown":{let i=t+Lu;return i>=n?t%Lu:i}case"ArrowUp":{let i=t-Lu,a=i<0?Lu*r+i:i;return a>=n?void 0:a}}},Jce=({e,colorObj:t,onChange:n,palette:r,customColors:i,setActiveColorPickerSection:a,activeShade:s})=>{if((t==null?void 0:t.shade)!=null&&["Digit1","Digit2","Digit3","Digit4","Digit5"].includes(e.code)&&e.shiftKey){let o=Number(e.code.slice(-1))-1;return n(r[t.colorName][o]),a("shades"),!0}if(["1","2","3","4","5"].includes(e.key)&&i[Number(e.key)-1])return n(i[Number(e.key)-1]),a("custom"),!0;if(m8.includes(e.key)){let o=m8.indexOf(e.key),c=Object.keys(r)[o],d=r[c],l=Array.isArray(d)?d[s]:d;return n(l),a("baseColors"),!0}return!1},ede=({event:e,activeColorPickerSection:t,palette:n,color:r,onChange:i,customColors:a,setActiveColorPickerSection:s,updateData:o,activeShade:c,onEyeDropperToggle:d,onEscape:l})=>{if(e[Z.CTRL_OR_CMD])return!1;if(e.key===Z.ESCAPE)return l(e),!0;if(e.key===Z.ALT)return d(!0),!0;if(e.key===Z.I)return d(),!0;let h=t6({color:r,palette:n});if(e.key===Z.TAB){let f={custom:!!a.length,baseColors:!0,shades:(h==null?void 0:h.shade)!=null,hex:!0},g=Object.entries(f).reduce((w,[C,S])=>(S&&w.push(C),w),[]),U=g.indexOf(t),y=e.shiftKey?-1:1,v=U+y>g.length-1?0:U+y<0?g.length-1:U+y,x=g[v];return x&&s(x),x==="custom"?i(a[0]):x==="baseColors"&&(Object.entries(n).find(([w,C])=>Array.isArray(C)?C.includes(r):C===r?w:null)||i(yt.black)),e.preventDefault(),e.stopPropagation(),!0}if(Jce({e,colorObj:h,onChange:i,palette:n,customColors:a,setActiveColorPickerSection:s,activeShade:c}))return!0;if(t==="shades"&&h){let{shade:f}=h,g=_y(e.key,f,Lu);if(g!==void 0)return i(n[h.colorName][g]),!0}if(t==="baseColors"&&h){let{colorName:f}=h,g=Object.keys(n),U=g.indexOf(f),y=_y(e.key,U,g.length);if(y!==void 0){let v=g[y],x=n[v];return i(Array.isArray(x)?x[c]:x),!0}}if(t==="custom"){let f=a.indexOf(r),g=_y(e.key,f,a.length);if(g!==void 0){let U=a[g];return i(U),!0}}return!1},tde=({children:e})=>m.jsx("div",{className:"color-picker__heading",children:e}),Lg=tde,nde=({color:e,onChange:t,label:n,type:r,elements:i,palette:a,updateData:s,children:o,onEyeDropperToggle:c,onEscape:d})=>{let[l]=ke.useState(()=>r==="canvasBackground"?[]:Vce(i,r,a)),[h,f]=kn(Wh),g=t6({color:e,palette:a});I.useEffect(()=>{if(!h){let x=Bj({color:e,palette:a}),w=x&&!l.includes(e);f(w?"hex":x?"custom":(g==null?void 0:g.shade)!=null?"shades":"baseColors")}},[h,e,a,f,g,l]);let[U,y]=I.useState((g==null?void 0:g.shade)??(r==="elementBackground"?up:dp));I.useEffect(()=>{(g==null?void 0:g.shade)!=null&&y(g.shade);let x=w=>{w.key===Z.ALT&&c(!1)};return document.addEventListener("keyup",x,{capture:!0}),()=>{document.removeEventListener("keyup",x,{capture:!0})}},[g,c]);let v=ke.useRef(null);return m.jsx("div",{role:"dialog","aria-modal":"true","aria-label":D("labels.colorPicker"),children:m.jsxs("div",{ref:v,onKeyDown:x=>{ede({event:x,activeColorPickerSection:h,palette:a,color:e,onChange:t,onEyeDropperToggle:c,customColors:l,setActiveColorPickerSection:f,updateData:s,activeShade:U,onEscape:d})&&(x.preventDefault(),x.stopPropagation())},className:"color-picker-content properties-content",tabIndex:-1,children:[!!l.length&&m.jsxs("div",{children:[m.jsx(Lg,{children:D("colorPicker.mostUsedCustomColors")}),m.jsx(Qce,{colors:l,color:e,label:D("colorPicker.mostUsedCustomColors"),onChange:t})]}),m.jsxs("div",{children:[m.jsx(Lg,{children:D("colorPicker.colors")}),m.jsx(Kce,{color:e,label:n,palette:a,onChange:t,activeShade:U})]}),m.jsxs("div",{children:[m.jsx(Lg,{children:D("colorPicker.shades")}),m.jsx(qce,{hex:e,onChange:t,palette:a})]}),o]})})},zj=ke.createContext(null),Nr=()=>ke.useContext(zj),Hj=e=>{let[t,n]=I.useState(null),r=Yn(),{theme:i}=Nr(),{container:a}=ao();return I.useLayoutEffect(()=>{var s;t&&(t.className="",t.classList.add("excalidraw",...((s=e==null?void 0:e.className)==null?void 0:s.split(/\s+/))||[]),t.classList.toggle("excalidraw--mobile",r.editor.isMobile),t.classList.toggle("theme--dark",i===wt.DARK))},[t,i,r.editor.isMobile,e==null?void 0:e.className]),I.useLayoutEffect(()=>{let s=e!=null&&e.parentSelector?a==null?void 0:a.querySelector(e.parentSelector):document.body;if(!s)return;let o=document.createElement("div");return s.appendChild(o),n(o),()=>{s.removeChild(o)}},[a,e==null?void 0:e.parentSelector]),t};function $7(e,t,n){I.useEffect(()=>{function r(i){let a=i;if(!e.current)return;let s=n==null?void 0:n(a,e.current);if(s!==!0){if(s===!1)return t(a);e.current.contains(a.target)||!document.documentElement.contains(a.target)||a.target.closest("[data-radix-portal]")||a.target===document.documentElement&&document.body.style.pointerEvents==="none"||a.target.closest("[data-prevent-outside-click]")||t(a)}}return document.addEventListener("pointerdown",r),document.addEventListener("touchstart",r),()=>{document.removeEventListener("pointerdown",r),document.removeEventListener("touchstart",r)}},[e,t,n])}var n6=e=>{let t=I.useRef(e);return Object.assign(t.current,e),t.current},r6=hr(null),rde=({onCancel:e,onChange:t,onSelect:n,colorPickerType:r})=>{let i=Hj({className:"excalidraw-eye-dropper-backdrop",parentSelector:".excalidraw-eye-dropper-container"}),a=Nr(),s=u6(),o=io(),c=gt(s,a),d=n6({app:o,onCancel:e,onChange:t,onSelect:n,selectedElements:c}),{container:l}=ao();I.useEffect(()=>{let f=h.current;if(!f||!o.canvas||!i)return;let g=!1,U=o.canvas.getContext("2d"),y=({clientX:M,clientY:T})=>{let R=U.getImageData((M-a.offsetLeft)*window.devicePixelRatio,(T-a.offsetTop)*window.devicePixelRatio,1,1).data;return OV(R[0],R[1],R[2])},v=({clientX:M,clientY:T,altKey:R})=>{f.style.top=`${T+20}px`,f.style.left=`${M+20}px`;let j=y({clientX:M,clientY:T});g&&d.onChange(r,j,d.selectedElements,{altKey:R}),f.style.background=j},x=()=>{d.onCancel()},w=(M,T)=>{d.onSelect(M,T)},C=M=>{g=!0,M.stopImmediatePropagation()},S=M=>{g=!1,l==null||l.focus(),M.stopImmediatePropagation(),M.preventDefault(),w(y(M),M)},k=M=>{M.key===Z.ESCAPE&&(M.preventDefault(),M.stopImmediatePropagation(),x())};return i.tabIndex=-1,i.focus(),v({clientX:d.app.lastViewportPosition.x,clientY:d.app.lastViewportPosition.y,altKey:!1}),i.addEventListener("keydown",k),i.addEventListener("pointerdown",C),i.addEventListener("pointerup",S),window.addEventListener("pointermove",v,{passive:!0}),window.addEventListener("blur",x),()=>{g=!1,i.removeEventListener("keydown",k),i.removeEventListener("pointerdown",C),i.removeEventListener("pointerup",S),window.removeEventListener("pointermove",v),window.removeEventListener("blur",x)}},[d,o.canvas,i,r,l,a.offsetLeft,a.offsetTop]);let h=I.useRef(null);return $7(h,()=>{e()},f=>!!f.target.closest(".excalidraw-eye-dropper-trigger, .excalidraw-eye-dropper-backdrop")),i?Jn.createPortal(m.jsx("div",{ref:h,className:"excalidraw-eye-dropper-preview"}),i):null},ide=({color:e,onChange:t,label:n,colorPickerType:r})=>{let i=Yn(),[a,s]=I.useState(e),[o,c]=kn(Wh);I.useEffect(()=>{s(e)},[e]);let d=I.useCallback(U=>{let y=U.toLowerCase(),v=ade(y);v&&t(v),s(y)},[t]),l=I.useRef(null),h=I.useRef(null);I.useEffect(()=>{l.current&&l.current.focus()},[o]);let[f,g]=kn(r6);return I.useEffect(()=>()=>{g(null)},[g]),m.jsxs("div",{className:"color-picker__input-label",children:[m.jsx("div",{className:"color-picker__input-hash",children:"#"}),m.jsx("input",{ref:o==="hex"?l:void 0,style:{border:0,padding:0},spellCheck:!1,className:"color-picker-input","aria-label":n,onChange:U=>{d(U.target.value)},value:(a||"").replace(/^#/,""),onBlur:()=>{s(e)},tabIndex:-1,onFocus:()=>c("hex"),onKeyDown:U=>{var y;U.key!==Z.TAB&&(U.key===Z.ESCAPE&&((y=h.current)==null||y.focus()),U.stopPropagation())}}),!i.editor.isMobile&&m.jsxs(m.Fragment,{children:[m.jsx("div",{style:{width:"1px",height:"1.25rem",backgroundColor:"var(--default-border-color)"}}),m.jsx("div",{ref:h,className:Fe("excalidraw-eye-dropper-trigger",{selected:f}),onClick:()=>g(U=>U?null:{keepOpenOnAlt:!1,onSelect:y=>t(y),colorPickerType:r}),title:`${D("labels.eyeDropper")} — ${Z.I.toLocaleUpperCase()} or ${pe("Alt")} `,children:Tq})]})]})},ts=ke.forwardRef(({children:e,padding:t,className:n,style:r},i)=>m.jsx("div",{className:Fe("Island",n),style:{"--padding":t,...r},ref:i,children:e})),Wj=ke.forwardRef(({className:e,container:t,children:n,style:r,onClose:i,onKeyDown:a,onFocusOutside:s,onPointerLeave:o,onPointerDownOutside:c},d)=>{let l=Yn();return m.jsx(zoe,{container:t,children:m.jsxs(j7,{ref:d,className:Fe("focus-visible-none",e),"data-prevent-outside-click":!0,side:l.editor.isMobile&&!l.viewport.isLandscape?"bottom":"right",align:l.editor.isMobile&&!l.viewport.isLandscape?"center":"start",alignOffset:-16,sideOffset:20,style:{zIndex:"var(--zIndex-popup)"},onPointerLeave:o,onKeyDown:a,onFocusOutside:s,onPointerDownOutside:c,onCloseAutoFocus:h=>{h.stopPropagation(),h.preventDefault(),t&&!MY(document.activeElement)&&t.focus(),i()},children:[m.jsx(ts,{padding:3,style:r,children:n}),m.jsx(sj,{width:20,height:10,style:{fill:"var(--popup-bg-color)",filter:"drop-shadow(rgba(0, 0, 0, 0.05) 0px 3px 2px)"}})]})})}),__=e=>{let t=new Option().style;return t.color=e,!!t.color},ade=e=>Ga(e)?e:__(`#${e}`)?`#${e}`:__(e)?e:null,sde=({type:e,color:t,onChange:n,label:r,elements:i,palette:a=yt,updateData:s})=>{let{container:o}=ao(),[,c]=kn(Wh),[d,l]=kn(r6),h=m.jsxs("div",{children:[m.jsx(Lg,{children:D("colorPicker.hexCode")}),m.jsx(ide,{color:t,label:r,onChange:U=>{n(U)},colorPickerType:e})]}),f=I.useRef(null),g=()=>{var U,y;(y=(U=f.current)==null?void 0:U.querySelector(".color-picker-content"))==null||y.focus()};return m.jsx(Wj,{container:o,style:{maxWidth:"13rem"},onFocusOutside:U=>{g(),U.preventDefault()},onPointerDownOutside:U=>{d&&U.preventDefault()},onClose:()=>{s({openPopup:null}),c(null)},children:a?m.jsx(nde,{palette:a,color:t,onChange:U=>{n(U)},onEyeDropperToggle:U=>{l(y=>U?(y=y||{keepOpenOnAlt:!0,onSelect:n,colorPickerType:e},y.keepOpenOnAlt=!0,y):U===!1||y?null:{keepOpenOnAlt:!1,onSelect:n,colorPickerType:e})},onEscape:U=>{d?l(null):s({openPopup:null})},label:r,type:e,elements:i,updateData:s,children:h}):h})},ode=({label:e,color:t,type:n})=>m.jsx(KU,{type:"button",className:Fe("color-picker__button active-color properties-trigger",{"is-transparent":t==="transparent"||!t}),"aria-label":e,style:t?{"--swatch-color":t}:void 0,title:D(n==="elementStroke"?"labels.showStroke":"labels.showBackground"),children:m.jsx("div",{className:"color-picker__button-outline"})}),B7=({type:e,color:t,onChange:n,label:r,elements:i,palette:a=yt,topPicks:s,updateData:o,appState:c})=>m.jsx("div",{children:m.jsxs("div",{role:"dialog","aria-modal":"true",className:"color-picker-container",children:[m.jsx(Xce,{activeColor:t,onChange:n,type:e,topPicks:s}),m.jsx($j,{}),m.jsxs(ZU,{open:c.openPopup===e,onOpenChange:d=>{o({openPopup:d?e:null})},children:[m.jsx(ode,{color:t,label:r,type:e}),c.openPopup===e&&m.jsx(sde,{type:e,color:t,onChange:n,label:r,elements:i,palette:a,updateData:o})]})]})}),i6=({icon:e})=>m.jsx("span",{style:{width:"1em",margin:"0 0.5ex 0 0.5ex",display:"inline-block",lineHeight:0,verticalAlign:"middle"},children:e}),lde=({label:e,open:t,openTrigger:n,children:r,className:i})=>m.jsxs(m.Fragment,{children:[m.jsxs("div",{style:{cursor:"pointer",display:"flex",justifyContent:"space-between",alignItems:"center"},className:i,onClick:n,children:[e,m.jsx(i6,{icon:t?Kq:sA})]}),t&&m.jsx("div",{style:{display:"flex",flexDirection:"column"},children:r})]}),g8=lde,cde=hr(!1);function dde({options:e,value:t,label:n,onChange:r,onClose:i,numberOfOptionsToAlwaysShow:a=e.length}){let s=Yn(),o=g=>{let U=e.find(y=>y.keyBinding===g.key.toLowerCase());if(!(g.metaKey||g.altKey||g.ctrlKey)&&U)r(U.value),g.preventDefault();else if(g.key===Z.TAB){let y=e.findIndex(x=>x.value===t),v=g.shiftKey?(e.length+y-1)%e.length:(y+1)%e.length;r(e[v].value)}else if(hp(g.key)){let y=E1().rtl,v=e.findIndex(x=>x.value===t);if(v!==-1){let x=e.length,w=v;switch(g.key){case(y?Z.ARROW_LEFT:Z.ARROW_RIGHT):w=(v+1)%x;break;case(y?Z.ARROW_RIGHT:Z.ARROW_LEFT):w=(x+v-1)%x;break;case Z.ARROW_DOWN:{w=(v+(a??1))%x;break}case Z.ARROW_UP:{w=(x+v-(a??1))%x;break}}r(e[w].value)}g.preventDefault()}else(g.key===Z.ESCAPE||g.key===Z.ENTER)&&(g.preventDefault(),i());g.nativeEvent.stopImmediatePropagation(),g.stopPropagation()},[c,d]=kn(cde),l=ke.useMemo(()=>e.slice(0,a),[e,a]),h=ke.useMemo(()=>e.slice(a),[e,a]);I.useEffect(()=>{l.some(g=>g.value===t)||d(!0)},[t,l,d]);let f=g=>m.jsx("div",{className:"picker-content",children:g.map((U,y)=>m.jsxs("button",{type:"button",className:Fe("picker-option",{active:t===U.value}),onClick:v=>{r(U.value)},title:`${U.text} ${U.keyBinding&&`— ${U.keyBinding.toUpperCase()}`}`,"aria-label":U.text||"none","aria-keyshortcuts":U.keyBinding||void 0,ref:v=>{t===U.value&&setTimeout(()=>{v==null||v.focus()},0)},children:[U.icon,U.keyBinding&&m.jsx("span",{className:"picker-keybinding",children:U.keyBinding})]},U.text))});return m.jsx(j7,{side:s.editor.isMobile&&!s.viewport.isLandscape?"top":"bottom",align:"start",sideOffset:12,style:{zIndex:"var(--zIndex-popup)"},onKeyDown:o,children:m.jsxs("div",{className:"picker",role:"dialog","aria-modal":"true","aria-label":n,children:[f(l),h.length>0&&m.jsx(g8,{label:D("labels.more_options"),open:c,openTrigger:()=>{d(g=>!g)},className:"picker-collapsible",children:f(h)})]})})}function k_({value:e,label:t,options:n,onChange:r,group:i="",numberOfOptionsToAlwaysShow:a}){var d;let[s,o]=ke.useState(!1),c=ke.useRef(null);return m.jsx("div",{children:m.jsxs(ZU,{open:s,onOpenChange:l=>o(l),children:[m.jsx(KU,{name:i,type:"button","aria-label":t,onClick:()=>o(!s),ref:c,className:s?"active":"",children:(d=n.find(l=>l.value===e))==null?void 0:d.icon}),s&&m.jsx(dde,{options:n,value:e,label:t,onChange:r,onClose:()=>{o(!1)},numberOfOptionsToAlwaysShow:a})]})})}var Xj=ke.forwardRef(({className:e,placeholder:t,onChange:n},r)=>m.jsxs("div",{className:Fe("QuickSearch__wrapper",e),children:[kd,m.jsx("input",{ref:r,className:"QuickSearch__input",type:"text",placeholder:t,onChange:i=>n(i.target.value.trim().toLowerCase())})]})),Vj=({className:e,placeholder:t,children:n})=>{let r=!I.Children.count(n);return m.jsx("div",{className:Fe("ScrollableList__wrapper",e),role:"menu",children:r?m.jsx("div",{className:"empty",children:t}):n})},Yj=({children:e,className:t="",style:n,title:r})=>m.jsxs("div",{className:`dropdown-menu-group ${t}`,style:n,children:[r&&m.jsx("p",{className:"dropdown-menu-group-title",children:r}),e]}),U8=Yj;Yj.displayName="DropdownMenuGroup";var Gj=ke.createContext({}),qj=(e="",t=!1,n=!1)=>`dropdown-menu-item dropdown-menu-item-base ${e}
148
- ${t?"dropdown-menu-item--selected":""} ${n?"dropdown-menu-item--hovered":""}`.trim(),Zj=(e,t)=>{let n=I.useContext(Gj);return wU(e,r=>{var a;let i=new CustomEvent("menu.itemSelect",{bubbles:!0,cancelable:!0});t==null||t(i),i.defaultPrevented||((a=n.onSelect)==null||a.call(n,i))})},ude=({textStyle:e,icon:t,shortcut:n,children:r})=>{let i=Yn();return m.jsxs(m.Fragment,{children:[t&&m.jsx("div",{className:"dropdown-menu-item__icon",children:t}),m.jsx("div",{style:e,className:"dropdown-menu-item__text",children:r}),n&&!i.editor.isMobile&&m.jsx("div",{className:"dropdown-menu-item__shortcut",children:n})]})},Kj=ude,z7=({icon:e,value:t,order:n,children:r,shortcut:i,className:a,hovered:s,selected:o,textStyle:c,onSelect:d,onClick:l,...h})=>{let f=Zj(l,d),g=I.useRef(null);return I.useEffect(()=>{var U,y;s&&(n===0?(U=g.current)==null||U.scrollIntoView({block:"end"}):(y=g.current)==null||y.scrollIntoView({block:"nearest"}))},[s,n]),m.jsx("button",{...h,ref:g,value:t,onClick:f,className:qj(a,o,s),title:h.title??h["aria-label"],children:m.jsx(Kj,{textStyle:c,icon:e,shortcut:i,children:r})})};z7.displayName="DropdownMenuItem";var bp={GREEN:"green",RED:"red",BLUE:"blue"},H7=({type:e=bp.BLUE,children:t})=>{let{theme:n}=s0(),r={display:"inline-flex",marginLeft:"auto",padding:"2px 4px",borderRadius:6,fontSize:9,fontFamily:"Cascadia, monospace",border:n===wt.LIGHT?"1.5px solid white":"none"};switch(e){case bp.GREEN:Object.assign(r,{backgroundColor:"var(--background-color-badge)",color:"var(--color-badge)"});break;case bp.RED:Object.assign(r,{backgroundColor:"pink",color:"darkred"});break;case bp.BLUE:default:Object.assign(r,{background:"var(--color-promo)",color:"var(--color-surface-lowest)"})}return m.jsx("div",{className:"DropDownMenuItemBadge",style:r,children:t})};H7.displayName="DropdownMenuItemBadge";z7.Badge=H7;var va=z7,hde=({event:e,inputRef:t,hoveredFont:n,filteredFonts:r,onClose:i,onSelect:a,onHover:s})=>{var o,c,d;if(!e[Z.CTRL_OR_CMD]&&e.shiftKey&&e.key.toLowerCase()===Z.F)return(o=t.current)==null||o.focus(),!0;if(e.key===Z.ESCAPE)return i(),!0;if(e.key===Z.ENTER)return n!=null&&n.value&&a(n.value),!0;if(e.key===Z.ARROW_DOWN)return n!=null&&n.next?s(n.next.value):(c=r[0])!=null&&c.value&&s(r[0].value),!0;if(e.key===Z.ARROW_UP)return n!=null&&n.prev?s(n.prev.value):(d=r[r.length-1])!=null&&d.value&&s(r[r.length-1].value),!0},fde=ke.memo(({selectedFontFamily:e,hoveredFontFamily:t,onSelect:n,onHover:r,onLeave:i,onOpen:a,onClose:s})=>{let{container:o}=ao(),{fonts:c}=io(),{showDeprecatedFonts:d}=a0(),[l,h]=I.useState(""),f=I.useRef(null),g=I.useMemo(()=>Array.from(Wo.registered.entries()).filter(([R,{metadata:j}])=>!j.serverSide&&!j.fallback).map(([R,{metadata:j,fontFaces:P}])=>{var F,$;let N={value:R,icon:j.icon??u2,text:(($=(F=P[0])==null?void 0:F.fontFace)==null?void 0:$.family)??"Unknown"};return j.deprecated&&Object.assign(N,{deprecated:j.deprecated,badge:{type:bp.RED,placeholder:D("fontList.badge.old")}}),N}).sort((R,j)=>R.text.toLowerCase()>j.text.toLowerCase()?1:-1),[]),U=I.useMemo(()=>new Set(c.getSceneFamilies()),[e]),y=I.useMemo(()=>g.filter(R=>U.has(R.value)),[g,U]),v=I.useMemo(()=>g.filter(R=>!U.has(R.value)&&(d||!R.deprecated)),[g,U,d]),x=I.useMemo(()=>$Y([...y,...v].filter(R=>{var j;return(j=R.text)==null?void 0:j.toLowerCase().includes(l)})),[y,v,l]),w=I.useMemo(()=>{var j;let R;return t?R=x.find(P=>P.value===t):e&&(R=x.find(P=>P.value===e)),!R&&l&&((j=x[0])!=null&&j.value?r(x[0].value):i()),R},[t,e,l,x,r,i]),C=I.useCallback(R=>{hde({event:R,inputRef:f,hoveredFont:w,filteredFonts:x,onSelect:n,onHover:r,onClose:s})&&(R.preventDefault(),R.stopPropagation())},[w,x,n,r,s]);I.useEffect(()=>(a(),()=>{s()}),[]);let S=I.useMemo(()=>x.filter(R=>U.has(R.value)),[x,U]),k=I.useMemo(()=>x.filter(R=>!U.has(R.value)),[x,U]),M=(R,j)=>m.jsxs(va,{icon:R.icon,value:R.value,order:j,textStyle:{fontFamily:dh({fontFamily:R.value})},hovered:R.value===(w==null?void 0:w.value),selected:R.value===e,tabIndex:R.value===e?0:-1,onClick:P=>{n(Number(P.currentTarget.value))},onMouseMove:()=>{(w==null?void 0:w.value)!==R.value&&r(R.value)},children:[R.text,R.badge&&m.jsx(H7,{type:R.badge.type,children:R.badge.placeholder})]},R.value),T=[];return S.length&&T.push(m.jsx(U8,{title:D("fontList.sceneFonts"),children:S.map(M)},"group_1")),k.length&&T.push(m.jsx(U8,{title:D("fontList.availableFonts"),children:k.map((R,j)=>M(R,j+S.length))},"group_2")),m.jsxs(Wj,{className:"properties-content",container:o,style:{width:"15rem"},onClose:s,onPointerLeave:i,onKeyDown:C,children:[m.jsx(Xj,{ref:f,placeholder:D("quickSearch.placeholder"),onChange:uh(h,20)}),m.jsx(Vj,{className:"dropdown-menu fonts manual-hover",placeholder:D("fontList.empty"),children:T.length?T:null})]})},(e,t)=>e.selectedFontFamily===t.selectedFontFamily&&e.hoveredFontFamily===t.hoveredFontFamily),pde=({selectedFontFamily:e})=>{let t=I.useMemo(()=>!!(e&&!gde(e)),[e]);return m.jsx(KU,{asChild:!0,children:m.jsx("div",{children:m.jsx(Fj,{standalone:!0,icon:WI,title:D("labels.showFonts"),className:"properties-trigger",testId:"font-family-show-fonts",active:t,onClick:()=>{}})})})},Qj=[{value:un.Excalifont,icon:d1,text:D("labels.handDrawn"),testId:"font-family-hand-drawn"},{value:un.Nunito,icon:u2,text:D("labels.normal"),testId:"font-family-normal"},{value:un["Comic Shanns"],icon:I3,text:D("labels.code"),testId:"font-family-code"}],mde=new Set(Qj.map(e=>e.value)),gde=e=>e?mde.has(e):!1,Ude=ke.memo(({isOpened:e,selectedFontFamily:t,hoveredFontFamily:n,onSelect:r,onHover:i,onLeave:a,onPopupChange:s})=>{let o=I.useMemo(()=>Qj,[]),c=I.useCallback(d=>{d&&r(d)},[r]);return m.jsxs("div",{role:"dialog","aria-modal":"true",className:"FontPicker__container",children:[m.jsx(ro,{type:"button",options:o,value:t,onClick:c}),m.jsx($j,{}),m.jsxs(ZU,{open:e,onOpenChange:s,children:[m.jsx(pde,{selectedFontFamily:t}),e&&m.jsx(fde,{selectedFontFamily:t,hoveredFontFamily:n,onSelect:c,onHover:i,onLeave:a,onOpen:()=>s(!0),onClose:()=>s(!1)})]})]})},(e,t)=>e.isOpened===t.isOpened&&e.selectedFontFamily===t.selectedFontFamily&&e.hoveredFontFamily===t.hoveredFontFamily),bde=({updateData:e,appState:t,elements:n,testId:r})=>{let i=ke.useRef(null),a=ke.useRef(null),s=qr(n,t,o=>o.opacity,!0,t.currentItemOpacity);return I.useEffect(()=>{if(i.current&&a.current){let o=i.current,c=a.current,d=o.offsetWidth,l=15,h=s/100*(d-l)+l/2;c.style.left=`${h}px`,o.style.background=`linear-gradient(to right, var(--color-slider-track) 0%, var(--color-slider-track) ${s}%, var(--button-bg) ${s}%, var(--button-bg) 100%)`}},[s]),m.jsxs("label",{className:"control-label",children:[D("labels.opacity"),m.jsxs("div",{className:"range-wrapper",children:[m.jsx("input",{ref:i,type:"range",min:"0",max:"100",step:"10",onChange:o=>{e(+o.target.value)},value:s,className:"range-input","data-testid":r}),m.jsx("div",{className:"value-bubble",ref:a,children:s!==0?s:null}),m.jsx("div",{className:"zero-label",children:"0"})]})]})},Jj=.1,Gr=(e,t,n,r=!1)=>{let i=nt(gt(e,t,{includeBoundTextElement:r}));return e.map(a=>{var s;return i.get(a.id)||a.id===((s=t.editingTextElement)==null?void 0:s.id)?n(a):a})},qr=function(e,t,n,r,i){let a=t.editingTextElement,s=Vt(e),o=null;return a&&(o=n(a)),o||(Vn(s,t)?o=rie(r===!0?s:s.filter(c=>r(c)),t,n)??(typeof i=="function"?i(!0):i):o=typeof i=="function"?i(!1):i),o},yde=(e,t)=>an(t)||!t.autoResize?t:me(t,{x:e.textAlign==="left"?e.x:e.x+(e.width-t.width)/(e.textAlign==="center"?2:1),y:e.y+(e.height-t.height)/2},!1),W7=(e,t,n,r,i)=>{let a=new Set,s=Gr(e,t,c=>{if(Le(c)){let d=r(c);a.add(d);let l=ct(c,{fontSize:d});return Yr(l,n.scene.getContainerElement(c),n.scene.getNonDeletedElementsMap()),l=yde(c,l),l}return c},!0),o=nt(s);return gt(e,t,{includeBoundTextElement:!0}).forEach(c=>{Le(c)&&gi(c,o)}),{elements:s,appState:{...t,currentItemFontSize:a.size===1?[...a][0]:i??t.currentItemFontSize},captureUpdate:le.IMMEDIATELY}};Te({name:"changeStrokeColor",label:"labels.stroke",trackEvent:!1,perform:(e,t,n)=>({...n.currentItemStrokeColor&&{elements:Gr(e,t,r=>j3(r.type)?ct(r,{strokeColor:n.currentItemStrokeColor}):r,!0)},appState:{...t,...n},captureUpdate:n.currentItemStrokeColor?le.IMMEDIATELY:le.EVENTUALLY}),PanelComponent:({elements:e,appState:t,updateData:n,appProps:r})=>m.jsxs(m.Fragment,{children:[m.jsx("h3",{"aria-hidden":"true",children:D("labels.stroke")}),m.jsx(B7,{topPicks:uI,palette:jV,type:"elementStroke",label:D("labels.stroke"),color:qr(e,t,i=>i.strokeColor,!0,t.currentItemStrokeColor),onChange:i=>n({currentItemStrokeColor:i}),elements:e,appState:t,updateData:n})]})});Te({name:"changeBackgroundColor",label:"labels.changeBackground",trackEvent:!1,perform:(e,t,n)=>({...n.currentItemBackgroundColor&&{elements:Gr(e,t,r=>ct(r,{backgroundColor:n.currentItemBackgroundColor}))},appState:{...t,...n},captureUpdate:n.currentItemBackgroundColor?le.IMMEDIATELY:le.EVENTUALLY}),PanelComponent:({elements:e,appState:t,updateData:n,appProps:r})=>m.jsxs(m.Fragment,{children:[m.jsx("h3",{"aria-hidden":"true",children:D("labels.background")}),m.jsx(B7,{topPicks:hI,palette:PV,type:"elementBackground",label:D("labels.background"),color:qr(e,t,i=>i.backgroundColor,!0,t.currentItemBackgroundColor),onChange:i=>n({currentItemBackgroundColor:i}),elements:e,appState:t,updateData:n})]})});Te({name:"changeFillStyle",label:"labels.fill",trackEvent:!1,perform:(e,t,n,r)=>(Jt("element","changeFillStyle",`${n} (${r.device.editor.isMobile?"mobile":"desktop"})`),{elements:Gr(e,t,i=>ct(i,{fillStyle:n})),appState:{...t,currentItemFillStyle:n},captureUpdate:le.IMMEDIATELY}),PanelComponent:({elements:e,appState:t,updateData:n})=>{let r=gt(e,t),i=r.length>0&&r.every(a=>a.fillStyle==="zigzag");return m.jsxs("fieldset",{children:[m.jsx("legend",{children:D("labels.fill")}),m.jsx(ro,{type:"button",options:[{value:"hachure",text:`${D(i?"labels.zigzag":"labels.hachure")} (${pe("Alt-Click")})`,icon:i?BG:zG,active:i?!0:void 0,testId:"fill-hachure"},{value:"cross-hatch",text:D("labels.crossHatch"),icon:HG,testId:"fill-cross-hatch"},{value:"solid",text:D("labels.solid"),icon:WG,testId:"fill-solid"}],value:qr(e,t,a=>a.fillStyle,a=>a.hasOwnProperty("fillStyle"),a=>a?null:t.currentItemFillStyle),onClick:(a,s)=>{let o=s.altKey&&a==="hachure"&&r.every(c=>c.fillStyle==="hachure")?"zigzag":a;n(o)}})]})}});Te({name:"changeStrokeWidth",label:"labels.strokeWidth",trackEvent:!1,perform:(e,t,n)=>({elements:Gr(e,t,r=>ct(r,{strokeWidth:n})),appState:{...t,currentItemStrokeWidth:n},captureUpdate:le.IMMEDIATELY}),PanelComponent:({elements:e,appState:t,updateData:n})=>m.jsxs("fieldset",{children:[m.jsx("legend",{children:D("labels.strokeWidth")}),m.jsx(ro,{group:"stroke-width",options:[{value:zb.thin,text:D("labels.thin"),icon:KI,testId:"strokeWidth-thin"},{value:zb.bold,text:D("labels.bold"),icon:XG,testId:"strokeWidth-bold"},{value:zb.extraBold,text:D("labels.extraBold"),icon:VG,testId:"strokeWidth-extraBold"}],value:qr(e,t,r=>r.strokeWidth,r=>r.hasOwnProperty("strokeWidth"),r=>r?null:t.currentItemStrokeWidth),onChange:r=>n(r)})]})});Te({name:"changeSloppiness",label:"labels.sloppiness",trackEvent:!1,perform:(e,t,n)=>({elements:Gr(e,t,r=>ct(r,{seed:Gs(),roughness:n})),appState:{...t,currentItemRoughness:n},captureUpdate:le.IMMEDIATELY}),PanelComponent:({elements:e,appState:t,updateData:n})=>m.jsxs("fieldset",{children:[m.jsx("legend",{children:D("labels.sloppiness")}),m.jsx(ro,{group:"sloppiness",options:[{value:0,text:D("labels.architect"),icon:qG},{value:1,text:D("labels.artist"),icon:ZG},{value:2,text:D("labels.cartoonist"),icon:KG}],value:qr(e,t,r=>r.roughness,r=>r.hasOwnProperty("roughness"),r=>r?null:t.currentItemRoughness),onChange:r=>n(r)})]})});Te({name:"changeStrokeStyle",label:"labels.strokeStyle",trackEvent:!1,perform:(e,t,n)=>({elements:Gr(e,t,r=>ct(r,{strokeStyle:n})),appState:{...t,currentItemStrokeStyle:n},captureUpdate:le.IMMEDIATELY}),PanelComponent:({elements:e,appState:t,updateData:n})=>m.jsxs("fieldset",{children:[m.jsx("legend",{children:D("labels.strokeStyle")}),m.jsx(ro,{group:"strokeStyle",options:[{value:"solid",text:D("labels.strokeStyle_solid"),icon:KI},{value:"dashed",text:D("labels.strokeStyle_dashed"),icon:YG},{value:"dotted",text:D("labels.strokeStyle_dotted"),icon:GG}],value:qr(e,t,r=>r.strokeStyle,r=>r.hasOwnProperty("strokeStyle"),r=>r?null:t.currentItemStrokeStyle),onChange:r=>n(r)})]})});Te({name:"changeOpacity",label:"labels.opacity",trackEvent:!1,perform:(e,t,n)=>({elements:Gr(e,t,r=>ct(r,{opacity:n}),!0),appState:{...t,currentItemOpacity:n},captureUpdate:le.IMMEDIATELY}),PanelComponent:({elements:e,appState:t,updateData:n})=>m.jsx(bde,{updateData:n,elements:e,appState:t,testId:"opacity"})});Te({name:"changeFontSize",label:"labels.fontSize",trackEvent:!1,perform:(e,t,n,r)=>W7(e,t,r,()=>n,n),PanelComponent:({elements:e,appState:t,updateData:n,app:r})=>m.jsxs("fieldset",{children:[m.jsx("legend",{children:D("labels.fontSize")}),m.jsx(ro,{group:"font-size",options:[{value:16,text:D("labels.small"),icon:hq,testId:"fontSize-small"},{value:20,text:D("labels.medium"),icon:fq,testId:"fontSize-medium"},{value:28,text:D("labels.large"),icon:pq,testId:"fontSize-large"},{value:36,text:D("labels.veryLarge"),icon:mq,testId:"fontSize-veryLarge"}],value:qr(e,t,i=>{if(Le(i))return i.fontSize;let a=pt(i,r.scene.getNonDeletedElementsMap());return a?a.fontSize:null},i=>Le(i)||pt(i,r.scene.getNonDeletedElementsMap())!==null,i=>i?null:t.currentItemFontSize||ol),onChange:i=>n(i)})]})});var T_=Te({name:"decreaseFontSize",label:"labels.decreaseFontSize",icon:_U,trackEvent:!1,perform:(e,t,n,r)=>W7(e,t,r,i=>Math.round(1/(1+Jj)*i.fontSize)),keyTest:e=>e[Z.CTRL_OR_CMD]&&e.shiftKey&&(e.key===Z.CHEVRON_LEFT||e.key===Z.COMMA)}),M_=Te({name:"increaseFontSize",label:"labels.increaseFontSize",icon:_U,trackEvent:!1,perform:(e,t,n,r)=>W7(e,t,r,i=>Math.round(i.fontSize*(1+Jj))),keyTest:e=>e[Z.CTRL_OR_CMD]&&e.shiftKey&&(e.key===Z.CHEVRON_RIGHT||e.key===Z.PERIOD)});Te({name:"changeFontFamily",label:"labels.fontFamily",trackEvent:!1,perform:(e,t,n,r)=>{var U;let{cachedElements:i,resetAll:a,resetContainers:s,...o}=n;if(a)return{elements:Gr(e,t,y=>{let v=i==null?void 0:i.get(y.id);return v?ct(y,{...v}):y},!0),appState:{...t,...o},captureUpdate:le.NEVER};let{currentItemFontFamily:c,currentHoveredFontFamily:d}=n,l=le.EVENTUALLY,h,f=!1;if(c)h=c,l=le.IMMEDIATELY;else if(d){h=d,l=le.EVENTUALLY;let y=gt(e,t,{includeBoundTextElement:!0}).filter(v=>Le(v));if(y.length>200)f=!0;else{let v=0,x=0;for(;v<y.length&&x<5e3;){let w=y[v];x+=(w==null?void 0:w.originalText.length)||0,v++}x>5e3&&(f=!0)}}let g={appState:{...t,...o},captureUpdate:l};if(h&&!f){let y=new Map,v=new Set,x=!1,w=Array.from(Wo.loadedFontsCache.values()),C=(U=Object.entries(un).find(([M,T])=>T===h))==null?void 0:U[0];d&&C&&w.some(M=>M.startsWith(C))&&(x=!0),Object.assign(g,{elements:Gr(e,t,M=>{if(Le(M)&&(M.fontFamily!==h||c)){let T=ct(M,{fontFamily:h,lineHeight:Td(h)}),R=(i==null?void 0:i.get(M.containerId||""))||{},j=r.scene.getContainerElement(M);return s&&j&&R&&me(j,{...R},!1),x||(v=new Set([...v,...Array.from(T.originalText)])),y.set(T,j),T}return M},!0)});let S=`10px ${dh({fontFamily:h})}`,k=Array.from(v.values()).join();if(x||window.document.fonts.check(S,k))for(let[M,T]of y)Yr(M,T,r.scene.getNonDeletedElementsMap(),!1);else window.document.fonts.load(S,k).then(M=>{for(let[T,R]of y){let j=r.scene.getElement(T.id),P=R?r.scene.getElement(R.id):null;j&&Yr(j,P,r.scene.getNonDeletedElementsMap(),!1)}r.fonts.onLoaded(M)})}return g},PanelComponent:({elements:e,appState:t,app:n,updateData:r})=>{let i=I.useRef(new Map),a=I.useRef(null),[s,o]=I.useState({}),c=I.useRef(!0),d=I.useMemo(()=>{var h;let l=(f,g)=>qr(f,t,U=>{if(Le(U))return U.fontFamily;let y=pt(U,g);return y?y.fontFamily:null},U=>Le(U)||pt(U,g)!==null,U=>U?null:t.currentItemFontFamily||xc);return s.openPopup==="fontFamily"&&t.openPopup==="fontFamily"?l(Array.from(((h=i.current)==null?void 0:h.values())??[]),i.current):!s.openPopup&&t.openPopup!=="fontFamily"?l(e,n.scene.getNonDeletedElementsMap()):a.current},[s.openPopup,t,e,n.scene]);return I.useEffect(()=>{a.current=d},[d]),I.useEffect(()=>{Object.keys(s).length&&(r(s),o({}))},[s]),I.useEffect(()=>(c.current=!1,()=>{c.current=!0}),[]),m.jsxs("fieldset",{children:[m.jsx("legend",{children:D("labels.fontFamily")}),m.jsx(Ude,{isOpened:t.openPopup==="fontFamily",selectedFontFamily:d,hoveredFontFamily:t.currentHoveredFontFamily,onSelect:l=>{o({openPopup:null,currentHoveredFontFamily:null,currentItemFontFamily:l}),i.current.clear()},onHover:l=>{o({currentHoveredFontFamily:l,cachedElements:new Map(i.current),resetContainers:!0})},onLeave:()=>{o({currentHoveredFontFamily:null,cachedElements:new Map(i.current),resetAll:!0})},onPopupChange:l=>{if(l){i.current.clear();let{editingTextElement:h}=t;if((h==null?void 0:h.type)==="text"){let f=n.scene.getElement(h.id);i.current.set(h.id,ct(f||h,{},!0))}else{let f=gt(e,t,{includeBoundTextElement:!0});for(let g of f)i.current.set(g.id,ct(g,{},!0))}o({openPopup:"fontFamily"})}else{let h={openPopup:null,currentHoveredFontFamily:null,cachedElements:new Map(i.current),resetAll:!0};c.current?r({...s,...h}):o(h),i.current.clear()}}})]})}});Te({name:"changeTextAlign",label:"Change text alignment",trackEvent:!1,perform:(e,t,n,r)=>({elements:Gr(e,t,i=>{if(Le(i)){let a=ct(i,{textAlign:n});return Yr(a,r.scene.getContainerElement(i),r.scene.getNonDeletedElementsMap()),a}return i},!0),appState:{...t,currentItemTextAlign:n},captureUpdate:le.IMMEDIATELY}),PanelComponent:({elements:e,appState:t,updateData:n,app:r})=>{let i=r.scene.getNonDeletedElementsMap();return m.jsxs("fieldset",{children:[m.jsx("legend",{children:D("labels.textAlign")}),m.jsx(ro,{group:"text-align",options:[{value:"left",text:D("labels.left"),icon:Uq,testId:"align-left"},{value:"center",text:D("labels.center"),icon:bq,testId:"align-horizontal-center"},{value:"right",text:D("labels.right"),icon:yq,testId:"align-right"}],value:qr(e,t,a=>{if(Le(a))return a.textAlign;let s=pt(a,i);return s?s.textAlign:null},a=>Le(a)||pt(a,i)!==null,a=>a?null:t.currentItemTextAlign),onChange:a=>n(a)})]})}});Te({name:"changeVerticalAlign",label:"Change vertical alignment",trackEvent:{category:"element"},perform:(e,t,n,r)=>({elements:Gr(e,t,i=>{if(Le(i)){let a=ct(i,{verticalAlign:n});return Yr(a,r.scene.getContainerElement(i),r.scene.getNonDeletedElementsMap()),a}return i},!0),appState:{...t},captureUpdate:le.IMMEDIATELY}),PanelComponent:({elements:e,appState:t,updateData:n,app:r})=>m.jsx("fieldset",{children:m.jsx(ro,{group:"text-align",options:[{value:ji.TOP,text:D("labels.alignTop"),icon:m.jsx(vq,{theme:t.theme}),testId:"align-top"},{value:ji.MIDDLE,text:D("labels.centerVertically"),icon:m.jsx(wq,{theme:t.theme}),testId:"align-middle"},{value:ji.BOTTOM,text:D("labels.alignBottom"),icon:m.jsx(xq,{theme:t.theme}),testId:"align-bottom"}],value:qr(e,t,i=>{if(Le(i)&&i.containerId)return i.verticalAlign;let a=pt(i,r.scene.getNonDeletedElementsMap());return a?a.verticalAlign:null},i=>Le(i)||pt(i,r.scene.getNonDeletedElementsMap())!==null,i=>i?null:ji.MIDDLE),onChange:i=>n(i)})})});Te({name:"changeRoundness",label:"Change edge roundness",trackEvent:!1,perform:(e,t,n)=>({elements:Gr(e,t,r=>Pe(r)?r:ct(r,{roundness:n==="round"?{type:$h(r.type)?Nn.ADAPTIVE_RADIUS:Nn.PROPORTIONAL_RADIUS}:null})),appState:{...t,currentItemRoundness:n},captureUpdate:le.IMMEDIATELY}),PanelComponent:({elements:e,appState:t,updateData:n})=>{let r=ZL(Vt(e),t).some(i=>{var a;return((a=i.roundness)==null?void 0:a.type)===Nn.LEGACY});return m.jsxs("fieldset",{children:[m.jsx("legend",{children:D("labels.edges")}),m.jsx(ro,{group:"edges",options:[{value:"sharp",text:D("labels.sharp"),icon:QG},{value:"round",text:D("labels.round"),icon:JG}],value:qr(e,t,i=>r?null:i.roundness?"round":"sharp",i=>!Ut(i)&&i.hasOwnProperty("roundness"),i=>i?null:t.currentItemRoundness),onChange:i=>n(i)})]})}});var I_=e=>[{value:null,text:D("labels.arrowhead_none"),keyBinding:"q",icon:eq},{value:"arrow",text:D("labels.arrowhead_arrow"),keyBinding:"w",icon:m.jsx(tq,{flip:e})},{value:"triangle",text:D("labels.arrowhead_triangle"),icon:m.jsx(aq,{flip:e}),keyBinding:"e"},{value:"triangle_outline",text:D("labels.arrowhead_triangle_outline"),icon:m.jsx(sq,{flip:e}),keyBinding:"r"},{value:"circle",text:D("labels.arrowhead_circle"),keyBinding:"a",icon:m.jsx(nq,{flip:e})},{value:"circle_outline",text:D("labels.arrowhead_circle_outline"),keyBinding:"s",icon:m.jsx(rq,{flip:e})},{value:"diamond",text:D("labels.arrowhead_diamond"),icon:m.jsx(oq,{flip:e}),keyBinding:"d"},{value:"diamond_outline",text:D("labels.arrowhead_diamond_outline"),icon:m.jsx(lq,{flip:e}),keyBinding:"f"},{value:"bar",text:D("labels.arrowhead_bar"),keyBinding:"z",icon:m.jsx(iq,{flip:e})},{value:"crowfoot_one",text:D("labels.arrowhead_crowfoot_one"),icon:m.jsx(dq,{flip:e}),keyBinding:"c"},{value:"crowfoot_many",text:D("labels.arrowhead_crowfoot_many"),icon:m.jsx(cq,{flip:e}),keyBinding:"x"},{value:"crowfoot_one_or_many",text:D("labels.arrowhead_crowfoot_one_or_many"),icon:m.jsx(uq,{flip:e}),keyBinding:"v"}];Te({name:"changeArrowhead",label:"Change arrowheads",trackEvent:!1,perform:(e,t,n)=>({elements:Gr(e,t,r=>{if(st(r)){let{position:i,type:a}=n;if(i==="start")return ct(r,{startArrowhead:a});if(i==="end")return ct(r,{endArrowhead:a})}return r}),appState:{...t,[n.position==="start"?"currentItemStartArrowhead":"currentItemEndArrowhead"]:n.type},captureUpdate:le.IMMEDIATELY}),PanelComponent:({elements:e,appState:t,updateData:n})=>{let r=E1().rtl;return m.jsxs("fieldset",{children:[m.jsx("legend",{children:D("labels.arrowheads")}),m.jsxs("div",{className:"iconSelectList buttonList",children:[m.jsx(k_,{label:"arrowhead_start",options:I_(!r),value:qr(e,t,i=>st(i)&&p2(i.type)?i.startArrowhead:t.currentItemStartArrowhead,!0,t.currentItemStartArrowhead),onChange:i=>n({position:"start",type:i}),numberOfOptionsToAlwaysShow:4}),m.jsx(k_,{label:"arrowhead_end",group:"arrowheads",options:I_(!!r),value:qr(e,t,i=>st(i)&&p2(i.type)?i.endArrowhead:t.currentItemEndArrowhead,!0,t.currentItemEndArrowhead),onChange:i=>n({position:"end",type:i}),numberOfOptionsToAlwaysShow:4})]})]})}});Te({name:"changeArrowType",label:"Change arrow types",trackEvent:!1,perform:(e,t,n,r)=>{var o;let i=Gr(e,t,c=>{if(!Ut(c))return c;let d=ct(c,{roundness:n===lr.round?{type:Nn.PROPORTIONAL_RADIUS}:null,elbowed:n===lr.elbow,points:n===lr.elbow||c.elbowed?[c.points[0],c.points[c.points.length-1]]:c.points});if(Pe(d)){let l=r.scene.getNonDeletedElementsMap();r.dismissLinearEditor();let h=Re.getPointAtIndexGlobalCoordinates(d,0,l),f=Re.getPointAtIndexGlobalCoordinates(d,-1,l),g=!d.startBinding&&qa(Ya(h),e,l,t.zoom,!1,!0),U=!d.endBinding&&qa(Ya(f),e,l,t.zoom,!1,!0),y=g||d.startBinding&&l.get(d.startBinding.elementId),v=U||d.endBinding&&l.get(d.endBinding.elementId),x=g?h1(d,g,"start"):h,w=U?h1(d,U,"end"):f;g&&Ys(d,g,"start",l),U&&Ys(d,U,"end",l),me(d,{points:[x,w].map(C=>A(C[0]-d.x,C[1]-d.y)),...y&&d.startBinding?{startBinding:{...d.startBinding,...U2(d,y,"start")}}:{},...v&&d.endBinding?{endBinding:{...d.endBinding,...U2(d,v,"end")}}:{}}),Re.updateEditorMidPointsCache(d,l,r.state)}return d}),a={...t,currentItemArrowType:n},s=(o=t.selectedLinearElement)==null?void 0:o.elementId;if(s){let c=i.find(d=>d.id===s);c&&(a.selectedLinearElement=new Re(c))}return{elements:i,appState:a,captureUpdate:le.IMMEDIATELY}},PanelComponent:({elements:e,appState:t,updateData:n})=>m.jsxs("fieldset",{children:[m.jsx("legend",{children:D("labels.arrowtypes")}),m.jsx(ro,{group:"arrowtypes",options:[{value:lr.sharp,text:D("labels.arrowtype_sharp"),icon:Gq,testId:"sharp-arrow"},{value:lr.round,text:D("labels.arrowtype_round"),icon:Zq,testId:"round-arrow"},{value:lr.elbow,text:D("labels.arrowtype_elbowed"),icon:qq,testId:"elbow-arrow"}],value:qr(e,t,r=>Ut(r)?r.elbowed?lr.elbow:r.roundness?lr.round:lr.sharp:null,r=>Ut(r),r=>r?null:t.currentItemArrowType),onChange:r=>n(r)})]})});var sd=({viewportX:e,viewportY:t,nextZoom:n},r)=>{let i=e-r.offsetLeft,a=t-r.offsetTop,s=r.zoom.value,o=r.scrollX+(i-i/s),c=r.scrollY+(a-a/s),d=-(i-i/n),l=-(a-a/n);return{scrollX:o+d,scrollY:c+l,zoom:{value:n}}},Np=()=>{let e=document.querySelector(".excalidraw-tooltip");if(e)return e;let t=document.createElement("div");return document.body.appendChild(t),t.classList.add("excalidraw-tooltip"),t},eP=(e,t,n="bottom")=>{let r=e.getBoundingClientRect(),i=window.innerWidth,a=window.innerHeight,s=5,o=t.left+t.width/2-r.width/2;o<0?o=s:o+r.width>=i&&(o=i-r.width-s);let c;n==="bottom"?(c=t.top+t.height+s,c+r.height>=a&&(c=t.top-r.height-s)):(c=t.top-r.height-s,c<0&&(c=t.top+t.height+s)),Object.assign(e.style,{top:`${c}px`,left:`${o}px`})},vde=(e,t,n,r)=>{t.classList.add("excalidraw-tooltip--visible"),t.style.minWidth=r?"50ch":"10ch",t.style.maxWidth=r?"50ch":"15ch",t.textContent=n;let i=e.getBoundingClientRect();eP(t,i)},Dd=({children:e,label:t,long:n=!1,style:r,disabled:i})=>(I.useEffect(()=>()=>Np().classList.remove("excalidraw-tooltip--visible"),[]),i?null:m.jsx("div",{className:"excalidraw-tooltip-wrapper",onPointerEnter:a=>vde(a.currentTarget,Np(),t,n),onPointerLeave:()=>Np().classList.remove("excalidraw-tooltip--visible"),style:r,children:e}));Te({name:"changeViewBackgroundColor",label:"labels.canvasBackground",paletteName:"Change canvas background color",trackEvent:!1,predicate:(e,t,n,r)=>!!r.props.UIOptions.canvasActions.changeViewBackgroundColor&&!t.viewModeEnabled,perform:(e,t,n)=>({appState:{...t,...n},captureUpdate:n.viewBackgroundColor?le.IMMEDIATELY:le.EVENTUALLY}),PanelComponent:({elements:e,appState:t,updateData:n,appProps:r})=>m.jsx(B7,{palette:null,topPicks:fI,label:D("labels.canvasBackground"),type:"canvasBackground",color:t.viewBackgroundColor,onChange:i=>n({viewBackgroundColor:i}),"data-testid":"canvas-background-picker",elements:e,appState:t,updateData:n})});var Op=Te({name:"clearCanvas",label:"labels.clearCanvas",paletteName:"Clear canvas",icon:_d,trackEvent:{category:"canvas"},predicate:(e,t,n,r)=>{var i;return!!r.props.UIOptions.canvasActions.clearCanvas&&!t.viewModeEnabled&&((i=t.openDialog)==null?void 0:i.name)!=="elementLinkSelector"},perform:(e,t,n,r)=>(r.imageCache.clear(),{elements:e.map(i=>ct(i,{isDeleted:!0})),appState:{...Vs(),files:{},theme:t.theme,penMode:t.penMode,penDetected:t.penDetected,exportBackground:t.exportBackground,exportEmbedScene:t.exportEmbedScene,gridSize:t.gridSize,gridStep:t.gridStep,gridModeEnabled:t.gridModeEnabled,stats:t.stats,pasteDialog:t.pasteDialog,activeTool:t.activeTool.type==="image"?{...t.activeTool,type:"selection"}:t.activeTool},captureUpdate:le.IMMEDIATELY})}),A_=Te({name:"zoomIn",label:"buttons.zoomIn",viewMode:!0,icon:rC,trackEvent:{category:"canvas"},perform:(e,t,n,r)=>({appState:{...t,...sd({viewportX:t.width/2+t.offsetLeft,viewportY:t.height/2+t.offsetTop,nextZoom:zo(t.zoom.value+yU)},t),userToFollow:null},captureUpdate:le.EVENTUALLY}),PanelComponent:({updateData:e,appState:t})=>m.jsx(Ct,{type:"button",className:"zoom-in-button zoom-button",icon:rC,title:`${D("buttons.zoomIn")} — ${pe("CtrlOrCmd++")}`,"aria-label":D("buttons.zoomIn"),disabled:t.zoom.value>=hv,onClick:()=>{e(null)}}),keyTest:e=>(e.code===kt.EQUAL||e.code===kt.NUM_ADD)&&(e[Z.CTRL_OR_CMD]||e.shiftKey)}),L_=Te({name:"zoomOut",label:"buttons.zoomOut",icon:iC,viewMode:!0,trackEvent:{category:"canvas"},perform:(e,t,n,r)=>({appState:{...t,...sd({viewportX:t.width/2+t.offsetLeft,viewportY:t.height/2+t.offsetTop,nextZoom:zo(t.zoom.value-yU)},t),userToFollow:null},captureUpdate:le.EVENTUALLY}),PanelComponent:({updateData:e,appState:t})=>m.jsx(Ct,{type:"button",className:"zoom-out-button zoom-button",icon:iC,title:`${D("buttons.zoomOut")} — ${pe("CtrlOrCmd+-")}`,"aria-label":D("buttons.zoomOut"),disabled:t.zoom.value<=uv,onClick:()=>{e(null)}}),keyTest:e=>(e.code===kt.MINUS||e.code===kt.NUM_SUBTRACT)&&(e[Z.CTRL_OR_CMD]||e.shiftKey)}),R_=Te({name:"resetZoom",label:"buttons.resetZoom",icon:kG,viewMode:!0,trackEvent:{category:"canvas"},perform:(e,t,n,r)=>({appState:{...t,...sd({viewportX:t.width/2+t.offsetLeft,viewportY:t.height/2+t.offsetTop,nextZoom:zo(1)},t),userToFollow:null},captureUpdate:le.EVENTUALLY}),PanelComponent:({updateData:e,appState:t})=>m.jsx(Dd,{label:D("buttons.resetZoom"),style:{height:"100%"},children:m.jsxs(Ct,{type:"button",className:"reset-zoom-button zoom-button",title:D("buttons.resetZoom"),"aria-label":D("buttons.resetZoom"),onClick:()=>{e(null)},children:[(t.zoom.value*100).toFixed(0),"%"]})}),keyTest:e=>(e.code===kt.ZERO||e.code===kt.NUM_ZERO)&&(e[Z.CTRL_OR_CMD]||e.shiftKey)}),xde=(e,t,n=1)=>{let[r,i,a,s]=e,o=a-r,c=t.width/o,d=s-i,l=t.height/d,h=Math.min(c,l)*vt(n,.1,1);return Math.min(h,1)},tP=({bounds:e,appState:t,canvasOffsets:n,fitToViewport:r=!1,viewportZoomFactor:i=1,minZoom:a=-1/0,maxZoom:s=1/0})=>{i=vt(i,uv,hv);let[o,c,d,l]=e,h=(o+d)/2,f=(c+l)/2,g=(n==null?void 0:n.left)??0,U=(n==null?void 0:n.top)??0,y=(n==null?void 0:n.right)??0,v=(n==null?void 0:n.bottom)??0,x=t.width-g-y,w=t.height-U-v,C;if(r){let M=d-o,T=l-c;C=Math.min(x/M,w/T)*i}else C=xde(e,{width:x,height:w},i);let S=zo(vt(gY(C,yU,"floor"),a,s)),k=VA({scenePoint:{x:h,y:f},viewportDimensions:{width:t.width,height:t.height},offsets:n,zoom:{value:S}});return{appState:{...t,scrollX:k.scrollX,scrollY:k.scrollY,zoom:{value:S}},captureUpdate:le.EVENTUALLY}},a6=({canvasOffsets:e,targetElements:t,appState:n,fitToViewport:r,viewportZoomFactor:i,minZoom:a,maxZoom:s})=>{let o=Dt(Vt(t));return tP({canvasOffsets:e,bounds:o,appState:n,fitToViewport:r,viewportZoomFactor:i,minZoom:a,maxZoom:s})};Te({name:"zoomToFitSelectionInViewport",label:"labels.zoomToFitViewport",icon:Tv,trackEvent:{category:"canvas"},perform:(e,t,n,r)=>{let i=r.scene.getSelectedElements(t);return a6({targetElements:i.length?i:e,appState:{...t,userToFollow:null},fitToViewport:!1,canvasOffsets:r.getEditorUIOffsets()})},keyTest:e=>e.code===kt.TWO&&e.shiftKey&&!e.altKey&&!e[Z.CTRL_OR_CMD]});Te({name:"zoomToFitSelection",label:"helpDialog.zoomToSelection",icon:Tv,trackEvent:{category:"canvas"},perform:(e,t,n,r)=>{let i=r.scene.getSelectedElements(t);return a6({targetElements:i.length?i:e,appState:{...t,userToFollow:null},fitToViewport:!0,canvasOffsets:r.getEditorUIOffsets()})},keyTest:e=>e.code===kt.THREE&&e.shiftKey&&!e.altKey&&!e[Z.CTRL_OR_CMD]});Te({name:"zoomToFit",label:"helpDialog.zoomToFit",icon:Tv,viewMode:!0,trackEvent:{category:"canvas"},perform:(e,t,n,r)=>a6({targetElements:e,appState:{...t,userToFollow:null},fitToViewport:!1,canvasOffsets:r.getEditorUIOffsets()}),keyTest:e=>e.code===kt.ONE&&e.shiftKey&&!e.altKey&&!e[Z.CTRL_OR_CMD]});var P2=Te({name:"toggleTheme",label:(e,t)=>t.theme===wt.DARK?"buttons.lightMode":"buttons.darkMode",keywords:["toggle","dark","light","mode","theme"],icon:e=>e.theme===wt.LIGHT?k3:T3,viewMode:!0,trackEvent:{category:"canvas"},perform:(e,t,n)=>({appState:{...t,theme:n||(t.theme===wt.LIGHT?wt.DARK:wt.LIGHT)},captureUpdate:le.EVENTUALLY}),keyTest:e=>e.altKey&&e.shiftKey&&e.code===kt.D,predicate:(e,t,n,r)=>!!r.props.UIOptions.canvasActions.toggleTheme});Te({name:"toggleEraserTool",label:"toolBar.eraser",trackEvent:{category:"toolbar"},perform:(e,t)=>{let n;return Is(t)?n=Pn(t,{...t.activeTool.lastActiveTool||{type:"selection"},lastActiveToolBeforeEraser:null}):n=Pn(t,{type:"eraser",lastActiveToolBeforeEraser:t.activeTool}),{appState:{...t,selectedElementIds:{},selectedGroupIds:{},activeEmbeddable:null,activeTool:n},captureUpdate:le.IMMEDIATELY}},keyTest:e=>e.key===Z.E});var wde=Te({name:"toggleHandTool",label:"toolBar.hand",paletteName:"Toggle hand tool",trackEvent:{category:"toolbar"},icon:JI,viewMode:!1,perform:(e,t,n,r)=>{let i;return ch(t)?i=Pn(t,{...t.activeTool.lastActiveTool||{type:"selection"},lastActiveToolBeforeEraser:null}):(i=Pn(t,{type:"hand",lastActiveToolBeforeEraser:t.activeTool}),$t(r.interactiveCanvas,Ot.GRAB)),{appState:{...t,selectedElementIds:{},selectedGroupIds:{},activeEmbeddable:null,activeTool:i},captureUpdate:le.IMMEDIATELY}},keyTest:e=>!e.altKey&&!e[Z.CTRL_OR_CMD]&&e.key===Z.H}),Oa=Te({name:"finalize",label:"",trackEvent:!1,perform:(e,t,n,r)=>{var f;let{interactiveCanvas:i,focusContainer:a,scene:s}=r,o=s.getNonDeletedElementsMap();if(t.editingLinearElement){let{elementId:g,startBindingElement:U,endBindingElement:y}=t.editingLinearElement,v=Re.getElement(g,o);if(v)return Ns(v)&&AU(v,U,y,o,s),{elements:v.points.length<2||Ad(v)?e.filter(x=>x.id!==v.id):void 0,appState:{...t,cursorButton:"up",editingLinearElement:null},captureUpdate:le.IMMEDIATELY}}let c=e,d=t.pendingImageElementId&&s.getElement(t.pendingImageElementId);d&&me(d,{isDeleted:!0},!1),window.document.activeElement instanceof HTMLElement&&a();let l=t.multiElement?t.multiElement:((f=t.newElement)==null?void 0:f.type)==="freedraw"?t.newElement:null;if(l){if(l.type!=="freedraw"&&t.lastPointerDownWith!=="touch"){let{points:U,lastCommittedPoint:y}=l;(!y||U[U.length-1]!==y)&&me(l,{points:l.points.slice(0,-1)})}Ad(l)&&(c=c.filter(U=>U.id!==l.id));let g=qo(l.points,t.zoom.value);if((l.type==="line"||l.type==="freedraw")&&g){let U=l.points,y=U[0];me(l,{points:U.map((v,x)=>x===U.length-1?A(y[0],y[1]):v)})}if(Ns(l)&&!g&&l.points.length>1){let[U,y]=Re.getPointAtIndexGlobalCoordinates(l,-1,nt(e));N3(l,t,{x:U,y},o,e)}}(!t.activeTool.locked&&t.activeTool.type!=="freedraw"||!l)&&$a(i);let h;return t.activeTool.type==="eraser"?h=Pn(t,{...t.activeTool.lastActiveTool||{type:"selection"},lastActiveToolBeforeEraser:null}):h=Pn(t,{type:"selection"}),{elements:c,appState:{...t,cursorButton:"up",activeTool:(t.activeTool.locked||t.activeTool.type==="freedraw")&&l?t.activeTool:h,activeEmbeddable:null,newElement:null,selectionElement:null,multiElement:null,editingTextElement:null,startBoundElement:null,suggestedBindings:[],selectedElementIds:l&&!t.activeTool.locked&&t.activeTool.type!=="freedraw"?{...t.selectedElementIds,[l.id]:!0}:t.selectedElementIds,selectedLinearElement:l&&st(l)?new Re(l):t.selectedLinearElement,pendingImageElementId:null},captureUpdate:le.IMMEDIATELY}},keyTest:(e,t)=>e.key===Z.ESCAPE&&(t.editingLinearElement!==null||!t.newElement&&t.multiElement===null)||(e.key===Z.ESCAPE||e.key===Z.ENTER)&&t.multiElement!==null,PanelComponent:({appState:e,updateData:t,data:n})=>m.jsx(Ct,{type:"button",icon:NG,title:D("buttons.done"),"aria-label":D("buttons.done"),onClick:t,visible:e.multiElement!=null,size:(n==null?void 0:n.size)||"medium",style:{pointerEvents:"all"}})}),Ede=e=>{let{id:t}=ao(),[n,r]=I.useState(e.value),i=s=>{e.ignoreFocus||NY(s.target);let o=s.target.value;o!==e.value&&e.onChange(o)},a=s=>{if(s.key===Z.ENTER){if(s.preventDefault(),s.nativeEvent.isComposing||s.keyCode===229)return;s.currentTarget.blur()}};return m.jsxs("div",{className:"ProjectName",children:[m.jsx("label",{className:"ProjectName-label",htmlFor:"filename",children:`${e.label}:`}),m.jsx("input",{type:"text",className:"TextInput",onBlur:i,onKeyDown:a,id:`${t}-filename`,value:n,onChange:s=>r(s.target.value)})]})},Cde=e=>{let t=e.title||(e.value===wt.DARK?D("buttons.lightMode"):D("buttons.darkMode"));return m.jsx(Ct,{type:"icon",icon:e.value===wt.LIGHT?D_.MOON:D_.SUN,title:t,"aria-label":t,onClick:()=>e.onChange(e.value===wt.DARK?wt.LIGHT:wt.DARK),"data-testid":"toggle-dark-mode"})},D_={SUN:m.jsx("svg",{width:"512",height:"512",className:"rtl-mirror",viewBox:"0 0 512 512",children:m.jsx("path",{fill:"currentColor",d:"M256 160c-52.9 0-96 43.1-96 96s43.1 96 96 96 96-43.1 96-96-43.1-96-96-96zm246.4 80.5l-94.7-47.3 33.5-100.4c4.5-13.6-8.4-26.5-21.9-21.9l-100.4 33.5-47.4-94.8c-6.4-12.8-24.6-12.8-31 0l-47.3 94.7L92.7 70.8c-13.6-4.5-26.5 8.4-21.9 21.9l33.5 100.4-94.7 47.4c-12.8 6.4-12.8 24.6 0 31l94.7 47.3-33.5 100.5c-4.5 13.6 8.4 26.5 21.9 21.9l100.4-33.5 47.3 94.7c6.4 12.8 24.6 12.8 31 0l47.3-94.7 100.4 33.5c13.6 4.5 26.5-8.4 21.9-21.9l-33.5-100.4 94.7-47.3c13-6.5 13-24.7.2-31.1zm-155.9 106c-49.9 49.9-131.1 49.9-181 0-49.9-49.9-49.9-131.1 0-181 49.9-49.9 131.1-49.9 181 0 49.9 49.9 49.9 131.1 0 181z"})}),MOON:m.jsx("svg",{width:"512",height:"512",className:"rtl-mirror",viewBox:"0 0 512 512",children:m.jsx("path",{fill:"currentColor",d:"M283.211 512c78.962 0 151.079-35.925 198.857-94.792 7.068-8.708-.639-21.43-11.562-19.35-124.203 23.654-238.262-71.576-238.262-196.954 0-72.222 38.662-138.635 101.498-174.394 9.686-5.512 7.25-20.197-3.756-22.23A258.156 258.156 0 0 0 283.211 0c-141.309 0-256 114.511-256 256 0 141.309 114.511 256 256 256z"})})},s6=(e,{selectedElementIds:t},n)=>{e=Vt(e);let r=n&&Vn(e,{selectedElementIds:t}),i=null,a=r?gt(e,{selectedElementIds:t},{includeBoundTextElement:!0}):e;return r&&(a.length===1&&tt(a[0])?(i=a[0],a=l7(e,i)):a.length>1&&(a=gt(e,{selectedElementIds:t},{includeBoundTextElement:!0,includeElementsInFrames:!0}))),{exportingFrame:i,exportedElements:Ho(a)}},o6=async(e,t,n,r,{exportBackground:i,exportPadding:a=Oh,viewBackgroundColor:s,name:o=n.name||xI,fileHandle:c=null,exportingFrame:d=null})=>{if(t.length===0)throw new Error(D("alerts.cannotExportEmptyCanvas"));if(e==="svg"||e==="clipboard-svg"){let h=Yv(t,{exportBackground:i,exportWithDarkMode:n.exportWithDarkMode,viewBackgroundColor:s,exportPadding:a,exportScale:n.exportScale,exportEmbedScene:n.exportEmbedScene&&e==="svg"},r,{exportingFrame:d});if(e==="svg")return w2(h.then(f=>new Blob([f.outerHTML],{type:We.svg})),{description:"Export to SVG",name:o,extension:n.exportEmbedScene?"excalidraw.svg":"svg",mimeTypes:[lh.svg],fileHandle:c});if(e==="clipboard-svg"){let f=await h.then(g=>g.outerHTML);try{await K1(f)}catch{throw new Error(D("errors.copyToSystemClipboardFailed"))}return}}let l=LL(t,n,r,{exportBackground:i,viewBackgroundColor:s,exportPadding:a,exportingFrame:d});if(e==="png"){let h=v1(l);return n.exportEmbedScene&&(h=h.then(f=>ye(async()=>{const{encodePngMetadata:g}=await Promise.resolve().then(()=>U$);return{encodePngMetadata:g}},void 0,import.meta.url).then(({encodePngMetadata:g})=>g({blob:f,metadata:q1(t,n,r)})))),w2(h,{description:"Export to PNG",name:o,extension:n.exportEmbedScene?"excalidraw.png":"png",mimeTypes:[lh.png],fileHandle:c})}else if(e==="clipboard")try{let h=v1(l);await Xre(h)}catch(h){throw console.warn(h),h.name==="CANVAS_POSSIBLY_TOO_BIG"?new Error(D("canvasError.canvasTooBig")):a1&&h.name==="TypeError"?new Error(`${D("alerts.couldNotCopyToClipboard")}
149
-
150
- ${D("hints.firefox_clipboard_write")}`):new Error(D("alerts.couldNotCopyToClipboard"))}else throw new Error("Unsupported export type")},Sde=async(e,t,n,r)=>{let{exportBackground:i,viewBackgroundColor:a,fileHandle:s}=t,o=sR(s);if(!s||!Sie(o))throw new Error("fileHandle should exist and should be of type svg or png when resaving");t={...t,exportEmbedScene:!0};let{exportedElements:c,exportingFrame:d}=s6(e,t,!1);return await o6(o,c,t,n,{exportBackground:i,viewBackgroundColor:a,name:r,fileHandle:s,exportingFrame:d}),{fileHandle:s}},X7=({children:e,checked:t,onChange:n,className:r})=>m.jsxs("div",{className:Fe("Checkbox",r,{"is-checked":t}),onClick:i=>{n(!t,i),i.currentTarget.querySelector(".Checkbox-box").focus()},children:[m.jsx("button",{type:"button",className:"Checkbox-box",role:"checkbox","aria-checked":t,children:LG}),m.jsx("div",{className:"Checkbox-label",children:e})]}),_de=Te({name:"changeProjectName",label:"labels.fileTitle",trackEvent:!1,perform:(e,t,n)=>({appState:{...t,name:n},captureUpdate:le.EVENTUALLY}),PanelComponent:({appState:e,updateData:t,appProps:n,data:r,app:i})=>m.jsx(Ede,{label:D("labels.fileTitle"),value:i.getName(),onChange:a=>t(a),ignoreFocus:(r==null?void 0:r.ignoreFocus)??!1})}),kde=Te({name:"changeExportScale",label:"imageExportDialog.scale",trackEvent:{category:"export",action:"scale"},perform:(e,t,n)=>({appState:{...t,exportScale:n},captureUpdate:le.EVENTUALLY}),PanelComponent:({elements:e,appState:t,updateData:n})=>{let r=Vt(e),i=Vn(r,t)?gt(r,t):r;return m.jsx(m.Fragment,{children:pv.map(a=>{let[s,o]=cre(i,Oh,a),c=`${D("imageExportDialog.label.scale")} ${a}x (${s}x${o})`;return m.jsx(Ct,{size:"small",type:"radio",icon:`${a}x`,name:"export-canvas-scale",title:c,"aria-label":c,id:"export-canvas-scale",checked:a===t.exportScale,onChange:()=>n(a)},a)})})}}),Tde=Te({name:"changeExportBackground",label:"imageExportDialog.label.withBackground",trackEvent:{category:"export",action:"toggleBackground"},perform:(e,t,n)=>({appState:{...t,exportBackground:n},captureUpdate:le.EVENTUALLY}),PanelComponent:({appState:e,updateData:t})=>m.jsx(X7,{checked:e.exportBackground,onChange:n=>t(n),children:D("imageExportDialog.label.withBackground")})}),nP=Te({name:"changeExportEmbedScene",label:"imageExportDialog.tooltip.embedScene",trackEvent:{category:"export",action:"embedScene"},perform:(e,t,n)=>({appState:{...t,exportEmbedScene:n},captureUpdate:le.EVENTUALLY}),PanelComponent:({appState:e,updateData:t})=>m.jsxs(X7,{checked:e.exportEmbedScene,onChange:n=>t(n),children:[D("imageExportDialog.label.embedScene"),m.jsx(Dd,{label:D("imageExportDialog.tooltip.embedScene"),long:!0,children:m.jsx("div",{className:"excalidraw-tooltip-icon",children:OG})})]})}),j_=Te({name:"saveToActiveFile",label:"buttons.save",icon:SU,trackEvent:{category:"export"},predicate:(e,t,n,r)=>!!r.props.UIOptions.canvasActions.saveToActiveFile&&!!t.fileHandle&&!t.viewModeEnabled,perform:async(e,t,n,r)=>{let i=!!t.fileHandle;try{let{fileHandle:a}=g7(t.fileHandle)?await Sde(e,t,r.files,r.getName()):await UL(e,t,r.files,r.getName());return{captureUpdate:le.EVENTUALLY,appState:{...t,fileHandle:a,toast:i?{message:a!=null&&a.name?D("toast.fileSavedToFilename").replace("{filename}",`"${a.name}"`):D("toast.fileSaved")}:null}}}catch(a){return(a==null?void 0:a.name)!=="AbortError"?console.error(a):console.warn(a),{captureUpdate:le.EVENTUALLY}}},keyTest:e=>e.key===Z.S&&e[Z.CTRL_OR_CMD]&&!e.shiftKey}),rP=Te({name:"saveFileToDisk",label:"exportDialog.disk_title",icon:SU,viewMode:!0,trackEvent:{category:"export"},perform:async(e,t,n,r)=>{try{let{fileHandle:i}=await UL(e,{...t,fileHandle:null},r.files,r.getName());return{captureUpdate:le.EVENTUALLY,appState:{...t,openDialog:null,fileHandle:i,toast:{message:D("toast.fileSaved")}}}}catch(i){return(i==null?void 0:i.name)!=="AbortError"?console.error(i):console.warn(i),{captureUpdate:le.EVENTUALLY}}},keyTest:e=>e.key===Z.S&&e.shiftKey&&e[Z.CTRL_OR_CMD],PanelComponent:({updateData:e})=>m.jsx(Ct,{type:"button",icon:DG,title:D("buttons.saveAs"),"aria-label":D("buttons.saveAs"),showAriaLabel:Yn().editor.isMobile,hidden:!Bd,onClick:()=>e(null),"data-testid":"save-as-button"})}),b8=Te({name:"loadScene",label:"buttons.load",trackEvent:{category:"export"},predicate:(e,t,n,r)=>!!r.props.UIOptions.canvasActions.loadScene&&!t.viewModeEnabled,perform:async(e,t,n,r)=>{try{let{elements:i,appState:a,files:s}=await Jne(t,e);return{elements:i,appState:a,files:s,captureUpdate:le.IMMEDIATELY}}catch(i){return(i==null?void 0:i.name)==="AbortError"?(console.warn(i),!1):{elements:e,appState:{...t,errorMessage:i.message},files:r.files,captureUpdate:le.EVENTUALLY}}},keyTest:e=>e[Z.CTRL_OR_CMD]&&e.key===Z.O}),Mde=Te({name:"exportWithDarkMode",label:"imageExportDialog.label.darkMode",trackEvent:{category:"export",action:"toggleTheme"},perform:(e,t,n)=>({appState:{...t,exportWithDarkMode:n},captureUpdate:le.EVENTUALLY}),PanelComponent:({appState:e,updateData:t})=>m.jsx("div",{style:{display:"flex",justifyContent:"flex-end",marginTop:"-45px",marginBottom:"10px"},children:m.jsx(Cde,{value:e.exportWithDarkMode?wt.DARK:wt.LIGHT,onChange:n=>{t(n===wt.DARK)},title:D("imageExportDialog.label.darkMode")})})}),iP="{}",Ide=Te({name:"copyStyles",label:"labels.copyStyles",icon:aA,trackEvent:{category:"element"},perform:(e,t,n,r)=>{let i=[],a=e.find(s=>t.selectedElementIds[s.id]);if(i.push(a),a&&ma(a)){let s=pt(a,r.scene.getNonDeletedElementsMap());i.push(s)}return a&&(iP=JSON.stringify(i)),{appState:{...t,toast:{message:D("toast.copyStyles")}},captureUpdate:le.EVENTUALLY}},keyTest:e=>e[Z.CTRL_OR_CMD]&&e.altKey&&e.code===kt.C}),Ade=Te({name:"pasteStyles",label:"labels.pasteStyles",icon:aA,trackEvent:{category:"element"},perform:(e,t,n,r)=>{let i=JSON.parse(iP),a=i[0],s=i[1];if(!OI(a))return{elements:e,captureUpdate:le.EVENTUALLY};let o=gt(e,t,{includeBoundTextElement:!0}),c=o.map(d=>d.id);return{elements:e.map(d=>{if(c.includes(d.id)){let l=a;if(Le(d)&&d.containerId&&(l=s),!l)return d;let h=ct(d,{backgroundColor:l==null?void 0:l.backgroundColor,strokeWidth:l==null?void 0:l.strokeWidth,strokeColor:l==null?void 0:l.strokeColor,strokeStyle:l==null?void 0:l.strokeStyle,fillStyle:l==null?void 0:l.fillStyle,opacity:l==null?void 0:l.opacity,roughness:l==null?void 0:l.roughness,roundness:l.roundness?GY(l.roundness.type,d)?l.roundness:qY(d):null});if(Le(h)){let f=l.fontSize||ol,g=l.fontFamily||xc;h=ct(h,{fontSize:f,fontFamily:g,textAlign:l.textAlign||B1,lineHeight:l.lineHeight||Td(g)});let U=null;h.containerId&&(U=o.find(y=>Le(h)&&y.id===h.containerId)||null),Yr(h,U,r.scene.getNonDeletedElementsMap())}return h.type==="arrow"&&Ut(l)&&(h=ct(h,{startArrowhead:l.startArrowhead,endArrowhead:l.endArrowhead})),tt(d)&&(h=ct(h,{roundness:null,backgroundColor:"transparent"})),h}return d}),captureUpdate:le.IMMEDIATELY}},keyTest:e=>e[Z.CTRL_OR_CMD]&&e.altKey&&e.code===kt.V});Te({name:"toggleCanvasMenu",label:"buttons.menu",trackEvent:{category:"menu"},perform:(e,t)=>({appState:{...t,openMenu:t.openMenu==="canvas"?null:"canvas"},captureUpdate:le.EVENTUALLY}),PanelComponent:({appState:e,updateData:t})=>m.jsx(Ct,{type:"button",icon:XI,"aria-label":D("buttons.menu"),onClick:t,selected:e.openMenu==="canvas"})});Te({name:"toggleEditMenu",label:"buttons.edit",trackEvent:{category:"menu"},perform:(e,t)=>({appState:{...t,openMenu:t.openMenu==="shape"?null:"shape"},captureUpdate:le.EVENTUALLY}),PanelComponent:({elements:e,appState:t,updateData:n})=>m.jsx(Ct,{visible:m7(t,Vt(e)),type:"button",icon:jG,"aria-label":D("buttons.edit"),onClick:n,selected:t.openMenu==="shape"})});var V7=Te({name:"toggleShortcuts",label:"welcomeScreen.defaults.helpHint",icon:MG,viewMode:!0,trackEvent:{category:"menu",action:"toggleHelpDialog"},perform:(e,t,n,{focusContainer:r})=>{var i,a;return((i=t.openDialog)==null?void 0:i.name)==="help"&&r(),{appState:{...t,openDialog:((a=t.openDialog)==null?void 0:a.name)==="help"?null:{name:"help"}},captureUpdate:le.EVENTUALLY}},keyTest:e=>e.key===Z.QUESTION_MARK}),Lde=e=>{if(e.length>=2){let t=e[0].groupIds;for(let n of t)if(e.reduce((r,i)=>r&&m1(i,n),!0))return!0}return!1},P_=(e,t,n)=>{let r=n.scene.getSelectedElements({selectedElementIds:t.selectedElementIds,includeBoundTextElement:!0});return r.length>=2&&!Lde(r)&&!GL(r)},Rde=Te({name:"group",label:"labels.group",icon:e=>m.jsx(bC,{theme:e.theme}),trackEvent:{category:"element"},perform:(e,t,n,r)=>{let i=o7(r.scene.getSelectedElements({selectedElementIds:t.selectedElementIds,includeBoundTextElement:!0}));if(i.length<2)return{appState:t,elements:e,captureUpdate:le.EVENTUALLY};let a=hd(t);if(a.length===1){let y=a[0],v=new Set(rn(e,y).map(w=>w.id)),x=new Set(i.map(w=>w.id));if(new Set([...Array.from(v),...Array.from(x)]).size===v.size)return{appState:t,elements:e,captureUpdate:le.EVENTUALLY}}let s=[...e];new Set(i.map(y=>y.frameId)).size>1&&Jre(i).forEach((y,v)=>{HU(y,r.scene.getNonDeletedElementsMap())});let o=ga(),c=nt(i);s=s.map(y=>c.get(y.id)?ct(y,{groupIds:sne(y.groupIds,o,t.editingGroupId)}):y);let d=rn(s,o),l=d[d.length-1],h=s.lastIndexOf(l),f=s.slice(h+1),g=s.slice(0,h).filter(y=>!m1(y,o)),U=Zs([...g,...d,...f],nt(d));return{appState:{...t,...GA(o,{...t,selectedGroupIds:{}},Vt(s))},elements:U,captureUpdate:le.IMMEDIATELY}},predicate:(e,t,n,r)=>P_(e,t,r),keyTest:e=>!e.shiftKey&&e[Z.CTRL_OR_CMD]&&e.key===Z.G,PanelComponent:({elements:e,appState:t,updateData:n,app:r})=>m.jsx(Ct,{hidden:!P_(e,t,r),type:"button",icon:m.jsx(bC,{theme:t.theme}),onClick:()=>n(null),title:`${D("labels.group")} — ${pe("CtrlOrCmd+G")}`,"aria-label":D("labels.group"),visible:Vn(Vt(e),t)})}),Dde=Te({name:"ungroup",label:"labels.ungroup",icon:e=>m.jsx(yC,{theme:e.theme}),trackEvent:{category:"element"},perform:(e,t,n,r)=>{let i=hd(t),a=nt(e);if(i.length===0)return{appState:t,elements:e,captureUpdate:le.EVENTUALLY};let s=[...e],o=[];s=s.map(h=>{an(h)&&o.push(h.id);let f=one(h.groupIds,t.selectedGroupIds);return f.length===h.groupIds.length?h:ct(h,{groupIds:f})});let c=Wr(t,Vt(s),t,null),d=r.scene.getSelectedElements(t),l=new Set(d.filter(h=>h.frameId).map(h=>h.frameId));return s7(e).filter(h=>l.has(h.id)).forEach(h=>{h&&(s=VL(s,Sg(s,h,t,a),h,r))}),c.selectedElementIds=Object.entries(c.selectedElementIds).reduce((h,[f,g])=>(g&&!o.includes(f)&&(h[f]=!0),h),{}),{appState:{...t,...c},elements:s,captureUpdate:le.IMMEDIATELY}},keyTest:e=>e.shiftKey&&e[Z.CTRL_OR_CMD]&&e.key===Z.G.toUpperCase(),predicate:(e,t)=>hd(t).length>0,PanelComponent:({elements:e,appState:t,updateData:n})=>m.jsx(Ct,{type:"button",hidden:hd(t).length===0,icon:m.jsx(yC,{theme:t.theme}),onClick:()=>n(null),title:`${D("labels.ungroup")} — ${pe("CtrlOrCmd+Shift+G")}`,"aria-label":D("labels.ungroup"),visible:Vn(Vt(e),t)})}),aP=(e,t,n,r,i,a,s)=>{e.beginPath(),e.moveTo(t+a,n),e.lineTo(t+r-a,n),e.quadraticCurveTo(t+r,n,t+r,n+a),e.lineTo(t+r,n+i-a),e.quadraticCurveTo(t+r,n+i,t+r-a,n+i),e.lineTo(t+a,n+i),e.quadraticCurveTo(t,n+i,t,n+i-a),e.lineTo(t,n+a),e.quadraticCurveTo(t,n,t+a,n),e.closePath(),e.fill(),s&&(e.strokeStyle=s),e.stroke()};function jde(e){let t=0;if(e.length===0)return t;for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);t=(t<<5)-t+r}return t}var l6=(e,t)=>`hsl(${Math.abs(jde((t==null?void 0:t.id)||e))%37*10}, 100%, 83%)`,Pde=e=>{var n;let t=(n=e==null?void 0:e.trim())==null?void 0:n.codePointAt(0);return(t?String.fromCodePoint(t):"?").toUpperCase()},Nde=({context:e,renderConfig:t,appState:n,normalizedWidth:r,normalizedHeight:i})=>{for(let[a,s]of t.remotePointerViewportCoords){let{x:o,y:c}=s,d=n.collaborators.get(a);o-=n.offsetLeft,c-=n.offsetTop;let l=11,h=14,f=o<0||o>r-l||c<0||c>i-h;o=Math.max(o,0),o=Math.min(o,r-l),c=Math.max(c,0),c=Math.min(c,i-h);let g=l6(a,d);e.save(),e.strokeStyle=g,e.fillStyle=g;let U=t.remotePointerUserStates.get(a),y=f||U==="idle"||U==="away";y&&(e.globalAlpha=.3),t.remotePointerButton.get(a)==="down"&&(e.beginPath(),e.arc(o,c,15,0,2*Math.PI,!1),e.lineWidth=3,e.strokeStyle="#ffffff88",e.stroke(),e.closePath(),e.beginPath(),e.arc(o,c,15,0,2*Math.PI,!1),e.lineWidth=1,e.strokeStyle=g,e.stroke(),e.closePath());let v=n.theme===wt.DARK?"#2f6330":ZV,x=d==null?void 0:d.isSpeaking;x&&(e.fillStyle=v,e.strokeStyle=v,e.lineWidth=10,e.lineJoin="round",e.beginPath(),e.moveTo(o,c),e.lineTo(o+0,c+14),e.lineTo(o+4,c+9),e.lineTo(o+11,c+8),e.closePath(),e.stroke(),e.fill()),e.fillStyle=Mm,e.strokeStyle=Mm,e.lineWidth=6,e.lineJoin="round",e.beginPath(),e.moveTo(o,c),e.lineTo(o+0,c+14),e.lineTo(o+4,c+9),e.lineTo(o+11,c+8),e.closePath(),e.stroke(),e.fill(),e.fillStyle=g,e.strokeStyle=g,e.lineWidth=2,e.lineJoin="round",e.beginPath(),y?(e.moveTo(o-1,c-1),e.lineTo(o-1,c+15),e.lineTo(o+5,c+10),e.lineTo(o+12,c+9),e.closePath(),e.fill()):(e.moveTo(o,c),e.lineTo(o+0,c+14),e.lineTo(o+4,c+9),e.lineTo(o+11,c+8),e.closePath(),e.fill(),e.stroke());let w=t.remotePointerUsernames.get(a)||"";if(!f&&w){e.font="600 12px sans-serif";let C=(x?o+0:o)+l/2,S=(x?c+0:c)+h+2,k=5,M=3,T=e.measureText(w),R=T.actualBoundingBoxDescent+T.actualBoundingBoxAscent,j=Math.max(R,12),P=C-1,N=S-1,F=T.width+2+k*2+2,$=j+2+M*2+2;if(e.roundRect?(e.beginPath(),e.roundRect(P,N,F,$,8),e.fillStyle=g,e.fill(),e.strokeStyle=Mm,e.stroke(),x&&(e.beginPath(),e.roundRect(P-2,N-2,F+4,$+4,8),e.strokeStyle=v,e.stroke())):aP(e,P,N,F,$,8,Mm),e.fillStyle=qV,e.fillText(w,C+k+1,S+M+T.actualBoundingBoxAscent+Math.floor((j-R)/2)+2),x){e.fillStyle=v;let q=8,W=8,V=5;e.fillRect(P+F+W,N+($/2-q/2),2,q),e.fillRect(P+F+W+V,N+($/2-q*2/2),2,q*2),e.fillRect(P+F+W+V*2,N+($/2-q/2),2,q)}}e.restore(),e.closePath()}},N_=({color:e,onClick:t,name:n,src:r,className:i})=>{let a=Pde(n),[s,o]=I.useState(!1),c=!s&&r,d=c?void 0:{background:e};return m.jsx("div",{className:Fe("Avatar",i),style:d,onClick:t,children:c?m.jsx("img",{className:"Avatar-img",src:r,alt:a,referrerPolicy:"no-referrer",onError:()=>o(!0)}):a})};Te({name:"goToCollaborator",label:"Go to a collaborator",viewMode:!0,trackEvent:{category:"collab"},perform:(e,t,n)=>{var r;return!n.socketId||((r=t.userToFollow)==null?void 0:r.socketId)===n.socketId||n.isCurrentUser?{appState:{...t,userToFollow:null},captureUpdate:le.EVENTUALLY}:{appState:{...t,userToFollow:{socketId:n.socketId,username:n.username||""},openMenu:t.openMenu==="canvas"?null:t.openMenu},captureUpdate:le.EVENTUALLY}},PanelComponent:({updateData:e,data:t,appState:n})=>{let{socketId:r,collaborator:i,withName:a,isBeingFollowed:s}=t,o=l6(r,i),c=Fe({"is-followed":s,"is-current-user":i.isCurrentUser===!0,"is-speaking":i.isSpeaking,"is-in-call":i.isInCall,"is-muted":i.isMuted}),d=i.isInCall?i.isSpeaking?m.jsxs("div",{className:"UserList__collaborator-status-icon-speaking-indicator",title:D("userList.hint.isSpeaking"),children:[m.jsx("div",{}),m.jsx("div",{}),m.jsx("div",{})]}):i.isMuted?m.jsx("div",{className:"UserList__collaborator-status-icon-microphone-muted",title:D("userList.hint.micMuted"),children:jq}):m.jsx("div",{title:D("userList.hint.inCall"),children:Dq}):null;return a?m.jsxs("div",{className:`dropdown-menu-item dropdown-menu-item-base UserList__collaborator ${c}`,style:{"--avatar-size":"1.5rem"},onClick:()=>e(i),children:[m.jsx(N_,{color:o,onClick:()=>{},name:i.username||"",src:i.avatarUrl,className:c}),m.jsx("div",{className:"UserList__collaborator-name",children:i.username}),m.jsxs("div",{className:"UserList__collaborator-status-icons","aria-hidden":!0,children:[s&&m.jsx("div",{className:"UserList__collaborator-status-icon-is-followed",title:D("userList.hint.followStatus"),children:kv}),d]})]}):m.jsxs("div",{className:`UserList__collaborator UserList__collaborator--avatar-only ${c}`,children:[m.jsx(N_,{color:o,onClick:()=>{e(i)},name:i.username||"",src:i.avatarUrl,className:c}),d&&m.jsx("div",{className:"UserList__collaborator-status-icon",children:d})]})}});var Ode=Te({name:"addToLibrary",trackEvent:{category:"element"},perform:(e,t,n,r)=>{let i=r.scene.getSelectedElements({selectedElementIds:t.selectedElementIds,includeBoundTextElement:!0,includeElementsInFrames:!0});for(let a of vI)if(i.some(s=>s.type===a))return{captureUpdate:le.EVENTUALLY,appState:{...t,errorMessage:D(`errors.libraryElementTypeError.${a}`)}};return r.library.getLatestLibrary().then(a=>r.library.setLibrary([{id:ga(),status:"unpublished",elements:i.map(Hd),created:Date.now()},...a])).then(()=>({captureUpdate:le.EVENTUALLY,appState:{...t,toast:{message:D("toast.addedToLibrary")}}})).catch(a=>({captureUpdate:le.EVENTUALLY,appState:{...t,errorMessage:a.message}}))},label:"labels.addToLibrary"}),Fde=(e,t,n,r)=>{let i=jU(e,t),a=es(e);return i.flatMap(s=>{let o=$de(s,a,n);return s.map(c=>{let d=me(c,{x:c.x+o.x,y:c.y+o.y});return gi(c,r.getNonDeletedElementsMap(),{simultaneouslyUpdated:s}),d})})},$de=(e,t,{axis:n,position:r})=>{let i=es(e),[a,s]=n==="x"?["minX","maxX"]:["minY","maxY"],o={x:0,y:0};return r==="start"?{...o,[n]:t[a]-i[a]}:r==="end"?{...o,[n]:t[s]-i[s]}:{...o,[n]:(t[a]+t[s])/2-(i[a]+i[s])/2}},Fi=(e,t)=>{let n=t.scene.getSelectedElements(e);return n.length>1&&!n.some(r=>tt(r))},Xh=(e,t,n,r)=>{let i=n.scene.getSelectedElements(t),a=nt(e),s=Fde(i,a,r,n.scene),o=nt(s);return xh(e.map(c=>o.get(c.id)||c),t,n)};Te({name:"alignTop",label:"labels.alignTop",icon:hC,trackEvent:{category:"element"},predicate:(e,t,n,r)=>Fi(t,r),perform:(e,t,n,r)=>({appState:t,elements:Xh(e,t,r,{position:"start",axis:"y"}),captureUpdate:le.IMMEDIATELY}),keyTest:e=>e[Z.CTRL_OR_CMD]&&e.shiftKey&&e.key===Z.ARROW_UP,PanelComponent:({elements:e,appState:t,updateData:n,app:r})=>m.jsx(Ct,{hidden:!Fi(t,r),type:"button",icon:hC,onClick:()=>n(null),title:`${D("labels.alignTop")} — ${pe("CtrlOrCmd+Shift+Up")}`,"aria-label":D("labels.alignTop"),visible:Vn(Vt(e),t)})});Te({name:"alignBottom",label:"labels.alignBottom",icon:fC,trackEvent:{category:"element"},predicate:(e,t,n,r)=>Fi(t,r),perform:(e,t,n,r)=>({appState:t,elements:Xh(e,t,r,{position:"end",axis:"y"}),captureUpdate:le.IMMEDIATELY}),keyTest:e=>e[Z.CTRL_OR_CMD]&&e.shiftKey&&e.key===Z.ARROW_DOWN,PanelComponent:({elements:e,appState:t,updateData:n,app:r})=>m.jsx(Ct,{hidden:!Fi(t,r),type:"button",icon:fC,onClick:()=>n(null),title:`${D("labels.alignBottom")} — ${pe("CtrlOrCmd+Shift+Down")}`,"aria-label":D("labels.alignBottom"),visible:Vn(Vt(e),t)})});Te({name:"alignLeft",label:"labels.alignLeft",icon:pC,trackEvent:{category:"element"},predicate:(e,t,n,r)=>Fi(t,r),perform:(e,t,n,r)=>({appState:t,elements:Xh(e,t,r,{position:"start",axis:"x"}),captureUpdate:le.IMMEDIATELY}),keyTest:e=>e[Z.CTRL_OR_CMD]&&e.shiftKey&&e.key===Z.ARROW_LEFT,PanelComponent:({elements:e,appState:t,updateData:n,app:r})=>m.jsx(Ct,{hidden:!Fi(t,r),type:"button",icon:pC,onClick:()=>n(null),title:`${D("labels.alignLeft")} — ${pe("CtrlOrCmd+Shift+Left")}`,"aria-label":D("labels.alignLeft"),visible:Vn(Vt(e),t)})});Te({name:"alignRight",label:"labels.alignRight",icon:mC,trackEvent:{category:"element"},predicate:(e,t,n,r)=>Fi(t,r),perform:(e,t,n,r)=>({appState:t,elements:Xh(e,t,r,{position:"end",axis:"x"}),captureUpdate:le.IMMEDIATELY}),keyTest:e=>e[Z.CTRL_OR_CMD]&&e.shiftKey&&e.key===Z.ARROW_RIGHT,PanelComponent:({elements:e,appState:t,updateData:n,app:r})=>m.jsx(Ct,{hidden:!Fi(t,r),type:"button",icon:mC,onClick:()=>n(null),title:`${D("labels.alignRight")} — ${pe("CtrlOrCmd+Shift+Right")}`,"aria-label":D("labels.alignRight"),visible:Vn(Vt(e),t)})});Te({name:"alignVerticallyCentered",label:"labels.centerVertically",icon:gC,trackEvent:{category:"element"},predicate:(e,t,n,r)=>Fi(t,r),perform:(e,t,n,r)=>({appState:t,elements:Xh(e,t,r,{position:"center",axis:"y"}),captureUpdate:le.IMMEDIATELY}),PanelComponent:({elements:e,appState:t,updateData:n,app:r})=>m.jsx(Ct,{hidden:!Fi(t,r),type:"button",icon:gC,onClick:()=>n(null),title:D("labels.centerVertically"),"aria-label":D("labels.centerVertically"),visible:Vn(Vt(e),t)})});Te({name:"alignHorizontallyCentered",label:"labels.centerHorizontally",icon:UC,trackEvent:{category:"element"},predicate:(e,t,n,r)=>Fi(t,r),perform:(e,t,n,r)=>({appState:t,elements:Xh(e,t,r,{position:"center",axis:"x"}),captureUpdate:le.IMMEDIATELY}),PanelComponent:({elements:e,appState:t,updateData:n,app:r})=>m.jsx(Ct,{hidden:!Fi(t,r),type:"button",icon:UC,onClick:()=>n(null),title:D("labels.centerHorizontally"),"aria-label":D("labels.centerHorizontally"),visible:Vn(Vt(e),t)})});var Bde=(e,t,n)=>{let[r,i,a,s]=n.axis==="x"?["minX","midX","maxX","width"]:["minY","midY","maxY","height"],o=es(e),c=jU(e,t).map(f=>[f,es(f)]).sort((f,g)=>f[1][i]-g[1][i]),d=0;for(let f of c)d+=f[1][s];let l=(o[s]-d)/(c.length-1);if(l<0){let f=c.findIndex(v=>v[1][r]===o[r]),g=c.findIndex(v=>v[1][a]===o[a]),U=(c[g][1][i]-c[f][1][i])/(c.length-1),y=c[f][1][i];return c.flatMap(([v,x],w)=>{let C={x:0,y:0};return w!==f&&w!==g&&(y+=U,C[n.axis]=y-x[i]),v.map(S=>ct(S,{x:S.x+C.x,y:S.y+C.y}))})}let h=o[r];return c.flatMap(([f,g])=>{let U={x:0,y:0};return U[n.axis]=h-g[r],h+=l,h+=g[s],f.map(y=>ct(y,{x:y.x+U.x,y:y.y+U.y}))})},sP=(e,t)=>{let n=t.scene.getSelectedElements(e);return n.length>1&&!n.some(r=>tt(r))},oP=(e,t,n,r)=>{let i=n.scene.getSelectedElements(t),a=Bde(i,n.scene.getNonDeletedElementsMap(),r),s=nt(a);return xh(e.map(o=>s.get(o.id)||o),t,n)};Te({name:"distributeHorizontally",label:"labels.distributeHorizontally",trackEvent:{category:"element"},perform:(e,t,n,r)=>({appState:t,elements:oP(e,t,r,{axis:"x"}),captureUpdate:le.IMMEDIATELY}),keyTest:e=>!e[Z.CTRL_OR_CMD]&&e.altKey&&e.code===kt.H,PanelComponent:({elements:e,appState:t,updateData:n,app:r})=>m.jsx(Ct,{hidden:!sP(t,r),type:"button",icon:FG,onClick:()=>n(null),title:`${D("labels.distributeHorizontally")} — ${pe("Alt+H")}`,"aria-label":D("labels.distributeHorizontally"),visible:Vn(Vt(e),t)})});Te({name:"distributeVertically",label:"labels.distributeVertically",trackEvent:{category:"element"},perform:(e,t,n,r)=>({appState:t,elements:oP(e,t,r,{axis:"y"}),captureUpdate:le.IMMEDIATELY}),keyTest:e=>!e[Z.CTRL_OR_CMD]&&e.altKey&&e.code===kt.V,PanelComponent:({elements:e,appState:t,updateData:n,app:r})=>m.jsx(Ct,{hidden:!sP(t,r),type:"button",icon:$G,onClick:()=>n(null),title:`${D("labels.distributeVertically")} — ${pe("Alt+V")}`,"aria-label":D("labels.distributeVertically"),visible:Vn(Vt(e),t)})});var zde=Te({name:"flipHorizontal",label:"labels.flipHorizontal",icon:Fq,trackEvent:{category:"element"},perform:(e,t,n,r)=>({elements:xh(lP(e,r.scene.getNonDeletedElementsMap(),t,"horizontal",r),t,r),appState:t,captureUpdate:le.IMMEDIATELY}),keyTest:e=>e.shiftKey&&e.code===kt.H}),Hde=Te({name:"flipVertical",label:"labels.flipVertical",icon:Oq,trackEvent:{category:"element"},perform:(e,t,n,r)=>({elements:xh(lP(e,r.scene.getNonDeletedElementsMap(),t,"vertical",r),t,r),appState:t,captureUpdate:le.IMMEDIATELY}),keyTest:e=>e.shiftKey&&e.code===kt.V&&!e[Z.CTRL_OR_CMD]}),lP=(e,t,n,r,i)=>{let a=gt(Vt(e),n,{includeBoundTextElement:!0,includeElementsInFrames:!0}),s=Wde(a,t,n,r,i),o=nt(s);return e.map(c=>o.get(c.id)||c)},Wde=(e,t,n,r,i)=>{if(e.every(g=>Ut(g)&&(g.startBinding||g.endBinding)))return e.map(g=>{let U=g;return ct(U,{startArrowhead:U.endArrowhead,endArrowhead:U.startArrowhead})});let{midX:a,midY:s}=es(e);nR(e,t,"nw",i.scene,new Map(Array.from(t.values()).map(g=>[g.id,Hd(g)])),{flipByX:r==="horizontal",flipByY:r==="vertical",shouldResizeFromCenter:!0,shouldMaintainAspectRatio:!0}),g2(e.filter(st),t,i.scene.getNonDeletedElements(),i.scene,id(n),[],n.zoom);let{elbowArrows:o,otherElements:c}=e.reduce((g,U)=>Pe(U)?{...g,elbowArrows:g.elbowArrows.concat(U)}:{...g,otherElements:g.otherElements.concat(U)},{elbowArrows:[],otherElements:[]}),{midX:d,midY:l}=es(e),[h,f]=[a-d,s-l];return c.forEach(g=>me(g,{x:g.x+h,y:g.y+f})),o.forEach(g=>me(g,{x:g.x+h,y:g.y+f})),e},Rg=Te({name:"copy",label:"labels.copy",icon:_3,trackEvent:{category:"element"},perform:async(e,t,n,r)=>{let i=r.scene.getSelectedElements({selectedElementIds:t.selectedElementIds,includeBoundTextElement:!0,includeElementsInFrames:!0});try{await $re(i,r.files,n)}catch(a){return{captureUpdate:le.EVENTUALLY,appState:{...t,errorMessage:a.message}}}return{captureUpdate:le.EVENTUALLY}},keyTest:void 0}),O_=Te({name:"paste",label:"labels.paste",trackEvent:{category:"element"},perform:async(e,t,n,r)=>{let i;try{i=await Hre()}catch(a){return a.name==="AbortError"||a.name==="NotAllowedError"?!1:(console.error(`actionPaste ${a.name}: ${a.message}`),a1?{captureUpdate:le.EVENTUALLY,appState:{...t,errorMessage:D("hints.firefox_clipboard_write")}}:{captureUpdate:le.EVENTUALLY,appState:{...t,errorMessage:D("errors.asyncPasteFailedOnRead")}})}try{r.pasteFromClipboard(Ore({types:i}))}catch(a){return console.error(a),{captureUpdate:le.EVENTUALLY,appState:{...t,errorMessage:D("errors.asyncPasteFailedOnParse")}}}return{captureUpdate:le.EVENTUALLY}},keyTest:void 0}),F_=Te({name:"cut",label:"labels.cut",icon:Cq,trackEvent:{category:"element"},perform:(e,t,n,r)=>(Rg.perform(e,t,n,r),Rj.perform(e,t,null,r)),keyTest:e=>e[Z.CTRL_OR_CMD]&&e.key===Z.X}),$_=Te({name:"copyAsSvg",label:"labels.copyAsSvg",icon:$q,trackEvent:{category:"element"},perform:async(e,t,n,r)=>{if(!r.canvas)return{captureUpdate:le.EVENTUALLY};let{exportedElements:i,exportingFrame:a}=s6(e,t,!0);try{await o6("clipboard-svg",i,t,r.files,{...t,exportingFrame:a,name:r.getName()});let s=r.scene.getSelectedElements({selectedElementIds:t.selectedElementIds,includeBoundTextElement:!0,includeElementsInFrames:!0});return{appState:{toast:{message:D("toast.copyToClipboardAsSvg",{exportSelection:s.length?D("toast.selection"):D("toast.canvas"),exportColorScheme:t.exportWithDarkMode?D("buttons.darkMode"):D("buttons.lightMode")})}},captureUpdate:le.EVENTUALLY}}catch(s){return console.error(s),{appState:{errorMessage:s.message},captureUpdate:le.EVENTUALLY}}},predicate:e=>n7&&e.length>0,keywords:["svg","clipboard","copy"]}),B_=Te({name:"copyAsPng",label:"labels.copyAsPng",icon:Bq,trackEvent:{category:"element"},perform:async(e,t,n,r)=>{if(!r.canvas)return{captureUpdate:le.EVENTUALLY};let i=r.scene.getSelectedElements({selectedElementIds:t.selectedElementIds,includeBoundTextElement:!0,includeElementsInFrames:!0}),{exportedElements:a,exportingFrame:s}=s6(e,t,!0);try{return await o6("clipboard",a,t,r.files,{...t,exportingFrame:s,name:r.getName()}),{appState:{...t,toast:{message:D("toast.copyToClipboardAsPng",{exportSelection:i.length?D("toast.selection"):D("toast.canvas"),exportColorScheme:t.exportWithDarkMode?D("buttons.darkMode"):D("buttons.lightMode")})}},captureUpdate:le.EVENTUALLY}}catch(o){return console.error(o),{appState:{...t,errorMessage:o.message},captureUpdate:le.EVENTUALLY}}},predicate:e=>r7&&e.length>0,keyTest:e=>e.code===kt.C&&e.altKey&&e.shiftKey,keywords:["png","clipboard","copy"]}),z_=Te({name:"copyText",label:"labels.copyText",trackEvent:{category:"element"},perform:(e,t,n,r)=>{let i=r.scene.getSelectedElements({selectedElementIds:t.selectedElementIds,includeBoundTextElement:!0});try{K1(nL(i))}catch{throw new Error(D("errors.copyToSystemClipboardFailed"))}return{captureUpdate:le.EVENTUALLY}},predicate:(e,t,n,r)=>n7&&r.scene.getSelectedElements({selectedElementIds:t.selectedElementIds,includeBoundTextElement:!0}).some(Le),keywords:["text","clipboard","copy"]}),H_=Te({name:"gridMode",icon:Vq,keywords:["snap"],label:"labels.toggleGrid",viewMode:!0,trackEvent:{category:"canvas",predicate:e=>e.gridModeEnabled},perform(e,t){return{appState:{...t,gridModeEnabled:!this.checked(t),objectsSnapModeEnabled:!1},captureUpdate:le.EVENTUALLY}},checked:e=>e.gridModeEnabled,predicate:(e,t,n)=>n.gridModeEnabled===void 0,keyTest:e=>e[Z.CTRL_OR_CMD]&&e.code===kt.QUOTE}),y8=Te({name:"zenMode",label:"buttons.zenMode",icon:Hq,paletteName:"Toggle zen mode",viewMode:!0,trackEvent:{category:"canvas",predicate:e=>!e.zenModeEnabled},perform(e,t){return{appState:{...t,zenModeEnabled:!this.checked(t)},captureUpdate:le.EVENTUALLY}},checked:e=>e.zenModeEnabled,predicate:(e,t,n)=>typeof n.zenModeEnabled>"u",keyTest:e=>!e[Z.CTRL_OR_CMD]&&e.altKey&&e.code===kt.Z}),Xde=Te({name:"objectsSnapMode",label:"buttons.objectsSnapMode",icon:zq,viewMode:!1,trackEvent:{category:"canvas",predicate:e=>!e.objectsSnapModeEnabled},perform(e,t){return{appState:{...t,objectsSnapModeEnabled:!this.checked(t),gridModeEnabled:!1},captureUpdate:le.EVENTUALLY}},checked:e=>e.objectsSnapModeEnabled,predicate:(e,t,n)=>typeof n.objectsSnapModeEnabled>"u",keyTest:e=>!e[Z.CTRL_OR_CMD]&&e.altKey&&e.code===kt.S}),v8=Te({name:"stats",label:"stats.fullTitle",icon:Nq,paletteName:"Toggle stats",viewMode:!0,trackEvent:{category:"menu"},keywords:["edit","attributes","customize"],perform(e,t){return{appState:{...t,stats:{...t.stats,open:!this.checked(t)}},captureUpdate:le.EVENTUALLY}},checked:e=>e.stats.open,keyTest:e=>!e[Z.CTRL_OR_CMD]&&e.altKey&&e.code===kt.SLASH}),Vde=Te({name:"unbindText",label:"labels.unbindText",trackEvent:{category:"element"},predicate:(e,t,n,r)=>r.scene.getSelectedElements(t).some(i=>ma(i)),perform:(e,t,n,r)=>{let i=r.scene.getSelectedElements(t),a=r.scene.getNonDeletedElementsMap();return i.forEach(s=>{var c;let o=pt(s,a);if(o){let{width:d,height:l}=jr(o.originalText,Bt(o),o.lineHeight),h=vne(s.id);eL(s.id);let{x:f,y:g}=NU(s,o,a);me(o,{containerId:null,width:d,height:l,text:o.originalText,x:f,y:g}),me(s,{boundElements:(c=s.boundElements)==null?void 0:c.filter(U=>U.id!==o.id),height:h||s.height})}}),{elements:e,appState:t,captureUpdate:le.IMMEDIATELY}}}),Yde=Te({name:"bindText",label:"labels.bindText",trackEvent:{category:"element"},predicate:(e,t,n,r)=>{let i=r.scene.getSelectedElements(t);if(i.length===2){let a=Le(i[0])||Le(i[1]),s;if(ud(i[0])?s=i[0]:ud(i[1])&&(s=i[1]),a&&s&&pt(s,r.scene.getNonDeletedElementsMap())===null)return!0}return!1},perform:(e,t,n,r)=>{let i=r.scene.getSelectedElements(t),a,s;Le(i[0])&&ud(i[1])?(a=i[0],s=i[1]):(a=i[1],s=i[0]),me(a,{containerId:s.id,verticalAlign:ji.MIDDLE,textAlign:o1.CENTER,autoResize:!0}),me(s,{boundElements:(s.boundElements||[]).concat({type:"text",id:a.id})});let o=s.height;return Yr(a,s,r.scene.getNonDeletedElementsMap()),b2(s.id,o),{elements:Gde(e,s,a),appState:{...t,selectedElementIds:{[s.id]:!0}},captureUpdate:le.IMMEDIATELY}}}),Gde=(e,t,n)=>{let r=e.slice(),i=r.findIndex(s=>s.id===n.id);r.splice(i,1);let a=r.findIndex(s=>s.id===t.id);return r.splice(a+1,0,n),Zs(r,nt([t,n])),r},qde=(e,t,n)=>{let r=e.slice(),i=r.findIndex(s=>s.id===t.id);r.splice(i,1);let a=r.findIndex(s=>s.id===n.id);return r.splice(a,0,t),Zs(r,nt([t,n])),r},Zde=Te({name:"wrapTextInContainer",label:"labels.createContainerFromText",trackEvent:{category:"element"},predicate:(e,t,n,r)=>{let i=r.scene.getSelectedElements(t),a=i.every(s=>Le(s));return i.length>0&&a},perform:(e,t,n,r)=>{var o;let i=r.scene.getSelectedElements(t),a=e.slice(),s={};for(let c of i)if(Le(c)){let d=qs({type:"rectangle",backgroundColor:t.currentItemBackgroundColor,boundElements:[...c.boundElements||[],{id:c.id,type:"text"}],angle:c.angle,fillStyle:t.currentItemFillStyle,strokeColor:t.currentItemStrokeColor,roughness:t.currentItemRoughness,strokeWidth:t.currentItemStrokeWidth,strokeStyle:t.currentItemStrokeStyle,roundness:t.currentItemRoundness==="round"?{type:$h("rectangle")?Nn.ADAPTIVE_RADIUS:Nn.PROPORTIONAL_RADIUS}:null,opacity:100,locked:!1,x:c.x-Xn,y:c.y-Xn,width:Id(c.width,"rectangle"),height:Id(c.height,"rectangle"),groupIds:c.groupIds,frameId:c.frameId});if((o=c.boundElements)!=null&&o.length){let l=c.boundElements.filter(h=>h.type==="arrow").map(h=>h.id);a.filter(h=>l.includes(h.id)).forEach(h=>{let f=h.startBinding,g=h.endBinding;(f==null?void 0:f.elementId)===c.id&&(f={...f,elementId:d.id}),(g==null?void 0:g.elementId)===c.id&&(g={...g,elementId:d.id}),(f||g)&&me(h,{startBinding:f,endBinding:g},!1)})}me(c,{containerId:d.id,verticalAlign:ji.MIDDLE,boundElements:null,textAlign:o1.CENTER,autoResize:!0},!1),Yr(c,d,r.scene.getNonDeletedElementsMap()),a=qde([...a,d],d,c),s[d.id]=!0}return{elements:a,appState:{...t,selectedElementIds:s},captureUpdate:le.IMMEDIATELY}}}),Y7=380,Kde=42,x8=5,cP=85,Qde=500,w8=!1,Xm=new Map,Jde=({element:e,elementsMap:t,setAppState:n,onLinkOpen:r,setToast:i,updateEmbedValidationStatus:a})=>{let s=s0(),o=a0(),c=Yn(),d=e.link||"",[l,h]=I.useState(d),f=I.useRef(null),g=s.showHyperlinkPopup==="editor",U=I.useCallback(()=>{var S;if(!f.current)return;let C=Ui(f.current.value)||null;if(!e.link&&C&&Jt("hyperlink","create"),li(e)){if(((S=s.activeEmbeddable)==null?void 0:S.element)===e&&n({activeEmbeddable:null}),!C){me(e,{link:null}),a(e,!1);return}if(!Eg(C,o.validateEmbeddable))C&&i({message:D("toast.unableToEmbed"),closable:!0}),e.link&&Xm.set(e.id,e.link),me(e,{link:C}),a(e,!1);else{let{width:k,height:M}=e,T=Bu(C);(T==null?void 0:T.error)instanceof URIError&&i({message:D("toast.unrecognizedLinkFormat"),closable:!0});let R=T?T.intrinsicSize.w/T.intrinsicSize.h:1,j=Xm.get(e.id)!==e.link;me(e,{...j?{width:(T==null?void 0:T.type)==="video"?k>M?k:M*R:k,height:(T==null?void 0:T.type)==="video"&&k>M?k/R:M}:{},link:C}),a(e,!0),Xm.has(e.id)&&Xm.delete(e.id)}}else me(e,{link:C})},[e,i,o.validateEmbeddable,s.activeEmbeddable,n,a]);I.useLayoutEffect(()=>()=>{U()},[U]),I.useEffect(()=>{g&&(f!=null&&f.current)&&!(c.viewport.isMobile||c.isTouchScreen)&&f.current.select()},[g,c.viewport.isMobile,c.isTouchScreen]),I.useEffect(()=>{let C=null,S=k=>{g||(C&&clearTimeout(C),nue(e,t,s,A(k.clientX,k.clientY))&&(C=window.setTimeout(()=>{n({showHyperlinkPopup:!1})},Qde)))};return window.addEventListener("pointermove",S,!1),()=>{window.removeEventListener("pointermove",S,!1),C&&clearTimeout(C)}},[s,e,g,n,t]);let y=I.useCallback(()=>{Jt("hyperlink","delete"),me(e,{link:null}),n({showHyperlinkPopup:!1})},[n,e]),v=()=>{Jt("hyperlink","edit","popup-ui"),n({showHyperlinkPopup:"editor"})},{x,y:w}=dP(e,s,t);return s.contextMenu||s.selectedElementsAreBeingDragged||s.resizingElement||s.isRotating||s.openMenu||s.viewModeEnabled?null:m.jsxs("div",{className:"excalidraw-hyperlinkContainer",style:{top:`${w}px`,left:`${x}px`,width:Y7,padding:x8},children:[g?m.jsx("input",{className:Fe("excalidraw-hyperlinkContainer-input"),placeholder:D("labels.link.hint"),ref:f,value:l,onChange:C=>h(C.target.value),autoFocus:!0,onKeyDown:C=>{C.stopPropagation(),C[Z.CTRL_OR_CMD]&&C.key===Z.K&&C.preventDefault(),(C.key===Z.ENTER||C.key===Z.ESCAPE)&&(U(),n({showHyperlinkPopup:"info"}))}}):e.link?m.jsx("a",{href:Ui(e.link||""),className:"excalidraw-hyperlinkContainer-link",target:rL(e.link)?"_self":"_blank",onClick:C=>{if(e.link&&r){let S=RI("excalidraw-link",C.nativeEvent);r({...e,link:Ui(e.link)},S),S.defaultPrevented&&C.preventDefault()}},rel:"noopener noreferrer",children:e.link}):m.jsx("div",{className:"excalidraw-hyperlinkContainer-link",children:D("labels.link.empty")}),m.jsxs("div",{className:"excalidraw-hyperlinkContainer__buttons",children:[!g&&m.jsx(Ct,{type:"button",title:D("buttons.edit"),"aria-label":D("buttons.edit"),label:D("buttons.edit"),onClick:v,className:"excalidraw-hyperlinkContainer--edit",icon:d1}),m.jsx(Ct,{type:"button",title:D("labels.linkToElement"),"aria-label":D("labels.linkToElement"),label:D("labels.linkToElement"),onClick:()=>{n({openDialog:{name:"elementLinkSelector",sourceElementId:e.id}})},icon:oA}),d&&!li(e)&&m.jsx(Ct,{type:"button",title:D("buttons.remove"),"aria-label":D("buttons.remove"),label:D("buttons.remove"),onClick:y,className:"excalidraw-hyperlinkContainer--remove",icon:_d})]})]})},dP=(e,t,n)=>{let[r,i]=lt(e,n),{x:a,y:s}=oa({sceneX:r+e.width/2,sceneY:i},t),o=a-t.offsetLeft-Y7/2,c=s-t.offsetTop-cP;return{x:o,y:c}},W_=(e,t)=>{var r;let n=gt(e,t);return li(n[0])?"labels.link.editEmbed":(r=n[0])!=null&&r.link?"labels.link.edit":"labels.link.create"},Fp=null,eue=(e,t,n)=>{Fp&&clearTimeout(Fp),Fp=window.setTimeout(()=>tue(e,t,n),nY)},tue=(e,t,n)=>{if(!e.link)return;let r=Np();r.classList.add("excalidraw-tooltip--visible"),r.style.maxWidth="20rem",r.textContent=qu(e.link)?D("labels.link.goToElement"):e.link;let[i,a,s,o]=lt(e,n),[c,d,l,h]=Wv([i,a,s,o],e.angle,t),f=oa({sceneX:c,sceneY:d},t);eP(r,{left:f.x,top:f.y,width:l,height:h},"top"),Jt("hyperlink","tooltip","link-icon"),w8=!0},X_=()=>{Fp&&clearTimeout(Fp),w8&&(w8=!1,Np().classList.remove("excalidraw-tooltip--visible"))},nue=(e,t,n,[r,i])=>{let{x:a,y:s}=Yt({clientX:r,clientY:i},n),o=15/n.zoom.value;if(Iv(a,s,e,t))return!1;let[c,d,l]=lt(e,t);if(a>=c&&a<=l&&s>=d-cP&&s<=d)return!1;let{x:h,y:f}=dP(e,n,t);return!(r>=h-o&&r<=h+Y7+x8*2+o&&i>=f-o&&i<=f+o+x8*2+Kde)},uP=Te({name:"hyperlink",label:(e,t)=>W_(e,t),icon:M3,perform:(e,t)=>t.showHyperlinkPopup==="editor"?!1:{elements:e,appState:{...t,showHyperlinkPopup:"editor",openMenu:null},captureUpdate:le.IMMEDIATELY},trackEvent:{category:"hyperlink",action:"click"},keyTest:e=>e[Z.CTRL_OR_CMD]&&e.key===Z.K,predicate:(e,t)=>gt(e,t).length===1,PanelComponent:({elements:e,appState:t,updateData:n})=>{let r=gt(e,t);return m.jsx(Ct,{type:"button",icon:M3,"aria-label":D(W_(e,t)),title:`${li(e[0])?D("labels.link.labelEmbed"):D("labels.link.label")} - ${pe("CtrlOrCmd+K")}`,onClick:()=>n(null),selected:r.length===1&&!!r[0].link})}}),ky=e=>e.every(t=>!t.locked),rue=Te({name:"toggleElementLock",label:(e,t,n)=>{let r=n.scene.getSelectedElements({selectedElementIds:t.selectedElementIds,includeBoundTextElement:!1});return r.length===1&&!tt(r[0])?r[0].locked?"labels.elementLock.unlock":"labels.elementLock.lock":ky(r)?"labels.elementLock.lockAll":"labels.elementLock.unlockAll"},icon:(e,t)=>{let n=gt(t,e);return ky(n)?Ev:CU},trackEvent:{category:"element"},predicate:(e,t,n,r)=>{let i=r.scene.getSelectedElements(t);return i.length>0&&!i.some(a=>a.locked&&a.frameId)},perform:(e,t,n,r)=>{let i=r.scene.getSelectedElements({selectedElementIds:t.selectedElementIds,includeBoundTextElement:!0,includeElementsInFrames:!0});if(!i.length)return!1;let a=ky(i),s=nt(i);return{elements:e.map(o=>s.has(o.id)?ct(o,{locked:a}):o),appState:{...t,selectedLinearElement:a?null:t.selectedLinearElement},captureUpdate:le.IMMEDIATELY}},keyTest:(e,t,n,r)=>e.key.toLocaleLowerCase()===Z.L&&e[Z.CTRL_OR_CMD]&&e.shiftKey&&r.scene.getSelectedElements({selectedElementIds:t.selectedElementIds,includeBoundTextElement:!1}).length>0}),iue=Te({name:"unlockAllElements",paletteName:"Unlock all elements",trackEvent:{category:"canvas"},viewMode:!1,icon:CU,predicate:(e,t)=>gt(e,t).length===0&&e.some(n=>n.locked),perform:(e,t)=>{let n=e.filter(r=>r.locked);return{elements:e.map(r=>r.locked?ct(r,{locked:!1}):r),appState:{...t,selectedElementIds:Object.fromEntries(n.map(r=>[r.id,!0]))},captureUpdate:le.IMMEDIATELY}},label:"labels.elementLock.unlockAll"}),aue=()=>{let[e,t]=I.useState(null),n=I.useCallback(r=>t(r),[]);return[e,n]},sue=e=>{let{closeOnClickOutside:t=!0}=e,n=Hj({className:"excalidraw-modal-container"}),r=I.useRef(document.body.classList.contains("excalidraw-animations-disabled"));if(!n)return null;let i=a=>{a.key===Z.ESCAPE&&(a.nativeEvent.stopImmediatePropagation(),a.stopPropagation(),e.onCloseRequest())};return Jn.createPortal(m.jsxs("div",{className:Fe("Modal",e.className,{"animations-disabled":r.current}),role:"dialog","aria-modal":"true",onKeyDown:i,"aria-labelledby":e.labelledBy,"data-prevent-outside-click":!0,children:[m.jsx("div",{className:"Modal__background",onClick:t?e.onCloseRequest:void 0}),m.jsx("div",{className:"Modal__content",style:{"--max-width":`${e.maxWidth}px`},tabIndex:0,children:e.children})]}),n)},hP=hr(new Map),V_=async e=>await zU({elements:e,appState:{exportBackground:!1,viewBackgroundColor:yt.white},files:null,renderEmbeddables:!1,skipInliningFonts:!0}),oue=(e,t,n)=>{let[r,i]=I.useState();return I.useEffect(()=>{if(t)if(e){let a=n.get(e);a?i(a):(async()=>{var o;let s=await V_(t);(o=s.querySelector(".style-fonts"))==null||o.remove(),s&&(n.set(e,s),i(s))})()}else(async()=>{let a=await V_(t);i(a)})()},[e,t,n,i]),r},fP=()=>{let[e]=kn(hP);return{clearLibraryCache:()=>e.clear(),deleteItemsFromLibraryCache:t=>{t.forEach(n=>e.delete(n))},svgCache:e}},lue=class{constructor(){H(this,"jobs",[]),H(this,"running",!1)}tick(){if(this.running)return;let e=this.jobs.shift();e?(this.running=!0,e.promise.resolve(hh(e.jobFactory,...e.args).finally(()=>{this.running=!1,this.tick()}))):this.running=!1}push(e,...t){let n=jY();return this.jobs.push({jobFactory:e,promise:n,args:t}),this.tick(),n}},cue=new As,C1=hr({status:"loaded",isInitialized:!1,libraryItems:[]}),Vf=e=>Ho(e),due=(e,t)=>!e.find(n=>n.elements.length!==t.elements.length?!1:n.elements.every((r,i)=>r.id===t.elements[i].id&&r.versionNonce===t.elements[i].versionNonce)),pP=(e,t)=>{let n=[];for(let r of t)due(e,r)&&n.push(r);return[...n,...e]},uue=(e,t)=>{let n=nt(t),r={deletedItems:new Map,addedItems:new Map};for(let a of e)n.has(a.id)||r.deletedItems.set(a.id,a);let i=nt(e);for(let a of t)i.has(a.id)||r.addedItems.set(a.id,a);return r},hue=class{constructor(e){H(this,"currLibraryItems",[]),H(this,"prevLibraryItems",Vf(this.currLibraryItems)),H(this,"app"),H(this,"updateQueue",[]),H(this,"getLastUpdateTask",()=>this.updateQueue[this.updateQueue.length-1]),H(this,"notifyListeners",()=>{var t,n;if(this.updateQueue.length>0)Za.set(C1,r=>({status:"loading",libraryItems:this.currLibraryItems,isInitialized:r.isInitialized}));else{Za.set(C1,{status:"loaded",libraryItems:this.currLibraryItems,isInitialized:!0});try{let r=this.prevLibraryItems;this.prevLibraryItems=Vf(this.currLibraryItems);let i=Vf(this.currLibraryItems);(n=(t=this.app.props).onLibraryChange)==null||n.call(t,i),cue.trigger(uue(r,i),i)}catch(r){console.error(r)}}}),H(this,"destroy",()=>{this.updateQueue=[],this.currLibraryItems=[],Za.set(hP,new Map)}),H(this,"resetLibrary",()=>this.setLibrary([])),H(this,"getLatestLibrary",()=>new Promise(async t=>{try{let n=await(this.getLastUpdateTask()||this.currLibraryItems);this.updateQueue.length>0?t(this.getLatestLibrary()):t(Vf(n))}catch{return t(this.currLibraryItems)}})),H(this,"updateLibrary",async({libraryItems:t,prompt:n=!1,merge:r=!1,openLibraryMenu:i=!1,defaultStatus:a="unpublished"})=>(i&&this.app.setState({openSidebar:{name:Qa.name,tab:n2}}),this.setLibrary(()=>new Promise(async(s,o)=>{try{let c=await(typeof t=="function"&&!(t instanceof Blob)?t(this.currLibraryItems):t),d;c instanceof Blob?d=await cR(c,a):d=BU(c,a),!n||window.confirm(D("alerts.confirmAddLibrary",{numShapes:d.length}))?(n&&this.app.focusContainer(),s(r?pP(this.currLibraryItems,d):d)):o(new kU)}catch(c){o(c)}})))),H(this,"setLibrary",t=>{let n=new Promise(async(r,i)=>{try{await this.getLastUpdateTask(),typeof t=="function"&&(t=t(this.currLibraryItems)),this.currLibraryItems=Vf(await t),r(this.currLibraryItems)}catch(a){i(a)}}).catch(r=>{if(r.name==="AbortError")return console.warn("Library update aborted by user"),this.currLibraryItems;throw r}).finally(()=>{this.updateQueue=this.updateQueue.filter(r=>r!==n),this.notifyListeners()});return this.updateQueue.push(n),this.notifyListeners(),n}),this.app=e}},fue=hue,mP=e=>{let t=Math.ceil(Math.sqrt(e.length)),n=[],r=f=>e.slice(f*t,f*t+t).reduce((g,U)=>{let{height:y}=es(U.elements);return Math.max(g,y)},0),i=f=>{let g=0,U=0,y=0;for(let v of e){if(g%t===0&&(U=0),U===f){let{width:x}=es(v.elements);y=Math.max(y,x)}g++,U++}return y},a=0,s=0,o=0,c=0,d=0,l=0,h=0;for(let f of e){d&&d%t===0&&(s+=o+50,a=0,l=0,h++),l===0&&(o=r(h)),c=i(l);let{minX:g,minY:U,width:y,height:v}=es(f.elements),x=(c-y)/2,w=(o-v)/2;n.push(...f.elements.map(C=>({...C,x:C.x+a+x-g,y:C.y+s+w-U}))),a+=c+50,d++,l++}return n},Vm=class E8{constructor(t){H(this,"adapter"),this.adapter=t}static async getLibraryItems(t,n,r=!0){let i=()=>new Promise(async(a,s)=>{try{let o=await t.load({source:n});a(BU((o==null?void 0:o.libraryItems)||[],"published"))}catch(o){s(o)}});return r?E8.queue.push(i):i()}getLibraryItems(t){return E8.getLibraryItems(this.adapter,t,!1)}};H(Vm,"queue",new lue),H(Vm,"run",async(e,t)=>{let n=new Vm(e);return Vm.queue.push(()=>t(n))});var pue=I.forwardRef(({children:e,gap:t,align:n,justifyContent:r,className:i,style:a},s)=>m.jsx("div",{className:Fe("Stack Stack_horizontal",i),style:{"--gap":t,alignItems:n,justifyContent:r,...a},ref:s,children:e})),mue=I.forwardRef(({children:e,gap:t,align:n,justifyContent:r,className:i,style:a},s)=>m.jsx("div",{className:Fe("Stack Stack_vertical",i),style:{"--gap":t,justifyItems:n,justifyContent:r,...a},ref:s,children:e})),la={Row:pue,Col:mue},gue=({theme:e,id:t,libraryReturnUrl:n})=>{let r=n||window.location.origin+window.location.pathname;return m.jsx("a",{className:"library-menu-browse-button",href:`${mt.VITE_APP_LIBRARY_URL}?target=${window.name||"_blank"}&referrer=${r}&useHash=true&token=${t}&theme=${e}&version=${vU.excalidrawLibrary}`,target:"_excalidraw_libraries",children:D("labels.libraries")})},Uue=gue,gP=({libraryReturnUrl:e,theme:t,id:n,style:r,children:i,className:a})=>m.jsxs("div",{className:Fe("library-menu-control-buttons",a),style:r,children:[m.jsx(Uue,{id:n,libraryReturnUrl:e,theme:t}),i]}),bue=/({{[\w-]+}})|(<[\w-]+>)|(<\/[\w-]+>)/g,yue=/{{([\w-]+)}}/,vue=/<([\w-]+)>/,xue=/<\/([\w-]+)>/,wue=(e,t)=>{let n=[{name:"",children:[]}];return e.split(bue).filter(Boolean).forEach(r=>{let i=r.match(vue),a=r.match(xue),s=r.match(yue);if(i!==null){let o=i[1];t.hasOwnProperty(o)?n.push({name:o,children:[]}):console.warn(`Trans: missed to pass in prop ${o} for interpolating ${e}`)}else if(a!==null)if(a[1]===n[n.length-1].name){let o=n.pop(),c=ke.createElement(ke.Fragment,{},...o.children),d=t[o.name];typeof d=="function"&&n[n.length-1].children.push(d(c))}else console.warn(`Trans: unexpected end tag ${r} for interpolating ${e}`);else if(s!==null){let o=s[1];t.hasOwnProperty(o)?n[n.length-1].children.push(t[o]):console.warn(`Trans: key ${o} not in props for interpolating ${e}`)}else n[n.length-1].children.push(r)}),n.length!==1&&console.warn(`Trans: stack not empty for interpolating ${e}`),n[0].children},Eue=({i18nKey:e,children:t,...n})=>{let{t:r}=vr();return ke.createElement(ke.Fragment,{},...wue(r(e),n))},$s=Eue,Cue=({label:e,onClick:t,className:n,children:r,actionType:i,type:a="button",isLoading:s,...o})=>{let c=i?`Dialog__action-button--${i}`:"";return m.jsxs("button",{className:Fe("Dialog__action-button",c,n),type:a,"aria-label":e,onClick:t,...o,children:[r&&m.jsx("div",{style:s?{visibility:"hidden"}:{},children:r}),m.jsx("div",{style:s?{visibility:"hidden"}:{},children:e}),s&&m.jsx("div",{style:{position:"absolute",inset:0},children:m.jsx(il,{})})]})},Ch=Cue,Sue=e=>{let{onConfirm:t,onCancel:n,children:r,confirmText:i=D("buttons.confirm"),cancelText:a=D("buttons.cancel"),className:s="",...o}=e,c=nr(),d=JU(G7),{container:l}=ao();return m.jsxs(cs,{onCloseRequest:n,size:"small",...o,className:`confirm-dialog ${s}`,children:[r,m.jsxs("div",{className:"confirm-dialog-buttons",children:[m.jsx(Ch,{label:a,onClick:()=>{c({openMenu:null}),d(!1),Jn.flushSync(()=>{n()}),l==null||l.focus()}}),m.jsx(Ch,{label:i,onClick:()=>{c({openMenu:null}),d(!1),Jn.flushSync(()=>{t()}),l==null||l.focus()},actionType:"danger"})]})]})},UP=Sue,md=class{static has(e){try{return!!window.localStorage.getItem(e)}catch(t){return console.warn(`localStorage.getItem error: ${t.message}`),!1}}static get(e){try{let t=window.localStorage.getItem(e);return t?JSON.parse(t):null}catch(t){return console.warn(`localStorage.getItem error: ${t.message}`),null}}};H(md,"set",(e,t)=>{try{return window.localStorage.setItem(e,JSON.stringify(t)),!0}catch(n){return console.warn(`localStorage.setItem error: ${n.message}`),!1}}),H(md,"delete",e=>{try{window.localStorage.removeItem(e)}catch(t){console.warn(`localStorage.removeItem error: ${t.message}`)}});var _ue=async e=>{let t=Math.round(8),n=Math.max(Math.round(128/64),2),r=AY(e,6),i=document.createElement("canvas");i.width=r[0].length*128+(r[0].length+1)*(t*2)-t*2,i.height=r.length*128+(r.length+1)*(t*2)-t*2;let a=i.getContext("2d");a.fillStyle=dr.white,a.fillRect(0,0,i.width,i.height);for(let[s,o]of e.entries()){let c=await Q1({elements:o.elements,files:null,maxWidthOrHeight:128}),{width:d,height:l}=c,h=Math.floor(s/6)*(128+t*2),f=s%6*(128+t*2);a.drawImage(c,f+(128-d)/2+t,h+(128-l)/2+t),a.lineWidth=n,a.strokeStyle=dr.gray[4],a.strokeRect(f+t/2,h+t/2,128+t,128+t)}return await K3(new File([await v1(i)],"preview",{type:We.png}),{outputType:We.jpg,maxWidthOrHeight:5e3})},kue=({libItem:e,appState:t,index:n,onChange:r,onRemove:i})=>{let a=I.useRef(null),s=I.useRef(null);return I.useEffect(()=>{let o=a.current;o&&(async()=>{let c=await zU({elements:e.elements,appState:{...t,viewBackgroundColor:dr.white,exportBackground:!0},files:null,skipInliningFonts:!0});o.innerHTML=c.outerHTML})()},[e.elements,t]),m.jsxs("div",{className:"single-library-item",children:[e.status==="published"&&m.jsx("span",{className:"single-library-item-status",children:D("labels.statusPublished")}),m.jsx("div",{ref:a,className:"single-library-item__svg"}),m.jsx(Ct,{"aria-label":D("buttons.remove"),type:"button",icon:Bh,className:"single-library-item--remove",onClick:i.bind(null,e.id),title:D("buttons.remove")}),m.jsxs("div",{style:{display:"flex",margin:"0.8rem 0",width:"100%",fontSize:"14px",fontWeight:500,flexDirection:"column"},children:[m.jsxs("label",{style:{display:"flex",justifyContent:"space-between",flexDirection:"column"},children:[m.jsxs("div",{style:{padding:"0.5em 0"},children:[m.jsx("span",{style:{fontWeight:500,color:dr.gray[6]},children:D("publishDialog.itemName")}),m.jsx("span",{"aria-hidden":"true",className:"required",children:"*"})]}),m.jsx("input",{type:"text",ref:s,style:{width:"80%",padding:"0.2rem"},defaultValue:e.name,placeholder:"Item name",onChange:o=>{r(o.target.value,n)}})]}),m.jsx("span",{className:"error",children:e.error})]})]})},Tue=({onClose:e,libraryItems:t,appState:n,onSuccess:r,onError:i,updateItemsInStorage:a,onRemove:s})=>{let[o,c]=I.useState({authorName:"",githubHandle:"",name:"",description:"",twitterHandle:"",website:""}),[d,l]=I.useState(!1);I.useEffect(()=>{let C=md.get(Tp.PUBLISH_LIBRARY);C&&c(C)},[]);let[h,f]=I.useState(t.slice());I.useEffect(()=>{f(t.slice())},[t]);let g=C=>{c({...o,[C.target.name]:C.target.value})},U=async C=>{C.preventDefault(),l(!0);let S=[],k=!1;if(h.forEach(N=>{let F="";N.name||(F=D("publishDialog.errors.required"),k=!0),S.push({...N,error:F})}),k){f(S),l(!1);return}let M=await _ue(h),T={type:da.excalidrawLibrary,version:vU.excalidrawLibrary,source:dv,libraryItems:h},R=JSON.stringify(T,null,2),j=new Blob([R],{type:"application/json"}),P=new FormData;P.append("excalidrawLib",j),P.append("previewImage",M),P.append("previewImageType",M.type),P.append("title",o.name),P.append("authorName",o.authorName),P.append("githubHandle",o.githubHandle),P.append("name",o.name),P.append("description",o.description),P.append("twitterHandle",o.twitterHandle),P.append("website",o.website),fetch(`${mt.VITE_APP_LIBRARY_BACKEND}/submit`,{method:"post",body:P}).then(N=>N.ok?N.json().then(({url:F})=>{md.delete(Tp.PUBLISH_LIBRARY),r({url:F,authorName:o.authorName,items:h})}):N.json().catch(()=>{throw new Error(N.statusText||"something went wrong")}).then(F=>{throw new Error(F.message||N.statusText||"something went wrong")}),N=>{console.error(N),i(N),l(!1)}).catch(N=>{console.error(N),i(N),l(!1)})},y=()=>{let C=[];return h.forEach((S,k)=>{C.push(m.jsx("div",{className:"single-library-item-wrapper",children:m.jsx(kue,{libItem:S,appState:n,index:k,onChange:(M,T)=>{let R=h.slice();R[T].name=M,f(R)},onRemove:s})},k))}),m.jsx("div",{className:"selected-library-items",children:C})},v=I.useCallback(()=>{a(h),md.set(Tp.PUBLISH_LIBRARY,o),e()},[h,e,a,o]),x=!!t.length,w=t.some(C=>C.status==="published");return m.jsx(cs,{onCloseRequest:v,title:D("publishDialog.title"),className:"publish-library",children:x?m.jsxs("form",{onSubmit:U,children:[m.jsx("div",{className:"publish-library-note",children:m.jsx($s,{i18nKey:"publishDialog.noteDescription",link:C=>m.jsx("a",{href:"https://libraries.excalidraw.com",target:"_blank",rel:"noopener noreferrer",children:C})})}),m.jsx("span",{className:"publish-library-note",children:m.jsx($s,{i18nKey:"publishDialog.noteGuidelines",link:C=>m.jsx("a",{href:"https://github.com/excalidraw/excalidraw-libraries#guidelines",target:"_blank",rel:"noopener noreferrer",children:C})})}),m.jsx("div",{className:"publish-library-note",children:D("publishDialog.noteItems")}),w&&m.jsx("span",{className:"publish-library-note publish-library-warning",children:D("publishDialog.republishWarning")}),y(),m.jsxs("div",{className:"publish-library__fields",children:[m.jsxs("label",{children:[m.jsxs("div",{children:[m.jsx("span",{children:D("publishDialog.libraryName")}),m.jsx("span",{"aria-hidden":"true",className:"required",children:"*"})]}),m.jsx("input",{type:"text",name:"name",required:!0,value:o.name,onChange:g,placeholder:D("publishDialog.placeholder.libraryName")})]}),m.jsxs("label",{style:{alignItems:"flex-start"},children:[m.jsxs("div",{children:[m.jsx("span",{children:D("publishDialog.libraryDesc")}),m.jsx("span",{"aria-hidden":"true",className:"required",children:"*"})]}),m.jsx("textarea",{name:"description",rows:4,required:!0,value:o.description,onChange:g,placeholder:D("publishDialog.placeholder.libraryDesc")})]}),m.jsxs("label",{children:[m.jsxs("div",{children:[m.jsx("span",{children:D("publishDialog.authorName")}),m.jsx("span",{"aria-hidden":"true",className:"required",children:"*"})]}),m.jsx("input",{type:"text",name:"authorName",required:!0,value:o.authorName,onChange:g,placeholder:D("publishDialog.placeholder.authorName")})]}),m.jsxs("label",{children:[m.jsx("span",{children:D("publishDialog.githubUsername")}),m.jsx("input",{type:"text",name:"githubHandle",value:o.githubHandle,onChange:g,placeholder:D("publishDialog.placeholder.githubHandle")})]}),m.jsxs("label",{children:[m.jsx("span",{children:D("publishDialog.twitterUsername")}),m.jsx("input",{type:"text",name:"twitterHandle",value:o.twitterHandle,onChange:g,placeholder:D("publishDialog.placeholder.twitterHandle")})]}),m.jsxs("label",{children:[m.jsx("span",{children:D("publishDialog.website")}),m.jsx("input",{type:"text",name:"website",pattern:"https?://.+",title:D("publishDialog.errors.website"),value:o.website,onChange:g,placeholder:D("publishDialog.placeholder.website")})]}),m.jsx("span",{className:"publish-library-note",children:m.jsx($s,{i18nKey:"publishDialog.noteLicense",link:C=>m.jsx("a",{href:"https://github.com/excalidraw/excalidraw-libraries/blob/main/LICENSE",target:"_blank",rel:"noopener noreferrer",children:C})})})]}),m.jsxs("div",{className:"publish-library__buttons",children:[m.jsx(Ch,{label:D("buttons.cancel"),onClick:v,"data-testid":"cancel-clear-canvas-button"}),m.jsx(Ch,{type:"submit",label:D("buttons.submit"),actionType:"primary",isLoading:d})]})]}):m.jsx("p",{style:{padding:"1em",textAlign:"center",fontWeight:500},children:D("publishDialog.atleastOneLibItem")})})},Mue=Tue,bP=({className:e="",children:t,onToggle:n,title:r,...i})=>{let a=Yn(),s=Fe(`dropdown-menu-button ${e}`,"zen-mode-transition",{"dropdown-menu-button--mobile":a.editor.isMobile}).trim();return m.jsx("button",{"data-prevent-outside-click":!0,className:s,onClick:n,type:"button","data-testid":"dropdown-menu-button",title:r,...i,children:t})},Iue=bP;bP.displayName="DropdownMenuTrigger";var yP=()=>m.jsx("div",{style:{height:"1px",backgroundColor:"var(--default-border-color)",margin:".5rem 0"}}),Aue=yP;yP.displayName="DropdownMenuSeparator";var vP=({children:e,onClickOutside:t,className:n="",onSelect:r,style:i})=>{let a=Yn(),s=I.useRef(null),o=n6({onClickOutside:t});$7(s,()=>{var d;(d=o.onClickOutside)==null||d.call(o)}),I.useEffect(()=>{let d=h=>{var f;h.key===Z.ESCAPE&&(h.stopImmediatePropagation(),(f=o.onClickOutside)==null||f.call(o))},l={capture:!0};return document.addEventListener("keydown",d,l),()=>{document.removeEventListener("keydown",d,l)}},[o]);let c=Fe(`dropdown-menu ${n}`,{"dropdown-menu--mobile":a.editor.isMobile}).trim();return m.jsx(Gj.Provider,{value:{onSelect:r},children:m.jsx("div",{ref:s,className:c,style:i,"data-testid":"dropdown-menu",children:a.editor.isMobile?m.jsx(la.Col,{className:"dropdown-menu-container",children:e}):m.jsx(ts,{className:"dropdown-menu-container",padding:2,style:{zIndex:2},children:e})})})};vP.displayName="DropdownMenuContent";var Lue=vP,xP=({icon:e,shortcut:t,href:n,children:r,onSelect:i,className:a="",selected:s,rel:o="noreferrer",...c})=>{let d=Zj(c.onClick,i);return m.jsx("a",{...c,href:n,target:"_blank",rel:"noreferrer",className:qj(a,s),title:c.title??c["aria-label"],onClick:d,children:m.jsx(Kj,{icon:e,shortcut:t,children:r})})},Dg=xP;xP.displayName="DropdownMenuItemLink";var Rue=({children:e,className:t="",selected:n,...r})=>m.jsx("div",{...r,className:`dropdown-menu-item-base dropdown-menu-item-custom ${t} ${n?"dropdown-menu-item--selected":""}`.trim(),children:e}),Due=Rue,jue=e=>ke.Children.toArray(e).find(n=>ke.isValidElement(n)&&typeof n.type!="string"&&(n==null?void 0:n.type.displayName)&&n.type.displayName==="DropdownMenuTrigger")||null,Pue=e=>ke.Children.toArray(e).find(n=>ke.isValidElement(n)&&typeof n.type!="string"&&(n==null?void 0:n.type.displayName)&&n.type.displayName==="DropdownMenuContent")||null,cl=({children:e,open:t})=>{let n=jue(e),r=Pue(e);return m.jsxs(m.Fragment,{children:[n,t&&r]})};cl.Trigger=Iue;cl.Content=Lue;cl.Item=va;cl.ItemLink=Dg;cl.ItemCustom=Due;cl.Group=U8;cl.Separator=Aue;var dn=cl;cl.displayName="DropdownMenu";var Nue=(e,t)=>e.filter(n=>t.includes(n.id)),Oue=({setAppState:e,selectedItems:t,library:n,onRemoveFromLibrary:r,resetLibrary:i,onSelectItems:a,appState:s,className:o})=>{let[c]=kn(C1),[d,l]=kn(G7),h=()=>{let P=t.length?D("alerts.removeItemsFromsLibrary",{count:t.length}):D("alerts.resetLibrary"),N=t.length?D("confirmDialog.removeItemsFromLib"):D("confirmDialog.resetLibrary");return m.jsx(UP,{onConfirm:()=>{t.length?r():i(),g(!1)},onCancel:()=>{g(!1)},title:N,children:m.jsx("p",{children:P})})},[f,g]=I.useState(!1),U=!!t.length,y=U?c.libraryItems.filter(P=>t.includes(P.id)):c.libraryItems,v=D(U?"buttons.remove":"buttons.resetLibrary"),[x,w]=I.useState(!1),[C,S]=I.useState(null),k=I.useCallback(()=>m.jsxs(cs,{onCloseRequest:()=>S(null),title:D("publishSuccessDialog.title"),className:"publish-library-success",size:"small",children:[m.jsx("p",{children:m.jsx($s,{i18nKey:"publishSuccessDialog.content",authorName:C.authorName,link:P=>m.jsx("a",{href:C==null?void 0:C.url,target:"_blank",rel:"noopener noreferrer",children:P})})}),m.jsx(Ct,{type:"button",title:D("buttons.close"),"aria-label":D("buttons.close"),label:D("buttons.close"),onClick:()=>S(null),"data-testid":"publish-library-success-close",className:"publish-library-success-close"})]}),[S,C]),M=(P,N)=>{w(!1),S({url:P.url,authorName:P.authorName});let F=N.slice();F.forEach($=>{t.includes($.id)&&($.status="published")}),n.setLibrary(F)},T=async()=>{try{await n.updateLibrary({libraryItems:zv({description:"Excalidraw library files"}),merge:!0,openLibraryMenu:!0})}catch(P){if((P==null?void 0:P.name)==="AbortError"){console.warn(P);return}e({errorMessage:D("errors.importLibraryError")})}},R=async()=>{let P=U?y:await n.getLatestLibrary();tre(P).catch(II).catch(N=>{e({errorMessage:N.message})})},j=()=>m.jsxs(dn,{open:d,children:[m.jsx(dn.Trigger,{onToggle:()=>l(!d),children:fG}),m.jsxs(dn.Content,{onClickOutside:()=>l(!1),onSelect:()=>l(!1),className:"library-menu",children:[!U&&m.jsx(dn.Item,{onSelect:T,icon:Sv,"data-testid":"lib-dropdown--load",children:D("buttons.load")}),!!y.length&&m.jsx(dn.Item,{onSelect:R,icon:SU,"data-testid":"lib-dropdown--export",children:D("buttons.export")}),!!y.length&&m.jsx(dn.Item,{onSelect:()=>g(!0),icon:_d,children:v}),U&&m.jsx(dn.Item,{icon:Eq,onSelect:()=>w(!0),"data-testid":"lib-dropdown--remove",children:D("buttons.publishLibrary")})]})]});return m.jsxs("div",{className:Fe("library-menu-dropdown-container",o),children:[j(),t.length>0&&m.jsx("div",{className:"library-actions-counter",children:t.length}),f&&h(),x&&m.jsx(Mue,{onClose:()=>w(!1),libraryItems:Nue(c.libraryItems,t),appState:s,onSuccess:P=>M(P,c.libraryItems),onError:P=>window.alert(P),updateItemsInStorage:()=>n.setLibrary(c.libraryItems),onRemove:P=>a(t.filter(N=>N!==P))}),C&&k()]})},Y_=({selectedItems:e,onSelectItems:t,className:n})=>{let{library:r}=io(),{clearLibraryCache:i,deleteItemsFromLibraryCache:a}=fP(),s=Nr(),o=nr(),[c]=kn(C1),d=async l=>{let h=l.filter(f=>!e.includes(f.id));r.setLibrary(h).catch(()=>{o({errorMessage:D("alerts.errorRemovingFromLibrary")})}),a(e),t([])};return m.jsx(Oue,{appState:s,setAppState:o,selectedItems:e,onSelectItems:t,library:r,onRemoveFromLibrary:()=>d(c.libraryItems),resetLibrary:()=>{r.resetLibrary(),i()},className:n})},Fue=I.memo(({id:e,elements:t,isPending:n,onClick:r,selected:i,onToggle:a,onDrag:s,svgCache:o})=>{let c=I.useRef(null),d=oue(e,t,o);I.useEffect(()=>{let U=c.current;if(U)return d&&(U.innerHTML=d.outerHTML),()=>{U.innerHTML=""}},[d]);let[l,h]=I.useState(!1),f=Yn().editor.isMobile,g=n&&m.jsx("div",{className:"library-unit__adder",children:hG});return m.jsxs("div",{className:Fe("library-unit",{"library-unit__active":t,"library-unit--hover":t&&l,"library-unit--selected":i,"library-unit--skeleton":!d}),onMouseEnter:()=>h(!0),onMouseLeave:()=>h(!1),children:[m.jsx("div",{className:Fe("library-unit__dragger",{"library-unit__pulse":!!n}),ref:c,draggable:!!t,onClick:t||n?U=>{e&&U.shiftKey?a(e,U):r(e)}:void 0,onDragStart:U=>{if(!e){U.preventDefault();return}h(!1),s(e,U)}}),g,e&&t&&(l||f||i)&&m.jsx(X7,{checked:i,onChange:(U,y)=>a(e,y),className:"library-unit__checkbox"})]})}),$ue=()=>m.jsx("div",{className:"library-unit library-unit--skeleton"});function Bue(){return[!1,I.useCallback(e=>e(),[])]}var zue=ke.useTransition||Bue,G_=({children:e})=>m.jsx("div",{className:"library-menu-items-container__grid",children:e}),Ty=I.memo(({items:e,onItemSelectToggle:t,onItemDrag:n,isItemSelected:r,onClick:i,svgCache:a,itemsRenderedPerBatch:s})=>{let[,o]=zue(),[c,d]=I.useState(0);return I.useEffect(()=>{c<e.length&&o(()=>{d(c+s)})},[c,e.length,o,s]),m.jsx(m.Fragment,{children:e.map((l,h)=>h<c?m.jsx(Fue,{elements:l==null?void 0:l.elements,isPending:!(l!=null&&l.id)&&!!(l!=null&&l.elements),onClick:i,svgCache:a,id:l==null?void 0:l.id,selected:r(l.id),onToggle:t,onDrag:n},(l==null?void 0:l.id)??h):m.jsx($ue,{},h))})}),Hue=hr(0),Wue=e=>{let[t,n]=kn(Hue);return I.useEffect(()=>{let{current:r}=e;if(!r)return;let i=F1(()=>{let{scrollTop:a}=r;n(a)},200);return r.addEventListener("scroll",i),()=>{i.cancel(),r.removeEventListener("scroll",i)}},[e,n]),t},Xue=17,Vue=64;function Yue({isLoading:e,libraryItems:t,onAddToLibrary:n,onInsertLibraryItems:r,pendingElements:i,theme:a,id:s,libraryReturnUrl:o,onSelectItems:c,selectedItems:d}){let l=I.useRef(null),h=Wue(l);I.useEffect(()=>{var P;h>0&&((P=l.current)==null||P.scrollTo(0,h))},[]);let{svgCache:f}=fP(),g=I.useMemo(()=>t.filter(P=>P.status!=="published"),[t]),U=I.useMemo(()=>t.filter(P=>P.status==="published"),[t]),y=!t.length&&!i.length,v=!i.length&&!g.length&&!U.length,[x,w]=I.useState(null),C=I.useCallback((P,N)=>{let F=!d.includes(P),$=[...g,...U];if(F){if(N.shiftKey&&x){let q=$.findIndex(z=>z.id===x),W=$.findIndex(z=>z.id===P);if(q===-1||W===-1){c([...d,P]);return}let V=nt(d),B=$.reduce((z,Y,K)=>((K>=q&&K<=W||V.has(Y.id))&&z.push(Y.id),z),[]);c(B)}else c([...d,P]);w(P)}else w(null),c(d.filter(q=>q!==P))},[x,c,U,d,g]),S=I.useCallback(P=>{let N;return d.includes(P)?N=t.filter(F=>d.includes(F.id)):N=t.filter(F=>F.id===P),N.map(F=>({...F,elements:fL(F.elements,{randomizeSeed:!0})}))},[t,d]),k=I.useCallback((P,N)=>{N.dataTransfer.setData(We.excalidrawlib,Hv(S(P)))},[S]),M=I.useCallback(P=>P?d.includes(P):!1,[d]),T=I.useCallback(()=>{n(i)},[i,n]),R=I.useCallback(P=>{P&&r(S(P))},[S,r]),j=f.size>=t.length?Vue:Xue;return m.jsxs("div",{className:"library-menu-items-container",style:i.length||g.length||U.length?{justifyContent:"flex-start"}:{borderBottom:0},children:[!v&&m.jsx(Y_,{selectedItems:d,onSelectItems:c,className:"library-menu-dropdown-container--in-heading"}),m.jsxs(la.Col,{className:"library-menu-items-container__items",align:"start",gap:1,style:{flex:U.length>0?1:"0 1 auto",marginBottom:0},ref:l,children:[m.jsxs(m.Fragment,{children:[!v&&m.jsx("div",{className:"library-menu-items-container__header",children:D("labels.personalLib")}),e&&m.jsx("div",{style:{position:"absolute",top:"var(--container-padding-y)",right:"var(--container-padding-x)",transform:"translateY(50%)"},children:m.jsx(il,{})}),!i.length&&!g.length?m.jsxs("div",{className:"library-menu-items__no-items",children:[m.jsx("div",{className:"library-menu-items__no-items__label",children:D("library.noItems")}),m.jsx("div",{className:"library-menu-items__no-items__hint",children:U.length>0?D("library.hint_emptyPrivateLibrary"):D("library.hint_emptyLibrary")})]}):m.jsxs(G_,{children:[i.length>0&&m.jsx(Ty,{itemsRenderedPerBatch:j,items:[{id:null,elements:i}],onItemSelectToggle:C,onItemDrag:k,onClick:T,isItemSelected:M,svgCache:f}),m.jsx(Ty,{itemsRenderedPerBatch:j,items:g,onItemSelectToggle:C,onItemDrag:k,onClick:R,isItemSelected:M,svgCache:f})]})]}),m.jsxs(m.Fragment,{children:[(U.length>0||i.length>0||g.length>0)&&m.jsx("div",{className:"library-menu-items-container__header library-menu-items-container__header--excal",children:D("labels.excalidrawLib")}),U.length>0?m.jsx(G_,{children:m.jsx(Ty,{itemsRenderedPerBatch:j,items:U,onItemSelectToggle:C,onItemDrag:k,onClick:R,isItemSelected:M,svgCache:f})}):g.length>0?m.jsx("div",{style:{margin:"1rem 0",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",width:"100%",fontSize:".9rem"},children:D("library.noItems")}):null]}),y&&m.jsx(gP,{style:{padding:"16px 0",width:"100%"},id:s,libraryReturnUrl:o,theme:a,children:m.jsx(Y_,{selectedItems:d,onSelectItems:c})})]})]})}var G7=hr(!1),q_=({children:e})=>m.jsx("div",{className:"layer-ui__library",children:e}),Gue=I.memo(({onInsertLibraryItems:e,pendingElements:t,onAddToLibrary:n,setAppState:r,libraryReturnUrl:i,library:a,id:s,theme:o,selectedItems:c,onSelectItems:d})=>{let[l]=kn(C1),h=I.useCallback(U=>{(async(y,v)=>{Jt("element","addToLibrary","ui");for(let w of vI)if(y.some(C=>C.type===w))return r({errorMessage:D(`errors.libraryElementTypeError.${w}`)});let x=[{status:"unpublished",elements:y,id:ga(),created:Date.now()},...v];n(),a.setLibrary(x).catch(()=>{r({errorMessage:D("alerts.errorAddingToLibrary")})})})(U,l.libraryItems)},[n,a,r,l.libraryItems]),f=I.useMemo(()=>l.libraryItems,[l]);if(l.status==="loading"&&!l.isInitialized)return m.jsx(q_,{children:m.jsx("div",{className:"layer-ui__library-message",children:m.jsxs("div",{children:[m.jsx(il,{size:"2em"}),m.jsx("span",{children:D("labels.libraryLoadingMessage")})]})})});let g=l.libraryItems.length>0||t.length>0;return m.jsxs(q_,{children:[m.jsx(Yue,{isLoading:l.status==="loading",libraryItems:f,onAddToLibrary:h,onInsertLibraryItems:e,pendingElements:t,id:s,libraryReturnUrl:i,theme:o,onSelectItems:d,selectedItems:c}),g&&m.jsx(gP,{className:"library-menu-control-buttons--at-bottom",style:{padding:"16px 12px 0 12px"},id:s,libraryReturnUrl:i,theme:o})]})}),My=(e,t)=>({elements:e,pending:gt(e,{selectedElementIds:t},{includeBoundTextElement:!0,includeElementsInFrames:!0}),selectedElementIds:t}),que=(e,t)=>{let n=u6(),[r,i]=I.useState(()=>My(n,e.selectedElementIds)),a=I.useRef(new Map);return I.useEffect(()=>{for(let s of r.pending)a.current.set(s.id,s.version)},[r.pending]),I.useEffect(()=>{t.state.cursorButton==="up"&&t.state.activeTool.type==="selection"&&i(s=>{var c;if(!yr(s.selectedElementIds,e.selectedElementIds))return a.current.clear(),My(n,e.selectedElementIds);let o=t.scene.getNonDeletedElementsMap();for(let d of Object.keys(e.selectedElementIds)){let l=(c=o.get(d))==null?void 0:c.version;if(l&&l!==a.current.get(d))return My(n,e.selectedElementIds)}return s})},[t,t.state.cursorButton,t.state.activeTool.type,e.selectedElementIds,n]),r.pending},Zue=I.memo(()=>{let e=io(),{onInsertElements:t}=e,n=a0(),r=Nr(),i=nr(),[a,s]=I.useState([]),o=I.useMemo(()=>e.library,[e.library]),c=que(r,e),d=I.useCallback(h=>{t(mP(h))},[t]),l=I.useCallback(()=>{i({selectedElementIds:{},selectedGroupIds:{},activeEmbeddable:null})},[i]);return m.jsx(Gue,{pendingElements:c,onInsertLibraryItems:d,onAddToLibrary:l,setAppState:i,libraryReturnUrl:n.libraryReturnUrl,library:o,id:e.id,theme:r.theme,selectedItems:a,onSelectItems:s})});function Kue(e){if(e&&typeof e=="number")return e;switch(e){case"small":return 550;case"wide":return 1024;case"regular":default:return 800}}var cs=e=>{let[t,n]=aue(),[r]=I.useState(document.activeElement),{id:i}=ao(),a=Yn().viewport.isMobile;I.useEffect(()=>{if(!t)return;let d=S3(t);setTimeout(()=>{d.length>0&&e.autofocus!==!1&&(d[1]||d[0]).focus()});let l=h=>{if(h.key===Z.TAB){let f=S3(t),{activeElement:g}=document,U=f.findIndex(y=>y===g);U===0&&h.shiftKey?(f[f.length-1].focus(),h.preventDefault()):U===f.length-1&&!h.shiftKey&&(f[0].focus(),h.preventDefault())}};return t.addEventListener("keydown",l),()=>t.removeEventListener("keydown",l)},[t,e.autofocus]);let s=nr(),o=JU(G7),c=()=>{s({openMenu:null}),o(!1),r.focus(),e.onCloseRequest()};return m.jsx(sue,{className:Fe("Dialog",e.className,{"Dialog--fullscreen":a}),labelledBy:"dialog-title",maxWidth:Kue(e.size),onCloseRequest:c,closeOnClickOutside:e.closeOnClickOutside,children:m.jsxs(ts,{ref:n,children:[e.title&&m.jsx("h2",{id:`${i}-dialog-title`,className:"Dialog__title",children:m.jsx("span",{className:"Dialog__titleContent",children:e.title})}),a&&m.jsx("button",{className:"Dialog__close",onClick:c,title:D("buttons.close"),"aria-label":D("buttons.close"),type:"button",children:Bh}),m.jsx("div",{className:"Dialog__content",children:e.children})]})})},jd=({type:e="button",onSelect:t,selected:n,children:r,className:i="",...a})=>m.jsx("button",{onClick:wU(a.onClick,s=>{t()}),type:e,className:Fe("excalidraw-button",i,{selected:n}),...a,children:r}),q7=I.forwardRef(({onChange:e,label:t,fullWidth:n,placeholder:r,readonly:i,selectOnRender:a,onKeyDown:s,isRedacted:o=!1,icon:c,className:d,...l},h)=>{let f=I.useRef(null);I.useImperativeHandle(h,()=>f.current),I.useLayoutEffect(()=>{var y,v;a&&((y=f.current)==null||y.focus(),(v=f.current)==null||v.select())},[a]);let[g,U]=I.useState(!1);return m.jsxs("div",{className:Fe("ExcTextField",d,{"ExcTextField--fullWidth":n,"ExcTextField--hasIcon":!!c}),onClick:()=>{var y;(y=f.current)==null||y.focus()},children:[c,t&&m.jsx("div",{className:"ExcTextField__label",children:t}),m.jsxs("div",{className:Fe("ExcTextField__input",{"ExcTextField__input--readonly":i}),children:[m.jsx("input",{className:Fe({"is-redacted":"value"in l&&l.value&&o&&!g}),readOnly:i,value:"value"in l?l.value:void 0,defaultValue:"defaultValue"in l?l.defaultValue:void 0,placeholder:r,ref:f,onChange:y=>e==null?void 0:e(y.target.value),onKeyDown:s}),o&&m.jsx(jd,{onSelect:()=>U(!g),style:{border:0,userSelect:"none"},children:g?Aq:kv})]})]})}),Que={toggleTheme:[pe("Shift+Alt+D")],saveScene:[pe("CtrlOrCmd+S")],loadScene:[pe("CtrlOrCmd+O")],clearCanvas:[pe("CtrlOrCmd+Delete")],imageExport:[pe("CtrlOrCmd+Shift+E")],commandPalette:[pe("CtrlOrCmd+/"),pe("CtrlOrCmd+Shift+P")],cut:[pe("CtrlOrCmd+X")],copy:[pe("CtrlOrCmd+C")],paste:[pe("CtrlOrCmd+V")],copyStyles:[pe("CtrlOrCmd+Alt+C")],pasteStyles:[pe("CtrlOrCmd+Alt+V")],selectAll:[pe("CtrlOrCmd+A")],deleteSelectedElements:[pe("Delete")],duplicateSelection:[pe("CtrlOrCmd+D"),pe(`Alt+${D("helpDialog.drag")}`)],sendBackward:[pe("CtrlOrCmd+[")],bringForward:[pe("CtrlOrCmd+]")],sendToBack:[pe(Xs?"CtrlOrCmd+Alt+[":"CtrlOrCmd+Shift+[")],bringToFront:[pe(Xs?"CtrlOrCmd+Alt+]":"CtrlOrCmd+Shift+]")],copyAsPng:[pe("Shift+Alt+C")],group:[pe("CtrlOrCmd+G")],ungroup:[pe("CtrlOrCmd+Shift+G")],gridMode:[pe("CtrlOrCmd+'")],zenMode:[pe("Alt+Z")],objectsSnapMode:[pe("Alt+S")],stats:[pe("Alt+/")],addToLibrary:[],flipHorizontal:[pe("Shift+H")],flipVertical:[pe("Shift+V")],viewMode:[pe("Alt+R")],hyperlink:[pe("CtrlOrCmd+K")],toggleElementLock:[pe("CtrlOrCmd+Shift+L")],resetZoom:[pe("CtrlOrCmd+0")],zoomOut:[pe("CtrlOrCmd+-")],zoomIn:[pe("CtrlOrCmd++")],zoomToFitSelection:[pe("Shift+3")],zoomToFit:[pe("Shift+1")],zoomToFitSelectionInViewport:[pe("Shift+2")],toggleEraserTool:[pe("E")],toggleHandTool:[pe("H")],setFrameAsActiveTool:[pe("F")],saveFileToDisk:[pe("CtrlOrCmd+S")],saveToActiveFile:[pe("CtrlOrCmd+S")],toggleShortcuts:[pe("?")],searchMenu:[pe("CtrlOrCmd+F")],wrapSelectionInFrame:[]},Rr=(e,t=0)=>{let n=Que[e];return n&&n.length>0?n[t]||n[0]:""},Jue="\\u0300-\\u036f",ehe="\\ufe20-\\ufe2f",the="\\u20d0-\\u20ff",nhe=Jue+ehe+the,rhe=`[${nhe}]`,ihe=RegExp(rhe,"g"),ahe=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,she={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"E",æ:"e",Þ:"T",þ:"t",ß:"s",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"I",ij:"i",Œ:"E",œ:"e",ʼn:"n",ſ:"s"},Z_=e=>e.replace(ahe,t=>she[t]||t).replace(ihe,""),wP=ke.createContext(null),yi=()=>ke.useContext(wP),ohe=lD(),lhe=()=>ke.useMemo(()=>({MainMenuTunnel:_s(),WelcomeScreenMenuHintTunnel:_s(),WelcomeScreenToolbarHintTunnel:_s(),WelcomeScreenHelpHintTunnel:_s(),WelcomeScreenCenterTunnel:_s(),FooterCenterTunnel:_s(),DefaultSidebarTriggerTunnel:_s(),DefaultSidebarTabTriggersTunnel:_s(),OverwriteConfirmDialogTunnel:_s(),TTDDialogTriggerTunnel:_s(),tunnelsJotai:ohe}),[]),EP=(e,t)=>{var r;let n=((r=t[0])==null?void 0:r.type)||null;for(let i of t)if(i.type!==n){n=null;break}return j3(e.activeTool.type)&&e.activeTool.type!=="image"&&n!=="image"&&n!=="frame"&&n!=="magicframe"||t.some(i=>j3(i.type))},CP=(e,t)=>mh(e.activeTool.type)||t.some(n=>mh(n.type)),SP=({appState:e,elementsMap:t,renderAction:n,app:r})=>{let i=ZL(t,e),a=!1;i.length===2&&(ma(i[0])||ma(i[1]))&&(a=!0);let s=!!(e.editingTextElement||e.newElement),o=Yn(),c=document.documentElement.getAttribute("dir")==="rtl",d=mh(e.activeTool.type)&&!Ga(e.currentItemBackgroundColor)||i.some(U=>mh(U.type)&&!Ga(U.backgroundColor)),l=i.length===1||a,h=!e.editingLinearElement&&i.length===1&&st(i[0])&&!Pe(i[0]),f=!e.croppingElementId&&i.length===1&&Lt(i[0]),g=!a&&Fi(e,r);return m.jsxs("div",{className:"panelColumn",children:[m.jsx("div",{children:EP(e,i)&&n("changeStrokeColor")}),CP(e,i)&&m.jsx("div",{children:n("changeBackgroundColor")}),d&&n("changeFillStyle"),(_C(e.activeTool.type)||i.some(U=>_C(U.type)))&&n("changeStrokeWidth"),(e.activeTool.type==="freedraw"||i.some(U=>U.type==="freedraw"))&&n("changeStrokeShape"),(kC(e.activeTool.type)||i.some(U=>kC(U.type)))&&m.jsxs(m.Fragment,{children:[n("changeStrokeStyle"),n("changeSloppiness")]}),(P3(e.activeTool.type)||i.some(U=>P3(U.type)))&&m.jsx(m.Fragment,{children:n("changeRoundness")}),(TC(e.activeTool.type)||i.some(U=>TC(U.type)))&&m.jsx(m.Fragment,{children:n("changeArrowType")}),(e.activeTool.type==="text"||i.some(Le))&&m.jsxs(m.Fragment,{children:[n("changeFontFamily"),n("changeFontSize"),(e.activeTool.type==="text"||Cne(i,t))&&n("changeTextAlign")]}),Ene(i,t)&&n("changeVerticalAlign"),(p2(e.activeTool.type)||i.some(U=>p2(U.type)))&&m.jsx(m.Fragment,{children:n("changeArrowhead")}),n("changeOpacity"),m.jsxs("fieldset",{children:[m.jsx("legend",{children:D("labels.layers")}),m.jsxs("div",{className:"buttonList",children:[n("sendToBack"),n("sendBackward"),n("bringForward"),n("bringToFront")]})]}),g&&!a&&m.jsxs("fieldset",{children:[m.jsx("legend",{children:D("labels.align")}),m.jsxs("div",{className:"buttonList",children:[c?m.jsxs(m.Fragment,{children:[n("alignRight"),n("alignHorizontallyCentered"),n("alignLeft")]}):m.jsxs(m.Fragment,{children:[n("alignLeft"),n("alignHorizontallyCentered"),n("alignRight")]}),i.length>2&&n("distributeHorizontally"),m.jsx("div",{style:{flexBasis:"100%",height:0}}),m.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:".5rem",marginTop:"-0.5rem"},children:[n("alignTop"),n("alignVerticallyCentered"),n("alignBottom"),i.length>2&&n("distributeVertically")]})]})]}),!s&&i.length>0&&m.jsxs("fieldset",{children:[m.jsx("legend",{children:D("labels.actions")}),m.jsxs("div",{className:"buttonList",children:[!o.editor.isMobile&&n("duplicateSelection"),!o.editor.isMobile&&n("deleteSelectedElements"),n("group"),n("ungroup"),l&&n("hyperlink"),f&&n("cropEditor"),h&&n("toggleLinearEditor")]})]})]})},_P=({activeTool:e,appState:t,app:n,UIOptions:r})=>{let[i,a]=I.useState(!1),s=e.type==="frame",o=e.type==="laser",c=e.type==="embeddable",{TTDDialogTriggerTunnel:d}=yi();return m.jsxs(m.Fragment,{children:[Av.map(({value:l,icon:h,key:f,numericKey:g,fillable:U},y)=>{var C;if(((C=r.tools)==null?void 0:C[l])===!1)return null;let v=D(`toolBar.${l}`),x=f&&Ap(typeof f=="string"?f:f[0]),w=x?`${x} ${D("helpDialog.or")} ${g}`:`${g}`;return m.jsx(Ct,{className:Fe("Shape",{fillable:U}),type:"radio",icon:h,checked:e.type===l,name:"editor-current-shape",title:`${Ap(v)} — ${w}`,keyBindingLabel:g||x,"aria-label":Ap(v),"aria-keyshortcuts":w,"data-testid":`toolbar-${l}`,onPointerDown:({pointerType:S})=>{!t.penDetected&&S==="pen"&&n.togglePenMode(!0)},onChange:({pointerType:S})=>{t.activeTool.type!==l&&Jt("toolbar",l,"ui"),l==="image"?n.setActiveTool({type:l,insertOnCanvasDirectly:S!=="mouse"}):n.setActiveTool({type:l})}},l)}),m.jsx("div",{className:"App-toolbar__divider"}),m.jsxs(dn,{open:i,children:[m.jsx(dn.Trigger,{className:Fe("App-toolbar__extra-tools-trigger",{"App-toolbar__extra-tools-trigger--selected":s||c||o&&!n.props.isCollaborating}),onToggle:()=>a(!i),title:D("toolBar.extraTools"),children:Mq}),m.jsxs(dn.Content,{onClickOutside:()=>a(!1),onSelect:()=>a(!1),className:"App-toolbar__extra-tools-dropdown",children:[m.jsx(dn.Item,{onSelect:()=>n.setActiveTool({type:"frame"}),icon:eA,shortcut:Z.F.toLocaleUpperCase(),"data-testid":"toolbar-frame",selected:s,children:D("toolBar.frame")}),m.jsx(dn.Item,{onSelect:()=>n.setActiveTool({type:"embeddable"}),icon:TG,"data-testid":"toolbar-embeddable",selected:c,children:D("toolBar.embeddable")}),m.jsx(dn.Item,{onSelect:()=>n.setActiveTool({type:"laser"}),icon:nA,"data-testid":"toolbar-laser",selected:o,shortcut:Z.K.toLocaleUpperCase(),children:D("toolBar.laser")}),m.jsx("div",{style:{margin:"6px 0",fontSize:14,fontWeight:600},children:"Generate"}),n.props.aiEnabled!==!1&&m.jsx(d.Out,{}),m.jsx(dn.Item,{onSelect:()=>n.setOpenDialog({name:"ttd",tab:"mermaid"}),icon:tA,"data-testid":"toolbar-embeddable",children:D("toolBar.mermaidToExcalidraw")}),n.props.aiEnabled!==!1&&n.plugins.diagramToCode&&m.jsx(m.Fragment,{children:m.jsxs(dn.Item,{onSelect:()=>n.onMagicframeToolSelect(),icon:rA,"data-testid":"toolbar-magicframe",children:[D("toolBar.magicframe"),m.jsx(dn.Item.Badge,{children:"AI"})]})})]})]})]})},che=({renderAction:e,zoom:t})=>m.jsx(la.Col,{gap:1,className:oh.ZOOM_ACTIONS,children:m.jsxs(la.Row,{align:"center",children:[e("zoomOut"),e("resetZoom"),e("zoomIn")]})}),dhe=({renderAction:e,className:t})=>m.jsxs("div",{className:`undo-redo-buttons ${t}`,children:[m.jsx("div",{className:"undo-button-container",children:m.jsx(Dd,{label:D("buttons.undo"),children:e("undo")})}),m.jsx("div",{className:"redo-button-container",children:m.jsxs(Dd,{label:D("buttons.redo"),children:[" ",e("redo")]})})]}),uhe=({actionManager:e,showExitZenModeBtn:t})=>m.jsx("button",{type:"button",className:Fe("disable-zen-mode",{"disable-zen-mode--visible":t}),onClick:()=>e.executeAction(y8),children:D("buttons.exitZenMode")}),hhe=({renderAction:e,className:t})=>m.jsx("div",{className:`finalize-button ${t}`,children:e("finalize",{size:"small"})}),K_=e=>{let t=I.useRef({userFn:e});return t.current.userFn=e,t.current.stableFn||(t.current.stableFn=(...n)=>t.current.userFn(...n)),t.current.stableFn},c6=hr(null),fhe=()=>{let[e,t]=kn(c6),n=vi();return e&&e==="clearCanvas"?m.jsx(UP,{onConfirm:()=>{n.executeAction(Op),t(null)},onCancel:()=>t(null),title:D("clearCanvasDialog.title"),children:m.jsxs("p",{className:"clear-canvas__content",children:[" ",D("alerts.clearReset")]})}):null},kP={};hM(kP,{toggleTheme:()=>phe});var phe={...P2,category:"App",label:"Toggle theme",perform:({actionManager:e})=>{e.executeAction(P2,"commandPalette")}},TP=Te({name:"copyElementLink",label:"labels.copyElementLink",icon:_v,trackEvent:{category:"element"},perform:async(e,t,n,r)=>{let i=gt(e,t);try{if(window.location){let a=_L(i,t);return a?(await K1(r.props.generateLinkForSelection?r.props.generateLinkForSelection(a.id,a.type):SL(a.id,a.type)),{appState:{toast:{message:D("toast.elementLinkCopied"),closable:!0}},captureUpdate:le.EVENTUALLY}):{appState:t,elements:e,app:r,captureUpdate:le.EVENTUALLY}}}catch(a){console.error(a)}return{appState:t,elements:e,app:r,captureUpdate:le.EVENTUALLY}},predicate:(e,t)=>E2(gt(e,t))}),mhe=Te({name:"linkToElement",label:"labels.linkToElement",icon:oA,perform:(e,t,n,r)=>{let i=gt(e,t);return i.length!==1||!E2(i)?{elements:e,appState:t,app:r,captureUpdate:le.EVENTUALLY}:{appState:{...t,openDialog:{name:"elementLinkSelector",sourceElementId:gt(e,t)[0].id}},captureUpdate:le.IMMEDIATELY}},predicate:(e,t,n,r)=>{var a;let i=gt(e,t);return((a=t.openDialog)==null?void 0:a.name)!=="elementLinkSelector"&&i.length===1&&E2(i)},trackEvent:!1}),ghe=hr(null),Ln={app:"App",export:"Export",tools:"Tools",editor:"Editor",elements:"Elements",links:"Links"},Uhe=e=>{switch(e){case Ln.app:return 1;case Ln.export:return 2;case Ln.editor:return 3;case Ln.tools:return 4;case Ln.elements:return 5;case Ln.links:return 6;default:return 10}},jg=({shortcut:e,className:t,children:n})=>{let r=e.replace("++","+$").split("+");return m.jsxs("div",{className:Fe("shortcut",t),children:[r.map((i,a)=>m.jsx("div",{className:"shortcut-wrapper",children:m.jsx("div",{className:"shortcut-key",children:i==="$"?"+":i})},i)),m.jsx("div",{className:"shortcut-desc",children:n})]})},MP=e=>!e.altKey&&e[Z.CTRL_OR_CMD]&&(e.shiftKey&&e.key.toLowerCase()===Z.P||e.key===Z.SLASH);Object.assign(e=>{var r;let t=Nr(),n=nr();return I.useEffect(()=>{let i=a=>{MP(a)&&(a.preventDefault(),a.stopPropagation(),n(s=>{var c;let o=((c=s.openDialog)==null?void 0:c.name)==="commandPalette"?null:{name:"commandPalette"};return o&&Jt("command_palette","open","shortcut"),{openDialog:o}}))};return window.addEventListener("keydown",i,{capture:!0}),()=>window.removeEventListener("keydown",i,{capture:!0})},[n]),((r=t.openDialog)==null?void 0:r.name)!=="commandPalette"?null:m.jsx(bhe,{...e})},{defaultItems:kP});function bhe({customCommandPaletteItems:e}){let t=io(),n=Nr(),r=nr(),i=a0(),a=vi(),[s,o]=kn(ghe),[c,d]=I.useState(null),l=I.useRef(null),h=n6({uiAppState:n,customCommandPaletteItems:e,appProps:i});I.useEffect(()=>{let{uiAppState:M,customCommandPaletteItems:T,appProps:R}=h,j=$=>{let q="";return $.label&&(typeof $.label=="function"?q=D($.label(t.scene.getNonDeletedElements(),M,t)):q=D($.label)),q},P=$=>typeof $.icon=="function"?$.icon(M,t.scene.getNonDeletedElements()):$.icon,N=[],F=($,q,W)=>{let V={label:j($),icon:P($),category:q,shortcut:Rr($.name),keywords:$.keywords,predicate:$.predicate,viewMode:$.viewMode,perform:()=>{a.executeAction($,"commandPalette")}};return W?W(V,$):V};if(M&&t.scene&&a){let $=[a.actions.group,a.actions.ungroup,a.actions.cut,a.actions.copy,a.actions.deleteSelectedElements,a.actions.wrapSelectionInFrame,a.actions.copyStyles,a.actions.pasteStyles,a.actions.bringToFront,a.actions.bringForward,a.actions.sendBackward,a.actions.sendToBack,a.actions.alignTop,a.actions.alignBottom,a.actions.alignLeft,a.actions.alignRight,a.actions.alignVerticallyCentered,a.actions.alignHorizontallyCentered,a.actions.duplicateSelection,a.actions.flipHorizontal,a.actions.flipVertical,a.actions.zoomToFitSelection,a.actions.zoomToFitSelectionInViewport,a.actions.increaseFontSize,a.actions.decreaseFontSize,a.actions.toggleLinearEditor,a.actions.cropEditor,uP,TP,mhe].map(Y=>F(Y,Ln.elements,(K,G)=>({...K,predicate:G.predicate?G.predicate:(ee,de,xe,ve)=>gt(ee,de).length>0}))),q=[a.actions.toggleHandTool,a.actions.setFrameAsActiveTool].map(Y=>F(Y,Ln.tools)),W=[a.actions.undo,a.actions.redo,a.actions.zoomIn,a.actions.zoomOut,a.actions.resetZoom,a.actions.zoomToFit,a.actions.zenMode,a.actions.viewMode,a.actions.gridMode,a.actions.objectsSnapMode,a.actions.toggleShortcuts,a.actions.selectAll,a.actions.toggleElementLock,a.actions.unlockAllElements,a.actions.stats].map(Y=>F(Y,Ln.editor)),V=[a.actions.saveToActiveFile,a.actions.saveFileToDisk,a.actions.copyAsPng,a.actions.copyAsSvg].map(Y=>F(Y,Ln.export));N=[...$,...W,{label:j(Op),icon:P(Op),shortcut:Rr(Op.name),category:Ln.editor,keywords:["delete","destroy"],viewMode:!1,perform:()=>{Za.set(c6,"clearCanvas")}},{label:D("buttons.exportImage"),category:Ln.export,icon:YI,shortcut:Rr("imageExport"),keywords:["export","image","png","jpeg","svg","clipboard","picture"],perform:()=>{r({openDialog:{name:"imageExport"}})}},...V];let B=[{label:D("toolBar.library"),category:Ln.app,icon:wv,viewMode:!1,perform:()=>{M.openSidebar?r({openSidebar:null}):r({openSidebar:{name:Qa.name,tab:Qa.defaultTab}})}},{label:D("search.title"),category:Ln.app,icon:kd,viewMode:!0,perform:()=>{a.executeAction(IP)}},{label:D("labels.changeStroke"),keywords:["color","outline"],category:Ln.elements,icon:Yb,viewMode:!1,predicate:(Y,K)=>{let G=gt(Y,K);return G.length>0&&EP(K,G)},perform:()=>{r(Y=>({openMenu:Y.openMenu==="shape"?null:"shape",openPopup:"elementStroke"}))}},{label:D("labels.changeBackground"),keywords:["color","fill"],icon:Yb,category:Ln.elements,viewMode:!1,predicate:(Y,K)=>{let G=gt(Y,K);return G.length>0&&CP(K,G)},perform:()=>{r(Y=>({openMenu:Y.openMenu==="shape"?null:"shape",openPopup:"elementBackground"}))}},{label:D("labels.canvasBackground"),keywords:["color"],icon:Yb,category:Ln.editor,viewMode:!1,perform:()=>{r(Y=>({openMenu:Y.openMenu==="canvas"?null:"canvas",openPopup:"canvasBackground"}))}},...Av.reduce((Y,K)=>{var Ce;let{value:G,icon:ee,key:de,numericKey:xe}=K;if(((Ce=R.UIOptions.tools)==null?void 0:Ce[G])===!1)return Y;let ve=de&&Ap(typeof de=="string"?de:de[0])||xe,Me={label:D(`toolBar.${G}`),category:Ln.tools,shortcut:ve,icon:ee,keywords:["toolbar"],viewMode:!1,perform:({event:ge})=>{G==="image"?t.setActiveTool({type:G,insertOnCanvasDirectly:ge.type==="keydown"}):t.setActiveTool({type:G})}};return Y.push(Me),Y},[]),...q,{label:D("toolBar.lock"),category:Ln.tools,icon:M.activeTool.locked?Ev:CU,shortcut:Z.Q.toLocaleUpperCase(),viewMode:!1,perform:()=>{t.toggleLock()}},{label:`${D("labels.textToDiagram")}...`,category:Ln.tools,icon:Lq,viewMode:!1,predicate:R.aiEnabled,perform:()=>{r(Y=>({...Y,openDialog:{name:"ttd",tab:"text-to-diagram"}}))}},{label:`${D("toolBar.mermaidToExcalidraw")}...`,category:Ln.tools,icon:tA,viewMode:!1,predicate:R.aiEnabled,perform:()=>{r(Y=>({...Y,openDialog:{name:"ttd",tab:"mermaid"}}))}}],z=[...N,...B,...T||[]].map(Y=>{var K;return{...Y,icon:Y.icon||iA,order:Y.order??Uhe(Y.category),haystack:`${Z_(Y.label.toLocaleLowerCase())} ${((K=Y.keywords)==null?void 0:K.join(" "))||""}`}});d(z),o(z.find(Y=>Y.label===(s==null?void 0:s.label))??null)}},[h,t,a,d,s==null?void 0:s.label,o,r]);let[f,g]=I.useState(""),[U,y]=I.useState(null),[v,x]=I.useState({}),w=M=>{r({openDialog:null},M),g("")},C=(M,T)=>{var R;((R=n.openDialog)==null?void 0:R.name)==="commandPalette"&&(T.stopPropagation(),T.preventDefault(),document.body.classList.add("excalidraw-animations-disabled"),w(()=>{M.perform({actionManager:a,event:T}),o(M),requestAnimationFrame(()=>{document.body.classList.remove("excalidraw-animations-disabled")})}))},S=K_(M=>M.viewMode===!1&&n.viewModeEnabled?!1:typeof M.predicate=="function"?M.predicate(t.scene.getNonDeletedElements(),n,i,t):M.predicate===void 0||M.predicate),k=K_(M=>{var P;let T=Zc(M.target)||MP(M)||M.key===Z.ESCAPE;if(T&&M.key!==Z.ARROW_UP&&M.key!==Z.ARROW_DOWN&&M.key!==Z.ENTER)return;let R=Object.values(v).flat(),j=s&&!f&&S(s);if(M.key===Z.ARROW_UP){M.preventDefault();let N=R.findIndex(q=>q.label===(U==null?void 0:U.label));if(j){if(N===0){y(s);return}if(U===s){let q=R[R.length-1];q&&y(q);return}}let F;N===-1?F=R.length-1:F=N===0?R.length-1:(N-1)%R.length;let $=R[F];$&&y($);return}if(M.key===Z.ARROW_DOWN){M.preventDefault();let N=R.findIndex(q=>q.label===(U==null?void 0:U.label));if(j){if(!U||N===R.length-1){y(s);return}if(U===s){let q=R[0];q&&y(q);return}}let F=(N+1)%R.length,$=R[F];$&&y($);return}if(M.key===Z.ENTER&&U&&setTimeout(()=>{C(U,M)}),!T){if(M.stopPropagation(),/^[a-zA-Z0-9]$/.test(M.key)){(P=l==null?void 0:l.current)==null||P.focus();return}M.preventDefault()}});return I.useEffect(()=>(window.addEventListener("keydown",k,{capture:!0}),()=>window.removeEventListener("keydown",k,{capture:!0})),[k]),I.useEffect(()=>{if(!c)return;let M=P=>{let N={};for(let F of P)N[F.category]?N[F.category].push(F):N[F.category]=[F];return N},T=c.filter(S).sort((P,N)=>P.order-N.order),R=!f&&s&&S(s);if(!f){x(M(R?T.filter(P=>P.label!==(s==null?void 0:s.label)):T)),y(R?s:T[0]||null);return}let j=Z_(f.toLocaleLowerCase().replace(/[<>_| -]/g,""));T=Xoe.filter(j,T,{extract:P=>P.haystack}).sort((P,N)=>N.score-P.score).map(P=>P.original),x(M(T)),y(T[0]??null)},[f,c,S,s]),m.jsxs(cs,{onCloseRequest:()=>w(),closeOnClickOutside:!0,title:!1,size:720,autofocus:!0,className:"command-palette-dialog",children:[m.jsx(q7,{value:f,placeholder:D("commandPalette.search.placeholder"),onChange:M=>{g(M)},selectOnRender:!0,ref:l}),!t.device.viewport.isMobile&&m.jsxs("div",{className:"shortcuts-wrapper",children:[m.jsx(jg,{shortcut:"↑↓",children:D("commandPalette.shortcuts.select")}),m.jsx(jg,{shortcut:"↵",children:D("commandPalette.shortcuts.confirm")}),m.jsx(jg,{shortcut:pe("Esc"),children:D("commandPalette.shortcuts.close")})]}),m.jsxs("div",{className:"commands",children:[s&&!f&&m.jsxs("div",{className:"command-category",children:[m.jsxs("div",{className:"command-category-title",children:[D("commandPalette.recents"),m.jsx("div",{className:"icon",style:{marginLeft:"6px"},children:Rq})]}),m.jsx(Q_,{command:s,isSelected:s.label===(U==null?void 0:U.label),onClick:M=>C(s,M),disabled:!S(s),onMouseMove:()=>y(s),showShortcut:!t.device.viewport.isMobile,appState:n})]}),Object.keys(v).length>0?Object.keys(v).map((M,T)=>m.jsxs("div",{className:"command-category",children:[m.jsx("div",{className:"command-category-title",children:M}),v[M].map(R=>m.jsx(Q_,{command:R,isSelected:R.label===(U==null?void 0:U.label),onClick:j=>C(R,j),onMouseMove:()=>y(R),showShortcut:!t.device.viewport.isMobile,appState:n},R.label))]},M)):c?m.jsxs("div",{className:"no-match",children:[m.jsx("div",{className:"icon",children:kd})," ",D("commandPalette.search.noMatch")]}):null]})]})}var Q_=({command:e,isSelected:t,disabled:n,onMouseMove:r,onClick:i,showShortcut:a,appState:s})=>{let o=()=>{};return m.jsxs("div",{className:Fe("command-item",{"item-selected":t,"item-disabled":n}),ref:c=>{var d;t&&!n&&((d=c==null?void 0:c.scrollIntoView)==null||d.call(c,{block:"nearest"}))},onClick:n?o:i,onMouseMove:n?o:r,title:n?D("commandPalette.itemNotAvailable"):"",children:[m.jsxs("div",{className:"name",children:[e.icon&&m.jsx(i6,{icon:typeof e.icon=="function"?e.icon(s):e.icon}),e.label]}),a&&e.shortcut&&m.jsx(jg,{shortcut:e.shortcut})]})},yhe=Te({name:"toggleLinearEditor",category:Ln.elements,label:(e,t,n)=>{var r;return((r=n.scene.getSelectedElements({selectedElementIds:t.selectedElementIds})[0])==null?void 0:r.type)==="arrow"?"labels.lineEditor.editArrow":"labels.lineEditor.edit"},keywords:["line"],trackEvent:{category:"element"},predicate:(e,t,n,r)=>{let i=r.scene.getSelectedElements(t);return!!(!t.editingLinearElement&&i.length===1&&st(i[0])&&!Pe(i[0]))},perform(e,t,n,r){var s;let i=r.scene.getSelectedElements({selectedElementIds:t.selectedElementIds,includeBoundTextElement:!0})[0],a=((s=t.editingLinearElement)==null?void 0:s.elementId)===i.id?null:new Re(i);return{appState:{...t,editingLinearElement:a},captureUpdate:le.IMMEDIATELY}},PanelComponent:({appState:e,updateData:t,app:n})=>{let r=n.scene.getSelectedElements({selectedElementIds:e.selectedElementIds})[0],i=D(r.type==="arrow"?"labels.lineEditor.editArrow":"labels.lineEditor.edit");return m.jsx(Ct,{type:"button",icon:Yq,title:i,"aria-label":i,onClick:()=>t(null)})}}),IP=Te({name:"searchMenu",icon:kd,keywords:["search","find"],label:"search.title",viewMode:!0,trackEvent:{category:"search_menu",action:"toggle",predicate:e=>e.gridModeEnabled},perform(e,t,n,r){var i,a;if(((i=t.openSidebar)==null?void 0:i.name)===Qa.name&&t.openSidebar.tab===Gu){let s=(a=r.excalidrawContainerValue.container)==null?void 0:a.querySelector(`.${oh.SEARCH_MENU_INPUT_WRAPPER} input`);return s!=null&&s.matches(":focus")?{appState:{...t,openSidebar:null},captureUpdate:le.EVENTUALLY}:(s==null||s.focus(),s==null||s.select(),!1)}return{appState:{...t,openSidebar:{name:Qa.name,tab:Gu},openDialog:null},captureUpdate:le.EVENTUALLY}},checked:e=>e.gridModeEnabled,predicate:(e,t,n)=>n.gridModeEnabled===void 0,keyTest:e=>e[Z.CTRL_OR_CMD]&&e.key===Z.F}),vhe=Te({name:"cropEditor",label:"helpDialog.cropStart",icon:xC,viewMode:!0,trackEvent:{category:"menu"},keywords:["image","crop"],perform(e,t,n,r){let i=r.scene.getSelectedElements({selectedElementIds:t.selectedElementIds,includeBoundTextElement:!0})[0];return{appState:{...t,isCropping:!1,croppingElementId:i.id},captureUpdate:le.IMMEDIATELY}},predicate:(e,t,n,r)=>{let i=r.scene.getSelectedElements(t);return!!(!t.croppingElementId&&i.length===1&&Lt(i[0]))},PanelComponent:({appState:e,updateData:t,app:n})=>{let r=D("helpDialog.cropStart");return m.jsx(Ct,{type:"button",icon:xC,title:r,"aria-label":r,onClick:()=>t(null)})}}),N2=class{constructor(e=!0,t=!0){this.isUndoStackEmpty=e,this.isRedoStackEmpty=t}},J_=class yp{constructor(){H(this,"onHistoryChangedEmitter",new As),H(this,"undoStack",[]),H(this,"redoStack",[])}get isUndoStackEmpty(){return this.undoStack.length===0}get isRedoStackEmpty(){return this.redoStack.length===0}clear(){this.undoStack.length=0,this.redoStack.length=0}record(t,n){let r=xhe.create(n,t);r.isEmpty()||(this.undoStack.push(r.inverse()),r.elementsChange.isEmpty()||(this.redoStack.length=0),this.onHistoryChangedEmitter.trigger(new N2(this.isUndoStackEmpty,this.isRedoStackEmpty)))}undo(t,n,r){return this.perform(t,n,r,()=>yp.pop(this.undoStack),i=>yp.push(this.redoStack,i,t))}redo(t,n,r){return this.perform(t,n,r,()=>yp.pop(this.redoStack),i=>yp.push(this.undoStack,i,t))}perform(t,n,r,i,a){try{let s=i();if(s===null)return;let o=t,c=n,d=!1;for(;s;){try{[o,c,d]=s.applyTo(o,c,r)}finally{a(s)}if(d)break;s=i()}return[o,c]}finally{this.onHistoryChangedEmitter.trigger(new N2(this.isUndoStackEmpty,this.isRedoStackEmpty))}}static pop(t){if(!t.length)return null;let n=t.pop();return n!==void 0?n:null}static push(t,n,r){let i=n.inverse().applyLatestChanges(r);return t.push(i)}},xhe=class Pg{constructor(t,n){this.appStateChange=t,this.elementsChange=n}static create(t,n){return new Pg(t,n)}inverse(){return new Pg(this.appStateChange.inverse(),this.elementsChange.inverse())}applyTo(t,n,r){let[i,a]=this.elementsChange.applyTo(t,r.elements),[s,o]=this.appStateChange.applyTo(n,i);return[i,s,a||o]}applyLatestChanges(t){let n=this.elementsChange.applyLatestChanges(t);return Pg.create(this.appStateChange,n)}isEmpty(){return this.appStateChange.isEmpty()&&this.elementsChange.isEmpty()}},AP=(e,t)=>{let[n,r]=I.useState(t);return I.useEffect(()=>{let i=e.on(a=>{r(a)});return()=>{i()}},[e]),n},LP=(e,t,n)=>{if(!t.multiElement&&!t.resizingElement&&!t.editingTextElement&&!t.newElement&&!t.selectedElementsAreBeingDragged&&!t.selectionElement&&!e.flowChartCreator.isCreatingChart){let r=n();if(!r)return{captureUpdate:le.EVENTUALLY};let[i,a]=r,s=Array.from(i.values());return{appState:a,elements:s,captureUpdate:le.NEVER}}return{captureUpdate:le.EVENTUALLY}},whe=(e,t)=>({name:"undo",label:"buttons.undo",icon:sC,trackEvent:{category:"history"},viewMode:!1,perform:(n,r,i,a)=>LP(a,r,()=>e.undo(nt(n),r,t.snapshot)),keyTest:n=>n[Z.CTRL_OR_CMD]&&R3(n,Z.Z)&&!n.shiftKey,PanelComponent:({updateData:n,data:r})=>{let{isUndoStackEmpty:i}=AP(e.onHistoryChangedEmitter,new N2(e.isUndoStackEmpty,e.isRedoStackEmpty));return m.jsx(Ct,{type:"button",icon:sC,"aria-label":D("buttons.undo"),onClick:n,size:(r==null?void 0:r.size)||"medium",disabled:i,"data-testid":"button-undo"})}}),Ehe=(e,t)=>({name:"redo",label:"buttons.redo",icon:oC,trackEvent:{category:"history"},viewMode:!1,perform:(n,r,i,a)=>LP(a,r,()=>e.redo(nt(n),r,t.snapshot)),keyTest:n=>n[Z.CTRL_OR_CMD]&&n.shiftKey&&R3(n,Z.Z)||pI&&n.ctrlKey&&!n.shiftKey&&R3(n,Z.Y),PanelComponent:({updateData:n,data:r})=>{let{isRedoStackEmpty:i}=AP(e.onHistoryChangedEmitter,new N2(e.isUndoStackEmpty,e.isRedoStackEmpty));return m.jsx(Ct,{type:"button",icon:oC,"aria-label":D("buttons.redo"),onClick:n,size:(r==null?void 0:r.size)||"medium",disabled:i,"data-testid":"button-redo"})}}),Iy=(e,t,n,r,i,a)=>{if(e.trackEvent)try{typeof e.trackEvent=="object"&&(!e.trackEvent.predicate||e.trackEvent.predicate(n,r,a))&&Jt(e.trackEvent.category,e.trackEvent.action||e.name,`${t} (${i.device.editor.isMobile?"mobile":"desktop"})`)}catch(s){console.error("error while logging action:",s)}},Che=class{constructor(e,t,n,r){H(this,"actions",{}),H(this,"updater"),H(this,"getAppState"),H(this,"getElementsIncludingDeleted"),H(this,"app"),H(this,"renderAction",(i,a)=>{let s=this.app.props.UIOptions.canvasActions;if(this.actions[i]&&"PanelComponent"in this.actions[i]&&(!(i in s)||s[i])){let o=this.actions[i],c=o.PanelComponent;c.displayName="PanelComponent";let d=this.getElementsIncludingDeleted(),l=this.getAppState(),h=f=>{Iy(o,"ui",l,d,this.app,f),this.updater(o.perform(this.getElementsIncludingDeleted(),this.getAppState(),f,this.app))};return m.jsx(c,{elements:this.getElementsIncludingDeleted(),appState:this.getAppState(),updateData:h,appProps:this.app.props,app:this.app,data:a})}return null}),H(this,"isActionEnabled",i=>{let a=this.getElementsIncludingDeleted(),s=this.getAppState();return!i.predicate||i.predicate(a,s,this.app.props,this.app)}),this.updater=i=>{if(W1(i))i.then(a=>e(a));else return e(i)},this.getAppState=t,this.getElementsIncludingDeleted=n,this.app=r}registerAction(e){this.actions[e.name]=e}registerAll(e){e.forEach(t=>this.registerAction(t))}handleKeyDown(e){let t=this.app.props.UIOptions.canvasActions,n=Object.values(this.actions).sort((o,c)=>(c.keyPriority||0)-(o.keyPriority||0)).filter(o=>(o.name in t?t[o.name]:!0)&&o.keyTest&&o.keyTest(e,this.getAppState(),this.getElementsIncludingDeleted(),this.app));if(n.length!==1)return n.length>1&&console.warn("Canceling as multiple actions match this shortcut",n),!1;let r=n[0];if(this.getAppState().viewModeEnabled&&r.viewMode!==!0)return!1;let i=this.getElementsIncludingDeleted(),a=this.getAppState();return Iy(r,"keyboard",a,i,this.app,null),e.preventDefault(),e.stopPropagation(),this.updater(n[0].perform(i,a,null,this.app)),!0}executeAction(e,t="api",n=null){let r=this.getElementsIncludingDeleted(),i=this.getAppState();Iy(e,t,i,r,this.app,n),this.updater(e.perform(r,i,n,this.app))}},ek=e=>{let t=Array.from(e.values());return{x:nk(t,n=>n.x)/t.length,y:nk(t,n=>n.y)/t.length}},tk=([e,t])=>Math.hypot(e.x-t.x,e.y-t.y),nk=(e,t)=>e.reduce((n,r)=>n+t(r),0),She=({children:e,left:t,top:n,onCloseRequest:r,fitInViewport:i=!1,offsetLeft:a=0,offsetTop:s=0,viewportWidth:o=window.innerWidth,viewportHeight:c=window.innerHeight})=>{let d=I.useRef(null);I.useEffect(()=>{let h=d.current;if(!h)return;h.contains(document.activeElement)||h.focus();let f=g=>{var U,y,v;if(g.key===Z.TAB){let x=S3(h),{activeElement:w}=document,C=x.findIndex(S=>S===w);w===h?(g.shiftKey?(U=x[x.length-1])==null||U.focus():x[0].focus(),g.preventDefault(),g.stopImmediatePropagation()):C===0&&g.shiftKey?((y=x[x.length-1])==null||y.focus(),g.preventDefault(),g.stopImmediatePropagation()):C===x.length-1&&!g.shiftKey&&((v=x[0])==null||v.focus(),g.preventDefault(),g.stopImmediatePropagation())}};return h.addEventListener("keydown",f),()=>h.removeEventListener("keydown",f)},[]);let l=I.useRef(null);return I.useLayoutEffect(()=>{var h,f;if(i&&d.current&&n!=null&&t!=null){let g=d.current,{width:U,height:y}=g.getBoundingClientRect();if(((h=l.current)==null?void 0:h.top)===n&&((f=l.current)==null?void 0:f.left)===t)return;l.current={top:n,left:t},U>=o?(g.style.width=`${o}px`,g.style.left="0px",g.style.overflowX="scroll"):t+U-a>o?g.style.left=`${o-U-10}px`:g.style.left=`${t}px`,y>=c?(g.style.height=`${c-20}px`,g.style.top="10px",g.style.overflowY="scroll"):n+y-s>c?g.style.top=`${c-y}px`:g.style.top=`${n}px`}},[n,t,i,o,c,a,s]),I.useEffect(()=>{if(r){let h=f=>{var g;(g=d.current)!=null&&g.contains(f.target)||Jn.unstable_batchedUpdates(()=>r(f))};return document.addEventListener("pointerdown",h,!1),()=>document.removeEventListener("pointerdown",h,!1)}},[r]),m.jsx("div",{className:"popover",ref:d,tabIndex:-1,children:e})},Zn="separator",_he=ke.memo(({actionManager:e,items:t,top:n,left:r,onClose:i})=>{let a=s0(),s=u6(),o=t.reduce((c,d)=>(d&&(d===Zn||!d.predicate||d.predicate(s,a,e.app.props,e.app))&&c.push(d),c),[]);return m.jsx(She,{onCloseRequest:()=>{i()},top:n,left:r,fitInViewport:!0,offsetLeft:a.offsetLeft,offsetTop:a.offsetTop,viewportWidth:a.width,viewportHeight:a.height,children:m.jsx("ul",{className:"context-menu",onContextMenu:c=>c.preventDefault(),children:o.map((c,d)=>{var f;if(c===Zn)return!o[d-1]||o[d-1]===Zn?null:m.jsx("hr",{className:"context-menu-item-separator"},d);let l=c.name,h="";return c.label&&(typeof c.label=="function"?h=D(c.label(s,a,e.app)):h=D(c.label)),m.jsx("li",{"data-testid":l,onClick:()=>{i(()=>{e.executeAction(c,"contextMenu")})},children:m.jsxs("button",{type:"button",className:Fe("context-menu-item",{dangerous:l==="deleteSelectedElements",checkmark:(f=c.checked)==null?void 0:f.call(c,a)}),children:[m.jsx("div",{className:"context-menu-item__label",children:h}),m.jsx("kbd",{className:"context-menu-item__shortcut",children:l?Rr(l):""})]})},d)})})})}),khe=({children:e,onClose:t})=>{let[n,r]=I.useState(!!e),{container:i}=ao(),a=ke.useCallback(()=>{r(!1),t&&t(),i==null||i.focus()},[t,i]);return m.jsx(m.Fragment,{children:n&&m.jsx(cs,{size:"small",onCloseRequest:a,title:D("errorDialog.title"),children:m.jsx("div",{style:{whiteSpace:"pre-wrap"},children:e})})})},RP=function({onChange:e,value:t,choices:n,name:r}){return m.jsx("div",{className:"RadioGroup",children:n.map(i=>m.jsxs("div",{className:Fe("RadioGroup__choice",{active:i.value===t}),title:i.ariaLabel,children:[m.jsx("input",{name:r,type:"radio",checked:i.value===t,onChange:()=>e(i.value),"aria-label":i.ariaLabel}),i.label]},String(i.value)))})},Ym=({title:e,name:t,checked:n,onChange:r,disabled:i=!1})=>m.jsx("div",{className:Fe("Switch",{toggled:n,disabled:i}),children:m.jsx("input",{name:t,id:t,title:e,type:"checkbox",checked:n,disabled:i,onChange:()=>r(!n),onKeyDown:a=>{a.key===" "&&r(!n)}})}),$p=I.forwardRef(({children:e,icon:t,onClick:n,label:r,variant:i="filled",color:a="primary",size:s="medium",fullWidth:o,className:c,status:d},l)=>{let[h,f]=I.useState(!1),g=async y=>{let v=n==null?void 0:n(y);if(W1(v)){let x=window.setTimeout(()=>{f(!0)},50);try{await v}catch(w){if(w instanceof kU)console.warn(w);else throw w}finally{clearTimeout(x),f(!1)}}},U=h?"loading":d;return a=U==="success"?"success":a,m.jsx("button",{className:Fe("ExcButton",`ExcButton--color-${a}`,`ExcButton--variant-${i}`,`ExcButton--size-${s}`,`ExcButton--status-${U}`,{"ExcButton--fullWidth":o},c),onClick:g,type:"button","aria-label":r,ref:l,disabled:U==="loading"||U==="success",children:m.jsxs("div",{className:"ExcButton__contents",children:[U==="loading"?m.jsx(il,{className:"ExcButton__statusIcon"}):U==="success"&&m.jsx("div",{className:"ExcButton__statusIcon",children:_q}),t&&m.jsx("div",{className:"ExcButton__icon","aria-hidden":!0,children:t}),i!=="icon"&&(e??r)]})})}),The=2e3,Mhe=()=>{let[e,t]=I.useState(null),n=I.useRef(0),r=()=>{clearTimeout(n.current),t("success"),n.current=window.setTimeout(()=>{t(null)},The)},i=I.useCallback(()=>{t(null)},[]);return{copyStatus:e,resetCopyStatus:i,onCopy:r}},Ihe="filter"in document.createElement("canvas").getContext("2d"),Ahe=()=>m.jsxs("div",{children:[m.jsx("h3",{children:D("canvasError.cannotShowPreview")}),m.jsx("p",{children:m.jsx("span",{children:D("canvasError.canvasTooBig")})}),m.jsxs("em",{children:["(",D("canvasError.canvasTooBigTip"),")"]})]}),Lhe=({appStateSnapshot:e,elementsSnapshot:t,files:n,actionManager:r,onExportImage:i,name:a})=>{let s=Vn(t,e),[o,c]=I.useState(a),[d,l]=I.useState(s),[h,f]=I.useState(e.exportBackground),[g,U]=I.useState(e.exportWithDarkMode),[y,v]=I.useState(e.exportEmbedScene),[x,w]=I.useState(e.exportScale),C=I.useRef(null),[S,k]=I.useState(null),{onCopy:M,copyStatus:T,resetCopyStatus:R}=Mhe();I.useEffect(()=>{R()},[o,h,g,x,y,R]);let{exportedElements:j,exportingFrame:P}=s6(t,e,d);return I.useEffect(()=>{let N=C.current;if(!N)return;let F=N.offsetWidth,$=N.offsetHeight;F&&Q1({elements:j,appState:{...e,name:o,exportBackground:h,exportWithDarkMode:g,exportScale:x,exportEmbedScene:y},files:n,exportPadding:Oh,maxWidthOrHeight:Math.max(F,$),exportingFrame:P}).then(q=>(k(null),v1(q).then(()=>{N.replaceChildren(q)}).catch(W=>{throw W.name==="CANVAS_POSSIBLY_TOO_BIG"?new Error(D("canvasError.canvasTooBig")):W}))).catch(q=>{console.error(q),k(q)})},[e,n,j,P,o,h,g,x,y]),m.jsxs("div",{className:"ImageExportModal",children:[m.jsx("h3",{children:D("imageExportDialog.header")}),m.jsxs("div",{className:"ImageExportModal__preview",children:[m.jsx("div",{className:"ImageExportModal__preview__canvas",ref:C,children:S&&m.jsx(Ahe,{})}),m.jsx("div",{className:"ImageExportModal__preview__filename",children:!Bd&&m.jsx("input",{type:"text",className:"TextInput",value:o,style:{width:"30ch"},onChange:N=>{c(N.target.value),r.executeAction(_de,"ui",N.target.value)}})})]}),m.jsxs("div",{className:"ImageExportModal__settings",children:[m.jsx("h3",{children:D("imageExportDialog.header")}),s&&m.jsx(Yf,{label:D("imageExportDialog.label.onlySelected"),name:"exportOnlySelected",children:m.jsx(Ym,{name:"exportOnlySelected",checked:d,onChange:N=>{l(N)}})}),m.jsx(Yf,{label:D("imageExportDialog.label.withBackground"),name:"exportBackgroundSwitch",children:m.jsx(Ym,{name:"exportBackgroundSwitch",checked:h,onChange:N=>{f(N),r.executeAction(Tde,"ui",N)}})}),Ihe&&m.jsx(Yf,{label:D("imageExportDialog.label.darkMode"),name:"exportDarkModeSwitch",children:m.jsx(Ym,{name:"exportDarkModeSwitch",checked:g,onChange:N=>{U(N),r.executeAction(Mde,"ui",N)}})}),m.jsx(Yf,{label:D("imageExportDialog.label.embedScene"),tooltip:D("imageExportDialog.tooltip.embedScene"),name:"exportEmbedSwitch",children:m.jsx(Ym,{name:"exportEmbedSwitch",checked:y,onChange:N=>{v(N),r.executeAction(nP,"ui",N)}})}),m.jsx(Yf,{label:D("imageExportDialog.label.scale"),name:"exportScale",children:m.jsx(RP,{name:"exportScale",value:x,onChange:N=>{w(N),r.executeAction(kde,"ui",N)},choices:pv.map(N=>({value:N,label:`${N}×`}))})}),m.jsxs("div",{className:"ImageExportModal__settings__buttons",children:[m.jsx($p,{className:"ImageExportModal__settings__buttons__button",label:D("imageExportDialog.title.exportToPng"),onClick:()=>i($b.png,j,{exportingFrame:P}),icon:vC,children:D("imageExportDialog.button.exportToPng")}),m.jsx($p,{className:"ImageExportModal__settings__buttons__button",label:D("imageExportDialog.title.exportToSvg"),onClick:()=>i($b.svg,j,{exportingFrame:P}),icon:vC,children:D("imageExportDialog.button.exportToSvg")}),(r7||a1)&&m.jsx($p,{className:"ImageExportModal__settings__buttons__button",label:D("imageExportDialog.title.copyPngToClipboard"),status:T,onClick:async()=>{await i($b.clipboard,j,{exportingFrame:P}),M()},icon:_v,children:D("imageExportDialog.button.copyPngToClipboard")})]})]})]})},Yf=({label:e,children:t,tooltip:n,name:r})=>m.jsxs("div",{className:"ImageExportModal__settings__setting",title:e,children:[m.jsxs("label",{htmlFor:r,className:"ImageExportModal__settings__setting__label",children:[e,n&&m.jsx(Dd,{label:n,long:!0,children:Sq})]}),m.jsx("div",{className:"ImageExportModal__settings__setting__content",children:t})]}),Rhe=({elements:e,appState:t,files:n,actionManager:r,onExportImage:i,onCloseRequest:a,name:s})=>{let[{appStateSnapshot:o,elementsSnapshot:c}]=I.useState(()=>({appStateSnapshot:Ho(t),elementsSnapshot:Ho(e)}));return m.jsx(cs,{onCloseRequest:a,size:"wide",title:!1,children:m.jsx(Lhe,{elementsSnapshot:c,appStateSnapshot:o,files:n,actionManager:r,onExportImage:i,name:s})})},DP=({children:e,side:t,className:n})=>m.jsx("div",{className:Fe("FixedSideContainer",`FixedSideContainer_side_${t}`,n),children:e}),eh=100,th=100,rk=e=>{switch(e){case Z.ARROW_UP:return"up";case Z.ARROW_DOWN:return"down";case Z.ARROW_RIGHT:return"right";case Z.ARROW_LEFT:return"left";default:return"right"}},jP=(e,t,n,r)=>{let i=[...n.values()].reduce((a,s)=>{var c;let o;if(Pe(s)&&(o=s[e==="predecessors"?"startBinding":"endBinding"])&&((c=s[e==="predecessors"?"endBinding":"startBinding"])==null?void 0:c.elementId)===t.id){let d=n.get(o.elementId);if(!d)return a;Dr(is(d),"not an ExcalidrawBindableElement");let l=e==="predecessors"?s.points[s.points.length-1]:[0,0],h=RA(t,Ds(t),[l[0]+s.x,l[1]+s.y]);a.push({relative:d,heading:h})}return a},[]);switch(r){case"up":return i.filter(a=>_n(a.heading,ui)).map(a=>a.relative);case"down":return i.filter(a=>_n(a.heading,cr)).map(a=>a.relative);case"right":return i.filter(a=>_n(a.heading,Cn)).map(a=>a.relative);case"left":return i.filter(a=>_n(a.heading,di)).map(a=>a.relative)}},C8=(e,t,n)=>jP("successors",e,t,n),S8=(e,t,n)=>jP("predecessors",e,t,n),Dhe=(e,t,n)=>{let r=th+e.width;if(n==="up"||n==="down"){let o=eh+e.height,c=e.x,d=e.x+e.width;if(t.every(l=>l.x+l.width<c||l.x>d))return{x:0,y:o*(n==="up"?-1:1)}}else if(n==="right"||n==="left"){let o=e.y,c=e.y+e.height;if(t.every(d=>d.y+d.height<o||d.y>c))return{x:(th+e.width)*(n==="left"?-1:1),y:0}}if(n==="up"||n==="down"){let o=eh+e.height,c=(t.length,o),d=t.length===0?0:(t.length+1)%2===0?(t.length+1)/2*r:t.length/2*r*-1;return n==="up"?{x:d,y:c*-1}:{x:d,y:c}}let i=eh+e.height,a=(t.length,th+e.width),s=t.length===0?0:(t.length+1)%2===0?(t.length+1)/2*i:t.length/2*i*-1;return n==="left"?{x:a*-1,y:s}:{x:a,y:s}},jhe=(e,t,n,r)=>{let i=C8(e,t,r),a=S8(e,t,r),s=Dhe(e,[...i,...a],r),o=qs({type:e.type,x:e.x+s.x,y:e.y+s.y,width:e.width,height:e.height,roundness:e.roundness,roughness:e.roughness,backgroundColor:e.backgroundColor,strokeColor:e.strokeColor,strokeWidth:e.strokeWidth,opacity:e.opacity,fillStyle:e.fillStyle,strokeStyle:e.strokeStyle});Dr(EU(o),"not an ExcalidrawFlowchartNodeElement");let c=PP(e,o,t,r,n);return{nextNode:o,bindingArrow:c}},Phe=(e,t,n,r,i)=>{let a=[];for(let s=0;s<i;s++){let o,c;if(r==="left"||r==="right"){let h=eh*(i-1)+i*e.height,f=e.y+e.height/2-h/2,g=th+e.width;r==="left"&&(g*=-1),o=e.x+g;let U=(eh+e.height)*s;c=f+U}else{let h=th*(i-1)+i*e.width,f=e.x+e.width/2-h/2,g=eh+e.height;r==="up"&&(g*=-1),c=e.y+g;let U=(th+e.width)*s;o=f+U}let d=qs({type:e.type,x:o,y:c,width:e.width,height:e.height,roundness:e.roundness,roughness:e.roughness,backgroundColor:e.backgroundColor,strokeColor:e.strokeColor,strokeWidth:e.strokeWidth,opacity:e.opacity,fillStyle:e.fillStyle,strokeStyle:e.strokeStyle});Dr(EU(d),"not an ExcalidrawFlowchartNodeElement");let l=PP(e,d,t,r,n);a.push(d),a.push(l)}return a},PP=(e,t,n,r,i)=>{let a,s;switch(r){case"up":{a=e.x+e.width/2,s=e.y-6;break}case"down":{a=e.x+e.width/2,s=e.y+e.height+6;break}case"right":{a=e.x+e.width+6,s=e.y+e.height/2;break}case"left":{a=e.x-6,s=e.y+e.height/2;break}}let o,c;switch(r){case"up":{o=t.x+t.width/2-a,c=t.y+t.height-s+6;break}case"down":{o=t.x+t.width/2-a,c=t.y-s-6;break}case"right":{o=t.x-a-6,c=t.y-s+t.height/2;break}case"left":{o=t.x+t.width-a+6,c=t.y-s+t.height/2;break}}let d=$v({type:"arrow",x:a,y:s,startArrowhead:null,endArrowhead:i.currentItemEndArrowhead,strokeColor:e.strokeColor,strokeStyle:e.strokeStyle,strokeWidth:e.strokeWidth,opacity:e.opacity,roughness:e.roughness,points:[A(0,0),A(o,c)],elbowed:!0});Ys(d,e,"start",n),Ys(d,t,"end",n);let l=new Map;l.set(e.id,e),l.set(t.id,t),l.set(d.id,d),Re.movePoints(d,[{index:1,point:d.points[1]}]);let h=Zv(d,fa(new Map([...n.entries(),[e.id,e],[t.id,t],[d.id,d]])),{points:d.points});return{...d,...h}},Nhe=class{constructor(){H(this,"isExploring",!1),H(this,"sameLevelNodes",[]),H(this,"sameLevelIndex",0),H(this,"direction",null),H(this,"visitedNodes",new Set)}clear(){this.isExploring=!1,this.sameLevelNodes=[],this.sameLevelIndex=0,this.direction=null,this.visitedNodes.clear()}exploreByDirection(e,t,n){if(!is(e))return null;if(n!==this.direction&&this.clear(),this.visitedNodes.has(e.id)||this.visitedNodes.add(e.id),this.isExploring&&n===this.direction&&this.sameLevelNodes.length>1)return this.sameLevelIndex=(this.sameLevelIndex+1)%this.sameLevelNodes.length,this.sameLevelNodes[this.sameLevelIndex].id;let r=[...C8(e,t,n),...S8(e,t,n)];if(r.length>0)return this.sameLevelIndex=0,this.isExploring=!0,this.sameLevelNodes=r,this.direction=n,this.visitedNodes.add(r[0].id),r[0].id;if(n===this.direction||!this.isExploring){this.isExploring||this.visitedNodes.add(e.id);let i=["up","right","down","left"].filter(a=>a!==n).map(a=>[...C8(e,t,a),...S8(e,t,a)]).flat().filter(a=>!this.visitedNodes.has(a.id));for(let a of i)if(!this.visitedNodes.has(a.id))return this.visitedNodes.add(a.id),this.isExploring=!0,this.direction=n,a.id}return null}},Ohe=class{constructor(){H(this,"isCreatingChart",!1),H(this,"numberOfNodes",0),H(this,"direction","right"),H(this,"pendingNodes",null)}createNodes(e,t,n,r){if(r!==this.direction){let{nextNode:i,bindingArrow:a}=jhe(e,t,n,r);this.numberOfNodes=1,this.isCreatingChart=!0,this.direction=r,this.pendingNodes=[i,a]}else{this.numberOfNodes+=1;let i=Phe(e,t,n,r,this.numberOfNodes);this.isCreatingChart=!0,this.direction=r,this.pendingNodes=i}if(e.frameId){let i=t.get(e.frameId);Dr(i&&PI(i),"not an ExcalidrawFrameElement"),i&&this.pendingNodes.every(a=>J1([a],i,t)||pc(a,i,t))&&(this.pendingNodes=this.pendingNodes.map(a=>me(a,{frameId:e.frameId},!1)))}}clear(){this.isCreatingChart=!1,this.pendingNodes=null,this.direction=null,this.numberOfNodes=0}},Fhe=(e,t)=>{var n,r;for(let[,i]of t)if(i.type==="arrow"&&(((n=i.startBinding)==null?void 0:n.elementId)===e.id||((r=i.endBinding)==null?void 0:r.elementId)===e.id))return!0;return!1},$he=({appState:e,isMobile:t,device:n,app:r})=>{var l,h;let{activeTool:i,isResizing:a,isRotating:s,lastPointerDownWith:o}=e,c=e.multiElement!==null;if(((l=e.openSidebar)==null?void 0:l.name)===Qa.name&&e.openSidebar.tab===Gu&&((h=e.searchMatches)!=null&&h.length))return D("hints.dismissSearch");if(e.openSidebar&&!n.editor.canFitSidebar)return null;if(Is(e))return D("hints.eraserRevert");if(i.type==="arrow"||i.type==="line")return c?D("hints.linearElementMulti"):i.type==="arrow"?D("hints.arrowTool",{arrowShortcut:pe("A")}):D("hints.linearElement");if(i.type==="freedraw")return D("hints.freeDraw");if(i.type==="text")return D("hints.text");if(i.type==="embeddable")return D("hints.embeddable");if(e.activeTool.type==="image"&&e.pendingImageElementId)return D("hints.placeImage");let d=r.scene.getSelectedElements(e);if(a&&o==="mouse"&&d.length===1){let f=d[0];return st(f)&&f.points.length===2?D("hints.lockAngle"):Lt(f)?D("hints.resizeImage"):D("hints.resize")}if(s&&o==="mouse")return D("hints.rotate");if(d.length===1&&Le(d[0]))return D("hints.text_selected");if(e.editingTextElement)return D("hints.text_editing");if(e.croppingElementId)return D("hints.leaveCropEditor");if(d.length===1&&Lt(d[0]))return D("hints.enterCropEditor");if(i.type==="selection"){if(e.selectionElement&&!d.length&&!e.editingTextElement&&!e.editingLinearElement)return D("hints.deepBoxSelect");if(g1(r)&&e.selectedElementsAreBeingDragged)return D("hints.disableSnapping");if(!d.length&&!t)return D("hints.canvasPanning");if(d.length===1){if(st(d[0]))return e.editingLinearElement?e.editingLinearElement.selectedPointsIndices?D("hints.lineEditor_pointSelected"):D("hints.lineEditor_nothingSelected"):D("hints.lineEditor_info");if(!e.newElement&&!e.selectedElementsAreBeingDragged&&ud(d[0]))return EU(d[0])?Fhe(d[0],r.scene.getNonDeletedElementsMap())?[D("hints.bindTextToElement"),D("hints.createFlowchart")]:[D("hints.bindTextToElement"),D("hints.createFlowchart")]:D("hints.bindTextToElement")}}return null},NP=({appState:e,isMobile:t,device:n,app:r})=>{let i=$he({appState:e,isMobile:t,device:n,app:r});if(!i)return null;let a=Array.isArray(i)?i.map(s=>pe(s).replace(/\. ?$/,"")).join(". "):pe(i);return m.jsx("div",{className:"HintViewer",children:m.jsx("span",{children:a})})},Bhe="medium",ik={CHECKED:Ev,UNCHECKED:CU},OP=e=>m.jsxs("label",{className:Fe("ToolIcon ToolIcon__lock",`ToolIcon_size_${Bhe}`,{"is-mobile":e.isMobile}),title:`${e.title} — Q`,children:[m.jsx("input",{className:"ToolIcon_type_checkbox",type:"checkbox",name:e.name,onChange:e.onChange,checked:e.checked,"aria-label":e.title,"data-testid":"toolbar-lock"}),m.jsx("div",{className:"ToolIcon__icon",children:e.checked?ik.CHECKED:ik.UNCHECKED})]}),S1=({heading:e,children:t,...n})=>{let{id:r}=ao(),i=m.jsx("h2",{className:"visually-hidden",id:`${r}-${e}-title`,children:D(`headings.${e}`)});return m.jsx("section",{...n,"aria-labelledby":`${r}-${e}-title`,children:typeof t=="function"?t(i):m.jsxs(m.Fragment,{children:[i,t]})})},Ls=4,tc=6,zhe="rgba(0,0,0,0.3)",Hhe=(e,t,n,r)=>{if(!e.length)return{horizontal:null,vertical:null};let[i,a,s,o]=Dt(e),c=t/r.zoom.value,d=n/r.zoom.value,l=t-c,h=n-d,f={top:parseInt(Lm("sat"))||0,bottom:parseInt(Lm("sab"))||0,left:parseInt(Lm("sal"))||0,right:parseInt(Lm("sar"))||0},g=E1().rtl,U=-r.scrollX+l/2+f.left,y=-r.scrollY+h/2+f.top,v=U+c-f.right,x=y+d-f.bottom,w=Math.min(i,U),C=Math.min(a,y),S=Math.max(s,v),k=Math.max(o,x);return{horizontal:U===w&&v===S?null:{x:Math.max(f.left,Ls)+(U-w)/(S-w)*t,y:n-tc-Math.max(Ls,f.bottom),width:(v-U)/(S-w)*t-Math.max(Ls*2,f.left+f.right),height:tc},vertical:y===C&&x===k?null:{x:g?Math.max(f.left,Ls):t-tc-Math.max(f.right,Ls),y:(y-C)/(k-C)*n+Math.max(f.top,Ls),width:tc,height:(x-y)/(k-C)*n-Math.max(Ls*2,f.top+f.bottom)}}},ak=(e,t,n)=>{let[r,i]=[e.horizontal,e.vertical].map(a=>a!=null&&a.x<=t&&t<=a.x+a.width&&a.y<=n&&n<=a.y+a.height);return{isOverEither:r||i,isOverHorizontal:r,isOverVertical:i}},Whe="medium",FP=e=>e.penDetected?m.jsxs("label",{className:Fe("ToolIcon ToolIcon__penMode",`ToolIcon_size_${Whe}`,{"is-mobile":e.isMobile}),title:`${e.title}`,children:[m.jsx("input",{className:"ToolIcon_type_checkbox",type:"checkbox",name:e.name,onChange:e.onChange,checked:e.checked,"aria-label":e.title}),m.jsx("div",{className:"ToolIcon__icon",children:CG})]}):null,$P=e=>m.jsx(Ct,{className:Fe("Shape",{fillable:!1}),type:"radio",icon:JI,name:"editor-current-shape",checked:e.checked,title:`${e.title} — H`,keyBindingLabel:e.isMobile?void 0:Z.H.toLocaleUpperCase(),"aria-label":`${e.title} — H`,"aria-keyshortcuts":Z.H,"data-testid":"toolbar-hand",onChange:()=>{var t;return(t=e.onChange)==null?void 0:t.call(e)}}),Xhe=({appState:e,elements:t,actionManager:n,setAppState:r,onLockToggle:i,onHandToolToggle:a,onPenModeToggle:s,renderTopRightUI:o,renderCustomStats:c,renderSidebars:d,device:l,renderWelcomeScreen:h,UIOptions:f,app:g})=>{var C,S;let{WelcomeScreenCenterTunnel:U,MainMenuTunnel:y,DefaultSidebarTriggerTunnel:v}=yi(),x=()=>m.jsxs(DP,{side:"top",className:"App-top-bar",children:[h&&m.jsx(U.Out,{}),m.jsx(S1,{heading:"shapes",children:k=>{var M;return m.jsx(la.Col,{gap:4,align:"center",children:m.jsxs(la.Row,{gap:1,className:"App-toolbar-container",children:[m.jsxs(ts,{padding:1,className:"App-toolbar App-toolbar--mobile",children:[k,m.jsx(la.Row,{gap:1,children:m.jsx(_P,{appState:e,activeTool:e.activeTool,UIOptions:f,app:g})})]}),o&&o(!0,e),m.jsxs("div",{className:"mobile-misc-tools-container",children:[!e.viewModeEnabled&&((M=e.openDialog)==null?void 0:M.name)!=="elementLinkSelector"&&m.jsx(v.Out,{}),m.jsx(FP,{checked:e.penMode,onChange:()=>s(null),title:D("toolBar.penMode"),isMobile:!0,penDetected:e.penDetected}),m.jsx(OP,{checked:e.activeTool.locked,onChange:i,title:D("toolBar.lock"),isMobile:!0}),m.jsx($P,{checked:ch(e),onChange:()=>a(),title:D("toolBar.hand"),isMobile:!0})]})]})})}}),m.jsx(NP,{appState:e,isMobile:!0,device:l,app:g})]}),w=()=>{var k;return e.viewModeEnabled||((k=e.openDialog)==null?void 0:k.name)==="elementLinkSelector"?m.jsx("div",{className:"App-toolbar-content",children:m.jsx(y.Out,{})}):m.jsxs("div",{className:"App-toolbar-content",children:[m.jsx(y.Out,{}),n.renderAction("toggleEditMenu"),n.renderAction(e.multiElement?"finalize":"duplicateSelection"),n.renderAction("deleteSelectedElements"),m.jsxs("div",{children:[n.renderAction("undo"),n.renderAction("redo")]})]})};return m.jsxs(m.Fragment,{children:[d(),!e.viewModeEnabled&&((C=e.openDialog)==null?void 0:C.name)!=="elementLinkSelector"&&x(),m.jsx("div",{className:"App-bottom-bar",style:{marginBottom:tc+Ls*2,marginLeft:tc+Ls*2,marginRight:tc+Ls*2},children:m.jsxs(ts,{padding:0,children:[e.openMenu==="shape"&&!e.viewModeEnabled&&((S=e.openDialog)==null?void 0:S.name)!=="elementLinkSelector"&&m7(e,t)?m.jsx(S1,{className:"App-mobile-menu",heading:"selectedShapeActions",children:m.jsx(SP,{appState:e,elementsMap:g.scene.getNonDeletedElementsMap(),renderAction:n.renderAction,app:g})}):null,m.jsxs("footer",{className:"App-toolbar",children:[w(),e.scrolledOutside&&!e.openMenu&&!e.openSidebar&&m.jsx("button",{type:"button",className:"scroll-back-to-content",onClick:()=>{r(k=>({...p1(t,k)}))},children:D("buttons.scrollBackToContent")})]})]})})]})},sk=e=>{let t=I.useRef(null),[n,r]=I.useState(null);return I.useLayoutEffect(()=>{if(!e.spreadsheet)return;let i=Pre(e.chartType,e.spreadsheet,0,0);r(i);let a,s=t.current;return(async()=>{var o;return a=await Yv(i,{exportBackground:!1,viewBackgroundColor:dr.white},null,{skipInliningFonts:!0}),(o=a.querySelector(".style-fonts"))==null||o.remove(),s.replaceChildren(),s.appendChild(a),e.selected&&s.parentNode.focus()})(),()=>{s.replaceChildren()}},[e.spreadsheet,e.chartType,e.selected]),m.jsx("button",{type:"button",className:"ChartPreview",onClick:()=>{n&&e.onClick(e.chartType,n)},children:m.jsx("div",{ref:t})})},Vhe=({setAppState:e,appState:t,onClose:n})=>{let{onInsertElements:r}=io(),i=ke.useCallback(()=>{n&&n()},[n]),a=(s,o)=>{r(o),Jt("paste","chart",s),e({currentChartType:s,pasteDialog:{shown:!1,data:null}})};return m.jsx(cs,{size:"small",onCloseRequest:i,title:D("labels.pasteCharts"),className:"PasteChartDialog",autofocus:!1,children:m.jsxs("div",{className:"container",children:[m.jsx(sk,{chartType:"bar",spreadsheet:t.pasteDialog.data,selected:t.currentChartType==="bar",onClick:a}),m.jsx(sk,{chartType:"line",spreadsheet:t.pasteDialog.data,selected:t.currentChartType==="line",onClick:a})]})})},Yhe=()=>m.jsxs("div",{className:"HelpDialog__header",children:[m.jsxs("a",{className:"HelpDialog__btn",href:"https://docs.excalidraw.com",target:"_blank",rel:"noopener noreferrer",children:[m.jsx("div",{className:"HelpDialog__link-icon",children:aC}),D("helpDialog.documentation")]}),m.jsxs("a",{className:"HelpDialog__btn",href:"https://plus.excalidraw.com/blog",target:"_blank",rel:"noopener noreferrer",children:[m.jsx("div",{className:"HelpDialog__link-icon",children:aC}),D("helpDialog.blog")]}),m.jsxs("a",{className:"HelpDialog__btn",href:"https://github.com/excalidraw/excalidraw/issues",target:"_blank",rel:"noopener noreferrer",children:[m.jsx("div",{className:"HelpDialog__link-icon",children:VI}),D("helpDialog.github")]}),m.jsxs("a",{className:"HelpDialog__btn",href:"https://youtube.com/@excalidraw",target:"_blank",rel:"noopener noreferrer",children:[m.jsx("div",{className:"HelpDialog__link-icon",children:Xq}),"YouTube"]})]}),Ghe=e=>m.jsxs(m.Fragment,{children:[m.jsx("h3",{children:e.title}),m.jsx("div",{className:"HelpDialog__islands-container",children:e.children})]}),Ay=e=>m.jsxs("div",{className:`HelpDialog__island ${e.className}`,children:[m.jsx("h4",{className:"HelpDialog__island-title",children:e.caption}),m.jsx("div",{className:"HelpDialog__island-content",children:e.children})]});function*qhe(e,t){let n=!0;for(let r of e)n||(yield t),n=!1,yield r}var Zhe=e=>e.replace(/\b[a-z]\b/,t=>t.toUpperCase()),Oe=({label:e,shortcuts:t,isOr:n=!0})=>{let r=t.map(i=>(i.endsWith("++")?[...i.slice(0,-2).split("+"),"+"]:i.split("+")).map(a=>m.jsx(Khe,{children:Zhe(a)},a)));return m.jsxs("div",{className:"HelpDialog__shortcut",children:[m.jsx("div",{children:e}),m.jsx("div",{className:"HelpDialog__key-container",children:[...qhe(r,n?D("helpDialog.or"):null)]})]})},Khe=e=>m.jsx("kbd",{className:"HelpDialog__key",...e}),Qhe=({onClose:e})=>{let t=ke.useCallback(()=>{e&&e()},[e]);return m.jsx(m.Fragment,{children:m.jsxs(cs,{onCloseRequest:t,title:D("helpDialog.title"),className:"HelpDialog",children:[m.jsx(Yhe,{}),m.jsxs(Ghe,{title:D("helpDialog.shortcuts"),children:[m.jsxs(Ay,{className:"HelpDialog__island--tools",caption:D("helpDialog.tools"),children:[m.jsx(Oe,{label:D("toolBar.hand"),shortcuts:[Z.H]}),m.jsx(Oe,{label:D("toolBar.selection"),shortcuts:[Z.V,Z[1]]}),m.jsx(Oe,{label:D("toolBar.rectangle"),shortcuts:[Z.R,Z[2]]}),m.jsx(Oe,{label:D("toolBar.diamond"),shortcuts:[Z.D,Z[3]]}),m.jsx(Oe,{label:D("toolBar.ellipse"),shortcuts:[Z.O,Z[4]]}),m.jsx(Oe,{label:D("toolBar.arrow"),shortcuts:[Z.A,Z[5]]}),m.jsx(Oe,{label:D("toolBar.line"),shortcuts:[Z.L,Z[6]]}),m.jsx(Oe,{label:D("toolBar.freedraw"),shortcuts:[Z.P,Z[7]]}),m.jsx(Oe,{label:D("toolBar.text"),shortcuts:[Z.T,Z[8]]}),m.jsx(Oe,{label:D("toolBar.image"),shortcuts:[Z[9]]}),m.jsx(Oe,{label:D("toolBar.eraser"),shortcuts:[Z.E,Z[0]]}),m.jsx(Oe,{label:D("toolBar.frame"),shortcuts:[Z.F]}),m.jsx(Oe,{label:D("toolBar.laser"),shortcuts:[Z.K]}),m.jsx(Oe,{label:D("labels.eyeDropper"),shortcuts:[Z.I,"Shift+S","Shift+G"]}),m.jsx(Oe,{label:D("helpDialog.editLineArrowPoints"),shortcuts:[pe("CtrlOrCmd+Enter")]}),m.jsx(Oe,{label:D("helpDialog.editText"),shortcuts:[pe("Enter")]}),m.jsx(Oe,{label:D("helpDialog.textNewLine"),shortcuts:[pe("Enter"),pe("Shift+Enter")]}),m.jsx(Oe,{label:D("helpDialog.textFinish"),shortcuts:[pe("Esc"),pe("CtrlOrCmd+Enter")]}),m.jsx(Oe,{label:D("helpDialog.curvedArrow"),shortcuts:["A",D("helpDialog.click"),D("helpDialog.click"),D("helpDialog.click")],isOr:!1}),m.jsx(Oe,{label:D("helpDialog.curvedLine"),shortcuts:["L",D("helpDialog.click"),D("helpDialog.click"),D("helpDialog.click")],isOr:!1}),m.jsx(Oe,{label:D("helpDialog.cropStart"),shortcuts:[D("helpDialog.doubleClick"),pe("Enter")],isOr:!0}),m.jsx(Oe,{label:D("helpDialog.cropFinish"),shortcuts:[pe("Enter"),pe("Escape")],isOr:!0}),m.jsx(Oe,{label:D("toolBar.lock"),shortcuts:[Z.Q]}),m.jsx(Oe,{label:D("helpDialog.preventBinding"),shortcuts:[pe("CtrlOrCmd")]}),m.jsx(Oe,{label:D("toolBar.link"),shortcuts:[pe("CtrlOrCmd+K")]})]}),m.jsxs(Ay,{className:"HelpDialog__island--view",caption:D("helpDialog.view"),children:[m.jsx(Oe,{label:D("buttons.zoomIn"),shortcuts:[pe("CtrlOrCmd++")]}),m.jsx(Oe,{label:D("buttons.zoomOut"),shortcuts:[pe("CtrlOrCmd+-")]}),m.jsx(Oe,{label:D("buttons.resetZoom"),shortcuts:[pe("CtrlOrCmd+0")]}),m.jsx(Oe,{label:D("helpDialog.zoomToFit"),shortcuts:["Shift+1"]}),m.jsx(Oe,{label:D("helpDialog.zoomToSelection"),shortcuts:["Shift+2"]}),m.jsx(Oe,{label:D("helpDialog.movePageUpDown"),shortcuts:["PgUp/PgDn"]}),m.jsx(Oe,{label:D("helpDialog.movePageLeftRight"),shortcuts:["Shift+PgUp/PgDn"]}),m.jsx(Oe,{label:D("buttons.zenMode"),shortcuts:[pe("Alt+Z")]}),m.jsx(Oe,{label:D("buttons.objectsSnapMode"),shortcuts:[pe("Alt+S")]}),m.jsx(Oe,{label:D("labels.toggleGrid"),shortcuts:[pe("CtrlOrCmd+'")]}),m.jsx(Oe,{label:D("labels.viewMode"),shortcuts:[pe("Alt+R")]}),m.jsx(Oe,{label:D("labels.toggleTheme"),shortcuts:[pe("Alt+Shift+D")]}),m.jsx(Oe,{label:D("stats.fullTitle"),shortcuts:[pe("Alt+/")]}),m.jsx(Oe,{label:D("search.title"),shortcuts:[Rr("searchMenu")]}),m.jsx(Oe,{label:D("commandPalette.title"),shortcuts:a1?[Rr("commandPalette")]:[Rr("commandPalette"),Rr("commandPalette",1)]})]}),m.jsxs(Ay,{className:"HelpDialog__island--editor",caption:D("helpDialog.editor"),children:[m.jsx(Oe,{label:D("helpDialog.createFlowchart"),shortcuts:[pe("CtrlOrCmd+Arrow Key")],isOr:!0}),m.jsx(Oe,{label:D("helpDialog.navigateFlowchart"),shortcuts:[pe("Alt+Arrow Key")],isOr:!0}),m.jsx(Oe,{label:D("labels.moveCanvas"),shortcuts:[pe(`Space+${D("helpDialog.drag")}`),pe(`Wheel+${D("helpDialog.drag")}`)],isOr:!0}),m.jsx(Oe,{label:D("buttons.clearReset"),shortcuts:[pe("CtrlOrCmd+Delete")]}),m.jsx(Oe,{label:D("labels.delete"),shortcuts:[pe("Delete")]}),m.jsx(Oe,{label:D("labels.cut"),shortcuts:[pe("CtrlOrCmd+X")]}),m.jsx(Oe,{label:D("labels.copy"),shortcuts:[pe("CtrlOrCmd+C")]}),m.jsx(Oe,{label:D("labels.paste"),shortcuts:[pe("CtrlOrCmd+V")]}),m.jsx(Oe,{label:D("labels.pasteAsPlaintext"),shortcuts:[pe("CtrlOrCmd+Shift+V")]}),m.jsx(Oe,{label:D("labels.selectAll"),shortcuts:[pe("CtrlOrCmd+A")]}),m.jsx(Oe,{label:D("labels.multiSelect"),shortcuts:[pe(`Shift+${D("helpDialog.click")}`)]}),m.jsx(Oe,{label:D("helpDialog.deepSelect"),shortcuts:[pe(`CtrlOrCmd+${D("helpDialog.click")}`)]}),m.jsx(Oe,{label:D("helpDialog.deepBoxSelect"),shortcuts:[pe(`CtrlOrCmd+${D("helpDialog.drag")}`)]}),(r7||a1)&&m.jsx(Oe,{label:D("labels.copyAsPng"),shortcuts:[pe("Shift+Alt+C")]}),m.jsx(Oe,{label:D("labels.copyStyles"),shortcuts:[pe("CtrlOrCmd+Alt+C")]}),m.jsx(Oe,{label:D("labels.pasteStyles"),shortcuts:[pe("CtrlOrCmd+Alt+V")]}),m.jsx(Oe,{label:D("labels.sendToBack"),shortcuts:[pe(Xs?"CtrlOrCmd+Alt+[":"CtrlOrCmd+Shift+[")]}),m.jsx(Oe,{label:D("labels.bringToFront"),shortcuts:[pe(Xs?"CtrlOrCmd+Alt+]":"CtrlOrCmd+Shift+]")]}),m.jsx(Oe,{label:D("labels.sendBackward"),shortcuts:[pe("CtrlOrCmd+[")]}),m.jsx(Oe,{label:D("labels.bringForward"),shortcuts:[pe("CtrlOrCmd+]")]}),m.jsx(Oe,{label:D("labels.alignTop"),shortcuts:[pe("CtrlOrCmd+Shift+Up")]}),m.jsx(Oe,{label:D("labels.alignBottom"),shortcuts:[pe("CtrlOrCmd+Shift+Down")]}),m.jsx(Oe,{label:D("labels.alignLeft"),shortcuts:[pe("CtrlOrCmd+Shift+Left")]}),m.jsx(Oe,{label:D("labels.alignRight"),shortcuts:[pe("CtrlOrCmd+Shift+Right")]}),m.jsx(Oe,{label:D("labels.duplicateSelection"),shortcuts:[pe("CtrlOrCmd+D"),pe(`Alt+${D("helpDialog.drag")}`)]}),m.jsx(Oe,{label:D("helpDialog.toggleElementLock"),shortcuts:[pe("CtrlOrCmd+Shift+L")]}),m.jsx(Oe,{label:D("buttons.undo"),shortcuts:[pe("CtrlOrCmd+Z")]}),m.jsx(Oe,{label:D("buttons.redo"),shortcuts:pI?[pe("CtrlOrCmd+Y"),pe("CtrlOrCmd+Shift+Z")]:[pe("CtrlOrCmd+Shift+Z")]}),m.jsx(Oe,{label:D("labels.group"),shortcuts:[pe("CtrlOrCmd+G")]}),m.jsx(Oe,{label:D("labels.ungroup"),shortcuts:[pe("CtrlOrCmd+Shift+G")]}),m.jsx(Oe,{label:D("labels.flipHorizontal"),shortcuts:[pe("Shift+H")]}),m.jsx(Oe,{label:D("labels.flipVertical"),shortcuts:[pe("Shift+V")]}),m.jsx(Oe,{label:D("labels.showStroke"),shortcuts:[pe("S")]}),m.jsx(Oe,{label:D("labels.showBackground"),shortcuts:[pe("G")]}),m.jsx(Oe,{label:D("labels.showFonts"),shortcuts:[pe("Shift+F")]}),m.jsx(Oe,{label:D("labels.decreaseFontSize"),shortcuts:[pe("CtrlOrCmd+Shift+<")]}),m.jsx(Oe,{label:D("labels.increaseFontSize"),shortcuts:[pe("CtrlOrCmd+Shift+>")]})]})]})]})})},Jhe=4,efe=8,tfe=({shouldWrap:e,children:t,username:n})=>e?m.jsx(Dd,{label:n||"Unknown user",children:t}):m.jsx(m.Fragment,{children:t}),Ly=({actionManager:e,collaborator:t,socketId:n,withName:r=!1,shouldWrapWithTooltip:i=!1,isBeingFollowed:a})=>{let s={socketId:n,collaborator:t,withName:r,isBeingFollowed:a},o=e.renderAction("goToCollaborator",s);return m.jsx(tfe,{username:t.username,shouldWrap:i,children:o},n)},nfe=["avatarUrl","id","socketId","username","isInCall","isSpeaking","isMuted"],BP=ke.memo(({className:e,mobile:t,collaborators:n,userToFollow:r})=>{let i=vi(),a=new Map;n.forEach((U,y)=>{let v=U.id||y;a.set(v,{...U,socketId:y})});let s=Array.from(a.values()).filter(U=>{var y;return(y=U.username)==null?void 0:y.trim()}),[o,c]=ke.useState(""),d=s.filter(U=>{var y;return(y=U.username)==null?void 0:y.toLowerCase().includes(o)}),l=ke.useRef(null);I.useLayoutEffect(()=>{if(l.current){let U=v=>{let x=Math.max(1,Math.min(8,Math.floor(v/38)));f(x)};if(U(l.current.clientWidth),!x3)return;let y=new ResizeObserver(v=>{for(let x of v){let{width:w}=x.contentRect;U(w)}});return y.observe(l.current),()=>{y.disconnect()}}},[]);let[h,f]=ke.useState(Jhe),g=s.slice(0,h-1).map(U=>Ly({actionManager:i,collaborator:U,socketId:U.socketId,shouldWrapWithTooltip:!0,isBeingFollowed:U.socketId===r}));return t?m.jsx("div",{className:Fe("UserList UserList_mobile",e),children:s.map(U=>Ly({actionManager:i,collaborator:U,socketId:U.socketId,shouldWrapWithTooltip:!0,isBeingFollowed:U.socketId===r}))}):m.jsx("div",{className:"UserList__wrapper",ref:l,children:m.jsxs("div",{className:Fe("UserList",e),style:{"--max-avatars":h},children:[g,s.length>h-1&&m.jsxs(ZU,{children:[m.jsxs(KU,{className:"UserList__more",children:["+",s.length-h+1]}),m.jsx(j7,{style:{zIndex:2,width:"15rem",textAlign:"left"},align:"end",sideOffset:10,children:m.jsxs(ts,{padding:2,children:[s.length>=efe&&m.jsx(Xj,{placeholder:D("quickSearch.placeholder"),onChange:c}),m.jsx(Vj,{className:"dropdown-menu UserList__collaborators",placeholder:D("userList.empty"),children:d.length>0?[m.jsx("div",{className:"hint",children:D("userList.hint.text")}),d.map(U=>Ly({actionManager:i,collaborator:U,socketId:U.socketId,withName:!0,isBeingFollowed:U.socketId===r}))]:[]}),m.jsx(sj,{width:20,height:10,style:{fill:"var(--popup-bg-color)",filter:"drop-shadow(rgba(0, 0, 0, 0.05) 0px 3px 2px)"}})]})})]})]})})},(e,t)=>{if(e.collaborators.size!==t.collaborators.size||e.mobile!==t.mobile||e.className!==t.className||e.userToFollow!==t.userToFollow)return!1;let n=t.collaborators.keys();for(let[r,i]of e.collaborators){let a=t.collaborators.get(r);if(!a||r!==n.next().value||!yr(i,a,nfe))return!1}return!0}),ok=({children:e,color:t})=>m.jsx("div",{className:"Card",style:{"--card-color":t==="primary"?"var(--color-primary)":dr[t][7],"--card-color-darker":t==="primary"?"var(--color-primary-darker)":dr[t][8],"--card-color-darkest":t==="primary"?"var(--color-primary-darkest)":dr[t][9]},children:e}),rfe=({elements:e,appState:t,setAppState:n,files:r,actionManager:i,exportOpts:a,canvas:s,onCloseRequest:o})=>{let{onExportToBackend:c}=a;return m.jsx("div",{className:"ExportDialog ExportDialog--json",children:m.jsxs("div",{className:"ExportDialog-cards",children:[a.saveFileToDisk&&m.jsxs(ok,{color:"lime",children:[m.jsx("div",{className:"Card-icon",children:PG}),m.jsx("h2",{children:D("exportDialog.disk_title")}),m.jsxs("div",{className:"Card-details",children:[D("exportDialog.disk_details"),!Bd&&i.renderAction("changeProjectName")]}),m.jsx(Ct,{className:"Card-button",type:"button",title:D("exportDialog.disk_button"),"aria-label":D("exportDialog.disk_button"),showAriaLabel:!0,onClick:()=>{i.executeAction(rP,"ui")}})]}),c&&m.jsxs(ok,{color:"pink",children:[m.jsx("div",{className:"Card-icon",children:M3}),m.jsx("h2",{children:D("exportDialog.link_title")}),m.jsx("div",{className:"Card-details",children:D("exportDialog.link_details")}),m.jsx(Ct,{className:"Card-button",type:"button",title:D("exportDialog.link_button"),"aria-label":D("exportDialog.link_button"),showAriaLabel:!0,onClick:async()=>{try{Jt("export","link",`ui (${zY()})`),await c(e,t,r),o()}catch(d){n({errorMessage:d.message})}}})]}),a.renderCustomUI&&a.renderCustomUI(e,t,r,s)]})})},ife=({elements:e,appState:t,files:n,actionManager:r,exportOpts:i,canvas:a,setAppState:s})=>{var c;let o=ke.useCallback(()=>{s({openDialog:null})},[s]);return m.jsx(m.Fragment,{children:((c=t.openDialog)==null?void 0:c.name)==="jsonExport"&&m.jsx(cs,{onCloseRequest:o,title:D("buttons.export"),children:m.jsx(rfe,{elements:e,appState:t,setAppState:s,files:n,actionManager:r,onCloseRequest:o,exportOpts:i,canvas:a})})})},afe=e=>m.jsx("button",{className:"help-icon",onClick:e.onClick,type:"button",title:`${D("helpDialog.title")} — ?`,"aria-label":D("helpDialog.title"),children:Cv}),zP=({appState:e,actionManager:t,showExitZenModeBtn:n,renderWelcomeScreen:r})=>{let{FooterCenterTunnel:i,WelcomeScreenHelpHintTunnel:a}=yi(),s=Yn(),o=!e.viewModeEnabled&&e.multiElement&&s.isTouchScreen;return m.jsxs("footer",{role:"contentinfo",className:"layer-ui__wrapper__footer App-menu App-menu_bottom",children:[m.jsx("div",{className:Fe("layer-ui__wrapper__footer-left zen-mode-transition",{"layer-ui__wrapper__footer-left--transition-left":e.zenModeEnabled}),children:m.jsx(la.Col,{gap:2,children:m.jsxs(S1,{heading:"canvasActions",children:[m.jsx(che,{renderAction:t.renderAction,zoom:e.zoom}),!e.viewModeEnabled&&m.jsx(dhe,{renderAction:t.renderAction,className:Fe("zen-mode-transition",{"layer-ui__wrapper__footer-left--transition-bottom":e.zenModeEnabled})}),o&&m.jsx(hhe,{renderAction:t.renderAction,className:Fe("zen-mode-transition",{"layer-ui__wrapper__footer-left--transition-left":e.zenModeEnabled})})]})})}),m.jsx(i.Out,{}),m.jsx("div",{className:Fe("layer-ui__wrapper__footer-right zen-mode-transition",{"transition-right":e.zenModeEnabled}),children:m.jsxs("div",{style:{position:"relative"},children:[r&&m.jsx(a.Out,{}),m.jsx(afe,{onClick:()=>t.executeAction(V7)})]})}),m.jsx(uhe,{actionManager:t,showExitZenModeBtn:n})]})},sfe=zP;zP.displayName="Footer";var HP=ke.createContext({}),WP=({children:e,className:t})=>{let n=Yn(),r=I.useContext(HP),i=!!(n.editor.canFitSidebar&&r.shouldRenderDockButton);return m.jsxs("div",{className:Fe("sidebar__header",t),"data-testid":"sidebar-header",children:[e,m.jsxs("div",{className:"sidebar__header__buttons",children:[i&&m.jsx(Dd,{label:D("labels.sidebarLock"),children:m.jsx(jd,{onSelect:()=>{var a;return(a=r.onDock)==null?void 0:a.call(r,!r.docked)},selected:!!r.docked,className:"sidebar__dock","data-testid":"sidebar-dock","aria-label":D("labels.sidebarLock"),children:pG})}),m.jsx(jd,{"data-testid":"sidebar-close",className:"sidebar__close",onSelect:r.onCloseRequest,"aria-label":D("buttons.close"),children:Bh})]})]})};WP.displayName="SidebarHeader";var XP=({name:e,tab:t,icon:n,title:r,children:i,onToggle:a,className:s,style:o})=>{var l;let c=nr(),d=Nr();return m.jsxs("label",{title:r,className:"sidebar-trigger__label-element",children:[m.jsx("input",{className:"ToolIcon_type_checkbox",type:"checkbox",onChange:h=>{var g;(g=document.querySelector(".layer-ui__wrapper"))==null||g.classList.remove("animate");let f=h.target.checked;c({openSidebar:f?{name:e,tab:t}:null}),a==null||a(f)},checked:((l=d.openSidebar)==null?void 0:l.name)===e,"aria-label":r,"aria-keyshortcuts":"0"}),m.jsxs("div",{className:Fe("sidebar-trigger",s),style:o,children:[n&&m.jsx("div",{children:n}),i&&m.jsx("div",{className:"sidebar-trigger__label",children:i})]})]})};XP.displayName="SidebarTrigger";var VP=({children:e,...t})=>m.jsx(Sj,{className:"sidebar-triggers",...t,children:e});VP.displayName="SidebarTabTriggers";var YP=({children:e,tab:t,onSelect:n,...r})=>m.jsx(_j,{value:t,asChild:!0,onSelect:n,children:m.jsx("button",{type:"button",className:"excalidraw-button sidebar-tab-trigger",...r,children:e})});YP.displayName="SidebarTabTrigger";var GP=({children:e,...t})=>{let n=Nr(),r=nr();if(!n.openSidebar)return null;let{name:i}=n.openSidebar;return m.jsx(Cj,{className:"sidebar-tabs-root",value:n.openSidebar.tab,onValueChange:a=>r(s=>({...s,openSidebar:{...s.openSidebar,name:i,tab:a}})),...t,children:e})};GP.displayName="SidebarTabs";var qP=({tab:e,children:t,...n})=>m.jsx(kj,{...n,value:e,"data-testid":e,children:t});qP.displayName="SidebarTab";var Z7=hr(!1),ZP=I.forwardRef(({name:e,children:t,onDock:n,docked:r,className:i,...a},s)=>{mt.DEV&&n&&r==null&&console.warn("Sidebar: `docked` must be set when `onDock` is supplied for the sidebar to be user-dockable. To hide this message, either pass `docked` or remove `onDock`");let o=nr(),c=JU(Z7);I.useLayoutEffect(()=>(c(!!r),()=>{c(!1)}),[c,r]);let d=I.useRef({});d.current.onCloseRequest=()=>{o({openSidebar:null})},d.current.onDock=g=>n==null?void 0:n(g),d.current=mg(d.current,{docked:r,shouldRenderDockButton:!!n&&r!=null});let l=I.useRef(null);I.useImperativeHandle(s,()=>l.current);let h=Yn(),f=I.useCallback(()=>{document.querySelector(".Dialog")||o({openSidebar:null})},[o]);return $7(l,I.useCallback(g=>{g.target.closest(".sidebar-trigger")||(!r||!h.editor.canFitSidebar)&&f()},[f,r,h.editor.canFitSidebar])),I.useEffect(()=>{let g=U=>{U.key===Z.ESCAPE&&(!r||!h.editor.canFitSidebar)&&f()};return document.addEventListener("keydown",g),()=>{document.removeEventListener("keydown",g)}},[f,r,h.editor.canFitSidebar]),m.jsx(ts,{...a,className:Fe("sidebar",{"sidebar--docked":r},i),ref:l,children:m.jsx(HP.Provider,{value:d.current,children:t})})});ZP.displayName="SidebarInner";var Ha=Object.assign(I.forwardRef((e,t)=>{var o;let n=Nr(),{onStateChange:r}=e,i=I.useRef(n.openSidebar);I.useEffect(()=>{var c,d,l,h,f;(!n.openSidebar&&((c=i==null?void 0:i.current)==null?void 0:c.name)===e.name||((d=n.openSidebar)==null?void 0:d.name)===e.name&&((l=i==null?void 0:i.current)==null?void 0:l.name)!==e.name||((h=i.current)==null?void 0:h.name)===e.name)&&n.openSidebar!==i.current&&(r==null||r(((f=n.openSidebar)==null?void 0:f.name)!==e.name?null:n.openSidebar)),i.current=n.openSidebar},[n.openSidebar,r,e.name]);let[a,s]=I.useState(!1);return I.useLayoutEffect(()=>(s(!0),()=>s(!1)),[]),a&&((o=n.openSidebar)==null?void 0:o.name)===e.name?I.createElement(ZP,{...e,ref:t,key:e.name}):null}),{Header:WP,TabTriggers:VP,TabTrigger:YP,Tabs:GP,Tab:qP,Trigger:XP});Ha.displayName="Sidebar";var KP={};hM(KP,{ChangeCanvasBackground:()=>lN,ClearCanvas:()=>sN,CommandPalette:()=>rN,Export:()=>cN,Help:()=>aN,LiveCollaborationTrigger:()=>uN,LoadScene:()=>eN,SaveAsImage:()=>nN,SaveToActiveFile:()=>tN,SearchMenu:()=>iN,Socials:()=>dN,ToggleTheme:()=>oN});var QP=hr({active:!1});async function ofe({title:e,description:t,actionLabel:n,color:r}){return new Promise(i=>{Za.set(QP,{active:!0,onConfirm:()=>i(!0),onClose:()=>i(!1),onReject:()=>i(!1),title:e,description:t,actionLabel:n,color:r})})}var JP=({value:e,shortcut:t,onChange:n,choices:r,children:i,name:a})=>{let s=Yn();return m.jsxs(m.Fragment,{children:[m.jsxs("div",{className:"dropdown-menu-item-base dropdown-menu-item-bare",children:[m.jsx("label",{className:"dropdown-menu-item__text",htmlFor:a,children:i}),m.jsx(RP,{name:a,value:e,onChange:n,choices:r})]}),t&&!s.editor.isMobile&&m.jsx("div",{className:"dropdown-menu-item__shortcut dropdown-menu-item__shortcut--orphaned",children:t})]})};JP.displayName="DropdownMenuItemContentRadio";var lfe=JP,eN=()=>{let{t:e}=vr(),t=vi(),n=u6();return t.isActionEnabled(b8)?m.jsx(va,{icon:Sv,onSelect:async()=>{(!n.length||await ofe({title:e("overwriteConfirm.modal.loadFromFile.title"),actionLabel:e("overwriteConfirm.modal.loadFromFile.button"),color:"warning",description:m.jsx($s,{i18nKey:"overwriteConfirm.modal.loadFromFile.description",bold:r=>m.jsx("strong",{children:r}),br:()=>m.jsx("br",{})})}))&&t.executeAction(b8)},"data-testid":"load-button",shortcut:Rr("loadScene"),"aria-label":e("buttons.load"),children:e("buttons.load")}):null};eN.displayName="LoadScene";var tN=()=>{let{t:e}=vr(),t=vi();return t.isActionEnabled(j_)?m.jsx(va,{shortcut:Rr("saveScene"),"data-testid":"save-button",onSelect:()=>t.executeAction(j_),icon:RG,"aria-label":`${e("buttons.save")}`,children:`${e("buttons.save")}`}):null};tN.displayName="SaveToActiveFile";var nN=()=>{let e=nr(),{t}=vr();return m.jsx(va,{icon:YI,"data-testid":"image-export-button",onSelect:()=>e({openDialog:{name:"imageExport"}}),shortcut:Rr("imageExport"),"aria-label":t("buttons.exportImage"),children:t("buttons.exportImage")})};nN.displayName="SaveAsImage";var rN=e=>{let t=nr(),{t:n}=vr();return m.jsx(va,{icon:iA,"data-testid":"command-palette-button",onSelect:()=>{Jt("command_palette","open","menu"),t({openDialog:{name:"commandPalette"}})},shortcut:Rr("commandPalette"),"aria-label":n("commandPalette.title"),className:e==null?void 0:e.className,children:n("commandPalette.title")})};rN.displayName="CommandPalette";var iN=e=>{let{t}=vr(),n=vi();return m.jsx(va,{icon:kd,"data-testid":"search-menu-button",onSelect:()=>{n.executeAction(IP)},shortcut:Rr("searchMenu"),"aria-label":t("search.title"),className:e==null?void 0:e.className,children:t("search.title")})};iN.displayName="SearchMenu";var aN=()=>{let{t:e}=vr(),t=vi();return m.jsx(va,{"data-testid":"help-menu-item",icon:Cv,onSelect:()=>t.executeAction(V7),shortcut:"?","aria-label":e("helpDialog.title"),children:e("helpDialog.title")})};aN.displayName="Help";var sN=()=>{let{t:e}=vr(),t=JU(c6);return vi().isActionEnabled(Op)?m.jsx(va,{icon:_d,onSelect:()=>t("clearCanvas"),"data-testid":"clear-canvas-button","aria-label":e("buttons.clearReset"),children:e("buttons.clearReset")}):null};sN.displayName="ClearCanvas";var oN=e=>{let{t}=vr(),n=Nr(),r=vi(),i=Rr("toggleTheme");return r.isActionEnabled(P2)?e!=null&&e.allowSystemTheme?m.jsx(lfe,{name:"theme",value:e.theme,onChange:a=>e.onSelect(a),choices:[{value:wt.LIGHT,label:T3,ariaLabel:`${t("buttons.lightMode")} - ${i}`},{value:wt.DARK,label:k3,ariaLabel:`${t("buttons.darkMode")} - ${i}`},{value:"system",label:Wq,ariaLabel:t("buttons.systemMode")}],children:t("labels.theme")}):m.jsx(va,{onSelect:a=>{if(a.preventDefault(),e==null?void 0:e.onSelect)e.onSelect(n.theme===wt.DARK?wt.LIGHT:wt.DARK);else return r.executeAction(P2)},icon:n.theme===wt.DARK?T3:k3,"data-testid":"toggle-dark-mode",shortcut:i,"aria-label":n.theme===wt.DARK?t("buttons.lightMode"):t("buttons.darkMode"),children:n.theme===wt.DARK?t("buttons.lightMode"):t("buttons.darkMode")}):null};oN.displayName="ToggleTheme";var lN=()=>{let{t:e}=vr(),t=Nr(),n=vi(),r=a0();return t.viewModeEnabled||!r.UIOptions.canvasActions.changeViewBackgroundColor?null:m.jsxs("div",{style:{marginTop:"0.5rem"},children:[m.jsx("div",{"data-testid":"canvas-background-label",style:{fontSize:".75rem",marginBottom:".5rem"},children:e("labels.canvasBackground")}),m.jsx("div",{style:{padding:"0 0.625rem"},children:n.renderAction("changeViewBackgroundColor")})]})};lN.displayName="ChangeCanvasBackground";var cN=()=>{let{t:e}=vr(),t=nr();return m.jsx(va,{icon:SU,onSelect:()=>{t({openDialog:{name:"jsonExport"}})},"data-testid":"json-export-button","aria-label":e("buttons.export"),children:e("buttons.export")})};cN.displayName="Export";var dN=()=>{let{t:e}=vr();return m.jsxs(m.Fragment,{children:[m.jsx(Dg,{icon:VI,href:"https://github.com/excalidraw/excalidraw","aria-label":"GitHub",children:"GitHub"}),m.jsx(Dg,{icon:AG,href:"https://x.com/excalidraw","aria-label":"X",children:e("labels.followUs")}),m.jsx(Dg,{icon:IG,href:"https://discord.gg/UexuTaE","aria-label":"Discord",children:e("labels.discordChat")})]})};dN.displayName="Socials";var uN=({onSelect:e,isCollaborating:t})=>{let{t:n}=vr();return m.jsx(va,{"data-testid":"collab-button",icon:ZI,className:Fe({"active-collab":t}),onSelect:e,children:n("labels.liveCollaboration")})};uN.displayName="LiveCollaborationTrigger";var r0=(e,t)=>{let n=hr(0),r=i=>{let{tunnelsJotai:{useAtom:a}}=yi(),[,s]=a(n),o=I.useRef({preferHost:!1,counter:0});return I.useLayoutEffect(()=>{let c=o.current;return s(d=>{let l=d+1;return c.counter=l,l}),()=>{s(d=>{let l=d-1;return c.counter=l,l||(c.preferHost=!1),l})}},[s]),i.__fallback||(o.current.preferHost=!0),!o.current.counter&&i.__fallback&&o.current.preferHost||o.current.counter>1&&i.__fallback?null:m.jsx(t,{...i})};return r.displayName=e,r},cfe=Object.assign(r0("MainMenu",({children:e,onSelect:t})=>{var o;let{MainMenuTunnel:n}=yi(),r=Yn(),i=Nr(),a=nr(),s=r.editor.isMobile?void 0:()=>a({openMenu:null});return m.jsx(n.In,{children:m.jsxs(dn,{open:i.openMenu==="canvas",children:[m.jsx(dn.Trigger,{onToggle:()=>{a({openMenu:i.openMenu==="canvas"?null:"canvas"})},"data-testid":"main-menu-trigger",className:"main-menu-trigger",children:XI}),m.jsxs(dn.Content,{onClickOutside:s,onSelect:wU(t,()=>{a({openMenu:null})}),children:[e,r.editor.isMobile&&i.collaborators.size>0&&m.jsxs("fieldset",{className:"UserList-Wrapper",children:[m.jsx("legend",{children:D("labels.collaborators")}),m.jsx(BP,{mobile:!0,collaborators:i.collaborators,userToFollow:((o=i.userToFollow)==null?void 0:o.socketId)||null})]})]})]})})}),{Trigger:dn.Trigger,Item:dn.Item,ItemLink:dn.ItemLink,ItemCustom:dn.ItemCustom,Group:dn.Group,Separator:dn.Separator,DefaultItems:KP}),Zt=cfe,K7=({title:e,children:t,actionLabel:n,onClick:r})=>m.jsxs("div",{className:"OverwriteConfirm__Actions__Action",children:[m.jsx("h4",{children:e}),m.jsx("div",{className:"OverwriteConfirm__Actions__Action__content",children:t}),m.jsx($p,{variant:"outlined",color:"muted",label:n,size:"large",fullWidth:!0,onClick:r})]}),dfe=()=>{let{t:e}=vr(),t=vi(),n=nr();return m.jsx(K7,{title:e("overwriteConfirm.action.exportToImage.title"),actionLabel:e("overwriteConfirm.action.exportToImage.button"),onClick:()=>{t.executeAction(nP,"ui",!0),n({openDialog:{name:"imageExport"}})},children:e("overwriteConfirm.action.exportToImage.description")})},ufe=()=>{let{t:e}=vr(),t=vi();return m.jsx(K7,{title:e("overwriteConfirm.action.saveToDisk.title"),actionLabel:e("overwriteConfirm.action.saveToDisk.button"),onClick:()=>{t.executeAction(rP,"ui")},children:e("overwriteConfirm.action.saveToDisk.description")})},lk=Object.assign(({children:e})=>m.jsx("div",{className:"OverwriteConfirm__Actions",children:e}),{ExportToImage:dfe,SaveToDisk:ufe}),Ry=Object.assign(r0("OverwriteConfirmDialog",({children:e})=>{let{OverwriteConfirmDialogTunnel:t}=yi(),[n,r]=kn(QP);if(!n.active)return null;let i=()=>{n.onClose(),r(s=>({...s,active:!1}))},a=()=>{n.onConfirm(),r(s=>({...s,active:!1}))};return m.jsx(t.In,{children:m.jsx(cs,{onCloseRequest:i,title:!1,size:916,children:m.jsxs("div",{className:"OverwriteConfirm",children:[m.jsx("h3",{children:n.title}),m.jsxs("div",{className:`OverwriteConfirm__Description OverwriteConfirm__Description--color-${n.color}`,children:[m.jsx("div",{className:"OverwriteConfirm__Description__icon",children:kq}),m.jsx("div",{children:n.description}),m.jsx("div",{className:"OverwriteConfirm__Description__spacer"}),m.jsx($p,{color:n.color,size:"large",label:n.actionLabel,onClick:a})]}),m.jsx(lk,{children:e})]})})})}),{Actions:lk,Action:K7}),hfe=hr(""),hN=hr(null),ffe=350,pfe=()=>{let e=io(),t=nr(),n=I.useRef(null),[r,i]=kn(hfe),a=r.trim(),[s,o]=I.useState(!1),[c,d]=I.useState({nonce:null,items:[]}),l=I.useRef(null),h=I.useRef(void 0),[f,g]=kn(hN),U=e.scene.getNonDeletedElementsMap();I.useEffect(()=>{s||(a!==l.current||e.scene.getSceneNonce()!==h.current)&&(l.current=null,ck(a,e,(C,S)=>{d({nonce:Gs(),items:C}),l.current=a,h.current=e.scene.getSceneNonce(),t({searchMatches:C.map(k=>({id:k.textElement.id,focus:!1,matchedLines:k.matchedLines}))})}))},[s,a,U,e,t,g,h]);let y=()=>{c.items.length>0&&g(C=>C===null?0:(C+1)%c.items.length)},v=()=>{c.items.length>0&&g(C=>C===null?0:C-1<0?c.items.length-1:C-1)};I.useEffect(()=>{t(C=>({searchMatches:C.searchMatches.map((S,k)=>k===f?{...S,focus:!0}:{...S,focus:!1})}))},[f,t]),I.useEffect(()=>{var C,S,k,M;if(c.items.length>0&&f!==null){let T=c.items[f];if(T){let R=e.state.zoom.value,j=Oi({text:T.searchQuery,x:T.textElement.x+(((C=T.matchedLines[0])==null?void 0:C.offsetX)??0),y:T.textElement.y+(((S=T.matchedLines[0])==null?void 0:S.offsetY)??0),width:(k=T.matchedLines[0])==null?void 0:k.width,height:(M=T.matchedLines[0])==null?void 0:M.height,fontSize:T.textElement.fontSize,fontFamily:T.textElement.fontFamily}),P=14,N=T.textElement.fontSize,F=N*R<P;if(!kg([j],e.canvas.width/window.devicePixelRatio,e.canvas.height/window.devicePixelRatio,{offsetLeft:e.state.offsetLeft,offsetTop:e.state.offsetTop,scrollX:e.state.scrollX,scrollY:e.state.scrollY,zoom:e.state.zoom},e.scene.getNonDeletedElementsMap(),e.getEditorUIOffsets())||F){let $;F?N>=P?$={fitToContent:!0}:$={fitToViewport:!0,maxZoom:Bs(P/N,1)}:$={fitToContent:!0},e.scrollToContent(j,{animate:!0,duration:300,...$,canvasOffsets:e.getEditorUIOffsets()})}}}},[f,c,e]),I.useEffect(()=>()=>{g(null),l.current=null,h.current=void 0,t({searchMatches:[]}),o(!1)},[t,g]);let x=n6({goToNextItem:y,goToPreviousItem:v,searchMatches:c});I.useEffect(()=>mn(window,"keydown",S=>{var k,M,T;if(S.key===Z.ESCAPE&&!e.state.openDialog&&!e.state.openPopup){S.preventDefault(),S.stopPropagation(),t({openSidebar:null});return}S[Z.CTRL_OR_CMD]&&S.key===Z.F&&(S.preventDefault(),S.stopPropagation(),(k=n.current)!=null&&k.matches(":focus")?t({openSidebar:null}):(e.state.openDialog&&t({openDialog:null}),(M=n.current)==null||M.focus(),(T=n.current)==null||T.select())),S.target instanceof HTMLElement&&S.target.closest(".layer-ui__search")&&x.searchMatches.items.length&&(S.key===Z.ENTER&&(S.stopPropagation(),x.goToNextItem()),S.key===Z.ARROW_UP?(S.stopPropagation(),x.goToPreviousItem()):S.key===Z.ARROW_DOWN&&(S.stopPropagation(),x.goToNextItem()))},{capture:!0,passive:!1}),[t,x,e]);let w=`${c.items.length} ${c.items.length===1?D("search.singleResult"):D("search.multipleResults")}`;return m.jsxs("div",{className:"layer-ui__search",children:[m.jsx("div",{className:"layer-ui__search-header",children:m.jsx(q7,{className:oh.SEARCH_MENU_INPUT_WRAPPER,value:r,ref:n,placeholder:D("search.placeholder"),icon:kd,onChange:C=>{i(C),o(!0);let S=C.trim();ck(S,e,(k,M)=>{d({nonce:Gs(),items:k}),g(M),l.current=S,h.current=e.scene.getSceneNonce(),t({searchMatches:k.map(T=>({id:T.textElement.id,focus:!1,matchedLines:T.matchedLines}))}),o(!1)})},selectOnRender:!0})}),m.jsxs("div",{className:"layer-ui__search-count",children:[c.items.length>0&&m.jsxs(m.Fragment,{children:[f!==null&&f>-1?m.jsxs("div",{children:[f+1," / ",w]}):m.jsx("div",{children:w}),m.jsxs("div",{className:"result-nav",children:[m.jsx(jd,{onSelect:()=>{y()},className:"result-nav-btn",children:sA}),m.jsx(jd,{onSelect:()=>{v()},className:"result-nav-btn",children:Qq})]})]}),c.items.length===0&&a&&l.current&&m.jsx("div",{style:{margin:"1rem auto"},children:D("search.noMatch")})]}),m.jsx(bfe,{matches:c,onItemClick:g,focusIndex:f,searchQuery:a})]})},mfe=e=>{let t=[e.preview.moreBefore?"...":"",e.preview.previewText.slice(0,e.preview.indexInSearchQuery),e.preview.previewText.slice(e.preview.indexInSearchQuery,e.preview.indexInSearchQuery+e.searchQuery.length),e.preview.previewText.slice(e.preview.indexInSearchQuery+e.searchQuery.length),e.preview.moreAfter?"...":""];return m.jsx("div",{tabIndex:-1,className:Fe("layer-ui__result-item",{active:e.highlighted}),onClick:e.onClick,ref:n=>{e.highlighted&&(n==null||n.scrollIntoView({behavior:"auto",block:"nearest"}))},children:m.jsx("div",{className:"preview-text",children:t.flatMap((n,r)=>m.jsx(I.Fragment,{children:r===2?m.jsx("b",{children:n}):n},r))})})},gfe=e=>m.jsx("div",{className:"layer-ui__search-result-container",children:e.matches.items.map((t,n)=>m.jsx(mfe,{searchQuery:e.searchQuery,preview:t.preview,highlighted:n===e.focusIndex,onClick:()=>e.onItemClick(n)},t.textElement.id+t.index))}),Ufe=(e,t)=>e.matches.nonce===t.matches.nonce&&e.focusIndex===t.focusIndex,bfe=I.memo(gfe,Ufe),yfe=(e,t,n)=>{let r=e.slice(0,t),i=r.split(/\s+/),a=r.endsWith(" "),s=i.length-2-1-(a?0:1),o=i.slice(s<=0?0:s).join(" ")+(a?" ":""),c=20;o=o.length>c?o.slice(-c):o;let d=e.slice(t+n.length),l=d.split(/\s+/),h=!d.startsWith(" "),f=h?6:5,g=(h?"":" ")+l.slice(0,f).join(" ");return{indexInSearchQuery:o.length,previewText:o+n+g,moreBefore:s>0,moreAfter:l.length>f}},vfe=(e,t)=>{let n=e.split(`
151
- `),r=[],i=0;for(let a=0;a<n.length;a++){let s=n[a],o=n[a+1];if(o){let c=t.indexOf(o,i);if(c>s.length+i){let d=c-(s.length+i);for(;d>0;)s+=" ",d--}}r.push(s),i=i+s.length}return r.join(`
152
- `)},xfe=(e,t,n)=>{let r=vfe(e.text,e.originalText).split(`
153
- `),i=[],a=0,s=0;for(let l of r){let h=a,f=h+l.length-1;i.push({line:l,startIndex:h,endIndex:f,lineNumber:s}),a=f+1,s++}let o=n,c=e.originalText.slice(n,n+t.length),d=[];for(let l of i){if(c==="")break;if(o>=l.startIndex&&o<=l.endIndex){let h=l.endIndex+1-o,f=l.line.slice(0,o-l.startIndex),g=c.slice(0,h);c=c.slice(h);let U=jr(f,Bt(e),e.lineHeight);if(f===""&&(U.width=0),e.textAlign!=="left"&&l.line.length>0){let C=jr(l.line,Bt(e),e.lineHeight),S=e.textAlign==="center"?(e.width-C.width)/2:e.width-C.width;U.width+=S}let{width:y,height:v}=jr(g,Bt(e),e.lineHeight),x=U.width,w=l.lineNumber*U.height;d.push({offsetX:x,offsetY:w,width:y,height:v}),o+=h}}return d},wfe=e=>e.replace(/[.*+?^${}()|[\]\\-]/g,"\\$&"),ck=pce((e,t,n)=>{if(!e||e===""){n([],null);return}let r=t.scene.getNonDeletedElements().filter(c=>Le(c));r.sort((c,d)=>c.y-d.y);let i=[],a=new RegExp(wfe(e),"gi");for(let c of r){let d=null,l=c.originalText;for(;(d=a.exec(l))!==null;){let h=yfe(l,d.index,e),f=xfe(c,e,d.index);f.length>0&&i.push({textElement:c,searchQuery:e,preview:h,index:d.index,matchedLines:f})}}let s=new Set(t.visibleElements.map(c=>c.id)),o=i.findIndex(c=>s.has(c.textElement.id))??null;n(i,o)},ffe),fN=r0("DefaultSidebarTrigger",e=>{let{DefaultSidebarTriggerTunnel:t}=yi();return m.jsx(t.In,{children:m.jsx(Ha.Trigger,{...e,className:"default-sidebar-trigger",name:Qa.name})})});fN.displayName="DefaultSidebarTrigger";var pN=({children:e})=>{let{DefaultSidebarTabTriggersTunnel:t}=yi();return m.jsx(t.In,{children:e})};pN.displayName="DefaultTabTriggers";var _8=Object.assign(r0("DefaultSidebar",({children:e,className:t,onDock:n,docked:r,...i})=>{var d;let a=Nr(),s=nr(),{DefaultSidebarTabTriggersTunnel:o}=yi(),c=((d=a.openSidebar)==null?void 0:d.tab)===Gu;return I.createElement(Ha,{...i,name:"default",key:"default",className:Fe("default-sidebar",t),docked:c||(r??a.defaultSidebarDockedPreference),onDock:c||n===!1||!n&&r!=null?void 0:wU(n,l=>{s({defaultSidebarDockedPreference:l})})},m.jsxs(Ha.Tabs,{children:[m.jsx(Ha.Header,{children:m.jsxs(Ha.TabTriggers,{children:[m.jsx(Ha.TabTrigger,{tab:Gu,children:kd}),m.jsx(Ha.TabTrigger,{tab:n2,children:wv}),m.jsx(o.Out,{})]})}),m.jsx(Ha.Tab,{tab:n2,children:m.jsx(Zue,{})}),m.jsx(Ha.Tab,{tab:Gu,children:m.jsx(pfe,{})}),e]}))}),{Trigger:fN,TabTriggers:pN}),Efe="small",Cfe=e=>m.jsxs("label",{className:Fe("ToolIcon ToolIcon__LaserPointer",`ToolIcon_size_${Efe}`,{"is-mobile":e.isMobile}),title:`${e.title}`,children:[m.jsx("input",{className:"ToolIcon_type_checkbox",type:"checkbox",name:e.name,onChange:e.onChange,checked:e.checked,"aria-label":e.title,"data-testid":"toolbar-LaserPointer"}),m.jsx("div",{className:"ToolIcon__icon",children:nA})]}),Sfe=({canvasRef:e,setError:t})=>{let n=e.current;if(!n)return;let r=n.parentElement;r&&(r.style.background="",t(null),n.replaceChildren())},mN=async({canvasRef:e,mermaidToExcalidrawLib:t,mermaidDefinition:n,setError:r,data:i})=>{let a=e.current,s=a==null?void 0:a.parentElement;if(!(!a||!s)){if(!n){Sfe({canvasRef:e,setError:r});return}try{let o=await t.api,c;try{c=await o.parseMermaidToExcalidraw(n)}catch{c=await o.parseMermaidToExcalidraw(n.replace(/"/g,"'"))}let{elements:d,files:l}=c;r(null),i.current={elements:Sh(d,{regenerateIds:!0}),files:l};let h=await Q1({elements:i.current.elements,files:i.current.files,exportPadding:Oh,maxWidthOrHeight:Math.max(s.offsetWidth,s.offsetHeight)*window.devicePixelRatio});try{await v1(h)}catch(f){throw f.name==="CANVAS_POSSIBLY_TOO_BIG"?new Error(D("canvasError.canvasTooBig")):f}s.style.background="var(--default-bg-color)",a.replaceChildren(h)}catch(o){throw s.style.background="var(--default-bg-color)",n&&r(o),o}}},Q7=e=>{md.set(Tp.MERMAID_TO_EXCALIDRAW,e)},gN=({app:e,data:t,text:n,shouldSaveMermaidDataToStorage:r})=>{let{elements:i,files:a}=t.current;i.length&&(e.addElementsFromPasteOrLibrary({elements:i,files:a,position:"center",fitToContent:!0}),e.setOpenDialog(null),r&&n&&Q7(n))},UN=({children:e})=>m.jsx("div",{className:"ttd-dialog-panels",children:e}),O2=({label:e,children:t,panelAction:n,panelActionDisabled:r=!1,onTextSubmitInProgess:i,renderTopRight:a,renderSubmitShortcut:s,renderBottomRight:o})=>m.jsxs("div",{className:"ttd-dialog-panel",children:[m.jsxs("div",{className:"ttd-dialog-panel__header",children:[m.jsx("label",{children:e}),a==null?void 0:a()]}),t,m.jsxs("div",{className:Fe("ttd-dialog-panel-button-container",{invisible:!n}),style:{display:"flex",alignItems:"center"},children:[m.jsxs(jd,{className:"ttd-dialog-panel-button",onSelect:n?n.action:()=>{},disabled:r||i,children:[m.jsxs("div",{className:Fe({invisible:i}),children:[n==null?void 0:n.label,(n==null?void 0:n.icon)&&m.jsx("span",{children:n.icon})]}),i&&m.jsx(il,{})]}),!r&&!i&&(s==null?void 0:s()),o==null?void 0:o()]})]}),bN=({input:e,placeholder:t,onChange:n,onKeyboardSubmit:r})=>{let i=I.useRef(null),a=I.useRef(r);return a.current=r,I.useEffect(()=>{if(!a.current)return;let s=i.current;if(s){let o=c=>{var d;c[Z.CTRL_OR_CMD]&&c.key===Z.ENTER&&(c.preventDefault(),(d=a.current)==null||d.call(a))};return s.addEventListener("keydown",o),()=>{s.removeEventListener("keydown",o)}}},[]),m.jsx("textarea",{className:"ttd-dialog-input",onChange:n,value:e,placeholder:t,autoFocus:!0,ref:i})},_fe=({error:e})=>m.jsxs("div",{"data-testid":"ttd-dialog-output-error",className:"ttd-dialog-output-error",children:["Error! ",m.jsx("p",{children:e})]}),yN=({error:e,canvasRef:t,loaded:n})=>m.jsxs("div",{className:"ttd-dialog-output-wrapper",children:[e&&m.jsx(_fe,{error:e.message}),n?m.jsx("div",{ref:t,style:{opacity:e?"0.15":1},className:"ttd-dialog-output-canvas-container"}):m.jsx(il,{size:"2rem"})]}),vN=()=>m.jsxs("div",{className:"ttd-dialog-submit-shortcut",children:[m.jsx("div",{className:"ttd-dialog-submit-shortcut__key",children:pe("CtrlOrCmd")}),m.jsx("div",{className:"ttd-dialog-submit-shortcut__key",children:pe("Enter")})]}),kfe=`flowchart TD
154
- A[Christmas] -->|Get money| B(Go shopping)
155
- B --> C{Let me think}
156
- C -->|One| D[Laptop]
157
- C -->|Two| E[iPhone]
158
- C -->|Three| F[Car]`,dk=uh(Q7,300),Tfe=({mermaidToExcalidrawLib:e})=>{let[t,n]=I.useState(()=>md.get(Tp.MERMAID_TO_EXCALIDRAW)||kfe),r=I.useDeferredValue(t.trim()),[i,a]=I.useState(null),s=I.useRef(null),o=I.useRef({elements:[],files:null}),c=io();I.useEffect(()=>{mN({canvasRef:s,data:o,mermaidToExcalidrawLib:e,setError:a,mermaidDefinition:r}).catch(l=>{LI()&&console.error("Failed to parse mermaid definition",l)}),dk(r)},[r,e]),I.useEffect(()=>()=>{dk.flush()},[]);let d=()=>{gN({app:c,data:o,text:t,shouldSaveMermaidDataToStorage:!0})};return m.jsxs(m.Fragment,{children:[m.jsx("div",{className:"ttd-dialog-desc",children:m.jsx($s,{i18nKey:"mermaid.description",flowchartLink:l=>m.jsx("a",{href:"https://mermaid.js.org/syntax/flowchart.html",children:l}),sequenceLink:l=>m.jsx("a",{href:"https://mermaid.js.org/syntax/sequenceDiagram.html",children:l}),classLink:l=>m.jsx("a",{href:"https://mermaid.js.org/syntax/classDiagram.html",children:l})})}),m.jsxs(UN,{children:[m.jsx(O2,{label:D("mermaid.syntax"),children:m.jsx(bN,{input:t,placeholder:"Write Mermaid diagram defintion here...",onChange:l=>n(l.target.value),onKeyboardSubmit:()=>{d()}})}),m.jsx(O2,{label:D("mermaid.preview"),panelAction:{action:()=>{d()},label:D("mermaid.button"),icon:bg},renderSubmitShortcut:()=>m.jsx(vN,{}),children:m.jsx(yN,{canvasRef:s,loaded:e.loaded,error:i})})]})]})},Mfe=Tfe,xN=e=>{let t=nr(),n=I.useRef(null),r=I.useRef(0);return m.jsx(Cj,{ref:n,className:"ttd-dialog-tabs-root",value:e.tab,onValueChange:i=>{var s;if(!i)return;let a=(s=n.current)==null?void 0:s.closest(".Modal__content");if(a){let o=a.offsetHeight||0;o>r.current&&(r.current=o,a.style.minHeight=`min(${r.current}px, 100%)`)}e.dialog==="ttd"&&DI(["text-to-diagram","mermaid"],i)&&t({openDialog:{name:e.dialog,tab:i}})},children:e.children})};xN.displayName="TTDDialogTabs";var Ife=xN,wN=({children:e,...t})=>m.jsx(Sj,{className:"ttd-dialog-triggers",...t,children:e});wN.displayName="TTDDialogTabTriggers";var k8=({children:e,tab:t,onSelect:n,...r})=>m.jsx(_j,{value:t,asChild:!0,onSelect:n,children:m.jsx("button",{type:"button",className:"ttd-dialog-tab-trigger",...r,children:e})});k8.displayName="TTDDialogTabTrigger";var T8=({tab:e,children:t,...n})=>m.jsx(kj,{...n,value:e,children:t});T8.displayName="TTDDialogTab";var Dy=3,Tu=1e3,Afe=hr(null),Lfe=hr(null),EN=e=>{var n;let t=Nr();return((n=t.openDialog)==null?void 0:n.name)!=="ttd"?null:m.jsx(Rfe,{...e,tab:t.openDialog.tab})},Rfe=r0("TTDDialogBase",({tab:e,...t})=>{let n=io(),r=nr(),i=I.useRef(null),[a,s]=kn(Lfe),[o,c]=I.useState((a==null?void 0:a.prompt)??""),d=o.trim(),l=M=>{c(M.target.value),s(T=>({generatedResponse:(T==null?void 0:T.generatedResponse)??null,prompt:M.target.value}))},[h,f]=I.useState(!1),[g,U]=kn(Afe),y=async()=>{if(d.length>Tu||d.length<Dy||h||(g==null?void 0:g.rateLimitRemaining)===0||"__fallback"in t){d.length<Dy&&k(new Error(`Prompt is too short (min ${Dy} characters)`)),d.length>Tu&&k(new Error(`Prompt is too long (max ${Tu} characters)`));return}try{f(!0),Jt("ai","generate","ttd");let{generatedResponse:M,error:T,rateLimit:R,rateLimitRemaining:j}=await t.onTextSubmit(d);if(typeof M=="string"&&s(P=>({generatedResponse:M,prompt:(P==null?void 0:P.prompt)??null})),Mp(R)&&Mp(j)&&U({rateLimit:R,rateLimitRemaining:j}),T){k(T);return}if(!M){k(new Error("Generation failed"));return}try{await mN({canvasRef:i,data:C,mermaidToExcalidrawLib:x,setError:k,mermaidDefinition:M}),Jt("ai","mermaid parse success","ttd")}catch(P){console.info(`%cTTD mermaid render errror: ${P.message}`,"color: red"),console.info(`>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
159
- TTD mermaid definition render errror: ${P.message}`,"color: yellow"),Jt("ai","mermaid parse failed","ttd"),k(new Error("Generated an invalid diagram :(. You may also try a different prompt."))}}catch(M){let T=M.message;(!T||T==="Failed to fetch")&&(T="Request failed"),k(new Error(T))}finally{f(!1)}},v=I.useRef(y);v.current=y;let[x,w]=I.useState({loaded:!1,api:ye(()=>import("./index-Dkn7NkQE.js").then(M=>M.N),[],import.meta.url)});I.useEffect(()=>{(async()=>(await x.api,w(M=>({...M,loaded:!0}))))()},[x.api]);let C=I.useRef({elements:[],files:null}),[S,k]=I.useState(null);return m.jsx(cs,{className:"ttd-dialog",onCloseRequest:()=>{n.setOpenDialog(null)},size:1200,title:!1,...t,autofocus:!1,children:m.jsxs(Ife,{dialog:"ttd",tab:e,children:["__fallback"in t&&t.__fallback?m.jsx("p",{className:"dialog-mermaid-title",children:D("mermaid.title")}):m.jsxs(wN,{children:[m.jsx(k8,{tab:"text-to-diagram",children:m.jsxs("div",{style:{display:"flex",alignItems:"center"},children:[D("labels.textToDiagram"),m.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",padding:"1px 6px",marginLeft:"10px",fontSize:10,borderRadius:"12px",background:"var(--color-promo)",color:"var(--color-surface-lowest)"},children:"AI Beta"})]})}),m.jsx(k8,{tab:"mermaid",children:"Mermaid"})]}),m.jsx(T8,{className:"ttd-dialog-content",tab:"mermaid",children:m.jsx(Mfe,{mermaidToExcalidrawLib:x})}),!("__fallback"in t)&&m.jsxs(T8,{className:"ttd-dialog-content",tab:"text-to-diagram",children:[m.jsx("div",{className:"ttd-dialog-desc",children:"Currently we use Mermaid as a middle step, so you'll get best results if you describe a diagram, workflow, flow chart, and similar."}),m.jsxs(UN,{children:[m.jsx(O2,{label:D("labels.prompt"),panelAction:{action:y,label:"Generate",icon:bg},onTextSubmitInProgess:h,panelActionDisabled:d.length>Tu||(g==null?void 0:g.rateLimitRemaining)===0,renderTopRight:()=>g?m.jsxs("div",{className:"ttd-dialog-rate-limit",style:{fontSize:12,marginLeft:"auto",color:g.rateLimitRemaining===0?"var(--color-danger)":void 0},children:[g.rateLimitRemaining," requests left today"]}):null,renderSubmitShortcut:()=>m.jsx(vN,{}),renderBottomRight:()=>{if(typeof(a==null?void 0:a.generatedResponse)=="string")return m.jsxs("div",{className:"excalidraw-link",style:{marginLeft:"auto",fontSize:14},onClick:()=>{typeof(a==null?void 0:a.generatedResponse)=="string"&&(Q7(a.generatedResponse),r({openDialog:{name:"ttd",tab:"mermaid"}}))},children:["View as Mermaid",m.jsx(i6,{icon:bg})]});let M=d.length/Tu;return M>.8?m.jsxs("div",{style:{marginLeft:"auto",fontSize:12,fontFamily:"monospace",color:M>1?"var(--color-danger)":void 0},children:["Length: ",d.length,"/",Tu]}):null},children:m.jsx(bN,{onChange:l,input:o,placeholder:"Describe what you want to see...",onKeyboardSubmit:()=>{v.current()}})}),m.jsx(O2,{label:"Preview",panelAction:{action:()=>{console.info("Panel action clicked"),gN({app:n,data:C})},label:"Insert",icon:bg},children:m.jsx(yN,{canvasRef:i,error:S,loaded:x.loaded})})]})]})]})})}),Dfe=.01,al=(e,t)=>!(t==="height"&&Le(e)||t==="width"&&Le(e)||t==="angle"&&tt(e)),Ir=(e,t)=>{let n=e+t/2;return n-n%t},F2=(e,t,n)=>Object.keys(e).map(r=>({original:(n??t).get(r),latest:t.get(r)})).filter(r=>r.original!==void 0&&r.latest!==void 0),_1=(e,t,n,r,i,a,s,o=!0)=>{let c=r.get(n.id);if(!c)return;let[d,l]=[n.x+n.width/2,n.y+n.height/2],[h,f]=he(A(n.x,n.y),A(d,l),n.angle),g=e-h,U=t-f,[y,v]=he(A(e,t),A(d+g,l+U),-n.angle);me(c,{x:y,y:v},o),M8(c,r,i,a);let x=pt(n,s);if(x){let w=r.get(x.id);w&&me(w,{x:x.x+g,y:x.y+U},o)}},J7=(e,t)=>{let n=hd(t).map(r=>rn(e,r).reduce((i,a)=>(i[a.id]=!0,i),{}));return e.filter(r=>!Uh(r)).forEach(r=>{n.push({[r.id]:!0})}),n},M8=(e,t,n,r,i)=>{st(e)?g2([e],t,n,r,!0,[],i==null?void 0:i.zoom):gi(e,t,i)},jfe=({label:e,icon:t,dragInputCallback:n,value:r,elements:i,editable:a=!0,shouldKeepAspectRatio:s,property:o,scene:c,appState:d,sensitivity:l=1})=>{let h=io(),f=I.useRef(null),g=I.useRef(null),[U,y]=I.useState(r.toString()),v=I.useRef(null);v.current||(v.current={originalAppState:Ho(d),originalElements:i,lastUpdatedValue:U,updatePending:!1}),I.useEffect(()=>{let C=r.toString();y(C),v.current.lastUpdatedValue=C},[r]);let x=(C,S,k)=>{if(!v.current.updatePending)return!1;v.current.updatePending=!1;let M=Number(C);if(isNaN(M)){y(r.toString());return}let T=Number(M.toFixed(2)),R=Number(r);(isNaN(R)||Math.abs(T-R)>=Dfe)&&(v.current.lastUpdatedValue=C,n({accumulatedChange:0,instantChange:0,originalElements:S,originalElementsMap:h.scene.getNonDeletedElementsMap(),shouldKeepAspectRatio:s,shouldChangeByStepSize:!1,scene:c,nextValue:T,property:o,originalAppState:k,setInputValue:j=>y(String(j))}),h.syncActionResult({captureUpdate:le.IMMEDIATELY}))},w=I.useRef({});return w.current.handleInputValue=x,I.useEffect(()=>{let C=f.current,S=w.current;return()=>{var M;let k=C==null?void 0:C.value;k&&((M=S.handleInputValue)==null||M.call(S,k,v.current.originalElements,v.current.originalAppState)),window.removeEventListener("pointermove",S.onPointerMove,!1),window.removeEventListener("pointerup",S.onPointerUp,!1)}},[a]),a?m.jsxs("div",{className:Fe("drag-input-container",!a&&"disabled"),"data-testid":e,children:[m.jsx("div",{className:"drag-input-label",ref:g,onPointerDown:C=>{if(f.current&&a){document.body.classList.add("excalidraw-cursor-resize"),Number(f.current.value);let S=null,k=h.scene.getNonDeletedElements().reduce((F,$)=>(F.set($.id,Hd($)),F),new Map),M=i.map(F=>k.get(F.id)),T=Ho(d),R=0,j=0,P=F=>{if(S&&k!==null&&M!==null){let $=F.clientX-S.x;$!==0&&(j+=$,Math.abs(j)>=l&&(j=Math.sign(j)*Math.floor(Math.abs(j)/l),R+=j,n({accumulatedChange:R,instantChange:j,originalElements:M,originalElementsMap:k,shouldKeepAspectRatio:s,shouldChangeByStepSize:F.shiftKey,property:o,scene:c,originalAppState:T,setInputValue:q=>y(String(q))}),j=0))}S={x:F.clientX,y:F.clientY}},N=()=>{window.removeEventListener("pointermove",P,!1),h.syncActionResult({captureUpdate:le.IMMEDIATELY}),S=null,R=0,j=0,M=null,k=null,document.body.classList.remove("excalidraw-cursor-resize"),window.removeEventListener("pointerup",N,!1)};w.current.onPointerMove=P,w.current.onPointerUp=N,window.addEventListener("pointermove",P,!1),window.addEventListener("pointerup",N,!1)}},onPointerEnter:()=>{g.current&&(g.current.style.cursor="ew-resize")},children:t?m.jsx(i6,{icon:t}):e}),m.jsx("input",{className:"drag-input",autoComplete:"off",spellCheck:"false",onKeyDown:C=>{if(a){let S=C.target;S instanceof HTMLInputElement&&C.key===Z.ENTER&&(x(S.value,i,d),h.focusContainer())}},ref:f,value:U,onChange:C=>{v.current.updatePending=!0,y(C.target.value)},onFocus:C=>{C.target.select(),v.current.originalElements=i,v.current.originalAppState=Ho(d)},onBlur:C=>{U?a&&x(C.target.value,v.current.originalElements,v.current.originalAppState):y(r.toString())},disabled:!a})]}):null},dl=jfe,uk=10,Pfe=e=>e.type==="image",Nfe=({accumulatedChange:e,originalElements:t,originalElementsMap:n,shouldKeepAspectRatio:r,shouldChangeByStepSize:i,nextValue:a,property:s,originalAppState:o,instantChange:c,scene:d})=>{let l=d.getNonDeletedElementsMap(),h=t[0],f=l.get(h.id);if(h&&f){let g=r||Pfe(h),U=h.width/h.height;if(o.croppingElementId===h.id){let C=l.get(h.id);if(!C||!Lt(C)||!C.crop)return;let S=C.crop,k={...S},M=C.scale[0]===-1,T=C.scale[1]===-1,{width:R,height:j}=Zo(C),P=S.naturalWidth/R,N=S.naturalHeight/j,F=M?S.width+S.x:S.naturalWidth-S.x,$=T?S.height+S.y:S.naturalHeight-S.y,q=sr*P,W=sr*N;if(a!==void 0){if(s==="width"){let K=a*P,G=vt(K,q,F);k={...k,width:G,x:M?S.x+S.width-G:S.x}}else if(s==="height"){let K=a*N,G=vt(K,W,$);k={...k,height:G,y:T?S.y+S.height-G:S.y}}me(C,{crop:k,width:k.width/(S.naturalWidth/R),height:k.height/(S.naturalHeight/j)});return}let V=s==="width"?c:0,B=s==="height"?c:0,z=vt(S.width+V,q,F),Y=vt(S.height+B,q,$);k={...S,x:M?S.x+S.width-z:S.x,y:T?S.y+S.height-Y:S.y,width:z,height:Y},me(C,{crop:k,width:k.width/(S.naturalWidth/R),height:k.height/(S.naturalHeight/j)});return}if(a!==void 0){let C=Math.max(s==="width"?a:g?a*U:h.width,ra),S=Math.max(s==="height"?a:g?a/U:h.height,ra);y1(C,S,f,h,l,n,s==="width"?"e":"s",{shouldMaintainAspectRatio:g});return}let y=s==="width"?e:0,v=s==="height"?e:0,x=Math.max(0,h.width+y);s==="width"&&(i?x=Ir(x,uk):x=Math.round(x));let w=Math.max(0,h.height+v);s==="height"&&(i?w=Ir(w,uk):w=Math.round(w)),g&&(s==="width"?w=Math.round(x/U*100)/100:x=Math.round(w*U*100)/100),w=Math.max(ra,w),x=Math.max(ra,x),y1(x,w,f,h,l,n,s==="width"?"e":"s",{shouldMaintainAspectRatio:g})}},Ofe=({property:e,element:t,scene:n,appState:r})=>{let i=Bs(e==="width"?t.width:t.height,2);if(r.croppingElementId&&r.croppingElementId===t.id&&Lt(t)&&t.crop){let{width:a,height:s}=Zo(t);if(e==="width"){let o=a/t.crop.naturalWidth;i=Bs(t.crop.width*o,2)}if(e==="height"){let o=s/t.crop.naturalHeight;i=Bs(t.crop.height*o,2)}}return m.jsx(dl,{label:e==="width"?"W":"H",elements:[t],dragInputCallback:Nfe,value:i,editable:al(t,e),scene:n,appState:r,property:e})},hk=Ofe,Ffe=15,$fe=({accumulatedChange:e,originalElements:t,shouldChangeByStepSize:n,nextValue:r,scene:i})=>{let a=i.getNonDeletedElementsMap(),s=i.getNonDeletedElements(),o=t[0];if(o&&!Pe(o)){let c=a.get(o.id);if(!c)return;if(r!==void 0){let U=cd(r);me(c,{angle:U}),M8(c,a,s,i);let y=pt(c,a);y&&!Ut(c)&&me(y,{angle:U});return}let d=Math.round(z1(o.angle)*100)/100,l=Math.round(e),h=(d+l)%360;n&&(h=Ir(h,Ffe)),h=h<0?h+360:h;let f=cd(h);me(c,{angle:f}),M8(c,a,s,i);let g=pt(c,a);g&&!Ut(c)&&me(g,{angle:f})}},Bfe=({element:e,scene:t,appState:n,property:r})=>m.jsx(dl,{label:"A",icon:QI,value:Math.round(z1(e.angle)%360*100)/100,elements:[e],dragInputCallback:$fe,editable:al(e,"angle"),scene:t,appState:n,property:r}),zfe=Bfe,fk=4,Hfe=4,Wfe=({accumulatedChange:e,originalElements:t,shouldChangeByStepSize:n,nextValue:r,scene:i})=>{let a=i.getNonDeletedElementsMap(),s=t[0];if(s){let o=a.get(s.id);if(!o||!Le(o))return;let c;if(r!==void 0)c=Math.max(Math.round(r),fk);else if(s.type==="text"){let d=Math.round(s.fontSize),l=Math.round(e);c=Math.max(d+l,fk),n&&(c=Ir(c,Hfe))}c&&(me(o,{fontSize:c}),Yr(o,i.getContainerElement(o),i.getNonDeletedElementsMap()))}},Xfe=({element:e,scene:t,appState:n,property:r})=>{let i=Le(e)?e:ma(e)?pt(e,t.getNonDeletedElementsMap()):null;return i?m.jsx(dl,{label:"F",value:Math.round(i.fontSize*10)/10,elements:[i],dragInputCallback:Wfe,icon:_U,appState:n,scene:t,property:r}):null},Vfe=Xfe,Mu=10,Yfe=(e,t,n,r)=>{let i=r.x-e,a=r.y-t,s=r.width*n,o=r.height*n,c=e+i*n,d=t+a*n;return{width:s,height:o,x:c,y:d,...f7(r,s,o,!1),...Le(r)?{fontSize:r.fontSize*n}:{}}},Gfe=(e,t,n,r,i,a,s,o)=>{let c=Yfe(e,t,r,a);me(i,c,!1);let d=pt(a,o);if(d){let l=d.fontSize*r;gi(i,s,{newSize:{width:c.width,height:c.height}});let h=s.get(d.id);h&&Le(h)&&(me(h,{fontSize:l},!1),G1(i,s,n==="width"?"e":"s",!0))}},pk=(e,t,n,r,i,a,s,o,c,d)=>{a==="width"?t=Math.round(e/r*100)/100:e=Math.round(t*r*100)/100;let l=t/n;for(let h=0;h<o.length;h++){let f=o[h],g=s[h];Gfe(i[0],i[1],a,l,g,f,c,d)}},qfe=({accumulatedChange:e,originalElements:t,originalElementsMap:n,originalAppState:r,shouldChangeByStepSize:i,nextValue:a,scene:s,property:o})=>{let c=s.getNonDeletedElementsMap(),d=J7(t,r);if(a!==void 0){for(let f of d){let g=F2(f,c,n);if(g.length>1){let U=g.map(j=>j.latest),y=g.map(j=>j.original),[v,x,w,C]=Dt(y),S=w-v,k=C-x,M=S/k,T=Math.max(ra,o==="width"?Math.max(0,a):S),R=Math.max(ra,o==="height"?Math.max(0,a):k);pk(T,R,k,M,A(v,x),o,U,y,c,n)}else{let[U]=g,y=U==null?void 0:U.latest,v=U==null?void 0:U.original;if(y&&v&&al(y,o)){let x=o==="width"?Math.max(0,a):y.width;o==="width"&&(i?x=Ir(x,Mu):x=Math.round(x));let w=o==="height"?Math.max(0,a):y.height;o==="height"&&(i?w=Ir(w,Mu):w=Math.round(w)),x=Math.max(ra,x),w=Math.max(ra,w),y1(x,w,y,v,c,n,o==="width"?"e":"s",{shouldInformMutation:!1})}}}s.triggerUpdate();return}let l=o==="width"?e:0,h=o==="height"?e:0;for(let f of d){let g=F2(f,c,n);if(g.length>1){let U=g.map(j=>j.latest),y=g.map(j=>j.original),[v,x,w,C]=Dt(y),S=w-v,k=C-x,M=S/k,T=Math.max(0,S+l);o==="width"&&(i?T=Ir(T,Mu):T=Math.round(T));let R=Math.max(0,k+h);o==="height"&&(i?R=Ir(R,Mu):R=Math.round(R)),T=Math.max(ra,T),R=Math.max(ra,R),pk(T,R,k,M,A(v,x),o,U,y,c,n)}else{let[U]=g,y=U==null?void 0:U.latest,v=U==null?void 0:U.original;if(y&&v&&al(y,o)){let x=Math.max(0,v.width+l);o==="width"&&(i?x=Ir(x,Mu):x=Math.round(x));let w=Math.max(0,v.height+h);o==="height"&&(i?w=Ir(w,Mu):w=Math.round(w)),x=Math.max(ra,x),w=Math.max(ra,w),y1(x,w,y,v,c,n,o==="width"?"e":"s",{shouldInformMutation:!1})}}}s.triggerUpdate()},Zfe=({property:e,elements:t,elementsMap:n,atomicUnits:r,scene:i,appState:a})=>{let s=I.useMemo(()=>r.map(d=>{let l=F2(d,n);if(l.length>1){let[f,g,U,y]=Dt(l.map(v=>v.latest));return Math.round((e==="width"?U-f:y-g)*100)/100}let[h]=l;return Math.round((e==="width"?h.latest.width:h.latest.height)*100)/100}),[n,r,e]),o=new Set(s).size===1?Math.round(s[0]*100)/100:"Mixed",c=s.length>0;return m.jsx(dl,{label:e==="width"?"W":"H",elements:t,dragInputCallback:qfe,value:o,editable:c,appState:a,property:e,scene:i})},mk=Zfe,Kfe=15,Qfe=({accumulatedChange:e,originalElements:t,shouldChangeByStepSize:n,nextValue:r,property:i,scene:a})=>{let s=a.getNonDeletedElementsMap(),o=t.map(d=>s.get(d.id)).filter(d=>d&&!Uh(d)&&al(d,i)),c=t.filter(d=>!Uh(d)&&al(d,i));if(r!==void 0){let d=cd(r);for(let l of o){if(!l)continue;me(l,{angle:d},!1);let h=pt(l,s);h&&!Ut(l)&&me(h,{angle:d},!1)}a.triggerUpdate();return}for(let d=0;d<o.length;d++){let l=o[d];if(!l)continue;let h=c[d],f=Math.round(z1(h.angle)*100)/100,g=Math.round(e),U=(f+g)%360;n&&(U=Ir(U,Kfe)),U=U<0?U+360:U;let y=cd(U);me(l,{angle:y},!1);let v=pt(l,s);v&&!Ut(l)&&me(v,{angle:y},!1)}a.triggerUpdate()},Jfe=({elements:e,scene:t,appState:n,property:r})=>{let i=e.filter(c=>!Uh(c)&&al(c,"angle")),a=i.map(c=>Math.round(z1(c.angle)%360*100)/100),s=new Set(a).size===1?a[0]:"Mixed",o=i.some(c=>al(c,"angle"));return m.jsx(dl,{label:"A",icon:QI,value:s,elements:e,dragInputCallback:Qfe,editable:o,appState:n,scene:t,property:r})},epe=Jfe,gk=4,tpe=4,npe=(e,t)=>e.reduce((n,r)=>{if(!r||Uh(r))return n;if(Le(r))return n.push(r),n;if(ma(r)){let i=pt(r,t);if(i)return n.push(i),n}return n},[]),rpe=({accumulatedChange:e,originalElements:t,shouldChangeByStepSize:n,nextValue:r,scene:i})=>{let a=i.getNonDeletedElementsMap(),s=t.map(c=>a.get(c.id)),o;if(r){o=Math.max(Math.round(r),gk);for(let c of s)me(c,{fontSize:o},!1),Yr(c,i.getContainerElement(c),a,!1);i.triggerUpdate()}else{let c=t;for(let d=0;d<s.length;d++){let l=s[d],h=c[d],f=Math.round(h.fontSize),g=Math.round(e),U=Math.max(f+g,gk);n&&(U=Ir(U,tpe)),me(l,{fontSize:U},!1),Yr(l,i.getContainerElement(l),a,!1)}i.triggerUpdate()}},ipe=({elements:e,scene:t,appState:n,property:r,elementsMap:i})=>{let a=npe(e,i);if(!a.length)return null;let s=a.map(d=>Math.round(d.fontSize*10)/10),o=new Set(s).size===1?s[0]:"Mixed",c=s.length>0;return m.jsx(dl,{label:"F",icon:_U,elements:a,dragInputCallback:rpe,value:o,editable:c,scene:t,property:r,appState:n})},ape=ipe,Uk=10,spe=({accumulatedChange:e,instantChange:t,originalElements:n,originalElementsMap:r,shouldChangeByStepSize:i,nextValue:a,property:s,scene:o,originalAppState:c})=>{let d=o.getNonDeletedElementsMap(),l=o.getNonDeletedElements(),h=n[0],[f,g]=[h.x+h.width/2,h.y+h.height/2],[U,y]=he(A(h.x,h.y),A(f,g),h.angle);if(c.croppingElementId===h.id){let S=d.get(h.id);if(!S||!Lt(S)||!S.crop)return;let k=S.crop,M=k,T=S.scale[0]===-1,R=S.scale[1]===-1,{width:j,height:P}=Zo(S);if(a!==void 0){if(s==="x"){let $=a*(k.naturalWidth/j);T?M={...k,x:vt(k.naturalWidth-$-k.width,0,k.naturalWidth-k.width)}:M={...k,x:vt(a*(k.naturalWidth/j),0,k.naturalWidth-k.width)}}s==="y"&&(M={...k,y:vt(a*(k.naturalHeight/P),0,k.naturalHeight-k.height)}),me(S,{crop:M});return}let N=(s==="x"?t:0)*(T?-1:1),F=(s==="y"?t:0)*(R?-1:1);M={...k,x:vt(k.x+N,0,k.naturalWidth-k.width),y:vt(k.y+F,0,k.naturalHeight-k.height)},me(S,{crop:M});return}if(a!==void 0){_1(s==="x"?a:U,s==="y"?a:y,h,d,l,o,r);return}let v=s==="x"?e:0,x=s==="y"?e:0,w=s==="x"?Math.round(i?Ir(h.x+v,Uk):U+v):U,C=s==="y"?Math.round(i?Ir(h.y+x,Uk):y+x):y;_1(w,C,h,d,l,o,r)},ope=({property:e,element:t,elementsMap:n,scene:r,appState:i})=>{let[a,s]=he(A(t.x,t.y),A(t.x+t.width/2,t.y+t.height/2),t.angle),o=Bs(e==="x"?a:s,2);if(i.croppingElementId===t.id&&Lt(t)&&t.crop){let c=ste(t);c&&(o=Bs(e==="x"?c.x:c.y,2))}return m.jsx(dl,{label:e==="x"?"X":"Y",elements:[t],dragInputCallback:spe,scene:r,value:o,property:e,appState:i})},bk=ope,lpe=10,cpe=(e,t,n,r,i,a,s,o)=>{for(let c=0;c<r.length;c++){let d=i[c],[l,h]=[d.x+d.width/2,d.y+d.height/2],[f,g]=he(A(d.x,d.y),A(l,h),d.angle),U=e==="x"?Math.round(f+t):f,y=e==="y"?Math.round(g+n):g;_1(U,y,d,a,r,o,s,!1)}},dpe=(e,t,n,r,i,a,s)=>{let[o,c,,]=Dt(n),d=e-o,l=t-c;for(let h=0;h<n.length;h++){let f=n[h],g=r.get(f.id);if(g&&(!Le(g)||!g.containerId)){let[U,y]=[g.x+g.width/2,g.y+g.height/2],[v,x]=he(A(g.x,g.y),A(U,y),g.angle);_1(v+d,x+l,f,r,i,s,a,!1)}}},upe=({accumulatedChange:e,originalElements:t,originalElementsMap:n,shouldChangeByStepSize:r,nextValue:i,property:a,scene:s,originalAppState:o})=>{var h,f;let c=s.getNonDeletedElementsMap(),d=s.getNonDeletedElements();if(i!==void 0){for(let g of J7(t,o)){let U=F2(g,c,n);if(U.length>1){let[y,v,,]=Dt(U.map(x=>x.latest));dpe(a==="x"?i:y,a==="y"?i:v,U.map(x=>x.original),c,d,n,s)}else{let y=(h=U[0])==null?void 0:h.original,v=(f=U[0])==null?void 0:f.latest;if(y&&v&&al(v,a)){let[x,w]=[y.x+y.width/2,y.y+y.height/2],[C,S]=he(A(y.x,y.y),A(x,w),y.angle);_1(a==="x"?i:C,a==="y"?i:S,y,c,d,s,n,!1)}}}s.triggerUpdate();return}let l=r?Ir(e,lpe):e;cpe(a,a==="x"?l:0,a==="y"?l:0,t,t,c,n,s),s.triggerUpdate()},hpe=({property:e,elements:t,elementsMap:n,atomicUnits:r,scene:i,appState:a})=>{let s=I.useMemo(()=>r.map(c=>{let d=Object.keys(c).map(y=>n.get(y)).filter(y=>y!==void 0);if(d.length>1){let[y,v]=Dt(d);return Math.round((e==="x"?y:v)*100)/100}let[l]=d,[h,f]=[l.x+l.width/2,l.y+l.height/2],[g,U]=he(A(l.x,l.y),A(h,f),l.angle);return Math.round((e==="x"?g:U)*100)/100}),[r,n,e]),o=new Set(s).size===1?s[0]:"Mixed";return m.jsx(dl,{label:e==="x"?"X":"Y",elements:t,dragInputCallback:upe,value:o,property:e,scene:i,appState:a})},yk=hpe,vk=5,fpe=({property:e,scene:t,appState:n,setAppState:r})=>m.jsx(dl,{label:"Grid step",sensitivity:8,elements:[],dragInputCallback:({nextValue:i,instantChange:a,shouldChangeByStepSize:s,setInputValue:o})=>{r(c=>{let d;return i?d=i:a&&(d=s?Ir(c.gridStep+vk*Math.sign(a),vk):c.gridStep+a),d?(d=YA(d),o(d),{gridStep:d}):(o(c.gridStep),null)})},scene:t,value:n.gridStep,property:e,appState:n}),ppe=fpe,mpe=50,d6=e=>{let t=s0(),n=e.app.scene.getSceneNonce()||1,r=e.app.scene.getSelectedElements({selectedElementIds:t.selectedElementIds,includeBoundTextElement:!1}),i=g1(e.app);return m.jsx(gpe,{...e,appState:t,sceneNonce:n,selectedElements:r,gridModeEnabled:i})},nn=({children:e,columns:t=1,heading:n,style:r,...i})=>m.jsx("div",{className:Fe("exc-stats__row",{"exc-stats__row--heading":n}),style:{gridTemplateColumns:`repeat(${t}, 1fr)`,...r},...i,children:e});nn.displayName="StatsRow";var $2=({children:e,order:t,style:n,...r})=>m.jsx("div",{className:"exc-stats__rows",style:{order:t,...n},...r,children:e});$2.displayName="StatsRows";d6.StatsRow=nn;d6.StatsRows=$2;var gpe=I.memo(({app:e,onClose:t,renderCustomStats:n,selectedElements:r,appState:i,sceneNonce:a,gridModeEnabled:s})=>{let o=e.scene,c=o.getNonDeletedElements(),d=o.getNonDeletedElementsMap(),l=nr(),h=r.length===1?r[0]:null,f=r.length>1?r:null,g=i.croppingElementId&&Lt(h),U=g?Zo(h):null,[y,v]=I.useState({width:0,height:0}),x=I.useMemo(()=>F1(S=>{let k=Dt(S);v({width:Math.round(k[2])-Math.round(k[0]),height:Math.round(k[3])-Math.round(k[1])})},mpe),[]);I.useEffect(()=>{x(c)},[a,c,x]),I.useEffect(()=>()=>x.cancel(),[x]);let w=I.useMemo(()=>J7(r,i),[r,i]),C=I.useMemo(()=>GL(r),[r]);return m.jsx("div",{className:"exc-stats",children:m.jsxs(ts,{padding:3,children:[m.jsxs("div",{className:"title",children:[m.jsx("h2",{children:D("stats.title")}),m.jsx("div",{className:"close",onClick:t,children:Bh})]}),m.jsxs(g8,{label:m.jsx("h3",{children:D("stats.generalStats")}),open:!!(i.stats.panels&Nu.generalStats),openTrigger:()=>l(S=>({stats:{open:!0,panels:S.stats.panels^Nu.generalStats}})),children:[m.jsxs($2,{children:[m.jsx(nn,{heading:!0,children:D("stats.scene")}),m.jsxs(nn,{columns:2,children:[m.jsx("div",{children:D("stats.shapes")}),m.jsx("div",{children:c.length})]}),m.jsxs(nn,{columns:2,children:[m.jsx("div",{children:D("stats.width")}),m.jsx("div",{children:y.width})]}),m.jsxs(nn,{columns:2,children:[m.jsx("div",{children:D("stats.height")}),m.jsx("div",{children:y.height})]}),s&&m.jsxs(m.Fragment,{children:[m.jsx(nn,{heading:!0,children:"Canvas"}),m.jsx(nn,{children:m.jsx(ppe,{property:"gridStep",scene:o,appState:i,setAppState:l})})]})]}),n==null?void 0:n(c,i)]}),!C&&r.length>0&&m.jsx("div",{id:"elementStats",style:{marginTop:12},children:m.jsx(g8,{label:m.jsx("h3",{children:D("stats.elementProperties")}),open:!!(i.stats.panels&Nu.elementProperties),openTrigger:()=>l(S=>({stats:{open:!0,panels:S.stats.panels^Nu.elementProperties}})),children:m.jsxs($2,{children:[h&&m.jsxs(m.Fragment,{children:[g&&m.jsx(nn,{heading:!0,children:D("labels.unCroppedDimension")}),i.croppingElementId&&Lt(h)&&U&&m.jsxs(nn,{columns:2,children:[m.jsx("div",{children:D("stats.width")}),m.jsx("div",{children:Bs(U.width,2)})]}),i.croppingElementId&&Lt(h)&&U&&m.jsxs(nn,{columns:2,children:[m.jsx("div",{children:D("stats.height")}),m.jsx("div",{children:Bs(U.height,2)})]}),m.jsx(nn,{heading:!0,"data-testid":"stats-element-type",children:i.croppingElementId?D("labels.imageCropping"):D(`element.${h.type}`)}),m.jsx(nn,{children:m.jsx(bk,{element:h,property:"x",elementsMap:d,scene:o,appState:i})}),m.jsx(nn,{children:m.jsx(bk,{element:h,property:"y",elementsMap:d,scene:o,appState:i})}),m.jsx(nn,{children:m.jsx(hk,{property:"width",element:h,scene:o,appState:i})}),m.jsx(nn,{children:m.jsx(hk,{property:"height",element:h,scene:o,appState:i})}),!Pe(h)&&m.jsx(nn,{children:m.jsx(zfe,{property:"angle",element:h,scene:o,appState:i})}),m.jsx(nn,{children:m.jsx(Vfe,{property:"fontSize",element:h,scene:o,appState:i})})]}),f&&m.jsxs(m.Fragment,{children:[QA(f)&&m.jsx(nn,{heading:!0,children:D("element.group")}),m.jsxs(nn,{columns:2,style:{margin:"0.3125rem 0"},children:[m.jsx("div",{children:D("stats.shapes")}),m.jsx("div",{children:r.length})]}),m.jsx(nn,{children:m.jsx(yk,{property:"x",elements:f,elementsMap:d,atomicUnits:w,scene:o,appState:i})}),m.jsx(nn,{children:m.jsx(yk,{property:"y",elements:f,elementsMap:d,atomicUnits:w,scene:o,appState:i})}),m.jsx(nn,{children:m.jsx(mk,{property:"width",elements:f,elementsMap:d,atomicUnits:w,scene:o,appState:i})}),m.jsx(nn,{children:m.jsx(mk,{property:"height",elements:f,elementsMap:d,atomicUnits:w,scene:o,appState:i})}),m.jsx(nn,{children:m.jsx(epe,{property:"angle",elements:f,scene:o,appState:i})}),m.jsx(nn,{children:m.jsx(ape,{property:"fontSize",elements:f,scene:o,appState:i,elementsMap:d})})]})]})})})]})})},(e,t)=>e.sceneNonce===t.sceneNonce&&e.selectedElements===t.selectedElements&&e.appState.stats.panels===t.appState.stats.panels&&e.gridModeEnabled===t.gridModeEnabled&&e.appState.gridStep===t.appState.gridStep&&e.appState.croppingElementId===t.appState.croppingElementId),Upe=({sourceElementId:e,onClose:t,elementsMap:n,appState:r,generateLinkForSelection:i=SL})=>{var h;let a=((h=n.get(e))==null?void 0:h.link)??null,[s,o]=I.useState(a),[c,d]=I.useState(!1);I.useEffect(()=>{let f=gt(n,r),g=a;if(f.length>0&&i){let U=_L(f,r);U&&(g=Ui(i(U.id,U.type)))}o(g)},[n,r,r.selectedElementIds,a,i]);let l=I.useCallback(()=>{var f;if(s&&s!==((f=n.get(e))==null?void 0:f.link)){let g=n.get(e);g&&me(g,{link:s})}if(!s&&c&&e){let g=n.get(e);g&&me(g,{link:null})}t==null||t()},[e,s,n,c,t]);return I.useEffect(()=>{let f=g=>{var U,y;((U=r.openDialog)==null?void 0:U.name)==="elementLinkSelector"&&g.key===Z.ENTER&&l(),((y=r.openDialog)==null?void 0:y.name)==="elementLinkSelector"&&g.key===Z.ESCAPE&&(t==null||t())};return window.addEventListener("keydown",f),()=>{window.removeEventListener("keydown",f)}},[r,t,l]),m.jsxs("div",{className:"ElementLinkDialog",children:[m.jsxs("div",{className:"ElementLinkDialog__header",children:[m.jsx("h2",{children:D("elementLink.title")}),m.jsx("p",{children:D("elementLink.desc")})]}),m.jsxs("div",{className:"ElementLinkDialog__input",children:[m.jsx(q7,{value:s??"",onChange:f=>{c||d(!0),o(f)},onKeyDown:f=>{f.key===Z.ENTER&&l()},className:"ElementLinkDialog__input-field",selectOnRender:!0}),a&&s&&m.jsx(Ct,{type:"button",title:D("buttons.remove"),"aria-label":D("buttons.remove"),label:D("buttons.remove"),onClick:()=>{o(null),d(!0)},className:"ElementLinkDialog__remove",icon:_d})]}),m.jsxs("div",{className:"ElementLinkDialog__actions",children:[m.jsx(Ch,{label:D("buttons.cancel"),onClick:()=>{t==null||t()},style:{marginRight:10}}),m.jsx(Ch,{label:D("buttons.confirm"),onClick:l,actionType:"primary"})]})]})},bpe=Upe,ype=({UIOptions:e})=>m.jsxs(Zt,{__fallback:!0,children:[m.jsx(Zt.DefaultItems.LoadScene,{}),m.jsx(Zt.DefaultItems.SaveToActiveFile,{}),e.canvasActions.export&&m.jsx(Zt.DefaultItems.Export,{}),e.canvasActions.saveAsImage&&m.jsx(Zt.DefaultItems.SaveAsImage,{}),m.jsx(Zt.DefaultItems.SearchMenu,{}),m.jsx(Zt.DefaultItems.Help,{}),m.jsx(Zt.DefaultItems.ClearCanvas,{}),m.jsx(Zt.Separator,{}),m.jsx(Zt.Group,{title:"Excalidraw links",children:m.jsx(Zt.DefaultItems.Socials,{})}),m.jsx(Zt.Separator,{}),m.jsx(Zt.DefaultItems.ToggleTheme,{}),m.jsx(Zt.DefaultItems.ChangeCanvasBackground,{})]}),vpe=()=>m.jsxs(Ry,{__fallback:!0,children:[m.jsx(Ry.Actions.SaveToDisk,{}),m.jsx(Ry.Actions.ExportToImage,{})]}),xpe=({actionManager:e,appState:t,files:n,setAppState:r,elements:i,canvas:a,onLockToggle:s,onHandToolToggle:o,onPenModeToggle:c,showExitZenModeBtn:d,renderTopRightUI:l,renderCustomStats:h,UIOptions:f,onExportImage:g,renderWelcomeScreen:U,children:y,app:v,isCollaborating:x,generateLinkForSelection:w})=>{var V,B,z;let C=Yn(),S=lhe(),k=S.tunnelsJotai.Provider,[M,T]=kn(r6),R=()=>f.canvasActions.export?m.jsx(ife,{elements:i,appState:t,files:n,actionManager:e,exportOpts:f.canvasActions.export,canvas:a,setAppState:r}):null,j=()=>{var Y;return!f.canvasActions.saveAsImage||((Y=t.openDialog)==null?void 0:Y.name)!=="imageExport"?null:m.jsx(Rhe,{elements:i,appState:t,files:n,actionManager:e,onExportImage:g,onCloseRequest:()=>r({openDialog:null}),name:v.getName()})},P=()=>m.jsxs("div",{style:{position:"relative"},children:[m.jsx(S.MainMenuTunnel.Out,{}),U&&m.jsx(S.WelcomeScreenMenuHintTunnel.Out,{})]}),N=()=>m.jsx(S1,{heading:"selectedShapeActions",className:Fe("selected-shape-actions zen-mode-transition",{"transition-left":t.zenModeEnabled}),children:m.jsx(ts,{className:oh.SHAPE_ACTIONS_MENU,padding:2,style:{maxHeight:`${t.height-166}px`},children:m.jsx(SP,{appState:t,elementsMap:v.scene.getNonDeletedElementsMap(),renderAction:e.renderAction,app:v})})}),F=()=>{var G,ee,de,xe,ve;let Y=m7(t,i),K=t.stats.open&&!t.zenModeEnabled&&!t.viewModeEnabled&&((G=t.openDialog)==null?void 0:G.name)!=="elementLinkSelector";return m.jsx(DP,{side:"top",children:m.jsxs("div",{className:"App-menu App-menu_top",children:[m.jsxs(la.Col,{gap:6,className:Fe("App-menu_top__left"),children:[P(),Y&&N()]}),!t.viewModeEnabled&&((ee=t.openDialog)==null?void 0:ee.name)!=="elementLinkSelector"&&m.jsx(S1,{heading:"shapes",className:"shapes-section",children:Me=>m.jsxs("div",{style:{position:"relative"},children:[U&&m.jsx(S.WelcomeScreenToolbarHintTunnel.Out,{}),m.jsx(la.Col,{gap:4,align:"start",children:m.jsxs(la.Row,{gap:1,className:Fe("App-toolbar-container",{"zen-mode":t.zenModeEnabled}),children:[m.jsxs(ts,{padding:1,className:Fe("App-toolbar",{"zen-mode":t.zenModeEnabled}),children:[m.jsx(NP,{appState:t,isMobile:C.editor.isMobile,device:C,app:v}),Me,m.jsxs(la.Row,{gap:1,children:[m.jsx(FP,{zenModeEnabled:t.zenModeEnabled,checked:t.penMode,onChange:()=>c(null),title:D("toolBar.penMode"),penDetected:t.penDetected}),m.jsx(OP,{checked:t.activeTool.locked,onChange:s,title:D("toolBar.lock")}),m.jsx("div",{className:"App-toolbar__divider"}),m.jsx($P,{checked:ch(t),onChange:()=>o(),title:D("toolBar.hand"),isMobile:!0}),m.jsx(_P,{appState:t,activeTool:t.activeTool,UIOptions:f,app:v})]})]}),x&&m.jsx(ts,{style:{marginLeft:8,alignSelf:"center",height:"fit-content"},children:m.jsx(Cfe,{title:D("toolBar.laser"),checked:t.activeTool.type===Qn.laser,onChange:()=>v.setActiveTool({type:Qn.laser}),isMobile:!0})})]})})]})}),m.jsxs("div",{className:Fe("layer-ui__wrapper__top-right zen-mode-transition",{"transition-right":t.zenModeEnabled}),children:[t.collaborators.size>0&&m.jsx(BP,{collaborators:t.collaborators,userToFollow:((de=t.userToFollow)==null?void 0:de.socketId)||null}),l==null?void 0:l(C.editor.isMobile,t),!t.viewModeEnabled&&((xe=t.openDialog)==null?void 0:xe.name)!=="elementLinkSelector"&&(!q||((ve=t.openSidebar)==null?void 0:ve.name)!==Qa.name)&&m.jsx(S.DefaultSidebarTriggerTunnel.Out,{}),K&&m.jsx(d6,{app:v,onClose:()=>{e.executeAction(v8)},renderCustomStats:h})]})]})})},$=()=>m.jsx(_8,{__fallback:!0,onDock:Y=>{Jt("sidebar",`toggleDock (${Y?"dock":"undock"})`,`(${C.editor.isMobile?"mobile":"desktop"})`)}}),q=Mj(Z7),W=m.jsxs(m.Fragment,{children:[y,m.jsx(ype,{UIOptions:f}),m.jsx(_8.Trigger,{__fallback:!0,icon:wv,title:Ap(D("toolBar.library")),onToggle:Y=>{Y&&Jt("sidebar",`${Qa.name} (open)`,`button (${C.editor.isMobile?"mobile":"desktop"})`)},tab:Qa.defaultTab,children:D("toolBar.library")}),m.jsx(vpe,{}),((V=t.openDialog)==null?void 0:V.name)==="ttd"&&m.jsx(EN,{__fallback:!0}),t.isLoading&&m.jsx(Lj,{delay:250}),t.errorMessage&&m.jsx(khe,{onClose:()=>r({errorMessage:null}),children:t.errorMessage}),M&&!C.editor.isMobile&&m.jsx(rde,{colorPickerType:M.colorPickerType,onCancel:()=>{T(null)},onChange:(Y,K,G,{altKey:ee})=>{var de;if(!(Y!=="elementBackground"&&Y!=="elementStroke"))if(G.length){for(let xe of G)me(xe,{[ee&&M.swapPreviewOnAlt?Y==="elementBackground"?"strokeColor":"backgroundColor":Y==="elementBackground"?"backgroundColor":"strokeColor"]:K},!1),yn.delete(xe);(de=el.getScene(G[0]))==null||de.triggerUpdate()}else r(Y==="elementBackground"?{currentItemBackgroundColor:K}:{currentItemStrokeColor:K})},onSelect:(Y,K)=>{var G;T(ee=>ee!=null&&ee.keepOpenOnAlt&&K.altKey?ee:null),(G=M==null?void 0:M.onSelect)==null||G.call(M,Y,K)}}),((B=t.openDialog)==null?void 0:B.name)==="help"&&m.jsx(Qhe,{onClose:()=>{r({openDialog:null})}}),m.jsx(fhe,{}),((z=t.openDialog)==null?void 0:z.name)==="elementLinkSelector"&&m.jsx(bpe,{sourceElementId:t.openDialog.sourceElementId,onClose:()=>{r({openDialog:null})},elementsMap:v.scene.getNonDeletedElementsMap(),appState:t,generateLinkForSelection:w}),m.jsx(S.OverwriteConfirmDialogTunnel.Out,{}),j(),R(),t.pasteDialog.shown&&m.jsx(Vhe,{setAppState:r,appState:t,onClose:()=>r({pasteDialog:{shown:!1,data:null}})}),C.editor.isMobile&&m.jsx(Xhe,{app:v,appState:t,elements:i,actionManager:e,renderJSONExportDialog:R,renderImageExportDialog:j,setAppState:r,onLockToggle:s,onHandToolToggle:o,onPenModeToggle:c,renderTopRightUI:l,renderCustomStats:h,renderSidebars:$,device:C,renderWelcomeScreen:U,UIOptions:f}),!C.editor.isMobile&&m.jsxs(m.Fragment,{children:[m.jsxs("div",{className:"layer-ui__wrapper",style:t.openSidebar&&q&&C.editor.canFitSidebar?{width:"calc(100% - var(--right-sidebar-width))"}:{},children:[U&&m.jsx(S.WelcomeScreenCenterTunnel.Out,{}),F(),m.jsx(sfe,{appState:t,actionManager:e,showExitZenModeBtn:d,renderWelcomeScreen:U}),t.scrolledOutside&&m.jsx("button",{type:"button",className:"scroll-back-to-content",onClick:()=>{r(Y=>({...p1(i,Y)}))},children:D("buttons.scrollBackToContent")})]}),$()]})]});return m.jsx(zj.Provider,{value:t,children:m.jsx(k,{children:m.jsx(wP.Provider,{value:S,children:W})})})},xk=e=>{let{suggestedBindings:t,startBoundElement:n,cursorButton:r,scrollX:i,scrollY:a,...s}=e;return s},wpe=(e,t)=>{if(e.children!==t.children)return!1;let{canvas:n,appState:r,...i}=e,{canvas:a,appState:s,...o}=t;return yr(xk(r),xk(s),{selectedElementIds:yr,selectedGroupIds:yr})&&yr(i,o)},Epe=ke.memo(xpe,wpe),Cpe=5e3,Spe=({message:e,onClose:t,closable:n=!1,duration:r=Cpe,style:i})=>{let a=I.useRef(0),s=r!==1/0,o=I.useCallback(()=>{s&&(a.current=window.setTimeout(()=>t(),r))},[t,r,s]);return I.useEffect(()=>{if(s)return o(),()=>clearTimeout(a.current)},[o,e,r,s]),m.jsxs("div",{className:"Toast",onMouseEnter:s?()=>clearTimeout(a==null?void 0:a.current):void 0,onMouseLeave:s?o:void 0,style:i,children:[m.jsx("p",{className:"Toast__message",children:e}),n&&m.jsx(Ct,{icon:Bh,"aria-label":"close",type:"icon",onClick:t,className:"close"})]})},wk=Te({name:"viewMode",label:"labels.viewMode",paletteName:"Toggle view mode",icon:kv,viewMode:!0,trackEvent:{category:"canvas",predicate:e=>!e.viewModeEnabled},perform(e,t){return{appState:{...t,viewModeEnabled:!this.checked(t)},captureUpdate:le.EVENTUALLY}},checked:e=>e.viewModeEnabled,predicate:(e,t,n)=>typeof n.viewModeEnabled>"u",keyTest:e=>!e[Z.CTRL_OR_CMD]&&e.altKey&&e.code===kt.R}),CN=(e,t)=>{let n=t.scene.getSelectedElements(e);return n.length===1&&tt(n[0])},_pe=Te({name:"selectAllElementsInFrame",label:"labels.selectAllElementsInFrame",trackEvent:{category:"canvas"},perform:(e,t,n,r)=>{let i=r.scene.getSelectedElements(t).at(0)||null;if(tt(i)){let a=Ks(Vt(e),i.id).filter(s=>!(s.type==="text"&&s.containerId));return{elements:e,appState:{...t,selectedElementIds:a.reduce((s,o)=>(s[o.id]=!0,s),{})},captureUpdate:le.IMMEDIATELY}}return{elements:e,appState:t,captureUpdate:le.EVENTUALLY}},predicate:(e,t,n,r)=>CN(t,r)}),kpe=Te({name:"removeAllElementsFromFrame",label:"labels.removeAllElementsFromFrame",trackEvent:{category:"history"},perform:(e,t,n,r)=>{let i=r.scene.getSelectedElements(t).at(0)||null;return tt(i)?{elements:XL(e,i),appState:{...t,selectedElementIds:{[i.id]:!0}},captureUpdate:le.IMMEDIATELY}:{elements:e,appState:t,captureUpdate:le.EVENTUALLY}},predicate:(e,t,n,r)=>CN(t,r)});Te({name:"updateFrameRendering",label:"labels.updateFrameRendering",viewMode:!0,trackEvent:{category:"canvas"},perform:(e,t)=>({elements:e,appState:{...t,frameRendering:{...t.frameRendering,enabled:!t.frameRendering.enabled}},captureUpdate:le.EVENTUALLY}),checked:e=>e.frameRendering.enabled});Te({name:"setFrameAsActiveTool",label:"toolBar.frame",trackEvent:{category:"toolbar"},icon:eA,viewMode:!1,perform:(e,t,n,r)=>{let i=Pn(t,{type:"frame"});return Ts(r.interactiveCanvas,{...t,activeTool:i}),{elements:e,appState:{...t,activeTool:Pn(t,{type:"frame"})},captureUpdate:le.EVENTUALLY}},keyTest:e=>!e[Z.CTRL_OR_CMD]&&!e.shiftKey&&!e.altKey&&e.key.toLocaleLowerCase()===Z.F});var Tpe=Te({name:"wrapSelectionInFrame",label:"labels.wrapSelectionInFrame",trackEvent:{category:"element"},predicate:(e,t,n,r)=>{let i=gt(e,t);return i.length>0&&!i.some(a=>tt(a))},perform:(e,t,n,r)=>{let i=gt(e,t),[a,s,o,c]=Dt(i,r.scene.getNonDeletedElementsMap()),d=16,l=Fv({x:a-d,y:s-d,width:o-a+d*2,height:c-s+d*2});if(t.editingGroupId){let h=rn(i,t.editingGroupId);for(let f of h){let g=f.groupIds.indexOf(t.editingGroupId);me(f,{groupIds:f.groupIds.slice(0,g)},!1)}}return{elements:Dp([...r.scene.getElementsIncludingDeleted(),l],i,l,t),appState:{selectedElementIds:{[l.id]:!0}},captureUpdate:le.IMMEDIATELY}}}),Mpe=()=>m.jsxs("div",{"data-testid":"brave-measure-text-error",children:[m.jsx("p",{children:m.jsx($s,{i18nKey:"errors.brave_measure_text_error.line1",bold:e=>m.jsx("span",{style:{fontWeight:600},children:e})})}),m.jsx("p",{children:m.jsx($s,{i18nKey:"errors.brave_measure_text_error.line2",bold:e=>m.jsx("span",{style:{fontWeight:600},children:e})})}),m.jsx("p",{children:m.jsx($s,{i18nKey:"errors.brave_measure_text_error.line3",link:e=>m.jsx("a",{href:"http://docs.excalidraw.com/docs/@excalidraw/excalidraw/faq#turning-off-aggresive-block-fingerprinting-in-brave-browser",children:e})})}),m.jsx("p",{children:m.jsx($s,{i18nKey:"errors.brave_measure_text_error.line4",issueLink:e=>m.jsx("a",{href:"https://github.com/excalidraw/excalidraw/issues/new",children:e}),discordLink:e=>m.jsxs("a",{href:"https://discord.gg/UexuTaE",children:[e,"."]})})})]}),Ipe=Mpe,Gm={width:100,height:0},nc=100,Ape=(e,t,n)=>{let r=Oi({x:0,y:0,textAlign:o1.CENTER,verticalAlign:ji.MIDDLE,...t,containerId:e.id,strokeColor:t.strokeColor||e.strokeColor});return Object.assign(e,{boundElements:(e.boundElements||[]).concat({type:"text",id:r.id})}),Yr(r,e,n),[e,r]},Ek=(e,t,n,r,i)=>{let a,s;if(Object.assign(e,{startBinding:(e==null?void 0:e.startBinding)||null,endBinding:e.endBinding||null}),t){let l=(t==null?void 0:t.width)??nc,h=(t==null?void 0:t.height)??nc,f;t.id&&(f=r.getElement(t.id),f||console.error(`No element for start binding with id ${t.id} found`));let g=t.x||e.x-l,U=t.y||e.y-h/2,y=f?f.type:t.type;if(y){if(y==="text"){let v="";f&&f.type==="text"?v=f.text:t.type==="text"&&(v=t.text),v||console.error(`No text found for start binding text element for ${e.id}`),a=Oi({x:g,y:U,type:"text",...f,...t,text:v}),Object.assign(a,{x:t.x||e.x-a.width,y:t.y||e.y-a.height/2})}else switch(y){case"rectangle":case"ellipse":case"diamond":{a=qs({x:g,y:U,width:l,height:h,...f,...t,type:y});break}default:Cd(e,`Unhandled element start type "${t.type}"`,!0)}Ys(e,a,"start",i)}}if(n){let l=(n==null?void 0:n.height)??nc,h=(n==null?void 0:n.width)??nc,f;n.id&&(f=r.getElement(n.id),f||console.error(`No element for end binding with id ${n.id} found`));let g=n.x||e.x+e.width,U=n.y||e.y-l/2,y=f?f.type:n.type;if(y){if(y==="text"){let v="";f&&f.type==="text"?v=f.text:n.type==="text"&&(v=n.text),v||console.error(`No text found for end binding text element for ${e.id}`),s=Oi({x:g,y:U,type:"text",...f,...n,text:v}),Object.assign(s,{y:n.y||e.y-s.height/2})}else switch(y){case"rectangle":case"ellipse":case"diamond":{s=qs({x:g,y:U,width:h,height:l,...f,...n,type:y});break}default:Cd(e,`Unhandled element end type "${y}"`,!0)}Ys(e,s,"end",i)}}if(e.points.length<2)return{linearElement:e,startBoundElement:a,endBoundElement:s};let o=e.points.length-1,c=.5,d=Ho(e.points);return e.points[o][0]>e.points[o-1][0]&&(d[0][0]=c,d[o][0]-=c),e.points[o][0]<e.points[o-1][0]&&(d[0][0]=-c,d[o][0]+=c),e.points[o][1]>e.points[o-1][1]&&(d[0][1]=c,d[o][1]-=c),e.points[o][1]<e.points[o-1][1]&&(d[0][1]=-c,d[o][1]+=c),Object.assign(e,{points:d}),{linearElement:e,startBoundElement:a,endBoundElement:s}},Lpe=class{constructor(){H(this,"excalidrawElements",new Map),H(this,"add",e=>{e&&this.excalidrawElements.set(e.id,e)}),H(this,"getElements",()=>Jo(Array.from(this.excalidrawElements.values()))),H(this,"getElementsMap",()=>fa(nt(this.getElements()))),H(this,"getElement",e=>this.excalidrawElements.get(e))}},Sh=(e,t)=>{var o,c,d;if(!e)return[];let n=Ho(e),r=new Lpe,i=new Map,a=new Map;for(let l of n){let h,f=l.id;switch((t==null?void 0:t.regenerateIds)!==!1&&Object.assign(l,{id:ga()}),l.type){case"rectangle":case"ellipse":case"diamond":{let g=(o=l==null?void 0:l.label)!=null&&o.text&&l.width===void 0?0:(l==null?void 0:l.width)||nc,U=(c=l==null?void 0:l.label)!=null&&c.text&&l.height===void 0?0:(l==null?void 0:l.height)||nc;h=qs({...l,width:g,height:U});break}case"line":{let g=l.width||Gm.width,U=l.height||Gm.height;h=fd({width:g,height:U,points:[A(0,0),A(g,U)],...l});break}case"arrow":{let g=l.width||Gm.width,U=l.height||Gm.height;h=$v({width:g,height:U,endArrowhead:"arrow",points:[A(0,0),A(g,U)],...l,type:"arrow"}),Object.assign(h,gh(h.points));break}case"text":{let g=(l==null?void 0:l.fontFamily)||xc,U=(l==null?void 0:l.fontSize)||ol,y=(l==null?void 0:l.lineHeight)||Td(g),v=l.text??"",x=fh(v),w=jr(x,Bt({fontFamily:g,fontSize:U}),y);h=Oi({width:w.width,height:w.height,fontFamily:g,fontSize:U,...l});break}case"image":{h=dL({width:(l==null?void 0:l.width)||nc,height:(l==null?void 0:l.height)||nc,...l});break}case"frame":{h=Fv({x:0,y:0,...l});break}case"magicframe":{h=$3({x:0,y:0,...l});break}case"freedraw":case"iframe":case"embeddable":{h=l;break}default:h=l,Cd(l,`Unhandled element type "${l.type}"`,!0)}r.getElement(h.id)?console.error(`Duplicate id found for ${h.id}`):(r.add(h),i.set(h.id,l),f&&a.set(f,h.id))}let s=r.getElementsMap();for(let[l,h]of i){let f=r.getElement(l);switch(h.type){case"rectangle":case"ellipse":case"diamond":case"arrow":{if((d=h.label)!=null&&d.text){let[g,U]=Ape(f,h==null?void 0:h.label,s);if(r.add(g),r.add(U),Ut(g)){let y=h.type==="arrow"?h==null?void 0:h.start:void 0,v=h.type==="arrow"?h==null?void 0:h.end:void 0;if(y&&y.id){let S=a.get(y.id);S&&Object.assign(y,{id:S})}if(v&&v.id){let S=a.get(v.id);S&&Object.assign(v,{id:S})}let{linearElement:x,startBoundElement:w,endBoundElement:C}=Ek(g,y,v,r,s);g=x,r.add(x),r.add(w),r.add(C)}}else switch(h.type){case"arrow":{let{start:g,end:U}=h;if(g&&g.id){let w=a.get(g.id);Object.assign(g,{id:w})}if(U&&U.id){let w=a.get(U.id);Object.assign(U,{id:w})}let{linearElement:y,startBoundElement:v,endBoundElement:x}=Ek(f,g,U,r,s);r.add(y),r.add(v),r.add(x);break}}break}}}for(let[l,h]of i){if(h.type!=="frame"&&h.type!=="magicframe")continue;let f=r.getElement(l);if(!f)throw new Error(`Excalidraw element with id ${l} doesn't exist`);let g=[];h.children.forEach(T=>{var P;let R=a.get(T);if(!R)throw new Error(`Element with ${T} wasn't mapped correctly`);let j=r.getElement(R);if(!j)throw new Error(`Frame element with id ${R} doesn't exist`);Object.assign(j,{frameId:f.id}),(P=j==null?void 0:j.boundElements)==null||P.forEach(N=>{let F=r.getElement(N.id);if(!F)throw new Error(`Bound element with id ${N.id} doesn't exist`);Object.assign(F,{frameId:f.id}),g.push(F)}),g.push(j)});let[U,y,v,x]=Dt(g),w=10;U=U-w,y=y-w,v=v+w,x=x+w;let C=(f==null?void 0:f.x)||U,S=(f==null?void 0:f.y)||y,k=(f==null?void 0:f.width)||v-U,M=(f==null?void 0:f.height)||x-y;Object.assign(f,{x:C,y:S,width:k,height:M}),LI()&&h.children.length&&(f!=null&&f.x||f!=null&&f.y||f!=null&&f.width||f!=null&&f.height)&&console.info("User provided frame attributes are being considered, if you find this inaccurate, please remove any of the attributes - x, y, width and height so frame coordinates and dimensions are calculated automatically")}return r.getElements()},wn=e=>t=>{Jn.unstable_batchedUpdates(e,t)},jy=e=>xU(t=>{Jn.unstable_batchedUpdates(e,t)}),ex=(()=>{let e;try{let n=I.version.split(".");e=Number(n[0])>17}catch{e=!1}let t=!1;return()=>window.EXCALIDRAW_THROTTLE_RENDER===!0?e?!0:(t||(t=!0,console.warn("Excalidraw: render throttling is disabled on React versions < 18.")),!1):!1})(),Rpe="#ff6b6b",Dpe="#ff0000",Ck=1,Sk=2,jpe=(e,t)=>{if(!t.snapLines.length)return;let n=t.theme===wt.LIGHT||t.zenModeEnabled?Rpe:Dpe,r=(t.zenModeEnabled?Ck*1.5:Ck)/t.zoom.value;e.save(),e.translate(t.scrollX,t.scrollY);for(let i of t.snapLines)i.type==="pointer"?(e.lineWidth=r,e.strokeStyle=n,Npe(i,e,t)):i.type==="gap"?(e.lineWidth=r,e.strokeStyle=n,Ope(i.points[0],i.points[1],i.direction,t,e)):i.type==="points"&&(e.lineWidth=r,e.strokeStyle=n,Ppe(i,e,t));e.restore()},Ppe=(e,t,n)=>{if(!n.zenModeEnabled){let r=e.points[0],i=e.points[e.points.length-1];ta(r,i,t)}for(let r of e.points)SN(r,n,t)},Npe=(e,t,n)=>{SN(e.points[0],n,t),n.zenModeEnabled||ta(e.points[0],e.points[1],t)},SN=([e,t],n,r)=>{r.save();let i=(n.zenModeEnabled?Sk*1.5:Sk)/n.zoom.value;r.beginPath(),r.moveTo(e-i,t-i),r.lineTo(e+i,t+i),r.moveTo(e+i,t-i),r.lineTo(e-i,t+i),r.stroke(),r.restore()},ta=(e,t,n)=>{n.beginPath(),n.lineTo(e[0],e[1]),n.lineTo(t[0],t[1]),n.stroke()},Ope=(e,t,n,r,i)=>{let a=8/r.zoom.value,s=a/2,o=a/4;if(n==="horizontal"){let c=[(e[0]+t[0])/2,e[1]];r.zenModeEnabled||ta(A(e[0],e[1]-a),A(e[0],e[1]+a),i),ta(A(c[0]-o,c[1]-s),A(c[0]-o,c[1]+s),i),ta(A(c[0]+o,c[1]-s),A(c[0]+o,c[1]+s),i),r.zenModeEnabled||(ta(A(t[0],t[1]-a),A(t[0],t[1]+a),i),ta(e,t,i))}else{let c=[e[0],(e[1]+t[1])/2];r.zenModeEnabled||ta(A(e[0]-a,e[1]),A(e[0]+a,e[1]),i),ta(A(c[0]-s,c[1]-o),A(c[0]+s,c[1]-o),i),ta(A(c[0]-s,c[1]+o),A(c[0]+s,c[1]+o),i),r.zenModeEnabled||(ta(A(t[0]-a,t[1]),A(t[0]+a,t[1]),i),ta(e,t,i))}},Fpe=(e,t)=>{Dr(t.selectedLinearElement,"selectedLinearElement is null");let{segmentMidPointHoveredCoords:n}=t.selectedLinearElement;Dr(n,"midPointCoords is null"),e.save(),e.translate(t.scrollX,t.scrollY),_N(n,e,t),e.restore()},$pe=(e,t,n)=>{var o,c;let{elementId:r,hoverPointIndex:i}=t.selectedLinearElement;if((c=(o=t.editingLinearElement)==null?void 0:o.selectedPointsIndices)!=null&&c.includes(i))return;let a=Re.getElement(r,n);if(!a)return;let s=Re.getPointAtIndexGlobalCoordinates(a,i,n);e.save(),e.translate(t.scrollX,t.scrollY),_N(s,e,t),e.restore()},_N=(e,t,n)=>{t.fillStyle="rgba(105, 101, 219, 0.4)",FU(t,e[0],e[1],Re.POINT_HANDLE_SIZE/n.zoom.value,!1)},i0=(e,t,n,r,i,a,s,o,c=!1,d=0)=>{e.save(),e.translate(a,s),e.rotate(o),c&&e.fillRect(t-a,n-s,r,i),d&&e.roundRect?(e.beginPath(),e.roundRect(t-a,n-s,r,i,d),e.stroke(),e.closePath()):e.strokeRect(t-a,n-s,r,i),e.restore()},Bpe=(e,t,n,r,i,a)=>{e.save(),e.translate(r,i),e.rotate(a),e.beginPath(),e.moveTo(0,n/2),e.lineTo(t/2,0),e.lineTo(0,-n/2),e.lineTo(-t/2,0),e.closePath(),e.stroke(),e.restore()},Py=(e,t,n,r,i,a=!1)=>{e.strokeStyle="#5e5ad8",e.setLineDash([]),e.fillStyle="rgba(255, 255, 255, 0.9)",i?e.fillStyle="rgba(134, 131, 226, 0.9)":a&&(e.fillStyle="rgba(177, 151, 252, 0.7)"),FU(e,n[0],n[1],r/t.zoom.value,!a)},zpe=(e,t,n,r,i,a)=>{e.beginPath(),e.ellipse(r,i,t/2,n/2,a,0,Math.PI*2),e.stroke()},Hpe=(e,t,n,r)=>{let[i,a,s,o]=lt(t,n),c=s-i,d=o-a;e.strokeStyle="rgba(0,0,0,.05)";let l=r.value<1?r.value:1;e.lineWidth=Pv/l;let h=e.lineWidth/2+Nv,f=Ja(Math.min(t.width,t.height),t);switch(t.type){case"rectangle":case"text":case"image":case"iframe":case"embeddable":case"frame":case"magicframe":i0(e,i-h,a-h,c+h*2,d+h*2,i+c/2,a+d/2,t.angle,void 0,f);break;case"diamond":let g=Math.hypot(c,d),U=h*g/d,y=h*g/c;Bpe(e,c+U*2,d+y*2,i+c/2,a+d/2,t.angle);break;case"ellipse":zpe(e,c+h*2,d+h*2,i+c/2,a+d/2,t.angle);break}},Wpe=(e,t,n,r)=>{let[i,a,s]=t,o=Y1(s,s.width,s.height,r);e.strokeStyle="rgba(0,0,0,0)",e.fillStyle="rgba(0,0,0,.05)",(a==="both"?[0,-1]:a==="start"?[0]:[-1]).forEach(c=>{let[d,l]=Re.getPointAtIndexGlobalCoordinates(i,c,n);FU(e,d,l,o)})},kN=(e,t,n)=>{let{angle:r,x1:i,y1:a,x2:s,y2:o,selectionColors:c,cx:d,cy:l,dashed:h,activeEmbeddable:f}=n,g=s-i,U=o-a,y=(n.padding??wd*2)/t.zoom.value,v=8/t.zoom.value,x=4/t.zoom.value;e.save(),e.translate(t.scrollX,t.scrollY),e.lineWidth=(f?4:1)/t.zoom.value;let w=c.length;for(let C=0;C<w;++C)e.strokeStyle=c[C],h&&e.setLineDash([v,x+(v+x)*(w-1)]),e.lineDashOffset=(v+x)*C,i0(e,i-y,a-y,g+y*2,U+y*2,d,l,r);e.restore()},Xpe=(e,t,n,r)=>{let i=Array.isArray(n)?Wpe:Hpe;e.save(),e.translate(t.scrollX,t.scrollY),i(e,n,r,t.zoom),e.restore()},Vpe=(e,t,n,r)=>{let[i,a,s,o]=lt(n,r),c=s-i,d=o-a;e.strokeStyle="rgb(0,118,255)",e.lineWidth=Un.strokeWidth/t.zoom.value,e.save(),e.translate(t.scrollX,t.scrollY),i0(e,i,a,c,d,i+c/2,a+d/2,n.angle,!1,Un.radius/t.zoom.value),e.restore()},Ype=(e,t,n)=>{let r=n.filter(o=>o.groupIds.length===0),i=n.filter(o=>o.groupIds.length>0),a=o=>{let[c,d,l,h]=Dt(o);return{angle:0,x1:c,x2:l,y1:d,y2:h,selectionColors:["rgb(0,118,255)"],dashed:!1,cx:c+(l-c)/2,cy:d+(h-d)/2,activeEmbeddable:!1}},s=o=>{let c=rn(n,o);return a(c)};Object.entries(KA(i,t)).filter(([o,c])=>c).map(([o,c])=>o).map(o=>s(o)).concat(r.map(o=>a([o]))).forEach(o=>kN(e,t,o))},Ny=(e,t,n,r)=>{var o;if(!t.selectedLinearElement)return;e.save(),e.translate(t.scrollX,t.scrollY),e.lineWidth=1/t.zoom.value;let i=Re.getPointsGlobalCoordinates(n,r),{POINT_HANDLE_SIZE:a}=Re,s=t.editingLinearElement?a:a/2;if(i.forEach((c,d)=>{var h,f;if(Pe(n)&&d!==0&&d!==i.length-1)return;let l=!!((f=(h=t.editingLinearElement)==null?void 0:h.selectedPointsIndices)!=null&&f.includes(d));Py(e,t,c,s,l)}),Pe(n)){let c=((o=n.fixedSegments)==null?void 0:o.map(d=>d.index))||[];i.slice(0,-1).forEach((d,l)=>{Re.isSegmentTooShort(n,i[l+1],i[l],l,t.zoom)||Py(e,t,A((d[0]+i[l+1][0])/2,(d[1]+i[l+1][1])/2),a/2,!1,!c.includes(l+1))})}else Re.getEditorMidPoints(n,r,t).filter((c,d,l)=>c!==null&&!(Pe(n)&&(d===0||d===l.length-1))).forEach(c=>{(t.editingLinearElement||i.length===2)&&Py(e,t,c,a/2,!1,!0)});e.restore()},_k=(e,t,n,r,i)=>{Object.keys(r).forEach(a=>{let s=r[a];if(s!==void 0){let[o,c,d,l]=s;e.save(),e.lineWidth=1/n.zoom.value,t.selectionColor&&(e.strokeStyle=t.selectionColor),a==="rotation"?FU(e,o+d/2,c+l/2,d/2):e.roundRect?(e.beginPath(),e.roundRect(o,c,d,l,2/n.zoom.value),e.fill(),e.stroke()):i0(e,o,c,d,l,o+d/2,c+l/2,i,!0),e.restore()}})},Gpe=(e,t,n,r,i)=>{let[a,s,,,o,c]=lt(r,i),d=3,l=20,h=d/n.zoom.value,f=h/2,g=o-a+h,U=c-s+h,y=Math.min(l/n.zoom.value,g),v=Math.min(l/n.zoom.value,U);e.save(),e.fillStyle=t.selectionColor,e.strokeStyle=t.selectionColor,e.lineWidth=h,[[[-g,-U],[0,f],[y,f],[f,0],[f,v]],[[g-f,-U],[f,f],[-y+f,f],[0,0],[0,v]],[[-g,U],[0,-f],[y,-f],[f,0],[f,-v]],[[g-f,U],[f,-f],[-y+f,-f],[0,0],[0,-v]]].forEach(x=>{let[[w,C],[S,k],[M,T],[R,j],[P,N]]=x;e.save(),e.translate(o,c),e.rotate(r.angle),e.beginPath(),e.moveTo(w+S,C+k),e.lineTo(w+M,C+T),e.stroke(),e.beginPath(),e.moveTo(w+R,C+j),e.lineTo(w+P,C+N),e.stroke(),e.restore()}),e.restore()},qpe=(e,t,n,r)=>{t.save();let i=wd*2/n.zoom.value,a=e.width+i*2,s=e.height+i*2,o=e.x+a/2,c=e.y+s/2,d=-(a/2+i),l=-(s/2+i);t.translate(o+n.scrollX,c+n.scrollY),t.rotate(e.angle),t.lineWidth=1/n.zoom.value,t.strokeStyle=r,t.strokeRect(d,l,a,s),t.restore()},TN=({canvas:e,elementsMap:t,visibleElements:n,selectedElements:r,allElementsMap:i,scale:a,appState:s,renderConfig:o,device:c})=>{var y,v,x;if(e===null)return{atLeastOneVisibleElement:!1,elementsMap:t};let[d,l]=Xv(e,a),h=Vv({canvas:e,scale:a,normalizedWidth:d,normalizedHeight:l});h.save(),h.scale(s.zoom.value,s.zoom.value);let f;if(n.forEach(w=>{var C;((C=s.editingLinearElement)==null?void 0:C.elementId)===w.id&&w&&(f=w)}),f&&Ny(h,s,f,t),s.selectionElement&&!s.isCropping)try{ute(s.selectionElement,h,s,o.selectionColor)}catch(w){console.error(w)}if(s.editingTextElement&&Le(s.editingTextElement)){let w=i.get(s.editingTextElement.id);w&&!w.autoResize&&qpe(w,h,s,o.selectionColor)}s.isBindingEnabled&&s.suggestedBindings.filter(w=>w!=null).forEach(w=>{Xpe(h,s,w,t)}),s.frameToHighlight&&Vpe(h,s,s.frameToHighlight,t),s.elementsToHighlight&&Ype(h,s,s.elementsToHighlight);let g=r.some(w=>tt(w));if(r.length===1&&((y=s.editingLinearElement)==null?void 0:y.elementId)===r[0].id&&Ny(h,s,r[0],t),Pe(r[0])&&s.selectedLinearElement&&s.selectedLinearElement.segmentMidPointHoveredCoords?Fpe(h,s):s.selectedLinearElement&&s.selectedLinearElement.hoverPointIndex>=0&&!(Pe(r[0])&&s.selectedLinearElement.hoverPointIndex>0&&s.selectedLinearElement.hoverPointIndex<r[0].points.length-1)&&$pe(h,s,t),!s.multiElement&&!s.editingLinearElement){let w=eR(r,s),C=r.length===1&&st(r[0]);C&&((v=s.selectedLinearElement)==null?void 0:v.elementId)===r[0].id&&!r[0].locked&&Ny(h,s,r[0],t);let S=o.selectionColor||dr.black;if(w){let k=nt(r),M=[];for(let R of t.values()){let j=[],P=o.remoteSelectedElementIds.get(R.id);if(C&&Pe(R)&&(R.startBinding||R.endBinding)||(k.has(R.id)&&!qA(s,R)&&j.push(S),P&&j.push(...P.map(N=>l6(N,s.collaborators.get(N))))),j.length){let[N,F,$,q,W,V]=lt(R,t,!0);M.push({angle:R.angle,x1:N,y1:F,x2:$,y2:q,selectionColors:j,dashed:!!P,cx:W,cy:V,activeEmbeddable:((x=s.activeEmbeddable)==null?void 0:x.element)===R&&s.activeEmbeddable.state==="active",padding:R.id===s.croppingElementId||Lt(R)?0:void 0})}}let T=R=>{let j=rn(t,R),[P,N,F,$]=Dt(j);M.push({angle:0,x1:P,x2:F,y1:N,y2:$,selectionColors:[dr.black],dashed:!0,cx:P+(F-P)/2,cy:N+($-N)/2,activeEmbeddable:!1})};for(let R of hd(s))T(R);s.editingGroupId&&T(s.editingGroupId),M.forEach(R=>kN(h,s,R))}if(h.save(),h.translate(s.scrollX,s.scrollY),r.length===1){h.fillStyle=dr.white;let k=JL(r[0],s.zoom,t,"mouse",jp(c));if(!s.viewModeEnabled&&w&&!Le(s.editingTextElement)&&!s.croppingElementId&&_k(h,o,s,k,r[0].angle),s.croppingElementId&&!s.isCropping){let M=t.get(s.croppingElementId);M&&Lt(M)&&Gpe(h,o,s,M,t)}}else if(r.length>1&&!s.isRotating){let k=wd*2/s.zoom.value;h.fillStyle=dr.white;let[M,T,R,j]=Dt(r),P=h.getLineDash();h.setLineDash([2/s.zoom.value]);let N=h.lineWidth;h.lineWidth=1/s.zoom.value,h.strokeStyle=S,i0(h,M-k,T-k,R-M+k*2,j-T+k*2,(M+R)/2,(T+j)/2,0),h.lineWidth=N,h.setLineDash(P);let F=h7([M,T,R,j,(M+R)/2,(T+j)/2],0,s.zoom,"mouse",g?{...jp(c),rotation:!0}:jp(c));r.some($=>!$.locked)&&_k(h,o,s,F,0)}h.restore()}s.searchMatches.forEach(({id:w,focus:C,matchedLines:S})=>{let k=t.get(w);if(k&&Le(k)){let[M,T,,,R,j]=lt(k,t,!0);h.save(),s.theme===wt.LIGHT?C?h.fillStyle="rgba(255, 124, 0, 0.4)":h.fillStyle="rgba(255, 226, 0, 0.4)":C?h.fillStyle="rgba(229, 82, 0, 0.4)":h.fillStyle="rgba(99, 52, 0, 0.4)",h.translate(s.scrollX,s.scrollY),h.translate(R,j),h.rotate(k.angle),S.forEach(P=>{h.fillRect(M+P.offsetX-R,T+P.offsetY-j,P.width,P.height)}),h.restore()}}),jpe(h,s),h.restore(),Nde({context:h,renderConfig:o,appState:s,normalizedWidth:d,normalizedHeight:l});let U;return o.renderScrollbars&&(U=Hhe(n,d,l,s),h.save(),h.fillStyle=zhe,h.strokeStyle="rgba(255,255,255,0.8)",[U.horizontal,U.vertical].forEach(w=>{w&&aP(h,w.x,w.y,w.width,w.height,tc/2)}),h.restore()),{scrollBars:U,atLeastOneVisibleElement:n.length>0,elementsMap:t}},MN=xU(e=>{var n;let t=TN(e);(n=e.callback)==null||n.call(e,t)},{trailing:!0}),Zpe=(e,t)=>{if(t){MN(e);return}let n=TN(e);return e.callback(n),n},Kpe=e=>{let t=I.useRef(!1);return I.useEffect(()=>{var c;if(!t.current){t.current=!0;return}let n=new Map,r=new Map,i=new Map,a=new Map,s=new Map;e.appState.collaborators.forEach((d,l)=>{if(d.selectedElementIds)for(let h of Object.keys(d.selectedElementIds))i.has(h)||i.set(h,[]),i.get(h).push(l);!d.pointer||d.pointer.renderCursor===!1||(d.username&&a.set(l,d.username),d.userState&&s.set(l,d.userState),r.set(l,oa({sceneX:d.pointer.x,sceneY:d.pointer.y},e.appState)),n.set(l,d.button))});let o=((c=e.containerRef)==null?void 0:c.current)&&getComputedStyle(e.containerRef.current).getPropertyValue("--color-selection")||"#6965db";Zpe({canvas:e.canvas,elementsMap:e.elementsMap,visibleElements:e.visibleElements,selectedElements:e.selectedElements,allElementsMap:e.allElementsMap,scale:window.devicePixelRatio,appState:e.appState,renderConfig:{remotePointerViewportCoords:r,remotePointerButton:n,remoteSelectedElementIds:i,remotePointerUsernames:a,remotePointerUserStates:s,selectionColor:o,renderScrollbars:!1},device:e.device,callback:e.renderInteractiveSceneCallback},ex())}),m.jsx("canvas",{className:"excalidraw__canvas interactive",style:{width:e.appState.width,height:e.appState.height,cursor:e.appState.viewModeEnabled?Ot.GRAB:Ot.AUTO},width:e.appState.width*e.scale,height:e.appState.height*e.scale,ref:e.handleCanvasRef,onContextMenu:e.onContextMenu,onPointerMove:e.onPointerMove,onPointerUp:e.onPointerUp,onPointerCancel:e.onPointerCancel,onTouchMove:e.onTouchMove,onPointerDown:e.onPointerDown,onDoubleClick:e.appState.viewModeEnabled?void 0:e.onDoubleClick,children:D("labels.drawingCanvas")})},kk=e=>({zoom:e.zoom,scrollX:e.scrollX,scrollY:e.scrollY,width:e.width,height:e.height,viewModeEnabled:e.viewModeEnabled,openDialog:e.openDialog,editingGroupId:e.editingGroupId,editingLinearElement:e.editingLinearElement,selectedElementIds:e.selectedElementIds,frameToHighlight:e.frameToHighlight,offsetLeft:e.offsetLeft,offsetTop:e.offsetTop,theme:e.theme,pendingImageElementId:e.pendingImageElementId,selectionElement:e.selectionElement,selectedGroupIds:e.selectedGroupIds,selectedLinearElement:e.selectedLinearElement,multiElement:e.multiElement,isBindingEnabled:e.isBindingEnabled,suggestedBindings:e.suggestedBindings,isRotating:e.isRotating,elementsToHighlight:e.elementsToHighlight,collaborators:e.collaborators,activeEmbeddable:e.activeEmbeddable,snapLines:e.snapLines,zenModeEnabled:e.zenModeEnabled,editingTextElement:e.editingTextElement,isCropping:e.isCropping,croppingElementId:e.croppingElementId,searchMatches:e.searchMatches}),Qpe=(e,t)=>e.selectionNonce!==t.selectionNonce||e.sceneNonce!==t.sceneNonce||e.scale!==t.scale||e.elementsMap!==t.elementsMap||e.visibleElements!==t.visibleElements||e.selectedElements!==t.selectedElements?!1:yr(kk(e.appState),kk(t.appState)),Jpe=ke.memo(Kpe,Qpe),e1e=e=>{let t=I.useRef(null),n=I.useRef(!1);return I.useEffect(()=>{let r=t.current;if(!r)return;let i=e.canvas;n.current||(n.current=!0,r.replaceChildren(i),i.classList.add("excalidraw__canvas","static"));let a=`${e.appState.width}px`,s=`${e.appState.height}px`;i.style.width!==a&&(i.style.width=a),i.style.height!==s&&(i.style.height=s);let o=e.appState.width*e.scale,c=e.appState.height*e.scale;i.width!==o&&(i.width=o),i.height!==c&&(i.height=c),ML({canvas:i,rc:e.rc,scale:e.scale,elementsMap:e.elementsMap,allElementsMap:e.allElementsMap,visibleElements:e.visibleElements,appState:e.appState,renderConfig:e.renderConfig},ex())}),m.jsx("div",{className:"excalidraw__canvas-wrapper",ref:t})},Tk=e=>({zoom:e.zoom,scrollX:e.scrollX,scrollY:e.scrollY,width:e.width,height:e.height,viewModeEnabled:e.viewModeEnabled,openDialog:e.openDialog,hoveredElementIds:e.hoveredElementIds,offsetLeft:e.offsetLeft,offsetTop:e.offsetTop,theme:e.theme,pendingImageElementId:e.pendingImageElementId,shouldCacheIgnoreZoom:e.shouldCacheIgnoreZoom,viewBackgroundColor:e.viewBackgroundColor,exportScale:e.exportScale,selectedElementsAreBeingDragged:e.selectedElementsAreBeingDragged,gridSize:e.gridSize,gridStep:e.gridStep,frameRendering:e.frameRendering,selectedElementIds:e.selectedElementIds,frameToHighlight:e.frameToHighlight,editingGroupId:e.editingGroupId,currentHoveredFontFamily:e.currentHoveredFontFamily,croppingElementId:e.croppingElementId}),t1e=(e,t)=>e.sceneNonce!==t.sceneNonce||e.scale!==t.scale||e.elementsMap!==t.elementsMap||e.visibleElements!==t.visibleElements?!1:yr(Tk(e.appState),Tk(t.appState))&&yr(e.renderConfig,t.renderConfig),n1e=ke.memo(e1e,t1e),Mk=class{constructor(e){H(this,"scene"),H(this,"getRenderableElements",(()=>{let t=({elementsMap:r,zoom:i,offsetLeft:a,offsetTop:s,scrollX:o,scrollY:c,height:d,width:l})=>{let h=[];for(let f of r.values())_2(f,l,d,{zoom:i,offsetLeft:a,offsetTop:s,scrollX:o,scrollY:c},r)&&h.push(f);return h},n=({elements:r,editingTextElement:i,newElementId:a,pendingImageElementId:s})=>{let o=fa(new Map);for(let c of r)Lt(c)&&s===c.id||a!==c.id&&(!i||i.type!=="text"||c.id!==i.id)&&o.set(c.id,c);return o};return HY(({zoom:r,offsetLeft:i,offsetTop:a,scrollX:s,scrollY:o,height:c,width:d,editingTextElement:l,newElementId:h,pendingImageElementId:f,sceneNonce:g})=>{let U=this.scene.getNonDeletedElements(),y=n({elements:U,editingTextElement:l,newElementId:h,pendingImageElementId:f}),v=t({elementsMap:y,zoom:r,offsetLeft:i,offsetTop:a,scrollX:s,scrollY:o,height:c,width:d});return{elementsMap:y,visibleElements:v}})})()),this.scene=e}destroy(){MN.cancel(),TL.cancel(),this.getRenderableElements.clear()}},r1e=({trails:e})=>{let t=I.useRef(null);return I.useEffect(()=>{if(t.current)for(let n of e)n.start(t.current);return()=>{for(let n of e)n.stop()}},e),m.jsx("div",{className:"SVGLayer",children:m.jsx("svg",{ref:t})})},i1e=5,a1e=(e,t,n)=>{let[r,i]=lt(e,n),{x:a,y:s}=oa({sceneX:r+e.width,sceneY:i},t),o=a-t.offsetLeft+10,c=s-t.offsetTop;return{x:o,y:c}},Ik=({children:e,element:t,elementsMap:n})=>{let r=s0();if(r.contextMenu||r.newElement||r.resizingElement||r.isRotating||r.openMenu||r.viewModeEnabled)return null;let{x:i,y:a}=a1e(t,r,n);return m.jsx("div",{className:"excalidraw-canvas-buttons",style:{top:`${a}px`,left:`${i}px`,padding:i1e},children:e})},s1e="small",Oy=e=>m.jsxs("label",{className:Fe("ToolIcon ToolIcon__MagicButton",`ToolIcon_size_${s1e}`,{"is-mobile":e.isMobile}),title:`${e.title}`,children:[m.jsx("input",{className:"ToolIcon_type_checkbox",type:"checkbox",name:e.name,onChange:e.onChange,checked:e.checked,"aria-label":e.title}),m.jsx("div",{className:"ToolIcon__icon",children:e.icon})]}),o1e=({height:e,width:t,userToFollow:n,onDisconnect:r})=>m.jsx("div",{className:"follow-mode",style:{width:t,height:e},children:m.jsxs("div",{className:"follow-mode__badge",children:[m.jsxs("div",{className:"follow-mode__badge__label",children:["Following"," ",m.jsx("span",{className:"follow-mode__badge__username",title:n.username,children:n.username})]}),m.jsx("button",{type:"button",onClick:r,className:"follow-mode__disconnect-btn",children:Bh})]})}),l1e=o1e,c1e=class{constructor(){H(this,"targets",new WeakMap),H(this,"rafIds",new WeakMap)}register(e,t){this.targets.set(e,{callback:t,stopped:!0})}start(e){let t=this.targets.get(e);t&&(this.rafIds.has(e)||(this.targets.set(e,{...t,stopped:!1}),this.scheduleFrame(e)))}stop(e){let t=this.targets.get(e);t&&!t.stopped&&this.targets.set(e,{...t,stopped:!0}),this.cancelFrame(e)}constructFrame(e){return t=>{let n=this.targets.get(e);if(!n)return;let r=this.onFrame(n,t);!n.stopped&&!r?this.scheduleFrame(e):this.cancelFrame(e)}}scheduleFrame(e){let t=requestAnimationFrame(this.constructFrame(e));this.rafIds.set(e,t)}cancelFrame(e){if(this.rafIds.has(e)){let t=this.rafIds.get(e);cancelAnimationFrame(t)}this.rafIds.delete(e)}onFrame(e,t){return e.callback(t)??!1}},I8=class{constructor(e,t,n){this.animationFrameHandler=e,this.app=t,this.options=n,H(this,"currentTrail"),H(this,"pastTrails",[]),H(this,"container"),H(this,"trailElement"),this.animationFrameHandler.register(this,this.onFrame.bind(this)),this.trailElement=document.createElementNS(Tt,"path")}get hasCurrentTrail(){return!!this.currentTrail}hasLastPoint(e,t){if(this.currentTrail){let n=this.currentTrail.originalPoints.length;return this.currentTrail.originalPoints[n-1][0]===e&&this.currentTrail.originalPoints[n-1][1]===t}return!1}start(e){e&&(this.container=e),this.trailElement.parentNode!==this.container&&this.container&&this.container.appendChild(this.trailElement),this.animationFrameHandler.start(this)}stop(){var e;this.animationFrameHandler.stop(this),this.trailElement.parentNode===this.container&&((e=this.container)==null||e.removeChild(this.trailElement))}startPath(e,t){this.currentTrail=new D2(this.options),this.currentTrail.addPoint([e,t,performance.now()]),this.update()}addPointToPath(e,t){this.currentTrail&&(this.currentTrail.addPoint([e,t,performance.now()]),this.update())}endPath(){this.currentTrail&&(this.currentTrail.close(),this.currentTrail.options.keepHead=!1,this.pastTrails.push(this.currentTrail),this.currentTrail=void 0,this.update())}update(){this.start()}onFrame(){let e=[];for(let n of this.pastTrails)e.push(this.drawTrail(n,this.app.state));if(this.currentTrail){let n=this.drawTrail(this.currentTrail,this.app.state);e.push(n)}this.pastTrails=this.pastTrails.filter(n=>n.getStrokeOutline().length!==0),e.length===0&&this.stop();let t=e.join(" ").trim();this.trailElement.setAttribute("d",t),this.trailElement.setAttribute("fill",(this.options.fill??(()=>"black"))(this))}drawTrail(e,t){let n=e.getStrokeOutline(e.options.size/t.zoom.value).map(([r,i])=>{let a=oa({sceneX:r,sceneY:i},t);return[a.x,a.y]});return WY(n,!0)}},d1e=class{constructor(e,t){this.animationFrameHandler=e,this.app=t,H(this,"localTrail"),H(this,"collabTrails",new Map),H(this,"container"),this.animationFrameHandler.register(this,this.onFrame.bind(this)),this.localTrail=new I8(e,t,{...this.getTrailOptions(),fill:()=>gI})}getTrailOptions(){return{simplify:0,streamline:.4,sizeMapping:e=>{let t=Math.max(0,1-(performance.now()-e.pressure)/1e3),n=(50-Math.min(50,e.totalLength-e.currentIndex))/50;return Math.min(dd(n),dd(t))}}}startPath(e,t){this.localTrail.startPath(e,t)}addPointToPath(e,t){this.localTrail.addPointToPath(e,t)}endPath(){this.localTrail.endPath()}start(e){this.container=e,this.animationFrameHandler.start(this),this.localTrail.start(e)}stop(){this.animationFrameHandler.stop(this),this.localTrail.stop()}onFrame(){this.updateCollabTrails()}updateCollabTrails(){if(!(!this.container||this.app.state.collaborators.size===0)){for(let[e,t]of this.app.state.collaborators.entries()){let n;this.collabTrails.has(e)?n=this.collabTrails.get(e):(n=new I8(this.animationFrameHandler,this.app,{...this.getTrailOptions(),fill:()=>{var r;return((r=t.pointer)==null?void 0:r.laserColor)||l6(e,t)}}),n.start(this.container),this.collabTrails.set(e,n)),t.pointer&&t.pointer.tool==="laser"&&(t.button==="down"&&!n.hasCurrentTrail&&n.startPath(t.pointer.x,t.pointer.y),t.button==="down"&&n.hasCurrentTrail&&!n.hasLastPoint(t.pointer.x,t.pointer.y)&&n.addPointToPath(t.pointer.x,t.pointer.y),t.button==="up"&&n.hasCurrentTrail&&(n.addPointToPath(t.pointer.x,t.pointer.y),n.endPath()))}for(let e of this.collabTrails.keys())this.app.state.collaborators.has(e)||(this.collabTrails.get(e).stop(),this.collabTrails.delete(e))}}},u1e=(e,t,n,r,i,a)=>{let{zoom:s}=r,o=180*n/Math.PI,c=e*(s.value-1)/2,d=t*(s.value-1)/2;return e>i&&s.value!==1&&(c=i*(s.value-1)/2),t>a&&s.value!==1&&(d=a*(s.value-1)/2),`translate(${c}px, ${d}px) scale(${s.value}) rotate(${o}deg)`},h1e=({id:e,onChange:t,onSubmit:n,getViewportCoords:r,element:i,canvas:a,excalidrawContainer:s,app:o,autoSelect:c=!0})=>{let d=(W,V)=>{if(!V.style.fontFamily||!V.style.fontSize)return!1;let B=V.style.fontFamily.replace(/"/g,"");return dh({fontFamily:W.fontFamily})!==B||`${W.fontSize}px`!==V.style.fontSize},l=()=>{var K;let W=o.state,V=(K=el.getScene(i))==null?void 0:K.getElement(e);if(!V)return;let{textAlign:B,verticalAlign:z}=V,Y=o.scene.getNonDeletedElementsMap();if(V&&Le(V)){let G=V.x,ee=V.y,de=ur(V,o.scene.getNonDeletedElementsMap()),xe=V.width,ve=V.height,Me=V.width,Ce=V.height;if(de&&V.containerId){if(Ut(de)){let hn=Re.getBoundTextElementPosition(de,V,Y);G=hn.x,ee=hn.y}let On=d(V,h),Fn;if(On?Fn=b2(de.id,de.height):(Fn=yh[de.id],Fn||(Fn=b2(de.id,de.height))),Me=Qo(de,V),Ce=OU(de,V),!Ut(de)&&ve>Ce){let hn=Id(ve,de.type);me(de,{height:hn});return}else if(!Ut(de)&&de.height>Fn.height&&ve<Ce){let hn=Id(ve,de.type);me(de,{height:hn})}else{let{y:hn}=NU(de,V,Y);ee=hn}}let[ge,$e]=r(G,ee),je=h.selectionStart,Je=h.selectionEnd,ut=h.value.length;if(je===Je&&Je!==ut){let On=ut-Je;h.selectionStart=h.value.length-On,h.selectionEnd=h.value.length-On}de?xe+=.5:(Me=(W.width-8-ge)/W.zoom.value,xe=Math.min(xe,Me)),ve*=1.05;let zt=Bt(V),Tn=(W.height-$e)/W.zoom.value;Object.assign(h.style,{font:zt,lineHeight:V.lineHeight,width:`${xe}px`,height:`${ve}px`,left:`${ge}px`,top:`${$e}px`,transform:u1e(xe,ve,wne(V,de),W,Me,Tn),textAlign:B,verticalAlign:z,color:V.strokeColor,opacity:V.opacity/100,filter:"var(--theme-filter)",maxHeight:`${Tn}px`}),h.scrollTop=0,Go()&&(h.style.fontFamily=dh(V)),me(V,{x:G,y:ee})}},h=document.createElement("textarea");h.dir="auto",h.tabIndex=0,h.dataset.type="wysiwyg",h.wrap="off",h.classList.add("excalidraw-wysiwyg");let f="pre",g="normal";(an(i)||!i.autoResize)&&(f="pre-wrap",g="break-word"),Object.assign(h.style,{position:"absolute",display:"inline-block",minHeight:"1em",backfaceVisibility:"hidden",margin:0,padding:0,border:0,outline:0,resize:"none",background:"transparent",overflow:"hidden",zIndex:"var(--zIndex-wysiwyg)",wordBreak:g,whiteSpace:f,overflowWrap:"break-word",boxSizing:"content-box"}),h.value=i.originalText,l(),t&&(h.onpaste=async W=>{let V=await FL(W,!0);if(!V.text)return;let B=fh(V.text);if(!B)return;let z=ur(i,o.scene.getNonDeletedElementsMap()),Y=Bt({fontSize:o.state.currentItemFontSize,fontFamily:o.state.currentItemFontFamily});if(z){let K=pt(z,o.scene.getNonDeletedElementsMap()),G=zd(`${h.value}${B}`,Y,Qo(z,K)),ee=vv(G,Y);h.style.width=`${ee}px`}},h.oninput=()=>{let W=fh(h.value);if(h.value!==W){let V=h.selectionStart;h.value=W,h.selectionStart=V,h.selectionEnd=V}t(h.value)}),h.onkeydown=W=>{if(!W.shiftKey&&A_.keyTest(W))W.preventDefault(),o.actionManager.executeAction(A_),l();else if(!W.shiftKey&&L_.keyTest(W))W.preventDefault(),o.actionManager.executeAction(L_),l();else if(!W.shiftKey&&R_.keyTest(W))W.preventDefault(),o.actionManager.executeAction(R_),l();else if(T_.keyTest(W))o.actionManager.executeAction(T_);else if(M_.keyTest(W))o.actionManager.executeAction(M_);else if(W.key===Z.ESCAPE)W.preventDefault(),k=!0,M();else if(W.key===Z.ENTER&&W[Z.CTRL_OR_CMD]){if(W.preventDefault(),W.isComposing||W.keyCode===229)return;k=!0,M()}else if(W.key===Z.TAB||W[Z.CTRL_OR_CMD]&&(W.code===kt.BRACKET_LEFT||W.code===kt.BRACKET_RIGHT)){if(W.preventDefault(),W.isComposing)return;W.shiftKey||W.code===kt.BRACKET_LEFT?w():x(),h.dispatchEvent(new Event("input"))}};let U=4,y=" ".repeat(U),v=new RegExp(`^ {1,${U}}`),x=()=>{let{selectionStart:W,selectionEnd:V}=h,B=C(),z=h.value;B.forEach(Y=>{let K=z.slice(0,Y),G=z.slice(Y);z=`${K}${y}${G}`}),h.value=z,h.selectionStart=W+U,h.selectionEnd=V+U*B.length},w=()=>{let{selectionStart:W,selectionEnd:V}=h,B=C(),z=[],Y=h.value;B.forEach(K=>{let G=Y.slice(K,K+U).match(v);if(G){let ee=Y.slice(0,K),de=Y.slice(K+G[0].length);Y=`${ee}${de}`,z.push(K)}}),h.value=Y,z.length&&(W>z[z.length-1]?h.selectionStart=Math.max(W-U,z[z.length-1]):h.selectionStart=W,h.selectionEnd=Math.max(h.selectionStart,V-U*z.length))},C=()=>{let{selectionStart:W,selectionEnd:V,value:B}=h,z=B.slice(0,W).match(/[^\n]*$/)[0].length;return W=W-z,B.slice(W,V).split(`
160
- `).reduce((Y,K,G,ee)=>Y.concat(G?Y[G-1]+ee[G-1].length+1:W),[]).reverse()},S=W=>{W.target instanceof HTMLCanvasElement&&(W.preventDefault(),W.stopPropagation())},k=!1,M=()=>{var B,z;if($)return;$=!0,T();let W=(B=el.getScene(i))==null?void 0:B.getElement(i.id);if(!W)return;let V=ur(W,o.scene.getNonDeletedElementsMap());if(V){if(h.value.trim()){let Y=Ko(V);!Y||Y!==i.id?me(V,{boundElements:(V.boundElements||[]).concat({type:"text",id:i.id})}):Ut(V)&&e0(V)}else me(V,{boundElements:(z=V.boundElements)==null?void 0:z.filter(Y=>!Le(Y))});Yr(W,V,o.scene.getNonDeletedElementsMap())}n({viaKeyboard:k,nextOriginalText:h.value})},T=()=>{h.onblur=null,h.oninput=null,h.onkeydown=null,q&&q.disconnect(),window.removeEventListener("resize",l),window.removeEventListener("wheel",S,!0),window.removeEventListener("pointerdown",P),window.removeEventListener("pointerup",R),window.removeEventListener("blur",M),window.removeEventListener("beforeunload",M),N(),F(),h.remove()},R=W=>{window.removeEventListener("pointerup",R);let V=W==null?void 0:W.target,B=V instanceof HTMLElement&&V.classList.contains("properties-trigger");setTimeout(()=>{h.onblur=M,B||h.focus()})},j=()=>{h.onblur=null,window.addEventListener("pointerup",R),window.addEventListener("blur",M)},P=W=>{let V=W==null?void 0:W.target;if(W.button===Bl.WHEEL){V instanceof HTMLTextAreaElement&&(W.preventDefault(),o.handleCanvasPanUsingWheelOrSpaceDrag(W)),j();return}let B=V instanceof HTMLElement&&V.classList.contains("properties-trigger");(W.target instanceof HTMLElement||W.target instanceof SVGElement)&&W.target.closest(`.${oh.SHAPE_ACTIONS_MENU}, .${oh.ZOOM_ACTIONS}`)&&!Zc(W.target)||B?j():W.target instanceof HTMLCanvasElement&&!Go()&&requestAnimationFrame(()=>{M()})},N=o.scene.onUpdate(()=>{var W;l(),(W=document.activeElement)!=null&&W.closest(".properties-content")||h.focus()}),F=o.onScrollChangeEmitter.on(()=>{l()}),$=!1;c&&h.select(),R();let q=null;a&&"ResizeObserver"in window?(q=new window.ResizeObserver(()=>{l()}),q.observe(a)):window.addEventListener("resize",l),h.onpointerdown=W=>W.stopPropagation(),requestAnimationFrame(()=>{window.addEventListener("pointerdown",P,{capture:!0})}),window.addEventListener("beforeunload",M),s==null||s.querySelector(".excalidraw-textEditorContainer").appendChild(h)},f1e=Te({name:"autoResize",label:"labels.autoResize",icon:null,trackEvent:{category:"element"},predicate:(e,t,n,r)=>{let i=gt(e,t);return i.length===1&&Le(i[0])&&!i[0].autoResize},perform:(e,t,n,r)=>{let i=gt(e,t);return{appState:t,elements:e.map(a=>{if(a.id===i[0].id&&Le(a)){let s=jr(a.originalText,Bt(a),a.lineHeight);return ct(a,{autoResize:!0,width:s.width,height:s.height,text:a.originalText})}return a}),captureUpdate:le.IMMEDIATELY}}}),p1e=e=>{let t=["flowchart","graph","sequenceDiagram","classDiagram","stateDiagram","stateDiagram-v2","erDiagram","journey","gantt","pie","quadrantChart","requirementDiagram","gitGraph","C4Context","mindmap","timeline","zenuml","sankey","xychart","block"];return new RegExp(`^(?:%%{.*?}%%[\\s\\n]*)?\\b(?:${t.map(n=>`\\s*${n}(-beta)?`).join("|")})\\b`).test(e.trim())},IN=({canvas:e,rc:t,newElement:n,elementsMap:r,allElementsMap:i,scale:a,appState:s,renderConfig:o})=>{if(e){let[c,d]=Xv(e,a),l=Vv({canvas:e,scale:a,normalizedWidth:c,normalizedHeight:d});l.save(),l.scale(s.zoom.value,s.zoom.value),n&&n.type!=="selection"?Yc(n,r,i,t,l,o,s):l.clearRect(0,0,c,d)}},m1e=xU(e=>{IN(e)},{trailing:!0}),g1e=(e,t)=>{if(t){m1e(e);return}IN(e)},U1e=e=>{let t=I.useRef(null);return I.useEffect(()=>{t.current&&g1e({canvas:t.current,scale:e.scale,newElement:e.appState.newElement,elementsMap:e.elementsMap,allElementsMap:e.allElementsMap,rc:e.rc,renderConfig:e.renderConfig,appState:e.appState},ex())}),m.jsx("canvas",{className:"excalidraw__canvas",style:{width:e.appState.width,height:e.appState.height},width:e.appState.width*e.scale,height:e.appState.height*e.scale,ref:t})},b1e=U1e,AN=ke.createContext(null),LN=ke.createContext(null),RN={viewport:{isMobile:!1,isLandscape:!1},editor:{isMobile:!1,canFitSidebar:!1},isTouchScreen:!1},tx=ke.createContext(RN);tx.displayName="DeviceContext";var nx=ke.createContext({container:null,id:null});nx.displayName="ExcalidrawContainerContext";var rx=ke.createContext([]);rx.displayName="ExcalidrawElementsContext";var ix=ke.createContext({...Vs(),width:0,height:0,offsetLeft:0,offsetTop:0});ix.displayName="ExcalidrawAppStateContext";var ax=ke.createContext(()=>{console.warn("Uninitialized ExcalidrawSetAppStateContext context!")});ax.displayName="ExcalidrawSetAppStateContext";var sx=ke.createContext(null);sx.displayName="ExcalidrawActionManagerContext";var io=()=>I.useContext(AN),a0=()=>I.useContext(LN),Yn=()=>I.useContext(tx),ao=()=>I.useContext(nx),u6=()=>I.useContext(rx),s0=()=>I.useContext(ix),nr=()=>I.useContext(ax),vi=()=>I.useContext(sx),Gf=!1,Fy=0,Bc=!1,qf=!1,$y=!1,By={horizontal:null,vertical:null},Ol=0,Zf=!1,zy=new Map,qm=!1,Ak=0,Lk=!1,zc=null,It={pointers:new Map,lastCenter:null,initialDistance:null,initialScale:null},y1e=class DN extends ke.Component{constructor(t){super(t),H(this,"canvas"),H(this,"interactiveCanvas",null),H(this,"rc"),H(this,"unmounted",!1),H(this,"actionManager"),H(this,"device",RN),H(this,"excalidrawContainerRef",ke.createRef()),H(this,"scene"),H(this,"fonts"),H(this,"renderer"),H(this,"visibleElements"),H(this,"resizeObserver"),H(this,"nearestScrollableContainer"),H(this,"library"),H(this,"libraryItemsFromStorage"),H(this,"id"),H(this,"store"),H(this,"history"),H(this,"excalidrawContainerValue"),H(this,"files",{}),H(this,"imageCache",new Map),H(this,"iFrameRefs",new Map),H(this,"embedsValidationStatus",new Map),H(this,"initializedEmbeds",new Set),H(this,"elementsPendingErasure",new Set),H(this,"flowChartCreator",new Ohe),H(this,"flowChartNavigator",new Nhe),H(this,"hitLinkElement"),H(this,"lastPointerDownEvent",null),H(this,"lastPointerUpEvent",null),H(this,"lastPointerMoveEvent",null),H(this,"lastPointerMoveCoords",null),H(this,"lastViewportPosition",{x:0,y:0}),H(this,"animationFrameHandler",new c1e),H(this,"laserTrails",new d1e(this.animationFrameHandler,this)),H(this,"eraserTrail",new I8(this.animationFrameHandler,this,{streamline:.2,size:5,keepHead:!0,sizeMapping:l=>{let h=Math.max(0,1-(performance.now()-l.pressure)/200),f=(10-Math.min(10,l.totalLength-l.currentIndex))/10;return Math.min(dd(f),dd(h))},fill:()=>this.state.theme===wt.LIGHT?"rgba(0, 0, 0, 0.2)":"rgba(255, 255, 255, 0.2)"})),H(this,"onChangeEmitter",new As),H(this,"onPointerDownEmitter",new As),H(this,"onPointerUpEmitter",new As),H(this,"onUserFollowEmitter",new As),H(this,"onScrollChangeEmitter",new As),H(this,"missingPointerEventCleanupEmitter",new As),H(this,"onRemoveEventListenersEmitter",new As),H(this,"getEffectiveGridSize",()=>g1(this)?this.state.gridSize:null),H(this,"updateEmbedValidationStatus",(l,h)=>{this.embedsValidationStatus.set(l.id,h),yn.delete(l)}),H(this,"updateEmbeddables",()=>{let l=new Set,h=!1;this.scene.getNonDeletedElements().filter(f=>{if(li(f)){if(l.add(f.id),!this.embedsValidationStatus.has(f.id)){h=!0;let g=Eg(f.link,this.props.validateEmbeddable);this.updateEmbedValidationStatus(f,g)}}else Yl(f)&&l.add(f.id);return!1}),h&&this.scene.triggerUpdate(),this.iFrameRefs.forEach((f,g)=>{l.has(g)||this.iFrameRefs.delete(g)})}),H(this,"getFrameNameDOMId",l=>`${this.id}-frame-name-${l.id}`),H(this,"frameNameBoundsCache",{get:l=>{let h=this.frameNameBoundsCache._cache.get(l.id);if(!h||h.zoom!==this.state.zoom.value||h.versionNonce!==l.versionNonce){let f=document.getElementById(this.getFrameNameDOMId(l));if(f){let g=f.getBoundingClientRect(),U=Yt({clientX:g.x,clientY:g.y},this.state),y=Yt({clientX:g.right,clientY:g.bottom},this.state);return h={x:U.x,y:U.y,width:y.x-U.x,height:y.y-U.y,angle:0,zoom:this.state.zoom.value,versionNonce:l.versionNonce},this.frameNameBoundsCache._cache.set(l.id,h),h}return null}return h},_cache:new Map}),H(this,"resetEditingFrame",l=>{var h;l&&me(l,{name:((h=l.name)==null?void 0:h.trim())||null}),this.setState({editingFrame:null})}),H(this,"renderFrameNames",()=>{if(!this.state.frameRendering.enabled||!this.state.frameRendering.name)return this.state.editingFrame&&this.resetEditingFrame(null),null;let l=this.state.theme===wt.DARK;return this.scene.getNonDeletedFramesLikes().map(h=>{if(!_2(h,this.canvas.width/window.devicePixelRatio,this.canvas.height/window.devicePixelRatio,{offsetLeft:this.state.offsetLeft,offsetTop:this.state.offsetTop,scrollX:this.state.scrollX,scrollY:this.state.scrollY,zoom:this.state.zoom},this.scene.getNonDeletedElementsMap()))return this.state.editingFrame===h.id&&this.resetEditingFrame(h),null;let{x:f,y:g}=oa({sceneX:h.x,sceneY:h.y},this.state),U=6,y,v=YL(h);if(h.id===this.state.editingFrame){let x=v;y=m.jsx("input",{autoFocus:!0,value:x,onChange:w=>{me(h,{name:w.target.value})},onFocus:w=>w.target.select(),onBlur:()=>this.resetEditingFrame(h),onKeyDown:w=>{(w.key===Z.ESCAPE||w.key===Z.ENTER)&&this.resetEditingFrame(h)},style:{background:this.state.viewBackgroundColor,filter:l?fv:"none",zIndex:2,border:"none",display:"block",padding:`${U}px`,borderRadius:4,boxShadow:"inset 0 0 0 1px var(--color-primary)",fontFamily:"Assistant",fontSize:"14px",transform:`translate(-${U}px, ${U}px)`,color:"var(--color-gray-80)",overflow:"hidden",maxWidth:`${document.body.clientWidth-f-U}px`},size:x.length+1||1,dir:"auto",autoComplete:"off",autoCapitalize:"off",autoCorrect:"off"})}else y=v;return m.jsx("div",{id:this.getFrameNameDOMId(h),style:{position:"absolute",bottom:`${this.state.height+Un.nameOffsetY-g+this.state.offsetTop}px`,left:`${f-this.state.offsetLeft}px`,zIndex:2,fontSize:Un.nameFontSize,color:l?Un.nameColorDarkTheme:Un.nameColorLightTheme,lineHeight:Un.nameLineHeight,width:"max-content",maxWidth:`${h.width}px`,overflow:h.id===this.state.editingFrame?"visible":"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",cursor:Ot.MOVE,pointerEvents:this.state.viewModeEnabled?xu.disabled:xu.enabled},onPointerDown:x=>this.handleCanvasPointerDown(x),onWheel:x=>this.handleWheel(x),onContextMenu:this.handleCanvasContextMenu,onDoubleClick:()=>{this.setState({editingFrame:h.id})},children:y},h.id)})}),H(this,"focusContainer",()=>{var l;(l=this.excalidrawContainerRef.current)==null||l.focus()}),H(this,"getSceneElementsIncludingDeleted",()=>this.scene.getElementsIncludingDeleted()),H(this,"getSceneElements",()=>this.scene.getNonDeletedElements()),H(this,"onInsertElements",l=>{this.addElementsFromPasteOrLibrary({elements:l,position:"center",files:null})}),H(this,"onExportImage",async(l,h,f)=>{Jt("export",l,"ui");let g=await o6(l,h,this.state,this.files,{exportBackground:this.state.exportBackground,name:this.getName(),viewBackgroundColor:this.state.viewBackgroundColor,exportingFrame:f.exportingFrame}).catch(II).catch(U=>{console.error(U),this.setState({errorMessage:U.message})});this.state.exportEmbedScene&&g&&g7(g)&&this.setState({fileHandle:g})}),H(this,"magicGenerations",new Map),H(this,"updateMagicGeneration",({frameElement:l,data:h})=>{h.status==="pending"?me(l,{customData:{generationData:void 0}},!1):me(l,{customData:{generationData:h}},!1),this.magicGenerations.set(l.id,h),this.triggerRender()}),H(this,"plugins",{}),H(this,"onMagicframeToolSelect",()=>{let l=this.scene.getSelectedElements({selectedElementIds:this.state.selectedElementIds});if(l.length===0)this.setActiveTool({type:Qn.magicframe}),Jt("ai","tool-select (empty-selection)","d2c");else{let h=l.length===1&&Ug(l[0])&&l[0];if(!h&&l.some(g=>tt(g)||g.frameId)){this.setActiveTool({type:Qn.magicframe});return}Jt("ai","tool-select (existing selection)","d2c");let f;if(h)f=h;else{let[g,U,y,v]=Dt(l),x=50;f=$3({...Un,x:g-x,y:U-x,width:y-g+x*2,height:v-U+x*2,opacity:100,locked:!1}),this.scene.insertElement(f);for(let w of l)me(w,{frameId:f.id});this.setState({selectedElementIds:{[f.id]:!0}})}this.onMagicFrameGenerate(f,"upstream")}}),H(this,"openEyeDropper",({type:l})=>{Za.set(r6,{swapPreviewOnAlt:!0,colorPickerType:l==="stroke"?"elementStroke":"elementBackground",onSelect:(h,f)=>{let g=l==="background"&&f.altKey||l==="stroke"&&!f.altKey;!this.scene.getSelectedElements(this.state).length||this.state.activeTool.type!=="selection"?g?this.syncActionResult({appState:{...this.state,currentItemStrokeColor:h},captureUpdate:le.IMMEDIATELY}):this.syncActionResult({appState:{...this.state,currentItemBackgroundColor:h},captureUpdate:le.IMMEDIATELY}):this.updateScene({elements:this.scene.getElementsIncludingDeleted().map(U=>this.state.selectedElementIds[U.id]?ct(U,{[g?"strokeColor":"backgroundColor"]:h}):U),captureUpdate:le.IMMEDIATELY})},keepOpenOnAlt:!1})}),H(this,"dismissLinearEditor",()=>{setTimeout(()=>{this.setState({editingLinearElement:null})})}),H(this,"syncActionResult",wn(l=>{var g,U,y,v,x,w;if(this.unmounted||l===!1)return;l.captureUpdate===le.NEVER?this.store.shouldUpdateSnapshot():l.captureUpdate===le.IMMEDIATELY&&this.store.shouldCaptureIncrement();let h=!1,f=null;if(l.elements&&(this.scene.replaceAllElements(l.elements),h=!0),l.files&&(this.addMissingFiles(l.files,l.replaceFiles),this.addNewImagesToImageCache()),l.appState||f||this.state.contextMenu){let C=((g=l==null?void 0:l.appState)==null?void 0:g.viewModeEnabled)||!1,S=((U=l==null?void 0:l.appState)==null?void 0:U.zenModeEnabled)||!1,k=((y=l==null?void 0:l.appState)==null?void 0:y.theme)||this.props.theme||wt.LIGHT,M=((v=l==null?void 0:l.appState)==null?void 0:v.name)??this.state.name,T=((x=l==null?void 0:l.appState)==null?void 0:x.errorMessage)??this.state.errorMessage;typeof this.props.viewModeEnabled<"u"&&(C=this.props.viewModeEnabled),typeof this.props.zenModeEnabled<"u"&&(S=this.props.zenModeEnabled),f=((w=l.appState)==null?void 0:w.editingTextElement)||null,l.elements&&f&&l.elements.forEach(R=>{(f==null?void 0:f.id)===R.id&&f!==R&&q3(R)&&Le(R)&&(f=R)}),f!=null&&f.isDeleted&&(f=null),this.setState(R=>{let j=l.appState||{};return{...R,...j,contextMenu:null,editingTextElement:f,viewModeEnabled:C,zenModeEnabled:S,theme:k,name:M,errorMessage:T}}),h=!0}!h&&l.captureUpdate!==le.EVENTUALLY&&this.scene.triggerUpdate()})),H(this,"onBlur",wn(()=>{Bc=!1,this.setState({isBindingEnabled:!0})})),H(this,"onUnload",()=>{this.onBlur()}),H(this,"disableEvent",l=>{l.preventDefault()}),H(this,"resetHistory",()=>{this.history.clear()}),H(this,"resetStore",()=>{this.store.clear()}),H(this,"resetScene",wn(l=>{this.scene.replaceAllElements([]),this.setState(h=>({...Vs(),isLoading:l!=null&&l.resetLoadingState?!1:h.isLoading,theme:this.state.theme})),this.resetStore(),this.resetHistory()})),H(this,"initializeScene",async()=>{var f;"launchQueue"in window&&"LaunchParams"in window&&window.launchQueue.setConsumer(async g=>{if(!g.files.length)return;let U=g.files[0],y=await U.getFile();this.loadFileToCanvas(new File([y],y.name||"",{type:y.type}),U)}),this.props.theme&&this.setState({theme:this.props.theme}),this.state.isLoading||this.setState({isLoading:!0});let l=null;try{typeof this.props.initialData=="function"?l=await this.props.initialData()||null:l=await this.props.initialData||null,l!=null&&l.libraryItems&&this.library.updateLibrary({libraryItems:l.libraryItems,merge:!0}).catch(g=>{console.error(g)})}catch(g){console.error(g),l={appState:{errorMessage:g.message||"Encountered an error during importing or restoring scene data"}}}let h=Z1(l,null,null,{repairBindings:!0});h.appState={...h.appState,theme:this.props.theme||h.appState.theme,openSidebar:((f=h.appState)==null?void 0:f.openSidebar)||this.state.openSidebar,activeTool:h.appState.activeTool.type==="image"?{...h.appState.activeTool,type:"selection"}:h.appState.activeTool,isLoading:!1,toast:this.state.toast},l!=null&&l.scrollToContent&&(h.appState={...h.appState,...p1(h.elements,{...h.appState,width:this.state.width,height:this.state.height,offsetTop:this.state.offsetTop,offsetLeft:this.state.offsetLeft})}),this.resetStore(),this.resetHistory(),this.syncActionResult({...h,captureUpdate:le.NEVER}),this.clearImageShapeCache(),this.fonts.loadSceneFonts().then(g=>{this.fonts.onLoaded(g)}),qu(window.location.href)&&this.scrollToContent(window.location.href,{animate:!1})}),H(this,"isMobileBreakpoint",(l,h)=>l<rY||h<aY&&l<iY),H(this,"refreshViewportBreakpoints",()=>{if(!this.excalidrawContainerRef.current)return;let{clientWidth:l,clientHeight:h}=document.body,f=this.device.viewport,g=mg(f,{isLandscape:l>h,isMobile:this.isMobileBreakpoint(l,h)});return f!==g?(this.device={...this.device,viewport:g},!0):!1}),H(this,"refreshEditorBreakpoints",()=>{let l=this.excalidrawContainerRef.current;if(!l)return;let{width:h,height:f}=l.getBoundingClientRect(),g=this.props.UIOptions.dockedSidebarBreakpoint!=null?this.props.UIOptions.dockedSidebarBreakpoint:sY,U=this.device.editor,y=mg(U,{isMobile:this.isMobileBreakpoint(h,f),canFitSidebar:h>g});return U!==y?(this.device={...this.device,editor:y},!0):!1}),H(this,"onResize",wn(()=>{this.scene.getElementsIncludingDeleted().forEach(l=>yn.delete(l)),this.refreshViewportBreakpoints(),this.updateDOMRect(),x3||this.refreshEditorBreakpoints(),this.setState({})})),H(this,"onFullscreenChange",()=>{var l;!document.fullscreenElement&&((l=this.state.activeEmbeddable)==null?void 0:l.state)==="active"&&this.setState({activeEmbeddable:null})}),H(this,"renderInteractiveSceneCallback",({atLeastOneVisibleElement:l,scrollBars:h,elementsMap:f})=>{h&&(By=h);let g=this.state.editingTextElement?!1:!l&&f.size>0;this.state.scrolledOutside!==g&&this.setState({scrolledOutside:g}),this.scheduleImageRefresh()}),H(this,"onScroll",uh(()=>{let{offsetTop:l,offsetLeft:h}=this.getCanvasOffsets();this.setState(f=>f.offsetLeft===h&&f.offsetTop===l?null:{offsetTop:l,offsetLeft:h})},tY)),H(this,"onCut",wn(l=>{var h;!((h=this.excalidrawContainerRef.current)!=null&&h.contains(document.activeElement))||Zc(l.target)||(this.actionManager.executeAction(F_,"keyboard",l),l.preventDefault(),l.stopPropagation())})),H(this,"onCopy",wn(l=>{var h;!((h=this.excalidrawContainerRef.current)!=null&&h.contains(document.activeElement))||Zc(l.target)||(this.actionManager.executeAction(Rg,"keyboard",l),l.preventDefault(),l.stopPropagation())})),H(this,"onTouchStart",l=>{if(mI&&l.preventDefault(),!Gf){Gf=!0,clearTimeout(Fy),Fy=window.setTimeout(DN.resetTapTwice,JV);return}if(Gf&&l.touches.length===1){let h=l.touches[0];this.handleCanvasDoubleClick({clientX:h.clientX,clientY:h.clientY}),Gf=!1,clearTimeout(Fy)}l.touches.length===2&&this.setState({selectedElementIds:At({},this.state),activeEmbeddable:null})}),H(this,"onTouchEnd",l=>{this.resetContextMenuTimer(),l.touches.length>0?this.setState({previousSelectedElementIds:{},selectedElementIds:At(this.state.previousSelectedElementIds,this.state)}):It.pointers.clear()}),H(this,"pasteFromClipboard",wn(async l=>{var C,S;let h=!!qm,f=document.activeElement,g=(C=this.excalidrawContainerRef.current)==null?void 0:C.contains(f);if(l&&!g)return;let U=document.elementFromPoint(this.lastViewportPosition.x,this.lastViewportPosition.y);if(l&&(!(U instanceof HTMLCanvasElement)||Zc(f)))return;let{x:y,y:v}=Yt({clientX:this.lastViewportPosition.x,clientY:this.lastViewportPosition.y},this.state),x=(S=l==null?void 0:l.clipboardData)==null?void 0:S.files[0],w=await FL(l,h);if(!x&&!h){if(w.mixedContent)return this.addElementsFromMixedContentPaste(w.mixedContent,{isPlainPaste:h,sceneX:y,sceneY:v});if(w.text){let k=w.text.trim();k.startsWith("<svg")&&k.endsWith("</svg>")&&(x=MS(k))}}if(pd(x)&&!w.spreadsheet){if(!this.isToolSupported("image")){this.setState({errorMessage:D("errors.imageToolNotSupported")});return}let k=this.createImageElement({sceneX:y,sceneY:v});this.insertImageElement(k,x),this.initializeImageDimensions(k),this.setState({selectedElementIds:At({[k.id]:!0},this.state)});return}if(this.props.onPaste)try{if(await this.props.onPaste(w,l)===!1)return}catch(k){console.error(k)}if(w.errorMessage)this.setState({errorMessage:w.errorMessage});else if(w.spreadsheet&&!h)this.setState({pasteDialog:{data:w.spreadsheet,shown:!0}});else if(w.elements){let k=w.programmaticAPI?Sh(w.elements):w.elements;this.addElementsFromPasteOrLibrary({elements:k,files:w.files||null,position:"cursor",retainSeed:h})}else if(w.text){if(w.text&&p1e(w.text)){let T=await ye(()=>import("./index-Dkn7NkQE.js").then(R=>R.N),[],import.meta.url);try{let{elements:R,files:j}=await T.parseMermaidToExcalidraw(w.text),P=Sh(R,{regenerateIds:!0});this.addElementsFromPasteOrLibrary({elements:P,files:j,position:"cursor"});return}catch(R){console.warn(`parsing pasted text as mermaid definition failed: ${R.message}`)}}let k=jI(w.text).split(/\n+/).map(T=>T.trim()).filter(Boolean),M=k.map(T=>Zne(T)).filter(T=>{var R;return Eg(T,this.props.validateEmbeddable)&&(/^(http|https):\/\/[^\s/$.?#].[^\s]*$/.test(T)||((R=Bu(T))==null?void 0:R.type)==="video")});if(!qm&&M.length>0&&M.length===k.length){let T=[];for(let R of M){let j=T[T.length-1],P=this.insertEmbeddableElement({sceneX:j?j.x+j.width+20:y,sceneY:v,link:Ui(R)});P&&T.push(P)}T.length&&this.setState({selectedElementIds:Object.fromEntries(T.map(R=>[R.id,!0]))});return}this.addTextFromPaste(w.text,h)}this.setActiveTool({type:"selection"}),l==null||l.preventDefault()})),H(this,"addElementsFromPasteOrLibrary",l=>{var W,V;let h=$U(l.elements,null,void 0),[f,g,U,y]=Dt(h),v=Mr(f,U)/2,x=Mr(g,y)/2,w=typeof l.position=="object"?l.position.clientX:l.position==="cursor"?this.lastViewportPosition.x:this.state.width/2+this.state.offsetLeft,C=typeof l.position=="object"?l.position.clientY:l.position==="cursor"?this.lastViewportPosition.y:this.state.height/2+this.state.offsetTop,{x:S,y:k}=Yt({clientX:w,clientY:C},this.state),M=S-v,T=k-x,[R,j]=zn(M,T,this.getEffectiveGridSize()),P=fL(h.map(B=>ct(B,{x:B.x+R-f,y:B.y+j-g})),{randomizeSeed:!l.retainSeed}),N=this.scene.getElementsIncludingDeleted(),F=[...N,...P];F=((V=(W=this.props).onDuplicate)==null?void 0:V.call(W,F,N))||F,Zs(F,nt(P));let $=this.getTopLayerFrameAtSceneCoords({x:S,y:k});if($){let B=nie(P,$);Dp(F,B,$,this.state)}this.scene.replaceAllElements(F),P.forEach(B=>{if(Le(B)&&an(B)){let z=ur(B,this.scene.getElementsMapIncludingDeleted());Yr(B,z,this.scene.getElementsMapIncludingDeleted())}}),BV&&Wo.loadElementsFonts(P).then(B=>{this.fonts.onLoaded(B)}),l.files&&this.addMissingFiles(l.files),this.store.shouldCaptureIncrement();let q=c7(P);this.setState({...this.state,openSidebar:this.state.openSidebar&&this.device.editor.canFitSidebar&&Za.get(Z7)?this.state.openSidebar:null,...Wr({editingGroupId:null,selectedElementIds:q.reduce((B,z)=>(an(z)||(B[z.id]=!0),B),{})},this.scene.getNonDeletedElements(),this.state,this)},()=>{l.files&&this.addNewImagesToImageCache()}),this.setActiveTool({type:"selection"}),l.fitToContent&&this.scrollToContent(P,{fitToContent:!0,canvasOffsets:this.getEditorUIOffsets()})}),H(this,"setAppState",(l,h)=>{this.setState(l,h)}),H(this,"removePointer",l=>{Ol&&this.resetContextMenuTimer(),It.pointers.delete(l.pointerId)}),H(this,"toggleLock",(l="ui")=>{this.state.activeTool.locked||Jt("toolbar","toggleLock",`${l} (${this.device.editor.isMobile?"mobile":"desktop"})`),this.setState(h=>({activeTool:{...h.activeTool,...Pn(this.state,h.activeTool.locked?{type:"selection"}:h.activeTool),locked:!h.activeTool.locked}}))}),H(this,"updateFrameRendering",l=>{this.setState(h=>{let f=typeof l=="function"?l(h.frameRendering):l;return{frameRendering:{enabled:(f==null?void 0:f.enabled)??h.frameRendering.enabled,clip:(f==null?void 0:f.clip)??h.frameRendering.clip,name:(f==null?void 0:f.name)??h.frameRendering.name,outline:(f==null?void 0:f.outline)??h.frameRendering.outline}}})}),H(this,"togglePenMode",l=>{this.setState(h=>({penMode:l??!h.penMode,penDetected:!0}))}),H(this,"onHandToolToggle",()=>{this.actionManager.executeAction(wde)}),H(this,"zoomCanvas",l=>{this.setState({...sd({viewportX:this.state.width/2+this.state.offsetLeft,viewportY:this.state.height/2+this.state.offsetTop,nextZoom:zo(l)},this.state)})}),H(this,"cancelInProgressAnimation",null),H(this,"scrollToContent",(l=this.scene.getNonDeletedElements(),h)=>{var v;if(typeof l=="string"){let x;if(qu(l)?x=rre(l):x=l,x){let w=this.scene.getElementsFromId(x);w!=null&&w.length?this.scrollToContent(w,{fitToContent:(h==null?void 0:h.fitToContent)??!0,animate:(h==null?void 0:h.animate)??!0}):qu(l)&&this.setState({toast:{message:D("elementLink.notFound"),duration:3e3,closable:!0}})}return}(v=this.cancelInProgressAnimation)==null||v.call(this);let f=Array.isArray(l)?l:[l],g=this.state.zoom,U=this.state.scrollX,y=this.state.scrollY;if(h!=null&&h.fitToContent||h!=null&&h.fitToViewport){let{appState:x}=a6({canvasOffsets:h.canvasOffsets,targetElements:f,appState:this.state,fitToViewport:!!(h!=null&&h.fitToViewport),viewportZoomFactor:h==null?void 0:h.viewportZoomFactor,minZoom:h==null?void 0:h.minZoom,maxZoom:h==null?void 0:h.maxZoom});g=x.zoom,U=x.scrollX,y=x.scrollY}else{let x=p1(f,this.state);U=x.scrollX,y=x.scrollY}if(h!=null&&h.animate){let x=this.state.scrollX,w=this.state.scrollY,C=this.state.zoom.value,S=IY({fromValues:{scrollX:x,scrollY:w,zoom:C},toValues:{scrollX:U,scrollY:y,zoom:g.value},interpolateValue:(k,M,T,R)=>{if(R==="zoom")return k*Math.pow(M/k,dd(T))},onStep:({scrollX:k,scrollY:M,zoom:T})=>{this.setState({scrollX:k,scrollY:M,zoom:{value:T}})},onStart:()=>{this.setState({shouldCacheIgnoreZoom:!0})},onEnd:()=>{this.setState({shouldCacheIgnoreZoom:!1})},onCancel:()=>{this.setState({shouldCacheIgnoreZoom:!1})},duration:(h==null?void 0:h.duration)??500});this.cancelInProgressAnimation=()=>{S(),this.cancelInProgressAnimation=null}}else this.setState({scrollX:U,scrollY:y,zoom:g})}),H(this,"maybeUnfollowRemoteUser",()=>{this.state.userToFollow&&this.setState({userToFollow:null})}),H(this,"translateCanvas",l=>{var h;(h=this.cancelInProgressAnimation)==null||h.call(this),this.maybeUnfollowRemoteUser(),this.setState(l)}),H(this,"setToast",l=>{this.setState({toast:l})}),H(this,"restoreFileFromShare",async()=>{try{let l=await caches.open("web-share-target"),h=await l.match("shared-file");if(h){let f=await h.blob(),g=new File([f],f.name||"",{type:f.type});this.loadFileToCanvas(g,null),await l.delete("shared-file"),window.history.replaceState(null,HV,window.location.pathname)}}catch(l){this.setState({errorMessage:l.message})}}),H(this,"addFiles",wn(l=>{let{addedFiles:h}=this.addMissingFiles(l);this.clearImageShapeCache(h),this.scene.triggerUpdate(),this.addNewImagesToImageCache()})),H(this,"addMissingFiles",(l,h=!1)=>{let f=h?{}:{...this.files},g={},U=Array.isArray(l)?l:Object.values(l);for(let y of U)if(!f[y.id]&&(g[y.id]=y,f[y.id]=y,y.mimeType===We.svg))try{let v=kie(tS(Mie(y.dataURL)),We.svg);y.dataURL!==v&&(y.version=(y.version??1)+1,y.dataURL=v)}catch(v){console.error(v)}return this.files=f,{addedFiles:g}}),H(this,"updateScene",wn(l=>{let h=Jo(l.elements??[]);if(l.captureUpdate&&l.captureUpdate!==le.EVENTUALLY){let f=this.store.snapshot.appState,g=this.store.snapshot.elements,U=l.appState?Object.assign({},f,l.appState):f,y=l.elements?this.store.filterUncomittedElements(this.scene.getElementsMapIncludingDeleted(),nt(h)):g;l.captureUpdate===le.IMMEDIATELY?this.store.captureIncrement(y,U):l.captureUpdate===le.NEVER&&this.store.updateSnapshot(y,U)}l.appState&&this.setState(l.appState),l.elements&&this.scene.replaceAllElements(h),l.collaborators&&this.setState({collaborators:l.collaborators})})),H(this,"triggerRender",l=>{l===!0?this.scene.triggerUpdate():this.setState({})}),H(this,"toggleSidebar",({name:l,tab:h,force:f})=>{var y,v;let g;f===void 0?g=((y=this.state.openSidebar)==null?void 0:y.name)===l&&((v=this.state.openSidebar)==null?void 0:v.tab)===h?null:l:g=f?l:null;let U=g?{name:g}:null;return U&&h&&(U.tab=h),this.setState({openSidebar:U}),!!g}),H(this,"updateCurrentCursorPosition",wn(l=>{this.lastViewportPosition.x=l.clientX,this.lastViewportPosition.y=l.clientY})),H(this,"getEditorUIOffsets",()=>{var U,y,v,x,w,C,S,k,M,T;let l=((x=(v=(y=(U=this.excalidrawContainerRef)==null?void 0:U.current)==null?void 0:y.querySelector(".App-toolbar"))==null?void 0:v.getBoundingClientRect())==null?void 0:x.bottom)??0,h=(S=(C=(w=this.excalidrawContainerRef)==null?void 0:w.current)==null?void 0:C.querySelector(".sidebar"))==null?void 0:S.getBoundingClientRect(),f=(T=(M=(k=this.excalidrawContainerRef)==null?void 0:k.current)==null?void 0:M.querySelector(".App-menu__left"))==null?void 0:T.getBoundingClientRect(),g=16;return E1().rtl?{top:l+g,right:Math.max(this.state.width-((f==null?void 0:f.left)??this.state.width),0)+g,bottom:g,left:Math.max((h==null?void 0:h.right)??0,0)+g}:{top:l+g,right:Math.max(this.state.width-((h==null?void 0:h.left)??this.state.width)+g,0),bottom:g,left:Math.max((f==null?void 0:f.right)??0,0)+g}}),H(this,"onKeyDown",wn(l=>{var U,y;if("Proxy"in window&&(!l.shiftKey&&/^[A-Z]$/.test(l.key)||l.shiftKey&&/^[a-z]$/.test(l.key))&&(l=new Proxy(l,{get(v,x){let w=v[x];return typeof w=="function"?w.bind(v):x==="key"?l.shiftKey?v.key.toUpperCase():v.key.toLowerCase():w}})),!C3(l.target)){if((l.key===Z.ESCAPE||l.key===Z.ENTER)&&this.state.croppingElementId){this.finishImageCropping();return}let v=gt(this.scene.getNonDeletedElementsMap(),this.state);if(v.length===1&&Lt(v[0])&&l.key===Z.ENTER){this.startImageCropping(v[0]);return}if(l.key===Z.ESCAPE&&this.flowChartCreator.isCreatingChart){this.flowChartCreator.clear(),this.triggerRender(!0);return}let x=hp(l.key);if(l[Z.CTRL_OR_CMD]&&x&&!l.shiftKey){l.preventDefault();let w=gt(this.scene.getNonDeletedElementsMap(),this.state);w.length===1&&EU(w[0])&&this.flowChartCreator.createNodes(w[0],this.scene.getNonDeletedElementsMap(),this.state,rk(l.key)),(U=this.flowChartCreator.pendingNodes)!=null&&U.length&&!kg(this.flowChartCreator.pendingNodes,this.canvas.width/window.devicePixelRatio,this.canvas.height/window.devicePixelRatio,{offsetLeft:this.state.offsetLeft,offsetTop:this.state.offsetTop,scrollX:this.state.scrollX,scrollY:this.state.scrollY,zoom:this.state.zoom},this.scene.getNonDeletedElementsMap(),this.getEditorUIOffsets())&&this.scrollToContent(this.flowChartCreator.pendingNodes,{animate:!0,duration:300,fitToContent:!0,canvasOffsets:this.getEditorUIOffsets()});return}if(l.altKey){let w=gt(this.scene.getNonDeletedElementsMap(),this.state);if(w.length===1&&x){l.preventDefault();let C=this.flowChartNavigator.exploreByDirection(w[0],this.scene.getNonDeletedElementsMap(),rk(l.key));if(C){this.setState(k=>({selectedElementIds:At({[C]:!0},k)}));let S=this.scene.getNonDeletedElementsMap().get(C);S&&!kg([S],this.canvas.width/window.devicePixelRatio,this.canvas.height/window.devicePixelRatio,{offsetLeft:this.state.offsetLeft,offsetTop:this.state.offsetTop,scrollX:this.state.scrollX,scrollY:this.state.scrollY,zoom:this.state.zoom},this.scene.getNonDeletedElementsMap(),this.getEditorUIOffsets())&&this.scrollToContent(S,{animate:!0,duration:300,canvasOffsets:this.getEditorUIOffsets()})}return}}}if(l[Z.CTRL_OR_CMD]&&l.key===Z.P&&!l.shiftKey&&!l.altKey){this.setToast({message:D("commandPalette.shortcutHint",{shortcut:Rr("commandPalette")})}),l.preventDefault();return}if(l[Z.CTRL_OR_CMD]&&l.key.toLowerCase()===Z.V&&(qm=l.shiftKey,clearTimeout(Ak),Ak=window.setTimeout(()=>{qm=!1},100)),l[Z.CTRL_OR_CMD]&&Zc(l.target)&&(l.code===kt.MINUS||l.code===kt.EQUAL)){l.preventDefault();return}if(Zc(l.target)&&l.key!==Z.ESCAPE||hp(l.key)&&C3(l.target))return;if(l.key===Z.QUESTION_MARK){this.setState({openDialog:{name:"help"}});return}else if(l.key.toLowerCase()===Z.E&&l.shiftKey&&l[Z.CTRL_OR_CMD]){l.preventDefault(),this.setState({openDialog:{name:"imageExport"}});return}if(l.key===Z.PAGE_UP||l.key===Z.PAGE_DOWN){let v=(l.shiftKey?this.state.width:this.state.height)/this.state.zoom.value;l.key===Z.PAGE_DOWN&&(v=-v),l.shiftKey?this.translateCanvas(x=>({scrollX:x.scrollX+v})):this.translateCanvas(x=>({scrollY:x.scrollY+v}))}if(((y=this.state.openDialog)==null?void 0:y.name)==="elementLinkSelector"||this.actionManager.handleKeyDown(l)||this.state.viewModeEnabled)return;if(l[Z.CTRL_OR_CMD]&&this.state.isBindingEnabled&&this.setState({isBindingEnabled:!1}),hp(l.key)){let v=this.scene.getSelectedElements({selectedElementIds:this.state.selectedElementIds,includeBoundTextElement:!0,includeElementsInFrames:!0}),x=v.find(Pe),w=new Set;v.filter(Pe).filter(M=>{let T=M.startBinding&&!v.some(j=>{var P;return j.id===((P=M.startBinding)==null?void 0:P.elementId)}),R=M.endBinding&&!v.some(j=>{var P;return j.id===((P=M.endBinding)==null?void 0:P.elementId)});return T||R}).forEach(M=>w.add(M.id)),v=v.filter(M=>!w.has(M.id));let C=this.getEffectiveGridSize()&&(l.shiftKey?WE:this.getEffectiveGridSize())||(l.shiftKey?XV:WE),S=0,k=0;l.key===Z.ARROW_LEFT?S=-C:l.key===Z.ARROW_RIGHT?S=C:l.key===Z.ARROW_UP?k=-C:l.key===Z.ARROW_DOWN&&(k=C),v.forEach(M=>{me(M,{x:M.x+S,y:M.y+k},!1),gi(M,this.scene.getNonDeletedElementsMap(),{simultaneouslyUpdated:v})}),this.setState({suggestedBindings:Jb(v.filter(M=>M.id!==(x==null?void 0:x.id)||C!==0),this.scene.getNonDeletedElementsMap(),this.state.zoom)}),this.scene.triggerUpdate(),l.preventDefault()}else if(l.key===Z.ENTER){let v=this.scene.getSelectedElements(this.state);if(v.length===1){let x=v[0];if(l[Z.CTRL_OR_CMD])st(x)&&(!this.state.editingLinearElement||this.state.editingLinearElement.elementId!==v[0].id)&&(this.store.shouldCaptureIncrement(),Pe(x)||this.setState({editingLinearElement:new Re(x)}));else if(Le(x)||_ne(x)){let w;Le(x)||(w=x);let C=ey(x,this.state,this.scene.getNonDeletedElementsMap()),S=C.x,k=C.y;this.startTextEditing({sceneX:S,sceneY:k,container:w}),l.preventDefault();return}else tt(x)&&this.setState({editingFrame:x.id})}}else if(!l.ctrlKey&&!l.altKey&&!l.metaKey&&!this.state.newElement&&!this.state.selectionElement&&!this.state.selectedElementsAreBeingDragged){let v=Qee(l.key);v?(this.state.activeTool.type!==v&&Jt("toolbar",v,`keyboard (${this.device.editor.isMobile?"mobile":"desktop"})`),v==="arrow"&&this.state.activeTool.type==="arrow"&&this.setState(x=>({currentItemArrowType:x.currentItemArrowType===lr.sharp?lr.round:x.currentItemArrowType===lr.round?lr.elbow:lr.sharp})),this.setActiveTool({type:v}),l.stopPropagation()):l.key===Z.Q&&(this.toggleLock("keyboard"),l.stopPropagation())}if(l.key===Z.SPACE&&It.pointers.size===0&&(Bc=!0,$t(this.interactiveCanvas,Ot.GRAB),l.preventDefault()),(l.key===Z.G||l.key===Z.S)&&!l.altKey&&!l[Z.CTRL_OR_CMD]){let v=this.scene.getSelectedElements(this.state);if(this.state.activeTool.type==="selection"&&!v.length)return;l.key===Z.G&&(mh(this.state.activeTool.type)||v.some(x=>mh(x.type)))&&(this.setState({openPopup:"elementBackground"}),l.stopPropagation()),l.key===Z.S&&(this.setState({openPopup:"elementStroke"}),l.stopPropagation())}if(!l[Z.CTRL_OR_CMD]&&l.shiftKey&&l.key.toLowerCase()===Z.F){let v=this.scene.getSelectedElements(this.state);if(this.state.activeTool.type==="selection"&&!v.length)return;(this.state.activeTool.type==="text"||v.find(x=>Le(x)||pt(x,this.scene.getNonDeletedElementsMap())))&&(l.preventDefault(),this.setState({openPopup:"fontFamily"}))}if(l.key===Z.K&&!l.altKey&&!l[Z.CTRL_OR_CMD]){this.state.activeTool.type==="laser"?this.setActiveTool({type:"selection"}):this.setActiveTool({type:"laser"});return}l[Z.CTRL_OR_CMD]&&(l.key===Z.BACKSPACE||l.key===Z.DELETE)&&Za.set(c6,"clearCanvas");let h=l.key.toLocaleLowerCase(),f=h===Z.S&&l.shiftKey,g=l.key===Z.I||h===Z.G&&l.shiftKey;(f||g)&&this.openEyeDropper({type:f?"stroke":"background"})})),H(this,"onKeyUp",wn(l=>{var h,f,g,U;if(l.key===Z.SPACE&&(this.state.viewModeEnabled||((h=this.state.openDialog)==null?void 0:h.name)==="elementLinkSelector"?$t(this.interactiveCanvas,Ot.GRAB):this.state.activeTool.type==="selection"?$a(this.interactiveCanvas):(Ts(this.interactiveCanvas,this.state),this.setState({selectedElementIds:At({},this.state),selectedGroupIds:{},editingGroupId:null,activeEmbeddable:null})),Bc=!1),!l[Z.CTRL_OR_CMD]&&!this.state.isBindingEnabled&&this.setState({isBindingEnabled:!0}),hp(l.key)&&(g2(this.scene.getSelectedElements(this.state).filter(st),this.scene.getNonDeletedElementsMap(),this.scene.getNonDeletedElements(),this.scene,id(this.state),((f=this.state.selectedLinearElement)==null?void 0:f.selectedPointsIndices)??[],this.state.zoom),this.setState({suggestedBindings:[]})),l.altKey||this.flowChartNavigator.isExploring&&(this.flowChartNavigator.clear(),this.syncActionResult({captureUpdate:le.IMMEDIATELY})),!l[Z.CTRL_OR_CMD]&&this.flowChartCreator.isCreatingChart){(g=this.flowChartCreator.pendingNodes)!=null&&g.length&&this.scene.insertElements(this.flowChartCreator.pendingNodes);let y=(U=this.flowChartCreator.pendingNodes)==null?void 0:U[0];y&&(this.setState(v=>({selectedElementIds:At({[y.id]:!0},v)})),kg([y],this.canvas.width/window.devicePixelRatio,this.canvas.height/window.devicePixelRatio,{offsetLeft:this.state.offsetLeft,offsetTop:this.state.offsetTop,scrollX:this.state.scrollX,scrollY:this.state.scrollY,zoom:this.state.zoom},this.scene.getNonDeletedElementsMap(),this.getEditorUIOffsets())||this.scrollToContent(y,{animate:!0,duration:300,canvasOffsets:this.getEditorUIOffsets()})),this.flowChartCreator.clear(),this.syncActionResult({captureUpdate:le.IMMEDIATELY})}})),H(this,"isToolSupported",l=>{var h;return((h=this.props.UIOptions.tools)==null?void 0:h[l])!==!1}),H(this,"setActiveTool",l=>{if(!this.isToolSupported(l.type)){console.warn(`"${l.type}" tool is disabled via "UIOptions.canvasActions.tools.${l.type}"`);return}let h=Pn(this.state,l);h.type==="hand"?$t(this.interactiveCanvas,Ot.GRAB):Bc||Ts(this.interactiveCanvas,{...this.state,activeTool:h}),TY(document.activeElement)&&this.focusContainer(),Uv(h.type)||this.setState({suggestedBindings:[]}),h.type==="image"&&this.onImageAction({insertOnCanvasDirectly:(l.type==="image"&&l.insertOnCanvasDirectly)??!1}),this.setState(f=>{let g={snapLines:f.snapLines.length?[]:f.snapLines,originSnapOffset:null,activeEmbeddable:null};return h.type==="freedraw"&&this.store.shouldCaptureIncrement(),h.type!=="selection"?{...f,activeTool:h,selectedElementIds:At({},f),selectedGroupIds:At({},f),editingGroupId:null,multiElement:null,...g}:{...f,activeTool:h,...g}})}),H(this,"setOpenDialog",l=>{this.setState({openDialog:l})}),H(this,"setCursor",l=>{$t(this.interactiveCanvas,l)}),H(this,"resetCursor",()=>{$a(this.interactiveCanvas)}),H(this,"isTouchScreenMultiTouchGesture",()=>It.pointers.size>=2),H(this,"getName",()=>this.state.name||this.props.name||`${D("labels.untitled")}-${QE()}`),H(this,"onGestureStart",wn(l=>{l.preventDefault(),this.isTouchScreenMultiTouchGesture()&&this.setState({selectedElementIds:At({},this.state),activeEmbeddable:null}),It.initialScale=this.state.zoom.value})),H(this,"onGestureChange",wn(l=>{if(l.preventDefault(),this.isTouchScreenMultiTouchGesture())return;let h=It.initialScale;h&&this.setState(f=>({...sd({viewportX:this.lastViewportPosition.x,viewportY:this.lastViewportPosition.y,nextZoom:zo(h*l.scale)},f)}))})),H(this,"onGestureEnd",wn(l=>{l.preventDefault(),this.isTouchScreenMultiTouchGesture()&&this.setState({previousSelectedElementIds:{},selectedElementIds:At(this.state.previousSelectedElementIds,this.state)}),It.initialScale=null})),H(this,"startTextEditing",({sceneX:l,sceneY:h,insertAtParentCenter:f=!0,container:g,autoEdit:U=!0})=>{let y=!1,v=f&&this.getTextWysiwygSnappedToCenterPosition(l,h,this.state,g);g&&v&&(pt(g,this.scene.getNonDeletedElementsMap())||(y=!0));let x=null,w=this.scene.getSelectedElements(this.state);w.length===1?Le(w[0])?x=w[0]:g?x=pt(w[0],this.scene.getNonDeletedElementsMap()):x=this.getTextElementAtPosition(l,h):x=this.getTextElementAtPosition(l,h);let C=(x==null?void 0:x.fontFamily)||this.state.currentItemFontFamily,S=(x==null?void 0:x.lineHeight)||Td(C),k=this.state.currentItemFontSize;if(!x&&y&&g&&!Ut(g)){let R=BI(Bt({fontSize:k,fontFamily:C}),S),j=zI(k,S),P=Math.max(g.height,j),N=Math.max(g.width,R);me(g,{height:P,width:N}),l=g.x+N/2,h=g.y+P/2,v&&(v=this.getTextWysiwygSnappedToCenterPosition(l,h,this.state,g))}let M=this.getTopLayerFrameAtSceneCoords({x:l,y:h}),T=x||Oi({x:v?v.elementCenterX:l,y:v?v.elementCenterY:h,strokeColor:this.state.currentItemStrokeColor,backgroundColor:this.state.currentItemBackgroundColor,fillStyle:this.state.currentItemFillStyle,strokeWidth:this.state.currentItemStrokeWidth,strokeStyle:this.state.currentItemStrokeStyle,roughness:this.state.currentItemRoughness,opacity:this.state.currentItemOpacity,text:"",fontSize:k,fontFamily:C,textAlign:v?"center":this.state.currentItemTextAlign,verticalAlign:v?ji.MIDDLE:Jg,containerId:y?g==null?void 0:g.id:void 0,groupIds:(g==null?void 0:g.groupIds)??[],lineHeight:S,angle:(g==null?void 0:g.angle)??0,frameId:M?M.id:null});if(!x&&y&&g&&me(g,{boundElements:(g.boundElements||[]).concat({type:"text",id:T.id})}),this.setState({editingTextElement:T}),!x)if(g&&y){let R=this.scene.getElementIndex(g.id);this.scene.insertElementAtIndex(T,R+1)}else this.scene.insertElement(T);U||x||g?this.handleTextWysiwyg(T,{isExistingElement:!!x}):this.setState({newElement:T,multiElement:null})}),H(this,"startImageCropping",l=>{this.store.shouldCaptureIncrement(),this.setState({croppingElementId:l.id})}),H(this,"finishImageCropping",()=>{this.state.croppingElementId&&(this.store.shouldCaptureIncrement(),this.setState({croppingElementId:null}))}),H(this,"handleCanvasDoubleClick",l=>{if(this.state.multiElement||this.state.activeTool.type!=="selection")return;let h=this.scene.getSelectedElements(this.state),{x:f,y:g}=Yt(l,this.state);if(h.length===1&&st(h[0])){if(l[Z.CTRL_OR_CMD]&&(!this.state.editingLinearElement||this.state.editingLinearElement.elementId!==h[0].id)&&!Pe(h[0])){this.store.shouldCaptureIncrement(),this.setState({editingLinearElement:new Re(h[0])});return}else if(this.state.selectedLinearElement&&Pe(h[0])){let U=Re.getSegmentMidpointHitCoords(this.state.selectedLinearElement,{x:f,y:g},this.state,this.scene.getNonDeletedElementsMap()),y=U?Re.getSegmentMidPointIndex(this.state.selectedLinearElement,this.state,U,this.scene.getNonDeletedElementsMap()):-1;if(y&&y>-1){this.store.shouldCaptureIncrement(),Re.deleteFixedSegment(h[0],y);let v=Re.getSegmentMidpointHitCoords({...this.state.selectedLinearElement,segmentMidPointHoveredCoords:null},{x:f,y:g},this.state,this.scene.getNonDeletedElementsMap()),x=v?Re.getSegmentMidPointIndex(this.state.selectedLinearElement,this.state,v,this.scene.getNonDeletedElementsMap()):null;this.setState({selectedLinearElement:{...this.state.selectedLinearElement,pointerDownState:{...this.state.selectedLinearElement.pointerDownState,segmentMidpoint:{index:x,value:U,added:!1}},segmentMidPointHoveredCoords:v}});return}}}if(h.length===1&&Lt(h[0])){this.startImageCropping(h[0]);return}if($a(this.interactiveCanvas),hd(this.state).length>0){let U=this.getElementAtPosition(f,g),y=U&&ine(U,this.state.selectedGroupIds);if(y){this.store.shouldCaptureIncrement(),this.setState(v=>({...v,...Wr({editingGroupId:y,selectedElementIds:{[U.id]:!0}},this.scene.getNonDeletedElements(),v,this)}));return}}if($a(this.interactiveCanvas),!l[Z.CTRL_OR_CMD]&&!this.state.viewModeEnabled){let U=this.getElementAtPosition(f,g);if(sa(U)){this.setState({activeEmbeddable:{element:U,state:"active"}});return}let y=this.getTextBindableContainerAtPosition(f,g);if(y&&(ma(y)||!Ga(y.backgroundColor)||Ru({x:f,y:g,element:y,shape:No(y,this.scene.getNonDeletedElementsMap()),threshold:this.getElementHitThreshold()}))){let v=ey(y,this.state,this.scene.getNonDeletedElementsMap());f=v.x,g=v.y}this.startTextEditing({sceneX:f,sceneY:g,insertAtParentCenter:!l.altKey,container:y})}}),H(this,"getElementLinkAtPosition",(l,h)=>{let f=this.scene.getNonDeletedElements(),g=-1;for(let U=f.length-1;U>=0;U--){let y=f[U];if(h&&y.id===h.id&&(g=U),y.link&&U>=g&&ty(y,this.scene.getNonDeletedElementsMap(),this.state,A(l.x,l.y),this.device.editor.isMobile))return y}}),H(this,"redirectToLink",(l,h)=>{let f=Rt(A(this.lastPointerDownEvent.clientX,this.lastPointerDownEvent.clientY),A(this.lastPointerUpEvent.clientX,this.lastPointerUpEvent.clientY));if(!this.hitLinkElement||f>Vc)return;let g=Yt(this.lastPointerDownEvent,this.state),U=this.scene.getNonDeletedElementsMap(),y=ty(this.hitLinkElement,U,this.state,A(g.x,g.y),this.device.editor.isMobile),v=Yt(this.lastPointerUpEvent,this.state),x=ty(this.hitLinkElement,U,this.state,A(v.x,v.y),this.device.editor.isMobile);if(y&&x){X_();let w=this.hitLinkElement.link;if(w){w=Ui(w);let C;if(this.props.onLinkOpen&&(C=RI("excalidraw-link",l.nativeEvent),this.props.onLinkOpen({...this.hitLinkElement,link:w},C)),!(C!=null&&C.defaultPrevented)){let S=rL(w)?"_self":"_blank",k=window.open(void 0,S);k&&(k.opener=null,k.location=w)}}}}),H(this,"getTopLayerFrameAtSceneCoords",l=>{let h=this.scene.getNonDeletedElementsMap(),f=this.scene.getNonDeletedFramesLikes().filter(g=>US(l,g,h));return f.length?f[f.length-1]:null}),H(this,"handleCanvasPointerMove",l=>{var C,S,k,M,T,R;this.savePointer(l.clientX,l.clientY,this.state.cursorButton),this.lastPointerMoveEvent=l.nativeEvent,It.pointers.has(l.pointerId)&&It.pointers.set(l.pointerId,{x:l.clientX,y:l.clientY});let h=It.initialScale;if(It.pointers.size===2&&It.lastCenter&&h&&It.initialDistance){let j=ek(It.pointers),P=j.x-It.lastCenter.x,N=j.y-It.lastCenter.y;It.lastCenter=j;let F=tk(Array.from(It.pointers.values())),$=this.state.activeTool.type==="freedraw"&&this.state.penMode?1:F/It.initialDistance,q=$?zo(h*$):this.state.zoom.value;this.setState(W=>{let V=sd({viewportX:j.x,viewportY:j.y,nextZoom:q},W);this.translateCanvas({zoom:V.zoom,scrollX:V.scrollX+2*(P/q),scrollY:V.scrollY+2*(N/q),shouldCacheIgnoreZoom:!0})}),this.resetShouldCacheIgnoreZoomDebounced()}else It.lastCenter=It.initialDistance=It.initialScale=null;if(Bc||qf||$y||ch(this.state))return;let f=ak(By,l.clientX-this.state.offsetLeft,l.clientY-this.state.offsetTop).isOverEither;!this.state.newElement&&!this.state.selectionElement&&!this.state.selectedElementsAreBeingDragged&&!this.state.multiElement&&(f?$a(this.interactiveCanvas):Ts(this.interactiveCanvas,this.state));let g=Yt(l,this.state),{x:U,y}=g;if(!this.state.newElement&&bne(this.state.activeTool.type)){let{originOffset:j,snapLines:P}=Une(this.scene.getNonDeletedElements(),this,{x:U,y},l,this.scene.getNonDeletedElementsMap());this.setState(N=>{let F=$f(N.snapLines,P),$=N.originSnapOffset?$f(N.originSnapOffset,j):j;return N.snapLines===F&&N.originSnapOffset===$?null:{snapLines:F,originSnapOffset:$}})}else!this.state.newElement&&!this.state.selectedElementsAreBeingDragged&&!this.state.selectionElement&&this.setState(j=>j.snapLines.length?{snapLines:[]}:null);if(this.state.editingLinearElement&&!this.state.editingLinearElement.isDragging){let j=Re.handlePointerMove(l,U,y,this,this.scene.getNonDeletedElementsMap());j&&j!==this.state.editingLinearElement&&Jn.flushSync(()=>{this.setState({editingLinearElement:j})}),(j==null?void 0:j.lastUncommittedPoint)!=null?this.maybeSuggestBindingAtCursor(g,j.elbowed):Jn.flushSync(()=>{this.setState({suggestedBindings:[]})})}if(NI(this.state.activeTool.type)){let{newElement:j}=this.state;Ns(j,!1)?this.maybeSuggestBindingsForLinearElementAtCoords(j,[g],this.state.startBoundElement):this.maybeSuggestBindingAtCursor(g,!1)}if(this.state.multiElement){let{multiElement:j}=this.state,{x:P,y:N}=j,{points:F,lastCommittedPoint:$}=j,q=F[F.length-1];if(Ts(this.interactiveCanvas,this.state),q===$)Rt(A(U-P,y-N),q)>=pg?me(j,{points:[...F,A(U-P,y-N)]},!1):$t(this.interactiveCanvas,Ot.POINTER);else if(F.length>2&&$&&Rt(A(U-P,y-N),$)<pg)$t(this.interactiveCanvas,Ot.POINTER),me(j,{points:F.slice(0,-1)},!1);else{let[W,V]=zn(U,y,l[Z.CTRL_OR_CMD]||Pe(j)?null:this.getEffectiveGridSize()),[B,z]=(j==null?void 0:j.lastCommittedPoint)??[0,0],Y=W-P-B,K=V-N-z;Lp(l)&&({width:Y,height:K}=Y3(B+P,z+N,W,V)),qo(F,this.state.zoom.value)&&$t(this.interactiveCanvas,Ot.POINTER),me(j,{points:[...F.slice(0,-1),A(B+Y,z+K)]},!1,{isDragging:!0}),this.triggerRender(!1)}return}if(l.buttons||this.state.activeTool.type!=="selection"&&this.state.activeTool.type!=="text"&&this.state.activeTool.type!=="eraser")return;let v=this.scene.getNonDeletedElements(),x=this.scene.getSelectedElements(this.state);if(x.length===1&&!f&&!this.state.editingLinearElement){if(this.state.selectedLinearElement&&this.handleHoverSelectedLinearElement(this.state.selectedLinearElement,U,y),(!this.state.selectedLinearElement||this.state.selectedLinearElement.hoverPointIndex===-1)&&((C=this.state.openDialog)==null?void 0:C.name)!=="elementLinkSelector"&&!(x.length===1&&Pe(x[0]))){let j=CS(v,this.state,U,y,this.state.zoom,l.pointerType,this.scene.getNonDeletedElementsMap(),this.device);if(j&&j.transformHandleType){$t(this.interactiveCanvas,_S(j));return}}}else if(x.length>1&&!f&&((S=this.state.openDialog)==null?void 0:S.name)!=="elementLinkSelector"){let j=SS(Dt(x),U,y,this.state.zoom,l.pointerType,this.device);if(j){$t(this.interactiveCanvas,_S({transformHandleType:j}));return}}let w=this.getElementAtPosition(g.x,g.y);this.hitLinkElement=this.getElementLinkAtPosition(g,w),!Is(this.state)&&(this.hitLinkElement&&!this.state.selectedElementIds[this.hitLinkElement.id]?($t(this.interactiveCanvas,Ot.POINTER),eue(this.hitLinkElement,this.state,this.scene.getNonDeletedElementsMap())):(X_(),w&&(w.link||li(w))&&this.state.selectedElementIds[w.id]&&!this.state.contextMenu&&!this.state.showHyperlinkPopup?this.setState({showHyperlinkPopup:"info"}):this.state.activeTool.type==="text"?$t(this.interactiveCanvas,Le(w)?Ot.TEXT:Ot.CROSSHAIR):this.state.viewModeEnabled?$t(this.interactiveCanvas,Ot.GRAB):((k=this.state.openDialog)==null?void 0:k.name)==="elementLinkSelector"?$t(this.interactiveCanvas,Ot.AUTO):f?$t(this.interactiveCanvas,Ot.AUTO):this.state.selectedLinearElement?this.handleHoverSelectedLinearElement(this.state.selectedLinearElement,U,y):l[Z.CTRL_OR_CMD]?$t(this.interactiveCanvas,Ot.AUTO):(w||this.isHittingCommonBoundingBoxOfSelectedElements(g,x))&&!(w!=null&&w.locked)&&(w&&sa(w)&&this.isIframeLikeElementCenter(w,l,U,y)?($t(this.interactiveCanvas,Ot.POINTER),this.setState({activeEmbeddable:{element:w,state:"hover"}})):(!w||!Pe(w))&&($t(this.interactiveCanvas,Ot.MOVE),((M=this.state.activeEmbeddable)==null?void 0:M.state)==="hover"&&this.setState({activeEmbeddable:null})))),((T=this.state.openDialog)==null?void 0:T.name)==="elementLinkSelector"&&w?this.setState(j=>({hoveredElementIds:$f(j.hoveredElementIds,Wr({editingGroupId:j.editingGroupId,selectedElementIds:{[w.id]:!0}},this.scene.getNonDeletedElements(),j,this).selectedElementIds)})):((R=this.state.openDialog)==null?void 0:R.name)==="elementLinkSelector"&&!w&&this.setState(j=>({hoveredElementIds:$f(j.hoveredElementIds,{})})))}),H(this,"handleEraser",(l,h,f)=>{this.eraserTrail.addPointToPath(f.x,f.y);let g=!1,U=new Set,y=this.scene.getNonDeletedElements(),v=k=>{var M;for(let T of k){if(T.locked)return;if(l.altKey?this.elementsPendingErasure.delete(T.id)&&(g=!0):this.elementsPendingErasure.has(T.id)||(g=!0,this.elementsPendingErasure.add(T.id)),g&&((M=T.groupIds)==null?void 0:M.length)){let R=T.groupIds.at(-1);if(!U.has(R)){U.add(R);let j=rn(y,R);for(let P of j)l.altKey?this.elementsPendingErasure.delete(P.id):this.elementsPendingErasure.add(P.id)}}}},x=Rt(A(h.lastCoords.x,h.lastCoords.y),A(f.x,f.y)),w=this.getElementHitThreshold(),C={...h.lastCoords},S=0;for(;S<=x;){let k=this.getElementsAtPosition(C.x,C.y);if(v(k),S===x)break;S=Math.min(S+w,x);let M=S/x,T=(1-M)*C.x+M*f.x,R=(1-M)*C.y+M*f.y;C.x=T,C.y=R}if(h.lastCoords.x=f.x,h.lastCoords.y=f.y,g){for(let k of this.scene.getNonDeletedElements())an(k)&&(this.elementsPendingErasure.has(k.id)||this.elementsPendingErasure.has(k.containerId))&&(l.altKey?(this.elementsPendingErasure.delete(k.id),this.elementsPendingErasure.delete(k.containerId)):(this.elementsPendingErasure.add(k.id),this.elementsPendingErasure.add(k.containerId)));this.elementsPendingErasure=new Set(this.elementsPendingErasure),this.triggerRender()}}),H(this,"handleTouchMove",l=>{Zf=!0}),H(this,"handleCanvasPointerDown",l=>{var w,C,S;let h=l.target;if(h.setPointerCapture&&h.setPointerCapture(l.pointerId),this.maybeCleanupAfterMissingPointerUp(l.nativeEvent),this.maybeUnfollowRemoteUser(),this.state.searchMatches&&(this.setState(k=>({searchMatches:k.searchMatches.map(M=>({...M,focus:!1}))})),Za.set(hN,null)),this.state.contextMenu&&this.setState({contextMenu:null}),this.state.snapLines&&this.setAppState({snapLines:[]}),this.updateGestureOnPointerDown(l),l.pointerType==="touch"&&this.state.newElement&&this.state.newElement.type==="freedraw"){let k=this.state.newElement;this.updateScene({...k.points.length<10?{elements:this.scene.getElementsIncludingDeleted().filter(M=>M.id!==k.id)}:{},appState:{newElement:null,editingTextElement:null,startBoundElement:null,suggestedBindings:[],selectedElementIds:At(Object.keys(this.state.selectedElementIds).filter(M=>M!==k.id).reduce((M,T)=>(M[T]=this.state.selectedElementIds[T],M),{}),this.state)},captureUpdate:((w=this.state.openDialog)==null?void 0:w.name)==="elementLinkSelector"?le.EVENTUALLY:le.NEVER});return}let f=document.getSelection();if(f!=null&&f.anchorNode&&f.removeAllRanges(),this.maybeOpenContextMenuAfterPointerDownOnTouchDevices(l),!this.state.penDetected&&l.pointerType==="pen"&&this.setState(k=>({penMode:!0,penDetected:!0})),!this.device.isTouchScreen&&["pen","touch"].includes(l.pointerType)&&(this.device=mg(this.device,{isTouchScreen:!0})),qf||(this.lastPointerDownEvent=l,this.handleCanvasPanUsingWheelOrSpaceDrag(l)))return;if(this.setState({lastPointerDownWith:l.pointerType,cursorButton:"down"}),this.savePointer(l.clientX,l.clientY,"down"),l.button===Bl.ERASER&&this.state.activeTool.type!==Qn.eraser){this.setState({activeTool:Pn(this.state,{type:Qn.eraser,lastActiveToolBeforeEraser:this.state.activeTool})},()=>{this.handleCanvasPointerDown(l);let k=()=>{M(),T==null||T(),Is(this.state)&&this.setState({activeTool:Pn(this.state,{...this.state.activeTool.lastActiveTool||{type:Qn.selection},lastActiveToolBeforeEraser:null})})},M=mn(window,"pointerup",k,{once:!0}),T;requestAnimationFrame(()=>{T=this.missingPointerEventCleanupEmitter.once(k)})});return}if(l.button!==Bl.MAIN&&l.button!==Bl.TOUCH&&l.button!==Bl.ERASER||It.pointers.size>1)return;let g=this.initialPointerDownState(l);if(this.setState({selectedElementsAreBeingDragged:!1}),this.handleDraggingScrollBar(l,g)||(this.clearSelectionIfNotUsingSelection(),this.updateBindingEnabledOnPointerMove(l),this.handleSelectionOnPointerDown(l,g))||!(!this.state.penMode||l.pointerType!=="touch"||this.state.activeTool.type==="selection"||this.state.activeTool.type==="text"||this.state.activeTool.type==="image"))return;if(this.state.activeTool.type==="text")this.handleTextOnPointerDown(l,g);else if(this.state.activeTool.type==="arrow"||this.state.activeTool.type==="line")this.handleLinearElementOnPointerDown(l,this.state.activeTool.type,g);else if(this.state.activeTool.type==="image"){$t(this.interactiveCanvas,Ot.CROSSHAIR);let k=this.state.pendingImageElementId&&this.scene.getElement(this.state.pendingImageElementId);if(!k)return;this.setState({newElement:k,pendingImageElementId:null,multiElement:null});let{x:M,y:T}=Yt(l,this.state),R=this.getTopLayerFrameAtSceneCoords({x:M,y:T});me(k,{x:M,y:T,frameId:R?R.id:null})}else this.state.activeTool.type==="freedraw"?this.handleFreeDrawElementOnPointerDown(l,this.state.activeTool.type,g):this.state.activeTool.type==="custom"?Ts(this.interactiveCanvas,this.state):this.state.activeTool.type===Qn.frame||this.state.activeTool.type===Qn.magicframe?this.createFrameElementOnPointerDown(g,this.state.activeTool.type):this.state.activeTool.type==="laser"?this.laserTrails.startPath(g.lastCoords.x,g.lastCoords.y):this.state.activeTool.type!=="eraser"&&this.state.activeTool.type!=="hand"&&this.createGenericElementOnPointerDown(this.state.activeTool.type,g);(S=(C=this.props)==null?void 0:C.onPointerDown)==null||S.call(C,this.state.activeTool,g),this.onPointerDownEmitter.trigger(this.state.activeTool,g,l),this.state.activeTool.type==="eraser"&&this.eraserTrail.startPath(g.lastCoords.x,g.lastCoords.y);let U=this.onPointerMoveFromPointerDownHandler(g),y=this.onPointerUpFromPointerDownHandler(g),v=this.onKeyDownFromPointerDownHandler(g),x=this.onKeyUpFromPointerDownHandler(g);this.missingPointerEventCleanupEmitter.once(k=>y(k||l.nativeEvent)),(!this.state.viewModeEnabled||this.state.activeTool.type==="laser")&&(window.addEventListener("pointermove",U),window.addEventListener("pointerup",y),window.addEventListener("keydown",v),window.addEventListener("keyup",x),g.eventListeners.onMove=U,g.eventListeners.onUp=y,g.eventListeners.onKeyUp=x,g.eventListeners.onKeyDown=v)}),H(this,"handleCanvasPointerUp",l=>{var g;this.removePointer(l),this.lastPointerUpEvent=l;let h=Yt({clientX:l.clientX,clientY:l.clientY},this.state),f=l.timeStamp-(((g=this.lastPointerDownEvent)==null?void 0:g.timeStamp)??0);if(this.device.editor.isMobile&&f<300){let U=this.getElementAtPosition(h.x,h.y);if(sa(U)&&this.isIframeLikeElementCenter(U,l,h.x,h.y)){this.handleEmbeddableCenterClick(U);return}}if(this.device.isTouchScreen){let U=this.getElementAtPosition(h.x,h.y);this.hitLinkElement=this.getElementLinkAtPosition(h,U)}this.hitLinkElement&&!this.state.selectedElementIds[this.hitLinkElement.id]?f<300&&sa(this.hitLinkElement)&&!CL(this.hitLinkElement,this.scene.getNonDeletedElementsMap(),this.state,A(h.x,h.y))?this.handleEmbeddableCenterClick(this.hitLinkElement):this.redirectToLink(l,this.device.isTouchScreen):this.state.viewModeEnabled&&this.setState({activeEmbeddable:null,selectedElementIds:{}})}),H(this,"maybeOpenContextMenuAfterPointerDownOnTouchDevices",l=>{l.pointerType==="touch"&&(Zf=!1,Ol?Zf=!0:Ol=window.setTimeout(()=>{Ol=0,Zf||this.handleCanvasContextMenu(l)},eY))}),H(this,"resetContextMenuTimer",()=>{clearTimeout(Ol),Ol=0,Zf=!1}),H(this,"maybeCleanupAfterMissingPointerUp",l=>{zc==null||zc(),this.missingPointerEventCleanupEmitter.trigger(l).clear()}),H(this,"handleCanvasPanUsingWheelOrSpaceDrag",l=>{if(!(It.pointers.size<=1&&(l.button===Bl.WHEEL||l.button===Bl.MAIN&&Bc||ch(this.state)||this.state.viewModeEnabled)))return!1;qf=!0,this.focusContainer(),this.state.editingTextElement||l.preventDefault();let h=!1,f=typeof window===void 0?!1:/Linux/.test(window.navigator.platform);$t(this.interactiveCanvas,Ot.GRABBING);let{clientX:g,clientY:U}=l,y=jy(x=>{let w=g-x.clientX,C=U-x.clientY;if(g=x.clientX,U=x.clientY,f&&!h&&(Math.abs(w)>1||Math.abs(C)>1)){h=!0;let S=M=>{document.body.removeEventListener("paste",S),M.stopPropagation()},k=()=>{setTimeout(()=>{document.body.removeEventListener("paste",S),window.removeEventListener("pointerup",k)},100)};document.body.addEventListener("paste",S),window.addEventListener("pointerup",k)}this.translateCanvas({scrollX:this.state.scrollX-w/this.state.zoom.value,scrollY:this.state.scrollY-C/this.state.zoom.value})}),v=wn(zc=()=>{zc=null,qf=!1,Bc||(this.state.viewModeEnabled?$t(this.interactiveCanvas,Ot.GRAB):Ts(this.interactiveCanvas,this.state)),this.setState({cursorButton:"up"}),this.savePointer(l.clientX,l.clientY,"up"),window.removeEventListener("pointermove",y),window.removeEventListener("pointerup",v),window.removeEventListener("blur",v),y.flush()});return window.addEventListener("blur",v),window.addEventListener("pointermove",y,{passive:!0}),window.addEventListener("pointerup",v),!0}),H(this,"clearSelectionIfNotUsingSelection",()=>{this.state.activeTool.type!=="selection"&&this.setState({selectedElementIds:At({},this.state),selectedGroupIds:{},editingGroupId:null,activeEmbeddable:null})}),H(this,"handleSelectionOnPointerDown",(l,h)=>{var f;if(this.state.activeTool.type==="selection"){let g=this.scene.getNonDeletedElements(),U=this.scene.getNonDeletedElementsMap(),y=this.scene.getSelectedElements(this.state);if(y.length===1&&!this.state.editingLinearElement&&!Pe(y[0])&&!(this.state.selectedLinearElement&&this.state.selectedLinearElement.hoverPointIndex!==-1)){let v=CS(g,this.state,h.origin.x,h.origin.y,this.state.zoom,l.pointerType,this.scene.getNonDeletedElementsMap(),this.device);v!=null&&(v.transformHandleType==="rotation"?(this.setState({resizingElement:v.element}),h.resize.handleType=v.transformHandleType):(this.state.croppingElementId||this.setState({resizingElement:v.element}),h.resize.handleType=v.transformHandleType))}else y.length>1&&(h.resize.handleType=SS(Dt(y),h.origin.x,h.origin.y,this.state.zoom,l.pointerType,this.device));if(h.resize.handleType)h.resize.isResizing=!0,h.resize.offset=Ya(pie(h.resize.handleType,y,U,h.origin.x,h.origin.y)),y.length===1&&st(y[0])&&y[0].points.length===2&&(h.resize.arrowDirection=mie(h.resize.handleType,y[0]));else{if(this.state.selectedLinearElement){let w=this.state.editingLinearElement||this.state.selectedLinearElement,C=Re.handlePointerDown(l,this,this.store,h.origin,w,this.scene);if(C.hitElement&&(h.hit.element=C.hitElement),C.linearElementEditor&&(this.setState({selectedLinearElement:C.linearElementEditor}),this.state.editingLinearElement&&this.setState({editingLinearElement:C.linearElementEditor})),C.didAddPoint)return!0}if(h.hit.element=h.hit.element??this.getElementAtPosition(h.origin.x,h.origin.y),this.hitLinkElement=this.getElementLinkAtPosition(h.origin,h.hit.element),this.hitLinkElement)return!0;if(this.state.croppingElementId&&((f=h.hit.element)==null?void 0:f.id)!==this.state.croppingElementId&&this.finishImageCropping(),h.hit.element&&this.getElementLinkAtPosition({x:h.origin.x,y:h.origin.y},h.hit.element))return!1;h.hit.allHitElements=this.getElementsAtPosition(h.origin.x,h.origin.y);let v=h.hit.element,x=h.hit.allHitElements.some(w=>this.isASelectedElement(w));if((v===null||!x)&&!l.shiftKey&&!h.hit.hasHitCommonBoundingBoxOfSelectedElements&&this.clearSelection(v),this.state.editingLinearElement)this.setState({selectedElementIds:At({[this.state.editingLinearElement.elementId]:!0},this.state)});else if(v!=null){if(l[Z.CTRL_OR_CMD])return this.state.selectedElementIds[v.id]||(h.hit.wasAddedToSelection=!0),this.setState(w=>({...rne(w,v),previousSelectedElementIds:this.state.selectedElementIds})),!1;this.state.selectedElementIds[v.id]||(this.state.editingGroupId&&!m1(v,this.state.editingGroupId)&&this.setState({selectedElementIds:At({},this.state),selectedGroupIds:{},editingGroupId:null,activeEmbeddable:null}),!x&&!h.hit.hasHitCommonBoundingBoxOfSelectedElements&&(this.setState(w=>{var k;let C={...w.selectedElementIds,[v.id]:!0},S=[];if(Object.keys(w.selectedElementIds).forEach(M=>{let T=this.scene.getElement(M);T&&S.push(T)}),tt(v))Ks(S,v.id).forEach(M=>{delete C[M.id]});else if(v.frameId)C[v.frameId]&&delete C[v.id];else{let M=v.groupIds,T=new Set(M.flatMap(R=>rn(this.scene.getNonDeletedElements(),R)).filter(R=>tt(R)).map(R=>R.id));T.size>0&&S.forEach(R=>{R.frameId&&T.has(R.frameId)&&(delete C[R.id],R.groupIds.flatMap(j=>rn(this.scene.getNonDeletedElements(),j)).forEach(j=>{delete C[j.id]}))})}return((k=w.openDialog)==null?void 0:k.name)==="elementLinkSelector"&&(v.groupIds.some(M=>w.selectedGroupIds[M])||(C={[v.id]:!0})),{...Wr({editingGroupId:w.editingGroupId,selectedElementIds:C},this.scene.getNonDeletedElements(),w,this),showHyperlinkPopup:v.link||li(v)?"info":!1}}),h.hit.wasAddedToSelection=!0))}this.setState({previousSelectedElementIds:this.state.selectedElementIds})}}return!1}),H(this,"handleTextOnPointerDown",(l,h)=>{if(this.state.editingTextElement)return;let f=h.origin.x,g=h.origin.y,U=this.getElementAtPosition(f,g,{includeBoundTextElement:!0}),y=this.getTextBindableContainerAtPosition(f,g);ma(U)&&(y=U,f=U.x+U.width/2,g=U.y+U.height/2),this.startTextEditing({sceneX:f,sceneY:g,insertAtParentCenter:!l.altKey,container:y,autoEdit:!1}),$a(this.interactiveCanvas),this.state.activeTool.locked||this.setState({activeTool:Pn(this.state,{type:"selection"})})}),H(this,"handleFreeDrawElementOnPointerDown",(l,h,f)=>{let[g,U]=zn(f.origin.x,f.origin.y,null),y=this.getTopLayerFrameAtSceneCoords({x:g,y:U}),v=l.pressure===.5,x=jne({type:h,x:g,y:U,strokeColor:this.state.currentItemStrokeColor,backgroundColor:this.state.currentItemBackgroundColor,fillStyle:this.state.currentItemFillStyle,strokeWidth:this.state.currentItemStrokeWidth,strokeStyle:this.state.currentItemStrokeStyle,roughness:this.state.currentItemRoughness,opacity:this.state.currentItemOpacity,roundness:null,simulatePressure:v,locked:!1,frameId:y?y.id:null,points:[A(0,0)],pressures:v?[]:[l.pressure]});this.scene.insertElement(x),this.setState(C=>{let S={...C.selectedElementIds};return delete S[x.id],{selectedElementIds:At(S,C)}});let w=qa(f.origin,this.scene.getNonDeletedElements(),this.scene.getNonDeletedElementsMap(),this.state.zoom);this.setState({newElement:x,startBoundElement:w,suggestedBindings:[]})}),H(this,"insertIframeElement",({sceneX:l,sceneY:h,width:f,height:g})=>{var x;let[U,y]=zn(l,h,(x=this.lastPointerDownEvent)!=null&&x[Z.CTRL_OR_CMD]?null:this.getEffectiveGridSize()),v=Lne({type:"iframe",x:U,y,strokeColor:"transparent",backgroundColor:"transparent",fillStyle:this.state.currentItemFillStyle,strokeWidth:this.state.currentItemStrokeWidth,strokeStyle:this.state.currentItemStrokeStyle,roughness:this.state.currentItemRoughness,roundness:this.getCurrentItemRoundness("iframe"),opacity:this.state.currentItemOpacity,locked:!1,width:f,height:g});return this.scene.insertElement(v),v}),H(this,"insertEmbeddableElement",({sceneX:l,sceneY:h,link:f})=>{var x;let[g,U]=zn(l,h,(x=this.lastPointerDownEvent)!=null&&x[Z.CTRL_OR_CMD]?null:this.getEffectiveGridSize()),y=Bu(f);if(!y)return;y.error instanceof URIError&&this.setToast({message:D("toast.unrecognizedLinkFormat"),closable:!0});let v=WC({type:"embeddable",x:g,y:U,strokeColor:"transparent",backgroundColor:"transparent",fillStyle:this.state.currentItemFillStyle,strokeWidth:this.state.currentItemStrokeWidth,strokeStyle:this.state.currentItemStrokeStyle,roughness:this.state.currentItemRoughness,roundness:this.getCurrentItemRoundness("embeddable"),opacity:this.state.currentItemOpacity,locked:!1,width:y.intrinsicSize.w,height:y.intrinsicSize.h,link:f});return this.scene.insertElement(v),v}),H(this,"createImageElement",({sceneX:l,sceneY:h,addToFrameUnderCursor:f=!0})=>{var v;let[g,U]=zn(l,h,(v=this.lastPointerDownEvent)!=null&&v[Z.CTRL_OR_CMD]?null:this.getEffectiveGridSize()),y=f?this.getTopLayerFrameAtSceneCoords({x:g,y:U}):null;return dL({type:"image",x:g,y:U,strokeColor:this.state.currentItemStrokeColor,backgroundColor:this.state.currentItemBackgroundColor,fillStyle:this.state.currentItemFillStyle,strokeWidth:this.state.currentItemStrokeWidth,strokeStyle:this.state.currentItemStrokeStyle,roughness:this.state.currentItemRoughness,roundness:null,opacity:this.state.currentItemOpacity,locked:!1,frameId:y?y.id:null})}),H(this,"handleLinearElementOnPointerDown",(l,h,f)=>{if(this.state.multiElement){let{multiElement:g}=this.state;if(g.type==="line"&&qo(g.points,this.state.zoom.value)){me(g,{lastCommittedPoint:g.points[g.points.length-1]}),this.actionManager.executeAction(Oa);return}if(Pe(g)&&g.points.length>1){me(g,{lastCommittedPoint:g.points[g.points.length-1]}),this.actionManager.executeAction(Oa);return}let{x:U,y,lastCommittedPoint:v}=g;if(g.points.length>1&&v&&Rt(A(f.origin.x-U,f.origin.y-y),v)<pg){this.actionManager.executeAction(Oa);return}this.setState(x=>({selectedElementIds:At({...x.selectedElementIds,[g.id]:!0},x)})),me(g,{lastCommittedPoint:g.points[g.points.length-1]}),$t(this.interactiveCanvas,Ot.POINTER)}else{let[g,U]=zn(f.origin.x,f.origin.y,l[Z.CTRL_OR_CMD]?null:this.getEffectiveGridSize()),y=this.getTopLayerFrameAtSceneCoords({x:g,y:U}),{currentItemStartArrowhead:v,currentItemEndArrowhead:x}=this.state,[w,C]=h==="arrow"?[v,x]:[null,null],S=h==="arrow"?$v({type:h,x:g,y:U,strokeColor:this.state.currentItemStrokeColor,backgroundColor:this.state.currentItemBackgroundColor,fillStyle:this.state.currentItemFillStyle,strokeWidth:this.state.currentItemStrokeWidth,strokeStyle:this.state.currentItemStrokeStyle,roughness:this.state.currentItemRoughness,opacity:this.state.currentItemOpacity,roundness:this.state.currentItemArrowType===lr.round?{type:Nn.PROPORTIONAL_RADIUS}:null,startArrowhead:w,endArrowhead:C,locked:!1,frameId:y?y.id:null,elbowed:this.state.currentItemArrowType===lr.elbow,fixedSegments:this.state.currentItemArrowType===lr.elbow?[]:null}):fd({type:h,x:g,y:U,strokeColor:this.state.currentItemStrokeColor,backgroundColor:this.state.currentItemBackgroundColor,fillStyle:this.state.currentItemFillStyle,strokeWidth:this.state.currentItemStrokeWidth,strokeStyle:this.state.currentItemStrokeStyle,roughness:this.state.currentItemRoughness,opacity:this.state.currentItemOpacity,roundness:this.state.currentItemRoundness==="round"?{type:Nn.PROPORTIONAL_RADIUS}:null,locked:!1,frameId:y?y.id:null});this.setState(M=>{let T={...M.selectedElementIds};return delete T[S.id],{selectedElementIds:At(T,M)}}),me(S,{points:[...S.points,A(0,0)]});let k=qa(f.origin,this.scene.getNonDeletedElements(),this.scene.getNonDeletedElementsMap(),this.state.zoom,Pe(S),Pe(S));this.scene.insertElement(S),this.setState({newElement:S,startBoundElement:k,suggestedBindings:[]})}}),H(this,"createGenericElementOnPointerDown",(l,h)=>{var x;let[f,g]=zn(h.origin.x,h.origin.y,(x=this.lastPointerDownEvent)!=null&&x[Z.CTRL_OR_CMD]?null:this.getEffectiveGridSize()),U=this.getTopLayerFrameAtSceneCoords({x:f,y:g}),y={x:f,y:g,strokeColor:this.state.currentItemStrokeColor,backgroundColor:this.state.currentItemBackgroundColor,fillStyle:this.state.currentItemFillStyle,strokeWidth:this.state.currentItemStrokeWidth,strokeStyle:this.state.currentItemStrokeStyle,roughness:this.state.currentItemRoughness,opacity:this.state.currentItemOpacity,roundness:this.getCurrentItemRoundness(l),locked:!1,frameId:U?U.id:null},v;l==="embeddable"?v=WC({type:"embeddable",...y}):v=qs({type:l,...y}),v.type==="selection"?this.setState({selectionElement:v}):(this.scene.insertElement(v),this.setState({multiElement:null,newElement:v}))}),H(this,"createFrameElementOnPointerDown",(l,h)=>{var v;let[f,g]=zn(l.origin.x,l.origin.y,(v=this.lastPointerDownEvent)!=null&&v[Z.CTRL_OR_CMD]?null:this.getEffectiveGridSize()),U={x:f,y:g,opacity:this.state.currentItemOpacity,locked:!1,...Un},y=h===Qn.magicframe?$3(U):Fv(U);this.scene.insertElement(y),this.setState({multiElement:null,newElement:y})}),H(this,"restoreReadyToEraseElements",()=>{this.elementsPendingErasure=new Set,this.triggerRender()}),H(this,"eraseElements",()=>{let l=!1,h=this.scene.getElementsIncludingDeleted().map(f=>this.elementsPendingErasure.has(f.id)||f.frameId&&this.elementsPendingErasure.has(f.frameId)||an(f)&&this.elementsPendingErasure.has(f.containerId)?(l=!0,ct(f,{isDeleted:!0})):f);this.elementsPendingErasure=new Set,l&&(this.store.shouldCaptureIncrement(),this.scene.replaceAllElements(h))}),H(this,"initializeImage",async({imageFile:l,imageElement:h,showCursorImagePreview:f=!1})=>{var x,w,C,S,k;if(!pd(l))throw new Error(D("errors.unsupportedFileType"));let g=l.type;if($t(this.interactiveCanvas,"wait"),g===We.svg)try{l=MS(tS(await l.text()),l.name)}catch(M){throw console.warn(M),new Error(D("errors.svgImageInsertError"))}let U=await(((w=(x=this.props).generateIdForFile)==null?void 0:w.call(x,l))||_ie(l));if(!U)throw console.warn("Couldn't generate file id or the supplied `generateIdForFile` didn't resolve to one."),new Error(D("errors.imageInsertError"));if(!((C=this.files[U])!=null&&C.dataURL)){try{l=await K3(l,{maxWidthOrHeight:oY})}catch(M){console.error("Error trying to resizing image file on insertion",M)}if(l.size>VE)throw new Error(D("errors.fileTooBig",{maxSize:`${Math.trunc(VE/1024/1024)}MB`}))}if(f){let M=(S=this.files[U])==null?void 0:S.dataURL,T=M&&Tie(M);this.setImagePreviewCursor(T||l)}let y=((k=this.files[U])==null?void 0:k.dataURL)||await Z3(l),v=me(h,{fileId:U},!1);return new Promise(async(M,T)=>{var R;try{this.addMissingFiles([{mimeType:g,id:U,dataURL:y,created:Date.now(),lastRetrieved:Date.now()}]);let j=this.imageCache.get(U);j||(this.addNewImagesToImageCache(),await this.updateImageCache([v])),(j==null?void 0:j.image)instanceof Promise&&await j.image,this.state.pendingImageElementId!==v.id&&((R=this.state.newElement)==null?void 0:R.id)!==v.id&&this.initializeImageDimensions(v,!0),M(v)}catch(j){console.error(j),T(new Error(D("errors.imageInsertError")))}finally{f||$a(this.interactiveCanvas)}})}),H(this,"insertImageElement",async(l,h,f)=>{if(!this.isToolSupported("image")){this.setState({errorMessage:D("errors.imageToolNotSupported")});return}this.scene.insertElement(l);try{return await this.initializeImage({imageFile:h,imageElement:l,showCursorImagePreview:f})}catch(g){return me(l,{isDeleted:!0}),this.actionManager.executeAction(Oa),this.setState({errorMessage:g.message||D("errors.imageInsertError")}),null}}),H(this,"setImagePreviewCursor",async l=>{let h;try{h=await K3(l,{maxWidthOrHeight:96})}catch(g){throw g.cause==="UNSUPPORTED"?new Error(D("errors.unsupportedFileType")):g}let f=await Z3(h);if(l.type===We.svg){let g=await yL(f),U=Math.min(g.height,96),y=U*(g.width/g.height);y>96&&(y=96,U=y*(g.height/g.width));let v=document.createElement("canvas");v.height=U,v.width=y,v.getContext("2d").drawImage(g,0,0,y,U),f=v.toDataURL(We.svg)}this.state.pendingImageElementId&&$t(this.interactiveCanvas,`url(${f}) 4 4, auto`)}),H(this,"onImageAction",async({insertOnCanvasDirectly:l})=>{try{let h=this.state.width/2+this.state.offsetLeft,f=this.state.height/2+this.state.offsetTop,{x:g,y:U}=Yt({clientX:h,clientY:f},this.state),y=await zv({description:"Image",extensions:Object.keys(lh)}),v=this.createImageElement({sceneX:g,sceneY:U,addToFrameUnderCursor:!1});l?(this.insertImageElement(v,y),this.initializeImageDimensions(v),this.setState({selectedElementIds:At({[v.id]:!0},this.state)},()=>{this.actionManager.executeAction(Oa)})):this.setState({pendingImageElementId:v.id},()=>{this.insertImageElement(v,y,!0)})}catch(h){h.name!=="AbortError"?console.error(h):console.warn(h),this.setState({pendingImageElementId:null,newElement:null,activeTool:Pn(this.state,{type:"selection"})},()=>{this.actionManager.executeAction(Oa)})}}),H(this,"initializeImageDimensions",(l,h=!1)=>{var g;let f=aa(l)&&((g=this.imageCache.get(l.fileId))==null?void 0:g.image);if(!f||f instanceof Promise){if(l.width<Vc/this.state.zoom.value&&l.height<Vc/this.state.zoom.value){let U=100/this.state.zoom.value;me(l,{x:l.x-U/2,y:l.y-U/2,width:U,height:U})}return}if(h||l.width<Vc/this.state.zoom.value&&l.height<Vc/this.state.zoom.value){let U=Math.max(this.state.height-120,160),y=Math.min(U,Math.floor(this.state.height*.5)/this.state.zoom.value),v=Math.min(f.naturalHeight,y),x=v*(f.naturalWidth/f.naturalHeight),w=l.x+l.width/2-x/2,C=l.y+l.height/2-v/2;me(l,{x:w,y:C,width:x,height:v,crop:null})}}),H(this,"updateImageCache",async(l,h=this.files)=>{let{updatedFiles:f,erroredFiles:g}=await vL({imageCache:this.imageCache,fileIds:l.map(U=>U.fileId),files:h});if(f.size||g.size)for(let U of l)f.has(U.fileId)&&yn.delete(U);return g.size&&this.scene.replaceAllElements(this.scene.getElementsIncludingDeleted().map(U=>aa(U)&&g.has(U.fileId)?ct(U,{status:"error"}):U)),{updatedFiles:f,erroredFiles:g}}),H(this,"addNewImagesToImageCache",async(l=xL(this.scene.getNonDeletedElements()),h=this.files)=>{let f=l.filter(g=>!g.isDeleted&&!this.imageCache.has(g.fileId));if(f.length){let{updatedFiles:g}=await this.updateImageCache(f,h);g.size&&this.scene.triggerUpdate()}}),H(this,"scheduleImageRefresh",F1(()=>{this.addNewImagesToImageCache()},QV)),H(this,"updateBindingEnabledOnPointerMove",l=>{let h=Lte(l);this.state.isBindingEnabled!==h&&this.setState({isBindingEnabled:h})}),H(this,"maybeSuggestBindingAtCursor",(l,h)=>{let f=qa(l,this.scene.getNonDeletedElements(),this.scene.getNonDeletedElementsMap(),this.state.zoom,!1,h);this.setState({suggestedBindings:f!=null?[f]:[]})}),H(this,"maybeSuggestBindingsForLinearElementAtCoords",(l,h,f)=>{if(!h.length)return;let g=h.reduce((U,y)=>{let v=qa(y,this.scene.getNonDeletedElements(),this.scene.getNonDeletedElementsMap(),this.state.zoom,Pe(l),Pe(l));return v!=null&&!BA(l,f==null?void 0:f.id,v)&&U.push(v),U},[]);this.setState({suggestedBindings:g})}),H(this,"handleInteractiveCanvasRef",l=>{var h,f;l!==null?(this.interactiveCanvas=l,this.interactiveCanvas.addEventListener("touchstart",this.onTouchStart,{passive:!1}),this.interactiveCanvas.addEventListener("touchend",this.onTouchEnd)):((h=this.interactiveCanvas)==null||h.removeEventListener("touchstart",this.onTouchStart),(f=this.interactiveCanvas)==null||f.removeEventListener("touchend",this.onTouchEnd))}),H(this,"handleAppOnDrop",async l=>{var v,x,w,C;let{file:h,fileHandle:f}=await Aie(l),{x:g,y:U}=Yt(l,this.state);try{if(pd(h)&&this.isToolSupported("image")){if((h==null?void 0:h.type)===We.png||(h==null?void 0:h.type)===We.svg)try{let k=await b7(h,this.state,this.scene.getElementsIncludingDeleted(),f);this.syncActionResult({...k,appState:{...k.appState||this.state,isLoading:!1},replaceFiles:!0,captureUpdate:le.IMMEDIATELY});return}catch(k){if(k.name!=="EncodingError")throw new Error(D("alerts.couldNotLoadInvalidFile"))}let S=this.createImageElement({sceneX:g,sceneY:U});this.insertImageElement(S,h),this.initializeImageDimensions(S),this.setState({selectedElementIds:At({[S.id]:!0},this.state)});return}}catch(S){return this.setState({isLoading:!1,errorMessage:S.message})}let y=l.dataTransfer.getData(We.excalidrawlib);if(y&&typeof y=="string"){try{let S=lR(y);this.addElementsFromPasteOrLibrary({elements:mP(S),position:l,files:null})}catch(S){this.setState({errorMessage:S.message})}return}if(h&&await this.loadFileToCanvas(h,f),(x=(v=l.dataTransfer)==null?void 0:v.types)==null?void 0:x.includes("text/plain")){let S=(w=l.dataTransfer)==null?void 0:w.getData("text");if(S&&Eg(S,this.props.validateEmbeddable)&&(/^(http|https):\/\/[^\s/$.?#].[^\s]*$/.test(S)||((C=Bu(S))==null?void 0:C.type)==="video")){let k=this.insertEmbeddableElement({sceneX:g,sceneY:U,link:Ui(S)});k&&this.setState({selectedElementIds:{[k.id]:!0}})}}}),H(this,"loadFileToCanvas",async(l,h)=>{l=await y7(l);try{let f=this.scene.getElementsIncludingDeleted(),g;try{g=await U7(l,this.state,f,h)}catch(U){let y=U instanceof rd;if(y&&U.code==="IMAGE_NOT_CONTAINS_SCENE_DATA"&&!this.isToolSupported("image")){this.setState({isLoading:!1,errorMessage:D("errors.imageToolNotSupported")});return}let v=D(y?"alerts.cannotRestoreFromImage":"alerts.couldNotLoadInvalidFile");this.setState({isLoading:!1,errorMessage:v})}if(!g)return;g.type===We.excalidraw?(Jo(f.concat(g.data.elements)),this.store.updateSnapshot(nt(f),this.state),this.setState({isLoading:!0}),this.syncActionResult({...g.data,appState:{...g.data.appState||this.state,isLoading:!1},replaceFiles:!0,captureUpdate:le.IMMEDIATELY})):g.type===We.excalidrawlib&&await this.library.updateLibrary({libraryItems:l,merge:!0,openLibraryMenu:!0}).catch(U=>{console.error(U),this.setState({errorMessage:D("errors.importLibraryError")})})}catch(f){this.setState({isLoading:!1,errorMessage:f.message})}}),H(this,"handleCanvasContextMenu",l=>{if(l.preventDefault(),("pointerType"in l.nativeEvent&&l.nativeEvent.pointerType==="touch"||"pointerType"in l.nativeEvent&&l.nativeEvent.pointerType==="pen"&&l.button!==Bl.SECONDARY)&&this.state.activeTool.type!=="selection")return;let{x:h,y:f}=Yt(l,this.state),g=this.getElementAtPosition(h,f,{preferSelected:!0,includeLockedElements:!0}),U=this.scene.getSelectedElements(this.state),y=this.isHittingCommonBoundingBoxOfSelectedElements({x:h,y:f},U),v=g||y?"element":"canvas",x=this.excalidrawContainerRef.current,{top:w,left:C}=x.getBoundingClientRect(),S=l.clientX-C,k=l.clientY-w;Jt("contextMenu","openContextMenu",v),this.setState({...g&&!this.state.selectedElementIds[g.id]?{...this.state,...Wr({editingGroupId:this.state.editingGroupId,selectedElementIds:{[g.id]:!0}},this.scene.getNonDeletedElements(),this.state,this),selectedLinearElement:st(g)?new Re(g):null}:this.state,showHyperlinkPopup:!1},()=>{this.setState({contextMenu:{top:k,left:S,items:this.getContextMenuItems(v)}})})}),H(this,"maybeDragNewGenericElement",(l,h,f=!0)=>{var M,T,R;let g=this.state.selectionElement,U=l.lastCoords;if(g&&this.state.activeTool.type!=="eraser"){TS({newElement:g,elementType:this.state.activeTool.type,originX:l.origin.x,originY:l.origin.y,x:U.x,y:U.y,width:Mr(l.origin.x,U.x),height:Mr(l.origin.y,U.y),shouldMaintainAspectRatio:Bf(h),shouldResizeFromCenter:Kb(h),zoom:this.state.zoom.value,informMutation:f});return}let y=this.state.newElement;if(!y)return;let[v,x]=zn(U.x,U.y,h[Z.CTRL_OR_CMD]?null:this.getEffectiveGridSize()),w=aa(y)&&((M=this.imageCache.get(y.fileId))==null?void 0:M.image),C=w&&!(w instanceof Promise)?w.width/w.height:null;this.maybeCacheReferenceSnapPoints(h,[y]);let{snapOffset:S,snapLines:k}=gne(y,this,h,{x:l.originInGrid.x+(((T=this.state.originSnapOffset)==null?void 0:T.x)??0),y:l.originInGrid.y+(((R=this.state.originSnapOffset)==null?void 0:R.y)??0)},{x:v-l.originInGrid.x,y:x-l.originInGrid.y},this.scene.getNonDeletedElementsMap());v+=S.x,x+=S.y,this.setState({snapLines:k}),TS({newElement:y,elementType:this.state.activeTool.type,originX:l.originInGrid.x,originY:l.originInGrid.y,x:v,y:x,width:Mr(l.originInGrid.x,v),height:Mr(l.originInGrid.y,x),shouldMaintainAspectRatio:Lt(y)?!Bf(h):Bf(h),shouldResizeFromCenter:Kb(h),zoom:this.state.zoom.value,widthAspectRatio:C,originOffset:this.state.originSnapOffset,informMutation:f}),this.setState({newElement:y}),(this.state.activeTool.type===Qn.frame||this.state.activeTool.type===Qn.magicframe)&&this.setState({elementsToHighlight:Sg(this.scene.getNonDeletedElements(),y,this.state,this.scene.getNonDeletedElementsMap())})}),H(this,"maybeHandleCrop",(l,h)=>{var x;if(!this.state.croppingElementId)return!1;let f=l.resize.handleType,g=l.lastCoords,[U,y]=zn(g.x-l.resize.offset.x,g.y-l.resize.offset.y,h[Z.CTRL_OR_CMD]?null:this.getEffectiveGridSize()),v=this.scene.getNonDeletedElementsMap().get(this.state.croppingElementId);if(f&&v&&Lt(v)){let w=l.originalElements.get(v.id),C=aa(v)&&((x=this.imageCache.get(v.fileId))==null?void 0:x.image);if(w&&Lt(w)&&C&&!(C instanceof Promise)){let[S,k]=zn(g.x,g.y,h[Z.CTRL_OR_CMD]?null:this.getEffectiveGridSize()),M={x:S-l.originInGrid.x,y:k-l.originInGrid.y};this.maybeCacheReferenceSnapPoints(h,[v]);let{snapOffset:T,snapLines:R}=zC([v],[w],this,h,M,f);me(v,nte(v,f,C.naturalWidth,C.naturalHeight,U+T.x,y+T.y,h.shiftKey?w.width/w.height:void 0)),gi(v,this.scene.getNonDeletedElementsMap(),{newSize:{width:v.width,height:v.height}}),this.setState({isCropping:f&&f!=="rotation",snapLines:R})}return!0}return!1}),H(this,"maybeHandleResize",(l,h)=>{let f=this.scene.getSelectedElements(this.state),g=f.filter(C=>tt(C)),U=l.resize.handleType;if(g.length>0&&U==="rotation"||f.length===1&&Pe(f[0])||this.state.croppingElementId)return!1;this.setState({isResizing:U&&U!=="rotation",isRotating:U==="rotation",activeEmbeddable:null});let y=l.lastCoords,[v,x]=zn(y.x-l.resize.offset.x,y.y-l.resize.offset.y,h[Z.CTRL_OR_CMD]?null:this.getEffectiveGridSize()),w=new Map;if(g.forEach(C=>{Ks(this.scene.getNonDeletedElements(),C.id).forEach(S=>{w.set(C.id+S.id,{x:S.x-C.x,y:S.y-C.y})})}),!this.state.selectedElementsAreBeingDragged){let[C,S]=zn(y.x,y.y,h[Z.CTRL_OR_CMD]?null:this.getEffectiveGridSize()),k={x:C-l.originInGrid.x,y:S-l.originInGrid.y},M=[...l.originalElements.values()];this.maybeCacheReferenceSnapPoints(h,f);let{snapOffset:T,snapLines:R}=zC(f,gt(M,this.state),this,h,k,U);v+=T.x,x+=T.y,this.setState({snapLines:R})}if(die(l.originalElements,U,f,this.scene.getElementsMapIncludingDeleted(),this.scene,Lp(h),Kb(h),f.some(C=>Lt(C))?!Bf(h):Bf(h),v,x,l.resize.center.x,l.resize.center.y)){let C=Jb(f,this.scene.getNonDeletedElementsMap(),this.state.zoom),S=new Set;return g.forEach(k=>{Sg(this.scene.getNonDeletedElements(),k,this.state,this.scene.getNonDeletedElementsMap()).forEach(M=>S.add(M))}),this.setState({elementsToHighlight:[...S],suggestedBindings:C}),!0}return!1}),H(this,"getContextMenuItems",l=>{let h=[];return h.push(B_,$_),l==="canvas"?this.state.viewModeEnabled?[...h,H_,y8,wk,v8]:[O_,Zn,B_,$_,z_,Zn,Oce,iue,Zn,H_,Xde,y8,wk,v8]:(h.push(z_),this.state.viewModeEnabled?[Rg,...h]:[Zn,F_,Rg,O_,Zn,_pe,kpe,Tpe,Zn,vhe,Zn,...h,Zn,Ide,Ade,Zn,Rde,f1e,Vde,Yde,Zde,Dde,Zn,Ode,Zn,Dce,jce,Pce,Nce,Zn,zde,Hde,Zn,yhe,Zn,uP,TP,Zn,zce,rue,Zn,Rj])}),H(this,"handleWheel",wn(l=>{if(!(l.target instanceof HTMLCanvasElement||l.target instanceof HTMLTextAreaElement||l.target instanceof HTMLIFrameElement)){l[Z.CTRL_OR_CMD]&&l.preventDefault();return}if(l.preventDefault(),qf)return;let{deltaX:h,deltaY:f}=l;if(l.metaKey||l.ctrlKey){let g=Math.sign(f),U=yU*100,y=Math.abs(f),v=f;y>U&&(v=U*g);let x=this.state.zoom.value-v/100;x+=Math.log10(Math.max(1,this.state.zoom.value))*-g*Math.min(1,y/20),this.translateCanvas(w=>({...sd({viewportX:this.lastViewportPosition.x,viewportY:this.lastViewportPosition.y,nextZoom:zo(x)},w),shouldCacheIgnoreZoom:!0})),this.resetShouldCacheIgnoreZoomDebounced();return}if(l.shiftKey){this.translateCanvas(({zoom:g,scrollX:U})=>({scrollX:U-(f||h)/g.value}));return}this.translateCanvas(({zoom:g,scrollX:U,scrollY:y})=>({scrollX:U-h/g.value,scrollY:y-f/g.value}))})),H(this,"savePointer",(l,h,f)=>{var v,x;if(!l||!h)return;let{x:g,y:U}=Yt({clientX:l,clientY:h},this.state),y={x:g,y:U,tool:this.state.activeTool.type==="laser"?"laser":"pointer"};(x=(v=this.props).onPointerUpdate)==null||x.call(v,{pointer:y,button:f,pointersMap:It.pointers})}),H(this,"resetShouldCacheIgnoreZoomDebounced",uh(()=>{this.unmounted||this.setState({shouldCacheIgnoreZoom:!1})},300)),H(this,"updateDOMRect",l=>{var h;if((h=this.excalidrawContainerRef)!=null&&h.current){let f=this.excalidrawContainerRef.current,{width:g,height:U,left:y,top:v}=f.getBoundingClientRect(),{width:x,height:w,offsetTop:C,offsetLeft:S}=this.state;if(g===x&&U===w&&y===S&&v===C){l&&l();return}this.setState({width:g,height:U,offsetLeft:y,offsetTop:v},()=>{l&&l()})}}),H(this,"refresh",()=>{this.setState({...this.getCanvasOffsets()})});let n=Vs(),{excalidrawAPI:r,viewModeEnabled:i=!1,zenModeEnabled:a=!1,gridModeEnabled:s=!1,objectsSnapModeEnabled:o=!1,theme:c=n.theme,name:d=`${D("labels.untitled")}-${QE()}`}=t;if(this.state={...n,theme:c,isLoading:!0,...this.getCanvasOffsets(),viewModeEnabled:i,zenModeEnabled:a,objectsSnapModeEnabled:o,gridModeEnabled:s??n.gridModeEnabled,name:d,width:window.innerWidth,height:window.innerHeight},this.id=sv(),this.library=new fue(this),this.actionManager=new Che(this.syncActionResult,()=>this.state,()=>this.scene.getElementsIncludingDeleted(),this),this.scene=new el,this.canvas=document.createElement("canvas"),this.rc=vc.canvas(this.canvas),this.renderer=new Mk(this.scene),this.visibleElements=[],this.store=new Bne,this.history=new J_,r){let l={updateScene:this.updateScene,updateLibrary:this.library.updateLibrary,addFiles:this.addFiles,resetScene:this.resetScene,getSceneElementsIncludingDeleted:this.getSceneElementsIncludingDeleted,history:{clear:this.resetHistory},scrollToContent:this.scrollToContent,getSceneElements:this.getSceneElements,getAppState:()=>this.state,getFiles:()=>this.files,getName:this.getName,registerAction:h=>{this.actionManager.registerAction(h)},refresh:this.refresh,setToast:this.setToast,id:this.id,setActiveTool:this.setActiveTool,setCursor:this.setCursor,resetCursor:this.resetCursor,updateFrameRendering:this.updateFrameRendering,toggleSidebar:this.toggleSidebar,onChange:h=>this.onChangeEmitter.on(h),onPointerDown:h=>this.onPointerDownEmitter.on(h),onPointerUp:h=>this.onPointerUpEmitter.on(h),onScrollChange:h=>this.onScrollChangeEmitter.on(h),onUserFollow:h=>this.onUserFollowEmitter.on(h)};typeof r=="function"?r(l):console.error("excalidrawAPI should be a function!")}this.excalidrawContainerValue={container:this.excalidrawContainerRef.current,id:this.id},this.fonts=new Wo(this.scene),this.history=new J_,this.actionManager.registerAll(F3),this.actionManager.registerAction(whe(this.history,this.store)),this.actionManager.registerAction(Ehe(this.history,this.store))}onWindowMessage(t){if(t.origin!=="https://player.vimeo.com"&&t.origin!=="https://www.youtube.com")return;let n=null;try{n=JSON.parse(t.data)}catch{}if(n)switch(t.origin){case"https://player.vimeo.com":if(n.method==="paused"){let r=null,i=document.body.querySelectorAll("iframe.excalidraw__embeddable");if(!i)break;for(let a of i)a.contentWindow===t.source&&(r=a.contentWindow);r==null||r.postMessage(JSON.stringify({method:n.value?"play":"pause",value:!0}),"*")}break;case"https://www.youtube.com":if(n.event==="infoDelivery"&&n.info&&n.id&&typeof n.info.playerState=="number"){let r=n.id,i=n.info.playerState;Object.values(Tm).includes(i)&&zy.set(r,i)}break}}cacheEmbeddableRef(t,n){n&&this.iFrameRefs.set(t.id,n)}getHTMLIFrameElement(t){return this.iFrameRefs.get(t.id)}handleEmbeddableCenterClick(t){var r,i,a,s;if(((r=this.state.activeEmbeddable)==null?void 0:r.element)===t&&((i=this.state.activeEmbeddable)==null?void 0:i.state)==="active"||(setTimeout(()=>{this.setState({activeEmbeddable:{element:t,state:"active"},selectedElementIds:{[t.id]:!0},newElement:null,selectionElement:null})},100),Yl(t)))return;let n=this.getHTMLIFrameElement(t);if(n!=null&&n.contentWindow){if(n.src.includes("youtube")){let o=zy.get(t.id);switch(o||(zy.set(t.id,Tm.UNSTARTED),n.contentWindow.postMessage(JSON.stringify({event:"listening",id:t.id}),"*")),o){case Tm.PLAYING:case Tm.BUFFERING:(a=n.contentWindow)==null||a.postMessage(JSON.stringify({event:"command",func:"pauseVideo",args:""}),"*");break;default:(s=n.contentWindow)==null||s.postMessage(JSON.stringify({event:"command",func:"playVideo",args:""}),"*")}}n.src.includes("player.vimeo.com")&&n.contentWindow.postMessage(JSON.stringify({method:"paused"}),"*")}}isIframeLikeElementCenter(t,n,r,i){var a,s;return t&&!n.altKey&&!n.shiftKey&&!n.metaKey&&!n.ctrlKey&&(((a=this.state.activeEmbeddable)==null?void 0:a.element)!==t||((s=this.state.activeEmbeddable)==null?void 0:s.state)==="hover"||!this.state.activeEmbeddable)&&r>=t.x+t.width/3&&r<=t.x+2*t.width/3&&i>=t.y+t.height/3&&i<=t.y+2*t.height/3}renderEmbeddables(){let t=this.state.zoom.value,n=this.state.width,r=this.state.height,i=this.scene.getNonDeletedElements().filter(a=>li(a)&&this.embedsValidationStatus.get(a.id)===!0||Yl(a));return m.jsx(m.Fragment,{children:i.map(a=>{var g,U,y,v,x,w,C,S,k;let{x:s,y:o}=oa({sceneX:a.x,sceneY:a.y},this.state),c=_2(a,n,r,this.state,this.scene.getNonDeletedElementsMap()),d=this.initializedEmbeds.has(a.id);if(c&&!d&&this.initializedEmbeds.add(a.id),!(c||d))return null;let l;if(Yl(a)){l=null;let M=(((g=a.customData)==null?void 0:g.generationData)??this.magicGenerations.get(a.id))||{status:"error",message:"No generation data",code:"ERR_NO_GENERATION_DATA"};if(M.status==="done"){let T=M.html;l={intrinsicSize:{w:a.width,h:a.height},type:"document",srcdoc:()=>T}}else if(M.status==="pending")l={intrinsicSize:{w:a.width,h:a.height},type:"document",srcdoc:()=>Rp(`
161
- <style>
162
- html, body {
163
- width: 100%;
164
- height: 100%;
165
- color: ${this.state.theme===wt.DARK?"white":"black"};
166
- }
167
- body {
168
- display: flex;
169
- align-items: center;
170
- justify-content: center;
171
- flex-direction: column;
172
- gap: 1rem;
173
- }
174
-
175
- .Spinner {
176
- display: flex;
177
- align-items: center;
178
- justify-content: center;
179
- margin-left: auto;
180
- margin-right: auto;
181
- }
182
-
183
- .Spinner svg {
184
- animation: rotate 1.6s linear infinite;
185
- transform-origin: center center;
186
- width: 40px;
187
- height: 40px;
188
- }
189
-
190
- .Spinner circle {
191
- stroke: currentColor;
192
- animation: dash 1.6s linear 0s infinite;
193
- stroke-linecap: round;
194
- }
195
-
196
- @keyframes rotate {
197
- 100% {
198
- transform: rotate(360deg);
199
- }
200
- }
201
-
202
- @keyframes dash {
203
- 0% {
204
- stroke-dasharray: 1, 300;
205
- stroke-dashoffset: 0;
206
- }
207
- 50% {
208
- stroke-dasharray: 150, 300;
209
- stroke-dashoffset: -200;
210
- }
211
- 100% {
212
- stroke-dasharray: 1, 300;
213
- stroke-dashoffset: -280;
214
- }
215
- }
216
- </style>
217
- <div class="Spinner">
218
- <svg
219
- viewBox="0 0 100 100"
220
- >
221
- <circle
222
- cx="50"
223
- cy="50"
224
- r="46"
225
- stroke-width="8"
226
- fill="none"
227
- stroke-miter-limit="10"
228
- />
229
- </svg>
230
- </div>
231
- <div>Generating...</div>
232
- `)};else{let T;M.code==="ERR_GENERATION_INTERRUPTED"?T="Generation was interrupted...":T=M.message||"Generation failed",l={intrinsicSize:{w:a.width,h:a.height},type:"document",srcdoc:()=>Rp(`
233
- <style>
234
- html, body {
235
- height: 100%;
236
- }
237
- body {
238
- display: flex;
239
- flex-direction: column;
240
- align-items: center;
241
- justify-content: center;
242
- color: ${yt.red[3]};
243
- }
244
- h1, h3 {
245
- margin-top: 0;
246
- margin-bottom: 0.5rem;
247
- }
248
- </style>
249
- <h1>Error!</h1>
250
- <h3>${T}</h3>
251
- `)}}}else l=Bu(iL(a.link||""));let h=((U=this.state.activeEmbeddable)==null?void 0:U.element)===a&&((y=this.state.activeEmbeddable)==null?void 0:y.state)==="active",f=((v=this.state.activeEmbeddable)==null?void 0:v.element)===a&&((x=this.state.activeEmbeddable)==null?void 0:x.state)==="hover";return m.jsx("div",{className:Fe("excalidraw__embeddable-container",{"is-hovered":f}),style:{transform:c?`translate(${s-this.state.offsetLeft}px, ${o-this.state.offsetTop}px) scale(${t})`:"none",display:c?"block":"none",opacity:TA(a,bi(a,this.scene.getNonDeletedElementsMap()),this.elementsPendingErasure,null,((w=this.state.openDialog)==null?void 0:w.name)==="elementLinkSelector"?wI:1),"--embeddable-radius":`${Ja(Math.min(a.width,a.height),a)}px`},children:m.jsxs("div",{className:"excalidraw__embeddable-container__inner",style:{width:c?`${a.width}px`:0,height:c?`${a.height}px`:0,transform:c?`rotate(${a.angle}rad)`:"none",pointerEvents:h?xu.enabled:xu.disabled},children:[f&&m.jsx("div",{className:"excalidraw__embeddable-hint",children:D("buttons.embeddableInteractionButton")}),m.jsx("div",{className:"excalidraw__embeddable__outer",style:{padding:`${a.strokeWidth}px`},children:(li(a)?(S=(C=this.props).renderEmbeddable)==null?void 0:S.call(C,a,this.state):null)??m.jsx("iframe",{ref:M=>this.cacheEmbeddableRef(a,M),className:"excalidraw__embeddable",srcDoc:(l==null?void 0:l.type)==="document"?l.srcdoc(this.state.theme):void 0,src:(l==null?void 0:l.type)!=="document"?(l==null?void 0:l.link)??"":void 0,scrolling:"no",referrerPolicy:"no-referrer-when-downgrade",title:"Excalidraw Embedded Content",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,sandbox:`${(k=l==null?void 0:l.sandbox)!=null&&k.allowSameOrigin?"allow-same-origin":""} allow-scripts allow-forms allow-popups allow-popups-to-escape-sandbox allow-presentation allow-downloads`})})]})},a.id)})})}toggleOverscrollBehavior(t){document.documentElement.style.overscrollBehaviorX=t.type==="pointerenter"?"none":"auto"}render(){var l,h,f,g,U,y,v,x;let t=this.scene.getSelectedElements(this.state),{renderTopRightUI:n,renderCustomStats:r}=this.props,i=this.scene.getSceneNonce(),{elementsMap:a,visibleElements:s}=this.renderer.getRenderableElements({sceneNonce:i,zoom:this.state.zoom,offsetLeft:this.state.offsetLeft,offsetTop:this.state.offsetTop,scrollX:this.state.scrollX,scrollY:this.state.scrollY,height:this.state.height,width:this.state.width,editingTextElement:this.state.editingTextElement,newElementId:(l=this.state.newElement)==null?void 0:l.id,pendingImageElementId:this.state.pendingImageElementId});this.visibleElements=s;let o=this.scene.getNonDeletedElementsMap(),c="setPointerCapture"in HTMLElement.prototype?!1:this.state.selectionElement||this.state.newElement||this.state.selectedElementsAreBeingDragged||this.state.resizingElement||this.state.activeTool.type==="laser"&&this.state.cursorButton==="down",d=t[0];return m.jsx("div",{className:Fe("excalidraw excalidraw-container",{"excalidraw--view-mode":this.state.viewModeEnabled||((h=this.state.openDialog)==null?void 0:h.name)==="elementLinkSelector","excalidraw--mobile":this.device.editor.isMobile}),style:{"--ui-pointerEvents":c?xu.disabled:xu.enabled,"--right-sidebar-width":"302px"},ref:this.excalidrawContainerRef,onDrop:this.handleAppOnDrop,tabIndex:0,onKeyDown:this.props.handleKeyboardGlobally?void 0:this.onKeyDown,onPointerEnter:this.toggleOverscrollBehavior,onPointerLeave:this.toggleOverscrollBehavior,children:m.jsx(AN.Provider,{value:this,children:m.jsx(LN.Provider,{value:this.props,children:m.jsx(nx.Provider,{value:this.excalidrawContainerValue,children:m.jsx(tx.Provider,{value:this.device,children:m.jsx(ax.Provider,{value:this.setAppState,children:m.jsx(ix.Provider,{value:this.state,children:m.jsxs(rx.Provider,{value:this.scene.getNonDeletedElements(),children:[m.jsxs(sx.Provider,{value:this.actionManager,children:[m.jsx(Epe,{canvas:this.canvas,appState:this.state,files:this.files,setAppState:this.setAppState,actionManager:this.actionManager,elements:this.scene.getNonDeletedElements(),onLockToggle:this.toggleLock,onPenModeToggle:this.togglePenMode,onHandToolToggle:this.onHandToolToggle,langCode:E1().code,renderTopRightUI:n,renderCustomStats:r,showExitZenModeBtn:typeof((f=this.props)==null?void 0:f.zenModeEnabled)>"u"&&this.state.zenModeEnabled,UIOptions:this.props.UIOptions,onExportImage:this.onExportImage,renderWelcomeScreen:!this.state.isLoading&&this.state.showWelcomeScreen&&this.state.activeTool.type==="selection"&&!this.state.zenModeEnabled&&!this.scene.getElementsIncludingDeleted().length,app:this,isCollaborating:this.props.isCollaborating,generateLinkForSelection:this.props.generateLinkForSelection,children:this.props.children}),m.jsx("div",{className:"excalidraw-textEditorContainer"}),m.jsx("div",{className:"excalidraw-contextMenuContainer"}),m.jsx("div",{className:"excalidraw-eye-dropper-container"}),m.jsx(r1e,{trails:[this.laserTrails,this.eraserTrail]}),t.length===1&&((g=this.state.openDialog)==null?void 0:g.name)!=="elementLinkSelector"&&this.state.showHyperlinkPopup&&m.jsx(Jde,{element:d,elementsMap:o,setAppState:this.setAppState,onLinkOpen:this.props.onLinkOpen,setToast:this.setToast,updateEmbedValidationStatus:this.updateEmbedValidationStatus},d.id),this.props.aiEnabled!==!1&&t.length===1&&Ug(d)&&m.jsx(Ik,{element:d,elementsMap:a,children:m.jsx(Oy,{title:D("labels.convertToCode"),icon:rA,checked:!1,onChange:()=>this.onMagicFrameGenerate(d,"button")})}),t.length===1&&Yl(d)&&((y=(U=d.customData)==null?void 0:U.generationData)==null?void 0:y.status)==="done"&&m.jsxs(Ik,{element:d,elementsMap:a,children:[m.jsx(Oy,{title:D("labels.copySource"),icon:_v,checked:!1,onChange:()=>this.onIframeSrcCopy(d)}),m.jsx(Oy,{title:"Enter fullscreen",icon:Iq,checked:!1,onChange:()=>{let w=this.getHTMLIFrameElement(d);if(w)try{w.requestFullscreen(),this.setState({activeEmbeddable:{element:d,state:"active"},selectedElementIds:{[d.id]:!0},newElement:null,selectionElement:null})}catch(C){console.warn(C),this.setState({errorMessage:"Couldn't enter fullscreen"})}}})]}),this.state.toast!==null&&m.jsx(Spe,{message:this.state.toast.message,onClose:()=>this.setToast(null),duration:this.state.toast.duration,closable:this.state.toast.closable}),this.state.contextMenu&&m.jsx(_he,{items:this.state.contextMenu.items,top:this.state.contextMenu.top,left:this.state.contextMenu.left,actionManager:this.actionManager,onClose:w=>{this.setState({contextMenu:null},()=>{this.focusContainer(),w==null||w()})}}),m.jsx(n1e,{canvas:this.canvas,rc:this.rc,elementsMap:a,allElementsMap:o,visibleElements:s,sceneNonce:i,selectionNonce:(v=this.state.selectionElement)==null?void 0:v.versionNonce,scale:window.devicePixelRatio,appState:this.state,renderConfig:{imageCache:this.imageCache,isExporting:!1,renderGrid:g1(this),canvasBackgroundColor:this.state.viewBackgroundColor,embedsValidationStatus:this.embedsValidationStatus,elementsPendingErasure:this.elementsPendingErasure,pendingFlowchartNodes:this.flowChartCreator.pendingNodes}}),this.state.newElement&&m.jsx(b1e,{appState:this.state,scale:window.devicePixelRatio,rc:this.rc,elementsMap:a,allElementsMap:o,renderConfig:{imageCache:this.imageCache,isExporting:!1,renderGrid:!1,canvasBackgroundColor:this.state.viewBackgroundColor,embedsValidationStatus:this.embedsValidationStatus,elementsPendingErasure:this.elementsPendingErasure,pendingFlowchartNodes:null}}),m.jsx(Jpe,{containerRef:this.excalidrawContainerRef,canvas:this.interactiveCanvas,elementsMap:a,visibleElements:s,allElementsMap:o,selectedElements:t,sceneNonce:i,selectionNonce:(x=this.state.selectionElement)==null?void 0:x.versionNonce,scale:window.devicePixelRatio,appState:this.state,device:this.device,renderInteractiveSceneCallback:this.renderInteractiveSceneCallback,handleCanvasRef:this.handleInteractiveCanvasRef,onContextMenu:this.handleCanvasContextMenu,onPointerMove:this.handleCanvasPointerMove,onPointerUp:this.handleCanvasPointerUp,onPointerCancel:this.removePointer,onTouchMove:this.handleTouchMove,onPointerDown:this.handleCanvasPointerDown,onDoubleClick:this.handleCanvasDoubleClick}),this.state.userToFollow&&m.jsx(l1e,{width:this.state.width,height:this.state.height,userToFollow:this.state.userToFollow,onDisconnect:this.maybeUnfollowRemoteUser}),this.renderFrameNames()]}),this.renderEmbeddables()]})})})})})})})})}setPlugins(t){Object.assign(this.plugins,t)}async onMagicFrameGenerate(t,n){var s;let r=(s=this.plugins.diagramToCode)==null?void 0:s.generate;if(!r){this.setState({errorMessage:"No diagram to code plugin found"});return}let i=l7(this.scene.getNonDeletedElements(),t).filter(o=>!Ug(o));if(!i.length){n==="button"?(this.setState({errorMessage:"Cannot generate from an empty frame"}),Jt("ai","generate (no-children)","d2c")):this.setActiveTool({type:"magicframe"});return}let a=this.insertIframeElement({sceneX:t.x+t.width+30,sceneY:t.y,width:t.width,height:t.height});if(a){this.updateMagicGeneration({frameElement:a,data:{status:"pending"}}),this.setState({selectedElementIds:{[a.id]:!0}}),Jt("ai","generate (start)","d2c");try{let{html:o}=await r({frame:t,children:i});if(Jt("ai","generate (success)","d2c"),!o.trim()){this.updateMagicGeneration({frameElement:a,data:{status:"error",code:"ERR_OAI",message:"Nothing genereated :("}});return}let c=o.includes("<!DOCTYPE html>")&&o.includes("</html>")?o.slice(o.indexOf("<!DOCTYPE html>"),o.indexOf("</html>")+7):o;this.updateMagicGeneration({frameElement:a,data:{status:"done",html:c}})}catch(o){Jt("ai","generate (failed)","d2c"),this.updateMagicGeneration({frameElement:a,data:{status:"error",code:"ERR_OAI",message:o.message||"Unknown error during generation"}})}}}onIframeSrcCopy(t){var n,r;((r=(n=t.customData)==null?void 0:n.generationData)==null?void 0:r.status)==="done"&&(K1(t.customData.generationData.html),this.setToast({message:"copied to clipboard",closable:!1,duration:1500}))}clearImageShapeCache(t){let n=t??this.files;this.scene.getNonDeletedElements().forEach(r=>{aa(r)&&n[r.fileId]&&(this.imageCache.delete(r.fileId),yn.delete(r))})}async componentDidMount(){var t;this.unmounted=!1,this.excalidrawContainerValue.container=this.excalidrawContainerRef.current,(mt.MODE===fi.TEST||mt.DEV)&&(this.setState.bind(this),Object.defineProperties(window.h,{state:{configurable:!0,get:()=>this.state},setState:{configurable:!0,value:(...n)=>this.setState(...n)},app:{configurable:!0,value:this},history:{configurable:!0,value:this.history},store:{configurable:!0,value:this.store},fonts:{configurable:!0,value:this.fonts}})),this.store.onStoreIncrementEmitter.on(n=>{this.history.record(n.elementsChange,n.appStateChange)}),this.scene.onUpdate(this.triggerRender),this.addEventListeners(),this.props.autoFocus&&this.excalidrawContainerRef.current&&this.focusContainer(),Go()||(this.refreshViewportBreakpoints(),this.refreshEditorBreakpoints()),x3&&this.excalidrawContainerRef.current&&(this.resizeObserver=new ResizeObserver(()=>{this.refreshEditorBreakpoints(),this.updateDOMRect()}),(t=this.resizeObserver)==null||t.observe(this.excalidrawContainerRef.current)),new URLSearchParams(window.location.search.slice(1)).has("web-share-target")?this.restoreFileFromShare():this.updateDOMRect(this.initializeScene),zV()&&!ZY()&&this.setState({errorMessage:m.jsx(Ipe,{})})}componentWillUnmount(){var t,n;(t=window.launchQueue)==null||t.setConsumer(()=>{}),this.renderer.destroy(),this.scene.destroy(),this.scene=new el,this.fonts=new Wo(this.scene),this.renderer=new Mk(this.scene),this.files={},this.imageCache.clear(),(n=this.resizeObserver)==null||n.disconnect(),this.unmounted=!0,this.removeEventListeners(),this.library.destroy(),this.laserTrails.stop(),this.eraserTrail.stop(),this.onChangeEmitter.clear(),this.store.onStoreIncrementEmitter.clear(),yn.destroy(),Do.destroy(),clearTimeout(Ol),Vn.clearCache(),Wr.clearCache(),Ol=0,document.documentElement.style.overscrollBehaviorX=""}removeEventListeners(){this.onRemoveEventListenersEmitter.trigger()}addEventListeners(){this.removeEventListeners(),this.props.handleKeyboardGlobally&&this.onRemoveEventListenersEmitter.once(mn(document,"keydown",this.onKeyDown,!1)),this.onRemoveEventListenersEmitter.once(mn(this.excalidrawContainerRef.current,"wheel",this.handleWheel,{passive:!1}),mn(window,"message",this.onWindowMessage,!1),mn(document,"pointerup",this.removePointer,{passive:!1}),mn(document,"copy",this.onCopy,{passive:!1}),mn(document,"keyup",this.onKeyUp,{passive:!0}),mn(document,"pointermove",this.updateCurrentCursorPosition,{passive:!1}),mn(document.fonts,"loadingdone",t=>{let n=t.fontfaces;this.fonts.onLoaded(n)},{passive:!1}),mn(document,"gesturestart",this.onGestureStart,!1),mn(document,"gesturechange",this.onGestureChange,!1),mn(document,"gestureend",this.onGestureEnd,!1),mn(window,"focus",()=>{this.maybeCleanupAfterMissingPointerUp(null),this.triggerRender(!0)},{passive:!1})),!this.state.viewModeEnabled&&(this.onRemoveEventListenersEmitter.once(mn(document,"fullscreenchange",this.onFullscreenChange,{passive:!1}),mn(document,"paste",this.pasteFromClipboard,{passive:!1}),mn(document,"cut",this.onCut,{passive:!1}),mn(window,"resize",this.onResize,!1),mn(window,"unload",this.onUnload,!1),mn(window,"blur",this.onBlur,!1),mn(this.excalidrawContainerRef.current,"wheel",this.handleWheel,{passive:!1}),mn(this.excalidrawContainerRef.current,"dragover",this.disableEvent,!1),mn(this.excalidrawContainerRef.current,"drop",this.disableEvent,!1)),this.props.detectScroll&&this.onRemoveEventListenersEmitter.once(mn(PY(this.excalidrawContainerRef.current),"scroll",this.onScroll,{passive:!1})))}componentDidUpdate(t,n){var o,c,d,l,h,f,g,U,y,v;this.updateEmbeddables();let r=this.scene.getElementsIncludingDeleted(),i=this.scene.getElementsMapIncludingDeleted(),a=this.scene.getNonDeletedElementsMap();!this.state.showWelcomeScreen&&!r.length&&this.setState({showWelcomeScreen:!0}),t.UIOptions.dockedSidebarBreakpoint!==this.props.UIOptions.dockedSidebarBreakpoint&&this.refreshEditorBreakpoints(),n.userToFollow&&!this.state.collaborators.has(n.userToFollow.socketId)&&this.maybeUnfollowRemoteUser(),(n.zoom.value!==this.state.zoom.value||n.scrollX!==this.state.scrollX||n.scrollY!==this.state.scrollY)&&((c=(o=this.props)==null?void 0:o.onScrollChange)==null||c.call(o,this.state.scrollX,this.state.scrollY,this.state.zoom),this.onScrollChangeEmitter.trigger(this.state.scrollX,this.state.scrollY,this.state.zoom)),n.userToFollow!==this.state.userToFollow&&(n.userToFollow&&this.onUserFollowEmitter.trigger({userToFollow:n.userToFollow,action:"UNFOLLOW"}),this.state.userToFollow&&this.onUserFollowEmitter.trigger({userToFollow:this.state.userToFollow,action:"FOLLOW"})),Object.keys(this.state.selectedElementIds).length&&Is(this.state)&&this.setState({activeTool:Pn(this.state,{type:"selection"})}),this.state.activeTool.type==="eraser"&&n.theme!==this.state.theme&&oL(this.interactiveCanvas,this.state.theme),n.activeTool.type==="selection"&&this.state.activeTool.type!=="selection"&&this.state.showHyperlinkPopup&&this.setState({showHyperlinkPopup:!1}),t.langCode!==this.props.langCode&&this.updateLanguage(),Is(n)&&!Is(this.state)&&this.eraserTrail.endPath(),t.viewModeEnabled!==this.props.viewModeEnabled&&this.setState({viewModeEnabled:!!this.props.viewModeEnabled}),n.viewModeEnabled!==this.state.viewModeEnabled&&(this.addEventListeners(),this.deselectElements()),(((d=n.openDialog)==null?void 0:d.name)==="elementLinkSelector"||((l=this.state.openDialog)==null?void 0:l.name)==="elementLinkSelector")&&((h=n.openDialog)==null?void 0:h.name)!==((f=this.state.openDialog)==null?void 0:f.name)&&(this.deselectElements(),this.setState({hoveredElementIds:{}})),t.zenModeEnabled!==this.props.zenModeEnabled&&this.setState({zenModeEnabled:!!this.props.zenModeEnabled}),t.theme!==this.props.theme&&this.props.theme&&this.setState({theme:this.props.theme}),(g=this.excalidrawContainerRef.current)==null||g.classList.toggle("theme--dark",this.state.theme===wt.DARK),this.state.editingLinearElement&&!this.state.selectedElementIds[this.state.editingLinearElement.elementId]&&setTimeout(()=>{this.state.editingLinearElement&&this.actionManager.executeAction(Oa)}),(U=this.state.editingTextElement)!=null&&U.isDeleted&&this.setState({editingTextElement:null}),this.state.selectedLinearElement&&!this.state.selectedElementIds[this.state.selectedLinearElement.elementId]&&this.setState({selectedLinearElement:null});let{multiElement:s}=n;n.activeTool!==this.state.activeTool&&s!=null&&id(this.state)&&Ns(s,!1)&&N3(s,this.state,Ya(Re.getPointAtIndexGlobalCoordinates(s,-1,a)),this.scene.getNonDeletedElementsMap(),this.scene.getNonDeletedElements()),this.store.commit(i,this.state),this.state.isLoading||((v=(y=this.props).onChange)==null||v.call(y,r,this.state,this.files),this.onChangeEmitter.trigger(r,this.state,this.files))}static resetTapTwice(){Gf=!1}async addElementsFromMixedContentPaste(t,{isPlainPaste:n,sceneX:r,sceneY:i}){if(!n&&t.some(a=>a.type==="imageUrl")&&this.isToolSupported("image")){let a=t.filter(h=>h.type==="imageUrl").map(h=>h.value),s=await Promise.all(a.map(async h=>{try{return{file:await Iie(h)}}catch(f){let g=f.message;return f.cause==="FETCH_ERROR"?g=D("errors.failedToFetchImage"):f.cause==="UNSUPPORTED"&&(g=D("errors.unsupportedFileType")),{errorMessage:g}}})),o=i,c=!1,d={};for(let h of s)if(h.file){let f=this.createImageElement({sceneX:r,sceneY:o}),g=await this.insertImageElement(f,h.file);g&&(c||(c=!0,o-=g.height/2),me(g,{y:o},!1),o=f.y+f.height+25,d[f.id]=!0)}this.setState({selectedElementIds:At(d,this.state)});let l=s.find(h=>!!h.errorMessage);l&&l.errorMessage&&this.setState({errorMessage:l.errorMessage})}else{let a=t.filter(s=>s.type==="text");a.length&&this.addTextFromPaste(a.map(s=>s.value).join(`
252
-
253
- `),n)}}addTextFromPaste(t,n=!1){let{x:r,y:i}=Yt({clientX:this.lastViewportPosition.x,clientY:this.lastViewportPosition.y},this.state),a={x:r,y:i,strokeColor:this.state.currentItemStrokeColor,backgroundColor:this.state.currentItemBackgroundColor,fillStyle:this.state.currentItemFillStyle,strokeWidth:this.state.currentItemStrokeWidth,strokeStyle:this.state.currentItemStrokeStyle,roundness:null,roughness:this.state.currentItemRoughness,opacity:this.state.currentItemOpacity,text:t,fontSize:this.state.currentItemFontSize,fontFamily:this.state.currentItemFontFamily,textAlign:B1,verticalAlign:Jg,locked:!1},s=Bt({fontSize:a.fontSize,fontFamily:a.fontFamily}),o=Td(a.fontFamily),[c,,d]=OA(this.state),l=Math.max(Math.min((d-c)*.5,800),200),h=10,f=i,g=n?[t]:t.split(`
254
- `),U=g.reduce((y,v,x)=>{var C;let w=fh(v).trim();if(w.length){let S=this.getTopLayerFrameAtSceneCoords({x:r,y:f}),k=jr(w,s,o),M=k.width>l,T=M?zd(w,s,l):w;k=M?jr(T,s,o):k;let R=r-k.width/2,j=f-k.height/2,P=Oi({...a,x:R,y:j,text:T,originalText:w,lineHeight:o,autoResize:!M,frameId:S?S.id:null});y.push(P),f+=P.height+h}else(C=g[x-1])!=null&&C.trim()&&(f+=X1(a.fontSize,o)+h);return y},[]);U.length!==0&&(this.scene.insertElements(U),this.setState({selectedElementIds:At(Object.fromEntries(U.map(y=>[y.id,!0])),this.state)}),!n&&U.length>1&&Lk===!1&&!this.device.editor.isMobile&&(this.setToast({message:D("toast.pasteAsSingleElement",{shortcut:pe("CtrlOrCmd+Shift+V")}),duration:5e3}),Lk=!0),this.store.shouldCaptureIncrement())}handleTextWysiwyg(t,{isExistingElement:n=!1}){let r=this.scene.getElementsMapIncludingDeleted(),i=(a,s)=>{this.scene.replaceAllElements([...this.scene.getElementsIncludingDeleted().map(o=>o.id===t.id&&Le(o)?ct(o,{originalText:a,isDeleted:s??o.isDeleted,...cL(o,ur(o,r),r,a)}):o)])};h1e({id:t.id,canvas:this.canvas,getViewportCoords:(a,s)=>{let{x:o,y:c}=oa({sceneX:a,sceneY:s},this.state);return[o-this.state.offsetLeft,c-this.state.offsetTop]},onChange:wn(a=>{i(a,!1),q3(t)&&gi(t,this.scene.getNonDeletedElementsMap())}),onSubmit:wn(({viaKeyboard:a,nextOriginalText:s})=>{let o=!s.trim();if(i(s,o),!o&&a){let c=t.containerId?t.containerId:t.id;Jn.flushSync(()=>{this.setState(d=>({selectedElementIds:At({...d.selectedElementIds,[c]:!0},d)}))})}o&&XA(this.scene.getNonDeletedElements(),[t]),(!o||n)&&this.store.shouldCaptureIncrement(),Jn.flushSync(()=>{this.setState({newElement:null,editingTextElement:null})}),this.state.activeTool.locked&&Ts(this.interactiveCanvas,this.state),this.focusContainer()}),element:t,excalidrawContainer:this.excalidrawContainerRef.current,app:this,autoSelect:!this.device.isTouchScreen}),this.deselectElements(),i(t.originalText,!1)}deselectElements(){this.setState({selectedElementIds:At({},this.state),selectedGroupIds:{},editingGroupId:null,activeEmbeddable:null})}getTextElementAtPosition(t,n){let r=this.getElementAtPosition(t,n,{includeBoundTextElement:!0});return r&&Le(r)&&!r.isDeleted?r:null}getElementAtPosition(t,n,r){let i=this.getElementsAtPosition(t,n,r==null?void 0:r.includeBoundTextElement,r==null?void 0:r.includeLockedElements);if(i.length>1){if(r!=null&&r.preferSelected){for(let s=i.length-1;s>-1;s--)if(this.state.selectedElementIds[i[s].id])return i[s]}let a=i[i.length-1];return Ru({x:t,y:n,element:a,shape:No(a,this.scene.getNonDeletedElementsMap()),threshold:this.getElementHitThreshold()/2,frameNameBound:tt(a)?this.frameNameBoundsCache.get(a):null})?a:i[i.length-2]}return i.length===1?i[0]:null}getElementsAtPosition(t,n,r=!1,i=!1){let a=[],s=this.scene.getNonDeletedElementsMap();return(r&&i?this.scene.getNonDeletedElements():this.scene.getNonDeletedElements().filter(o=>(i||!o.locked)&&(r||!(Le(o)&&o.containerId)))).filter(o=>this.hitElement(t,n,o)).filter(o=>{let c=bi(o,s);return c&&this.state.frameRendering.enabled&&this.state.frameRendering.clip?US({x:t,y:n},c,s):!0}).filter(o=>Yl(o)?(a.push(o),!1):!0).concat(a)}getElementHitThreshold(){return GV/this.state.zoom.value}hitElement(t,n,r,i=!0){if(i&&this.state.selectedElementIds[r.id]&&eR([r],this.state)){let a=Lee(r,this.scene.getNonDeletedElementsMap(),Lt(r)?0:this.getElementHitThreshold());if(f2(A(t,n),a))return!0}return yA(t,n,xA(r,this.scene.getNonDeletedElementsMap()))?!0:Ru({x:t,y:n,element:r,shape:No(r,this.scene.getNonDeletedElementsMap()),threshold:this.getElementHitThreshold(),frameNameBound:tt(r)?this.frameNameBoundsCache.get(r):null})}getTextBindableContainerAtPosition(t,n){let r=this.scene.getNonDeletedElements(),i=this.scene.getSelectedElements(this.state);if(i.length===1)return ud(i[0],!1)?i[0]:null;let a=null;for(let s=r.length-1;s>=0;--s){if(r[s].isDeleted)continue;let[o,c,d,l]=lt(r[s],this.scene.getNonDeletedElementsMap());if(Ut(r[s])&&Ru({x:t,y:n,element:r[s],shape:No(r[s],this.scene.getNonDeletedElementsMap()),threshold:this.getElementHitThreshold()})){a=r[s];break}else if(o<t&&t<d&&c<n&&n<l){a=r[s];break}}return ud(a,!1)?a:null}handleHoverSelectedLinearElement(t,n,r){let i=this.scene.getNonDeletedElementsMap(),a=Re.getElement(t.elementId,i);if(a)if(this.state.selectedLinearElement){let s=-1,o=null;Ru({x:n,y:r,element:a,shape:No(a,this.scene.getNonDeletedElementsMap())})?(s=Re.getPointIndexUnderCursor(a,i,this.state.zoom,n,r),o=Re.getSegmentMidpointHitCoords(t,{x:n,y:r},this.state,this.scene.getNonDeletedElementsMap()),(Pe(a)?s===0||s===a.points.length-1:s>=0)||o?$t(this.interactiveCanvas,Ot.POINTER):this.hitElement(n,r,a)&&$t(this.interactiveCanvas,Ot.MOVE)):this.hitElement(n,r,a)&&(!Pe(a)||!(a.startBinding||a.endBinding))&&$t(this.interactiveCanvas,Ot.MOVE),this.state.selectedLinearElement.hoverPointIndex!==s&&this.setState({selectedLinearElement:{...this.state.selectedLinearElement,hoverPointIndex:s}}),Re.arePointsEqual(this.state.selectedLinearElement.segmentMidPointHoveredCoords,o)||this.setState({selectedLinearElement:{...this.state.selectedLinearElement,segmentMidPointHoveredCoords:o}})}else $t(this.interactiveCanvas,Ot.AUTO)}updateGestureOnPointerDown(t){It.pointers.set(t.pointerId,{x:t.clientX,y:t.clientY}),It.pointers.size===2&&(It.lastCenter=ek(It.pointers),It.initialScale=this.state.zoom.value,It.initialDistance=tk(Array.from(It.pointers.values())))}initialPointerDownState(t){let n=Yt(t,this.state),r=this.scene.getSelectedElements(this.state),[i,a,s,o]=Dt(r),c=r.findIndex(Pe)===0;return{origin:n,withCmdOrCtrl:t[Z.CTRL_OR_CMD],originInGrid:Ya(zn(n.x,n.y,t[Z.CTRL_OR_CMD]||c?null:this.getEffectiveGridSize())),scrollbars:ak(By,t.clientX-this.state.offsetLeft,t.clientY-this.state.offsetTop),lastCoords:{...n},originalElements:this.scene.getNonDeletedElements().reduce((d,l)=>(d.set(l.id,Hd(l)),d),new Map),resize:{handleType:!1,isResizing:!1,offset:{x:0,y:0},arrowDirection:"origin",center:{x:(s+i)/2,y:(o+a)/2}},hit:{element:null,allHitElements:[],wasAddedToSelection:!1,hasBeenDuplicated:!1,hasHitCommonBoundingBoxOfSelectedElements:this.isHittingCommonBoundingBoxOfSelectedElements(n,r)},drag:{hasOccurred:!1,offset:null},eventListeners:{onMove:null,onUp:null,onKeyUp:null,onKeyDown:null},boxSelection:{hasOccurred:!1}}}handleDraggingScrollBar(t,n){if(!(n.scrollbars.isOverEither&&!this.state.multiElement))return!1;$y=!0,n.lastCoords.x=t.clientX,n.lastCoords.y=t.clientY;let r=jy(a=>{a.target instanceof HTMLElement&&this.handlePointerMoveOverScrollbars(a,n)}),i=wn(()=>{zc=null,$y=!1,Ts(this.interactiveCanvas,this.state),this.setState({cursorButton:"up"}),this.savePointer(t.clientX,t.clientY,"up"),window.removeEventListener("pointermove",r),window.removeEventListener("pointerup",i),r.flush()});return zc=i,window.addEventListener("pointermove",r),window.addEventListener("pointerup",i),!0}isASelectedElement(t){return t!=null&&this.state.selectedElementIds[t.id]}isHittingCommonBoundingBoxOfSelectedElements(t,n){if(n.length<2)return!1;let r=this.getElementHitThreshold(),[i,a,s,o]=Dt(n);return t.x>i-r&&t.x<s+r&&t.y>a-r&&t.y<o+r}getCurrentItemRoundness(t){return this.state.currentItemRoundness==="round"?{type:$h(t)?Nn.ADAPTIVE_RADIUS:Nn.PROPORTIONAL_RADIUS}:null}maybeCacheReferenceSnapPoints(t,n,r=!1){hc({event:t,app:this,selectedElements:n})&&(r||!Do.getReferenceSnapPoints())&&Do.setReferenceSnapPoints(hne(this.scene.getNonDeletedElements(),n,this.state,this.scene.getNonDeletedElementsMap()))}maybeCacheVisibleGaps(t,n,r=!1){hc({event:t,app:this,selectedElements:n})&&(r||!Do.getVisibleGaps())&&Do.setVisibleGaps(une(this.scene.getNonDeletedElements(),n,this.state,this.scene.getNonDeletedElementsMap()))}onKeyDownFromPointerDownHandler(t){return wn(n=>{this.maybeHandleResize(t,n)||this.maybeDragNewGenericElement(t,n)})}onKeyUpFromPointerDownHandler(t){return wn(n=>{n.key===Z.ALT&&n.preventDefault(),!this.maybeHandleResize(t,n)&&this.maybeDragNewGenericElement(t,n)})}onPointerMoveFromPointerDownHandler(t){return jy(n=>{var l,h,f,g,U,y;if(((l=this.state.openDialog)==null?void 0:l.name)==="elementLinkSelector")return;let r=Yt(n,this.state);if(this.state.selectedLinearElement&&this.state.selectedLinearElement.elbowed&&this.state.selectedLinearElement.pointerDownState.segmentMidpoint.index){let[v,x]=zn(r.x,r.y,n[Z.CTRL_OR_CMD]?null:this.getEffectiveGridSize()),w=this.state.selectedLinearElement.pointerDownState.segmentMidpoint.index;if(w<0){let S=Re.getSegmentMidpointHitCoords({...this.state.selectedLinearElement,segmentMidPointHoveredCoords:null},{x:v,y:x},this.state,this.scene.getNonDeletedElementsMap());w=S?Re.getSegmentMidPointIndex(this.state.selectedLinearElement,this.state,S,this.scene.getNonDeletedElementsMap()):-1}let C=Re.moveFixedSegment(this.state.selectedLinearElement,w,v,x,this.scene.getNonDeletedElementsMap());Jn.flushSync(()=>{this.state.selectedLinearElement&&this.setState({selectedLinearElement:{...this.state.selectedLinearElement,segmentMidPointHoveredCoords:C.segmentMidPointHoveredCoords,pointerDownState:C.pointerDownState}})});return}let i=this.lastPointerMoveCoords??t.origin;if(this.lastPointerMoveCoords=r,t.drag.offset===null&&(t.drag.offset=Ya(wie(this.scene.getSelectedElements(this.state),t.origin.x,t.origin.y))),!(n.target instanceof HTMLElement)||this.handlePointerMoveOverScrollbars(n,t))return;if(Is(this.state)){this.handleEraser(n,t,r);return}this.state.activeTool.type==="laser"&&this.laserTrails.addPointToPath(r.x,r.y);let[a,s]=zn(r.x,r.y,n[Z.CTRL_OR_CMD]?null:this.getEffectiveGridSize());if(!t.drag.hasOccurred&&(this.state.activeTool.type==="arrow"||this.state.activeTool.type==="line")&&Rt(A(r.x,r.y),A(t.origin.x,t.origin.y))<Vc)return;if(t.resize.isResizing&&(t.lastCoords.x=r.x,t.lastCoords.y=r.y,this.maybeHandleCrop(t,n)||this.maybeHandleResize(t,n)))return!0;let o=this.scene.getNonDeletedElementsMap();if(this.state.selectedLinearElement){let v=this.state.editingLinearElement||this.state.selectedLinearElement;if(Re.shouldAddMidpoint(this.state.selectedLinearElement,r,this.state,o)){let x=Re.addMidpoint(this.state.selectedLinearElement,r,this,!n[Z.CTRL_OR_CMD],o);if(!x)return;Jn.flushSync(()=>{this.state.selectedLinearElement&&this.setState({selectedLinearElement:{...this.state.selectedLinearElement,pointerDownState:x.pointerDownState,selectedPointsIndices:x.selectedPointsIndices}}),this.state.editingLinearElement&&this.setState({editingLinearElement:{...this.state.editingLinearElement,pointerDownState:x.pointerDownState,selectedPointsIndices:x.selectedPointsIndices}})});return}else if(v.pointerDownState.segmentMidpoint.value!==null&&!v.pointerDownState.segmentMidpoint.added)return;if(Re.handlePointDragging(n,this,r.x,r.y,(x,w)=>{this.maybeSuggestBindingsForLinearElementAtCoords(x,w)},v,this.scene)){t.lastCoords.x=r.x,t.lastCoords.y=r.y,t.drag.hasOccurred=!0,this.state.editingLinearElement&&!this.state.editingLinearElement.isDragging&&this.setState({editingLinearElement:{...this.state.editingLinearElement,isDragging:!0}}),this.state.selectedLinearElement.isDragging||this.setState({selectedLinearElement:{...this.state.selectedLinearElement,isDragging:!0}});return}}let c=t.hit.allHitElements.some(v=>this.isASelectedElement(v)),d=this.state.editingLinearElement&&n.shiftKey&&this.state.editingLinearElement.elementId===((h=t.hit.element)==null?void 0:h.id);if((c||t.hit.hasHitCommonBoundingBoxOfSelectedElements)&&!d){let v=this.scene.getSelectedElements(this.state);if(v.every(S=>S.locked))return;let x=v.find(S=>tt(S)),w=this.getTopLayerFrameAtSceneCoords(r),C=w&&!x?w:null;if(this.state.frameToHighlight!==C&&Jn.flushSync(()=>{this.setState({frameToHighlight:C})}),t.drag.hasOccurred=!0,v.length>0&&!t.withCmdOrCtrl&&!this.state.editingTextElement&&((f=this.state.activeEmbeddable)==null?void 0:f.state)!=="active"){let S={x:r.x-t.origin.x,y:r.y-t.origin.y},k=[...t.originalElements.values()],M=n.shiftKey;if(M){let j=Math.abs(S.x),P=Math.abs(S.y),N=M&&j<P,F=M&&j>P;N&&(S.x=0),F&&(S.y=0)}if(this.state.croppingElementId){let j=this.scene.getNonDeletedElementsMap().get(this.state.croppingElementId);if(j&&Lt(j)&&j.crop!==null&&t.hit.element===j){let P=j.crop,N=aa(j)&&((g=this.imageCache.get(j.fileId))==null?void 0:g.image);if(N&&!(N instanceof Promise)){let F=Sn(gr(r.x-i.x,r.y-i.y),Math.max(this.state.zoom.value,2)),[$,q,W,V,B,z]=lt(j,o),Y=Ve(he(A($,q),A(B,z),j.angle)),K=Ve(he(A(W,q),A(B,z),j.angle)),G=Ve(he(A($,V),A(B,z),j.angle)),ee=Lr(a2(K,Y)),de=Lr(a2(G,Y)),xe=gr(GE(F,ee),GE(F,de)),ve={...P,x:vt(P.x-xe[0]*Math.sign(j.scale[0]),0,N.naturalWidth-P.width),y:vt(P.y-xe[1]*Math.sign(j.scale[1]),0,N.naturalHeight-P.height)};me(j,{crop:ve});return}}}this.maybeCacheVisibleGaps(n,v),this.maybeCacheReferenceSnapPoints(n,v);let{snapOffset:T,snapLines:R}=fne(k,S,this,n,this.scene.getNonDeletedElementsMap());if(this.setState({snapLines:R}),this.state.editingFrame||vie(t,v,S,this.scene,T,n[Z.CTRL_OR_CMD]?null:this.getEffectiveGridSize()),this.setState({selectedElementsAreBeingDragged:!0,selectionElement:null}),(v.length!==1||!Pe(v[0]))&&this.setState({suggestedBindings:Jb(v,this.scene.getNonDeletedElementsMap(),this.state.zoom)}),n.altKey&&!t.hit.hasBeenDuplicated){t.hit.hasBeenDuplicated=!0;let j=[],P=[],N=new Map,F=new Map,$=t.hit.element,q=new Set(this.scene.getSelectedElements({selectedElementIds:this.state.selectedElementIds,includeBoundTextElement:!0,includeElementsInFrames:!0}).map(B=>B.id)),W=this.scene.getElementsIncludingDeleted();for(let B of W){let z=q.has(B.id)||B.id===($==null?void 0:$.id)&&t.hit.wasAddedToSelection;if(Math.abs(B.x)>1e7||Math.abs(B.x)>1e7||Math.abs(B.width)>1e7||Math.abs(B.height)>1e7){console.error("Alt+dragging element in scene with invalid dimensions",B.x,B.y,B.width,B.height,z);return}if(z){let Y=hL(this.state.editingGroupId,N,B);if(Math.abs(Y.x)>1e7||Math.abs(Y.x)>1e7||Math.abs(Y.width)>1e7||Math.abs(Y.height)>1e7){console.error("Alt+dragging duplicated element with invalid dimensions",Y.x,Y.y,Y.width,Y.height);return}let K=t.originalElements.get(B.id);if(Math.abs(K.x)>1e7||Math.abs(K.x)>1e7||Math.abs(K.width)>1e7||Math.abs(K.height)>1e7){console.error("Alt+dragging duplicated element with invalid dimensions",K.x,K.y,K.width,K.height);return}me(Y,{x:K.x,y:K.y}),t.originalElements.set(Y.id,Y),j.push(Y),P.push(B),F.set(B.id,Y.id)}else j.push(B)}let V=[...j,...P];V=((y=(U=this.props).onDuplicate)==null?void 0:y.call(U,V,W))||V,Zs(V,nt(P)),tL(j,P,F),WA(V,P,F,"duplicatesServeAsOld"),HL(V,P,F),this.scene.replaceAllElements(V),this.maybeCacheVisibleGaps(n,v,!0),this.maybeCacheReferenceSnapPoints(n,v,!0)}return}}if(this.state.selectionElement)t.lastCoords.x=r.x,t.lastCoords.y=r.y,this.maybeDragNewGenericElement(t,n);else{let v=this.state.newElement;if(!v)return;if(v.type==="freedraw"){let x=v.points,w=r.x-v.x,C=r.y-v.y,S=x.length>0&&x[x.length-1];if(!(S&&S[0]===w&&S[1]===C)){let k=v.simulatePressure?v.pressures:[...v.pressures,n.pressure];me(v,{points:[...x,A(w,C)],pressures:k},!1),this.setState({newElement:v})}}else if(st(v)){t.drag.hasOccurred=!0;let x=v.points,w=a-v.x,C=s-v.y;Lp(n)&&x.length===2&&({width:w,height:C}=Y3(v.x,v.y,r.x,r.y)),x.length===1?me(v,{points:[...x,A(w,C)]},!1):(x.length===2||x.length>1&&Pe(v))&&me(v,{points:[...x.slice(0,-1),A(w,C)]},!1,{isDragging:!0}),this.setState({newElement:v}),Ns(v,!1)&&this.maybeSuggestBindingsForLinearElementAtCoords(v,[r],this.state.startBoundElement)}else t.lastCoords.x=r.x,t.lastCoords.y=r.y,this.maybeDragNewGenericElement(t,n,!1)}if(this.state.activeTool.type==="selection"){t.boxSelection.hasOccurred=!0;let v=this.scene.getNonDeletedElements();if(this.state.editingLinearElement)Re.handleBoxSelection(n,this.state,this.setState.bind(this),this.scene.getNonDeletedElementsMap());else{let x=!0;!n.shiftKey&&Vn(v,this.state)&&(t.withCmdOrCtrl&&t.hit.element?this.setState(C=>Wr({...C,selectedElementIds:{[t.hit.element.id]:!0}},this.scene.getNonDeletedElements(),C,this)):x=!1);let w=this.state.selectionElement?d7(v,this.state.selectionElement,this.scene.getNonDeletedElementsMap(),!1):[];this.setState(C=>{let S={...x&&C.selectedElementIds,...w.reduce((k,M)=>(k[M.id]=!0,k),{})};return t.hit.element&&(w.length?delete S[t.hit.element.id]:S[t.hit.element.id]=!0),C=x?C:{...C,selectedGroupIds:{},editingGroupId:null},{...Wr({editingGroupId:C.editingGroupId,selectedElementIds:S},this.scene.getNonDeletedElements(),C,this),selectedLinearElement:w.length===1&&st(w[0])?new Re(w[0]):null,showHyperlinkPopup:w.length===1&&(w[0].link||li(w[0]))?"info":!1}})}}})}handlePointerMoveOverScrollbars(t,n){if(n.scrollbars.isOverHorizontal){let r=t.clientX,i=r-n.lastCoords.x;return this.translateCanvas({scrollX:this.state.scrollX-i/this.state.zoom.value}),n.lastCoords.x=r,!0}if(n.scrollbars.isOverVertical){let r=t.clientY,i=r-n.lastCoords.y;return this.translateCanvas({scrollY:this.state.scrollY-i/this.state.zoom.value}),n.lastCoords.y=r,!0}return!1}onPointerUpFromPointerDownHandler(t){return wn(n=>{var y,v,x,w,C,S,k,M,T,R,j,P;this.removePointer(n),t.eventListeners.onMove&&t.eventListeners.onMove.flush();let{newElement:r,resizingElement:i,croppingElementId:a,multiElement:s,activeTool:o,isResizing:c,isRotating:d,isCropping:l}=this.state;this.setState(N=>({isResizing:!1,isRotating:!1,isCropping:!1,resizingElement:null,selectionElement:null,frameToHighlight:null,elementsToHighlight:null,cursorButton:"up",snapLines:$f(N.snapLines,[]),originSnapOffset:null})),this.lastPointerMoveCoords=null,Do.setReferenceSnapPoints(null),Do.setVisibleGaps(null),this.savePointer(n.clientX,n.clientY,"up"),this.setState({selectedElementsAreBeingDragged:!1});let h=this.scene.getNonDeletedElementsMap();if(t.drag.hasOccurred&&((v=(y=t.hit)==null?void 0:y.element)!=null&&v.id)){let N=h.get(t.hit.element.id);is(N)&&((x=N.boundElements)==null||x.filter(F=>F.type==="arrow").map(F=>h.get(F.id)).filter(F=>Pe(F)).forEach(F=>{F&&me(F,{},!0)}))}if(this.state.editingLinearElement)if(!t.boxSelection.hasOccurred&&((C=(w=t.hit)==null?void 0:w.element)==null?void 0:C.id)!==this.state.editingLinearElement.elementId)this.actionManager.executeAction(Oa);else{let N=Re.handlePointerUp(n,this.state.editingLinearElement,this.state,this.scene);N!==this.state.editingLinearElement&&this.setState({editingLinearElement:N,suggestedBindings:[]})}else if(this.state.selectedLinearElement){if(this.state.selectedLinearElement.elbowed){let N=Re.getElement(this.state.selectedLinearElement.elementId,this.scene.getNonDeletedElementsMap());N&&me(N,{},!0)}if(((k=(S=t.hit)==null?void 0:S.element)==null?void 0:k.id)!==this.state.selectedLinearElement.elementId)this.scene.getSelectedElements(this.state).length>1&&this.setState({selectedLinearElement:null});else{let N=Re.handlePointerUp(n,this.state.selectedLinearElement,this.state,this.scene),{startBindingElement:F,endBindingElement:$}=N,q=this.scene.getElement(N.elementId);Ns(q)&&AU(q,F,$,h,this.scene),N!==this.state.selectedLinearElement&&this.setState({selectedLinearElement:{...N,selectedPointsIndices:null},suggestedBindings:[]})}}if(this.missingPointerEventCleanupEmitter.clear(),window.removeEventListener("pointermove",t.eventListeners.onMove),window.removeEventListener("pointerup",t.eventListeners.onUp),window.removeEventListener("keydown",t.eventListeners.onKeyDown),window.removeEventListener("keyup",t.eventListeners.onKeyUp),this.state.pendingImageElementId&&this.setState({pendingImageElementId:null}),(T=(M=this.props)==null?void 0:M.onPointerUp)==null||T.call(M,o,t),this.onPointerUpEmitter.trigger(this.state.activeTool,t,n),(r==null?void 0:r.type)==="freedraw"){let N=Yt(n,this.state),F=r.points,$=N.x-r.x,q=N.y-r.y;$===F[0][0]&&q===F[0][1]&&(q+=1e-4,$+=1e-4);let W=r.simulatePressure?[]:[...r.pressures,n.pressure];me(r,{points:[...F,A($,q)],pressures:W,lastCommittedPoint:A($,q)}),this.actionManager.executeAction(Oa);return}if(Lt(r)){let N=r;try{this.initializeImageDimensions(N),this.setState({selectedElementIds:At({[N.id]:!0},this.state)},()=>{this.actionManager.executeAction(Oa)})}catch(F){console.error(F),this.scene.replaceAllElements(this.scene.getElementsIncludingDeleted().filter($=>$.id!==N.id)),this.actionManager.executeAction(Oa)}return}if(st(r)){r.points.length>1&&this.store.shouldCaptureIncrement();let N=Yt(n,this.state);!t.drag.hasOccurred&&r&&!s?(me(r,{points:[...r.points,A(N.x-r.x,N.y-r.y)]}),this.setState({multiElement:r,newElement:r})):t.drag.hasOccurred&&!s&&(id(this.state)&&Ns(r,!1)&&N3(r,this.state,N,this.scene.getNonDeletedElementsMap(),this.scene.getNonDeletedElements()),this.setState({suggestedBindings:[],startBoundElement:null}),o.locked?this.setState(F=>({newElement:null})):($a(this.interactiveCanvas),this.setState(F=>({newElement:null,activeTool:Pn(this.state,{type:"selection"}),selectedElementIds:At({...F.selectedElementIds,[r.id]:!0},F),selectedLinearElement:new Re(r)}))),this.scene.triggerUpdate());return}if(Le(r)){let N=bv(Bt({fontSize:r.fontSize,fontFamily:r.fontFamily}),r.lineHeight);r.width<N&&me(r,{autoResize:!0}),this.resetCursor(),this.handleTextWysiwyg(r,{isExistingElement:!0})}if(o.type!=="selection"&&r&&Ad(r)){this.updateScene({elements:this.scene.getElementsIncludingDeleted().filter(N=>N.id!==r.id),appState:{newElement:null},captureUpdate:le.NEVER});return}if(tt(r)){let N=eie(this.scene.getElementsIncludingDeleted(),r,this.scene.getNonDeletedElementsMap());this.scene.replaceAllElements(Dp(this.scene.getElementsMapIncludingDeleted(),N,r,this.state))}if(r&&(me(r,KL(r)),this.scene.triggerUpdate()),t.drag.hasOccurred){let N=Yt(n,this.state);if(this.state.selectedLinearElement&&this.state.selectedLinearElement.isDragging){let F=this.scene.getElement(this.state.selectedLinearElement.elementId);if(F!=null&&F.frameId){let $=bi(F,h);$&&F&&(pc(F,$,this.scene.getNonDeletedElementsMap())||(me(F,{groupIds:[]}),HU([F],this.scene.getNonDeletedElementsMap()),this.scene.triggerUpdate()))}}else{let F=this.getTopLayerFrameAtSceneCoords(N),$=this.scene.getSelectedElements(this.state),q=this.scene.getElementsMapIncludingDeleted(),W=V=>{if(V.length>0){for(let B of V){let z=B.groupIds.indexOf(this.state.editingGroupId);me(B,{groupIds:B.groupIds.slice(0,z)},!1)}q.forEach(B=>{B.groupIds.length&&rn(q,B.groupIds[B.groupIds.length-1]).length<2&&me(B,{groupIds:[]},!1)}),this.setState({editingGroupId:null})}};if(F&&!this.state.selectedElementIds[F.id]){let V=$.filter(B=>B.frameId!==F.id&&S2(B,q,this.state));this.state.editingGroupId&&W(V),q=Dp(q,V,F,this.state)}else if(!F&&this.state.editingGroupId){let V=$.filter(B=>B.frameId&&!S2(B,q,this.state));W(V)}q=xh(q,this.state,this),this.scene.replaceAllElements(q)}}if(i&&this.store.shouldCaptureIncrement(),i&&Ad(i)&&this.updateScene({elements:this.scene.getElementsIncludingDeleted().filter(N=>N.id!==i.id),captureUpdate:le.NEVER}),t.resize.isResizing){let N=xh(this.scene.getElementsIncludingDeleted(),this.state,this),F=this.scene.getSelectedElements(this.state).filter($=>tt($));for(let $ of F)N=VL(N,Sg(this.scene.getElementsIncludingDeleted(),$,this.state,h),$,this);this.scene.replaceAllElements(N)}let f=t.hit.element;((R=this.state.selectedLinearElement)==null?void 0:R.elementId)!==(f==null?void 0:f.id)&&st(f)&&this.scene.getSelectedElements(this.state).length===1&&this.setState({selectedLinearElement:new Re(f)}),(!a||a&&(!f&&!l||f&&f.id!==a))&&this.finishImageCropping();let g=this.lastPointerDownEvent,U=this.lastPointerUpEvent||this.lastPointerMoveEvent;if(Is(this.state)&&g&&U){if(this.eraserTrail.endPath(),Rt(A(g.clientX,g.clientY),A(U.clientX,U.clientY))===0){let N=Yt({clientX:U.clientX,clientY:U.clientY},this.state);this.getElementsAtPosition(N.x,N.y).forEach(F=>this.elementsPendingErasure.add(F.id))}this.eraseElements();return}else this.elementsPendingErasure.size&&this.restoreReadyToEraseElements();if(f&&!t.drag.hasOccurred&&!t.hit.wasAddedToSelection&&(!this.state.editingLinearElement||!t.boxSelection.hasOccurred)&&(n.shiftKey&&!this.state.editingLinearElement?this.state.selectedElementIds[f.id]?qA(this.state,f)?this.setState(N=>{let F={...N.selectedElementIds};for(let $ of f.groupIds.flatMap(q=>rn(this.scene.getNonDeletedElements(),q)))delete F[$.id];return{selectedGroupIds:{...N.selectedElementIds,...f.groupIds.map($=>({[$]:!1})).reduce(($,q)=>({...$,...q}),{})},selectedElementIds:At(F,N)}}):(j=this.state.selectedLinearElement)!=null&&j.isDragging||this.setState(N=>{let F={...N.selectedElementIds};delete F[f.id];let $=gt(this.scene.getNonDeletedElements(),{selectedElementIds:F});return{...Wr({editingGroupId:N.editingGroupId,selectedElementIds:F},this.scene.getNonDeletedElements(),N,this),selectedLinearElement:$.length===1&&st($[0])?new Re($[0]):N.selectedLinearElement}}):f.frameId&&this.state.selectedElementIds[f.frameId]?this.setState(N=>{var $;let F={...N.selectedElementIds,[f.id]:!0};return delete F[f.frameId],((($=this.scene.getElement(f.frameId))==null?void 0:$.groupIds)??[]).flatMap(q=>rn(this.scene.getNonDeletedElements(),q)).forEach(q=>{delete F[q.id]}),{...Wr({editingGroupId:N.editingGroupId,selectedElementIds:F},this.scene.getNonDeletedElements(),N,this),showHyperlinkPopup:f.link||li(f)?"info":!1}}):this.setState(N=>({selectedElementIds:At({...N.selectedElementIds,[f.id]:!0},N)})):this.setState(N=>{var F;return{...Wr({editingGroupId:N.editingGroupId,selectedElementIds:{[f.id]:!0}},this.scene.getNonDeletedElements(),N,this),selectedLinearElement:st(f)&&((F=N.selectedLinearElement)==null?void 0:F.elementId)!==f.id?new Re(f):N.selectedLinearElement}})),!(f&&Pe(f))&&!t.drag.hasOccurred&&!this.state.isResizing&&(f&&Vee({x:t.origin.x,y:t.origin.y,element:f,shape:No(f,this.scene.getNonDeletedElementsMap()),threshold:this.getElementHitThreshold(),frameNameBound:tt(f)?this.frameNameBoundsCache.get(f):null},h)||!f&&t.hit.hasHitCommonBoundingBoxOfSelectedElements)){this.state.editingLinearElement?this.setState({editingLinearElement:null}):this.setState({selectedElementIds:At({},this.state),selectedGroupIds:{},editingGroupId:null,activeEmbeddable:null}),$t(this.interactiveCanvas,Ot.AUTO);return}if(!o.locked&&o.type!=="freedraw"&&r&&this.setState(N=>({selectedElementIds:At({...N.selectedElementIds,[r.id]:!0},N),showHyperlinkPopup:li(r)&&!r.link?"editor":N.showHyperlinkPopup})),(o.type!=="selection"||Vn(this.scene.getNonDeletedElements(),this.state)||!yr(this.state.previousSelectedElementIds,this.state.selectedElementIds))&&this.store.shouldCaptureIncrement(),t.drag.hasOccurred||c||d||l){let N=this.scene.getSelectedElements(this.state).filter(st);g2(N,this.scene.getNonDeletedElementsMap(),this.scene.getNonDeletedElements(),this.scene,id(this.state),((P=this.state.selectedLinearElement)==null?void 0:P.selectedPointsIndices)??[],this.state.zoom)}if(o.type==="laser"){this.laserTrails.endPath();return}!o.locked&&o.type!=="freedraw"?($a(this.interactiveCanvas),this.setState({newElement:null,suggestedBindings:[],activeTool:Pn(this.state,{type:"selection"})})):this.setState({newElement:null,suggestedBindings:[]}),f&&this.lastPointerUpEvent&&this.lastPointerDownEvent&&this.lastPointerUpEvent.timeStamp-this.lastPointerDownEvent.timeStamp<300&&It.pointers.size<=1&&sa(f)&&this.isIframeLikeElementCenter(f,this.lastPointerUpEvent,t.origin.x,t.origin.y)&&this.handleEmbeddableCenterClick(f)})}clearSelection(t){this.setState(n=>({selectedElementIds:At({},n),activeEmbeddable:null,selectedGroupIds:{},editingGroupId:n.editingGroupId&&t!=null&&m1(t,n.editingGroupId)?n.editingGroupId:null})),this.setState({selectedElementIds:At({},this.state),activeEmbeddable:null,previousSelectedElementIds:this.state.selectedElementIds})}getTextWysiwygSnappedToCenterPosition(t,n,r,i){if(i){let a=i.x+i.width/2,s=i.y+i.height/2,o=ey(i,r,this.scene.getNonDeletedElementsMap());if(o&&(a=o.x,s=o.y),Math.hypot(t-a,n-s)<VV){let{x:c,y:d}=oa({sceneX:a,sceneY:s},r);return{viewportX:c,viewportY:d,elementCenterX:a,elementCenterY:s}}}}getCanvasOffsets(){var t;if((t=this.excalidrawContainerRef)!=null&&t.current){let n=this.excalidrawContainerRef.current,{left:r,top:i}=n.getBoundingClientRect();return{offsetLeft:r,offsetTop:i}}return{offsetLeft:0,offsetTop:0}}async updateLanguage(){let t=e6.find(n=>n.code===this.props.langCode)||Wd;await Ij(t),this.setAppState({})}},v1e=()=>{(mt.MODE===fi.TEST||mt.DEV)&&(window.h=window.h||{},Object.defineProperties(window.h,{elements:{configurable:!0,get(){var e;return(e=this.app)==null?void 0:e.scene.getElementsIncludingDeleted()},set(e){var t;return(t=this.app)==null?void 0:t.scene.replaceAllElements(Jo(e))}},scene:{configurable:!0,get(){var e;return(e=this.app)==null?void 0:e.scene}}}))};v1e();var x1e=y1e,w1e=()=>{Array.prototype.at||Object.defineProperty(Array.prototype,"at",{value:function(e){if(e=Math.trunc(e)||0,e<0&&(e+=this.length),!(e<0||e>=this.length))return this[e]},writable:!0,enumerable:!1,configurable:!0}),Element.prototype.replaceChildren||(Element.prototype.replaceChildren=function(...e){this.innerHTML="",this.append(...e)})},E1e=w1e,jN=({children:e})=>{let{FooterCenterTunnel:t}=yi(),n=Nr();return m.jsx(t.In,{children:m.jsx("div",{className:Fe("footer-center zen-mode-transition",{"layer-ui__wrapper__footer-left--transition-bottom":n.zenModeEnabled}),children:e})})},PN=jN;jN.displayName="FooterCenter";var C1e=()=>m.jsx("svg",{viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"ExcalidrawLogo-icon",children:m.jsx("path",{d:"M39.9 32.889a.326.326 0 0 0-.279-.056c-2.094-3.083-4.774-6-7.343-8.833l-.419-.472a.212.212 0 0 0-.056-.139.586.586 0 0 0-.167-.111l-.084-.083-.056-.056c-.084-.167-.28-.278-.475-.167-.782.39-1.507.973-2.206 1.528-.92.722-1.842 1.445-2.708 2.25a8.405 8.405 0 0 0-.977 1.028c-.14.194-.028.361.14.444-.615.611-1.23 1.223-1.843 1.861a.315.315 0 0 0-.084.223c0 .083.056.166.111.194l1.09.833v.028c1.535 1.528 4.244 3.611 7.12 5.861.418.334.865.667 1.284 1 .195.223.39.473.558.695.084.11.28.139.391.055.056.056.14.111.196.167a.398.398 0 0 0 .167.056.255.255 0 0 0 .224-.111.394.394 0 0 0 .055-.167c.029 0 .028.028.056.028a.318.318 0 0 0 .224-.084l5.082-5.528a.309.309 0 0 0 0-.444Zm-14.63-1.917a.485.485 0 0 0 .111.14c.586.5 1.2 1 1.843 1.555l-2.569-1.945-.251-.166c-.056-.028-.112-.084-.168-.111l-.195-.167.056-.056.055-.055.112-.111c.866-.861 2.346-2.306 3.1-3.028-.81.805-2.43 3.167-2.095 3.944Zm8.767 6.89-2.122-1.612a44.713 44.713 0 0 0-2.625-2.5c1.145.861 2.122 1.611 2.262 1.75 1.117.972 1.06.806 1.815 1.445l.921.666a1.06 1.06 0 0 1-.251.25Zm.558.416-.056-.028c.084-.055.168-.111.252-.194l-.196.222ZM1.089 5.75c.055.361.14.722.195 1.056.335 1.833.67 3.5 1.284 4.75l.252.944c.084.361.223.806.363.917 1.424 1.25 3.602 3.11 5.947 4.889a.295.295 0 0 0 .363 0s0 .027.028.027a.254.254 0 0 0 .196.084.318.318 0 0 0 .223-.084c2.988-3.305 5.221-6.027 6.813-8.305.112-.111.14-.278.14-.417.111-.111.195-.25.307-.333.111-.111.111-.306 0-.39l-.028-.027c0-.055-.028-.139-.084-.167-.698-.666-1.2-1.138-1.731-1.638-.922-.862-1.871-1.75-3.881-3.75l-.028-.028c-.028-.028-.056-.056-.112-.056-.558-.194-1.703-.389-3.127-.639C6.087 2.223 3.21 1.723.614.944c0 0-.168 0-.196.028l-.083.084c-.028.027-.056.055-.224.11h.056-.056c.028.167.028.278.084.473 0 .055.112.5.112.555l.782 3.556Zm15.496 3.278-.335-.334c.084.112.196.195.335.334Zm-3.546 4.666-.056.056c0-.028.028-.056.056-.056Zm-2.038-10c.168.167.866.834 1.033.973-.726-.334-2.54-1.167-3.379-1.445.838.167 1.983.334 2.346.472ZM1.424 2.306c.419.722.754 3.222 1.089 5.666-.196-.778-.335-1.555-.503-2.278-.251-1.277-.503-2.416-.838-3.416.056 0 .14 0 .252.028Zm-.168-.584c-.112 0-.223-.028-.307-.028 0-.027 0-.055-.028-.055.14 0 .223.028.335.083Zm-1.089.222c0-.027 0-.027 0 0ZM39.453 1.333c.028-.11-.558-.61-.363-.639.42-.027.42-.666 0-.666-.558.028-1.144.166-1.675.25-.977.194-1.982.389-2.96.61-2.205.473-4.383.973-6.561 1.557-.67.194-1.424.333-2.066.666-.224.111-.196.333-.084.472-.056.028-.084.028-.14.056-.195.028-.363.056-.558.083-.168.028-.252.167-.224.334 0 .027.028.083.028.11-1.173 1.556-2.485 3.195-3.909 4.945-1.396 1.611-2.876 3.306-4.356 5.056-4.719 5.5-10.052 11.75-15.943 17.25a.268.268 0 0 0 0 .389c.028.027.056.055.084.055-.084.084-.168.14-.252.222-.056.056-.084.111-.084.167a.605.605 0 0 0-.111.139c-.112.111-.112.305.028.389.111.11.307.11.39-.028.029-.028.029-.056.056-.056a.44.44 0 0 1 .615 0c.335.362.67.723.977 1.028l-.698-.583c-.112-.111-.307-.083-.39.028-.113.11-.085.305.027.389l7.427 6.194c.056.056.112.056.196.056s.14-.028.195-.084l.168-.166c.028.027.083.027.111.027.084 0 .14-.027.196-.083 10.052-10.055 18.15-17.639 27.42-24.417.083-.055.111-.166.111-.25.112 0 .196-.083.251-.194 1.704-5.194 2.039-9.806 2.15-12.083v-.028c0-.028.028-.056.028-.083.028-.056.028-.084.028-.084a1.626 1.626 0 0 0-.111-1.028ZM21.472 9.5c.446-.5.893-1.028 1.34-1.5-2.876 3.778-7.65 9.583-14.408 16.5 4.607-5.083 9.242-10.333 13.068-15ZM5.193 35.778h.084-.084Zm3.462 3.194c-.027-.028-.027-.028 0-.028v.028Zm4.16-3.583c.224-.25.448-.472.699-.722 0 0 0 .027.028.027-.252.223-.475.445-.726.695Zm1.146-1.111c.14-.14.279-.334.446-.5l.028-.028c1.648-1.694 3.351-3.389 5.082-5.111l.028-.028c.419-.333.921-.694 1.368-1.028a379.003 379.003 0 0 0-6.952 6.695ZM24.794 6.472c-.921 1.195-1.954 2.778-2.82 4.028-2.736 3.944-11.532 13.583-11.727 13.75a1976.983 1976.983 0 0 1-8.042 7.639l-.167.167c-.14-.167-.14-.417.028-.556C14.49 19.861 22.03 10.167 25.074 5.917c-.084.194-.14.36-.28.555Zm4.83 5.695c-1.116-.64-1.646-1.64-1.34-2.611l.084-.334c.028-.083.084-.194.14-.277.307-.5.754-.917 1.257-1.167.027 0 .055 0 .083-.028-.028-.056-.028-.139-.028-.222.028-.167.14-.278.335-.278.335 0 1.369.306 1.76.639.111.083.223.194.335.305.14.167.363.445.474.667.056.028.112.306.196.445.056.222.111.472.084.694-.028.028 0 .194-.028.194a2.668 2.668 0 0 1-.363 1.028c-.028.028-.028.056-.056.084l-.028.027c-.14.223-.335.417-.53.556-.643.444-1.369.583-2.095.389 0 0-.195-.084-.28-.111Zm8.154-.834a39.098 39.098 0 0 1-.893 3.167c0 .028-.028.083 0 .111-.056 0-.084.028-.14.056-2.206 1.61-4.356 3.305-6.506 5.028 1.843-1.64 3.686-3.306 5.613-4.945.558-.5.949-1.139 1.06-1.861l.28-1.667v-.055c.14-.334.67-.195.586.166Z",fill:"currentColor"})}),S1e=()=>m.jsxs("svg",{viewBox:"0 0 450 55",xmlns:"http://www.w3.org/2000/svg",fill:"none",className:"ExcalidrawLogo-text",children:[m.jsx("path",{d:"M429.27 96.74c2.47-1.39 4.78-3.02 6.83-4.95 1.43-1.35 2.73-2.86 3.81-4.51-.66.9-1.4 1.77-2.23 2.59-2.91 2.84-5.72 5.09-8.42 6.87h.01ZM343.6 69.36c.33 3.13.58 6.27.79 9.4.09 1.37.18 2.75.25 4.12-.12-4.46-.27-8.93-.5-13.39-.11-2.08-.24-4.16-.4-6.24-.06 1.79-.11 3.85-.13 6.11h-.01ZM378.47 98.34c.01-.37.07-1.13.01-6.51-.11 1.9-.22 3.81-.31 5.71-.07 1.42-.22 2.91-.16 4.35.39.03.78.07 1.17.1-.92-.85-.76-2.01-.72-3.66l.01.01ZM344.09 86.12c-.09-2.41-.22-4.83-.39-7.24v12.21c.15-.05.32-.09.47-.14.05-1.61-.03-3.23-.09-4.83h.01ZM440.69 66.79c-.22-.34-.45-.67-.69-.99-3.71-4.87-9.91-7.14-15.65-8.55-1.05-.26-2.12-.49-3.18-.71 2.29.59 4.48 1.26 6.64 2.02 7.19 2.54 10.57 5.41 12.88 8.23ZM305.09 72.46l1.2 3.6c.84 2.53 1.67 5.06 2.46 7.61.24.78.5 1.57.73 2.36.22-.04.44-.08.67-.12a776.9 776.9 0 0 1-5.01-13.57c-.02.04-.03.09-.05.13v-.01ZM345.49 90.25v.31c1.48-.42 3.05-.83 4.66-1.2-1.56.25-3.12.52-4.66.89ZM371.02 90.22c0-.57-.04-1.14-.11-1.71-.06-.02-.12-.04-.19-.05-.21-.05-.43-.08-.65-.11.42.16.74.88.95 1.87ZM398.93 54.23c-.13 0-.27-.01-.4-.02l.03.4c.11-.15.23-.27.37-.38ZM401.57 62.28v-.15c-1.22-.24-2.86-.61-3.23-1.25-.09-.15-.18-.51-.27-.98-.09.37-.2.73-.33 1.09 1.24.56 2.52.98 3.83 1.29ZM421.73 88.68c-2.97 1.65-6.28 3.12-9.69 3.68v.18c4.72-.14 11.63-3.85 16.33-8.38-2.04 1.75-4.33 3.24-6.63 4.53l-.01-.01ZM411.28 80.92c-.05-1.2-.09-2.4-.15-3.6-.21 5.66-.46 11.38-.47 14.51.24-.02.48-.04.71-.07.15-3.61.05-7.23-.09-10.83v-.01Z",transform:"translate(-144.023 -51.76)"}),m.jsx("path",{d:"M425.38 67.41c-3.5-1.45-7.19-2.57-14.06-3.62.09 1.97.06 4.88-.03 8.12.03.04.06.09.06.15.19 1.36.28 2.73.37 4.1.25 3.77.39 7.55.41 11.33 0 1.38-.01 2.76-.07 4.13 1.4-.25 2.78-.65 4.12-1.15 4.07-1.5 7.94-3.78 11.28-6.54 2.33-1.92 5.13-4.49 5.88-7.58.63-3.53-2.45-6.68-7.97-8.96l.01.02ZM411.35 92.53v-.06l-.34.03c.11.01.22.03.34.03ZM314.26 64.06c-.23-.59-.47-1.17-.7-1.75.57 1.62 1.11 3.25 1.6 4.9l.15.54 2.35 6.05c.32.82.66 1.64.98 2.46-1.38-4.1-2.83-8.17-4.39-12.2h.01ZM156.82 103.07c-.18.13-.38.23-.58.33 1.32-.03 2.66-.2 3.93-.34.86-.09 1.72-.22 2.58-.33-2.12.1-4.12.17-5.94.34h.01ZM210.14 68.88s.03.04.05.07c.18-.31.39-.64.58-.96-.21.3-.42.6-.64.89h.01ZM201.65 82.8c-.5.77-1.02 1.56-1.49 2.37 1.11-1.55 2.21-3.1 3.2-4.59-.23.23-.49.51-.75.79-.32.47-.65.95-.96 1.43ZM194.03 98.66c-.33-.4-.65-.84-1.05-1.17-.24-.2-.07-.49.17-.56-.23-.26-.42-.5-.63-.75 1.51-2.55 3.93-5.87 6.4-9.28-.17-.08-.29-.28-.2-.49.04-.09.09-.17.13-.26-1.21 1.78-2.42 3.55-3.61 5.33-.87 1.31-1.74 2.64-2.54 4-.29.5-.63 1.04-.87 1.61.81.65 1.63 1.27 2.47 1.88-.09-.11-.18-.21-.27-.32v.01ZM307.79 82.93c-1-3.17-2.05-6.32-3.1-9.48-1.62 4.08-3.69 9.17-6.16 15.19 3.32-1.04 6.77-1.87 10.27-2.5-.32-1.08-.67-2.15-1.01-3.21ZM149.5 80.7c.05-1.71.04-3.43 0-5.14-.1 2.26-.16 4.51-.22 6.77-.02.73-.03 1.46-.04 2.19.14-1.27.2-2.55.24-3.82h.02ZM228.98 98.3c.39 1.25.91 3.03.94 3.91.06-.03.12-.07.17-.1.08-1.29-.55-2.65-1.11-3.81ZM307.72 53.36c.81.5 1.53 1.04 2.07 1.49-.38-.8-.78-1.58-1.21-2.35-.17.03-.34.06-.51.11-.43.12-.86.26-1.29.41.35-.01.53.1.94.34ZM283.69 96.14c3.91-7.25 6.89-13.35 8.88-18.15l1.1-2.66c-1.27 2.64-2.56 5.27-3.83 7.9-1.53 3.15-3.06 6.31-4.58 9.47-.87 1.81-1.76 3.62-2.54 5.47.04.02.07.04.11.07.05.05.1.09.15.14.05-.73.27-1.48.71-2.24ZM289.92 103.23s-.04.01-.05.03c0-.02.04-.03.05-.04.05-.05.11-.1.16-.15l.21-.21c-.55 0-1.5-.27-2.55-.72.4.26.8.51 1.22.74.24.13.48.26.73.37.05.02.1.03.14.05a.27.27 0 0 1 .08-.07h.01ZM269.23 68.49c-.39-.19-.82-.48-1.33-.87-3.06-1.56-6.31-2.78-9.36-2.35-3.5.49-5.7 1.11-7.74 2.44 5.71-2.6 12.82-2.07 18.44.79l-.01-.01ZM177.87 53.69l1.06.03c-.96-.22-2-.25-2.89-.3-4.95-.26-9.99.33-14.86 1.19-2.44.43-4.88.95-7.28 1.59 9.09-1.76 15.69-2.77 23.97-2.51ZM219.85 55.51c-.18.12-.36.27-.56.45-.45.53-.86 1.11-1.26 1.66-1.91 2.61-3.71 5.31-5.57 7.95l-.12.18 8.05-10.11c-.18-.05-.36-.1-.55-.13h.01ZM510.71 54.1c.12-.15.29-.3.53-.45.69-.4 3.72-.63 5.87-.74-.36-.02-.73-.04-1.09-.05-1.84-.03-3.67.09-5.49.35.05.3.12.59.18.88v.01ZM510.76 86.02c1.37-3.07 2.49-6.27 3.57-9.46.55-1.64 1.12-3.3 1.6-4.97-1.59 4.01-3.67 9.14-6.2 15.3.24-.08.5-.14.74-.22.1-.22.19-.44.29-.65ZM566.95 75.76c.11-.02.23.03.31.11-.05-.13-.09-.26-.14-.39-.05.09-.11.18-.17.28ZM511.33 86.41c3.08-.89 6.24-1.62 9.46-2.14-1.51-3.98-2.98-7.96-4.39-11.87-.05.15-.09.31-.14.46-1.02 3.32-2.15 6.61-3.39 9.85-.48 1.25-.98 2.49-1.53 3.7h-.01ZM578.24 74.45c.11-.44.23-.87.35-1.31-.31.7-.64 1.39-.97 2.08.09.21.19.4.28.61.12-.46.23-.92.35-1.38h-.01ZM520.62 53.11c-.09 0-.18-.01-.28-.02.38.34.29 1.08.93 2.53l6.65 17.15c2.2 5.68 4.69 11.36 7.41 16.87l1.06 2.17c-2.95-7.05-5.92-14.08-8.87-21.13-1.58-3.79-3.16-7.59-4.7-11.4-.78-1.92-1.73-3.89-2.25-5.91-.03-.1 0-.19.04-.26h.01ZM578.78 77.87c1.45-5.77 3.07-10.43 3.58-13.36.05-.34.16-.88.31-1.55-.67 1.79-1.37 3.56-2.08 5.33-.12.43-.23.86-.35 1.29-.65 2.43-1.29 4.86-1.9 7.3.14.33.29.65.43 1l.01-.01ZM545.3 94.66c.02-.44.03-.83.05-1.12.02-1.01.05-2.02.11-3.02.03-6.66-.46-14.33-1.46-22.8-.13-.42-.27-1.24-.56-2.89 0-.02 0-.04-.01-.06.62 6.61.95 13.25 1.32 19.87.17 3.08.33 6.16.52 9.23.02.25.03.52.04.78l-.01.01ZM580.77 102.81c.13.2.27.38.37.49.27-.11.53-.22.8-.32-.43.09-.82.05-1.17-.16v-.01ZM530.48 104.07h.33c-.36-.13-.71-.32-1.04-.56.14.24.3.47.45.7.06-.08.14-.13.26-.13v-.01ZM542.63 58.82c.06.23.11.47.15.71.14-.33.36-.62.7-.86-.28.05-.57.11-.85.15ZM583.81 57.87c.15-.7.29-1.41.42-2.11-.14.45-.28.9-.42 1.34-.46 1.44-.89 2.89-1.31 4.34.44-1.19.88-2.37 1.31-3.57ZM523.62 91.48c-4.66 1.17-9.05 2.89-14.02 5.27 4.65-1.84 9.48-3.29 14.28-4.63-.09-.22-.17-.41-.26-.64ZM460.64 78.3c-.04-2.9-.11-5.81-.28-8.71-.1-1.68-.17-3.43-.5-5.09-.07.02-.14.03-.2.05.3 6.54.45 12.17.51 17.12.17-.07.34-.14.51-.2 0-1.06-.01-2.11-.03-3.17h-.01ZM470.63 63.24c-3.38-.26-6.81.32-10.1 1.1.41 2.01.47 4.14.57 6.18.18 3.55.25 7.11.27 10.67 3.31-1.38 6.5-3.12 9.3-5.35 1.96-1.56 3.86-3.41 5.02-5.66.73-1.41 1.19-3.22.26-4.65-1.09-1.7-3.46-2.14-5.32-2.29ZM460.29 63.68c1-.24 2.01-.46 3.04-.65-1.15.16-2.37.38-3.71.69v.13c.07-.02.15-.04.22-.05.11-.13.3-.18.45-.11v-.01ZM457.24 100.96c.43-.03.86-.07 1.29-.11.14-.49.27-.99.38-1.49-.44.7-1 1.23-1.67 1.6ZM482.88 104.98c-.18.23-.36.38-.55.47.14.09.27.19.4.28a70.76 70.76 0 0 0 4.37-4.63c.76-.89 1.52-1.81 2.19-2.77-.3-.27-.61-.53-.92-.79-.07 1.94-4.62 6.32-5.49 7.45v-.01Z",transform:"translate(-144.023 -51.76)"}),m.jsx("path",{d:"M474.36 63.31c-.4-.16-.84-.27-1.29-.37 1.56.42 3.08 1.22 3.76 2.74.62 1.4.32 2.95-.28 4.32.7-1.22.94-2.34.74-3.47-.24-1.33-1.19-2.54-2.93-3.21v-.01ZM477.34 89.18c-1.2-.81-2.4-1.62-3.6-2.42-.14.1-.26.19-.4.29 1.4.67 2.73 1.39 4 2.13ZM465.88 93.85c.37.25.74.5 1.1.75.46.32.92.65 1.38.97-1.57-1.2-2.01-1.61-2.49-1.72h.01ZM574.92 90.06c-2.28-5.21-4.93-11.13-5.67-12.26-.1-.15-1.57-3.01-1.63-3.08 0 0-.01.02-.02.02.4 1.37 1.09 2.69 1.65 3.99 2.14 4.95 4.36 9.86 6.67 14.73.6 1.26 1.21 2.52 1.83 3.78-.75-2.01-1.64-4.45-2.83-7.18ZM448.73 65.29c.1.2.22.38.34.57.22-.02.43-.06.65-.08v-.08c-.14-.05-.25 0-.99-.41ZM460.16 94.81c-.02.31-.06.59-.1.89-.03 1.71-.33 3.43-.79 5.07.15-.02.3-.03.45-.05.01-.04.02-.08.03-.11.09-.34.15-.69.2-1.03.17-1.07.25-2.16.33-3.24.05-.69.08-1.39.12-2.08-.27.1-.27.26-.24.57v-.02Z",transform:"translate(-144.023 -51.76)"}),m.jsx("path",{d:"m328.67 98.12-3.22-6.58c-1.29-2.63-2.53-5.29-3.72-7.97-.25-.85-.52-1.69-.79-2.53-.81-2.57-1.67-5.12-2.55-7.67-1.92-5.53-3.9-11.08-6.32-16.41-.72-1.58-1.46-3.44-2.63-4.79-.03-.17-.16-.29-.34-.36a.282.282 0 0 0-.23-.04c-.06-.01-.12 0-.18.01-.74.06-1.5.38-2.19.61-2.22.77-4.4 1.64-6.63 2.38-.03-.08-.06-.16-.09-.25-.15-.42-.82-.24-.67.19.03.09.07.19.1.28l-.18.06c-.36.11-.28.6 0 .68.18 1.18.63 2.36.98 3.49.03.09.06.17.08.26-.08.23-.17.46-.24.64-.37.98-.79 1.94-1.21 2.9-1.27 2.89-2.62 5.75-3.98 8.6-3.18 6.67-6.44 13.31-9.64 19.97-1.08 2.25-2.2 4.5-3.15 6.81-.13.32.24.5.5.37 1.34 1.33 2.84 2.5 4.4 3.57.65.44 1.31.87 2.01 1.24.4.22.86.48 1.33.5.24.01.35-.19.33-.37.11-.1.21-.21.28-.28.41-.41.81-.84 1.2-1.26.85-.92 1.69-1.87 2.5-2.84 6.31-2.34 12.6-4.31 18.71-5.84 2.14 5.3 3.43 8.43 3.97 9.58.55 1.05 1.15 1.88 1.82 2.52 1.32.56 6.96-.03 9.23-1.96.87-1.28 1.19-2.67.93-4.15-.09-.5-.22-.95-.4-1.33l-.01-.03Zm-20.09-45.61c.43.77.83 1.56 1.21 2.35-.54-.45-1.27-.99-2.07-1.49-.42-.24-.6-.35-.94-.34.43-.15.85-.29 1.29-.41.17-.05.34-.08.51-.11Zm-25.86 45.66c.78-1.85 1.67-3.66 2.54-5.47 1.51-3.16 3.05-6.31 4.58-9.47 1.28-2.63 2.56-5.26 3.83-7.9l-1.1 2.66c-1.99 4.79-4.97 10.9-8.88 18.15-.43.76-.66 1.51-.71 2.24-.05-.05-.1-.09-.15-.14a.259.259 0 0 0-.11-.07Zm6.24 4.71c-.42-.23-.82-.48-1.22-.74 1.05.45 2 .72 2.55.72l-.21.21c-.05.05-.11.1-.16.15-.01.01-.04.03-.05.04 0-.02.03-.02.05-.03a.27.27 0 0 0-.08.07c-.05-.02-.1-.03-.14-.05-.25-.1-.49-.24-.73-.37h-.01Zm15.73-29.43c1.05 3.15 2.1 6.31 3.1 9.48.34 1.06.69 2.13 1.01 3.21-3.5.63-6.95 1.46-10.27 2.5 2.48-6.03 4.54-11.11 6.16-15.19Zm4.79 12.57c-.23-.79-.49-1.58-.73-2.36-.79-2.54-1.63-5.08-2.46-7.61l-1.2-3.6c.02-.04.04-.09.05-.13 1.6 4.45 3.28 9 5.01 13.57l-.67.12v.01Zm5.83-18.27-.15-.54c-.49-1.64-1.03-3.28-1.6-4.9.23.58.47 1.17.7 1.75 1.56 4.03 3.01 8.1 4.39 12.2-.33-.82-.67-1.64-.98-2.46l-2.35-6.05h-.01ZM390.43 79.37c-.13-10.43-.22-17.5-.24-19.97-.24-1.6.21-2.88-.65-3.65-.14-.13-.32-.23-.52-.32h.03c.45 0 .45-.69 0-.7-1.75-.03-3.5-.04-5.25-.14-1.38-.08-2.76-.21-4.15-.31-.07 0-.12.01-.17.04-.21-.07-.47.03-.45.31l.03.45c-.11.14-.19.3-.22.5-.21 1.26-.32 13.67-.36 23.59-.32 5.79-.67 11.57-.97 17.36-.09 1.73-.29 3.54-.21 5.3-.39.02-.38.64.04.69v.12c.05.44.74.45.7 0v-.06c1.1.09 2.2.21 3.3.3 1.14.19 2.44.2 3.29.17 1.73-.05 2.92-.05 3.8-.37.45-.05.9-.11 1.35-.17.44-.06.25-.73-.19-.67h-.01c.24-.32.45-.72.62-1.25.66-1.84.41-6.36.34-11.33l-.13-9.9.02.01Zm-12.26 18.17c.09-1.91.2-3.81.31-5.71.06 5.38 0 6.14-.01 6.51-.05 1.65-.21 2.81.72 3.66-.39-.04-.78-.07-1.17-.1-.06-1.44.09-2.93.16-4.35l-.01-.01ZM588.97 53.85c-2.06-.25-3.17-.51-3.76-.6a.3.3 0 0 1 .04-.08c.22-.39-.39-.75-.6-.35-.56 1.02-.9 2.19-1.26 3.29-.61 1.88-1.17 3.78-1.72 5.68-.63 2.19-1.24 4.39-1.83 6.59-.81 2.03-1.67 4.05-2.61 6.03-1.7-3.64-3.11-6.04-4.03-7.57-2.26-3.74-2.85-5.48-3.57-6.08l.31-.09c.43-.12.25-.8-.19-.67-1.06.3-2.12.6-3.17.95-.93.32-1.85.69-2.76 1.07-.13.05-.19.16-.22.27-.04.02-.08.05-.11.07-.04-.06-.07-.12-.11-.18a.354.354 0 0 0-.48-.12c-.16.09-.22.32-.13.48l.33.54c0 .09.02.18.06.28.51 1.16.78 1.38.72 1.47-2.42 3.44-5.41 7.86-6.2 9.1-1.27 1.97-2.01 3.14-2.45 3.84l-.91-6.56-.43-4.1c-.19-1.85-.37-3.23-.53-4.13-.19-1.1-.3-2.15-.45-3.16-.2-1.36-.29-2.06-.47-2.42h.04c.45.02.45-.68 0-.7-3.43-.16-6.81.94-10.17 1.48-.24-.22-.73-.04-.58.32.24.59.33 1.25.43 1.87.17 1.06.29 2.13.4 3.2.32 3.09.53 6.2.74 9.3.44 6.75.77 13.51 1.17 20.26.11 1.95.13 3.96.46 5.89.05.3.37.31.55.14.74 1.71 2.87 1.27 6.13 1.27 1.34 0 2.39.04 2.99-.11.02.32.48.53.63.18 3.61-8.26 7.41-16.46 12.05-24.2.03-.05.04-.1.05-.15.3.73.64 1.45.94 2.16.97 2.26 1.97 4.52 2.98 6.76 2.26 5.03 4.54 10.07 7.09 14.96.47.9.94 1.79 1.47 2.65.2.32.4.67.66.96-.18.25 0 .68.34.54.91-.38 1.82-.75 2.76-1.07 1.04-.35 2.11-.65 3.17-.95.39-.11.28-.66-.07-.68.62-.4.95-.96.87-1.91-.3-3.34.72-7.47.86-8.52l2.14-11.43c1.75-10.74 3.13-17.51 3.23-20.86.02-.49.08-2.84.13-3.24.17-1.25.48-1-4.96-1.65l.03-.02Zm-46.19 5.67c-.04-.24-.09-.48-.15-.71l.85-.15c-.34.24-.56.53-.7.86Zm1.95 25.12c-.36-6.63-.7-13.26-1.32-19.87 0 .02 0 .04.01.06.29 1.65.44 2.47.56 2.89 1 8.46 1.5 16.14 1.46 22.8-.06.99-.1 2-.11 3.02-.01.29-.03.68-.05 1.12-.01-.26-.03-.53-.04-.78-.19-3.08-.35-6.16-.52-9.23l.01-.01Zm36.4 18.66c-.11-.11-.24-.29-.37-.49.35.21.74.26 1.17.16-.27.11-.53.22-.8.32v.01Zm-.89-33.72c.12-.43.23-.86.35-1.29.71-1.77 1.41-3.55 2.08-5.33-.15.68-.26 1.22-.31 1.55-.5 2.94-2.13 7.59-3.58 13.36-.15-.35-.29-.66-.43-1 .61-2.44 1.25-4.87 1.9-7.3l-.01.01Zm3.56-12.48c.14-.44.28-.89.42-1.34-.13.7-.27 1.41-.42 2.11-.43 1.19-.86 2.38-1.31 3.57.42-1.45.85-2.9 1.31-4.34Zm-5.22 16.05c-.11.44-.23.87-.35 1.31-.12.46-.23.92-.35 1.38-.1-.22-.19-.4-.28-.61.34-.69.66-1.38.97-2.08h.01Zm-11.64 2.62c.06-.1.12-.19.17-.28.05.13.09.26.14.39a.398.398 0 0 0-.31-.11Zm2.3 2.98c-.56-1.3-1.25-2.63-1.65-3.99 0 0 .01-.02.02-.02.06.08 1.52 2.93 1.63 3.08.73 1.13 3.38 7.04 5.67 12.26 1.2 2.73 2.08 5.17 2.83 7.18-.62-1.25-1.23-2.51-1.83-3.78-2.31-4.87-4.53-9.78-6.67-14.73ZM275.92 87.03c-1.06-2.18-1.13-3.45-2.44-2.93-1.52.57-2.94 1.3-4.5 2.1-1.4.72-2.68 1.44-3.92 2.12.01-.25-.24-.5-.51-.34-4.8 2.93-12.41 4.7-17.28 1.31-1.98-1.77-3.32-4.15-3.97-5.78-.29-.95-.49-1.94-.63-2.93-.14-3.34 1.58-6.53 3.9-9.12.8-.79 1.68-1.51 2.66-2.12 3.7-2.3 8.22-3.07 12.51-2.51 2.71.35 5.32 1.24 7.71 2.55.39.22.75-.39.35-.6-.18-.1-.37-.18-.55-.27.56.27 1.03.33 1.51.19l-.48.39c-.15.11-.23.3-.13.48.09.15.33.24.48.13 1.3-.97 2.46-2.09 3.45-3.37.37-.29.64-.6.65-.97v-.02c.08-.33-.03-.7-.21-1.08-.31-.87-.98-2.01-2.19-3.26-2.43-2.52-3.79-3.45-5.68-4.26-1.14-.49-3.12-1.06-4.42-1.23-3.28-.42-10.64-1.21-18.18 4.11-7.74 5.46-11.94 12.3-12.23 20.61-.08 2.06.04 3.98.34 5.71.74 4.18 2.57 8 5.44 11.34 4.26 4.99 9.76 7.52 16.34 7.52 4.85 0 9.69-1.77 14.89-4.62.23-.12.45-.23.68-.35 2.19-1.1 4.37-2.23 6.46-3.5.49-.3 1.03-.61 1.5-.98 1.47-.87 1.11-1.12.49-2.95-.39-1.14-.76-2.7-2.06-5.36l.02-.01Zm-17.38-21.76c3.05-.42 6.31.79 9.36 2.35.51.39.94.68 1.33.87-5.61-2.86-12.72-3.39-18.44-.79 2.05-1.33 4.24-1.95 7.74-2.44l.01.01ZM443.67 72.67c-.4-2.2-1.15-4.33-2.37-6.22-1.49-2.32-3.58-4.19-5.91-5.64-6.17-3.81-13.75-5.11-20.83-6.01-3.23-.41-6.47-.69-9.72-.92l-1.39-.12c-.85-.07-1.52-.1-2.05-.1-1.08-.06-2.17-.12-3.25-.17-.08 0-.14.02-.19.05-.1.05-.18.14-.16.3.27 2.55-.01 5.12-.92 7.52-.15.38.4.56.62.28 1.32.59 2.68 1.05 4.08 1.37 0 2.78-.14 7.58-.33 12.91 0 0 0 .02-.01.03-.61 3.66-.79 7.42-1 11.12-.23 4.01-.43 8.03-.44 12.05 0 .64 0 1.28.03 1.93.02.31 0 .68.15.96.06.11.14.16.24.17-.2.17-.21.54.11.59 3.83.67 7.78.71 11.68.25 2.3-.19 4.87-.65 7.65-1.56 1.85-.54 3.67-1.18 5.43-1.91 7.2-3.02 14.31-8.07 17.35-15.53.76-1.86 1.17-3.8 1.31-5.75.3-1.93.28-3.82-.09-5.58l.01-.02Zm-19.32-15.42c5.74 1.41 11.94 3.68 15.65 8.55.25.32.47.65.69.99-2.3-2.82-5.68-5.69-12.88-8.23-2.16-.76-4.35-1.43-6.64-2.02 1.06.21 2.13.45 3.18.71Zm-25.82-3.04c.13 0 .27.01.4.02-.14.1-.26.23-.37.38 0-.13-.02-.26-.03-.4Zm34.82 22.17c-.75 3.09-3.55 5.66-5.88 7.58-3.35 2.76-7.21 5.03-11.28 6.54-1.33.49-2.71.9-4.12 1.15.06-1.38.08-2.76.07-4.13-.02-3.78-.16-7.56-.41-11.33-.09-1.37-.18-2.74-.37-4.1 0-.06-.03-.11-.06-.15.09-3.25.12-6.16.03-8.12 6.86 1.05 10.56 2.17 14.06 3.62 5.52 2.28 8.59 5.44 7.97 8.96l-.01-.02Zm-22 16.15c-.12 0-.23-.02-.34-.03l.34-.03v.06Zm-.69-.7c0-3.13.26-8.84.47-14.51.06 1.2.11 2.41.15 3.6.15 3.6.25 7.23.09 10.83-.24.03-.48.05-.71.07v.01Zm-12.33-30.94c.37.63 2.01 1.01 3.23 1.25v.15c-1.31-.31-2.59-.73-3.83-1.29.12-.36.23-.72.33-1.09.08.48.18.84.27.98Zm13.7 31.65v-.18c3.41-.56 6.71-2.02 9.69-3.68 2.31-1.28 4.59-2.78 6.63-4.53-4.69 4.53-11.61 8.24-16.33 8.38l.01.01Zm24.07-.75c-2.05 1.93-4.37 3.56-6.83 4.95 2.7-1.78 5.52-4.03 8.42-6.87.82-.82 1.56-1.69 2.23-2.59-1.08 1.65-2.38 3.16-3.81 4.51h-.01ZM187.16 92.14c-.79-2.47-2.1-7.12-3.1-6.87-.19-.01-2.09.77-4.08 1.54-3.06 1.18-5.91 2.13-10.09 2.82-2.74.42-5.87 1.01-10.61 1.06.04-3.34.05-6.01.05-7.99 7.97-.65 12.33-2.11 16.37-3.55 1.11-.39 2.69-1.01 2.63-1.8-.08-.35-.55-1.39-1.17-2.61-.47-1.16-.98-2.31-1.61-3.38-.42-.71-1.04-1.69-1.86-2.06-.11-.08-.22-.13-.29-.12-.02 0-.04 0-.07.01-.19-.04-.39-.05-.6-.01-.17.03-.24.15-.25.28-.04.02-.09.04-.14.05-4.33 1.48-8.85 2.33-13.24 3.61a499.1 499.1 0 0 0-.31-8.19c4.51-.99 8.88-1.38 13.11-1.82 3.68-.38 6.28.12 7.47.34.59.11.9.16 1.16.18h.1c-.1.37.44.66.62.28.02-.04.03-.08.05-.13.15.2.53.22.62-.1.17-.58.19-1.21.21-1.81v-.36c.03-.15.05-.3.07-.45.52-2.47.33-5.09-.64-7.44-.11-.27-.44-.28-.6-.14-.08-.21-.15-.42-.24-.62-.19-.41-.79-.05-.6.35.03.07.05.15.09.22-.98-.42-2.15-.54-3.17-.63-2.17-.19-4.37-.14-6.54 0-5.7.35-11.4 1.3-16.91 2.79-2.08.56-4.13 1.22-6.14 2-4.54 1.05-3.79 1.51-2.17 6.07.18.51.46 1.68.54 1.94.82 2.47 1.08 2.13 3.1 2.13s0 .05 0 .08h.52c-.48 2.66-.51 5.45-.62 8.13-.15 3.48-.22 6.96-.28 10.45 0 .41-.01.82-.02 1.23-.16.29-.33.57-.51.85-.05.38-.09.77-.14 1.18-.42 3.52-.59 6.48-.52 8.8v.34c.02.47.05.76.06.87.16 1.57-.26 3.47 1.35 3.79 1.61.32 3.5.55 4.85.55.11 0 .22-.02.33-.02 1.79.24 3.67.05 5.45-.12 2.85-.28 5.69-.7 8.51-1.19 3.03-.53 6.05-1.14 9.04-1.86 2.4-.58 4.82-1.19 7.13-2.06.51-.19 1.73-.57 2.46-1.14 1.81-.68 2.18-1 1.57-2.67-.23-.62-.48-1.49-.91-2.78l-.03-.02Zm-11.12-38.71c.89.05 1.93.08 2.89.3-.33 0-.68-.02-1.06-.03-8.28-.26-14.88.75-23.97 2.51 2.41-.64 4.85-1.16 7.28-1.59 4.87-.86 9.91-1.45 14.86-1.19Zm-26.53 22.13c.03 1.71.04 3.43 0 5.14-.04 1.27-.11 2.55-.24 3.82 0-.73.02-1.46.04-2.19.05-2.26.12-4.51.22-6.77h-.02Zm6.73 27.85c.2-.1.4-.21.58-.33 1.82-.17 3.82-.24 5.94-.34-.86.11-1.72.24-2.58.33-1.27.14-2.61.31-3.93.34h-.01ZM534.48 85.44c-3.52-8.38-7.07-16.75-10.5-25.17-.63-1.54-1.25-3.09-1.86-4.65-.31-.8-.65-1.6-.87-2.43-.04-.17-.17-.24-.31-.25.1-.2 0-.51-.29-.53-1.59-.08-3.18-.22-4.78-.25-1.96-.03-3.91.13-5.84.42-.31.05-.31.38-.13.56-.03.06-.05.14-.04.22.23 1.54.63 3.06 1.16 4.53.13.35.27.7.41 1.06l-2.68 6.18c-.11.03-.2.09-.25.22-.67 1.9-1.52 3.73-2.34 5.56a536.85 536.85 0 0 1-3.9 8.45c-2.64 5.64-5.34 11.25-7.91 16.93-.44.97-.88 1.94-1.29 2.93-.2.48-.47 1-.55 1.52v.05c-.02.12.02.26.16.34 1.19.73 2.41 1.41 3.66 2.05 1.2.62 2.45 1.25 3.76 1.61.43.12.62-.55.19-.67-1.13-.31-2.2-.83-3.24-1.36 1.09.36 2.1.69 2.75.93 2.82 1.01 2.38 1.1 4.3-3.75 2.1-1.09 4.34-1.96 6.53-2.79 4.35-1.64 8.8-3.03 13.27-4.29.82 2.01 1.77 3.97 2.72 5.92.35.83.62 1.45.79 1.82.22.42.45.8.69 1.15.17.33.33.67.5 1 .42.8.84 1.63 1.4 2.35.23.29.6 0 .55-.31 1.53-.02 3.06-.07 4.58-.27.92-.12 1.82-.32 2.71-.54 1.39-.27 3.85-1.11 3.74-1.42-.67-1.96-1.55-3.87-2.34-5.78-1.57-3.78-3.16-7.56-4.75-11.33v-.01Zm-11.65-26.16c1.54 3.81 3.12 7.6 4.7 11.4 2.94 7.05 5.91 14.09 8.87 21.13l-1.06-2.17c-2.71-5.51-5.2-11.19-7.41-16.87l-6.65-17.15c-.65-1.45-.55-2.19-.93-2.53.09 0 .18.01.28.02a.29.29 0 0 0-.04.26c.52 2.02 1.47 3.98 2.25 5.91h-.01Zm-6.58 13.58c.05-.15.09-.31.14-.46 1.41 3.92 2.88 7.9 4.39 11.87-3.22.52-6.38 1.25-9.46 2.14.55-1.22 1.05-2.46 1.53-3.7 1.24-3.24 2.37-6.53 3.39-9.85h.01Zm-.23-20c.36 0 .73.03 1.09.05-2.15.1-5.18.33-5.87.74-.24.15-.41.3-.53.45-.06-.29-.13-.58-.18-.88 1.82-.26 3.65-.39 5.49-.35v-.01Zm-.09 18.72c-.49 1.67-1.05 3.33-1.6 4.97-1.07 3.19-2.19 6.38-3.57 9.46-.09.21-.19.43-.29.65-.25.07-.5.14-.74.22 2.53-6.16 4.61-11.29 6.2-15.3Zm-6.34 25.16c4.97-2.38 9.37-4.1 14.02-5.27l.26.64c-4.8 1.35-9.63 2.8-14.28 4.63Zm20.17 6.76c.33.23.68.42 1.04.56h-.33c-.12 0-.21.06-.26.13-.15-.23-.31-.45-.45-.7v.01ZM226.57 91.75c-3.55-4.74-6.68-9.11-9.31-12.99 9.2-15.25 10.05-17.81 10.35-18.38.17-.34 1.09-2.27.64-2.53-1.13-.65-1.03-.65-2.97-1.71-1.19-.65-3.04-1.61-4.53-2.12-1.71-.59-1.24-.36-3 2.77-.06.1-.11.2-.17.3-.75 1.02-1.48 2.05-2.2 3.09-1.88 2.71-3.73 5.45-5.69 8.1-3.68-4.91-6.88-8.76-9.51-11.43-.15-.15-.3-.29-.46-.42-1.27-1.28-7.24 3.53-7.93 5.58-.09.09-.19.16-.28.25-.27.26.03.64.33.58.19.65.5 1.29.94 1.91 3.85 5.06 7.19 9.76 9.94 14-1.23 2.61-3.06 5-4.67 7.38l-2.28 3.33c-.5.66-.93 1.23-1.29 1.69-.67.93-2.09 2.61-2.3 3.87-.51.85-1.16 1.84-1.29 2.83-.06.44.61.63.67.19.01-.08.04-.15.06-.22 1.36 1.08 2.76 2.11 4.19 3.11 1.3.91 2.62 1.85 4.04 2.56.21.1.4 0 .48-.17.24.07.48.14.72.2.44.1.62-.57.19-.67-2.02-.48-3.77-1.57-5.23-3.02-.47-.46-.9-.96-1.32-1.46 1.74 1.35 4.2 2.89 5.89 4.14 1.39 1.03 2.85-2.27 4.22-4.2 1.86-2.64 3.96-5.86 5.52-8.29l10.39 14.51c.67.81 1.14 1.21 1.57 1.36-.05.24.12.51.41.4 1.53-.58 3.05-1.19 4.54-1.87 1.52-.69 3.06-1.45 4.36-2.5a.28.28 0 0 0 .12-.23c1.66-1.1.81-1.74-1.41-4.91-1.13-1.58-1.71-2.36-3.7-5.01l-.03-.02Zm2.41 6.54c.56 1.15 1.19 2.52 1.11 3.81-.06.04-.12.07-.17.1-.03-.88-.55-2.66-.94-3.91Zm-16.51-32.73c1.86-2.65 3.65-5.35 5.57-7.95.4-.55.81-1.13 1.26-1.66.19-.18.38-.33.56-.45.18.03.36.08.55.13l-8.05 10.11.12-.18h-.01ZM192.7 95.48c.79-1.37 1.66-2.69 2.54-4 1.19-1.79 2.4-3.56 3.61-5.33-.04.09-.09.17-.13.26-.1.22.03.41.2.49-2.47 3.42-4.89 6.73-6.4 9.28.21.24.4.48.63.75-.24.07-.4.36-.17.56.4.33.72.77 1.05 1.17.09.11.18.21.27.32-.84-.61-1.66-1.24-2.47-1.88.24-.57.58-1.11.87-1.61v-.01Zm7.46-10.32c.47-.81.98-1.59 1.49-2.37.31-.48.64-.95.96-1.43.26-.29.52-.56.75-.79-.99 1.48-2.09 3.03-3.2 4.59Zm10.03-16.22s-.03-.05-.05-.07c.22-.29.43-.59.64-.89-.2.32-.4.65-.58.96h-.01ZM371.54 87.96c-.01-.08-.01-.16-.03-.23-.06-.38-.58-.29-.66.03-.3-.05-.6-.08-.81-.11-1.14-.15-2.29-.19-3.44-.2 1.04-.09 2.09-.18 3.14-.23.45-.02.45-.72 0-.7-6.57.35-13.14 1.23-19.65 2.11-1.53.21-3.05.42-4.57.68-.01 0-.02.01-.04.01-.04-3.33-.13-6.66-.24-9.99-.19-5.7-.4-11.41-.88-17.1-.13-1.51-.23-3.07-.49-4.58 0-.25 0-.48-.02-.68-.06-1.19-.04-2.61-.68-2.78-.16-.07-.72-.16-1.5-.24.22-.17.16-.62-.2-.63-1.19-.04-2.39.09-3.57.23-1.2.14-2.41.32-3.59.6-.16-.1-.41-.06-.5.12-.06.02-.13.03-.19.05-.35.1-.29.55-.03.66-.26.6-.19 2.27-.21 3-.02.66-.66 33.73-.9 40.3-.03.65.06 1.12.04 1.45-.16 3.05.87 4.96 6.34 3.93 1.09-.08 2.75-.77 5.36-1.43 4.13-1.04 5.78-1.52 6.2-1.65 6.43-1.69 6.78-1.97 11.72-2.43.55-.05 4.8-.38 6.03-.3.64.04 1.19.07 1.65.1.09 0 .16-.03.24-.05.1.27.56.33.66-.02.39-1.32.61-2.71.78-4.08.2-1.61.29-3.24.15-4.86.24.03.52-.23.38-.53-.09-.2-.27-.33-.49-.43v-.02Zm-.63.56c.07.57.11 1.14.11 1.71-.21-.99-.53-1.71-.95-1.87.22.03.44.06.65.11.06.01.12.04.19.05Zm-25.41 1.73c1.54-.36 3.1-.64 4.66-.89-1.61.37-3.18.77-4.66 1.2v-.31Zm-.86-7.37c-.07-1.37-.16-2.75-.25-4.12-.21-3.13-.45-6.27-.79-9.4.02-2.25.08-4.31.13-6.11.16 2.08.29 4.16.4 6.24.23 4.46.38 8.93.5 13.39h.01Zm-.94-4c.16 2.41.29 4.83.39 7.24.06 1.6.14 3.22.09 4.83-.15.05-.32.09-.47.14V78.88h-.01ZM483.72 92.83c-3.05-2.28-6.22-4.4-9.38-6.51 8.86-6.49 13.49-12.95 13.73-19.23.04-.76 0-1.5-.13-2.2-.67-3.82-3.5-6.68-8.39-8.48.13.04.27.08.4.13 3.92 1.39 7.74 4.23 8.5 8.56.34 1.95-.05 3.96-.98 5.69-.21.4.39.75.6.35 1.86-3.46 1.46-7.55-.97-10.63-3.53-4.47-9.76-5.88-15.16-6.16-2.32-.12-4.64-.04-6.95.19-6 .32-12.71 1.68-17.63 3.21-.37.11-.67.23-.92.35-.2-.17-.62.02-.57.37v.03c-.64.68-.18 1.64.48 3.21.38.91.67 1.89 1.15 2.58.32.76.68 1.51 1.13 2.19.14.21.38.19.53.07.19-.02.38-.05.57-.08v1.57c-.06.06-.1.13-.11.23-.27 4.18-.34 8.38-.48 12.57l-.3 9.03c-.24 3.91-.44 6.77-.46 7.26-.05.88-.11 1.95.07 2.81-.01.22-.02.43-.04.65 0 .11-.02.23-.03.35 0 .05-.03.27-.01.16-.05.4.5.59.64.28.05.04.12.08.2.08 1.75.13 3.5.28 5.25.3 1.69.02 3.38-.12 5.06-.32.08.23.36.39.55.15.06-.08.11-.17.16-.26.18-.09.24-.32.18-.48.05-.2.1-.4.13-.6.16-.86.25-1.74.33-2.62.11-1.17.17-2.34.23-3.51.15-.01.32-.03.52-.04.36-.03 1.73-.15 2.06-.15.39 0 .7-.02.95-.04 1.76 1.11 3.45 2.35 5.14 3.55 2.83 2.01 5.64 4.04 8.47 6.04 1.42 1 2.85 2 4.29 2.97.1.06.19.07.27.04.08 0 .17-.02.25-.1 1.61-1.56 3.15-3.18 4.6-4.88.75-.88 1.49-1.78 2.15-2.73.01.01.03.02.04.03.34.3.83-.2.49-.49-2.16-1.9-4.34-3.76-6.64-5.48l.03-.01Zm-6.38-3.65a55.72 55.72 0 0 0-4-2.13c.14-.1.26-.19.4-.29 1.2.81 2.4 1.61 3.6 2.42Zm-20.1 11.78c.67-.37 1.23-.91 1.67-1.6-.11.5-.24 1-.38 1.49-.43.04-.86.08-1.29.11Zm2.38-37.24c1.34-.31 2.56-.52 3.71-.69-1.03.19-2.04.41-3.04.65-.14-.07-.34-.02-.45.11-.07.02-.15.04-.22.05v-.13.01Zm.04.84c.07-.02.14-.03.2-.05.34 1.66.41 3.41.5 5.09.17 2.9.24 5.81.28 8.71l.03 3.17c-.17.07-.34.14-.51.2-.06-4.96-.21-10.58-.51-17.12h.01Zm16.04 5.62c-1.16 2.25-3.06 4.1-5.02 5.66-2.8 2.23-5.99 3.97-9.3 5.35-.01-3.56-.09-7.12-.27-10.67-.1-2.04-.16-4.16-.57-6.18 3.3-.78 6.72-1.36 10.1-1.1 1.85.14 4.23.59 5.32 2.29.92 1.43.46 3.24-.26 4.65Zm.85-.18c.6-1.37.9-2.92.28-4.32-.67-1.52-2.2-2.32-3.76-2.74.46.1.89.21 1.29.37 1.74.67 2.69 1.88 2.93 3.21.2 1.13-.05 2.25-.74 3.47V70Zm-27.47-4.14c-.12-.19-.23-.38-.34-.57.74.42.85.36.99.41v.08c-.22.03-.43.06-.65.08Zm11.21 30.46c-.08 1.08-.16 2.17-.33 3.24-.05.35-.11.69-.2 1.03 0 .04-.02.07-.03.11-.15.02-.3.04-.45.05.45-1.64.76-3.36.79-5.07.03-.29.08-.57.1-.89-.03-.31-.03-.47.24-.57-.04.69-.07 1.39-.12 2.08v.02Zm5.6-2.47c.48.11.92.52 2.49 1.72-.46-.32-.92-.65-1.38-.97-.37-.25-.73-.5-1.1-.75h-.01Zm21.23 7.24a70.76 70.76 0 0 1-4.37 4.63c-.14-.09-.27-.19-.4-.28.19-.09.37-.24.55-.47.87-1.14 5.43-5.51 5.49-7.45.31.26.62.53.92.79-.67.97-1.42 1.88-2.19 2.77v.01Z",fill:"currentColor",transform:"translate(-144.023 -51.76)"})]}),_1e=({style:e,size:t="small",withText:n})=>m.jsxs("div",{className:`ExcalidrawLogo is-${t}`,style:e,children:[m.jsx(C1e,{}),n&&m.jsx(S1e,{})]}),ox=({icon:e,shortcut:t,children:n})=>{let r=Yn();return m.jsxs(m.Fragment,{children:[m.jsx("div",{className:"welcome-screen-menu-item__icon",children:e}),m.jsx("div",{className:"welcome-screen-menu-item__text",children:n}),t&&!r.editor.isMobile&&m.jsx("div",{className:"welcome-screen-menu-item__shortcut",children:t})]})};ox.displayName="WelcomeScreenMenuItemContent";var o0=({onSelect:e,children:t,icon:n,shortcut:r,className:i="",...a})=>m.jsx("button",{...a,type:"button",className:`welcome-screen-menu-item ${i}`,onClick:e,children:m.jsx(ox,{icon:n,shortcut:r,children:t})});o0.displayName="WelcomeScreenMenuItem";var NN=({children:e,href:t,icon:n,shortcut:r,className:i="",...a})=>m.jsx("a",{...a,className:`welcome-screen-menu-item ${i}`,href:t,target:"_blank",rel:"noreferrer",children:m.jsx(ox,{icon:n,shortcut:r,children:e})});NN.displayName="WelcomeScreenMenuItemLink";var ul=({children:e})=>{let{WelcomeScreenCenterTunnel:t}=yi();return m.jsx(t.In,{children:m.jsx("div",{className:"welcome-screen-center",children:e||m.jsxs(m.Fragment,{children:[m.jsx(lx,{}),m.jsx(cx,{children:D("welcomeScreen.defaults.center_heading")}),m.jsxs(dx,{children:[m.jsx(hx,{}),m.jsx(ux,{})]})]})})})};ul.displayName="Center";var lx=({children:e})=>m.jsx("div",{className:"welcome-screen-center__logo excalifont welcome-screen-decor",children:e||m.jsx(_1e,{withText:!0})});lx.displayName="Logo";var cx=({children:e})=>m.jsx("div",{className:"welcome-screen-center__heading welcome-screen-decor excalifont",children:e});cx.displayName="Heading";var dx=({children:e})=>m.jsx("div",{className:"welcome-screen-menu",children:e});dx.displayName="Menu";var ux=()=>{let e=vi();return m.jsx(o0,{onSelect:()=>e.executeAction(V7),shortcut:"?",icon:Cv,children:D("helpDialog.title")})};ux.displayName="MenuItemHelp";var hx=()=>{let e=Nr(),t=vi();return e.viewModeEnabled?null:m.jsx(o0,{onSelect:()=>t.executeAction(b8),shortcut:Rr("loadScene"),icon:Sv,children:D("buttons.load")})};hx.displayName="MenuItemLoadScene";var ON=({onSelect:e})=>{let{t}=vr();return m.jsx(o0,{shortcut:null,onSelect:e,icon:ZI,children:t("labels.liveCollaboration")})};ON.displayName="MenuItemLiveCollaborationTrigger";ul.Logo=lx;ul.Heading=cx;ul.Menu=dx;ul.MenuItem=o0;ul.MenuItemLink=NN;ul.MenuItemHelp=ux;ul.MenuItemLoadScene=hx;ul.MenuItemLiveCollaborationTrigger=ON;var k1e=({children:e})=>{let{WelcomeScreenMenuHintTunnel:t}=yi();return m.jsx(t.In,{children:m.jsxs("div",{className:"excalifont welcome-screen-decor welcome-screen-decor-hint welcome-screen-decor-hint--menu",children:[mG,m.jsx("div",{className:"welcome-screen-decor-hint__label",children:e||D("welcomeScreen.defaults.menuHint")})]})})};k1e.displayName="MenuHint";var T1e=({children:e})=>{let{WelcomeScreenToolbarHintTunnel:t}=yi();return m.jsx(t.In,{children:m.jsxs("div",{className:"excalifont welcome-screen-decor welcome-screen-decor-hint welcome-screen-decor-hint--toolbar",children:[m.jsx("div",{className:"welcome-screen-decor-hint__label",children:e||D("welcomeScreen.defaults.toolbarHint")}),UG]})})};T1e.displayName="ToolbarHint";var M1e=({children:e})=>{let{WelcomeScreenHelpHintTunnel:t}=yi();return m.jsx(t.In,{children:m.jsxs("div",{className:"excalifont welcome-screen-decor welcome-screen-decor-hint welcome-screen-decor-hint--help",children:[m.jsx("div",{children:e||D("welcomeScreen.defaults.helpHint")}),gG]})})};M1e.displayName="HelpHint";F1((e,t,n)=>{if(mt.DEV||mt.MODE===fi.TEST||window!=null&&window.DEBUG_FRACTIONAL_INDICES){let r=Jo(e.map(i=>({...i})));Bv(r,{shouldThrow:mt.DEV||mt.MODE===fi.TEST,includeBoundTextValidation:!0,reconciliationContext:{localElements:t,remoteElements:n}})}},1e3*60,{leading:!0,trailing:!1});E1e();var I1e=e=>{var z,Y,K,G;let{onChange:t,initialData:n,excalidrawAPI:r,isCollaborating:i=!1,onPointerUpdate:a,renderTopRightUI:s,langCode:o=Wd.code,viewModeEnabled:c,zenModeEnabled:d,gridModeEnabled:l,libraryReturnUrl:h,theme:f,name:g,renderCustomStats:U,onPaste:y,detectScroll:v=!0,handleKeyboardGlobally:x=!1,onLibraryChange:w,autoFocus:C=!1,generateIdForFile:S,onLinkOpen:k,generateLinkForSelection:M,onPointerDown:T,onPointerUp:R,onScrollChange:j,onDuplicate:P,children:N,validateEmbeddable:F,renderEmbeddable:$,aiEnabled:q,showDeprecatedFonts:W}=e,V=(z=e.UIOptions)==null?void 0:z.canvasActions,B={...e.UIOptions,canvasActions:{...XE.canvasActions,...V},tools:{image:((K=(Y=e.UIOptions)==null?void 0:Y.tools)==null?void 0:K.image)??!0}};return V!=null&&V.export&&(B.canvasActions.export.saveFileToDisk=((G=V.export)==null?void 0:G.saveFileToDisk)??XE.canvasActions.export.saveFileToDisk),B.canvasActions.toggleTheme===null&&typeof f>"u"&&(B.canvasActions.toggleTheme=!0),I.useEffect(()=>{(async()=>await ye(()=>import("./roundRect-0PYZxl1G.js"),[],import.meta.url))();let ee=de=>{typeof de.scale=="number"&&de.scale!==1&&de.preventDefault()};return document.addEventListener("touchmove",ee,{passive:!1}),()=>{document.removeEventListener("touchmove",ee)}},[]),m.jsx(xce,{store:Za,children:m.jsx(Sce,{langCode:o,theme:f,children:m.jsx(x1e,{onChange:t,initialData:n,excalidrawAPI:r,isCollaborating:i,onPointerUpdate:a,renderTopRightUI:s,langCode:o,viewModeEnabled:c,zenModeEnabled:d,gridModeEnabled:l,libraryReturnUrl:h,theme:f,name:g,renderCustomStats:U,UIOptions:B,onPaste:y,detectScroll:v,handleKeyboardGlobally:x,onLibraryChange:w,autoFocus:C,generateIdForFile:S,onLinkOpen:k,generateLinkForSelection:M,onPointerDown:T,onPointerUp:R,onScrollChange:j,onDuplicate:P,validateEmbeddable:F,renderEmbeddable:$,aiEnabled:q!==!1,showDeprecatedFonts:W,children:N})})})},A1e=(e,t)=>{if(e.children!==t.children)return!1;let{initialData:n,UIOptions:r={},...i}=e,{initialData:a,UIOptions:s={},...o}=t,c=Object.keys(r),d=Object.keys(s);return c.length!==d.length?!1:c.every(l=>l==="canvasActions"?Object.keys(r.canvasActions).every(h=>{var f,g,U,y;return h==="export"&&((f=r==null?void 0:r.canvasActions)!=null&&f.export)&&((g=s==null?void 0:s.canvasActions)!=null&&g.export)?r.canvasActions.export.saveFileToDisk===s.canvasActions.export.saveFileToDisk:((U=r==null?void 0:r.canvasActions)==null?void 0:U[h])===((y=s==null?void 0:s.canvasActions)==null?void 0:y[h])}):r[l]===s[l])&&yr(i,o)},fx=ke.memo(I1e,A1e);fx.displayName="Excalidraw";const L1e=Object.freeze(Object.defineProperty({__proto__:null,Button:jd,CaptureUpdateAction:le,DEFAULT_LASER_COLOR:gI,DefaultSidebar:_8,Excalidraw:fx,FONT_FAMILY:un,Footer:PN,MIME_TYPES:We,MainMenu:Zt,ROUNDNESS:Nn,Sidebar:Ha,Stats:d6,THEME:wt,TTDDialog:EN,UserIdleState:EI,bumpVersion:e0,convertToExcalidrawElements:Sh,defaultLang:Wd,elementPartiallyOverlapsWithOrContainsBBox:BL,elementsOverlappingBBox:zL,exportToBlob:$L,exportToCanvas:Q1,exportToSvg:zU,getCommonBounds:Dt,getDataURL:Z3,getFreeDrawSvgPath:Lv,getNonDeletedElements:Vt,getTextFromElements:nL,getVisibleSceneBounds:OA,hashString:rR,isElementLink:qu,isInvisiblySmallElement:Ad,isLinearElement:st,languages:e6,loadFromBlob:b7,loadLibraryFromBlob:cR,loadSceneOrLibraryFromBlob:U7,mergeLibraryItems:pP,mutateElement:me,newElementWith:ct,normalizeLink:Ui,restore:Z1,restoreAppState:DL,restoreElements:$U,restoreLibraryItems:BU,sceneCoordsToViewportCoords:oa,serializeAsJSON:q1,serializeLibraryAsJSON:Hv,useDevice:Yn,useI18n:vr,viewportCoordsToSceneCoords:Yt,zoomToFitBounds:tP},Symbol.toStringTag,{value:"Module"})),h6=20,R1e={rect:"rectangle",circle:"ellipse"},Rk={startOnLoad:!1,flowchart:{curve:"linear"},themeVariables:{fontSize:`${h6*1.25}px`},maxEdges:500,maxTextSize:5e4};class f6{constructor({converter:t}){this.convert=(n,r)=>this.converter(n,{...r,fontSize:r.fontSize||h6}),this.converter=t}}var ed;(function(e){e.ROUND="round",e.STADIUM="stadium",e.DOUBLECIRCLE="doublecircle",e.CIRCLE="circle",e.DIAMOND="diamond"})(ed||(ed={}));var A8;(function(e){e.COLOR="color"})(A8||(A8={}));var Wu;(function(e){e.FILL="fill",e.STROKE="stroke",e.STROKE_WIDTH="stroke-width",e.STROKE_DASHARRAY="stroke-dasharray"})(Wu||(Wu={}));var Kf={},Dk;function D1e(){if(Dk)return Kf;Dk=1,Object.defineProperty(Kf,"__esModule",{value:!0}),Kf.removeMarkdown=void 0;var e=function(t,n){n===void 0&&(n={listUnicodeChar:""}),n=n||{},n.listUnicodeChar=n.hasOwnProperty("listUnicodeChar")?n.listUnicodeChar:!1,n.stripListLeaders=n.hasOwnProperty("stripListLeaders")?n.stripListLeaders:!0,n.gfm=n.hasOwnProperty("gfm")?n.gfm:!0,n.useImgAltText=n.hasOwnProperty("useImgAltText")?n.useImgAltText:!0,n.preserveLinks=n.hasOwnProperty("preserveLinks")?n.preserveLinks:!1;var r=t||"";r=r.replace(/^(-\s*?|\*\s*?|_\s*?){3,}\s*$/gm,"");try{n.stripListLeaders&&(n.listUnicodeChar?r=r.replace(/^([\s\t]*)([\*\-\+]|\d+\.)\s+/gm,n.listUnicodeChar+" $1"):r=r.replace(/^([\s\t]*)([\*\-\+]|\d+\.)\s+/gm,"$1")),n.gfm&&(r=r.replace(/\n={2,}/g,`
255
- `).replace(/~{3}.*\n/g,"").replace(/~~/g,"").replace(/`{3}.*\n/g,"")),n.preserveLinks&&(r=r.replace(/\[(.*?)\][\[\(](.*?)[\]\)]/g,"$1 ($2)")),r=r.replace(/<[^>]*>/g,"").replace(/^[=\-]{2,}\s*$/g,"").replace(/\[\^.+?\](\: .*?$)?/g,"").replace(/\s{0,2}\[.*?\]: .*?$/g,"").replace(/\!\[(.*?)\][\[\(].*?[\]\)]/g,n.useImgAltText?"$1":"").replace(/\[(.*?)\][\[\(].*?[\]\)]/g,"$1").replace(/^\s{0,3}>\s?/g,"").replace(/(^|\n)\s{0,3}>\s?/g,`
256
-
257
- `).replace(/^\s{1,2}\[(.*?)\]: (\S+)( ".*?")?\s*$/g,"").replace(/^(\n)?\s{0,}#{1,6}\s+| {0,}(\n)?\s{0,}#{0,} {0,}(\n)?\s{0,}$/gm,"$1$2$3").replace(/([\*_]{1,3})(\S.*?\S{0,1})\1/g,"$2").replace(/([\*_]{1,3})(\S.*?\S{0,1})\1/g,"$2").replace(/(`{3,})(.*?)\1/gm,"$2").replace(/`(.+?)`/g,"$1").replace(/\n{2,}/g,`
258
-
259
- `)}catch(i){return console.error(i),t}return r};return Kf.removeMarkdown=e,Kf}var j1e=D1e();const P1e={arrow_circle:{endArrowhead:"dot"},arrow_cross:{endArrowhead:"bar"},arrow_open:{endArrowhead:null,startArrowhead:null},double_arrow_circle:{endArrowhead:"dot",startArrowhead:"dot"},double_arrow_cross:{endArrowhead:"bar",startArrowhead:"bar"},double_arrow_point:{endArrowhead:"arrow",startArrowhead:"arrow"}},N1e=e=>P1e[e],Zm=e=>{let t=e.text;return e.labelType==="markdown"&&(t=j1e.removeMarkdown(e.text)),O1e(t)},O1e=e=>{const t=/\s?(fa|fab):[a-zA-Z0-9-]+/g;return e.replace(t,"")},F1e=e=>{const t={};return Object.keys(e).forEach(n=>{var r;switch(n){case Wu.FILL:{t.backgroundColor=e[n],t.fillStyle="solid";break}case Wu.STROKE:{t.strokeColor=e[n];break}case Wu.STROKE_WIDTH:{t.strokeWidth=Number((r=e[n])==null?void 0:r.split("px")[0]);break}case Wu.STROKE_DASHARRAY:{t.strokeStyle="dashed";break}}}),t},$1e=e=>{const t={};return Object.keys(e).forEach(n=>{switch(n){case A8.COLOR:{t.strokeColor=e[n];break}}}),t},B1e=e=>{const t={};e.subGraphs.map(r=>{r.nodeIds.forEach(i=>{t[r.id]={id:r.id,parent:null,isLeaf:!1},t[i]={id:i,parent:r.id,isLeaf:e.vertices[i]!==void 0}})});const n={};return[...Object.keys(e.vertices),...e.subGraphs.map(r=>r.id)].forEach(r=>{if(!t[r])return;let i=t[r];const a=[];for(i.isLeaf||a.push(`subgraph_group_${i.id}`);i.parent;)a.push(`subgraph_group_${i.parent}`),i=t[i.parent];n[r]=a}),{getGroupIds:r=>n[r]||[],getParentId:r=>t[r]?t[r].parent:null}},z1e=new f6({converter:(e,t)=>{const n=[],r=t.fontSize,{getGroupIds:i,getParentId:a}=B1e(e);return e.subGraphs.reverse().forEach(s=>{const o=i(s.id),c={id:s.id,type:"rectangle",groupIds:o,x:s.x,y:s.y,width:s.width,height:s.height,label:{groupIds:o,text:Zm(s),fontSize:r,verticalAlign:"top"}};n.push(c)}),Object.values(e.vertices).forEach(s=>{if(!s)return;const o=i(s.id),c=F1e(s.containerStyle),d=$1e(s.labelStyle);let l={id:s.id,type:"rectangle",groupIds:o,x:s.x,y:s.y,width:s.width,height:s.height,strokeWidth:2,label:{groupIds:o,text:Zm(s),fontSize:r,...d},link:s.link||null,...c};switch(s.type){case ed.STADIUM:{l={...l,roundness:{type:3}};break}case ed.ROUND:{l={...l,roundness:{type:3}};break}case ed.DOUBLECIRCLE:{o.push(`doublecircle_${s.id}}`);const f={type:"ellipse",groupIds:o,x:s.x+5,y:s.y+5,width:s.width-5*2,height:s.height-5*2,strokeWidth:2,roundness:{type:3},label:{groupIds:o,text:Zm(s),fontSize:r}};l={...l,groupIds:o,type:"ellipse"},n.push(f);break}case ed.CIRCLE:{l.type="ellipse";break}case ed.DIAMOND:{l.type="diamond";break}}n.push(l)}),e.edges.forEach(s=>{let o=[];const c=a(s.start),d=a(s.end);c&&c===d&&(o=i(c));const{startX:l,startY:h,reflectionPoints:f}=s,g=f.map(C=>[C.x-f[0].x,C.y-f[0].y]),U=N1e(s.type),v={id:`${s.start}_${s.end}`,type:"arrow",groupIds:o,x:l,y:h,strokeWidth:s.stroke==="thick"?4:2,strokeStyle:s.stroke==="dotted"?"dashed":void 0,points:g,...s.text?{label:{text:Zm(s),fontSize:r,groupIds:o}}:{},roundness:{type:2},...U},x=n.find(C=>C.id===s.start),w=n.find(C=>C.id===s.end);!x||!w||(v.start={id:x.id||""},v.end={id:w.id||""},n.push(v))}),{elements:n}}});let Xo=(e=21)=>crypto.getRandomValues(new Uint8Array(e)).reduce((t,n)=>(n&=63,n<36?t+=n.toString(36):n<62?t+=(n-26).toString(36).toUpperCase():n>62?t+="-":t+="_",t),"");const H1e=new f6({converter:e=>{const t=Xo(),{width:n,height:r}=e,i={type:"image",x:0,y:0,width:n,height:r,status:"saved",fileId:t};return{files:{[t]:{id:t,mimeType:e.mimeType,dataURL:e.dataURL}},elements:[i]}}}),px=e=>e.replace(/\\n/g,`
260
- `),Bp=e=>{const t={type:"line",x:e.startX,y:e.startY,points:[[0,0],[e.endX-e.startX,e.endY-e.startY]],width:e.endX-e.startX,height:e.endY-e.startY,strokeStyle:e.strokeStyle||"solid",strokeColor:e.strokeColor||"#000",strokeWidth:e.strokeWidth||1};return e.groupId&&Object.assign(t,{groupIds:[e.groupId]}),e.id&&Object.assign(t,{id:e.id}),t},B2=e=>{const t={type:"text",x:e.x,y:e.y,width:e.width,height:e.height,text:px(e.text)||"",fontSize:e.fontSize,verticalAlign:"middle"};return e.groupId&&Object.assign(t,{groupIds:[e.groupId]}),e.id&&Object.assign(t,{id:e.id}),t},vp=e=>{var r,i,a,s;let t={};e.type==="rectangle"&&e.subtype==="activation"&&(t={backgroundColor:"#e9ecef",fillStyle:"solid"});const n={id:e.id,type:e.type,x:e.x,y:e.y,width:e.width,height:e.height,label:{text:px(((r=e==null?void 0:e.label)==null?void 0:r.text)||""),fontSize:(i=e==null?void 0:e.label)==null?void 0:i.fontSize,verticalAlign:((a=e.label)==null?void 0:a.verticalAlign)||"middle",strokeColor:((s=e.label)==null?void 0:s.color)||"#000",groupIds:e.groupId?[e.groupId]:[]},strokeStyle:e==null?void 0:e.strokeStyle,strokeWidth:e==null?void 0:e.strokeWidth,strokeColor:e==null?void 0:e.strokeColor,backgroundColor:e==null?void 0:e.bgColor,fillStyle:"solid",...t};return e.groupId&&Object.assign(n,{groupIds:[e.groupId]}),n},FN=e=>{var n;const t={type:"arrow",x:e.startX,y:e.startY,points:e.points||[[0,0],[e.endX-e.startX,e.endY-e.startY]],width:e.endX-e.startX,height:e.endY-e.startY,strokeStyle:(e==null?void 0:e.strokeStyle)||"solid",endArrowhead:(e==null?void 0:e.endArrowhead)||null,startArrowhead:(e==null?void 0:e.startArrowhead)||null,label:{text:px(((n=e==null?void 0:e.label)==null?void 0:n.text)||""),fontSize:16},roundness:{type:2},start:e.start,end:e.end};return e.groupId&&Object.assign(t,{groupIds:[e.groupId]}),t},W1e=new f6({converter:e=>{const t=[],n=[];if(Object.values(e.nodes).forEach(r=>{!r||!r.length||r.forEach(i=>{let a;switch(i.type){case"line":a=Bp(i);break;case"rectangle":case"ellipse":a=vp(i);break;case"text":a=B2(i);break;default:throw`unknown type ${i.type}`}i.type==="rectangle"&&(i==null?void 0:i.subtype)==="activation"?n.push(a):t.push(a)})}),Object.values(e.lines).forEach(r=>{r&&t.push(Bp(r))}),Object.values(e.arrows).forEach(r=>{r&&(t.push(FN(r)),r.sequenceNumber&&t.push(vp(r.sequenceNumber)))}),t.push(...n),e.loops){const{lines:r,texts:i,nodes:a}=e.loops;r.forEach(s=>{t.push(Bp(s))}),i.forEach(s=>{t.push(B2(s))}),a.forEach(s=>{t.push(vp(s))})}return e.groups&&e.groups.forEach(r=>{const{actorKeys:i,name:a}=r;let s=1/0,o=1/0,c=0,d=0;if(!i.length)return;t.filter(k=>{if(k.id){const M=k.id.indexOf("-"),T=k.id.substring(0,M);return i.includes(T)}}).forEach(k=>{if(k.x===void 0||k.y===void 0||k.width===void 0||k.height===void 0)throw new Error(`Actor attributes missing ${k}`);s=Math.min(s,k.x),o=Math.min(o,k.y),c=Math.max(c,k.x+k.width),d=Math.max(d,k.y+k.height)});const h=10,f=s-h,g=o-h,U=c-s+h*2,y=d-o+h*2,v=Xo(),x=vp({type:"rectangle",x:f,y:g,width:U,height:y,bgColor:r.fill,id:v});t.unshift(x);const w=Xo(),C=[v];t.forEach(k=>{if(k.type!=="frame"){if(k.x===void 0||k.y===void 0||k.width===void 0||k.height===void 0)throw new Error(`Element attributes missing ${k}`);if(k.x>=s&&k.x+k.width<=c&&k.y>=o&&k.y+k.height<=d){const M=k.id||Xo();k.id||Object.assign(k,{id:M}),C.push(M)}}});const S={type:"frame",id:w,name:a,children:C};t.push(S)}),{elements:t}}}),X1e=new f6({converter:e=>{const t=[];return Object.values(e.nodes).forEach(n=>{!n||!n.length||n.forEach(r=>{let i;switch(r.type){case"line":i=Bp(r);break;case"rectangle":case"ellipse":i=vp(r);break;case"text":i=B2(r);break;default:throw`unknown type ${r.type}`}t.push(i)})}),Object.values(e.lines).forEach(n=>{n&&t.push(Bp(n))}),Object.values(e.arrows).forEach(n=>{if(!n)return;const r=FN(n);t.push(r)}),Object.values(e.text).forEach(n=>{const r=B2(n);t.push(r)}),Object.values(e.namespaces).forEach(n=>{const r=Object.keys(n.classes),i=[...r],a=[...e.lines,...e.arrows,...e.text];r.forEach(o=>{const c=a.filter(d=>d.metadata&&d.metadata.classId===o).map(d=>d.id);c.length&&i.push(...c)});const s={type:"frame",id:Xo(),name:n.id,children:i};t.push(s)}),{elements:t}}}),V1e=(e,t={})=>{switch(e.type){case"graphImage":return H1e.convert(e,t);case"flowchart":return z1e.convert(e,t);case"sequence":return W1e.convert(e,t);case"class":return X1e.convert(e,t);default:throw new Error(`graphToExcalidraw: unknown graph type "${e.type}, only flowcharts are supported!"`)}};function Y1e(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=Array.from(typeof e=="string"?[e]:e);r[r.length-1]=r[r.length-1].replace(/\r?\n([\t ]*)$/,"");var i=r.reduce(function(o,c){var d=c.match(/\n([\t ]+|(?!\s).)/g);return d?o.concat(d.map(function(l){var h,f;return(f=(h=l.match(/[\t ]/g))===null||h===void 0?void 0:h.length)!==null&&f!==void 0?f:0})):o},[]);if(i.length){var a=new RegExp(`
261
- [ ]{`+Math.min.apply(Math,i)+"}","g");r=r.map(function(o){return o.replace(a,`
262
- `)})}r[0]=r[0].replace(/^\r?\n/,"");var s=r[0];return t.forEach(function(o,c){var d=s.match(/(?:^|\n)( *)$/),l=d?d[1]:"",h=o;typeof o=="string"&&o.includes(`
263
- `)&&(h=String(o).split(`
264
- `).map(function(f,g){return g===0?f:""+l+f}).join(`
265
- `)),s+=h+r[c+1]}),s}var Ng={exports:{}},G1e=Ng.exports,jk;function q1e(){return jk||(jk=1,function(e,t){(function(n,r){e.exports=r()})(G1e,function(){var n=1e3,r=6e4,i=36e5,a="millisecond",s="second",o="minute",c="hour",d="day",l="week",h="month",f="quarter",g="year",U="date",y="Invalid Date",v=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,x=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,w={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(q){var W=["th","st","nd","rd"],V=q%100;return"["+q+(W[(V-20)%10]||W[V]||W[0])+"]"}},C=function(q,W,V){var B=String(q);return!B||B.length>=W?q:""+Array(W+1-B.length).join(V)+q},S={s:C,z:function(q){var W=-q.utcOffset(),V=Math.abs(W),B=Math.floor(V/60),z=V%60;return(W<=0?"+":"-")+C(B,2,"0")+":"+C(z,2,"0")},m:function q(W,V){if(W.date()<V.date())return-q(V,W);var B=12*(V.year()-W.year())+(V.month()-W.month()),z=W.clone().add(B,h),Y=V-z<0,K=W.clone().add(B+(Y?-1:1),h);return+(-(B+(V-z)/(Y?z-K:K-z))||0)},a:function(q){return q<0?Math.ceil(q)||0:Math.floor(q)},p:function(q){return{M:h,y:g,w:l,d,D:U,h:c,m:o,s,ms:a,Q:f}[q]||String(q||"").toLowerCase().replace(/s$/,"")},u:function(q){return q===void 0}},k="en",M={};M[k]=w;var T="$isDayjsObject",R=function(q){return q instanceof F||!(!q||!q[T])},j=function q(W,V,B){var z;if(!W)return k;if(typeof W=="string"){var Y=W.toLowerCase();M[Y]&&(z=Y),V&&(M[Y]=V,z=Y);var K=W.split("-");if(!z&&K.length>1)return q(K[0])}else{var G=W.name;M[G]=W,z=G}return!B&&z&&(k=z),z||!B&&k},P=function(q,W){if(R(q))return q.clone();var V=typeof W=="object"?W:{};return V.date=q,V.args=arguments,new F(V)},N=S;N.l=j,N.i=R,N.w=function(q,W){return P(q,{locale:W.$L,utc:W.$u,x:W.$x,$offset:W.$offset})};var F=function(){function q(V){this.$L=j(V.locale,null,!0),this.parse(V),this.$x=this.$x||V.x||{},this[T]=!0}var W=q.prototype;return W.parse=function(V){this.$d=function(B){var z=B.date,Y=B.utc;if(z===null)return new Date(NaN);if(N.u(z))return new Date;if(z instanceof Date)return new Date(z);if(typeof z=="string"&&!/Z$/i.test(z)){var K=z.match(v);if(K){var G=K[2]-1||0,ee=(K[7]||"0").substring(0,3);return Y?new Date(Date.UTC(K[1],G,K[3]||1,K[4]||0,K[5]||0,K[6]||0,ee)):new Date(K[1],G,K[3]||1,K[4]||0,K[5]||0,K[6]||0,ee)}}return new Date(z)}(V),this.init()},W.init=function(){var V=this.$d;this.$y=V.getFullYear(),this.$M=V.getMonth(),this.$D=V.getDate(),this.$W=V.getDay(),this.$H=V.getHours(),this.$m=V.getMinutes(),this.$s=V.getSeconds(),this.$ms=V.getMilliseconds()},W.$utils=function(){return N},W.isValid=function(){return this.$d.toString()!==y},W.isSame=function(V,B){var z=P(V);return this.startOf(B)<=z&&z<=this.endOf(B)},W.isAfter=function(V,B){return P(V)<this.startOf(B)},W.isBefore=function(V,B){return this.endOf(B)<P(V)},W.$g=function(V,B,z){return N.u(V)?this[B]:this.set(z,V)},W.unix=function(){return Math.floor(this.valueOf()/1e3)},W.valueOf=function(){return this.$d.getTime()},W.startOf=function(V,B){var z=this,Y=!!N.u(B)||B,K=N.p(V),G=function($e,je){var Je=N.w(z.$u?Date.UTC(z.$y,je,$e):new Date(z.$y,je,$e),z);return Y?Je:Je.endOf(d)},ee=function($e,je){return N.w(z.toDate()[$e].apply(z.toDate("s"),(Y?[0,0,0,0]:[23,59,59,999]).slice(je)),z)},de=this.$W,xe=this.$M,ve=this.$D,Me="set"+(this.$u?"UTC":"");switch(K){case g:return Y?G(1,0):G(31,11);case h:return Y?G(1,xe):G(0,xe+1);case l:var Ce=this.$locale().weekStart||0,ge=(de<Ce?de+7:de)-Ce;return G(Y?ve-ge:ve+(6-ge),xe);case d:case U:return ee(Me+"Hours",0);case c:return ee(Me+"Minutes",1);case o:return ee(Me+"Seconds",2);case s:return ee(Me+"Milliseconds",3);default:return this.clone()}},W.endOf=function(V){return this.startOf(V,!1)},W.$set=function(V,B){var z,Y=N.p(V),K="set"+(this.$u?"UTC":""),G=(z={},z[d]=K+"Date",z[U]=K+"Date",z[h]=K+"Month",z[g]=K+"FullYear",z[c]=K+"Hours",z[o]=K+"Minutes",z[s]=K+"Seconds",z[a]=K+"Milliseconds",z)[Y],ee=Y===d?this.$D+(B-this.$W):B;if(Y===h||Y===g){var de=this.clone().set(U,1);de.$d[G](ee),de.init(),this.$d=de.set(U,Math.min(this.$D,de.daysInMonth())).$d}else G&&this.$d[G](ee);return this.init(),this},W.set=function(V,B){return this.clone().$set(V,B)},W.get=function(V){return this[N.p(V)]()},W.add=function(V,B){var z,Y=this;V=Number(V);var K=N.p(B),G=function(xe){var ve=P(Y);return N.w(ve.date(ve.date()+Math.round(xe*V)),Y)};if(K===h)return this.set(h,this.$M+V);if(K===g)return this.set(g,this.$y+V);if(K===d)return G(1);if(K===l)return G(7);var ee=(z={},z[o]=r,z[c]=i,z[s]=n,z)[K]||1,de=this.$d.getTime()+V*ee;return N.w(de,this)},W.subtract=function(V,B){return this.add(-1*V,B)},W.format=function(V){var B=this,z=this.$locale();if(!this.isValid())return z.invalidDate||y;var Y=V||"YYYY-MM-DDTHH:mm:ssZ",K=N.z(this),G=this.$H,ee=this.$m,de=this.$M,xe=z.weekdays,ve=z.months,Me=z.meridiem,Ce=function(je,Je,ut,zt){return je&&(je[Je]||je(B,Y))||ut[Je].slice(0,zt)},ge=function(je){return N.s(G%12||12,je,"0")},$e=Me||function(je,Je,ut){var zt=je<12?"AM":"PM";return ut?zt.toLowerCase():zt};return Y.replace(x,function(je,Je){return Je||function(ut){switch(ut){case"YY":return String(B.$y).slice(-2);case"YYYY":return N.s(B.$y,4,"0");case"M":return de+1;case"MM":return N.s(de+1,2,"0");case"MMM":return Ce(z.monthsShort,de,ve,3);case"MMMM":return Ce(ve,de);case"D":return B.$D;case"DD":return N.s(B.$D,2,"0");case"d":return String(B.$W);case"dd":return Ce(z.weekdaysMin,B.$W,xe,2);case"ddd":return Ce(z.weekdaysShort,B.$W,xe,3);case"dddd":return xe[B.$W];case"H":return String(G);case"HH":return N.s(G,2,"0");case"h":return ge(1);case"hh":return ge(2);case"a":return $e(G,ee,!0);case"A":return $e(G,ee,!1);case"m":return String(ee);case"mm":return N.s(ee,2,"0");case"s":return String(B.$s);case"ss":return N.s(B.$s,2,"0");case"SSS":return N.s(B.$ms,3,"0");case"Z":return K}return null}(je)||K.replace(":","")})},W.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},W.diff=function(V,B,z){var Y,K=this,G=N.p(B),ee=P(V),de=(ee.utcOffset()-this.utcOffset())*r,xe=this-ee,ve=function(){return N.m(K,ee)};switch(G){case g:Y=ve()/12;break;case h:Y=ve();break;case f:Y=ve()/3;break;case l:Y=(xe-de)/6048e5;break;case d:Y=(xe-de)/864e5;break;case c:Y=xe/i;break;case o:Y=xe/r;break;case s:Y=xe/n;break;default:Y=xe}return z?Y:N.a(Y)},W.daysInMonth=function(){return this.endOf(h).$D},W.$locale=function(){return M[this.$L]},W.locale=function(V,B){if(!V)return this.$L;var z=this.clone(),Y=j(V,B,!0);return Y&&(z.$L=Y),z},W.clone=function(){return N.w(this.$d,this)},W.toDate=function(){return new Date(this.valueOf())},W.toJSON=function(){return this.isValid()?this.toISOString():null},W.toISOString=function(){return this.$d.toISOString()},W.toString=function(){return this.$d.toUTCString()},q}(),$=F.prototype;return P.prototype=$,[["$ms",a],["$s",s],["$m",o],["$H",c],["$W",d],["$M",h],["$y",g],["$D",U]].forEach(function(q){$[q[1]]=function(W){return this.$g(W,q[0],q[1])}}),P.extend=function(q,W){return q.$i||(q(W,F,P),q.$i=!0),P},P.locale=j,P.isDayjs=R,P.unix=function(q){return P(1e3*q)},P.en=M[k],P.Ls=M,P.p={},P})}(Ng)),Ng.exports}var Z1e=q1e();const K1e=ya(Z1e);var Q1e={value:()=>{}};function $N(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new Og(n)}function Og(e){this._=e}function J1e(e,t){return e.trim().split(/^|\s+/).map(function(n){var r="",i=n.indexOf(".");if(i>=0&&(r=n.slice(i+1),n=n.slice(0,i)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}Og.prototype=$N.prototype={constructor:Og,on:function(e,t){var n=this._,r=J1e(e+"",n),i,a=-1,s=r.length;if(arguments.length<2){for(;++a<s;)if((i=(e=r[a]).type)&&(i=e0e(n[i],e.name)))return i;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++a<s;)if(i=(e=r[a]).type)n[i]=Pk(n[i],e.name,t);else if(t==null)for(i in n)n[i]=Pk(n[i],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new Og(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var n=new Array(i),r=0,i,a;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(a=this._[e],r=0,i=a.length;r<i;++r)a[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var r=this._[e],i=0,a=r.length;i<a;++i)r[i].value.apply(t,n)}};function e0e(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function Pk(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=Q1e,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var L8="http://www.w3.org/1999/xhtml";const Nk={svg:"http://www.w3.org/2000/svg",xhtml:L8,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function p6(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),Nk.hasOwnProperty(t)?{space:Nk[t],local:e}:e}function t0e(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===L8&&t.documentElement.namespaceURI===L8?t.createElement(e):t.createElementNS(n,e)}}function n0e(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function BN(e){var t=p6(e);return(t.local?n0e:t0e)(t)}function r0e(){}function mx(e){return e==null?r0e:function(){return this.querySelector(e)}}function i0e(e){typeof e!="function"&&(e=mx(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var a=t[i],s=a.length,o=r[i]=new Array(s),c,d,l=0;l<s;++l)(c=a[l])&&(d=e.call(c,c.__data__,l,a))&&("__data__"in c&&(d.__data__=c.__data__),o[l]=d);return new $i(r,this._parents)}function a0e(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function s0e(){return[]}function zN(e){return e==null?s0e:function(){return this.querySelectorAll(e)}}function o0e(e){return function(){return a0e(e.apply(this,arguments))}}function l0e(e){typeof e=="function"?e=o0e(e):e=zN(e);for(var t=this._groups,n=t.length,r=[],i=[],a=0;a<n;++a)for(var s=t[a],o=s.length,c,d=0;d<o;++d)(c=s[d])&&(r.push(e.call(c,c.__data__,d,s)),i.push(c));return new $i(r,i)}function HN(e){return function(){return this.matches(e)}}function WN(e){return function(t){return t.matches(e)}}var c0e=Array.prototype.find;function d0e(e){return function(){return c0e.call(this.children,e)}}function u0e(){return this.firstElementChild}function h0e(e){return this.select(e==null?u0e:d0e(typeof e=="function"?e:WN(e)))}var f0e=Array.prototype.filter;function p0e(){return Array.from(this.children)}function m0e(e){return function(){return f0e.call(this.children,e)}}function g0e(e){return this.selectAll(e==null?p0e:m0e(typeof e=="function"?e:WN(e)))}function U0e(e){typeof e!="function"&&(e=HN(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var a=t[i],s=a.length,o=r[i]=[],c,d=0;d<s;++d)(c=a[d])&&e.call(c,c.__data__,d,a)&&o.push(c);return new $i(r,this._parents)}function XN(e){return new Array(e.length)}function b0e(){return new $i(this._enter||this._groups.map(XN),this._parents)}function z2(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}z2.prototype={constructor:z2,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function y0e(e){return function(){return e}}function v0e(e,t,n,r,i,a){for(var s=0,o,c=t.length,d=a.length;s<d;++s)(o=t[s])?(o.__data__=a[s],r[s]=o):n[s]=new z2(e,a[s]);for(;s<c;++s)(o=t[s])&&(i[s]=o)}function x0e(e,t,n,r,i,a,s){var o,c,d=new Map,l=t.length,h=a.length,f=new Array(l),g;for(o=0;o<l;++o)(c=t[o])&&(f[o]=g=s.call(c,c.__data__,o,t)+"",d.has(g)?i[o]=c:d.set(g,c));for(o=0;o<h;++o)g=s.call(e,a[o],o,a)+"",(c=d.get(g))?(r[o]=c,c.__data__=a[o],d.delete(g)):n[o]=new z2(e,a[o]);for(o=0;o<l;++o)(c=t[o])&&d.get(f[o])===c&&(i[o]=c)}function w0e(e){return e.__data__}function E0e(e,t){if(!arguments.length)return Array.from(this,w0e);var n=t?x0e:v0e,r=this._parents,i=this._groups;typeof e!="function"&&(e=y0e(e));for(var a=i.length,s=new Array(a),o=new Array(a),c=new Array(a),d=0;d<a;++d){var l=r[d],h=i[d],f=h.length,g=C0e(e.call(l,l&&l.__data__,d,r)),U=g.length,y=o[d]=new Array(U),v=s[d]=new Array(U),x=c[d]=new Array(f);n(l,h,y,v,x,g,t);for(var w=0,C=0,S,k;w<U;++w)if(S=y[w]){for(w>=C&&(C=w+1);!(k=v[C])&&++C<U;);S._next=k||null}}return s=new $i(s,r),s._enter=o,s._exit=c,s}function C0e(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function S0e(){return new $i(this._exit||this._groups.map(XN),this._parents)}function _0e(e,t,n){var r=this.enter(),i=this,a=this.exit();return typeof e=="function"?(r=e(r),r&&(r=r.selection())):r=r.append(e+""),t!=null&&(i=t(i),i&&(i=i.selection())),n==null?a.remove():n(a),r&&i?r.merge(i).order():i}function k0e(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,i=n.length,a=r.length,s=Math.min(i,a),o=new Array(i),c=0;c<s;++c)for(var d=n[c],l=r[c],h=d.length,f=o[c]=new Array(h),g,U=0;U<h;++U)(g=d[U]||l[U])&&(f[U]=g);for(;c<i;++c)o[c]=n[c];return new $i(o,this._parents)}function T0e(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],i=r.length-1,a=r[i],s;--i>=0;)(s=r[i])&&(a&&s.compareDocumentPosition(a)^4&&a.parentNode.insertBefore(s,a),a=s);return this}function M0e(e){e||(e=I0e);function t(h,f){return h&&f?e(h.__data__,f.__data__):!h-!f}for(var n=this._groups,r=n.length,i=new Array(r),a=0;a<r;++a){for(var s=n[a],o=s.length,c=i[a]=new Array(o),d,l=0;l<o;++l)(d=s[l])&&(c[l]=d);c.sort(t)}return new $i(i,this._parents).order()}function I0e(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function A0e(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function L0e(){return Array.from(this)}function R0e(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,a=r.length;i<a;++i){var s=r[i];if(s)return s}return null}function D0e(){let e=0;for(const t of this)++e;return e}function j0e(){return!this.node()}function P0e(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var i=t[n],a=0,s=i.length,o;a<s;++a)(o=i[a])&&e.call(o,o.__data__,a,i);return this}function N0e(e){return function(){this.removeAttribute(e)}}function O0e(e){return function(){this.removeAttributeNS(e.space,e.local)}}function F0e(e,t){return function(){this.setAttribute(e,t)}}function $0e(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function B0e(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function z0e(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function H0e(e,t){var n=p6(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((t==null?n.local?O0e:N0e:typeof t=="function"?n.local?z0e:B0e:n.local?$0e:F0e)(n,t))}function VN(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function W0e(e){return function(){this.style.removeProperty(e)}}function X0e(e,t,n){return function(){this.style.setProperty(e,t,n)}}function V0e(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function Y0e(e,t,n){return arguments.length>1?this.each((t==null?W0e:typeof t=="function"?V0e:X0e)(e,t,n??"")):_h(this.node(),e)}function _h(e,t){return e.style.getPropertyValue(t)||VN(e).getComputedStyle(e,null).getPropertyValue(t)}function G0e(e){return function(){delete this[e]}}function q0e(e,t){return function(){this[e]=t}}function Z0e(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function K0e(e,t){return arguments.length>1?this.each((t==null?G0e:typeof t=="function"?Z0e:q0e)(e,t)):this.node()[e]}function YN(e){return e.trim().split(/^|\s+/)}function gx(e){return e.classList||new GN(e)}function GN(e){this._node=e,this._names=YN(e.getAttribute("class")||"")}GN.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function qN(e,t){for(var n=gx(e),r=-1,i=t.length;++r<i;)n.add(t[r])}function ZN(e,t){for(var n=gx(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}function Q0e(e){return function(){qN(this,e)}}function J0e(e){return function(){ZN(this,e)}}function eme(e,t){return function(){(t.apply(this,arguments)?qN:ZN)(this,e)}}function tme(e,t){var n=YN(e+"");if(arguments.length<2){for(var r=gx(this.node()),i=-1,a=n.length;++i<a;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof t=="function"?eme:t?Q0e:J0e)(n,t))}function nme(){this.textContent=""}function rme(e){return function(){this.textContent=e}}function ime(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function ame(e){return arguments.length?this.each(e==null?nme:(typeof e=="function"?ime:rme)(e)):this.node().textContent}function sme(){this.innerHTML=""}function ome(e){return function(){this.innerHTML=e}}function lme(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function cme(e){return arguments.length?this.each(e==null?sme:(typeof e=="function"?lme:ome)(e)):this.node().innerHTML}function dme(){this.nextSibling&&this.parentNode.appendChild(this)}function ume(){return this.each(dme)}function hme(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function fme(){return this.each(hme)}function pme(e){var t=typeof e=="function"?e:BN(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function mme(){return null}function gme(e,t){var n=typeof e=="function"?e:BN(e),r=t==null?mme:typeof t=="function"?t:mx(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function Ume(){var e=this.parentNode;e&&e.removeChild(this)}function bme(){return this.each(Ume)}function yme(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function vme(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function xme(e){return this.select(e?vme:yme)}function wme(e){return arguments.length?this.property("__data__",e):this.node().__data__}function Eme(e){return function(t){e.call(this,t,this.__data__)}}function Cme(e){return e.trim().split(/^|\s+/).map(function(t){var n="",r=t.indexOf(".");return r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),{type:t,name:n}})}function Sme(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,i=t.length,a;n<i;++n)a=t[n],(!e.type||a.type===e.type)&&a.name===e.name?this.removeEventListener(a.type,a.listener,a.options):t[++r]=a;++r?t.length=r:delete this.__on}}}function _me(e,t,n){return function(){var r=this.__on,i,a=Eme(t);if(r){for(var s=0,o=r.length;s<o;++s)if((i=r[s]).type===e.type&&i.name===e.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=a,i.options=n),i.value=t;return}}this.addEventListener(e.type,a,n),i={type:e.type,name:e.name,value:t,listener:a,options:n},r?r.push(i):this.__on=[i]}}function kme(e,t,n){var r=Cme(e+""),i,a=r.length,s;if(arguments.length<2){var o=this.node().__on;if(o){for(var c=0,d=o.length,l;c<d;++c)for(i=0,l=o[c];i<a;++i)if((s=r[i]).type===l.type&&s.name===l.name)return l.value}return}for(o=t?_me:Sme,i=0;i<a;++i)this.each(o(r[i],t,n));return this}function KN(e,t,n){var r=VN(e),i=r.CustomEvent;typeof i=="function"?i=new i(t,n):(i=r.document.createEvent("Event"),n?(i.initEvent(t,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(t,!1,!1)),e.dispatchEvent(i)}function Tme(e,t){return function(){return KN(this,e,t)}}function Mme(e,t){return function(){return KN(this,e,t.apply(this,arguments))}}function Ime(e,t){return this.each((typeof t=="function"?Mme:Tme)(e,t))}function*Ame(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,a=r.length,s;i<a;++i)(s=r[i])&&(yield s)}var QN=[null];function $i(e,t){this._groups=e,this._parents=t}function l0(){return new $i([[document.documentElement]],QN)}function Lme(){return this}$i.prototype=l0.prototype={constructor:$i,select:i0e,selectAll:l0e,selectChild:h0e,selectChildren:g0e,filter:U0e,data:E0e,enter:b0e,exit:S0e,join:_0e,merge:k0e,selection:Lme,order:T0e,sort:M0e,call:A0e,nodes:L0e,node:R0e,size:D0e,empty:j0e,each:P0e,attr:H0e,style:Y0e,property:K0e,classed:tme,text:ame,html:cme,raise:ume,lower:fme,append:pme,insert:gme,remove:bme,clone:xme,datum:wme,on:kme,dispatch:Ime,[Symbol.iterator]:Ame};function ia(e){return typeof e=="string"?new $i([[document.querySelector(e)]],[document.documentElement]):new $i([[e]],QN)}function Ux(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function JN(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function c0(){}var k1=.7,H2=1/k1,nh="\\s*([+-]?\\d+)\\s*",T1="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Hs="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Rme=/^#([0-9a-f]{3,8})$/,Dme=new RegExp(`^rgb\\(${nh},${nh},${nh}\\)$`),jme=new RegExp(`^rgb\\(${Hs},${Hs},${Hs}\\)$`),Pme=new RegExp(`^rgba\\(${nh},${nh},${nh},${T1}\\)$`),Nme=new RegExp(`^rgba\\(${Hs},${Hs},${Hs},${T1}\\)$`),Ome=new RegExp(`^hsl\\(${T1},${Hs},${Hs}\\)$`),Fme=new RegExp(`^hsla\\(${T1},${Hs},${Hs},${T1}\\)$`),Ok={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};Ux(c0,M1,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Fk,formatHex:Fk,formatHex8:$me,formatHsl:Bme,formatRgb:$k,toString:$k});function Fk(){return this.rgb().formatHex()}function $me(){return this.rgb().formatHex8()}function Bme(){return eO(this).formatHsl()}function $k(){return this.rgb().formatRgb()}function M1(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=Rme.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?Bk(t):n===3?new pi(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Km(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Km(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=Dme.exec(e))?new pi(t[1],t[2],t[3],1):(t=jme.exec(e))?new pi(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=Pme.exec(e))?Km(t[1],t[2],t[3],t[4]):(t=Nme.exec(e))?Km(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=Ome.exec(e))?Wk(t[1],t[2]/100,t[3]/100,1):(t=Fme.exec(e))?Wk(t[1],t[2]/100,t[3]/100,t[4]):Ok.hasOwnProperty(e)?Bk(Ok[e]):e==="transparent"?new pi(NaN,NaN,NaN,0):null}function Bk(e){return new pi(e>>16&255,e>>8&255,e&255,1)}function Km(e,t,n,r){return r<=0&&(e=t=n=NaN),new pi(e,t,n,r)}function zme(e){return e instanceof c0||(e=M1(e)),e?(e=e.rgb(),new pi(e.r,e.g,e.b,e.opacity)):new pi}function R8(e,t,n,r){return arguments.length===1?zme(e):new pi(e,t,n,r??1)}function pi(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}Ux(pi,R8,JN(c0,{brighter(e){return e=e==null?H2:Math.pow(H2,e),new pi(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?k1:Math.pow(k1,e),new pi(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new pi(gd(this.r),gd(this.g),gd(this.b),W2(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:zk,formatHex:zk,formatHex8:Hme,formatRgb:Hk,toString:Hk}));function zk(){return`#${od(this.r)}${od(this.g)}${od(this.b)}`}function Hme(){return`#${od(this.r)}${od(this.g)}${od(this.b)}${od((isNaN(this.opacity)?1:this.opacity)*255)}`}function Hk(){const e=W2(this.opacity);return`${e===1?"rgb(":"rgba("}${gd(this.r)}, ${gd(this.g)}, ${gd(this.b)}${e===1?")":`, ${e})`}`}function W2(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function gd(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function od(e){return e=gd(e),(e<16?"0":"")+e.toString(16)}function Wk(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Va(e,t,n,r)}function eO(e){if(e instanceof Va)return new Va(e.h,e.s,e.l,e.opacity);if(e instanceof c0||(e=M1(e)),!e)return new Va;if(e instanceof Va)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),a=Math.max(t,n,r),s=NaN,o=a-i,c=(a+i)/2;return o?(t===a?s=(n-r)/o+(n<r)*6:n===a?s=(r-t)/o+2:s=(t-n)/o+4,o/=c<.5?a+i:2-a-i,s*=60):o=c>0&&c<1?0:s,new Va(s,o,c,e.opacity)}function Wme(e,t,n,r){return arguments.length===1?eO(e):new Va(e,t,n,r??1)}function Va(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}Ux(Va,Wme,JN(c0,{brighter(e){return e=e==null?H2:Math.pow(H2,e),new Va(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?k1:Math.pow(k1,e),new Va(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new pi(Hy(e>=240?e-240:e+120,i,r),Hy(e,i,r),Hy(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new Va(Xk(this.h),Qm(this.s),Qm(this.l),W2(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=W2(this.opacity);return`${e===1?"hsl(":"hsla("}${Xk(this.h)}, ${Qm(this.s)*100}%, ${Qm(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Xk(e){return e=(e||0)%360,e<0?e+360:e}function Qm(e){return Math.max(0,Math.min(1,e||0))}function Hy(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const bx=e=>()=>e;function tO(e,t){return function(n){return e+n*t}}function Xme(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function U4e(e,t){var n=t-e;return n?tO(e,n>180||n<-180?n-360*Math.round(n/360):n):bx(isNaN(e)?t:e)}function Vme(e){return(e=+e)==1?nO:function(t,n){return n-t?Xme(t,n,e):bx(isNaN(t)?n:t)}}function nO(e,t){var n=t-e;return n?tO(e,n):bx(isNaN(e)?t:e)}const Vk=function e(t){var n=Vme(t);function r(i,a){var s=n((i=R8(i)).r,(a=R8(a)).r),o=n(i.g,a.g),c=n(i.b,a.b),d=nO(i.opacity,a.opacity);return function(l){return i.r=s(l),i.g=o(l),i.b=c(l),i.opacity=d(l),i+""}}return r.gamma=e,r}(1);function Gl(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}var D8=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Wy=new RegExp(D8.source,"g");function Yme(e){return function(){return e}}function Gme(e){return function(t){return e(t)+""}}function qme(e,t){var n=D8.lastIndex=Wy.lastIndex=0,r,i,a,s=-1,o=[],c=[];for(e=e+"",t=t+"";(r=D8.exec(e))&&(i=Wy.exec(t));)(a=i.index)>n&&(a=t.slice(n,a),o[s]?o[s]+=a:o[++s]=a),(r=r[0])===(i=i[0])?o[s]?o[s]+=i:o[++s]=i:(o[++s]=null,c.push({i:s,x:Gl(r,i)})),n=Wy.lastIndex;return n<t.length&&(a=t.slice(n),o[s]?o[s]+=a:o[++s]=a),o.length<2?c[0]?Gme(c[0].x):Yme(t):(t=c.length,function(d){for(var l=0,h;l<t;++l)o[(h=c[l]).i]=h.x(d);return o.join("")})}var Yk=180/Math.PI,j8={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function rO(e,t,n,r,i,a){var s,o,c;return(s=Math.sqrt(e*e+t*t))&&(e/=s,t/=s),(c=e*n+t*r)&&(n-=e*c,r-=t*c),(o=Math.sqrt(n*n+r*r))&&(n/=o,r/=o,c/=o),e*r<t*n&&(e=-e,t=-t,c=-c,s=-s),{translateX:i,translateY:a,rotate:Math.atan2(t,e)*Yk,skewX:Math.atan(c)*Yk,scaleX:s,scaleY:o}}var Jm;function Zme(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?j8:rO(t.a,t.b,t.c,t.d,t.e,t.f)}function Kme(e){return e==null||(Jm||(Jm=document.createElementNS("http://www.w3.org/2000/svg","g")),Jm.setAttribute("transform",e),!(e=Jm.transform.baseVal.consolidate()))?j8:(e=e.matrix,rO(e.a,e.b,e.c,e.d,e.e,e.f))}function iO(e,t,n,r){function i(d){return d.length?d.pop()+" ":""}function a(d,l,h,f,g,U){if(d!==h||l!==f){var y=g.push("translate(",null,t,null,n);U.push({i:y-4,x:Gl(d,h)},{i:y-2,x:Gl(l,f)})}else(h||f)&&g.push("translate("+h+t+f+n)}function s(d,l,h,f){d!==l?(d-l>180?l+=360:l-d>180&&(d+=360),f.push({i:h.push(i(h)+"rotate(",null,r)-2,x:Gl(d,l)})):l&&h.push(i(h)+"rotate("+l+r)}function o(d,l,h,f){d!==l?f.push({i:h.push(i(h)+"skewX(",null,r)-2,x:Gl(d,l)}):l&&h.push(i(h)+"skewX("+l+r)}function c(d,l,h,f,g,U){if(d!==h||l!==f){var y=g.push(i(g)+"scale(",null,",",null,")");U.push({i:y-4,x:Gl(d,h)},{i:y-2,x:Gl(l,f)})}else(h!==1||f!==1)&&g.push(i(g)+"scale("+h+","+f+")")}return function(d,l){var h=[],f=[];return d=e(d),l=e(l),a(d.translateX,d.translateY,l.translateX,l.translateY,h,f),s(d.rotate,l.rotate,h,f),o(d.skewX,l.skewX,h,f),c(d.scaleX,d.scaleY,l.scaleX,l.scaleY,h,f),d=l=null,function(g){for(var U=-1,y=f.length,v;++U<y;)h[(v=f[U]).i]=v.x(g);return h.join("")}}}var Qme=iO(Zme,"px, ","px)","deg)"),Jme=iO(Kme,", ",")",")"),kh=0,xp=0,Qf=0,aO=1e3,X2,wp,V2=0,Pd=0,m6=0,I1=typeof performance=="object"&&performance.now?performance:Date,sO=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function yx(){return Pd||(sO(ege),Pd=I1.now()+m6)}function ege(){Pd=0}function Y2(){this._call=this._time=this._next=null}Y2.prototype=oO.prototype={constructor:Y2,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?yx():+n)+(t==null?0:+t),!this._next&&wp!==this&&(wp?wp._next=this:X2=this,wp=this),this._call=e,this._time=n,P8()},stop:function(){this._call&&(this._call=null,this._time=1/0,P8())}};function oO(e,t,n){var r=new Y2;return r.restart(e,t,n),r}function tge(){yx(),++kh;for(var e=X2,t;e;)(t=Pd-e._time)>=0&&e._call.call(void 0,t),e=e._next;--kh}function Gk(){Pd=(V2=I1.now())+m6,kh=xp=0;try{tge()}finally{kh=0,rge(),Pd=0}}function nge(){var e=I1.now(),t=e-V2;t>aO&&(m6-=t,V2=e)}function rge(){for(var e,t=X2,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:X2=n);wp=e,P8(r)}function P8(e){if(!kh){xp&&(xp=clearTimeout(xp));var t=e-Pd;t>24?(e<1/0&&(xp=setTimeout(Gk,e-I1.now()-m6)),Qf&&(Qf=clearInterval(Qf))):(Qf||(V2=I1.now(),Qf=setInterval(nge,aO)),kh=1,sO(Gk))}}function qk(e,t,n){var r=new Y2;return t=t==null?0:+t,r.restart(i=>{r.stop(),e(i+t)},t,n),r}var ige=$N("start","end","cancel","interrupt"),age=[],lO=0,Zk=1,N8=2,Fg=3,Kk=4,O8=5,$g=6;function g6(e,t,n,r,i,a){var s=e.__transition;if(!s)e.__transition={};else if(n in s)return;sge(e,n,{name:t,index:r,group:i,on:ige,tween:age,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:lO})}function vx(e,t){var n=ds(e,t);if(n.state>lO)throw new Error("too late; already scheduled");return n}function so(e,t){var n=ds(e,t);if(n.state>Fg)throw new Error("too late; already running");return n}function ds(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function sge(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=oO(a,0,n.time);function a(d){n.state=Zk,n.timer.restart(s,n.delay,n.time),n.delay<=d&&s(d-n.delay)}function s(d){var l,h,f,g;if(n.state!==Zk)return c();for(l in r)if(g=r[l],g.name===n.name){if(g.state===Fg)return qk(s);g.state===Kk?(g.state=$g,g.timer.stop(),g.on.call("interrupt",e,e.__data__,g.index,g.group),delete r[l]):+l<t&&(g.state=$g,g.timer.stop(),g.on.call("cancel",e,e.__data__,g.index,g.group),delete r[l])}if(qk(function(){n.state===Fg&&(n.state=Kk,n.timer.restart(o,n.delay,n.time),o(d))}),n.state=N8,n.on.call("start",e,e.__data__,n.index,n.group),n.state===N8){for(n.state=Fg,i=new Array(f=n.tween.length),l=0,h=-1;l<f;++l)(g=n.tween[l].value.call(e,e.__data__,n.index,n.group))&&(i[++h]=g);i.length=h+1}}function o(d){for(var l=d<n.duration?n.ease.call(null,d/n.duration):(n.timer.restart(c),n.state=O8,1),h=-1,f=i.length;++h<f;)i[h].call(e,l);n.state===O8&&(n.on.call("end",e,e.__data__,n.index,n.group),c())}function c(){n.state=$g,n.timer.stop(),delete r[t];for(var d in r)return;delete e.__transition}}function oge(e,t){var n=e.__transition,r,i,a=!0,s;if(n){t=t==null?null:t+"";for(s in n){if((r=n[s]).name!==t){a=!1;continue}i=r.state>N8&&r.state<O8,r.state=$g,r.timer.stop(),r.on.call(i?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[s]}a&&delete e.__transition}}function lge(e){return this.each(function(){oge(this,e)})}function cge(e,t){var n,r;return function(){var i=so(this,e),a=i.tween;if(a!==n){r=n=a;for(var s=0,o=r.length;s<o;++s)if(r[s].name===t){r=r.slice(),r.splice(s,1);break}}i.tween=r}}function dge(e,t,n){var r,i;if(typeof n!="function")throw new Error;return function(){var a=so(this,e),s=a.tween;if(s!==r){i=(r=s).slice();for(var o={name:t,value:n},c=0,d=i.length;c<d;++c)if(i[c].name===t){i[c]=o;break}c===d&&i.push(o)}a.tween=i}}function uge(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=ds(this.node(),n).tween,i=0,a=r.length,s;i<a;++i)if((s=r[i]).name===e)return s.value;return null}return this.each((t==null?cge:dge)(n,e,t))}function xx(e,t,n){var r=e._id;return e.each(function(){var i=so(this,r);(i.value||(i.value={}))[t]=n.apply(this,arguments)}),function(i){return ds(i,r).value[t]}}function cO(e,t){var n;return(typeof t=="number"?Gl:t instanceof M1?Vk:(n=M1(t))?(t=n,Vk):qme)(e,t)}function hge(e){return function(){this.removeAttribute(e)}}function fge(e){return function(){this.removeAttributeNS(e.space,e.local)}}function pge(e,t,n){var r,i=n+"",a;return function(){var s=this.getAttribute(e);return s===i?null:s===r?a:a=t(r=s,n)}}function mge(e,t,n){var r,i=n+"",a;return function(){var s=this.getAttributeNS(e.space,e.local);return s===i?null:s===r?a:a=t(r=s,n)}}function gge(e,t,n){var r,i,a;return function(){var s,o=n(this),c;return o==null?void this.removeAttribute(e):(s=this.getAttribute(e),c=o+"",s===c?null:s===r&&c===i?a:(i=c,a=t(r=s,o)))}}function Uge(e,t,n){var r,i,a;return function(){var s,o=n(this),c;return o==null?void this.removeAttributeNS(e.space,e.local):(s=this.getAttributeNS(e.space,e.local),c=o+"",s===c?null:s===r&&c===i?a:(i=c,a=t(r=s,o)))}}function bge(e,t){var n=p6(e),r=n==="transform"?Jme:cO;return this.attrTween(e,typeof t=="function"?(n.local?Uge:gge)(n,r,xx(this,"attr."+e,t)):t==null?(n.local?fge:hge)(n):(n.local?mge:pge)(n,r,t))}function yge(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function vge(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function xge(e,t){var n,r;function i(){var a=t.apply(this,arguments);return a!==r&&(n=(r=a)&&vge(e,a)),n}return i._value=t,i}function wge(e,t){var n,r;function i(){var a=t.apply(this,arguments);return a!==r&&(n=(r=a)&&yge(e,a)),n}return i._value=t,i}function Ege(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;var r=p6(e);return this.tween(n,(r.local?xge:wge)(r,t))}function Cge(e,t){return function(){vx(this,e).delay=+t.apply(this,arguments)}}function Sge(e,t){return t=+t,function(){vx(this,e).delay=t}}function _ge(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?Cge:Sge)(t,e)):ds(this.node(),t).delay}function kge(e,t){return function(){so(this,e).duration=+t.apply(this,arguments)}}function Tge(e,t){return t=+t,function(){so(this,e).duration=t}}function Mge(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?kge:Tge)(t,e)):ds(this.node(),t).duration}function Ige(e,t){if(typeof t!="function")throw new Error;return function(){so(this,e).ease=t}}function Age(e){var t=this._id;return arguments.length?this.each(Ige(t,e)):ds(this.node(),t).ease}function Lge(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;so(this,e).ease=n}}function Rge(e){if(typeof e!="function")throw new Error;return this.each(Lge(this._id,e))}function Dge(e){typeof e!="function"&&(e=HN(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var a=t[i],s=a.length,o=r[i]=[],c,d=0;d<s;++d)(c=a[d])&&e.call(c,c.__data__,d,a)&&o.push(c);return new sl(r,this._parents,this._name,this._id)}function jge(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,r=t.length,i=n.length,a=Math.min(r,i),s=new Array(r),o=0;o<a;++o)for(var c=t[o],d=n[o],l=c.length,h=s[o]=new Array(l),f,g=0;g<l;++g)(f=c[g]||d[g])&&(h[g]=f);for(;o<r;++o)s[o]=t[o];return new sl(s,this._parents,this._name,this._id)}function Pge(e){return(e+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||t==="start"})}function Nge(e,t,n){var r,i,a=Pge(t)?vx:so;return function(){var s=a(this,e),o=s.on;o!==r&&(i=(r=o).copy()).on(t,n),s.on=i}}function Oge(e,t){var n=this._id;return arguments.length<2?ds(this.node(),n).on.on(e):this.each(Nge(n,e,t))}function Fge(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function $ge(){return this.on("end.remove",Fge(this._id))}function Bge(e){var t=this._name,n=this._id;typeof e!="function"&&(e=mx(e));for(var r=this._groups,i=r.length,a=new Array(i),s=0;s<i;++s)for(var o=r[s],c=o.length,d=a[s]=new Array(c),l,h,f=0;f<c;++f)(l=o[f])&&(h=e.call(l,l.__data__,f,o))&&("__data__"in l&&(h.__data__=l.__data__),d[f]=h,g6(d[f],t,n,f,d,ds(l,n)));return new sl(a,this._parents,t,n)}function zge(e){var t=this._name,n=this._id;typeof e!="function"&&(e=zN(e));for(var r=this._groups,i=r.length,a=[],s=[],o=0;o<i;++o)for(var c=r[o],d=c.length,l,h=0;h<d;++h)if(l=c[h]){for(var f=e.call(l,l.__data__,h,c),g,U=ds(l,n),y=0,v=f.length;y<v;++y)(g=f[y])&&g6(g,t,n,y,f,U);a.push(f),s.push(l)}return new sl(a,s,t,n)}var Hge=l0.prototype.constructor;function Wge(){return new Hge(this._groups,this._parents)}function Xge(e,t){var n,r,i;return function(){var a=_h(this,e),s=(this.style.removeProperty(e),_h(this,e));return a===s?null:a===n&&s===r?i:i=t(n=a,r=s)}}function dO(e){return function(){this.style.removeProperty(e)}}function Vge(e,t,n){var r,i=n+"",a;return function(){var s=_h(this,e);return s===i?null:s===r?a:a=t(r=s,n)}}function Yge(e,t,n){var r,i,a;return function(){var s=_h(this,e),o=n(this),c=o+"";return o==null&&(c=o=(this.style.removeProperty(e),_h(this,e))),s===c?null:s===r&&c===i?a:(i=c,a=t(r=s,o))}}function Gge(e,t){var n,r,i,a="style."+t,s="end."+a,o;return function(){var c=so(this,e),d=c.on,l=c.value[a]==null?o||(o=dO(t)):void 0;(d!==n||i!==l)&&(r=(n=d).copy()).on(s,i=l),c.on=r}}function qge(e,t,n){var r=(e+="")=="transform"?Qme:cO;return t==null?this.styleTween(e,Xge(e,r)).on("end.style."+e,dO(e)):typeof t=="function"?this.styleTween(e,Yge(e,r,xx(this,"style."+e,t))).each(Gge(this._id,e)):this.styleTween(e,Vge(e,r,t),n).on("end.style."+e,null)}function Zge(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function Kge(e,t,n){var r,i;function a(){var s=t.apply(this,arguments);return s!==i&&(r=(i=s)&&Zge(e,s,n)),r}return a._value=t,a}function Qge(e,t,n){var r="style."+(e+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!="function")throw new Error;return this.tween(r,Kge(e,t,n??""))}function Jge(e){return function(){this.textContent=e}}function e2e(e){return function(){var t=e(this);this.textContent=t??""}}function t2e(e){return this.tween("text",typeof e=="function"?e2e(xx(this,"text",e)):Jge(e==null?"":e+""))}function n2e(e){return function(t){this.textContent=e.call(this,t)}}function r2e(e){var t,n;function r(){var i=e.apply(this,arguments);return i!==n&&(t=(n=i)&&n2e(i)),t}return r._value=e,r}function i2e(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,r2e(e))}function a2e(){for(var e=this._name,t=this._id,n=uO(),r=this._groups,i=r.length,a=0;a<i;++a)for(var s=r[a],o=s.length,c,d=0;d<o;++d)if(c=s[d]){var l=ds(c,t);g6(c,e,n,d,s,{time:l.time+l.delay+l.duration,delay:0,duration:l.duration,ease:l.ease})}return new sl(r,this._parents,e,n)}function s2e(){var e,t,n=this,r=n._id,i=n.size();return new Promise(function(a,s){var o={value:s},c={value:function(){--i===0&&a()}};n.each(function(){var d=so(this,r),l=d.on;l!==e&&(t=(e=l).copy(),t._.cancel.push(o),t._.interrupt.push(o),t._.end.push(c)),d.on=t}),i===0&&a()})}var o2e=0;function sl(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function uO(){return++o2e}var To=l0.prototype;sl.prototype={constructor:sl,select:Bge,selectAll:zge,selectChild:To.selectChild,selectChildren:To.selectChildren,filter:Dge,merge:jge,selection:Wge,transition:a2e,call:To.call,nodes:To.nodes,node:To.node,size:To.size,empty:To.empty,each:To.each,on:Oge,attr:bge,attrTween:Ege,style:qge,styleTween:Qge,text:t2e,textTween:i2e,remove:$ge,tween:uge,delay:_ge,duration:Mge,ease:Age,easeVarying:Rge,end:s2e,[Symbol.iterator]:To[Symbol.iterator]};function l2e(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var c2e={time:null,delay:0,duration:250,ease:l2e};function d2e(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}function u2e(e){var t,n;e instanceof sl?(t=e._id,e=e._name):(t=uO(),(n=c2e).time=yx(),e=e==null?null:e+"");for(var r=this._groups,i=r.length,a=0;a<i;++a)for(var s=r[a],o=s.length,c,d=0;d<o;++d)(c=s[d])&&g6(c,e,t,d,s,n||d2e(c,t));return new sl(r,this._parents,e,t)}l0.prototype.interrupt=lge;l0.prototype.transition=u2e;const b4e=Math.abs,y4e=Math.atan2,v4e=Math.cos,x4e=Math.max,w4e=Math.min,E4e=Math.sin,C4e=Math.sqrt,Qk=1e-12,wx=Math.PI,Jk=wx/2,S4e=2*wx;function _4e(e){return e>1?0:e<-1?wx:Math.acos(e)}function k4e(e){return e>=1?Jk:e<=-1?-Jk:Math.asin(e)}function hO(e){this._context=e}hO.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function h2e(e){return new hO(e)}class fO{constructor(t,n){this._context=t,this._x=n}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(t,n){switch(t=+t,n=+n,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,n,t,n):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+n)/2,t,this._y0,t,n);break}}this._x0=t,this._y0=n}}function f2e(e){return new fO(e,!0)}function p2e(e){return new fO(e,!1)}function bc(){}function G2(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function U6(e){this._context=e}U6.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:G2(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:G2(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function m2e(e){return new U6(e)}function pO(e){this._context=e}pO.prototype={areaStart:bc,areaEnd:bc,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:G2(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function g2e(e){return new pO(e)}function mO(e){this._context=e}mO.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+e)/6,r=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:G2(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function U2e(e){return new mO(e)}function gO(e,t){this._basis=new U6(e),this._beta=t}gO.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var e=this._x,t=this._y,n=e.length-1;if(n>0)for(var r=e[0],i=t[0],a=e[n]-r,s=t[n]-i,o=-1,c;++o<=n;)c=o/n,this._basis.point(this._beta*e[o]+(1-this._beta)*(r+c*a),this._beta*t[o]+(1-this._beta)*(i+c*s));this._x=this._y=null,this._basis.lineEnd()},point:function(e,t){this._x.push(+e),this._y.push(+t)}};const b2e=function e(t){function n(r){return t===1?new U6(r):new gO(r,t)}return n.beta=function(r){return e(+r)},n}(.85);function q2(e,t,n){e._context.bezierCurveTo(e._x1+e._k*(e._x2-e._x0),e._y1+e._k*(e._y2-e._y0),e._x2+e._k*(e._x1-t),e._y2+e._k*(e._y1-n),e._x2,e._y2)}function Ex(e,t){this._context=e,this._k=(1-t)/6}Ex.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:q2(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2,this._x1=e,this._y1=t;break;case 2:this._point=3;default:q2(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const y2e=function e(t){function n(r){return new Ex(r,t)}return n.tension=function(r){return e(+r)},n}(0);function Cx(e,t){this._context=e,this._k=(1-t)/6}Cx.prototype={areaStart:bc,areaEnd:bc,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:q2(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const v2e=function e(t){function n(r){return new Cx(r,t)}return n.tension=function(r){return e(+r)},n}(0);function Sx(e,t){this._context=e,this._k=(1-t)/6}Sx.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:q2(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const x2e=function e(t){function n(r){return new Sx(r,t)}return n.tension=function(r){return e(+r)},n}(0);function _x(e,t,n){var r=e._x1,i=e._y1,a=e._x2,s=e._y2;if(e._l01_a>Qk){var o=2*e._l01_2a+3*e._l01_a*e._l12_a+e._l12_2a,c=3*e._l01_a*(e._l01_a+e._l12_a);r=(r*o-e._x0*e._l12_2a+e._x2*e._l01_2a)/c,i=(i*o-e._y0*e._l12_2a+e._y2*e._l01_2a)/c}if(e._l23_a>Qk){var d=2*e._l23_2a+3*e._l23_a*e._l12_a+e._l12_2a,l=3*e._l23_a*(e._l23_a+e._l12_a);a=(a*d+e._x1*e._l23_2a-t*e._l12_2a)/l,s=(s*d+e._y1*e._l23_2a-n*e._l12_2a)/l}e._context.bezierCurveTo(r,i,a,s,e._x2,e._y2)}function UO(e,t){this._context=e,this._alpha=t}UO.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3;default:_x(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const w2e=function e(t){function n(r){return t?new UO(r,t):new Ex(r,0)}return n.alpha=function(r){return e(+r)},n}(.5);function bO(e,t){this._context=e,this._alpha=t}bO.prototype={areaStart:bc,areaEnd:bc,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:_x(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const E2e=function e(t){function n(r){return t?new bO(r,t):new Cx(r,0)}return n.alpha=function(r){return e(+r)},n}(.5);function yO(e,t){this._context=e,this._alpha=t}yO.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:_x(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const C2e=function e(t){function n(r){return t?new yO(r,t):new Sx(r,0)}return n.alpha=function(r){return e(+r)},n}(.5);function vO(e){this._context=e}vO.prototype={areaStart:bc,areaEnd:bc,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function S2e(e){return new vO(e)}function eT(e){return e<0?-1:1}function tT(e,t,n){var r=e._x1-e._x0,i=t-e._x1,a=(e._y1-e._y0)/(r||i<0&&-0),s=(n-e._y1)/(i||r<0&&-0),o=(a*i+s*r)/(r+i);return(eT(a)+eT(s))*Math.min(Math.abs(a),Math.abs(s),.5*Math.abs(o))||0}function nT(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function Xy(e,t,n){var r=e._x0,i=e._y0,a=e._x1,s=e._y1,o=(a-r)/3;e._context.bezierCurveTo(r+o,i+o*t,a-o,s-o*n,a,s)}function Z2(e){this._context=e}Z2.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:Xy(this,this._t0,nT(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,Xy(this,nT(this,n=tT(this,e,t)),n);break;default:Xy(this,this._t0,n=tT(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function xO(e){this._context=new wO(e)}(xO.prototype=Object.create(Z2.prototype)).point=function(e,t){Z2.prototype.point.call(this,t,e)};function wO(e){this._context=e}wO.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,r,i,a){this._context.bezierCurveTo(t,e,r,n,a,i)}};function _2e(e){return new Z2(e)}function k2e(e){return new xO(e)}function EO(e){this._context=e}EO.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),n===2)this._context.lineTo(e[1],t[1]);else for(var r=rT(e),i=rT(t),a=0,s=1;s<n;++a,++s)this._context.bezierCurveTo(r[0][a],i[0][a],r[1][a],i[1][a],e[s],t[s]);(this._line||this._line!==0&&n===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}};function rT(e){var t,n=e.length-1,r,i=new Array(n),a=new Array(n),s=new Array(n);for(i[0]=0,a[0]=2,s[0]=e[0]+2*e[1],t=1;t<n-1;++t)i[t]=1,a[t]=4,s[t]=4*e[t]+2*e[t+1];for(i[n-1]=2,a[n-1]=7,s[n-1]=8*e[n-1]+e[n],t=1;t<n;++t)r=i[t]/a[t-1],a[t]-=r,s[t]-=r*s[t-1];for(i[n-1]=s[n-1]/a[n-1],t=n-2;t>=0;--t)i[t]=(s[t]-i[t+1])/a[t];for(a[n-1]=(e[n]+i[n-1])/2,t=0;t<n-1;++t)a[t]=2*e[t+1]-i[t+1];return[i,a]}function T2e(e){return new EO(e)}function b6(e,t){this._context=e,this._t=t}b6.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}break}}this._x=e,this._y=t}};function M2e(e){return new b6(e,.5)}function I2e(e){return new b6(e,0)}function A2e(e){return new b6(e,1)}function Ep(e,t,n){this.k=e,this.x=t,this.y=n}Ep.prototype={constructor:Ep,scale:function(e){return e===1?this:new Ep(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Ep(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};Ep.prototype;/*! @license DOMPurify 3.1.6 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.1.6/LICENSE */const{entries:CO,setPrototypeOf:iT,isFrozen:L2e,getPrototypeOf:R2e,getOwnPropertyDescriptor:D2e}=Object;let{freeze:Zr,seal:Ua,create:SO}=Object,{apply:F8,construct:$8}=typeof Reflect<"u"&&Reflect;Zr||(Zr=function(t){return t});Ua||(Ua=function(t){return t});F8||(F8=function(t,n,r){return t.apply(n,r)});$8||($8=function(t,n){return new t(...n)});const eg=Bi(Array.prototype.forEach),aT=Bi(Array.prototype.pop),Jf=Bi(Array.prototype.push),Bg=Bi(String.prototype.toLowerCase),Vy=Bi(String.prototype.toString),sT=Bi(String.prototype.match),ep=Bi(String.prototype.replace),j2e=Bi(String.prototype.indexOf),P2e=Bi(String.prototype.trim),Ba=Bi(Object.prototype.hasOwnProperty),Br=Bi(RegExp.prototype.test),tp=N2e(TypeError);function Bi(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return F8(e,t,r)}}function N2e(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return $8(e,n)}}function St(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Bg;iT&&iT(e,null);let r=t.length;for(;r--;){let i=t[r];if(typeof i=="string"){const a=n(i);a!==i&&(L2e(t)||(t[r]=a),i=a)}e[i]=!0}return e}function O2e(e){for(let t=0;t<e.length;t++)Ba(e,t)||(e[t]=null);return e}function Gc(e){const t=SO(null);for(const[n,r]of CO(e))Ba(e,n)&&(Array.isArray(r)?t[n]=O2e(r):r&&typeof r=="object"&&r.constructor===Object?t[n]=Gc(r):t[n]=r);return t}function np(e,t){for(;e!==null;){const r=D2e(e,t);if(r){if(r.get)return Bi(r.get);if(typeof r.value=="function")return Bi(r.value)}e=R2e(e)}function n(){return null}return n}const oT=Zr(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Yy=Zr(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Gy=Zr(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),F2e=Zr(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),qy=Zr(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),$2e=Zr(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),lT=Zr(["#text"]),cT=Zr(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),Zy=Zr(["accent-height","accumulate","additive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),dT=Zr(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),tg=Zr(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),B2e=Ua(/\{\{[\w\W]*|[\w\W]*\}\}/gm),z2e=Ua(/<%[\w\W]*|[\w\W]*%>/gm),H2e=Ua(/\${[\w\W]*}/gm),W2e=Ua(/^data-[\-\w.\u00B7-\uFFFF]/),X2e=Ua(/^aria-[\-\w]+$/),_O=Ua(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),V2e=Ua(/^(?:\w+script|data):/i),Y2e=Ua(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),kO=Ua(/^html$/i),G2e=Ua(/^[a-z][.\w]*(-[.\w]+)+$/i);var uT=Object.freeze({__proto__:null,MUSTACHE_EXPR:B2e,ERB_EXPR:z2e,TMPLIT_EXPR:H2e,DATA_ATTR:W2e,ARIA_ATTR:X2e,IS_ALLOWED_URI:_O,IS_SCRIPT_OR_DATA:V2e,ATTR_WHITESPACE:Y2e,DOCTYPE_NAME:kO,CUSTOM_ELEMENT:G2e});const rp={element:1,text:3,progressingInstruction:7,comment:8,document:9},q2e=function(){return typeof window>"u"?null:window},Z2e=function(t,n){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let r=null;const i="data-tt-policy-suffix";n&&n.hasAttribute(i)&&(r=n.getAttribute(i));const a="dompurify"+(r?"#"+r:"");try{return t.createPolicy(a,{createHTML(s){return s},createScriptURL(s){return s}})}catch{return console.warn("TrustedTypes policy "+a+" could not be created."),null}};function TO(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:q2e();const t=ae=>TO(ae);if(t.version="3.1.6",t.removed=[],!e||!e.document||e.document.nodeType!==rp.document)return t.isSupported=!1,t;let{document:n}=e;const r=n,i=r.currentScript,{DocumentFragment:a,HTMLTemplateElement:s,Node:o,Element:c,NodeFilter:d,NamedNodeMap:l=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:h,DOMParser:f,trustedTypes:g}=e,U=c.prototype,y=np(U,"cloneNode"),v=np(U,"remove"),x=np(U,"nextSibling"),w=np(U,"childNodes"),C=np(U,"parentNode");if(typeof s=="function"){const ae=n.createElement("template");ae.content&&ae.content.ownerDocument&&(n=ae.content.ownerDocument)}let S,k="";const{implementation:M,createNodeIterator:T,createDocumentFragment:R,getElementsByTagName:j}=n,{importNode:P}=r;let N={};t.isSupported=typeof CO=="function"&&typeof C=="function"&&M&&M.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:F,ERB_EXPR:$,TMPLIT_EXPR:q,DATA_ATTR:W,ARIA_ATTR:V,IS_SCRIPT_OR_DATA:B,ATTR_WHITESPACE:z,CUSTOM_ELEMENT:Y}=uT;let{IS_ALLOWED_URI:K}=uT,G=null;const ee=St({},[...oT,...Yy,...Gy,...qy,...lT]);let de=null;const xe=St({},[...cT,...Zy,...dT,...tg]);let ve=Object.seal(SO(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Me=null,Ce=null,ge=!0,$e=!0,je=!1,Je=!0,ut=!1,zt=!0,Tn=!1,On=!1,Fn=!1,hn=!1,xa=!1,fr=!1,xi=!0,xr=!1;const fl="user-content-";let lo=!0,wa=!1,wi={},Ei=null;const co=St({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let us=null;const Ea=St({},["audio","video","img","source","image","track"]);let zi=null;const Ca=St({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),hs="http://www.w3.org/1998/Math/MathML",fs="http://www.w3.org/2000/svg",Ci="http://www.w3.org/1999/xhtml";let ps=Ci,Sa=!1,_a=null;const pl=St({},[hs,fs,Ci],Vy);let ka=null;const uo=["application/xhtml+xml","text/html"],ms="text/html";let Qt=null,Kr=null;const _c=n.createElement("form"),gs=function(X){return X instanceof RegExp||X instanceof Function},ho=function(){let X=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(Kr&&Kr===X)){if((!X||typeof X!="object")&&(X={}),X=Gc(X),ka=uo.indexOf(X.PARSER_MEDIA_TYPE)===-1?ms:X.PARSER_MEDIA_TYPE,Qt=ka==="application/xhtml+xml"?Vy:Bg,G=Ba(X,"ALLOWED_TAGS")?St({},X.ALLOWED_TAGS,Qt):ee,de=Ba(X,"ALLOWED_ATTR")?St({},X.ALLOWED_ATTR,Qt):xe,_a=Ba(X,"ALLOWED_NAMESPACES")?St({},X.ALLOWED_NAMESPACES,Vy):pl,zi=Ba(X,"ADD_URI_SAFE_ATTR")?St(Gc(Ca),X.ADD_URI_SAFE_ATTR,Qt):Ca,us=Ba(X,"ADD_DATA_URI_TAGS")?St(Gc(Ea),X.ADD_DATA_URI_TAGS,Qt):Ea,Ei=Ba(X,"FORBID_CONTENTS")?St({},X.FORBID_CONTENTS,Qt):co,Me=Ba(X,"FORBID_TAGS")?St({},X.FORBID_TAGS,Qt):{},Ce=Ba(X,"FORBID_ATTR")?St({},X.FORBID_ATTR,Qt):{},wi=Ba(X,"USE_PROFILES")?X.USE_PROFILES:!1,ge=X.ALLOW_ARIA_ATTR!==!1,$e=X.ALLOW_DATA_ATTR!==!1,je=X.ALLOW_UNKNOWN_PROTOCOLS||!1,Je=X.ALLOW_SELF_CLOSE_IN_ATTR!==!1,ut=X.SAFE_FOR_TEMPLATES||!1,zt=X.SAFE_FOR_XML!==!1,Tn=X.WHOLE_DOCUMENT||!1,hn=X.RETURN_DOM||!1,xa=X.RETURN_DOM_FRAGMENT||!1,fr=X.RETURN_TRUSTED_TYPE||!1,Fn=X.FORCE_BODY||!1,xi=X.SANITIZE_DOM!==!1,xr=X.SANITIZE_NAMED_PROPS||!1,lo=X.KEEP_CONTENT!==!1,wa=X.IN_PLACE||!1,K=X.ALLOWED_URI_REGEXP||_O,ps=X.NAMESPACE||Ci,ve=X.CUSTOM_ELEMENT_HANDLING||{},X.CUSTOM_ELEMENT_HANDLING&&gs(X.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(ve.tagNameCheck=X.CUSTOM_ELEMENT_HANDLING.tagNameCheck),X.CUSTOM_ELEMENT_HANDLING&&gs(X.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(ve.attributeNameCheck=X.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),X.CUSTOM_ELEMENT_HANDLING&&typeof X.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(ve.allowCustomizedBuiltInElements=X.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),ut&&($e=!1),xa&&(hn=!0),wi&&(G=St({},lT),de=[],wi.html===!0&&(St(G,oT),St(de,cT)),wi.svg===!0&&(St(G,Yy),St(de,Zy),St(de,tg)),wi.svgFilters===!0&&(St(G,Gy),St(de,Zy),St(de,tg)),wi.mathMl===!0&&(St(G,qy),St(de,dT),St(de,tg))),X.ADD_TAGS&&(G===ee&&(G=Gc(G)),St(G,X.ADD_TAGS,Qt)),X.ADD_ATTR&&(de===xe&&(de=Gc(de)),St(de,X.ADD_ATTR,Qt)),X.ADD_URI_SAFE_ATTR&&St(zi,X.ADD_URI_SAFE_ATTR,Qt),X.FORBID_CONTENTS&&(Ei===co&&(Ei=Gc(Ei)),St(Ei,X.FORBID_CONTENTS,Qt)),lo&&(G["#text"]=!0),Tn&&St(G,["html","head","body"]),G.table&&(St(G,["tbody"]),delete Me.tbody),X.TRUSTED_TYPES_POLICY){if(typeof X.TRUSTED_TYPES_POLICY.createHTML!="function")throw tp('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof X.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw tp('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');S=X.TRUSTED_TYPES_POLICY,k=S.createHTML("")}else S===void 0&&(S=Z2e(g,i)),S!==null&&typeof k=="string"&&(k=S.createHTML(""));Zr&&Zr(X),Kr=X}},Si=St({},["mi","mo","mn","ms","mtext"]),fo=St({},["foreignobject","annotation-xml"]),ml=St({},["title","style","font","a","script"]),Hi=St({},[...Yy,...Gy,...F2e]),Ta=St({},[...qy,...$2e]),Wi=function(X){let se=C(X);(!se||!se.tagName)&&(se={namespaceURI:ps,tagName:"template"});const be=Bg(X.tagName),Xe=Bg(se.tagName);return _a[X.namespaceURI]?X.namespaceURI===fs?se.namespaceURI===Ci?be==="svg":se.namespaceURI===hs?be==="svg"&&(Xe==="annotation-xml"||Si[Xe]):!!Hi[be]:X.namespaceURI===hs?se.namespaceURI===Ci?be==="math":se.namespaceURI===fs?be==="math"&&fo[Xe]:!!Ta[be]:X.namespaceURI===Ci?se.namespaceURI===fs&&!fo[Xe]||se.namespaceURI===hs&&!Si[Xe]?!1:!Ta[be]&&(ml[be]||!Hi[be]):!!(ka==="application/xhtml+xml"&&_a[X.namespaceURI]):!1},Or=function(X){Jf(t.removed,{element:X});try{C(X).removeChild(X)}catch{v(X)}},Qr=function(X,se){try{Jf(t.removed,{attribute:se.getAttributeNode(X),from:se})}catch{Jf(t.removed,{attribute:null,from:se})}if(se.removeAttribute(X),X==="is"&&!de[X])if(hn||xa)try{Or(se)}catch{}else try{se.setAttribute(X,"")}catch{}},po=function(X){let se=null,be=null;if(Fn)X="<remove></remove>"+X;else{const _e=sT(X,/^[\r\n\t ]+/);be=_e&&_e[0]}ka==="application/xhtml+xml"&&ps===Ci&&(X='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+X+"</body></html>");const Xe=S?S.createHTML(X):X;if(ps===Ci)try{se=new f().parseFromString(Xe,ka)}catch{}if(!se||!se.documentElement){se=M.createDocument(ps,"template",null);try{se.documentElement.innerHTML=Sa?k:Xe}catch{}}const De=se.body||se.documentElement;return X&&be&&De.insertBefore(n.createTextNode(be),De.childNodes[0]||null),ps===Ci?j.call(se,Tn?"html":"body")[0]:Tn?se.documentElement:De},mo=function(X){return T.call(X.ownerDocument||X,X,d.SHOW_ELEMENT|d.SHOW_COMMENT|d.SHOW_TEXT|d.SHOW_PROCESSING_INSTRUCTION|d.SHOW_CDATA_SECTION,null)},go=function(X){return X instanceof h&&(typeof X.nodeName!="string"||typeof X.textContent!="string"||typeof X.removeChild!="function"||!(X.attributes instanceof l)||typeof X.removeAttribute!="function"||typeof X.setAttribute!="function"||typeof X.namespaceURI!="string"||typeof X.insertBefore!="function"||typeof X.hasChildNodes!="function")},Us=function(X){return typeof o=="function"&&X instanceof o},_i=function(X,se,be){N[X]&&eg(N[X],Xe=>{Xe.call(t,se,be,Kr)})},Gd=function(X){let se=null;if(_i("beforeSanitizeElements",X,null),go(X))return Or(X),!0;const be=Qt(X.nodeName);if(_i("uponSanitizeElement",X,{tagName:be,allowedTags:G}),X.hasChildNodes()&&!Us(X.firstElementChild)&&Br(/<[/\w]/g,X.innerHTML)&&Br(/<[/\w]/g,X.textContent)||X.nodeType===rp.progressingInstruction||zt&&X.nodeType===rp.comment&&Br(/<[/\w]/g,X.data))return Or(X),!0;if(!G[be]||Me[be]){if(!Me[be]&&re(be)&&(ve.tagNameCheck instanceof RegExp&&Br(ve.tagNameCheck,be)||ve.tagNameCheck instanceof Function&&ve.tagNameCheck(be)))return!1;if(lo&&!Ei[be]){const Xe=C(X)||X.parentNode,De=w(X)||X.childNodes;if(De&&Xe){const _e=De.length;for(let ze=_e-1;ze>=0;--ze){const en=y(De[ze],!0);en.__removalCount=(X.__removalCount||0)+1,Xe.insertBefore(en,x(X))}}}return Or(X),!0}return X instanceof c&&!Wi(X)||(be==="noscript"||be==="noembed"||be==="noframes")&&Br(/<\/no(script|embed|frames)/i,X.innerHTML)?(Or(X),!0):(ut&&X.nodeType===rp.text&&(se=X.textContent,eg([F,$,q],Xe=>{se=ep(se,Xe," ")}),X.textContent!==se&&(Jf(t.removed,{element:X.cloneNode()}),X.textContent=se)),_i("afterSanitizeElements",X,null),!1)},Xi=function(X,se,be){if(xi&&(se==="id"||se==="name")&&(be in n||be in _c))return!1;if(!($e&&!Ce[se]&&Br(W,se))){if(!(ge&&Br(V,se))){if(!de[se]||Ce[se]){if(!(re(X)&&(ve.tagNameCheck instanceof RegExp&&Br(ve.tagNameCheck,X)||ve.tagNameCheck instanceof Function&&ve.tagNameCheck(X))&&(ve.attributeNameCheck instanceof RegExp&&Br(ve.attributeNameCheck,se)||ve.attributeNameCheck instanceof Function&&ve.attributeNameCheck(se))||se==="is"&&ve.allowCustomizedBuiltInElements&&(ve.tagNameCheck instanceof RegExp&&Br(ve.tagNameCheck,be)||ve.tagNameCheck instanceof Function&&ve.tagNameCheck(be))))return!1}else if(!zi[se]){if(!Br(K,ep(be,z,""))){if(!((se==="src"||se==="xlink:href"||se==="href")&&X!=="script"&&j2e(be,"data:")===0&&us[X])){if(!(je&&!Br(B,ep(be,z,"")))){if(be)return!1}}}}}}return!0},re=function(X){return X!=="annotation-xml"&&sT(X,Y)},ue=function(X){_i("beforeSanitizeAttributes",X,null);const{attributes:se}=X;if(!se)return;const be={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:de};let Xe=se.length;for(;Xe--;){const De=se[Xe],{name:_e,namespaceURI:ze,value:en}=De,Ht=Qt(_e);let sn=_e==="value"?en:P2e(en);if(be.attrName=Ht,be.attrValue=sn,be.keepAttr=!0,be.forceKeepAttr=void 0,_i("uponSanitizeAttribute",X,be),sn=be.attrValue,zt&&Br(/((--!?|])>)|<\/(style|title)/i,sn)){Qr(_e,X);continue}if(be.forceKeepAttr||(Qr(_e,X),!be.keepAttr))continue;if(!Je&&Br(/\/>/i,sn)){Qr(_e,X);continue}ut&&eg([F,$,q],Zh=>{sn=ep(sn,Zh," ")});const p0=Qt(X.nodeName);if(Xi(p0,Ht,sn)){if(xr&&(Ht==="id"||Ht==="name")&&(Qr(_e,X),sn=fl+sn),S&&typeof g=="object"&&typeof g.getAttributeType=="function"&&!ze)switch(g.getAttributeType(p0,Ht)){case"TrustedHTML":{sn=S.createHTML(sn);break}case"TrustedScriptURL":{sn=S.createScriptURL(sn);break}}try{ze?X.setAttributeNS(ze,_e,sn):X.setAttribute(_e,sn),go(X)?Or(X):aT(t.removed)}catch{}}}_i("afterSanitizeAttributes",X,null)},Ue=function ae(X){let se=null;const be=mo(X);for(_i("beforeSanitizeShadowDOM",X,null);se=be.nextNode();)_i("uponSanitizeShadowNode",se,null),!Gd(se)&&(se.content instanceof a&&ae(se.content),ue(se));_i("afterSanitizeShadowDOM",X,null)};return t.sanitize=function(ae){let X=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},se=null,be=null,Xe=null,De=null;if(Sa=!ae,Sa&&(ae="<!-->"),typeof ae!="string"&&!Us(ae))if(typeof ae.toString=="function"){if(ae=ae.toString(),typeof ae!="string")throw tp("dirty is not a string, aborting")}else throw tp("toString is not a function");if(!t.isSupported)return ae;if(On||ho(X),t.removed=[],typeof ae=="string"&&(wa=!1),wa){if(ae.nodeName){const en=Qt(ae.nodeName);if(!G[en]||Me[en])throw tp("root node is forbidden and cannot be sanitized in-place")}}else if(ae instanceof o)se=po("<!---->"),be=se.ownerDocument.importNode(ae,!0),be.nodeType===rp.element&&be.nodeName==="BODY"||be.nodeName==="HTML"?se=be:se.appendChild(be);else{if(!hn&&!ut&&!Tn&&ae.indexOf("<")===-1)return S&&fr?S.createHTML(ae):ae;if(se=po(ae),!se)return hn?null:fr?k:""}se&&Fn&&Or(se.firstChild);const _e=mo(wa?ae:se);for(;Xe=_e.nextNode();)Gd(Xe)||(Xe.content instanceof a&&Ue(Xe.content),ue(Xe));if(wa)return ae;if(hn){if(xa)for(De=R.call(se.ownerDocument);se.firstChild;)De.appendChild(se.firstChild);else De=se;return(de.shadowroot||de.shadowrootmode)&&(De=P.call(r,De,!0)),De}let ze=Tn?se.outerHTML:se.innerHTML;return Tn&&G["!doctype"]&&se.ownerDocument&&se.ownerDocument.doctype&&se.ownerDocument.doctype.name&&Br(kO,se.ownerDocument.doctype.name)&&(ze="<!DOCTYPE "+se.ownerDocument.doctype.name+`>
266
- `+ze),ut&&eg([F,$,q],en=>{ze=ep(ze,en," ")}),S&&fr?S.createHTML(ze):ze},t.setConfig=function(){let ae=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};ho(ae),On=!0},t.clearConfig=function(){Kr=null,On=!1},t.isValidAttribute=function(ae,X,se){Kr||ho({});const be=Qt(ae),Xe=Qt(X);return Xi(be,Xe,se)},t.addHook=function(ae,X){typeof X=="function"&&(N[ae]=N[ae]||[],Jf(N[ae],X))},t.removeHook=function(ae){if(N[ae])return aT(N[ae])},t.removeHooks=function(ae){N[ae]&&(N[ae]=[])},t.removeAllHooks=function(){N={}},t}var Th=TO();const zg={min:{r:0,g:0,b:0,s:0,l:0,a:0},max:{r:255,g:255,b:255,h:360,s:100,l:100,a:1},clamp:{r:e=>e>=255?255:e<0?0:e,g:e=>e>=255?255:e<0?0:e,b:e=>e>=255?255:e<0?0:e,h:e=>e%360,s:e=>e>=100?100:e<0?0:e,l:e=>e>=100?100:e<0?0:e,a:e=>e>=1?1:e<0?0:e},toLinear:e=>{const t=e/255;return e>.03928?Math.pow((t+.055)/1.055,2.4):t/12.92},hue2rgb:(e,t,n)=>(n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e),hsl2rgb:({h:e,s:t,l:n},r)=>{if(!t)return n*2.55;e/=360,t/=100,n/=100;const i=n<.5?n*(1+t):n+t-n*t,a=2*n-i;switch(r){case"r":return zg.hue2rgb(a,i,e+1/3)*255;case"g":return zg.hue2rgb(a,i,e)*255;case"b":return zg.hue2rgb(a,i,e-1/3)*255}},rgb2hsl:({r:e,g:t,b:n},r)=>{e/=255,t/=255,n/=255;const i=Math.max(e,t,n),a=Math.min(e,t,n),s=(i+a)/2;if(r==="l")return s*100;if(i===a)return 0;const o=i-a,c=s>.5?o/(2-i-a):o/(i+a);if(r==="s")return c*100;switch(i){case e:return((t-n)/o+(t<n?6:0))*60;case t:return((n-e)/o+2)*60;case n:return((e-t)/o+4)*60;default:return-1}}},K2e={clamp:(e,t,n)=>t>n?Math.min(t,Math.max(n,e)):Math.min(n,Math.max(t,e)),round:e=>Math.round(e*1e10)/1e10},Q2e={dec2hex:e=>{const t=Math.round(e).toString(16);return t.length>1?t:`0${t}`}},ft={channel:zg,lang:K2e,unit:Q2e},Xl={};for(let e=0;e<=255;e++)Xl[e]=ft.unit.dec2hex(e);const kr={ALL:0,RGB:1,HSL:2};class J2e{constructor(){this.type=kr.ALL}get(){return this.type}set(t){if(this.type&&this.type!==t)throw new Error("Cannot change both RGB and HSL channels at the same time");this.type=t}reset(){this.type=kr.ALL}is(t){return this.type===t}}class eUe{constructor(t,n){this.color=n,this.changed=!1,this.data=t,this.type=new J2e}set(t,n){return this.color=n,this.changed=!1,this.data=t,this.type.type=kr.ALL,this}_ensureHSL(){const t=this.data,{h:n,s:r,l:i}=t;n===void 0&&(t.h=ft.channel.rgb2hsl(t,"h")),r===void 0&&(t.s=ft.channel.rgb2hsl(t,"s")),i===void 0&&(t.l=ft.channel.rgb2hsl(t,"l"))}_ensureRGB(){const t=this.data,{r:n,g:r,b:i}=t;n===void 0&&(t.r=ft.channel.hsl2rgb(t,"r")),r===void 0&&(t.g=ft.channel.hsl2rgb(t,"g")),i===void 0&&(t.b=ft.channel.hsl2rgb(t,"b"))}get r(){const t=this.data,n=t.r;return!this.type.is(kr.HSL)&&n!==void 0?n:(this._ensureHSL(),ft.channel.hsl2rgb(t,"r"))}get g(){const t=this.data,n=t.g;return!this.type.is(kr.HSL)&&n!==void 0?n:(this._ensureHSL(),ft.channel.hsl2rgb(t,"g"))}get b(){const t=this.data,n=t.b;return!this.type.is(kr.HSL)&&n!==void 0?n:(this._ensureHSL(),ft.channel.hsl2rgb(t,"b"))}get h(){const t=this.data,n=t.h;return!this.type.is(kr.RGB)&&n!==void 0?n:(this._ensureRGB(),ft.channel.rgb2hsl(t,"h"))}get s(){const t=this.data,n=t.s;return!this.type.is(kr.RGB)&&n!==void 0?n:(this._ensureRGB(),ft.channel.rgb2hsl(t,"s"))}get l(){const t=this.data,n=t.l;return!this.type.is(kr.RGB)&&n!==void 0?n:(this._ensureRGB(),ft.channel.rgb2hsl(t,"l"))}get a(){return this.data.a}set r(t){this.type.set(kr.RGB),this.changed=!0,this.data.r=t}set g(t){this.type.set(kr.RGB),this.changed=!0,this.data.g=t}set b(t){this.type.set(kr.RGB),this.changed=!0,this.data.b=t}set h(t){this.type.set(kr.HSL),this.changed=!0,this.data.h=t}set s(t){this.type.set(kr.HSL),this.changed=!0,this.data.s=t}set l(t){this.type.set(kr.HSL),this.changed=!0,this.data.l=t}set a(t){this.changed=!0,this.data.a=t}}const y6=new eUe({r:0,g:0,b:0,a:0},"transparent"),rh={re:/^#((?:[a-f0-9]{2}){2,4}|[a-f0-9]{3})$/i,parse:e=>{if(e.charCodeAt(0)!==35)return;const t=e.match(rh.re);if(!t)return;const n=t[1],r=parseInt(n,16),i=n.length,a=i%4===0,s=i>4,o=s?1:17,c=s?8:4,d=a?0:-1,l=s?255:15;return y6.set({r:(r>>c*(d+3)&l)*o,g:(r>>c*(d+2)&l)*o,b:(r>>c*(d+1)&l)*o,a:a?(r&l)*o/255:1},e)},stringify:e=>{const{r:t,g:n,b:r,a:i}=e;return i<1?`#${Xl[Math.round(t)]}${Xl[Math.round(n)]}${Xl[Math.round(r)]}${Xl[Math.round(i*255)]}`:`#${Xl[Math.round(t)]}${Xl[Math.round(n)]}${Xl[Math.round(r)]}`}},ld={re:/^hsla?\(\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?(?:deg|grad|rad|turn)?)\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?%)\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?%)(?:\s*?(?:,|\/)\s*?\+?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?(%)?))?\s*?\)$/i,hueRe:/^(.+?)(deg|grad|rad|turn)$/i,_hue2deg:e=>{const t=e.match(ld.hueRe);if(t){const[,n,r]=t;switch(r){case"grad":return ft.channel.clamp.h(parseFloat(n)*.9);case"rad":return ft.channel.clamp.h(parseFloat(n)*180/Math.PI);case"turn":return ft.channel.clamp.h(parseFloat(n)*360)}}return ft.channel.clamp.h(parseFloat(e))},parse:e=>{const t=e.charCodeAt(0);if(t!==104&&t!==72)return;const n=e.match(ld.re);if(!n)return;const[,r,i,a,s,o]=n;return y6.set({h:ld._hue2deg(r),s:ft.channel.clamp.s(parseFloat(i)),l:ft.channel.clamp.l(parseFloat(a)),a:s?ft.channel.clamp.a(o?parseFloat(s)/100:parseFloat(s)):1},e)},stringify:e=>{const{h:t,s:n,l:r,a:i}=e;return i<1?`hsla(${ft.lang.round(t)}, ${ft.lang.round(n)}%, ${ft.lang.round(r)}%, ${i})`:`hsl(${ft.lang.round(t)}, ${ft.lang.round(n)}%, ${ft.lang.round(r)}%)`}},zp={colors:{aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyanaqua:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",transparent:"#00000000",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},parse:e=>{e=e.toLowerCase();const t=zp.colors[e];if(t)return rh.parse(t)},stringify:e=>{const t=rh.stringify(e);for(const n in zp.colors)if(zp.colors[n]===t)return n}},Cp={re:/^rgba?\(\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))(?:\s*?(?:,|\/)\s*?\+?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?)))?\s*?\)$/i,parse:e=>{const t=e.charCodeAt(0);if(t!==114&&t!==82)return;const n=e.match(Cp.re);if(!n)return;const[,r,i,a,s,o,c,d,l]=n;return y6.set({r:ft.channel.clamp.r(i?parseFloat(r)*2.55:parseFloat(r)),g:ft.channel.clamp.g(s?parseFloat(a)*2.55:parseFloat(a)),b:ft.channel.clamp.b(c?parseFloat(o)*2.55:parseFloat(o)),a:d?ft.channel.clamp.a(l?parseFloat(d)/100:parseFloat(d)):1},e)},stringify:e=>{const{r:t,g:n,b:r,a:i}=e;return i<1?`rgba(${ft.lang.round(t)}, ${ft.lang.round(n)}, ${ft.lang.round(r)}, ${ft.lang.round(i)})`:`rgb(${ft.lang.round(t)}, ${ft.lang.round(n)}, ${ft.lang.round(r)})`}},Js={format:{keyword:zp,hex:rh,rgb:Cp,rgba:Cp,hsl:ld,hsla:ld},parse:e=>{if(typeof e!="string")return e;const t=rh.parse(e)||Cp.parse(e)||ld.parse(e)||zp.parse(e);if(t)return t;throw new Error(`Unsupported color format: "${e}"`)},stringify:e=>!e.changed&&e.color?e.color:e.type.is(kr.HSL)||e.data.r===void 0?ld.stringify(e):e.a<1||!Number.isInteger(e.r)||!Number.isInteger(e.g)||!Number.isInteger(e.b)?Cp.stringify(e):rh.stringify(e)},MO=(e,t)=>{const n=Js.parse(e);for(const r in t)n[r]=ft.channel.clamp[r](t[r]);return Js.stringify(n)},Hp=(e,t,n=0,r=1)=>{if(typeof e!="number")return MO(e,{a:t});const i=y6.set({r:ft.channel.clamp.r(e),g:ft.channel.clamp.g(t),b:ft.channel.clamp.b(n),a:ft.channel.clamp.a(r)});return Js.stringify(i)},tUe=e=>{const{r:t,g:n,b:r}=Js.parse(e),i=.2126*ft.channel.toLinear(t)+.7152*ft.channel.toLinear(n)+.0722*ft.channel.toLinear(r);return ft.lang.round(i)},nUe=e=>tUe(e)>=.5,d0=e=>!nUe(e),IO=(e,t,n)=>{const r=Js.parse(e),i=r[t],a=ft.channel.clamp[t](i+n);return i!==a&&(r[t]=a),Js.stringify(r)},Ke=(e,t)=>IO(e,"l",t),at=(e,t)=>IO(e,"l",-t),ie=(e,t)=>{const n=Js.parse(e),r={};for(const i in t)t[i]&&(r[i]=n[i]+t[i]);return MO(e,r)},rUe=(e,t,n=50)=>{const{r,g:i,b:a,a:s}=Js.parse(e),{r:o,g:c,b:d,a:l}=Js.parse(t),h=n/100,f=h*2-1,g=s-l,y=((f*g===-1?f:(f+g)/(1+f*g))+1)/2,v=1-y,x=r*y+o*v,w=i*y+c*v,C=a*y+d*v,S=s*h+l*(1-h);return Hp(x,w,C,S)},Ne=(e,t=100)=>{const n=Js.parse(e);return n.r=255-n.r,n.g=255-n.g,n.b=255-n.b,rUe(n,e,t)};var AO=typeof global=="object"&&global&&global.Object===Object&&global,iUe=typeof self=="object"&&self&&self.Object===Object&&self,oo=AO||iUe||Function("return this")(),K2=oo.Symbol,LO=Object.prototype,aUe=LO.hasOwnProperty,sUe=LO.toString,ip=K2?K2.toStringTag:void 0;function oUe(e){var t=aUe.call(e,ip),n=e[ip];try{e[ip]=void 0;var r=!0}catch{}var i=sUe.call(e);return r&&(t?e[ip]=n:delete e[ip]),i}var lUe=Object.prototype,cUe=lUe.toString;function dUe(e){return cUe.call(e)}var uUe="[object Null]",hUe="[object Undefined]",hT=K2?K2.toStringTag:void 0;function Vh(e){return e==null?e===void 0?hUe:uUe:hT&&hT in Object(e)?oUe(e):dUe(e)}function Xd(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var fUe="[object AsyncFunction]",pUe="[object Function]",mUe="[object GeneratorFunction]",gUe="[object Proxy]";function kx(e){if(!Xd(e))return!1;var t=Vh(e);return t==pUe||t==mUe||t==fUe||t==gUe}var Ky=oo["__core-js_shared__"],fT=function(){var e=/[^.]+$/.exec(Ky&&Ky.keys&&Ky.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function UUe(e){return!!fT&&fT in e}var bUe=Function.prototype,yUe=bUe.toString;function Vd(e){if(e!=null){try{return yUe.call(e)}catch{}try{return e+""}catch{}}return""}var vUe=/[\\^$.*+?()[\]{}|]/g,xUe=/^\[object .+?Constructor\]$/,wUe=Function.prototype,EUe=Object.prototype,CUe=wUe.toString,SUe=EUe.hasOwnProperty,_Ue=RegExp("^"+CUe.call(SUe).replace(vUe,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function kUe(e){if(!Xd(e)||UUe(e))return!1;var t=kx(e)?_Ue:xUe;return t.test(Vd(e))}function TUe(e,t){return e==null?void 0:e[t]}function Yd(e,t){var n=TUe(e,t);return kUe(n)?n:void 0}var A1=Yd(Object,"create");function MUe(){this.__data__=A1?A1(null):{},this.size=0}function IUe(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var AUe="__lodash_hash_undefined__",LUe=Object.prototype,RUe=LUe.hasOwnProperty;function DUe(e){var t=this.__data__;if(A1){var n=t[e];return n===AUe?void 0:n}return RUe.call(t,e)?t[e]:void 0}var jUe=Object.prototype,PUe=jUe.hasOwnProperty;function NUe(e){var t=this.__data__;return A1?t[e]!==void 0:PUe.call(t,e)}var OUe="__lodash_hash_undefined__";function FUe(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=A1&&t===void 0?OUe:t,this}function Nd(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Nd.prototype.clear=MUe;Nd.prototype.delete=IUe;Nd.prototype.get=DUe;Nd.prototype.has=NUe;Nd.prototype.set=FUe;function $Ue(){this.__data__=[],this.size=0}function v6(e,t){return e===t||e!==e&&t!==t}function x6(e,t){for(var n=e.length;n--;)if(v6(e[n][0],t))return n;return-1}var BUe=Array.prototype,zUe=BUe.splice;function HUe(e){var t=this.__data__,n=x6(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():zUe.call(t,n,1),--this.size,!0}function WUe(e){var t=this.__data__,n=x6(t,e);return n<0?void 0:t[n][1]}function XUe(e){return x6(this.__data__,e)>-1}function VUe(e,t){var n=this.__data__,r=x6(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function hl(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}hl.prototype.clear=$Ue;hl.prototype.delete=HUe;hl.prototype.get=WUe;hl.prototype.has=XUe;hl.prototype.set=VUe;var L1=Yd(oo,"Map");function YUe(){this.size=0,this.__data__={hash:new Nd,map:new(L1||hl),string:new Nd}}function GUe(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function w6(e,t){var n=e.__data__;return GUe(t)?n[typeof t=="string"?"string":"hash"]:n.map}function qUe(e){var t=w6(this,e).delete(e);return this.size-=t?1:0,t}function ZUe(e){return w6(this,e).get(e)}function KUe(e){return w6(this,e).has(e)}function QUe(e,t){var n=w6(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}function Sc(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Sc.prototype.clear=YUe;Sc.prototype.delete=qUe;Sc.prototype.get=ZUe;Sc.prototype.has=KUe;Sc.prototype.set=QUe;var JUe="Expected a function";function u0(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(JUe);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],a=n.cache;if(a.has(i))return a.get(i);var s=e.apply(this,r);return n.cache=a.set(i,s)||a,s};return n.cache=new(u0.Cache||Sc),n}u0.Cache=Sc;function e6e(){this.__data__=new hl,this.size=0}function t6e(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function n6e(e){return this.__data__.get(e)}function r6e(e){return this.__data__.has(e)}var i6e=200;function a6e(e,t){var n=this.__data__;if(n instanceof hl){var r=n.__data__;if(!L1||r.length<i6e-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Sc(r)}return n.set(e,t),this.size=n.size,this}function Yh(e){var t=this.__data__=new hl(e);this.size=t.size}Yh.prototype.clear=e6e;Yh.prototype.delete=t6e;Yh.prototype.get=n6e;Yh.prototype.has=r6e;Yh.prototype.set=a6e;var Q2=function(){try{var e=Yd(Object,"defineProperty");return e({},"",{}),e}catch{}}();function Tx(e,t,n){t=="__proto__"&&Q2?Q2(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function B8(e,t,n){(n!==void 0&&!v6(e[t],n)||n===void 0&&!(t in e))&&Tx(e,t,n)}function s6e(e){return function(t,n,r){for(var i=-1,a=Object(t),s=r(t),o=s.length;o--;){var c=s[++i];if(n(a[c],c,a)===!1)break}return t}}var o6e=s6e(),RO=typeof exports=="object"&&exports&&!exports.nodeType&&exports,pT=RO&&typeof module=="object"&&module&&!module.nodeType&&module,l6e=pT&&pT.exports===RO,mT=l6e?oo.Buffer:void 0,gT=mT?mT.allocUnsafe:void 0;function c6e(e,t){if(t)return e.slice();var n=e.length,r=gT?gT(n):new e.constructor(n);return e.copy(r),r}var UT=oo.Uint8Array;function d6e(e){var t=new e.constructor(e.byteLength);return new UT(t).set(new UT(e)),t}function u6e(e,t){var n=t?d6e(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function h6e(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}var bT=Object.create,f6e=function(){function e(){}return function(t){if(!Xd(t))return{};if(bT)return bT(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function DO(e,t){return function(n){return e(t(n))}}var jO=DO(Object.getPrototypeOf,Object),p6e=Object.prototype;function E6(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||p6e;return e===n}function m6e(e){return typeof e.constructor=="function"&&!E6(e)?f6e(jO(e)):{}}function h0(e){return e!=null&&typeof e=="object"}var g6e="[object Arguments]";function yT(e){return h0(e)&&Vh(e)==g6e}var PO=Object.prototype,U6e=PO.hasOwnProperty,b6e=PO.propertyIsEnumerable,J2=yT(function(){return arguments}())?yT:function(e){return h0(e)&&U6e.call(e,"callee")&&!b6e.call(e,"callee")},eU=Array.isArray,y6e=9007199254740991;function NO(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=y6e}function C6(e){return e!=null&&NO(e.length)&&!kx(e)}function v6e(e){return h0(e)&&C6(e)}function x6e(){return!1}var OO=typeof exports=="object"&&exports&&!exports.nodeType&&exports,vT=OO&&typeof module=="object"&&module&&!module.nodeType&&module,w6e=vT&&vT.exports===OO,xT=w6e?oo.Buffer:void 0,E6e=xT?xT.isBuffer:void 0,Mx=E6e||x6e,C6e="[object Object]",S6e=Function.prototype,_6e=Object.prototype,FO=S6e.toString,k6e=_6e.hasOwnProperty,T6e=FO.call(Object);function M6e(e){if(!h0(e)||Vh(e)!=C6e)return!1;var t=jO(e);if(t===null)return!0;var n=k6e.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&FO.call(n)==T6e}var I6e="[object Arguments]",A6e="[object Array]",L6e="[object Boolean]",R6e="[object Date]",D6e="[object Error]",j6e="[object Function]",P6e="[object Map]",N6e="[object Number]",O6e="[object Object]",F6e="[object RegExp]",$6e="[object Set]",B6e="[object String]",z6e="[object WeakMap]",H6e="[object ArrayBuffer]",W6e="[object DataView]",X6e="[object Float32Array]",V6e="[object Float64Array]",Y6e="[object Int8Array]",G6e="[object Int16Array]",q6e="[object Int32Array]",Z6e="[object Uint8Array]",K6e="[object Uint8ClampedArray]",Q6e="[object Uint16Array]",J6e="[object Uint32Array]",cn={};cn[X6e]=cn[V6e]=cn[Y6e]=cn[G6e]=cn[q6e]=cn[Z6e]=cn[K6e]=cn[Q6e]=cn[J6e]=!0;cn[I6e]=cn[A6e]=cn[H6e]=cn[L6e]=cn[W6e]=cn[R6e]=cn[D6e]=cn[j6e]=cn[P6e]=cn[N6e]=cn[O6e]=cn[F6e]=cn[$6e]=cn[B6e]=cn[z6e]=!1;function e5e(e){return h0(e)&&NO(e.length)&&!!cn[Vh(e)]}function t5e(e){return function(t){return e(t)}}var $O=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Wp=$O&&typeof module=="object"&&module&&!module.nodeType&&module,n5e=Wp&&Wp.exports===$O,Qy=n5e&&AO.process,wT=function(){try{var e=Wp&&Wp.require&&Wp.require("util").types;return e||Qy&&Qy.binding&&Qy.binding("util")}catch{}}(),ET=wT&&wT.isTypedArray,Ix=ET?t5e(ET):e5e;function z8(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}var r5e=Object.prototype,i5e=r5e.hasOwnProperty;function a5e(e,t,n){var r=e[t];(!(i5e.call(e,t)&&v6(r,n))||n===void 0&&!(t in e))&&Tx(e,t,n)}function s5e(e,t,n,r){var i=!n;n||(n={});for(var a=-1,s=t.length;++a<s;){var o=t[a],c=void 0;c===void 0&&(c=e[o]),i?Tx(n,o,c):a5e(n,o,c)}return n}function o5e(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var l5e=9007199254740991,c5e=/^(?:0|[1-9]\d*)$/;function BO(e,t){var n=typeof e;return t=t??l5e,!!t&&(n=="number"||n!="symbol"&&c5e.test(e))&&e>-1&&e%1==0&&e<t}var d5e=Object.prototype,u5e=d5e.hasOwnProperty;function h5e(e,t){var n=eU(e),r=!n&&J2(e),i=!n&&!r&&Mx(e),a=!n&&!r&&!i&&Ix(e),s=n||r||i||a,o=s?o5e(e.length,String):[],c=o.length;for(var d in e)(t||u5e.call(e,d))&&!(s&&(d=="length"||i&&(d=="offset"||d=="parent")||a&&(d=="buffer"||d=="byteLength"||d=="byteOffset")||BO(d,c)))&&o.push(d);return o}function f5e(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var p5e=Object.prototype,m5e=p5e.hasOwnProperty;function g5e(e){if(!Xd(e))return f5e(e);var t=E6(e),n=[];for(var r in e)r=="constructor"&&(t||!m5e.call(e,r))||n.push(r);return n}function zO(e){return C6(e)?h5e(e,!0):g5e(e)}function U5e(e){return s5e(e,zO(e))}function b5e(e,t,n,r,i,a,s){var o=z8(e,n),c=z8(t,n),d=s.get(c);if(d){B8(e,n,d);return}var l=a?a(o,c,n+"",e,t,s):void 0,h=l===void 0;if(h){var f=eU(c),g=!f&&Mx(c),U=!f&&!g&&Ix(c);l=c,f||g||U?eU(o)?l=o:v6e(o)?l=h6e(o):g?(h=!1,l=c6e(c,!0)):U?(h=!1,l=u6e(c,!0)):l=[]:M6e(c)||J2(c)?(l=o,J2(o)?l=U5e(o):(!Xd(o)||kx(o))&&(l=m6e(c))):h=!1}h&&(s.set(c,l),i(l,c,r,a,s),s.delete(c)),B8(e,n,l)}function HO(e,t,n,r,i){e!==t&&o6e(t,function(a,s){if(i||(i=new Yh),Xd(a))b5e(e,t,s,n,HO,r,i);else{var o=r?r(z8(e,s),a,s+"",e,t,i):void 0;o===void 0&&(o=a),B8(e,s,o)}},zO)}function WO(e){return e}function y5e(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}var CT=Math.max;function v5e(e,t,n){return t=CT(t===void 0?e.length-1:t,0),function(){for(var r=arguments,i=-1,a=CT(r.length-t,0),s=Array(a);++i<a;)s[i]=r[t+i];i=-1;for(var o=Array(t+1);++i<t;)o[i]=r[i];return o[t]=n(s),y5e(e,this,o)}}function x5e(e){return function(){return e}}var w5e=Q2?function(e,t){return Q2(e,"toString",{configurable:!0,enumerable:!1,value:x5e(t),writable:!0})}:WO,E5e=800,C5e=16,S5e=Date.now;function _5e(e){var t=0,n=0;return function(){var r=S5e(),i=C5e-(r-n);if(n=r,i>0){if(++t>=E5e)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var k5e=_5e(w5e);function T5e(e,t){return k5e(v5e(e,t,WO),e+"")}function M5e(e,t,n){if(!Xd(n))return!1;var r=typeof t;return(r=="number"?C6(n)&&BO(t,n.length):r=="string"&&t in n)?v6(n[t],e):!1}function I5e(e){return T5e(function(t,n){var r=-1,i=n.length,a=i>1?n[i-1]:void 0,s=i>2?n[2]:void 0;for(a=e.length>3&&typeof a=="function"?(i--,a):void 0,s&&M5e(n[0],n[1],s)&&(a=i<3?void 0:a,i=1),t=Object(t);++r<i;){var o=n[r];o&&e(t,o,r,a)}return t})}var A5e=I5e(function(e,t,n){HO(e,t,n)}),XO="comm",VO="rule",YO="decl",L5e="@import",R5e="@namespace",D5e="@keyframes",j5e="@layer",GO=Math.abs,Ax=String.fromCharCode;function qO(e){return e.trim()}function Hg(e,t,n){return e.replace(t,n)}function P5e(e,t,n){return e.indexOf(t,n)}function ih(e,t){return e.charCodeAt(t)|0}function Mh(e,t,n){return e.slice(t,n)}function Rs(e){return e.length}function N5e(e){return e.length}function ng(e,t){return t.push(e),e}var S6=1,Ih=1,ZO=0,ba=0,Hn=0,Gh="";function Lx(e,t,n,r,i,a,s,o){return{value:e,root:t,parent:n,type:r,props:i,children:a,line:S6,column:Ih,length:s,return:"",siblings:o}}function O5e(){return Hn}function F5e(){return Hn=ba>0?ih(Gh,--ba):0,Ih--,Hn===10&&(Ih=1,S6--),Hn}function ns(){return Hn=ba<ZO?ih(Gh,ba++):0,Ih++,Hn===10&&(Ih=1,S6++),Hn}function rc(){return ih(Gh,ba)}function Wg(){return ba}function _6(e,t){return Mh(Gh,e,t)}function R1(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function $5e(e){return S6=Ih=1,ZO=Rs(Gh=e),ba=0,[]}function B5e(e){return Gh="",e}function Jy(e){return qO(_6(ba-1,H8(e===91?e+2:e===40?e+1:e)))}function z5e(e){for(;(Hn=rc())&&Hn<33;)ns();return R1(e)>2||R1(Hn)>3?"":" "}function H5e(e,t){for(;--t&&ns()&&!(Hn<48||Hn>102||Hn>57&&Hn<65||Hn>70&&Hn<97););return _6(e,Wg()+(t<6&&rc()==32&&ns()==32))}function H8(e){for(;ns();)switch(Hn){case e:return ba;case 34:case 39:e!==34&&e!==39&&H8(Hn);break;case 40:e===41&&H8(e);break;case 92:ns();break}return ba}function W5e(e,t){for(;ns()&&e+Hn!==57;)if(e+Hn===84&&rc()===47)break;return"/*"+_6(t,ba-1)+"*"+Ax(e===47?e:ns())}function X5e(e){for(;!R1(rc());)ns();return _6(e,ba)}function V5e(e){return B5e(Xg("",null,null,null,[""],e=$5e(e),0,[0],e))}function Xg(e,t,n,r,i,a,s,o,c){for(var d=0,l=0,h=s,f=0,g=0,U=0,y=1,v=1,x=1,w=0,C="",S=i,k=a,M=r,T=C;v;)switch(U=w,w=ns()){case 40:if(U!=108&&ih(T,h-1)==58){P5e(T+=Hg(Jy(w),"&","&\f"),"&\f",GO(d?o[d-1]:0))!=-1&&(x=-1);break}case 34:case 39:case 91:T+=Jy(w);break;case 9:case 10:case 13:case 32:T+=z5e(U);break;case 92:T+=H5e(Wg()-1,7);continue;case 47:switch(rc()){case 42:case 47:ng(Y5e(W5e(ns(),Wg()),t,n,c),c),(R1(U||1)==5||R1(rc()||1)==5)&&Rs(T)&&Mh(T,-1,void 0)!==" "&&(T+=" ");break;default:T+="/"}break;case 123*y:o[d++]=Rs(T)*x;case 125*y:case 59:case 0:switch(w){case 0:case 125:v=0;case 59+l:x==-1&&(T=Hg(T,/\f/g,"")),g>0&&(Rs(T)-h||y===0&&U===47)&&ng(g>32?_T(T+";",r,n,h-1,c):_T(Hg(T," ","")+";",r,n,h-2,c),c);break;case 59:T+=";";default:if(ng(M=ST(T,t,n,d,l,i,o,C,S=[],k=[],h,a),a),w===123)if(l===0)Xg(T,t,M,M,S,a,h,o,k);else{switch(f){case 99:if(ih(T,3)===110)break;case 108:if(ih(T,2)===97)break;default:l=0;case 100:case 109:case 115:}l?Xg(e,M,M,r&&ng(ST(e,M,M,0,0,i,o,C,i,S=[],h,k),k),i,k,h,o,r?S:k):Xg(T,M,M,M,[""],k,0,o,k)}}d=l=g=0,y=x=1,C=T="",h=s;break;case 58:h=1+Rs(T),g=U;default:if(y<1){if(w==123)--y;else if(w==125&&y++==0&&F5e()==125)continue}switch(T+=Ax(w),w*y){case 38:x=l>0?1:(T+="\f",-1);break;case 44:o[d++]=(Rs(T)-1)*x,x=1;break;case 64:rc()===45&&(T+=Jy(ns())),f=rc(),l=h=Rs(C=T+=X5e(Wg())),w++;break;case 45:U===45&&Rs(T)==2&&(y=0)}}return a}function ST(e,t,n,r,i,a,s,o,c,d,l,h){for(var f=i-1,g=i===0?a:[""],U=N5e(g),y=0,v=0,x=0;y<r;++y)for(var w=0,C=Mh(e,f+1,f=GO(v=s[y])),S=e;w<U;++w)(S=qO(v>0?g[w]+" "+C:Hg(C,/&\f/g,g[w])))&&(c[x++]=S);return Lx(e,t,n,i===0?VO:o,c,d,l,h)}function Y5e(e,t,n,r){return Lx(e,t,n,XO,Ax(O5e()),Mh(e,2,-2),0,r)}function _T(e,t,n,r,i){return Lx(e,t,n,YO,Mh(e,0,r),Mh(e,r+1,-1),r,i)}function W8(e,t){for(var n="",r=0;r<e.length;r++)n+=t(e[r],r,e,t)||"";return n}function G5e(e,t,n,r){switch(e.type){case j5e:if(e.children.length)break;case L5e:case R5e:case YO:return e.return=e.return||e.value;case XO:return"";case D5e:return e.return=e.value+"{"+W8(e.children,r)+"}";case VO:if(!Rs(e.value=e.props.join(",")))return""}return Rs(n=W8(e.children,r))?e.return=e.value+"{"+n+"}":""}var q5e=DO(Object.keys,Object),Z5e=Object.prototype,K5e=Z5e.hasOwnProperty;function Q5e(e){if(!E6(e))return q5e(e);var t=[];for(var n in Object(e))K5e.call(e,n)&&n!="constructor"&&t.push(n);return t}var X8=Yd(oo,"DataView"),V8=Yd(oo,"Promise"),Y8=Yd(oo,"Set"),G8=Yd(oo,"WeakMap"),kT="[object Map]",J5e="[object Object]",TT="[object Promise]",MT="[object Set]",IT="[object WeakMap]",AT="[object DataView]",ebe=Vd(X8),tbe=Vd(L1),nbe=Vd(V8),rbe=Vd(Y8),ibe=Vd(G8),qc=Vh;(X8&&qc(new X8(new ArrayBuffer(1)))!=AT||L1&&qc(new L1)!=kT||V8&&qc(V8.resolve())!=TT||Y8&&qc(new Y8)!=MT||G8&&qc(new G8)!=IT)&&(qc=function(e){var t=Vh(e),n=t==J5e?e.constructor:void 0,r=n?Vd(n):"";if(r)switch(r){case ebe:return AT;case tbe:return kT;case nbe:return TT;case rbe:return MT;case ibe:return IT}return t});var abe="[object Map]",sbe="[object Set]",obe=Object.prototype,lbe=obe.hasOwnProperty;function e3(e){if(e==null)return!0;if(C6(e)&&(eU(e)||typeof e=="string"||typeof e.splice=="function"||Mx(e)||Ix(e)||J2(e)))return!e.length;var t=qc(e);if(t==abe||t==sbe)return!e.size;if(E6(e))return!Q5e(e).length;for(var n in e)if(lbe.call(e,n))return!1;return!0}const Mo={trace:0,debug:1,info:2,warn:3,error:4,fatal:5},et={trace:(...e)=>{},debug:(...e)=>{},info:(...e)=>{},warn:(...e)=>{},error:(...e)=>{},fatal:(...e)=>{}},Rx=function(e="fatal"){let t=Mo.fatal;typeof e=="string"?(e=e.toLowerCase(),e in Mo&&(t=Mo[e])):typeof e=="number"&&(t=e),et.trace=()=>{},et.debug=()=>{},et.info=()=>{},et.warn=()=>{},et.error=()=>{},et.fatal=()=>{},t<=Mo.fatal&&(et.fatal=console.error?console.error.bind(console,Qi("FATAL"),"color: orange"):console.log.bind(console,"\x1B[35m",Qi("FATAL"))),t<=Mo.error&&(et.error=console.error?console.error.bind(console,Qi("ERROR"),"color: orange"):console.log.bind(console,"\x1B[31m",Qi("ERROR"))),t<=Mo.warn&&(et.warn=console.warn?console.warn.bind(console,Qi("WARN"),"color: orange"):console.log.bind(console,"\x1B[33m",Qi("WARN"))),t<=Mo.info&&(et.info=console.info?console.info.bind(console,Qi("INFO"),"color: lightblue"):console.log.bind(console,"\x1B[34m",Qi("INFO"))),t<=Mo.debug&&(et.debug=console.debug?console.debug.bind(console,Qi("DEBUG"),"color: lightgreen"):console.log.bind(console,"\x1B[32m",Qi("DEBUG"))),t<=Mo.trace&&(et.trace=console.debug?console.debug.bind(console,Qi("TRACE"),"color: lightgreen"):console.log.bind(console,"\x1B[32m",Qi("TRACE")))},Qi=e=>`%c${K1e().format("ss.SSS")} : ${e} : `,f0=/<br\s*\/?>/gi,cbe=e=>e?QO(e).replace(/\\n/g,"#br#").split("#br#"):[""],dbe=(()=>{let e=!1;return()=>{e||(ube(),e=!0)}})();function ube(){const e="data-temp-href-target";Th.addHook("beforeSanitizeAttributes",t=>{t.tagName==="A"&&t.hasAttribute("target")&&t.setAttribute(e,t.getAttribute("target")||"")}),Th.addHook("afterSanitizeAttributes",t=>{t.tagName==="A"&&t.hasAttribute(e)&&(t.setAttribute("target",t.getAttribute(e)||""),t.removeAttribute(e),t.getAttribute("target")==="_blank"&&t.setAttribute("rel","noopener"))})}const KO=e=>(dbe(),Th.sanitize(e)),LT=(e,t)=>{var n;if(((n=t.flowchart)==null?void 0:n.htmlLabels)!==!1){const r=t.securityLevel;r==="antiscript"||r==="strict"?e=KO(e):r!=="loose"&&(e=QO(e),e=e.replace(/</g,"&lt;").replace(/>/g,"&gt;"),e=e.replace(/=/g,"&equals;"),e=mbe(e))}return e},Ah=(e,t)=>e&&(t.dompurifyConfig?e=Th.sanitize(LT(e,t),t.dompurifyConfig).toString():e=Th.sanitize(LT(e,t),{FORBID_TAGS:["style"]}).toString(),e),hbe=(e,t)=>typeof e=="string"?Ah(e,t):e.flat().map(n=>Ah(n,t)),fbe=e=>f0.test(e),pbe=e=>e.split(f0),mbe=e=>e.replace(/#br#/g,"<br/>"),QO=e=>e.replace(f0,"#br#"),gbe=e=>{let t="";return e&&(t=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,t=t.replaceAll(/\(/g,"\\("),t=t.replaceAll(/\)/g,"\\)")),t},JO=e=>!(e===!1||["false","null","0"].includes(String(e).trim().toLowerCase())),Ube=function(...e){const t=e.filter(n=>!isNaN(n));return Math.max(...t)},bbe=function(...e){const t=e.filter(n=>!isNaN(n));return Math.min(...t)},T4e=function(e){const t=e.split(/(,)/),n=[];for(let r=0;r<t.length;r++){let i=t[r];if(i===","&&r>0&&r+1<t.length){const a=t[r-1],s=t[r+1];ybe(a,s)&&(i=a+","+s,r++,n.pop())}n.push(vbe(i))}return n.join("")},q8=(e,t)=>Math.max(0,e.split(t).length-1),ybe=(e,t)=>{const n=q8(e,"~"),r=q8(t,"~");return n===1&&r===1},vbe=e=>{const t=q8(e,"~");let n=!1;if(t<=1)return e;t%2!==0&&e.startsWith("~")&&(e=e.substring(1),n=!0);const r=[...e];let i=r.indexOf("~"),a=r.lastIndexOf("~");for(;i!==-1&&a!==-1&&i!==a;)r[i]="<",r[a]=">",i=r.indexOf("~"),a=r.lastIndexOf("~");return n&&r.unshift("~"),r.join("")},RT=()=>window.MathMLElement!==void 0,Z8=/\$\$(.*)\$\$/g,DT=e=>{var t;return(((t=e.match(Z8))==null?void 0:t.length)??0)>0},M4e=async(e,t)=>{const n=document.createElement("div");n.innerHTML=await wbe(e,t),n.id="katex-temp",n.style.visibility="hidden",n.style.position="absolute",n.style.top="0";const r=document.querySelector("body");r==null||r.insertAdjacentElement("beforeend",n);const i={width:n.clientWidth,height:n.clientHeight};return n.remove(),i},xbe=async(e,t)=>{if(!DT(e))return e;if(!RT()&&!t.legacyMathML)return e.replace(Z8,"MathML is unsupported in this environment.");const{default:n}=await ye(async()=>{const{default:r}=await import("./katex-ChWnQ-fc.js");return{default:r}},[],import.meta.url);return e.split(f0).map(r=>DT(r)?`
267
- <div style="display: flex; align-items: center; justify-content: center; white-space: nowrap;">
268
- ${r}
269
- </div>
270
- `:`<div>${r}</div>`).join("").replace(Z8,(r,i)=>n.renderToString(i,{throwOnError:!0,displayMode:!0,output:RT()?"mathml":"htmlAndMathml"}).replace(/\n/g," ").replace(/<annotation.*<\/annotation>/g,""))},wbe=async(e,t)=>Ah(await xbe(e,t),t),Dx={getRows:cbe,sanitizeText:Ah,sanitizeTextOrArray:hbe,hasBreaks:fbe,splitBreaks:pbe,lineBreakRegex:f0,removeScript:KO,getUrl:gbe,evaluate:JO,getMax:Ube,getMin:bbe},Vr=(e,t)=>t?ie(e,{s:-40,l:10}):ie(e,{s:-40,l:-10}),k6="#ffffff",T6="#f2f2f2";let Ebe=class{constructor(){this.background="#f4f4f4",this.primaryColor="#fff4dd",this.noteBkgColor="#fff5ad",this.noteTextColor="#333",this.THEME_COLOR_LIMIT=12,this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px"}updateColors(){var t,n,r,i,a,s,o,c,d,l,h;if(this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#333"),this.secondaryColor=this.secondaryColor||ie(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||ie(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||Vr(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||Vr(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||Vr(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||Vr(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||Ne(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||Ne(this.tertiaryColor),this.lineColor=this.lineColor||Ne(this.background),this.arrowheadColor=this.arrowheadColor||Ne(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.primaryBorderColor,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?at(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||"grey",this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||at(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||Ne(this.lineColor),this.sectionBkgColor=this.sectionBkgColor||this.tertiaryColor,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||this.secondaryColor,this.sectionBkgColor2=this.sectionBkgColor2||this.primaryColor,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||this.primaryColor,this.activeTaskBorderColor=this.activeTaskBorderColor||this.primaryColor,this.activeTaskBkgColor=this.activeTaskBkgColor||Ke(this.primaryColor,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.taskTextColor=this.taskTextColor||this.textColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||this.tertiaryColor,this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||ie(this.primaryColor,{h:30}),this.cScale4=this.cScale4||ie(this.primaryColor,{h:60}),this.cScale5=this.cScale5||ie(this.primaryColor,{h:90}),this.cScale6=this.cScale6||ie(this.primaryColor,{h:120}),this.cScale7=this.cScale7||ie(this.primaryColor,{h:150}),this.cScale8=this.cScale8||ie(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||ie(this.primaryColor,{h:270}),this.cScale10=this.cScale10||ie(this.primaryColor,{h:300}),this.cScale11=this.cScale11||ie(this.primaryColor,{h:330}),this.darkMode)for(let g=0;g<this.THEME_COLOR_LIMIT;g++)this["cScale"+g]=at(this["cScale"+g],75);else for(let g=0;g<this.THEME_COLOR_LIMIT;g++)this["cScale"+g]=at(this["cScale"+g],25);for(let g=0;g<this.THEME_COLOR_LIMIT;g++)this["cScaleInv"+g]=this["cScaleInv"+g]||Ne(this["cScale"+g]);for(let g=0;g<this.THEME_COLOR_LIMIT;g++)this.darkMode?this["cScalePeer"+g]=this["cScalePeer"+g]||Ke(this["cScale"+g],10):this["cScalePeer"+g]=this["cScalePeer"+g]||at(this["cScale"+g],10);this.scaleLabelColor=this.scaleLabelColor||this.labelTextColor;for(let g=0;g<this.THEME_COLOR_LIMIT;g++)this["cScaleLabel"+g]=this["cScaleLabel"+g]||this.scaleLabelColor;const f=this.darkMode?-4:-1;for(let g=0;g<5;g++)this["surface"+g]=this["surface"+g]||ie(this.mainBkg,{h:180,s:-15,l:f*(5+g*3)}),this["surfacePeer"+g]=this["surfacePeer"+g]||ie(this.mainBkg,{h:180,s:-15,l:f*(8+g*3)});this.classText=this.classText||this.textColor,this.fillType0=this.fillType0||this.primaryColor,this.fillType1=this.fillType1||this.secondaryColor,this.fillType2=this.fillType2||ie(this.primaryColor,{h:64}),this.fillType3=this.fillType3||ie(this.secondaryColor,{h:64}),this.fillType4=this.fillType4||ie(this.primaryColor,{h:-64}),this.fillType5=this.fillType5||ie(this.secondaryColor,{h:-64}),this.fillType6=this.fillType6||ie(this.primaryColor,{h:128}),this.fillType7=this.fillType7||ie(this.secondaryColor,{h:128}),this.pie1=this.pie1||this.primaryColor,this.pie2=this.pie2||this.secondaryColor,this.pie3=this.pie3||this.tertiaryColor,this.pie4=this.pie4||ie(this.primaryColor,{l:-10}),this.pie5=this.pie5||ie(this.secondaryColor,{l:-10}),this.pie6=this.pie6||ie(this.tertiaryColor,{l:-10}),this.pie7=this.pie7||ie(this.primaryColor,{h:60,l:-10}),this.pie8=this.pie8||ie(this.primaryColor,{h:-60,l:-10}),this.pie9=this.pie9||ie(this.primaryColor,{h:120,l:0}),this.pie10=this.pie10||ie(this.primaryColor,{h:60,l:-20}),this.pie11=this.pie11||ie(this.primaryColor,{h:-60,l:-20}),this.pie12=this.pie12||ie(this.primaryColor,{h:120,l:-10}),this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||ie(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||ie(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||ie(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||ie(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||ie(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||ie(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||d0(this.quadrant1Fill)?Ke(this.quadrant1Fill):at(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:((t=this.xyChart)==null?void 0:t.backgroundColor)||this.background,titleColor:((n=this.xyChart)==null?void 0:n.titleColor)||this.primaryTextColor,xAxisTitleColor:((r=this.xyChart)==null?void 0:r.xAxisTitleColor)||this.primaryTextColor,xAxisLabelColor:((i=this.xyChart)==null?void 0:i.xAxisLabelColor)||this.primaryTextColor,xAxisTickColor:((a=this.xyChart)==null?void 0:a.xAxisTickColor)||this.primaryTextColor,xAxisLineColor:((s=this.xyChart)==null?void 0:s.xAxisLineColor)||this.primaryTextColor,yAxisTitleColor:((o=this.xyChart)==null?void 0:o.yAxisTitleColor)||this.primaryTextColor,yAxisLabelColor:((c=this.xyChart)==null?void 0:c.yAxisLabelColor)||this.primaryTextColor,yAxisTickColor:((d=this.xyChart)==null?void 0:d.yAxisTickColor)||this.primaryTextColor,yAxisLineColor:((l=this.xyChart)==null?void 0:l.yAxisLineColor)||this.primaryTextColor,plotColorPalette:((h=this.xyChart)==null?void 0:h.plotColorPalette)||"#FFF4DD,#FFD8B1,#FFA07A,#ECEFF1,#D6DBDF,#C3E0A8,#FFB6A4,#FFD74D,#738FA7,#FFFFF0"},this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||(this.darkMode?at(this.secondaryColor,30):this.secondaryColor),this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=this.git0||this.primaryColor,this.git1=this.git1||this.secondaryColor,this.git2=this.git2||this.tertiaryColor,this.git3=this.git3||ie(this.primaryColor,{h:-30}),this.git4=this.git4||ie(this.primaryColor,{h:-60}),this.git5=this.git5||ie(this.primaryColor,{h:-90}),this.git6=this.git6||ie(this.primaryColor,{h:60}),this.git7=this.git7||ie(this.primaryColor,{h:120}),this.darkMode?(this.git0=Ke(this.git0,25),this.git1=Ke(this.git1,25),this.git2=Ke(this.git2,25),this.git3=Ke(this.git3,25),this.git4=Ke(this.git4,25),this.git5=Ke(this.git5,25),this.git6=Ke(this.git6,25),this.git7=Ke(this.git7,25)):(this.git0=at(this.git0,25),this.git1=at(this.git1,25),this.git2=at(this.git2,25),this.git3=at(this.git3,25),this.git4=at(this.git4,25),this.git5=at(this.git5,25),this.git6=at(this.git6,25),this.git7=at(this.git7,25)),this.gitInv0=this.gitInv0||Ne(this.git0),this.gitInv1=this.gitInv1||Ne(this.git1),this.gitInv2=this.gitInv2||Ne(this.git2),this.gitInv3=this.gitInv3||Ne(this.git3),this.gitInv4=this.gitInv4||Ne(this.git4),this.gitInv5=this.gitInv5||Ne(this.git5),this.gitInv6=this.gitInv6||Ne(this.git6),this.gitInv7=this.gitInv7||Ne(this.git7),this.branchLabelColor=this.branchLabelColor||(this.darkMode?"black":this.labelTextColor),this.gitBranchLabel0=this.gitBranchLabel0||this.branchLabelColor,this.gitBranchLabel1=this.gitBranchLabel1||this.branchLabelColor,this.gitBranchLabel2=this.gitBranchLabel2||this.branchLabelColor,this.gitBranchLabel3=this.gitBranchLabel3||this.branchLabelColor,this.gitBranchLabel4=this.gitBranchLabel4||this.branchLabelColor,this.gitBranchLabel5=this.gitBranchLabel5||this.branchLabelColor,this.gitBranchLabel6=this.gitBranchLabel6||this.branchLabelColor,this.gitBranchLabel7=this.gitBranchLabel7||this.branchLabelColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||k6,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||T6}calculate(t){if(typeof t!="object"){this.updateColors();return}const n=Object.keys(t);n.forEach(r=>{this[r]=t[r]}),this.updateColors(),n.forEach(r=>{this[r]=t[r]})}};const Cbe=e=>{const t=new Ebe;return t.calculate(e),t};let Sbe=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=Ke(this.primaryColor,16),this.tertiaryColor=ie(this.primaryColor,{h:-160}),this.primaryBorderColor=Ne(this.background),this.secondaryBorderColor=Vr(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=Vr(this.tertiaryColor,this.darkMode),this.primaryTextColor=Ne(this.primaryColor),this.secondaryTextColor=Ne(this.secondaryColor),this.tertiaryTextColor=Ne(this.tertiaryColor),this.lineColor=Ne(this.background),this.textColor=Ne(this.background),this.mainBkg="#1f2020",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=Ke(Ne("#323D47"),10),this.lineColor="calculated",this.border1="#81B1DB",this.border2=Hp(255,255,255,.25),this.arrowheadColor="calculated",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.labelBackground="#181818",this.textColor="#ccc",this.THEME_COLOR_LIMIT=12,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="#F9FFFE",this.edgeLabelBackground="calculated",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="calculated",this.actorLineColor="calculated",this.signalColor="calculated",this.signalTextColor="calculated",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="calculated",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="#fff5ad",this.noteTextColor="calculated",this.activationBorderColor="calculated",this.activationBkgColor="calculated",this.sequenceNumberColor="black",this.sectionBkgColor=at("#EAE8D9",30),this.altSectionBkgColor="calculated",this.sectionBkgColor2="#EAE8D9",this.excludeBkgColor=at(this.sectionBkgColor,10),this.taskBorderColor=Hp(255,255,255,70),this.taskBkgColor="calculated",this.taskTextColor="calculated",this.taskTextLightColor="calculated",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor=Hp(255,255,255,50),this.activeTaskBkgColor="#81B1DB",this.gridColor="calculated",this.doneTaskBkgColor="calculated",this.doneTaskBorderColor="grey",this.critBorderColor="#E83737",this.critBkgColor="#E83737",this.taskTextDarkColor="calculated",this.todayLineColor="#DB5757",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.labelColor="calculated",this.errorBkgColor="#a44141",this.errorTextColor="#ddd"}updateColors(){var t,n,r,i,a,s,o,c,d,l,h;this.secondBkg=Ke(this.mainBkg,16),this.lineColor=this.mainContrastColor,this.arrowheadColor=this.mainContrastColor,this.nodeBkg=this.mainBkg,this.nodeBorder=this.border1,this.clusterBkg=this.secondBkg,this.clusterBorder=this.border2,this.defaultLinkColor=this.lineColor,this.edgeLabelBackground=Ke(this.labelBackground,25),this.actorBorder=this.border1,this.actorBkg=this.mainBkg,this.actorTextColor=this.mainContrastColor,this.actorLineColor=this.mainContrastColor,this.signalColor=this.mainContrastColor,this.signalTextColor=this.mainContrastColor,this.labelBoxBkgColor=this.actorBkg,this.labelBoxBorderColor=this.actorBorder,this.labelTextColor=this.mainContrastColor,this.loopTextColor=this.mainContrastColor,this.noteBorderColor=this.secondaryBorderColor,this.noteBkgColor=this.secondBkg,this.noteTextColor=this.secondaryTextColor,this.activationBorderColor=this.border1,this.activationBkgColor=this.secondBkg,this.altSectionBkgColor=this.background,this.taskBkgColor=Ke(this.mainBkg,23),this.taskTextColor=this.darkTextColor,this.taskTextLightColor=this.mainContrastColor,this.taskTextOutsideColor=this.taskTextLightColor,this.gridColor=this.mainContrastColor,this.doneTaskBkgColor=this.mainContrastColor,this.taskTextDarkColor=this.darkTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#555",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.primaryBorderColor,this.specialStateColor="#f4f4f4",this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.fillType0=this.primaryColor,this.fillType1=this.secondaryColor,this.fillType2=ie(this.primaryColor,{h:64}),this.fillType3=ie(this.secondaryColor,{h:64}),this.fillType4=ie(this.primaryColor,{h:-64}),this.fillType5=ie(this.secondaryColor,{h:-64}),this.fillType6=ie(this.primaryColor,{h:128}),this.fillType7=ie(this.secondaryColor,{h:128}),this.cScale1=this.cScale1||"#0b0000",this.cScale2=this.cScale2||"#4d1037",this.cScale3=this.cScale3||"#3f5258",this.cScale4=this.cScale4||"#4f2f1b",this.cScale5=this.cScale5||"#6e0a0a",this.cScale6=this.cScale6||"#3b0048",this.cScale7=this.cScale7||"#995a01",this.cScale8=this.cScale8||"#154706",this.cScale9=this.cScale9||"#161722",this.cScale10=this.cScale10||"#00296f",this.cScale11=this.cScale11||"#01629c",this.cScale12=this.cScale12||"#010029",this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||ie(this.primaryColor,{h:30}),this.cScale4=this.cScale4||ie(this.primaryColor,{h:60}),this.cScale5=this.cScale5||ie(this.primaryColor,{h:90}),this.cScale6=this.cScale6||ie(this.primaryColor,{h:120}),this.cScale7=this.cScale7||ie(this.primaryColor,{h:150}),this.cScale8=this.cScale8||ie(this.primaryColor,{h:210}),this.cScale9=this.cScale9||ie(this.primaryColor,{h:270}),this.cScale10=this.cScale10||ie(this.primaryColor,{h:300}),this.cScale11=this.cScale11||ie(this.primaryColor,{h:330});for(let f=0;f<this.THEME_COLOR_LIMIT;f++)this["cScaleInv"+f]=this["cScaleInv"+f]||Ne(this["cScale"+f]);for(let f=0;f<this.THEME_COLOR_LIMIT;f++)this["cScalePeer"+f]=this["cScalePeer"+f]||Ke(this["cScale"+f],10);for(let f=0;f<5;f++)this["surface"+f]=this["surface"+f]||ie(this.mainBkg,{h:30,s:-30,l:-(-10+f*4)}),this["surfacePeer"+f]=this["surfacePeer"+f]||ie(this.mainBkg,{h:30,s:-30,l:-(-7+f*4)});this.scaleLabelColor=this.scaleLabelColor||(this.darkMode?"black":this.labelTextColor);for(let f=0;f<this.THEME_COLOR_LIMIT;f++)this["cScaleLabel"+f]=this["cScaleLabel"+f]||this.scaleLabelColor;for(let f=0;f<this.THEME_COLOR_LIMIT;f++)this["pie"+f]=this["cScale"+f];this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||ie(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||ie(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||ie(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||ie(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||ie(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||ie(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||d0(this.quadrant1Fill)?Ke(this.quadrant1Fill):at(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:((t=this.xyChart)==null?void 0:t.backgroundColor)||this.background,titleColor:((n=this.xyChart)==null?void 0:n.titleColor)||this.primaryTextColor,xAxisTitleColor:((r=this.xyChart)==null?void 0:r.xAxisTitleColor)||this.primaryTextColor,xAxisLabelColor:((i=this.xyChart)==null?void 0:i.xAxisLabelColor)||this.primaryTextColor,xAxisTickColor:((a=this.xyChart)==null?void 0:a.xAxisTickColor)||this.primaryTextColor,xAxisLineColor:((s=this.xyChart)==null?void 0:s.xAxisLineColor)||this.primaryTextColor,yAxisTitleColor:((o=this.xyChart)==null?void 0:o.yAxisTitleColor)||this.primaryTextColor,yAxisLabelColor:((c=this.xyChart)==null?void 0:c.yAxisLabelColor)||this.primaryTextColor,yAxisTickColor:((d=this.xyChart)==null?void 0:d.yAxisTickColor)||this.primaryTextColor,yAxisLineColor:((l=this.xyChart)==null?void 0:l.yAxisLineColor)||this.primaryTextColor,plotColorPalette:((h=this.xyChart)==null?void 0:h.plotColorPalette)||"#3498db,#2ecc71,#e74c3c,#f1c40f,#bdc3c7,#ffffff,#34495e,#9b59b6,#1abc9c,#e67e22"},this.classText=this.primaryTextColor,this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||(this.darkMode?at(this.secondaryColor,30):this.secondaryColor),this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=Ke(this.secondaryColor,20),this.git1=Ke(this.pie2||this.secondaryColor,20),this.git2=Ke(this.pie3||this.tertiaryColor,20),this.git3=Ke(this.pie4||ie(this.primaryColor,{h:-30}),20),this.git4=Ke(this.pie5||ie(this.primaryColor,{h:-60}),20),this.git5=Ke(this.pie6||ie(this.primaryColor,{h:-90}),10),this.git6=Ke(this.pie7||ie(this.primaryColor,{h:60}),10),this.git7=Ke(this.pie8||ie(this.primaryColor,{h:120}),20),this.gitInv0=this.gitInv0||Ne(this.git0),this.gitInv1=this.gitInv1||Ne(this.git1),this.gitInv2=this.gitInv2||Ne(this.git2),this.gitInv3=this.gitInv3||Ne(this.git3),this.gitInv4=this.gitInv4||Ne(this.git4),this.gitInv5=this.gitInv5||Ne(this.git5),this.gitInv6=this.gitInv6||Ne(this.git6),this.gitInv7=this.gitInv7||Ne(this.git7),this.gitBranchLabel0=this.gitBranchLabel0||Ne(this.labelTextColor),this.gitBranchLabel1=this.gitBranchLabel1||this.labelTextColor,this.gitBranchLabel2=this.gitBranchLabel2||this.labelTextColor,this.gitBranchLabel3=this.gitBranchLabel3||Ne(this.labelTextColor),this.gitBranchLabel4=this.gitBranchLabel4||this.labelTextColor,this.gitBranchLabel5=this.gitBranchLabel5||this.labelTextColor,this.gitBranchLabel6=this.gitBranchLabel6||this.labelTextColor,this.gitBranchLabel7=this.gitBranchLabel7||this.labelTextColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||Ke(this.background,12),this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||Ke(this.background,2)}calculate(t){if(typeof t!="object"){this.updateColors();return}const n=Object.keys(t);n.forEach(r=>{this[r]=t[r]}),this.updateColors(),n.forEach(r=>{this[r]=t[r]})}};const _be=e=>{const t=new Sbe;return t.calculate(e),t};let kbe=class{constructor(){this.background="#f4f4f4",this.primaryColor="#ECECFF",this.secondaryColor=ie(this.primaryColor,{h:120}),this.secondaryColor="#ffffde",this.tertiaryColor=ie(this.primaryColor,{h:-160}),this.primaryBorderColor=Vr(this.primaryColor,this.darkMode),this.secondaryBorderColor=Vr(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=Vr(this.tertiaryColor,this.darkMode),this.primaryTextColor=Ne(this.primaryColor),this.secondaryTextColor=Ne(this.secondaryColor),this.tertiaryTextColor=Ne(this.tertiaryColor),this.lineColor=Ne(this.background),this.textColor=Ne(this.background),this.background="white",this.mainBkg="#ECECFF",this.secondBkg="#ffffde",this.lineColor="#333333",this.border1="#9370DB",this.border2="#aaaa33",this.arrowheadColor="#333333",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.labelBackground="#e8e8e8",this.textColor="#333",this.THEME_COLOR_LIMIT=12,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="calculated",this.edgeLabelBackground="calculated",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="black",this.actorLineColor="grey",this.signalColor="calculated",this.signalTextColor="calculated",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="calculated",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="#fff5ad",this.noteTextColor="calculated",this.activationBorderColor="#666",this.activationBkgColor="#f4f4f4",this.sequenceNumberColor="white",this.sectionBkgColor="calculated",this.altSectionBkgColor="calculated",this.sectionBkgColor2="calculated",this.excludeBkgColor="#eeeeee",this.taskBorderColor="calculated",this.taskBkgColor="calculated",this.taskTextLightColor="calculated",this.taskTextColor=this.taskTextLightColor,this.taskTextDarkColor="calculated",this.taskTextOutsideColor=this.taskTextDarkColor,this.taskTextClickableColor="calculated",this.activeTaskBorderColor="calculated",this.activeTaskBkgColor="calculated",this.gridColor="calculated",this.doneTaskBkgColor="calculated",this.doneTaskBorderColor="calculated",this.critBorderColor="calculated",this.critBkgColor="calculated",this.todayLineColor="calculated",this.sectionBkgColor=Hp(102,102,255,.49),this.altSectionBkgColor="white",this.sectionBkgColor2="#fff400",this.taskBorderColor="#534fbc",this.taskBkgColor="#8a90dd",this.taskTextLightColor="white",this.taskTextColor="calculated",this.taskTextDarkColor="black",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor="#534fbc",this.activeTaskBkgColor="#bfc7ff",this.gridColor="lightgrey",this.doneTaskBkgColor="lightgrey",this.doneTaskBorderColor="grey",this.critBorderColor="#ff8888",this.critBkgColor="red",this.todayLineColor="red",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222",this.updateColors()}updateColors(){var t,n,r,i,a,s,o,c,d,l,h;this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||ie(this.primaryColor,{h:30}),this.cScale4=this.cScale4||ie(this.primaryColor,{h:60}),this.cScale5=this.cScale5||ie(this.primaryColor,{h:90}),this.cScale6=this.cScale6||ie(this.primaryColor,{h:120}),this.cScale7=this.cScale7||ie(this.primaryColor,{h:150}),this.cScale8=this.cScale8||ie(this.primaryColor,{h:210}),this.cScale9=this.cScale9||ie(this.primaryColor,{h:270}),this.cScale10=this.cScale10||ie(this.primaryColor,{h:300}),this.cScale11=this.cScale11||ie(this.primaryColor,{h:330}),this.cScalePeer1=this.cScalePeer1||at(this.secondaryColor,45),this.cScalePeer2=this.cScalePeer2||at(this.tertiaryColor,40);for(let f=0;f<this.THEME_COLOR_LIMIT;f++)this["cScale"+f]=at(this["cScale"+f],10),this["cScalePeer"+f]=this["cScalePeer"+f]||at(this["cScale"+f],25);for(let f=0;f<this.THEME_COLOR_LIMIT;f++)this["cScaleInv"+f]=this["cScaleInv"+f]||ie(this["cScale"+f],{h:180});for(let f=0;f<5;f++)this["surface"+f]=this["surface"+f]||ie(this.mainBkg,{h:30,l:-(5+f*5)}),this["surfacePeer"+f]=this["surfacePeer"+f]||ie(this.mainBkg,{h:30,l:-(7+f*5)});if(this.scaleLabelColor=this.scaleLabelColor!=="calculated"&&this.scaleLabelColor?this.scaleLabelColor:this.labelTextColor,this.labelTextColor!=="calculated"){this.cScaleLabel0=this.cScaleLabel0||Ne(this.labelTextColor),this.cScaleLabel3=this.cScaleLabel3||Ne(this.labelTextColor);for(let f=0;f<this.THEME_COLOR_LIMIT;f++)this["cScaleLabel"+f]=this["cScaleLabel"+f]||this.labelTextColor}this.nodeBkg=this.mainBkg,this.nodeBorder=this.border1,this.clusterBkg=this.secondBkg,this.clusterBorder=this.border2,this.defaultLinkColor=this.lineColor,this.titleColor=this.textColor,this.edgeLabelBackground=this.labelBackground,this.actorBorder=Ke(this.border1,23),this.actorBkg=this.mainBkg,this.labelBoxBkgColor=this.actorBkg,this.signalColor=this.textColor,this.signalTextColor=this.textColor,this.labelBoxBorderColor=this.actorBorder,this.labelTextColor=this.actorTextColor,this.loopTextColor=this.actorTextColor,this.noteBorderColor=this.border2,this.noteTextColor=this.actorTextColor,this.taskTextColor=this.taskTextLightColor,this.taskTextOutsideColor=this.taskTextDarkColor,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.specialStateColor=this.lineColor,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.classText=this.primaryTextColor,this.fillType0=this.primaryColor,this.fillType1=this.secondaryColor,this.fillType2=ie(this.primaryColor,{h:64}),this.fillType3=ie(this.secondaryColor,{h:64}),this.fillType4=ie(this.primaryColor,{h:-64}),this.fillType5=ie(this.secondaryColor,{h:-64}),this.fillType6=ie(this.primaryColor,{h:128}),this.fillType7=ie(this.secondaryColor,{h:128}),this.pie1=this.pie1||this.primaryColor,this.pie2=this.pie2||this.secondaryColor,this.pie3=this.pie3||ie(this.tertiaryColor,{l:-40}),this.pie4=this.pie4||ie(this.primaryColor,{l:-10}),this.pie5=this.pie5||ie(this.secondaryColor,{l:-30}),this.pie6=this.pie6||ie(this.tertiaryColor,{l:-20}),this.pie7=this.pie7||ie(this.primaryColor,{h:60,l:-20}),this.pie8=this.pie8||ie(this.primaryColor,{h:-60,l:-40}),this.pie9=this.pie9||ie(this.primaryColor,{h:120,l:-40}),this.pie10=this.pie10||ie(this.primaryColor,{h:60,l:-40}),this.pie11=this.pie11||ie(this.primaryColor,{h:-90,l:-40}),this.pie12=this.pie12||ie(this.primaryColor,{h:120,l:-30}),this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||ie(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||ie(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||ie(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||ie(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||ie(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||ie(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||d0(this.quadrant1Fill)?Ke(this.quadrant1Fill):at(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:((t=this.xyChart)==null?void 0:t.backgroundColor)||this.background,titleColor:((n=this.xyChart)==null?void 0:n.titleColor)||this.primaryTextColor,xAxisTitleColor:((r=this.xyChart)==null?void 0:r.xAxisTitleColor)||this.primaryTextColor,xAxisLabelColor:((i=this.xyChart)==null?void 0:i.xAxisLabelColor)||this.primaryTextColor,xAxisTickColor:((a=this.xyChart)==null?void 0:a.xAxisTickColor)||this.primaryTextColor,xAxisLineColor:((s=this.xyChart)==null?void 0:s.xAxisLineColor)||this.primaryTextColor,yAxisTitleColor:((o=this.xyChart)==null?void 0:o.yAxisTitleColor)||this.primaryTextColor,yAxisLabelColor:((c=this.xyChart)==null?void 0:c.yAxisLabelColor)||this.primaryTextColor,yAxisTickColor:((d=this.xyChart)==null?void 0:d.yAxisTickColor)||this.primaryTextColor,yAxisLineColor:((l=this.xyChart)==null?void 0:l.yAxisLineColor)||this.primaryTextColor,plotColorPalette:((h=this.xyChart)==null?void 0:h.plotColorPalette)||"#ECECFF,#8493A6,#FFC3A0,#DCDDE1,#B8E994,#D1A36F,#C3CDE6,#FFB6C1,#496078,#F8F3E3"},this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||this.labelBackground,this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=this.git0||this.primaryColor,this.git1=this.git1||this.secondaryColor,this.git2=this.git2||this.tertiaryColor,this.git3=this.git3||ie(this.primaryColor,{h:-30}),this.git4=this.git4||ie(this.primaryColor,{h:-60}),this.git5=this.git5||ie(this.primaryColor,{h:-90}),this.git6=this.git6||ie(this.primaryColor,{h:60}),this.git7=this.git7||ie(this.primaryColor,{h:120}),this.darkMode?(this.git0=Ke(this.git0,25),this.git1=Ke(this.git1,25),this.git2=Ke(this.git2,25),this.git3=Ke(this.git3,25),this.git4=Ke(this.git4,25),this.git5=Ke(this.git5,25),this.git6=Ke(this.git6,25),this.git7=Ke(this.git7,25)):(this.git0=at(this.git0,25),this.git1=at(this.git1,25),this.git2=at(this.git2,25),this.git3=at(this.git3,25),this.git4=at(this.git4,25),this.git5=at(this.git5,25),this.git6=at(this.git6,25),this.git7=at(this.git7,25)),this.gitInv0=this.gitInv0||at(Ne(this.git0),25),this.gitInv1=this.gitInv1||Ne(this.git1),this.gitInv2=this.gitInv2||Ne(this.git2),this.gitInv3=this.gitInv3||Ne(this.git3),this.gitInv4=this.gitInv4||Ne(this.git4),this.gitInv5=this.gitInv5||Ne(this.git5),this.gitInv6=this.gitInv6||Ne(this.git6),this.gitInv7=this.gitInv7||Ne(this.git7),this.gitBranchLabel0=this.gitBranchLabel0||Ne(this.labelTextColor),this.gitBranchLabel1=this.gitBranchLabel1||this.labelTextColor,this.gitBranchLabel2=this.gitBranchLabel2||this.labelTextColor,this.gitBranchLabel3=this.gitBranchLabel3||Ne(this.labelTextColor),this.gitBranchLabel4=this.gitBranchLabel4||this.labelTextColor,this.gitBranchLabel5=this.gitBranchLabel5||this.labelTextColor,this.gitBranchLabel6=this.gitBranchLabel6||this.labelTextColor,this.gitBranchLabel7=this.gitBranchLabel7||this.labelTextColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||k6,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||T6}calculate(t){if(typeof t!="object"){this.updateColors();return}const n=Object.keys(t);n.forEach(r=>{this[r]=t[r]}),this.updateColors(),n.forEach(r=>{this[r]=t[r]})}};const Tbe=e=>{const t=new kbe;return t.calculate(e),t};let Mbe=class{constructor(){this.background="#f4f4f4",this.primaryColor="#cde498",this.secondaryColor="#cdffb2",this.background="white",this.mainBkg="#cde498",this.secondBkg="#cdffb2",this.lineColor="green",this.border1="#13540c",this.border2="#6eaa49",this.arrowheadColor="green",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.tertiaryColor=Ke("#cde498",10),this.primaryBorderColor=Vr(this.primaryColor,this.darkMode),this.secondaryBorderColor=Vr(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=Vr(this.tertiaryColor,this.darkMode),this.primaryTextColor=Ne(this.primaryColor),this.secondaryTextColor=Ne(this.secondaryColor),this.tertiaryTextColor=Ne(this.primaryColor),this.lineColor=Ne(this.background),this.textColor=Ne(this.background),this.THEME_COLOR_LIMIT=12,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="#333",this.edgeLabelBackground="#e8e8e8",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="black",this.actorLineColor="grey",this.signalColor="#333",this.signalTextColor="#333",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="#326932",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="#fff5ad",this.noteTextColor="calculated",this.activationBorderColor="#666",this.activationBkgColor="#f4f4f4",this.sequenceNumberColor="white",this.sectionBkgColor="#6eaa49",this.altSectionBkgColor="white",this.sectionBkgColor2="#6eaa49",this.excludeBkgColor="#eeeeee",this.taskBorderColor="calculated",this.taskBkgColor="#487e3a",this.taskTextLightColor="white",this.taskTextColor="calculated",this.taskTextDarkColor="black",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor="calculated",this.activeTaskBkgColor="calculated",this.gridColor="lightgrey",this.doneTaskBkgColor="lightgrey",this.doneTaskBorderColor="grey",this.critBorderColor="#ff8888",this.critBkgColor="red",this.todayLineColor="red",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222"}updateColors(){var t,n,r,i,a,s,o,c,d,l,h;this.actorBorder=at(this.mainBkg,20),this.actorBkg=this.mainBkg,this.labelBoxBkgColor=this.actorBkg,this.labelTextColor=this.actorTextColor,this.loopTextColor=this.actorTextColor,this.noteBorderColor=this.border2,this.noteTextColor=this.actorTextColor,this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||ie(this.primaryColor,{h:30}),this.cScale4=this.cScale4||ie(this.primaryColor,{h:60}),this.cScale5=this.cScale5||ie(this.primaryColor,{h:90}),this.cScale6=this.cScale6||ie(this.primaryColor,{h:120}),this.cScale7=this.cScale7||ie(this.primaryColor,{h:150}),this.cScale8=this.cScale8||ie(this.primaryColor,{h:210}),this.cScale9=this.cScale9||ie(this.primaryColor,{h:270}),this.cScale10=this.cScale10||ie(this.primaryColor,{h:300}),this.cScale11=this.cScale11||ie(this.primaryColor,{h:330}),this.cScalePeer1=this.cScalePeer1||at(this.secondaryColor,45),this.cScalePeer2=this.cScalePeer2||at(this.tertiaryColor,40);for(let f=0;f<this.THEME_COLOR_LIMIT;f++)this["cScale"+f]=at(this["cScale"+f],10),this["cScalePeer"+f]=this["cScalePeer"+f]||at(this["cScale"+f],25);for(let f=0;f<this.THEME_COLOR_LIMIT;f++)this["cScaleInv"+f]=this["cScaleInv"+f]||ie(this["cScale"+f],{h:180});this.scaleLabelColor=this.scaleLabelColor!=="calculated"&&this.scaleLabelColor?this.scaleLabelColor:this.labelTextColor;for(let f=0;f<this.THEME_COLOR_LIMIT;f++)this["cScaleLabel"+f]=this["cScaleLabel"+f]||this.scaleLabelColor;for(let f=0;f<5;f++)this["surface"+f]=this["surface"+f]||ie(this.mainBkg,{h:30,s:-30,l:-(5+f*5)}),this["surfacePeer"+f]=this["surfacePeer"+f]||ie(this.mainBkg,{h:30,s:-30,l:-(8+f*5)});this.nodeBkg=this.mainBkg,this.nodeBorder=this.border1,this.clusterBkg=this.secondBkg,this.clusterBorder=this.border2,this.defaultLinkColor=this.lineColor,this.taskBorderColor=this.border1,this.taskTextColor=this.taskTextLightColor,this.taskTextOutsideColor=this.taskTextDarkColor,this.activeTaskBorderColor=this.taskBorderColor,this.activeTaskBkgColor=this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.primaryBorderColor,this.specialStateColor=this.lineColor,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.classText=this.primaryTextColor,this.fillType0=this.primaryColor,this.fillType1=this.secondaryColor,this.fillType2=ie(this.primaryColor,{h:64}),this.fillType3=ie(this.secondaryColor,{h:64}),this.fillType4=ie(this.primaryColor,{h:-64}),this.fillType5=ie(this.secondaryColor,{h:-64}),this.fillType6=ie(this.primaryColor,{h:128}),this.fillType7=ie(this.secondaryColor,{h:128}),this.pie1=this.pie1||this.primaryColor,this.pie2=this.pie2||this.secondaryColor,this.pie3=this.pie3||this.tertiaryColor,this.pie4=this.pie4||ie(this.primaryColor,{l:-30}),this.pie5=this.pie5||ie(this.secondaryColor,{l:-30}),this.pie6=this.pie6||ie(this.tertiaryColor,{h:40,l:-40}),this.pie7=this.pie7||ie(this.primaryColor,{h:60,l:-10}),this.pie8=this.pie8||ie(this.primaryColor,{h:-60,l:-10}),this.pie9=this.pie9||ie(this.primaryColor,{h:120,l:0}),this.pie10=this.pie10||ie(this.primaryColor,{h:60,l:-50}),this.pie11=this.pie11||ie(this.primaryColor,{h:-60,l:-50}),this.pie12=this.pie12||ie(this.primaryColor,{h:120,l:-50}),this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||ie(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||ie(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||ie(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||ie(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||ie(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||ie(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||d0(this.quadrant1Fill)?Ke(this.quadrant1Fill):at(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:((t=this.xyChart)==null?void 0:t.backgroundColor)||this.background,titleColor:((n=this.xyChart)==null?void 0:n.titleColor)||this.primaryTextColor,xAxisTitleColor:((r=this.xyChart)==null?void 0:r.xAxisTitleColor)||this.primaryTextColor,xAxisLabelColor:((i=this.xyChart)==null?void 0:i.xAxisLabelColor)||this.primaryTextColor,xAxisTickColor:((a=this.xyChart)==null?void 0:a.xAxisTickColor)||this.primaryTextColor,xAxisLineColor:((s=this.xyChart)==null?void 0:s.xAxisLineColor)||this.primaryTextColor,yAxisTitleColor:((o=this.xyChart)==null?void 0:o.yAxisTitleColor)||this.primaryTextColor,yAxisLabelColor:((c=this.xyChart)==null?void 0:c.yAxisLabelColor)||this.primaryTextColor,yAxisTickColor:((d=this.xyChart)==null?void 0:d.yAxisTickColor)||this.primaryTextColor,yAxisLineColor:((l=this.xyChart)==null?void 0:l.yAxisLineColor)||this.primaryTextColor,plotColorPalette:((h=this.xyChart)==null?void 0:h.plotColorPalette)||"#CDE498,#FF6B6B,#A0D2DB,#D7BDE2,#F0F0F0,#FFC3A0,#7FD8BE,#FF9A8B,#FAF3E0,#FFF176"},this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||this.edgeLabelBackground,this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=this.git0||this.primaryColor,this.git1=this.git1||this.secondaryColor,this.git2=this.git2||this.tertiaryColor,this.git3=this.git3||ie(this.primaryColor,{h:-30}),this.git4=this.git4||ie(this.primaryColor,{h:-60}),this.git5=this.git5||ie(this.primaryColor,{h:-90}),this.git6=this.git6||ie(this.primaryColor,{h:60}),this.git7=this.git7||ie(this.primaryColor,{h:120}),this.darkMode?(this.git0=Ke(this.git0,25),this.git1=Ke(this.git1,25),this.git2=Ke(this.git2,25),this.git3=Ke(this.git3,25),this.git4=Ke(this.git4,25),this.git5=Ke(this.git5,25),this.git6=Ke(this.git6,25),this.git7=Ke(this.git7,25)):(this.git0=at(this.git0,25),this.git1=at(this.git1,25),this.git2=at(this.git2,25),this.git3=at(this.git3,25),this.git4=at(this.git4,25),this.git5=at(this.git5,25),this.git6=at(this.git6,25),this.git7=at(this.git7,25)),this.gitInv0=this.gitInv0||Ne(this.git0),this.gitInv1=this.gitInv1||Ne(this.git1),this.gitInv2=this.gitInv2||Ne(this.git2),this.gitInv3=this.gitInv3||Ne(this.git3),this.gitInv4=this.gitInv4||Ne(this.git4),this.gitInv5=this.gitInv5||Ne(this.git5),this.gitInv6=this.gitInv6||Ne(this.git6),this.gitInv7=this.gitInv7||Ne(this.git7),this.gitBranchLabel0=this.gitBranchLabel0||Ne(this.labelTextColor),this.gitBranchLabel1=this.gitBranchLabel1||this.labelTextColor,this.gitBranchLabel2=this.gitBranchLabel2||this.labelTextColor,this.gitBranchLabel3=this.gitBranchLabel3||Ne(this.labelTextColor),this.gitBranchLabel4=this.gitBranchLabel4||this.labelTextColor,this.gitBranchLabel5=this.gitBranchLabel5||this.labelTextColor,this.gitBranchLabel6=this.gitBranchLabel6||this.labelTextColor,this.gitBranchLabel7=this.gitBranchLabel7||this.labelTextColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||k6,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||T6}calculate(t){if(typeof t!="object"){this.updateColors();return}const n=Object.keys(t);n.forEach(r=>{this[r]=t[r]}),this.updateColors(),n.forEach(r=>{this[r]=t[r]})}};const Ibe=e=>{const t=new Mbe;return t.calculate(e),t};class Abe{constructor(){this.primaryColor="#eee",this.contrast="#707070",this.secondaryColor=Ke(this.contrast,55),this.background="#ffffff",this.tertiaryColor=ie(this.primaryColor,{h:-160}),this.primaryBorderColor=Vr(this.primaryColor,this.darkMode),this.secondaryBorderColor=Vr(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=Vr(this.tertiaryColor,this.darkMode),this.primaryTextColor=Ne(this.primaryColor),this.secondaryTextColor=Ne(this.secondaryColor),this.tertiaryTextColor=Ne(this.tertiaryColor),this.lineColor=Ne(this.background),this.textColor=Ne(this.background),this.mainBkg="#eee",this.secondBkg="calculated",this.lineColor="#666",this.border1="#999",this.border2="calculated",this.note="#ffa",this.text="#333",this.critical="#d42",this.done="#bbb",this.arrowheadColor="#333333",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.THEME_COLOR_LIMIT=12,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="calculated",this.edgeLabelBackground="white",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="calculated",this.actorLineColor="calculated",this.signalColor="calculated",this.signalTextColor="calculated",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="calculated",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="calculated",this.noteTextColor="calculated",this.activationBorderColor="#666",this.activationBkgColor="#f4f4f4",this.sequenceNumberColor="white",this.sectionBkgColor="calculated",this.altSectionBkgColor="white",this.sectionBkgColor2="calculated",this.excludeBkgColor="#eeeeee",this.taskBorderColor="calculated",this.taskBkgColor="calculated",this.taskTextLightColor="white",this.taskTextColor="calculated",this.taskTextDarkColor="calculated",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor="calculated",this.activeTaskBkgColor="calculated",this.gridColor="calculated",this.doneTaskBkgColor="calculated",this.doneTaskBorderColor="calculated",this.critBkgColor="calculated",this.critBorderColor="calculated",this.todayLineColor="calculated",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222"}updateColors(){var t,n,r,i,a,s,o,c,d,l,h;this.secondBkg=Ke(this.contrast,55),this.border2=this.contrast,this.actorBorder=Ke(this.border1,23),this.actorBkg=this.mainBkg,this.actorTextColor=this.text,this.actorLineColor=this.lineColor,this.signalColor=this.text,this.signalTextColor=this.text,this.labelBoxBkgColor=this.actorBkg,this.labelBoxBorderColor=this.actorBorder,this.labelTextColor=this.text,this.loopTextColor=this.text,this.noteBorderColor="#999",this.noteBkgColor="#666",this.noteTextColor="#fff",this.cScale0=this.cScale0||"#555",this.cScale1=this.cScale1||"#F4F4F4",this.cScale2=this.cScale2||"#555",this.cScale3=this.cScale3||"#BBB",this.cScale4=this.cScale4||"#777",this.cScale5=this.cScale5||"#999",this.cScale6=this.cScale6||"#DDD",this.cScale7=this.cScale7||"#FFF",this.cScale8=this.cScale8||"#DDD",this.cScale9=this.cScale9||"#BBB",this.cScale10=this.cScale10||"#999",this.cScale11=this.cScale11||"#777";for(let f=0;f<this.THEME_COLOR_LIMIT;f++)this["cScaleInv"+f]=this["cScaleInv"+f]||Ne(this["cScale"+f]);for(let f=0;f<this.THEME_COLOR_LIMIT;f++)this.darkMode?this["cScalePeer"+f]=this["cScalePeer"+f]||Ke(this["cScale"+f],10):this["cScalePeer"+f]=this["cScalePeer"+f]||at(this["cScale"+f],10);this.scaleLabelColor=this.scaleLabelColor||(this.darkMode?"black":this.labelTextColor),this.cScaleLabel0=this.cScaleLabel0||this.cScale1,this.cScaleLabel2=this.cScaleLabel2||this.cScale1;for(let f=0;f<this.THEME_COLOR_LIMIT;f++)this["cScaleLabel"+f]=this["cScaleLabel"+f]||this.scaleLabelColor;for(let f=0;f<5;f++)this["surface"+f]=this["surface"+f]||ie(this.mainBkg,{l:-(5+f*5)}),this["surfacePeer"+f]=this["surfacePeer"+f]||ie(this.mainBkg,{l:-(8+f*5)});this.nodeBkg=this.mainBkg,this.nodeBorder=this.border1,this.clusterBkg=this.secondBkg,this.clusterBorder=this.border2,this.defaultLinkColor=this.lineColor,this.titleColor=this.text,this.sectionBkgColor=Ke(this.contrast,30),this.sectionBkgColor2=Ke(this.contrast,30),this.taskBorderColor=at(this.contrast,10),this.taskBkgColor=this.contrast,this.taskTextColor=this.taskTextLightColor,this.taskTextDarkColor=this.text,this.taskTextOutsideColor=this.taskTextDarkColor,this.activeTaskBorderColor=this.taskBorderColor,this.activeTaskBkgColor=this.mainBkg,this.gridColor=Ke(this.border1,30),this.doneTaskBkgColor=this.done,this.doneTaskBorderColor=this.lineColor,this.critBkgColor=this.critical,this.critBorderColor=at(this.critBkgColor,10),this.todayLineColor=this.critBkgColor,this.transitionColor=this.transitionColor||"#000",this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f4f4f4",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.stateBorder=this.stateBorder||"#000",this.innerEndBackground=this.primaryBorderColor,this.specialStateColor="#222",this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.classText=this.primaryTextColor,this.fillType0=this.primaryColor,this.fillType1=this.secondaryColor,this.fillType2=ie(this.primaryColor,{h:64}),this.fillType3=ie(this.secondaryColor,{h:64}),this.fillType4=ie(this.primaryColor,{h:-64}),this.fillType5=ie(this.secondaryColor,{h:-64}),this.fillType6=ie(this.primaryColor,{h:128}),this.fillType7=ie(this.secondaryColor,{h:128});for(let f=0;f<this.THEME_COLOR_LIMIT;f++)this["pie"+f]=this["cScale"+f];this.pie12=this.pie0,this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||ie(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||ie(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||ie(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||ie(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||ie(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||ie(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||d0(this.quadrant1Fill)?Ke(this.quadrant1Fill):at(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:((t=this.xyChart)==null?void 0:t.backgroundColor)||this.background,titleColor:((n=this.xyChart)==null?void 0:n.titleColor)||this.primaryTextColor,xAxisTitleColor:((r=this.xyChart)==null?void 0:r.xAxisTitleColor)||this.primaryTextColor,xAxisLabelColor:((i=this.xyChart)==null?void 0:i.xAxisLabelColor)||this.primaryTextColor,xAxisTickColor:((a=this.xyChart)==null?void 0:a.xAxisTickColor)||this.primaryTextColor,xAxisLineColor:((s=this.xyChart)==null?void 0:s.xAxisLineColor)||this.primaryTextColor,yAxisTitleColor:((o=this.xyChart)==null?void 0:o.yAxisTitleColor)||this.primaryTextColor,yAxisLabelColor:((c=this.xyChart)==null?void 0:c.yAxisLabelColor)||this.primaryTextColor,yAxisTickColor:((d=this.xyChart)==null?void 0:d.yAxisTickColor)||this.primaryTextColor,yAxisLineColor:((l=this.xyChart)==null?void 0:l.yAxisLineColor)||this.primaryTextColor,plotColorPalette:((h=this.xyChart)==null?void 0:h.plotColorPalette)||"#EEE,#6BB8E4,#8ACB88,#C7ACD6,#E8DCC2,#FFB2A8,#FFF380,#7E8D91,#FFD8B1,#FAF3E0"},this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||this.edgeLabelBackground,this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=at(this.pie1,25)||this.primaryColor,this.git1=this.pie2||this.secondaryColor,this.git2=this.pie3||this.tertiaryColor,this.git3=this.pie4||ie(this.primaryColor,{h:-30}),this.git4=this.pie5||ie(this.primaryColor,{h:-60}),this.git5=this.pie6||ie(this.primaryColor,{h:-90}),this.git6=this.pie7||ie(this.primaryColor,{h:60}),this.git7=this.pie8||ie(this.primaryColor,{h:120}),this.gitInv0=this.gitInv0||Ne(this.git0),this.gitInv1=this.gitInv1||Ne(this.git1),this.gitInv2=this.gitInv2||Ne(this.git2),this.gitInv3=this.gitInv3||Ne(this.git3),this.gitInv4=this.gitInv4||Ne(this.git4),this.gitInv5=this.gitInv5||Ne(this.git5),this.gitInv6=this.gitInv6||Ne(this.git6),this.gitInv7=this.gitInv7||Ne(this.git7),this.branchLabelColor=this.branchLabelColor||this.labelTextColor,this.gitBranchLabel0=this.branchLabelColor,this.gitBranchLabel1="white",this.gitBranchLabel2=this.branchLabelColor,this.gitBranchLabel3="white",this.gitBranchLabel4=this.branchLabelColor,this.gitBranchLabel5=this.branchLabelColor,this.gitBranchLabel6=this.branchLabelColor,this.gitBranchLabel7=this.branchLabelColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||k6,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||T6}calculate(t){if(typeof t!="object"){this.updateColors();return}const n=Object.keys(t);n.forEach(r=>{this[r]=t[r]}),this.updateColors(),n.forEach(r=>{this[r]=t[r]})}}const Lbe=e=>{const t=new Abe;return t.calculate(e),t},Vo={base:{getThemeVariables:Cbe},dark:{getThemeVariables:_be},default:{getThemeVariables:Tbe},forest:{getThemeVariables:Ibe},neutral:{getThemeVariables:Lbe}},Io={flowchart:{useMaxWidth:!0,titleTopMargin:25,subGraphTitleMargin:{top:0,bottom:0},diagramPadding:8,htmlLabels:!0,nodeSpacing:50,rankSpacing:50,curve:"basis",padding:15,defaultRenderer:"dagre-wrapper",wrappingWidth:200},sequence:{useMaxWidth:!0,hideUnusedParticipants:!1,activationWidth:10,diagramMarginX:50,diagramMarginY:10,actorMargin:50,width:150,height:65,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,messageAlign:"center",mirrorActors:!0,forceMenus:!1,bottomMarginAdj:1,rightAngles:!1,showSequenceNumbers:!1,actorFontSize:14,actorFontFamily:'"Open Sans", sans-serif',actorFontWeight:400,noteFontSize:14,noteFontFamily:'"trebuchet ms", verdana, arial, sans-serif',noteFontWeight:400,noteAlign:"center",messageFontSize:16,messageFontFamily:'"trebuchet ms", verdana, arial, sans-serif',messageFontWeight:400,wrap:!1,wrapPadding:10,labelBoxWidth:50,labelBoxHeight:20},gantt:{useMaxWidth:!0,titleTopMargin:25,barHeight:20,barGap:4,topPadding:50,rightPadding:75,leftPadding:75,gridLineStartPadding:35,fontSize:11,sectionFontSize:11,numberSectionStyles:4,axisFormat:"%Y-%m-%d",topAxis:!1,displayMode:"",weekday:"sunday"},journey:{useMaxWidth:!0,diagramMarginX:50,diagramMarginY:10,leftMargin:150,width:150,height:50,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,messageAlign:"center",bottomMarginAdj:1,rightAngles:!1,taskFontSize:14,taskFontFamily:'"Open Sans", sans-serif',taskMargin:50,activationWidth:10,textPlacement:"fo",actorColours:["#8FBC8F","#7CFC00","#00FFFF","#20B2AA","#B0E0E6","#FFFFE0"],sectionFills:["#191970","#8B008B","#4B0082","#2F4F4F","#800000","#8B4513","#00008B"],sectionColours:["#fff"]},class:{useMaxWidth:!0,titleTopMargin:25,arrowMarkerAbsolute:!1,dividerMargin:10,padding:5,textHeight:10,defaultRenderer:"dagre-wrapper",htmlLabels:!1},state:{useMaxWidth:!0,titleTopMargin:25,dividerMargin:10,sizeUnit:5,padding:8,textHeight:10,titleShift:-15,noteMargin:10,forkWidth:70,forkHeight:7,miniPadding:2,fontSizeFactor:5.02,fontSize:24,labelHeight:16,edgeLengthFactor:"20",compositTitleSize:35,radius:5,defaultRenderer:"dagre-wrapper"},er:{useMaxWidth:!0,titleTopMargin:25,diagramPadding:20,layoutDirection:"TB",minEntityWidth:100,minEntityHeight:75,entityPadding:15,stroke:"gray",fill:"honeydew",fontSize:12},pie:{useMaxWidth:!0,textPosition:.75},quadrantChart:{useMaxWidth:!0,chartWidth:500,chartHeight:500,titleFontSize:20,titlePadding:10,quadrantPadding:5,xAxisLabelPadding:5,yAxisLabelPadding:5,xAxisLabelFontSize:16,yAxisLabelFontSize:16,quadrantLabelFontSize:16,quadrantTextTopPadding:5,pointTextPadding:5,pointLabelFontSize:12,pointRadius:5,xAxisPosition:"top",yAxisPosition:"left",quadrantInternalBorderStrokeWidth:1,quadrantExternalBorderStrokeWidth:2},xyChart:{useMaxWidth:!0,width:700,height:500,titleFontSize:20,titlePadding:10,showTitle:!0,xAxis:{$ref:"#/$defs/XYChartAxisConfig",showLabel:!0,labelFontSize:14,labelPadding:5,showTitle:!0,titleFontSize:16,titlePadding:5,showTick:!0,tickLength:5,tickWidth:2,showAxisLine:!0,axisLineWidth:2},yAxis:{$ref:"#/$defs/XYChartAxisConfig",showLabel:!0,labelFontSize:14,labelPadding:5,showTitle:!0,titleFontSize:16,titlePadding:5,showTick:!0,tickLength:5,tickWidth:2,showAxisLine:!0,axisLineWidth:2},chartOrientation:"vertical",plotReservedSpacePercent:50},requirement:{useMaxWidth:!0,rect_fill:"#f9f9f9",text_color:"#333",rect_border_size:"0.5px",rect_border_color:"#bbb",rect_min_width:200,rect_min_height:200,fontSize:14,rect_padding:10,line_height:20},mindmap:{useMaxWidth:!0,padding:10,maxNodeWidth:200},timeline:{useMaxWidth:!0,diagramMarginX:50,diagramMarginY:10,leftMargin:150,width:150,height:50,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,messageAlign:"center",bottomMarginAdj:1,rightAngles:!1,taskFontSize:14,taskFontFamily:'"Open Sans", sans-serif',taskMargin:50,activationWidth:10,textPlacement:"fo",actorColours:["#8FBC8F","#7CFC00","#00FFFF","#20B2AA","#B0E0E6","#FFFFE0"],sectionFills:["#191970","#8B008B","#4B0082","#2F4F4F","#800000","#8B4513","#00008B"],sectionColours:["#fff"],disableMulticolor:!1},gitGraph:{useMaxWidth:!0,titleTopMargin:25,diagramPadding:8,nodeLabel:{width:75,height:100,x:-25,y:0},mainBranchName:"main",mainBranchOrder:0,showCommitLabel:!0,showBranches:!0,rotateCommitLabel:!0,parallelCommits:!1,arrowMarkerAbsolute:!1},c4:{useMaxWidth:!0,diagramMarginX:50,diagramMarginY:10,c4ShapeMargin:50,c4ShapePadding:20,width:216,height:60,boxMargin:10,c4ShapeInRow:4,nextLinePaddingX:0,c4BoundaryInRow:2,personFontSize:14,personFontFamily:'"Open Sans", sans-serif',personFontWeight:"normal",external_personFontSize:14,external_personFontFamily:'"Open Sans", sans-serif',external_personFontWeight:"normal",systemFontSize:14,systemFontFamily:'"Open Sans", sans-serif',systemFontWeight:"normal",external_systemFontSize:14,external_systemFontFamily:'"Open Sans", sans-serif',external_systemFontWeight:"normal",system_dbFontSize:14,system_dbFontFamily:'"Open Sans", sans-serif',system_dbFontWeight:"normal",external_system_dbFontSize:14,external_system_dbFontFamily:'"Open Sans", sans-serif',external_system_dbFontWeight:"normal",system_queueFontSize:14,system_queueFontFamily:'"Open Sans", sans-serif',system_queueFontWeight:"normal",external_system_queueFontSize:14,external_system_queueFontFamily:'"Open Sans", sans-serif',external_system_queueFontWeight:"normal",boundaryFontSize:14,boundaryFontFamily:'"Open Sans", sans-serif',boundaryFontWeight:"normal",messageFontSize:12,messageFontFamily:'"Open Sans", sans-serif',messageFontWeight:"normal",containerFontSize:14,containerFontFamily:'"Open Sans", sans-serif',containerFontWeight:"normal",external_containerFontSize:14,external_containerFontFamily:'"Open Sans", sans-serif',external_containerFontWeight:"normal",container_dbFontSize:14,container_dbFontFamily:'"Open Sans", sans-serif',container_dbFontWeight:"normal",external_container_dbFontSize:14,external_container_dbFontFamily:'"Open Sans", sans-serif',external_container_dbFontWeight:"normal",container_queueFontSize:14,container_queueFontFamily:'"Open Sans", sans-serif',container_queueFontWeight:"normal",external_container_queueFontSize:14,external_container_queueFontFamily:'"Open Sans", sans-serif',external_container_queueFontWeight:"normal",componentFontSize:14,componentFontFamily:'"Open Sans", sans-serif',componentFontWeight:"normal",external_componentFontSize:14,external_componentFontFamily:'"Open Sans", sans-serif',external_componentFontWeight:"normal",component_dbFontSize:14,component_dbFontFamily:'"Open Sans", sans-serif',component_dbFontWeight:"normal",external_component_dbFontSize:14,external_component_dbFontFamily:'"Open Sans", sans-serif',external_component_dbFontWeight:"normal",component_queueFontSize:14,component_queueFontFamily:'"Open Sans", sans-serif',component_queueFontWeight:"normal",external_component_queueFontSize:14,external_component_queueFontFamily:'"Open Sans", sans-serif',external_component_queueFontWeight:"normal",wrap:!0,wrapPadding:10,person_bg_color:"#08427B",person_border_color:"#073B6F",external_person_bg_color:"#686868",external_person_border_color:"#8A8A8A",system_bg_color:"#1168BD",system_border_color:"#3C7FC0",system_db_bg_color:"#1168BD",system_db_border_color:"#3C7FC0",system_queue_bg_color:"#1168BD",system_queue_border_color:"#3C7FC0",external_system_bg_color:"#999999",external_system_border_color:"#8A8A8A",external_system_db_bg_color:"#999999",external_system_db_border_color:"#8A8A8A",external_system_queue_bg_color:"#999999",external_system_queue_border_color:"#8A8A8A",container_bg_color:"#438DD5",container_border_color:"#3C7FC0",container_db_bg_color:"#438DD5",container_db_border_color:"#3C7FC0",container_queue_bg_color:"#438DD5",container_queue_border_color:"#3C7FC0",external_container_bg_color:"#B3B3B3",external_container_border_color:"#A6A6A6",external_container_db_bg_color:"#B3B3B3",external_container_db_border_color:"#A6A6A6",external_container_queue_bg_color:"#B3B3B3",external_container_queue_border_color:"#A6A6A6",component_bg_color:"#85BBF0",component_border_color:"#78A8D8",component_db_bg_color:"#85BBF0",component_db_border_color:"#78A8D8",component_queue_bg_color:"#85BBF0",component_queue_border_color:"#78A8D8",external_component_bg_color:"#CCCCCC",external_component_border_color:"#BFBFBF",external_component_db_bg_color:"#CCCCCC",external_component_db_border_color:"#BFBFBF",external_component_queue_bg_color:"#CCCCCC",external_component_queue_border_color:"#BFBFBF"},sankey:{useMaxWidth:!0,width:600,height:400,linkColor:"gradient",nodeAlignment:"justify",showValues:!0,prefix:"",suffix:""},block:{useMaxWidth:!0,padding:8},theme:"default",maxTextSize:5e4,maxEdges:500,darkMode:!1,fontFamily:'"trebuchet ms", verdana, arial, sans-serif;',logLevel:5,securityLevel:"strict",startOnLoad:!0,arrowMarkerAbsolute:!1,secure:["secure","securityLevel","startOnLoad","maxTextSize","maxEdges"],legacyMathML:!1,deterministicIds:!1,fontSize:16},eF={...Io,deterministicIDSeed:void 0,themeCSS:void 0,themeVariables:Vo.default.getThemeVariables(),sequence:{...Io.sequence,messageFont:function(){return{fontFamily:this.messageFontFamily,fontSize:this.messageFontSize,fontWeight:this.messageFontWeight}},noteFont:function(){return{fontFamily:this.noteFontFamily,fontSize:this.noteFontSize,fontWeight:this.noteFontWeight}},actorFont:function(){return{fontFamily:this.actorFontFamily,fontSize:this.actorFontSize,fontWeight:this.actorFontWeight}}},gantt:{...Io.gantt,tickInterval:void 0,useWidth:void 0},c4:{...Io.c4,useWidth:void 0,personFont:function(){return{fontFamily:this.personFontFamily,fontSize:this.personFontSize,fontWeight:this.personFontWeight}},external_personFont:function(){return{fontFamily:this.external_personFontFamily,fontSize:this.external_personFontSize,fontWeight:this.external_personFontWeight}},systemFont:function(){return{fontFamily:this.systemFontFamily,fontSize:this.systemFontSize,fontWeight:this.systemFontWeight}},external_systemFont:function(){return{fontFamily:this.external_systemFontFamily,fontSize:this.external_systemFontSize,fontWeight:this.external_systemFontWeight}},system_dbFont:function(){return{fontFamily:this.system_dbFontFamily,fontSize:this.system_dbFontSize,fontWeight:this.system_dbFontWeight}},external_system_dbFont:function(){return{fontFamily:this.external_system_dbFontFamily,fontSize:this.external_system_dbFontSize,fontWeight:this.external_system_dbFontWeight}},system_queueFont:function(){return{fontFamily:this.system_queueFontFamily,fontSize:this.system_queueFontSize,fontWeight:this.system_queueFontWeight}},external_system_queueFont:function(){return{fontFamily:this.external_system_queueFontFamily,fontSize:this.external_system_queueFontSize,fontWeight:this.external_system_queueFontWeight}},containerFont:function(){return{fontFamily:this.containerFontFamily,fontSize:this.containerFontSize,fontWeight:this.containerFontWeight}},external_containerFont:function(){return{fontFamily:this.external_containerFontFamily,fontSize:this.external_containerFontSize,fontWeight:this.external_containerFontWeight}},container_dbFont:function(){return{fontFamily:this.container_dbFontFamily,fontSize:this.container_dbFontSize,fontWeight:this.container_dbFontWeight}},external_container_dbFont:function(){return{fontFamily:this.external_container_dbFontFamily,fontSize:this.external_container_dbFontSize,fontWeight:this.external_container_dbFontWeight}},container_queueFont:function(){return{fontFamily:this.container_queueFontFamily,fontSize:this.container_queueFontSize,fontWeight:this.container_queueFontWeight}},external_container_queueFont:function(){return{fontFamily:this.external_container_queueFontFamily,fontSize:this.external_container_queueFontSize,fontWeight:this.external_container_queueFontWeight}},componentFont:function(){return{fontFamily:this.componentFontFamily,fontSize:this.componentFontSize,fontWeight:this.componentFontWeight}},external_componentFont:function(){return{fontFamily:this.external_componentFontFamily,fontSize:this.external_componentFontSize,fontWeight:this.external_componentFontWeight}},component_dbFont:function(){return{fontFamily:this.component_dbFontFamily,fontSize:this.component_dbFontSize,fontWeight:this.component_dbFontWeight}},external_component_dbFont:function(){return{fontFamily:this.external_component_dbFontFamily,fontSize:this.external_component_dbFontSize,fontWeight:this.external_component_dbFontWeight}},component_queueFont:function(){return{fontFamily:this.component_queueFontFamily,fontSize:this.component_queueFontSize,fontWeight:this.component_queueFontWeight}},external_component_queueFont:function(){return{fontFamily:this.external_component_queueFontFamily,fontSize:this.external_component_queueFontSize,fontWeight:this.external_component_queueFontWeight}},boundaryFont:function(){return{fontFamily:this.boundaryFontFamily,fontSize:this.boundaryFontSize,fontWeight:this.boundaryFontWeight}},messageFont:function(){return{fontFamily:this.messageFontFamily,fontSize:this.messageFontSize,fontWeight:this.messageFontWeight}}},pie:{...Io.pie,useWidth:984},xyChart:{...Io.xyChart,useWidth:void 0},requirement:{...Io.requirement,useWidth:void 0},gitGraph:{...Io.gitGraph,useMaxWidth:!1},sankey:{...Io.sankey,useMaxWidth:!1}},tF=(e,t="")=>Object.keys(e).reduce((n,r)=>Array.isArray(e[r])?n:typeof e[r]=="object"&&e[r]!==null?[...n,t+r,...tF(e[r],"")]:[...n,t+r],[]),Rbe=new Set(tF(eF,"")),Dbe=eF,tU=e=>{if(et.debug("sanitizeDirective called with",e),!(typeof e!="object"||e==null)){if(Array.isArray(e)){e.forEach(t=>tU(t));return}for(const t of Object.keys(e)){if(et.debug("Checking key",t),t.startsWith("__")||t.includes("proto")||t.includes("constr")||!Rbe.has(t)||e[t]==null){et.debug("sanitize deleting key: ",t),delete e[t];continue}if(typeof e[t]=="object"){et.debug("sanitizing object",t),tU(e[t]);continue}const n=["themeCSS","fontFamily","altFontFamily"];for(const r of n)t.includes(r)&&(et.debug("sanitizing css option",t),e[t]=jbe(e[t]))}if(e.themeVariables)for(const t of Object.keys(e.themeVariables)){const n=e.themeVariables[t];n!=null&&n.match&&!n.match(/^[\d "#%(),.;A-Za-z]+$/)&&(e.themeVariables[t]="")}et.debug("After sanitization",e)}},jbe=e=>{let t=0,n=0;for(const r of e){if(t<n)return"{ /* ERROR: Unbalanced CSS */ }";r==="{"?t++:r==="}"&&n++}return t!==n?"{ /* ERROR: Unbalanced CSS */ }":e},nF=/^-{3}\s*[\n\r](.*?)[\n\r]-{3}\s*[\n\r]+/s,Xp=/%{2}{\s*(?:(\w+)\s*:|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,Pbe=/\s*%%.*\n/gm;class rF extends Error{constructor(t){super(t),this.name="UnknownDiagramError"}}const Lh={},M6=function(e,t){e=e.replace(nF,"").replace(Xp,"").replace(Pbe,`
271
- `);for(const[n,{detector:r}]of Object.entries(Lh))if(r(e,t))return n;throw new rF(`No diagram type detected matching given configuration for text: ${e}`)},iF=(...e)=>{for(const{id:t,detector:n,loader:r}of e)aF(t,n,r)},aF=(e,t,n)=>{Lh[e]?et.error(`Detector with key ${e} already exists`):Lh[e]={detector:t,loader:n},et.debug(`Detector with key ${e} added${n?" with loader":""}`)},Nbe=e=>Lh[e].loader,K8=(e,t,{depth:n=2,clobber:r=!1}={})=>{const i={depth:n,clobber:r};return Array.isArray(t)&&!Array.isArray(e)?(t.forEach(a=>K8(e,a,i)),e):Array.isArray(t)&&Array.isArray(e)?(t.forEach(a=>{e.includes(a)||e.push(a)}),e):e===void 0||n<=0?e!=null&&typeof e=="object"&&typeof t=="object"?Object.assign(e,t):t:(t!==void 0&&typeof e=="object"&&typeof t=="object"&&Object.keys(t).forEach(a=>{typeof t[a]=="object"&&(e[a]===void 0||typeof e[a]=="object")?(e[a]===void 0&&(e[a]=Array.isArray(t[a])?[]:{}),e[a]=K8(e[a],t[a],{depth:n-1,clobber:r})):(r||typeof e[a]!="object"&&typeof t[a]!="object")&&(e[a]=t[a])}),e)},Ar=K8,Obe="​",Fbe={curveBasis:m2e,curveBasisClosed:g2e,curveBasisOpen:U2e,curveBumpX:f2e,curveBumpY:p2e,curveBundle:b2e,curveCardinalClosed:v2e,curveCardinalOpen:x2e,curveCardinal:y2e,curveCatmullRomClosed:E2e,curveCatmullRomOpen:C2e,curveCatmullRom:w2e,curveLinear:h2e,curveLinearClosed:S2e,curveMonotoneX:_2e,curveMonotoneY:k2e,curveNatural:T2e,curveStep:M2e,curveStepAfter:A2e,curveStepBefore:I2e},$be=/\s*(?:(\w+)(?=:):|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,Bbe=function(e,t){const n=sF(e,/(?:init\b)|(?:initialize\b)/);let r={};if(Array.isArray(n)){const s=n.map(o=>o.args);tU(s),r=Ar(r,[...s])}else r=n.args;if(!r)return;let i=M6(e,t);const a="config";return r[a]!==void 0&&(i==="flowchart-v2"&&(i="flowchart"),r[i]=r[a],delete r[a]),r},sF=function(e,t=null){try{const n=new RegExp(`[%]{2}(?![{]${$be.source})(?=[}][%]{2}).*
272
- `,"ig");e=e.trim().replace(n,"").replace(/'/gm,'"'),et.debug(`Detecting diagram directive${t!==null?" type:"+t:""} based on the text:${e}`);let r;const i=[];for(;(r=Xp.exec(e))!==null;)if(r.index===Xp.lastIndex&&Xp.lastIndex++,r&&!t||t&&r[1]&&r[1].match(t)||t&&r[2]&&r[2].match(t)){const a=r[1]?r[1]:r[2],s=r[3]?r[3].trim():r[4]?JSON.parse(r[4].trim()):null;i.push({type:a,args:s})}return i.length===0?{type:e,args:null}:i.length===1?i[0]:i}catch(n){return et.error(`ERROR: ${n.message} - Unable to parse directive type: '${t}' based on the text: '${e}'`),{type:void 0,args:null}}},zbe=function(e){return e.replace(Xp,"")},Hbe=function(e,t){for(const[n,r]of t.entries())if(r.match(e))return n;return-1};function Wbe(e,t){if(!e)return t;const n=`curve${e.charAt(0).toUpperCase()+e.slice(1)}`;return Fbe[n]??t}function Xbe(e,t){const n=e.trim();if(n)return t.securityLevel!=="loose"?sI.sanitizeUrl(n):n}const Vbe=(e,...t)=>{const n=e.split("."),r=n.length-1,i=n[r];let a=window;for(let s=0;s<r;s++)if(a=a[n[s]],!a){et.error(`Function name: ${e} not found in window`);return}a[i](...t)};function oF(e,t){return!e||!t?0:Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function Ybe(e){let t,n=0;e.forEach(i=>{n+=oF(i,t),t=i});const r=n/2;return jx(e,r)}function Gbe(e){return e.length===1?e[0]:Ybe(e)}const jT=(e,t=2)=>{const n=Math.pow(10,t);return Math.round(e*n)/n},jx=(e,t)=>{let n,r=t;for(const i of e){if(n){const a=oF(i,n);if(a<r)r-=a;else{const s=r/a;if(s<=0)return n;if(s>=1)return{x:i.x,y:i.y};if(s>0&&s<1)return{x:jT((1-s)*n.x+s*i.x,5),y:jT((1-s)*n.y+s*i.y,5)}}}n=i}throw new Error("Could not find a suitable point for the given distance")},qbe=(e,t,n)=>{et.info(`our points ${JSON.stringify(t)}`),t[0]!==n&&(t=t.reverse());const i=jx(t,25),a=e?10:5,s=Math.atan2(t[0].y-i.y,t[0].x-i.x),o={x:0,y:0};return o.x=Math.sin(s)*a+(t[0].x+i.x)/2,o.y=-Math.cos(s)*a+(t[0].y+i.y)/2,o};function Zbe(e,t,n){const r=structuredClone(n);et.info("our points",r),t!=="start_left"&&t!=="start_right"&&r.reverse();const i=25+e,a=jx(r,i),s=10+e*.5,o=Math.atan2(r[0].y-a.y,r[0].x-a.x),c={x:0,y:0};return t==="start_left"?(c.x=Math.sin(o+Math.PI)*s+(r[0].x+a.x)/2,c.y=-Math.cos(o+Math.PI)*s+(r[0].y+a.y)/2):t==="end_right"?(c.x=Math.sin(o-Math.PI)*s+(r[0].x+a.x)/2-5,c.y=-Math.cos(o-Math.PI)*s+(r[0].y+a.y)/2-5):t==="end_left"?(c.x=Math.sin(o)*s+(r[0].x+a.x)/2-5,c.y=-Math.cos(o)*s+(r[0].y+a.y)/2-5):(c.x=Math.sin(o)*s+(r[0].x+a.x)/2,c.y=-Math.cos(o)*s+(r[0].y+a.y)/2),c}function Kbe(e){let t="",n="";for(const r of e)r!==void 0&&(r.startsWith("color:")||r.startsWith("text-align:")?n=n+r+";":t=t+r+";");return{style:t,labelStyle:n}}let PT=0;const Qbe=()=>(PT++,"id-"+Math.random().toString(36).substr(2,12)+"-"+PT);function Jbe(e){let t="";const n="0123456789abcdef",r=n.length;for(let i=0;i<e;i++)t+=n.charAt(Math.floor(Math.random()*r));return t}const eye=e=>Jbe(e.length),tye=function(){return{x:0,y:0,fill:void 0,anchor:"start",style:"#666",width:100,height:100,textMargin:0,rx:0,ry:0,valign:void 0,text:""}},nye=function(e,t){const n=t.text.replace(Dx.lineBreakRegex," "),[,r]=Nx(t.fontSize),i=e.append("text");i.attr("x",t.x),i.attr("y",t.y),i.style("text-anchor",t.anchor),i.style("font-family",t.fontFamily),i.style("font-size",r),i.style("font-weight",t.fontWeight),i.attr("fill",t.fill),t.class!==void 0&&i.attr("class",t.class);const a=i.append("tspan");return a.attr("x",t.x+t.textMargin*2),a.attr("fill",t.fill),a.text(n),i},rye=u0((e,t,n)=>{if(!e||(n=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",joinWith:"<br/>"},n),Dx.lineBreakRegex.test(e)))return e;const r=e.split(" "),i=[];let a="";return r.forEach((s,o)=>{const c=nU(`${s} `,n),d=nU(a,n);if(c>t){const{hyphenatedStrings:f,remainingWord:g}=iye(s,t,"-",n);i.push(a,...f),a=g}else d+c>=t?(i.push(a),a=s):a=[a,s].filter(Boolean).join(" ");o+1===r.length&&i.push(a)}),i.filter(s=>s!=="").join(n.joinWith)},(e,t,n)=>`${e}${t}${n.fontSize}${n.fontWeight}${n.fontFamily}${n.joinWith}`),iye=u0((e,t,n="-",r)=>{r=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",margin:0},r);const i=[...e],a=[];let s="";return i.forEach((o,c)=>{const d=`${s}${o}`;if(nU(d,r)>=t){const h=c+1,f=i.length===h,g=`${d}${n}`;a.push(f?d:g),s=""}else s=d}),{hyphenatedStrings:a,remainingWord:s}},(e,t,n="-",r)=>`${e}${t}${n}${r.fontSize}${r.fontWeight}${r.fontFamily}`);function aye(e,t){return Px(e,t).height}function nU(e,t){return Px(e,t).width}const Px=u0((e,t)=>{const{fontSize:n=12,fontFamily:r="Arial",fontWeight:i=400}=t;if(!e)return{width:0,height:0};const[,a]=Nx(n),s=["sans-serif",r],o=e.split(Dx.lineBreakRegex),c=[],d=ia("body");if(!d.remove)return{width:0,height:0,lineHeight:0};const l=d.append("svg");for(const f of s){let g=0;const U={width:0,height:0,lineHeight:0};for(const y of o){const v=tye();v.text=y||Obe;const x=nye(l,v).style("font-size",a).style("font-weight",i).style("font-family",f),w=(x._groups||x)[0][0].getBBox();if(w.width===0&&w.height===0)throw new Error("svg element not in render tree");U.width=Math.round(Math.max(U.width,w.width)),g=Math.round(w.height),U.height+=g,U.lineHeight=Math.round(Math.max(U.lineHeight,g))}c.push(U)}l.remove();const h=isNaN(c[1].height)||isNaN(c[1].width)||isNaN(c[1].lineHeight)||c[0].height>c[1].height&&c[0].width>c[1].width&&c[0].lineHeight>c[1].lineHeight?0:1;return c[h]},(e,t)=>`${e}${t.fontSize}${t.fontWeight}${t.fontFamily}`);class sye{constructor(t=!1,n){this.count=0,this.count=n?n.length:0,this.next=t?()=>this.count++:()=>Date.now()}}let rg;const oye=function(e){return rg=rg||document.createElement("div"),e=escape(e).replace(/%26/g,"&").replace(/%23/g,"#").replace(/%3B/g,";"),rg.innerHTML=e,unescape(rg.textContent)};function lF(e){return"str"in e}const lye=(e,t,n,r)=>{var i;if(!r)return;const a=(i=e.node())==null?void 0:i.getBBox();a&&e.append("text").text(r).attr("x",a.x+a.width/2).attr("y",-n).attr("class",t)},Nx=e=>{if(typeof e=="number")return[e,e+"px"];const t=parseInt(e??"",10);return Number.isNaN(t)?[void 0,void 0]:e===String(t)?[t,e+"px"]:[t,e]};function cF(e,t){return A5e({},e,t)}const Vp={assignWithDepth:Ar,wrapLabel:rye,calculateTextHeight:aye,calculateTextWidth:nU,calculateTextDimensions:Px,cleanAndMerge:cF,detectInit:Bbe,detectDirective:sF,isSubstringInArray:Hbe,interpolateToCurve:Wbe,calcLabelPosition:Gbe,calcCardinalityPosition:qbe,calcTerminalLabelPosition:Zbe,formatUrl:Xbe,getStylesFromArray:Kbe,generateId:Qbe,random:eye,runFunc:Vbe,entityDecode:oye,insertTitle:lye,parseFontSize:Nx,InitIDGenerator:sye},cye=function(e){let t=e;return t=t.replace(/style.*:\S*#.*;/g,function(n){return n.substring(0,n.length-1)}),t=t.replace(/classDef.*:\S*#.*;/g,function(n){return n.substring(0,n.length-1)}),t=t.replace(/#\w+;/g,function(n){const r=n.substring(1,n.length-1);return/^\+?\d+$/.test(r)?"fl°°"+r+"¶ß":"fl°"+r+"¶ß"}),t},dye=function(e){return e.replace(/fl°°/g,"&#").replace(/fl°/g,"&").replace(/¶ß/g,";")},NT="10.9.4",Rh=Object.freeze(Dbe);let ci=Ar({},Rh),dF,Dh=[],Yp=Ar({},Rh);const I6=(e,t)=>{let n=Ar({},e),r={};for(const i of t)fF(i),r=Ar(r,i);if(n=Ar(n,r),r.theme&&r.theme in Vo){const i=Ar({},dF),a=Ar(i.themeVariables||{},r.themeVariables);n.theme&&n.theme in Vo&&(n.themeVariables=Vo[n.theme].getThemeVariables(a))}return Yp=n,pF(Yp),Yp},uye=e=>(ci=Ar({},Rh),ci=Ar(ci,e),e.theme&&Vo[e.theme]&&(ci.themeVariables=Vo[e.theme].getThemeVariables(e.themeVariables)),I6(ci,Dh),ci),hye=e=>{dF=Ar({},e)},fye=e=>(ci=Ar(ci,e),I6(ci,Dh),ci),uF=()=>Ar({},ci),hF=e=>(pF(e),Ar(Yp,e),eo()),eo=()=>Ar({},Yp),fF=e=>{e&&(["secure",...ci.secure??[]].forEach(t=>{Object.hasOwn(e,t)&&(et.debug(`Denied attempt to modify a secure key ${t}`,e[t]),delete e[t])}),Object.keys(e).forEach(t=>{t.startsWith("__")&&delete e[t]}),Object.keys(e).forEach(t=>{typeof e[t]=="string"&&(e[t].includes("<")||e[t].includes(">")||e[t].includes("url(data:"))&&delete e[t],typeof e[t]=="object"&&fF(e[t])}))},pye=e=>{tU(e),e.fontFamily&&(!e.themeVariables||!e.themeVariables.fontFamily)&&(e.themeVariables={fontFamily:e.fontFamily}),Dh.push(e),I6(ci,Dh)},rU=(e=ci)=>{Dh=[],I6(e,Dh)},mye={LAZY_LOAD_DEPRECATED:"The configuration options lazyLoadedDiagrams and loadExternalDiagramsAtStartup are deprecated. Please use registerExternalDiagrams instead."},OT={},gye=e=>{OT[e]||(et.warn(mye[e]),OT[e]=!0)},pF=e=>{e&&(e.lazyLoadedDiagrams||e.loadExternalDiagramsAtStartup)&&gye("LAZY_LOAD_DEPRECATED")},mF="c4",Uye=e=>/^\s*C4Context|C4Container|C4Component|C4Dynamic|C4Deployment/.test(e),bye=async()=>{const{diagram:e}=await ye(async()=>{const{diagram:t}=await import("./c4Diagram-15b5d702-DpvGNdb1.js");return{diagram:t}},__vite__mapDeps([4,5]),import.meta.url);return{id:mF,diagram:e}},yye={id:mF,detector:Uye,loader:bye},vye=yye,gF="flowchart",xye=(e,t)=>{var n,r;return((n=t==null?void 0:t.flowchart)==null?void 0:n.defaultRenderer)==="dagre-wrapper"||((r=t==null?void 0:t.flowchart)==null?void 0:r.defaultRenderer)==="elk"?!1:/^\s*graph/.test(e)},wye=async()=>{const{diagram:e}=await ye(async()=>{const{diagram:t}=await import("./flowDiagram-cbd28bf7-i3WrrODz.js");return{diagram:t}},__vite__mapDeps([6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23]),import.meta.url);return{id:gF,diagram:e}},Eye={id:gF,detector:xye,loader:wye},Cye=Eye,UF="flowchart-v2",Sye=(e,t)=>{var n,r,i;return((n=t==null?void 0:t.flowchart)==null?void 0:n.defaultRenderer)==="dagre-d3"||((r=t==null?void 0:t.flowchart)==null?void 0:r.defaultRenderer)==="elk"?!1:/^\s*graph/.test(e)&&((i=t==null?void 0:t.flowchart)==null?void 0:i.defaultRenderer)==="dagre-wrapper"?!0:/^\s*flowchart/.test(e)},_ye=async()=>{const{diagram:e}=await ye(async()=>{const{diagram:t}=await import("./flowDiagram-v2-ffc7f31a-Dt9-YCmt.js");return{diagram:t}},__vite__mapDeps([24,7,12,8,9,13,10,11,14,15,16,17,18,19,20,21,22]),import.meta.url);return{id:UF,diagram:e}},kye={id:UF,detector:Sye,loader:_ye},Tye=kye,bF="er",Mye=e=>/^\s*erDiagram/.test(e),Iye=async()=>{const{diagram:e}=await ye(async()=>{const{diagram:t}=await import("./erDiagram-880f2ed8-DQ9hgik4.js");return{diagram:t}},__vite__mapDeps([25,8,9,10,11,18,19,20]),import.meta.url);return{id:bF,diagram:e}},Aye={id:bF,detector:Mye,loader:Iye},Lye=Aye,yF="gitGraph",Rye=e=>/^\s*gitGraph/.test(e),Dye=async()=>{const{diagram:e}=await ye(async()=>{const{diagram:t}=await import("./gitGraphDiagram-21fc4d3e-B4kyX168.js");return{diagram:t}},[],import.meta.url);return{id:yF,diagram:e}},jye={id:yF,detector:Rye,loader:Dye},Pye=jye,vF="gantt",Nye=e=>/^\s*gantt/.test(e),Oye=async()=>{const{diagram:e}=await ye(async()=>{const{diagram:t}=await import("./ganttDiagram-04f9e578-VkIDQA63.js");return{diagram:t}},__vite__mapDeps([26,27,28,29]),import.meta.url);return{id:vF,diagram:e}},Fye={id:vF,detector:Nye,loader:Oye},$ye=Fye,xF="info",Bye=e=>/^\s*info/.test(e),zye=async()=>{const{diagram:e}=await ye(async()=>{const{diagram:t}=await import("./infoDiagram-4a4f5b27-BhNHOwZA.js");return{diagram:t}},[],import.meta.url);return{id:xF,diagram:e}},Hye={id:xF,detector:Bye,loader:zye},wF="pie",Wye=e=>/^\s*pie/.test(e),Xye=async()=>{const{diagram:e}=await ye(async()=>{const{diagram:t}=await import("./pieDiagram-421022e6-BvT5PUN-.js");return{diagram:t}},__vite__mapDeps([30,31,20,32,29,33,19]),import.meta.url);return{id:wF,diagram:e}},Vye={id:wF,detector:Wye,loader:Xye},EF="quadrantChart",Yye=e=>/^\s*quadrantChart/.test(e),Gye=async()=>{const{diagram:e}=await ye(async()=>{const{diagram:t}=await import("./quadrantDiagram-0957ecba-DEeyKHE8.js");return{diagram:t}},__vite__mapDeps([34,28,29]),import.meta.url);return{id:EF,diagram:e}},qye={id:EF,detector:Yye,loader:Gye},Zye=qye,CF="xychart",Kye=e=>/^\s*xychart-beta/.test(e),Qye=async()=>{const{diagram:e}=await ye(async()=>{const{diagram:t}=await import("./xychartDiagram-b6496bcd-DhEWj72p.js");return{diagram:t}},__vite__mapDeps([35,16,17,36,29,32,28,18,19,20]),import.meta.url);return{id:CF,diagram:e}},Jye={id:CF,detector:Kye,loader:Qye},e3e=Jye,SF="requirement",t3e=e=>/^\s*requirement(Diagram)?/.test(e),n3e=async()=>{const{diagram:e}=await ye(async()=>{const{diagram:t}=await import("./requirementDiagram-23d650b8-CVQ2ZP6m.js");return{diagram:t}},__vite__mapDeps([37,8,9,10,11,18,19,20]),import.meta.url);return{id:SF,diagram:e}},r3e={id:SF,detector:t3e,loader:n3e},i3e=r3e,_F="sequence",a3e=e=>/^\s*sequenceDiagram/.test(e),s3e=async()=>{const{diagram:e}=await ye(async()=>{const{diagram:t}=await import("./sequenceDiagram-17ac3bff-Dioe6R0p.js");return{diagram:t}},__vite__mapDeps([38,5]),import.meta.url);return{id:_F,diagram:e}},o3e={id:_F,detector:a3e,loader:s3e},l3e=o3e,kF="class",c3e=(e,t)=>{var n;return((n=t==null?void 0:t.class)==null?void 0:n.defaultRenderer)==="dagre-wrapper"?!1:/^\s*classDiagram/.test(e)},d3e=async()=>{const{diagram:e}=await ye(async()=>{const{diagram:t}=await import("./classDiagram-d40c83e7-CNWHkFWX.js");return{diagram:t}},__vite__mapDeps([39,40,8,9,10,11,18,19,20]),import.meta.url);return{id:kF,diagram:e}},u3e={id:kF,detector:c3e,loader:d3e},h3e=u3e,TF="classDiagram",f3e=(e,t)=>{var n;return/^\s*classDiagram/.test(e)&&((n=t==null?void 0:t.class)==null?void 0:n.defaultRenderer)==="dagre-wrapper"?!0:/^\s*classDiagram-v2/.test(e)},p3e=async()=>{const{diagram:e}=await ye(async()=>{const{diagram:t}=await import("./classDiagram-v2-d5a6b087-CnoZ7UrM.js");return{diagram:t}},__vite__mapDeps([41,40,8,9,13,10,11,14,15,16,17,18,19,20]),import.meta.url);return{id:TF,diagram:e}},m3e={id:TF,detector:f3e,loader:p3e},g3e=m3e,MF="state",U3e=(e,t)=>{var n;return((n=t==null?void 0:t.state)==null?void 0:n.defaultRenderer)==="dagre-wrapper"?!1:/^\s*stateDiagram/.test(e)},b3e=async()=>{const{diagram:e}=await ye(async()=>{const{diagram:t}=await import("./stateDiagram-9c5f0230-BRyfqsP4.js");return{diagram:t}},__vite__mapDeps([42,43,8,9,10,11,18,19,20]),import.meta.url);return{id:MF,diagram:e}},y3e={id:MF,detector:U3e,loader:b3e},v3e=y3e,IF="stateDiagram",x3e=(e,t)=>{var n;return!!(/^\s*stateDiagram-v2/.test(e)||/^\s*stateDiagram/.test(e)&&((n=t==null?void 0:t.state)==null?void 0:n.defaultRenderer)==="dagre-wrapper")},w3e=async()=>{const{diagram:e}=await ye(async()=>{const{diagram:t}=await import("./stateDiagram-v2-51a3dcff-C_46txUS.js");return{diagram:t}},__vite__mapDeps([44,43,8,9,13,10,11,14,15,16,17,18,19,20]),import.meta.url);return{id:IF,diagram:e}},E3e={id:IF,detector:x3e,loader:w3e},C3e=E3e,AF="journey",S3e=e=>/^\s*journey/.test(e),_3e=async()=>{const{diagram:e}=await ye(async()=>{const{diagram:t}=await import("./journeyDiagram-29694f62-Bh6lLjz4.js");return{diagram:t}},__vite__mapDeps([45,5,31,20]),import.meta.url);return{id:AF,diagram:e}},k3e={id:AF,detector:S3e,loader:_3e},T3e=k3e,M3e=function(e,t){for(let n of t)e.attr(n[0],n[1])},I3e=function(e,t,n){let r=new Map;return n?(r.set("width","100%"),r.set("style",`max-width: ${t}px;`)):(r.set("height",e),r.set("width",t)),r},LF=function(e,t,n,r){const i=I3e(t,n,r);M3e(e,i)},A3e=function(e,t,n,r){const i=t.node().getBBox(),a=i.width,s=i.height;et.info(`SVG bounds: ${a}x${s}`,i);let o=0,c=0;et.info(`Graph bounds: ${o}x${c}`,e),o=a+n*2,c=s+n*2,et.info(`Calculated bounds: ${o}x${c}`),LF(t,c,o,r);const d=`${i.x-n} ${i.y-n} ${i.width+2*n} ${i.height+2*n}`;t.attr("viewBox",d)},Vg={},L3e=(e,t,n)=>{let r="";return e in Vg&&Vg[e]?r=Vg[e](n):et.warn(`No theme found for ${e}`),` & {
273
- font-family: ${n.fontFamily};
274
- font-size: ${n.fontSize};
275
- fill: ${n.textColor}
276
- }
277
-
278
- /* Classes common for multiple diagrams */
279
-
280
- & .error-icon {
281
- fill: ${n.errorBkgColor};
282
- }
283
- & .error-text {
284
- fill: ${n.errorTextColor};
285
- stroke: ${n.errorTextColor};
286
- }
287
-
288
- & .edge-thickness-normal {
289
- stroke-width: 2px;
290
- }
291
- & .edge-thickness-thick {
292
- stroke-width: 3.5px
293
- }
294
- & .edge-pattern-solid {
295
- stroke-dasharray: 0;
296
- }
297
-
298
- & .edge-pattern-dashed{
299
- stroke-dasharray: 3;
300
- }
301
- .edge-pattern-dotted {
302
- stroke-dasharray: 2;
303
- }
304
-
305
- & .marker {
306
- fill: ${n.lineColor};
307
- stroke: ${n.lineColor};
308
- }
309
- & .marker.cross {
310
- stroke: ${n.lineColor};
311
- }
312
-
313
- & svg {
314
- font-family: ${n.fontFamily};
315
- font-size: ${n.fontSize};
316
- }
317
-
318
- ${r}
319
-
320
- ${t}
321
- `},R3e=(e,t)=>{t!==void 0&&(Vg[e]=t)},D3e=L3e;let Ox="",Fx="",$x="";const Bx=e=>Ah(e,eo()),j3e=()=>{Ox="",$x="",Fx=""},P3e=e=>{Ox=Bx(e).replace(/^\s+/g,"")},N3e=()=>Ox,O3e=e=>{$x=Bx(e).replace(/\n\s+/g,`
322
- `)},F3e=()=>$x,$3e=e=>{Fx=Bx(e)},B3e=()=>Fx,z3e=Object.freeze(Object.defineProperty({__proto__:null,clear:j3e,getAccDescription:F3e,getAccTitle:N3e,getDiagramTitle:B3e,setAccDescription:O3e,setAccTitle:P3e,setDiagramTitle:$3e},Symbol.toStringTag,{value:"Module"})),H3e=et,W3e=Rx,zx=eo,D4e=hF,j4e=Rh,X3e=e=>Ah(e,zx()),V3e=A3e,Y3e=()=>z3e,iU={},aU=(e,t,n)=>{var r;if(iU[e])throw new Error(`Diagram ${e} already registered.`);iU[e]=t,n&&aF(e,n),R3e(e,t.styles),(r=t.injectUtils)==null||r.call(t,H3e,W3e,zx,X3e,V3e,Y3e(),()=>{})},Hx=e=>{if(e in iU)return iU[e];throw new G3e(e)};class G3e extends Error{constructor(t){super(`Diagram ${t} not found.`)}}const q3e=e=>{var t;const{securityLevel:n}=zx();let r=ia("body");if(n==="sandbox"){const s=((t=ia(`#i${e}`).node())==null?void 0:t.contentDocument)??document;r=ia(s.body)}return r.select(`#${e}`)},Z3e=(e,t,n)=>{et.debug(`rendering svg for syntax error
323
- `);const r=q3e(t),i=r.append("g");r.attr("viewBox","0 0 2412 512"),LF(r,100,512,!0),i.append("path").attr("class","error-icon").attr("d","m411.313,123.313c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32-9.375,9.375-20.688-20.688c-12.484-12.5-32.766-12.5-45.25,0l-16,16c-1.261,1.261-2.304,2.648-3.31,4.051-21.739-8.561-45.324-13.426-70.065-13.426-105.867,0-192,86.133-192,192s86.133,192 192,192 192-86.133 192-192c0-24.741-4.864-48.327-13.426-70.065 1.402-1.007 2.79-2.049 4.051-3.31l16-16c12.5-12.492 12.5-32.758 0-45.25l-20.688-20.688 9.375-9.375 32.001-31.999zm-219.313,100.687c-52.938,0-96,43.063-96,96 0,8.836-7.164,16-16,16s-16-7.164-16-16c0-70.578 57.422-128 128-128 8.836,0 16,7.164 16,16s-7.164,16-16,16z"),i.append("path").attr("class","error-icon").attr("d","m459.02,148.98c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l16,16c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16.001-16z"),i.append("path").attr("class","error-icon").attr("d","m340.395,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16-16c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l15.999,16z"),i.append("path").attr("class","error-icon").attr("d","m400,64c8.844,0 16-7.164 16-16v-32c0-8.836-7.156-16-16-16-8.844,0-16,7.164-16,16v32c0,8.836 7.156,16 16,16z"),i.append("path").attr("class","error-icon").attr("d","m496,96.586h-32c-8.844,0-16,7.164-16,16 0,8.836 7.156,16 16,16h32c8.844,0 16-7.164 16-16 0-8.836-7.156-16-16-16z"),i.append("path").attr("class","error-icon").attr("d","m436.98,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688l32-32c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32c-6.251,6.25-6.251,16.375-0.001,22.625z"),i.append("text").attr("class","error-text").attr("x",1440).attr("y",250).attr("font-size","150px").style("text-anchor","middle").text("Syntax error in text"),i.append("text").attr("class","error-text").attr("x",1250).attr("y",400).attr("font-size","100px").style("text-anchor","middle").text(`mermaid version ${n}`)},RF={draw:Z3e},K3e=RF,Q3e={db:{},renderer:RF,parser:{parser:{yy:{}},parse:()=>{}}},J3e=Q3e,DF="flowchart-elk",e8e=(e,t)=>{var n;return!!(/^\s*flowchart-elk/.test(e)||/^\s*flowchart|graph/.test(e)&&((n=t==null?void 0:t.flowchart)==null?void 0:n.defaultRenderer)==="elk")},t8e=async()=>{const{diagram:e}=await ye(async()=>{const{diagram:t}=await import("./flowchart-elk-definition-36e2d292-S2mocwzS.js");return{diagram:t}},__vite__mapDeps([46,7,15,16,17,18,19,20,47,3]),import.meta.url);return{id:DF,diagram:e}},n8e={id:DF,detector:e8e,loader:t8e},r8e=n8e,jF="timeline",i8e=e=>/^\s*timeline/.test(e),a8e=async()=>{const{diagram:e}=await ye(async()=>{const{diagram:t}=await import("./timeline-definition-7e6b55e7--QFtbYaW.js");return{diagram:t}},__vite__mapDeps([48,31,20]),import.meta.url);return{id:jF,diagram:e}},s8e={id:jF,detector:i8e,loader:a8e},o8e=s8e,PF="mindmap",l8e=e=>/^\s*mindmap/.test(e),c8e=async()=>{const{diagram:e}=await ye(async()=>{const{diagram:t}=await import("./mindmap-definition-ac74a2e8-BqOdiX5M.js");return{diagram:t}},__vite__mapDeps([49,50,16,17]),import.meta.url);return{id:PF,diagram:e}},d8e={id:PF,detector:l8e,loader:c8e},u8e=d8e,NF="sankey",h8e=e=>/^\s*sankey-beta/.test(e),f8e=async()=>{const{diagram:e}=await ye(async()=>{const{diagram:t}=await import("./sankeyDiagram-23345273-CqrhI2Nl.js");return{diagram:t}},__vite__mapDeps([51,52,32,29,53]),import.meta.url);return{id:NF,diagram:e}},p8e={id:NF,detector:h8e,loader:f8e},m8e=p8e,OF="block",g8e=e=>/^\s*block-beta/.test(e),U8e=async()=>{const{diagram:e}=await ye(async()=>{const{diagram:t}=await import("./blockDiagram-68f4deed-BYexJ9l5.js");return{diagram:t}},__vite__mapDeps([54,14,9,15,16,17,18,19,20,8,21,32,29,53]),import.meta.url);return{id:OF,diagram:e}},b8e={id:OF,detector:g8e,loader:U8e},y8e=b8e;let FT=!1;const Wx=()=>{FT||(FT=!0,aU("error",J3e,e=>e.toLowerCase().trim()==="error"),aU("---",{db:{clear:()=>{}},styles:{},renderer:{draw:()=>{}},parser:{parser:{yy:{}},parse:()=>{throw new Error("Diagrams beginning with --- are not valid. If you were trying to use a YAML front-matter, please ensure that you've correctly opened and closed the YAML front-matter with un-indented `---` blocks")}},init:()=>null},e=>e.toLowerCase().trimStart().startsWith("---")),iF(vye,g3e,h3e,Lye,$ye,Hye,Vye,i3e,l3e,r8e,Tye,Cye,u8e,o8e,Pye,C3e,v3e,T3e,Zye,m8e,e3e,y8e))};class FF{constructor(t,n={}){this.text=t,this.metadata=n,this.type="graph",this.text=cye(t),this.text+=`
324
- `;const r=eo();try{this.type=M6(t,r)}catch(a){this.type="error",this.detectError=a}const i=Hx(this.type);et.debug("Type "+this.type),this.db=i.db,this.renderer=i.renderer,this.parser=i.parser,this.parser.parser.yy=this.db,this.init=i.init,this.parse()}parse(){var t,n,r,i,a;if(this.detectError)throw this.detectError;(n=(t=this.db).clear)==null||n.call(t);const s=eo();(r=this.init)==null||r.call(this,s),this.metadata.title&&((a=(i=this.db).setDiagramTitle)==null||a.call(i,this.metadata.title)),this.parser.parse(this.text)}async render(t,n){await this.renderer.draw(this.text,t,n,this)}getParser(){return this.parser}getType(){return this.type}}const v8e=async(e,t={})=>{const n=M6(e,eo());try{Hx(n)}catch{const i=Nbe(n);if(!i)throw new rF(`Diagram ${n} not found.`);const{id:a,diagram:s}=await i();aU(a,s)}return new FF(e,t)};let $T=[];const x8e=()=>{$T.forEach(e=>{e()}),$T=[]},w8e="graphics-document document";function E8e(e,t){e.attr("role",w8e),t!==""&&e.attr("aria-roledescription",t)}function C8e(e,t,n,r){if(e.insert!==void 0){if(n){const i=`chart-desc-${r}`;e.attr("aria-describedby",i),e.insert("desc",":first-child").attr("id",i).text(n)}if(t){const i=`chart-title-${r}`;e.attr("aria-labelledby",i),e.insert("title",":first-child").attr("id",i).text(t)}}}const S8e=e=>e.replace(/^\s*%%(?!{)[^\n]+\n?/gm,"").trimStart();/*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT */function $F(e){return typeof e>"u"||e===null}function _8e(e){return typeof e=="object"&&e!==null}function k8e(e){return Array.isArray(e)?e:$F(e)?[]:[e]}function T8e(e,t){var n,r,i,a;if(t)for(a=Object.keys(t),n=0,r=a.length;n<r;n+=1)i=a[n],e[i]=t[i];return e}function M8e(e,t){var n="",r;for(r=0;r<t;r+=1)n+=e;return n}function I8e(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}var A8e=$F,L8e=_8e,R8e=k8e,D8e=M8e,j8e=I8e,P8e=T8e,Xr={isNothing:A8e,isObject:L8e,toArray:R8e,repeat:D8e,isNegativeZero:j8e,extend:P8e};function BF(e,t){var n="",r=e.reason||"(unknown reason)";return e.mark?(e.mark.name&&(n+='in "'+e.mark.name+'" '),n+="("+(e.mark.line+1)+":"+(e.mark.column+1)+")",!t&&e.mark.snippet&&(n+=`
325
-
326
- `+e.mark.snippet),r+" "+n):r}function D1(e,t){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=t,this.message=BF(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}D1.prototype=Object.create(Error.prototype);D1.prototype.constructor=D1;D1.prototype.toString=function(t){return this.name+": "+BF(this,t)};var Fo=D1;function t3(e,t,n,r,i){var a="",s="",o=Math.floor(i/2)-1;return r-t>o&&(a=" ... ",t=r-o+a.length),n-r>o&&(s=" ...",n=r+o-s.length),{str:a+e.slice(t,n).replace(/\t/g,"→")+s,pos:r-t+a.length}}function n3(e,t){return Xr.repeat(" ",t-e.length)+e}function N8e(e,t){if(t=Object.create(t||null),!e.buffer)return null;t.maxLength||(t.maxLength=79),typeof t.indent!="number"&&(t.indent=1),typeof t.linesBefore!="number"&&(t.linesBefore=3),typeof t.linesAfter!="number"&&(t.linesAfter=2);for(var n=/\r?\n|\r|\0/g,r=[0],i=[],a,s=-1;a=n.exec(e.buffer);)i.push(a.index),r.push(a.index+a[0].length),e.position<=a.index&&s<0&&(s=r.length-2);s<0&&(s=r.length-1);var o="",c,d,l=Math.min(e.line+t.linesAfter,i.length).toString().length,h=t.maxLength-(t.indent+l+3);for(c=1;c<=t.linesBefore&&!(s-c<0);c++)d=t3(e.buffer,r[s-c],i[s-c],e.position-(r[s]-r[s-c]),h),o=Xr.repeat(" ",t.indent)+n3((e.line-c+1).toString(),l)+" | "+d.str+`
327
- `+o;for(d=t3(e.buffer,r[s],i[s],e.position,h),o+=Xr.repeat(" ",t.indent)+n3((e.line+1).toString(),l)+" | "+d.str+`
328
- `,o+=Xr.repeat("-",t.indent+l+3+d.pos)+`^
329
- `,c=1;c<=t.linesAfter&&!(s+c>=i.length);c++)d=t3(e.buffer,r[s+c],i[s+c],e.position-(r[s]-r[s+c]),h),o+=Xr.repeat(" ",t.indent)+n3((e.line+c+1).toString(),l)+" | "+d.str+`
330
- `;return o.replace(/\n$/,"")}var O8e=N8e,F8e=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],$8e=["scalar","sequence","mapping"];function B8e(e){var t={};return e!==null&&Object.keys(e).forEach(function(n){e[n].forEach(function(r){t[String(r)]=n})}),t}function z8e(e,t){if(t=t||{},Object.keys(t).forEach(function(n){if(F8e.indexOf(n)===-1)throw new Fo('Unknown option "'+n+'" is met in definition of "'+e+'" YAML type.')}),this.options=t,this.tag=e,this.kind=t.kind||null,this.resolve=t.resolve||function(){return!0},this.construct=t.construct||function(n){return n},this.instanceOf=t.instanceOf||null,this.predicate=t.predicate||null,this.represent=t.represent||null,this.representName=t.representName||null,this.defaultStyle=t.defaultStyle||null,this.multi=t.multi||!1,this.styleAliases=B8e(t.styleAliases||null),$8e.indexOf(this.kind)===-1)throw new Fo('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}var Pr=z8e;function BT(e,t){var n=[];return e[t].forEach(function(r){var i=n.length;n.forEach(function(a,s){a.tag===r.tag&&a.kind===r.kind&&a.multi===r.multi&&(i=s)}),n[i]=r}),n}function H8e(){var e={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},t,n;function r(i){i.multi?(e.multi[i.kind].push(i),e.multi.fallback.push(i)):e[i.kind][i.tag]=e.fallback[i.tag]=i}for(t=0,n=arguments.length;t<n;t+=1)arguments[t].forEach(r);return e}function Q8(e){return this.extend(e)}Q8.prototype.extend=function(t){var n=[],r=[];if(t instanceof Pr)r.push(t);else if(Array.isArray(t))r=r.concat(t);else if(t&&(Array.isArray(t.implicit)||Array.isArray(t.explicit)))t.implicit&&(n=n.concat(t.implicit)),t.explicit&&(r=r.concat(t.explicit));else throw new Fo("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");n.forEach(function(a){if(!(a instanceof Pr))throw new Fo("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(a.loadKind&&a.loadKind!=="scalar")throw new Fo("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(a.multi)throw new Fo("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),r.forEach(function(a){if(!(a instanceof Pr))throw new Fo("Specified list of YAML types (or a single Type object) contains a non-Type object.")});var i=Object.create(Q8.prototype);return i.implicit=(this.implicit||[]).concat(n),i.explicit=(this.explicit||[]).concat(r),i.compiledImplicit=BT(i,"implicit"),i.compiledExplicit=BT(i,"explicit"),i.compiledTypeMap=H8e(i.compiledImplicit,i.compiledExplicit),i};var W8e=Q8,X8e=new Pr("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return e!==null?e:""}}),V8e=new Pr("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return e!==null?e:[]}}),Y8e=new Pr("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return e!==null?e:{}}}),G8e=new W8e({explicit:[X8e,V8e,Y8e]});function q8e(e){if(e===null)return!0;var t=e.length;return t===1&&e==="~"||t===4&&(e==="null"||e==="Null"||e==="NULL")}function Z8e(){return null}function K8e(e){return e===null}var Q8e=new Pr("tag:yaml.org,2002:null",{kind:"scalar",resolve:q8e,construct:Z8e,predicate:K8e,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"});function J8e(e){if(e===null)return!1;var t=e.length;return t===4&&(e==="true"||e==="True"||e==="TRUE")||t===5&&(e==="false"||e==="False"||e==="FALSE")}function eve(e){return e==="true"||e==="True"||e==="TRUE"}function tve(e){return Object.prototype.toString.call(e)==="[object Boolean]"}var nve=new Pr("tag:yaml.org,2002:bool",{kind:"scalar",resolve:J8e,construct:eve,predicate:tve,represent:{lowercase:function(e){return e?"true":"false"},uppercase:function(e){return e?"TRUE":"FALSE"},camelcase:function(e){return e?"True":"False"}},defaultStyle:"lowercase"});function rve(e){return 48<=e&&e<=57||65<=e&&e<=70||97<=e&&e<=102}function ive(e){return 48<=e&&e<=55}function ave(e){return 48<=e&&e<=57}function sve(e){if(e===null)return!1;var t=e.length,n=0,r=!1,i;if(!t)return!1;if(i=e[n],(i==="-"||i==="+")&&(i=e[++n]),i==="0"){if(n+1===t)return!0;if(i=e[++n],i==="b"){for(n++;n<t;n++)if(i=e[n],i!=="_"){if(i!=="0"&&i!=="1")return!1;r=!0}return r&&i!=="_"}if(i==="x"){for(n++;n<t;n++)if(i=e[n],i!=="_"){if(!rve(e.charCodeAt(n)))return!1;r=!0}return r&&i!=="_"}if(i==="o"){for(n++;n<t;n++)if(i=e[n],i!=="_"){if(!ive(e.charCodeAt(n)))return!1;r=!0}return r&&i!=="_"}}if(i==="_")return!1;for(;n<t;n++)if(i=e[n],i!=="_"){if(!ave(e.charCodeAt(n)))return!1;r=!0}return!(!r||i==="_")}function ove(e){var t=e,n=1,r;if(t.indexOf("_")!==-1&&(t=t.replace(/_/g,"")),r=t[0],(r==="-"||r==="+")&&(r==="-"&&(n=-1),t=t.slice(1),r=t[0]),t==="0")return 0;if(r==="0"){if(t[1]==="b")return n*parseInt(t.slice(2),2);if(t[1]==="x")return n*parseInt(t.slice(2),16);if(t[1]==="o")return n*parseInt(t.slice(2),8)}return n*parseInt(t,10)}function lve(e){return Object.prototype.toString.call(e)==="[object Number]"&&e%1===0&&!Xr.isNegativeZero(e)}var cve=new Pr("tag:yaml.org,2002:int",{kind:"scalar",resolve:sve,construct:ove,predicate:lve,represent:{binary:function(e){return e>=0?"0b"+e.toString(2):"-0b"+e.toString(2).slice(1)},octal:function(e){return e>=0?"0o"+e.toString(8):"-0o"+e.toString(8).slice(1)},decimal:function(e){return e.toString(10)},hexadecimal:function(e){return e>=0?"0x"+e.toString(16).toUpperCase():"-0x"+e.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),dve=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function uve(e){return!(e===null||!dve.test(e)||e[e.length-1]==="_")}function hve(e){var t,n;return t=e.replace(/_/g,"").toLowerCase(),n=t[0]==="-"?-1:1,"+-".indexOf(t[0])>=0&&(t=t.slice(1)),t===".inf"?n===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:t===".nan"?NaN:n*parseFloat(t,10)}var fve=/^[-+]?[0-9]+e/;function pve(e,t){var n;if(isNaN(e))switch(t){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===e)switch(t){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===e)switch(t){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(Xr.isNegativeZero(e))return"-0.0";return n=e.toString(10),fve.test(n)?n.replace("e",".e"):n}function mve(e){return Object.prototype.toString.call(e)==="[object Number]"&&(e%1!==0||Xr.isNegativeZero(e))}var gve=new Pr("tag:yaml.org,2002:float",{kind:"scalar",resolve:uve,construct:hve,predicate:mve,represent:pve,defaultStyle:"lowercase"}),zF=G8e.extend({implicit:[Q8e,nve,cve,gve]}),Uve=zF,HF=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),WF=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function bve(e){return e===null?!1:HF.exec(e)!==null||WF.exec(e)!==null}function yve(e){var t,n,r,i,a,s,o,c=0,d=null,l,h,f;if(t=HF.exec(e),t===null&&(t=WF.exec(e)),t===null)throw new Error("Date resolve error");if(n=+t[1],r=+t[2]-1,i=+t[3],!t[4])return new Date(Date.UTC(n,r,i));if(a=+t[4],s=+t[5],o=+t[6],t[7]){for(c=t[7].slice(0,3);c.length<3;)c+="0";c=+c}return t[9]&&(l=+t[10],h=+(t[11]||0),d=(l*60+h)*6e4,t[9]==="-"&&(d=-d)),f=new Date(Date.UTC(n,r,i,a,s,o,c)),d&&f.setTime(f.getTime()-d),f}function vve(e){return e.toISOString()}var xve=new Pr("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:bve,construct:yve,instanceOf:Date,represent:vve});function wve(e){return e==="<<"||e===null}var Eve=new Pr("tag:yaml.org,2002:merge",{kind:"scalar",resolve:wve}),Xx=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
331
- \r`;function Cve(e){if(e===null)return!1;var t,n,r=0,i=e.length,a=Xx;for(n=0;n<i;n++)if(t=a.indexOf(e.charAt(n)),!(t>64)){if(t<0)return!1;r+=6}return r%8===0}function Sve(e){var t,n,r=e.replace(/[\r\n=]/g,""),i=r.length,a=Xx,s=0,o=[];for(t=0;t<i;t++)t%4===0&&t&&(o.push(s>>16&255),o.push(s>>8&255),o.push(s&255)),s=s<<6|a.indexOf(r.charAt(t));return n=i%4*6,n===0?(o.push(s>>16&255),o.push(s>>8&255),o.push(s&255)):n===18?(o.push(s>>10&255),o.push(s>>2&255)):n===12&&o.push(s>>4&255),new Uint8Array(o)}function _ve(e){var t="",n=0,r,i,a=e.length,s=Xx;for(r=0;r<a;r++)r%3===0&&r&&(t+=s[n>>18&63],t+=s[n>>12&63],t+=s[n>>6&63],t+=s[n&63]),n=(n<<8)+e[r];return i=a%3,i===0?(t+=s[n>>18&63],t+=s[n>>12&63],t+=s[n>>6&63],t+=s[n&63]):i===2?(t+=s[n>>10&63],t+=s[n>>4&63],t+=s[n<<2&63],t+=s[64]):i===1&&(t+=s[n>>2&63],t+=s[n<<4&63],t+=s[64],t+=s[64]),t}function kve(e){return Object.prototype.toString.call(e)==="[object Uint8Array]"}var Tve=new Pr("tag:yaml.org,2002:binary",{kind:"scalar",resolve:Cve,construct:Sve,predicate:kve,represent:_ve}),Mve=Object.prototype.hasOwnProperty,Ive=Object.prototype.toString;function Ave(e){if(e===null)return!0;var t=[],n,r,i,a,s,o=e;for(n=0,r=o.length;n<r;n+=1){if(i=o[n],s=!1,Ive.call(i)!=="[object Object]")return!1;for(a in i)if(Mve.call(i,a))if(!s)s=!0;else return!1;if(!s)return!1;if(t.indexOf(a)===-1)t.push(a);else return!1}return!0}function Lve(e){return e!==null?e:[]}var Rve=new Pr("tag:yaml.org,2002:omap",{kind:"sequence",resolve:Ave,construct:Lve}),Dve=Object.prototype.toString;function jve(e){if(e===null)return!0;var t,n,r,i,a,s=e;for(a=new Array(s.length),t=0,n=s.length;t<n;t+=1){if(r=s[t],Dve.call(r)!=="[object Object]"||(i=Object.keys(r),i.length!==1))return!1;a[t]=[i[0],r[i[0]]]}return!0}function Pve(e){if(e===null)return[];var t,n,r,i,a,s=e;for(a=new Array(s.length),t=0,n=s.length;t<n;t+=1)r=s[t],i=Object.keys(r),a[t]=[i[0],r[i[0]]];return a}var Nve=new Pr("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:jve,construct:Pve}),Ove=Object.prototype.hasOwnProperty;function Fve(e){if(e===null)return!0;var t,n=e;for(t in n)if(Ove.call(n,t)&&n[t]!==null)return!1;return!0}function $ve(e){return e!==null?e:{}}var Bve=new Pr("tag:yaml.org,2002:set",{kind:"mapping",resolve:Fve,construct:$ve}),zve=Uve.extend({implicit:[xve,Eve],explicit:[Tve,Rve,Nve,Bve]}),yc=Object.prototype.hasOwnProperty,sU=1,XF=2,VF=3,oU=4,r3=1,Hve=2,zT=3,Wve=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,Xve=/[\x85\u2028\u2029]/,Vve=/[,\[\]\{\}]/,YF=/^(?:!|!!|![a-z\-]+!)$/i,GF=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function HT(e){return Object.prototype.toString.call(e)}function Ws(e){return e===10||e===13}function Ud(e){return e===9||e===32}function mi(e){return e===9||e===32||e===10||e===13}function Xu(e){return e===44||e===91||e===93||e===123||e===125}function Yve(e){var t;return 48<=e&&e<=57?e-48:(t=e|32,97<=t&&t<=102?t-97+10:-1)}function Gve(e){return e===120?2:e===117?4:e===85?8:0}function qve(e){return 48<=e&&e<=57?e-48:-1}function WT(e){return e===48?"\0":e===97?"\x07":e===98?"\b":e===116||e===9?" ":e===110?`
332
- `:e===118?"\v":e===102?"\f":e===114?"\r":e===101?"\x1B":e===32?" ":e===34?'"':e===47?"/":e===92?"\\":e===78?"…":e===95?" ":e===76?"\u2028":e===80?"\u2029":""}function Zve(e){return e<=65535?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}var qF=new Array(256),ZF=new Array(256);for(var Iu=0;Iu<256;Iu++)qF[Iu]=WT(Iu)?1:0,ZF[Iu]=WT(Iu);function Kve(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||zve,this.onWarning=t.onWarning||null,this.legacy=t.legacy||!1,this.json=t.json||!1,this.listener=t.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}function KF(e,t){var n={name:e.filename,buffer:e.input.slice(0,-1),position:e.position,line:e.line,column:e.position-e.lineStart};return n.snippet=O8e(n),new Fo(t,n)}function Qe(e,t){throw KF(e,t)}function lU(e,t){e.onWarning&&e.onWarning.call(null,KF(e,t))}var XT={YAML:function(t,n,r){var i,a,s;t.version!==null&&Qe(t,"duplication of %YAML directive"),r.length!==1&&Qe(t,"YAML directive accepts exactly one argument"),i=/^([0-9]+)\.([0-9]+)$/.exec(r[0]),i===null&&Qe(t,"ill-formed argument of the YAML directive"),a=parseInt(i[1],10),s=parseInt(i[2],10),a!==1&&Qe(t,"unacceptable YAML version of the document"),t.version=r[0],t.checkLineBreaks=s<2,s!==1&&s!==2&&lU(t,"unsupported YAML version of the document")},TAG:function(t,n,r){var i,a;r.length!==2&&Qe(t,"TAG directive accepts exactly two arguments"),i=r[0],a=r[1],YF.test(i)||Qe(t,"ill-formed tag handle (first argument) of the TAG directive"),yc.call(t.tagMap,i)&&Qe(t,'there is a previously declared suffix for "'+i+'" tag handle'),GF.test(a)||Qe(t,"ill-formed tag prefix (second argument) of the TAG directive");try{a=decodeURIComponent(a)}catch{Qe(t,"tag prefix is malformed: "+a)}t.tagMap[i]=a}};function dc(e,t,n,r){var i,a,s,o;if(t<n){if(o=e.input.slice(t,n),r)for(i=0,a=o.length;i<a;i+=1)s=o.charCodeAt(i),s===9||32<=s&&s<=1114111||Qe(e,"expected valid JSON character");else Wve.test(o)&&Qe(e,"the stream contains non-printable characters");e.result+=o}}function VT(e,t,n,r){var i,a,s,o;for(Xr.isObject(n)||Qe(e,"cannot merge mappings; the provided source object is unacceptable"),i=Object.keys(n),s=0,o=i.length;s<o;s+=1)a=i[s],yc.call(t,a)||(t[a]=n[a],r[a]=!0)}function Vu(e,t,n,r,i,a,s,o,c){var d,l;if(Array.isArray(i))for(i=Array.prototype.slice.call(i),d=0,l=i.length;d<l;d+=1)Array.isArray(i[d])&&Qe(e,"nested arrays are not supported inside keys"),typeof i=="object"&&HT(i[d])==="[object Object]"&&(i[d]="[object Object]");if(typeof i=="object"&&HT(i)==="[object Object]"&&(i="[object Object]"),i=String(i),t===null&&(t={}),r==="tag:yaml.org,2002:merge")if(Array.isArray(a))for(d=0,l=a.length;d<l;d+=1)VT(e,t,a[d],n);else VT(e,t,a,n);else!e.json&&!yc.call(n,i)&&yc.call(t,i)&&(e.line=s||e.line,e.lineStart=o||e.lineStart,e.position=c||e.position,Qe(e,"duplicated mapping key")),i==="__proto__"?Object.defineProperty(t,i,{configurable:!0,enumerable:!0,writable:!0,value:a}):t[i]=a,delete n[i];return t}function Vx(e){var t;t=e.input.charCodeAt(e.position),t===10?e.position++:t===13?(e.position++,e.input.charCodeAt(e.position)===10&&e.position++):Qe(e,"a line break is expected"),e.line+=1,e.lineStart=e.position,e.firstTabInLine=-1}function Wn(e,t,n){for(var r=0,i=e.input.charCodeAt(e.position);i!==0;){for(;Ud(i);)i===9&&e.firstTabInLine===-1&&(e.firstTabInLine=e.position),i=e.input.charCodeAt(++e.position);if(t&&i===35)do i=e.input.charCodeAt(++e.position);while(i!==10&&i!==13&&i!==0);if(Ws(i))for(Vx(e),i=e.input.charCodeAt(e.position),r++,e.lineIndent=0;i===32;)e.lineIndent++,i=e.input.charCodeAt(++e.position);else break}return n!==-1&&r!==0&&e.lineIndent<n&&lU(e,"deficient indentation"),r}function A6(e){var t=e.position,n;return n=e.input.charCodeAt(t),!!((n===45||n===46)&&n===e.input.charCodeAt(t+1)&&n===e.input.charCodeAt(t+2)&&(t+=3,n=e.input.charCodeAt(t),n===0||mi(n)))}function Yx(e,t){t===1?e.result+=" ":t>1&&(e.result+=Xr.repeat(`
333
- `,t-1))}function Qve(e,t,n){var r,i,a,s,o,c,d,l,h=e.kind,f=e.result,g;if(g=e.input.charCodeAt(e.position),mi(g)||Xu(g)||g===35||g===38||g===42||g===33||g===124||g===62||g===39||g===34||g===37||g===64||g===96||(g===63||g===45)&&(i=e.input.charCodeAt(e.position+1),mi(i)||n&&Xu(i)))return!1;for(e.kind="scalar",e.result="",a=s=e.position,o=!1;g!==0;){if(g===58){if(i=e.input.charCodeAt(e.position+1),mi(i)||n&&Xu(i))break}else if(g===35){if(r=e.input.charCodeAt(e.position-1),mi(r))break}else{if(e.position===e.lineStart&&A6(e)||n&&Xu(g))break;if(Ws(g))if(c=e.line,d=e.lineStart,l=e.lineIndent,Wn(e,!1,-1),e.lineIndent>=t){o=!0,g=e.input.charCodeAt(e.position);continue}else{e.position=s,e.line=c,e.lineStart=d,e.lineIndent=l;break}}o&&(dc(e,a,s,!1),Yx(e,e.line-c),a=s=e.position,o=!1),Ud(g)||(s=e.position+1),g=e.input.charCodeAt(++e.position)}return dc(e,a,s,!1),e.result?!0:(e.kind=h,e.result=f,!1)}function Jve(e,t){var n,r,i;if(n=e.input.charCodeAt(e.position),n!==39)return!1;for(e.kind="scalar",e.result="",e.position++,r=i=e.position;(n=e.input.charCodeAt(e.position))!==0;)if(n===39)if(dc(e,r,e.position,!0),n=e.input.charCodeAt(++e.position),n===39)r=e.position,e.position++,i=e.position;else return!0;else Ws(n)?(dc(e,r,i,!0),Yx(e,Wn(e,!1,t)),r=i=e.position):e.position===e.lineStart&&A6(e)?Qe(e,"unexpected end of the document within a single quoted scalar"):(e.position++,i=e.position);Qe(e,"unexpected end of the stream within a single quoted scalar")}function e7e(e,t){var n,r,i,a,s,o;if(o=e.input.charCodeAt(e.position),o!==34)return!1;for(e.kind="scalar",e.result="",e.position++,n=r=e.position;(o=e.input.charCodeAt(e.position))!==0;){if(o===34)return dc(e,n,e.position,!0),e.position++,!0;if(o===92){if(dc(e,n,e.position,!0),o=e.input.charCodeAt(++e.position),Ws(o))Wn(e,!1,t);else if(o<256&&qF[o])e.result+=ZF[o],e.position++;else if((s=Gve(o))>0){for(i=s,a=0;i>0;i--)o=e.input.charCodeAt(++e.position),(s=Yve(o))>=0?a=(a<<4)+s:Qe(e,"expected hexadecimal character");e.result+=Zve(a),e.position++}else Qe(e,"unknown escape sequence");n=r=e.position}else Ws(o)?(dc(e,n,r,!0),Yx(e,Wn(e,!1,t)),n=r=e.position):e.position===e.lineStart&&A6(e)?Qe(e,"unexpected end of the document within a double quoted scalar"):(e.position++,r=e.position)}Qe(e,"unexpected end of the stream within a double quoted scalar")}function t7e(e,t){var n=!0,r,i,a,s=e.tag,o,c=e.anchor,d,l,h,f,g,U=Object.create(null),y,v,x,w;if(w=e.input.charCodeAt(e.position),w===91)l=93,g=!1,o=[];else if(w===123)l=125,g=!0,o={};else return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=o),w=e.input.charCodeAt(++e.position);w!==0;){if(Wn(e,!0,t),w=e.input.charCodeAt(e.position),w===l)return e.position++,e.tag=s,e.anchor=c,e.kind=g?"mapping":"sequence",e.result=o,!0;n?w===44&&Qe(e,"expected the node content, but found ','"):Qe(e,"missed comma between flow collection entries"),v=y=x=null,h=f=!1,w===63&&(d=e.input.charCodeAt(e.position+1),mi(d)&&(h=f=!0,e.position++,Wn(e,!0,t))),r=e.line,i=e.lineStart,a=e.position,jh(e,t,sU,!1,!0),v=e.tag,y=e.result,Wn(e,!0,t),w=e.input.charCodeAt(e.position),(f||e.line===r)&&w===58&&(h=!0,w=e.input.charCodeAt(++e.position),Wn(e,!0,t),jh(e,t,sU,!1,!0),x=e.result),g?Vu(e,o,U,v,y,x,r,i,a):h?o.push(Vu(e,null,U,v,y,x,r,i,a)):o.push(y),Wn(e,!0,t),w=e.input.charCodeAt(e.position),w===44?(n=!0,w=e.input.charCodeAt(++e.position)):n=!1}Qe(e,"unexpected end of the stream within a flow collection")}function n7e(e,t){var n,r,i=r3,a=!1,s=!1,o=t,c=0,d=!1,l,h;if(h=e.input.charCodeAt(e.position),h===124)r=!1;else if(h===62)r=!0;else return!1;for(e.kind="scalar",e.result="";h!==0;)if(h=e.input.charCodeAt(++e.position),h===43||h===45)r3===i?i=h===43?zT:Hve:Qe(e,"repeat of a chomping mode identifier");else if((l=qve(h))>=0)l===0?Qe(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):s?Qe(e,"repeat of an indentation width identifier"):(o=t+l-1,s=!0);else break;if(Ud(h)){do h=e.input.charCodeAt(++e.position);while(Ud(h));if(h===35)do h=e.input.charCodeAt(++e.position);while(!Ws(h)&&h!==0)}for(;h!==0;){for(Vx(e),e.lineIndent=0,h=e.input.charCodeAt(e.position);(!s||e.lineIndent<o)&&h===32;)e.lineIndent++,h=e.input.charCodeAt(++e.position);if(!s&&e.lineIndent>o&&(o=e.lineIndent),Ws(h)){c++;continue}if(e.lineIndent<o){i===zT?e.result+=Xr.repeat(`
334
- `,a?1+c:c):i===r3&&a&&(e.result+=`
335
- `);break}for(r?Ud(h)?(d=!0,e.result+=Xr.repeat(`
336
- `,a?1+c:c)):d?(d=!1,e.result+=Xr.repeat(`
337
- `,c+1)):c===0?a&&(e.result+=" "):e.result+=Xr.repeat(`
338
- `,c):e.result+=Xr.repeat(`
339
- `,a?1+c:c),a=!0,s=!0,c=0,n=e.position;!Ws(h)&&h!==0;)h=e.input.charCodeAt(++e.position);dc(e,n,e.position,!1)}return!0}function YT(e,t){var n,r=e.tag,i=e.anchor,a=[],s,o=!1,c;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=a),c=e.input.charCodeAt(e.position);c!==0&&(e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,Qe(e,"tab characters must not be used in indentation")),!(c!==45||(s=e.input.charCodeAt(e.position+1),!mi(s))));){if(o=!0,e.position++,Wn(e,!0,-1)&&e.lineIndent<=t){a.push(null),c=e.input.charCodeAt(e.position);continue}if(n=e.line,jh(e,t,VF,!1,!0),a.push(e.result),Wn(e,!0,-1),c=e.input.charCodeAt(e.position),(e.line===n||e.lineIndent>t)&&c!==0)Qe(e,"bad indentation of a sequence entry");else if(e.lineIndent<t)break}return o?(e.tag=r,e.anchor=i,e.kind="sequence",e.result=a,!0):!1}function r7e(e,t,n){var r,i,a,s,o,c,d=e.tag,l=e.anchor,h={},f=Object.create(null),g=null,U=null,y=null,v=!1,x=!1,w;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=h),w=e.input.charCodeAt(e.position);w!==0;){if(!v&&e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,Qe(e,"tab characters must not be used in indentation")),r=e.input.charCodeAt(e.position+1),a=e.line,(w===63||w===58)&&mi(r))w===63?(v&&(Vu(e,h,f,g,U,null,s,o,c),g=U=y=null),x=!0,v=!0,i=!0):v?(v=!1,i=!0):Qe(e,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),e.position+=1,w=r;else{if(s=e.line,o=e.lineStart,c=e.position,!jh(e,n,XF,!1,!0))break;if(e.line===a){for(w=e.input.charCodeAt(e.position);Ud(w);)w=e.input.charCodeAt(++e.position);if(w===58)w=e.input.charCodeAt(++e.position),mi(w)||Qe(e,"a whitespace character is expected after the key-value separator within a block mapping"),v&&(Vu(e,h,f,g,U,null,s,o,c),g=U=y=null),x=!0,v=!1,i=!1,g=e.tag,U=e.result;else if(x)Qe(e,"can not read an implicit mapping pair; a colon is missed");else return e.tag=d,e.anchor=l,!0}else if(x)Qe(e,"can not read a block mapping entry; a multiline key may not be an implicit key");else return e.tag=d,e.anchor=l,!0}if((e.line===a||e.lineIndent>t)&&(v&&(s=e.line,o=e.lineStart,c=e.position),jh(e,t,oU,!0,i)&&(v?U=e.result:y=e.result),v||(Vu(e,h,f,g,U,y,s,o,c),g=U=y=null),Wn(e,!0,-1),w=e.input.charCodeAt(e.position)),(e.line===a||e.lineIndent>t)&&w!==0)Qe(e,"bad indentation of a mapping entry");else if(e.lineIndent<t)break}return v&&Vu(e,h,f,g,U,null,s,o,c),x&&(e.tag=d,e.anchor=l,e.kind="mapping",e.result=h),x}function i7e(e){var t,n=!1,r=!1,i,a,s;if(s=e.input.charCodeAt(e.position),s!==33)return!1;if(e.tag!==null&&Qe(e,"duplication of a tag property"),s=e.input.charCodeAt(++e.position),s===60?(n=!0,s=e.input.charCodeAt(++e.position)):s===33?(r=!0,i="!!",s=e.input.charCodeAt(++e.position)):i="!",t=e.position,n){do s=e.input.charCodeAt(++e.position);while(s!==0&&s!==62);e.position<e.length?(a=e.input.slice(t,e.position),s=e.input.charCodeAt(++e.position)):Qe(e,"unexpected end of the stream within a verbatim tag")}else{for(;s!==0&&!mi(s);)s===33&&(r?Qe(e,"tag suffix cannot contain exclamation marks"):(i=e.input.slice(t-1,e.position+1),YF.test(i)||Qe(e,"named tag handle cannot contain such characters"),r=!0,t=e.position+1)),s=e.input.charCodeAt(++e.position);a=e.input.slice(t,e.position),Vve.test(a)&&Qe(e,"tag suffix cannot contain flow indicator characters")}a&&!GF.test(a)&&Qe(e,"tag name cannot contain such characters: "+a);try{a=decodeURIComponent(a)}catch{Qe(e,"tag name is malformed: "+a)}return n?e.tag=a:yc.call(e.tagMap,i)?e.tag=e.tagMap[i]+a:i==="!"?e.tag="!"+a:i==="!!"?e.tag="tag:yaml.org,2002:"+a:Qe(e,'undeclared tag handle "'+i+'"'),!0}function a7e(e){var t,n;if(n=e.input.charCodeAt(e.position),n!==38)return!1;for(e.anchor!==null&&Qe(e,"duplication of an anchor property"),n=e.input.charCodeAt(++e.position),t=e.position;n!==0&&!mi(n)&&!Xu(n);)n=e.input.charCodeAt(++e.position);return e.position===t&&Qe(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(t,e.position),!0}function s7e(e){var t,n,r;if(r=e.input.charCodeAt(e.position),r!==42)return!1;for(r=e.input.charCodeAt(++e.position),t=e.position;r!==0&&!mi(r)&&!Xu(r);)r=e.input.charCodeAt(++e.position);return e.position===t&&Qe(e,"name of an alias node must contain at least one character"),n=e.input.slice(t,e.position),yc.call(e.anchorMap,n)||Qe(e,'unidentified alias "'+n+'"'),e.result=e.anchorMap[n],Wn(e,!0,-1),!0}function jh(e,t,n,r,i){var a,s,o,c=1,d=!1,l=!1,h,f,g,U,y,v;if(e.listener!==null&&e.listener("open",e),e.tag=null,e.anchor=null,e.kind=null,e.result=null,a=s=o=oU===n||VF===n,r&&Wn(e,!0,-1)&&(d=!0,e.lineIndent>t?c=1:e.lineIndent===t?c=0:e.lineIndent<t&&(c=-1)),c===1)for(;i7e(e)||a7e(e);)Wn(e,!0,-1)?(d=!0,o=a,e.lineIndent>t?c=1:e.lineIndent===t?c=0:e.lineIndent<t&&(c=-1)):o=!1;if(o&&(o=d||i),(c===1||oU===n)&&(sU===n||XF===n?y=t:y=t+1,v=e.position-e.lineStart,c===1?o&&(YT(e,v)||r7e(e,v,y))||t7e(e,y)?l=!0:(s&&n7e(e,y)||Jve(e,y)||e7e(e,y)?l=!0:s7e(e)?(l=!0,(e.tag!==null||e.anchor!==null)&&Qe(e,"alias node should not have any properties")):Qve(e,y,sU===n)&&(l=!0,e.tag===null&&(e.tag="?")),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):c===0&&(l=o&&YT(e,v))),e.tag===null)e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);else if(e.tag==="?"){for(e.result!==null&&e.kind!=="scalar"&&Qe(e,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+e.kind+'"'),h=0,f=e.implicitTypes.length;h<f;h+=1)if(U=e.implicitTypes[h],U.resolve(e.result)){e.result=U.construct(e.result),e.tag=U.tag,e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);break}}else if(e.tag!=="!"){if(yc.call(e.typeMap[e.kind||"fallback"],e.tag))U=e.typeMap[e.kind||"fallback"][e.tag];else for(U=null,g=e.typeMap.multi[e.kind||"fallback"],h=0,f=g.length;h<f;h+=1)if(e.tag.slice(0,g[h].tag.length)===g[h].tag){U=g[h];break}U||Qe(e,"unknown tag !<"+e.tag+">"),e.result!==null&&U.kind!==e.kind&&Qe(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+U.kind+'", not "'+e.kind+'"'),U.resolve(e.result,e.tag)?(e.result=U.construct(e.result,e.tag),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):Qe(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")}return e.listener!==null&&e.listener("close",e),e.tag!==null||e.anchor!==null||l}function o7e(e){var t=e.position,n,r,i,a=!1,s;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap=Object.create(null),e.anchorMap=Object.create(null);(s=e.input.charCodeAt(e.position))!==0&&(Wn(e,!0,-1),s=e.input.charCodeAt(e.position),!(e.lineIndent>0||s!==37));){for(a=!0,s=e.input.charCodeAt(++e.position),n=e.position;s!==0&&!mi(s);)s=e.input.charCodeAt(++e.position);for(r=e.input.slice(n,e.position),i=[],r.length<1&&Qe(e,"directive name must not be less than one character in length");s!==0;){for(;Ud(s);)s=e.input.charCodeAt(++e.position);if(s===35){do s=e.input.charCodeAt(++e.position);while(s!==0&&!Ws(s));break}if(Ws(s))break;for(n=e.position;s!==0&&!mi(s);)s=e.input.charCodeAt(++e.position);i.push(e.input.slice(n,e.position))}s!==0&&Vx(e),yc.call(XT,r)?XT[r](e,r,i):lU(e,'unknown document directive "'+r+'"')}if(Wn(e,!0,-1),e.lineIndent===0&&e.input.charCodeAt(e.position)===45&&e.input.charCodeAt(e.position+1)===45&&e.input.charCodeAt(e.position+2)===45?(e.position+=3,Wn(e,!0,-1)):a&&Qe(e,"directives end mark is expected"),jh(e,e.lineIndent-1,oU,!1,!0),Wn(e,!0,-1),e.checkLineBreaks&&Xve.test(e.input.slice(t,e.position))&&lU(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&A6(e)){e.input.charCodeAt(e.position)===46&&(e.position+=3,Wn(e,!0,-1));return}if(e.position<e.length-1)Qe(e,"end of the stream or a document separator is expected");else return}function l7e(e,t){e=String(e),t=t||{},e.length!==0&&(e.charCodeAt(e.length-1)!==10&&e.charCodeAt(e.length-1)!==13&&(e+=`
340
- `),e.charCodeAt(0)===65279&&(e=e.slice(1)));var n=new Kve(e,t),r=e.indexOf("\0");for(r!==-1&&(n.position=r,Qe(n,"null byte is not allowed in input")),n.input+="\0";n.input.charCodeAt(n.position)===32;)n.lineIndent+=1,n.position+=1;for(;n.position<n.length-1;)o7e(n);return n.documents}function c7e(e,t){var n=l7e(e,t);if(n.length!==0){if(n.length===1)return n[0];throw new Fo("expected a single document in the stream, but found more")}}var d7e=c7e,u7e={load:d7e},h7e=zF,f7e=u7e.load;function p7e(e){const t=e.match(nF);if(!t)return{text:e,metadata:{}};let n=f7e(t[1],{schema:h7e})??{};n=typeof n=="object"&&!Array.isArray(n)?n:{};const r={};return n.displayMode&&(r.displayMode=n.displayMode.toString()),n.title&&(r.title=n.title.toString()),n.config&&(r.config=n.config),{text:e.slice(t[0].length),metadata:r}}const m7e=e=>e.replace(/\r\n?/g,`
341
- `).replace(/<(\w+)([^>]*)>/g,(t,n,r)=>"<"+n+r.replace(/="([^"]*)"/g,"='$1'")+">"),g7e=e=>{const{text:t,metadata:n}=p7e(e),{displayMode:r,title:i,config:a={}}=n;return r&&(a.gantt||(a.gantt={}),a.gantt.displayMode=r),{title:i,config:a,text:t}},U7e=e=>{const t=Vp.detectInit(e)??{},n=Vp.detectDirective(e,"wrap");return Array.isArray(n)?t.wrap=n.some(({type:r})=>{}):(n==null?void 0:n.type)==="wrap"&&(t.wrap=!0),{text:zbe(e),directive:t}};function QF(e){const t=m7e(e),n=g7e(t),r=U7e(n.text),i=cF(n.config,r.directive);return e=S8e(r.text),{code:e,title:n.title,config:i}}const b7e=5e4,y7e="graph TB;a[Maximum text size in diagram exceeded];style a fill:#faa",v7e="sandbox",x7e="loose",w7e="http://www.w3.org/2000/svg",E7e="http://www.w3.org/1999/xlink",C7e="http://www.w3.org/1999/xhtml",S7e="100%",_7e="100%",k7e="border:0;margin:0;",T7e="margin:0",M7e="allow-top-navigation-by-user-activation allow-popups",I7e='The "iframe" tag is not supported by your browser.',A7e=["foreignobject"],L7e=["dominant-baseline"];function JF(e){const t=QF(e);return rU(),pye(t.config??{}),t}async function R7e(e,t){Wx(),e=JF(e).code;try{await Gx(e)}catch(n){if(t!=null&&t.suppressErrors)return!1;throw n}return!0}const GT=(e,t,n=[])=>`
342
- .${e} ${t} { ${n.join(" !important; ")} !important; }`,D7e=(e,t={})=>{var n;let r="";if(e.themeCSS!==void 0&&(r+=`
343
- ${e.themeCSS}`),e.fontFamily!==void 0&&(r+=`
344
- :root { --mermaid-font-family: ${e.fontFamily}}`),e.altFontFamily!==void 0&&(r+=`
345
- :root { --mermaid-alt-font-family: ${e.altFontFamily}}`),!e3(t)){const o=e.htmlLabels||((n=e.flowchart)==null?void 0:n.htmlLabels)?["> *","span"]:["rect","polygon","ellipse","circle","path"];for(const c in t){const d=t[c];e3(d.styles)||o.forEach(l=>{r+=GT(d.id,l,d.styles)}),e3(d.textStyles)||(r+=GT(d.id,"tspan",d.textStyles))}}return r},j7e=(e,t,n,r)=>{const i=D7e(e,n),a=D3e(t,i,e.themeVariables);return W8(V5e(`${r}{${a}}`),G5e)},P7e=(e="",t,n)=>{let r=e;return!n&&!t&&(r=r.replace(/marker-end="url\([\d+./:=?A-Za-z-]*?#/g,'marker-end="url(#')),r=dye(r),r=r.replace(/<br>/g,"<br/>"),r},N7e=(e="",t)=>{var n,r;const i=(r=(n=t==null?void 0:t.viewBox)==null?void 0:n.baseVal)!=null&&r.height?t.viewBox.baseVal.height+"px":_7e,a=btoa('<body style="'+T7e+'">'+e+"</body>");return`<iframe style="width:${S7e};height:${i};${k7e}" src="data:text/html;base64,${a}" sandbox="${M7e}">
346
- ${I7e}
347
- </iframe>`},qT=(e,t,n,r,i)=>{const a=e.append("div");a.attr("id",n),r&&a.attr("style",r);const s=a.append("svg").attr("id",t).attr("width","100%").attr("xmlns",w7e);return i&&s.attr("xmlns:xlink",i),s.append("g"),e};function ZT(e,t){return e.append("iframe").attr("id",t).attr("style","width: 100%; height: 100%;").attr("sandbox","")}const O7e=(e,t,n,r)=>{var i,a,s;(i=e.getElementById(t))==null||i.remove(),(a=e.getElementById(n))==null||a.remove(),(s=e.getElementById(r))==null||s.remove()},F7e=async function(e,t,n){var r,i,a,s,o,c;Wx();const d=JF(t);t=d.code;const l=eo();et.debug(l),t.length>((l==null?void 0:l.maxTextSize)??b7e)&&(t=y7e);const h="#"+e,f="i"+e,g="#"+f,U="d"+e,y="#"+U;let v=ia("body");const x=l.securityLevel===v7e,w=l.securityLevel===x7e,C=l.fontFamily;if(n!==void 0){if(n&&(n.innerHTML=""),x){const Y=ZT(ia(n),f);v=ia(Y.nodes()[0].contentDocument.body),v.node().style.margin=0}else v=ia(n);qT(v,e,U,`font-family: ${C}`,E7e)}else{if(O7e(document,e,U,f),x){const Y=ZT(ia("body"),f);v=ia(Y.nodes()[0].contentDocument.body),v.node().style.margin=0}else v=ia("body");qT(v,e,U)}let S,k;try{S=await Gx(t,{title:d.title})}catch(Y){S=new FF("error"),k=Y}const M=v.select(y).node(),T=S.type,R=M.firstChild,j=R.firstChild,P=(i=(r=S.renderer).getClasses)==null?void 0:i.call(r,t,S),N=j7e(l,T,P,h),F=document.createElement("style");F.innerHTML=N,R.insertBefore(F,j);try{await S.renderer.draw(t,e,NT,S)}catch(Y){throw K3e.draw(t,e,NT),Y}const $=v.select(`${y} svg`),q=(s=(a=S.db).getAccTitle)==null?void 0:s.call(a),W=(c=(o=S.db).getAccDescription)==null?void 0:c.call(o);B7e(T,$,q,W),v.select(`[id="${e}"]`).selectAll("foreignobject > *").attr("xmlns",C7e);let V=v.select(y).node().innerHTML;if(et.debug("config.arrowMarkerAbsolute",l.arrowMarkerAbsolute),V=P7e(V,x,JO(l.arrowMarkerAbsolute)),x){const Y=v.select(y+" svg").node();V=N7e(V,Y)}else w||(V=Th.sanitize(V,{ADD_TAGS:A7e,ADD_ATTR:L7e}));if(x8e(),k)throw k;const z=ia(x?g:y).node();return z&&"remove"in z&&z.remove(),{svg:V,bindFunctions:S.db.bindFunctions}};function $7e(e={}){var t;e!=null&&e.fontFamily&&!((t=e.themeVariables)!=null&&t.fontFamily)&&(e.themeVariables||(e.themeVariables={}),e.themeVariables.fontFamily=e.fontFamily),hye(e),e!=null&&e.theme&&e.theme in Vo?e.themeVariables=Vo[e.theme].getThemeVariables(e.themeVariables):e&&(e.themeVariables=Vo.default.getThemeVariables(e.themeVariables));const n=typeof e=="object"?uye(e):uF();Rx(n.logLevel),Wx()}const Gx=(e,t={})=>{const{code:n}=QF(e);return v8e(n,t)};function B7e(e,t,n,r){E8e(t,e),C8e(t,n,r,t.attr("id"))}const Od=Object.freeze({render:F7e,parse:R7e,getDiagramFromText:Gx,initialize:$7e,getConfig:eo,setConfig:hF,getSiteConfig:uF,updateSiteConfig:fye,reset:()=>{rU()},globalReset:()=>{rU(Rh)},defaultConfig:Rh});Rx(eo().logLevel);rU(eo());const z7e=async()=>{et.debug("Loading registered diagrams");const t=(await Promise.allSettled(Object.entries(Lh).map(async([n,{detector:r,loader:i}])=>{if(i)try{Hx(n)}catch{try{const{diagram:s,id:o}=await i();aU(o,s,r)}catch(s){throw et.error(`Failed to load external diagram with key ${n}. Removing from detectors.`),delete Lh[n],s}}}))).filter(n=>n.status==="rejected");if(t.length>0){et.error(`Failed to load ${t.length} external diagrams`);for(const n of t)et.error(n);throw new Error(`Failed to load ${t.length} external diagrams`)}},H7e=(e,t,n)=>{et.warn(e),lF(e)?(n&&n(e.str,e.hash),t.push({...e,message:e.str,error:e})):(n&&n(e),e instanceof Error&&t.push({str:e.message,message:e.message,hash:e.name,error:e}))},e$=async function(e={querySelector:".mermaid"}){try{await W7e(e)}catch(t){if(lF(t)&&et.error(t.str),Ni.parseError&&Ni.parseError(t),!e.suppressErrors)throw et.error("Use the suppressErrors option to suppress these errors"),t}},W7e=async function({postRenderCallback:e,querySelector:t,nodes:n}={querySelector:".mermaid"}){const r=Od.getConfig();et.debug(`${e?"":"No "}Callback function found`);let i;if(n)i=n;else if(t)i=document.querySelectorAll(t);else throw new Error("Nodes and querySelector are both undefined");et.debug(`Found ${i.length} diagrams`),(r==null?void 0:r.startOnLoad)!==void 0&&(et.debug("Start On Load: "+(r==null?void 0:r.startOnLoad)),Od.updateSiteConfig({startOnLoad:r==null?void 0:r.startOnLoad}));const a=new Vp.InitIDGenerator(r.deterministicIds,r.deterministicIDSeed);let s;const o=[];for(const c of Array.from(i)){et.info("Rendering diagram: "+c.id);/*! Check if previously processed */if(c.getAttribute("data-processed"))continue;c.setAttribute("data-processed","true");const d=`mermaid-${a.next()}`;s=c.innerHTML,s=Y1e(Vp.entityDecode(s)).trim().replace(/<br\s*\/?>/gi,"<br/>");const l=Vp.detectInit(s);l&&et.debug("Detected early reinit: ",l);try{const{svg:h,bindFunctions:f}=await i$(d,s,c);c.innerHTML=h,e&&await e(d),f&&f(c)}catch(h){H7e(h,o,Ni.parseError)}}if(o.length>0)throw o[0]},t$=function(e){Od.initialize(e)},X7e=async function(e,t,n){et.warn("mermaid.init is deprecated. Please use run instead."),e&&t$(e);const r={postRenderCallback:n,querySelector:".mermaid"};typeof t=="string"?r.querySelector=t:t&&(t instanceof HTMLElement?r.nodes=[t]:r.nodes=t),await e$(r)},V7e=async(e,{lazyLoad:t=!0}={})=>{iF(...e),t===!1&&await z7e()},n$=function(){if(Ni.startOnLoad){const{startOnLoad:e}=Od.getConfig();e&&Ni.run().catch(t=>et.error("Mermaid failed to initialize",t))}};if(typeof document<"u"){/*!
348
- * Wait for document loaded before starting the execution
349
- */window.addEventListener("load",n$,!1)}const Y7e=function(e){Ni.parseError=e},cU=[];let i3=!1;const r$=async()=>{if(!i3){for(i3=!0;cU.length>0;){const e=cU.shift();if(e)try{await e()}catch(t){et.error("Error executing queue",t)}}i3=!1}},G7e=async(e,t)=>new Promise((n,r)=>{const i=()=>new Promise((a,s)=>{Od.parse(e,t).then(o=>{a(o),n(o)},o=>{var c;et.error("Error parsing",o),(c=Ni.parseError)==null||c.call(Ni,o),s(o),r(o)})});cU.push(i),r$().catch(r)}),i$=(e,t,n)=>new Promise((r,i)=>{const a=()=>new Promise((s,o)=>{Od.render(e,t,n).then(c=>{s(c),r(c)},c=>{var d;et.error("Error parsing",c),(d=Ni.parseError)==null||d.call(Ni,c),o(c),i(c)})});cU.push(a),r$().catch(i)}),Ni={startOnLoad:!0,mermaidAPI:Od,parse:G7e,render:i$,init:X7e,run:e$,registerExternalDiagrams:V7e,initialize:t$,parseError:void 0,contentLoaded:n$,setParseErrorHandler:Y7e,detectType:M6},qh=e=>{e=Z7e(e);const t=e.replace(/#(\d+);/g,"&#$1;").replace(/#([a-z]+);/g,"&$1;"),n=document.createElement("textarea");return n.innerHTML=t,n.value},ah=e=>{const t=e.getAttribute("transform"),n=t==null?void 0:t.match(/translate\(([ \d.-]+),\s*([\d.-]+)\)/);let r=0,i=0;return n&&(r=Number(n[1]),i=Number(n[2])),{transformX:r,transformY:i}},q7e=e=>{let t=e;return t=t.replace(/style.*:\S*#.*;/g,n=>n.substring(0,n.length-1)),t=t.replace(/classDef.*:\S*#.*;/g,n=>n.substring(0,n.length-1)),t=t.replace(/#\w+;/g,n=>{const r=n.substring(1,n.length-1);return/^\+?\d+$/.test(r)?`fl°°${r}¶ß`:`fl°${r}¶ß`}),t},Z7e=function(e){return e.replace(/fl°°/g,"#").replace(/fl°/g,"&").replace(/¶ß/g,";")},a$=(e,t={x:0,y:0})=>{if(e.tagName.toLowerCase()!=="path")throw new Error(`Invalid input: Expected an HTMLElement of tag "path", got ${e.tagName}`);const n=e.getAttribute("d");if(!n)throw new Error('Path element does not contain a "d" attribute');const r=n.split(/(?=[LM])/),i=r[0].substring(1).split(",").map(o=>parseFloat(o)),a=r[r.length-1].substring(1).split(",").map(o=>parseFloat(o)),s=r.map(o=>{const c=o.substring(1).split(",").map(d=>parseFloat(d));return{x:c[0],y:c[1]}}).filter((o,c,d)=>{if(c===0||c===d.length-1)return!0;if(o.x===d[c-1].x&&o.y===d[c-1].y)return!1;if(c===d.length-2&&(d[c-1].x===o.x||d[c-1].y===o.y)){const l=d[d.length-1];return Math.hypot(l.x-o.x,l.y-o.y)>20}return o.x!==d[c-1].x||o.y!==d[c-1].y}).map(o=>({x:o.x+t.x,y:o.y+t.y}));return{startX:i[0]+t.x,startY:i[1]+t.y,endX:a[0]+t.x,endY:a[1]+t.y,reflectionPoints:s}},K7e=(e,t)=>{const n=e.nodes.map(o=>o.startsWith("flowchart-")?o.split("-")[1]:o),r=t.querySelector(`[id='${e.id}']`);if(!r)throw new Error("SubGraph element not found");const i=qx(r,t),a=r.getBBox(),s={width:a.width,height:a.height};return e.classes=void 0,e.dir=void 0,{...e,nodeIds:n,...i,...s,text:qh(e.title)}},Q7e=(e,t,n)=>{var f,g,U,y,v;const r=t.querySelector(`[id*="flowchart-${e.id}-"]`);if(!r)return;let i;((f=r.parentElement)==null?void 0:f.tagName.toLowerCase())==="a"&&(i=r.parentElement.getAttribute("xlink:href"));const a=qx(i?r.parentElement:r,t),s=r.getBBox(),o={width:s.width,height:s.height},c=(g=r.querySelector(".label-container"))==null?void 0:g.getAttribute("style"),d=(U=r.querySelector(".label"))==null?void 0:U.getAttribute("style"),l={};c==null||c.split(";").forEach(x=>{if(!x)return;const w=x.split(":")[0].trim(),C=x.split(":")[1].trim();l[w]=C});const h={};if(d==null||d.split(";").forEach(x=>{if(!x)return;const w=x.split(":")[0].trim(),C=x.split(":")[1].trim();h[w]=C}),e.classes){const x=n[e.classes];x&&((y=x.styles)==null||y.forEach(w=>{const[C,S]=w.split(":");l[C.trim()]=S.trim()}),(v=x.textStyles)==null||v.forEach(w=>{const[C,S]=w.split(":");h[C.trim()]=S.trim()}))}return{id:e.id,labelType:e.labelType,text:qh(e.text),type:e.type,link:i||void 0,...a,...o,containerStyle:l,labelStyle:h}},J7e=(e,t,n)=>{const r=n.querySelector(`[id*="L-${e.start}-${e.end}-${t}"]`);if(!r)throw new Error("Edge element not found");const i=qx(r,n),a=a$(r,i);return e.length=void 0,{...e,...a,text:qh(e.text)}},qx=(e,t)=>{var c;if(!e)throw new Error("Element not found");let n=(c=e.parentElement)==null?void 0:c.parentElement;const r=e.childNodes[0];let i={x:0,y:0};if(r){const{transformX:d,transformY:l}=ah(r),h=r.getBBox();i={x:Number(r.getAttribute("x"))||d+h.x||0,y:Number(r.getAttribute("y"))||l+h.y||0}}const{transformX:a,transformY:s}=ah(e),o={x:a+i.x,y:s+i.y};for(;n&&n.id!==t.id;){if(n.classList.value==="root"&&n.hasAttribute("transform")){const{transformX:d,transformY:l}=ah(n);o.x+=d,o.y+=l}n=n.parentElement}return o},exe=(e,t)=>{e.parse();const n=e.parser.yy,r=n.getVertices(),i=n.getClasses();Object.keys(r).forEach(c=>{r[c]=Q7e(r[c],t,i)});const a=new Map,s=n.getEdges().filter(c=>t.querySelector(`[id*="L-${c.start}-${c.end}"]`)).map(c=>{const d=`${c.start}-${c.end}`,l=a.get(d)||0;return a.set(d,l+1),J7e(c,l,t)});return{type:"flowchart",subGraphs:n.getSubGraphs().map(c=>K7e(c,t)),vertices:r,edges:s}},txe=(e,t)=>{const n={};t!=null&&t.label&&(n.label={text:qh(t.label),fontSize:16});const r=e.tagName;if(r==="line")n.startX=Number(e.getAttribute("x1")),n.startY=Number(e.getAttribute("y1")),n.endX=Number(e.getAttribute("x2")),n.endY=Number(e.getAttribute("y2"));else if(r==="path"){const i=e.getAttribute("d");if(!i)throw new Error('Path element does not contain a "d" attribute');const a=i.split(/(?=[LC])/),s=a[0].substring(1).split(",").map(d=>parseFloat(d)),o=[];a.forEach(d=>{const l=d.substring(1).trim().split(" ").map(h=>{const[f,g]=h.split(",");return[parseFloat(f)-s[0],parseFloat(g)-s[1]]});o.push(...l)});const c=o[o.length-1];n.startX=s[0],n.startY=s[1],n.endX=c[0],n.endY=c[1],n.points=o}return t!=null&&t.label&&(n.startY=n.startY-10,n.endY=n.endY-10),n.strokeColor=e.getAttribute("stroke"),n.strokeWidth=Number(e.getAttribute("stroke-width")),n.type="arrow",n.strokeStyle=(t==null?void 0:t.strokeStyle)||"solid",n.startArrowhead=(t==null?void 0:t.startArrowhead)||null,n.endArrowhead=(t==null?void 0:t.endArrowhead)||null,n},s$=(e,t,n,r,i)=>{const a={};return a.type="arrow",a.startX=e,a.startY=t,a.endX=n,a.endY=r,Object.assign(a,{...i}),a},J8=(e,t,n,r)=>({type:"text",x:e,y:t,text:n,width:(r==null?void 0:r.width)||20,height:(r==null?void 0:r.height)||20,fontSize:(r==null?void 0:r.fontSize)||h6,id:r==null?void 0:r.id,groupId:r==null?void 0:r.groupId,metadata:r==null?void 0:r.metadata}),o$=(e,t,n)=>{const r={},i=Number(e.getAttribute("x")),a=Number(e.getAttribute("y"));r.type="text",r.text=qh(t),n!=null&&n.id&&(r.id=n.id),n!=null&&n.groupId&&(r.groupId=n.groupId);const s=e.getBBox();r.width=s.width,r.height=s.height,r.x=i-s.width/2,r.y=a;const o=parseInt(getComputedStyle(e).fontSize);return r.fontSize=o,r},to=(e,t,n={})=>{const r={};r.type=t;const{label:i,subtype:a,id:s,groupId:o}=n;r.id=s,o&&(r.groupId=o),i&&(r.label={text:qh(i.text),fontSize:16,verticalAlign:i==null?void 0:i.verticalAlign});const c=e.getBBox();switch(r.x=c.x,r.y=c.y,r.width=c.width,r.height=c.height,r.subtype=a,a){case"highlight":const d=e.getAttribute("fill");d&&(r.bgColor=d);break;case"note":r.strokeStyle="dashed";break}return r},j1=(e,t,n,r,i,a)=>{const s={};return s.startX=t,s.startY=n,s.endX=r,a!=null&&a.groupId&&(s.groupId=a.groupId),a!=null&&a.id&&(s.id=a.id),s.endY=i,s.strokeColor=e.getAttribute("stroke"),s.strokeWidth=Number(e.getAttribute("stroke-width")),s.type="line",s},KT={0:"SOLID",1:"DOTTED",3:"SOLID_CROSS",4:"DOTTED_CROSS",5:"SOLID_OPEN",6:"DOTTED_OPEN",24:"SOLID_POINT",25:"DOTTED_POINT"},Ms={SOLID:0,DOTTED:1,NOTE:2,SOLID_CROSS:3,DOTTED_CROSS:4,SOLID_OPEN:5,DOTTED_OPEN:6,SOLID_POINT:24,DOTTED_POINT:25,CRITICAL_START:27},nxe=e=>{let t;switch(e){case Ms.SOLID:case Ms.SOLID_CROSS:case Ms.SOLID_OPEN:case Ms.SOLID_POINT:t="solid";break;case Ms.DOTTED:case Ms.DOTTED_CROSS:case Ms.DOTTED_OPEN:case Ms.DOTTED_POINT:t="dotted";break;default:t="solid";break}return t},rxe=(e,t)=>{var r,i;if(!!((r=e.nextElementSibling)!=null&&r.classList.contains("sequenceNumber"))){const a=(i=e.nextElementSibling)==null?void 0:i.textContent;if(!a)throw new Error("sequence number not present");const s=30,o=s/2,d={type:"rectangle",x:t.startX-10,y:t.startY-o,label:{text:a,fontSize:14},bgColor:"#e9ecef",height:s,subtype:"sequence"};Object.assign(t,{sequenceNumber:d})}},QT=(e,t,n)=>{if(!e)throw"root node not found";const r=Xo(),i=Array.from(e.children),a=[];return i.forEach((s,o)=>{const c=`${n==null?void 0:n.id}-${o}`;let d;switch(s.tagName){case"line":const l=Number(s.getAttribute("x1")),h=Number(s.getAttribute("y1")),f=Number(s.getAttribute("x2")),g=Number(s.getAttribute("y2"));d=j1(s,l,h,f,g,{groupId:r,id:c});break;case"text":d=o$(s,t,{groupId:r,id:c});break;case"circle":d=to(s,"ellipse",{label:s.textContent?{text:s.textContent}:void 0,groupId:r,id:c});default:d=to(s,R1e[s.tagName],{label:s.textContent?{text:s.textContent}:void 0,groupId:r,id:c})}a.push(d)}),a},ixe=(e,t)=>{const n=Array.from(t.querySelectorAll(".actor-top")),r=Array.from(t.querySelectorAll(".actor-bottom")),i=[],a=[];return Object.values(e).forEach((s,o)=>{var h;const c=n.find(f=>f.getAttribute("name")===s.name),d=r.find(f=>f.getAttribute("name")===s.name);if(!c||!d)throw"root not found";const l=s.description;if(s.type==="participant"){const f=to(c,"rectangle",{id:`${s.name}-top`,label:{text:l},subtype:"actor"});if(!f)throw"Top Node element not found!";i.push([f]);const g=to(d,"rectangle",{id:`${s.name}-bottom`,label:{text:l},subtype:"actor"});i.push([g]);const U=(h=c==null?void 0:c.parentElement)==null?void 0:h.previousElementSibling;if((U==null?void 0:U.tagName)!=="line")throw"Line not found";const y=Number(U.getAttribute("x1"));if(!f.height)throw"Top node element height is null";const v=f.y+f.height,x=g.y,w=Number(U.getAttribute("x2")),C=j1(U,y,v,w,x);a.push(C)}else if(s.type==="actor"){const f=QT(c,l,{id:`${s.name}-top`});i.push(f);const g=QT(d,l,{id:`${s.name}-bottom`});i.push(g);const U=c.previousElementSibling;if((U==null?void 0:U.tagName)!=="line")throw"Line not found";const y=Number(U.getAttribute("x1")),v=Number(U.getAttribute("y1")),x=Number(U.getAttribute("x2")),w=g.find(C=>C.type==="ellipse");if(w){const C=w.y,S=j1(U,y,v,x,C);a.push(S)}}}),{nodes:i,lines:a}},axe=(e,t)=>{const n=[],r=Array.from(t.querySelectorAll('[class*="messageLine"]')),i=Object.keys(KT),a=e.filter(s=>i.includes(s.type.toString()));return r.forEach((s,o)=>{const c=a[o],d=KT[c.type],l=txe(s,{label:c==null?void 0:c.message,strokeStyle:nxe(c.type),endArrowhead:d==="SOLID_OPEN"||d==="DOTTED_OPEN"?null:"arrow"});rxe(s,l),n.push(l)}),n},sxe=(e,t)=>{const n=Array.from(t.querySelectorAll(".note")).map(a=>a.parentElement),r=e.filter(a=>a.type===Ms.NOTE),i=[];return n.forEach((a,s)=>{if(!a)return;const o=a.firstChild,c=r[s].message,d=to(o,"rectangle",{label:{text:c},subtype:"note"});i.push(d)}),i},oxe=e=>{const t=Array.from(e.querySelectorAll("[class*=activation]")),n=[];return t.forEach(r=>{const i=to(r,"rectangle",{label:{text:""},subtype:"activation"});n.push(i)}),n},lxe=(e,t)=>{const n=Array.from(t.querySelectorAll(".loopLine")),r=[],i=[],a=[];n.forEach(l=>{const h=Number(l.getAttribute("x1")),f=Number(l.getAttribute("y1")),g=Number(l.getAttribute("x2")),U=Number(l.getAttribute("y2")),y=j1(l,h,f,g,U);y.strokeStyle="dotted",y.strokeColor="#adb5bd",y.strokeWidth=2,r.push(y)});const s=Array.from(t.querySelectorAll(".loopText")),o=e.filter(l=>l.type===Ms.CRITICAL_START).map(l=>l.message);s.forEach(l=>{var y;const h=l.textContent||"",f=o$(l,h),g=((y=h.match(/\[(.*?)\]/))==null?void 0:y[1])||"";o.includes(g)&&(f.x+=16),i.push(f)});const c=Array.from(t==null?void 0:t.querySelectorAll(".labelBox")),d=Array.from(t==null?void 0:t.querySelectorAll(".labelText"));return c.forEach((l,h)=>{var U;const f=((U=d[h])==null?void 0:U.textContent)||"",g=to(l,"rectangle",{label:{text:f}});g.strokeColor="#adb5bd",g.bgColor="#e9ecef",g.width=void 0,a.push(g)}),{lines:r,texts:i,nodes:a}},cxe=e=>{const t=Array.from(e.querySelectorAll(".rect")).filter(r=>{var i;return((i=r.parentElement)==null?void 0:i.tagName)!=="g"}),n=[];return t.forEach(r=>{const i=to(r,"rectangle",{label:{text:""},subtype:"highlight"});n.push(i)}),n},dxe=(e,t)=>{e.parse();const n=e.parser.yy,r=[],i=n.getBoxes(),a=cxe(t),s=n.getActors(),{nodes:o,lines:c}=ixe(s,t),d=n.getMessages(),l=axe(d,t),h=sxe(d,t),f=oxe(t),g=lxe(d,t);return r.push(a),r.push(...o),r.push(h),r.push(f),{type:"sequence",lines:c,arrows:l,nodes:r,loops:g,groups:i}},ig={AGGREGATION:0,EXTENSION:1,COMPOSITION:2,DEPENDENCY:3},JT={LINE:0,DOTTED_LINE:1},Fl=16,uxe=e=>{let t;switch(e){case JT.LINE:t="solid";break;case JT.DOTTED_LINE:t="dotted";break;default:t="solid"}return t},eM=e=>{let t;switch(e){case ig.AGGREGATION:t="diamond_outline";break;case ig.COMPOSITION:t="diamond";break;case ig.EXTENSION:t="triangle_outline";break;case"none":t=null;break;case ig.DEPENDENCY:default:t="arrow";break}return t},hxe=(e,t)=>{const n=[],r=[],i=[];return Object.values(e).forEach(a=>{var y;const{domId:s,id:o}=a,c=Xo(),d=t.querySelector(`[data-id=${o}]`);if(!d)throw Error(`DOM Node with id ${s} not found`);const{transformX:l,transformY:h}=ah(d),f=to(d.firstChild,"rectangle",{id:o,groupId:c});f.x+=l,f.y+=h,f.metadata={classId:o},n.push(f),Array.from(d.querySelectorAll(".divider")).forEach(v=>{const x=Number(v.getAttribute("x1")),w=Number(v.getAttribute("y1")),C=Number(v.getAttribute("x2")),S=Number(v.getAttribute("y2")),k=j1(v,x,w,C,S,{groupId:c,id:Xo()});k.startX+=l,k.startY+=h,k.endX+=l,k.endY+=h,k.metadata={classId:o},r.push(k)});const U=(y=d.querySelector(".label"))==null?void 0:y.children;if(!U)throw"label nodes not found";Array.from(U).forEach(v=>{const x=v.textContent;if(!x)return;const w=Xo(),{transformX:C,transformY:S}=ah(v),k=v.getBBox(),T=J8(l+C,h+S+10,x,{width:k.width,height:k.height,id:w,groupId:c,metadata:{classId:o}});i.push(T)})}),{nodes:n,lines:r,text:i}},fxe=(e,t)=>{const n=["triangle_outline","diamond","diamond_outline"],r=t.startArrowhead&&n.includes(t.startArrowhead),i=t.endArrowhead&&n.includes(t.endArrowhead);return!i&&!r||(r&&(e==="LR"?t.startX-=Fl:e==="RL"?t.startX+=Fl:e==="TB"?t.startY-=Fl:e==="BT"&&(t.startY+=Fl)),i&&(e==="LR"?t.endX+=Fl:e==="RL"?t.endX-=Fl:e==="TB"?t.endY+=Fl:e==="BT"&&(t.endY-=Fl))),t},pxe=(e,t,n,r)=>{var o;const i=(o=n.querySelector(".edgePaths"))==null?void 0:o.children;if(!i)throw new Error("No Edges found!");const a=[],s=[];return e.forEach((c,d)=>{const{id1:l,id2:h,relation:f}=c,g=t.find(F=>F.id===l),U=t.find(F=>F.id===h),y=uxe(f.lineType),v=eM(f.type1),x=eM(f.type2),w=a$(i[d]),C=s$(w.startX,w.startY,w.endX,w.endY,{strokeStyle:y,startArrowhead:v,endArrowhead:x,label:c.title?{text:c.title}:void 0,start:{type:"rectangle",id:g.id},end:{type:"rectangle",id:U.id}}),S=fxe(r,C);a.push(S);const{relationTitle1:k,relationTitle2:M}=c,T=20,R=15,j=15;let P,N;if(k&&k!=="none"){switch(r){case"TB":P=S.startX-T,S.endX<S.startX&&(P-=j),N=S.startY+R;break;case"BT":P=S.startX+T,S.endX>S.startX&&(P+=j),N=S.startY-R;break;case"LR":P=S.startX+T,N=S.startY+R,S.endY>S.startY&&(N+=j);break;case"RL":P=S.startX-T,N=S.startY-R,S.startY>S.endY&&(N-=j);break;default:P=S.startX-T,N=S.startY+R}const F=J8(P,N,k,{fontSize:16});s.push(F)}if(M&&M!=="none"){switch(r){case"TB":P=S.endX+T,S.endX<S.startX&&(P+=j),N=S.endY-R;break;case"BT":P=S.endX-T,S.endX>S.startX&&(P-=j),N=S.endY+R;break;case"LR":P=S.endX-T,N=S.endY-R,S.endY>S.startY&&(N-=j);break;case"RL":P=S.endX+T,N=S.endY+R,S.startY>S.endY&&(N+=j);break;default:P=S.endX+T,N=S.endY-R}const F=J8(P,N,M,{fontSize:16});s.push(F)}}),{arrows:a,text:s}},mxe=(e,t,n)=>{const r=[],i=[];return e.forEach(a=>{const{id:s,text:o,class:c}=a,d=t.querySelector(`#${s}`);if(!d)throw new Error(`Node with id ${s} not found!`);const{transformX:l,transformY:h}=ah(d),f=d.firstChild,g=to(f,"rectangle",{id:s,subtype:"note",label:{text:o}});if(Object.assign(g,{x:g.x+l,y:g.y+h}),r.push(g),c){const U=n.find(S=>S.id===c);if(!U)throw new Error(`class node with id ${c} not found!`);const y=g.x+(g.width||0)/2,v=g.y+(g.height||0),x=y,w=U.y,C=s$(y,v,x,w,{strokeStyle:"dotted",startArrowhead:null,endArrowhead:null,start:{id:g.id,type:"rectangle"},end:{id:U.id,type:"rectangle"}});i.push(C)}}),{notes:r,connectors:i}},gxe=(e,t)=>{e.parse();const n=e.parser.yy,r=n.getDirection(),i=[],a=[],s=[],o=[],c=n.getNamespaces(),d=n.getClasses();if(Object.keys(d).length){const y=hxe(d,t);i.push(y.nodes),a.push(...y.lines),s.push(...y.text),o.push(...y.nodes)}const l=n.getRelations(),{arrows:h,text:f}=pxe(l,o,t,r),{notes:g,connectors:U}=mxe(n.getNotes(),t,o);return i.push(g),h.push(...U),s.push(...f),{type:"class",nodes:i,lines:a,arrows:h,text:s,namespaces:c}},Uxe=e=>{const t=e.querySelector("svg");if(!t)throw new Error("SVG element not found");const n=t.getBoundingClientRect(),r=n.width,i=n.height;t.setAttribute("width",`${r}`),t.setAttribute("height",`${i}`);const a="image/svg+xml",s=unescape(encodeURIComponent(t.outerHTML)),c=`data:image/svg+xml;base64,${btoa(s)}`;return{type:"graphImage",mimeType:a,dataURL:c,width:r,height:i}},bxe=async(e,t=Rk)=>{Ni.initialize({...Rk,...t});const n=await Ni.mermaidAPI.getDiagramFromText(q7e(e)),{svg:r}=await Ni.render("mermaid-to-excalidraw",e),i=document.createElement("div");i.setAttribute("style","opacity: 0; position: relative; z-index: -1;"),i.innerHTML=r,i.id="mermaid-diagram",document.body.appendChild(i);let a;switch(n.type){case"flowchart-v2":{a=exe(n,i);break}case"sequence":{a=dxe(n,i);break}case"classDiagram":{a=gxe(n,i);break}default:a=Uxe(i)}return i.remove(),a},yxe=async(e,t)=>{var s;const n=t||{},r=parseInt(((s=n.themeVariables)==null?void 0:s.fontSize)??"")||h6,i=await bxe(e,{...n,themeVariables:{...n.themeVariables,fontSize:`${r*1.25}px`}});return V1e(i,{fontSize:r})},vxe=async(e,t)=>{try{const n=await yxe(e,t);return{elements:n.elements,files:n.files}}catch(n){return console.error("Error converting Mermaid to Excalidraw:",n),{elements:[],error:n instanceof Error?n.message:String(n)}}},xxe={startOnLoad:!1,flowchart:{curve:"linear"},themeVariables:{fontSize:"20px"},maxEdges:500,maxTextSize:5e4};function wxe(){try{const e=document,t=navigator,n=e.modelContext??t.modelContext;if(n&&typeof n.registerTool=="function")return n}catch{}return null}function Exe(){try{if(typeof crypto<"u"&&"randomUUID"in crypto)return crypto.randomUUID().slice(0,12)}catch{}return`el_${Math.random().toString(36).slice(2,10)}`}function Cxe(e){var r;const t={id:e.id,type:e.type,x:Math.round(Number(e.x??0)),y:Math.round(Number(e.y??0))};e.width!==void 0&&(t.width=e.width),e.height!==void 0&&(t.height=e.height);const n=typeof e.text=="string"&&e.text||((r=e.label)==null?void 0:r.text);return n&&(t.text=String(n).slice(0,120)),e.locked&&(t.locked=!0),t}const Sxe={type:"object",properties:{id:{type:"string",description:"Custom element ID (auto-generated if omitted)"},type:{type:"string",description:"Excalidraw element type: rectangle, ellipse, diamond, text, arrow, line, freedraw, image"},x:{type:"number"},y:{type:"number"},width:{type:"number"},height:{type:"number"},text:{type:"string",description:"Label text for shapes / content for text elements"},backgroundColor:{type:"string"},strokeColor:{type:"string"},strokeWidth:{type:"number"},fontSize:{type:"number"},startElementId:{type:"string",description:"For arrows: bind start to this element ID"},endElementId:{type:"string",description:"For arrows: bind end to this element ID"}},required:["type","x","y"],additionalProperties:!0};function _xe(e){const t=()=>{},n=wxe();if(!n)return{available:!1,count:0,cleanup:t};const r=new AbortController,i=r.signal;let a=0;const s=()=>{const c=e();if(!c)throw new Error("Canvas not ready yet");return c},o=c=>{try{const d=n.registerTool(c,{signal:i});d&&typeof d.catch=="function"&&d.catch(()=>{}),a+=1}catch{}};return o({name:"describe_scene",title:"Describe canvas scene",description:"Read-only summary of the live Excalidraw canvas: element counts by type plus id/type/position/label per element (capped at 200). Call before editing.",inputSchema:{type:"object",properties:{},additionalProperties:!1},annotations:{readOnlyHint:!0},execute:()=>{const d=s().getSceneElements().filter(h=>!h.isDeleted),l={};for(const h of d){const f=String(h.type??"unknown");l[f]=(l[f]??0)+1}return{count:d.length,byType:l,elements:d.slice(0,200).map(Cxe)}}}),o({name:"create_elements",title:"Create canvas elements",description:"Add new elements to the live canvas in one batch. Assign custom ids to shapes so arrows can reference them via startElementId/endElementId.",inputSchema:{type:"object",properties:{elements:{type:"array",items:Sxe,minItems:1}},required:["elements"],additionalProperties:!1},annotations:{destructiveHint:!1},execute:c=>{const d=s(),l=Array.isArray(c==null?void 0:c.elements)?c.elements:[];if(l.length===0)throw new Error("elements must be a non-empty array");if(l.length>200)throw new Error("max 200 elements per call");const h=l.map(g=>{if(!g||typeof g!="object")throw new Error("each element must be an object");if(typeof g.type!="string")throw new Error("each element needs a type");if(typeof g.x!="number"||typeof g.y!="number")throw new Error("each element needs numeric x and y");const{startElementId:U,endElementId:y,...v}=g,x={id:Exe(),...v};return typeof U=="string"&&(x.start={id:U}),typeof y=="string"&&(x.end={id:y}),(x.type==="arrow"||x.type==="line")&&!Array.isArray(x.points)&&(x.points=[[0,0],[100,0]]),x}),f=d.getSceneElements();return d.updateScene({elements:[...f,...h]}),{ok:!0,count:h.length,ids:h.map(g=>g.id)}}}),o({name:"update_element",title:"Update canvas element",description:"Patch position, size, colors, or text of one element by id on the live canvas.",inputSchema:{type:"object",properties:{id:{type:"string",description:"Element ID from describe_scene"},patch:{type:"object",description:"Fields to merge (x, y, width, height, backgroundColor, strokeColor, text, ...)"}},required:["id","patch"],additionalProperties:!1},annotations:{destructiveHint:!1},execute:c=>{const d=s();if(!(c!=null&&c.id))throw new Error("id is required");if(!(c!=null&&c.patch)||typeof c.patch!="object")throw new Error("patch must be an object");const l=d.getSceneElements(),h=l.findIndex(g=>g.id===c.id);if(h===-1)throw new Error(`Element ${c.id} not found`);const f=l.slice();return f[h]={...l[h],...c.patch,id:c.id},d.updateScene({elements:f}),{ok:!0,id:c.id}}}),o({name:"delete_element",title:"Delete canvas element",description:"Remove one element by id from the live canvas.",inputSchema:{type:"object",properties:{id:{type:"string"}},required:["id"],additionalProperties:!1},annotations:{destructiveHint:!0},execute:c=>{const d=s();if(!(c!=null&&c.id))throw new Error("id is required");const l=d.getSceneElements();if(!l.some(h=>h.id===c.id))throw new Error(`Element ${c.id} not found`);return d.updateScene({elements:l.filter(h=>h.id!==c.id)}),{ok:!0,deleted:c.id}}}),o({name:"clear_canvas",title:"Clear canvas",description:"Remove ALL elements from the live canvas. Ask the user to confirm first.",inputSchema:{type:"object",properties:{},additionalProperties:!1},annotations:{destructiveHint:!0,consequentialHint:!0},execute:()=>{const c=s(),d=c.getSceneElements().length;return c.resetScene(),{ok:!0,cleared:d}}}),o({name:"take_screenshot",title:"Screenshot canvas",description:"Render the live canvas to a PNG dataURL (viewer-side, no server).",inputSchema:{type:"object",properties:{background:{type:"boolean"}},additionalProperties:!1},annotations:{readOnlyHint:!0},execute:async()=>{var y,v;const{exportToBlob:c}=await ye(async()=>{const{exportToBlob:x}=await Promise.resolve().then(()=>L1e);return{exportToBlob:x}},void 0,import.meta.url),d=s(),l=d.getSceneElements(),h=((y=d.getFiles)==null?void 0:y.call(d))||{},f=((v=d.getAppState)==null?void 0:v.call(d))||{},g=await c({elements:l,mimeType:"image/png",quality:.9,appState:f,files:h});return{ok:!0,dataUrl:await new Promise((x,w)=>{const C=new FileReader;C.onload=()=>x(String(C.result)),C.onerror=()=>w(C.error),C.readAsDataURL(g)})}}}),o({name:"set_viewport",title:"Set viewport",description:"Zoom-to-fit or center on an element on the live canvas.",inputSchema:{type:"object",properties:{scrollToContent:{type:"boolean"},scrollToElementId:{type:"string"},zoom:{type:"number"}},additionalProperties:!1},execute:c=>{const d=s();if(c!=null&&c.scrollToElementId){const l=d.getSceneElements().find(h=>h.id===c.scrollToElementId);if(!l)throw new Error(`Element ${c.scrollToElementId} not found`);d.scrollToContent([l],{fitToViewport:!1,animate:!1})}else d.scrollToContent(d.getSceneElements(),{fitToViewport:!0,animate:!1});return{ok:!0}}}),{available:!0,count:a,cleanup:()=>{try{r.abort()}catch{}}}}const sh={};function kxe(){try{const r=new URLSearchParams(window.location.search).get("repo");if(r!=null&&r.includes("/")){const[i,a]=r.split("/");if(i&&a)return{owner:i,repo:a,branch:"excalidrop"}}}catch{}const e="__EXCALIDROP_REPO_SLUG__";if(e!=null&&e.includes("/")){const[r,i]=e.split("/");return{owner:r,repo:i,branch:"excalidrop"}}const t=window.location.hostname,n=window.location.pathname.split("/").filter(Boolean);return t.endsWith(".github.io")&&n.length>0?{owner:t.slice(0,-10),repo:n[0],branch:"excalidrop"}:null}function l$(e){return`https://raw.githubusercontent.com/${e.owner}/${e.repo}/${e.branch}/canvas.excalidraw`}function c$(e,t){return`https://raw.githubusercontent.com/${e.owner}/${e.repo}/${t}/canvas.excalidraw`}async function Txe(e,t){var n,r,i,a,s,o,c;try{const d={};t&&(d.Authorization=`Bearer ${t}`);const l=await Fd(`https://api.github.com/repos/${e.owner}/${e.repo}/commits?path=canvas.excalidraw&sha=${encodeURIComponent(e.branch)}&per_page=1`,{cache:"no-store",headers:d});if(!l.ok)return null;const h=await l.json().catch(()=>null),f=Array.isArray(h)?h[0]:null;return f?{author:((r=(n=f==null?void 0:f.commit)==null?void 0:n.author)==null?void 0:r.login)??((a=(i=f==null?void 0:f.commit)==null?void 0:i.committer)==null?void 0:a.login)??((s=f==null?void 0:f.author)==null?void 0:s.login)??null,date:((c=(o=f==null?void 0:f.commit)==null?void 0:o.committer)==null?void 0:c.date)??null}:null}catch{return null}}const ev=new Map,tM=new Map,nM=new Map;function d$(e){return`${e.owner}/${e.repo}/${e.branch}`}function u$(e){try{if(e.status===403||e.status===429){const t=Number(e.headers.get("retry-after")||0);if(t>0)return t*1e3+1e3;const n=e.headers.get("x-ratelimit-remaining"),r=Number(e.headers.get("x-ratelimit-reset")||0);return n==="0"&&r>0?Math.max(0,r*1e3-Date.now())+5e3:5*60*1e3}}catch{}return 0}async function Fd(e,t={},n=2e4){try{return await fetch(e,{...t,signal:AbortSignal.timeout(n)})}catch(r){if(typeof AbortSignal.timeout!="function"&&!t.signal){let i=null;try{const a=new Promise((s,o)=>{i=setTimeout(()=>o(new Error(`fetch timed out after ${n}ms: ${e}`)),n)});return await Promise.race([fetch(e,t),a])}finally{i&&clearTimeout(i)}}throw r}}async function Zx(e){var r;const t=d$(e),n=tM.get(t)||null;if(Date.now()<(ev.get(t)||0))return{sha:n,notModified:!0,backedOff:!0};try{const i={Accept:"application/vnd.github+json"},a=nM.get(t);a&&(i["If-None-Match"]=a);const s=await Fd(`https://api.github.com/repos/${e.owner}/${e.repo}/git/ref/heads/${e.branch}`,{cache:"no-store",headers:i});if(s.status===304)return{sha:n,notModified:!0,backedOff:!1};if(!s.ok){const h=u$(s);return h>0&&ev.set(t,Date.now()+h),{sha:n,notModified:!0,backedOff:h>0}}const o=s.headers.get("etag");o&&nM.set(t,o);const c=await s.json().catch(()=>null),d=(r=c==null?void 0:c.object)==null?void 0:r.sha;if(!d)return{sha:n,notModified:!0,backedOff:!1};const l=d!==n;return tM.set(t,d),{sha:d,notModified:!l,backedOff:!1}}catch{return{sha:n,notModified:!0,backedOff:!1}}}async function Kx(e,t){const n=await fetch(c$(e,t),{cache:"no-store"});if(!n.ok)throw new Error(`pinned blob ${n.status}`);const r=await n.json();return{elements:r.elements||[],files:r.files||{}}}async function Mxe(e){const t=await Zx(e);if(t.backedOff)return{status:"backed-off"};if(!t.sha||t.notModified)return{status:"not-modified"};try{const n=await Kx(e,t.sha);return{status:"fresh",elements:n.elements,files:n.files}}catch{return{status:"backed-off"}}}const Gp="excalidrop_gh_token";function L6(){const e=window.location.hash.startsWith("#")?window.location.hash.slice(1):window.location.hash;try{return new URLSearchParams(e)}catch{return new URLSearchParams}}function dU(...e){try{const t=L6();let n=!1;for(const a of e)t.has(a)&&(t.delete(a),n=!0);if(!n)return;const r=t.toString(),i=window.location.pathname+window.location.search+(r?`#${r}`:"");history.replaceState(null,"",i)}catch{}}function h$(){const e=[];try{const t=L6();for(const n of t.getAll("addLibrary"))if(n&&e.push(n),n!=null&&n.includes(",")){const r=n.split(",").map(i=>i.trim()).filter(Boolean);e.pop(),e.push(...r)}}catch{}return e.filter(Boolean)}function Ixe(){var n;const e=L6(),t=e.get("token");if(t){const r=e.get("refresh_token"),i=Number(e.get("expires_in"));return r||Number.isFinite(i)?(Qx(t,r||null,Number.isFinite(i)?i:null),dU("token","refresh_token","expires_in")):(localStorage.setItem(Gp,t),dU("token")),t}return((n=Jx())==null?void 0:n.token)??null}function Qx(e,t,n){try{if(!e){localStorage.removeItem(Gp);return}if(t||n){const r={token:e,...t?{refresh_token:t}:{},...n?{expires_at:Date.now()+n*1e3}:{}};localStorage.setItem(Gp,JSON.stringify(r))}else localStorage.setItem(Gp,e)}catch{}}function Jx(){try{const e=localStorage.getItem(Gp);if(!e)return null;if(e.trimStart().startsWith("{")){const t=JSON.parse(e);return t!=null&&t.token?t:null}return{token:e}}catch{return null}}async function f$(e,t){try{const n=await fetch("https://github.com/login/oauth/access_token",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({client_id:e,grant_type:"refresh_token",refresh_token:t})});if(!n.ok)return null;const r=await n.json();return r.access_token?{token:r.access_token,...r.refresh_token?{refresh_token:r.refresh_token}:{},...r.expires_in?{expires_in:Number(r.expires_in)}:{}}:null}catch{return null}}async function Axe(e,t={}){const n=Jx();if(!(n!=null&&n.refresh_token))return null;const r=t.marginMs??10*60*1e3,i=!n.expires_at||n.expires_at-Date.now()<r;if(!t.force&&!i)return n.token;const a=await f$(e,n.refresh_token);return a?(Qx(a.token,a.refresh_token??n.refresh_token,a.expires_in??null),a.token):null}async function Ur(e,t,n){const r=await Fd(`https://api.github.com${e}`,{cache:"no-store",...n,headers:{Authorization:`Bearer ${t}`,Accept:"application/vnd.github+json","Content-Type":"application/json",...(n==null?void 0:n.headers)||{}}});if(!r.ok)throw new Error(`GitHub ${r.status}: ${(await r.text()).slice(0,200)}`);return r.json()}function Lxe(e,t){return e4(e,e,t).merged}function rM(e){const t=(e==null?void 0:e.updatedAt)??(e==null?void 0:e.createdAt),n=typeof t=="number"?t:Date.parse(String(t??""));return Number.isFinite(n)?n:0}function Vl(e){try{return JSON.stringify([e.id,e.version,e.x,e.y,e.width,e.height,e.angle,e.text,e.originalText,e.points,e.isDeleted,e.containerId,e.boundElements,e.groupIds,e.link,e.backgroundColor,e.strokeColor,e.fontSize])}catch{return String(e==null?void 0:e.id)}}function e4(e,t,n){const r=new Map;for(const l of e||[])l!=null&&l.id&&r.set(l.id,l);const i=new Map;for(const l of t||[])l!=null&&l.id&&i.set(l.id,l);const a=new Map;for(const l of n||[])l!=null&&l.id&&a.set(l.id,l);const s=[],o=[];let c=0,d=0;for(const l of new Set([...r.keys(),...i.keys(),...a.keys()])){const h=r.get(l),f=i.get(l),g=a.get(l);if(f&&!g){h?Vl(h)!==Vl(f)&&(s.push(f),o.push(l)):s.push(f);continue}if(!f&&g){h?Vl(h)!==Vl(g)&&(s.push(g),o.push(l)):(s.push(g),c++);continue}if(!f&&!g)continue;const U=h?Vl(h):null,y=Vl(f),v=Vl(g);if(y===v){s.push(f);continue}if(U===null||U===v){s.push(f);continue}if(U===y){s.push(g),d++;continue}const x=rM(g)>=rM(f)?g:f;s.push(x),x===g&&d++,o.push(l)}return{merged:s,conflicts:o,added:c,updated:d}}function Rxe(e,t){return btoa(unescape(encodeURIComponent(JSON.stringify({type:"excalidraw",version:2,source:"excalidrop",elements:e,...t?{files:t}:{}},null,2))))}function Dxe(e){return{"image/png":"png","image/jpeg":"jpg","image/jpg":"jpg","image/gif":"gif","image/webp":"webp","image/svg+xml":"svg"}[e]||"png"}function jxe(e,t){return`assets/${e}.${Dxe(t)}`}const qp=new Set;try{for(const e of(localStorage.getItem("excalidrop_synced_assets")||"").split(",").filter(Boolean))qp.add(e)}catch{}function iM(e){if(!qp.has(e)){qp.add(e);try{const t=[...qp].slice(-200);localStorage.setItem("excalidrop_synced_assets",t.join(","))}catch{}}}async function aM(e,t,n,r){const a=(Array.isArray(n)?n:Object.values(n||{})).filter(s=>(s==null?void 0:s.id)&&typeof(s==null?void 0:s.dataURL)=="string"&&s.dataURL.startsWith("data:"));a.length!==0&&await Promise.all(a.map(async s=>{try{if(qp.has(s.id))return;let o,c;const d=/^data:([^;]+);base64,(.+)$/s.exec(s.dataURL);if(d)o=s.mimeType||d[1],c=d[2];else{const h=/^data:([^,]+),([\s\S]+)$/.exec(s.dataURL);if(!h)return;o=s.mimeType||h[1].split(";")[0];try{c=btoa(unescape(encodeURIComponent(decodeURIComponent(h[2]))))}catch{return}}const l=jxe(s.id,o);try{if((await Fd(`https://api.github.com/repos/${e.owner}/${e.repo}/contents/${l}?ref=${e.branch}`,{cache:"no-store",headers:{Authorization:`Bearer ${t}`,Accept:"application/vnd.github+json"}})).ok){iM(s.id);return}}catch{}await Ur(`/repos/${e.owner}/${e.repo}/contents/${l}`,t,{method:"PUT",...r?{keepalive:!0}:{},body:JSON.stringify({message:`excalidrop: add image asset ${s.id}`,content:c,branch:e.branch})}),iM(s.id)}catch{}}))}function sM(e){try{return JSON.parse(decodeURIComponent(escape(atob(e.replace(/\n/g,"")))))}catch{return null}}async function oM(e,t){try{const n=await Ur(`/repos/${e.owner}/${e.repo}/contents/canvas.excalidraw?ref=${e.branch}`,t);if(!n||typeof n.sha!="string")return null;if(typeof n.content=="string"&&n.content.length>0){const r=sM(n.content);return r?{sha:n.sha,elements:Array.isArray(r.elements)?r.elements:[],files:r.files}:{sha:n.sha,elements:[]}}try{const r=await Ur(`/repos/${e.owner}/${e.repo}/git/blobs/${n.sha}`,t);if(!(r!=null&&r.content))return{sha:n.sha,elements:[]};const i=sM(r.content);return i?{sha:n.sha,elements:Array.isArray(i.elements)?i.elements:[],files:i.files}:{sha:n.sha,elements:[]}}catch{return{sha:n.sha,elements:[]}}}catch{return null}}const Pxe=9e5;async function Nxe(e,t,n,r,i){var f,g;const a=`/repos/${e.owner}/${e.repo}`,s=await Ur(`${a}/git/blobs`,t,{method:"POST",body:JSON.stringify({content:n,encoding:"base64"})}),o=await Ur(`${a}/git/ref/heads/${e.branch}`,t),c=(f=o==null?void 0:o.object)==null?void 0:f.sha;if(!c)throw new Error("GitHub 422: branch ref not found");const d=await Ur(`${a}/git/commits/${c}`,t),l=await Ur(`${a}/git/trees`,t,{method:"POST",body:JSON.stringify({base_tree:(g=d==null?void 0:d.tree)==null?void 0:g.sha,tree:[{path:"canvas.excalidraw",mode:"100644",type:"blob",sha:s.sha}]})}),h=await Ur(`${a}/git/commits`,t,{method:"POST",body:JSON.stringify({message:r,tree:l.sha,parents:[c],...i?{author:i,committer:i}:{}})});try{await Ur(`${a}/git/refs/heads/${e.branch}`,t,{method:"PATCH",body:JSON.stringify({sha:h.sha})})}catch(U){throw new Error(`GitHub 409: ${U.message}`)}return s.sha}async function a3(e,t,n,r,i,a,s){let o;if(!a)try{const l=await Ur("/user",t);l!=null&&l.login&&(o={name:l.login,email:`${l.login}@users.noreply.github.com`})}catch{}const c=Rxe(n,s);return c.length>Pxe?Nxe(e,t,c,o?`${r} — ${o.name}`:r,o):(await Ur(`/repos/${e.owner}/${e.repo}/contents/canvas.excalidraw`,t,{method:"PUT",...a?{keepalive:!0}:{},body:JSON.stringify({message:o?`${r} — ${o.name}`:r,content:c,branch:e.branch,...i?{sha:i}:{},...o?{author:o,committer:o}:{}})})).content.sha}async function Oxe(e,t,n,r={}){const i=n.elements||[],a=n.files,s=r.keepalive??!1;if(s&&r.sha)return await aM(e,t,a,!0).catch(()=>null),{sha:await a3(e,t,i,`excalidrop: autosync ${i.length} elements`,r.sha,!0,a),elements:i};await aM(e,t,a,s).catch(()=>null);const o=await oM(e,t);try{return{sha:await a3(e,t,i,`excalidrop: autosync ${i.length} elements`,o==null?void 0:o.sha,s,a),elements:i}}catch(U){if(!String(U.message).includes("409"))throw U}const c=await oM(e,t),{merged:d,conflicts:l,added:h,updated:f}=e4(r.base||[],i,(c==null?void 0:c.elements)||[]);return{sha:await a3(e,t,d,`excalidrop: autosync ${i.length} elements (+${d.length-i.length} merged)`,c==null?void 0:c.sha,s,a),elements:d,conflicts:l,added:h,updated:f}}async function Fxe(e,t){if(e&&t)try{const i=await Fd(`https://api.github.com/repos/${e.owner}/${e.repo}/contents/canvas.excalidraw?ref=${e.branch}`,{cache:"no-store",headers:{Authorization:`Bearer ${t}`,Accept:"application/vnd.github.raw"}});if(i.ok){const a=await i.json();if(a&&Array.isArray(a.elements))return{elements:a.elements,files:a.files||{}}}}catch{}if(e&&!t){try{const i=await Fd(`https://api.github.com/repos/${e.owner}/${e.repo}/contents/canvas.excalidraw?ref=${e.branch}`,{cache:"no-store",headers:{Accept:"application/vnd.github.raw"}});if(i.ok){const a=await i.json();if(a&&Array.isArray(a.elements))return{elements:a.elements,files:a.files||{}}}else{const a=u$(i);a>0&&ev.set(d$(e),Date.now()+a)}}catch{}try{const i=await Zx(e);if(i.sha&&!i.backedOff){const a=await Kx(e,i.sha);return{elements:a.elements||[],files:a.files||{}}}}catch{}}if(e)try{const i=await fetch(l$(e),{cache:"no-store"});if(i.ok){const a=await i.json();return{elements:a.elements||[],files:a.files||{}}}}catch{}const n=await fetch("./canvas.excalidraw",{cache:"no-cache"});if(!n.ok)return{elements:[],files:{}};const r=await n.json().catch(()=>null);return r?{elements:r.elements||[],files:r.files||{}}:{elements:[],files:{}}}async function $xe(e){const t=await fetch("https://github.com/login/device/code",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({client_id:e})});if(!t.ok)throw new Error("device flow start failed");const n=await t.json();return{user_code:n.user_code,verification_uri:n.verification_uri}}const uU="excalidrop_device_flow";async function Bxe(e){const t=await fetch("https://github.com/login/device/code",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({client_id:e})});if(!t.ok)throw new Error("device flow start failed");const n=await t.json();return{device_code:n.device_code,user_code:n.user_code,verification_uri:n.verification_uri||"https://github.com/login/device",interval:Number(n.interval)||5,expires_at:Date.now()+(Number(n.expires_in)||900)*1e3}}async function zxe(e,t,n){let r=t.interval;for(;;){if(n!=null&&n.aborted)throw new DOMException("Login cancelled","AbortError");if(Date.now()>=t.expires_at)throw new Error("Login code expired — please try again.");if(await new Promise(s=>setTimeout(s,r*1e3)),n!=null&&n.aborted)throw new DOMException("Login cancelled","AbortError");const i=await fetch("https://github.com/login/oauth/access_token",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({client_id:e,device_code:t.device_code,grant_type:"urn:ietf:params:oauth:grant-type:device_code"})});if(!i.ok)throw new Error("Login polling failed");const a=await i.json();if(a.access_token)return{token:a.access_token,...a.refresh_token?{refresh_token:a.refresh_token}:{},...a.expires_in?{expires_in:Number(a.expires_in)}:{}};if(a.error!=="authorization_pending"){if(a.error==="slow_down"){r+=5;continue}if(a.error)throw new Error(a.error_description||a.error)}}}function Hxe(e){try{e?sessionStorage.setItem(uU,JSON.stringify(e)):sessionStorage.removeItem(uU)}catch{}}function Wxe(){try{const e=sessionStorage.getItem(uU);if(!e)return null;const t=JSON.parse(e);return!t.device_code||Date.now()>=t.expires_at?(sessionStorage.removeItem(uU),null):t}catch{return null}}async function Xxe(e,t){let n=null;try{n=await Ur("/user",t)}catch(d){if(String(d.message).includes("401"))return{access:"denied",login:"",detail:"expired"};throw d}const r=n.login||"",i=`${e.owner}/${e.repo}`.toLowerCase(),a=await Ur("/user/installations?per_page=100",t).catch(()=>null),s=!!(a!=null&&a.installations)&&a.installations.length>0,o=/^(ghu_|ghs_)/.test(t.trim());if(s){for(const d of a.installations||[]){const l=await Ur(`/user/installations/${d.id}/repositories?per_page=100`,t).catch(()=>null);if(((l==null?void 0:l.repositories)||[]).find(f=>f.full_name.toLowerCase()===i)){const f=await Ur(`/repos/${e.owner}/${e.repo}/collaborators/${r}/permission`,t).catch(()=>null),g=(f==null?void 0:f.permission)||"";if(g==="read"||g==="triage")return{access:"viewer",login:r,detail:null};if(g==="admin"||g==="maintain"||g==="write")return{access:"editor",login:r,detail:null};if(!g){const U=await Ur(`/repos/${e.owner}/${e.repo}`,t).catch(()=>null);if(U!=null&&U.permissions&&!(U.permissions.push||U.permissions.admin||U.permissions.maintain))return{access:"viewer",login:r,detail:null}}return{access:"editor",login:r,detail:null}}}if(o)return{access:"denied",login:r,detail:"repo-not-covered"}}const c=await Ur(`/repos/${e.owner}/${e.repo}`,t).catch(()=>null);return c!=null&&c.permissions?c.permissions.push||c.permissions.admin||c.permissions.maintain?{access:"editor",login:r,detail:null}:{access:"viewer",login:r,detail:s?"repo-not-covered":null}:{access:"denied",login:r,detail:s?"repo-not-covered":"no-token-permissions"}}const p$=(sh==null?void 0:sh.VITE_GITHUB_CLIENT_ID)||"Iv23liuS2fx3QOEIoDmx",m$=(sh==null?void 0:sh.VITE_GITHUB_APP_SLUG)||"excalidrop",Vxe=`https://github.com/apps/${m$}/installations/new`,Yxe=!p$.includes("EXCALIDROP_APP"),zr=Object.freeze(Object.defineProperty({__proto__:null,APP_INSTALL_URL:Vxe,APP_SLUG:m$,CLIENT_ID:p$,HAS_CLIENT_ID:Yxe,checkAccess:Xxe,detectRepo:kxe,elementSig:Vl,fetchBranchHeadSha:Zx,fetchPinnedScene:Kx,getAddLibraryUrls:h$,getStoredToken:Jx,getToken:Ixe,lastCanvasCommit:Txe,loadFlowSession:Wxe,loadStaticScene:Fxe,mergeSceneElements:Lxe,parseHashParams:L6,pollAnonymousScene:Mxe,pollDeviceToken:zxe,pushScene:Oxe,rawSceneUrl:l$,rawSceneUrlForCommit:c$,refreshAccessToken:f$,removeHashParams:dU,saveFlowSession:Hxe,setToken:Qx,startDeviceFlow:$xe,startDeviceFlowFull:Bxe,threeWayMerge:e4,timedFetch:Fd,tryRefreshToken:Axe},Symbol.toStringTag,{value:"Module"}));async function Gxe(e){const t=await fetch(e,{cache:"no-store"});if(!t.ok)throw new Error(`library fetch ${t.status}`);const n=await t.json(),r=Array.isArray(n)?n:Array.isArray(n==null?void 0:n.libraryItems)?n.libraryItems:Array.isArray(n==null?void 0:n.library)?n.library:null;if(!r)throw new Error("not an excalidrawlib file");return r}const Ji={},s3=()=>{const e=localStorage.getItem("excalidrop_gh_token")||localStorage.getItem("excalidrop_token");return e?{Authorization:`Bearer ${e}`}:{}},qxe=1200,lM=()=>{const e=window.location.hostname;return e.includes("github.io")||e.endsWith(".pages.dev")||window.location.pathname.startsWith("/excalidrop/")},Zxe=(e,t)=>{let n=0,r=0;const i=new Map;for(const a of e||[])a!=null&&a.id&&i.set(String(a.id),a);for(const a of t||[]){const s=a==null?void 0:a.id;if(s==null)continue;const o=i.get(String(s));o?JSON.stringify(o)!==JSON.stringify(a)&&r++:n++}return{added:n,updated:r}},ap=e=>e?`excalidrop_snapshot_${e.owner}_${e.repo}`:"excalidrop_snapshot_local",Kxe=e=>{try{const t=localStorage.getItem(e);if(!t)return null;const n=JSON.parse(t);return!n||typeof n.updatedAt!="number"||!Array.isArray(n.elements)?null:n}catch{return null}},Qxe=(e,t,n,r)=>{try{return localStorage.setItem(e,JSON.stringify({updatedAt:Date.now(),elements:t,base:n,...r?{files:r}:{}})),!0}catch{try{return localStorage.setItem(e,JSON.stringify({updatedAt:Date.now(),elements:t,base:n})),!0}catch{return!1}}},sp=e=>{try{localStorage.removeItem(e)}catch{}},Li=e=>{const{createdAt:t,updatedAt:n,version:r,syncedAt:i,source:a,syncTimestamp:s,...o}=e;return o},Jxe=e=>{const t=new Map(e.map(n=>[n.id,n]));return e.map(n=>{const r={...n};return r.boundElements&&(Array.isArray(r.boundElements)?(r.boundElements=r.boundElements.filter(i=>!(!i||typeof i!="object"||!i.id||!i.type||!t.get(i.id)||!["text","arrow"].includes(i.type))),r.boundElements.length===0&&(r.boundElements=null)):r.boundElements=null),r.containerId&&(t.get(r.containerId)||(r.containerId=null)),r})},cM=e=>e.type==="image",e4e=e=>e==="rectangle"||e==="ellipse"||e==="diamond",t4e=e=>{const t=new Map(e.map(n=>[n.id,n]));return e.map(n=>{if(n.type!=="text"||!n.containerId)return n;const r=n,i=t.get(r.containerId);return!i||!e4e(i.type)||r.autoResize===!1||typeof i.x!="number"||typeof i.y!="number"||typeof i.width!="number"||typeof i.height!="number"||typeof r.width!="number"||typeof r.height!="number"?n:{...n,x:i.x+(i.width-r.width)/2,y:i.y+(i.height-r.height)/2}})},n4e=e=>{const t=e;return{...t,angle:t.angle||0,strokeColor:t.strokeColor||"transparent",backgroundColor:t.backgroundColor||"transparent",fillStyle:t.fillStyle||"solid",strokeWidth:t.strokeWidth||1,strokeStyle:t.strokeStyle||"solid",roughness:t.roughness??0,opacity:t.opacity??100,groupIds:t.groupIds||[],roundness:null,seed:t.seed||Math.floor(Math.random()*1e6),version:t.version||1,versionNonce:t.versionNonce||Math.floor(Math.random()*1e6),isDeleted:t.isDeleted??!1,boundElements:t.boundElements||null,link:t.link||null,locked:t.locked||!1,status:t.status||"saved",fileId:t.fileId,scale:t.scale||[1,1]}},r4e=(e,t)=>{const n=new Map;for(const r of t)r.id&&n.set(r.id,r);return e.map(r=>{const i=n.get(r.id);if(!i)return r;const a={...r};return i.startBinding&&!r.startBinding&&(a.startBinding=i.startBinding),i.endBinding&&!r.endBinding&&(a.endBinding=i.endBinding),i.boundElements&&(!r.boundElements||r.boundElements.length===0)&&(a.boundElements=i.boundElements),i.elbowed!==void 0&&r.elbowed===void 0&&(a.elbowed=i.elbowed),a})},Ao=e=>{if(e.length===0)return[];const t=Jxe(e),n=t.filter(cM).map(n4e),r=t.filter(s=>!cM(s)),i=Sh(r,{regenerateIds:!1}),a=r4e(i,r);return t4e([...a,...n])};function i4e(){const[e,t]=I.useState(null),n=I.useRef(null);I.useEffect(()=>{n.current=e},[e]),I.useEffect(()=>{if(!e)return;const re=_xe(()=>n.current);return()=>re.cleanup()},[e]),I.useEffect(()=>{let re;return(async()=>{try{const{installYoutubeResume:ue}=await ye(async()=>{const{installYoutubeResume:Ue}=await import("./youtubeResume-DPG81gOQ.js");return{installYoutubeResume:Ue}},[],import.meta.url);re=ue()}catch{}})(),()=>{try{re==null||re()}catch{}}},[]),I.useEffect(()=>{if(!e)return;let re=[];return(async()=>{try{const{connectRelay:ue,startCommandQueue:Ue}=await ye(async()=>{const{connectRelay:Xe,startCommandQueue:De}=await import("./relay-DDrathjM.js");return{connectRelay:Xe,startCommandQueue:De}},[],import.meta.url),{detectRepo:ae}=await ye(async()=>{const{detectRepo:Xe}=await Promise.resolve().then(()=>zr);return{detectRepo:Xe}},void 0,import.meta.url),X=()=>n.current,se=()=>localStorage.getItem("excalidrop_gh_token")||localStorage.getItem("excalidrop_token"),be=()=>ae();re=[ue(X,se,be),Ue(X,se,be)]}catch{}})(),()=>{re.forEach(ue=>{try{ue.cleanup()}catch{}})}},[e]);const r=I.useRef(!1),[i,a]=I.useState(null);I.useEffect(()=>{if(!e||r.current)return;const re=h$();re.length!==0&&(r.current=!0,(async()=>{try{for(const ue of re){const Ue=await Gxe(ue);await e.updateLibrary({libraryItems:Ue,merge:!0,openLibraryMenu:!1})}a(null)}catch(ue){a(`Could not load library: ${ue instanceof Error?ue.message:String(ue)}. Open it manually via Library → Open.`)}finally{dU("addLibrary")}})())},[e]);const[s,o]=I.useState(!1),c=I.useRef(null),[d,l]=I.useState("idle"),[h,f]=I.useState(null),[g,U]=I.useState(null),[y,v]=I.useState(null),[x,w]=I.useState(!1),C=I.useRef([]),S=I.useRef(null),k=re=>{v(re),setTimeout(()=>v(ue=>ue===re?null:ue),4e3)},M=I.useRef(null),T=I.useRef(null),R=I.useRef(!1),j=I.useRef(0),P=I.useRef(!1),N=1.5,F=I.useRef(new Set),$=re=>typeof re=="string"&&/(?:youtube\.com\/(?:watch|embed|shorts)|youtu\.be\/)/i.test(re),q=re=>{const ue=re.getSceneElements();let Ue=!1;const ae=ue.map(X=>{if(((X==null?void 0:X.type)==="embeddable"||(X==null?void 0:X.type)==="iframe")&&!(X!=null&&X.isDeleted)&&$(X==null?void 0:X.link)&&typeof(X==null?void 0:X.width)=="number"&&typeof(X==null?void 0:X.height)=="number"&&!F.current.has(X.id)){F.current.add(X.id);const se=Math.round(X.width*N),be=Math.round(X.height*N);return Ue=!0,{...X,width:se,height:be,x:X.x-(se-X.width)/2,y:X.y-(be-X.height)/2}}return X});return Ue&&(j.current+=1,re.updateScene({elements:ae}),setTimeout(()=>{j.current=Math.max(0,j.current-1)},0)),Ue},W=(re,ue)=>{re&&(j.current+=1,re.updateScene(ue),setTimeout(()=>{j.current=Math.max(0,j.current-1)},0))},V=re=>{try{return JSON.stringify(re.map(ue=>[ue.id,ue.version,ue.versionNonce,ue.x,ue.y,ue.width,ue.height,ue.text,ue.originalText,ue.points,ue.isDeleted]))}catch{return""}},B=I.useRef(null);I.useEffect(()=>()=>{M.current&&clearTimeout(M.current),T.current&&clearTimeout(T.current)},[]);const[z,Y]=I.useState(!1),[K,G]=I.useState(null),[ee,de]=I.useState("unknown"),[xe,ve]=I.useState(null),[Me,Ce]=I.useState(""),[ge,$e]=I.useState(null),[je,Je]=I.useState(!1),[ut,zt]=I.useState(!1),Tn=I.useRef(null),On=I.useRef(!1),Fn=I.useRef(null),hn=I.useRef(null),xa=re=>{try{const ue=Array.isArray(re)?re:Object.values(re||{});return JSON.stringify(ue.map(Ue=>[Ue==null?void 0:Ue.id,typeof(Ue==null?void 0:Ue.dataURL)=="string"?Ue.dataURL.length:0,(Ue==null?void 0:Ue.mimeType)||""]).sort((Ue,ae)=>String(Ue[0]).localeCompare(String(ae[0]))))}catch{return""}},fr=(re,ue)=>{if(!ue)return;const Ue=xa(ue);Ue!==hn.current&&(hn.current=Ue,re.addFiles(Object.values(ue)))},xi=I.useRef(0),xr=I.useRef(ge);xr.current=ge;const fl=()=>{const re=n.current;if(!re)return!1;try{const ue=re.getSceneElements().filter(ae=>!ae.isDeleted);let Ue;try{Ue=re.getFiles()}catch{Ue=void 0}return Qxe(ap(xr.current),ue,C.current,Ue)}catch{return!1}},lo=()=>{T.current&&clearTimeout(T.current),T.current=setTimeout(()=>{T.current=null,fl()},800)},wa=async re=>{const ue=n.current;if(!ue)return!1;const Ue=ap(xr.current),ae=Kxe(Ue);if(!ae)return!1;const X=await ye(()=>Promise.resolve().then(()=>zr),void 0,import.meta.url),se=De=>JSON.stringify((De||[]).map(_e=>X.elementSig(_e)).sort());if(se(ae.elements)===se(re||[]))return sp(Ue),!1;if(ae.elements.length===0&&(ae.base||[]).length>0&&se(ae.base)===se(re||[]))return W(ue,{elements:[],captureUpdate:le.NEVER}),!0;const{merged:be}=X.threeWayMerge(ae.base||[],ae.elements,re||[]);if(se(be)===se(re||[])){try{const De=Object.values(ae.files||{});De.length>0&&ue.addFiles(De)}catch{}return sp(Ue),Object.keys(ae.files||{}).length>0}const Xe=Ao(be.map(Li));W(ue,{elements:Xe,captureUpdate:le.NEVER});try{const De=Object.values(ae.files||{});De.length>0&&ue.addFiles(De)}catch{}return!0};I.useEffect(()=>(lM()?wi():fetch("/api/health",{headers:s3()}).then(async ue=>{var ae;let Ue=!1;if(ue.ok)try{Ue=((ae=await ue.json())==null?void 0:ae.ok)===!0}catch{Ue=!1}Ue?(Y(!0),Qr()):wi()}).catch(()=>wi()),()=>{c.current&&c.current.close()}),[]);const wi=async()=>{const re=await ye(()=>Promise.resolve().then(()=>zr),void 0,import.meta.url),ue=re.detectRepo();$e(ue),G(re.getToken()),Je(!0),ue||(de("denied"),ve("no-repo"))};I.useEffect(()=>{if(!(z||!ge)){try{const re=localStorage.getItem(`excalidrop_sha_${ge.owner}_${ge.repo}`);re&&(Tn.current=re)}catch{}K&&(async()=>(await ye(()=>Promise.resolve().then(()=>zr),void 0,import.meta.url)).timedFetch(`https://api.github.com/repos/${ge.owner}/${ge.repo}/contents/canvas.excalidraw?ref=${ge.branch}`,{cache:"no-store",headers:{Authorization:`Bearer ${K}`,Accept:"application/vnd.github+json"}}))().then(async re=>{if(!re.ok)return;const ue=await re.json().catch(()=>null);if(ue!=null&&ue.sha){Tn.current=ue.sha;try{localStorage.setItem(`excalidrop_sha_${ge.owner}_${ge.repo}`,ue.sha)}catch{}}}).catch(()=>{})}},[z,ge,K]),I.useEffect(()=>{document.title=ge?`${ge.owner}/${ge.repo}`:"Excalidrop Canvas"},[ge]);const Ei=I.useRef(null),co=I.useRef(0);I.useEffect(()=>{if(z||!ge)return;if(!K){de("denied"),ve(null),Ce("");return}de("unknown");const re=++co.current,ue=()=>re===co.current;(async()=>{try{const Ue=await ye(()=>Promise.resolve().then(()=>zr),void 0,import.meta.url),ae=await Ue.tryRefreshToken(Ue.CLIENT_ID),X=ae||K;if(ae&&ae!==K){G(ae);return}const{access:se,login:be,detail:Xe}=await Ue.checkAccess(ge,X);if(!ue())return;if(Xe==="expired"&&Ei.current!==X){Ei.current=X;const De=await Ue.tryRefreshToken(Ue.CLIENT_ID,{force:!0});if(De){G(De);return}}if(!ue())return;de(se),ve(Xe),Ce(be)}catch(Ue){if(!ue())return;const ae=String((Ue==null?void 0:Ue.message)||"").includes("401");de("denied"),ve(ae?"expired":null),Ce("")}})()},[z,K,ge]);const us=Ji==null?void 0:Ji.VITE_AUTH_EXCHANGE_URL,Ea=us==="off"?void 0:us||"https://excalidrop.wtf403.workers.dev",zi="excalidrop_oauth_state",Ca="excalidrop_oauth_redirect",hs=Ji==null?void 0:Ji.VITE_CENTRAL_LOGIN_HOST,fs=hs==="off"||hs===""?void 0:hs||"https://wtf403.github.io/excalidrop/",ps=((Ji==null?void 0:Ji.VITE_LOGIN_RETURN_ALLOW)||"*.github.io,*.pages.dev").split(",").map(re=>re.trim().toLowerCase()).filter(Boolean),Sa="excalidrop_login_return",_a=re=>{if(!re.startsWith("https://"))return!1;let ue="";try{ue=new URL(re).host.toLowerCase()}catch{return!1}return ps.some(Ue=>{if(!Ue)return!1;if(Ue.startsWith("*."))return ue===Ue.slice(2)||ue.endsWith(Ue.slice(1));try{return new URL(Ue).origin.toLowerCase()===re.toLowerCase()}catch{return Ue===ue}})},pl=async()=>{const re=await ye(()=>Promise.resolve().then(()=>zr),void 0,import.meta.url),ue=window.location.origin+window.location.pathname,Ue=new Uint8Array(16);crypto.getRandomValues(Ue);const ae=Array.from(Ue).map(se=>se.toString(16).padStart(2,"0")).join("");try{sessionStorage.setItem(zi,ae),sessionStorage.setItem(Ca,ue)}catch{}const X=new URLSearchParams({client_id:re.CLIENT_ID,redirect_uri:ue,scope:"repo",state:ae});window.location.href=`https://github.com/login/oauth/authorize?${X}`},ka=()=>{if(Ea){let re=null;try{re=fs?new URL(fs):null}catch{re=null}if(!(!re||window.location.origin===re.origin||window.location.hostname.endsWith(".github.io"))&&re){const Ue=window.location.origin+window.location.pathname;if(!_a(new URL(Ue).origin)){k("This host is not allowed for login bounce.");return}const ae=new URL(re.toString());ae.searchParams.set("login_return",Ue),window.location.href=ae.toString();return}pl();return}k("GitHub login is unavailable on this host (no exchange backend configured).")};I.useEffect(()=>{if(!Ea)return;const re=new URLSearchParams(window.location.search),ue=re.get("login_return");if(!ue||re.get("code"))return;let Ue="";try{Ue=new URL(ue).origin}catch{}if(!Ue||!_a(Ue)){history.replaceState(null,"",window.location.pathname+window.location.hash),k("Login bounce target not allowed.");return}try{sessionStorage.setItem(Sa,ue)}catch{}pl()},[]);const uo=I.useRef(!1);I.useEffect(()=>{if(uo.current||!Ea)return;const re=new URLSearchParams(window.location.search),ue=re.get("code");if(!ue){const ae=re.get("error");ae&&(uo.current=!0,history.replaceState(null,"",window.location.pathname+window.location.hash),k(`Login failed: ${re.get("error_description")||ae}`));return}uo.current=!0;const Ue=re.get("state");if(Ue&&Ue.startsWith("excsess_")){window.location.href=`${Ea}/oauth/callback${window.location.search}`;return}(async()=>{try{const ae=sessionStorage.getItem(zi),X=sessionStorage.getItem(Ca)||window.location.origin+window.location.pathname;if(!ae||ae!==Ue)throw new Error("state mismatch — please log in again");const se=await fetch(`${Ea}/exchange`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({code:ue,redirect_uri:X})}),be=await se.json().catch(()=>null);if(!se.ok||!(be!=null&&be.token))throw new Error((be==null?void 0:be.error)||"exchange failed");const Xe=await ye(()=>Promise.resolve().then(()=>zr),void 0,import.meta.url),De=sessionStorage.getItem(Sa);if(De){sessionStorage.removeItem(Sa);try{let _e="";try{_e=new URL(De).origin}catch{}if(!_e||!_a(_e))throw new Error("bounce target not allowed");const ze=new URL(De),en=new URLSearchParams;en.set("token",be.token),be.refresh_token&&en.set("refresh_token",be.refresh_token),be.expires_in&&en.set("expires_in",String(be.expires_in)),ze.hash=en.toString(),window.location.href=ze.toString();return}catch(_e){k(`Login failed: ${_e.message}`),history.replaceState(null,"",window.location.pathname+window.location.hash);return}}Xe.setToken(be.token,be.refresh_token??null,be.expires_in??null),Ei.current=null,G(be.token);try{const _e=Xe.detectRepo(),ze=_e?await Xe.checkAccess(_e,be.token):null;ze&&(de(ze.access),ve(ze.detail),Ce(ze.login)),k(!ze||ze.access==="editor"?"Logged in — canvas unlocked":ze.detail==="repo-not-covered"?"Logged in — repo is not in the Excalidrop app installation (read-only)":"Logged in — read-only for this repo")}catch{k("Logged in — checking canvas access…")}}catch(ae){k(`Login failed: ${ae.message}`)}finally{history.replaceState(null,"",window.location.pathname+window.location.hash)}})()},[]),I.useEffect(()=>{const re=ue=>{(ue.metaKey||ue.ctrlKey)&&(ue.code==="KeyS"||ue.key.toLowerCase()==="s")&&(ue.preventDefault(),ue.stopPropagation(),!z&&ee==="editor"?Si(!1):Us())};return window.addEventListener("keydown",re,!0),()=>window.removeEventListener("keydown",re,!0)},[z,ee,e]);const ms=async()=>{if(!(z||!e||!ge)&&!On.current)try{const re=await ye(()=>Promise.resolve().then(()=>zr),void 0,import.meta.url),ue=await re.loadStaticScene(ge,K),Ue=ue.elements||[],ae=n.current;if(!ae)return;const X=ae.getSceneElements().map(Li),{merged:se,conflicts:be,added:Xe,updated:De}=re.threeWayMerge(C.current,X,Ue),_e=Ao(se.map(Li));W(ae,{elements:_e,captureUpdate:le.NEVER}),ue.files&&fr(ae,ue.files),C.current=se,Fn.current=JSON.stringify(Ue),B.current=V(ae.getSceneElements().filter(ze=>!ze.isDeleted)),w(!1),zt(be.length>0||V(ae.getSceneElements().filter(ze=>!ze.isDeleted))!==B.current?ut:!1),k(be.length>0?`Pulled ${Xe+De} change(s), ${be.length} conflict(s) kept newer — review ids ${be.slice(0,3).join(", ")}`:`Pulled ${Xe+De} remote change(s)`)}catch(re){console.error("Pull failed:",re),U(`pull failed (${re.message.slice(0,60)})`)}},Qt=async()=>{if(z||!e||!ge||On.current)return;const re=ut,ue=xi.current;try{let Ue=null;const ae=[];if(K){const ze=await(await ye(()=>Promise.resolve().then(()=>zr),void 0,import.meta.url)).timedFetch(`https://api.github.com/repos/${ge.owner}/${ge.repo}/contents/canvas.excalidraw?ref=${ge.branch}`,{cache:"no-store",headers:{Authorization:`Bearer ${K}`,Accept:"application/vnd.github.raw"}}).catch(()=>null);ze!=null&&ze.ok?Ue=await ze.json().catch(()=>null):ze&&ae.push(`api ${ze.status}`)}if(!Ue&&!K){const _e=await ye(()=>Promise.resolve().then(()=>zr),void 0,import.meta.url);try{const ze=await _e.pollAnonymousScene(ge);if(ze.status==="fresh")Ue={elements:ze.elements,files:ze.files};else if(ze.status==="not-modified")return}catch{}}if(!Ue){const _e=await ye(()=>Promise.resolve().then(()=>zr),void 0,import.meta.url),ze=await fetch(_e.rawSceneUrl(ge),{cache:"no-store"}).catch(()=>null);ze!=null&&ze.ok?Ue=await ze.json().catch(()=>null):ze&&ae.push(`blob ${ze.status}`)}if(!Ue){const _e=await fetch("./canvas.excalidraw",{cache:"no-store"}).catch(()=>null);_e!=null&&_e.ok?Ue=await _e.json().catch(()=>null):_e&&ae.push(`pages ${_e.status}`)}if(!Ue){U(ae.length>0?`pull failed (${ae.join(", ")})`:"pull failed (network)");return}if(U(null),ue!==xi.current||On.current)return;const X=Ue.elements||[],se=JSON.stringify(X);if(se===Fn.current)return;if(re){if(se!==S.current){S.current=se;const{added:_e,updated:ze}=Zxe(C.current,X);if(_e+ze>0){let en=!1;if(Me&&ge)try{const sn=await(await ye(()=>Promise.resolve().then(()=>zr),void 0,import.meta.url)).lastCanvasCommit(ge,K);en=!!sn&&sn.author===Me}catch{}if(!en){w(!0);const Ht=_e>0?`${_e} new element${_e===1?"":"s"}${ze?`, ${ze} changed`:""}`:`${ze} element${ze===1?"":"s"} changed`;k(`Teammate updated canvas (${Ht}) — Pull to merge`)}}}return}const be=n.current;if(!be||V(be.getSceneElements().filter(_e=>!_e.isDeleted))!==B.current)return;const De=Ao(X.map(Li));W(be,{elements:De,captureUpdate:le.NEVER}),Ue.files&&fr(be,Ue.files),Fn.current=se,C.current=X,B.current=V(be.getSceneElements().filter(_e=>!_e.isDeleted)),zt(!1)}catch(Ue){console.error("GitHub pull failed:",Ue),U(`pull failed (${Ue.message.slice(0,60)})`)}},Kr=I.useRef(null);I.useEffect(()=>{if(z)return;const re=K?2e4:9e4,ue=()=>{document.hidden||(Si(!1),Qt())},Ue=setInterval(ue,re),ae=()=>{if(document.hidden){Kr.current=Date.now();return}const X=Kr.current!=null?Date.now()-Kr.current:1/0;Kr.current=null,X>2e4&&ue()};return document.addEventListener("visibilitychange",ae),window.addEventListener("focus",ae),window.addEventListener("blur",ae),()=>{clearInterval(Ue),document.removeEventListener("visibilitychange",ae),window.removeEventListener("focus",ae),window.removeEventListener("blur",ae)}},[z,K,ge,ut,e,ee]);const _c=I.useRef(()=>{}),gs=I.useRef(()=>!1),ho=I.useRef(z);ho.current=z,_c.current=()=>{ho.current?Us({silent:!0}):Si(!1)},gs.current=()=>fl(),I.useEffect(()=>{const re=()=>{document.hidden&&(gs.current(),_c.current())},ue=()=>{gs.current()},Ue=ae=>{!gs.current()&&ut&&(ae.preventDefault(),ae.returnValue="")};return document.addEventListener("visibilitychange",re),window.addEventListener("pagehide",ue),window.addEventListener("beforeunload",Ue),()=>{document.removeEventListener("visibilitychange",re),window.removeEventListener("pagehide",ue),window.removeEventListener("beforeunload",Ue)}},[ut]);const Si=async re=>{var ae,X;if(z||!e||!K||!ge||ee!=="editor"||On.current||B.current===null)return;const ue=n.current;if(!ue)return;const Ue=ue.getSceneElements().filter(se=>!se.isDeleted);if(V(Ue)===B.current){zt(!1);return}On.current=!0,xi.current+=1,l("syncing");try{const se=await ye(()=>Promise.resolve().then(()=>zr),void 0,import.meta.url),be=ue.getFiles();let Xe=null;const De=await se.pushScene(ge,K,{elements:Ue,files:be},{keepalive:re,base:C.current,sha:Tn.current}).catch(Ht=>(Xe=(Ht==null?void 0:Ht.message)||"push failed",null));if(!De){if(!re){l("error");const Ht=String(Xe||"network"),sn=Ht.includes("Resource not accessible by integration")?"repo not in the Excalidrop app installation — add it, then re-login":Ht.slice(0,80);U(`save failed (${sn})`)}return}Tn.current=De.sha;try{localStorage.setItem(`excalidrop_sha_${ge.owner}_${ge.repo}`,De.sha)}catch{}const _e=new Set(Ue.map(Ht=>Ht.id)),ze=De.elements.filter(Ht=>(Ht==null?void 0:Ht.id)&&!_e.has(Ht.id));if(ze.length>0){const Ht=ue.getSceneElements().map(Li);W(ue,{elements:Ao([...Ht,...ze.map(Li)]),captureUpdate:le.NEVER})}const en=ue.getSceneElements().filter(Ht=>!Ht.isDeleted);B.current=V(en),Fn.current=JSON.stringify(De.elements),C.current=De.elements,zt(!1),U(null),sp(ap(xr.current)),!re&&((((ae=De.conflicts)==null?void 0:ae.length)||0)>0||(De.added||0)+(De.updated||0)>0)&&k((X=De.conflicts)!=null&&X.length?`Saved + merged ${De.added+De.updated} remote change(s), ${De.conflicts.length} conflict(s) kept newer`:`Saved + merged ${De.added+De.updated} remote change(s)`),re||(f(new Date),l("success"),setTimeout(()=>l("idle"),2e3))}catch(se){if(console.error("GitHub push failed:",se),String(se.message).includes("403")&&ge&&K)try{const be=await ye(()=>Promise.resolve().then(()=>zr),void 0,import.meta.url),{access:Xe}=await be.checkAccess(ge,K);de(Xe)}catch{de("viewer")}{l("error");const be=String((se==null?void 0:se.message)||"network"),Xe=be.includes("Resource not accessible by integration")?"repo not in the Excalidrop app installation — add it, then re-login":be.slice(0,80);U(`save failed (${Xe})`)}}finally{On.current=!1,xi.current+=1}};I.useEffect(()=>{e&&z&&!s&&Qr()},[e,s,z]);const fo=re=>{const ue=n.current;if(!ue)return!1;for(const ae of re)((ae==null?void 0:ae.type)==="embeddable"||(ae==null?void 0:ae.type)==="iframe")&&typeof(ae==null?void 0:ae.id)=="string"&&F.current.add(ae.id);const Ue=ue.getSceneElements().filter(ae=>!ae.isDeleted);if(Ue.length>0&&B.current!==null&&V(Ue)!==B.current){const ae=new Set(Ue.map(se=>se.id)),X=re.filter(se=>(se==null?void 0:se.id)&&!ae.has(se.id));return X.length>0&&W(ue,{elements:Ao([...Ue.map(Li),...X]),captureUpdate:le.NEVER}),!0}return W(ue,{elements:re,captureUpdate:le.NEVER}),!1},ml=I.useRef(!1),Hi=I.useRef(0);I.useEffect(()=>{if(!(!e||ml.current)){if(z){ml.current=!0,Ta();return}je&&(ml.current=!0,Ta())}},[e,z,ge,je]);const Ta=async()=>{try{if(!lM())try{const X=await fetch("/api/elements",{headers:s3()}).catch(()=>null);if(X!=null&&X.ok){let se=null;try{se=await X.json()}catch{se=null}if(se!=null&&se.success&&se.elements){if(se.elements.length>0){const Xe=se.elements.map(Li),De=Ao(Xe);e&&fo(De)}const be=await fetch("/api/files",{headers:s3()});if(be.ok){const Xe=await be.json();Xe.files&&(e==null||e.addFiles(Object.values(Xe.files)))}await wa(se.elements||[])&&setTimeout(()=>{Us({silent:!0})},1500);return}}}catch{}const ue=await(await ye(()=>Promise.resolve().then(()=>zr),void 0,import.meta.url)).loadStaticScene(ge,K),Ue=Ao((ue.elements||[]).map(Li)),ae=e?fo(Ue):!1;if(ue.files&&e&&fr(e,ue.files),e){B.current=V(e.getSceneElements().filter(se=>!se.isDeleted)),Fn.current=JSON.stringify(ue.elements||[]),C.current=ue.elements||[];const X=await wa(ue.elements||[]);zt(ae||X),X&&setTimeout(()=>{Si(!1)},1500)}}catch(re){if(console.error("Error loading existing elements:",re),Hi.current<5&&!z&&je){Hi.current+=1;const ue=Hi.current**2*1500;setTimeout(()=>{Ta()},ue)}}},Wi=I.useRef(0),Or=5,Qr=()=>{if(c.current&&c.current.readyState===WebSocket.OPEN||Wi.current>=Or)return;const ue=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}`;c.current=new WebSocket(ue),c.current.onopen=()=>{Wi.current=0,o(!0),e&&setTimeout(Ta,100)},c.current.onmessage=Ue=>{try{const ae=JSON.parse(Ue.data);po(ae)}catch(ae){console.error("Error parsing WebSocket message:",ae,Ue.data)}},c.current.onclose=Ue=>{o(!1),Ue.code!==1e3&&Wi.current<Or&&(Wi.current+=1,setTimeout(Qr,3e3))},c.current.onerror=Ue=>{console.error("WebSocket error:",Ue),o(!1)}},po=async re=>{const ue=n.current;if(ue)try{const Ue=ue.getSceneElements(),ae=X=>{if(X.length===0)return;const se=new Map;X.forEach(De=>{De.id&&se.set(De.id,De)});const be=Ue.map(De=>{const _e=se.get(De.id);return _e?(se.delete(De.id),{...De,..._e}):De});be.push(...se.values());const Xe=Ao(be);W(ue,{elements:Xe,captureUpdate:le.NEVER})};switch(re.type){case"initial_elements":if(re.elements&&re.elements.length>0){const X=re.elements.map(Li),se=Ao(X);W(ue,{elements:se,captureUpdate:le.NEVER})}re.files&&ue.addFiles(Object.values(re.files));break;case"files_added":Array.isArray(re.files)&&ue.addFiles(re.files);break;case"element_created":if(re.element){const X=Li(re.element);ae([X])}break;case"element_updated":if(re.element){const X=Li(re.element);ae([X])}break;case"element_deleted":if(re.elementId){const X=Ue.filter(se=>se.id!==re.elementId);W(ue,{elements:X,captureUpdate:le.NEVER})}break;case"elements_batch_created":if(re.elements){const X=re.elements.map(Li);ae(X)}break;case"elements_synced":console.log(`Sync confirmed by server: ${re.count} elements`);break;case"sync_status":console.log(`Server sync status: ${re.count} elements`);break;case"canvas_cleared":console.log("Canvas cleared by server"),W(ue,{elements:[],captureUpdate:le.NEVER});break;case"export_image_request":if(re.requestId)try{const X=ue.getSceneElements(),se=ue.getAppState(),be=ue.getFiles();if(re.format==="svg"){const Xe=await zU({elements:X,appState:{...se,exportBackground:re.background!==!1},files:be}),De=new XMLSerializer().serializeToString(Xe);await fetch("/api/export/image/result",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({requestId:re.requestId,format:"svg",data:De})})}else{const Xe=await $L({elements:X,appState:{...se,exportBackground:re.background!==!1},files:be,mimeType:"image/png"}),De=new FileReader;De.onload=async()=>{try{const _e=De.result,ze=_e==null?void 0:_e.split(",")[1];if(!ze)throw new Error("Could not extract base64 data from result");await fetch("/api/export/image/result",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({requestId:re.requestId,format:"png",data:ze})})}catch(_e){console.error("Image export (FileReader) failed:",_e),await fetch("/api/export/image/result",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({requestId:re.requestId,error:_e.message})}).catch(()=>{})}},De.onerror=async()=>{var _e;console.error("FileReader error:",De.error),await fetch("/api/export/image/result",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({requestId:re.requestId,error:((_e=De.error)==null?void 0:_e.message)||"FileReader failed"})}).catch(()=>{})},De.readAsDataURL(Xe)}}catch(X){console.error("Image export failed:",X),await fetch("/api/export/image/result",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({requestId:re.requestId,error:X.message})})}break;case"set_viewport":if(console.log("Received viewport control request",re),re.requestId)try{if(re.scrollToContent){const X=ue.getSceneElements();X.length>0&&ue.scrollToContent(X,{fitToViewport:!0,animate:!0})}else if(re.scrollToElementId){const se=ue.getSceneElements().find(be=>be.id===re.scrollToElementId);if(se)ue.scrollToContent([se],{fitToViewport:!1,animate:!0});else throw new Error(`Element ${re.scrollToElementId} not found`)}else{const X={};re.zoom!==void 0&&(X.zoom={value:re.zoom}),re.offsetX!==void 0&&(X.scrollX=re.offsetX),re.offsetY!==void 0&&(X.scrollY=re.offsetY),Object.keys(X).length>0&&W(ue,{appState:X})}await fetch("/api/viewport/result",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({requestId:re.requestId,success:!0,message:"Viewport updated"})})}catch(X){console.error("Viewport control failed:",X),await fetch("/api/viewport/result",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({requestId:re.requestId,error:X.message})}).catch(()=>{})}break;case"mermaid_convert":if(console.log("Received Mermaid conversion request from MCP"),re.mermaidDiagram)try{const X=await vxe(re.mermaidDiagram,re.config||xxe);if(X.error){console.error("Mermaid conversion error:",X.error);return}if(X.elements&&X.elements.length>0){const se=Sh(X.elements,{regenerateIds:!1});W(ue,{elements:se,captureUpdate:le.IMMEDIATELY}),X.files&&ue.addFiles(Object.values(X.files)),console.log("Mermaid diagram converted successfully:",X.elements.length,"elements"),await Us()}}catch(X){console.error("Error converting Mermaid diagram from WebSocket:",X)}break;default:console.log("Unknown WebSocket message type:",re.type)}}catch(Ue){console.error("Error processing WebSocket message:",Ue,re)}},mo=re=>({...re}),go=re=>re?re.toLocaleTimeString("zh-CN",{hour:"2-digit",minute:"2-digit",second:"2-digit"}):"",Us=async(re={})=>{const{silent:ue=!1,keepalive:Ue=!1}=re;if(!e){console.warn("Excalidraw API not available");return}if(!R.current){M.current&&(clearTimeout(M.current),M.current=null),R.current=!0,ue||l("syncing");try{const ae=e.getSceneElements();console.log(`Syncing ${ae.length} elements to backend`);const X=ae.filter(_e=>!_e.isDeleted),se=e.getFiles(),be=Object.values(se),Xe=X.map(mo),De=await fetch("/api/elements/sync",{method:"POST",keepalive:Ue,headers:{"Content-Type":"application/json"},body:JSON.stringify({elements:Xe,timestamp:new Date().toISOString()})});if(De.ok){const _e=await De.json();if(console.log(`Sync successful: ${_e.count} elements synced`),be.length>0){console.log(`Syncing ${be.length} files to backend`);const ze=await fetch("/api/files",{method:"POST",keepalive:Ue,headers:{"Content-Type":"application/json"},body:JSON.stringify(be)});if(ze.ok){const en=await ze.json();console.log(`Files sync successful: ${en.count} files synced`)}else console.error("Files sync failed:",await ze.text())}f(new Date),sp(ap(xr.current)),ue||(l("success"),setTimeout(()=>l("idle"),2e3))}else{const _e=await De.json();console.error("Sync failed:",_e.error),ue||l("error")}}catch(ae){console.error("Sync error:",ae),ue||l("error")}finally{R.current=!1}}},_i=()=>{!s||!e||P.current&&(j.current>0||(M.current&&clearTimeout(M.current),M.current=setTimeout(()=>{M.current=null,!(j.current>0||R.current)&&Us({silent:!0})},qxe)))},Gd=m.jsxs("div",{className:"pill",title:i||g||void 0,children:[m.jsx("div",{className:`status-dot ${(z?s:ee==="editor")&&!g?"status-connected":"status-disconnected"}`}),m.jsx("span",{children:z?s?"Live":"Offline":ee==="unknown"?"Checking access…":i||g||(ee==="editor"?d==="syncing"?"Saving…":ut?"Unsaved changes":h?`Saved ${go(h)}${Me?` · ${Me}`:""}`:`Can edit${Me?` · ${Me}`:""}`:xe==="expired"?"Session expired":xe==="no-repo"?"No repo — add ?repo=owner/name":xe==="repo-not-covered"||xe==="app-not-installed"?"Read-only — app not installed":"Read-only")}),!z&&ee==="denied"&&xe!=="no-repo"&&m.jsx("button",{className:"save-icon-btn",title:xe==="expired"?"Session expired — log in again":"Log in with GitHub to edit","aria-label":"Log in with GitHub",onClick:()=>{ka()},children:m.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[m.jsx("path",{d:"M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4"}),m.jsx("polyline",{points:"10 17 15 12 10 7"}),m.jsx("line",{x1:"15",y1:"12",x2:"3",y2:"12"})]})}),!z&&ee==="denied"&&(xe==="repo-not-covered"||xe==="app-not-installed")&&m.jsx("a",{className:"install-link",href:`https://github.com/apps/${(Ji==null?void 0:Ji.VITE_GITHUB_APP_SLUG)||"excalidrop"}/installations/new`,target:"_blank",rel:"noreferrer",title:"The canvas token is valid, but the Excalidrop GitHub App isn't installed on this repo — install it for write access",children:"Install app"}),!z&&ee==="editor"&&m.jsxs(m.Fragment,{children:[x&&m.jsx("button",{className:"save-icon-btn pull-available",title:"Pull teammate changes","aria-label":"Pull teammate changes",onClick:()=>{ms()},children:m.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[m.jsx("polyline",{points:"17 1 21 5 17 9"}),m.jsx("path",{d:"M3 11V9a4 4 0 0 1 4-4h14"}),m.jsx("polyline",{points:"7 23 3 19 7 15"}),m.jsx("path",{d:"M21 13v2a4 4 0 0 1-4 4H3"})]})}),m.jsx("button",{className:"save-icon-btn",title:"Save now (Cmd/Ctrl+S)","aria-label":"Save now",onClick:()=>{Si(!1)},children:m.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[m.jsx("path",{d:"M19 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11l5 5v11a2 2 0 0 1-2 2z"}),m.jsx("polyline",{points:"17 21 17 13 7 13 7 21"}),m.jsx("polyline",{points:"7 3 7 8 15 8"})]})})]})]}),Xi=()=>{const[re,ue]=I.useState(null);if(I.useEffect(()=>{const ae=()=>{const X=document.querySelector(".excalidraw .mobile-misc-tools-container");return X?(ue(X),!0):!1};if(!ae()){const X=new MutationObserver(()=>{ae()&&X.disconnect()});return X.observe(document.body,{childList:!0,subtree:!0}),window.addEventListener("resize",ae),()=>{X.disconnect(),window.removeEventListener("resize",ae)}}return window.addEventListener("resize",ae),()=>window.removeEventListener("resize",ae)},[]),!re||z||ee!=="editor")return null;const Ue=d==="syncing"?"Saving…":ut?"Unsaved changes — tap to save":h?`Saved ${go(h)}`:"Saved — tap to save";return Jn.createPortal(m.jsx("button",{className:`mobile-save-btn${ut||d==="syncing"?" dirty":""}`,title:Ue,"aria-label":"Save now",onClick:()=>{Si(!1)},children:m.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[m.jsx("path",{d:"M19 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11l5 5v11a2 2 0 0 1-2 2z"}),m.jsx("polyline",{points:"17 21 17 13 7 13 7 21"}),m.jsx("polyline",{points:"7 3 7 8 15 8"})]})}),re)};return m.jsxs("div",{className:"app",children:[m.jsx("footer",{id:"contentinfo",children:y&&m.jsx("div",{className:"toast",role:"status",onClick:()=>v(null),children:m.jsx("span",{children:y})})}),m.jsx("div",{className:"canvas-container",children:m.jsxs("div",{onPointerDownCapture:()=>{P.current=!0},onKeyDownCapture:()=>{P.current=!0},style:{width:"100%",height:"100%"},children:[m.jsxs(fx,{viewModeEnabled:!z&&ee!=="editor",excalidrawAPI:re=>t(re),validateEmbeddable:!0,onChange:()=>{if(z){_i(),lo();return}if(j.current)return;const re=n.current;if(!re||q(re))return;const ue=V(re.getSceneElements().filter(Ue=>!Ue.isDeleted));B.current===null||ue!==B.current?(zt(!0),lo()):(zt(!1),sp(ap(xr.current)))},initialData:{elements:[],appState:{theme:"light",viewBackgroundColor:"#ffffff"}},children:[m.jsxs(Zt,{children:[m.jsx(Zt.DefaultItems.LoadScene,{}),m.jsx(Zt.DefaultItems.SaveToActiveFile,{}),m.jsx(Zt.DefaultItems.Export,{}),m.jsx(Zt.DefaultItems.SaveAsImage,{}),m.jsx(Zt.Separator,{}),!z&&ee==="editor"&&m.jsx(Zt.Item,{icon:m.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[m.jsx("path",{d:"M19 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11l5 5v11a2 2 0 0 1-2 2z"}),m.jsx("polyline",{points:"17 21 17 13 7 13 7 21"}),m.jsx("polyline",{points:"7 3 7 8 15 8"})]}),shortcut:"Ctrl+S",onSelect:()=>{Si(!1)},children:"Save now"}),m.jsx(Zt.DefaultItems.ClearCanvas,{}),m.jsx(Zt.DefaultItems.ChangeCanvasBackground,{}),m.jsx(Zt.DefaultItems.ToggleTheme,{}),m.jsx(Zt.Separator,{}),m.jsx(Zt.DefaultItems.SearchMenu,{}),m.jsx(Zt.DefaultItems.CommandPalette,{})]}),m.jsx(PN,{children:Gd})]}),m.jsx(Xi,{})]})})]})}const g$=document.getElementById("root");if(!g$)throw new Error("Root element not found");const a4e=e=>e instanceof HTMLElement?e.closest(".excalidraw__canvas canvas, .excalidraw__canvas")!==null:!1;window.addEventListener("wheel",e=>{!e.ctrlKey&&!e.metaKey||(e.preventDefault(),a4e(e.target)||e.stopPropagation())},{passive:!1,capture:!0});window.addEventListener("gesturestart",e=>e.preventDefault(),{passive:!1});window.addEventListener("gesturechange",e=>e.preventDefault(),{passive:!1});window.addEventListener("keydown",e=>{(e.ctrlKey||e.metaKey)&&(e.key==="+"||e.key==="-"||e.key==="="||e.key==="0")&&e.preventDefault()},{capture:!0});hz.createRoot(g$).render(m.jsx(ke.StrictMode,{children:m.jsx(i4e,{})}));const U$=Object.freeze(Object.defineProperty({__proto__:null,decodePngMetadata:Rie,encodePngMetadata:UR,getTEXtChunk:gR},Symbol.toStringTag,{value:"Module"})),s4e=Object.freeze(Object.defineProperty({__proto__:null,alerts:ER,buttons:wR,canvasError:MR,clearCanvasDialog:PR,colorPicker:VR,colors:WR,commandPalette:QR,confirmDialog:FR,default:v7,element:_R,elementLink:yR,encrypted:BR,errorDialog:RR,errorSplash:IR,errors:CR,exportDialog:DR,fontList:ZR,headings:kR,helpDialog:jR,hints:TR,imageExportDialog:$R,labels:bR,library:vR,mermaid:GR,overwriteConfirm:YR,publishDialog:NR,publishSuccessDialog:OR,quickSearch:qR,roomDialog:LR,search:xR,shareDialog:AR,stats:zR,toast:HR,toolBar:SR,userList:KR,welcomeScreen:XR},Symbol.toStringTag,{value:"Module"})),o4e=Object.freeze(Object.defineProperty({__proto__:null,default:tD,en:JR,kaa:eD},Symbol.toStringTag,{value:"Module"}));export{C4e as $,e3 as A,QN as B,a0e as C,xxe as D,Js as E,m2e as F,JO as G,dye as H,eo as I,Y1e as J,D4e as K,V3e as L,eye as M,K1e as N,q3e as O,cF as P,Nx as Q,Dbe as R,$i as S,wx as T,ft as U,v4e as V,E4e as W,Jk as X,Qk as Y,S4e as Z,ye as _,F3e as a,M1 as a$,w4e as a0,b4e as a1,y4e as a2,k4e as a3,x4e as a4,_4e as a5,Tbe as a6,DT as a7,M4e as a8,Obe as a9,E2e as aA,y2e as aB,x2e as aC,v2e as aD,b2e as aE,p2e as aF,f2e as aG,U2e as aH,g2e as aI,A5e as aJ,W8 as aK,V5e as aL,ie as aM,Ne as aN,G5e as aO,eU as aP,pi as aQ,zme as aR,Ux as aS,JN as aT,c0 as aU,nO as aV,U4e as aW,bx as aX,Gl as aY,Vk as aZ,qme as a_,wbe as aa,T4e as ab,A3e as ac,Kbe as ad,Wbe as ae,h2e as af,Qbe as ag,d0 as ah,Ke as ai,at as aj,z3e as ak,Hp as al,ya as am,M6e as an,Kl as ao,j1e as ap,u0 as aq,I2e as ar,A2e as as,M2e as at,T2e as au,k2e as av,_2e as aw,S2e as ax,w2e as ay,C2e as az,N3e as b,Xd as b0,k5e as b1,v5e as b2,T5e as b3,M5e as b4,zO as b5,v6 as b6,C6 as b7,o6e as b8,Tx as b9,v6e as bA,l4e as bB,zr as bC,WO as ba,BO as bb,a5e as bc,t5e as bd,h0 as be,Vh as bf,K2 as bg,h5e as bh,Q5e as bi,J2 as bj,s5e as bk,jO as bl,d6e as bm,u6e as bn,qc as bo,wT as bp,h6e as bq,Mx as br,c6e as bs,m6e as bt,Yh as bu,Sc as bv,UT as bw,Ix as bx,NO as by,Y8 as bz,vxe as c,P3e as d,ia as e,LF as f,zx as g,Ar as h,nU as i,Ah as j,sI as k,et as l,Dx as m,$L as n,aye as o,f0 as p,B3e as q,zU as r,O3e as s,$3e as t,j4e as u,j3e as v,rye as w,Vp as x,x5e as y,kx as z};