@kabmo-labs/kabmo 0.32.1 → 0.33.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (266) hide show
  1. package/dist/client/index.html +1 -1
  2. package/dist/client/index.js +542 -535
  3. package/dist/client/static/js/{CsvGrid-4gx0jevc.js → CsvGrid-fncjbg6j.js} +2 -2
  4. package/dist/client/static/js/{DocxView-0667nr8h.js → DocxView-c9v2vr3r.js} +2 -2
  5. package/dist/client/static/js/{DrawioView-522v0d0r.js → DrawioView-vxjksm12.js} +2 -2
  6. package/dist/client/static/js/{ImageView-t8xp60hm.js → ImageView-a3g5k226.js} +1 -1
  7. package/dist/client/static/js/LayoutWrapper-hnjfwsjh.js +2 -0
  8. package/dist/client/static/js/Modal-qtftcp2t.js +38 -0
  9. package/dist/client/static/js/{PdfView-3fx172xh.js → PdfView-ksaes53y.js} +1 -1
  10. package/dist/client/static/js/{SessionsView-n3agmf5t.js → SessionsView-30vcr95v.js} +1 -1
  11. package/dist/client/static/js/{SheetView-nmrdb1b8.js → SheetView-vc484scg.js} +6 -6
  12. package/dist/client/static/js/{SvgPreview-0xsc6xam.js → SvgPreview-tph89jet.js} +1 -1
  13. package/dist/client/static/js/{abnfDiagram-O67JEVCF-jj31rs62.js → abnfDiagram-O67JEVCF-xbar278c.js} +1 -1
  14. package/dist/client/static/js/architecture-7GRP2DOG-tavtgb8a.js +1 -0
  15. package/dist/client/static/js/{architectureDiagram-NJMV4G6O-ay3yr7pf.js → architectureDiagram-NJMV4G6O-s171n2z6.js} +3 -3
  16. package/dist/client/static/js/{astro-qgx1r159.js → astro-80bs6hvg.js} +1 -1
  17. package/dist/client/static/js/bash-b3rwyg5p.js +1 -0
  18. package/dist/client/static/js/{blockDiagram-BEXU5L5S-4x33e16k.js → blockDiagram-BEXU5L5S-gzx6rv9n.js} +2 -2
  19. package/dist/client/static/js/{c4Diagram-YGBWAQC7-dtb81cgz.js → c4Diagram-YGBWAQC7-7f00skch.js} +2 -2
  20. package/dist/client/static/js/{classDiagram-v2-NBCMYWYE-vk5a2n9w.js → classDiagram-v2-NBCMYWYE-j79v95nc.js} +4 -4
  21. package/dist/client/static/js/{cose-bilkent-JH36ORCC-6rbjbe19.js → cose-bilkent-JH36ORCC-5fkn7ee5.js} +1 -1
  22. package/dist/client/static/js/css-6vj0d308.js +1 -0
  23. package/dist/client/static/js/cynefin-OW5HDTMX-cdh3n2z2.js +1 -0
  24. package/dist/client/static/js/{cynefinDiagram-VND7K2PF-vyjksedr.js → cynefinDiagram-VND7K2PF-cfs1yvrd.js} +2 -2
  25. package/dist/client/static/js/{dagre-6A5THRUB-7hey38z5.js → dagre-6A5THRUB-44bgc48p.js} +2 -2
  26. package/dist/client/static/js/{diagram-22UHCM2B-aes06jde.js → diagram-22UHCM2B-a4g4x83k.js} +14 -14
  27. package/dist/client/static/js/{diagram-3UASUU5V-3cfkgm3x.js → diagram-3UASUU5V-gm4rg5na.js} +1 -1
  28. package/dist/client/static/js/{diagram-ATOU4E4O-z8mfhwpy.js → diagram-ATOU4E4O-a95y41vk.js} +3 -3
  29. package/dist/client/static/js/{diagram-CDSNMT55-t4821ctz.js → diagram-CDSNMT55-t3j93mmc.js} +5 -5
  30. package/dist/client/static/js/{diagram-MLGK6HIB-23yxbfrx.js → diagram-MLGK6HIB-c2wdez02.js} +1 -1
  31. package/dist/client/static/js/{diagram-MPIPVDR6-chhtf7v0.js → diagram-MPIPVDR6-gya9jhs5.js} +2 -2
  32. package/dist/client/static/js/{dockerfile-5b87ghm7.js → dockerfile-a7q6174s.js} +1 -1
  33. package/dist/client/static/js/{ebnfDiagram-ZINNZB2B-9jejcvfr.js → ebnfDiagram-ZINNZB2B-jjhkza6t.js} +1 -1
  34. package/dist/client/static/js/{elk-276RUBZZ-xhhtkf58.js → elk-276RUBZZ-f7re45mw.js} +1 -1
  35. package/dist/client/static/js/{erDiagram-OPXOYQCR-mt2apjjb.js → erDiagram-OPXOYQCR-tpm9g5te.js} +6 -6
  36. package/dist/client/static/js/{erlang-6m6tpt72.js → erlang-qt876zrq.js} +1 -1
  37. package/dist/client/static/js/eventmodeling-NTZA5JFV-as97tpyp.js +1 -0
  38. package/dist/client/static/js/flowDiagram-KWPJA3E3-ggm06d12.js +1 -0
  39. package/dist/client/static/js/{ganttDiagram-FUAMR5RP-8cm7a29w.js → ganttDiagram-FUAMR5RP-fz43n12d.js} +3 -3
  40. package/dist/client/static/js/gitGraph-4MIJSDKK-eqz7p9ng.js +1 -0
  41. package/dist/client/static/js/{gitGraphDiagram-X574FWY7-5s0gbnx2.js → gitGraphDiagram-X574FWY7-f61hgbn6.js} +9 -9
  42. package/dist/client/static/js/graphql-n43pd5fs.js +1 -0
  43. package/dist/client/static/js/{index-z5s27s26.js → index-03h3bkcf.js} +1 -1
  44. package/dist/client/static/js/{index-360d7j0d.js → index-0e40xskg.js} +1 -1
  45. package/dist/client/static/js/{index-z4v1xmh1.js → index-0n5wwe60.js} +2 -2
  46. package/dist/client/static/js/{index-pf7syd7t.js → index-0tf0arsp.js} +3 -3
  47. package/dist/client/static/js/{index-fdbfzshx.js → index-14vndmcr.js} +2 -2
  48. package/dist/client/static/js/{index-7n68yx6m.js → index-1a0zkj8h.js} +2 -2
  49. package/dist/client/static/js/{index-p7btwjvj.js → index-1xqs14fr.js} +3 -3
  50. package/dist/client/static/js/{index-brj8qwa6.js → index-1y9r4frb.js} +2 -2
  51. package/dist/client/static/js/{index-6q80csr0.js → index-2svnq5gg.js} +1 -1
  52. package/dist/client/static/js/{index-9sd0vjmh.js → index-2x5f66t6.js} +2 -2
  53. package/dist/client/static/js/{index-dt7e1328.js → index-354mqqra.js} +2 -2
  54. package/dist/client/static/js/{index-5x95n3hx.js → index-3rcjx70v.js} +1 -1
  55. package/dist/client/static/js/{index-532btjmp.js → index-3zc1b0dv.js} +2 -2
  56. package/dist/client/static/js/{index-wzma5n54.js → index-5tgq7aqx.js} +1 -1
  57. package/dist/client/static/js/{index-xya34x4v.js → index-76zb4m0n.js} +2 -2
  58. package/dist/client/static/js/{index-2xj14800.js → index-7y6rpsrp.js} +2 -2
  59. package/dist/client/static/js/{index-h06bcfds.js → index-8239j2v1.js} +1 -1
  60. package/dist/client/static/js/{index-dq1kdt03.js → index-9fjt5anh.js} +1 -1
  61. package/dist/client/static/js/{index-ehcpzk5b.js → index-9y3gjdj7.js} +1 -1
  62. package/dist/client/static/js/{index-sa9cp6km.js → index-ahv9y42z.js} +2 -2
  63. package/dist/client/static/js/{index-vd0e25p0.js → index-ajs3jj6j.js} +1 -1
  64. package/dist/client/static/js/{index-qnwqaczk.js → index-apvkd37e.js} +3 -3
  65. package/dist/client/static/js/index-at6bhjyf.js +1 -0
  66. package/dist/client/static/js/index-bkye8mz4.js +2 -0
  67. package/dist/client/static/js/{index-dnp07j57.js → index-d495kfm0.js} +1 -1
  68. package/dist/client/static/js/{index-gbfg0anm.js → index-dbe6afkf.js} +2 -2
  69. package/dist/client/static/js/{index-g33knza2.js → index-djmg1d7h.js} +1 -1
  70. package/dist/client/static/js/{index-629kfbcb.js → index-e4p4cd3r.js} +2 -2
  71. package/dist/client/static/js/{index-5y7c62sm.js → index-eyzeya95.js} +5 -5
  72. package/dist/client/static/js/{index-3vhznzgr.js → index-gcs49f3p.js} +1 -1
  73. package/dist/client/static/js/{index-59jb53v3.js → index-gs6f0qwa.js} +2 -2
  74. package/dist/client/static/js/{index-7fdp9c7m.js → index-hf52f59k.js} +2 -2
  75. package/dist/client/static/js/{index-qkscve6n.js → index-j0r5hj0j.js} +2 -2
  76. package/dist/client/static/js/{index-ay34b398.js → index-js7t1vb1.js} +17 -17
  77. package/dist/client/static/js/{index-a0bdavdr.js → index-km2zb6wk.js} +2 -2
  78. package/dist/client/static/js/{index-ye3sr7db.js → index-m73za75e.js} +2 -2
  79. package/dist/client/static/js/{index-kpspnztv.js → index-pbe4yed4.js} +2 -2
  80. package/dist/client/static/js/{index-a6k2hqke.js → index-pxv2nw9w.js} +1 -1
  81. package/dist/client/static/js/{index-jz9fpznk.js → index-q2w6s8n7.js} +5 -5
  82. package/dist/client/static/js/{index-h7pn9qw6.js → index-qckv9nte.js} +2 -2
  83. package/dist/client/static/js/{index-a733k69t.js → index-qsm2z36d.js} +2 -2
  84. package/dist/client/static/js/{index-pf5sbesf.js → index-rytaa8ca.js} +2 -2
  85. package/dist/client/static/js/{index-c0x6s6f7.js → index-sdtye3jy.js} +2 -2
  86. package/dist/client/static/js/index-sffjtm5w.js +12 -0
  87. package/dist/client/static/js/{index-ejgd8w3s.js → index-trm9x02n.js} +28 -28
  88. package/dist/client/static/js/{index-c93sp4yh.js → index-vw4brsdx.js} +1 -1
  89. package/dist/client/static/js/{index-hc2jmzpx.js → index-vw5k8csz.js} +46 -46
  90. package/dist/client/static/js/{index-2gfc25tq.js → index-w0fwb80e.js} +1 -1
  91. package/dist/client/static/js/{index-bbggh3f8.js → index-ypx3qmhq.js} +2 -2
  92. package/dist/client/static/js/{index-4s8ttfxj.js → index-zt75xpq0.js} +193 -193
  93. package/dist/client/static/js/{index-jppt5mgc.js → index-zvfvqvn9.js} +2 -2
  94. package/dist/client/static/js/info-A6RAGUB7-4pkzh1qx.js +1 -0
  95. package/dist/client/static/js/{infoDiagram-VRGFBTTK-3w1yz32c.js → infoDiagram-VRGFBTTK-1qj804sn.js} +1 -1
  96. package/dist/client/static/js/ini-j5dyq6gm.js +1 -0
  97. package/dist/client/static/js/{ishikawaDiagram-OU5B5YK6-ckt471dy.js → ishikawaDiagram-OU5B5YK6-4j4qsnzw.js} +3 -3
  98. package/dist/client/static/js/java-g4dgwbfd.js +1 -0
  99. package/dist/client/static/js/{journeyDiagram-ZHPQQLJL-kfvn4w7e.js → journeyDiagram-ZHPQQLJL-j0brnfft.js} +4 -4
  100. package/dist/client/static/js/jsx-7t5ecz9s.js +1 -0
  101. package/dist/client/static/js/{julia-0j0gsjvc.js → julia-4ghmfy3e.js} +1 -1
  102. package/dist/client/static/js/{kanban-definition-PNTS6WVX-0q36cm83.js → kanban-definition-PNTS6WVX-qqc22br0.js} +2 -2
  103. package/dist/client/static/js/lua-1g6w30de.js +1 -0
  104. package/dist/client/static/js/markdown-afx21x8c.js +1 -0
  105. package/dist/client/static/js/{mermaid.core-b1ssa824.js → mermaid.core-vv3wbe65.js} +6 -6
  106. package/dist/client/static/js/{mindmap-definition-NLK3R4M7-e2ym5en8.js → mindmap-definition-NLK3R4M7-y5b2z8zp.js} +2 -2
  107. package/dist/client/static/js/one-dark-pro-hm3f56n1.js +1 -0
  108. package/dist/client/static/js/one-light-xrz49rct.js +1 -0
  109. package/dist/client/static/js/packet-AYTQ26CC-yg71sp88.js +1 -0
  110. package/dist/client/static/js/{pegDiagram-GJSIUBJH-t8bbdyhe.js → pegDiagram-GJSIUBJH-0be07mqs.js} +1 -1
  111. package/dist/client/static/js/{perl-7n7e9ncg.js → perl-sd00t4b4.js} +1 -1
  112. package/dist/client/static/js/{php-32vy69vd.js → php-2zfyqa61.js} +1 -1
  113. package/dist/client/static/js/pie-WAS4IAKB-89wd6np0.js +1 -0
  114. package/dist/client/static/js/{pieDiagram-5QR66LMP-envv4brj.js → pieDiagram-5QR66LMP-544w86jk.js} +2 -2
  115. package/dist/client/static/js/properties-thd83wey.js +1 -0
  116. package/dist/client/static/js/python-264ns4xw.js +1 -0
  117. package/dist/client/static/js/{quadrantDiagram-O4NWA36T-72rk137a.js → quadrantDiagram-O4NWA36T-p09e7z5s.js} +4 -4
  118. package/dist/client/static/js/r-qw82kkv9.js +1 -0
  119. package/dist/client/static/js/radar-RG4KPBEZ-avn0b8r9.js +1 -0
  120. package/dist/client/static/js/railroad-74A4TZTK-de27xv5w.js +1 -0
  121. package/dist/client/static/js/railroad-abnf-HS5TGJTU-rg4zzj7x.js +1 -0
  122. package/dist/client/static/js/railroad-ebnf-LZEXJU2U-d84fhj8v.js +1 -0
  123. package/dist/client/static/js/railroad-peg-WCYAUIDC-dvf8xrmc.js +1 -0
  124. package/dist/client/static/js/{railroadDiagram-XR7U4H2S-1ej0f5hr.js → railroadDiagram-XR7U4H2S-de830ed2.js} +1 -1
  125. package/dist/client/static/js/{requirementDiagram-PLB6GJNP-rvdaknpd.js → requirementDiagram-PLB6GJNP-b47d74p1.js} +4 -4
  126. package/dist/client/static/js/{ruby-5ty7fys7.js → ruby-v9qaqhby.js} +1 -1
  127. package/dist/client/static/js/{rust-2geezrcs.js → rust-fkt0qyrs.js} +1 -1
  128. package/dist/client/static/js/{sankeyDiagram-IPEJSGJF-nxvhtdaw.js → sankeyDiagram-IPEJSGJF-6ezc2fpj.js} +5 -5
  129. package/dist/client/static/js/{sass-mey5150f.js → sass-9bxped7y.js} +1 -1
  130. package/dist/client/static/js/{sequenceDiagram-PO4LG4MO-n5cn5qrt.js → sequenceDiagram-PO4LG4MO-by5zqj6w.js} +18 -18
  131. package/dist/client/static/js/{sizeCapture-INFHLROL-r074kj7s.js → sizeCapture-INFHLROL-q85r06j6.js} +1 -1
  132. package/dist/client/static/js/{stateDiagram-v2-GCMORJYK-vxghxdb0.js → stateDiagram-v2-GCMORJYK-ep5pyexs.js} +3 -3
  133. package/dist/client/static/js/{svelte-3ewx0hzx.js → svelte-mwtx07d9.js} +1 -1
  134. package/dist/client/static/js/{swimlanes-2SLR337P-qkkv894p.js → swimlanes-2SLR337P-95fcqkh8.js} +1 -1
  135. package/dist/client/static/js/swimlanesDiagram-TC7HE7FX-xs2en5dv.js +8 -0
  136. package/dist/client/static/js/{timeline-definition-EJHVYXUP-5tbq4ex2.js → timeline-definition-EJHVYXUP-461e615g.js} +2 -2
  137. package/dist/client/static/js/treeView-Q6P3EWNA-mham0bh6.js +1 -0
  138. package/dist/client/static/js/treemap-WGGIJYW6-mxrxax86.js +1 -0
  139. package/dist/client/static/js/tsx-nm94hed6.js +1 -0
  140. package/dist/client/static/js/typescript-0s2t05jj.js +1 -0
  141. package/dist/client/static/js/{usecaseDiagram-POWQR4AR-6p8hf0b7.js → usecaseDiagram-POWQR4AR-ftqfnvhg.js} +37 -37
  142. package/dist/client/static/js/{vennDiagram-UO4OBE2U-7k5jsxf9.js → vennDiagram-UO4OBE2U-7t96h6ez.js} +7 -7
  143. package/dist/client/static/js/{vue-06rdf4wh.js → vue-j8vb9d7r.js} +1 -1
  144. package/dist/client/static/js/wardley-WFR3VGLG-8vrvh9p3.js +1 -0
  145. package/dist/client/static/js/{wardleyDiagram-VNRHLVJA-km2x4er8.js → wardleyDiagram-VNRHLVJA-0de8w8c6.js} +4 -4
  146. package/dist/client/static/js/xml-dz51p1m3.js +1 -0
  147. package/dist/client/static/js/{xychartDiagram-PMCCYNJV-kr3sgr4m.js → xychartDiagram-PMCCYNJV-dez9phkf.js} +5 -5
  148. package/dist/client/static/js/yaml-2cfkd30t.js +1 -0
  149. package/package.json +1 -1
  150. package/src/client/components/common/context-usage-button/McpSection.test.tsx +98 -0
  151. package/src/client/components/common/context-usage-button/McpSection.tsx +12 -5
  152. package/src/client/components/common/context-usage-button/SessionStats.tsx +80 -0
  153. package/src/client/components/common/context-usage-button/index.test.tsx +26 -0
  154. package/src/client/components/common/context-usage-button/index.tsx +36 -28
  155. package/src/client/components/common/harness-glyph/brands.ts +8 -0
  156. package/src/client/components/mobile/LayoutWrapper.tsx +12 -3
  157. package/src/client/components/mobile/mobile-right-sidebar/FullDiff.tsx +9 -2
  158. package/src/client/components/settings/apply-side-effects.test.ts +11 -0
  159. package/src/client/components/settings/apply-side-effects.ts +7 -0
  160. package/src/client/components/settings/categories/ChatSettings.test.tsx +1 -1
  161. package/src/client/components/settings/categories/ChatSettings.tsx +2 -0
  162. package/src/client/components/settings/categories/NotificationSettings.tsx +1 -1
  163. package/src/client/components/settings/categories/chat-settings/ChangedFilesSection.tsx +79 -0
  164. package/src/client/components/settings/categories/chat-settings/groups.ts +4 -3
  165. package/src/client/components/workspace/chat-timeline/ChangedFilesSummary.tsx +101 -0
  166. package/src/client/components/workspace/chat-timeline/MessageList.tsx +33 -1
  167. package/src/client/components/workspace/chat-timeline/RunFooter.tsx +21 -1
  168. package/src/client/components/workspace/chat-timeline/TimelineBody.tsx +13 -0
  169. package/src/client/components/workspace/chat-timeline/index.tsx +1 -1
  170. package/src/client/components/workspace/diff-panel/Toolbar.tsx +17 -51
  171. package/src/client/components/workspace/diff-panel/index.tsx +23 -4
  172. package/src/client/components/workspace/diff-panel/toolbar-git-actions.tsx +94 -0
  173. package/src/client/components/workspace/editor/Body.tsx +2 -0
  174. package/src/client/data/settings/omp-schema.json +73 -3
  175. package/src/client/hooks/chat/timeline/changed-files-setting.test.ts +31 -0
  176. package/src/client/hooks/chat/timeline/changed-files-setting.ts +60 -0
  177. package/src/client/hooks/chat/timeline/session-changes.ts +51 -0
  178. package/src/client/hooks/ui/notification-events.test.ts +3 -0
  179. package/src/client/hooks/ui/notification-events.ts +3 -1
  180. package/src/client/hooks/ui/notification-sound.ts +13 -6
  181. package/src/client/hooks/ui/ui-sounds.test.ts +15 -0
  182. package/src/client/hooks/workspace/diff-file.ts +11 -4
  183. package/src/client/hooks/workspace/file-tabs.ts +13 -4
  184. package/src/client/hooks/workspace/journal-diff.ts +97 -0
  185. package/src/client/lib/notifications/native-banner-sound.test.ts +93 -0
  186. package/src/client/lib/notifications/native-banner-sound.ts +46 -0
  187. package/src/client/lib/notifications/os.test.ts +14 -5
  188. package/src/client/lib/notifications/os.ts +8 -0
  189. package/src/server/lib/harness/launch-table.ts +10 -0
  190. package/src/server/lib/omp/session/changes.test.ts +138 -0
  191. package/src/server/lib/omp/session/changes.ts +220 -0
  192. package/src/server/lib/omp/session/session-discovery.test.ts +4 -4
  193. package/src/server/lib/omp/session/sidebar-activity.server.test.ts +6 -2
  194. package/src/server/lib/omp/session/subagent-presence-scan.ts +54 -0
  195. package/src/server/lib/omp/session/subagent-presence-store.test.ts +1 -1
  196. package/src/server/lib/omp/session/subagent-presence.test.ts +115 -0
  197. package/src/server/lib/omp/session/subagent-presence.ts +12 -3
  198. package/src/server/lib/omp/session/telemetry/compute.ts +68 -0
  199. package/src/server/lib/omp/session/telemetry.test.ts +81 -0
  200. package/src/server/routes/sessions/changes.test.ts +90 -0
  201. package/src/server/routes/sessions/changes.ts +55 -0
  202. package/src/server/routes/sessions/index.ts +6 -0
  203. package/src/shared/lib/chat/duration.ts +34 -0
  204. package/src/shared/lib/chat/timeline/changed-files.test.ts +121 -0
  205. package/src/shared/lib/chat/timeline/changed-files.ts +71 -0
  206. package/src/shared/lib/chat/timeline/fork-anchor.test.ts +3 -0
  207. package/src/shared/lib/format/duration.test.ts +31 -0
  208. package/src/shared/lib/format/duration.ts +27 -0
  209. package/src/shared/lib/fs/unified-diff.test.ts +53 -0
  210. package/src/shared/lib/fs/unified-diff.ts +127 -0
  211. package/src/shared/lib/harness/brand-color.ts +3 -0
  212. package/src/shared/lib/harness/catalog.test.ts +13 -0
  213. package/src/shared/lib/harness/catalog.ts +8 -1
  214. package/src/shared/lib/harness/fork.ts +4 -2
  215. package/src/shared/lib/harness/mcp-facts.ts +3 -0
  216. package/src/shared/lib/harness/provider-facts.ts +14 -0
  217. package/src/shared/lib/harness/updates.ts +5 -0
  218. package/src/shared/lib/icons/tint-hues.generated.ts +27 -27
  219. package/src/shared/lib/omp/config/schema.test.ts +4 -2
  220. package/src/shared/lib/settings/defaults.ts +1 -0
  221. package/src/shared/lib/workspace/file-tab-id.ts +9 -0
  222. package/src/shared/types/context.ts +18 -0
  223. package/src/shared/types/fs.ts +21 -0
  224. package/src/shared/types/index.ts +1 -0
  225. package/src/shared/types/omp/session.ts +6 -0
  226. package/src/shared/types/session-changes.ts +58 -0
  227. package/src/shared/types/settings/state.ts +8 -0
  228. package/dist/client/static/js/LayoutWrapper-xjnveecv.js +0 -2
  229. package/dist/client/static/js/Modal-k2jr9hc4.js +0 -38
  230. package/dist/client/static/js/architecture-7GRP2DOG-1y9zvsyt.js +0 -1
  231. package/dist/client/static/js/bash-m0qjsyy0.js +0 -1
  232. package/dist/client/static/js/css-t4ngafan.js +0 -1
  233. package/dist/client/static/js/cynefin-OW5HDTMX-k2188qcq.js +0 -1
  234. package/dist/client/static/js/eventmodeling-NTZA5JFV-pdr0qn0n.js +0 -1
  235. package/dist/client/static/js/flowDiagram-KWPJA3E3-zvz0mxne.js +0 -1
  236. package/dist/client/static/js/gitGraph-4MIJSDKK-wmqf046s.js +0 -1
  237. package/dist/client/static/js/graphql-692h0n2x.js +0 -1
  238. package/dist/client/static/js/index-61tm0v57.js +0 -1
  239. package/dist/client/static/js/index-kg86e3sy.js +0 -12
  240. package/dist/client/static/js/index-nmmxb4va.js +0 -2
  241. package/dist/client/static/js/info-A6RAGUB7-zg3twte6.js +0 -1
  242. package/dist/client/static/js/ini-cg0a5wm3.js +0 -1
  243. package/dist/client/static/js/java-vcck089n.js +0 -1
  244. package/dist/client/static/js/jsx-ht9zyzwa.js +0 -1
  245. package/dist/client/static/js/lua-ke895s2q.js +0 -1
  246. package/dist/client/static/js/markdown-gwmsh53r.js +0 -1
  247. package/dist/client/static/js/one-dark-pro-4geyzhjj.js +0 -1
  248. package/dist/client/static/js/one-light-tqssjm9t.js +0 -1
  249. package/dist/client/static/js/packet-AYTQ26CC-3pav51g0.js +0 -1
  250. package/dist/client/static/js/pie-WAS4IAKB-wqfh7zdk.js +0 -1
  251. package/dist/client/static/js/properties-mzvvbqg5.js +0 -1
  252. package/dist/client/static/js/python-3w64wsyd.js +0 -1
  253. package/dist/client/static/js/r-32re2zwb.js +0 -1
  254. package/dist/client/static/js/radar-RG4KPBEZ-w7qjdr2g.js +0 -1
  255. package/dist/client/static/js/railroad-74A4TZTK-rhr99kkj.js +0 -1
  256. package/dist/client/static/js/railroad-abnf-HS5TGJTU-c4jeea3m.js +0 -1
  257. package/dist/client/static/js/railroad-ebnf-LZEXJU2U-x2ee66ex.js +0 -1
  258. package/dist/client/static/js/railroad-peg-WCYAUIDC-yw8wjfwg.js +0 -1
  259. package/dist/client/static/js/swimlanesDiagram-TC7HE7FX-y81h9n27.js +0 -8
  260. package/dist/client/static/js/treeView-Q6P3EWNA-ekz05ccs.js +0 -1
  261. package/dist/client/static/js/treemap-WGGIJYW6-aq6qymjr.js +0 -1
  262. package/dist/client/static/js/tsx-0p183w2f.js +0 -1
  263. package/dist/client/static/js/typescript-t9a5jyvv.js +0 -1
  264. package/dist/client/static/js/wardley-WFR3VGLG-z34tj4y3.js +0 -1
  265. package/dist/client/static/js/xml-81hxjjt4.js +0 -1
  266. package/dist/client/static/js/yaml-yssayv8a.js +0 -1
@@ -1,2 +1,2 @@
1
- import{u,e}from"./index-4s8ttfxj.js";import{kc,Xf,Jm,xc}from"./index-jz9fpznk.js";function w({content:d,path:l,onChange:s}){let r=u(()=>Xf(d,l),[d,l]),o=s!==void 0&&!r.truncated,a=d.endsWith(`
2
- `),c=o?(i,n,t)=>{s(Jm(r.header,xc(r.rows,i,n,t),r.delimiter,a))}:void 0,h=o?(i,n)=>{let t=r.header.slice();while(t.length<=i)t.push("");t[i]=n,s(Jm(t,r.rows,r.delimiter,a))}:void 0;return e(kc,{header:r.header,rows:r.rows,truncated:r.truncated,readOnlyNote:r.truncated?"This file is too large to edit in the grid — use Show source.":o?"Paste is not supported — double-click a cell to edit it.":"This grid is read-only — use Show source to edit the cells.",onEditCell:c,onEditHeader:h})}export{w as CsvGrid};
1
+ import{u,e}from"./index-zt75xpq0.js";import{xc,eA,Zm,wc}from"./index-q2w6s8n7.js";function w({content:d,path:l,onChange:s}){let r=u(()=>eA(d,l),[d,l]),o=s!==void 0&&!r.truncated,a=d.endsWith(`
2
+ `),c=o?(i,n,t)=>{s(Zm(r.header,wc(r.rows,i,n,t),r.delimiter,a))}:void 0,h=o?(i,n)=>{let t=r.header.slice();while(t.length<=i)t.push("");t[i]=n,s(Zm(t,r.rows,r.delimiter,a))}:void 0;return e(xc,{header:r.header,rows:r.rows,truncated:r.truncated,readOnlyNote:r.truncated?"This file is too large to edit in the grid — use Show source.":o?"Paste is not supported — double-click a cell to edit it.":"This grid is read-only — use Show source to edit the cells.",onEditCell:c,onEditHeader:h})}export{w as CsvGrid};
@@ -1,4 +1,4 @@
1
- import{u,e,m,Cp,Br,Vu}from"./index-4s8ttfxj.js";import{an,yn,Yf}from"./index-c0x6s6f7.js";var wr=yn(function(gr,Zt){(function(et){if(typeof gr==="object"&&typeof Zt<"u")Zt.exports=et();else if(typeof define==="function"&&define.amd)define([],et);else{var ft;if(typeof window<"u")ft=window;else if(typeof global<"u")ft=global;else if(typeof self<"u")ft=self;else ft=this;ft.mammoth=et()}})(function(){var et,ft,Yt;return function X(ce,L,z){function I(c,o){if(!L[c]){if(!ce[c]){var i=Yf;if(!o&&i)return i(c,!0);if(p)return p(c,!0);var t=Error("Cannot find module '"+c+"'");throw t.code="MODULE_NOT_FOUND",t}var l=L[c]={exports:{}};ce[c][0].call(l.exports,function(g){var _=ce[c][1][g];return I(_?_:g)},l,l.exports,X,ce,L,z)}return L[c].exports}var p=Yf;for(var k=0;k<z.length;k++)I(z[k]);return I}({1:[function(X,ce,L){var z=X("../../lib/promises");L.Files=I;function I(){function p(k){return z.reject(Error("could not open external image: '"+k+`'
1
+ import{u,e,m,Ep,Br,Yu}from"./index-zt75xpq0.js";import{an,yn,Jf}from"./index-sdtye3jy.js";var wr=yn(function(gr,Zt){(function(et){if(typeof gr==="object"&&typeof Zt<"u")Zt.exports=et();else if(typeof define==="function"&&define.amd)define([],et);else{var ft;if(typeof window<"u")ft=window;else if(typeof global<"u")ft=global;else if(typeof self<"u")ft=self;else ft=this;ft.mammoth=et()}})(function(){var et,ft,Yt;return function X(ce,L,z){function I(c,o){if(!L[c]){if(!ce[c]){var i=Jf;if(!o&&i)return i(c,!0);if(p)return p(c,!0);var t=Error("Cannot find module '"+c+"'");throw t.code="MODULE_NOT_FOUND",t}var l=L[c]={exports:{}};ce[c][0].call(l.exports,function(g){var _=ce[c][1][g];return I(_?_:g)},l,l.exports,X,ce,L,z)}return L[c].exports}var p=Jf;for(var k=0;k<z.length;k++)I(z[k]);return I}({1:[function(X,ce,L){var z=X("../../lib/promises");L.Files=I;function I(){function p(k){return z.reject(Error("could not open external image: '"+k+`'
2
2
  cannot open linked files from a web browser`))}return{read:p}}},{"../../lib/promises":23}],2:[function(X,ce,L){var z=X("../lib/promises"),I=X("../lib/zipfile");L.openZip=p;function p(k){if(k.arrayBuffer)return z.resolve(I.openArrayBuffer(k.arrayBuffer));else return z.reject(Error("Could not find file in options"))}},{"../lib/promises":23,"../lib/zipfile":40}],3:[function(X,ce,L){var z=X("underscore"),I=X("./promises"),p=X("./documents"),k=X("./styles/html-paths"),c=X("./results"),o=X("./images"),i=X("./html"),t=X("./writers");L.DocumentConverter=l;function l(n){return{convertToHtml:function(v){var a=z.indexBy(v.type===p.types.document?v.comments:[],"commentId"),E=new g(n,a);return E.convertToHtml(v)}}}function g(n,v){var a=1,E=[],F=[];n=z.extend({ignoreEmptyParagraphs:!0},n);var A=n.idPrefix===void 0?"":n.idPrefix,W=n.ignoreEmptyParagraphs,S=k.topLevelElement("p"),P=n.styleMap||[];function O(d){var q=[],Y=ee(d,q,Object.create(null)),j=[];T(Y,function(r){if(r.type==="deferred")j.push(r)});var f=Object.create(null);return I.forEachSeries(j,function(r){return r.value().then(function(s){f[r.id]=s})}).then(function(){function r(N){return h(N,function(M){if(M.type==="deferred")return f[M.id];else if(M.children)return[z.extend({},M,{children:r(M.children)})];else return[M]})}var s=t.writer({prettyPrint:n.prettyPrint,outputFormat:n.outputFormat});return i.write(s,i.simplify(r(Y))),new c.Result(s.asString(),q)})}function H(d,q,Y){return h(d,function(j){return ee(j,q,Y)})}function ee(d,q,Y){if(!Y)throw Error("context not set");var j=Ae[d.type];if(j)return j(d,q,Y);else return[]}function U(d,q,Y){return J(d,q).wrap(function(){var j=H(d.children,q,Y);if(W)return j;else return[i.forceWrite].concat(j)})}function J(d,q){var Y=se(d);if(Y)return Y.to;else{if(d.styleId)q.push(y("paragraph",d));return S}}function D(d,q,Y){var j=function(){return H(d.children,q,Y)},f=[];if(d.highlight!==null){var r=ye({type:"highlight",color:d.highlight});if(r)f.push(r)}if(d.isSmallCaps)f.push(te("smallCaps"));if(d.isAllCaps)f.push(te("allCaps"));if(d.isStrikethrough)f.push(te("strikethrough","s"));if(d.isUnderline)f.push(te("underline"));if(d.verticalAlignment===p.verticalAlignment.subscript)f.push(k.element("sub",{},{fresh:!1}));if(d.verticalAlignment===p.verticalAlignment.superscript)f.push(k.element("sup",{},{fresh:!1}));if(d.isItalic)f.push(te("italic","em"));if(d.isBold)f.push(te("bold","strong"));var s=k.empty,N=se(d);if(N)s=N.to;else if(d.styleId)q.push(y("run",d));return f.push(s),f.forEach(function(M){j=M.wrap.bind(M,j)}),j()}function te(d,q){var Y=ye({type:d});if(Y)return Y;else if(q)return k.element(q,{},{fresh:!1});else return k.empty}function ye(d,q){var Y=se(d);return Y?Y.to:q}function se(d){for(var q=0;q<P.length;q++)if(P[q].from.matches(d))return P[q]}function ve(d){return function(q,Y){return I.try(function(){return d(q,Y)}).catch(function(j){return Y.push(c.error(j)),[]})}}function le(d){return Q(d.noteType,d.noteId)}function be(d){return ne(d.noteType,d.noteId)}function Q(d,q){return Te(d+"-"+q)}function ne(d,q){return Te(d+"-ref-"+q)}function Te(d){return A+d}var pe=k.elements([k.element("table",{},{fresh:!0})]);function de(d,q,Y){return ye(d,pe).wrap(function(){return Pe(d,q,Y)})}function Pe(d,q,Y){var j=z.findIndex(d.children,function(N){return!N.type===p.types.tableRow||!N.isHeader});if(j===-1)j=d.children.length;var f;if(j===0)f=H(d.children,q,z.extend({},Y,{isTableHeader:!1}));else{var r=H(d.children.slice(0,j),q,z.extend({},Y,{isTableHeader:!0})),s=H(d.children.slice(j),q,z.extend({},Y,{isTableHeader:!1}));f=[i.freshElement("thead",{},r),i.freshElement("tbody",{},s)]}return[i.forceWrite].concat(f)}function Be(d,q,Y){var j=H(d.children,q,Y);return[i.freshElement("tr",{},[i.forceWrite].concat(j))]}function Ie(d,q,Y){var j=Y.isTableHeader?"th":"td",f=H(d.children,q,Y),r={};if(d.colSpan!==1)r.colspan=d.colSpan.toString();if(d.rowSpan!==1)r.rowspan=d.rowSpan.toString();return[i.freshElement(j,r,[i.forceWrite].concat(f))]}function ke(d,q,Y){return ye(d,k.ignore).wrap(function(){var j=v[d.commentId],f=F.length+1,r="["+x(j)+f+"]";return F.push({label:r,comment:j}),[i.freshElement("a",{href:"#"+Q("comment",d.commentId),id:ne("comment",d.commentId)},[i.text(r)])]})}function Ne(d,q,Y){var{label:j,comment:f}=d,r=H(f.body,q,Y).concat([i.nonFreshElement("p",{},[i.text(" "),i.freshElement("a",{href:"#"+ne("comment",f.commentId)},[i.text("↑")])])]);return[i.freshElement("dt",{id:Q("comment",f.commentId)},[i.text("Comment "+j)]),i.freshElement("dd",{},r)]}function Re(d,q,Y){return We(d).wrap(function(){return[]})}function We(d){var q=se(d);if(q)return q.to;else if(d.breakType==="line")return k.topLevelElement("br");else return k.empty}var Ae={document:function(d,q,Y){var j=H(d.children,q,Y),f=E.map(function(s){return d.notes.resolve(s)}),r=H(f,q,Y);return j.concat([i.freshElement("ol",{},r),i.freshElement("dl",{},h(F,function(s){return Ne(s,q,Y)}))])},paragraph:U,run:D,text:function(d,q,Y){return[i.text(d.value)]},tab:function(d,q,Y){return[i.text("\t")]},hyperlink:function(d,q,Y){var j=d.anchor?"#"+Te(d.anchor):d.href,f={href:j};if(d.targetFrame!=null)f.target=d.targetFrame;var r=H(d.children,q,Y);return[i.nonFreshElement("a",f,r)]},checkbox:function(d){var q={type:"checkbox"};if(d.checked)q.checked="checked";return[i.freshElement("input",q)]},bookmarkStart:function(d,q,Y){var j=i.freshElement("a",{id:Te(d.name)},[i.forceWrite]);return[j]},noteReference:function(d,q,Y){E.push(d);var j=i.freshElement("a",{href:"#"+le(d),id:be(d)},[i.text("["+a+++"]")]);return[i.freshElement("sup",{},[j])]},note:function(d,q,Y){var j=H(d.body,q,Y),f=i.elementWithTag(k.element("p",{},{fresh:!1}),[i.text(" "),i.freshElement("a",{href:"#"+be(d)},[i.text("↑")])]),r=j.concat([f]);return i.freshElement("li",{id:le(d)},r)},commentReference:ke,comment:Ne,image:w(ve(n.convertImage||o.dataUri)),table:de,tableRow:Be,tableCell:Ie,break:Re};return{convertToHtml:O}}var _=1;function w(n){return function(v,a,E){return[{type:"deferred",id:_++,value:function(){return n(v,a,E)}}]}}function y(n,v){return c.warning("Unrecognised "+n+" style: '"+v.styleName+"' (Style ID: "+v.styleId+")")}function h(n,v){return z.flatten(n.map(v),!0)}function T(n,v){n.forEach(function(a){if(v(a),a.children)T(a.children,v)})}var x=L.commentAuthorLabel=function(v){return v.authorInitials||""}},{"./documents":4,"./html":18,"./images":20,"./promises":23,"./results":25,"./styles/html-paths":28,"./writers":33,underscore:67}],4:[function(X,ce,L){(function(z){var I=X("underscore"),p=L.types={document:"document",paragraph:"paragraph",run:"run",text:"text",tab:"tab",checkbox:"checkbox",hyperlink:"hyperlink",noteReference:"noteReference",image:"image",note:"note",commentReference:"commentReference",comment:"comment",table:"table",tableRow:"tableRow",tableCell:"tableCell",break:"break",bookmarkStart:"bookmarkStart"};function k(S,P){return P=P||{},{type:p.document,children:S,notes:P.notes||new y({}),comments:P.comments||[]}}function c(S,P){P=P||{};var O=P.indent||{};return{type:p.paragraph,children:S,styleId:P.styleId||null,styleName:P.styleName||null,numbering:P.numbering||null,alignment:P.alignment||null,indent:{start:O.start||null,end:O.end||null,firstLine:O.firstLine||null,hanging:O.hanging||null}}}function o(S,P){return P=P||{},{type:p.run,children:S,styleId:P.styleId||null,styleName:P.styleName||null,isBold:!!P.isBold,isUnderline:!!P.isUnderline,isItalic:!!P.isItalic,isStrikethrough:!!P.isStrikethrough,isAllCaps:!!P.isAllCaps,isSmallCaps:!!P.isSmallCaps,verticalAlignment:P.verticalAlignment||i.baseline,font:P.font||null,fontSize:P.fontSize||null,highlight:P.highlight||null}}var i={baseline:"baseline",superscript:"superscript",subscript:"subscript"};function t(S){return{type:p.text,value:S}}function l(){return{type:p.tab}}function g(S){return{type:p.checkbox,checked:S.checked}}function _(S,P){return{type:p.hyperlink,children:S,href:P.href,anchor:P.anchor,targetFrame:P.targetFrame}}function w(S){return{type:p.noteReference,noteType:S.noteType,noteId:S.noteId}}function y(S){this._notes=I.indexBy(S,function(P){return n(P.noteType,P.noteId)})}y.prototype.resolve=function(S){return this.findNoteByKey(n(S.noteType,S.noteId))},y.prototype.findNoteByKey=function(S){return this._notes[S]||null};function h(S){return{type:p.note,noteType:S.noteType,noteId:S.noteId,body:S.body}}function T(S){return{type:p.commentReference,commentId:S.commentId}}function x(S){return{type:p.comment,commentId:S.commentId,body:S.body,authorName:S.authorName,authorInitials:S.authorInitials}}function n(S,P){return S+"-"+P}function v(S){return{type:p.image,read:function(P){if(P)return S.readImage(P);else return S.readImage().then(function(O){return z.from(O)})},readAsArrayBuffer:function(){return S.readImage()},readAsBase64String:function(){return S.readImage("base64")},readAsBuffer:function(){return S.readImage().then(function(P){return z.from(P)})},altText:S.altText,contentType:S.contentType}}function a(S,P){return P=P||{},{type:p.table,children:S,styleId:P.styleId||null,styleName:P.styleName||null}}function E(S,P){return P=P||{},{type:p.tableRow,children:S,isHeader:P.isHeader||!1}}function F(S,P){return P=P||{},{type:p.tableCell,children:S,colSpan:P.colSpan==null?1:P.colSpan,rowSpan:P.rowSpan==null?1:P.rowSpan}}function A(S){return{type:p.break,breakType:S}}function W(S){return{type:p.bookmarkStart,name:S.name}}L.document=L.Document=k,L.paragraph=L.Paragraph=c,L.run=L.Run=o,L.text=L.Text=t,L.tab=L.Tab=l,L.checkbox=L.Checkbox=g,L.Hyperlink=_,L.noteReference=L.NoteReference=w,L.Notes=y,L.Note=h,L.commentReference=T,L.comment=x,L.Image=v,L.Table=a,L.TableRow=E,L.TableCell=F,L.lineBreak=A("line"),L.pageBreak=A("page"),L.columnBreak=A("column"),L.BookmarkStart=W,L.verticalAlignment=i}).call(this,X("buffer").Buffer)},{buffer:48,underscore:67}],5:[function(X,ce,L){L.createBodyReader=l,L._readNumberingProperties=_;var z=X("dingbat-to-unicode"),I=X("underscore"),p=X("../documents"),k=X("../results").Result,c=X("../results").warning,o=X("../xml"),i=X("../transforms"),t=X("./uris");function l(A){return{readXmlElement:function(W){return new g(A).readXmlElement(W)},readXmlElements:function(W){return new g(A).readXmlElements(W)}}}function g(A){var W=[],S=[],P=[],{relationships:O,contentTypes:H,docxFile:ee,files:U,numbering:J,styles:D}=A;function te(oe){var me=oe.map(ye);return a(me)}function ye(oe){if(oe.type==="element"){var me=j[oe.name];if(me)return me(oe);else if(!Object.prototype.hasOwnProperty.call(y,oe.name)){var xe=c("An unrecognised element was ignored: "+oe.name);return h([xe])}}return T()}function se(oe){return pe(oe).map(function(me){return{type:"paragraphProperties",styleId:me.styleId,styleName:me.name,alignment:oe.firstOrEmpty("w:jc").attributes["w:val"],numbering:_(me.styleId,oe.firstOrEmpty("w:numPr"),J),indent:ve(oe.firstOrEmpty("w:ind"))}})}function ve(oe){return{start:oe.attributes["w:start"]||oe.attributes["w:left"],end:oe.attributes["w:end"]||oe.attributes["w:right"],firstLine:oe.attributes["w:firstLine"],hanging:oe.attributes["w:hanging"]}}function le(oe){return de(oe).map(function(me){var xe=oe.firstOrEmpty("w:sz").attributes["w:val"],De=/^[0-9]+$/.test(xe)?parseInt(xe,10)/2:null;return{type:"runProperties",styleId:me.styleId,styleName:me.name,verticalAlignment:oe.firstOrEmpty("w:vertAlign").attributes["w:val"],font:oe.firstOrEmpty("w:rFonts").attributes["w:ascii"],fontSize:De,isBold:Q(oe.first("w:b")),isUnderline:be(oe.first("w:u")),isItalic:Q(oe.first("w:i")),isStrikethrough:Q(oe.first("w:strike")),isAllCaps:Q(oe.first("w:caps")),isSmallCaps:Q(oe.first("w:smallCaps")),highlight:Te(oe.firstOrEmpty("w:highlight").attributes["w:val"])}})}function be(oe){if(oe){var me=oe.attributes["w:val"];return me!==void 0&&me!=="false"&&me!=="0"&&me!=="none"}else return!1}function Q(oe){if(oe){var me=oe.attributes["w:val"];return me!=="false"&&me!=="0"}else return!1}function ne(oe){return oe!=="false"&&oe!=="0"}function Te(oe){if(!oe||oe==="none")return null;else return oe}function pe(oe){return Be(oe,"w:pStyle","Paragraph",D.findParagraphStyleById)}function de(oe){return Be(oe,"w:rStyle","Run",D.findCharacterStyleById)}function Pe(oe){return Be(oe,"w:tblStyle","Table",D.findTableStyleById)}function Be(oe,me,xe,De){var Me=[],Xe=oe.first(me),ze=null,Ve=null;if(Xe){if(ze=Xe.attributes["w:val"],ze){var Ge=De(ze);if(Ge)Ve=Ge.name;else Me.push(Qe(xe,ze))}}return n({styleId:ze,name:Ve},Me)}function Ie(oe){var me=oe.attributes["w:fldCharType"];if(me==="begin")W.push({type:"begin",fldChar:oe}),S=[];else if(me==="end"){if(W.length===0)return h([c("Ignoring complex field end character without corresponding start character")]);var xe=W.pop();if(xe.type==="begin")xe=Ne(xe);if(xe.type==="checkbox")return x(p.checkbox({checked:xe.checked}))}else if(me==="separate"){if(W.length===0)return h([c("Ignoring complex field separator character without corresponding start character")]);var De=W.pop(),Me=Ne(De);W.push(Me)}return T()}function ke(){var oe=I.last(W.filter(function(me){return me.type==="hyperlink"}));return oe?oe.options:null}function Ne(oe){return Re(S.join(""),oe.type==="begin"?oe.fldChar:o.emptyElement)}function Re(oe,me){var xe=/^\s*HYPERLINK\s+(\\l\s+)?(?:"(.*)"|([^\\]\S*))/.exec(oe);if(xe){var De=xe[2]===void 0?xe[3]:xe[2],Me=xe[1]===void 0?{href:De}:{anchor:De};return{type:"hyperlink",options:Me}}var Xe=/\s*FORMCHECKBOX\s*/.exec(oe);if(Xe){var ze=me.firstOrEmpty("w:ffData").firstOrEmpty("w:checkBox"),Ve=ze.first("w:checked"),Ge=Ve==null?Q(ze.first("w:default")):Q(Ve);return{type:"checkbox",checked:Ge}}return{type:"unknown"}}function We(oe){return S.push(oe.text()),T()}function Ae(oe){var me=oe.attributes["w:font"],xe=oe.attributes["w:char"],De=z.hex(me,xe);if(De==null&&/^F0..$/.test(xe))De=z.hex(me,xe.substring(2));if(De==null)return h([c("A w:sym element with an unsupported character was ignored: char "+xe+" in font "+me)]);else return x(new p.Text(De.string))}function d(oe){return function(me){var xe=me.attributes["w:id"];return x(new p.NoteReference({noteType:oe,noteId:xe}))}}function q(oe){return x(p.commentReference({commentId:oe.attributes["w:id"]}))}function Y(oe){return te(oe.children)}var j={"w:p":function(oe){var me=oe.firstOrEmpty("w:pPr"),xe=!!me.firstOrEmpty("w:rPr").first("w:del");if(xe)return oe.children.forEach(function(Me){P.push(Me)}),T();else{var De=oe.children;if(P.length>0)De=P.concat(De),P=[];return v.map(se(me),te(De),function(Me,Xe){return new p.Paragraph(Xe,Me)}).insertExtra()}},"w:r":function(oe){return v.map(le(oe.firstOrEmpty("w:rPr")),te(oe.children),function(me,xe){var De=ke();if(De!==null)xe=[new p.Hyperlink(xe,De)];return new p.Run(xe,me)})},"w:fldChar":Ie,"w:instrText":We,"w:t":function(oe){return x(new p.Text(oe.text()))},"w:tab":function(oe){return x(new p.Tab)},"w:noBreakHyphen":function(){return x(new p.Text("‑"))},"w:softHyphen":function(oe){return x(new p.Text("­"))},"w:sym":Ae,"w:hyperlink":function(oe){var me=oe.attributes["r:id"],xe=oe.attributes["w:anchor"];return te(oe.children).map(function(De){function Me(ze){var Ve=oe.attributes["w:tgtFrame"]||null;return new p.Hyperlink(De,I.extend({targetFrame:Ve},ze))}if(me){var Xe=O.findTargetByRelationshipId(me);if(xe)Xe=t.replaceFragment(Xe,xe);return Me({href:Xe})}else if(xe)return Me({anchor:xe});else return De})},"w:tbl":f,"w:tr":s,"w:tc":N,"w:footnoteReference":d("footnote"),"w:endnoteReference":d("endnote"),"w:commentReference":q,"w:br":function(oe){var me=oe.attributes["w:type"];if(me==null||me==="textWrapping")return x(p.lineBreak);else if(me==="page")return x(p.pageBreak);else if(me==="column")return x(p.columnBreak);else return h([c("Unsupported break type: "+me)])},"w:bookmarkStart":function(oe){var me=oe.attributes["w:name"];if(me==="_GoBack")return T();else return x(new p.BookmarkStart({name:me}))},"mc:AlternateContent":function(oe){return Y(oe.firstOrEmpty("mc:Fallback"))},"w:sdt":function(oe){var me=te(oe.firstOrEmpty("w:sdtContent").children);return me.map(function(xe){var De=oe.firstOrEmpty("w:sdtPr").first("wordml:checkbox");if(De){var Me=De.first("wordml:checked"),Xe=!!Me&&ne(Me.attributes["wordml:val"]),ze=p.checkbox({checked:Xe}),Ve=!1,Ge=xe.map(i._elementsOfType(p.types.text,function($e){if($e.value.length>0&&!Ve)return Ve=!0,ze;else return $e}));if(Ve)return Ge;else return ze}else return xe})},"w:customXml":Y,"w:ins":Y,"w:moveFromRangeEnd":Y,"w:moveFromRangeStart":Y,"w:moveTo":Y,"w:moveToRangeEnd":Y,"w:moveToRangeStart":Y,"w:object":Y,"w:smartTag":Y,"w:drawing":Y,"w:pict":function(oe){return Y(oe).toExtra()},"v:roundrect":Y,"v:shape":Y,"v:textbox":Y,"w:txbxContent":Y,"wp:inline":ue,"wp:anchor":ue,"v:imagedata":Fe,"v:group":Y,"v:rect":Y};return{readXmlElement:ye,readXmlElements:te};function f(oe){var me=r(oe.firstOrEmpty("w:tblPr"));return te(oe.children).flatMap(K).flatMap(function(xe){return me.map(function(De){return p.Table(xe,De)})})}function r(oe){return Pe(oe).map(function(me){return{styleId:me.styleId,styleName:me.name}})}function s(oe){var me=oe.firstOrEmpty("w:trPr"),xe=!!me.first("w:del");if(xe)return T();var De=!!me.first("w:tblHeader");return te(oe.children).map(function(Me){return p.TableRow(Me,{isHeader:De})})}function N(oe){return te(oe.children).map(function(me){var xe=oe.firstOrEmpty("w:tcPr"),De=xe.firstOrEmpty("w:gridSpan").attributes["w:val"],Me=De?parseInt(De,10):1,Xe=p.TableCell(me,{colSpan:Me});return Xe._vMerge=M(xe),Xe})}function M(oe){var me=oe.first("w:vMerge");if(me){var xe=me.attributes["w:val"];return xe==="continue"||!xe}else return null}function K(oe){var me=I.any(oe,function(Me){return Me.type!==p.types.tableRow});if(me)return ie(oe),n(oe,[c("unexpected non-row element in table, cell merging may be incorrect")]);var xe=I.any(oe,function(Me){return I.any(Me.children,function(Xe){return Xe.type!==p.types.tableCell})});if(xe)return ie(oe),n(oe,[c("unexpected non-cell element in table row, cell merging may be incorrect")]);var De={};return oe.forEach(function(Me){var Xe=0;Me.children.forEach(function(ze){if(ze._vMerge&&De[Xe])De[Xe].rowSpan++;else De[Xe]=ze,ze._vMerge=!1;Xe+=ze.colSpan})}),oe.forEach(function(Me){Me.children=Me.children.filter(function(Xe){return!Xe._vMerge}),Me.children.forEach(function(Xe){delete Xe._vMerge})}),x(oe)}function ie(oe){oe.forEach(function(me){var xe=i.getDescendantsOfType(me,p.types.tableCell);xe.forEach(function(De){delete De._vMerge})})}function ue(oe){var me=oe.getElementsByTagName("a:graphic").getElementsByTagName("a:graphicData").getElementsByTagName("pic:pic").getElementsByTagName("pic:blipFill").getElementsByTagName("a:blip");return a(me.map(we.bind(null,oe)))}function we(oe,me){var xe=oe.firstOrEmpty("wp:docPr"),De=xe.attributes,Me=Se(De.descr)?De.title:De.descr,Xe=_e(me);if(Xe===null)return h([c("Could not find image file for a:blip element")]);return He(Xe,Me).map(function(ze){var Ve=xe.firstOrEmpty("a:hlinkClick"),Ge=Ve.attributes["r:id"];if(Ge){var $e=O.findTargetByRelationshipId(Ge);return new p.Hyperlink([ze],{href:$e})}else return ze})}function Se(oe){return oe==null||/^\s*$/.test(oe)}function _e(oe){var me=oe.attributes["r:embed"],xe=oe.attributes["r:link"];if(me)return Ze(me);else if(xe){var De=O.findTargetByRelationshipId(xe);return{path:De,read:U.read.bind(U,De)}}else return null}function Fe(oe){var me=oe.attributes["r:id"];if(me)return He(Ze(me),oe.attributes["o:title"]);else return h([c("A v:imagedata element without a relationship ID was ignored")])}function Ze(oe){var me=t.uriToZipEntryName("word",O.findTargetByRelationshipId(oe));return{path:me,read:ee.read.bind(ee,me)}}function He(oe,me){var xe=H.findContentType(oe.path),De=p.Image({readImage:oe.read,altText:me,contentType:xe}),Me=w[xe]?[]:c("Image of type "+xe+" is unlikely to display in web browsers");return n(De,Me)}function Qe(oe,me){return c(oe+" style with ID "+me+" was referenced but not defined in the document")}}function _(A,W,S){var P=W.firstOrEmpty("w:ilvl").attributes["w:val"],O=W.firstOrEmpty("w:numId").attributes["w:val"];if(P!==void 0&&O!==void 0)return S.findLevel(O,P);if(A!=null){var H=S.findLevelByParagraphStyleId(A);if(H!=null)return H}if(O!==void 0)return S.findLevel(O,"0");return null}var w={"image/png":!0,"image/gif":!0,"image/jpeg":!0,"image/svg+xml":!0,"image/tiff":!0},y={"office-word:wrap":!0,"v:shadow":!0,"v:shapetype":!0,"w:annotationRef":!0,"w:bookmarkEnd":!0,"w:sectPr":!0,"w:proofErr":!0,"w:lastRenderedPageBreak":!0,"w:commentRangeStart":!0,"w:commentRangeEnd":!0,"w:del":!0,"w:footnoteRef":!0,"w:endnoteRef":!0,"w:moveFrom":!0,"w:pPr":!0,"w:rPr":!0,"w:tblPr":!0,"w:tblGrid":!0,"w:trPr":!0,"w:tcPr":!0};function h(A){return new v(null,null,A)}function T(){return new v(null)}function x(A){return new v(A)}function n(A,W){return new v(A,null,W)}function v(A,W,S){this.value=A||[],this.extra=W||[],this._result=new k({element:this.value,extra:W},S),this.messages=this._result.messages}v.prototype.toExtra=function(){return new v(null,E(this.extra,this.value),this.messages)},v.prototype.insertExtra=function(){var A=this.extra;if(A&&A.length)return new v(E(this.value,A),null,this.messages);else return this},v.prototype.map=function(A){var W=this._result.map(function(S){return A(S.element)});return new v(W.value,this.extra,W.messages)},v.prototype.flatMap=function(A){var W=this._result.flatMap(function(S){return A(S.element)._result});return new v(W.value.element,E(this.extra,W.value.extra),W.messages)},v.map=function(A,W,S){return new v(S(A.value,W.value),E(A.extra,W.extra),A.messages.concat(W.messages))};function a(A){var W=k.combine(I.pluck(A,"_result"));return new v(I.flatten(I.pluck(W.value,"element")),I.filter(I.flatten(I.pluck(W.value,"extra")),F),W.messages)}function E(A,W){return I.flatten([A,W])}function F(A){return A}},{"../documents":4,"../results":25,"../transforms":30,"../xml":35,"./uris":16,"dingbat-to-unicode":50,underscore:67}],6:[function(X,ce,L){var z=X("../documents"),I=X("../results").Result;function p(k){function c(i){return I.combine(i.getElementsByTagName("w:comment").map(o))}function o(i){var t=i.attributes["w:id"];function l(g){return(i.attributes[g]||"").trim()||null}return k.readXmlElements(i.children).map(function(g){return z.comment({commentId:t,body:g,authorName:l("w:author"),authorInitials:l("w:initials")})})}return c}L.createCommentsReader=p},{"../documents":4,"../results":25}],7:[function(X,ce,L){L.readContentTypesFromXml=I;var z={png:"png",gif:"gif",jpeg:"jpeg",jpg:"jpeg",tif:"tiff",tiff:"tiff",bmp:"bmp"};L.defaultContentTypes=p({},{});function I(k){var c=Object.create(null),o=Object.create(null);return k.children.forEach(function(i){if(i.name==="content-types:Default")c[i.attributes.Extension]=i.attributes.ContentType;if(i.name==="content-types:Override"){var t=i.attributes.PartName;if(t.charAt(0)==="/")t=t.substring(1);o[t]=i.attributes.ContentType}}),p(o,c)}function p(k,c){return{findContentType:function(o){var i=k[o];if(i)return i;else{var t=o.split("."),l=t[t.length-1];if(Object.prototype.hasOwnProperty.call(c,l))return c[l];else{var g=z[l.toLowerCase()];if(g)return"image/"+g;else return null}}}}}},{}],8:[function(X,ce,L){L.DocumentXmlReader=p;var z=X("../documents"),I=X("../results").Result;function p(k){var c=k.bodyReader;function o(i){var t=i.first("w:body");if(t==null)throw Error("Could not find the body element: are you sure this is a docx file?");var l=c.readXmlElements(t.children).map(function(g){return new z.Document(g,{notes:k.notes,comments:k.comments})});return new I(l.value,l.messages)}return{convertXmlToDocument:o}}},{"../documents":4,"../results":25}],9:[function(X,ce,L){L.read=T,L._findPartPaths=x;var z=X("../promises"),I=X("../documents"),p=X("../results").Result,k=X("../zipfile"),c=X("./office-xml-reader").readXmlFromZipFile,o=X("./body-reader").createBodyReader,i=X("./document-xml-reader").DocumentXmlReader,t=X("./relationships-reader"),l=X("./content-types-reader"),g=X("./numbering-xml"),_=X("./styles-reader"),w=X("./notes-reader"),y=X("./comments-reader"),h=X("./files").Files;function T(O,H,ee){H=H||{},ee=ee||{};var U=new h({externalFileAccess:ee.externalFileAccess,relativeToFile:H.path});return z.props({contentTypes:A(O),partPaths:x(O),docxFile:O,files:U}).also(function(J){return{styles:S(O,J.partPaths.styles)}}).also(function(J){return{numbering:W(O,J.partPaths.numbering,J.styles)}}).also(function(J){return{footnotes:E(J.partPaths.footnotes,J,function(D,te){if(te)return w.createFootnotesReader(D)(te);else return new p([])}),endnotes:E(J.partPaths.endnotes,J,function(D,te){if(te)return w.createEndnotesReader(D)(te);else return new p([])}),comments:E(J.partPaths.comments,J,function(D,te){if(te)return y.createCommentsReader(D)(te);else return new p([])})}}).also(function(J){return{notes:J.footnotes.flatMap(function(D){return J.endnotes.map(function(te){return new I.Notes(D.concat(te))})})}}).then(function(J){return E(J.partPaths.mainDocument,J,function(D,te){return J.notes.flatMap(function(ye){return J.comments.flatMap(function(se){var ve=new i({bodyReader:D,notes:ye,comments:se});return ve.convertXmlToDocument(te)})})})})}function x(O){return P(O).then(function(H){var ee=n({docxFile:O,relationships:H,relationshipType:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument",basePath:"",fallbackPath:"word/document.xml"});if(!O.exists(ee))throw Error("Could not find main document part. Are you sure this is a valid .docx file?");return a({filename:F(ee),readElement:t.readRelationships,defaultValue:t.defaultValue})(O).then(function(U){function J(D){return n({docxFile:O,relationships:U,relationshipType:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/"+D,basePath:k.splitPath(ee).dirname,fallbackPath:"word/"+D+".xml"})}return{mainDocument:ee,comments:J("comments"),endnotes:J("endnotes"),footnotes:J("footnotes"),numbering:J("numbering"),styles:J("styles")}})})}function n(O){var{docxFile:H,relationships:ee,relationshipType:U,basePath:J,fallbackPath:D}=O,te=ee.findTargetsByType(U),ye=te.map(function(ve){return v(k.joinPath(J,ve),"/")}),se=ye.filter(function(ve){return H.exists(ve)});if(se.length===0)return D;else return se[0]}function v(O,H){if(O.substring(0,H.length)===H)return O.substring(H.length);else return O}function a(O){return function(H){return c(H,O.filename).then(function(ee){return ee?O.readElement(ee):O.defaultValue})}}function E(O,H,ee){var U=a({filename:F(O),readElement:t.readRelationships,defaultValue:t.defaultValue});return U(H.docxFile).then(function(J){var D=new o({relationships:J,contentTypes:H.contentTypes,docxFile:H.docxFile,numbering:H.numbering,styles:H.styles,files:H.files});return c(H.docxFile,O).then(function(te){return ee(D,te)})})}function F(O){var H=k.splitPath(O);return k.joinPath(H.dirname,"_rels",H.basename+".rels")}var A=a({filename:"[Content_Types].xml",readElement:l.readContentTypesFromXml,defaultValue:l.defaultContentTypes});function W(O,H,ee){return a({filename:H,readElement:function(U){return g.readNumberingXml(U,{styles:ee})},defaultValue:g.defaultNumbering})(O)}function S(O,H){return a({filename:H,readElement:_.readStylesXml,defaultValue:_.defaultStyles})(O)}var P=a({filename:"_rels/.rels",readElement:t.readRelationships,defaultValue:t.defaultValue})},{"../documents":4,"../promises":23,"../results":25,"../zipfile":40,"./body-reader":5,"./comments-reader":6,"./content-types-reader":7,"./document-xml-reader":8,"./files":1,"./notes-reader":10,"./numbering-xml":11,"./office-xml-reader":12,"./relationships-reader":13,"./styles-reader":15}],10:[function(X,ce,L){var z=X("../documents"),I=X("../results").Result;L.createFootnotesReader=p.bind(this,"footnote"),L.createEndnotesReader=p.bind(this,"endnote");function p(k,c){function o(l){return I.combine(l.getElementsByTagName("w:"+k).filter(i).map(t))}function i(l){var g=l.attributes["w:type"];return g!=="continuationSeparator"&&g!=="separator"}function t(l){var g=l.attributes["w:id"];return c.readXmlElements(l.children).map(function(_){return z.Note({noteType:k,noteId:g,body:_})})}return o}},{"../documents":4,"../results":25}],11:[function(X,ce,L){var z=X("underscore");L.readNumberingXml=p,L.Numbering=I,L.defaultNumbering=new I({},{});function I(i,t,l){var g=z.flatten(z.values(t).map(function(T){return z.values(T.levels)})),_=z.indexBy(g.filter(function(T){return T.paragraphStyleId!=null}),"paragraphStyleId");function w(T,x){return y(T,x,Object.create(null))}function y(T,x,n){if(n[T])return null;n[T]=!0;var v=i[T];if(!v)return null;var a=t[v.abstractNumId];if(!a)return null;else if(a.numStyleLink==null)return t[v.abstractNumId].levels[x];else{var E=l.findNumberingStyleById(a.numStyleLink);return y(E.numId,x,n)}}function h(T){return _[T]||null}return{findLevel:w,findLevelByParagraphStyleId:h}}function p(i,t){if(!t||!t.styles)throw Error("styles is missing");var l=k(i),g=o(i,l);return new I(g,l,t.styles)}function k(i){var t=Object.create(null);return i.getElementsByTagName("w:abstractNum").forEach(function(l){var g=l.attributes["w:abstractNumId"];t[g]=c(l)}),t}function c(i){var t=Object.create(null),l=null;if(i.getElementsByTagName("w:lvl").forEach(function(_){var w=_.attributes["w:ilvl"],y=_.firstOrEmpty("w:numFmt").attributes["w:val"],h=y!=="bullet",T=_.firstOrEmpty("w:pStyle").attributes["w:val"];if(w===void 0)l={isOrdered:h,level:"0",paragraphStyleId:T};else t[w]={isOrdered:h,level:w,paragraphStyleId:T}}),l!==null&&t[l.level]===void 0)t[l.level]=l;var g=i.firstOrEmpty("w:numStyleLink").attributes["w:val"];return{levels:t,numStyleLink:g}}function o(i){var t=Object.create(null);return i.getElementsByTagName("w:num").forEach(function(l){var g=l.attributes["w:numId"],_=l.first("w:abstractNumId").attributes["w:val"];t[g]={abstractNumId:_}}),t}},{underscore:67}],12:[function(X,ce,L){var z=X("underscore"),I=X("../promises"),p=X("../xml");L.read=c,L.readXmlFromZipFile=o;var k={"http://schemas.openxmlformats.org/wordprocessingml/2006/main":"w","http://schemas.openxmlformats.org/officeDocument/2006/relationships":"r","http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing":"wp","http://schemas.openxmlformats.org/drawingml/2006/main":"a","http://schemas.openxmlformats.org/drawingml/2006/picture":"pic","http://purl.oclc.org/ooxml/wordprocessingml/main":"w","http://purl.oclc.org/ooxml/officeDocument/relationships":"r","http://purl.oclc.org/ooxml/drawingml/wordprocessingDrawing":"wp","http://purl.oclc.org/ooxml/drawingml/main":"a","http://purl.oclc.org/ooxml/drawingml/picture":"pic","http://schemas.openxmlformats.org/package/2006/content-types":"content-types","http://schemas.openxmlformats.org/package/2006/relationships":"relationships","http://schemas.openxmlformats.org/markup-compatibility/2006":"mc","urn:schemas-microsoft-com:vml":"v","urn:schemas-microsoft-com:office:word":"office-word","http://schemas.microsoft.com/office/word/2010/wordml":"wordml"};function c(l){return p.readString(l,k).then(function(g){return t(g)[0]})}function o(l,g){if(l.exists(g))return l.read(g,"utf-8").then(i).then(c);else return I.resolve(null)}function i(l){return l.replace(/^\uFEFF/g,"")}function t(l){if(l.type==="element")if(l.name==="mc:AlternateContent")return l.firstOrEmpty("mc:Fallback").children;else return l.children=z.flatten(l.children.map(t,!0)),[l];else return[l]}},{"../promises":23,"../xml":35,underscore:67}],13:[function(X,ce,L){L.readRelationships=z,L.defaultValue=new I([]),L.Relationships=I;function z(p){var k=[];return p.children.forEach(function(c){if(c.name==="relationships:Relationship"){var o={relationshipId:c.attributes.Id,target:c.attributes.Target,type:c.attributes.Type};k.push(o)}}),new I(k)}function I(p){var k=Object.create(null);p.forEach(function(o){k[o.relationshipId]=o.target});var c=Object.create(null);return p.forEach(function(o){if(!c[o.type])c[o.type]=[];c[o.type].push(o.target)}),{findTargetByRelationshipId:function(o){return k[o]},findTargetsByType:function(o){return c[o]||[]}}}},{}],14:[function(X,ce,L){var z=X("underscore"),I=X("../promises"),p=X("../xml");L.writeStyleMap=i,L.readStyleMap=_;var k="http://schemas.zwobble.org/mammoth/style-map",c="mammoth/style-map",o="/"+c;function i(w,y){return w.write(c,y),t(w).then(function(){return l(w)})}function t(w){var y="word/_rels/document.xml.rels",h="http://schemas.openxmlformats.org/package/2006/relationships",T="{"+h+"}Relationship";return w.read(y,"utf8").then(p.readString).then(function(x){var n=x.children;g(n,T,"Id",{Id:"rMammothStyleMap",Type:k,Target:o});var v={"":h};return w.write(y,p.writeString(x,v))})}function l(w){var y="[Content_Types].xml",h="http://schemas.openxmlformats.org/package/2006/content-types",T="{"+h+"}Override";return w.read(y,"utf8").then(p.readString).then(function(x){var n=x.children;g(n,T,"PartName",{PartName:o,ContentType:"text/prs.mammoth.style-map"});var v={"":h};return w.write(y,p.writeString(x,v))})}function g(w,y,h,T){var x=z.find(w,function(n){return n.name===y&&n.attributes[h]===T[h]});if(x)x.attributes=T;else w.push(p.element(y,T))}function _(w){if(w.exists(c))return w.read(c,"utf8");else return I.resolve(null)}},{"../promises":23,"../xml":35,underscore:67}],15:[function(X,ce,L){L.readStylesXml=I,L.Styles=z,L.defaultStyles=new z({},{});function z(i,t,l,g){return{findParagraphStyleById:function(_){return i[_]},findCharacterStyleById:function(_){return t[_]},findTableStyleById:function(_){return l[_]},findNumberingStyleById:function(_){return g[_]}}}z.EMPTY=new z({},{},{},{});function I(i){var t=Object.create(null),l=Object.create(null),g=Object.create(null),_=Object.create(null);return i.getElementsByTagName("w:style").forEach(function(w){var y=p(w),h;switch(y.type){case"paragraph":h=t;break;case"character":h=l;break;case"table":h=g;break;case"numbering":h=_;break}if(h&&h[y.styleId]===void 0)h[y.styleId]=y}),new z(t,l,g,_)}function p(i){var t=i.attributes["w:type"];if(t==="numbering")return c(t,i);else{var l=o(i),g=k(i);return{type:t,styleId:l,name:g}}}function k(i){var t=i.first("w:name");return t?t.attributes["w:val"]:null}function c(i,t){var l=o(t),g=t.firstOrEmpty("w:pPr").firstOrEmpty("w:numPr").firstOrEmpty("w:numId").attributes["w:val"];return{type:i,numId:g,styleId:l}}function o(i){return i.attributes["w:styleId"]}},{}],16:[function(X,ce,L){L.uriToZipEntryName=z,L.replaceFragment=I;function z(p,k){if(k.charAt(0)==="/")return k.substr(1);else return p+"/"+k}function I(p,k){var c=p.indexOf("#");if(c!==-1)p=p.substring(0,c);return p+"#"+k}},{}],17:[function(X,ce,L){var z=X("../styles/html-paths");function I(l,g,_){return k(z.element(l,g,{fresh:!1}),_)}function p(l,g,_){var w=z.element(l,g,{fresh:!0});return k(w,_)}function k(l,g){return{type:"element",tag:l,children:g||[]}}function c(l){return{type:"text",value:l}}var o={type:"forceWrite"};L.freshElement=p,L.nonFreshElement=I,L.elementWithTag=k,L.text=c,L.forceWrite=o;var i={br:!0,hr:!0,img:!0,input:!0};function t(l){return l.children.length===0&&i[l.tag.tagName]}L.isVoidElement=t},{"../styles/html-paths":28}],18:[function(X,ce,L){var z=X("./ast");L.freshElement=z.freshElement,L.nonFreshElement=z.nonFreshElement,L.elementWithTag=z.elementWithTag,L.text=z.text,L.forceWrite=z.forceWrite,L.simplify=X("./simplify");function I(i,t){t.forEach(function(l){p(i,l)})}function p(i,t){k[t.type](i,t)}var k={element:c,text:o,forceWrite:function(){}};function c(i,t){if(z.isVoidElement(t))i.selfClosing(t.tag.tagName,t.tag.attributes);else i.open(t.tag.tagName,t.tag.attributes),I(i,t.children),i.close(t.tag.tagName)}function o(i,t){i.text(t.value)}L.write=I},{"./ast":17,"./simplify":19}],19:[function(X,ce,L){var z=X("underscore"),I=X("./ast");function p(x){return k(g(x))}function k(x){var n=[];return x.map(c).forEach(function(v){l(n,v)}),n}function c(x){return o[x.type](x)}var o={element:i,text:t,forceWrite:t};function i(x){return I.elementWithTag(x.tag,k(x.children))}function t(x){return x}function l(x,n){var v=x[x.length-1];if(n.type==="element"&&!n.tag.fresh&&v&&v.type==="element"&&n.tag.matchesElement(v.tag)){if(n.tag.separator)l(v.children,I.text(n.tag.separator));n.children.forEach(function(a){l(v.children,a)})}else x.push(n)}function g(x){return _(x,function(n){return w[n.type](n)})}function _(x,n){return z.flatten(z.map(x,n),!0)}var w={element:h,text:T,forceWrite:y};function y(x){return[x]}function h(x){var n=g(x.children);if(n.length===0&&!I.isVoidElement(x))return[];else return[I.elementWithTag(x.tag,n)]}function T(x){if(x.value.length===0)return[];else return[x]}ce.exports=p},{"./ast":17,underscore:67}],20:[function(X,ce,L){var z=X("underscore"),I=X("./promises"),p=X("./html");L.imgElement=k;function k(o){return function(i,t){return I.resolve(o(i)).then(function(l){var g={};if(i.altText)g.alt=i.altText;return z.extend(g,l),[p.freshElement("img",g)]})}}L.inline=L.imgElement,L.dataUri=k(function(o){return o.readAsBase64String().then(function(i){return{src:"data:"+o.contentType+";base64,"+i}})});function c(o){return o.contentType.split(/\/|\\/)[1]}L.imageFilenameExtension=c},{"./html":18,"./promises":23,underscore:67}],21:[function(X,ce,L){(function(z){var I=X("underscore"),p=X("./docx/docx-reader"),k=X("./docx/style-map"),c=X("./document-to-html").DocumentConverter,o=X("./raw-text").convertElementToRawText,i=X("./style-reader").readStyle,t=X("./options-reader").readOptions,l=X("./promises"),g=X("./unzip"),_=X("./results").Result;L.convertToHtml=w,L.convertToMarkdown=y,L.convert=h,L.extractRawText=v,L.images=X("./images"),L.transforms=X("./transforms"),L.underline=X("./underline"),L.embedStyleMap=a,L.readEmbeddedStyleMap=T;function w(E,F){return h(E,F)}function y(E,F){var A=Object.create(F||{});return A.outputFormat="markdown",h(E,A)}function h(E,F){F=t(F);var A=g.openZip(E).then(function(W){return k.readStyleMap(W).then(function(S){return F.embeddedStyleMap=S,W})}).then(function(W){return p.read(W,E,F).then(function(S){return S.map(F.transformDocument)}).then(function(S){return x(S,F)})});return l.toExternalPromise(A)}function T(E){var F=g.openZip(E).then(k.readStyleMap);return l.toExternalPromise(F)}function x(E,F){var A=n(F.readStyleMap()),W=I.extend({},F,{styleMap:A.value}),S=new c(W);return E.flatMapThen(function(P){return A.flatMapThen(function(O){return S.convertToHtml(P)})})}function n(E){return _.combine((E||[]).map(i)).map(function(F){return F.filter(function(A){return!!A})})}function v(E){var F=g.openZip(E).then(p.read).then(function(A){return A.map(o)});return l.toExternalPromise(F)}function a(E,F){var A=g.openZip(E).then(function(W){return k.writeStyleMap(W,F).then(function(){return W})}).then(function(W){return W.toArrayBuffer()}).then(function(W){return{toArrayBuffer:function(){return W},toBuffer:function(){return z.from(W)}}});return l.toExternalPromise(A)}L.styleMapping=function(){throw Error(`Use a raw string instead of mammoth.styleMapping e.g. "p[style-name='Title'] => h1" instead of mammoth.styleMapping("p[style-name='Title'] => h1")`)}}).call(this,X("buffer").Buffer)},{"./document-to-html":3,"./docx/docx-reader":9,"./docx/style-map":14,"./images":20,"./options-reader":22,"./promises":23,"./raw-text":24,"./results":25,"./style-reader":26,"./transforms":30,"./underline":31,"./unzip":2,buffer:48,underscore:67}],22:[function(X,ce,L){L.readOptions=k;var z=X("underscore"),I=L._defaultStyleMap=["p.Heading1 => h1:fresh","p.Heading2 => h2:fresh","p.Heading3 => h3:fresh","p.Heading4 => h4:fresh","p.Heading5 => h5:fresh","p.Heading6 => h6:fresh","p[style-name='Heading 1'] => h1:fresh","p[style-name='Heading 2'] => h2:fresh","p[style-name='Heading 3'] => h3:fresh","p[style-name='Heading 4'] => h4:fresh","p[style-name='Heading 5'] => h5:fresh","p[style-name='Heading 6'] => h6:fresh","p[style-name='heading 1'] => h1:fresh","p[style-name='heading 2'] => h2:fresh","p[style-name='heading 3'] => h3:fresh","p[style-name='heading 4'] => h4:fresh","p[style-name='heading 5'] => h5:fresh","p[style-name='heading 6'] => h6:fresh","p.Heading => h1:fresh","p[style-name='Heading'] => h1:fresh","r[style-name='Strong'] => strong","p[style-name='footnote text'] => p:fresh","r[style-name='footnote reference'] =>","p[style-name='endnote text'] => p:fresh","r[style-name='endnote reference'] =>","p[style-name='annotation text'] => p:fresh","r[style-name='annotation reference'] =>","p[style-name='Footnote'] => p:fresh","r[style-name='Footnote anchor'] =>","p[style-name='Endnote'] => p:fresh","r[style-name='Endnote anchor'] =>","p:unordered-list(1) => ul > li:fresh","p:unordered-list(2) => ul|ol > li > ul > li:fresh","p:unordered-list(3) => ul|ol > li > ul|ol > li > ul > li:fresh","p:unordered-list(4) => ul|ol > li > ul|ol > li > ul|ol > li > ul > li:fresh","p:unordered-list(5) => ul|ol > li > ul|ol > li > ul|ol > li > ul|ol > li > ul > li:fresh","p:ordered-list(1) => ol > li:fresh","p:ordered-list(2) => ul|ol > li > ol > li:fresh","p:ordered-list(3) => ul|ol > li > ul|ol > li > ol > li:fresh","p:ordered-list(4) => ul|ol > li > ul|ol > li > ul|ol > li > ol > li:fresh","p:ordered-list(5) => ul|ol > li > ul|ol > li > ul|ol > li > ul|ol > li > ol > li:fresh","r[style-name='Hyperlink'] =>","p[style-name='Normal'] => p:fresh","p.Body => p:fresh","p[style-name='Body'] => p:fresh"],p=L._standardOptions={externalFileAccess:!1,transformDocument:o,includeDefaultStyleMap:!0,includeEmbeddedStyleMap:!0};function k(i){return i=i||{},z.extend({},p,i,{customStyleMap:c(i.styleMap),readStyleMap:function(){var t=this.customStyleMap;if(this.includeEmbeddedStyleMap)t=t.concat(c(this.embeddedStyleMap));if(this.includeDefaultStyleMap)t=t.concat(I);return t}})}function c(i){if(!i)return[];else if(z.isString(i))return i.split(`
3
3
  `).map(function(t){return t.trim()}).filter(function(t){return t!==""&&t.charAt(0)!=="#"});else return i}function o(i){return i}},{underscore:67}],23:[function(X,ce,L){(function(z){var I=X("underscore");L.defer=o,L.Promise=Promise,L.resolve=Promise.resolve.bind(Promise),L.reject=Promise.reject.bind(Promise),L.forEachSeries=function(g,_){var w=0,y=o(),h=function(){if(w<g.length){var T=g[w];w++,_(T).then(h,y.reject)}else y.resolve()};return h(),y.promise};var p=L.props=function(g){var _=Object.keys(g),w=Object.values(g),y=Promise.all(w).then(function(h){var T={};for(var x=0;x<_.length;x++)T[_[x]]=h[x];return T});return c(y)},k=function(g){var _=this.then(function(w){var y=I.extend({},w,g(w));return p(y)});return c(_)};function c(g){return g.also=k,g}L.try=function(g){try{return Promise.resolve(g())}catch(_){return Promise.reject(_)}};function o(){var g,_,w=new Promise(function(y,h){g=y,_=h});return{resolve:g,reject:_,promise:w}}function i(g){var _=new Promise(g);return _.__proto__=i.prototype,_}i.__proto__=Promise,i.prototype.__proto__=Promise.prototype,i.prototype.done=function(g,_){return this.then(g,_).catch(function(w){if(l()){var y=w instanceof Error?w.stack:w;z.stderr.write("Fatal "+y+`
4
4
  `),z.exit(2)}else setTimeout(function(){throw w},0)})};function t(g){return i.resolve(g)}L.toExternalPromise=t;function l(){if(typeof z>"u")return!1;return{}.toString.call(z).toLowerCase()==="[object process]"}}).call(this,X("_process"))},{_process:66,underscore:67}],24:[function(X,ce,L){var z=X("./documents");function I(p){if(p.type==="text")return p.value;else if(p.type===z.types.tab)return"\t";else{var k=p.type==="paragraph"?`
@@ -55,4 +55,4 @@ __p+='`;return Ce}),re+=`';
55
55
  `;var Ee;try{Ee=Function(he,"_",re)}catch(Ce){throw Ce.source=re,Ce}var Le=function(Ce){return Ee.call(this,Ce,_e)};return Le.source="function("+he+`){
56
56
  `+re+"}",Le}function Or(b,C,V){C=Ye(C);var Z=C.length;if(!Z)return Q(V)?V.call(b):V;for(var ae=0;ae<Z;ae++){var re=b==null?void 0:b[C[ae]];if(re===void 0)re=V,ae=Z;b=Q(re)?re.call(b):re}return b}var Cr=0;function Rr(b){var C=++Cr+"";return b?b+C:C}function Mr(b){var C=_e(b);return C._chain=!0,C}function $t(b,C,V,Z,ae){if(!(Z instanceof C))return b.apply(V,ae);var re=G(b.prototype),he=b.apply(re,ae);if(W(he))return he;return re}var bt=A(function(b,C){var V=bt.placeholder,Z=function(){var ae=0,re=C.length,he=Array(re);for(var Ee=0;Ee<re;Ee++)he[Ee]=C[Ee]===V?arguments[ae++]:C[Ee];while(ae<arguments.length)he.push(arguments[ae++]);return $t(b,Z,this,this,he)};return Z});bt.placeholder=_e;var Jt=A(function(b,C,V){if(!Q(b))throw TypeError("Bind must be called on a function");var Z=A(function(ae){return $t(b,Z,C,this,V.concat(ae))});return Z}),rt=q(M);function gt(b,C,V,Z){if(Z=Z||[],!C&&C!==0)C=1/0;else if(C<=0)return Z.concat(b);var ae=Z.length;for(var re=0,he=M(b);re<he;re++){var Ee=b[re];if(rt(Ee)&&(Ie(Ee)||Re(Ee)))if(C>1)gt(Ee,C-1,V,Z),ae=Z.length;else{var Le=0,Ce=Ee.length;while(Le<Ce)Z[ae++]=Ee[Le++]}else if(!V)Z[ae++]=Ee}return Z}var Lr=A(function(b,C){C=gt(C,!1,!1);var V=C.length;if(V<1)throw Error("bindAll must be passed function names");while(V--){var Z=C[V];b[Z]=Jt(b[Z],b)}return b});function Pr(b,C){var V=function(Z){var ae=V.cache,re=""+(C?C.apply(this,arguments):Z);if(!ke(ae,re))ae[re]=b.apply(this,arguments);return ae[re]};return V.cache={},V}var Qt=A(function(b,C,V){return setTimeout(function(){return b.apply(null,V)},C)}),Fr=bt(Qt,_e,1);function Xr(b,C,V){var Z,ae,re,he,Ee=0;if(!V)V={};var Le=function(){if(Ee=V.leading===!1?0:Dt(),Z=null,he=b.apply(ae,re),!Z)ae=re=null},Ce=function(){var Ke=Dt();if(!Ee&&V.leading===!1)Ee=Ke;var qe=C-(Ke-Ee);if(ae=this,re=arguments,qe<=0||qe>C){if(Z)clearTimeout(Z),Z=null;if(Ee=Ke,he=b.apply(ae,re),!Z)ae=re=null}else if(!Z&&V.trailing!==!1)Z=setTimeout(Le,qe);return he};return Ce.cancel=function(){clearTimeout(Z),Ee=0,Z=ae=re=null},Ce}function zr(b,C,V){var Z,ae,re,he,Ee,Le=function(){var Ke=Dt()-ae;if(C>Ke)Z=setTimeout(Le,C-Ke);else{if(Z=null,!V)he=b.apply(Ee,re);if(!Z)re=Ee=null}},Ce=A(function(Ke){if(Ee=this,re=Ke,ae=Dt(),!Z){if(Z=setTimeout(Le,C),V)he=b.apply(Ee,re)}return he});return Ce.cancel=function(){clearTimeout(Z),Z=re=Ee=null},Ce}function Ur(b,C){return bt(C,b)}function Pt(b){return function(){return!b.apply(this,arguments)}}function Wr(){var b=arguments,C=b.length-1;return function(){var V=C,Z=b[C].apply(this,arguments);while(V--)Z=b[V].call(this,Z);return Z}}function jr(b,C){return function(){if(--b<1)return C.apply(this,arguments)}}function qt(b,C){var V;return function(){if(--b>0)V=C.apply(this,arguments);if(b<=1)C=null;return V}}var Hr=bt(qt,2);function er(b,C,V){C=Ue(C,V);var Z=ue(b),ae;for(var re=0,he=Z.length;re<he;re++)if(ae=Z[re],C(b[ae],ae,b))return ae}function tr(b){return function(C,V,Z){V=Ue(V,Z);var ae=M(C),re=b>0?0:ae-1;for(;re>=0&&re<ae;re+=b)if(V(C[re],re,C))return re;return-1}}var Ft=tr(1),rr=tr(-1);function nr(b,C,V,Z){V=Ue(V,Z,1);var ae=V(C),re=0,he=M(b);while(re<he){var Ee=Math.floor((re+he)/2);if(V(b[Ee])<ae)re=Ee+1;else he=Ee}return re}function ir(b,C,V){return function(Z,ae,re){var he=0,Ee=M(Z);if(typeof re=="number")if(b>0)he=re>=0?re:Math.max(re+Ee,he);else Ee=re>=0?Math.min(re+1,Ee):re+Ee+1;else if(V&&re&&Ee)return re=V(Z,ae),Z[re]===ae?re:-1;if(ae!==ae)return re=C(t.call(Z,he,Ee),Ae),re>=0?re+he:-1;for(re=b>0?he:Ee-1;re>=0&&re<Ee;re+=b)if(Z[re]===ae)return re;return-1}}var ar=ir(1,Ft,nr),Vr=ir(-1,rr);function Bt(b,C,V){var Z=rt(b)?Ft:er,ae=Z(b,C,V);if(ae!==void 0&&ae!==-1)return b[ae]}function Zr(b,C){return Bt(b,it(C))}function mt(b,C,V){C=Je(C,V);var Z,ae;if(rt(b))for(Z=0,ae=b.length;Z<ae;Z++)C(b[Z],Z,b);else{var re=ue(b);for(Z=0,ae=re.length;Z<ae;Z++)C(b[re[Z]],re[Z],b)}return b}function wt(b,C,V){C=Ue(C,V);var Z=!rt(b)&&ue(b),ae=(Z||b).length,re=Array(ae);for(var he=0;he<ae;he++){var Ee=Z?Z[he]:he;re[he]=C(b[Ee],Ee,b)}return re}function or(b){var C=function(V,Z,ae,re){var he=!rt(V)&&ue(V),Ee=(he||V).length,Le=b>0?0:Ee-1;if(!re)ae=V[he?he[Le]:Le],Le+=b;for(;Le>=0&&Le<Ee;Le+=b){var Ce=he?he[Le]:Le;ae=Z(ae,V[Ce],Ce,V)}return ae};return function(V,Z,ae,re){var he=arguments.length>=3;return C(V,Je(Z,re,4),ae,he)}}var Xt=or(1),sr=or(-1);function Et(b,C,V){var Z=[];return C=Ue(C,V),mt(b,function(ae,re,he){if(C(ae,re,he))Z.push(ae)}),Z}function Yr(b,C,V){return Et(b,Pt(Ue(C)),V)}function ur(b,C,V){C=Ue(C,V);var Z=!rt(b)&&ue(b),ae=(Z||b).length;for(var re=0;re<ae;re++){var he=Z?Z[re]:re;if(!C(b[he],he,b))return!1}return!0}function lr(b,C,V){C=Ue(C,V);var Z=!rt(b)&&ue(b),ae=(Z||b).length;for(var re=0;re<ae;re++){var he=Z?Z[re]:re;if(C(b[he],he,b))return!0}return!1}function vt(b,C,V,Z){if(!rt(b))b=lt(b);if(typeof V!="number"||Z)V=0;return ar(b,C,V)>=0}var Gr=A(function(b,C,V){var Z,ae;if(Q(C))ae=C;else C=Ye(C),Z=C.slice(0,-1),C=C[C.length-1];return wt(b,function(re){var he=ae;if(!he){if(Z&&Z.length)re=nt(re,Z);if(re==null)return;he=re[C]}return he==null?he:he.apply(re,V)})});function zt(b,C){return wt(b,ut(C))}function Kr(b,C){return Et(b,it(C))}function cr(b,C,V){var Z=-1/0,ae=-1/0,re,he;if(C==null||typeof C=="number"&&typeof b[0]!="object"&&b!=null){b=rt(b)?b:lt(b);for(var Ee=0,Le=b.length;Ee<Le;Ee++)if(re=b[Ee],re!=null&&re>Z)Z=re}else C=Ue(C,V),mt(b,function(Ce,Ke,qe){if(he=C(Ce,Ke,qe),he>ae||he===-1/0&&Z===-1/0)Z=Ce,ae=he});return Z}function $r(b,C,V){var Z=1/0,ae=1/0,re,he;if(C==null||typeof C=="number"&&typeof b[0]!="object"&&b!=null){b=rt(b)?b:lt(b);for(var Ee=0,Le=b.length;Ee<Le;Ee++)if(re=b[Ee],re!=null&&re<Z)Z=re}else C=Ue(C,V),mt(b,function(Ce,Ke,qe){if(he=C(Ce,Ke,qe),he<ae||he===1/0&&Z===1/0)Z=Ce,ae=he});return Z}function fr(b,C,V){if(C==null||V){if(!rt(b))b=lt(b);return b[Mt(b.length-1)]}var Z=rt(b)?ge(b):lt(b),ae=M(Z);C=Math.max(Math.min(C,ae),0);var re=ae-1;for(var he=0;he<C;he++){var Ee=Mt(he,re),Le=Z[he];Z[he]=Z[Ee],Z[Ee]=Le}return Z.slice(0,C)}function Jr(b){return fr(b,1/0)}function Qr(b,C,V){var Z=0;return C=Ue(C,V),zt(wt(b,function(ae,re,he){return{value:ae,index:Z++,criteria:C(ae,re,he)}}).sort(function(ae,re){var he=ae.criteria,Ee=re.criteria;if(he!==Ee){if(he>Ee||he===void 0)return 1;if(he<Ee||Ee===void 0)return-1}return ae.index-re.index}),"value")}function Ct(b,C){return function(V,Z,ae){var re=C?[[],[]]:{};return Z=Ue(Z,ae),mt(V,function(he,Ee){var Le=Z(he,Ee,V);b(re,he,Le)}),re}}var qr=Ct(function(b,C,V){if(ke(b,V))b[V].push(C);else b[V]=[C]}),en=Ct(function(b,C,V){b[V]=C}),tn=Ct(function(b,C,V){if(ke(b,V))b[V]++;else b[V]=1}),rn=Ct(function(b,C,V){b[V?0:1].push(C)},!0),nn=/[^\ud800-\udfff]|[\ud800-\udbff][\udc00-\udfff]|[\ud800-\udfff]/g;function on(b){if(!b)return[];if(Ie(b))return t.call(b);if(U(b))return b.match(nn);if(rt(b))return wt(b,st);return lt(b)}function sn(b){if(b==null)return 0;return rt(b)?b.length:ue(b).length}function un(b,C,V){return C in V}var hr=A(function(b,C){var V={},Z=C[0];if(b==null)return V;if(Q(Z)){if(C.length>1)Z=Je(Z,C[1]);C=me(b)}else Z=un,C=gt(C,!1,!1),b=Object(b);for(var ae=0,re=C.length;ae<re;ae++){var he=C[ae],Ee=b[he];if(Z(Ee,he,b))V[he]=Ee}return V}),ln=A(function(b,C){var V=C[0],Z;if(Q(V)){if(V=Pt(V),C.length>1)Z=C[1]}else C=wt(gt(C,!1,!1),String),V=function(ae,re){return!vt(C,re)};return hr(b,V,Z)});function pr(b,C,V){return t.call(b,0,Math.max(0,b.length-(C==null||V?1:C)))}function Ut(b,C,V){if(b==null||b.length<1)return C==null||V?void 0:[];if(C==null||V)return b[0];return pr(b,b.length-C)}function Rt(b,C,V){return t.call(b,C==null||V?1:C)}function cn(b,C,V){if(b==null||b.length<1)return C==null||V?void 0:[];if(C==null||V)return b[b.length-1];return Rt(b,Math.max(0,b.length-C))}function fn(b){return Et(b,Boolean)}function hn(b,C){return gt(b,C,!1)}var dr=A(function(b,C){return C=gt(C,!0,!0),Et(b,function(V){return!vt(C,V)})}),pn=A(function(b,C){return dr(b,C)});function Wt(b,C,V,Z){if(!O(C))Z=V,V=C,C=!1;if(V!=null)V=Ue(V,Z);var ae=[],re=[];for(var he=0,Ee=M(b);he<Ee;he++){var Le=b[he],Ce=V?V(Le,he,b):Le;if(C&&!V){if(!he||re!==Ce)ae.push(Le);re=Ce}else if(V){if(!vt(re,Ce))re.push(Ce),ae.push(Le)}else if(!vt(ae,Le))ae.push(Le)}return ae}var dn=A(function(b){return Wt(gt(b,!0,!0))});function mn(b){var C=[],V=arguments.length;for(var Z=0,ae=M(b);Z<ae;Z++){var re=b[Z];if(vt(C,re))continue;var he;for(he=1;he<V;he++)if(!vt(arguments[he],re))break;if(he===V)C.push(re)}return C}function jt(b){var C=b&&cr(b,M).length||0,V=Array(C);for(var Z=0;Z<C;Z++)V[Z]=zt(b,Z);return V}var vn=A(jt);function gn(b,C){var V={};for(var Z=0,ae=M(b);Z<ae;Z++)if(C)V[b[Z]]=C[Z];else V[b[Z][0]]=b[Z][1];return V}function wn(b,C,V){if(C==null)C=b||0,b=0;if(!V)V=C<b?-1:1;var Z=Math.max(Math.ceil((C-b)/V),0),ae=Array(Z);for(var re=0;re<Z;re++,b+=V)ae[re]=b;return ae}function _n(b,C){if(C==null||C<1)return[];var V=[],Z=0,ae=b.length;while(Z<ae)V.push(t.call(b,Z,Z+=C));return V}function Ht(b,C){return b._chain?_e(C).chain():C}function mr(b){return mt(_t(b),function(C){var V=_e[C]=b[C];_e.prototype[C]=function(){var Z=[this._wrapped];return i.apply(Z,arguments),Ht(this,V.apply(_e,Z))}}),_e}mt(["pop","push","reverse","shift","sort","splice","unshift"],function(b){var C=k[b];_e.prototype[b]=function(){var V=this._wrapped;if(V!=null){if(C.apply(V,arguments),(b==="shift"||b==="splice")&&V.length===0)delete V[0]}return Ht(this,V)}}),mt(["concat","join","slice"],function(b){var C=k[b];_e.prototype[b]=function(){var V=this._wrapped;if(V!=null)V=C.apply(V,arguments);return Ht(this,V)}});var bn={__proto__:null,VERSION:I,restArguments:A,isObject:W,isNull:S,isUndefined:P,isBoolean:O,isElement:H,isString:U,isNumber:J,isDate:D,isRegExp:te,isError:ye,isSymbol:se,isArrayBuffer:ve,isDataView:Be,isArray:Ie,isFunction:Q,isArguments:Re,isFinite:We,isNaN:Ae,isTypedArray:N,isEmpty:we,isMatch:Se,isEqual:oe,isMap:at,isWeakMap:xt,isSet:kt,isWeakSet:St,keys:ue,allKeys:me,values:lt,pairs:Tt,invert:ht,functions:_t,methods:_t,extend:It,extendOwn:Nt,assign:Nt,defaults:R,create:fe,clone:ge,tap:Oe,get:tt,has:ot,mapObject:At,identity:st,constant:d,noop:dt,toPath:je,property:ut,propertyOf:Ot,matcher:it,matches:it,times:br,random:Mt,now:Dt,escape:Er,unescape:Tr,templateSettings:Ir,template:Ar,result:Or,uniqueId:Rr,chain:Mr,iteratee:pt,partial:bt,bind:Jt,bindAll:Lr,memoize:Pr,delay:Qt,defer:Fr,throttle:Xr,debounce:zr,wrap:Ur,negate:Pt,compose:Wr,after:jr,before:qt,once:Hr,findKey:er,findIndex:Ft,findLastIndex:rr,sortedIndex:nr,indexOf:ar,lastIndexOf:Vr,find:Bt,detect:Bt,findWhere:Zr,each:mt,forEach:mt,map:wt,collect:wt,reduce:Xt,foldl:Xt,inject:Xt,reduceRight:sr,foldr:sr,filter:Et,select:Et,reject:Yr,every:ur,all:ur,some:lr,any:lr,contains:vt,includes:vt,include:vt,invoke:Gr,pluck:zt,where:Kr,max:cr,min:$r,shuffle:Jr,sample:fr,sortBy:Qr,groupBy:qr,indexBy:en,countBy:tn,partition:rn,toArray:on,size:sn,pick:hr,omit:ln,first:Ut,head:Ut,take:Ut,initial:pr,last:cn,rest:Rt,tail:Rt,drop:Rt,compact:fn,flatten:hn,without:pn,uniq:Wt,unique:Wt,union:dn,intersection:mn,difference:dr,unzip:jt,transpose:jt,zip:vn,object:gn,range:wn,chunk:_n,mixin:mr,default:_e},Vt=mr(bn);return Vt._=Vt,Vt})}).call(this,typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{})},{}],68:[function(X,ce,L){(function(){var z,I,p,k,c,o,i,t=[].slice,l={}.hasOwnProperty;z=function(){var g,_,w,y,h,T;if(T=arguments[0],h=2<=arguments.length?t.call(arguments,1):[],c(Object.assign))Object.assign.apply(null,arguments);else for(g=0,w=h.length;g<w;g++)if(y=h[g],y!=null)for(_ in y){if(!l.call(y,_))continue;T[_]=y[_]}return T},c=function(g){return!!g&&Object.prototype.toString.call(g)==="[object Function]"},o=function(g){var _;return!!g&&((_=typeof g)==="function"||_==="object")},p=function(g){if(c(Array.isArray))return Array.isArray(g);else return Object.prototype.toString.call(g)==="[object Array]"},k=function(g){var _;if(p(g))return!g.length;else{for(_ in g){if(!l.call(g,_))continue;return!1}return!0}},i=function(g){var _,w;return o(g)&&(w=Object.getPrototypeOf(g))&&(_=w.constructor)&&typeof _==="function"&&_ instanceof _&&Function.prototype.toString.call(_)===Function.prototype.toString.call(Object)},I=function(g){if(c(g.valueOf))return g.valueOf();else return g},ce.exports.assign=z,ce.exports.isFunction=c,ce.exports.isObject=o,ce.exports.isArray=p,ce.exports.isEmpty=k,ce.exports.isPlainObject=i,ce.exports.getValue=I}).call(this)},{}],69:[function(X,ce,L){(function(){var z;ce.exports=z=function(){function I(p,k,c){if(this.options=p.options,this.stringify=p.stringify,this.parent=p,k==null)throw Error("Missing attribute name. "+this.debugInfo(k));if(c==null)throw Error("Missing attribute value. "+this.debugInfo(k));this.name=this.stringify.attName(k),this.value=this.stringify.attValue(c)}return I.prototype.clone=function(){return Object.create(this)},I.prototype.toString=function(p){return this.options.writer.set(p).attribute(this)},I.prototype.debugInfo=function(p){var k,c;if(p=p||this.name,p==null&&!((k=this.parent)!=null?k.name:void 0))return"";else if(p==null)return"parent: <"+this.parent.name+">";else if(!((c=this.parent)!=null?c.name:void 0))return"attribute: {"+p+"}";else return"attribute: {"+p+"}, parent: <"+this.parent.name+">"},I}()}).call(this)},{}],70:[function(X,ce,L){(function(){var z,I,p=function(c,o){for(var i in o)if(k.call(o,i))c[i]=o[i];function t(){this.constructor=c}return t.prototype=o.prototype,c.prototype=new t,c.__super__=o.prototype,c},k={}.hasOwnProperty;I=X("./XMLNode"),ce.exports=z=function(c){p(o,c);function o(i,t){if(o.__super__.constructor.call(this,i),t==null)throw Error("Missing CDATA text. "+this.debugInfo());this.text=this.stringify.cdata(t)}return o.prototype.clone=function(){return Object.create(this)},o.prototype.toString=function(i){return this.options.writer.set(i).cdata(this)},o}(I)}).call(this)},{"./XMLNode":81}],71:[function(X,ce,L){(function(){var z,I,p=function(c,o){for(var i in o)if(k.call(o,i))c[i]=o[i];function t(){this.constructor=c}return t.prototype=o.prototype,c.prototype=new t,c.__super__=o.prototype,c},k={}.hasOwnProperty;I=X("./XMLNode"),ce.exports=z=function(c){p(o,c);function o(i,t){if(o.__super__.constructor.call(this,i),t==null)throw Error("Missing comment text. "+this.debugInfo());this.text=this.stringify.comment(t)}return o.prototype.clone=function(){return Object.create(this)},o.prototype.toString=function(i){return this.options.writer.set(i).comment(this)},o}(I)}).call(this)},{"./XMLNode":81}],72:[function(X,ce,L){(function(){var z,I,p=function(c,o){for(var i in o)if(k.call(o,i))c[i]=o[i];function t(){this.constructor=c}return t.prototype=o.prototype,c.prototype=new t,c.__super__=o.prototype,c},k={}.hasOwnProperty;I=X("./XMLNode"),ce.exports=z=function(c){p(o,c);function o(i,t,l,g,_,w){if(o.__super__.constructor.call(this,i),t==null)throw Error("Missing DTD element name. "+this.debugInfo());if(l==null)throw Error("Missing DTD attribute name. "+this.debugInfo(t));if(!g)throw Error("Missing DTD attribute type. "+this.debugInfo(t));if(!_)throw Error("Missing DTD attribute default. "+this.debugInfo(t));if(_.indexOf("#")!==0)_="#"+_;if(!_.match(/^(#REQUIRED|#IMPLIED|#FIXED|#DEFAULT)$/))throw Error("Invalid default value type; expected: #REQUIRED, #IMPLIED, #FIXED or #DEFAULT. "+this.debugInfo(t));if(w&&!_.match(/^(#FIXED|#DEFAULT)$/))throw Error("Default value only applies to #FIXED or #DEFAULT. "+this.debugInfo(t));this.elementName=this.stringify.eleName(t),this.attributeName=this.stringify.attName(l),this.attributeType=this.stringify.dtdAttType(g),this.defaultValue=this.stringify.dtdAttDefault(w),this.defaultValueType=_}return o.prototype.toString=function(i){return this.options.writer.set(i).dtdAttList(this)},o}(I)}).call(this)},{"./XMLNode":81}],73:[function(X,ce,L){(function(){var z,I,p=function(c,o){for(var i in o)if(k.call(o,i))c[i]=o[i];function t(){this.constructor=c}return t.prototype=o.prototype,c.prototype=new t,c.__super__=o.prototype,c},k={}.hasOwnProperty;I=X("./XMLNode"),ce.exports=z=function(c){p(o,c);function o(i,t,l){if(o.__super__.constructor.call(this,i),t==null)throw Error("Missing DTD element name. "+this.debugInfo());if(!l)l="(#PCDATA)";if(Array.isArray(l))l="("+l.join(",")+")";this.name=this.stringify.eleName(t),this.value=this.stringify.dtdElementValue(l)}return o.prototype.toString=function(i){return this.options.writer.set(i).dtdElement(this)},o}(I)}).call(this)},{"./XMLNode":81}],74:[function(X,ce,L){(function(){var z,I,p,k=function(o,i){for(var t in i)if(c.call(i,t))o[t]=i[t];function l(){this.constructor=o}return l.prototype=i.prototype,o.prototype=new l,o.__super__=i.prototype,o},c={}.hasOwnProperty;p=X("./Utility").isObject,I=X("./XMLNode"),ce.exports=z=function(o){k(i,o);function i(t,l,g,_){if(i.__super__.constructor.call(this,t),g==null)throw Error("Missing DTD entity name. "+this.debugInfo(g));if(_==null)throw Error("Missing DTD entity value. "+this.debugInfo(g));if(this.pe=!!l,this.name=this.stringify.eleName(g),!p(_))this.value=this.stringify.dtdEntityValue(_);else{if(!_.pubID&&!_.sysID)throw Error("Public and/or system identifiers are required for an external entity. "+this.debugInfo(g));if(_.pubID&&!_.sysID)throw Error("System identifier is required for a public external entity. "+this.debugInfo(g));if(_.pubID!=null)this.pubID=this.stringify.dtdPubID(_.pubID);if(_.sysID!=null)this.sysID=this.stringify.dtdSysID(_.sysID);if(_.nData!=null)this.nData=this.stringify.dtdNData(_.nData);if(this.pe&&this.nData)throw Error("Notation declaration is not allowed in a parameter entity. "+this.debugInfo(g))}}return i.prototype.toString=function(t){return this.options.writer.set(t).dtdEntity(this)},i}(I)}).call(this)},{"./Utility":68,"./XMLNode":81}],75:[function(X,ce,L){(function(){var z,I,p=function(c,o){for(var i in o)if(k.call(o,i))c[i]=o[i];function t(){this.constructor=c}return t.prototype=o.prototype,c.prototype=new t,c.__super__=o.prototype,c},k={}.hasOwnProperty;I=X("./XMLNode"),ce.exports=z=function(c){p(o,c);function o(i,t,l){if(o.__super__.constructor.call(this,i),t==null)throw Error("Missing DTD notation name. "+this.debugInfo(t));if(!l.pubID&&!l.sysID)throw Error("Public or system identifiers are required for an external entity. "+this.debugInfo(t));if(this.name=this.stringify.eleName(t),l.pubID!=null)this.pubID=this.stringify.dtdPubID(l.pubID);if(l.sysID!=null)this.sysID=this.stringify.dtdSysID(l.sysID)}return o.prototype.toString=function(i){return this.options.writer.set(i).dtdNotation(this)},o}(I)}).call(this)},{"./XMLNode":81}],76:[function(X,ce,L){(function(){var z,I,p,k=function(o,i){for(var t in i)if(c.call(i,t))o[t]=i[t];function l(){this.constructor=o}return l.prototype=i.prototype,o.prototype=new l,o.__super__=i.prototype,o},c={}.hasOwnProperty;p=X("./Utility").isObject,I=X("./XMLNode"),ce.exports=z=function(o){k(i,o);function i(t,l,g,_){var w;if(i.__super__.constructor.call(this,t),p(l))w=l,l=w.version,g=w.encoding,_=w.standalone;if(!l)l="1.0";if(this.version=this.stringify.xmlVersion(l),g!=null)this.encoding=this.stringify.xmlEncoding(g);if(_!=null)this.standalone=this.stringify.xmlStandalone(_)}return i.prototype.toString=function(t){return this.options.writer.set(t).declaration(this)},i}(I)}).call(this)},{"./Utility":68,"./XMLNode":81}],77:[function(X,ce,L){(function(){var z,I,p,k,c,o,i,t=function(g,_){for(var w in _)if(l.call(_,w))g[w]=_[w];function y(){this.constructor=g}return y.prototype=_.prototype,g.prototype=new y,g.__super__=_.prototype,g},l={}.hasOwnProperty;i=X("./Utility").isObject,o=X("./XMLNode"),z=X("./XMLDTDAttList"),p=X("./XMLDTDEntity"),I=X("./XMLDTDElement"),k=X("./XMLDTDNotation"),ce.exports=c=function(g){t(_,g);function _(w,y,h){var T,x;if(_.__super__.constructor.call(this,w),this.name="!DOCTYPE",this.documentObject=w,i(y))T=y,y=T.pubID,h=T.sysID;if(h==null)x=[y,h],h=x[0],y=x[1];if(y!=null)this.pubID=this.stringify.dtdPubID(y);if(h!=null)this.sysID=this.stringify.dtdSysID(h)}return _.prototype.element=function(w,y){var h=new I(this,w,y);return this.children.push(h),this},_.prototype.attList=function(w,y,h,T,x){var n=new z(this,w,y,h,T,x);return this.children.push(n),this},_.prototype.entity=function(w,y){var h=new p(this,!1,w,y);return this.children.push(h),this},_.prototype.pEntity=function(w,y){var h=new p(this,!0,w,y);return this.children.push(h),this},_.prototype.notation=function(w,y){var h=new k(this,w,y);return this.children.push(h),this},_.prototype.toString=function(w){return this.options.writer.set(w).docType(this)},_.prototype.ele=function(w,y){return this.element(w,y)},_.prototype.att=function(w,y,h,T,x){return this.attList(w,y,h,T,x)},_.prototype.ent=function(w,y){return this.entity(w,y)},_.prototype.pent=function(w,y){return this.pEntity(w,y)},_.prototype.not=function(w,y){return this.notation(w,y)},_.prototype.up=function(){return this.root()||this.documentObject},_}(o)}).call(this)},{"./Utility":68,"./XMLDTDAttList":72,"./XMLDTDElement":73,"./XMLDTDEntity":74,"./XMLDTDNotation":75,"./XMLNode":81}],78:[function(X,ce,L){(function(){var z,I,p,k,c,o=function(t,l){for(var g in l)if(i.call(l,g))t[g]=l[g];function _(){this.constructor=t}return _.prototype=l.prototype,t.prototype=new _,t.__super__=l.prototype,t},i={}.hasOwnProperty;c=X("./Utility").isPlainObject,I=X("./XMLNode"),k=X("./XMLStringifier"),p=X("./XMLStringWriter"),ce.exports=z=function(t){o(l,t);function l(g){if(l.__super__.constructor.call(this,null),this.name="?xml",g||(g={}),!g.writer)g.writer=new p;this.options=g,this.stringify=new k(g),this.isDocument=!0}return l.prototype.end=function(g){var _;if(!g)g=this.options.writer;else if(c(g))_=g,g=this.options.writer.set(_);return g.document(this)},l.prototype.toString=function(g){return this.options.writer.set(g).document(this)},l}(I)}).call(this)},{"./Utility":68,"./XMLNode":81,"./XMLStringWriter":85,"./XMLStringifier":86}],79:[function(X,ce,L){(function(){var z,I,p,k,c,o,i,t,l,g,_,w,y,h,T,x,n,v,a,E,F,A={}.hasOwnProperty;F=X("./Utility"),a=F.isObject,v=F.isFunction,E=F.isPlainObject,n=F.getValue,_=X("./XMLElement"),I=X("./XMLCData"),p=X("./XMLComment"),y=X("./XMLRaw"),x=X("./XMLText"),w=X("./XMLProcessingInstruction"),t=X("./XMLDeclaration"),l=X("./XMLDocType"),k=X("./XMLDTDAttList"),o=X("./XMLDTDEntity"),c=X("./XMLDTDElement"),i=X("./XMLDTDNotation"),z=X("./XMLAttribute"),T=X("./XMLStringifier"),h=X("./XMLStringWriter"),ce.exports=g=function(){function W(S,P,O){var H;if(this.name="?xml",S||(S={}),!S.writer)S.writer=new h(S);else if(E(S.writer))H=S.writer,S.writer=new h(H);this.options=S,this.writer=S.writer,this.stringify=new T(S),this.onDataCallback=P||function(){},this.onEndCallback=O||function(){},this.currentNode=null,this.currentLevel=-1,this.openTags={},this.documentStarted=!1,this.documentCompleted=!1,this.root=null}return W.prototype.node=function(S,P,O){var H;if(S==null)throw Error("Missing node name.");if(this.root&&this.currentLevel===-1)throw Error("Document can only have one root node. "+this.debugInfo(S));if(this.openCurrent(),S=n(S),P==null)P={};if(P=n(P),!a(P))H=[P,O],O=H[0],P=H[1];if(this.currentNode=new _(this,S,P),this.currentNode.children=!1,this.currentLevel++,this.openTags[this.currentLevel]=this.currentNode,O!=null)this.text(O);return this},W.prototype.element=function(S,P,O){if(this.currentNode&&this.currentNode instanceof l)return this.dtdElement.apply(this,arguments);else return this.node(S,P,O)},W.prototype.attribute=function(S,P){var O,H;if(!this.currentNode||this.currentNode.children)throw Error("att() can only be used immediately after an ele() call in callback mode. "+this.debugInfo(S));if(S!=null)S=n(S);if(a(S))for(O in S){if(!A.call(S,O))continue;H=S[O],this.attribute(O,H)}else{if(v(P))P=P.apply();if(!this.options.skipNullAttributes||P!=null)this.currentNode.attributes[S]=new z(this,S,P)}return this},W.prototype.text=function(S){var P;return this.openCurrent(),P=new x(this,S),this.onData(this.writer.text(P,this.currentLevel+1),this.currentLevel+1),this},W.prototype.cdata=function(S){var P;return this.openCurrent(),P=new I(this,S),this.onData(this.writer.cdata(P,this.currentLevel+1),this.currentLevel+1),this},W.prototype.comment=function(S){var P;return this.openCurrent(),P=new p(this,S),this.onData(this.writer.comment(P,this.currentLevel+1),this.currentLevel+1),this},W.prototype.raw=function(S){var P;return this.openCurrent(),P=new y(this,S),this.onData(this.writer.raw(P,this.currentLevel+1),this.currentLevel+1),this},W.prototype.instruction=function(S,P){var O,H,ee,U,J;if(this.openCurrent(),S!=null)S=n(S);if(P!=null)P=n(P);if(Array.isArray(S))for(O=0,U=S.length;O<U;O++)H=S[O],this.instruction(H);else if(a(S))for(H in S){if(!A.call(S,H))continue;ee=S[H],this.instruction(H,ee)}else{if(v(P))P=P.apply();J=new w(this,S,P),this.onData(this.writer.processingInstruction(J,this.currentLevel+1),this.currentLevel+1)}return this},W.prototype.declaration=function(S,P,O){var H;if(this.openCurrent(),this.documentStarted)throw Error("declaration() must be the first node.");return H=new t(this,S,P,O),this.onData(this.writer.declaration(H,this.currentLevel+1),this.currentLevel+1),this},W.prototype.doctype=function(S,P,O){if(this.openCurrent(),S==null)throw Error("Missing root node name.");if(this.root)throw Error("dtd() must come before the root node.");return this.currentNode=new l(this,P,O),this.currentNode.rootNodeName=S,this.currentNode.children=!1,this.currentLevel++,this.openTags[this.currentLevel]=this.currentNode,this},W.prototype.dtdElement=function(S,P){var O;return this.openCurrent(),O=new c(this,S,P),this.onData(this.writer.dtdElement(O,this.currentLevel+1),this.currentLevel+1),this},W.prototype.attList=function(S,P,O,H,ee){var U;return this.openCurrent(),U=new k(this,S,P,O,H,ee),this.onData(this.writer.dtdAttList(U,this.currentLevel+1),this.currentLevel+1),this},W.prototype.entity=function(S,P){var O;return this.openCurrent(),O=new o(this,!1,S,P),this.onData(this.writer.dtdEntity(O,this.currentLevel+1),this.currentLevel+1),this},W.prototype.pEntity=function(S,P){var O;return this.openCurrent(),O=new o(this,!0,S,P),this.onData(this.writer.dtdEntity(O,this.currentLevel+1),this.currentLevel+1),this},W.prototype.notation=function(S,P){var O;return this.openCurrent(),O=new i(this,S,P),this.onData(this.writer.dtdNotation(O,this.currentLevel+1),this.currentLevel+1),this},W.prototype.up=function(){if(this.currentLevel<0)throw Error("The document node has no parent.");if(this.currentNode){if(this.currentNode.children)this.closeNode(this.currentNode);else this.openNode(this.currentNode);this.currentNode=null}else this.closeNode(this.openTags[this.currentLevel]);return delete this.openTags[this.currentLevel],this.currentLevel--,this},W.prototype.end=function(){while(this.currentLevel>=0)this.up();return this.onEnd()},W.prototype.openCurrent=function(){if(this.currentNode)return this.currentNode.children=!0,this.openNode(this.currentNode)},W.prototype.openNode=function(S){if(!S.isOpen){if(!this.root&&this.currentLevel===0&&S instanceof _)this.root=S;return this.onData(this.writer.openNode(S,this.currentLevel),this.currentLevel),S.isOpen=!0}},W.prototype.closeNode=function(S){if(!S.isClosed)return this.onData(this.writer.closeNode(S,this.currentLevel),this.currentLevel),S.isClosed=!0},W.prototype.onData=function(S,P){return this.documentStarted=!0,this.onDataCallback(S,P+1)},W.prototype.onEnd=function(){return this.documentCompleted=!0,this.onEndCallback()},W.prototype.debugInfo=function(S){if(S==null)return"";else return"node: <"+S+">"},W.prototype.ele=function(){return this.element.apply(this,arguments)},W.prototype.nod=function(S,P,O){return this.node(S,P,O)},W.prototype.txt=function(S){return this.text(S)},W.prototype.dat=function(S){return this.cdata(S)},W.prototype.com=function(S){return this.comment(S)},W.prototype.ins=function(S,P){return this.instruction(S,P)},W.prototype.dec=function(S,P,O){return this.declaration(S,P,O)},W.prototype.dtd=function(S,P,O){return this.doctype(S,P,O)},W.prototype.e=function(S,P,O){return this.element(S,P,O)},W.prototype.n=function(S,P,O){return this.node(S,P,O)},W.prototype.t=function(S){return this.text(S)},W.prototype.d=function(S){return this.cdata(S)},W.prototype.c=function(S){return this.comment(S)},W.prototype.r=function(S){return this.raw(S)},W.prototype.i=function(S,P){return this.instruction(S,P)},W.prototype.att=function(){if(this.currentNode&&this.currentNode instanceof l)return this.attList.apply(this,arguments);else return this.attribute.apply(this,arguments)},W.prototype.a=function(){if(this.currentNode&&this.currentNode instanceof l)return this.attList.apply(this,arguments);else return this.attribute.apply(this,arguments)},W.prototype.ent=function(S,P){return this.entity(S,P)},W.prototype.pent=function(S,P){return this.pEntity(S,P)},W.prototype.not=function(S,P){return this.notation(S,P)},W}()}).call(this)},{"./Utility":68,"./XMLAttribute":69,"./XMLCData":70,"./XMLComment":71,"./XMLDTDAttList":72,"./XMLDTDElement":73,"./XMLDTDEntity":74,"./XMLDTDNotation":75,"./XMLDeclaration":76,"./XMLDocType":77,"./XMLElement":80,"./XMLProcessingInstruction":82,"./XMLRaw":83,"./XMLStringWriter":85,"./XMLStringifier":86,"./XMLText":87}],80:[function(X,ce,L){(function(){var z,I,p,k,c,o,i,t=function(g,_){for(var w in _)if(l.call(_,w))g[w]=_[w];function y(){this.constructor=g}return y.prototype=_.prototype,g.prototype=new y,g.__super__=_.prototype,g},l={}.hasOwnProperty;i=X("./Utility"),o=i.isObject,c=i.isFunction,k=i.getValue,p=X("./XMLNode"),z=X("./XMLAttribute"),ce.exports=I=function(g){t(_,g);function _(w,y,h){if(_.__super__.constructor.call(this,w),y==null)throw Error("Missing element name. "+this.debugInfo());if(this.name=this.stringify.eleName(y),this.attributes={},h!=null)this.attribute(h);if(w.isDocument)this.isRoot=!0,this.documentObject=w,w.rootObject=this}return _.prototype.clone=function(){var w,y,h,T;if(h=Object.create(this),h.isRoot)h.documentObject=null;h.attributes={},T=this.attributes;for(y in T){if(!l.call(T,y))continue;w=T[y],h.attributes[y]=w.clone()}return h.children=[],this.children.forEach(function(x){var n=x.clone();return n.parent=h,h.children.push(n)}),h},_.prototype.attribute=function(w,y){var h,T;if(w!=null)w=k(w);if(o(w))for(h in w){if(!l.call(w,h))continue;T=w[h],this.attribute(h,T)}else{if(c(y))y=y.apply();if(!this.options.skipNullAttributes||y!=null)this.attributes[w]=new z(this,w,y)}return this},_.prototype.removeAttribute=function(w){var y,h,T;if(w==null)throw Error("Missing attribute name. "+this.debugInfo());if(w=k(w),Array.isArray(w))for(h=0,T=w.length;h<T;h++)y=w[h],delete this.attributes[y];else delete this.attributes[w];return this},_.prototype.toString=function(w){return this.options.writer.set(w).element(this)},_.prototype.att=function(w,y){return this.attribute(w,y)},_.prototype.a=function(w,y){return this.attribute(w,y)},_}(p)}).call(this)},{"./Utility":68,"./XMLAttribute":69,"./XMLNode":81}],81:[function(X,ce,L){(function(){var z,I,p,k,c,o,i,t,l,g,_,w,y,h,T={}.hasOwnProperty;h=X("./Utility"),y=h.isObject,w=h.isFunction,_=h.isEmpty,g=h.getValue,c=null,z=null,I=null,p=null,k=null,t=null,l=null,i=null,ce.exports=o=function(){function x(n){if(this.parent=n,this.parent)this.options=this.parent.options,this.stringify=this.parent.stringify;if(this.children=[],!c)c=X("./XMLElement"),z=X("./XMLCData"),I=X("./XMLComment"),p=X("./XMLDeclaration"),k=X("./XMLDocType"),t=X("./XMLRaw"),l=X("./XMLText"),i=X("./XMLProcessingInstruction")}return x.prototype.element=function(n,v,a){var E,F,A,W,S,P,O,H,ee,U;if(P=null,v==null)v={};if(v=g(v),!y(v))ee=[v,a],a=ee[0],v=ee[1];if(n!=null)n=g(n);if(Array.isArray(n))for(A=0,O=n.length;A<O;A++)F=n[A],P=this.element(F);else if(w(n))P=this.element(n.apply());else if(y(n))for(S in n){if(!T.call(n,S))continue;if(U=n[S],w(U))U=U.apply();if(y(U)&&_(U))U=null;if(!this.options.ignoreDecorators&&this.stringify.convertAttKey&&S.indexOf(this.stringify.convertAttKey)===0)P=this.attribute(S.substr(this.stringify.convertAttKey.length),U);else if(!this.options.separateArrayItems&&Array.isArray(U))for(W=0,H=U.length;W<H;W++)F=U[W],E={},E[S]=F,P=this.element(E);else if(y(U))P=this.element(S),P.element(U);else P=this.element(S,U)}else if(!this.options.ignoreDecorators&&this.stringify.convertTextKey&&n.indexOf(this.stringify.convertTextKey)===0)P=this.text(a);else if(!this.options.ignoreDecorators&&this.stringify.convertCDataKey&&n.indexOf(this.stringify.convertCDataKey)===0)P=this.cdata(a);else if(!this.options.ignoreDecorators&&this.stringify.convertCommentKey&&n.indexOf(this.stringify.convertCommentKey)===0)P=this.comment(a);else if(!this.options.ignoreDecorators&&this.stringify.convertRawKey&&n.indexOf(this.stringify.convertRawKey)===0)P=this.raw(a);else if(!this.options.ignoreDecorators&&this.stringify.convertPIKey&&n.indexOf(this.stringify.convertPIKey)===0)P=this.instruction(n.substr(this.stringify.convertPIKey.length),a);else P=this.node(n,v,a);if(P==null)throw Error("Could not create any elements with: "+n+". "+this.debugInfo());return P},x.prototype.insertBefore=function(n,v,a){var E,F,A;if(this.isRoot)throw Error("Cannot insert elements at root level. "+this.debugInfo(n));return F=this.parent.children.indexOf(this),A=this.parent.children.splice(F),E=this.parent.element(n,v,a),Array.prototype.push.apply(this.parent.children,A),E},x.prototype.insertAfter=function(n,v,a){var E,F,A;if(this.isRoot)throw Error("Cannot insert elements at root level. "+this.debugInfo(n));return F=this.parent.children.indexOf(this),A=this.parent.children.splice(F+1),E=this.parent.element(n,v,a),Array.prototype.push.apply(this.parent.children,A),E},x.prototype.remove=function(){var n,v;if(this.isRoot)throw Error("Cannot remove the root element. "+this.debugInfo());return n=this.parent.children.indexOf(this),[].splice.apply(this.parent.children,[n,n-n+1].concat(v=[])),this.parent},x.prototype.node=function(n,v,a){var E,F;if(n!=null)n=g(n);if(v||(v={}),v=g(v),!y(v))F=[v,a],a=F[0],v=F[1];if(E=new c(this,n,v),a!=null)E.text(a);return this.children.push(E),E},x.prototype.text=function(n){var v=new l(this,n);return this.children.push(v),this},x.prototype.cdata=function(n){var v=new z(this,n);return this.children.push(v),this},x.prototype.comment=function(n){var v=new I(this,n);return this.children.push(v),this},x.prototype.commentBefore=function(n){var v,a,E;return a=this.parent.children.indexOf(this),E=this.parent.children.splice(a),v=this.parent.comment(n),Array.prototype.push.apply(this.parent.children,E),this},x.prototype.commentAfter=function(n){var v,a,E;return a=this.parent.children.indexOf(this),E=this.parent.children.splice(a+1),v=this.parent.comment(n),Array.prototype.push.apply(this.parent.children,E),this},x.prototype.raw=function(n){var v=new t(this,n);return this.children.push(v),this},x.prototype.instruction=function(n,v){var a,E,F,A,W;if(n!=null)n=g(n);if(v!=null)v=g(v);if(Array.isArray(n))for(A=0,W=n.length;A<W;A++)a=n[A],this.instruction(a);else if(y(n))for(a in n){if(!T.call(n,a))continue;E=n[a],this.instruction(a,E)}else{if(w(v))v=v.apply();F=new i(this,n,v),this.children.push(F)}return this},x.prototype.instructionBefore=function(n,v){var a,E,F;return E=this.parent.children.indexOf(this),F=this.parent.children.splice(E),a=this.parent.instruction(n,v),Array.prototype.push.apply(this.parent.children,F),this},x.prototype.instructionAfter=function(n,v){var a,E,F;return E=this.parent.children.indexOf(this),F=this.parent.children.splice(E+1),a=this.parent.instruction(n,v),Array.prototype.push.apply(this.parent.children,F),this},x.prototype.declaration=function(n,v,a){var E,F;if(E=this.document(),F=new p(E,n,v,a),E.children[0]instanceof p)E.children[0]=F;else E.children.unshift(F);return E.root()||E},x.prototype.doctype=function(n,v){var a,E,F,A,W,S,P,O,H,ee;E=this.document(),F=new k(E,n,v),H=E.children;for(A=W=0,P=H.length;W<P;A=++W)if(a=H[A],a instanceof k)return E.children[A]=F,F;ee=E.children;for(A=S=0,O=ee.length;S<O;A=++S)if(a=ee[A],a.isRoot)return E.children.splice(A,0,F),F;return E.children.push(F),F},x.prototype.up=function(){if(this.isRoot)throw Error("The root node has no parent. Use doc() if you need to get the document object.");return this.parent},x.prototype.root=function(){var n=this;while(n)if(n.isDocument)return n.rootObject;else if(n.isRoot)return n;else n=n.parent},x.prototype.document=function(){var n=this;while(n)if(n.isDocument)return n;else n=n.parent},x.prototype.end=function(n){return this.document().end(n)},x.prototype.prev=function(){var n=this.parent.children.indexOf(this);if(n<1)throw Error("Already at the first node. "+this.debugInfo());return this.parent.children[n-1]},x.prototype.next=function(){var n=this.parent.children.indexOf(this);if(n===-1||n===this.parent.children.length-1)throw Error("Already at the last node. "+this.debugInfo());return this.parent.children[n+1]},x.prototype.importDocument=function(n){var v=n.root().clone();return v.parent=this,v.isRoot=!1,this.children.push(v),this},x.prototype.debugInfo=function(n){var v,a;if(n=n||this.name,n==null&&!((v=this.parent)!=null?v.name:void 0))return"";else if(n==null)return"parent: <"+this.parent.name+">";else if(!((a=this.parent)!=null?a.name:void 0))return"node: <"+n+">";else return"node: <"+n+">, parent: <"+this.parent.name+">"},x.prototype.ele=function(n,v,a){return this.element(n,v,a)},x.prototype.nod=function(n,v,a){return this.node(n,v,a)},x.prototype.txt=function(n){return this.text(n)},x.prototype.dat=function(n){return this.cdata(n)},x.prototype.com=function(n){return this.comment(n)},x.prototype.ins=function(n,v){return this.instruction(n,v)},x.prototype.doc=function(){return this.document()},x.prototype.dec=function(n,v,a){return this.declaration(n,v,a)},x.prototype.dtd=function(n,v){return this.doctype(n,v)},x.prototype.e=function(n,v,a){return this.element(n,v,a)},x.prototype.n=function(n,v,a){return this.node(n,v,a)},x.prototype.t=function(n){return this.text(n)},x.prototype.d=function(n){return this.cdata(n)},x.prototype.c=function(n){return this.comment(n)},x.prototype.r=function(n){return this.raw(n)},x.prototype.i=function(n,v){return this.instruction(n,v)},x.prototype.u=function(){return this.up()},x.prototype.importXMLBuilder=function(n){return this.importDocument(n)},x}()}).call(this)},{"./Utility":68,"./XMLCData":70,"./XMLComment":71,"./XMLDeclaration":76,"./XMLDocType":77,"./XMLElement":80,"./XMLProcessingInstruction":82,"./XMLRaw":83,"./XMLText":87}],82:[function(X,ce,L){(function(){var z,I,p=function(c,o){for(var i in o)if(k.call(o,i))c[i]=o[i];function t(){this.constructor=c}return t.prototype=o.prototype,c.prototype=new t,c.__super__=o.prototype,c},k={}.hasOwnProperty;z=X("./XMLNode"),ce.exports=I=function(c){p(o,c);function o(i,t,l){if(o.__super__.constructor.call(this,i),t==null)throw Error("Missing instruction target. "+this.debugInfo());if(this.target=this.stringify.insTarget(t),l)this.value=this.stringify.insValue(l)}return o.prototype.clone=function(){return Object.create(this)},o.prototype.toString=function(i){return this.options.writer.set(i).processingInstruction(this)},o}(z)}).call(this)},{"./XMLNode":81}],83:[function(X,ce,L){(function(){var z,I,p=function(c,o){for(var i in o)if(k.call(o,i))c[i]=o[i];function t(){this.constructor=c}return t.prototype=o.prototype,c.prototype=new t,c.__super__=o.prototype,c},k={}.hasOwnProperty;z=X("./XMLNode"),ce.exports=I=function(c){p(o,c);function o(i,t){if(o.__super__.constructor.call(this,i),t==null)throw Error("Missing raw text. "+this.debugInfo());this.value=this.stringify.raw(t)}return o.prototype.clone=function(){return Object.create(this)},o.prototype.toString=function(i){return this.options.writer.set(i).raw(this)},o}(z)}).call(this)},{"./XMLNode":81}],84:[function(X,ce,L){(function(){var z,I,p,k,c,o,i,t,l,g,_,w,y,h,T=function(n,v){for(var a in v)if(x.call(v,a))n[a]=v[a];function E(){this.constructor=n}return E.prototype=v.prototype,n.prototype=new E,n.__super__=v.prototype,n},x={}.hasOwnProperty;i=X("./XMLDeclaration"),t=X("./XMLDocType"),z=X("./XMLCData"),I=X("./XMLComment"),l=X("./XMLElement"),_=X("./XMLRaw"),y=X("./XMLText"),g=X("./XMLProcessingInstruction"),p=X("./XMLDTDAttList"),k=X("./XMLDTDElement"),c=X("./XMLDTDEntity"),o=X("./XMLDTDNotation"),h=X("./XMLWriterBase"),ce.exports=w=function(n){T(v,n);function v(a,E){v.__super__.constructor.call(this,E),this.stream=a}return v.prototype.document=function(a){var E,F,A,W,S,P,O,H;P=a.children;for(F=0,W=P.length;F<W;F++)E=P[F],E.isLastRootNode=!1;a.children[a.children.length-1].isLastRootNode=!0,O=a.children,H=[];for(A=0,S=O.length;A<S;A++)switch(E=O[A],!1){case!(E instanceof i):H.push(this.declaration(E));break;case!(E instanceof t):H.push(this.docType(E));break;case!(E instanceof I):H.push(this.comment(E));break;case!(E instanceof g):H.push(this.processingInstruction(E));break;default:H.push(this.element(E))}return H},v.prototype.attribute=function(a){return this.stream.write(" "+a.name+'="'+a.value+'"')},v.prototype.cdata=function(a,E){return this.stream.write(this.space(E)+"<![CDATA["+a.text+"]]>"+this.endline(a))},v.prototype.comment=function(a,E){return this.stream.write(this.space(E)+"<!-- "+a.text+" -->"+this.endline(a))},v.prototype.declaration=function(a,E){if(this.stream.write(this.space(E)),this.stream.write('<?xml version="'+a.version+'"'),a.encoding!=null)this.stream.write(' encoding="'+a.encoding+'"');if(a.standalone!=null)this.stream.write(' standalone="'+a.standalone+'"');return this.stream.write(this.spacebeforeslash+"?>"),this.stream.write(this.endline(a))},v.prototype.docType=function(a,E){var F,A,W,S;if(E||(E=0),this.stream.write(this.space(E)),this.stream.write("<!DOCTYPE "+a.root().name),a.pubID&&a.sysID)this.stream.write(' PUBLIC "'+a.pubID+'" "'+a.sysID+'"');else if(a.sysID)this.stream.write(' SYSTEM "'+a.sysID+'"');if(a.children.length>0){this.stream.write(" ["),this.stream.write(this.endline(a)),S=a.children;for(A=0,W=S.length;A<W;A++)switch(F=S[A],!1){case!(F instanceof p):this.dtdAttList(F,E+1);break;case!(F instanceof k):this.dtdElement(F,E+1);break;case!(F instanceof c):this.dtdEntity(F,E+1);break;case!(F instanceof o):this.dtdNotation(F,E+1);break;case!(F instanceof z):this.cdata(F,E+1);break;case!(F instanceof I):this.comment(F,E+1);break;case!(F instanceof g):this.processingInstruction(F,E+1);break;default:throw Error("Unknown DTD node type: "+F.constructor.name)}this.stream.write("]")}return this.stream.write(this.spacebeforeslash+">"),this.stream.write(this.endline(a))},v.prototype.element=function(a,E){var F,A,W,S,P,O,H,ee;E||(E=0),ee=this.space(E),this.stream.write(ee+"<"+a.name),O=a.attributes;for(P in O){if(!x.call(O,P))continue;F=O[P],this.attribute(F)}if(a.children.length===0||a.children.every(function(U){return U.value===""}))if(this.allowEmpty)this.stream.write("></"+a.name+">");else this.stream.write(this.spacebeforeslash+"/>");else if(this.pretty&&a.children.length===1&&a.children[0].value!=null)this.stream.write(">"),this.stream.write(a.children[0].value),this.stream.write("</"+a.name+">");else{this.stream.write(">"+this.newline),H=a.children;for(W=0,S=H.length;W<S;W++)switch(A=H[W],!1){case!(A instanceof z):this.cdata(A,E+1);break;case!(A instanceof I):this.comment(A,E+1);break;case!(A instanceof l):this.element(A,E+1);break;case!(A instanceof _):this.raw(A,E+1);break;case!(A instanceof y):this.text(A,E+1);break;case!(A instanceof g):this.processingInstruction(A,E+1);break;default:throw Error("Unknown XML node type: "+A.constructor.name)}this.stream.write(ee+"</"+a.name+">")}return this.stream.write(this.endline(a))},v.prototype.processingInstruction=function(a,E){if(this.stream.write(this.space(E)+"<?"+a.target),a.value)this.stream.write(" "+a.value);return this.stream.write(this.spacebeforeslash+"?>"+this.endline(a))},v.prototype.raw=function(a,E){return this.stream.write(this.space(E)+a.value+this.endline(a))},v.prototype.text=function(a,E){return this.stream.write(this.space(E)+a.value+this.endline(a))},v.prototype.dtdAttList=function(a,E){if(this.stream.write(this.space(E)+"<!ATTLIST "+a.elementName+" "+a.attributeName+" "+a.attributeType),a.defaultValueType!=="#DEFAULT")this.stream.write(" "+a.defaultValueType);if(a.defaultValue)this.stream.write(' "'+a.defaultValue+'"');return this.stream.write(this.spacebeforeslash+">"+this.endline(a))},v.prototype.dtdElement=function(a,E){return this.stream.write(this.space(E)+"<!ELEMENT "+a.name+" "+a.value),this.stream.write(this.spacebeforeslash+">"+this.endline(a))},v.prototype.dtdEntity=function(a,E){if(this.stream.write(this.space(E)+"<!ENTITY"),a.pe)this.stream.write(" %");if(this.stream.write(" "+a.name),a.value)this.stream.write(' "'+a.value+'"');else{if(a.pubID&&a.sysID)this.stream.write(' PUBLIC "'+a.pubID+'" "'+a.sysID+'"');else if(a.sysID)this.stream.write(' SYSTEM "'+a.sysID+'"');if(a.nData)this.stream.write(" NDATA "+a.nData)}return this.stream.write(this.spacebeforeslash+">"+this.endline(a))},v.prototype.dtdNotation=function(a,E){if(this.stream.write(this.space(E)+"<!NOTATION "+a.name),a.pubID&&a.sysID)this.stream.write(' PUBLIC "'+a.pubID+'" "'+a.sysID+'"');else if(a.pubID)this.stream.write(' PUBLIC "'+a.pubID+'"');else if(a.sysID)this.stream.write(' SYSTEM "'+a.sysID+'"');return this.stream.write(this.spacebeforeslash+">"+this.endline(a))},v.prototype.endline=function(a){if(!a.isLastRootNode)return this.newline;else return""},v}(h)}).call(this)},{"./XMLCData":70,"./XMLComment":71,"./XMLDTDAttList":72,"./XMLDTDElement":73,"./XMLDTDEntity":74,"./XMLDTDNotation":75,"./XMLDeclaration":76,"./XMLDocType":77,"./XMLElement":80,"./XMLProcessingInstruction":82,"./XMLRaw":83,"./XMLText":87,"./XMLWriterBase":88}],85:[function(X,ce,L){(function(){var z,I,p,k,c,o,i,t,l,g,_,w,y,h,T=function(n,v){for(var a in v)if(x.call(v,a))n[a]=v[a];function E(){this.constructor=n}return E.prototype=v.prototype,n.prototype=new E,n.__super__=v.prototype,n},x={}.hasOwnProperty;i=X("./XMLDeclaration"),t=X("./XMLDocType"),z=X("./XMLCData"),I=X("./XMLComment"),l=X("./XMLElement"),_=X("./XMLRaw"),y=X("./XMLText"),g=X("./XMLProcessingInstruction"),p=X("./XMLDTDAttList"),k=X("./XMLDTDElement"),c=X("./XMLDTDEntity"),o=X("./XMLDTDNotation"),h=X("./XMLWriterBase"),ce.exports=w=function(n){T(v,n);function v(a){v.__super__.constructor.call(this,a)}return v.prototype.document=function(a){var E,F,A,W,S;this.textispresent=!1,W="",S=a.children;for(F=0,A=S.length;F<A;F++)E=S[F],W+=function(){switch(!1){case!(E instanceof i):return this.declaration(E);case!(E instanceof t):return this.docType(E);case!(E instanceof I):return this.comment(E);case!(E instanceof g):return this.processingInstruction(E);default:return this.element(E,0)}}.call(this);if(this.pretty&&W.slice(-this.newline.length)===this.newline)W=W.slice(0,-this.newline.length);return W},v.prototype.attribute=function(a){return" "+a.name+'="'+a.value+'"'},v.prototype.cdata=function(a,E){return this.space(E)+"<![CDATA["+a.text+"]]>"+this.newline},v.prototype.comment=function(a,E){return this.space(E)+"<!-- "+a.text+" -->"+this.newline},v.prototype.declaration=function(a,E){var F=this.space(E);if(F+='<?xml version="'+a.version+'"',a.encoding!=null)F+=' encoding="'+a.encoding+'"';if(a.standalone!=null)F+=' standalone="'+a.standalone+'"';return F+=this.spacebeforeslash+"?>",F+=this.newline,F},v.prototype.docType=function(a,E){var F,A,W,S,P;if(E||(E=0),S=this.space(E),S+="<!DOCTYPE "+a.root().name,a.pubID&&a.sysID)S+=' PUBLIC "'+a.pubID+'" "'+a.sysID+'"';else if(a.sysID)S+=' SYSTEM "'+a.sysID+'"';if(a.children.length>0){S+=" [",S+=this.newline,P=a.children;for(A=0,W=P.length;A<W;A++)F=P[A],S+=function(){switch(!1){case!(F instanceof p):return this.dtdAttList(F,E+1);case!(F instanceof k):return this.dtdElement(F,E+1);case!(F instanceof c):return this.dtdEntity(F,E+1);case!(F instanceof o):return this.dtdNotation(F,E+1);case!(F instanceof z):return this.cdata(F,E+1);case!(F instanceof I):return this.comment(F,E+1);case!(F instanceof g):return this.processingInstruction(F,E+1);default:throw Error("Unknown DTD node type: "+F.constructor.name)}}.call(this);S+="]"}return S+=this.spacebeforeslash+">",S+=this.newline,S},v.prototype.element=function(a,E){var F,A,W,S,P,O,H,ee,U,J,D,te,ye;if(E||(E=0),ye=!1,this.textispresent)this.newline="",this.pretty=!1;else this.newline=this.newlinedefault,this.pretty=this.prettydefault;te=this.space(E),ee="",ee+=te+"<"+a.name,U=a.attributes;for(H in U){if(!x.call(U,H))continue;F=U[H],ee+=this.attribute(F)}if(a.children.length===0||a.children.every(function(se){return se.value===""}))if(this.allowEmpty)ee+="></"+a.name+">"+this.newline;else ee+=this.spacebeforeslash+"/>"+this.newline;else if(this.pretty&&a.children.length===1&&a.children[0].value!=null)ee+=">",ee+=a.children[0].value,ee+="</"+a.name+">"+this.newline;else{if(this.dontprettytextnodes){J=a.children;for(W=0,P=J.length;W<P;W++)if(A=J[W],A.value!=null){this.textispresent++,ye=!0;break}}if(this.textispresent)this.newline="",this.pretty=!1,te=this.space(E);ee+=">"+this.newline,D=a.children;for(S=0,O=D.length;S<O;S++)A=D[S],ee+=function(){switch(!1){case!(A instanceof z):return this.cdata(A,E+1);case!(A instanceof I):return this.comment(A,E+1);case!(A instanceof l):return this.element(A,E+1);case!(A instanceof _):return this.raw(A,E+1);case!(A instanceof y):return this.text(A,E+1);case!(A instanceof g):return this.processingInstruction(A,E+1);default:throw Error("Unknown XML node type: "+A.constructor.name)}}.call(this);if(ye)this.textispresent--;if(!this.textispresent)this.newline=this.newlinedefault,this.pretty=this.prettydefault;ee+=te+"</"+a.name+">"+this.newline}return ee},v.prototype.processingInstruction=function(a,E){var F=this.space(E)+"<?"+a.target;if(a.value)F+=" "+a.value;return F+=this.spacebeforeslash+"?>"+this.newline,F},v.prototype.raw=function(a,E){return this.space(E)+a.value+this.newline},v.prototype.text=function(a,E){return this.space(E)+a.value+this.newline},v.prototype.dtdAttList=function(a,E){var F=this.space(E)+"<!ATTLIST "+a.elementName+" "+a.attributeName+" "+a.attributeType;if(a.defaultValueType!=="#DEFAULT")F+=" "+a.defaultValueType;if(a.defaultValue)F+=' "'+a.defaultValue+'"';return F+=this.spacebeforeslash+">"+this.newline,F},v.prototype.dtdElement=function(a,E){return this.space(E)+"<!ELEMENT "+a.name+" "+a.value+this.spacebeforeslash+">"+this.newline},v.prototype.dtdEntity=function(a,E){var F=this.space(E)+"<!ENTITY";if(a.pe)F+=" %";if(F+=" "+a.name,a.value)F+=' "'+a.value+'"';else{if(a.pubID&&a.sysID)F+=' PUBLIC "'+a.pubID+'" "'+a.sysID+'"';else if(a.sysID)F+=' SYSTEM "'+a.sysID+'"';if(a.nData)F+=" NDATA "+a.nData}return F+=this.spacebeforeslash+">"+this.newline,F},v.prototype.dtdNotation=function(a,E){var F=this.space(E)+"<!NOTATION "+a.name;if(a.pubID&&a.sysID)F+=' PUBLIC "'+a.pubID+'" "'+a.sysID+'"';else if(a.pubID)F+=' PUBLIC "'+a.pubID+'"';else if(a.sysID)F+=' SYSTEM "'+a.sysID+'"';return F+=this.spacebeforeslash+">"+this.newline,F},v.prototype.openNode=function(a,E){var F,A,W,S;if(E||(E=0),a instanceof l){W=this.space(E)+"<"+a.name,S=a.attributes;for(A in S){if(!x.call(S,A))continue;F=S[A],W+=this.attribute(F)}return W+=(a.children?">":"/>")+this.newline,W}else{if(W=this.space(E)+"<!DOCTYPE "+a.rootNodeName,a.pubID&&a.sysID)W+=' PUBLIC "'+a.pubID+'" "'+a.sysID+'"';else if(a.sysID)W+=' SYSTEM "'+a.sysID+'"';return W+=(a.children?" [":">")+this.newline,W}},v.prototype.closeNode=function(a,E){switch(E||(E=0),!1){case!(a instanceof l):return this.space(E)+"</"+a.name+">"+this.newline;case!(a instanceof t):return this.space(E)+"]>"+this.newline}},v}(h)}).call(this)},{"./XMLCData":70,"./XMLComment":71,"./XMLDTDAttList":72,"./XMLDTDElement":73,"./XMLDTDEntity":74,"./XMLDTDNotation":75,"./XMLDeclaration":76,"./XMLDocType":77,"./XMLElement":80,"./XMLProcessingInstruction":82,"./XMLRaw":83,"./XMLText":87,"./XMLWriterBase":88}],86:[function(X,ce,L){(function(){var z,I=function(k,c){return function(){return k.apply(c,arguments)}},p={}.hasOwnProperty;ce.exports=z=function(){function k(c){this.assertLegalChar=I(this.assertLegalChar,this);var o,i,t;c||(c={}),this.noDoubleEncoding=c.noDoubleEncoding,i=c.stringify||{};for(o in i){if(!p.call(i,o))continue;t=i[o],this[o]=t}}return k.prototype.eleName=function(c){return c=""+c||"",this.assertLegalChar(c)},k.prototype.eleText=function(c){return c=""+c||"",this.assertLegalChar(this.elEscape(c))},k.prototype.cdata=function(c){return c=""+c||"",c=c.replace("]]>","]]]]><![CDATA[>"),this.assertLegalChar(c)},k.prototype.comment=function(c){if(c=""+c||"",c.match(/--/))throw Error("Comment text cannot contain double-hypen: "+c);return this.assertLegalChar(c)},k.prototype.raw=function(c){return""+c||""},k.prototype.attName=function(c){return c=""+c||""},k.prototype.attValue=function(c){return c=""+c||"",this.attEscape(c)},k.prototype.insTarget=function(c){return""+c||""},k.prototype.insValue=function(c){if(c=""+c||"",c.match(/\?>/))throw Error("Invalid processing instruction value: "+c);return c},k.prototype.xmlVersion=function(c){if(c=""+c||"",!c.match(/1\.[0-9]+/))throw Error("Invalid version number: "+c);return c},k.prototype.xmlEncoding=function(c){if(c=""+c||"",!c.match(/^[A-Za-z](?:[A-Za-z0-9._-])*$/))throw Error("Invalid encoding: "+c);return c},k.prototype.xmlStandalone=function(c){if(c)return"yes";else return"no"},k.prototype.dtdPubID=function(c){return""+c||""},k.prototype.dtdSysID=function(c){return""+c||""},k.prototype.dtdElementValue=function(c){return""+c||""},k.prototype.dtdAttType=function(c){return""+c||""},k.prototype.dtdAttDefault=function(c){if(c!=null)return""+c||"";else return c},k.prototype.dtdEntityValue=function(c){return""+c||""},k.prototype.dtdNData=function(c){return""+c||""},k.prototype.convertAttKey="@",k.prototype.convertPIKey="?",k.prototype.convertTextKey="#text",k.prototype.convertCDataKey="#cdata",k.prototype.convertCommentKey="#comment",k.prototype.convertRawKey="#raw",k.prototype.assertLegalChar=function(c){var o=c.match(/[\0\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/);if(o)throw Error("Invalid character in string: "+c+" at index "+o.index);return c},k.prototype.elEscape=function(c){var o=this.noDoubleEncoding?/(?!&\S+;)&/g:/&/g;return c.replace(o,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\r/g,"&#xD;")},k.prototype.attEscape=function(c){var o=this.noDoubleEncoding?/(?!&\S+;)&/g:/&/g;return c.replace(o,"&amp;").replace(/</g,"&lt;").replace(/"/g,"&quot;").replace(/\t/g,"&#x9;").replace(/\n/g,"&#xA;").replace(/\r/g,"&#xD;")},k}()}).call(this)},{}],87:[function(X,ce,L){(function(){var z,I,p=function(c,o){for(var i in o)if(k.call(o,i))c[i]=o[i];function t(){this.constructor=c}return t.prototype=o.prototype,c.prototype=new t,c.__super__=o.prototype,c},k={}.hasOwnProperty;z=X("./XMLNode"),ce.exports=I=function(c){p(o,c);function o(i,t){if(o.__super__.constructor.call(this,i),t==null)throw Error("Missing element text. "+this.debugInfo());this.value=this.stringify.eleText(t)}return o.prototype.clone=function(){return Object.create(this)},o.prototype.toString=function(i){return this.options.writer.set(i).text(this)},o}(z)}).call(this)},{"./XMLNode":81}],88:[function(X,ce,L){(function(){var z,I={}.hasOwnProperty;ce.exports=z=function(){function p(k){var c,o,i,t,l,g,_,w,y;if(k||(k={}),this.pretty=k.pretty||!1,this.allowEmpty=(o=k.allowEmpty)!=null?o:!1,this.pretty)this.indent=(i=k.indent)!=null?i:" ",this.newline=(t=k.newline)!=null?t:`
57
57
  `,this.offset=(l=k.offset)!=null?l:0,this.dontprettytextnodes=(g=k.dontprettytextnodes)!=null?g:0;else this.indent="",this.newline="",this.offset=0,this.dontprettytextnodes=0;if(this.spacebeforeslash=(_=k.spacebeforeslash)!=null?_:"",this.spacebeforeslash===!0)this.spacebeforeslash=" ";this.newlinedefault=this.newline,this.prettydefault=this.pretty,w=k.writer||{};for(c in w){if(!I.call(w,c))continue;y=w[c],this[c]=y}}return p.prototype.set=function(k){var c,o,i;if(k||(k={}),"pretty"in k)this.pretty=k.pretty;if("allowEmpty"in k)this.allowEmpty=k.allowEmpty;if(this.pretty)this.indent="indent"in k?k.indent:" ",this.newline="newline"in k?k.newline:`
58
- `,this.offset="offset"in k?k.offset:0,this.dontprettytextnodes="dontprettytextnodes"in k?k.dontprettytextnodes:0;else this.indent="",this.newline="",this.offset=0,this.dontprettytextnodes=0;if(this.spacebeforeslash="spacebeforeslash"in k?k.spacebeforeslash:"",this.spacebeforeslash===!0)this.spacebeforeslash=" ";this.newlinedefault=this.newline,this.prettydefault=this.pretty,o=k.writer||{};for(c in o){if(!I.call(o,c))continue;i=o[c],this[c]=i}return this},p.prototype.space=function(k){var c;if(this.pretty)if(c=(k||0)+this.offset+1,c>0)return Array(c).join(this.indent);else return"";else return""},p}()}).call(this)},{}],89:[function(X,ce,L){(function(){var z,I,p,k,c,o,i;i=X("./Utility"),c=i.assign,o=i.isFunction,z=X("./XMLDocument"),I=X("./XMLDocumentCB"),k=X("./XMLStringWriter"),p=X("./XMLStreamWriter"),ce.exports.create=function(t,l,g,_){var w,y;if(t==null)throw Error("Root element needs a name.");if(_=c({},l,g,_),w=new z(_),y=w.element(t),!_.headless){if(w.declaration(_),_.pubID!=null||_.sysID!=null)w.doctype(_)}return y},ce.exports.begin=function(t,l,g){var _;if(o(t))_=[t,l],l=_[0],g=_[1],t={};if(l)return new I(t,l,g);else return new z(t)},ce.exports.stringWriter=function(t){return new k(t)},ce.exports.streamWriter=function(t,l){return new p(t,l)}}).call(this)},{"./Utility":68,"./XMLDocument":78,"./XMLDocumentCB":79,"./XMLStreamWriter":84,"./XMLStringWriter":85}]},{},[21])(21)})});var _r=an(wr(),1);async function En(et){return(await _r.default.convertToHtml({arrayBuffer:et})).value}function Nn({source:et,name:ft,revision:Yt=0}){let{value:X,loading:ce,error:L}=Vu(et,En,Yt),z=u(()=>X?Cp(X):"",[X]);if(L)return e(Br,{name:ft,message:L});if(ce||X===null)return e("div",{className:"flex flex-1 items-center justify-center gap-2 text-xs text-ink/40",children:[e(m,{size:14,className:"animate-spin"}),e("span",{children:"Loading document…"})]});return e("div",{className:"flex-1 overflow-auto bg-paper",children:e("div",{className:"prose-content mx-auto max-w-4xl p-6 font-sans",dangerouslySetInnerHTML:{__html:z}})})}export{Nn as DocxView};
58
+ `,this.offset="offset"in k?k.offset:0,this.dontprettytextnodes="dontprettytextnodes"in k?k.dontprettytextnodes:0;else this.indent="",this.newline="",this.offset=0,this.dontprettytextnodes=0;if(this.spacebeforeslash="spacebeforeslash"in k?k.spacebeforeslash:"",this.spacebeforeslash===!0)this.spacebeforeslash=" ";this.newlinedefault=this.newline,this.prettydefault=this.pretty,o=k.writer||{};for(c in o){if(!I.call(o,c))continue;i=o[c],this[c]=i}return this},p.prototype.space=function(k){var c;if(this.pretty)if(c=(k||0)+this.offset+1,c>0)return Array(c).join(this.indent);else return"";else return""},p}()}).call(this)},{}],89:[function(X,ce,L){(function(){var z,I,p,k,c,o,i;i=X("./Utility"),c=i.assign,o=i.isFunction,z=X("./XMLDocument"),I=X("./XMLDocumentCB"),k=X("./XMLStringWriter"),p=X("./XMLStreamWriter"),ce.exports.create=function(t,l,g,_){var w,y;if(t==null)throw Error("Root element needs a name.");if(_=c({},l,g,_),w=new z(_),y=w.element(t),!_.headless){if(w.declaration(_),_.pubID!=null||_.sysID!=null)w.doctype(_)}return y},ce.exports.begin=function(t,l,g){var _;if(o(t))_=[t,l],l=_[0],g=_[1],t={};if(l)return new I(t,l,g);else return new z(t)},ce.exports.stringWriter=function(t){return new k(t)},ce.exports.streamWriter=function(t,l){return new p(t,l)}}).call(this)},{"./Utility":68,"./XMLDocument":78,"./XMLDocumentCB":79,"./XMLStreamWriter":84,"./XMLStringWriter":85}]},{},[21])(21)})});var _r=an(wr(),1);async function En(et){return(await _r.default.convertToHtml({arrayBuffer:et})).value}function Nn({source:et,name:ft,revision:Yt=0}){let{value:X,loading:ce,error:L}=Yu(et,En,Yt),z=u(()=>X?Ep(X):"",[X]);if(L)return e(Br,{name:ft,message:L});if(ce||X===null)return e("div",{className:"flex flex-1 items-center justify-center gap-2 text-xs text-ink/40",children:[e(m,{size:14,className:"animate-spin"}),e("span",{children:"Loading document…"})]});return e("div",{className:"flex-1 overflow-auto bg-paper",children:e("div",{className:"prose-content mx-auto max-w-4xl p-6 font-sans",dangerouslySetInnerHTML:{__html:z}})})}export{Nn as DocxView};
@@ -1,5 +1,5 @@
1
- import{o,u,e,Om,Br,Yu}from"./index-4s8ttfxj.js";var mt=/^[a-zA-Z][a-zA-Z0-9:_-]*$/;function S(n,i={},a=[]){if(!mt.test(n))throw Error(`Invalid SVG tag name: ${n}`);return{tag:n,attrs:i,children:a.filter((l)=>!!l)}}function Fe(n){return{text:n}}function kt(n){return n.replace(/[&<>]/g,(i)=>i==="&"?"&amp;":i==="<"?"&lt;":"&gt;")}function St(n){return n.replace(/[&<>"']/g,(i)=>{switch(i){case"&":return"&amp;";case"<":return"&lt;";case">":return"&gt;";case'"':return"&quot;";default:return"&#39;"}})}function Y(n){if(!Number.isFinite(n))return"0";let i=Math.round(n*100)/100;return Object.is(i,-0)?"0":String(i)}function At(n){let i="";for(let[a,l]of Object.entries(n)){if(l===null||l===void 0||l===!1)continue;if(!mt.test(a))throw Error(`Invalid SVG attribute name: ${a}`);if(l===!0)i+=` ${a}=""`;else if(typeof l==="number")i+=` ${a}="${Y(l)}"`;else i+=` ${a}="${St(l)}"`}return i}function gt(n){if("text"in n)return kt(n.text);let i=At(n.attrs);if(n.children.length===0)return`<${n.tag}${i}/>`;return`<${n.tag}${i}>${n.children.map(gt).join("")}</${n.tag}>`}var L=class{constructor(){this.parts=[]}moveTo(n,i){return this.parts.push(`M${Y(n)},${Y(i)}`),this}lineTo(n,i){return this.parts.push(`L${Y(n)},${Y(i)}`),this}curveTo(n,i,a,l,r,t){return this.parts.push(`C${Y(n)},${Y(i)} ${Y(a)},${Y(l)} ${Y(r)},${Y(t)}`),this}quadTo(n,i,a,l){return this.parts.push(`Q${Y(n)},${Y(i)} ${Y(a)},${Y(l)}`),this}arcTo(n,i,a,l,r,t,s){return this.parts.push(`A${Y(n)},${Y(i)} ${Y(a)} ${l?1:0},${r?1:0} ${Y(t)},${Y(s)}`),this}close(){return this.parts.push("Z"),this}toString(){return this.parts.join(" ")}},xt=1.25,Et=[278,278,355,556,556,889,667,191,333,333,389,584,278,333,278,278,556,556,556,556,556,556,556,556,556,556,278,278,584,584,584,556,1015,667,667,722,722,667,611,778,722,278,500,667,556,833,722,778,667,778,722,667,611,722,667,944,667,667,611,278,278,278,469,556,333,556,556,500,556,556,278,556,556,222,222,500,222,833,556,556,556,556,333,500,278,556,500,722,500,500,500,334,260,334,584],Ct=1.06,It=new Set("гзтэсеё".split("")),Nt=new Set("жмшщюыЖМШЩЮЫФф".split(""));function Ft(n){let i=n.codePointAt(0)??0;if(i>=32&&i<=126)return Et[i-32]??556;if(i>=1024&&i<=1279){if(Nt.has(n))return 800;if(It.has(n))return 470;return n===n.toUpperCase()?690:545}if(i>=11904&&i<=40959||i>=44032&&i<=55215||i>=63744&&i<=64255||i>=65280&&i<=65519||i>=127744&&i<=129791)return 1000;if(i===8212||i===8230)return 1000;if(i===8211)return 556;if(i===160)return 278;return 600}var Ot=(n,i)=>{let a=0;for(let r of n)a+=Ft(r);let l=a/1000*i.size*Ct;if(i.weight==="bold")l*=1.07;return{width:l,height:i.size*xt}},de;function Lt(){if(de!==void 0)return de;de=null;try{let n=globalThis;if(n.navigator?.userAgent?.includes("jsdom"))return de;if(typeof n.OffscreenCanvas==="function")de=new n.OffscreenCanvas(1,1).getContext("2d");else if(n.document&&typeof n.document.createElement==="function")de=n.document.createElement("canvas").getContext("2d");if(de&&de.measureText("M").width<=0)de=null}catch{de=null}return de}function pt(n){return`${n.style==="italic"?"italic ":""}${n.weight==="bold"?"bold ":""}${n.size}px ${n.family}`}function Pt(n){let i=new Map;return(a,l)=>{let r=`${pt(l)}\x00${a}`,t=i.get(r);if(!t){if(t=n(a,l),i.size>5000)i.clear();i.set(r,t)}return t}}function Dt(){let n=Lt();if(!n)return Ot;return Pt((i,a)=>(n.font=pt(a),{width:n.measureText(i).width,height:a.size*xt}))}var _t=/^[a-zA-Z]{3,24}$/,Rt=/^#(?:[0-9a-fA-F]{3,4}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/,ze=String.raw`\s*[+-]?(?:\d+\.?\d*|\.\d+)(?:%|deg)?\s*`,zt=new RegExp(`^(?:rgba?|hsla?)\\((?:${ze},){2,3}${ze}\\)$|^(?:rgba?|hsla?)\\((?:${ze}){3}(?:/${ze})?\\)$`,"i");function Be(n){if(n===void 0)return;let i=n.trim();if(Rt.test(i)||zt.test(i))return i;if(_t.test(i)&&!/^(?:inherit|initial|unset|revert|var|url|expression|none|default)$/i.test(i))return i}var Wt={"--drawio-font-family":"Helvetica, Arial, sans-serif","--drawio-background":"transparent","--drawio-fill":"#ffffff","--drawio-stroke":"#000000","--drawio-text":"#000000","--drawio-label-background":"#ffffff","--drawio-placeholder":"#9ca3af"};function Te(n){return`var(${n}, ${Wt[n]})`}function ge(n,i,a){let l=n[i];if(l===void 0||l===""||l==="default")return a;if(l==="none")return"none";return Be(l)??a}function M(n,i,a,l=-1e6,r=1e6){let t=n[i],s=t===void 0?NaN:Number(t);return Number.isFinite(s)?Math.min(r,Math.max(l,s)):a}function Ve(n,i,a=!1){let l=n[i];return l===void 0?a:l==="1"||l==="true"}function nt(n,i){if(!Ve(n,"dashed"))return;let a=n.dashPattern;if(a&&/^[\d.\s]+$/.test(a))return a.trim().split(/\s+/).map((l)=>Number(l)*i).join(" ");return`${3*i} ${3*i}`}function Xt(n){let i=`#${n}`;return[`${i}{font-family:${Te("--drawio-font-family")};background:${Te("--drawio-background")}}`,`${i} text{white-space:pre}`,`${i} a{cursor:pointer}`].join("")}var $e=(n)=>({x:n.x+n.width/2,y:n.y+n.height/2});function ot(n,i,a){let l=$e(n),r=a.x-l.x,t=a.y-l.y;if(r===0&&t===0)return l;let s=n.width/2,c=n.height/2;if(i==="ellipse"||i==="doubleEllipse"||i==="orShape"||i==="xorShape"){let m=1/Math.sqrt(r*r/(s*s||1)+t*t/(c*c||1));return{x:l.x+r*m,y:l.y+t*m}}if(i==="rhombus"){let m=1/(Math.abs(r)/(s||1)+Math.abs(t)/(c||1));return{x:l.x+r*m,y:l.y+t*m}}let d=Math.min(r===0?1/0:s/Math.abs(r),t===0?1/0:c/Math.abs(t));return{x:l.x+r*d,y:l.y+t*d}}function Ee(n){if(!n.port)return;return{x:n.bounds.x+n.port.x*n.bounds.width,y:n.bounds.y+n.port.y*n.bounds.height}}function Oe(n,i){return[["left",Math.abs(i.x-n.x)],["right",Math.abs(i.x-n.x-n.width)],["top",Math.abs(i.y-n.y)],["bottom",Math.abs(i.y-n.y-n.height)]].sort((a,l)=>a[1]-l[1])[0][0]}function rt(n,i){let a=Ee(n);if(a)return a;let l=n.bounds,r=$e(l);if(i.x>=l.x&&i.x<=l.x+l.width&&(i.y<l.y||i.y>l.y+l.height))return{x:i.x,y:i.y<l.y?l.y:l.y+l.height};if(i.y>=l.y&&i.y<=l.y+l.height&&(i.x<l.x||i.x>l.x+l.width))return{x:i.x<l.x?l.x:l.x+l.width,y:i.y};let t=i.x-r.x,s=i.y-r.y;if(Math.abs(t)*l.height>=Math.abs(s)*l.width)return{x:t>0?l.x+l.width:l.x,y:r.y};return{x:r.x,y:s>0?l.y+l.height:l.y}}function Bt(n,i){let a=[n[0]],l=i;for(let r=1;r<n.length;r++){let t=a[a.length-1],s=n[r];if(Math.abs(t.x-s.x)>0.01&&Math.abs(t.y-s.y)>0.01)a.push(l?{x:s.x,y:t.y}:{x:t.x,y:s.y});a.push(s);let c=a[a.length-2];l=Math.abs(c.y-s.y)>0.01}return Me(a)}function Me(n){let i=[];for(let a of n){let l=i[i.length-1];if(l&&Math.abs(l.x-a.x)<0.01&&Math.abs(l.y-a.y)<0.01)continue;i.push(a)}return i}function qt(n,i,a,l){let r=l.edgeStyle??"",t=(f)=>("bounds"in f),s=(f)=>t(f)?$e(f.bounds):f;if(r==="entityRelationEdgeStyle"&&t(n)&&t(i)){let f=M(l,"segment",30,0,200),x=n.bounds,p=i.bounds;if(Math.min(x.x+x.width,p.x+p.width)-Math.max(x.x,p.x)>0&&!Ee(n)&&!Ee(i)){let J=Math.max(x.x+x.width,p.x+p.width)+f,_={x:x.x+x.width,y:$e(x).y},b={x:p.x+p.width,y:$e(p).y};return Me([_,{x:J,y:_.y},{x:J,y:b.y},b])}let T=$e(x).x<=$e(p).x,k=Ee(n)??{x:T?x.x+x.width:x.x,y:$e(x).y},C=Ee(i)??{x:T?p.x:p.x+p.width,y:$e(p).y},O=k.x+(T?f:-f),R=C.x+(T?-f:f);return Me([k,{x:O,y:k.y},{x:R,y:C.y},C])}if(r==="orthogonalEdgeStyle"||r==="elbowEdgeStyle"||r==="segmentEdgeStyle"){let f=a[0]??s(i),x=a[a.length-1]??s(n),p=t(n)?rt(n,f):n,T=t(i)?rt(i,x):i;if(a.length===0){let C=r==="elbowEdgeStyle"?l.elbow==="vertical":t(n)&&(Oe(n.bounds,p)==="top"||Oe(n.bounds,p)==="bottom");if(p.x===T.x||p.y===T.y)return Me([p,T]);if(C!==(t(i)&&(Oe(i.bounds,T)==="top"||Oe(i.bounds,T)==="bottom")))return Me([p,C?{x:p.x,y:T.y}:{x:T.x,y:p.y},T]);if(C){let R=(p.y+T.y)/2;return Me([p,{x:p.x,y:R},{x:T.x,y:R},T])}let O=(p.x+T.x)/2;return Me([p,{x:O,y:p.y},{x:O,y:T.y},T])}let k=t(n)?!(Oe(n.bounds,p)==="top"||Oe(n.bounds,p)==="bottom"):Math.abs(f.x-p.x)>=Math.abs(f.y-p.y);return Bt([p,...a,T],k)}let c=a[0]??s(i),d=a[a.length-1]??s(n),m=t(n)?Ee(n)??ot(n.bounds,n.shape,c):n,y=t(i)?Ee(i)??ot(i.bounds,i.shape,d):i;return Me([m,...a,y])}function Yt(n,i){let a=new L;if(n.length===0)return"";if(a.moveTo(n[0].x,n[0].y),i.curved==="1"&&n.length>2){for(let r=1;r<n.length-1;r++){let t=n[r],s=n[r+1],c=r===n.length-2?s:{x:(t.x+s.x)/2,y:(t.y+s.y)/2};a.quadTo(t.x,t.y,c.x,c.y)}return a.toString()}let l=i.rounded==="1"?M(i,"arcSize",20,0,200)/2:0;for(let r=1;r<n.length;r++){let t=n[r],s=n[r+1];if(l>0&&s){let c=n[r-1],d=Math.hypot(t.x-c.x,t.y-c.y),m=Math.hypot(s.x-t.x,s.y-t.y),y=Math.min(l,d/2,m/2);if(y>0.5){let f={x:t.x-(t.x-c.x)/d*y,y:t.y-(t.y-c.y)/d*y},x={x:t.x+(s.x-t.x)/m*y,y:t.y+(s.y-t.y)/m*y};a.lineTo(f.x,f.y).quadTo(t.x,t.y,x.x,x.y);continue}}a.lineTo(t.x,t.y)}return a.toString()}function it(n,i){switch(n){case"classic":case"classicThin":return i*1.2;case"block":case"blockThin":return i*1.6;case"diamond":case"diamondThin":return i*2.2;case"oval":case"circle":return i;default:return 0}}function st(n,i,a,l,r,t,s){if(!n||n==="none")return[];let c={x:-a.y,y:a.x},d=(x,p)=>[i.x-a.x*x+c.x*p,i.y-a.y*x+c.y*p],m=(x,p,T)=>{let k=new L;if(x.forEach(([C,O],R)=>R===0?k.moveTo(C,O):k.lineTo(C,O)),p)k.close();return S("path",{d:k.toString(),fill:p?T?t:"var(--drawio-label-background, #ffffff)":"none",stroke:t,"stroke-width":s,"stroke-linejoin":"round","stroke-linecap":"round"})},y=l*1.6,f=l*(n.endsWith("Thin")?0.45:0.7);switch(n){case"classic":case"classicThin":return[m([d(0,0),d(y,f),d(y*0.75,0),d(y,-f)],!0,r)];case"block":case"blockThin":return[m([d(0,0),d(y,f),d(y,-f)],!0,r)];case"open":case"openThin":return[m([d(y,f),d(0,0),d(y,-f)],!1,!1)];case"async":return[m([d(0,0),d(y,f),d(y,0)],!0,r)];case"diamond":case"diamondThin":return[m([d(0,0),d(y*0.7,f),d(y*1.4,0),d(y*0.7,-f)],!0,r)];case"oval":case"circle":{let[x,p]=d(l/2,0);return[S("circle",{cx:x,cy:p,r:l/2,fill:r?t:"var(--drawio-label-background, #ffffff)",stroke:t,"stroke-width":s})]}case"dash":return[m([d(l,l),d(l,-l)],!1,!1)];case"cross":return[m([d(y,f),d(0,-f)],!1,!1),m([d(y,-f),d(0,f)],!1,!1)];case"ERone":return[m([d(l*1.6,l),d(l*1.6,-l)],!1,!1)];case"ERmandOne":return[m([d(l*1.2,l),d(l*1.2,-l)],!1,!1),m([d(l*2,l),d(l*2,-l)],!1,!1)];case"ERmany":return[m([d(0,l),d(l*1.6,0),d(0,-l)],!1,!1)];case"ERoneToMany":return[m([d(0,l),d(l*1.6,0),d(0,-l)],!1,!1),m([d(l*2,l),d(l*2,-l)],!1,!1)];case"ERzeroToMany":{let[x,p]=d(l*2.6,0);return[m([d(0,l),d(l*1.6,0),d(0,-l)],!1,!1),S("circle",{cx:x,cy:p,r:l*0.6,fill:"var(--drawio-label-background, #ffffff)",stroke:t,"stroke-width":s})]}case"ERzeroToOne":{let[x,p]=d(l*2.6,0);return[m([d(l*1.2,l),d(l*1.2,-l)],!1,!1),S("circle",{cx:x,cy:p,r:l*0.6,fill:"var(--drawio-label-background, #ffffff)",stroke:t,"stroke-width":s})]}default:return[m([d(y,f),d(0,0),d(y,-f)],!1,!1)]}}function at(n,i){let a=0;for(let c=1;c<n.length;c++)a+=Math.hypot(n[c].x-n[c-1].x,n[c].y-n[c-1].y);let l=a*Math.min(1,Math.max(0,i));for(let c=1;c<n.length;c++){let d=n[c-1],m=n[c],y=Math.hypot(m.x-d.x,m.y-d.y);if(l<=y&&y>0)return{point:{x:d.x+(m.x-d.x)*l/y,y:d.y+(m.y-d.y)*l/y},dir:{x:(m.x-d.x)/y,y:(m.y-d.y)/y}};l-=y}let r=n[n.length-2]??n[0],t=n[n.length-1],s=Math.hypot(t.x-r.x,t.y-r.y)||1;return{point:t,dir:{x:(t.x-r.x)/s,y:(t.y-r.y)/s}}}var Q=class extends Error{constructor(n,i=0,a=0,l){super(i>0?`${n} (line ${i}${a>0?`, column ${a}`:""})`:n);this.line=i,this.column=a,this.hint=l,this.name="DrawioError"}},Ut={amp:"&",lt:"<",gt:">",quot:'"',apos:"'",nbsp:" ",ndash:"–",mdash:"—",hellip:"…",laquo:"«",raquo:"»",copy:"©",reg:"®",trade:"™",bull:"•",middot:"·",deg:"°",times:"×",rarr:"→",larr:"←",euro:"€"};function je(n){return n.replace(/&(#x[0-9a-f]+|#\d+|[a-z]+);/gi,(i,a)=>{if(a[0]==="#"){let l=a[1]==="x"||a[1]==="X"?parseInt(a.slice(2),16):parseInt(a.slice(1),10);return l>0&&l<=1114111&&!(l>=55296&&l<=57343)?String.fromCodePoint(l):i}return Ut[a.toLowerCase()]??i})}function Ht(n){return n.split(/\r\n|\r|\n/).map((i)=>i?[{text:i}]:[])}var lt=new Set(["div","p","li","h1","h2","h3","h4","h5","h6","tr","ul","ol","table","blockquote","pre"]),jt=[10,13,16,18,24,32,48];function Gt(n){let i={};for(let a of n.split(";")){let l=a.indexOf(":");if(l<0)continue;let r=a.slice(0,l).trim().toLowerCase(),t=a.slice(l+1).trim();if(r==="color")i.color=Be(t);else if(r==="font-weight")i.bold=t==="bold"||Number(t)>=600;else if(r==="font-style")i.italic=t==="italic"||t==="oblique";else if(r==="text-decoration"||r==="text-decoration-line")i.underline=t.includes("underline");else if(r==="font-size"){let s=/^([\d.]+)px$/.exec(t);if(s)i.size=Math.min(200,Number(s[1]))}}return i}function Zt(n){let i=[[]],a=[],l=()=>Object.assign({},...a.map((m)=>m.style)),r=()=>{i.push([])},t=()=>{if(i[i.length-1].length>0)r()},s=(m)=>{if(!m)return;let y=l(),f={text:m};if(y.bold)f.bold=!0;if(y.italic)f.italic=!0;if(y.underline)f.underline=!0;if(y.color)f.color=y.color;if(y.size)f.size=y.size;i[i.length-1].push(f)},c=/<!--[\s\S]*?-->|<\/?([a-zA-Z][a-zA-Z0-9]*)((?:\s+[^\s=>/]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s>]+))?)*)\s*\/?>|([^<]+)|</g,d;while(d=c.exec(n)){if(d[3]!==void 0||d[0]==="<"){s(je((d[3]??"<").replace(/[ \t\r\n]+/g," ")));continue}let m=(d[1]??"").toLowerCase();if(!m)continue;let y=d[0][1]==="/";if(m==="br"){r();continue}if(y){let k=a.map((C)=>C.tag).lastIndexOf(m);if(k>=0)a.splice(k);if(lt.has(m))t();continue}if(["script","style","title","head"].includes(m)){let k=n.toLowerCase().indexOf(`</${m}`,c.lastIndex);c.lastIndex=k<0?n.length:k;continue}if(lt.has(m))t();let f=d[2]??"",x=(k)=>new RegExp(`\\s${k}\\s*=\\s*(?:"([^"]*)"|'([^']*)'|([^\\s>]+))`,"i").exec(f),p={};if(m==="b"||m==="strong"||/^h[1-6]$/.test(m))p.bold=!0;if(m==="i"||m==="em")p.italic=!0;if(m==="u")p.underline=!0;let T=x("style");if(T)Object.assign(p,Gt(je(T[1]??T[2]??T[3]??"")));if(m==="font"){let k=x("color"),C=k&&Be(je(k[1]??k[2]??k[3]??""));if(C)p.color=C;let O=x("size"),R=O?Number(O[1]??O[2]??O[3]):NaN;if(R>=1&&R<=7)p.size=jt[R-1]}if(m==="li")s("• ");if(!(/\/>$/.test(d[0])||["img","hr","input","wbr","meta","link"].includes(m)))a.push({tag:m,style:p})}while(i.length>1&&i[i.length-1].every((m)=>!m.text.trim()))i.pop();while(i.length>1&&i[0].every((m)=>!m.text.trim()))i.shift();return i.map((m)=>Vt(m))}function Vt(n){let i=n.map((a)=>({...a}));while(i.length>0&&i[0].text.trim()==="")i.shift();while(i.length>0&&i[i.length-1].text.trim()==="")i.pop();if(i[0])i[0].text=i[0].text.replace(/^ +/,"");if(i.length>0)i[i.length-1].text=i[i.length-1].text.replace(/ +$/,"");return i}function yt(n,i){return{...i,size:n.size??i.size,weight:n.bold?"bold":i.weight,style:n.italic?"italic":i.style}}function Ke(n,i,a){return n.reduce((l,r)=>l+a(r.text,yt(r,i)).width,0)}function Kt(n,i){return Math.max(i.size,...n.map((a)=>a.size??i.size))*1.2}function Qt(n,i,a,l){let r=[];for(let t of n){if(Ke(t,a,l)<=i){r.push(t);continue}let s=[[]];for(let m of t)for(let y of m.text.split(/( +)/))if(/^ +$/.test(y))s.push([]);else if(y)s[s.length-1].push({...m,text:y});let c=[],d=0;for(let m of s){if(m.length===0)continue;let y=Ke(m,a,l),f=l(" ",yt(m[0],a)).width;if(c.length>0&&d+f+y>i)r.push(c),c=[],d=0;if(c.length>0)c.push({...m[0],text:" "}),d+=f;c.push(...m),d+=y}r.push(c)}return r}var Jt=[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],en=[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],tn=[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],nn=[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],on=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];function Re(n,i){let a=new Uint16Array(16);for(let t=0;t<i;t++)a[n[t]]++;a[0]=0;let l=new Uint16Array(16);for(let t=1;t<16;t++)l[t]=l[t-1]+a[t-1];let r=new Uint16Array(i);for(let t=0;t<i;t++)if(n[t])r[l[n[t]]++]=t;return{counts:a,symbols:r}}var We;function rn(){if(We)return We;let n=new Uint8Array(288);for(let a=0;a<144;a++)n[a]=8;for(let a=144;a<256;a++)n[a]=9;for(let a=256;a<280;a++)n[a]=7;for(let a=280;a<288;a++)n[a]=8;let i=new Uint8Array(30).fill(5);return We={lit:Re(n,288),dist:Re(i,30)},We}function sn(n,i=50000000){let a=0,l=0,r=0,t=new Uint8Array(Math.min(i,Math.max(1024,n.length*4))),s=0,c=()=>{throw new Q("A compressed page is corrupt")},d=(f)=>{while(r<f){if(a>=n.length)c();l|=n[a++]<<r,r+=8}let x=l&(1<<f)-1;return l>>>=f,r-=f,x},m=(f)=>{if(s+f<=t.length)return;if(s+f>i)throw new Q(`A compressed page expands beyond ${i} bytes`);let x=t.length*2;while(x<s+f)x*=2;let p=new Uint8Array(Math.min(x,i));p.set(t.subarray(0,s)),t=p},y=(f)=>{let x=0,p=0,T=0;for(let k=1;k<16;k++){x|=d(1);let C=f.counts[k];if(x-C<p)return f.symbols[T+(x-p)];T+=C,p+=C,p<<=1,x<<=1}return c()};for(;;){let f=d(1),x=d(2);if(x===0){if(l=0,r=0,a+4>n.length)c();let p=n[a]|n[a+1]<<8,T=n[a+2]|n[a+3]<<8;if((p^65535)!==T)c();if(a+=4,a+p>n.length)c();m(p),t.set(n.subarray(a,a+p),s),s+=p,a+=p}else if(x===1||x===2){let p,T;if(x===1)({lit:p,dist:T}=rn());else{let k=d(5)+257,C=d(5)+1,O=d(4)+4,R=new Uint8Array(19);for(let b=0;b<O;b++)R[on[b]]=d(3);let J=Re(R,19),_=new Uint8Array(k+C);for(let b=0;b<k+C;){let E=y(J);if(E<16)_[b++]=E;else{let N,P=0;if(E===16){if(b===0)c();P=_[b-1],N=3+d(2)}else if(E===17)N=3+d(3);else N=11+d(7);if(b+N>k+C)c();_.fill(P,b,b+N),b+=N}}p=Re(_.subarray(0,k),k),T=Re(_.subarray(k),C)}for(;;){let k=y(p);if(k<256)m(1),t[s++]=k;else if(k===256)break;else{let C=k-257;if(C>=29)c();let O=Jt[C]+d(en[C]),R=y(T);if(R>=30)c();let J=tn[R]+d(nn[R]);if(J>s)c();m(O);for(let _=0;_<O;_++,s++)t[s]=t[s-J]}}}else c();if(f)break}return t.subarray(0,s)}var an="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",qe=new Int16Array(128).fill(-1);for(let n=0;n<64;n++)qe[an.charCodeAt(n)]=n;qe[45]=62;qe[95]=63;function ln(n){let i=n.replace(/[\s=]/g,""),a=new Uint8Array(Math.floor(i.length*3/4)),l=0,r=0,t=0;for(let s=0;s<i.length;s++){let c=i.charCodeAt(s),d=c<128?qe[c]:-1;if(d<0)throw new Q("A compressed page is not valid base64");if(l=l<<6|d,r+=6,r>=8)r-=8,a[t++]=l>>r&255}return a.subarray(0,t)}function cn(n){return new TextDecoder("utf-8").decode(n)}function un(n,i){let a=cn(sn(ln(n.trim()),i));try{return decodeURIComponent(a)}catch{return a}}var ct="http://www.w3.org/XML/1998/namespace",ut="http://www.w3.org/2000/xmlns/",wt=String.raw`A-Za-z_\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD`,fn=String.raw`${wt}\-.0-9\u00B7\u0300-\u036F\u203F-\u2040:`,ft=new RegExp(`[${wt}:][${fn}]*`,"y"),hn={lt:"<",gt:">",amp:"&",quot:'"',apos:"'"};function Ge(n){return n===9||n===10||n===13||n>=32&&n<=55295||n>=57344&&n<=65533||n>=65536&&n<=1114111}function Qe(n,i={}){let a=i.maxLength??20000000,l=i.maxElements??200000,r=i.maxDepth??256;if(typeof n!=="string")throw new Q("The diagram must be a string of XML");if(n.length>a)throw new Q(`The file has ${n.length} characters; the limit is ${a}`);let t=n.charCodeAt(0)===65279?n.slice(1):n,s=0,c=0,d=[0];for(let b=t.indexOf(`
1
+ import{o,u,e,$m,Br,Ju}from"./index-zt75xpq0.js";var mt=/^[a-zA-Z][a-zA-Z0-9:_-]*$/;function S(n,i={},a=[]){if(!mt.test(n))throw Error(`Invalid SVG tag name: ${n}`);return{tag:n,attrs:i,children:a.filter((l)=>!!l)}}function Fe(n){return{text:n}}function kt(n){return n.replace(/[&<>]/g,(i)=>i==="&"?"&amp;":i==="<"?"&lt;":"&gt;")}function St(n){return n.replace(/[&<>"']/g,(i)=>{switch(i){case"&":return"&amp;";case"<":return"&lt;";case">":return"&gt;";case'"':return"&quot;";default:return"&#39;"}})}function Y(n){if(!Number.isFinite(n))return"0";let i=Math.round(n*100)/100;return Object.is(i,-0)?"0":String(i)}function At(n){let i="";for(let[a,l]of Object.entries(n)){if(l===null||l===void 0||l===!1)continue;if(!mt.test(a))throw Error(`Invalid SVG attribute name: ${a}`);if(l===!0)i+=` ${a}=""`;else if(typeof l==="number")i+=` ${a}="${Y(l)}"`;else i+=` ${a}="${St(l)}"`}return i}function gt(n){if("text"in n)return kt(n.text);let i=At(n.attrs);if(n.children.length===0)return`<${n.tag}${i}/>`;return`<${n.tag}${i}>${n.children.map(gt).join("")}</${n.tag}>`}var L=class{constructor(){this.parts=[]}moveTo(n,i){return this.parts.push(`M${Y(n)},${Y(i)}`),this}lineTo(n,i){return this.parts.push(`L${Y(n)},${Y(i)}`),this}curveTo(n,i,a,l,r,t){return this.parts.push(`C${Y(n)},${Y(i)} ${Y(a)},${Y(l)} ${Y(r)},${Y(t)}`),this}quadTo(n,i,a,l){return this.parts.push(`Q${Y(n)},${Y(i)} ${Y(a)},${Y(l)}`),this}arcTo(n,i,a,l,r,t,s){return this.parts.push(`A${Y(n)},${Y(i)} ${Y(a)} ${l?1:0},${r?1:0} ${Y(t)},${Y(s)}`),this}close(){return this.parts.push("Z"),this}toString(){return this.parts.join(" ")}},xt=1.25,Et=[278,278,355,556,556,889,667,191,333,333,389,584,278,333,278,278,556,556,556,556,556,556,556,556,556,556,278,278,584,584,584,556,1015,667,667,722,722,667,611,778,722,278,500,667,556,833,722,778,667,778,722,667,611,722,667,944,667,667,611,278,278,278,469,556,333,556,556,500,556,556,278,556,556,222,222,500,222,833,556,556,556,556,333,500,278,556,500,722,500,500,500,334,260,334,584],Ct=1.06,It=new Set("гзтэсеё".split("")),Nt=new Set("жмшщюыЖМШЩЮЫФф".split(""));function Ft(n){let i=n.codePointAt(0)??0;if(i>=32&&i<=126)return Et[i-32]??556;if(i>=1024&&i<=1279){if(Nt.has(n))return 800;if(It.has(n))return 470;return n===n.toUpperCase()?690:545}if(i>=11904&&i<=40959||i>=44032&&i<=55215||i>=63744&&i<=64255||i>=65280&&i<=65519||i>=127744&&i<=129791)return 1000;if(i===8212||i===8230)return 1000;if(i===8211)return 556;if(i===160)return 278;return 600}var Ot=(n,i)=>{let a=0;for(let r of n)a+=Ft(r);let l=a/1000*i.size*Ct;if(i.weight==="bold")l*=1.07;return{width:l,height:i.size*xt}},de;function Lt(){if(de!==void 0)return de;de=null;try{let n=globalThis;if(n.navigator?.userAgent?.includes("jsdom"))return de;if(typeof n.OffscreenCanvas==="function")de=new n.OffscreenCanvas(1,1).getContext("2d");else if(n.document&&typeof n.document.createElement==="function")de=n.document.createElement("canvas").getContext("2d");if(de&&de.measureText("M").width<=0)de=null}catch{de=null}return de}function pt(n){return`${n.style==="italic"?"italic ":""}${n.weight==="bold"?"bold ":""}${n.size}px ${n.family}`}function Pt(n){let i=new Map;return(a,l)=>{let r=`${pt(l)}\x00${a}`,t=i.get(r);if(!t){if(t=n(a,l),i.size>5000)i.clear();i.set(r,t)}return t}}function Dt(){let n=Lt();if(!n)return Ot;return Pt((i,a)=>(n.font=pt(a),{width:n.measureText(i).width,height:a.size*xt}))}var _t=/^[a-zA-Z]{3,24}$/,Rt=/^#(?:[0-9a-fA-F]{3,4}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/,ze=String.raw`\s*[+-]?(?:\d+\.?\d*|\.\d+)(?:%|deg)?\s*`,zt=new RegExp(`^(?:rgba?|hsla?)\\((?:${ze},){2,3}${ze}\\)$|^(?:rgba?|hsla?)\\((?:${ze}){3}(?:/${ze})?\\)$`,"i");function Be(n){if(n===void 0)return;let i=n.trim();if(Rt.test(i)||zt.test(i))return i;if(_t.test(i)&&!/^(?:inherit|initial|unset|revert|var|url|expression|none|default)$/i.test(i))return i}var Wt={"--drawio-font-family":"Helvetica, Arial, sans-serif","--drawio-background":"transparent","--drawio-fill":"#ffffff","--drawio-stroke":"#000000","--drawio-text":"#000000","--drawio-label-background":"#ffffff","--drawio-placeholder":"#9ca3af"};function Te(n){return`var(${n}, ${Wt[n]})`}function ge(n,i,a){let l=n[i];if(l===void 0||l===""||l==="default")return a;if(l==="none")return"none";return Be(l)??a}function M(n,i,a,l=-1e6,r=1e6){let t=n[i],s=t===void 0?NaN:Number(t);return Number.isFinite(s)?Math.min(r,Math.max(l,s)):a}function Ve(n,i,a=!1){let l=n[i];return l===void 0?a:l==="1"||l==="true"}function nt(n,i){if(!Ve(n,"dashed"))return;let a=n.dashPattern;if(a&&/^[\d.\s]+$/.test(a))return a.trim().split(/\s+/).map((l)=>Number(l)*i).join(" ");return`${3*i} ${3*i}`}function Xt(n){let i=`#${n}`;return[`${i}{font-family:${Te("--drawio-font-family")};background:${Te("--drawio-background")}}`,`${i} text{white-space:pre}`,`${i} a{cursor:pointer}`].join("")}var $e=(n)=>({x:n.x+n.width/2,y:n.y+n.height/2});function ot(n,i,a){let l=$e(n),r=a.x-l.x,t=a.y-l.y;if(r===0&&t===0)return l;let s=n.width/2,c=n.height/2;if(i==="ellipse"||i==="doubleEllipse"||i==="orShape"||i==="xorShape"){let m=1/Math.sqrt(r*r/(s*s||1)+t*t/(c*c||1));return{x:l.x+r*m,y:l.y+t*m}}if(i==="rhombus"){let m=1/(Math.abs(r)/(s||1)+Math.abs(t)/(c||1));return{x:l.x+r*m,y:l.y+t*m}}let d=Math.min(r===0?1/0:s/Math.abs(r),t===0?1/0:c/Math.abs(t));return{x:l.x+r*d,y:l.y+t*d}}function Ee(n){if(!n.port)return;return{x:n.bounds.x+n.port.x*n.bounds.width,y:n.bounds.y+n.port.y*n.bounds.height}}function Oe(n,i){return[["left",Math.abs(i.x-n.x)],["right",Math.abs(i.x-n.x-n.width)],["top",Math.abs(i.y-n.y)],["bottom",Math.abs(i.y-n.y-n.height)]].sort((a,l)=>a[1]-l[1])[0][0]}function rt(n,i){let a=Ee(n);if(a)return a;let l=n.bounds,r=$e(l);if(i.x>=l.x&&i.x<=l.x+l.width&&(i.y<l.y||i.y>l.y+l.height))return{x:i.x,y:i.y<l.y?l.y:l.y+l.height};if(i.y>=l.y&&i.y<=l.y+l.height&&(i.x<l.x||i.x>l.x+l.width))return{x:i.x<l.x?l.x:l.x+l.width,y:i.y};let t=i.x-r.x,s=i.y-r.y;if(Math.abs(t)*l.height>=Math.abs(s)*l.width)return{x:t>0?l.x+l.width:l.x,y:r.y};return{x:r.x,y:s>0?l.y+l.height:l.y}}function Bt(n,i){let a=[n[0]],l=i;for(let r=1;r<n.length;r++){let t=a[a.length-1],s=n[r];if(Math.abs(t.x-s.x)>0.01&&Math.abs(t.y-s.y)>0.01)a.push(l?{x:s.x,y:t.y}:{x:t.x,y:s.y});a.push(s);let c=a[a.length-2];l=Math.abs(c.y-s.y)>0.01}return Me(a)}function Me(n){let i=[];for(let a of n){let l=i[i.length-1];if(l&&Math.abs(l.x-a.x)<0.01&&Math.abs(l.y-a.y)<0.01)continue;i.push(a)}return i}function qt(n,i,a,l){let r=l.edgeStyle??"",t=(f)=>("bounds"in f),s=(f)=>t(f)?$e(f.bounds):f;if(r==="entityRelationEdgeStyle"&&t(n)&&t(i)){let f=M(l,"segment",30,0,200),x=n.bounds,p=i.bounds;if(Math.min(x.x+x.width,p.x+p.width)-Math.max(x.x,p.x)>0&&!Ee(n)&&!Ee(i)){let J=Math.max(x.x+x.width,p.x+p.width)+f,_={x:x.x+x.width,y:$e(x).y},b={x:p.x+p.width,y:$e(p).y};return Me([_,{x:J,y:_.y},{x:J,y:b.y},b])}let T=$e(x).x<=$e(p).x,k=Ee(n)??{x:T?x.x+x.width:x.x,y:$e(x).y},C=Ee(i)??{x:T?p.x:p.x+p.width,y:$e(p).y},O=k.x+(T?f:-f),R=C.x+(T?-f:f);return Me([k,{x:O,y:k.y},{x:R,y:C.y},C])}if(r==="orthogonalEdgeStyle"||r==="elbowEdgeStyle"||r==="segmentEdgeStyle"){let f=a[0]??s(i),x=a[a.length-1]??s(n),p=t(n)?rt(n,f):n,T=t(i)?rt(i,x):i;if(a.length===0){let C=r==="elbowEdgeStyle"?l.elbow==="vertical":t(n)&&(Oe(n.bounds,p)==="top"||Oe(n.bounds,p)==="bottom");if(p.x===T.x||p.y===T.y)return Me([p,T]);if(C!==(t(i)&&(Oe(i.bounds,T)==="top"||Oe(i.bounds,T)==="bottom")))return Me([p,C?{x:p.x,y:T.y}:{x:T.x,y:p.y},T]);if(C){let R=(p.y+T.y)/2;return Me([p,{x:p.x,y:R},{x:T.x,y:R},T])}let O=(p.x+T.x)/2;return Me([p,{x:O,y:p.y},{x:O,y:T.y},T])}let k=t(n)?!(Oe(n.bounds,p)==="top"||Oe(n.bounds,p)==="bottom"):Math.abs(f.x-p.x)>=Math.abs(f.y-p.y);return Bt([p,...a,T],k)}let c=a[0]??s(i),d=a[a.length-1]??s(n),m=t(n)?Ee(n)??ot(n.bounds,n.shape,c):n,y=t(i)?Ee(i)??ot(i.bounds,i.shape,d):i;return Me([m,...a,y])}function Yt(n,i){let a=new L;if(n.length===0)return"";if(a.moveTo(n[0].x,n[0].y),i.curved==="1"&&n.length>2){for(let r=1;r<n.length-1;r++){let t=n[r],s=n[r+1],c=r===n.length-2?s:{x:(t.x+s.x)/2,y:(t.y+s.y)/2};a.quadTo(t.x,t.y,c.x,c.y)}return a.toString()}let l=i.rounded==="1"?M(i,"arcSize",20,0,200)/2:0;for(let r=1;r<n.length;r++){let t=n[r],s=n[r+1];if(l>0&&s){let c=n[r-1],d=Math.hypot(t.x-c.x,t.y-c.y),m=Math.hypot(s.x-t.x,s.y-t.y),y=Math.min(l,d/2,m/2);if(y>0.5){let f={x:t.x-(t.x-c.x)/d*y,y:t.y-(t.y-c.y)/d*y},x={x:t.x+(s.x-t.x)/m*y,y:t.y+(s.y-t.y)/m*y};a.lineTo(f.x,f.y).quadTo(t.x,t.y,x.x,x.y);continue}}a.lineTo(t.x,t.y)}return a.toString()}function it(n,i){switch(n){case"classic":case"classicThin":return i*1.2;case"block":case"blockThin":return i*1.6;case"diamond":case"diamondThin":return i*2.2;case"oval":case"circle":return i;default:return 0}}function st(n,i,a,l,r,t,s){if(!n||n==="none")return[];let c={x:-a.y,y:a.x},d=(x,p)=>[i.x-a.x*x+c.x*p,i.y-a.y*x+c.y*p],m=(x,p,T)=>{let k=new L;if(x.forEach(([C,O],R)=>R===0?k.moveTo(C,O):k.lineTo(C,O)),p)k.close();return S("path",{d:k.toString(),fill:p?T?t:"var(--drawio-label-background, #ffffff)":"none",stroke:t,"stroke-width":s,"stroke-linejoin":"round","stroke-linecap":"round"})},y=l*1.6,f=l*(n.endsWith("Thin")?0.45:0.7);switch(n){case"classic":case"classicThin":return[m([d(0,0),d(y,f),d(y*0.75,0),d(y,-f)],!0,r)];case"block":case"blockThin":return[m([d(0,0),d(y,f),d(y,-f)],!0,r)];case"open":case"openThin":return[m([d(y,f),d(0,0),d(y,-f)],!1,!1)];case"async":return[m([d(0,0),d(y,f),d(y,0)],!0,r)];case"diamond":case"diamondThin":return[m([d(0,0),d(y*0.7,f),d(y*1.4,0),d(y*0.7,-f)],!0,r)];case"oval":case"circle":{let[x,p]=d(l/2,0);return[S("circle",{cx:x,cy:p,r:l/2,fill:r?t:"var(--drawio-label-background, #ffffff)",stroke:t,"stroke-width":s})]}case"dash":return[m([d(l,l),d(l,-l)],!1,!1)];case"cross":return[m([d(y,f),d(0,-f)],!1,!1),m([d(y,-f),d(0,f)],!1,!1)];case"ERone":return[m([d(l*1.6,l),d(l*1.6,-l)],!1,!1)];case"ERmandOne":return[m([d(l*1.2,l),d(l*1.2,-l)],!1,!1),m([d(l*2,l),d(l*2,-l)],!1,!1)];case"ERmany":return[m([d(0,l),d(l*1.6,0),d(0,-l)],!1,!1)];case"ERoneToMany":return[m([d(0,l),d(l*1.6,0),d(0,-l)],!1,!1),m([d(l*2,l),d(l*2,-l)],!1,!1)];case"ERzeroToMany":{let[x,p]=d(l*2.6,0);return[m([d(0,l),d(l*1.6,0),d(0,-l)],!1,!1),S("circle",{cx:x,cy:p,r:l*0.6,fill:"var(--drawio-label-background, #ffffff)",stroke:t,"stroke-width":s})]}case"ERzeroToOne":{let[x,p]=d(l*2.6,0);return[m([d(l*1.2,l),d(l*1.2,-l)],!1,!1),S("circle",{cx:x,cy:p,r:l*0.6,fill:"var(--drawio-label-background, #ffffff)",stroke:t,"stroke-width":s})]}default:return[m([d(y,f),d(0,0),d(y,-f)],!1,!1)]}}function at(n,i){let a=0;for(let c=1;c<n.length;c++)a+=Math.hypot(n[c].x-n[c-1].x,n[c].y-n[c-1].y);let l=a*Math.min(1,Math.max(0,i));for(let c=1;c<n.length;c++){let d=n[c-1],m=n[c],y=Math.hypot(m.x-d.x,m.y-d.y);if(l<=y&&y>0)return{point:{x:d.x+(m.x-d.x)*l/y,y:d.y+(m.y-d.y)*l/y},dir:{x:(m.x-d.x)/y,y:(m.y-d.y)/y}};l-=y}let r=n[n.length-2]??n[0],t=n[n.length-1],s=Math.hypot(t.x-r.x,t.y-r.y)||1;return{point:t,dir:{x:(t.x-r.x)/s,y:(t.y-r.y)/s}}}var Q=class extends Error{constructor(n,i=0,a=0,l){super(i>0?`${n} (line ${i}${a>0?`, column ${a}`:""})`:n);this.line=i,this.column=a,this.hint=l,this.name="DrawioError"}},Ut={amp:"&",lt:"<",gt:">",quot:'"',apos:"'",nbsp:" ",ndash:"–",mdash:"—",hellip:"…",laquo:"«",raquo:"»",copy:"©",reg:"®",trade:"™",bull:"•",middot:"·",deg:"°",times:"×",rarr:"→",larr:"←",euro:"€"};function je(n){return n.replace(/&(#x[0-9a-f]+|#\d+|[a-z]+);/gi,(i,a)=>{if(a[0]==="#"){let l=a[1]==="x"||a[1]==="X"?parseInt(a.slice(2),16):parseInt(a.slice(1),10);return l>0&&l<=1114111&&!(l>=55296&&l<=57343)?String.fromCodePoint(l):i}return Ut[a.toLowerCase()]??i})}function Ht(n){return n.split(/\r\n|\r|\n/).map((i)=>i?[{text:i}]:[])}var lt=new Set(["div","p","li","h1","h2","h3","h4","h5","h6","tr","ul","ol","table","blockquote","pre"]),jt=[10,13,16,18,24,32,48];function Gt(n){let i={};for(let a of n.split(";")){let l=a.indexOf(":");if(l<0)continue;let r=a.slice(0,l).trim().toLowerCase(),t=a.slice(l+1).trim();if(r==="color")i.color=Be(t);else if(r==="font-weight")i.bold=t==="bold"||Number(t)>=600;else if(r==="font-style")i.italic=t==="italic"||t==="oblique";else if(r==="text-decoration"||r==="text-decoration-line")i.underline=t.includes("underline");else if(r==="font-size"){let s=/^([\d.]+)px$/.exec(t);if(s)i.size=Math.min(200,Number(s[1]))}}return i}function Zt(n){let i=[[]],a=[],l=()=>Object.assign({},...a.map((m)=>m.style)),r=()=>{i.push([])},t=()=>{if(i[i.length-1].length>0)r()},s=(m)=>{if(!m)return;let y=l(),f={text:m};if(y.bold)f.bold=!0;if(y.italic)f.italic=!0;if(y.underline)f.underline=!0;if(y.color)f.color=y.color;if(y.size)f.size=y.size;i[i.length-1].push(f)},c=/<!--[\s\S]*?-->|<\/?([a-zA-Z][a-zA-Z0-9]*)((?:\s+[^\s=>/]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s>]+))?)*)\s*\/?>|([^<]+)|</g,d;while(d=c.exec(n)){if(d[3]!==void 0||d[0]==="<"){s(je((d[3]??"<").replace(/[ \t\r\n]+/g," ")));continue}let m=(d[1]??"").toLowerCase();if(!m)continue;let y=d[0][1]==="/";if(m==="br"){r();continue}if(y){let k=a.map((C)=>C.tag).lastIndexOf(m);if(k>=0)a.splice(k);if(lt.has(m))t();continue}if(["script","style","title","head"].includes(m)){let k=n.toLowerCase().indexOf(`</${m}`,c.lastIndex);c.lastIndex=k<0?n.length:k;continue}if(lt.has(m))t();let f=d[2]??"",x=(k)=>new RegExp(`\\s${k}\\s*=\\s*(?:"([^"]*)"|'([^']*)'|([^\\s>]+))`,"i").exec(f),p={};if(m==="b"||m==="strong"||/^h[1-6]$/.test(m))p.bold=!0;if(m==="i"||m==="em")p.italic=!0;if(m==="u")p.underline=!0;let T=x("style");if(T)Object.assign(p,Gt(je(T[1]??T[2]??T[3]??"")));if(m==="font"){let k=x("color"),C=k&&Be(je(k[1]??k[2]??k[3]??""));if(C)p.color=C;let O=x("size"),R=O?Number(O[1]??O[2]??O[3]):NaN;if(R>=1&&R<=7)p.size=jt[R-1]}if(m==="li")s("• ");if(!(/\/>$/.test(d[0])||["img","hr","input","wbr","meta","link"].includes(m)))a.push({tag:m,style:p})}while(i.length>1&&i[i.length-1].every((m)=>!m.text.trim()))i.pop();while(i.length>1&&i[0].every((m)=>!m.text.trim()))i.shift();return i.map((m)=>Vt(m))}function Vt(n){let i=n.map((a)=>({...a}));while(i.length>0&&i[0].text.trim()==="")i.shift();while(i.length>0&&i[i.length-1].text.trim()==="")i.pop();if(i[0])i[0].text=i[0].text.replace(/^ +/,"");if(i.length>0)i[i.length-1].text=i[i.length-1].text.replace(/ +$/,"");return i}function yt(n,i){return{...i,size:n.size??i.size,weight:n.bold?"bold":i.weight,style:n.italic?"italic":i.style}}function Ke(n,i,a){return n.reduce((l,r)=>l+a(r.text,yt(r,i)).width,0)}function Kt(n,i){return Math.max(i.size,...n.map((a)=>a.size??i.size))*1.2}function Qt(n,i,a,l){let r=[];for(let t of n){if(Ke(t,a,l)<=i){r.push(t);continue}let s=[[]];for(let m of t)for(let y of m.text.split(/( +)/))if(/^ +$/.test(y))s.push([]);else if(y)s[s.length-1].push({...m,text:y});let c=[],d=0;for(let m of s){if(m.length===0)continue;let y=Ke(m,a,l),f=l(" ",yt(m[0],a)).width;if(c.length>0&&d+f+y>i)r.push(c),c=[],d=0;if(c.length>0)c.push({...m[0],text:" "}),d+=f;c.push(...m),d+=y}r.push(c)}return r}var Jt=[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],en=[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],tn=[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],nn=[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],on=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];function Re(n,i){let a=new Uint16Array(16);for(let t=0;t<i;t++)a[n[t]]++;a[0]=0;let l=new Uint16Array(16);for(let t=1;t<16;t++)l[t]=l[t-1]+a[t-1];let r=new Uint16Array(i);for(let t=0;t<i;t++)if(n[t])r[l[n[t]]++]=t;return{counts:a,symbols:r}}var We;function rn(){if(We)return We;let n=new Uint8Array(288);for(let a=0;a<144;a++)n[a]=8;for(let a=144;a<256;a++)n[a]=9;for(let a=256;a<280;a++)n[a]=7;for(let a=280;a<288;a++)n[a]=8;let i=new Uint8Array(30).fill(5);return We={lit:Re(n,288),dist:Re(i,30)},We}function sn(n,i=50000000){let a=0,l=0,r=0,t=new Uint8Array(Math.min(i,Math.max(1024,n.length*4))),s=0,c=()=>{throw new Q("A compressed page is corrupt")},d=(f)=>{while(r<f){if(a>=n.length)c();l|=n[a++]<<r,r+=8}let x=l&(1<<f)-1;return l>>>=f,r-=f,x},m=(f)=>{if(s+f<=t.length)return;if(s+f>i)throw new Q(`A compressed page expands beyond ${i} bytes`);let x=t.length*2;while(x<s+f)x*=2;let p=new Uint8Array(Math.min(x,i));p.set(t.subarray(0,s)),t=p},y=(f)=>{let x=0,p=0,T=0;for(let k=1;k<16;k++){x|=d(1);let C=f.counts[k];if(x-C<p)return f.symbols[T+(x-p)];T+=C,p+=C,p<<=1,x<<=1}return c()};for(;;){let f=d(1),x=d(2);if(x===0){if(l=0,r=0,a+4>n.length)c();let p=n[a]|n[a+1]<<8,T=n[a+2]|n[a+3]<<8;if((p^65535)!==T)c();if(a+=4,a+p>n.length)c();m(p),t.set(n.subarray(a,a+p),s),s+=p,a+=p}else if(x===1||x===2){let p,T;if(x===1)({lit:p,dist:T}=rn());else{let k=d(5)+257,C=d(5)+1,O=d(4)+4,R=new Uint8Array(19);for(let b=0;b<O;b++)R[on[b]]=d(3);let J=Re(R,19),_=new Uint8Array(k+C);for(let b=0;b<k+C;){let E=y(J);if(E<16)_[b++]=E;else{let N,P=0;if(E===16){if(b===0)c();P=_[b-1],N=3+d(2)}else if(E===17)N=3+d(3);else N=11+d(7);if(b+N>k+C)c();_.fill(P,b,b+N),b+=N}}p=Re(_.subarray(0,k),k),T=Re(_.subarray(k),C)}for(;;){let k=y(p);if(k<256)m(1),t[s++]=k;else if(k===256)break;else{let C=k-257;if(C>=29)c();let O=Jt[C]+d(en[C]),R=y(T);if(R>=30)c();let J=tn[R]+d(nn[R]);if(J>s)c();m(O);for(let _=0;_<O;_++,s++)t[s]=t[s-J]}}}else c();if(f)break}return t.subarray(0,s)}var an="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",qe=new Int16Array(128).fill(-1);for(let n=0;n<64;n++)qe[an.charCodeAt(n)]=n;qe[45]=62;qe[95]=63;function ln(n){let i=n.replace(/[\s=]/g,""),a=new Uint8Array(Math.floor(i.length*3/4)),l=0,r=0,t=0;for(let s=0;s<i.length;s++){let c=i.charCodeAt(s),d=c<128?qe[c]:-1;if(d<0)throw new Q("A compressed page is not valid base64");if(l=l<<6|d,r+=6,r>=8)r-=8,a[t++]=l>>r&255}return a.subarray(0,t)}function cn(n){return new TextDecoder("utf-8").decode(n)}function un(n,i){let a=cn(sn(ln(n.trim()),i));try{return decodeURIComponent(a)}catch{return a}}var ct="http://www.w3.org/XML/1998/namespace",ut="http://www.w3.org/2000/xmlns/",wt=String.raw`A-Za-z_\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD`,fn=String.raw`${wt}\-.0-9\u00B7\u0300-\u036F\u203F-\u2040:`,ft=new RegExp(`[${wt}:][${fn}]*`,"y"),hn={lt:"<",gt:">",amp:"&",quot:'"',apos:"'"};function Ge(n){return n===9||n===10||n===13||n>=32&&n<=55295||n>=57344&&n<=65533||n>=65536&&n<=1114111}function Qe(n,i={}){let a=i.maxLength??20000000,l=i.maxElements??200000,r=i.maxDepth??256;if(typeof n!=="string")throw new Q("The diagram must be a string of XML");if(n.length>a)throw new Q(`The file has ${n.length} characters; the limit is ${a}`);let t=n.charCodeAt(0)===65279?n.slice(1):n,s=0,c=0,d=[0];for(let b=t.indexOf(`
2
2
  `);b>=0;b=t.indexOf(`
3
3
  `,b+1))d.push(b+1);let m=(b)=>{let E=0,N=d.length-1;while(E<N){let P=E+N+1>>1;if(d[P]<=b)E=P;else N=P-1}return{line:E+1,column:b-d[E]+1}},y=(b,E=s,N)=>{let{line:P,column:V}=m(E);throw new Q(b,P,V,N)},f=()=>{ft.lastIndex=s;let b=ft.exec(t);if(!b)y("A name is expected here");return s+=b[0].length,b[0]},x=()=>{let b=s;while(s<t.length&&/[ \t\r\n]/.test(t[s]))s++;return s>b},p=(b)=>{if(!t.startsWith(b,s))y(`"${b}" is expected here`);s+=b.length},T=(b,E,N)=>{let P=(U)=>N?U.replace(/\r\n|[\r\n\t]/g," "):U.replace(/\r\n?/g,`
4
4
  `),V="",re=0;for(let U=0;U<b.length;U++){let ie=b.charCodeAt(U);if(ie===38){let me=b.indexOf(";",U);if(me<0)y('An "&" must start a reference such as "&amp;"',E+U);let K=b.slice(U+1,me),se;if(K.startsWith("#x")){let j=/^[0-9a-fA-F]+$/.test(K.slice(2))?parseInt(K.slice(2),16):NaN;se=Ge(j)?String.fromCodePoint(j):void 0}else if(K.startsWith("#")){let j=/^[0-9]+$/.test(K.slice(1))?parseInt(K.slice(1),10):NaN;se=Ge(j)?String.fromCodePoint(j):void 0}else se=hn[K];if(se===void 0)y(`"&${K};" is not a known reference`,E+U,"Only &lt; &gt; &amp; &quot; &apos; and &#…; are allowed.");V+=P(b.slice(re,U))+se,U=me,re=me+1;continue}if(N&&ie===60)y('"<" is not allowed in an attribute value',E+U);if(!Ge(ie)&&!(ie>=55296&&ie<=57343))y("The file contains a character XML does not allow",E+U)}return V+P(b.slice(re))},k=(b)=>{if(t.startsWith("<!--",s)){let E=t.indexOf("-->",s+4);if(E<0)y("A comment is never closed");let N=t.slice(s+4,E);if(N.includes("--"))y('"--" is not allowed inside a comment');return s=E+3,{kind:"comment",value:N}}if(t.startsWith("<?",s)){let E=s;s+=2;let N=f();if(N.toLowerCase()==="xml"&&E!==0)y("The XML declaration must come first",E);let P=t.indexOf("?>",s);if(P<0)y("A processing instruction is never closed",E);let V=t.slice(s,P).trim();return s=P+2,{kind:"instruction",target:N,value:V}}if(b&&t.startsWith("<![CDATA[",s)){let E=t.indexOf("]]>",s+9);if(E<0)y("A CDATA section is never closed");let N=t.slice(s+9,E).replace(/\r\n?/g,`
5
- `);return s=E+3,{kind:"cdata",value:N}}if(t.startsWith("<!DOCTYPE",s)||t.startsWith("<!ENTITY",s))y("Document type declarations are not accepted",s,"Remove the <!DOCTYPE …> line: draw.io files do not need it.");return null},C=(b,E)=>{if(E>r)y(`Elements are nested deeper than ${r} levels`);if(++c>l)y(`The file has more than ${l} elements`);let N=s;p("<");let P=f(),V=[];for(;;){let F=x();if(t.startsWith("/>",s)||t.startsWith(">",s))break;if(!F)y("A space is expected between attributes");let ee=s,h=f();x(),p("="),x();let g=t[s];if(g!=='"'&&g!=="'")y("An attribute value must be quoted");let w=t.indexOf(g,s+1);if(w<0)y("An attribute value is never closed");let v=T(t.slice(s+1,w),s+1,!0);if(s=w+1,V.some((A)=>A.name===h))y(`The attribute "${h}" is repeated`,ee);V.push({name:h,value:v,at:ee})}let re=b;for(let F of V)if(F.name==="xmlns"||F.name.startsWith("xmlns:")){if(re===b)re=new Map(b);let ee=F.name==="xmlns"?"":F.name.slice(6);if(ee&&F.value==="")y(`The prefix "${ee}" cannot be undeclared`,F.at);re.set(ee,F.value)}let U=(F,ee,h)=>{let g=F.indexOf(":");if(g<0)return{ns:h?"":re.get("")??"",local:F};let w=F.slice(0,g),v=F.slice(g+1);if(w==="xml")return{ns:ct,local:v};if(w==="xmlns")return{ns:ut,local:v};let A=re.get(w);if(A===void 0)y(`The prefix "${w}" is not declared`,ee,`Add xmlns:${w}="…" to the root element.`);return{ns:A,local:v}},ie=U(P,N+1,!1),me=V.map((F)=>{if(F.name==="xmlns")return{name:F.name,value:F.value,ns:ut,local:"xmlns"};return{name:F.name,value:F.value,...U(F.name,F.at,!0)}}),{line:K,column:se}=m(N),j={kind:"element",name:P,...ie,attributes:me,children:[],line:K,column:se};if(t.startsWith("/>",s))return s+=2,j;s+=1;for(;;){if(s>=t.length)y(`<${P}> is never closed`,N);let F=t.indexOf("<",s);if(F!==s){let h=F<0?t.length:F,g=t.slice(s,h);if(g.includes("]]>"))y('"]]>" is not allowed in text',s+g.indexOf("]]>"));j.children.push({kind:"text",value:T(g,s,!1)}),s=h;continue}if(t.startsWith("</",s)){s+=2;let h=f();if(h!==P)y(`</${h}> closes <${P}>`,s-h.length-2);return x(),p(">"),j}let ee=k(!0);if(ee){j.children.push(ee);continue}j.children.push(C(re,E+1))}},O=[],R=[],J=new Map([["xml",ct]]),_;for(;;){if(x(),s>=t.length)break;let b=k(!1);if(b){(_?R:O).push(b);continue}if(t[s]!=="<")y("Text is not allowed outside the root element");if(_)y("A document has one root element");_=C(J,1)}if(!_)y("The file has no XML element",0,"A draw.io file starts with <mxfile> or <mxGraphModel>.");return{prolog:O,root:_,epilog:R}}function D(n,i,a=""){for(let l of n.attributes)if(l.local===i&&l.ns===a)return l.value}function ke(n,i,a){let l=[];for(let r of n.children){if(r.kind!=="element")continue;if(i!==void 0&&r.ns!==i)continue;if(a!==void 0&&r.local!==a)continue;l.push(r)}return l}function vt(n){let i="";for(let a of n.children)if(a.kind==="text"||a.kind==="cdata")i+=a.value;else if(a.kind==="element")i+=vt(a);return i}function dn(n){let i={},a=[];for(let l of(n??"").split(";")){let r=l.trim();if(!r)continue;let t=r.indexOf("=");if(t<0)a.push(r);else i[r.slice(0,t).trim()]=r.slice(t+1).trim()}return{style:i,names:a}}function Le(n,i=0){let a=n===void 0?NaN:Number(n);return Number.isFinite(a)?a:i}function Xe(n){return{x:Le(D(n,"x")),y:Le(D(n,"y"))}}function mn(n){if(!n)return;let i={x:Le(D(n,"x")),y:Le(D(n,"y")),width:Le(D(n,"width")),height:Le(D(n,"height")),relative:D(n,"relative")==="1",points:[]};for(let a of ke(n)){let l=D(a,"as");if(a.local==="mxPoint"){if(l==="sourcePoint")i.sourcePoint=Xe(a);else if(l==="targetPoint")i.targetPoint=Xe(a);else if(l==="offset")i.offset=Xe(a)}else if(a.local==="Array"&&l==="points")i.points=ke(a,"","mxPoint").map(Xe)}return i}function Ze(n,i){let a=ke(n).find((s)=>s.local==="root"),l=new Map,r=[];for(let s of a?ke(a):[]){let c=s,d=D(s,"id"),m={},y=D(s,"value")??"";if(s.local==="UserObject"||s.local==="object"){c=ke(s).find((T)=>T.local==="mxCell")??s;for(let T of s.attributes)if(T.ns===""&&T.local!=="id")m[T.local]=T.value;if(y=m.label??"",delete m.label,m.placeholders==="1")y=y.replace(/%([\w.-]+)%/g,(T,k)=>m[k]??T)}else if(s.local!=="mxCell")continue;if(d??=D(c,"id"),!d)continue;let{style:f,names:x}=dn(D(c,"style")),p={id:d,parent:D(c,"parent"),value:y,style:f,names:x,vertex:D(c,"vertex")==="1",edge:D(c,"edge")==="1",source:D(c,"source"),target:D(c,"target"),visible:D(c,"visible")!=="0",collapsed:D(c,"collapsed")==="1",geometry:mn(ke(c).find((T)=>T.local==="mxGeometry")),data:m};l.set(d,p),r.push(p)}let t=r.find((s)=>s.parent===void 0)?.id;return{...i,cells:l,order:r,root:t,background:i.background??D(n,"background")}}function gn(n,i){let a=Qe(n.replace(/<!DOCTYPE\s+svg\s+PUBLIC\s+"[^"[\]]*"\s+"[^"[\]]*"\s*>/i,""),i.limits).root,l=D(a,"content");return l?Ye(l,i):void 0}function Ye(n,i={}){let a=n.replace(/^\uFEFF/,"").trimStart();if(/^(?:<\?xml[^>]*>\s*)?(?:<!--[\s\S]*?-->\s*)*(?:<!DOCTYPE\s+svg|<svg[\s>])/i.test(a)){let s=gn(a,i);if(!s)throw new Q("The SVG has no draw.io diagram in it",0,0,'Export from draw.io with "Include a copy of my diagram".');return s}let l=Qe(a,i.limits).root;if(l.local==="mxGraphModel")return{pages:[Ze(l,{})],meta:{}};if(l.local!=="mxfile")throw new Q(`<${l.name}> is not a draw.io file`,l.line,l.column,"A draw.io file starts with <mxfile> or <mxGraphModel>.");let r={};for(let s of["host","agent","version","type"]){let c=D(l,s);if(c)r[s]=c}let t=ke(l).filter((s)=>s.local==="diagram").map((s)=>{let c={id:D(s,"id"),name:D(s,"name")},d=ke(s).find((x)=>x.local==="mxGraphModel");if(d)return Ze(d,c);let m=vt(s).trim();if(!m)return{...c,cells:new Map,order:[]};let y;try{y=un(m,i.maxPageSize)}catch(x){throw new Q(`The page "${c.name??c.id??""}" cannot be read: ${x.message}`,s.line,s.column)}let f=Qe(y,i.limits).root;if(f.local!=="mxGraphModel")throw new Q(`The page "${c.name??""}" holds no diagram`,s.line,s.column);return Ze(f,c)});if(t.length===0)throw new Q("The file has no pages");return{pages:t,meta:r}}function oe(n,i={}){return{fill:n.fill,stroke:n.stroke,"stroke-width":n.stroke==="none"?void 0:n.strokeWidth,"stroke-dasharray":n.dash,"fill-opacity":n.fillOpacity,"stroke-opacity":n.strokeOpacity,"stroke-linejoin":"round",...i}}var be=(n,i,a={})=>S("path",oe(i,{d:n.toString(),...a})),fe=(n,i)=>S("path",oe({...i,fill:"none"},{d:n.toString()}));function H(n,i){let a=new L;return n.forEach(([l,r],t)=>t===0?a.moveTo(l,r):a.lineTo(l,r)),be(a.close(),i)}function Se(n,i,a){let{x:l,y:r,width:t,height:s}=i;switch(a){case"south":return n.map(([c,d])=>[l+(1-d)*t,r+c*s]);case"west":return n.map(([c,d])=>[l+(1-c)*t,r+(1-d)*s]);case"north":return n.map(([c,d])=>[l+d*t,r+(1-c)*s]);default:return n.map(([c,d])=>[l+c*t,r+d*s])}}function Ae(n,i,a){let l=a.rounded==="1",r=0;if(l){let t=M(a,"arcSize",a.absoluteArcSize==="1"?20:15,0,100);r=a.absoluteArcSize==="1"?t/2:Math.min(n.width,n.height)*t/100,r=Math.min(r,n.width/2,n.height/2)}return S("rect",oe(i,{x:n.x,y:n.y,width:Math.max(0,n.width),height:Math.max(0,n.height),rx:r||void 0}))}var xn={decision:"rhombus",process:"rectangle",terminator:"terminator",document:"document",multi_document:"document",data:"parallelogram",database:"cylinder",start_1:"ellipse",start_2:"ellipse",on_page_reference:"ellipse",off_page_reference:"offPageConnector",predefined_process:"process",manual_input:"manualInput",manual_operation:"trapezoid",delay:"delay",display:"display",preparation:"hexagon",stored_data:"dataStorage",internal_storage:"internalStorage",merge_or_storage:"triangleDown",extract_or_measurement:"triangleUp",or:"orShape",summing_function:"xorShape",card:"card",paper_tape:"tape",loop_limit:"loopLimit",annotation_1:"annotation",annotation_2:"annotation"};function ht(n,i){let a=n.shape;if(!a)a=i.find((l)=>bt.has(l)||l==="swimlane"||l==="text"||l==="group"||l==="image"||l==="edgeLabel")??"rectangle";if(a.startsWith("mxgraph.flowchart."))return xn[a.slice(18)]??"rectangle";if(a==="mxgraph.basic.rect"||a==="mxgraph.basic.patternFillRect")return"rectangle";if(a==="mxgraph.basic.oval")return"ellipse";if(a==="orEllipse")return"orShape";if(a==="sumEllipse")return"xorShape";if(a==="mxgraph.aws4.resourceIcon"||a==="mxgraph.aws4.productIcon")return n.resIcon??n.prIcon??a;return a}var bt=new Set(["rectangle","label","ellipse","doubleEllipse","rhombus","triangle","hexagon","parallelogram","trapezoid","cylinder","cylinder3","document","cloud","process","note","card","callout","actor","umlActor","step","tape","internalStorage","manualInput","delay","display","offPageConnector","dataStorage","orShape","xorShape","cross","singleArrow","doubleArrow","partialRectangle","line","terminator","triangleDown","triangleUp","loopLimit","annotation","table","tableRow","curlyBracket","or","xor","plus","link","lineEllipse","swimlane","text","image","group","edgeLabel","umlLifeline","module","component","folder","datastore","cube"]);function pn(n){return bt.has(n)}function yn(n,i,a,l){let{x:r,y:t,width:s,height:c}=i,d=r+s/2,m=t+c/2,y=l.direction;switch(n){case"rectangle":case"label":case"tableRow":case"table":return[Ae(i,a,l)];case"text":case"edgeLabel":case"group":return l.fillColor||l.strokeColor?[Ae(i,{...a,fill:l.fillColor?a.fill:"none",stroke:l.strokeColor?a.stroke:"none"},l)]:[];case"ellipse":return[S("ellipse",oe(a,{cx:d,cy:m,rx:s/2,ry:c/2}))];case"doubleEllipse":case"lineEllipse":{let f=Math.min(s,c)*0.1;return[S("ellipse",oe(a,{cx:d,cy:m,rx:s/2,ry:c/2})),S("ellipse",oe({...a,fill:"none"},{cx:d,cy:m,rx:Math.max(0,s/2-f),ry:Math.max(0,c/2-f)}))]}case"rhombus":return[H([[d,t],[r+s,m],[d,t+c],[r,m]],a)];case"triangle":return[H(Se([[0,0],[1,0.5],[0,1]],i,y),a)];case"triangleDown":return[H([[r,t],[r+s,t],[d,t+c]],a)];case"triangleUp":return[H([[d,t],[r+s,t+c],[r,t+c]],a)];case"hexagon":{let f=M(l,"size",0.25,0,0.5);return[H(Se([[f,0],[1-f,0],[1,0.5],[1-f,1],[f,1],[0,0.5]],i,y),a)]}case"parallelogram":{let f=M(l,"size",0.2,0,1);return[H(Se([[0,1],[f,0],[1,0],[1-f,1]],i,y),a)]}case"trapezoid":{let f=M(l,"size",0.2,0,0.5);return[H(Se([[0,1],[f,0],[1-f,0],[1,1]],i,y),a)]}case"manualInput":return[H([[r,t+Math.min(M(l,"size",30,0),c)],[r+s,t],[r+s,t+c],[r,t+c]],a)];case"cylinder":case"cylinder3":case"datastore":{let f=Math.min(n==="cylinder3"?M(l,"size",15,0):c*0.12,c/3),x=new L().moveTo(r,t+f).arcTo(s/2,f,0,!1,!0,r+s,t+f).lineTo(r+s,t+c-f).arcTo(s/2,f,0,!1,!0,r,t+c-f).close(),p=new L().moveTo(r,t+f).arcTo(s/2,f,0,!1,!1,r+s,t+f);return[be(x,a),fe(p,a)]}case"document":{let f=M(l,"size",0.3,0,1)*c*0.5;return[be(new L().moveTo(r,t).lineTo(r+s,t).lineTo(r+s,t+c-f/2).curveTo(r+s*0.75,t+c-f*1.5,r+s*0.25,t+c+f*0.5,r,t+c-f/2).close(),a)]}case"cloud":return[be(new L().moveTo(r+0.25*s,t+0.25*c).curveTo(r+0.05*s,t+0.25*c,r,t+0.5*c,r+0.16*s,t+0.55*c).curveTo(r,t+0.66*c,r+0.18*s,t+0.9*c,r+0.31*s,t+0.8*c).curveTo(r+0.4*s,t+c,r+0.7*s,t+c,r+0.8*s,t+0.8*c).curveTo(r+s,t+0.8*c,r+s,t+0.6*c,r+0.875*s,t+0.5*c).curveTo(r+s,t+0.3*c,r+0.8*s,t+0.1*c,r+0.625*s,t+0.2*c).curveTo(r+0.5*s,t+0.05*c,r+0.3*s,t+0.05*c,r+0.25*s,t+0.25*c).close(),a)];case"process":{let f=M(l,"size",0.1,0,0.5)*s;return[Ae(i,a,l),fe(new L().moveTo(r+f,t).lineTo(r+f,t+c).moveTo(r+s-f,t).lineTo(r+s-f,t+c),a)]}case"note":{let f=Math.min(M(l,"size",30,0),s,c);return[H([[r,t],[r+s-f,t],[r+s,t+f],[r+s,t+c],[r,t+c]],a),fe(new L().moveTo(r+s-f,t).lineTo(r+s-f,t+f).lineTo(r+s,t+f),a)]}case"card":{let f=Math.min(M(l,"size",15,0),s,c);return[H([[r+f,t],[r+s,t],[r+s,t+c],[r,t+c],[r,t+f]],a)]}case"folder":{let f=Math.min(M(l,"tabWidth",50,0),s),x=Math.min(M(l,"tabHeight",20,0),c);return[H([[r,t],[r+f,t],[r+f,t+x],[r+s,t+x],[r+s,t+c],[r,t+c]],a)]}case"callout":{let f=Math.min(M(l,"size",30,0),c),x=M(l,"base",20,0),p=r+s*M(l,"position",0.5,0,1);return[H([[r,t],[r+s,t],[r+s,t+c-f],[p+x/2,t+c-f],[p,t+c],[p-x/2,t+c-f],[r,t+c-f]],a)]}case"actor":return[be(new L().moveTo(r,t+c).curveTo(r,t+c*0.6,r+s*0.3,t+c*0.55,r+s*0.5,t+c*0.55).curveTo(r+s*0.7,t+c*0.55,r+s,t+c*0.6,r+s,t+c).close(),a),S("ellipse",oe(a,{cx:d,cy:t+c*0.25,rx:s*0.22,ry:c*0.25}))];case"umlActor":{let f=Math.min(s,c/4)/2,x=new L().moveTo(d,t+f*2).lineTo(d,t+c*0.65).moveTo(r,t+c*0.35).lineTo(r+s,t+c*0.35).moveTo(r,t+c).lineTo(d,t+c*0.65).lineTo(r+s,t+c);return[S("ellipse",oe(a,{cx:d,cy:t+f,rx:f,ry:f})),fe(x,a)]}case"step":{let f=M(l,"size",0.2,0,1)*s;return[H(Se([[0,0],[1-f/s,0],[1,0.5],[1-f/s,1],[0,1],[f/s,0.5]],i,y),a)]}case"tape":{let f=M(l,"size",0.4,0,1)*c*0.25;return[be(new L().moveTo(r,t+f).quadTo(r+s/4,t-f,r+s/2,t+f).quadTo(r+3*s/4,t+3*f,r+s,t+f).lineTo(r+s,t+c-f).quadTo(r+3*s/4,t+c-3*f,r+s/2,t+c-f).quadTo(r+s/4,t+c+f,r,t+c-f).close(),a)]}case"internalStorage":{let f=M(l,"dx",20,0),x=M(l,"dy",20,0);return[Ae(i,a,l),fe(new L().moveTo(r+f,t).lineTo(r+f,t+c).moveTo(r,t+x).lineTo(r+s,t+x),a)]}case"delay":return[be(new L().moveTo(r,t).lineTo(r+s-c/2,t).arcTo(c/2,c/2,0,!1,!0,r+s-c/2,t+c).lineTo(r,t+c).close(),a)];case"display":{let f=s*0.25;return[be(new L().moveTo(r+f,t).lineTo(r+s-c/2,t).arcTo(c/2,c/2,0,!1,!0,r+s-c/2,t+c).lineTo(r+f,t+c).lineTo(r,m).close(),a)]}case"terminator":return[S("rect",oe(a,{x:r,y:t,width:s,height:c,rx:Math.min(c/2,s/2)}))];case"offPageConnector":{let f=M(l,"size",0.375,0,1)*c;return[H([[r,t],[r+s,t],[r+s,t+c-f],[d,t+c],[r,t+c-f]],a)]}case"loopLimit":{let f=Math.min(M(l,"size",20,0),s/2,c);return[H([[r+f,t],[r+s-f,t],[r+s,t+f],[r+s,t+c],[r,t+c],[r,t+f]],a)]}case"dataStorage":{let f=M(l,"size",0.1,0,1)*s;return[be(new L().moveTo(r+f,t).lineTo(r+s,t).quadTo(r+s-f*2,m,r+s,t+c).lineTo(r+f,t+c).quadTo(r-f,m,r+f,t).close(),a)]}case"orShape":case"or":case"xorShape":case"xor":{let f=Math.min(s,c)/2,x=n.startsWith("or")?new L().moveTo(d-f*0.707,m-f*0.707).lineTo(d+f*0.707,m+f*0.707).moveTo(d+f*0.707,m-f*0.707).lineTo(d-f*0.707,m+f*0.707):new L().moveTo(d-f,m).lineTo(d+f,m).moveTo(d,m-f).lineTo(d,m+f);return[S("ellipse",oe(a,{cx:d,cy:m,rx:s/2,ry:c/2})),fe(x,a)]}case"cross":case"plus":{let f=M(l,"size",0.2,0,1),x=s*(1-f)/2,p=c*(1-f)/2;return[H([[r+x,t],[r+s-x,t],[r+s-x,t+p],[r+s,t+p],[r+s,t+c-p],[r+s-x,t+c-p],[r+s-x,t+c],[r+x,t+c],[r+x,t+c-p],[r,t+c-p],[r,t+p],[r+x,t+p]],a)]}case"singleArrow":{let f=M(l,"arrowWidth",0.3,0,1),x=M(l,"arrowSize",0.2,0,1);return[H(Se([[0,0.5-f/2],[1-x,0.5-f/2],[1-x,0],[1,0.5],[1-x,1],[1-x,0.5+f/2],[0,0.5+f/2]],i,y),a)]}case"doubleArrow":{let f=M(l,"arrowWidth",0.3,0,1),x=M(l,"arrowSize",0.2,0,0.5);return[H(Se([[0,0.5],[x,0],[x,0.5-f/2],[1-x,0.5-f/2],[1-x,0],[1,0.5],[1-x,1],[1-x,0.5+f/2],[x,0.5+f/2],[x,1]],i,y),a)]}case"partialRectangle":{let f=[];if(a.fill!=="none")f.push(S("rect",oe({...a,stroke:"none"},{x:r,y:t,width:s,height:c})));let x=(T)=>l[T]!=="0",p=new L;if(x("top"))p.moveTo(r,t).lineTo(r+s,t);if(x("right"))p.moveTo(r+s,t).lineTo(r+s,t+c);if(x("bottom"))p.moveTo(r,t+c).lineTo(r+s,t+c);if(x("left"))p.moveTo(r,t).lineTo(r,t+c);if(p.toString())f.push(fe(p,a));return f}case"line":return[fe(l.direction==="south"||l.direction==="north"?new L().moveTo(d,t).lineTo(d,t+c):new L().moveTo(r,m).lineTo(r+s,m),a)];case"curlyBracket":return[fe(new L().moveTo(r+s,t).quadTo(r+s/2,t,r+s/2,t+c*0.1).lineTo(r+s/2,t+c*0.4).quadTo(r+s/2,m,r,m).quadTo(r+s/2,m,r+s/2,t+c*0.6).lineTo(r+s/2,t+c*0.9).quadTo(r+s/2,t+c,r+s,t+c),a)];case"annotation":return[fe(new L().moveTo(r+Math.min(20,s/3),t).lineTo(r,t).lineTo(r,t+c).lineTo(r+Math.min(20,s/3),t+c),a)];case"cube":{let f=Math.min(M(l,"size",20,0),s,c);return[H([[r,t+f],[r+f,t],[r+s,t],[r+s,t+c-f],[r+s-f,t+c],[r,t+c]],a),fe(new L().moveTo(r,t+f).lineTo(r+s-f,t+f).lineTo(r+s,t).moveTo(r+s-f,t+f).lineTo(r+s-f,t+c),a)]}case"component":case"module":{let f=[Ae({x:r+10,y:t,width:s-10,height:c},a,l)];return f.push(S("rect",oe(a,{x:r,y:t+c*0.25-5,width:20,height:10})),S("rect",oe(a,{x:r,y:t+c*0.65-5,width:20,height:10}))),f}case"umlLifeline":{let f=Math.min(M(l,"size",40,0),c);return[Ae({x:r,y:t,width:s,height:f},a,l),fe(new L().moveTo(d,t+f).lineTo(d,t+c),{...a,dash:a.dash??`${3*a.strokeWidth} ${3*a.strokeWidth}`})]}default:return[Ae(i,a,l)]}}function dt(n,i){let a=(i.split(".").pop()??i).replace(/[_-]+/g," ").replace(/([a-z])([A-Z])/g,"$1 $2").trim();return{shapes:[S("rect",{x:n.x,y:n.y,width:Math.max(0,n.width),height:Math.max(0,n.height),rx:4,fill:"none",stroke:"var(--drawio-placeholder, #9ca3af)","stroke-dasharray":"4 3","stroke-width":1})],name:a}}var wn=/^[\w\s,'"-]{1,80}$/;function vn(n){let i=2166136261;for(let a=0;a<n.length;a++)i^=n.charCodeAt(a),i=Math.imul(i,16777619);return`drawio-${(i>>>0).toString(36)}`}function bn(n,i){if(i===void 0)return{page:n.pages[0],index:0};let a=typeof i==="number"?i:n.pages.findIndex((r)=>r.id===i||r.name===i),l=n.pages[a];if(!l)throw new Q(`The file has no page "${i}"`,0,0,`It has: ${n.pages.map((r,t)=>r.name??`#${t}`).join(", ")}.`);return{page:l,index:a}}function Tn(n){if(!n)return;let i=n.trim();if(/^(?:https?:|mailto:)/i.test(i))return i;if(/^[a-z][a-z0-9+.-]*:/i.test(i))return;return i}function $n(n,i){if(!n)return;let a=n.trim(),l=/^data:image\/(png|jpe?g|gif|webp|svg\+xml)(;base64)?,(.*)$/is.exec(a);if(l){let r=l[3].replace(/\s/g,"");if(!l[2]&&/^[A-Za-z0-9+/]+=*$/.test(r)&&l[1]!=="svg+xml")return`data:image/${l[1]};base64,${r}`;return`data:image/${l[1]}${l[2]??""},${r}`}if(i&&/^https?:\/\//i.test(a))return a}function Tt(n,i={}){let a=typeof n==="string"?Ye(n,i):n,{page:l,index:r}=bn(a,i.page),t=i.measureText??Dt(),s=[],c=(i.idPrefix??vn(typeof n==="string"?n:`${l.id??""}/${r}`)).replace(/[^a-zA-Z0-9_-]/g,"-"),d=l.cells,m={minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0},y=(h,g,w=0,v=0)=>{if(!Number.isFinite(h)||!Number.isFinite(g))return;m.minX=Math.min(m.minX,h),m.minY=Math.min(m.minY,g),m.maxX=Math.max(m.maxX,h+w),m.maxY=Math.max(m.maxY,g+v)},f=(h)=>h.parent!==void 0&&h.parent===l.root,x=(h)=>{for(let g=h,w=!0;g;g=g.parent?d.get(g.parent):void 0,w=!1){if(!g.visible)return!1;if(!w&&g.collapsed&&g.vertex)return!1}return!0},p=(h)=>{let g=0,w=0;for(let v=h;v&&!f(v)&&v.id!==l.root;v=v.parent?d.get(v.parent):void 0)if(v.vertex&&v.geometry&&!v.geometry.relative)g+=v.geometry.x,w+=v.geometry.y;return{x:g,y:w}},T=(h)=>{if(!h.geometry||h.geometry.relative)return;let g=p(h.parent?d.get(h.parent):void 0);return{x:g.x+h.geometry.x,y:g.y+h.geometry.y,width:h.geometry.width,height:h.geometry.height}},k=(h)=>{let g=M(h,"fontStyle",0,0,255),w=h.fontFamily&&wn.test(h.fontFamily)?h.fontFamily:void 0;return{font:{size:M(h,"fontSize",12,1,200),family:w??"Helvetica, Arial, sans-serif",weight:g&1?"bold":"normal",style:g&2?"italic":"normal"},family:w?`${w}, Helvetica, Arial, sans-serif`:"",underline:(g&4)!==0}},C=(h)=>h.style.html==="1"?Zt(h.value):Ht(h.value),O=(h,g,w={})=>{if(!h.value||h.style.noLabel==="1")return null;let v=C(h);if(v.every((ne)=>ne.every((_e)=>!_e.text.trim())))return null;let{font:A,family:X,underline:I}=k(h.style),B=M(h.style,"spacing",2,0,200),Z=B+M(h.style,"spacingLeft",0,-200,200),ae=B+M(h.style,"spacingRight",0,-200,200),G=B+M(h.style,"spacingTop",0,-200,200),xe=B+M(h.style,"spacingBottom",0,-200,200);if(h.style.whiteSpace==="wrap"&&!w.point)v=Qt(v,Math.max(10,g.width-Z-ae),A,t);let pe=v.map((ne)=>Kt(ne,A)),q=pe.reduce((ne,_e)=>ne+_e,0),te=Math.max(0,...v.map((ne)=>Ke(ne,A,t))),z=w.point?"center":h.style.align??"center",Ce=w.point?"middle":h.style.verticalAlign??"middle",ye=z==="left"?g.x+Z:z==="right"?g.x+g.width-ae:g.x+g.width/2,Ie=Ce==="top"?g.y+G:Ce==="bottom"?g.y+g.height-xe-q:g.y+g.height/2-q/2,Ne=z==="left"?"start":z==="right"?"end":"middle",W=(ne)=>h.style[ne]!==void 0&&h.style[ne]!=="none"&&h.style[ne]!=="default",le=W("fillColor")||w.background!==void 0&&W("labelBackgroundColor"),he=ge(h.style,"fontColor",le?"#000000":Te("--drawio-text")),we=Ne==="start"?ye:Ne==="end"?ye-te:ye-te/2;y(we,Ie,te,q);let ce=Ie,ve=v.map((ne,_e)=>{let et=pe[_e],Mt=ce+et*0.78;ce+=et;let tt=ne.map((ue)=>ue.bold||ue.italic||ue.underline||ue.color||ue.size?S("tspan",{"font-weight":ue.bold?"bold":void 0,"font-style":ue.italic?"italic":void 0,"text-decoration":ue.underline?"underline":void 0,fill:ue.color,"font-size":ue.size},[Fe(ue.text)]):Fe(ue.text));return S("tspan",{x:ye,y:Mt},tt.length>0?tt:[Fe("")])}),Ue=S("text",{"text-anchor":Ne,"font-size":A.size,"font-family":X||void 0,"font-weight":A.weight==="bold"?"bold":void 0,"font-style":A.style==="italic"?"italic":void 0,"text-decoration":I?"underline":void 0,fill:he==="none"?"none":he},ve),Pe=w.background??ge(h.style,"labelBackgroundColor","none"),De=ge(h.style,"labelBorderColor","none"),He=[];if(Pe!=="none"||De!=="none")He.push(S("rect",{x:we-2,y:Ie-1,width:te+4,height:q+2,fill:Pe,stroke:De==="none"?void 0:De}));He.push(Ue);let Je=w.rotate;return S("g",{class:"drawio-label",transform:Je?`rotate(${Je} ${g.x+g.width/2} ${g.y+g.height/2})`:void 0},He)},R=(h,g)=>{let w=M(h,"strokeWidth",1,0,100),v=ge(h,"fillColor",Te("--drawio-fill")),A=ge(h,"gradientColor","none");if(v!=="none"&&A!=="none"){let B=`${c}-g${g.length}`,Z=h.gradientDirection??"south",[ae,G,xe,pe]=Z==="north"?[0,1,0,0]:Z==="east"?[0,0,1,0]:Z==="west"?[1,0,0,0]:[0,0,0,1];g.push(S("linearGradient",{id:B,x1:ae,y1:G,x2:xe,y2:pe},[S("stop",{offset:0,"stop-color":v}),S("stop",{offset:1,"stop-color":A})])),v=`url(#${B})`}let X=M(h,"fillOpacity",100,0,100),I=M(h,"strokeOpacity",100,0,100);return{fill:v,stroke:ge(h,"strokeColor",Te("--drawio-stroke")),strokeWidth:w,dash:nt(h,w),fillOpacity:X<100?X/100:void 0,strokeOpacity:I<100?I/100:void 0}},J=[],_=[],b=(h,g,w)=>{let v=M(h.style,"opacity",100,0,100),A=h.data.tooltip,X=S("g",{class:`drawio-${w}`,"data-cell-id":h.id,opacity:v<100?v/100:void 0},[A?S("title",{},[Fe(A)]):null,...g]),I=Tn(h.data.link);if(!I)return X;let B=/^https?:/i.test(I);return S("a",{href:I,target:B?"_blank":void 0,rel:B?"noopener noreferrer":void 0},[X])},E=(h)=>{let g=T(h);if(!g)return;let w=ht(h.style,h.names),v=[],A=R(h.style,J),X=M(h.style,"rotation",0,-360,360),I=[Ve(h.style,"flipH")?-1:1,Ve(h.style,"flipV")?-1:1],B=g.x+g.width/2,Z=g.y+g.height/2,ae=[X?`rotate(${X} ${B} ${Z})`:"",I[0]!==1||I[1]!==1?`translate(${B} ${Z}) scale(${I[0]} ${I[1]}) translate(${-B} ${-Z})`:""].filter(Boolean).join(" ")||void 0;y(g.x,g.y,g.width,g.height);let G={...g};if(h.style.labelPosition==="left")G.x-=g.width;else if(h.style.labelPosition==="right")G.x+=g.width;if(h.style.verticalLabelPosition==="top")G.y-=g.height;else if(h.style.verticalLabelPosition==="bottom")G.y+=g.height;let xe;if(w==="swimlane"||w==="table"){let q=M(h.style,"startSize",w==="table"?0:23,0,1e4),te=h.style.horizontal!=="0",z=te?{x:g.x,y:g.y,width:g.width,height:Math.min(q,g.height)}:{x:g.x,y:g.y,width:Math.min(q,g.width),height:g.height},Ce=ge(h.style,"swimlaneFillColor","none"),ye=h.style.rounded==="1"?Math.min(M(h.style,"arcSize",15,0,100)/100*Math.min(g.width,g.height),10):0;if(v.push(S("rect",{x:g.x,y:g.y,width:g.width,height:g.height,rx:ye||void 0,fill:Ce,stroke:A.stroke,"stroke-width":A.strokeWidth,"stroke-dasharray":A.dash})),v.push(S("rect",{x:z.x,y:z.y,width:z.width,height:z.height,rx:ye||void 0,fill:A.fill,stroke:A.stroke,"stroke-width":A.strokeWidth,"stroke-dasharray":A.dash})),G=z,!te)xe=-90;if(!te)G={x:z.x+z.width/2-z.height/2,y:z.y+z.height/2-z.width/2,width:z.height,height:z.width}}else if(w==="image"){let q=$n(h.style.image,i.allowExternalImages===!0);if(q)v.push(S("image",{href:q,x:g.x,y:g.y,width:g.width,height:g.height,preserveAspectRatio:h.style.imageAspect==="0"?"none":"xMidYMid meet"}));else{let te=dt(g,"image");v.push(...te.shapes),s.push(`The image of "${h.id}" is not embedded in the file and is not loaded`)}if(h.style.verticalLabelPosition===void 0)G={...g,y:g.y+g.height}}else if(!pn(w)){let q=dt(g,w);if(v.push(...q.shapes),s.push(`"${w}" is drawn as a placeholder`),!h.value){v.push(O({...h,value:q.name,style:{fontColor:Te("--drawio-placeholder"),fontSize:"11",whiteSpace:"wrap"},names:[]},g)),_.push(b(h,v,"vertex"));return}}else{let q=yn(w,g,A,h.style);v.push(ae&&q.length>0?S("g",{transform:ae},q):null,...ae?[]:q)}let pe=h.style.horizontal==="0"&&w!=="swimlane"?-90:void 0;v.push(O(h,G,{rotate:xe??pe??(X||void 0)})),_.push(b(h,v,"vertex"))},N=new Map,P=(h,g)=>{let w=h?d.get(h):void 0;if(!w||!w.vertex)return;let v=T(w);if(!v)return;return{bounds:v,shape:ht(w.style,w.names),port:g}},V=(h,g)=>{let w=h[`${g}X`],v=h[`${g}Y`];if(w===void 0||v===void 0)return;let A=Number(w),X=Number(v);return Number.isFinite(A)&&Number.isFinite(X)?{x:A,y:X}:void 0},re=(h)=>{let g=h.geometry,w=p(h.parent?d.get(h.parent):void 0),v=(W)=>({x:W.x+w.x,y:W.y+w.y}),A=P(h.source,V(h.style,"exit"))??(g?.sourcePoint?v(g.sourcePoint):void 0),X=P(h.target,V(h.style,"entry"))??(g?.targetPoint?v(g.targetPoint):void 0);if(!A||!X){s.push(`The connector "${h.id}" has no end to draw to`);return}let I=qt(A,X,(g?.points??[]).map(v),h.style);if(I.length<2)return;N.set(h.id,I);for(let W of I)y(W.x,W.y);let B=ge(h.style,"strokeColor",Te("--drawio-stroke")),Z=M(h.style,"strokeWidth",1,0,100),ae=h.style.endArrow??"classic",G=h.style.startArrow??"none",xe=M(h.style,"endSize",6,0,100),pe=M(h.style,"startSize",6,0,100),q=(W,le)=>{let he=Math.hypot(le.x-W.x,le.y-W.y)||1;return{x:(le.x-W.x)/he,y:(le.y-W.y)/he}},te=q(I[I.length-2],I[I.length-1]),z=q(I[1],I[0]),Ce=I[I.length-1],ye=I[0],Ie=(W,le,he,we)=>{if(he<=0)return W;let ce=W.map((De)=>({...De})),ve=we?ce.length-1:0,Ue=Math.hypot(ce[ve].x-ce[we?ve-1:1].x,ce[ve].y-ce[we?ve-1:1].y),Pe=Math.min(he,Ue);return ce[ve]={x:ce[ve].x-le.x*Pe,y:ce[ve].y-le.y*Pe},ce};I=Ie(I,te,ae==="none"?0:it(ae,xe)*0.9,!0),I=Ie(I,z,G==="none"?0:it(G,pe)*0.9,!1);let Ne=[S("path",{d:Yt(I,h.style),fill:"none",stroke:B,"stroke-width":Z,"stroke-dasharray":nt(h.style,Z),"stroke-linejoin":"round","stroke-opacity":M(h.style,"strokeOpacity",100,0,100)<100?M(h.style,"strokeOpacity",100,0,100)/100:void 0}),...B==="none"?[]:st(ae,Ce,te,xe,h.style.endFill!=="0",B,Z),...B==="none"?[]:st(G,ye,z,pe,h.style.startFill!=="0",B,Z)];if(h.value){let W=at(N.get(h.id),g?(g.x+1)/2:0.5),le=g?.offset??{x:0,y:0},he=g?.y??0,we={x:W.point.x+le.x-W.dir.y*he,y:W.point.y+le.y+W.dir.x*he};Ne.push(O(h,{x:we.x,y:we.y,width:0,height:0},{point:!0,background:ge(h.style,"labelBackgroundColor",Te("--drawio-label-background"))}))}_.push(b(h,Ne,"edge"))},U=(h,g)=>{let w=N.get(g.id);if(!w||!h.geometry)return;let v=at(w,(h.geometry.x+1)/2),A=h.geometry.offset??{x:0,y:0},X={x:v.point.x+A.x,y:v.point.y+A.y-h.geometry.y},I=ge(h.style,"labelBackgroundColor",h.names.includes("edgeLabel")?Te("--drawio-label-background"):"none");_.push(b(h,[O(h,{x:X.x,y:X.y,width:0,height:0},{point:!0,background:I})],"vertex"))};for(let h of l.order){if(h.id===l.root||f(h)||!x(h))continue;if(h.edge)re(h);else if(h.vertex){let g=h.parent?d.get(h.parent):void 0;if(g?.edge)U(h,g);else E(h)}}let ie=i.padding??10;if(!Number.isFinite(m.minX))m.minX=m.minY=m.maxX=m.maxY=0;let me=Math.floor(m.minX-ie),K=Math.floor(m.minY-ie),se=Math.ceil(m.maxX+ie)-me,j=Math.ceil(m.maxY+ie)-K,F=l.background&&l.background!=="none"?Be(l.background):void 0,ee=i.title??l.name??"Diagram";return{svg:gt(S("svg",{xmlns:"http://www.w3.org/2000/svg",id:c,class:"drawio",width:se,height:j,viewBox:`${me} ${K} ${se} ${j}`,role:"img","aria-labelledby":`${c}-title`,style:"max-width:100%;height:auto"},[S("title",{id:`${c}-title`},[Fe(ee)]),S("style",{},[Fe(Xt(c))]),J.length>0?S("defs",{},J):null,F?S("rect",{x:me,y:K,width:se,height:j,fill:F}):null,..._])),width:se,height:j,page:{index:r,id:l.id,name:l.name},pages:a.pages.map((h,g)=>h.name??`Page ${g+1}`),warnings:[...new Set(s)]}}function Mn(n){if(n instanceof Q){let i=n.line>0?` (line ${n.line}${n.column>0?`, column ${n.column}`:""})`:"";return`${n.message}${i}${n.hint?` — ${n.hint}`:""}`}return n instanceof Error?n.message:String(n)}function $t(n,i){try{let a=Ye(n);return{status:"ready",pages:a.pages.map((r,t)=>{let s=Tt(a,{page:t,padding:16,idPrefix:`${i}${t}-`});return{name:r.name||`Page ${t+1}`,svg:s.svg,width:s.width,height:s.height,warnings:s.warnings}})}}catch(a){return{status:"error",message:Mn(a)}}}function Pn({content:n,name:i}){let a=o("");if(!a.current)a.current=Yu();let l=u(()=>$t(n,a.current),[n]);if(l.status==="error")return e(Br,{name:i,message:l.message});let r=l.pages,t=r.length===1?`${r[0].name} · ${r[0].width} × ${r[0].height} px`:`${r.length} pages · ${r.map((s)=>s.name).join(", ")}`;return e(Om,{measureKey:r,caption:t,children:e("div",{className:"flex flex-col items-center gap-6 bg-paper p-6",children:r.map((s,c)=>e("figure",{className:"w-max",children:[r.length>1?e("figcaption",{className:"mb-2 text-center font-sans text-[11px] uppercase tracking-wide text-ink/40",children:s.name}):null,e("div",{className:"drawio-preview [&>svg]:block",role:"img","aria-label":s.name,style:{width:`${s.width}px`,height:`${s.height}px`},dangerouslySetInnerHTML:{__html:s.svg}}),s.warnings.length>0?e("ul",{className:"mx-auto mt-2 max-w-[80ch] space-y-0.5 text-center font-sans text-[10.5px] text-ink/40",children:s.warnings.map((d)=>e("li",{children:d},d))}):null]},`${c}-${s.name}`))})})}export{Pn as DrawioView};
5
+ `);return s=E+3,{kind:"cdata",value:N}}if(t.startsWith("<!DOCTYPE",s)||t.startsWith("<!ENTITY",s))y("Document type declarations are not accepted",s,"Remove the <!DOCTYPE …> line: draw.io files do not need it.");return null},C=(b,E)=>{if(E>r)y(`Elements are nested deeper than ${r} levels`);if(++c>l)y(`The file has more than ${l} elements`);let N=s;p("<");let P=f(),V=[];for(;;){let F=x();if(t.startsWith("/>",s)||t.startsWith(">",s))break;if(!F)y("A space is expected between attributes");let ee=s,h=f();x(),p("="),x();let g=t[s];if(g!=='"'&&g!=="'")y("An attribute value must be quoted");let w=t.indexOf(g,s+1);if(w<0)y("An attribute value is never closed");let v=T(t.slice(s+1,w),s+1,!0);if(s=w+1,V.some((A)=>A.name===h))y(`The attribute "${h}" is repeated`,ee);V.push({name:h,value:v,at:ee})}let re=b;for(let F of V)if(F.name==="xmlns"||F.name.startsWith("xmlns:")){if(re===b)re=new Map(b);let ee=F.name==="xmlns"?"":F.name.slice(6);if(ee&&F.value==="")y(`The prefix "${ee}" cannot be undeclared`,F.at);re.set(ee,F.value)}let U=(F,ee,h)=>{let g=F.indexOf(":");if(g<0)return{ns:h?"":re.get("")??"",local:F};let w=F.slice(0,g),v=F.slice(g+1);if(w==="xml")return{ns:ct,local:v};if(w==="xmlns")return{ns:ut,local:v};let A=re.get(w);if(A===void 0)y(`The prefix "${w}" is not declared`,ee,`Add xmlns:${w}="…" to the root element.`);return{ns:A,local:v}},ie=U(P,N+1,!1),me=V.map((F)=>{if(F.name==="xmlns")return{name:F.name,value:F.value,ns:ut,local:"xmlns"};return{name:F.name,value:F.value,...U(F.name,F.at,!0)}}),{line:K,column:se}=m(N),j={kind:"element",name:P,...ie,attributes:me,children:[],line:K,column:se};if(t.startsWith("/>",s))return s+=2,j;s+=1;for(;;){if(s>=t.length)y(`<${P}> is never closed`,N);let F=t.indexOf("<",s);if(F!==s){let h=F<0?t.length:F,g=t.slice(s,h);if(g.includes("]]>"))y('"]]>" is not allowed in text',s+g.indexOf("]]>"));j.children.push({kind:"text",value:T(g,s,!1)}),s=h;continue}if(t.startsWith("</",s)){s+=2;let h=f();if(h!==P)y(`</${h}> closes <${P}>`,s-h.length-2);return x(),p(">"),j}let ee=k(!0);if(ee){j.children.push(ee);continue}j.children.push(C(re,E+1))}},O=[],R=[],J=new Map([["xml",ct]]),_;for(;;){if(x(),s>=t.length)break;let b=k(!1);if(b){(_?R:O).push(b);continue}if(t[s]!=="<")y("Text is not allowed outside the root element");if(_)y("A document has one root element");_=C(J,1)}if(!_)y("The file has no XML element",0,"A draw.io file starts with <mxfile> or <mxGraphModel>.");return{prolog:O,root:_,epilog:R}}function D(n,i,a=""){for(let l of n.attributes)if(l.local===i&&l.ns===a)return l.value}function ke(n,i,a){let l=[];for(let r of n.children){if(r.kind!=="element")continue;if(i!==void 0&&r.ns!==i)continue;if(a!==void 0&&r.local!==a)continue;l.push(r)}return l}function vt(n){let i="";for(let a of n.children)if(a.kind==="text"||a.kind==="cdata")i+=a.value;else if(a.kind==="element")i+=vt(a);return i}function dn(n){let i={},a=[];for(let l of(n??"").split(";")){let r=l.trim();if(!r)continue;let t=r.indexOf("=");if(t<0)a.push(r);else i[r.slice(0,t).trim()]=r.slice(t+1).trim()}return{style:i,names:a}}function Le(n,i=0){let a=n===void 0?NaN:Number(n);return Number.isFinite(a)?a:i}function Xe(n){return{x:Le(D(n,"x")),y:Le(D(n,"y"))}}function mn(n){if(!n)return;let i={x:Le(D(n,"x")),y:Le(D(n,"y")),width:Le(D(n,"width")),height:Le(D(n,"height")),relative:D(n,"relative")==="1",points:[]};for(let a of ke(n)){let l=D(a,"as");if(a.local==="mxPoint"){if(l==="sourcePoint")i.sourcePoint=Xe(a);else if(l==="targetPoint")i.targetPoint=Xe(a);else if(l==="offset")i.offset=Xe(a)}else if(a.local==="Array"&&l==="points")i.points=ke(a,"","mxPoint").map(Xe)}return i}function Ze(n,i){let a=ke(n).find((s)=>s.local==="root"),l=new Map,r=[];for(let s of a?ke(a):[]){let c=s,d=D(s,"id"),m={},y=D(s,"value")??"";if(s.local==="UserObject"||s.local==="object"){c=ke(s).find((T)=>T.local==="mxCell")??s;for(let T of s.attributes)if(T.ns===""&&T.local!=="id")m[T.local]=T.value;if(y=m.label??"",delete m.label,m.placeholders==="1")y=y.replace(/%([\w.-]+)%/g,(T,k)=>m[k]??T)}else if(s.local!=="mxCell")continue;if(d??=D(c,"id"),!d)continue;let{style:f,names:x}=dn(D(c,"style")),p={id:d,parent:D(c,"parent"),value:y,style:f,names:x,vertex:D(c,"vertex")==="1",edge:D(c,"edge")==="1",source:D(c,"source"),target:D(c,"target"),visible:D(c,"visible")!=="0",collapsed:D(c,"collapsed")==="1",geometry:mn(ke(c).find((T)=>T.local==="mxGeometry")),data:m};l.set(d,p),r.push(p)}let t=r.find((s)=>s.parent===void 0)?.id;return{...i,cells:l,order:r,root:t,background:i.background??D(n,"background")}}function gn(n,i){let a=Qe(n.replace(/<!DOCTYPE\s+svg\s+PUBLIC\s+"[^"[\]]*"\s+"[^"[\]]*"\s*>/i,""),i.limits).root,l=D(a,"content");return l?Ye(l,i):void 0}function Ye(n,i={}){let a=n.replace(/^\uFEFF/,"").trimStart();if(/^(?:<\?xml[^>]*>\s*)?(?:<!--[\s\S]*?-->\s*)*(?:<!DOCTYPE\s+svg|<svg[\s>])/i.test(a)){let s=gn(a,i);if(!s)throw new Q("The SVG has no draw.io diagram in it",0,0,'Export from draw.io with "Include a copy of my diagram".');return s}let l=Qe(a,i.limits).root;if(l.local==="mxGraphModel")return{pages:[Ze(l,{})],meta:{}};if(l.local!=="mxfile")throw new Q(`<${l.name}> is not a draw.io file`,l.line,l.column,"A draw.io file starts with <mxfile> or <mxGraphModel>.");let r={};for(let s of["host","agent","version","type"]){let c=D(l,s);if(c)r[s]=c}let t=ke(l).filter((s)=>s.local==="diagram").map((s)=>{let c={id:D(s,"id"),name:D(s,"name")},d=ke(s).find((x)=>x.local==="mxGraphModel");if(d)return Ze(d,c);let m=vt(s).trim();if(!m)return{...c,cells:new Map,order:[]};let y;try{y=un(m,i.maxPageSize)}catch(x){throw new Q(`The page "${c.name??c.id??""}" cannot be read: ${x.message}`,s.line,s.column)}let f=Qe(y,i.limits).root;if(f.local!=="mxGraphModel")throw new Q(`The page "${c.name??""}" holds no diagram`,s.line,s.column);return Ze(f,c)});if(t.length===0)throw new Q("The file has no pages");return{pages:t,meta:r}}function oe(n,i={}){return{fill:n.fill,stroke:n.stroke,"stroke-width":n.stroke==="none"?void 0:n.strokeWidth,"stroke-dasharray":n.dash,"fill-opacity":n.fillOpacity,"stroke-opacity":n.strokeOpacity,"stroke-linejoin":"round",...i}}var be=(n,i,a={})=>S("path",oe(i,{d:n.toString(),...a})),fe=(n,i)=>S("path",oe({...i,fill:"none"},{d:n.toString()}));function H(n,i){let a=new L;return n.forEach(([l,r],t)=>t===0?a.moveTo(l,r):a.lineTo(l,r)),be(a.close(),i)}function Se(n,i,a){let{x:l,y:r,width:t,height:s}=i;switch(a){case"south":return n.map(([c,d])=>[l+(1-d)*t,r+c*s]);case"west":return n.map(([c,d])=>[l+(1-c)*t,r+(1-d)*s]);case"north":return n.map(([c,d])=>[l+d*t,r+(1-c)*s]);default:return n.map(([c,d])=>[l+c*t,r+d*s])}}function Ae(n,i,a){let l=a.rounded==="1",r=0;if(l){let t=M(a,"arcSize",a.absoluteArcSize==="1"?20:15,0,100);r=a.absoluteArcSize==="1"?t/2:Math.min(n.width,n.height)*t/100,r=Math.min(r,n.width/2,n.height/2)}return S("rect",oe(i,{x:n.x,y:n.y,width:Math.max(0,n.width),height:Math.max(0,n.height),rx:r||void 0}))}var xn={decision:"rhombus",process:"rectangle",terminator:"terminator",document:"document",multi_document:"document",data:"parallelogram",database:"cylinder",start_1:"ellipse",start_2:"ellipse",on_page_reference:"ellipse",off_page_reference:"offPageConnector",predefined_process:"process",manual_input:"manualInput",manual_operation:"trapezoid",delay:"delay",display:"display",preparation:"hexagon",stored_data:"dataStorage",internal_storage:"internalStorage",merge_or_storage:"triangleDown",extract_or_measurement:"triangleUp",or:"orShape",summing_function:"xorShape",card:"card",paper_tape:"tape",loop_limit:"loopLimit",annotation_1:"annotation",annotation_2:"annotation"};function ht(n,i){let a=n.shape;if(!a)a=i.find((l)=>bt.has(l)||l==="swimlane"||l==="text"||l==="group"||l==="image"||l==="edgeLabel")??"rectangle";if(a.startsWith("mxgraph.flowchart."))return xn[a.slice(18)]??"rectangle";if(a==="mxgraph.basic.rect"||a==="mxgraph.basic.patternFillRect")return"rectangle";if(a==="mxgraph.basic.oval")return"ellipse";if(a==="orEllipse")return"orShape";if(a==="sumEllipse")return"xorShape";if(a==="mxgraph.aws4.resourceIcon"||a==="mxgraph.aws4.productIcon")return n.resIcon??n.prIcon??a;return a}var bt=new Set(["rectangle","label","ellipse","doubleEllipse","rhombus","triangle","hexagon","parallelogram","trapezoid","cylinder","cylinder3","document","cloud","process","note","card","callout","actor","umlActor","step","tape","internalStorage","manualInput","delay","display","offPageConnector","dataStorage","orShape","xorShape","cross","singleArrow","doubleArrow","partialRectangle","line","terminator","triangleDown","triangleUp","loopLimit","annotation","table","tableRow","curlyBracket","or","xor","plus","link","lineEllipse","swimlane","text","image","group","edgeLabel","umlLifeline","module","component","folder","datastore","cube"]);function pn(n){return bt.has(n)}function yn(n,i,a,l){let{x:r,y:t,width:s,height:c}=i,d=r+s/2,m=t+c/2,y=l.direction;switch(n){case"rectangle":case"label":case"tableRow":case"table":return[Ae(i,a,l)];case"text":case"edgeLabel":case"group":return l.fillColor||l.strokeColor?[Ae(i,{...a,fill:l.fillColor?a.fill:"none",stroke:l.strokeColor?a.stroke:"none"},l)]:[];case"ellipse":return[S("ellipse",oe(a,{cx:d,cy:m,rx:s/2,ry:c/2}))];case"doubleEllipse":case"lineEllipse":{let f=Math.min(s,c)*0.1;return[S("ellipse",oe(a,{cx:d,cy:m,rx:s/2,ry:c/2})),S("ellipse",oe({...a,fill:"none"},{cx:d,cy:m,rx:Math.max(0,s/2-f),ry:Math.max(0,c/2-f)}))]}case"rhombus":return[H([[d,t],[r+s,m],[d,t+c],[r,m]],a)];case"triangle":return[H(Se([[0,0],[1,0.5],[0,1]],i,y),a)];case"triangleDown":return[H([[r,t],[r+s,t],[d,t+c]],a)];case"triangleUp":return[H([[d,t],[r+s,t+c],[r,t+c]],a)];case"hexagon":{let f=M(l,"size",0.25,0,0.5);return[H(Se([[f,0],[1-f,0],[1,0.5],[1-f,1],[f,1],[0,0.5]],i,y),a)]}case"parallelogram":{let f=M(l,"size",0.2,0,1);return[H(Se([[0,1],[f,0],[1,0],[1-f,1]],i,y),a)]}case"trapezoid":{let f=M(l,"size",0.2,0,0.5);return[H(Se([[0,1],[f,0],[1-f,0],[1,1]],i,y),a)]}case"manualInput":return[H([[r,t+Math.min(M(l,"size",30,0),c)],[r+s,t],[r+s,t+c],[r,t+c]],a)];case"cylinder":case"cylinder3":case"datastore":{let f=Math.min(n==="cylinder3"?M(l,"size",15,0):c*0.12,c/3),x=new L().moveTo(r,t+f).arcTo(s/2,f,0,!1,!0,r+s,t+f).lineTo(r+s,t+c-f).arcTo(s/2,f,0,!1,!0,r,t+c-f).close(),p=new L().moveTo(r,t+f).arcTo(s/2,f,0,!1,!1,r+s,t+f);return[be(x,a),fe(p,a)]}case"document":{let f=M(l,"size",0.3,0,1)*c*0.5;return[be(new L().moveTo(r,t).lineTo(r+s,t).lineTo(r+s,t+c-f/2).curveTo(r+s*0.75,t+c-f*1.5,r+s*0.25,t+c+f*0.5,r,t+c-f/2).close(),a)]}case"cloud":return[be(new L().moveTo(r+0.25*s,t+0.25*c).curveTo(r+0.05*s,t+0.25*c,r,t+0.5*c,r+0.16*s,t+0.55*c).curveTo(r,t+0.66*c,r+0.18*s,t+0.9*c,r+0.31*s,t+0.8*c).curveTo(r+0.4*s,t+c,r+0.7*s,t+c,r+0.8*s,t+0.8*c).curveTo(r+s,t+0.8*c,r+s,t+0.6*c,r+0.875*s,t+0.5*c).curveTo(r+s,t+0.3*c,r+0.8*s,t+0.1*c,r+0.625*s,t+0.2*c).curveTo(r+0.5*s,t+0.05*c,r+0.3*s,t+0.05*c,r+0.25*s,t+0.25*c).close(),a)];case"process":{let f=M(l,"size",0.1,0,0.5)*s;return[Ae(i,a,l),fe(new L().moveTo(r+f,t).lineTo(r+f,t+c).moveTo(r+s-f,t).lineTo(r+s-f,t+c),a)]}case"note":{let f=Math.min(M(l,"size",30,0),s,c);return[H([[r,t],[r+s-f,t],[r+s,t+f],[r+s,t+c],[r,t+c]],a),fe(new L().moveTo(r+s-f,t).lineTo(r+s-f,t+f).lineTo(r+s,t+f),a)]}case"card":{let f=Math.min(M(l,"size",15,0),s,c);return[H([[r+f,t],[r+s,t],[r+s,t+c],[r,t+c],[r,t+f]],a)]}case"folder":{let f=Math.min(M(l,"tabWidth",50,0),s),x=Math.min(M(l,"tabHeight",20,0),c);return[H([[r,t],[r+f,t],[r+f,t+x],[r+s,t+x],[r+s,t+c],[r,t+c]],a)]}case"callout":{let f=Math.min(M(l,"size",30,0),c),x=M(l,"base",20,0),p=r+s*M(l,"position",0.5,0,1);return[H([[r,t],[r+s,t],[r+s,t+c-f],[p+x/2,t+c-f],[p,t+c],[p-x/2,t+c-f],[r,t+c-f]],a)]}case"actor":return[be(new L().moveTo(r,t+c).curveTo(r,t+c*0.6,r+s*0.3,t+c*0.55,r+s*0.5,t+c*0.55).curveTo(r+s*0.7,t+c*0.55,r+s,t+c*0.6,r+s,t+c).close(),a),S("ellipse",oe(a,{cx:d,cy:t+c*0.25,rx:s*0.22,ry:c*0.25}))];case"umlActor":{let f=Math.min(s,c/4)/2,x=new L().moveTo(d,t+f*2).lineTo(d,t+c*0.65).moveTo(r,t+c*0.35).lineTo(r+s,t+c*0.35).moveTo(r,t+c).lineTo(d,t+c*0.65).lineTo(r+s,t+c);return[S("ellipse",oe(a,{cx:d,cy:t+f,rx:f,ry:f})),fe(x,a)]}case"step":{let f=M(l,"size",0.2,0,1)*s;return[H(Se([[0,0],[1-f/s,0],[1,0.5],[1-f/s,1],[0,1],[f/s,0.5]],i,y),a)]}case"tape":{let f=M(l,"size",0.4,0,1)*c*0.25;return[be(new L().moveTo(r,t+f).quadTo(r+s/4,t-f,r+s/2,t+f).quadTo(r+3*s/4,t+3*f,r+s,t+f).lineTo(r+s,t+c-f).quadTo(r+3*s/4,t+c-3*f,r+s/2,t+c-f).quadTo(r+s/4,t+c+f,r,t+c-f).close(),a)]}case"internalStorage":{let f=M(l,"dx",20,0),x=M(l,"dy",20,0);return[Ae(i,a,l),fe(new L().moveTo(r+f,t).lineTo(r+f,t+c).moveTo(r,t+x).lineTo(r+s,t+x),a)]}case"delay":return[be(new L().moveTo(r,t).lineTo(r+s-c/2,t).arcTo(c/2,c/2,0,!1,!0,r+s-c/2,t+c).lineTo(r,t+c).close(),a)];case"display":{let f=s*0.25;return[be(new L().moveTo(r+f,t).lineTo(r+s-c/2,t).arcTo(c/2,c/2,0,!1,!0,r+s-c/2,t+c).lineTo(r+f,t+c).lineTo(r,m).close(),a)]}case"terminator":return[S("rect",oe(a,{x:r,y:t,width:s,height:c,rx:Math.min(c/2,s/2)}))];case"offPageConnector":{let f=M(l,"size",0.375,0,1)*c;return[H([[r,t],[r+s,t],[r+s,t+c-f],[d,t+c],[r,t+c-f]],a)]}case"loopLimit":{let f=Math.min(M(l,"size",20,0),s/2,c);return[H([[r+f,t],[r+s-f,t],[r+s,t+f],[r+s,t+c],[r,t+c],[r,t+f]],a)]}case"dataStorage":{let f=M(l,"size",0.1,0,1)*s;return[be(new L().moveTo(r+f,t).lineTo(r+s,t).quadTo(r+s-f*2,m,r+s,t+c).lineTo(r+f,t+c).quadTo(r-f,m,r+f,t).close(),a)]}case"orShape":case"or":case"xorShape":case"xor":{let f=Math.min(s,c)/2,x=n.startsWith("or")?new L().moveTo(d-f*0.707,m-f*0.707).lineTo(d+f*0.707,m+f*0.707).moveTo(d+f*0.707,m-f*0.707).lineTo(d-f*0.707,m+f*0.707):new L().moveTo(d-f,m).lineTo(d+f,m).moveTo(d,m-f).lineTo(d,m+f);return[S("ellipse",oe(a,{cx:d,cy:m,rx:s/2,ry:c/2})),fe(x,a)]}case"cross":case"plus":{let f=M(l,"size",0.2,0,1),x=s*(1-f)/2,p=c*(1-f)/2;return[H([[r+x,t],[r+s-x,t],[r+s-x,t+p],[r+s,t+p],[r+s,t+c-p],[r+s-x,t+c-p],[r+s-x,t+c],[r+x,t+c],[r+x,t+c-p],[r,t+c-p],[r,t+p],[r+x,t+p]],a)]}case"singleArrow":{let f=M(l,"arrowWidth",0.3,0,1),x=M(l,"arrowSize",0.2,0,1);return[H(Se([[0,0.5-f/2],[1-x,0.5-f/2],[1-x,0],[1,0.5],[1-x,1],[1-x,0.5+f/2],[0,0.5+f/2]],i,y),a)]}case"doubleArrow":{let f=M(l,"arrowWidth",0.3,0,1),x=M(l,"arrowSize",0.2,0,0.5);return[H(Se([[0,0.5],[x,0],[x,0.5-f/2],[1-x,0.5-f/2],[1-x,0],[1,0.5],[1-x,1],[1-x,0.5+f/2],[x,0.5+f/2],[x,1]],i,y),a)]}case"partialRectangle":{let f=[];if(a.fill!=="none")f.push(S("rect",oe({...a,stroke:"none"},{x:r,y:t,width:s,height:c})));let x=(T)=>l[T]!=="0",p=new L;if(x("top"))p.moveTo(r,t).lineTo(r+s,t);if(x("right"))p.moveTo(r+s,t).lineTo(r+s,t+c);if(x("bottom"))p.moveTo(r,t+c).lineTo(r+s,t+c);if(x("left"))p.moveTo(r,t).lineTo(r,t+c);if(p.toString())f.push(fe(p,a));return f}case"line":return[fe(l.direction==="south"||l.direction==="north"?new L().moveTo(d,t).lineTo(d,t+c):new L().moveTo(r,m).lineTo(r+s,m),a)];case"curlyBracket":return[fe(new L().moveTo(r+s,t).quadTo(r+s/2,t,r+s/2,t+c*0.1).lineTo(r+s/2,t+c*0.4).quadTo(r+s/2,m,r,m).quadTo(r+s/2,m,r+s/2,t+c*0.6).lineTo(r+s/2,t+c*0.9).quadTo(r+s/2,t+c,r+s,t+c),a)];case"annotation":return[fe(new L().moveTo(r+Math.min(20,s/3),t).lineTo(r,t).lineTo(r,t+c).lineTo(r+Math.min(20,s/3),t+c),a)];case"cube":{let f=Math.min(M(l,"size",20,0),s,c);return[H([[r,t+f],[r+f,t],[r+s,t],[r+s,t+c-f],[r+s-f,t+c],[r,t+c]],a),fe(new L().moveTo(r,t+f).lineTo(r+s-f,t+f).lineTo(r+s,t).moveTo(r+s-f,t+f).lineTo(r+s-f,t+c),a)]}case"component":case"module":{let f=[Ae({x:r+10,y:t,width:s-10,height:c},a,l)];return f.push(S("rect",oe(a,{x:r,y:t+c*0.25-5,width:20,height:10})),S("rect",oe(a,{x:r,y:t+c*0.65-5,width:20,height:10}))),f}case"umlLifeline":{let f=Math.min(M(l,"size",40,0),c);return[Ae({x:r,y:t,width:s,height:f},a,l),fe(new L().moveTo(d,t+f).lineTo(d,t+c),{...a,dash:a.dash??`${3*a.strokeWidth} ${3*a.strokeWidth}`})]}default:return[Ae(i,a,l)]}}function dt(n,i){let a=(i.split(".").pop()??i).replace(/[_-]+/g," ").replace(/([a-z])([A-Z])/g,"$1 $2").trim();return{shapes:[S("rect",{x:n.x,y:n.y,width:Math.max(0,n.width),height:Math.max(0,n.height),rx:4,fill:"none",stroke:"var(--drawio-placeholder, #9ca3af)","stroke-dasharray":"4 3","stroke-width":1})],name:a}}var wn=/^[\w\s,'"-]{1,80}$/;function vn(n){let i=2166136261;for(let a=0;a<n.length;a++)i^=n.charCodeAt(a),i=Math.imul(i,16777619);return`drawio-${(i>>>0).toString(36)}`}function bn(n,i){if(i===void 0)return{page:n.pages[0],index:0};let a=typeof i==="number"?i:n.pages.findIndex((r)=>r.id===i||r.name===i),l=n.pages[a];if(!l)throw new Q(`The file has no page "${i}"`,0,0,`It has: ${n.pages.map((r,t)=>r.name??`#${t}`).join(", ")}.`);return{page:l,index:a}}function Tn(n){if(!n)return;let i=n.trim();if(/^(?:https?:|mailto:)/i.test(i))return i;if(/^[a-z][a-z0-9+.-]*:/i.test(i))return;return i}function $n(n,i){if(!n)return;let a=n.trim(),l=/^data:image\/(png|jpe?g|gif|webp|svg\+xml)(;base64)?,(.*)$/is.exec(a);if(l){let r=l[3].replace(/\s/g,"");if(!l[2]&&/^[A-Za-z0-9+/]+=*$/.test(r)&&l[1]!=="svg+xml")return`data:image/${l[1]};base64,${r}`;return`data:image/${l[1]}${l[2]??""},${r}`}if(i&&/^https?:\/\//i.test(a))return a}function Tt(n,i={}){let a=typeof n==="string"?Ye(n,i):n,{page:l,index:r}=bn(a,i.page),t=i.measureText??Dt(),s=[],c=(i.idPrefix??vn(typeof n==="string"?n:`${l.id??""}/${r}`)).replace(/[^a-zA-Z0-9_-]/g,"-"),d=l.cells,m={minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0},y=(h,g,w=0,v=0)=>{if(!Number.isFinite(h)||!Number.isFinite(g))return;m.minX=Math.min(m.minX,h),m.minY=Math.min(m.minY,g),m.maxX=Math.max(m.maxX,h+w),m.maxY=Math.max(m.maxY,g+v)},f=(h)=>h.parent!==void 0&&h.parent===l.root,x=(h)=>{for(let g=h,w=!0;g;g=g.parent?d.get(g.parent):void 0,w=!1){if(!g.visible)return!1;if(!w&&g.collapsed&&g.vertex)return!1}return!0},p=(h)=>{let g=0,w=0;for(let v=h;v&&!f(v)&&v.id!==l.root;v=v.parent?d.get(v.parent):void 0)if(v.vertex&&v.geometry&&!v.geometry.relative)g+=v.geometry.x,w+=v.geometry.y;return{x:g,y:w}},T=(h)=>{if(!h.geometry||h.geometry.relative)return;let g=p(h.parent?d.get(h.parent):void 0);return{x:g.x+h.geometry.x,y:g.y+h.geometry.y,width:h.geometry.width,height:h.geometry.height}},k=(h)=>{let g=M(h,"fontStyle",0,0,255),w=h.fontFamily&&wn.test(h.fontFamily)?h.fontFamily:void 0;return{font:{size:M(h,"fontSize",12,1,200),family:w??"Helvetica, Arial, sans-serif",weight:g&1?"bold":"normal",style:g&2?"italic":"normal"},family:w?`${w}, Helvetica, Arial, sans-serif`:"",underline:(g&4)!==0}},C=(h)=>h.style.html==="1"?Zt(h.value):Ht(h.value),O=(h,g,w={})=>{if(!h.value||h.style.noLabel==="1")return null;let v=C(h);if(v.every((ne)=>ne.every((_e)=>!_e.text.trim())))return null;let{font:A,family:X,underline:I}=k(h.style),B=M(h.style,"spacing",2,0,200),Z=B+M(h.style,"spacingLeft",0,-200,200),ae=B+M(h.style,"spacingRight",0,-200,200),G=B+M(h.style,"spacingTop",0,-200,200),xe=B+M(h.style,"spacingBottom",0,-200,200);if(h.style.whiteSpace==="wrap"&&!w.point)v=Qt(v,Math.max(10,g.width-Z-ae),A,t);let pe=v.map((ne)=>Kt(ne,A)),q=pe.reduce((ne,_e)=>ne+_e,0),te=Math.max(0,...v.map((ne)=>Ke(ne,A,t))),z=w.point?"center":h.style.align??"center",Ce=w.point?"middle":h.style.verticalAlign??"middle",ye=z==="left"?g.x+Z:z==="right"?g.x+g.width-ae:g.x+g.width/2,Ie=Ce==="top"?g.y+G:Ce==="bottom"?g.y+g.height-xe-q:g.y+g.height/2-q/2,Ne=z==="left"?"start":z==="right"?"end":"middle",W=(ne)=>h.style[ne]!==void 0&&h.style[ne]!=="none"&&h.style[ne]!=="default",le=W("fillColor")||w.background!==void 0&&W("labelBackgroundColor"),he=ge(h.style,"fontColor",le?"#000000":Te("--drawio-text")),we=Ne==="start"?ye:Ne==="end"?ye-te:ye-te/2;y(we,Ie,te,q);let ce=Ie,ve=v.map((ne,_e)=>{let et=pe[_e],Mt=ce+et*0.78;ce+=et;let tt=ne.map((ue)=>ue.bold||ue.italic||ue.underline||ue.color||ue.size?S("tspan",{"font-weight":ue.bold?"bold":void 0,"font-style":ue.italic?"italic":void 0,"text-decoration":ue.underline?"underline":void 0,fill:ue.color,"font-size":ue.size},[Fe(ue.text)]):Fe(ue.text));return S("tspan",{x:ye,y:Mt},tt.length>0?tt:[Fe("")])}),Ue=S("text",{"text-anchor":Ne,"font-size":A.size,"font-family":X||void 0,"font-weight":A.weight==="bold"?"bold":void 0,"font-style":A.style==="italic"?"italic":void 0,"text-decoration":I?"underline":void 0,fill:he==="none"?"none":he},ve),Pe=w.background??ge(h.style,"labelBackgroundColor","none"),De=ge(h.style,"labelBorderColor","none"),He=[];if(Pe!=="none"||De!=="none")He.push(S("rect",{x:we-2,y:Ie-1,width:te+4,height:q+2,fill:Pe,stroke:De==="none"?void 0:De}));He.push(Ue);let Je=w.rotate;return S("g",{class:"drawio-label",transform:Je?`rotate(${Je} ${g.x+g.width/2} ${g.y+g.height/2})`:void 0},He)},R=(h,g)=>{let w=M(h,"strokeWidth",1,0,100),v=ge(h,"fillColor",Te("--drawio-fill")),A=ge(h,"gradientColor","none");if(v!=="none"&&A!=="none"){let B=`${c}-g${g.length}`,Z=h.gradientDirection??"south",[ae,G,xe,pe]=Z==="north"?[0,1,0,0]:Z==="east"?[0,0,1,0]:Z==="west"?[1,0,0,0]:[0,0,0,1];g.push(S("linearGradient",{id:B,x1:ae,y1:G,x2:xe,y2:pe},[S("stop",{offset:0,"stop-color":v}),S("stop",{offset:1,"stop-color":A})])),v=`url(#${B})`}let X=M(h,"fillOpacity",100,0,100),I=M(h,"strokeOpacity",100,0,100);return{fill:v,stroke:ge(h,"strokeColor",Te("--drawio-stroke")),strokeWidth:w,dash:nt(h,w),fillOpacity:X<100?X/100:void 0,strokeOpacity:I<100?I/100:void 0}},J=[],_=[],b=(h,g,w)=>{let v=M(h.style,"opacity",100,0,100),A=h.data.tooltip,X=S("g",{class:`drawio-${w}`,"data-cell-id":h.id,opacity:v<100?v/100:void 0},[A?S("title",{},[Fe(A)]):null,...g]),I=Tn(h.data.link);if(!I)return X;let B=/^https?:/i.test(I);return S("a",{href:I,target:B?"_blank":void 0,rel:B?"noopener noreferrer":void 0},[X])},E=(h)=>{let g=T(h);if(!g)return;let w=ht(h.style,h.names),v=[],A=R(h.style,J),X=M(h.style,"rotation",0,-360,360),I=[Ve(h.style,"flipH")?-1:1,Ve(h.style,"flipV")?-1:1],B=g.x+g.width/2,Z=g.y+g.height/2,ae=[X?`rotate(${X} ${B} ${Z})`:"",I[0]!==1||I[1]!==1?`translate(${B} ${Z}) scale(${I[0]} ${I[1]}) translate(${-B} ${-Z})`:""].filter(Boolean).join(" ")||void 0;y(g.x,g.y,g.width,g.height);let G={...g};if(h.style.labelPosition==="left")G.x-=g.width;else if(h.style.labelPosition==="right")G.x+=g.width;if(h.style.verticalLabelPosition==="top")G.y-=g.height;else if(h.style.verticalLabelPosition==="bottom")G.y+=g.height;let xe;if(w==="swimlane"||w==="table"){let q=M(h.style,"startSize",w==="table"?0:23,0,1e4),te=h.style.horizontal!=="0",z=te?{x:g.x,y:g.y,width:g.width,height:Math.min(q,g.height)}:{x:g.x,y:g.y,width:Math.min(q,g.width),height:g.height},Ce=ge(h.style,"swimlaneFillColor","none"),ye=h.style.rounded==="1"?Math.min(M(h.style,"arcSize",15,0,100)/100*Math.min(g.width,g.height),10):0;if(v.push(S("rect",{x:g.x,y:g.y,width:g.width,height:g.height,rx:ye||void 0,fill:Ce,stroke:A.stroke,"stroke-width":A.strokeWidth,"stroke-dasharray":A.dash})),v.push(S("rect",{x:z.x,y:z.y,width:z.width,height:z.height,rx:ye||void 0,fill:A.fill,stroke:A.stroke,"stroke-width":A.strokeWidth,"stroke-dasharray":A.dash})),G=z,!te)xe=-90;if(!te)G={x:z.x+z.width/2-z.height/2,y:z.y+z.height/2-z.width/2,width:z.height,height:z.width}}else if(w==="image"){let q=$n(h.style.image,i.allowExternalImages===!0);if(q)v.push(S("image",{href:q,x:g.x,y:g.y,width:g.width,height:g.height,preserveAspectRatio:h.style.imageAspect==="0"?"none":"xMidYMid meet"}));else{let te=dt(g,"image");v.push(...te.shapes),s.push(`The image of "${h.id}" is not embedded in the file and is not loaded`)}if(h.style.verticalLabelPosition===void 0)G={...g,y:g.y+g.height}}else if(!pn(w)){let q=dt(g,w);if(v.push(...q.shapes),s.push(`"${w}" is drawn as a placeholder`),!h.value){v.push(O({...h,value:q.name,style:{fontColor:Te("--drawio-placeholder"),fontSize:"11",whiteSpace:"wrap"},names:[]},g)),_.push(b(h,v,"vertex"));return}}else{let q=yn(w,g,A,h.style);v.push(ae&&q.length>0?S("g",{transform:ae},q):null,...ae?[]:q)}let pe=h.style.horizontal==="0"&&w!=="swimlane"?-90:void 0;v.push(O(h,G,{rotate:xe??pe??(X||void 0)})),_.push(b(h,v,"vertex"))},N=new Map,P=(h,g)=>{let w=h?d.get(h):void 0;if(!w||!w.vertex)return;let v=T(w);if(!v)return;return{bounds:v,shape:ht(w.style,w.names),port:g}},V=(h,g)=>{let w=h[`${g}X`],v=h[`${g}Y`];if(w===void 0||v===void 0)return;let A=Number(w),X=Number(v);return Number.isFinite(A)&&Number.isFinite(X)?{x:A,y:X}:void 0},re=(h)=>{let g=h.geometry,w=p(h.parent?d.get(h.parent):void 0),v=(W)=>({x:W.x+w.x,y:W.y+w.y}),A=P(h.source,V(h.style,"exit"))??(g?.sourcePoint?v(g.sourcePoint):void 0),X=P(h.target,V(h.style,"entry"))??(g?.targetPoint?v(g.targetPoint):void 0);if(!A||!X){s.push(`The connector "${h.id}" has no end to draw to`);return}let I=qt(A,X,(g?.points??[]).map(v),h.style);if(I.length<2)return;N.set(h.id,I);for(let W of I)y(W.x,W.y);let B=ge(h.style,"strokeColor",Te("--drawio-stroke")),Z=M(h.style,"strokeWidth",1,0,100),ae=h.style.endArrow??"classic",G=h.style.startArrow??"none",xe=M(h.style,"endSize",6,0,100),pe=M(h.style,"startSize",6,0,100),q=(W,le)=>{let he=Math.hypot(le.x-W.x,le.y-W.y)||1;return{x:(le.x-W.x)/he,y:(le.y-W.y)/he}},te=q(I[I.length-2],I[I.length-1]),z=q(I[1],I[0]),Ce=I[I.length-1],ye=I[0],Ie=(W,le,he,we)=>{if(he<=0)return W;let ce=W.map((De)=>({...De})),ve=we?ce.length-1:0,Ue=Math.hypot(ce[ve].x-ce[we?ve-1:1].x,ce[ve].y-ce[we?ve-1:1].y),Pe=Math.min(he,Ue);return ce[ve]={x:ce[ve].x-le.x*Pe,y:ce[ve].y-le.y*Pe},ce};I=Ie(I,te,ae==="none"?0:it(ae,xe)*0.9,!0),I=Ie(I,z,G==="none"?0:it(G,pe)*0.9,!1);let Ne=[S("path",{d:Yt(I,h.style),fill:"none",stroke:B,"stroke-width":Z,"stroke-dasharray":nt(h.style,Z),"stroke-linejoin":"round","stroke-opacity":M(h.style,"strokeOpacity",100,0,100)<100?M(h.style,"strokeOpacity",100,0,100)/100:void 0}),...B==="none"?[]:st(ae,Ce,te,xe,h.style.endFill!=="0",B,Z),...B==="none"?[]:st(G,ye,z,pe,h.style.startFill!=="0",B,Z)];if(h.value){let W=at(N.get(h.id),g?(g.x+1)/2:0.5),le=g?.offset??{x:0,y:0},he=g?.y??0,we={x:W.point.x+le.x-W.dir.y*he,y:W.point.y+le.y+W.dir.x*he};Ne.push(O(h,{x:we.x,y:we.y,width:0,height:0},{point:!0,background:ge(h.style,"labelBackgroundColor",Te("--drawio-label-background"))}))}_.push(b(h,Ne,"edge"))},U=(h,g)=>{let w=N.get(g.id);if(!w||!h.geometry)return;let v=at(w,(h.geometry.x+1)/2),A=h.geometry.offset??{x:0,y:0},X={x:v.point.x+A.x,y:v.point.y+A.y-h.geometry.y},I=ge(h.style,"labelBackgroundColor",h.names.includes("edgeLabel")?Te("--drawio-label-background"):"none");_.push(b(h,[O(h,{x:X.x,y:X.y,width:0,height:0},{point:!0,background:I})],"vertex"))};for(let h of l.order){if(h.id===l.root||f(h)||!x(h))continue;if(h.edge)re(h);else if(h.vertex){let g=h.parent?d.get(h.parent):void 0;if(g?.edge)U(h,g);else E(h)}}let ie=i.padding??10;if(!Number.isFinite(m.minX))m.minX=m.minY=m.maxX=m.maxY=0;let me=Math.floor(m.minX-ie),K=Math.floor(m.minY-ie),se=Math.ceil(m.maxX+ie)-me,j=Math.ceil(m.maxY+ie)-K,F=l.background&&l.background!=="none"?Be(l.background):void 0,ee=i.title??l.name??"Diagram";return{svg:gt(S("svg",{xmlns:"http://www.w3.org/2000/svg",id:c,class:"drawio",width:se,height:j,viewBox:`${me} ${K} ${se} ${j}`,role:"img","aria-labelledby":`${c}-title`,style:"max-width:100%;height:auto"},[S("title",{id:`${c}-title`},[Fe(ee)]),S("style",{},[Fe(Xt(c))]),J.length>0?S("defs",{},J):null,F?S("rect",{x:me,y:K,width:se,height:j,fill:F}):null,..._])),width:se,height:j,page:{index:r,id:l.id,name:l.name},pages:a.pages.map((h,g)=>h.name??`Page ${g+1}`),warnings:[...new Set(s)]}}function Mn(n){if(n instanceof Q){let i=n.line>0?` (line ${n.line}${n.column>0?`, column ${n.column}`:""})`:"";return`${n.message}${i}${n.hint?` — ${n.hint}`:""}`}return n instanceof Error?n.message:String(n)}function $t(n,i){try{let a=Ye(n);return{status:"ready",pages:a.pages.map((r,t)=>{let s=Tt(a,{page:t,padding:16,idPrefix:`${i}${t}-`});return{name:r.name||`Page ${t+1}`,svg:s.svg,width:s.width,height:s.height,warnings:s.warnings}})}}catch(a){return{status:"error",message:Mn(a)}}}function Pn({content:n,name:i}){let a=o("");if(!a.current)a.current=Ju();let l=u(()=>$t(n,a.current),[n]);if(l.status==="error")return e(Br,{name:i,message:l.message});let r=l.pages,t=r.length===1?`${r[0].name} · ${r[0].width} × ${r[0].height} px`:`${r.length} pages · ${r.map((s)=>s.name).join(", ")}`;return e($m,{measureKey:r,caption:t,children:e("div",{className:"flex flex-col items-center gap-6 bg-paper p-6",children:r.map((s,c)=>e("figure",{className:"w-max",children:[r.length>1?e("figcaption",{className:"mb-2 text-center font-sans text-[11px] uppercase tracking-wide text-ink/40",children:s.name}):null,e("div",{className:"drawio-preview [&>svg]:block",role:"img","aria-label":s.name,style:{width:`${s.width}px`,height:`${s.height}px`},dangerouslySetInnerHTML:{__html:s.svg}}),s.warnings.length>0?e("ul",{className:"mx-auto mt-2 max-w-[80ch] space-y-0.5 text-center font-sans text-[10.5px] text-ink/40",children:s.warnings.map((d)=>e("li",{children:d},d))}):null]},`${c}-${s.name}`))})})}export{Pn as DrawioView};
@@ -1 +1 @@
1
- import{e,m,Ri,Br}from"./index-4s8ttfxj.js";import{Tc}from"./index-kg86e3sy.js";function g({source:t,name:r,revision:s=0}){let{url:i,loading:n,error:o}=Tc(t,s);if(o)return e(Br,{name:r,message:o});if(n||!i)return e("div",{className:"flex flex-1 items-center justify-center gap-2 text-xs text-ink/40",children:[e(m,{size:14,className:"animate-spin"}),e("span",{children:"Loading image…"})]});return e(Ri,{src:i,name:r,className:"flex-1 min-h-0"})}export{g as ImageView};
1
+ import{e,m,Ri,Br}from"./index-zt75xpq0.js";import{Dc}from"./index-sffjtm5w.js";function g({source:t,name:r,revision:s=0}){let{url:i,loading:n,error:o}=Dc(t,s);if(o)return e(Br,{name:r,message:o});if(n||!i)return e("div",{className:"flex flex-1 items-center justify-center gap-2 text-xs text-ink/40",children:[e(m,{size:14,className:"animate-spin"}),e("span",{children:"Loading image…"})]});return e(Ri,{src:i,name:r,className:"flex-1 min-h-0"})}export{g as ImageView};