@kern0x1b/penstock-cli 26.11.0 → 26.11.2

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 (302) hide show
  1. package/THIRD-PARTY-NOTICES.md +16 -16
  2. package/dist/chunk-account-BaYNvO18.js +1 -0
  3. package/dist/{chunk-agentLaunch-D21uPuMr.js → chunk-agentLaunch-BnrpVME4.js} +1 -1
  4. package/dist/chunk-agentServe-BeOh1rjE.js +10 -0
  5. package/dist/chunk-agents-CZJoU2u2.js +1 -0
  6. package/dist/chunk-agentsMigrate-DnrqoXNz.js +2 -0
  7. package/dist/{chunk-analyze-BG-rlggA.js → chunk-analyze-ClE2LBCj.js} +1 -1
  8. package/dist/chunk-analyze-DgQqzEgb.js +1 -0
  9. package/dist/{chunk-analyzeFlow-2cYPgjh-.js → chunk-analyzeFlow-F2ZFmJhv.js} +1 -1
  10. package/dist/chunk-apiTemplates-Cl_z63FA.js +1 -0
  11. package/dist/{chunk-bot-DlhStBoG.js → chunk-bot-C2k8yaXA.js} +5 -5
  12. package/dist/chunk-cmmnFindings-DKpYqUZN.js +1 -0
  13. package/dist/{chunk-codeFactSet-LxSnQy8K.js → chunk-codeFactSet-DiAYqvbb.js} +1 -1
  14. package/dist/{chunk-codeIndex-N1gnP_sW.js → chunk-codeIndex-vStNh6Bm.js} +1 -1
  15. package/dist/chunk-codeLinks-BVpn4_Sr.js +1 -0
  16. package/dist/chunk-codeLinks-BrGduhsm.js +1 -0
  17. package/dist/chunk-command-8s6m3ZUw.js +5 -0
  18. package/dist/chunk-command-aMxPQdiV.js +1 -0
  19. package/dist/chunk-command-vH1_y5F0.js +1 -0
  20. package/dist/chunk-commands-B8YVT41b.js +5 -0
  21. package/dist/{chunk-commands-DcjlDt7B.js → chunk-commands-CJCSznbv.js} +1 -1
  22. package/dist/chunk-compose-BUJTvoFX.js +4 -0
  23. package/dist/chunk-connections-Drr67X9U.js +1 -0
  24. package/dist/chunk-connectors-DcMqy0u8.js +1 -0
  25. package/dist/chunk-convert-Ce1MZmsE.js +3 -0
  26. package/dist/chunk-convert-FkMnlxyi.js +1 -0
  27. package/dist/chunk-deploy-BHg8pB9x.js +1 -0
  28. package/dist/chunk-deploy-DZgCTgaY.js +6 -0
  29. package/dist/{chunk-diagrams-BukAOL0g.js → chunk-diagrams-CtGMGTa8.js} +1 -1
  30. package/dist/chunk-diff-9hjavV6V.js +1 -0
  31. package/dist/chunk-diff-Dp3fUALc.js +1 -0
  32. package/dist/chunk-dispatch-o-eqJb9Y.js +7 -0
  33. package/dist/chunk-dmnTests-BOxutoRs.js +1 -0
  34. package/dist/{chunk-dmnTests-ChwX1YVo.js → chunk-dmnTests-BzNA-u2k.js} +1 -1
  35. package/dist/{chunk-docs-D7yEDpa4.js → chunk-docs-B3C3pZpY.js} +17 -17
  36. package/dist/chunk-doctor-CRxbsAm7.js +1 -0
  37. package/dist/{chunk-editPreview-CC2vwhIW.js → chunk-editPreview-DCUnMkTU.js} +1 -1
  38. package/dist/chunk-evidence-ny_2ltVe.js +23 -0
  39. package/dist/{chunk-examples-0HkF-frb.js → chunk-examples-BG0lGXcZ.js} +9 -9
  40. package/dist/chunk-export-Blwjf23H.js +1 -0
  41. package/dist/chunk-export-kt3sBTZu.js +20 -0
  42. package/dist/{chunk-facts-DSVaURw5.js → chunk-facts-Dl5lLriU.js} +1 -1
  43. package/dist/chunk-failure-BRyRvObj.js +1 -0
  44. package/dist/{chunk-file-BswMa3FN.js → chunk-file-1YhfNmPn.js} +1 -1
  45. package/dist/chunk-import-Dh3az4BC.js +6 -0
  46. package/dist/chunk-importCommand-Dhikkmo0.js +1 -0
  47. package/dist/chunk-incident-LJe2-ohi.js +1 -0
  48. package/dist/chunk-init-D34Q4YA8.js +227 -0
  49. package/dist/chunk-lint-CnEhoYRB.js +1 -0
  50. package/dist/{chunk-lsp-7vA_mIt1.js → chunk-lsp-BzeJkpmf.js} +1 -1
  51. package/dist/chunk-main-BZF-ErAx.js +1 -0
  52. package/dist/chunk-mcp-B_B9bet5.js +95 -0
  53. package/dist/{chunk-mcpLaunch-LyfmIF_Z.js → chunk-mcpLaunch-BS709697.js} +1 -1
  54. package/dist/chunk-migrate-DVfXC-iJ.js +1 -0
  55. package/dist/chunk-migrate-DwWg0k5_.js +16 -0
  56. package/dist/{chunk-migrateApply-CzOkgKhB.js → chunk-migrateApply-e8O9oZXP.js} +3 -3
  57. package/dist/chunk-migrateVerify-oIBf-PM3.js +1 -0
  58. package/dist/{chunk-model-f8AzYUK7.js → chunk-model-BulEKnY1.js} +2 -2
  59. package/dist/{chunk-parse-B-uKGDy-.js → chunk-parse-DiOcpdOU.js} +1 -1
  60. package/dist/{chunk-penstockCli-CKMvaZ0O.js → chunk-penstockCli-C41P_G7i.js} +1 -1
  61. package/dist/chunk-policy-BVb7c7G_.js +1 -0
  62. package/dist/chunk-policyGate-BOgKsqLq.js +2 -0
  63. package/dist/chunk-pr-1jKcTNnP.js +1 -0
  64. package/dist/{chunk-project-DBYOlYRi.js → chunk-project-COaBZhMt.js} +1 -1
  65. package/dist/chunk-project-lO_6DX8G.js +1 -0
  66. package/dist/chunk-promotion-CTMPjXjZ.js +2 -0
  67. package/dist/chunk-promotion-DDLrgBqZ.js +1 -0
  68. package/dist/{chunk-promotion-DchO6xoC.js → chunk-promotion-NeRj4uTP.js} +1 -1
  69. package/dist/chunk-receipt-C4NqnSkH.js +1 -0
  70. package/dist/chunk-receiptDeps-B7MehyHT.js +1 -0
  71. package/dist/chunk-receiptGate-BZCKCMTV.js +1 -0
  72. package/dist/chunk-receiptGate-DRcw327y.js +1 -0
  73. package/dist/{chunk-receiptSnapshot-B6ruXw8z.js → chunk-receiptSnapshot-CHSk3_4N.js} +1 -1
  74. package/dist/{chunk-receiptStore-Cy-L0H1u.js → chunk-receiptStore-DhROtI2h.js} +1 -1
  75. package/dist/chunk-refactor-CO3qyIEv.js +17 -0
  76. package/dist/chunk-refactor-CWeCOl7w.js +1 -0
  77. package/dist/{chunk-render-Ci5d6mg4.js → chunk-render-DZd5hScS.js} +1 -1
  78. package/dist/chunk-report-w7YZwhyg.js +1 -0
  79. package/dist/chunk-review-DYMgFDSy.js +1 -0
  80. package/dist/chunk-say-CP1IyOSv.js +1 -0
  81. package/dist/{chunk-security-VgKwtohm.js → chunk-security-pgip-kdY.js} +2 -2
  82. package/dist/chunk-serve-CKt2rO05.js +10 -0
  83. package/dist/{chunk-share-CBV2FuKq.js → chunk-share-rsL0itIM.js} +18 -18
  84. package/dist/chunk-stages-B2sBBxUc.js +3 -0
  85. package/dist/chunk-systemError-O3vQ8hLb.js +1 -0
  86. package/dist/chunk-systemError-n2E6isvg.js +1 -0
  87. package/dist/chunk-taskTest-DWoME1mY.js +2 -0
  88. package/dist/chunk-taskTest-JErgWO6t.js +1 -0
  89. package/dist/{chunk-templateDiagnostics-BwH7RNkz.js → chunk-templateDiagnostics-6txfKwas.js} +2 -2
  90. package/dist/chunk-templates-Y3xfCO_3.js +1 -0
  91. package/dist/chunk-testCases-BwimUfDC.js +4 -0
  92. package/dist/chunk-testCases-DO2Rkyvd.js +1 -0
  93. package/dist/chunk-tests-Cy325OGw.js +1 -0
  94. package/dist/chunk-tests-DNkORsqB.js +23 -0
  95. package/dist/{chunk-trust-DXcsUJaK.js → chunk-trust-DSX-k3by.js} +1 -1
  96. package/dist/{chunk-trust-DubjEjlN.js → chunk-trust-Di4EYPah.js} +1 -1
  97. package/dist/{chunk-variableChecks-KnECGMR3.js → chunk-variableChecks-CBDpmI4d.js} +1 -1
  98. package/dist/{chunk-workerVariables-CajAcbwl.js → chunk-workerVariables-CNnCRijJ.js} +1 -1
  99. package/dist/{chunk-workerVariables-DIDoUpHF.js → chunk-workerVariables-CulLc3YH.js} +1 -1
  100. package/dist/chunk-wrapper-CGYED7G2.js +1 -0
  101. package/dist/chunk-wrapper-CK7Xtes6.js +3 -0
  102. package/dist/grammars/web-tree-sitter.wasm +0 -0
  103. package/dist/penstock.js +1 -1
  104. package/dist/web/assets/{AgentSettings-Cn5Vcph3.js → AgentSettings-D24jOuht.js} +1 -1
  105. package/dist/web/assets/{AgentsDialog-C6WqzlxZ.js → AgentsDialog-BMWv3Gyk.js} +1 -1
  106. package/dist/web/assets/{AgentsDialog-dpbwVSxk.js → AgentsDialog-DbY2O6O5.js} +1 -1
  107. package/dist/web/assets/{AgentsTab-C34OhVkw.js → AgentsTab-D6LbK6sG.js} +2 -2
  108. package/dist/web/assets/{BpmnCanvas-yur9daZa.js → BpmnCanvas-BcQRQ2Br.js} +27 -27
  109. package/dist/web/assets/BpmnDocument-Ce5F4K1e.js +27 -0
  110. package/dist/web/assets/CmmnDocument-C_UlPowC.js +17 -0
  111. package/dist/web/assets/{ConflictDialog-Bb5kduaR.js → ConflictDialog-DfFp8F7n.js} +1 -1
  112. package/dist/web/assets/{ConnectionsDialog-qtF7yDFw.js → ConnectionsDialog-BaYtHD5h.js} +1 -1
  113. package/dist/web/assets/{DiffDocument-LHOif5Ac.js → DiffDocument-BOPdBEN3.js} +1 -1
  114. package/dist/web/assets/{DmnDocument-0f5uS67x.css → DmnDocument-DZ9u2uk2.css} +1 -1
  115. package/dist/web/assets/DmnDocument-vtnARy7Q.js +41 -0
  116. package/dist/web/assets/{DriftDialog-Chl6BX6k.js → DriftDialog-dIbCbSK2.js} +1 -1
  117. package/dist/web/assets/FormDocument-B0q8DF9v.css +1 -0
  118. package/dist/web/assets/FormDocument-DHBUBUzO.js +32 -0
  119. package/dist/web/assets/FormStepView-CbHb32_8.js +1 -0
  120. package/dist/web/assets/{GraphAwareLayoutService-wsos3yPD.js → GraphAwareLayoutService-C5N8K9dm.js} +1 -1
  121. package/dist/web/assets/{MigrationDialog-CBJU7Oe3.js → MigrationDialog-DA3Vrzgw.js} +1 -1
  122. package/dist/web/assets/{NewFileDialog-B7075LWG.js → NewFileDialog-Dev41oA1.js} +1 -1
  123. package/dist/web/assets/PolicyDialog-qR19Csji.js +1 -0
  124. package/dist/web/assets/{QuickOpen-DJQrI7Od.js → QuickOpen-ps-rMjiS.js} +1 -1
  125. package/dist/web/assets/ScriptPane-BQLMNYzc.js +2 -0
  126. package/dist/web/assets/{ScriptRunDialog-BwE4cXnp.js → ScriptRunDialog-YivjHB6j.js} +1 -1
  127. package/dist/web/assets/{SettingsDialog-c307wPsg.js → SettingsDialog-DI0vZ6Ay.js} +1 -1
  128. package/dist/web/assets/ShortcutsDialog-DLXnv4Vm.js +1 -0
  129. package/dist/web/assets/SourceDocument-Cj8cGsoS.js +1 -0
  130. package/dist/web/assets/TemplateDocument-BRyFsofH.js +7 -0
  131. package/dist/web/assets/TextDocument-DB2hEuMA.js +1 -0
  132. package/dist/web/assets/{UnreadableFileLayer-CUP_30X8.js → UnreadableFileLayer-CRW3MM7w.js} +1 -1
  133. package/dist/web/assets/{UploadDialog-CaVBOxUL.js → UploadDialog-D-X6GG98.js} +1 -1
  134. package/dist/web/assets/Viewer-BcpDlvg_.js +4 -0
  135. package/dist/web/assets/apply-Nsj6ek02.js +1 -0
  136. package/dist/web/assets/{bpmnTheme-CZ7xp4R5.js → bpmnTheme-pKgl9Mrn.js} +2 -2
  137. package/dist/web/assets/{data-ZauKnQ2Z.js → data-CdiToGOq.js} +2 -2
  138. package/dist/web/assets/{data-Da5Nxzev.js → data-wU6sw6RY.js} +1 -1
  139. package/dist/web/assets/{dialog-DSLu1Bbo.js → dialog-BDJ5dDiU.js} +1 -1
  140. package/dist/web/assets/{diff-C4hitkRR.js → diff-BhYqTg4l.js} +1 -1
  141. package/dist/web/assets/dist-27z6Phtg.js +23 -0
  142. package/dist/web/assets/{dist-CofBTWz1.js → dist-B7TL-7R3.js} +4 -4
  143. package/dist/web/assets/dist-BEpeEbIu.js +1 -0
  144. package/dist/web/assets/{dist-CYCbBoYQ.js → dist-BTf7NfeQ.js} +1 -1
  145. package/dist/web/assets/{dist-CJKVV2_S.js → dist-BqGv7f4M.js} +10 -10
  146. package/dist/web/assets/dist-C-q1IWjr.js +6 -0
  147. package/dist/web/assets/{dist-Blylfrak.js → dist-CJx_2eBF.js} +2 -2
  148. package/dist/web/assets/dist-COUY_jv5.js +1 -0
  149. package/dist/web/assets/{dist-DpDu6Wz_.js → dist-CWjAtsKe.js} +1 -1
  150. package/dist/web/assets/{dist-gb3IfUZi.js → dist-Cv8_A_95.js} +2 -2
  151. package/dist/web/assets/dist-DDE6BjgI.js +5 -0
  152. package/dist/web/assets/{dist-7VC_hKpw.js → dist-DDNYYQtV.js} +1 -1
  153. package/dist/web/assets/dist-DW-S9iZN.js +1 -0
  154. package/dist/web/assets/dist-OnU5n5o1.js +1 -0
  155. package/dist/web/assets/dmn-Cgoh6wXm.js +3 -0
  156. package/dist/web/assets/{documentBridge-1Eg7H9yI.js → documentBridge-CHw4XsZH.js} +3 -3
  157. package/dist/web/assets/{documents-LG-7CTrn.js → documents-CEtohzAC.js} +1 -1
  158. package/dist/web/assets/duplicate-D_ic-m62.js +342 -0
  159. package/dist/web/assets/{engines-DhO6OW1S.js → engines-lyEvb0pH.js} +1 -1
  160. package/dist/web/assets/{executable-BTarDLry.js → executable--4381_Lf.js} +1 -1
  161. package/dist/web/assets/{file-CIeVSOHy.js → file-BbVBUuIH.js} +1 -1
  162. package/dist/web/assets/formChecks-CSClH9sH.js +1 -0
  163. package/dist/web/assets/frontend-uXAWaalt.js +1 -0
  164. package/dist/web/assets/{httpHost-DBSjdVth.js → httpHost-C973OTRe.js} +1 -1
  165. package/dist/web/assets/{index.es-pigASDxC.js → index.es-CMvq8Bhe.js} +3 -3
  166. package/dist/web/assets/index.es-GbdJvMnO.js +78 -0
  167. package/dist/web/assets/{index.esm-CTLpq4ik.js → index.esm-Ba6q0zSu.js} +1 -1
  168. package/dist/web/assets/{intelligence-_1C71hkQ.js → intelligence-DNqJNmdB.js} +3 -3
  169. package/dist/web/assets/{jspdf.es.min-PgZzOmkT.js → jspdf.es.min-C0L4zezU.js} +6 -6
  170. package/dist/web/assets/{kind-X3_nabTt.js → kind-DDHnk6dW.js} +1 -1
  171. package/dist/web/assets/{lib-BmLAen_d.js → lib-DrkEMJ65.js} +1 -1
  172. package/dist/web/assets/{list-DovB9lWV.js → list-TmXvCwja.js} +1 -1
  173. package/dist/web/assets/{migrationHost-BcguK4K5.js → migrationHost-DCWBb3L6.js} +1 -1
  174. package/dist/web/assets/moddle-f0Q4Guwd.js +1 -0
  175. package/dist/web/assets/{model--Bj28IOj.js → model-afHgSxJs.js} +1 -1
  176. package/dist/web/assets/{nudges-UF9_cBuO.js → nudges-DPG3WpyV.js} +1 -1
  177. package/dist/web/assets/{open-C9Kt9JLw.js → open-Vkx72dYx.js} +1 -1
  178. package/dist/web/assets/platform-G53Cenyw.js +2 -0
  179. package/dist/web/assets/{preload-helper-VRuDKI9K.js → preload-helper-DExCAR_V.js} +1 -1
  180. package/dist/web/assets/{run-BZgz1U9U.js → run-BMfRBe5O.js} +1 -1
  181. package/dist/web/assets/samples-BL3jA_Vd.js +1 -0
  182. package/dist/web/assets/{say-WvEHqIbO.js → say-BkdZMivA.js} +1 -1
  183. package/dist/web/assets/{say-ChFGKK2E.js → say-C7KqKcFr.js} +1 -1
  184. package/dist/web/assets/{sections-N6WYk7b8.js → sections-LJKSRDTS.js} +1 -1
  185. package/dist/web/assets/sharedReader-BsXfiBT8.js +1 -0
  186. package/dist/web/assets/{source-frame-DcptKpVq.js → source-frame-DC4W0A5-.js} +2 -2
  187. package/dist/web/assets/{syntax-DW10Wzg4.js → syntax-00Hk6Xv7.js} +4 -4
  188. package/dist/web/assets/{template-CMl68jPp.js → template-BQP7ZXdK.js} +1 -1
  189. package/dist/web/assets/testCaseRuns-liAhWMg7.js +1 -0
  190. package/dist/web/assets/{trace-DLziNpe2.js → trace-DXQU2N_l.js} +1 -1
  191. package/dist/web/assets/{translator-DLDFsUlE.js → translator-BLCeE6UY.js} +1 -1
  192. package/dist/web/assets/ui-BLtm3Y1J.js +1 -0
  193. package/dist/web/assets/{useTrace-UYBskc2k.js → useTrace-dZdQ805W.js} +1 -1
  194. package/dist/web/assets/web-C4k0NLZ9.js +982 -0
  195. package/dist/web/assets/web-CnDpD6qy.css +1 -0
  196. package/dist/web/assets/{workerVariables-DURgyUbG.js → workerVariables-O6VqwDzr.js} +1 -1
  197. package/dist/web/assets/xml-DIWt4von.js +1 -0
  198. package/dist/web/index.html +39 -40
  199. package/package.json +5 -5
  200. package/dist/chunk-account-CpZu-RTg.js +0 -1
  201. package/dist/chunk-agentServe-BYRtgGGD.js +0 -10
  202. package/dist/chunk-agents-B9oxdPTA.js +0 -1
  203. package/dist/chunk-agentsMigrate-BV8TeRXq.js +0 -2
  204. package/dist/chunk-analyze-pgzR-Cx-.js +0 -1
  205. package/dist/chunk-apiTemplates-cU7C8vap.js +0 -1
  206. package/dist/chunk-cmmnFindings-S2TGSnEp.js +0 -1
  207. package/dist/chunk-codeLinks-C8N6e8k3.js +0 -1
  208. package/dist/chunk-codeLinks-o0a8tBGk.js +0 -1
  209. package/dist/chunk-command-Bqlbgo-2.js +0 -1
  210. package/dist/chunk-command-DT84ioJb.js +0 -5
  211. package/dist/chunk-command-DrGP2kg8.js +0 -1
  212. package/dist/chunk-commands-B4PoZbpX.js +0 -5
  213. package/dist/chunk-compose-CWKKVtN5.js +0 -4
  214. package/dist/chunk-connections-DQpKbIGD.js +0 -1
  215. package/dist/chunk-connectors-PtAvE91B.js +0 -1
  216. package/dist/chunk-convert-CpgtOlZk.js +0 -1
  217. package/dist/chunk-convert-HbFpg8ab.js +0 -3
  218. package/dist/chunk-deploy-l4MdFfn8.js +0 -6
  219. package/dist/chunk-deploy-qRaaKGZb.js +0 -1
  220. package/dist/chunk-diff-BhTFlCE3.js +0 -1
  221. package/dist/chunk-diff-kBF83vzM.js +0 -1
  222. package/dist/chunk-dispatch-BnO-QhMh.js +0 -7
  223. package/dist/chunk-dmnTests-0x_yUH6S.js +0 -1
  224. package/dist/chunk-doctor-BuHK1dTm.js +0 -1
  225. package/dist/chunk-evidence-oLw_C6j8.js +0 -23
  226. package/dist/chunk-export-cIFHDXug.js +0 -1
  227. package/dist/chunk-export-jBVxtmCH.js +0 -20
  228. package/dist/chunk-failure-D5brrYW2.js +0 -1
  229. package/dist/chunk-import-BBOe-5RZ.js +0 -6
  230. package/dist/chunk-importCommand-DRjYoljA.js +0 -1
  231. package/dist/chunk-incident-BK1h37CD.js +0 -1
  232. package/dist/chunk-init-_OALJuKm.js +0 -227
  233. package/dist/chunk-lint-7KJFxyCN.js +0 -1
  234. package/dist/chunk-main-Cw2JXCil.js +0 -1
  235. package/dist/chunk-mcp-K63bhqnF.js +0 -95
  236. package/dist/chunk-migrate-BMwBV5sc.js +0 -16
  237. package/dist/chunk-migrate-CxfVmKt0.js +0 -1
  238. package/dist/chunk-migrateVerify-DSEXSpfR.js +0 -1
  239. package/dist/chunk-policy-BX0Ftdws.js +0 -1
  240. package/dist/chunk-policyGate-dmcufnwB.js +0 -2
  241. package/dist/chunk-pr-ByrGcfam.js +0 -1
  242. package/dist/chunk-project-DA3KnAZH.js +0 -1
  243. package/dist/chunk-promotion-Boedyq43.js +0 -1
  244. package/dist/chunk-promotion-D8Ti-vxp.js +0 -2
  245. package/dist/chunk-receipt-CusJaqNn.js +0 -1
  246. package/dist/chunk-receiptDeps-oVbX156d.js +0 -1
  247. package/dist/chunk-receiptGate-DrGChj7i.js +0 -1
  248. package/dist/chunk-receiptGate-xldHKMyJ.js +0 -1
  249. package/dist/chunk-refactor-B1W_MGTp.js +0 -1
  250. package/dist/chunk-refactor-BJXxEtVs.js +0 -17
  251. package/dist/chunk-report-D9pM09Nu.js +0 -1
  252. package/dist/chunk-review-UcqS5AAi.js +0 -1
  253. package/dist/chunk-say-CYb4HeJD.js +0 -1
  254. package/dist/chunk-serve-Dmqen1yd.js +0 -10
  255. package/dist/chunk-stages-BTQJrAMF.js +0 -3
  256. package/dist/chunk-systemError-BYrMzp2o.js +0 -1
  257. package/dist/chunk-systemError-CXvnhNPK.js +0 -1
  258. package/dist/chunk-taskTest-9gMsx0zu.js +0 -2
  259. package/dist/chunk-taskTest-BjXYpG5p.js +0 -1
  260. package/dist/chunk-templates-D3ouIwHD.js +0 -1
  261. package/dist/chunk-testCases-9jwT_Y7z.js +0 -4
  262. package/dist/chunk-testCases-BcpBPg9L.js +0 -1
  263. package/dist/chunk-tests-CEEXnWOp.js +0 -23
  264. package/dist/chunk-tests-CRVosdWp.js +0 -1
  265. package/dist/chunk-wrapper-B2WnOIoB.js +0 -3
  266. package/dist/chunk-wrapper-DiKCKZti.js +0 -1
  267. package/dist/web/assets/BpmnDocument-C247Rqim.js +0 -27
  268. package/dist/web/assets/CmmnDocument-Dj48bsUd.js +0 -17
  269. package/dist/web/assets/DmnDocument-Cb9Zi9fS.js +0 -41
  270. package/dist/web/assets/FormDocument-DoZaxWd-.js +0 -32
  271. package/dist/web/assets/FormDocument-URLcKn84.css +0 -1
  272. package/dist/web/assets/FormStepView-D8MFcpeI.js +0 -1
  273. package/dist/web/assets/PolicyDialog-CGdglmDn.js +0 -1
  274. package/dist/web/assets/ScriptPane-T6M5f6fc.js +0 -2
  275. package/dist/web/assets/ShortcutsDialog-BAoL9EHu.js +0 -1
  276. package/dist/web/assets/SourceDocument-C9KIzBA5.js +0 -1
  277. package/dist/web/assets/TemplateDocument-CNt2turg.js +0 -7
  278. package/dist/web/assets/TextDocument-CtkHoEqN.js +0 -1
  279. package/dist/web/assets/Viewer-DZske1C5.js +0 -4
  280. package/dist/web/assets/apply-nnKP9HIM.js +0 -1
  281. package/dist/web/assets/dist--PmHUHDp.js +0 -1
  282. package/dist/web/assets/dist-BoPrKCf2.js +0 -5
  283. package/dist/web/assets/dist-C1m02xAO.js +0 -1
  284. package/dist/web/assets/dist-CLqJMzT-.js +0 -1
  285. package/dist/web/assets/dist-D3jqq0XS.js +0 -1
  286. package/dist/web/assets/dist-DA-9F0U9.js +0 -1
  287. package/dist/web/assets/dist-DojzF5q2.js +0 -6
  288. package/dist/web/assets/dist-yvjzrXXf.js +0 -23
  289. package/dist/web/assets/dmn-DwdcYXGr.js +0 -3
  290. package/dist/web/assets/duplicate-D-ilQqKz.js +0 -342
  291. package/dist/web/assets/formChecks-CGox1z7R.js +0 -1
  292. package/dist/web/assets/frontend-Qq5hBH0U.js +0 -1
  293. package/dist/web/assets/index.es-CcNNw3VB.js +0 -78
  294. package/dist/web/assets/moddle-DJxj0oEU.js +0 -1
  295. package/dist/web/assets/platform-BLPhsye9.js +0 -2
  296. package/dist/web/assets/samples-oeXBsJ9Y.js +0 -1
  297. package/dist/web/assets/sharedReader-Bopy7Uk9.js +0 -1
  298. package/dist/web/assets/testCaseRuns-B_XdqGFh.js +0 -1
  299. package/dist/web/assets/ui-BTKMbWYG.js +0 -1
  300. package/dist/web/assets/web-FzNBw1kZ.css +0 -1
  301. package/dist/web/assets/web-jPMZVwbQ.js +0 -982
  302. package/dist/web/assets/xml-DTgZ-B-l.js +0 -1
@@ -1,6 +1,6 @@
1
- import"./rolldown-runtime-B8BYMn-z.js";import{m as e,p as t,v as n}from"./dist-CRJyslwo.js";import{a as r,c as i,o as a}from"./dist-DHrd1AHo.js";import{a as o,n as s,r as c,t as l}from"./dist-CdHwU8_m.js";var u=[`for`,`in`,`return`,`if`,`then`,`else`,`some`,`every`,`satisfies`,`and`,`or`,`between`,`instance`,`of`,`function`,`external`],d=[`true`,`false`],f=`time`,ee=[`**`,`!=`,`<=`,`>=`],p={"(":`open_parenthesis`,")":`close_parenthesis`,"[":`open_bracket`,"]":`close_bracket`,"{":`open_brace`,"}":`close_brace`},m=[`for`,`some`,`every`],te=`function`,h=``,g=` `,_=`(`,v=`*`,y=`/`,b=/\s/u,x=/\p{Nd}/u,S=/[\p{L}\p{Nl}\p{Sc}\p{Pc}]/u,C=/[\p{L}\p{Nl}\p{Sc}\p{Pc}\p{Mn}\p{Mc}\p{Nd}\p{Cf}]/u;function charAt(e,t,n){return t<n?e.charAt(t):h}function indexOfOrEnd(e,t,n,r){let i=n;for(;i<r&&e.charAt(i)!==t;)i++;return i}function whitespaceSpan(e,t,n){let r=t;for(;r<n&&b.test(e.charAt(r));)r++;return{kind:`whitespace`,end:r}}function scanFeel(e,t,n,r){let i=charAt(e,t,n),a=b.test(i)?whitespaceSpan(e,t,n):spanOf(e,t,n,r);return a.kind===`whitespace`?{kind:a.kind,end:a.end,afterDot:r}:{kind:a.kind,end:a.end,afterDot:a.kind===`punctuation`&&i===`.`}}function spanOf(e,t,n,r){let i=charAt(e,t,n),a=charAt(e,t+1,n);return i===y&&a===y?{kind:`line_comment`,end:indexOfOrEnd(e,`
2
- `,t,n)}:i===y&&a===v?blockComment(e,t,n):i===`"`?quoted(e,t,n,`string`):i===`@`&&a===`"`?quoted(e,t+1,n,`temporal`):i==="`"?backtick(e,t,n):x.test(i)?{kind:`number`,end:numberEnd(e,t,n)}:S.test(i)?word(e,t,n,r):i===`.`&&a===`.`?{kind:`operator`,end:t+2}:i===`.`?{kind:`punctuation`,end:t+1}:ee.includes(i+a)?{kind:`operator`,end:t+2}:i!==h&&`+-*/=<>`.includes(i)?{kind:`operator`,end:t+1}:{kind:bracketOrPunctuation(i),end:t+1}}function bracketOrPunctuation(e){return e in p?p[e]??`bad`:e!==h&&`,:?;`.includes(e)?`punctuation`:`bad`}function blockComment(e,t,n){let r=t+2;for(;r+1<n&&(e.charAt(r)!==v||e.charAt(r+1)!==y);)r++;return{kind:`block_comment`,end:r+1<n?r+2:n}}function quoted(e,t,n,r){let i=closingQuote(e,t,n);return i<0?{kind:`bad`,end:n}:{kind:r,end:i+1}}function closingQuote(e,t,n){let r=t+1;for(;r<n;){let t=e.charAt(r);if(t===`\\`)r+=2;else if(t===`"`)return r;else r++}return-1}function backtick(e,t,n){let r=indexOfOrEnd(e,"`",t+1,n);return r<n?{kind:`backtick_name`,end:r+1}:{kind:`bad`,end:n}}function numberEnd(e,t,n){let r=digitsEnd(e,t,n);return charAt(e,r,n)===`.`&&x.test(charAt(e,r+1,n))&&(r=digitsEnd(e,r+1,n)),r}function digitsEnd(e,t,n){let r=t;for(;r<n&&x.test(e.charAt(r));)r++;return r}function isReservedWord(e){return u.includes(e)||d.includes(e)||e===`null`}function word(e,t,n,r){let i=identifierEnd(e,t,n);if(r)return{kind:`property`,end:i};let a=e.slice(t,i);if(a===`date`){let t=dateAndTimeEnd(e,i,n);if(t!==void 0)return{kind:`function`,end:t}}if(u.includes(a))return{kind:`keyword`,end:i};if(d.includes(a))return{kind:`boolean`,end:i};if(a===`null`)return{kind:`null`,end:i};let o=nameEndFrom(e,i,n);return{kind:charAt(e,o,n)===_?`function`:`name`,end:o}}function identifierEnd(e,t,n){let r=t+1;for(;r<n&&C.test(e.charAt(r));)r++;return r}function nameEndFrom(e,t,n){let r=t;for(;r+1<n&&e.charAt(r)===g&&S.test(e.charAt(r+1));){let t=identifierEnd(e,r+1,n);if(isReservedWord(e.slice(r+1,t)))break;r=t}return r}function dateAndTimeEnd(e,t,n){let r=wordAfterSpaces(e,t,n,`and`);if(r===void 0)return;let i=wordAfterSpaces(e,r,n,f);if(i===void 0)return;let a=i;for(;a<n&&b.test(e.charAt(a));)a++;return charAt(e,a,n)===_?i:void 0}function wordAfterSpaces(e,t,n,r){let i=t;for(;i<n&&b.test(e.charAt(i));)i++;if(i===t)return;let a=i+r.length;if(!(a>n||e.slice(i,a)!==r))return a<n&&C.test(e.charAt(a))?void 0:a}function feelTokens(e){let t=[],n=0,r=!1;for(;n<e.length;){let i=scanFeel(e,n,e.length,r);i.kind!==`whitespace`&&t.push({kind:i.kind,start:n,end:i.end,text:e.slice(n,i.end)}),r=i.afterDot,n=i.end}return t}o(),e(),r();var w=124,T=125,E=126,ne=127,D=131,re=4,ie=134,ae=7,oe=8,se=9,ce=10,le=140,O=21,ue=141,de=25,k=142,A=29,j=39,M=43,N=145,P=146,F=147,I=148,L=49,R=70,z=154,B=71,V=73,H=155,U=75,fe=156,pe=79,me=161,he=82,ge=83,_e=84,ve=168,W=92,ye=93,be=170,xe=100,Se=172,Ce=101,we=103,Te=104,G=typeof process<`u`&&/\bfparse(:dbg)?\b/.test({}.LOG),K=typeof process<`u`&&/\bfparse:dbg\b/.test({}.LOG),q=typeof process<`u`&&/\bcontext\b/.test({}.LOG),J=[9,11,12,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],Ee=chars(`
1
+ import"./rolldown-runtime-B8BYMn-z.js";import{a as e,n as t,r as n,t as r}from"./dist-CdHwU8_m.js";import{m as i,p as a,v as o}from"./dist-CRJyslwo.js";import{a as s,c,o as l}from"./dist-DHrd1AHo.js";var u=[`for`,`in`,`return`,`if`,`then`,`else`,`some`,`every`,`satisfies`,`and`,`or`,`between`,`instance`,`of`,`function`,`external`],d=[`true`,`false`],f=`time`,ee=[`**`,`!=`,`<=`,`>=`],p={"(":`open_parenthesis`,")":`close_parenthesis`,"[":`open_bracket`,"]":`close_bracket`,"{":`open_brace`,"}":`close_brace`},m=[`for`,`some`,`every`],te=`function`,h=``,g=` `,_=`(`,v=`*`,y=`/`,b=/\s/u,x=/\p{Nd}/u,S=/[\p{L}\p{Nl}\p{Sc}\p{Pc}]/u,C=/[\p{L}\p{Nl}\p{Sc}\p{Pc}\p{Mn}\p{Mc}\p{Nd}\p{Cf}]/u;function charAt(e,t,n){return t<n?e.charAt(t):h}function indexOfOrEnd(e,t,n,r){let i=n;for(;i<r&&e.charAt(i)!==t;)i++;return i}function whitespaceSpan(e,t,n){let r=t;for(;r<n&&b.test(e.charAt(r));)r++;return{kind:`whitespace`,end:r}}function scanFeel(e,t,n,r){let i=charAt(e,t,n),a=b.test(i)?whitespaceSpan(e,t,n):spanOf(e,t,n,r);return a.kind===`whitespace`?{kind:a.kind,end:a.end,afterDot:r}:{kind:a.kind,end:a.end,afterDot:a.kind===`punctuation`&&i===`.`}}function spanOf(e,t,n,r){let i=charAt(e,t,n),a=charAt(e,t+1,n);return i===y&&a===y?{kind:`line_comment`,end:indexOfOrEnd(e,`
2
+ `,t,n)}:i===y&&a===v?blockComment(e,t,n):i===`"`?quoted(e,t,n,`string`):i===`@`&&a===`"`?quoted(e,t+1,n,`temporal`):i==="`"?backtick(e,t,n):x.test(i)?{kind:`number`,end:numberEnd(e,t,n)}:S.test(i)?word(e,t,n,r):i===`.`&&a===`.`?{kind:`operator`,end:t+2}:i===`.`?{kind:`punctuation`,end:t+1}:ee.includes(i+a)?{kind:`operator`,end:t+2}:i!==h&&`+-*/=<>`.includes(i)?{kind:`operator`,end:t+1}:{kind:bracketOrPunctuation(i),end:t+1}}function bracketOrPunctuation(e){return e in p?p[e]??`bad`:e!==h&&`,:?;`.includes(e)?`punctuation`:`bad`}function blockComment(e,t,n){let r=t+2;for(;r+1<n&&(e.charAt(r)!==v||e.charAt(r+1)!==y);)r++;return{kind:`block_comment`,end:r+1<n?r+2:n}}function quoted(e,t,n,r){let i=closingQuote(e,t,n);return i<0?{kind:`bad`,end:n}:{kind:r,end:i+1}}function closingQuote(e,t,n){let r=t+1;for(;r<n;){let t=e.charAt(r);if(t===`\\`)r+=2;else if(t===`"`)return r;else r++}return-1}function backtick(e,t,n){let r=indexOfOrEnd(e,"`",t+1,n);return r<n?{kind:`backtick_name`,end:r+1}:{kind:`bad`,end:n}}function numberEnd(e,t,n){let r=digitsEnd(e,t,n);return charAt(e,r,n)===`.`&&x.test(charAt(e,r+1,n))&&(r=digitsEnd(e,r+1,n)),r}function digitsEnd(e,t,n){let r=t;for(;r<n&&x.test(e.charAt(r));)r++;return r}function isReservedWord(e){return u.includes(e)||d.includes(e)||e===`null`}function word(e,t,n,r){let i=identifierEnd(e,t,n);if(r)return{kind:`property`,end:i};let a=e.slice(t,i);if(a===`date`){let t=dateAndTimeEnd(e,i,n);if(t!==void 0)return{kind:`function`,end:t}}if(u.includes(a))return{kind:`keyword`,end:i};if(d.includes(a))return{kind:`boolean`,end:i};if(a===`null`)return{kind:`null`,end:i};let o=nameEndFrom(e,i,n);return{kind:charAt(e,o,n)===_?`function`:`name`,end:o}}function identifierEnd(e,t,n){let r=t+1;for(;r<n&&C.test(e.charAt(r));)r++;return r}function nameEndFrom(e,t,n){let r=t;for(;r+1<n&&e.charAt(r)===g&&S.test(e.charAt(r+1));){let t=identifierEnd(e,r+1,n);if(isReservedWord(e.slice(r+1,t)))break;r=t}return r}function dateAndTimeEnd(e,t,n){let r=wordAfterSpaces(e,t,n,`and`);if(r===void 0)return;let i=wordAfterSpaces(e,r,n,f);if(i===void 0)return;let a=i;for(;a<n&&b.test(e.charAt(a));)a++;return charAt(e,a,n)===_?i:void 0}function wordAfterSpaces(e,t,n,r){let i=t;for(;i<n&&b.test(e.charAt(i));)i++;if(i===t)return;let a=i+r.length;if(!(a>n||e.slice(i,a)!==r))return a<n&&C.test(e.charAt(a))?void 0:a}function feelTokens(e){let t=[],n=0,r=!1;for(;n<e.length;){let i=scanFeel(e,n,e.length,r);i.kind!==`whitespace`&&t.push({kind:i.kind,start:n,end:i.end,text:e.slice(n,i.end)}),r=i.afterDot,n=i.end}return t}e(),i(),s();var w=124,T=125,E=126,ne=127,D=131,re=4,ie=134,ae=7,oe=8,se=9,ce=10,le=140,O=21,ue=141,de=25,k=142,A=29,j=39,M=43,N=145,P=146,F=147,I=148,L=49,R=70,z=154,B=71,V=73,H=155,U=75,fe=156,pe=79,me=161,he=82,ge=83,_e=84,ve=168,W=92,ye=93,be=170,xe=100,Se=172,Ce=101,we=103,Te=104,G=typeof process<`u`&&/\bfparse(:dbg)?\b/.test({}.LOG),K=typeof process<`u`&&/\bfparse:dbg\b/.test({}.LOG),q=typeof process<`u`&&/\bcontext\b/.test({}.LOG),J=[9,11,12,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],Ee=chars(`
3
3
  \r`),Y=42,De=chars(`'./-+*^`);function chars(e){return Array.from(e).map(e=>e.charCodeAt(0))}function isStartChar(e){return e===63||e>=65&&e<=90||e===95||e>=97&&e<=122||e>=192&&e<=214||e>=216&&e<=246||e>=248&&e<=767||e>=880&&e<=893||e>=895&&e<=8191||e>=8204&&e<=8205||e>=8304&&e<=8591||e>=11264&&e<=12271||e>=12289&&e<=55295||e>=63744&&e<=64975||e>=65008&&e<=65533||e>=55296&&e<=56319||e>=56320&&e<=57343}function isAdditional(e){return De.includes(e)}function isPartChar(e){return e>=48&&e<=57||e===183||e>=768&&e<=879||e>=8255&&e<=8256}function isSpace(e){return J.includes(e)}function indent(e,t){return t.concat(e.split(/\n/g).join(`
4
- `+t))}function parseAdditionalSymbol(e,t=0){let n=e.peek(t);return n===Y&&e.peek(t+1)===Y?{offset:2,token:`**`}:isAdditional(n)?{offset:1,token:String.fromCharCode(n)}:null}function parseIdentifier(e,t=0,n=!1){for(let r=!1,i=[],a=0;;a++){let o=e.peek(t+a);if(isStartChar(o)||(r||n)&&isPartChar(o))r||=!0,i.push(o);else return i.length?{token:String.fromCharCode(...i),offset:a}:null}}function parseSpaces(e,t){for(let n=!1,r=0;;r++)if(isSpace(e.peek(t+r)))n||=!0;else return n?{token:` `,offset:r}:null}function parseName(e,t){let{keys:n,prefixes:r}=t.contextCache(),i=t.tokens;for(let t=0,a=[],o=null;;){let s=i.length+a.length>0,c=a.length>0,l=parseIdentifier(e,t,s)||s&&parseAdditionalSymbol(e,t)||c&&parseSpaces(e,t);if(!l)return o;let{token:u,offset:d}=l;if(t+=d,u===` `)continue;a=[...a,u];let f=[...i,...a].join(` `);if(n.has(f)){let e=a[0];o={token:e,offset:e.length,term:E}}if(!r.has(f)){if(Z.some(e=>e===f)){let e=a[0];o={token:e,offset:e.length,term:T}}if(!Z.some(e=>e.startsWith(f)))return o}}}var Oe={[T]:`identifier`,[E]:`nameIdentifier`},ke=new s((e,t)=>{K&&console.log(`%s: T <identifier | nameIdentifier>`,e.pos);let n=parseName(e,t.context),r=t.context.tokens,i=n||parseIdentifier(e,0,r.length>0);i&&(e.advance(i.offset),e.acceptToken(n?n.term:T),G&&console.log(`%s: MATCH <%s> <%s>`,e.pos,n?Oe[n.term]:`identifier`,i.token))},{contextual:!0}),Ae=new s((e,t)=>{K&&console.log(`%s: T <propertyIdentifier>`,e.pos);let n=t.context.tokens,r=parseIdentifier(e,0,n.length>0);r&&(e.advance(r.offset),e.acceptToken(w),G&&console.log(`%s: MATCH <propertyIdentifier> <%s>`,e.pos,r.token))}),je=new s((e,t)=>{K&&console.log(`%s: T <insertSemi>`,e.pos);let n,r=!1;for(n=0;;n++){let t=e.peek(n);if(!J.includes(t)){Ee.includes(t)&&(r=!0);break}}if(r){let t=parseIdentifier(e,n+1);if(parseSpaces(e,n+1)||t&&/^(then|else|return|satisfies)$/.test(t.token))return;G&&console.log(`%s: MATCH <insertSemi>`,e.pos),e.acceptToken(ne)}}),Me={[fe]:`FunctionInvocation`,[H]:`FilterExpression`,[z]:`PathExpression`},Ne={[Se]:`Context`,[be]:`FunctionDefinition`,[ie]:`ForExpression`,[ve]:`List`,[ue]:`IfExpression`,[k]:`QuantifiedExpression`},Pe={[xe]:`Context`,[ye]:`FunctionDefinition`,[re]:`ForExpression`,[W]:`List`,[O]:`IfExpression`,[de]:`QuantifiedExpression`,[R]:`PathExpression`,[U]:`FunctionInvocation`,[V]:`FilterExpression`,[M]:`ArithmeticExpression`},X=class ValueProducer{constructor(e){this.fn=e}get(e){return this.fn(e)}static of(e){return new ValueProducer(e)}},Z=Object.keys({"date and time":1,date:1,time:1,duration:1});function getPrefixes(e){let t=[];for(let n=1;n<=e.length;n++)t.push(e.substring(0,n));return t}function cacheKey(e,t){let n=normalizeContextKey(e),r=getPrefixes(n);t.keys.add(n);for(let e of r)t.prefixes.add(e);return t.originalMap.set(n,e),t}function computeContextCache(e){let t=createContextCache();for(let n of e.getKeys())cacheKey(n,t);return t}function createContextCache(e){return{keys:new Set(e?.keys),prefixes:new Set(e?.prefixes),originalMap:new Map(e?.originalMap)}}var VariableContext=class{constructor(e={}){this.value=e}getKeys(){return Object.keys(this.value)}get(e){let t=this.value[e],n=this.constructor;return n.isAtomic(t)?t:n.of(t)}set(e,t){let n=this.constructor;return new n({...this.value,[e]:t})}merge(e){let t=this.constructor;return new t(t.__merge(this.value,e))}static isAtomic(e){return e==null||e instanceof this||e instanceof X||typeof e!=`object`}static of(...e){let t=e.reduce((e,t)=>this.__merge(e,t),{});return new this(t)}static __unwrap(e){return e?e instanceof this?e.value:this.isAtomic(e)?{}:e:{}}static __merge(e,n){let r=Object.assign({},this.__unwrap(e));for(let[e,i]of Object.entries(this.__unwrap(n)))r[e]=i instanceof X?i:t(r,e)?this.__merge(r[e],i):i;return r}},Fe=class Variables{constructor({name:e=`Expressions`,tokens:t=[],children:n=[],parent:r=null,context:i,value:a,raw:o,__cache:s}){this.name=e,this.tokens=t,this.children=n,this.parent=r,this.context=i,this.value=a,this.raw=o,this.__cache=s}get root(){let e=this;for(;e.parent;)e=e.parent;return e}get cache(){let e=this.root;return e.__cache||=new WeakMap,e.__cache}enterScope(e){let t=this.of({name:e,parent:this});return q&&console.log(`[%s] enter`,t.path,t.context),t}exitScope(e){return this.parent?(q&&console.log(`[%s] exit %o
4
+ `+t))}function parseAdditionalSymbol(e,t=0){let n=e.peek(t);return n===Y&&e.peek(t+1)===Y?{offset:2,token:`**`}:isAdditional(n)?{offset:1,token:String.fromCharCode(n)}:null}function parseIdentifier(e,t=0,n=!1){for(let r=!1,i=[],a=0;;a++){let o=e.peek(t+a);if(isStartChar(o)||(r||n)&&isPartChar(o))r||=!0,i.push(o);else return i.length?{token:String.fromCharCode(...i),offset:a}:null}}function parseSpaces(e,t){for(let n=!1,r=0;;r++)if(isSpace(e.peek(t+r)))n||=!0;else return n?{token:` `,offset:r}:null}function parseName(e,t){let{keys:n,prefixes:r}=t.contextCache(),i=t.tokens;for(let t=0,a=[],o=null;;){let s=i.length+a.length>0,c=a.length>0,l=parseIdentifier(e,t,s)||s&&parseAdditionalSymbol(e,t)||c&&parseSpaces(e,t);if(!l)return o;let{token:u,offset:d}=l;if(t+=d,u===` `)continue;a=[...a,u];let f=[...i,...a].join(` `);if(n.has(f)){let e=a[0];o={token:e,offset:e.length,term:E}}if(!r.has(f)){if(Z.some(e=>e===f)){let e=a[0];o={token:e,offset:e.length,term:T}}if(!Z.some(e=>e.startsWith(f)))return o}}}var Oe={[T]:`identifier`,[E]:`nameIdentifier`},ke=new t((e,t)=>{K&&console.log(`%s: T <identifier | nameIdentifier>`,e.pos);let n=parseName(e,t.context),r=t.context.tokens,i=n||parseIdentifier(e,0,r.length>0);i&&(e.advance(i.offset),e.acceptToken(n?n.term:T),G&&console.log(`%s: MATCH <%s> <%s>`,e.pos,n?Oe[n.term]:`identifier`,i.token))},{contextual:!0}),Ae=new t((e,t)=>{K&&console.log(`%s: T <propertyIdentifier>`,e.pos);let n=t.context.tokens,r=parseIdentifier(e,0,n.length>0);r&&(e.advance(r.offset),e.acceptToken(w),G&&console.log(`%s: MATCH <propertyIdentifier> <%s>`,e.pos,r.token))}),je=new t((e,t)=>{K&&console.log(`%s: T <insertSemi>`,e.pos);let n,r=!1;for(n=0;;n++){let t=e.peek(n);if(!J.includes(t)){Ee.includes(t)&&(r=!0);break}}if(r){let t=parseIdentifier(e,n+1);if(parseSpaces(e,n+1)||t&&/^(then|else|return|satisfies)$/.test(t.token))return;G&&console.log(`%s: MATCH <insertSemi>`,e.pos),e.acceptToken(ne)}}),Me={[fe]:`FunctionInvocation`,[H]:`FilterExpression`,[z]:`PathExpression`},Ne={[Se]:`Context`,[be]:`FunctionDefinition`,[ie]:`ForExpression`,[ve]:`List`,[ue]:`IfExpression`,[k]:`QuantifiedExpression`},Pe={[xe]:`Context`,[ye]:`FunctionDefinition`,[re]:`ForExpression`,[W]:`List`,[O]:`IfExpression`,[de]:`QuantifiedExpression`,[R]:`PathExpression`,[U]:`FunctionInvocation`,[V]:`FilterExpression`,[M]:`ArithmeticExpression`},X=class ValueProducer{constructor(e){this.fn=e}get(e){return this.fn(e)}static of(e){return new ValueProducer(e)}},Z=Object.keys({"date and time":1,date:1,time:1,duration:1});function getPrefixes(e){let t=[];for(let n=1;n<=e.length;n++)t.push(e.substring(0,n));return t}function cacheKey(e,t){let n=normalizeContextKey(e),r=getPrefixes(n);t.keys.add(n);for(let e of r)t.prefixes.add(e);return t.originalMap.set(n,e),t}function computeContextCache(e){let t=createContextCache();for(let n of e.getKeys())cacheKey(n,t);return t}function createContextCache(e){return{keys:new Set(e?.keys),prefixes:new Set(e?.prefixes),originalMap:new Map(e?.originalMap)}}var VariableContext=class{constructor(e={}){this.value=e}getKeys(){return Object.keys(this.value)}get(e){let t=this.value[e],n=this.constructor;return n.isAtomic(t)?t:n.of(t)}set(e,t){let n=this.constructor;return new n({...this.value,[e]:t})}merge(e){let t=this.constructor;return new t(t.__merge(this.value,e))}static isAtomic(e){return e==null||e instanceof this||e instanceof X||typeof e!=`object`}static of(...e){let t=e.reduce((e,t)=>this.__merge(e,t),{});return new this(t)}static __unwrap(e){return e?e instanceof this?e.value:this.isAtomic(e)?{}:e:{}}static __merge(e,t){let n=Object.assign({},this.__unwrap(e));for(let[e,r]of Object.entries(this.__unwrap(t)))n[e]=r instanceof X?r:a(n,e)?this.__merge(n[e],r):r;return n}},Fe=class Variables{constructor({name:e=`Expressions`,tokens:t=[],children:n=[],parent:r=null,context:i,value:a,raw:o,__cache:s}){this.name=e,this.tokens=t,this.children=n,this.parent=r,this.context=i,this.value=a,this.raw=o,this.__cache=s}get root(){let e=this;for(;e.parent;)e=e.parent;return e}get cache(){let e=this.root;return e.__cache||=new WeakMap,e.__cache}enterScope(e){let t=this.of({name:e,parent:this});return q&&console.log(`[%s] enter`,t.path,t.context),t}exitScope(e){return this.parent?(q&&console.log(`[%s] exit %o
5
5
  %s`,this.path,this.context,indent(e,` `)),this.parent.pushChild(this)):(q&&console.log(`[%s] NO exit %o
6
- %s`,this.path,this.context,indent(e,` `)),this)}token(e){return q&&console.log(`[%s] token <%s> + <%s>`,this.path,this.tokens.join(` `),e),this.assign({tokens:[...this.tokens,e]})}literal(e){return q&&console.log(`[%s] literal %o`,this.path,e),this.pushChild(this.of({name:`Literal`,value:e}))}computedValue(){for(let e=this;;e=last(e.children)){if(!e)return null;if(!n(e.value))return e.value}}contextCache(){let e=this.cache.get(this.context);return e||(e=computeContextCache(this.context),this.cache.set(this.context,e)),e}get path(){return this.parent?.path?.concat(` > `,this.name)||this.name}get(e){let t=e&&normalizeContextKey(e),n=this.contextCache().originalMap.get(t);if(n===void 0)return;let r=this.context.get(n);return r instanceof X?r.get(this):r}resolveName(e){let t=this.tokens.join(` `),n=this.assign({tokens:[]}),r=this.of({name:e,parent:n,value:this.get(t),raw:t});return q&&console.log(`[%s] resolve %s <%s=%s>`,e,r.path,t,r.value),n.pushChild(r)}pushChild(e){if(!e)return this;let t=this.assign({children:[...this.children,e]});return e.parent=t,t}pushChildren(e){let t=this;for(let n of e)t=t.pushChild(n);return t}declareName(){if(this.tokens.length===0)throw Error(`no tokens to declare name`);let e=this.tokens.join(` `);return q&&console.log(`[%s] declareName <%s>`,this.path,e),this.assign({tokens:[]}).pushChild(this.of({name:`Name`,value:e}))}define(e,t){if(typeof e!=`string`)return q&&console.log(`[%s] no define <%s=%s>`,this.path,e,t),this;q&&console.log(`[%s] define <%s=%s>`,this.path,e,t);let n=this.context,r=n.set(e,t),i=cacheKey(e,createContextCache(this.cache.get(n)||computeContextCache(n)));return this.cache.set(r,i),this.assign({context:r})}assign(e={}){return Variables.of({...this,...e})}of(e={}){let t={context:this.context,parent:this.parent};return Variables.of({...t,...e})}static of(e){let{name:t,tokens:n=[],children:r=[],parent:i=null,context:a,value:o,raw:s,__cache:c}=e;if(!a)throw Error(`must provide <context>`);return new Variables({name:t,tokens:[...n],children:[...r],context:a,parent:i,value:o,raw:s,__cache:c})}};function normalizeContextKey(e){return e.replace(/\s*([./\-'+]|\*\*?)\s*/g,` $1 `).replace(/\s{2,}/g,` `).trim()}function wrap(e,t,n){let r=e.children.filter(e=>e.name!==t),i=e.children.filter(e=>e.name===t),a=r[0],o=r[Math.max(1,r.length-1)],s=a?.computedValue(),c=o?.computedValue()??null;return e.assign({children:i}).enterScope(t).pushChildren(r).exitScope(n).define(s,c)}function trackVariables(e={},t=VariableContext){let n=Fe.of({context:t.of(e)});return new l({start:n,reduce(e,n,r,i){if(n===O){let[n,r]=e.children.slice(-2);e=e.assign({value:t.of(n?.computedValue(),r?.computedValue())})}if(n===W&&(e=e.assign({value:t.of(...e.children.map(e=>e?.computedValue()))})),n===V){let[t,n]=e.children.slice(-2);e=e.assign({value:t?.computedValue()})}if(n===U){let[n,...r]=e.children;e=n?.raw===`get value`?getContextValue(e,r):e.assign({value:n?.computedValue()||t.of(void 0)})}let a=Ne[n];if(a)return e.enterScope(a);let o=Me[n];if(o){let{children:r,context:i}=e,a=r.slice(0,-1),s=last(r),c=null;return n===z&&(c=t.of(s?.computedValue())),n===H&&(c=t.of(i,s?.computedValue()).set(`item`,s?.computedValue())),e.assign({children:a}).enterScope(o).pushChild(s).assign({context:c||i})}let s=i.read(i.pos,r.pos);if(Pe[n])return e.exitScope(s);if(n===Ce){let n=e.children.filter(e=>e.name!==`ContextEntry`),r=n[0],i=last(n);return wrap(e,`ContextEntry`,s).assign({value:t.of(e.value).set(r?.computedValue(),i?.computedValue())})}if(n===ae||n===A)return wrap(e,`InExpression`,s);if(n===le)return e.define(`partial`,X.of(e=>last(e.children)?.computedValue()));if(n===pe){let t=last(e.children).computedValue();return e.define(t,1)}if(n===N||n===P||n===F){let t=e.children.slice(0,-1),n=last(e.children);return e.assign({children:t}).enterScope(`ArithmeticExpression`).pushChild(n)}if(n===I)return e.enterScope(`ArithmeticExpression`);if(n===se||n===ce||n===Te)return e.token(s);if(n===ge)return e.literal(s.replace(/^"|"$/g,``).replace(/\\(["\\])/g,`$1`));if(n===_e)return e.literal(s===`true`);if(n===he)return e.literal(parseFloat(s));if(n===me)return e.literal(null);if(n===L)return e.resolveName(`VariableName`);if(n===B)return e.resolveName(`PathName`);if(n===oe||n===we)return e.declareName();if((n===D||n===j)&&e.tokens.length>0)throw Error(`uncleared name`);if(n===D){let t=e;for(;t.parent;)t=t.exitScope(s);return t}return e}})}var Q=trackVariables({});function getContextValue(e,t){if(!t.length||(t[0].name===`Name`&&(t=extractNamedArgs(t,[`m`,`key`])),t.length!==2))return e.assign({value:null});let[n,r]=t,i=r?.computedValue(),a=n?.computedValue();return!a||typeof a!=`object`||typeof i!=`string`?e.assign({value:null}):e.assign({value:[normalizeContextKey(i),i].reduce((e,t)=>a.get(t)||e,null)})}function extractNamedArgs(e,t){let n={};for(let t=0;t<e.length;t+=2){let[r,i]=e.slice(t,t+2);n[r.value]=i}return t.map(e=>n[e])}function last(e){return e[e.length-1]}var Ie=a({StringLiteral:i.string,NumericLiteral:i.number,BooleanLiteral:i.bool,"AtLiteral!":i.special(i.string),CompareOp:i.compareOperator,ArithOp:i.arithmeticOperator,"for if then else some every return":i.controlKeyword,"in instance of and or satisfies between as":i.operatorKeyword,function:i.definitionKeyword,"Type/...":i.typeName,"Wildcard!":i.modifier,null:i.null,LineComment:i.lineComment,BlockComment:i.blockComment,"VariableName!":i.variableName,'"?"':i.self,"DateTimeConstructor! SpecialFunctionName!":i.standard(i.function(i.variableName)),"FunctionInvocation/VariableName!":i.function(i.variableName),"Name!":i.definition(i.variableName),"Key/Name! ContextEntryType/Name!":i.definition(i.propertyName),"PathExpression/PathName!":i.propertyName,"FormalParameter/ParameterName!":i.function(i.definition(i.variableName)),"( )":i.paren,"[ ]":i.squareBracket,"{ }":i.brace,".":i.derefOperator,", ;":i.separator,"..":i.punctuation}),Le={__proto__:null,for:10,in:34,return:40,if:44,then:46,else:48,some:52,every:54,satisfies:60,or:64,and:68,between:76,instance:90,of:93,days:105,time:107,duration:109,years:111,months:113,date:115,list:121,context:127,function:134,null:162,true:332,false:332,"?":176,external:192,not:217},Re=c.deserialize({version:14,states:"CvO`QYOOO`QYOOO$yQYOOOOQU'#Ce'#CeO%TQYO'#C`O&^QYO'#FTOOQQ'#Ff'#FfO&hQYO'#FfO`QYO'#DXOOQU'#Eq'#EqO(_Q^O'#D_OOQU'#D`'#D`OOQU'#D_'#D_OOQO'#Fn'#FnO*[QWO'#DyOOQQ'#EQ'#EQOOQQ'#ER'#EROOQQ'#ES'#ESO*aOWO'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!koOPQWilu|}!]!a!b!c!g!h!i!j!k!p#Y#[#^#b#f#s$P$Q$Z$_$b$q$}%X%c%x%yR#Oo",nodeNames:`⚠ LineComment BlockComment Expression ForExpression for InExpressions InExpression Name Identifier Identifier . ArithOp ArithOp ArithOp ArithOp ArithOp in IterationContext .. return IfExpression if then else QuantifiedExpression some every InExpressions InExpression satisfies Disjunction or Conjunction and Comparison CompareOp CompareOp between PositiveUnaryTest ( PositiveUnaryTests ) ArithmeticExpression InstanceOfExpression instance of Type QualifiedName VariableName BacktickIdentifier SpecialType days time duration years months date > ListType list < ContextType context ContextEntryTypes ContextEntryType FunctionType function ArgumentTypes ArgumentType PathExpression PathName ] FilterExpression [ FunctionInvocation SpecialFunctionName NamedParameters NamedParameter ParameterName PositionalParameters null NumericLiteral StringLiteral BooleanLiteral DateTimeLiteral DateTimeConstructor AtLiteral ? SimplePositiveUnaryTest Interval ParenthesizedExpression List FunctionDefinition FormalParameters FormalParameter external FunctionBody } { Context ContextEntry Key Name Identifier Expressions UnaryTests Wildcard not`,maxTerm:174,context:Q,nodeProps:[[`group`,-17,4,21,25,31,33,35,43,44,70,73,75,88,89,91,92,93,100,`Expr`,49,`Expr Expr`,-5,81,82,83,84,85,`Expr Literal`],[`closedBy`,40,`)`,74,`]`,99,`}`],[`openedBy`,42,`(`,72,`[`,98,`{`]],propSources:[Ie],skippedNodes:[0,1,2],repeatNodeCount:14,tokenData:".v~RvXY#iYZ$^Z[#i]^$^pq#iqr$crs$nwx(Wxy(]yz(bz{(g{|(t|}(y}!O)O!O!P)]!P!Q*g!Q![,b![!],y!]!^-O!^!_-T!_!`$i!`!a-d!b!c-n!}#O-s#P#Q-x#Q#R(o#S#T-}#o#p.l#q#r.q$f$g#i#BY#BZ#i$IS$I_#i$I|$I}$^$I}$JO$^$JT$JU#i$KV$KW#i&FU&FV#i?HT?HU#i~#nY#u~XY#iZ[#ipq#i$f$g#i#BY#BZ#i$IS$I_#i$JT$JU#i$KV$KW#i&FU&FV#i?HT?HU#i~$cO#v~~$fP!_!`$i~$nOt~~$qXOY$nYZ%^Zr$nrs&zs#O$n#O#P'R#P;'S$n;'S;=`(Q<%lO$n~%aVOr%^rs%vs#O%^#O#P%{#P;'S%^;'S;=`&t<%lO%^~%{O$j~~&ORO;'S%^;'S;=`&X;=`O%^~&[WOr%^rs%vs#O%^#O#P%{#P;'S%^;'S;=`&t;=`<%l%^<%lO%^~&wP;=`<%l%^~'RO$j~$k~~'URO;'S$n;'S;=`'_;=`O$n~'bYOY$nYZ%^Zr$nrs&zs#O$n#O#P'R#P;'S$n;'S;=`(Q;=`<%l$n<%lO$n~(TP;=`<%l$n~(]O#}~~(bOx~~(gOz~~(lP_~z{(o~(tO`~~(yO]~~)OO$P~R)TP[P!`!a)WQ)]O$_Q~)bQZ~!O!P)h!Q![)m~)mOc~~)rR$i~!Q![)m!g!h){#X#Y){~*OR{|*X}!O*X!Q![*_~*[P!Q![*_~*dP$i~!Q![*_~*lQ^~z{*r!P!Q+y~*uTOz*rz{+U{;'S*r;'S;=`+s<%lO*r~+XVOz*rz{+U{!P*r!P!Q+n!Q;'S*r;'S;=`+s<%lO*r~+sOQ~~+vP;=`<%l*r~,OSP~OY+yZ;'S+y;'S;=`,[<%lO+y~,_P;=`<%l+y~,gS$i~!O!P,s!Q![,b!g!h){#X#Y){~,vP!Q![)m~-OO$]~~-TO$t~R-[P!_QuP!_!`-_P-dOuPR-kP![QuP!_!`-_~-sO$m~~-xO!l~~-}O!j~~.QTO#S-}#S#T.a#T;'S-};'S;=`.f<%lO-}~.fO$Z~~.iP;=`<%l-}~.qO#V~~.vO#U~",tokenizers:[Ae,ke,je,0,1],topRules:{Expression:[0,3],Expressions:[1,105],UnaryTests:[2,106]},dialects:{camunda:2657},dynamicPrecedences:{33:-1,70:1,75:-1,77:-1},specialized:[{term:125,get:e=>Le[e]||-1}],tokenPrec:2660}),ze=`x`;function withBacktickNamesMasked(e,t){return t.reduce((e,t)=>t.kind===`backtick_name`?e.slice(0,t.start)+ze.repeat(t.end-t.start)+e.slice(t.end):e,e)}function parseFeelTree(e,t=feelTokens(e)){return Re.parse(withBacktickNamesMasked(e,t))}var Be=` `,$={open_parenthesis:`close_parenthesis`,open_bracket:`close_bracket`,open_brace:`close_brace`},Ve=new Set(Object.values($)),He=new Set([`operator`,`keyword`]);function firstGrammarError(e){let t;return e.iterate({enter(e){e.type.isError&&(t===void 0||e.from<t)&&(t=e.from)}}),t}function isEquals(e){return e!==void 0&&e.kind===`operator`&&e.text===`=`}function doubleEqualsFindings(e){return e.flatMap((t,n)=>{let r=e[n+1];return!isEquals(t)||!isEquals(r)||r?.start!==t.end?[]:[{problem:`DOUBLE_EQUALS`,start:t.start,end:r.end,text:`==`,replacement:`=`}]})}function spacedNameFindings(e){return e.filter(e=>e.kind===`name`&&e.text.includes(Be)).map(e=>({problem:`SPACED_NAME`,start:e.start,end:e.end,text:e.text,replacement:"`"+e.text+"`"}))}function gluedNameFindings(e){return e.flatMap((t,n)=>{let r=e[n+1];return t.kind!==`number`||r===void 0||r.kind!==`name`||r.start!==t.end?[]:[{problem:`UNEXPECTED_TOKEN`,start:r.start,end:r.end,text:r.text}]})}function unclosedBracket(e){let t=[];for(let n of e){let e=t[t.length-1];n.kind in $?t.push(n):e!==void 0&&Ve.has(n.kind)&&$[e.kind]===n.kind&&t.pop()}let n=t[t.length-1];return n?{problem:`UNCLOSED_BRACKET`,start:n.start,end:n.end,text:n.text}:void 0}function missingElse(e){let t=e.find(e=>e.kind===`keyword`&&e.text===`if`);if(t&&!e.some(e=>e.kind===`keyword`&&e.text===`else`))return{problem:`MISSING_ELSE`,start:t.start,end:t.end,text:t.text}}function endsTooEarly(e){let t=e[e.length-1];return t&&He.has(t.kind)?{problem:`ENDS_TOO_EARLY`,start:t.start,end:t.end,text:t.text}:void 0}function unterminatedString(e,t){let n=e.find(e=>e.end>t);if(n&&n.kind===`bad`&&`"'`.includes(n.text.charAt(0)))return{problem:`UNTERMINATED_STRING`,start:n.start,end:n.end,text:n.text}}function unexpectedToken(e,t){let n=e.find(e=>e.end>t);return n?{problem:`UNEXPECTED_TOKEN`,start:n.start,end:n.end,text:n.text}:void 0}function feelSyntaxFinding(e){if(e.trim()===``)return;let t=feelTokens(e),n=[...doubleEqualsFindings(t),...spacedNameFindings(t),...gluedNameFindings(t)],r=n.map(e=>e.start),i=firstGrammarError(parseFeelTree(e,t));if(i!==void 0&&r.push(i),r.length===0)return;let a=Math.min(...r);return n.find(e=>e.start<=a&&a<e.end)??unclosedBracket(t)??missingElse(t)??endsTooEarly(t)??unterminatedString(t,a)??unexpectedToken(t,a)??{problem:`NOT_FEEL`,start:0,end:e.length,text:e.trim()}}export{te as i,feelTokens as n,m as r,feelSyntaxFinding as t};
6
+ %s`,this.path,this.context,indent(e,` `)),this)}token(e){return q&&console.log(`[%s] token <%s> + <%s>`,this.path,this.tokens.join(` `),e),this.assign({tokens:[...this.tokens,e]})}literal(e){return q&&console.log(`[%s] literal %o`,this.path,e),this.pushChild(this.of({name:`Literal`,value:e}))}computedValue(){for(let e=this;;e=last(e.children)){if(!e)return null;if(!o(e.value))return e.value}}contextCache(){let e=this.cache.get(this.context);return e||(e=computeContextCache(this.context),this.cache.set(this.context,e)),e}get path(){return this.parent?.path?.concat(` > `,this.name)||this.name}get(e){let t=e&&normalizeContextKey(e),n=this.contextCache().originalMap.get(t);if(n===void 0)return;let r=this.context.get(n);return r instanceof X?r.get(this):r}resolveName(e){let t=this.tokens.join(` `),n=this.assign({tokens:[]}),r=this.of({name:e,parent:n,value:this.get(t),raw:t});return q&&console.log(`[%s] resolve %s <%s=%s>`,e,r.path,t,r.value),n.pushChild(r)}pushChild(e){if(!e)return this;let t=this.assign({children:[...this.children,e]});return e.parent=t,t}pushChildren(e){let t=this;for(let n of e)t=t.pushChild(n);return t}declareName(){if(this.tokens.length===0)throw Error(`no tokens to declare name`);let e=this.tokens.join(` `);return q&&console.log(`[%s] declareName <%s>`,this.path,e),this.assign({tokens:[]}).pushChild(this.of({name:`Name`,value:e}))}define(e,t){if(typeof e!=`string`)return q&&console.log(`[%s] no define <%s=%s>`,this.path,e,t),this;q&&console.log(`[%s] define <%s=%s>`,this.path,e,t);let n=this.context,r=n.set(e,t),i=cacheKey(e,createContextCache(this.cache.get(n)||computeContextCache(n)));return this.cache.set(r,i),this.assign({context:r})}assign(e={}){return Variables.of({...this,...e})}of(e={}){let t={context:this.context,parent:this.parent};return Variables.of({...t,...e})}static of(e){let{name:t,tokens:n=[],children:r=[],parent:i=null,context:a,value:o,raw:s,__cache:c}=e;if(!a)throw Error(`must provide <context>`);return new Variables({name:t,tokens:[...n],children:[...r],context:a,parent:i,value:o,raw:s,__cache:c})}};function normalizeContextKey(e){return e.replace(/\s*([./\-'+]|\*\*?)\s*/g,` $1 `).replace(/\s{2,}/g,` `).trim()}function wrap(e,t,n){let r=e.children.filter(e=>e.name!==t),i=e.children.filter(e=>e.name===t),a=r[0],o=r[Math.max(1,r.length-1)],s=a?.computedValue(),c=o?.computedValue()??null;return e.assign({children:i}).enterScope(t).pushChildren(r).exitScope(n).define(s,c)}function trackVariables(e={},t=VariableContext){let n=Fe.of({context:t.of(e)});return new r({start:n,reduce(e,n,r,i){if(n===O){let[n,r]=e.children.slice(-2);e=e.assign({value:t.of(n?.computedValue(),r?.computedValue())})}if(n===W&&(e=e.assign({value:t.of(...e.children.map(e=>e?.computedValue()))})),n===V){let[t,n]=e.children.slice(-2);e=e.assign({value:t?.computedValue()})}if(n===U){let[n,...r]=e.children;e=n?.raw===`get value`?getContextValue(e,r):e.assign({value:n?.computedValue()||t.of(void 0)})}let a=Ne[n];if(a)return e.enterScope(a);let o=Me[n];if(o){let{children:r,context:i}=e,a=r.slice(0,-1),s=last(r),c=null;return n===z&&(c=t.of(s?.computedValue())),n===H&&(c=t.of(i,s?.computedValue()).set(`item`,s?.computedValue())),e.assign({children:a}).enterScope(o).pushChild(s).assign({context:c||i})}let s=i.read(i.pos,r.pos);if(Pe[n])return e.exitScope(s);if(n===Ce){let n=e.children.filter(e=>e.name!==`ContextEntry`),r=n[0],i=last(n);return wrap(e,`ContextEntry`,s).assign({value:t.of(e.value).set(r?.computedValue(),i?.computedValue())})}if(n===ae||n===A)return wrap(e,`InExpression`,s);if(n===le)return e.define(`partial`,X.of(e=>last(e.children)?.computedValue()));if(n===pe){let t=last(e.children).computedValue();return e.define(t,1)}if(n===N||n===P||n===F){let t=e.children.slice(0,-1),n=last(e.children);return e.assign({children:t}).enterScope(`ArithmeticExpression`).pushChild(n)}if(n===I)return e.enterScope(`ArithmeticExpression`);if(n===se||n===ce||n===Te)return e.token(s);if(n===ge)return e.literal(s.replace(/^"|"$/g,``).replace(/\\(["\\])/g,`$1`));if(n===_e)return e.literal(s===`true`);if(n===he)return e.literal(parseFloat(s));if(n===me)return e.literal(null);if(n===L)return e.resolveName(`VariableName`);if(n===B)return e.resolveName(`PathName`);if(n===oe||n===we)return e.declareName();if((n===D||n===j)&&e.tokens.length>0)throw Error(`uncleared name`);if(n===D){let t=e;for(;t.parent;)t=t.exitScope(s);return t}return e}})}var Q=trackVariables({});function getContextValue(e,t){if(!t.length||(t[0].name===`Name`&&(t=extractNamedArgs(t,[`m`,`key`])),t.length!==2))return e.assign({value:null});let[n,r]=t,i=r?.computedValue(),a=n?.computedValue();return!a||typeof a!=`object`||typeof i!=`string`?e.assign({value:null}):e.assign({value:[normalizeContextKey(i),i].reduce((e,t)=>a.get(t)||e,null)})}function extractNamedArgs(e,t){let n={};for(let t=0;t<e.length;t+=2){let[r,i]=e.slice(t,t+2);n[r.value]=i}return t.map(e=>n[e])}function last(e){return e[e.length-1]}var Ie=l({StringLiteral:c.string,NumericLiteral:c.number,BooleanLiteral:c.bool,"AtLiteral!":c.special(c.string),CompareOp:c.compareOperator,ArithOp:c.arithmeticOperator,"for if then else some every return":c.controlKeyword,"in instance of and or satisfies between as":c.operatorKeyword,function:c.definitionKeyword,"Type/...":c.typeName,"Wildcard!":c.modifier,null:c.null,LineComment:c.lineComment,BlockComment:c.blockComment,"VariableName!":c.variableName,'"?"':c.self,"DateTimeConstructor! SpecialFunctionName!":c.standard(c.function(c.variableName)),"FunctionInvocation/VariableName!":c.function(c.variableName),"Name!":c.definition(c.variableName),"Key/Name! ContextEntryType/Name!":c.definition(c.propertyName),"PathExpression/PathName!":c.propertyName,"FormalParameter/ParameterName!":c.function(c.definition(c.variableName)),"( )":c.paren,"[ ]":c.squareBracket,"{ }":c.brace,".":c.derefOperator,", ;":c.separator,"..":c.punctuation}),Le={__proto__:null,for:10,in:34,return:40,if:44,then:46,else:48,some:52,every:54,satisfies:60,or:64,and:68,between:76,instance:90,of:93,days:105,time:107,duration:109,years:111,months:113,date:115,list:121,context:127,function:134,null:162,true:332,false:332,"?":176,external:192,not:217},Re=n.deserialize({version:14,states:"CvO`QYOOO`QYOOO$yQYOOOOQU'#Ce'#CeO%TQYO'#C`O&^QYO'#FTOOQQ'#Ff'#FfO&hQYO'#FfO`QYO'#DXOOQU'#Eq'#EqO(_Q^O'#D_OOQU'#D`'#D`OOQU'#D_'#D_OOQO'#Fn'#FnO*[QWO'#DyOOQQ'#EQ'#EQOOQQ'#ER'#EROOQQ'#ES'#ESO*aOWO'#EVO*[QWO'#ETOOQQ'#ET'#ETOOQQ'#Ft'#FtOOQQ'#Fr'#FrOOQQ'#Fz'#FzOOQQ'#EX'#EXO`QYO'#EZOOQQ'#FV'#FVO*iQ^O'#FVO,`QYO'#E[O,gQWO'#E]OOQP'#GO'#GOO,lQXO'#EdOOQQ'#F{'#F{OOQQ'#FU'#FUQOQWOOOOQQ'#FW'#FWOOQQ'#F_'#F_O`QYO'#CqOOQQ'#F`'#F`O%TQYO'#CuO,zQYO'#DzOOQQ'#Fs'#FsO-PQYO'#EUOOQO'#EU'#EUO`QYO'#EYO`QYO'#EXOOQO'#F|'#F|Q-XQWOOO-^QYO'#DTO.TQWO'#FbOOQO'#DV'#DVO.`QYO'#FfO.gQWOOO/^QYO'#CdO/kQYO'#FYOOQQ'#Cc'#CcO/pQYO'#FXOOQQ'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$r%R%S%Z%^%a%d%n%v%z&]!Z!cT!Q!t!v#P#W#X#h#i#j#o#p#q#r#w$k$o$r%R%S%Z%^%a%d%n%v%z&]!kWOPQWilu|}!]!a!b!c!g!h!i!j!k!p#Y#[#^#b#f#s$P$Q$Z$_$b$q$}%X%c%x%yR&U%lT&Y%m&s!_!eT!Q!n!t!v#P#W#X#h#i#j#k#o#p#q#r#w$k$o$r%R%S%Z%^%a%d%n%v%z&]!_!gT!Q!n!t!v#P#W#X#h#i#j#k#o#p#q#r#w$k$o$r%R%S%Z%^%a%d%n%v%z&]!k^OPQWilu|}!]!a!b!c!g!h!i!j!k!p#Y#[#^#b#f#s$P$Q$Z$_$b$q$}%X%c%x%yQ!q^R!scR#{!pQ!wlR#|!p!kfOPQWilu|}!]!a!b!c!g!h!i!j!k!p#Y#[#^#b#f#s$P$Q$Z$_$b$q$}%X%c%x%y!klOPQWilu|}!]!a!b!c!g!h!i!j!k!p#Y#[#^#b#f#s$P$Q$Z$_$b$q$}%X%c%x%y!kmOPQWilu|}!]!a!b!c!g!h!i!j!k!p#Y#[#^#b#f#s$P$Q$Z$_$b$q$}%X%c%x%yR$V!x!koOPQWilu|}!]!a!b!c!g!h!i!j!k!p#Y#[#^#b#f#s$P$Q$Z$_$b$q$}%X%c%x%yR#Oo",nodeNames:`⚠ LineComment BlockComment Expression ForExpression for InExpressions InExpression Name Identifier Identifier . ArithOp ArithOp ArithOp ArithOp ArithOp in IterationContext .. return IfExpression if then else QuantifiedExpression some every InExpressions InExpression satisfies Disjunction or Conjunction and Comparison CompareOp CompareOp between PositiveUnaryTest ( PositiveUnaryTests ) ArithmeticExpression InstanceOfExpression instance of Type QualifiedName VariableName BacktickIdentifier SpecialType days time duration years months date > ListType list < ContextType context ContextEntryTypes ContextEntryType FunctionType function ArgumentTypes ArgumentType PathExpression PathName ] FilterExpression [ FunctionInvocation SpecialFunctionName NamedParameters NamedParameter ParameterName PositionalParameters null NumericLiteral StringLiteral BooleanLiteral DateTimeLiteral DateTimeConstructor AtLiteral ? SimplePositiveUnaryTest Interval ParenthesizedExpression List FunctionDefinition FormalParameters FormalParameter external FunctionBody } { Context ContextEntry Key Name Identifier Expressions UnaryTests Wildcard not`,maxTerm:174,context:Q,nodeProps:[[`group`,-17,4,21,25,31,33,35,43,44,70,73,75,88,89,91,92,93,100,`Expr`,49,`Expr Expr`,-5,81,82,83,84,85,`Expr Literal`],[`closedBy`,40,`)`,74,`]`,99,`}`],[`openedBy`,42,`(`,72,`[`,98,`{`]],propSources:[Ie],skippedNodes:[0,1,2],repeatNodeCount:14,tokenData:".v~RvXY#iYZ$^Z[#i]^$^pq#iqr$crs$nwx(Wxy(]yz(bz{(g{|(t|}(y}!O)O!O!P)]!P!Q*g!Q![,b![!],y!]!^-O!^!_-T!_!`$i!`!a-d!b!c-n!}#O-s#P#Q-x#Q#R(o#S#T-}#o#p.l#q#r.q$f$g#i#BY#BZ#i$IS$I_#i$I|$I}$^$I}$JO$^$JT$JU#i$KV$KW#i&FU&FV#i?HT?HU#i~#nY#u~XY#iZ[#ipq#i$f$g#i#BY#BZ#i$IS$I_#i$JT$JU#i$KV$KW#i&FU&FV#i?HT?HU#i~$cO#v~~$fP!_!`$i~$nOt~~$qXOY$nYZ%^Zr$nrs&zs#O$n#O#P'R#P;'S$n;'S;=`(Q<%lO$n~%aVOr%^rs%vs#O%^#O#P%{#P;'S%^;'S;=`&t<%lO%^~%{O$j~~&ORO;'S%^;'S;=`&X;=`O%^~&[WOr%^rs%vs#O%^#O#P%{#P;'S%^;'S;=`&t;=`<%l%^<%lO%^~&wP;=`<%l%^~'RO$j~$k~~'URO;'S$n;'S;=`'_;=`O$n~'bYOY$nYZ%^Zr$nrs&zs#O$n#O#P'R#P;'S$n;'S;=`(Q;=`<%l$n<%lO$n~(TP;=`<%l$n~(]O#}~~(bOx~~(gOz~~(lP_~z{(o~(tO`~~(yO]~~)OO$P~R)TP[P!`!a)WQ)]O$_Q~)bQZ~!O!P)h!Q![)m~)mOc~~)rR$i~!Q![)m!g!h){#X#Y){~*OR{|*X}!O*X!Q![*_~*[P!Q![*_~*dP$i~!Q![*_~*lQ^~z{*r!P!Q+y~*uTOz*rz{+U{;'S*r;'S;=`+s<%lO*r~+XVOz*rz{+U{!P*r!P!Q+n!Q;'S*r;'S;=`+s<%lO*r~+sOQ~~+vP;=`<%l*r~,OSP~OY+yZ;'S+y;'S;=`,[<%lO+y~,_P;=`<%l+y~,gS$i~!O!P,s!Q![,b!g!h){#X#Y){~,vP!Q![)m~-OO$]~~-TO$t~R-[P!_QuP!_!`-_P-dOuPR-kP![QuP!_!`-_~-sO$m~~-xO!l~~-}O!j~~.QTO#S-}#S#T.a#T;'S-};'S;=`.f<%lO-}~.fO$Z~~.iP;=`<%l-}~.qO#V~~.vO#U~",tokenizers:[Ae,ke,je,0,1],topRules:{Expression:[0,3],Expressions:[1,105],UnaryTests:[2,106]},dialects:{camunda:2657},dynamicPrecedences:{33:-1,70:1,75:-1,77:-1},specialized:[{term:125,get:e=>Le[e]||-1}],tokenPrec:2660}),ze=`x`;function withBacktickNamesMasked(e,t){return t.reduce((e,t)=>t.kind===`backtick_name`?e.slice(0,t.start)+ze.repeat(t.end-t.start)+e.slice(t.end):e,e)}function parseFeelTree(e,t=feelTokens(e)){return Re.parse(withBacktickNamesMasked(e,t))}var Be=` `,$={open_parenthesis:`close_parenthesis`,open_bracket:`close_bracket`,open_brace:`close_brace`},Ve=new Set(Object.values($)),He=new Set([`operator`,`keyword`]);function firstGrammarError(e){let t;return e.iterate({enter(e){e.type.isError&&(t===void 0||e.from<t)&&(t=e.from)}}),t}function isEquals(e){return e!==void 0&&e.kind===`operator`&&e.text===`=`}function doubleEqualsFindings(e){return e.flatMap((t,n)=>{let r=e[n+1];return!isEquals(t)||!isEquals(r)||r?.start!==t.end?[]:[{problem:`DOUBLE_EQUALS`,start:t.start,end:r.end,text:`==`,replacement:`=`}]})}function spacedNameFindings(e){return e.filter(e=>e.kind===`name`&&e.text.includes(Be)).map(e=>({problem:`SPACED_NAME`,start:e.start,end:e.end,text:e.text,replacement:"`"+e.text+"`"}))}function gluedNameFindings(e){return e.flatMap((t,n)=>{let r=e[n+1];return t.kind!==`number`||r===void 0||r.kind!==`name`||r.start!==t.end?[]:[{problem:`UNEXPECTED_TOKEN`,start:r.start,end:r.end,text:r.text}]})}function unclosedBracket(e){let t=[];for(let n of e){let e=t[t.length-1];n.kind in $?t.push(n):e!==void 0&&Ve.has(n.kind)&&$[e.kind]===n.kind&&t.pop()}let n=t[t.length-1];return n?{problem:`UNCLOSED_BRACKET`,start:n.start,end:n.end,text:n.text}:void 0}function missingElse(e){let t=e.find(e=>e.kind===`keyword`&&e.text===`if`);if(t&&!e.some(e=>e.kind===`keyword`&&e.text===`else`))return{problem:`MISSING_ELSE`,start:t.start,end:t.end,text:t.text}}function endsTooEarly(e){let t=e[e.length-1];return t&&He.has(t.kind)?{problem:`ENDS_TOO_EARLY`,start:t.start,end:t.end,text:t.text}:void 0}function unterminatedString(e,t){let n=e.find(e=>e.end>t);if(n&&n.kind===`bad`&&`"'`.includes(n.text.charAt(0)))return{problem:`UNTERMINATED_STRING`,start:n.start,end:n.end,text:n.text}}function unexpectedToken(e,t){let n=e.find(e=>e.end>t);return n?{problem:`UNEXPECTED_TOKEN`,start:n.start,end:n.end,text:n.text}:void 0}function feelSyntaxFinding(e){if(e.trim()===``)return;let t=feelTokens(e),n=[...doubleEqualsFindings(t),...spacedNameFindings(t),...gluedNameFindings(t)],r=n.map(e=>e.start),i=firstGrammarError(parseFeelTree(e,t));if(i!==void 0&&r.push(i),r.length===0)return;let a=Math.min(...r);return n.find(e=>e.start<=a&&a<e.end)??unclosedBracket(t)??missingElse(t)??endsTooEarly(t)??unterminatedString(t,a)??unexpectedToken(t,a)??{problem:`NOT_FEEL`,start:0,end:e.length,text:e.trim()}}export{te as i,feelTokens as n,m as r,feelSyntaxFinding as t};
@@ -1 +1 @@
1
- import"./rolldown-runtime-B8BYMn-z.js";import{i as e}from"./translator-DLDFsUlE.js";var t=`https://unpkg.com/@camunda/zeebe-element-templates-json-schema/resources/schema.json`;function bindingNameOf(e){let t=e.binding;return t?t.name?t.name:t.type===`zeebe:output`&&t.source&&t.source.replace(/^=\s*/,``)||null:null}var n=bindingNameOf;function templateDrift(e,t){let r=new Map;for(let t of e.properties){if(t.binding?.type===`zeebe:output`||t.binding?.type===`camunda:taskDefinition`)continue;let e=n(t);e&&r.set(e,t.type)}let i=new Map(t.inputs.map(e=>[e.name,e.type])),a=[...i.keys()].filter(e=>!r.has(e)),o=[...r.keys()].filter(e=>!i.has(e)),s=[...i.keys()].filter(e=>r.has(e)&&r.get(e)!==i.get(e));return a.length===0&&o.length===0&&s.length===0?null:{missing:a,extra:o,changed:s}}function driftText(t){return[...t.missing.map(t=>e(`app.templates.drift.noLongerRead`,{name:t})),...t.extra.map(t=>e(`app.templates.drift.notRead`,{name:t})),...t.changed.map(t=>e(`app.templates.drift.differentType`,{name:t}))].join(`; `)}export{templateDrift as i,bindingNameOf as n,driftText as r,t};
1
+ import"./rolldown-runtime-B8BYMn-z.js";import{i as e}from"./translator-BLCeE6UY.js";var t=`https://unpkg.com/@camunda/zeebe-element-templates-json-schema/resources/schema.json`;function bindingNameOf(e){let t=e.binding;return t?t.name?t.name:t.type===`zeebe:output`&&t.source&&t.source.replace(/^=\s*/,``)||null:null}var n=bindingNameOf;function templateDrift(e,t){let r=new Map;for(let t of e.properties){if(t.binding?.type===`zeebe:output`||t.binding?.type===`camunda:taskDefinition`)continue;let e=n(t);e&&r.set(e,t.type)}let i=new Map(t.inputs.map(e=>[e.name,e.type])),a=[...i.keys()].filter(e=>!r.has(e)),o=[...r.keys()].filter(e=>!i.has(e)),s=[...i.keys()].filter(e=>r.has(e)&&r.get(e)!==i.get(e));return a.length===0&&o.length===0&&s.length===0?null:{missing:a,extra:o,changed:s}}function driftText(t){return[...t.missing.map(t=>e(`app.templates.drift.noLongerRead`,{name:t})),...t.extra.map(t=>e(`app.templates.drift.notRead`,{name:t})),...t.changed.map(t=>e(`app.templates.drift.differentType`,{name:t}))].join(`; `)}export{templateDrift as i,bindingNameOf as n,driftText as r,t};
@@ -0,0 +1 @@
1
+ import{i as e,r as t}from"./rolldown-runtime-B8BYMn-z.js";import{C as n}from"./frontend-uXAWaalt.js";import{r}from"./moddle-f0Q4Guwd.js";import{a as i,o as a}from"./xml-DIWt4von.js";import{o,u as s}from"./file-BbVBUuIH.js";import{t as c}from"./steps-BB_6M1MU.js";import{i as l}from"./translator-BLCeE6UY.js";import{i as u,t as d}from"./engines-lyEvb0pH.js";import{t as f}from"./list-TmXvCwja.js";import{r as p,t as m}from"./say-C7KqKcFr.js";import{_ as h}from"./descriptors-B5VIyY5g.js";import{t as g}from"./bridgeInstance-qzSInqLW.js";function declaredIds(e,t){try{if(e===`form`){let e=JSON.parse(t).id;return typeof e==`string`?[e]:[]}return i(a(t),e).map(e=>e.attrs.id).filter(e=>typeof e==`string`&&e!==``)}catch{return[]}}var _=new Set(`and.or.not.true.false.null.if.then.else.for.in.return.some.every.satisfies.instance.of.between.function.execution.task.string.number.date.time.duration.count.sum.min.max.contains.is.defined.now.today.list.context.get.value.length.size.substring.upper.lower.case.matches.replace.split.append.concatenate.flatten.distinct.values.entries.abs.floor.ceiling.round.decimal.odd.even.mean.median.all.any`.split(`.`)),words=e=>e.replace(`bpmn:`,``).replace(/([a-z])([A-Z])/g,`$1 $2`).toLowerCase();function label$1(e){let t=e.name?.replace(/\s+/g,` `).trim();return t?`"${t}"`:l(`app.rules.flow.theNode`,{node:words(e.$type)})}e(label$1,`label`);function bodyOf(e){let t=(e?.body??e?.$body??``).trim();if(!t)return null;if(t.startsWith(`=`))return t.slice(1).trim();let n=/^[$#]\{([\s\S]*)\}$/.exec(t);return n?n[1].trim():t}function splitTop(e,t){let n=[],r=0,i=null,a=0;for(let o=0;o<e.length;o+=1){let s=e[o];if(i)s===i&&(i=null);else if(s===`"`||s===`'`)i=s;else if(s===`(`)r+=1;else if(s===`)`)--r;else if(r===0){let r=e.slice(o),i=t.exec(r);i&&i.index===0&&(n.push(e.slice(a,o)),o+=i[0].length-1,a=o+1)}}return n.push(e.slice(a)),n.map(e=>e.trim()).filter(Boolean)}function unwrap(e){let t=e.trim();for(;t.startsWith(`(`)&&t.endsWith(`)`);){let e=0,n=-1;for(let r=0;r<t.length;r+=1)if(t[r]===`(`&&(e+=1),t[r]===`)`&&--e,e===0){n=r;break}if(n!==t.length-1)break;t=t.slice(1,-1).trim()}return t}var v=e(e=>e&&e[0].toUpperCase()+e.slice(1),`capitalize`),y={lo:null,hi:null};function intersect(e,t){let n=e.lo?t.lo?e.lo.value>t.lo.value||e.lo.value===t.lo.value&&e.lo.open?e.lo:t.lo:e.lo:t.lo,r=e.hi?t.hi?e.hi.value<t.hi.value||e.hi.value===t.hi.value&&e.hi.open?e.hi:t.hi:e.hi:t.hi;return n&&r&&(n.value>r.value||n.value===r.value&&(n.open||r.open))?null:{lo:n,hi:r}}function complement(e){let t=[...e].sort((e,t)=>!e.lo||!t.lo?e.lo?1:t.lo?-1:0:e.lo.value-t.lo.value||Number(e.lo.open)-Number(t.lo.open)),n=[],r=null,i=!1;for(let e of t){if(!i){if(e.lo&&n.push({lo:null,hi:{value:e.lo.value,open:!e.lo.open}}),i=!0,!e.hi)return n;r=e.hi;continue}let t=r,a=e.lo;if((a.value>t.value||a.value===t.value&&t.open&&a.open)&&n.push({lo:{value:t.value,open:!t.open},hi:{value:a.value,open:!a.open}}),!e.hi)return n;(e.hi.value>t.value||e.hi.value===t.value&&t.open&&!e.hi.open)&&(r=e.hi)}if(!i)return[y];let a=r;return n.push({lo:{value:a.value,open:!a.open},hi:null}),n}function comparison(e){let t=/^([A-Za-z_][\w.]*)\s*(<=|>=|!=|==|=|<|>)\s*(-?\d+(?:\.\d+)?|"[^"]*"|'[^']*'|true|false)$/.exec(e)??/^(-?\d+(?:\.\d+)?|"[^"]*"|'[^']*')\s*(<=|>=|!=|==|=|<|>)\s*([A-Za-z_][\w.]*)$/.exec(e);if(!t)return null;let n=/^-?\d|^["']/.test(t[1]),r=n?t[3]:t[1],i=n?t[1]:t[3],a=n?{"<":`>`,">":`<`,"<=":`>=`,">=":`<=`}[t[2]]??t[2]:t[2];if(i===`true`||i===`false`){let e=i===`true`;return a===`=`||a===`==`?{kind:`boolean`,variable:r,values:new Set([e])}:a===`!=`?{kind:`boolean`,variable:r,values:new Set([!e])}:null}if(/^["']/.test(i)){let e=i.slice(1,-1);return a===`=`||a===`==`?{kind:`string`,variable:r,values:new Set([e]),others:!1}:a===`!=`?{kind:`string`,variable:r,values:new Set([e]),others:!0}:null}let o=Number(i);return{kind:`number`,variable:r,intervals:{"<":[{lo:null,hi:{value:o,open:!0}}],"<=":[{lo:null,hi:{value:o,open:!1}}],">":[{lo:{value:o,open:!0},hi:null}],">=":[{lo:{value:o,open:!1},hi:null}],"=":[{lo:{value:o,open:!1},hi:{value:o,open:!1}}],"==":[{lo:{value:o,open:!1},hi:{value:o,open:!1}}],"!=":[{lo:null,hi:{value:o,open:!0}},{lo:{value:o,open:!0},hi:null}]}[a]}}function parseCondition(e){let t=unwrap(e),n=splitTop(t,/^(\s+or\s+|\s*\|\|\s*)/);if(n.length>1){let e=n.map(parseCondition);return e.some(e=>!e)||new Set(e.map(e=>`${e?.kind}:${e?.variable}`)).size!==1?null:e.reduce((e,t)=>union(e,t))}let r=splitTop(t,/^(\s+and\s+|\s*&&\s*)/);if(r.length>1){let e=r.map(parseCondition);return e.some(e=>!e)||new Set(e.map(e=>`${e?.kind}:${e?.variable}`)).size!==1?null:e.reduce((e,t)=>both(e,t))}let i=/^(?:not\s*\(([\s\S]*)\)|!\s*([A-Za-z_][\w.]*))$/.exec(t);if(i){let e=parseCondition(i[1]??i[2]);return e?invert(e):null}return/^[A-Za-z_][\w.]*$/.test(t)&&!_.has(t)?{kind:`boolean`,variable:t,values:new Set([!0])}:comparison(t)}function union(e,t){if(e.kind===`number`&&t.kind===`number`)return{...e,intervals:[...e.intervals,...t.intervals]};if(e.kind===`boolean`&&t.kind===`boolean`)return{...e,values:new Set([...e.values,...t.values])};let n=e,r=t;if(n.others&&r.others)return{...n,values:new Set([...n.values].filter(e=>r.values.has(e))),others:!0};if(n.others||r.others){let[e,t]=n.others?[n,r]:[r,n];return{...e,values:new Set([...e.values].filter(e=>!t.values.has(e))),others:!0}}return{...n,values:new Set([...n.values,...r.values]),others:!1}}function both(e,t){if(e.kind===`number`&&t.kind===`number`){let n=e.intervals.flatMap(e=>t.intervals.map(t=>intersect(e,t)).filter(e=>!!e));return{...e,intervals:n}}return e.kind===`boolean`&&t.kind===`boolean`?{...e,values:new Set([...e.values].filter(e=>t.values.has(e)))}:invert(union(invert(e),invert(t)))}function invert(e){return e.kind===`number`?{...e,intervals:complement(e.intervals)}:e.kind===`boolean`?{...e,values:new Set([!0,!1].filter(t=>!e.values.has(t)))}:{...e,others:!e.others}}function bound(e){return String(e.value)}function describeInterval(e,t){let{lo:n,hi:r}=t;return n&&r&&n.value===r.value?l(`app.rules.flow.isValue`,{variable:e,bound:bound(n)}):!n&&r?l(`app.rules.flow.isBound`,{variable:e,side:r.open?l(`app.rules.flow.below`):l(`app.rules.flow.atMost`),bound:bound(r)}):n&&!r?l(`app.rules.flow.isBound`,{variable:e,side:n.open?l(`app.rules.flow.above`):l(`app.rules.flow.atLeast`),bound:bound(n)}):n&&r?l(`app.rules.flow.isBetween`,{variable:e,lo:bound(n),hi:bound(r),exclusive:n.open||r.open?l(`app.rules.flow.exclusive`):``}):l(`app.rules.flow.hasAnyValue`,{variable:e})}function gapsOf(e){let t=e[0];if(t.kind===`number`)return complement(e.flatMap(e=>e.intervals)).map(e=>describeInterval(t.variable,e));if(t.kind===`boolean`){let n=new Set(e.flatMap(e=>[...e.values]));return[!0,!1].filter(e=>!n.has(e)).map(e=>l(`app.rules.flow.isValue`,{variable:t.variable,bound:e}))}let n=e.reduce((e,t)=>union(e,t));return n.kind===`string`?n.others?[...n.values].map(e=>l(`app.rules.flow.isValue`,{variable:t.variable,bound:`"${e}"`})):[l(`app.rules.flow.isAnythingBut`,{variable:t.variable,values:[...n.values].map(e=>`"${e}"`).join(l(`app.rules.flow.comma`))})]:[]}function overlapOf(e,t){let n=both(e,t);return n.kind===`number`?n.intervals[0]?describeInterval(e.variable,n.intervals[0]):null:n.kind===`boolean`?n.values.size>0?l(`app.rules.flow.isValue`,{variable:e.variable,bound:[...n.values][0]}):null:n.others?l(`app.rules.flow.isSomeOtherValue`,{variable:e.variable}):n.values.size>0?l(`app.rules.flow.isValue`,{variable:e.variable,bound:`"${[...n.values][0]}"`}):null}function*elementsOf(e){let t=new Set,n=[];for(let t of e.rootElements??[])t.$type===`bpmn:Process`&&n.push(t),t.$type===`bpmn:Collaboration`&&t.participants?.forEach(e=>e.processRef&&n.push(e.processRef));for(;n.length>0;){let e=n.pop();if(!t.has(e)){t.add(e);for(let t of e.flowElements??[])yield t,t.flowElements&&n.push(t)}}}function checkGateway(e,t){if(t.length<2||e.default)return[];let n=t.map(e=>({flow:e,body:bodyOf(e.conditionExpression)}));if(n.some(e=>e.body===null))return[];let r=e.$type===`bpmn:ExclusiveGateway`,i=n.map(e=>parseCondition(e.body)),a=i.every(e=>e&&e.kind===i[0]?.kind&&e.variable===i[0]?.variable),o=e.id??``;if(!a)return[{kind:`NO-DEFAULT`,title:p(`flow`,`NO-DEFAULT`),detail:l(`app.rules.flow.noDefaultFlow`,{gateway:v(label$1(e))}),elements:[o],trace:[]}];let s=i,c=[],u=gapsOf(s);if(u.length>0&&c.push({kind:`NO-WAY-OUT`,title:p(`flow`,`NO-WAY-OUT`),detail:l(`app.rules.flow.noWayOut`,{gateway:v(label$1(e)),gaps:u.join(l(`app.rules.flow.orWhen`))}),elements:[o],trace:[]}),r)for(let n=0;n<s.length;n+=1)for(let r=n+1;r<s.length;r+=1){let i=overlapOf(s[n],s[r]);if(!i)continue;let flowName=e=>e.name?.trim()?`"${e.name.trim()}"`:l(`app.rules.flow.theFlowTo`,{target:e.targetRef?label$1(e.targetRef):l(`app.rules.flow.theNextStep`)});c.push({kind:`OVERLAP`,title:p(`flow`,`OVERLAP`),detail:l(`app.rules.flow.bothConditionsHold`,{shared:i,first:flowName(t[n]),second:flowName(t[r]),gateway:label$1(e)}),elements:[o,t[n].id??``,t[r].id??``],trace:[]})}return c}function identifiers(e){return[...e.replace(/"[^"]*"|'[^']*'/g,` `).matchAll(/[A-Za-z_][\w]*/g)].map(e=>e[0]).filter(e=>!_.has(e))}function variablesOf(e){let t=[],n=bodyOf(e.conditionExpression);n&&t.push(...identifiers(n));let r=e.$attrs??{},i=e.resultVariable??r[`camunda:resultVariable`];typeof i==`string`&&t.push(i);let visit=e=>{if(!e)return;let n=e.$type??``;if(/zeebe:(input|output)$/.test(n)&&(typeof e.target==`string`&&t.push(e.target),typeof e.source==`string`&&e.source.trim().startsWith(`=`)&&t.push(...identifiers(e.source.trim().slice(1)))),/camunda:(inputParameter|outputParameter)$/.test(n)){typeof e.name==`string`&&t.push(e.name);let n=e.$body??e.value;if(typeof n==`string`)for(let e of n.matchAll(/[$#]\{([^}]*)\}/g))t.push(...identifiers(e[1]))}for(let t of[`$children`,`values`,`inputParameters`,`outputParameters`,`inputParameter`,`outputParameter`]){let n=e[t];Array.isArray(n)&&n.forEach(e=>visit(e))}};return(e.extensionElements?.values??[]).forEach(visit),t.map(t=>({name:t.split(`.`)[0],element:e.id??``}))}function oneEditApart(e,t){if(e===t||Math.abs(e.length-t.length)>1)return!1;let n=0;for(;n<e.length&&n<t.length&&e[n]===t[n];)n+=1;let rest=(e,t)=>e.slice(t);return e.length===t.length?rest(e,n+1)===rest(t,n+1)||e[n]===t[n+1]&&e[n+1]===t[n]&&rest(e,n+2)===rest(t,n+2):e.length>t.length?rest(e,n+1)===rest(t,n):rest(e,n)===rest(t,n+1)}function lookalikes(e){let t=new Map;e.forEach(e=>t.set(e.name,new Set([...t.get(e.name)??[],e.element])));let n=[...t.keys()].sort(),r=[];for(let e=0;e<n.length;e+=1)for(let i=e+1;i<n.length;i+=1){let[a,o]=[n[e],n[i]];if(/\d$/.test(a)&&/\d$/.test(o))continue;let s=a.toLowerCase()===o.toLowerCase(),c=Math.min(a.length,o.length)>=5&&oneEditApart(a,o);(s||c)&&r.push({kind:`LOOKALIKE`,title:p(`flow`,`LOOKALIKE`),detail:l(`app.rules.flow.lookalikeNames`,{first:a,second:o,difference:l(s?`app.rules.flow.letterCaseOnly`:`app.rules.flow.oneCharacter`)}),elements:[...new Set([...t.get(a)??[],...t.get(o)??[]])].filter(Boolean),trace:[]})}return r}function analyzeDecisions(e){let t=e,n=[],r=[],i=[...elementsOf(t)],a=new Map;for(let e of i)e.$type===`bpmn:SequenceFlow`&&e.sourceRef&&a.set(e.sourceRef,[...a.get(e.sourceRef)??[],e]);for(let e of i)(e.$type===`bpmn:ExclusiveGateway`||e.$type===`bpmn:InclusiveGateway`)&&n.push(...checkGateway(e,a.get(e)??[])),r.push(...variablesOf(e));return n.push(...lookalikes(r)),n}function conditionBody(e){let t=e.trim();if(t.startsWith(`=`))return t.slice(1).trim();let n=/^[$#]\{([\s\S]*)\}$/.exec(t);return n?n[1].trim():t}function inside(e,t){let n=!e.lo||(e.lo.open?t>e.lo.value:t>=e.lo.value),r=!e.hi||(e.hi.open?t<e.hi.value:t<=e.hi.value);return n&&r}function pick(e){if(e.kind===`boolean`)return[...e.values][0];if(e.kind===`string`){if(!e.others)return[...e.values][0];let t=`other`;for(let n=2;e.values.has(t);n+=1)t=`other${n}`;return t}for(let t of e.intervals){let e=[t.lo?t.lo.open?Math.floor(t.lo.value)+1:t.lo.value:null,t.hi?t.hi.open?Math.ceil(t.hi.value)-1:t.hi.value:null,t.lo&&t.hi?(t.lo.value+t.hi.value)/2:null,0].find(e=>e!==null&&inside(t,e));if(e!==void 0)return e}}function empty(e){return e.kind===`number`?e.intervals.length===0:(e.kind===`boolean`||!e.others)&&e.values.size===0}function valuesFor(e){let t=new Map,n=[],r=[],narrow=(e,r,i,a=n)=>{let o=t.get(e.variable);if(o&&o.kind!==e.kind){i&&a.push(r);return}let s=o?both(o,e):e;empty(s)?i&&a.push(r):t.set(e.variable,s)};for(let t of e)for(let e of t.takes){let t=parseCondition(conditionBody(e));t?narrow(t,e,!0):n.push(e)}for(let t of e)for(let e of t.avoids){let n=parseCondition(conditionBody(e));n?narrow(invert(n),e,t.takes.length===0,r):t.takes.length===0&&r.push(e)}let i={};for(let[e,r]of t){let t=pick(r);t===void 0?n.push(e):i[e]=t}return{values:i,unresolved:n,avoided:r}}var b=2e4,x=4,title=e=>p(`flow`,e),capitalize=e=>e&&e[0].toUpperCase()+e.slice(1);function kindOf$1(e){switch(e.$type){case`bpmn:StartEvent`:return`start`;case`bpmn:EndEvent`:return`end`;case`bpmn:ExclusiveGateway`:case`bpmn:EventBasedGateway`:case`bpmn:ComplexGateway`:return`xor`;case`bpmn:ParallelGateway`:return`and`;case`bpmn:InclusiveGateway`:return`or`;case`bpmn:BoundaryEvent`:return`boundary`;default:return`activity`}}e(kindOf$1,`kindOf`);var S=new Set([`bpmn:SequenceFlow`,`bpmn:DataObject`,`bpmn:DataObjectReference`,`bpmn:DataStoreReference`]);function scopesOf(e){let t=[],n=[],r=new Set,add=e=>{e&&!r.has(e)&&(r.add(e),n.push(e))};for(let t of e.rootElements??[])t.$type===`bpmn:Process`&&add(t),t.$type===`bpmn:Collaboration`&&t.participants?.forEach(e=>add(e.processRef));for(let e=0;e<n.length;e+=1){let r=n[e],i=r.flowElements??[],a=new Map;for(let e of i){if(S.has(e.$type)||!e.id||(e.$type===`bpmn:SubProcess`||e.$type===`bpmn:Transaction`||e.$type===`bpmn:AdHocSubProcess`)&&(add(e),e.triggeredByEvent))continue;let t=kindOf$1(e);a.set(e,{id:e.id,named:!!e.name?.trim(),name:e.name?.replace(/\s+/g,` `).trim()||m(e.$type),kind:t,incoming:[],outgoing:[],defaultFlow:null,terminate:(e.eventDefinitions??[]).some(e=>e.$type===`bpmn:TerminateEventDefinition`),boundaries:[],interrupting:e.cancelActivity!==!1,outgoingNodes:[],host:null,plain:(e.eventDefinitions??[]).length===0})}let o=[];for(let e of i){if(e.$type!==`bpmn:SequenceFlow`)continue;let t=e.sourceRef&&a.get(e.sourceRef),n=e.targetRef&&a.get(e.targetRef);if(!t||!n||!e.id)continue;let r=o.length;o.push({id:e.id,name:e.name?.replace(/\s+/g,` `).trim()??``,source:t,target:n,conditional:!!e.conditionExpression,condition:e.conditionExpression?.body?.trim()??``}),t.outgoing.push(r),t.outgoingNodes.push(n),n.incoming.push(r)}for(let[e,t]of a){e.default&&(t.defaultFlow=o.findIndex(t=>t.id===e.default?.id)),t.defaultFlow===-1&&(t.defaultFlow=null);let n=t.kind===`boundary`&&e.attachedToRef?a.get(e.attachedToRef):void 0;n&&(n.boundaries.push(t),t.host=n)}a.size>0&&t.push({id:r.id??`scope-${e}`,nodes:[...a.values()],flows:o})}return t}function subsets(e){if(e.length===0)return[];if(e.length>x)return[...e.map(e=>[e]),e];let t=[];for(let n=1;n<1<<e.length;n+=1)t.push(e.filter((e,t)=>n&1<<t));return t}function choices(e,t){let n=e.outgoing;if(n.length===0)return[[]];if(e.kind===`xor`)return n.map(e=>[e]);if(e.kind===`and`)return[n];let r=n.filter(n=>n!==e.defaultFlow&&(e.kind===`or`||t[n].conditional)),i=e.kind===`or`?[]:n.filter(t=>!r.includes(t)&&t!==e.defaultFlow),a=subsets(r).map(e=>[...i,...e]);return e.defaultFlow!==null&&a.push([...i,e.defaultFlow]),r.length===0&&e.defaultFlow===null?[i]:a.length>0?a:[i]}function reachability(e){let t=e.flows.length,n=e.flows.map(()=>Array(t).fill(!1));return e.flows.forEach((t,r)=>{let i=[...t.target.outgoing];for(;i.length>0;){let t=i.pop();n[r][t]||(n[r][t]=!0,i.push(...e.flows[t].target.outgoing))}}),n}function label(e){if(e.named)return`"${e.name}"`;let t=e.outgoingNodes.find(e=>e.named);return t?l(`app.rules.flow.nodeBefore`,{node:e.name,next:t.name}):l(`app.rules.flow.theNode`,{node:e.name})}function sourceLabel(e){return e.source.named?`"${e.source.name}"`:l(`app.rules.flow.theBranchThrough`,{node:e.source.name})}function downstream(e){let t=new Set,n=[...e];for(;n.length>0;){let e=n.pop();if(!t.has(e.id)){t.add(e.id);for(let t of e.boundaries)n.push(t);n.push(...e.outgoingNodes)}}return t}function explore(e,t){let n=reachability(e),r=new Set(t.fired),i=[],key=e=>e.join(`,`),a=new Map([[key(t.tokens),0]]),o=[t.tokens],s=[{from:-1,fired:t.fired}],c=[],u=[],d=!1,f=new Set,p=new Set,m=new Set,doubledAt=t=>p.has(t.id)||m.has(t.id)?!0:(p.add(t.id),m=downstream([...p].map(t=>e.nodes.find(e=>e.id===t))),!1),traceTo=e=>{let t=[];for(let n=e;n>=0;n=s[n].from)t.unshift(...s[n].fired);return t};for(let t=0;t<o.length;t+=1){let p=o[t],m=[],h=[],push=(n,c,u,g=!1,_=null)=>{let v=g?p.map(()=>0):[...p];g||(n.forEach(e=>--v[e]),c.forEach(e=>v[e]+=1)),u.forEach(e=>r.add(e));let y=v.findIndex(e=>e>1);if(y>=0){let n=e.flows[y].target;if(doubledAt(n))return;i.push({kind:`NO-SYNCHRONIZATION`,title:title(`NO-SYNCHRONIZATION`),detail:l(`app.rules.flow.twoTokensAtOnce`,{node:label(n)}),elements:[n.id],trace:[...traceTo(t),...u,n.id]});return}let x=key(v),S=a.get(x);if(S===void 0){if(o.length>=b){d=!0,f.add(t);return}S=o.length,a.set(x,S),o.push(v),s.push({from:t,fired:u})}m.push(S),h.push({to:S,fired:u,choice:_,produced:g?[]:c.map(t=>e.flows[t].id)})};for(let r of e.nodes){if(r.kind===`boundary`||r.kind===`start`)continue;let a=r.incoming.filter(e=>p[e]>0);if(a.length!==0){if(r.kind===`and`)a.length===r.incoming.length&&push(r.incoming,r.outgoing,[r.id]);else if((r.kind===`activity`||r.kind===`xor`)&&a.length>1&&!doubledAt(r)&&i.push({kind:`NO-SYNCHRONIZATION`,title:title(`NO-SYNCHRONIZATION`),detail:l(`app.rules.flow.twoBranchesAtOnce`,{node:label(r)}),elements:[r.id],trace:traceTo(t)}),r.kind===`or`){if(r.incoming.filter(e=>p[e]===0).some(e=>p.some((t,i)=>t>0&&!r.incoming.includes(i)&&n[i][e])))continue;let t=choices(r,e.flows);for(let e of t)push(a,e,[r.id],!1,t.length>1?{node:r.id,ways:e,boundary:null}:null)}else for(let t of a){if(r.kind===`end`){push([t],[],[r.id],r.terminate);continue}let n=choices(r,e.flows);for(let e of n){push([t],e,[r.id],!1,n.length>1?{node:r.id,ways:e,boundary:null}:null);for(let n of r.boundaries){let i=n.interrupting?n.outgoing:[...e,...n.outgoing];push([t],i,[r.id,n.id],!1,{node:r.id,ways:e,boundary:n.id})}}}}}c.push(m),u.push(h)}let h=o.map(()=>[]);c.forEach((e,t)=>e.forEach(e=>h[e].push(t)));let backwards=e=>{let t=Array(o.length).fill(!1),n=[...e];for(n.forEach(e=>t[e]=!0);n.length>0;){let e=n.pop();for(let r of h[e])t[r]||(t[r]=!0,n.push(r))}return t},explored=e=>c[e]!==void 0,busy=e=>o[e].some(e=>e>0),g=o.map((e,t)=>t).filter(e=>!busy(e)),_=o.map((e,t)=>t).filter(e=>busy(e)&&explored(e)&&c[e].length===0&&!f.has(e)),v=backwards([...g,...f]),y=backwards(_),waitingAt=t=>[...new Set(t.flatMap((t,n)=>t>0?[e.flows[n].target]:[]))],x=_.find(e=>!v[e]);if(x!==void 0){let t=o[x],n=waitingAt(t),r=traceTo(x),a=new Map(e.nodes.map(e=>[e.id,e])),s=[...r].reverse().map(e=>a.get(e)).find(e=>e&&(e.kind===`xor`||e.kind===`or`||e.kind===`boundary`)),c=s?s.kind===`boundary`?l(`app.rules.flow.leftThroughBoundary`,{host:s.host?label(s.host):l(`app.rules.flow.anActivity`),event:s.named?` ${label(s)}`:``}):l(`app.rules.flow.sentDownAnotherBranch`,{turn:capitalize(label(s))}):``,u=n.map(n=>{let r=n.incoming.filter(e=>t[e]===0).map(t=>sourceLabel(e.flows[t])),i=label(n);return r.length>0?l(`app.rules.flow.waitsFor`,{who:capitalize(i),missing:r.join(l(`app.rules.flow.and`)),arrives:r.length===1?l(`app.rules.flow.arrives`):l(`app.rules.flow.arrive`)}):l(`app.rules.flow.waitsAndCannotContinue`,{who:capitalize(i)})}).join(` `)+c;i.push({kind:`DEADLOCK`,title:title(`DEADLOCK`),detail:u,elements:n.map(e=>e.id),trace:r})}let S=o.findIndex((e,t)=>busy(t)&&explored(t)&&!v[t]&&!y[t]);if(S>=0&&!d){let e=waitingAt(o[S]);i.push({kind:`NEVER-FINISHES`,title:title(`NEVER-FINISHES`),detail:l(`app.rules.flow.noPathToAnEnd`,{nodes:e.map(label).join(l(`app.rules.flow.and`))}),elements:e.map(e=>e.id),trace:traceTo(S)})}d&&i.push({kind:`TOO-COMPLEX`,title:title(`TOO-COMPLEX`),detail:l(`app.rules.flow.tooManyStates`,{states:b}),elements:[],trace:[]});let C=i.filter(e=>e.kind===`DEADLOCK`).flatMap(e=>e.elements),w=downstream(e.nodes.filter(e=>C.includes(e.id)));return m.forEach(e=>w.add(e)),{problems:i,fired:r,states:o.length,consequences:w,graph:{tokens:o,edges:u}}}function initialsOf(e){let t=e.nodes.filter(e=>e.kind===`start`),n=e.nodes.filter(e=>e.kind===`activity`&&e.incoming.length===0);return t.length>0?t.map(t=>{let n=e.flows.map(()=>0);return t.outgoing.forEach(e=>n[e]+=1),{fired:[t.id],tokens:n,flows:t.outgoing.map(t=>e.flows[t].id)}}):[{fired:n.map(e=>e.id),tokens:e.flows.map((e,t)=>+!!n.some(e=>e.outgoing.includes(t))),flows:e.flows.filter((e,t)=>n.some(e=>e.outgoing.includes(t))).map(e=>e.id)}]}function analyzeScope(e){let t=initialsOf(e),n=new Set,r=new Set,i=[],a=0;for(let o of t){let t=explore(e,o);t.fired.forEach(e=>n.add(e)),t.consequences.forEach(e=>r.add(e)),i.push(...t.problems),a+=t.states}for(let t of e.nodes){if(n.has(t.id)||t.kind===`start`||r.has(t.id))continue;let e=t.incoming.length===0&&t.kind!==`boundary`?l(`app.rules.flow.nothingLeadsToIt`):l(`app.rules.flow.noPathReachesIt`);i.push({kind:`DEAD-ELEMENT`,title:title(`DEAD-ELEMENT`),detail:l(`app.rules.flow.neverRuns`,{node:capitalize(label(t)),cause:e}),elements:[t.id],trace:[]})}return{problems:i,fired:n,states:a,consequences:r}}function analyzeFlow(e){let t=scopesOf(e),n=[...analyzeDecisions(e)],r=0;for(let e of t){let t=analyzeScope(e);r+=t.states;for(let e of t.problems)n.some(t=>t.kind===e.kind&&t.elements.join()===e.elements.join())||n.push(e)}return{problems:n,scopes:t.length,states:r}}var C=2e5;function decisionOf(e,t,n){let nameOf=e=>t.get(e)?.name??e;return{decision:nameOf(n.node),way:f(n.ways.map(t=>e.flows[t].name||`to "${e.flows[t].target.name}"`)),condition:f(n.ways.map(t=>e.flows[t].condition).filter(Boolean)),boundary:n.boundary?nameOf(n.boundary):null,decisionId:n.node,flowIds:n.ways.map(t=>e.flows[t].id),takes:n.ways.map(t=>e.flows[t].condition).filter(Boolean),avoids:(t.get(n.node)?.outgoing??[]).filter(e=>!n.ways.includes(e)).map(t=>e.flows[t].condition).filter(Boolean),boundaryId:n.boundary}}function scenarioOf(e,t,n,r,i,a){let nameOf=e=>t.get(e)?.name??e,o=r.filter((e,t)=>r.indexOf(e)===t);return{process:e.id,start:nameOf(n.fired[0]),decisions:a.map(n=>decisionOf(e,t,n)),steps:o.filter(e=>t.get(e)?.kind===`activity`||t.get(e)?.kind===`boundary`).map(nameOf),ends:o.filter(e=>t.get(e)?.kind===`end`).map(nameOf),startId:n.fired[0],stepIds:o.filter(e=>t.get(e)?.kind===`activity`||t.get(e)?.kind===`boundary`),endIds:o.filter(e=>t.get(e)?.kind===`end`),firedIds:r,flowIds:i}}function enumerate(e,t,n,r,i){let a=[],o=new Set,s=new Set,c=C,l=!1,walk=(u,d,f,p,m)=>{if(a.length>=i||c--<=0){l=!0;return}let h=m.map(e=>`${e.node}:${e.ways.join(`+`)}:${e.boundary??``}`).join(`|`),g=`${u}#${h}`;if(!o.has(g)){if(o.add(g),r.tokens[u].every(e=>e===0)){if(s.has(h))return;s.add(h),a.push(scenarioOf(e,t,n,f,p,m))}else for(let e of r.edges[u]??[])d.has(e.to)||(d.add(e.to),walk(e.to,d,[...f,...e.fired],[...p,...e.produced],e.choice?[...m,e.choice]:m),d.delete(e.to))}};return walk(0,new Set([0]),[...n.fired],[...n.flows],[]),{list:a,capped:l}}function cover(e,t,n,r){let{tokens:i,edges:a}=r,finished=e=>i[e].every(e=>e===0),o=i.map(()=>[]);a.forEach((e,t)=>e.forEach(e=>o[e.to].push({from:t,edge:e})));let s=i.map(()=>null),c=i.map((e,t)=>finished(t)),l=c.flatMap((e,t)=>e?[t]:[]);for(let e=0;e<l.length;e+=1)for(let{from:t,edge:n}of o[l[e]])c[t]||(c[t]=!0,s[t]=n,l.push(t));let u=i.map(()=>null),d=[0],f=new Set([0]);for(let e=0;e<d.length;e+=1)for(let t of a[d[e]]??[])f.has(t.to)||(f.add(t.to),u[t.to]={from:d[e],edge:t},d.push(t.to));let p=new Set([...n.fired,...n.flows]),m=new Set,h=[];for(let r of d)for(let i of a[r]??[]){if(!c[i.to]||[...i.fired,...i.produced].every(e=>p.has(e)))continue;let a=[];for(let e=r;u[e];e=u[e].from)a.unshift(u[e].edge);a.push(i);for(let e=i.to;!finished(e)&&s[e];e=s[e].to)a.push(s[e]);let o=a.filter(e=>e.choice).map(e=>`${e.choice?.node}:${e.choice?.ways.join(`+`)}:${e.choice?.boundary??``}`).join(`|`);a.forEach(e=>[...e.fired,...e.produced].forEach(e=>p.add(e))),m.has(o)||(m.add(o),h.push(scenarioOf(e,t,n,[...n.fired,...a.flatMap(e=>e.fired)],[...n.flows,...a.flatMap(e=>e.produced)],a.flatMap(e=>e.choice?[e.choice]:[]))))}return h}function scenarioSet(e,t=64){let n=[],r=!1;for(let i of scopesOf(e)){let e=new Map(i.nodes.map(e=>[e.id,e]));for(let a of initialsOf(i)){let{graph:o}=explore(i,a),s=enumerate(i,e,a,o,t);s.capped?(r=!0,n.push(...cover(i,e,a,o))):n.push(...s.list)}}return{scenarios:n,capped:r}}function rootProcesses(e){let t=[];for(let n of e?.rootElements??[])if(n.$type===`bpmn:Process`&&t.push(n),n.$type===`bpmn:Collaboration`)for(let e of n.participants??[])e.processRef&&t.push(e.processRef);return[...new Set(t)]}function executableProcessIds(e){return rootProcesses(e).filter(e=>e.isExecutable!==!1&&e.id).map(e=>e.id)}function startEventsOf(e,t){return(scopesOf(e).find(e=>e.id===t)?.nodes??[]).filter(e=>e.kind===`start`).map(e=>({id:e.id,name:e.named?e.name:``,plain:e.plain}))}var w=5e3;function walkScenario(e,t,n={}){let r=scopesOf(e),i=executableProcessIds(e),a=n.process?r.find(e=>e.id===n.process):r.filter(e=>i.includes(e.id)).length===1?r.find(e=>i.includes(e.id)):void 0;if(!a)return null;let o=initialsOf(a),plainStart=e=>a.nodes.find(t=>t.id===e.fired[0])?.plain!==!1,s=o.find(e=>e.fired[0]===n.startId)??(n.startId?void 0:o.find(plainStart)??o[0]);if(!s||s.fired.length===0)return null;let c=new Map(a.nodes.map(e=>[e.id,e])),{graph:l}=explore(a,s),u=[...s.fired],d=[...s.flows],f=[],p=new Set([0]),m=0,h=!1,g;for(let e=0;e<w;e+=1){if(l.tokens[m].every(e=>e===0)){h=!0;break}let e=l.edges[m]??[];if(e.length===0)break;let n=e[0].fired[0],r=e.filter(e=>e.fired[0]===n),i=r.length===1?0:t(r.map(e=>({nodeId:n,flowIds:e.produced,boundaryId:e.choice?.boundary??null})),u);if(i<0){g=n,u.push(n);break}let a=r[Math.min(i,r.length-1)];if(p.has(a.to))break;p.add(a.to),u.push(...a.fired),d.push(...a.produced),a.choice&&f.push(a.choice),m=a.to}return{scenario:scenarioOf(a,c,s,u,d,f),complete:h,...g?{blockedAt:g}:{}}}var T=new Set([`localhost`,`127.0.0.1`,`[::1]`,`::1`]);function hostOf(e){if(!e)return null;try{return new URL(e).hostname.toLowerCase()}catch{return null}}function mockPermission(e){if(e.forTests)return`allowed`;let t=hostOf(e.url);return t&&(T.has(t)||/^127(?:\.\d{1,3}){3}$/.test(t)||t.endsWith(`.localhost`))?`confirm`:`refused`}function refusalText(e){let t=hostOf(e)??l(`app.testCases.safety.thisEngine`);return l(`app.testCases.safety.refusal`,{where:t})}async function sweepLeftovers(e,t,n){let r=[],i=[];for(let a of await t.list())if(!(n-a.at<=9e5)){a.instance&&await e.cancel(a.instance).catch(()=>void 0);try{await e.remove(a.deployment)}catch(e){if(!(e instanceof d&&e.status===404)){i.push(a.deployment);continue}}await t.drop(a.deployment),r.push(a.deployment)}return{removed:r,kept:i}}function storageLedger(e,t,n){let read=()=>{try{let n=JSON.parse(e.getItem(t)??`{}`);return n&&typeof n==`object`&&!Array.isArray(n)?n:{}}catch{return{}}},list=()=>{let e=read()[n];return Array.isArray(e)?e:[]},write=r=>{let i=read();r.length?i[n]=r:delete i[n],e.setItem(t,JSON.stringify(i))};return{list:async()=>list(),add:async e=>write([...list().filter(t=>t.deployment!==e.deployment),e]),drop:async e=>write(list().filter(t=>t.deployment!==e))}}function builds(e){return l(`app.testCases.count.testBuilds`,{count:e})}function leftoverLines(e){return[...e.removed.length?[l(`app.testCases.leftovers.removed`,{builds:builds(e.removed.length)})]:[],...e.kept.length?[l(`app.testCases.leftovers.kept`,{builds:builds(e.kept.length)})]:[]]}var E=/\.(bpmn20\.xml|bpmn\.xml|bpmn)$/i,D=[`process`,`decision`,`form`];function normal(e){return e.replace(/\\/g,`/`)}function nameOf(e){return normal(e).split(`/`).pop()??e}function kindOf(e){return E.test(e)?`process`:/\.dmn$/i.test(e)?`decision`:/\.form$/i.test(e)?`form`:null}function nearness(e,t){let n=normal(e).split(`/`).slice(0,-1),r=normal(t).split(`/`).slice(0,-1),i=0;for(;i<n.length&&i<r.length&&n[i]===r[i];)i+=1;return i}async function usedBy(e){let t=[...c(await r(e)).values()],ids=e=>[...new Set(t.map(e).filter(e=>!!e))];return{process:ids(e=>e.calledProcess),decision:ids(e=>e.decision),form:ids(e=>e.form)}}async function testBuildResources(e,t){let n=[{path:e.path,name:nameOf(e.path),content:e.content}],r=new Set([normal(e.path)]),i={process:new Set,decision:new Set,form:new Set},a=await usedBy(e.content);declaredIds(`process`,e.content).forEach(e=>i.process.add(e));let o=new Map,scan=async e=>{let n=[];for(let i of t){if(kindOf(i.path)!==e||r.has(normal(i.path)))continue;let t=o.get(i.path);if(!t){let n=await i.read().catch(()=>``);t={content:n,ids:declaredIds(e,n)},o.set(i.path,t)}n.push({path:i.path,...t})}return n};for(;D.some(e=>a[e].some(t=>!i[e].has(t)));)for(let t of D){let o=a[t].filter(e=>!i[t].has(e));if(a[t]=[],o.length===0)continue;let s=await scan(t);for(let c of o){i[t].add(c);let o=s.filter(e=>e.ids.includes(c)&&!r.has(normal(e.path))).sort((t,n)=>nearness(e.path,n.path)-nearness(e.path,t.path))[0];if(o&&(r.add(normal(o.path)),n.push({path:o.path,name:nameOf(o.path),content:o.content}),o.ids.forEach(e=>i[t].add(e)),t===`process`)){let e=await usedBy(o.content);D.forEach(t=>a[t].push(...e[t]))}}}return n}function testCaseFileByProcessId(e,t){if(e.length===0)return null;let n=new Set(e),starts=e=>Array.isArray(e?.instructions)&&e.instructions.some(e=>e?.type===`CREATE_PROCESS_INSTANCE`&&n.has(e.processDefinitionSelector?.processDefinitionId??``));return t.find(e=>(o(e.content).file?.testCases??[]).some(starts))?.path??null}async function withLinkedResources(e,t){let n=[],r=new Set,take=e=>{let t=normal(e.path);r.has(t)||(r.add(t),n.push(e))};for(let n of e)E.test(n.path)?(await testBuildResources(n,t)).forEach(take):take({path:n.path,name:nameOf(n.path),content:n.content});return n}function noEngine(){return l(`app.scenarios.needsAnEngine`)}function missingTarget(e){return e?.url&&e.ready===!1?l(`app.scenarios.targetNeedsSignIn`,{url:e.url}):noEngine()}var O=new Set([`FetchError`,`ResponseError`,`RequiredError`]);function describeFailure(e){return typeof e==`string`?e:e instanceof TypeError?noEngine():e instanceof Error?O.has(e.name)||/Response returned an error code|The request failed/.test(e.message)?noEngine():e.message:String(e)}var k=t({resourcesOf:()=>resourcesOf});function targetKey(e){return`${e.profile??``}|${e.url??``}`}var A=`penstock.testRuns.confirmed`,j=`penstock.testRuns.builds`;function buildsOn(e){return storageLedger(localStorage,j,targetKey(e))}async function runTargetOf(e,t,n){try{let r=await(n??g()).getDeployTargets(e??void 0),i=t??r?.active??null,a=(r?.targets??[]).find(e=>(e?.profile??null)===i);return!a?.ready||!h(String(a.engine))?null:{profile:a.profile??null,url:a.url??null,engine:a.engine,forTests:a.deployment?.forTests===!0,tenantId:a.deployment?.tenantId??null}}catch{return null}}async function runTargetProblem(e,t,n){try{let r=await(n??g()).getDeployTargets(e??void 0),i=t??r?.active??null;return missingTarget((r?.targets??[]).find(e=>(e?.profile??null)===i))}catch{return``}}function hostEngine(e,t,n=g()){return u(e.engine,r=>n.askEngine(e.profile,r,t??void 0,!0),e.tenantId??null)}function confirmedTargets(){try{return new Set(JSON.parse(localStorage.getItem(A)??`[]`))}catch{return new Set}}function autoRunAllowed(e){let t=mockPermission({url:e.url,forTests:e.forTests});return t===`allowed`||t===`confirm`&&confirmedTargets().has(targetKey(e))}async function mayRunOn(e,t,n=g()){let r=mockPermission({url:e.url,forTests:e.forTests});if(r===`allowed`)return null;if(r===`refused`)return refusalText(e.url);let i=targetKey(e),a=confirmedTargets();if(a.has(i))return null;if(!await n.confirmWithUser({title:t?.title??l(`app.project.runScenariosOnThisEngine`),text:t?.text??l(`app.project.penstockWillDeployATest`,{url:e.url})+l(`app.project.theBuildAndItsInstances`),accept:t?.accept??l(`app.runs.run`),decline:l(`app.common.cancel`)}))return l(`app.project.notRunTheEngineWas`);a.add(i);try{localStorage.setItem(A,JSON.stringify([...a]))}catch{}return null}async function mayRunTests(){try{return await g().requestFeature(n.TEST_RUNS)}catch{return!1}}async function resourcesOf(e,t,n){try{let r=n??g(),i=await r.getProjectFiles(),a=(Array.isArray(i?.files)?i.files:[]).map(e=>({path:e.path,read:()=>r.readFile(e.path)}));return testBuildResources({path:e,content:t},a)}catch{return[]}}async function byProcessId(e,t){let n;try{n=executableProcessIds(await r(e))}catch{return null}if(n.length===0)return null;try{let e=g(),r=[];for(let n of t){let t=await e.readFile(n).catch(()=>null);t!==null&&r.push({path:n,content:t})}let i=testCaseFileByProcessId(n,r),a=i?r.find(e=>e.path===i):void 0;return a?{file:a.path,parsed:o(a.content)}:null}catch{return null}}async function listedTestCases(){return((await g().getProjectFiles())?.testCases??[]).map(e=>e.path)}async function readScenarioFile(e){return(await listedTestCases()).some(t=>t.replace(/\\/g,`/`)===e.replace(/\\/g,`/`))?g().readFileIfPresent(e):null}async function readTestCases(e,t){try{if(e.endsWith(`.json`)){let t=await g().readFile(e).catch(()=>null);return{file:e,parsed:t===null?{file:null,problems:[]}:o(t)}}let n=s(e),r=await listedTestCases(),i=r.find(e=>e.replace(/\\/g,`/`)===n);if(i!==void 0){let e=await g().readFile(i).catch(()=>null);if(e!==null)return{file:i,parsed:o(e)}}if(t){let e=await byProcessId(t,r);if(e)return e}return{file:n,parsed:{file:null,problems:[]}}}catch{return{file:e,parsed:{file:null,problems:[]}}}}async function keepTrace(e,t){try{return await g().saveRunTrace(e.runId,t,`${JSON.stringify(e,null,2)}\n`)}catch(e){return console.error(e),null}}export{executableProcessIds as C,conditionBody as D,walkScenario as E,valuesFor as O,analyzeFlow as S,startEventsOf as T,leftoverLines as _,mayRunOn as a,mockPermission as b,readTestCases as c,runTargetProblem as d,targetKey as f,withLinkedResources as g,testBuildResources as h,keepTrace as i,declaredIds as k,resourcesOf as l,describeFailure as m,buildsOn as n,mayRunTests as o,k as p,hostEngine as r,readScenarioFile as s,autoRunAllowed as t,runTargetOf as u,storageLedger as v,scenarioSet as w,refusalText as x,sweepLeftovers as y};
@@ -1 +1 @@
1
- import"./rolldown-runtime-B8BYMn-z.js";import{i as e}from"./translator-DLDFsUlE.js";import"./frontend-Qq5hBH0U.js";import"./platform-BLPhsye9.js";import{t}from"./bridgeInstance-qzSInqLW.js";var ApiClient=class{bridge;bpmn;file;constructor(e=t()){this.bridge=e,this.bpmn=new BpmnApi(e),this.file=new FileApi(e)}dispose(){this.bridge.dispose()}},BpmnApi=class{bridge;constructor(e){this.bridge=e}getConfig=()=>this.bridge.getConfig();getPreviewDiff=()=>this.bridge.getPreviewDiff();saveProjectConfig=e=>this.bridge.saveConfig(e);getBpmnXml=()=>this.bridge.getBpmnXml();saveBpmnXml=e=>this.bridge.saveBpmnXml(e);getClipboard=()=>this.bridge.getClipboard();saveClipboard=e=>this.bridge.saveClipboard(e);openScriptFile=(e,t,n,r,i,a)=>this.bridge.openScriptFile(e,t,n,r,i,a);reportScriptSlot=(e,t)=>this.bridge.reportScriptSlot(e,t)},FileApi=class{bridge;constructor(e){this.bridge=e}readFile=e=>this.bridge.readFile(e);saveFile=(e,t,n)=>this.bridge.saveFile(e,t,n);chooseFile=(e,t)=>this.bridge.chooseFile(e,t);exportSvg=e=>this.bridge.exportSvg(e);exportPng=e=>this.bridge.exportPng(e);exportPdf=e=>this.bridge.exportPdf(e);exportFile=async(t,n,r)=>{let i=await this.bridge.chooseFile(t,{title:e(`app.export.asFormat`,{format:t.toUpperCase()}),mode:`save`});i&&await this.bridge.saveFile(i,n,r)}},n;function getApiClient(){return n||=new ApiClient,n}var r=`<rect x="5.5" y="4.5" width="5" height="7" rx="1"/><path d="M1.5 2H3V6H5.5M1.5 14H3V10H5.5M10.5 6H13V2H14.5M10.5 10H13V14H14.5"/>`,i=`<svg class="trace-icon" viewBox="0 0 16 16" width="22" height="22" stroke="currentColor" fill="none" stroke-width="1" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">${r}</svg>`,a=new Set([`bpmn:EndEvent`,`bpmn:TerminateEndEvent`,`bpmn:MessageEndEvent`,`bpmn:EscalationEndEvent`,`bpmn:ErrorEndEvent`,`bpmn:CancelEndEvent`,`bpmn:CompensateEndEvent`,`bpmn:SignalEndEvent`]),o=new Set([`bpmn:StartEvent`,`bpmn:MessageStartEvent`,`bpmn:TimerStartEvent`,`bpmn:SignalStartEvent`,`bpmn:ErrorStartEvent`,`bpmn:EscalationStartEvent`,`bpmn:ConditionalStartEvent`,`bpmn:LinkStartEvent`]),s=new Set([`bpmn:Process`,`bpmn:SubProcess`,`bpmn:Transaction`,`bpmn:AdHocSubProcess`]),c=new Set([`bpmn:SequenceFlow`,`bpmn:MessageFlow`,`bpmn:Association`,`bpmn:DataAssociation`]);function words(t){let n=t.replace(/^[a-z]+:/,``),r=`app.element.kind.${n[0].toLowerCase()}${n.slice(1)}`,i=e(r);return i===r?n.replace(/([a-z])([A-Z])/g,`$1 $2`).toLowerCase():i}function labelOf(t){let n=t?.name?.replace(/\s+/g,` `).trim();return n?`"${n}"`:e(`app.rules.theKindOf`,{kind:t?words(t.$type):e(`app.rules.compat.element`)})}function containersOf(e){let t=[],n=new Set,add=e=>{e&&!n.has(e)&&(n.add(e),t.push(e))};for(let t of e.rootElements??[])if(t.$type===`bpmn:Process`&&add(t),t.$type===`bpmn:Collaboration`)for(let e of t.participants??[])add(e.processRef);for(let e=0;e<t.length;e+=1)for(let n of t[e].flowElements??[])s.has(n.$type)&&add(n);return t}function bpmnGraph(e,t){let n=e,r=new Map,i=[],link=(e,t,n)=>{e?.id&&t?.id&&i.push({from:e.id,to:t.id,flow:n})};for(let e of containersOf(n??{$type:`bpmn:Definitions`})){for(let t of e.flowElements??[])t.id&&!c.has(t.$type)&&r.set(t.id,t);for(let t of e.flowElements??[])t.$type===`bpmn:SequenceFlow`&&link(t.sourceRef,t.targetRef,t.id??null),t.$type===`bpmn:BoundaryEvent`&&link(t.attachedToRef,t,null),t.$type===`bpmn:SubProcess`&&t.triggeredByEvent&&link(e,t,null)}if(t)for(let e of n?.rootElements??[])for(let t of e.messageFlows??[])link(t.sourceRef,t.targetRef,t.id??null);let a=new Map,o=new Map;for(let e of i)r.has(e.from)&&r.has(e.to)&&(o.set(e.from,[...o.get(e.from)??[],e]),a.set(e.to,[...a.get(e.to)??[],e]));return{nodes:r,incoming:a,outgoing:o}}function bpmnSide(e,t,n,r){let i=n===`incoming`?e.incoming:e.outgoing,other=e=>n===`incoming`?e.from:e.to,a=new Set([t]),o=new Set,s=[],reach=e=>{for(let t of i.get(e)??[]){t.flow&&o.add(t.flow);let e=other(t);a.has(e)||(a.add(e),s.push(e))}};reach(t);for(let t=0;t<s.length;t+=1)r.has(e.nodes.get(s[t])?.$type??``)||reach(s[t]);return{nodes:s,flows:[...o]}}function traceBpmnPaths(e,t,n={}){let r=bpmnGraph(e,n.followMessages===!0);if(!r.nodes.has(t))return null;let i=bpmnSide(r,t,`incoming`,o),s=bpmnSide(r,t,`outgoing`,a);return{origin:t,originLabel:labelOf(r.nodes.get(t)),before:i.nodes,after:s.nodes,beforeFlows:i.flows,afterFlows:s.flows}}function dmnNodesOf(e,t){let visit=e=>{if(e&&e.id&&!t.has(e.id)){t.set(e.id,e);for(let t of e.childDecisions??[])visit(t)}};for(let t of e.rootElements??[])visit(t)}function dmnSide(e,t,n){let other=e=>n===`up`?e.from:e.to,r=new Set([t]),i=new Set,a=[],reach=t=>{for(let o of e.get(t)??[]){(n===`up`?o.to===t:o.from===t)&&i.add(o);let e=other(o);r.has(e)||(r.add(e),a.push(e))}};reach(t);for(let e=0;e<a.length;e+=1)reach(a[e]);return{nodes:a,edges:[...i]}}function traceDmnPaths(e,t){let n=e??{$type:`dmn:Definitions`},r=new Map;if(dmnNodesOf(n,r),!r.has(t))return null;let i=new Map,a=new Map;for(let e of r.values())if(e.id)for(let t of e.requires??[]){let n=t.requiredInput??t.requiredDecision,o=typeof n==`string`?n:n?.id;if(!o||!r.has(o)||!e.id)continue;let s={from:o,to:e.id};i.set(s.to,[...i.get(s.to)??[],s]),a.set(s.from,[...a.get(s.from)??[],s])}let o=dmnSide(i,t,`up`),s=dmnSide(a,t,`down`);return{origin:t,originLabel:labelOf(r.get(t)),before:o.nodes,after:s.nodes,beforeEdges:o.edges,afterEdges:s.edges}}var l=`penstock-trace-before`,u=`penstock-trace-after`,d=`penstock-trace-origin`,f=`penstock-trace-dim`,p=`penstock-trace-label`,m=`penstock-trace-label-dim`,h=[l,u,d,f,p,m],g=new Set([`bpmn:SubProcess`,`bpmn:Transaction`,`bpmn:AdHocSubProcess`]),_=/Task$|Event$|Gateway$|Activity$/;function isBpmnFlowNode(e){return e?.$type?typeof e.$instanceOf==`function`?e.$instanceOf(`bpmn:FlowNode`):_.test(e.$type)||g.has(e.$type):!1}function isDmnDecision(e){return e?.$type===`dmn:Decision`}function isTraceable(e,t,n){if(!t)return!1;let r=e?.get?.(`elementRegistry`,!1)?.get?.(t);return!!r?.businessObject&&n(r.businessObject)}function bpmnTraceOf(e,t,n){return!t||!isTraceable(e,t,isBpmnFlowNode)?null:traceBpmnPaths(e.getDefinitions?.(),t,{followMessages:n})}function rootsOf(e){let t=e,n=t?.rootElements??t?.drgElement?.rootElements;return Array.isArray(n)&&n.length>0?{$type:`dmn:Definitions`,rootElements:n}:null}function drdOf(e){let t=new Map;return e?.forEach(e=>{let n=e?.businessObject;n?.id&&!t.has(n.id)&&t.set(n.id,{$type:n.$type??``,id:n.id,...n.name?{name:n.name}:{}})}),e?.forEach(e=>{let n=e?.businessObject?.$type===`dmn:InformationRequirement`,r=e?.source?.businessObject?.id,i=e?.target?.businessObject?.id;if(!n||!r||!i)return;let a=t.get(i);a&&t.has(r)&&(a.requires=[...a.requires??[],{requiredInput:{id:r}}])}),{$type:`dmn:Definitions`,rootElements:[...t.values()]}}function dmnTraceOf(e,t,n){if(!n)return null;let r=t?.get?.(`elementRegistry`,!1)?.get?.(n);return isDmnDecision(r?.businessObject)?traceDmnPaths(rootsOf(e)??drdOf(t?.get?.(`elementRegistry`,!1)),n):null}var v={before:l,after:u,origin:d,dim:f};function clearTrace(e,t){t.forEach(t=>{for(let n of h)e.hasMarker?.(t,n)!==!1&&e.removeMarker(t,n)})}function paintTrace(e,t,n){clearTrace(e,t),t.forEach(t=>{if(!t.parent)return;let r=t.labelTarget,i=n(r||t);i&&e.addMarker(t,r?i===`dim`?m:p:v[i])})}function bpmnToneOf(e){let t=new Set(e.before),n=new Set(e.after),r=new Set([...e.beforeFlows,...e.afterFlows]),i=new Set(e.afterFlows);return a=>{let o=a.id;return o?r.has(o)?i.has(o)?`after`:`before`:o===e.origin?`origin`:n.has(o)?`after`:t.has(o)?`before`:`dim`:null}}function dmnToneOf(e){let t=new Set(e.before),n=new Set(e.after),edgeKey=(e,t)=>`${e}>${t}`,r=new Set(e.beforeEdges.map(e=>edgeKey(e.from,e.to))),i=new Set(e.afterEdges.map(e=>edgeKey(e.from,e.to)));return a=>{let o=a.id;if(!o)return null;let s=a.source?.id,c=a.target?.id;if(s&&c){let e=edgeKey(s,c);return i.has(e)?`after`:r.has(e)?`before`:`dim`}return o===e.origin?`origin`:n.has(o)?`after`:t.has(o)?`before`:`dim`}}var y=`http://www.w3.org/2000/svg`,b=[[`before`,`--theme-trace-before`],[`after`,`--theme-trace-after`],[`dim`,`--theme-trace-dim-stroke`]];function traceArrowOf(e){return`penstock-trace-arrow-${e}`}function arrowMarker(e,t,n){let r=e.createElementNS(y,`marker`);r.setAttribute(`id`,traceArrowOf(t)),r.setAttribute(`viewBox`,`0 0 20 20`),r.setAttribute(`refX`,`11`),r.setAttribute(`refY`,`10`),r.setAttribute(`markerWidth`,`20`),r.setAttribute(`markerHeight`,`20`),r.setAttribute(`markerUnits`,`userSpaceOnUse`),r.setAttribute(`orient`,`auto`);let i=e.createElementNS(y,`path`);return i.setAttribute(`d`,`M 1 5 L 11 10 L 1 15 Z`),i.setAttribute(`style`,`stroke-width: 1px; stroke-linecap: round; stroke-dasharray: 10000, 1; fill: var(${n}); stroke: none;`),r.appendChild(i),r}function ensureTraceArrows(e){let t=(e?.get?.(`canvas`,!1)?.getContainer?.())?.querySelector?.(`svg`),n=t?.querySelector?.(`defs`)??t?.ownerDocument?.createElementNS?.(y,`defs`);if(t&&n){n.parentNode||t.appendChild(n);for(let[e,r]of b)n.querySelector(`#${traceArrowOf(e)}`)||n.appendChild(arrowMarker(t.ownerDocument,e,r))}}function traceTally(t,n,r){return e(`app.tracePaths.tracingBeforeAfter`,{label:t,before:n,after:r})}function canvasOf(e){let t=e?.get?.(`canvas`,!1),n=e?.get?.(`elementRegistry`,!1);return t&&n?{canvas:t,registry:n}:null}function clearTraceOn(e){let t=canvasOf(e);t&&clearTrace(t.canvas,t.registry)}function bpmnTraceReading(e,t,n){let r=bpmnTraceOf(e,t,n);return r?{label:r.originLabel,before:r.before.length,after:r.after.length}:null}function dmnTraceReading(e,t,n){let r=dmnTraceOf(e,t,n);return r?{label:r.originLabel,before:r.before.length,after:r.after.length}:null}var x=null;function paintBpmnTrace(e,t,n){let r=canvasOf(e);if(!r)return;let i=t?bpmnTraceOf(e,t,n):null;i?(paintTrace(r.canvas,r.registry,bpmnToneOf(i)),x={viewer:e,paint:e=>paintBpmnTrace(e,t,n)}):(clearTrace(r.canvas,r.registry),x=null)}function paintDmnTrace(e,t,n){let r=canvasOf(t);if(!r)return;ensureTraceArrows(t);let i=n?dmnTraceOf(e,t,n):null;i?(paintTrace(r.canvas,r.registry,dmnToneOf(i)),x={viewer:t,paint:t=>paintDmnTrace(e,t,n)}):(clearTrace(r.canvas,r.registry),x=null)}async function withoutTrace(e,t){if(!e)return t();let n=x&&x.viewer===e?x:null;clearTraceOn(e);try{return await t()}finally{n?.paint(e)}}export{isDmnDecision as a,paintDmnTrace as c,r as d,i as f,isBpmnFlowNode as i,traceTally as l,getApiClient as m,clearTraceOn as n,isTraceable as o,ApiClient as p,dmnTraceReading as r,paintBpmnTrace as s,bpmnTraceReading as t,withoutTrace as u};
1
+ import"./rolldown-runtime-B8BYMn-z.js";import{i as e}from"./translator-BLCeE6UY.js";import"./frontend-uXAWaalt.js";import"./platform-G53Cenyw.js";import{t}from"./bridgeInstance-qzSInqLW.js";var ApiClient=class{bridge;bpmn;file;constructor(e=t()){this.bridge=e,this.bpmn=new BpmnApi(e),this.file=new FileApi(e)}dispose(){this.bridge.dispose()}},BpmnApi=class{bridge;constructor(e){this.bridge=e}getConfig=()=>this.bridge.getConfig();getPreviewDiff=()=>this.bridge.getPreviewDiff();saveProjectConfig=e=>this.bridge.saveConfig(e);getBpmnXml=()=>this.bridge.getBpmnXml();saveBpmnXml=e=>this.bridge.saveBpmnXml(e);getClipboard=()=>this.bridge.getClipboard();saveClipboard=e=>this.bridge.saveClipboard(e);openScriptFile=(e,t,n,r,i,a)=>this.bridge.openScriptFile(e,t,n,r,i,a);reportScriptSlot=(e,t)=>this.bridge.reportScriptSlot(e,t)},FileApi=class{bridge;constructor(e){this.bridge=e}readFile=e=>this.bridge.readFile(e);saveFile=(e,t,n)=>this.bridge.saveFile(e,t,n);chooseFile=(e,t)=>this.bridge.chooseFile(e,t);exportSvg=e=>this.bridge.exportSvg(e);exportPng=e=>this.bridge.exportPng(e);exportPdf=e=>this.bridge.exportPdf(e);exportFile=async(t,n,r)=>{let i=await this.bridge.chooseFile(t,{title:e(`app.export.asFormat`,{format:t.toUpperCase()}),mode:`save`});i&&await this.bridge.saveFile(i,n,r)}},n;function getApiClient(){return n||=new ApiClient,n}var r=`<rect x="5.5" y="4.5" width="5" height="7" rx="1"/><path d="M1.5 2H3V6H5.5M1.5 14H3V10H5.5M10.5 6H13V2H14.5M10.5 10H13V14H14.5"/>`,i=`<svg class="trace-icon" viewBox="0 0 16 16" width="22" height="22" stroke="currentColor" fill="none" stroke-width="1" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">${r}</svg>`,a=new Set([`bpmn:EndEvent`,`bpmn:TerminateEndEvent`,`bpmn:MessageEndEvent`,`bpmn:EscalationEndEvent`,`bpmn:ErrorEndEvent`,`bpmn:CancelEndEvent`,`bpmn:CompensateEndEvent`,`bpmn:SignalEndEvent`]),o=new Set([`bpmn:StartEvent`,`bpmn:MessageStartEvent`,`bpmn:TimerStartEvent`,`bpmn:SignalStartEvent`,`bpmn:ErrorStartEvent`,`bpmn:EscalationStartEvent`,`bpmn:ConditionalStartEvent`,`bpmn:LinkStartEvent`]),s=new Set([`bpmn:Process`,`bpmn:SubProcess`,`bpmn:Transaction`,`bpmn:AdHocSubProcess`]),c=new Set([`bpmn:SequenceFlow`,`bpmn:MessageFlow`,`bpmn:Association`,`bpmn:DataAssociation`]);function words(t){let n=t.replace(/^[a-z]+:/,``),r=`app.element.kind.${n[0].toLowerCase()}${n.slice(1)}`,i=e(r);return i===r?n.replace(/([a-z])([A-Z])/g,`$1 $2`).toLowerCase():i}function labelOf(t){let n=t?.name?.replace(/\s+/g,` `).trim();return n?`"${n}"`:e(`app.rules.theKindOf`,{kind:t?words(t.$type):e(`app.rules.compat.element`)})}function containersOf(e){let t=[],n=new Set,add=e=>{e&&!n.has(e)&&(n.add(e),t.push(e))};for(let t of e.rootElements??[])if(t.$type===`bpmn:Process`&&add(t),t.$type===`bpmn:Collaboration`)for(let e of t.participants??[])add(e.processRef);for(let e=0;e<t.length;e+=1)for(let n of t[e].flowElements??[])s.has(n.$type)&&add(n);return t}function bpmnGraph(e,t){let n=e,r=new Map,i=[],link=(e,t,n)=>{e?.id&&t?.id&&i.push({from:e.id,to:t.id,flow:n})};for(let e of containersOf(n??{$type:`bpmn:Definitions`})){for(let t of e.flowElements??[])t.id&&!c.has(t.$type)&&r.set(t.id,t);for(let t of e.flowElements??[])t.$type===`bpmn:SequenceFlow`&&link(t.sourceRef,t.targetRef,t.id??null),t.$type===`bpmn:BoundaryEvent`&&link(t.attachedToRef,t,null),t.$type===`bpmn:SubProcess`&&t.triggeredByEvent&&link(e,t,null)}if(t)for(let e of n?.rootElements??[])for(let t of e.messageFlows??[])link(t.sourceRef,t.targetRef,t.id??null);let a=new Map,o=new Map;for(let e of i)r.has(e.from)&&r.has(e.to)&&(o.set(e.from,[...o.get(e.from)??[],e]),a.set(e.to,[...a.get(e.to)??[],e]));return{nodes:r,incoming:a,outgoing:o}}function bpmnSide(e,t,n,r){let i=n===`incoming`?e.incoming:e.outgoing,other=e=>n===`incoming`?e.from:e.to,a=new Set([t]),o=new Set,s=[],reach=e=>{for(let t of i.get(e)??[]){t.flow&&o.add(t.flow);let e=other(t);a.has(e)||(a.add(e),s.push(e))}};reach(t);for(let t=0;t<s.length;t+=1)r.has(e.nodes.get(s[t])?.$type??``)||reach(s[t]);return{nodes:s,flows:[...o]}}function traceBpmnPaths(e,t,n={}){let r=bpmnGraph(e,n.followMessages===!0);if(!r.nodes.has(t))return null;let i=bpmnSide(r,t,`incoming`,o),s=bpmnSide(r,t,`outgoing`,a);return{origin:t,originLabel:labelOf(r.nodes.get(t)),before:i.nodes,after:s.nodes,beforeFlows:i.flows,afterFlows:s.flows}}function dmnNodesOf(e,t){let visit=e=>{if(e&&e.id&&!t.has(e.id)){t.set(e.id,e);for(let t of e.childDecisions??[])visit(t)}};for(let t of e.rootElements??[])visit(t)}function dmnSide(e,t,n){let other=e=>n===`up`?e.from:e.to,r=new Set([t]),i=new Set,a=[],reach=t=>{for(let o of e.get(t)??[]){(n===`up`?o.to===t:o.from===t)&&i.add(o);let e=other(o);r.has(e)||(r.add(e),a.push(e))}};reach(t);for(let e=0;e<a.length;e+=1)reach(a[e]);return{nodes:a,edges:[...i]}}function traceDmnPaths(e,t){let n=e??{$type:`dmn:Definitions`},r=new Map;if(dmnNodesOf(n,r),!r.has(t))return null;let i=new Map,a=new Map;for(let e of r.values())if(e.id)for(let t of e.requires??[]){let n=t.requiredInput??t.requiredDecision,o=typeof n==`string`?n:n?.id;if(!o||!r.has(o)||!e.id)continue;let s={from:o,to:e.id};i.set(s.to,[...i.get(s.to)??[],s]),a.set(s.from,[...a.get(s.from)??[],s])}let o=dmnSide(i,t,`up`),s=dmnSide(a,t,`down`);return{origin:t,originLabel:labelOf(r.get(t)),before:o.nodes,after:s.nodes,beforeEdges:o.edges,afterEdges:s.edges}}var l=`penstock-trace-before`,u=`penstock-trace-after`,d=`penstock-trace-origin`,f=`penstock-trace-dim`,p=`penstock-trace-label`,m=`penstock-trace-label-dim`,h=[l,u,d,f,p,m],g=new Set([`bpmn:SubProcess`,`bpmn:Transaction`,`bpmn:AdHocSubProcess`]),_=/Task$|Event$|Gateway$|Activity$/;function isBpmnFlowNode(e){return e?.$type?typeof e.$instanceOf==`function`?e.$instanceOf(`bpmn:FlowNode`):_.test(e.$type)||g.has(e.$type):!1}function isDmnDecision(e){return e?.$type===`dmn:Decision`}function isTraceable(e,t,n){if(!t)return!1;let r=e?.get?.(`elementRegistry`,!1)?.get?.(t);return!!r?.businessObject&&n(r.businessObject)}function bpmnTraceOf(e,t,n){return!t||!isTraceable(e,t,isBpmnFlowNode)?null:traceBpmnPaths(e.getDefinitions?.(),t,{followMessages:n})}function rootsOf(e){let t=e,n=t?.rootElements??t?.drgElement?.rootElements;return Array.isArray(n)&&n.length>0?{$type:`dmn:Definitions`,rootElements:n}:null}function drdOf(e){let t=new Map;return e?.forEach(e=>{let n=e?.businessObject;n?.id&&!t.has(n.id)&&t.set(n.id,{$type:n.$type??``,id:n.id,...n.name?{name:n.name}:{}})}),e?.forEach(e=>{let n=e?.businessObject?.$type===`dmn:InformationRequirement`,r=e?.source?.businessObject?.id,i=e?.target?.businessObject?.id;if(!n||!r||!i)return;let a=t.get(i);a&&t.has(r)&&(a.requires=[...a.requires??[],{requiredInput:{id:r}}])}),{$type:`dmn:Definitions`,rootElements:[...t.values()]}}function dmnTraceOf(e,t,n){if(!n)return null;let r=t?.get?.(`elementRegistry`,!1)?.get?.(n);return isDmnDecision(r?.businessObject)?traceDmnPaths(rootsOf(e)??drdOf(t?.get?.(`elementRegistry`,!1)),n):null}var v={before:l,after:u,origin:d,dim:f};function clearTrace(e,t){t.forEach(t=>{for(let n of h)e.hasMarker?.(t,n)!==!1&&e.removeMarker(t,n)})}function paintTrace(e,t,n){clearTrace(e,t),t.forEach(t=>{if(!t.parent)return;let r=t.labelTarget,i=n(r||t);i&&e.addMarker(t,r?i===`dim`?m:p:v[i])})}function bpmnToneOf(e){let t=new Set(e.before),n=new Set(e.after),r=new Set([...e.beforeFlows,...e.afterFlows]),i=new Set(e.afterFlows);return a=>{let o=a.id;return o?r.has(o)?i.has(o)?`after`:`before`:o===e.origin?`origin`:n.has(o)?`after`:t.has(o)?`before`:`dim`:null}}function dmnToneOf(e){let t=new Set(e.before),n=new Set(e.after),edgeKey=(e,t)=>`${e}>${t}`,r=new Set(e.beforeEdges.map(e=>edgeKey(e.from,e.to))),i=new Set(e.afterEdges.map(e=>edgeKey(e.from,e.to)));return a=>{let o=a.id;if(!o)return null;let s=a.source?.id,c=a.target?.id;if(s&&c){let e=edgeKey(s,c);return i.has(e)?`after`:r.has(e)?`before`:`dim`}return o===e.origin?`origin`:n.has(o)?`after`:t.has(o)?`before`:`dim`}}var y=`http://www.w3.org/2000/svg`,b=[[`before`,`--theme-trace-before`],[`after`,`--theme-trace-after`],[`dim`,`--theme-trace-dim-stroke`]];function traceArrowOf(e){return`penstock-trace-arrow-${e}`}function arrowMarker(e,t,n){let r=e.createElementNS(y,`marker`);r.setAttribute(`id`,traceArrowOf(t)),r.setAttribute(`viewBox`,`0 0 20 20`),r.setAttribute(`refX`,`11`),r.setAttribute(`refY`,`10`),r.setAttribute(`markerWidth`,`20`),r.setAttribute(`markerHeight`,`20`),r.setAttribute(`markerUnits`,`userSpaceOnUse`),r.setAttribute(`orient`,`auto`);let i=e.createElementNS(y,`path`);return i.setAttribute(`d`,`M 1 5 L 11 10 L 1 15 Z`),i.setAttribute(`style`,`stroke-width: 1px; stroke-linecap: round; stroke-dasharray: 10000, 1; fill: var(${n}); stroke: none;`),r.appendChild(i),r}function ensureTraceArrows(e){let t=(e?.get?.(`canvas`,!1)?.getContainer?.())?.querySelector?.(`svg`),n=t?.querySelector?.(`defs`)??t?.ownerDocument?.createElementNS?.(y,`defs`);if(t&&n){n.parentNode||t.appendChild(n);for(let[e,r]of b)n.querySelector(`#${traceArrowOf(e)}`)||n.appendChild(arrowMarker(t.ownerDocument,e,r))}}function traceTally(t,n,r){return e(`app.tracePaths.tracingBeforeAfter`,{label:t,before:n,after:r})}function canvasOf(e){let t=e?.get?.(`canvas`,!1),n=e?.get?.(`elementRegistry`,!1);return t&&n?{canvas:t,registry:n}:null}function clearTraceOn(e){let t=canvasOf(e);t&&clearTrace(t.canvas,t.registry)}function bpmnTraceReading(e,t,n){let r=bpmnTraceOf(e,t,n);return r?{label:r.originLabel,before:r.before.length,after:r.after.length}:null}function dmnTraceReading(e,t,n){let r=dmnTraceOf(e,t,n);return r?{label:r.originLabel,before:r.before.length,after:r.after.length}:null}var x=null;function paintBpmnTrace(e,t,n){let r=canvasOf(e);if(!r)return;let i=t?bpmnTraceOf(e,t,n):null;i?(paintTrace(r.canvas,r.registry,bpmnToneOf(i)),x={viewer:e,paint:e=>paintBpmnTrace(e,t,n)}):(clearTrace(r.canvas,r.registry),x=null)}function paintDmnTrace(e,t,n){let r=canvasOf(t);if(!r)return;ensureTraceArrows(t);let i=n?dmnTraceOf(e,t,n):null;i?(paintTrace(r.canvas,r.registry,dmnToneOf(i)),x={viewer:t,paint:t=>paintDmnTrace(e,t,n)}):(clearTrace(r.canvas,r.registry),x=null)}async function withoutTrace(e,t){if(!e)return t();let n=x&&x.viewer===e?x:null;clearTraceOn(e);try{return await t()}finally{n?.paint(e)}}export{isDmnDecision as a,paintDmnTrace as c,r as d,i as f,isBpmnFlowNode as i,traceTally as l,getApiClient as m,clearTraceOn as n,isTraceable as o,ApiClient as p,dmnTraceReading as r,paintBpmnTrace as s,bpmnTraceReading as t,withoutTrace as u};