diff --git a/.env b/.env index 0dcd5d3c..4bba397c 100644 --- a/.env +++ b/.env @@ -11,7 +11,7 @@ VITE_OPEN=true VITE_APP_TENANT_ENABLE=true # 验证码的开关 -VITE_APP_CAPTCHA_ENABLE=true +VITE_APP_CAPTCHA_ENABLE=false # 文档地址的开关 VITE_APP_DOCALERT_ENABLE=true diff --git a/.env.dev b/.env.dev index 0d5427ca..78bd8366 100644 --- a/.env.dev +++ b/.env.dev @@ -4,7 +4,8 @@ NODE_ENV=production VITE_DEV=true # 请求路径 -VITE_BASE_URL='https://manage-dev.hs365.top' +#VITE_BASE_URL='https://manage-dev.hs365.top' +VITE_BASE_URL=${ENV_API_BASE_URL:-https://manage-dev.hs365.top} # 文件上传类型:server - 后端上传, client - 前端直连上传,仅支持S3服务 VITE_UPLOAD_TYPE=server diff --git a/.env.local b/.env.local index 35765584..84b25c36 100644 --- a/.env.local +++ b/.env.local @@ -4,7 +4,8 @@ NODE_ENV=development VITE_DEV=true # 请求路径 -VITE_BASE_URL='http://localhost:48080' +#VITE_BASE_URL='http://localhost:48080' +VITE_BASE_URL=${ENV_API_BASE_URL:-http://localhost:48080} # 文件上传类型:server - 后端上传, client - 前端直连上传,仅支持 S3 服务 VITE_UPLOAD_TYPE=server diff --git a/.env.prod b/.env.prod index 806f61fc..cc6b8e6c 100644 --- a/.env.prod +++ b/.env.prod @@ -4,7 +4,7 @@ NODE_ENV=production VITE_DEV=false # 请求路径 -VITE_BASE_URL='https://manage.hs365.top' +VITE_BASE_URL=${ENV_API_BASE_URL:-https://manage.hs365.top} # 文件上传类型:server - 后端上传, client - 前端直连上传,仅支持S3服务 VITE_UPLOAD_TYPE=server diff --git a/node_modules/.vite/deps/@form-create_designer.js b/node_modules/.vite/deps/@form-create_designer.js index 2f8d2010..d6a8067d 100644 --- a/node_modules/.vite/deps/@form-create_designer.js +++ b/node_modules/.vite/deps/@form-create_designer.js @@ -3,9 +3,9 @@ import { } from "./chunk-FKOWI4VU.js"; import { ElMessage -} from "./chunk-DI2SIYDQ.js"; -import "./chunk-GVKQVKU2.js"; +} from "./chunk-QM5QNHIO.js"; import "./chunk-TQUTZUXW.js"; +import "./chunk-GVKQVKU2.js"; import "./chunk-PHKUHJQP.js"; import "./chunk-LROEKXT5.js"; import "./chunk-O7KFMITO.js"; diff --git a/node_modules/.vite/deps/@form-create_element-ui_auto-import.js b/node_modules/.vite/deps/@form-create_element-ui_auto-import.js index 18d80c45..3fb689ca 100644 --- a/node_modules/.vite/deps/@form-create_element-ui_auto-import.js +++ b/node_modules/.vite/deps/@form-create_element-ui_auto-import.js @@ -1,15 +1,16 @@ import "./chunk-BCFMTI3R.js"; import "./chunk-FBJWDERR.js"; -import "./chunk-WTG273Z3.js"; -import "./chunk-5MJQOEES.js"; -import "./chunk-46FTKYZS.js"; import "./chunk-4TBAE7E3.js"; -import "./chunk-C373DD4S.js"; -import "./chunk-KARBCTKP.js"; -import "./chunk-HZRC7S76.js"; import "./chunk-OX6JP2AA.js"; -import "./chunk-MGTDGDA4.js"; +import "./chunk-5MJQOEES.js"; +import "./chunk-WTG273Z3.js"; +import "./chunk-46FTKYZS.js"; +import "./chunk-C373DD4S.js"; +import "./chunk-HZRC7S76.js"; +import "./chunk-DWEZRTLP.js"; +import "./chunk-5CTUXGGF.js"; import "./chunk-B4L4KVT2.js"; +import "./chunk-MGTDGDA4.js"; import "./chunk-JWIHIIT3.js"; import "./chunk-MC27QSJL.js"; import "./chunk-UUC56VKA.js"; @@ -17,20 +18,19 @@ import "./chunk-HGRMPKRI.js"; import "./chunk-NZR6SVVT.js"; import "./chunk-THZSTYZP.js"; import "./chunk-DB6OWVVK.js"; -import "./chunk-T6DOWK6H.js"; -import "./chunk-DWEZRTLP.js"; -import "./chunk-5CTUXGGF.js"; -import "./chunk-ZEGP4DVR.js"; -import "./chunk-IIHLKWL5.js"; -import "./chunk-MB7KUOZ6.js"; -import "./chunk-VLWH5T2T.js"; -import "./chunk-7EBAVFZW.js"; -import "./chunk-JQ2IYF3Y.js"; -import "./chunk-5KQYIVGF.js"; import "./chunk-FRMPVTTW.js"; import "./chunk-C47PGQGR.js"; import "./chunk-HODVN2HK.js"; +import "./chunk-JQ2IYF3Y.js"; +import "./chunk-T6DOWK6H.js"; import "./chunk-3N2VGZJ2.js"; +import "./chunk-KARBCTKP.js"; +import "./chunk-ZEGP4DVR.js"; +import "./chunk-IIHLKWL5.js"; +import "./chunk-7EBAVFZW.js"; +import "./chunk-MB7KUOZ6.js"; +import "./chunk-VLWH5T2T.js"; +import "./chunk-5KQYIVGF.js"; import { ElAutocomplete, ElButton, @@ -60,14 +60,14 @@ import { ElTooltip, ElTree, ElUpload -} from "./chunk-DI2SIYDQ.js"; -import "./chunk-GVKQVKU2.js"; +} from "./chunk-QM5QNHIO.js"; import "./chunk-TQUTZUXW.js"; +import "./chunk-GVKQVKU2.js"; import "./chunk-PHKUHJQP.js"; import "./chunk-LROEKXT5.js"; import "./chunk-O7KFMITO.js"; -import "./chunk-5TRUIT6X.js"; import "./chunk-YNRHTVZR.js"; +import "./chunk-5TRUIT6X.js"; import "./chunk-67TUTJCN.js"; import "./chunk-ULX5FOVL.js"; import "./chunk-GTWINWNV.js"; diff --git a/node_modules/.vite/deps/_metadata.json b/node_modules/.vite/deps/_metadata.json index c877ef9b..b942eaec 100644 --- a/node_modules/.vite/deps/_metadata.json +++ b/node_modules/.vite/deps/_metadata.json @@ -2,954 +2,966 @@ "hash": "4b143440", "configHash": "a0db7612", "lockfileHash": "17d7b729", - "browserHash": "d2e0f1f3", + "browserHash": "3fe44fd7", "optimized": { "qs": { "src": "../../.pnpm/qs@6.13.1/node_modules/qs/lib/index.js", "file": "qs.js", - "fileHash": "2cba4833", + "fileHash": "d260c756", "needsInterop": true }, "url": { "src": "../../.pnpm/url@0.11.4/node_modules/url/url.js", "file": "url.js", - "fileHash": "95f01415", + "fileHash": "c4c0fb52", "needsInterop": true }, "vue": { "src": "../../.pnpm/vue@3.5.12_typescript@5.3.3/node_modules/vue/dist/vue.runtime.esm-bundler.js", "file": "vue.js", - "fileHash": "2ce7a043", + "fileHash": "38770138", "needsInterop": false }, "sass": { "src": "../../.pnpm/sass@1.81.0/node_modules/sass/sass.default.js", "file": "sass.js", - "fileHash": "f7245d0d", + "fileHash": "fbfa141b", "needsInterop": false }, "mitt": { "src": "../../.pnpm/mitt@3.0.1/node_modules/mitt/dist/mitt.mjs", "file": "mitt.js", - "fileHash": "4aab23bb", + "fileHash": "0e9d835b", "needsInterop": false }, "axios": { "src": "../../.pnpm/axios@1.7.8/node_modules/axios/index.js", "file": "axios.js", - "fileHash": "739120d4", + "fileHash": "f86fdcb8", "needsInterop": false }, "pinia": { "src": "../../.pnpm/pinia@2.2.8_typescript@5.3.3_vue@3.5.12_typescript@5.3.3_/node_modules/pinia/dist/pinia.mjs", "file": "pinia.js", - "fileHash": "b16a73c0", + "fileHash": "71ae85d6", "needsInterop": false }, "dayjs": { "src": "../../.pnpm/dayjs@1.11.13/node_modules/dayjs/dayjs.min.js", "file": "dayjs.js", - "fileHash": "7e366c69", + "fileHash": "38654faa", "needsInterop": true }, "qrcode": { "src": "../../.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/browser.js", "file": "qrcode.js", - "fileHash": "c010c320", + "fileHash": "6d3261a0", "needsInterop": true }, "unocss": { "src": "../../.pnpm/unocss@0.58.9_postcss@8.4.49_rollup@4.27.4_vite@5.1.4_@types+node@20.17.9_sass@1.81.0_terser@5.36.0_/node_modules/unocss/dist/index.mjs", "file": "unocss.js", - "fileHash": "fedc5bac", + "fileHash": "2cd1ef38", "needsInterop": false }, "vue-router": { "src": "../../.pnpm/vue-router@4.4.5_vue@3.5.12_typescript@5.3.3_/node_modules/vue-router/dist/vue-router.mjs", "file": "vue-router.js", - "fileHash": "5aa2bbfe", + "fileHash": "e27d749b", "needsInterop": false }, "vue-types": { "src": "../../.pnpm/vue-types@5.1.3_vue@3.5.12_typescript@5.3.3_/node_modules/vue-types/dist/vue-types.modern.js", "file": "vue-types.js", - "fileHash": "ee1c6c95", + "fileHash": "31d532ae", "needsInterop": false }, "vue-i18n": { "src": "../../.pnpm/vue-i18n@9.10.2_vue@3.5.12_typescript@5.3.3_/node_modules/vue-i18n/dist/vue-i18n.cjs.js", "file": "vue-i18n.js", - "fileHash": "b90b28ae", + "fileHash": "9173ddf5", "needsInterop": true }, "crypto-js": { "src": "../../.pnpm/crypto-js@4.2.0/node_modules/crypto-js/index.js", "file": "crypto-js.js", - "fileHash": "01967af3", + "fileHash": "5f9e8234", "needsInterop": true }, "cropperjs": { "src": "../../.pnpm/cropperjs@1.6.2/node_modules/cropperjs/dist/cropper.esm.js", "file": "cropperjs.js", - "fileHash": "c2351163", + "fileHash": "3bd7e7d1", "needsInterop": false }, "lodash-es": { "src": "../../.pnpm/lodash-es@4.17.21/node_modules/lodash-es/lodash.js", "file": "lodash-es.js", - "fileHash": "997c593d", + "fileHash": "72cc7de2", "needsInterop": false }, "nprogress": { "src": "../../.pnpm/nprogress@0.2.0/node_modules/nprogress/nprogress.js", "file": "nprogress.js", - "fileHash": "8b50f8f0", + "fileHash": "2d590954", "needsInterop": true }, "web-storage-cache": { "src": "../../.pnpm/web-storage-cache@1.1.1/node_modules/web-storage-cache/dist/web-storage-cache.min.js", "file": "web-storage-cache.js", - "fileHash": "afec7b06", + "fileHash": "b76f8ba5", "needsInterop": true }, "@iconify/iconify": { "src": "../../.pnpm/@iconify+iconify@3.1.1/node_modules/@iconify/iconify/dist/iconify.mjs", "file": "@iconify_iconify.js", - "fileHash": "8ef6f73e", + "fileHash": "e1931585", "needsInterop": false }, "@vueuse/core": { "src": "../../.pnpm/@vueuse+core@10.11.1_vue@3.5.12_typescript@5.3.3_/node_modules/@vueuse/core/index.mjs", "file": "@vueuse_core.js", - "fileHash": "7f33bdea", + "fileHash": "05c12401", "needsInterop": false }, "@zxcvbn-ts/core": { "src": "../../.pnpm/@zxcvbn-ts+core@3.0.4/node_modules/@zxcvbn-ts/core/dist/index.esm.js", "file": "@zxcvbn-ts_core.js", - "fileHash": "770eb2cd", + "fileHash": "d6e4d03e", "needsInterop": false }, "echarts/core": { "src": "../../.pnpm/echarts@5.5.1/node_modules/echarts/core.js", "file": "echarts_core.js", - "fileHash": "2cf3cb32", + "fileHash": "159c5665", "needsInterop": false }, "echarts/charts": { "src": "../../.pnpm/echarts@5.5.1/node_modules/echarts/charts.js", "file": "echarts_charts.js", - "fileHash": "f5803394", + "fileHash": "3d9a50a9", "needsInterop": false }, "echarts/components": { "src": "../../.pnpm/echarts@5.5.1/node_modules/echarts/components.js", "file": "echarts_components.js", - "fileHash": "76ddc834", + "fileHash": "224d9953", "needsInterop": false }, "echarts/renderers": { "src": "../../.pnpm/echarts@5.5.1/node_modules/echarts/renderers.js", "file": "echarts_renderers.js", - "fileHash": "71139f89", + "fileHash": "6756509a", "needsInterop": false }, "echarts-wordcloud": { "src": "../../.pnpm/echarts-wordcloud@2.1.0_echarts@5.5.1/node_modules/echarts-wordcloud/index.js", "file": "echarts-wordcloud.js", - "fileHash": "61ad2d7b", + "fileHash": "9142a7c4", "needsInterop": false }, "@wangeditor/editor": { "src": "../../.pnpm/@wangeditor+editor@5.1.23/node_modules/@wangeditor/editor/dist/index.esm.js", "file": "@wangeditor_editor.js", - "fileHash": "c62e1b6c", + "fileHash": "32c182c5", "needsInterop": false }, "@wangeditor/editor-for-vue": { "src": "../../.pnpm/@wangeditor+editor-for-vue@5.1.12_@wangeditor+editor@5.1.23_vue@3.5.12_typescript@5.3.3_/node_modules/@wangeditor/editor-for-vue/dist/index.esm.js", "file": "@wangeditor_editor-for-vue.js", - "fileHash": "52a4b36d", + "fileHash": "9c22b2be", "needsInterop": false }, "@microsoft/fetch-event-source": { "src": "../../.pnpm/@microsoft+fetch-event-source@2.0.1/node_modules/@microsoft/fetch-event-source/lib/esm/index.js", "file": "@microsoft_fetch-event-source.js", - "fileHash": "a1bc6130", + "fileHash": "916de345", "needsInterop": false }, "markdown-it": { "src": "../../.pnpm/markdown-it@14.1.0/node_modules/markdown-it/index.mjs", "file": "markdown-it.js", - "fileHash": "4662dd32", + "fileHash": "c42f7030", "needsInterop": false }, "markmap-view": { "src": "../../.pnpm/markmap-view@0.16.0_markmap-common@0.16.0/node_modules/markmap-view/dist/index.js", "file": "markmap-view.js", - "fileHash": "dc883880", + "fileHash": "ab22e9b9", "needsInterop": false }, "markmap-lib": { "src": "../../.pnpm/markmap-lib@0.16.1_markmap-common@0.16.0/node_modules/markmap-lib/dist/browser/index.mjs", "file": "markmap-lib.js", - "fileHash": "8eeed576", + "fileHash": "13beb3bd", "needsInterop": false }, "markmap-toolbar": { "src": "../../.pnpm/markmap-toolbar@0.17.2_markmap-common@0.16.0/node_modules/markmap-toolbar/dist/index.mjs", "file": "markmap-toolbar.js", - "fileHash": "5451507f", + "fileHash": "0c797f35", "needsInterop": false }, "highlight.js": { "src": "../../.pnpm/highlight.js@11.10.0/node_modules/highlight.js/es/index.js", "file": "highlight__js.js", - "fileHash": "932c2846", + "fileHash": "9e2f74c1", "needsInterop": false }, "element-plus": { "src": "../../.pnpm/element-plus@2.9.1_vue@3.5.12_typescript@5.3.3_/node_modules/element-plus/es/index.mjs", "file": "element-plus.js", - "fileHash": "a18fc0f3", + "fileHash": "966dea9d", "needsInterop": false }, "element-plus/es": { "src": "../../.pnpm/element-plus@2.9.1_vue@3.5.12_typescript@5.3.3_/node_modules/element-plus/es/index.mjs", "file": "element-plus_es.js", - "fileHash": "82ea4fc2", + "fileHash": "b513c6fc", "needsInterop": false }, "element-plus/es/locale/lang/zh-cn": { "src": "../../.pnpm/element-plus@2.9.1_vue@3.5.12_typescript@5.3.3_/node_modules/element-plus/es/locale/lang/zh-cn.mjs", "file": "element-plus_es_locale_lang_zh-cn.js", - "fileHash": "bf95d213", + "fileHash": "21e65704", "needsInterop": false }, "element-plus/es/locale/lang/en": { "src": "../../.pnpm/element-plus@2.9.1_vue@3.5.12_typescript@5.3.3_/node_modules/element-plus/es/locale/lang/en.mjs", "file": "element-plus_es_locale_lang_en.js", - "fileHash": "1f7b571d", + "fileHash": "6001b116", "needsInterop": false }, "element-plus/es/components/avatar/style/css": { "src": "../../.pnpm/element-plus@2.9.1_vue@3.5.12_typescript@5.3.3_/node_modules/element-plus/es/components/avatar/style/css.mjs", "file": "element-plus_es_components_avatar_style_css.js", - "fileHash": "891219b2", + "fileHash": "8563a091", "needsInterop": false }, "element-plus/es/components/space/style/css": { "src": "../../.pnpm/element-plus@2.9.1_vue@3.5.12_typescript@5.3.3_/node_modules/element-plus/es/components/space/style/css.mjs", "file": "element-plus_es_components_space_style_css.js", - "fileHash": "7970b235", + "fileHash": "643f0024", "needsInterop": false }, "element-plus/es/components/backtop/style/css": { "src": "../../.pnpm/element-plus@2.9.1_vue@3.5.12_typescript@5.3.3_/node_modules/element-plus/es/components/backtop/style/css.mjs", "file": "element-plus_es_components_backtop_style_css.js", - "fileHash": "a936b03f", + "fileHash": "10ae0e0a", "needsInterop": false }, "element-plus/es/components/form/style/css": { "src": "../../.pnpm/element-plus@2.9.1_vue@3.5.12_typescript@5.3.3_/node_modules/element-plus/es/components/form/style/css.mjs", "file": "element-plus_es_components_form_style_css.js", - "fileHash": "fd897ced", + "fileHash": "f12a678e", "needsInterop": false }, "element-plus/es/components/radio-group/style/css": { "src": "../../.pnpm/element-plus@2.9.1_vue@3.5.12_typescript@5.3.3_/node_modules/element-plus/es/components/radio-group/style/css.mjs", "file": "element-plus_es_components_radio-group_style_css.js", - "fileHash": "5468541c", + "fileHash": "d5a0d206", "needsInterop": false }, "element-plus/es/components/radio/style/css": { "src": "../../.pnpm/element-plus@2.9.1_vue@3.5.12_typescript@5.3.3_/node_modules/element-plus/es/components/radio/style/css.mjs", "file": "element-plus_es_components_radio_style_css.js", - "fileHash": "397b24e0", + "fileHash": "d6025baf", "needsInterop": false }, "element-plus/es/components/checkbox/style/css": { "src": "../../.pnpm/element-plus@2.9.1_vue@3.5.12_typescript@5.3.3_/node_modules/element-plus/es/components/checkbox/style/css.mjs", "file": "element-plus_es_components_checkbox_style_css.js", - "fileHash": "a7016a61", + "fileHash": "225749c8", "needsInterop": false }, "element-plus/es/components/checkbox-group/style/css": { "src": "../../.pnpm/element-plus@2.9.1_vue@3.5.12_typescript@5.3.3_/node_modules/element-plus/es/components/checkbox-group/style/css.mjs", "file": "element-plus_es_components_checkbox-group_style_css.js", - "fileHash": "4e85dc0d", + "fileHash": "df8546c7", "needsInterop": false }, "element-plus/es/components/switch/style/css": { "src": "../../.pnpm/element-plus@2.9.1_vue@3.5.12_typescript@5.3.3_/node_modules/element-plus/es/components/switch/style/css.mjs", "file": "element-plus_es_components_switch_style_css.js", - "fileHash": "08a8e648", + "fileHash": "a81bf51c", "needsInterop": false }, "element-plus/es/components/time-picker/style/css": { "src": "../../.pnpm/element-plus@2.9.1_vue@3.5.12_typescript@5.3.3_/node_modules/element-plus/es/components/time-picker/style/css.mjs", "file": "element-plus_es_components_time-picker_style_css.js", - "fileHash": "4fb65c74", + "fileHash": "3e037a47", "needsInterop": false }, "element-plus/es/components/date-picker/style/css": { "src": "../../.pnpm/element-plus@2.9.1_vue@3.5.12_typescript@5.3.3_/node_modules/element-plus/es/components/date-picker/style/css.mjs", "file": "element-plus_es_components_date-picker_style_css.js", - "fileHash": "b48fe276", + "fileHash": "aefaaf5b", "needsInterop": false }, "element-plus/es/components/descriptions/style/css": { "src": "../../.pnpm/element-plus@2.9.1_vue@3.5.12_typescript@5.3.3_/node_modules/element-plus/es/components/descriptions/style/css.mjs", "file": "element-plus_es_components_descriptions_style_css.js", - "fileHash": "e2886843", + "fileHash": "d9a0988b", "needsInterop": false }, "element-plus/es/components/descriptions-item/style/css": { "src": "../../.pnpm/element-plus@2.9.1_vue@3.5.12_typescript@5.3.3_/node_modules/element-plus/es/components/descriptions-item/style/css.mjs", "file": "element-plus_es_components_descriptions-item_style_css.js", - "fileHash": "de8cc5f0", + "fileHash": "3f51d3d1", "needsInterop": false }, "element-plus/es/components/link/style/css": { "src": "../../.pnpm/element-plus@2.9.1_vue@3.5.12_typescript@5.3.3_/node_modules/element-plus/es/components/link/style/css.mjs", "file": "element-plus_es_components_link_style_css.js", - "fileHash": "e9863823", + "fileHash": "587352f0", "needsInterop": false }, "element-plus/es/components/tooltip/style/css": { "src": "../../.pnpm/element-plus@2.9.1_vue@3.5.12_typescript@5.3.3_/node_modules/element-plus/es/components/tooltip/style/css.mjs", "file": "element-plus_es_components_tooltip_style_css.js", - "fileHash": "7c6b0b43", + "fileHash": "c60c33a2", "needsInterop": false }, "element-plus/es/components/drawer/style/css": { "src": "../../.pnpm/element-plus@2.9.1_vue@3.5.12_typescript@5.3.3_/node_modules/element-plus/es/components/drawer/style/css.mjs", "file": "element-plus_es_components_drawer_style_css.js", - "fileHash": "44b1162c", + "fileHash": "b852a345", "needsInterop": false }, "element-plus/es/components/dialog/style/css": { "src": "../../.pnpm/element-plus@2.9.1_vue@3.5.12_typescript@5.3.3_/node_modules/element-plus/es/components/dialog/style/css.mjs", "file": "element-plus_es_components_dialog_style_css.js", - "fileHash": "48522a8a", + "fileHash": "d9320f6a", "needsInterop": false }, "element-plus/es/components/checkbox-button/style/css": { "src": "../../.pnpm/element-plus@2.9.1_vue@3.5.12_typescript@5.3.3_/node_modules/element-plus/es/components/checkbox-button/style/css.mjs", "file": "element-plus_es_components_checkbox-button_style_css.js", - "fileHash": "92043456", + "fileHash": "3af03564", "needsInterop": false }, "element-plus/es/components/option-group/style/css": { "src": "../../.pnpm/element-plus@2.9.1_vue@3.5.12_typescript@5.3.3_/node_modules/element-plus/es/components/option-group/style/css.mjs", "file": "element-plus_es_components_option-group_style_css.js", - "fileHash": "fcc7edca", + "fileHash": "78bd9d42", "needsInterop": false }, "element-plus/es/components/radio-button/style/css": { "src": "../../.pnpm/element-plus@2.9.1_vue@3.5.12_typescript@5.3.3_/node_modules/element-plus/es/components/radio-button/style/css.mjs", "file": "element-plus_es_components_radio-button_style_css.js", - "fileHash": "05cc92f4", + "fileHash": "84bf68d7", "needsInterop": false }, "element-plus/es/components/cascader/style/css": { "src": "../../.pnpm/element-plus@2.9.1_vue@3.5.12_typescript@5.3.3_/node_modules/element-plus/es/components/cascader/style/css.mjs", "file": "element-plus_es_components_cascader_style_css.js", - "fileHash": "72696773", + "fileHash": "3682cd67", "needsInterop": false }, "element-plus/es/components/color-picker/style/css": { "src": "../../.pnpm/element-plus@2.9.1_vue@3.5.12_typescript@5.3.3_/node_modules/element-plus/es/components/color-picker/style/css.mjs", "file": "element-plus_es_components_color-picker_style_css.js", - "fileHash": "23e8d988", + "fileHash": "7124cace", "needsInterop": false }, "element-plus/es/components/input-number/style/css": { "src": "../../.pnpm/element-plus@2.9.1_vue@3.5.12_typescript@5.3.3_/node_modules/element-plus/es/components/input-number/style/css.mjs", "file": "element-plus_es_components_input-number_style_css.js", - "fileHash": "a6926d36", + "fileHash": "3dd6ccd2", "needsInterop": false }, "element-plus/es/components/rate/style/css": { "src": "../../.pnpm/element-plus@2.9.1_vue@3.5.12_typescript@5.3.3_/node_modules/element-plus/es/components/rate/style/css.mjs", "file": "element-plus_es_components_rate_style_css.js", - "fileHash": "1268e66a", + "fileHash": "ea61c242", "needsInterop": false }, "element-plus/es/components/select-v2/style/css": { "src": "../../.pnpm/element-plus@2.9.1_vue@3.5.12_typescript@5.3.3_/node_modules/element-plus/es/components/select-v2/style/css.mjs", "file": "element-plus_es_components_select-v2_style_css.js", - "fileHash": "7a3f021d", + "fileHash": "1965141a", "needsInterop": false }, "element-plus/es/components/tree-select/style/css": { "src": "../../.pnpm/element-plus@2.9.1_vue@3.5.12_typescript@5.3.3_/node_modules/element-plus/es/components/tree-select/style/css.mjs", "file": "element-plus_es_components_tree-select_style_css.js", - "fileHash": "bee6a974", + "fileHash": "62cc30c5", "needsInterop": false }, "element-plus/es/components/slider/style/css": { "src": "../../.pnpm/element-plus@2.9.1_vue@3.5.12_typescript@5.3.3_/node_modules/element-plus/es/components/slider/style/css.mjs", "file": "element-plus_es_components_slider_style_css.js", - "fileHash": "37b3e965", + "fileHash": "103e7192", "needsInterop": false }, "element-plus/es/components/time-select/style/css": { "src": "../../.pnpm/element-plus@2.9.1_vue@3.5.12_typescript@5.3.3_/node_modules/element-plus/es/components/time-select/style/css.mjs", "file": "element-plus_es_components_time-select_style_css.js", - "fileHash": "ee5cfed2", + "fileHash": "bed2e08f", "needsInterop": false }, "element-plus/es/components/autocomplete/style/css": { "src": "../../.pnpm/element-plus@2.9.1_vue@3.5.12_typescript@5.3.3_/node_modules/element-plus/es/components/autocomplete/style/css.mjs", "file": "element-plus_es_components_autocomplete_style_css.js", - "fileHash": "0d9c0c79", + "fileHash": "4e43e5c8", "needsInterop": false }, "element-plus/es/components/image-viewer/style/css": { "src": "../../.pnpm/element-plus@2.9.1_vue@3.5.12_typescript@5.3.3_/node_modules/element-plus/es/components/image-viewer/style/css.mjs", "file": "element-plus_es_components_image-viewer_style_css.js", - "fileHash": "73961475", + "fileHash": "b65f0917", "needsInterop": false }, "element-plus/es/components/upload/style/css": { "src": "../../.pnpm/element-plus@2.9.1_vue@3.5.12_typescript@5.3.3_/node_modules/element-plus/es/components/upload/style/css.mjs", "file": "element-plus_es_components_upload_style_css.js", - "fileHash": "5758a5b0", + "fileHash": "20c4e5e7", "needsInterop": false }, "element-plus/es/components/col/style/css": { "src": "../../.pnpm/element-plus@2.9.1_vue@3.5.12_typescript@5.3.3_/node_modules/element-plus/es/components/col/style/css.mjs", "file": "element-plus_es_components_col_style_css.js", - "fileHash": "71d50320", + "fileHash": "4fcf062e", "needsInterop": false }, "element-plus/es/components/form-item/style/css": { "src": "../../.pnpm/element-plus@2.9.1_vue@3.5.12_typescript@5.3.3_/node_modules/element-plus/es/components/form-item/style/css.mjs", "file": "element-plus_es_components_form-item_style_css.js", - "fileHash": "3b78c0b3", + "fileHash": "19354fe5", "needsInterop": false }, "element-plus/es/components/alert/style/css": { "src": "../../.pnpm/element-plus@2.9.1_vue@3.5.12_typescript@5.3.3_/node_modules/element-plus/es/components/alert/style/css.mjs", "file": "element-plus_es_components_alert_style_css.js", - "fileHash": "7e7d5594", + "fileHash": "d63433ca", "needsInterop": false }, "element-plus/es/components/breadcrumb/style/css": { "src": "../../.pnpm/element-plus@2.9.1_vue@3.5.12_typescript@5.3.3_/node_modules/element-plus/es/components/breadcrumb/style/css.mjs", "file": "element-plus_es_components_breadcrumb_style_css.js", - "fileHash": "accdbb47", + "fileHash": "05ccdd19", "needsInterop": false }, "element-plus/es/components/select/style/css": { "src": "../../.pnpm/element-plus@2.9.1_vue@3.5.12_typescript@5.3.3_/node_modules/element-plus/es/components/select/style/css.mjs", "file": "element-plus_es_components_select_style_css.js", - "fileHash": "5e86e646", + "fileHash": "0c33bcc1", "needsInterop": false }, "element-plus/es/components/input/style/css": { "src": "../../.pnpm/element-plus@2.9.1_vue@3.5.12_typescript@5.3.3_/node_modules/element-plus/es/components/input/style/css.mjs", "file": "element-plus_es_components_input_style_css.js", - "fileHash": "be078288", + "fileHash": "68ee8d38", "needsInterop": false }, "element-plus/es/components/breadcrumb-item/style/css": { "src": "../../.pnpm/element-plus@2.9.1_vue@3.5.12_typescript@5.3.3_/node_modules/element-plus/es/components/breadcrumb-item/style/css.mjs", "file": "element-plus_es_components_breadcrumb-item_style_css.js", - "fileHash": "08c99f14", + "fileHash": "c4bdf81c", "needsInterop": false }, "element-plus/es/components/tag/style/css": { "src": "../../.pnpm/element-plus@2.9.1_vue@3.5.12_typescript@5.3.3_/node_modules/element-plus/es/components/tag/style/css.mjs", "file": "element-plus_es_components_tag_style_css.js", - "fileHash": "dd1d5637", + "fileHash": "71fa3db2", "needsInterop": false }, "element-plus/es/components/pagination/style/css": { "src": "../../.pnpm/element-plus@2.9.1_vue@3.5.12_typescript@5.3.3_/node_modules/element-plus/es/components/pagination/style/css.mjs", "file": "element-plus_es_components_pagination_style_css.js", - "fileHash": "02be4af6", + "fileHash": "26f4c928", "needsInterop": false }, "element-plus/es/components/table/style/css": { "src": "../../.pnpm/element-plus@2.9.1_vue@3.5.12_typescript@5.3.3_/node_modules/element-plus/es/components/table/style/css.mjs", "file": "element-plus_es_components_table_style_css.js", - "fileHash": "ff091f17", + "fileHash": "58034308", "needsInterop": false }, "element-plus/es/components/table-v2/style/css": { "src": "../../.pnpm/element-plus@2.9.1_vue@3.5.12_typescript@5.3.3_/node_modules/element-plus/es/components/table-v2/style/css.mjs", "file": "element-plus_es_components_table-v2_style_css.js", - "fileHash": "77db0edc", + "fileHash": "eb971374", "needsInterop": false }, "element-plus/es/components/table-column/style/css": { "src": "../../.pnpm/element-plus@2.9.1_vue@3.5.12_typescript@5.3.3_/node_modules/element-plus/es/components/table-column/style/css.mjs", "file": "element-plus_es_components_table-column_style_css.js", - "fileHash": "5c065413", + "fileHash": "994e2dbd", "needsInterop": false }, "element-plus/es/components/card/style/css": { "src": "../../.pnpm/element-plus@2.9.1_vue@3.5.12_typescript@5.3.3_/node_modules/element-plus/es/components/card/style/css.mjs", "file": "element-plus_es_components_card_style_css.js", - "fileHash": "17937582", + "fileHash": "02a565b1", "needsInterop": false }, "element-plus/es/components/row/style/css": { "src": "../../.pnpm/element-plus@2.9.1_vue@3.5.12_typescript@5.3.3_/node_modules/element-plus/es/components/row/style/css.mjs", "file": "element-plus_es_components_row_style_css.js", - "fileHash": "000ceb69", + "fileHash": "f997769c", "needsInterop": false }, "element-plus/es/components/button/style/css": { "src": "../../.pnpm/element-plus@2.9.1_vue@3.5.12_typescript@5.3.3_/node_modules/element-plus/es/components/button/style/css.mjs", "file": "element-plus_es_components_button_style_css.js", - "fileHash": "32088608", + "fileHash": "6d254cf3", "needsInterop": false }, "element-plus/es/components/menu/style/css": { "src": "../../.pnpm/element-plus@2.9.1_vue@3.5.12_typescript@5.3.3_/node_modules/element-plus/es/components/menu/style/css.mjs", "file": "element-plus_es_components_menu_style_css.js", - "fileHash": "e86c4695", + "fileHash": "1e4473bb", "needsInterop": false }, "element-plus/es/components/sub-menu/style/css": { "src": "../../.pnpm/element-plus@2.9.1_vue@3.5.12_typescript@5.3.3_/node_modules/element-plus/es/components/sub-menu/style/css.mjs", "file": "element-plus_es_components_sub-menu_style_css.js", - "fileHash": "3c765f57", + "fileHash": "6b67f391", "needsInterop": false }, "element-plus/es/components/menu-item/style/css": { "src": "../../.pnpm/element-plus@2.9.1_vue@3.5.12_typescript@5.3.3_/node_modules/element-plus/es/components/menu-item/style/css.mjs", "file": "element-plus_es_components_menu-item_style_css.js", - "fileHash": "d4d7547a", + "fileHash": "e882368c", "needsInterop": false }, "element-plus/es/components/option/style/css": { "src": "../../.pnpm/element-plus@2.9.1_vue@3.5.12_typescript@5.3.3_/node_modules/element-plus/es/components/option/style/css.mjs", "file": "element-plus_es_components_option_style_css.js", - "fileHash": "8ae0bf09", + "fileHash": "175bef3b", "needsInterop": false }, "element-plus/es/components/dropdown/style/css": { "src": "../../.pnpm/element-plus@2.9.1_vue@3.5.12_typescript@5.3.3_/node_modules/element-plus/es/components/dropdown/style/css.mjs", "file": "element-plus_es_components_dropdown_style_css.js", - "fileHash": "6dd7bfac", + "fileHash": "9b47788d", "needsInterop": false }, "element-plus/es/components/dropdown-menu/style/css": { "src": "../../.pnpm/element-plus@2.9.1_vue@3.5.12_typescript@5.3.3_/node_modules/element-plus/es/components/dropdown-menu/style/css.mjs", "file": "element-plus_es_components_dropdown-menu_style_css.js", - "fileHash": "e063651e", + "fileHash": "2d06fdc0", "needsInterop": false }, "element-plus/es/components/dropdown-item/style/css": { "src": "../../.pnpm/element-plus@2.9.1_vue@3.5.12_typescript@5.3.3_/node_modules/element-plus/es/components/dropdown-item/style/css.mjs", "file": "element-plus_es_components_dropdown-item_style_css.js", - "fileHash": "bf78ffbd", + "fileHash": "ee6eae1f", "needsInterop": false }, "element-plus/es/components/skeleton/style/css": { "src": "../../.pnpm/element-plus@2.9.1_vue@3.5.12_typescript@5.3.3_/node_modules/element-plus/es/components/skeleton/style/css.mjs", "file": "element-plus_es_components_skeleton_style_css.js", - "fileHash": "c8764342", + "fileHash": "c95ca853", "needsInterop": false }, "element-plus/es/components/tree/style/css": { "src": "../../.pnpm/element-plus@2.9.1_vue@3.5.12_typescript@5.3.3_/node_modules/element-plus/es/components/tree/style/css.mjs", "file": "element-plus_es_components_tree_style_css.js", - "fileHash": "d5410c5b", + "fileHash": "e25ebc9d", "needsInterop": false }, "element-plus/es/components/badge/style/css": { "src": "../../.pnpm/element-plus@2.9.1_vue@3.5.12_typescript@5.3.3_/node_modules/element-plus/es/components/badge/style/css.mjs", "file": "element-plus_es_components_badge_style_css.js", - "fileHash": "27b5ccd1", + "fileHash": "396cbf65", "needsInterop": false }, "element-plus/es/components/image/style/css": { "src": "../../.pnpm/element-plus@2.9.1_vue@3.5.12_typescript@5.3.3_/node_modules/element-plus/es/components/image/style/css.mjs", "file": "element-plus_es_components_image_style_css.js", - "fileHash": "7038f2e2", + "fileHash": "2c813731", "needsInterop": false }, "element-plus/es/components/collapse-transition/style/css": { "src": "../../.pnpm/element-plus@2.9.1_vue@3.5.12_typescript@5.3.3_/node_modules/element-plus/es/components/collapse-transition/style/css.mjs", "file": "element-plus_es_components_collapse-transition_style_css.js", - "fileHash": "5fb1963c", + "fileHash": "c65687cf", "needsInterop": false }, "element-plus/es/components/timeline/style/css": { "src": "../../.pnpm/element-plus@2.9.1_vue@3.5.12_typescript@5.3.3_/node_modules/element-plus/es/components/timeline/style/css.mjs", "file": "element-plus_es_components_timeline_style_css.js", - "fileHash": "d636e109", + "fileHash": "a67ebb8e", "needsInterop": false }, "element-plus/es/components/timeline-item/style/css": { "src": "../../.pnpm/element-plus@2.9.1_vue@3.5.12_typescript@5.3.3_/node_modules/element-plus/es/components/timeline-item/style/css.mjs", "file": "element-plus_es_components_timeline-item_style_css.js", - "fileHash": "a6935cfe", + "fileHash": "92302e28", "needsInterop": false }, "element-plus/es/components/collapse/style/css": { "src": "../../.pnpm/element-plus@2.9.1_vue@3.5.12_typescript@5.3.3_/node_modules/element-plus/es/components/collapse/style/css.mjs", "file": "element-plus_es_components_collapse_style_css.js", - "fileHash": "99187708", + "fileHash": "1aec4d8d", "needsInterop": false }, "element-plus/es/components/collapse-item/style/css": { "src": "../../.pnpm/element-plus@2.9.1_vue@3.5.12_typescript@5.3.3_/node_modules/element-plus/es/components/collapse-item/style/css.mjs", "file": "element-plus_es_components_collapse-item_style_css.js", - "fileHash": "caa5071e", + "fileHash": "8b101f69", "needsInterop": false }, "element-plus/es/components/button-group/style/css": { "src": "../../.pnpm/element-plus@2.9.1_vue@3.5.12_typescript@5.3.3_/node_modules/element-plus/es/components/button-group/style/css.mjs", "file": "element-plus_es_components_button-group_style_css.js", - "fileHash": "95cee2ed", + "fileHash": "e2318f25", "needsInterop": false }, "element-plus/es/components/text/style/css": { "src": "../../.pnpm/element-plus@2.9.1_vue@3.5.12_typescript@5.3.3_/node_modules/element-plus/es/components/text/style/css.mjs", "file": "element-plus_es_components_text_style_css.js", - "fileHash": "132d11d8", + "fileHash": "293d05ce", "needsInterop": false }, "element-plus/es/components/segmented/style/css": { "src": "../../.pnpm/element-plus@2.9.1_vue@3.5.12_typescript@5.3.3_/node_modules/element-plus/es/components/segmented/style/css.mjs", "file": "element-plus_es_components_segmented_style_css.js", - "fileHash": "b2f00ac0", + "fileHash": "ff8405f3", "needsInterop": false }, "@element-plus/icons-vue": { "src": "../../.pnpm/@element-plus+icons-vue@2.3.1_vue@3.5.12_typescript@5.3.3_/node_modules/@element-plus/icons-vue/dist/index.js", "file": "@element-plus_icons-vue.js", - "fileHash": "f9da83bf", + "fileHash": "cd1128c9", "needsInterop": false }, "element-plus/es/components/footer/style/css": { "src": "../../.pnpm/element-plus@2.9.1_vue@3.5.12_typescript@5.3.3_/node_modules/element-plus/es/components/footer/style/css.mjs", "file": "element-plus_es_components_footer_style_css.js", - "fileHash": "f6ce6c89", + "fileHash": "1a496ba1", "needsInterop": false }, "element-plus/es/components/empty/style/css": { "src": "../../.pnpm/element-plus@2.9.1_vue@3.5.12_typescript@5.3.3_/node_modules/element-plus/es/components/empty/style/css.mjs", "file": "element-plus_es_components_empty_style_css.js", - "fileHash": "060b4b15", + "fileHash": "1af33c67", "needsInterop": false }, "@form-create/designer": { "src": "../../.pnpm/@form-create+designer@3.2.8_vue@3.5.12_typescript@5.3.3_/node_modules/@form-create/designer/dist/index.es.js", "file": "@form-create_designer.js", - "fileHash": "f34836d2", + "fileHash": "74fcb601", "needsInterop": false }, "@form-create/element-ui": { "src": "../../.pnpm/@form-create+element-ui@3.2.14_vue@3.5.12_typescript@5.3.3_/node_modules/@form-create/element-ui/dist/form-create.esm.js", "file": "@form-create_element-ui.js", - "fileHash": "d874ab8e", + "fileHash": "f8493c3d", "needsInterop": false }, "@form-create/element-ui/auto-import": { "src": "../../.pnpm/@form-create+element-ui@3.2.14_vue@3.5.12_typescript@5.3.3_/node_modules/@form-create/element-ui/auto-import.js", "file": "@form-create_element-ui_auto-import.js", - "fileHash": "8af52a50", + "fileHash": "81c4fe55", "needsInterop": false }, "@videojs-player/vue": { "src": "../../.pnpm/@videojs-player+vue@1.0.0_@types+video.js@7.3.58_video.js@7.21.6_vue@3.5.12_typescript@5.3.3_/node_modules/@videojs-player/vue/dist/videojs-player.esm.js", "file": "@videojs-player_vue.js", - "fileHash": "78e36373", + "fileHash": "d867dc9a", "needsInterop": false }, "benz-amr-recorder": { "src": "../../.pnpm/benz-amr-recorder@1.1.5/node_modules/benz-amr-recorder/BenzAMRRecorder.js", "file": "benz-amr-recorder.js", - "fileHash": "57809b39", + "fileHash": "dcc796c4", "needsInterop": true }, "bpmn-js-token-simulation": { "src": "../../.pnpm/bpmn-js-token-simulation@0.36.0/node_modules/bpmn-js-token-simulation/lib/index.js", "file": "bpmn-js-token-simulation.js", - "fileHash": "c3871b47", + "fileHash": "9fe3990c", "needsInterop": false }, "bpmn-js/lib/features/modeling/util/LaneUtil": { "src": "../../.pnpm/bpmn-js@17.11.1/node_modules/bpmn-js/lib/features/modeling/util/LaneUtil.js", "file": "bpmn-js_lib_features_modeling_util_LaneUtil.js", - "fileHash": "f4251027", + "fileHash": "66e02d25", "needsInterop": false }, "bpmn-js/lib/features/modeling/util/ModelingUtil": { "src": "../../.pnpm/bpmn-js@17.11.1/node_modules/bpmn-js/lib/features/modeling/util/ModelingUtil.js", "file": "bpmn-js_lib_features_modeling_util_ModelingUtil.js", - "fileHash": "fcdd557f", + "fileHash": "b83e14bd", "needsInterop": false }, "bpmn-js/lib/features/palette/PaletteProvider": { "src": "../../.pnpm/bpmn-js@17.11.1/node_modules/bpmn-js/lib/features/palette/PaletteProvider.js", "file": "bpmn-js_lib_features_palette_PaletteProvider.js", - "fileHash": "6e94205c", + "fileHash": "52fce879", "needsInterop": false }, "bpmn-js/lib/Modeler": { "src": "../../.pnpm/bpmn-js@17.11.1/node_modules/bpmn-js/lib/Modeler.js", "file": "bpmn-js_lib_Modeler.js", - "fileHash": "de2f3de6", + "fileHash": "b57f1483", "needsInterop": false }, "bpmn-js/lib/util/DiUtil": { "src": "../../.pnpm/bpmn-js@17.11.1/node_modules/bpmn-js/lib/util/DiUtil.js", "file": "bpmn-js_lib_util_DiUtil.js", - "fileHash": "82814204", + "fileHash": "cc645513", "needsInterop": false }, "bpmn-js/lib/util/ModelUtil": { "src": "../../.pnpm/bpmn-js@17.11.1/node_modules/bpmn-js/lib/util/ModelUtil.js", "file": "bpmn-js_lib_util_ModelUtil.js", - "fileHash": "2e1e6cab", + "fileHash": "b46e2a8d", "needsInterop": false }, "bpmn-js/lib/Viewer": { "src": "../../.pnpm/bpmn-js@17.11.1/node_modules/bpmn-js/lib/Viewer.js", "file": "bpmn-js_lib_Viewer.js", - "fileHash": "7f21e624", + "fileHash": "234238a6", "needsInterop": false }, "dayjs/plugin/relativeTime": { "src": "../../.pnpm/dayjs@1.11.13/node_modules/dayjs/plugin/relativeTime.js", "file": "dayjs_plugin_relativeTime.js", - "fileHash": "6bc8d903", + "fileHash": "3d8a1d94", "needsInterop": true }, "diagram-js/lib/navigation/movecanvas": { "src": "../../.pnpm/diagram-js@12.8.1/node_modules/diagram-js/lib/navigation/movecanvas/index.js", "file": "diagram-js_lib_navigation_movecanvas.js", - "fileHash": "70768efb", + "fileHash": "a7da76fd", "needsInterop": false }, "diagram-js/lib/util/Mouse": { "src": "../../.pnpm/diagram-js@12.8.1/node_modules/diagram-js/lib/util/Mouse.js", "file": "diagram-js_lib_util_Mouse.js", - "fileHash": "5a7d6cfc", + "fileHash": "866b74eb", "needsInterop": false }, "echarts": { "src": "../../.pnpm/echarts@5.5.1/node_modules/echarts/index.js", "file": "echarts.js", - "fileHash": "facdeabf", + "fileHash": "fc7c75ac", "needsInterop": false }, "echarts/lib/component/markArea": { "src": "../../.pnpm/echarts@5.5.1/node_modules/echarts/lib/component/markArea.js", "file": "echarts_lib_component_markArea.js", - "fileHash": "f1ab6298", + "fileHash": "a3b8b3aa", "needsInterop": false }, "echarts/lib/component/markLine": { "src": "../../.pnpm/echarts@5.5.1/node_modules/echarts/lib/component/markLine.js", "file": "echarts_lib_component_markLine.js", - "fileHash": "ad683a1a", + "fileHash": "3c66ff0e", "needsInterop": false }, "echarts/lib/component/markPoint": { "src": "../../.pnpm/echarts@5.5.1/node_modules/echarts/lib/component/markPoint.js", "file": "echarts_lib_component_markPoint.js", - "fileHash": "208bf403", + "fileHash": "68c7ff6c", "needsInterop": false }, "element-plus/es/components/scrollbar/index": { "src": "../../.pnpm/element-plus@2.9.1_vue@3.5.12_typescript@5.3.3_/node_modules/element-plus/es/components/scrollbar/index.mjs", "file": "element-plus_es_components_scrollbar_index.js", - "fileHash": "2a9cd79d", + "fileHash": "8108ac66", "needsInterop": false }, "element-plus/es/components/upload/src/upload": { "src": "../../.pnpm/element-plus@2.9.1_vue@3.5.12_typescript@5.3.3_/node_modules/element-plus/es/components/upload/src/upload.mjs", "file": "element-plus_es_components_upload_src_upload.js", - "fileHash": "708b8623", + "fileHash": "b2ba6bed", "needsInterop": false }, "highlight.js/lib/languages/java": { "src": "../../.pnpm/highlight.js@11.10.0/node_modules/highlight.js/es/languages/java.js", "file": "highlight__js_lib_languages_java.js", - "fileHash": "9d3e569e", + "fileHash": "62ef0a5c", "needsInterop": false }, "highlight.js/lib/languages/javascript": { "src": "../../.pnpm/highlight.js@11.10.0/node_modules/highlight.js/es/languages/javascript.js", "file": "highlight__js_lib_languages_javascript.js", - "fileHash": "760cd481", + "fileHash": "1b9a4a6d", "needsInterop": false }, "highlight.js/lib/languages/json": { "src": "../../.pnpm/highlight.js@11.10.0/node_modules/highlight.js/es/languages/json.js", "file": "highlight__js_lib_languages_json.js", - "fileHash": "67e9c536", + "fileHash": "6886c9a0", "needsInterop": false }, "highlight.js/lib/languages/sql": { "src": "../../.pnpm/highlight.js@11.10.0/node_modules/highlight.js/es/languages/sql.js", "file": "highlight__js_lib_languages_sql.js", - "fileHash": "61dd0d9f", + "fileHash": "d51e94d5", "needsInterop": false }, "highlight.js/lib/languages/typescript": { "src": "../../.pnpm/highlight.js@11.10.0/node_modules/highlight.js/es/languages/typescript.js", "file": "highlight__js_lib_languages_typescript.js", - "fileHash": "051b33b8", + "fileHash": "b4227a76", "needsInterop": false }, "jsencrypt": { "src": "../../.pnpm/jsencrypt@3.3.2/node_modules/jsencrypt/lib/index.js", "file": "jsencrypt.js", - "fileHash": "3a25ba45", + "fileHash": "ad77b9da", "needsInterop": false }, "min-dash": { "src": "../../.pnpm/min-dash@4.2.2/node_modules/min-dash/dist/index.esm.js", "file": "min-dash.js", - "fileHash": "554b7256", + "fileHash": "623aab5b", "needsInterop": false }, "pinia-plugin-persistedstate": { "src": "../../.pnpm/pinia-plugin-persistedstate@3.2.3_pinia@2.2.8_typescript@5.3.3_vue@3.5.12_typescript@5.3.3__/node_modules/pinia-plugin-persistedstate/dist/index.js", "file": "pinia-plugin-persistedstate.js", - "fileHash": "95615255", + "fileHash": "1cc1a11c", "needsInterop": false }, "sortablejs": { "src": "../../.pnpm/sortablejs@1.15.6/node_modules/sortablejs/modular/sortable.esm.js", "file": "sortablejs.js", - "fileHash": "5988a890", + "fileHash": "c7c72b70", "needsInterop": false }, "steady-xml": { "src": "../../.pnpm/steady-xml@0.1.0/node_modules/steady-xml/dist/index.mjs", "file": "steady-xml.js", - "fileHash": "2f1b0da8", + "fileHash": "bec0ca10", "needsInterop": false }, "vue-dompurify-html": { "src": "../../.pnpm/vue-dompurify-html@4.1.4_vue@3.5.12_typescript@5.3.3_/node_modules/vue-dompurify-html/dist/vue-dompurify-html.mjs", "file": "vue-dompurify-html.js", - "fileHash": "36fa75c2", + "fileHash": "0946223e", "needsInterop": false }, "vuedraggable": { "src": "../../.pnpm/vuedraggable@4.1.0_vue@3.5.12_typescript@5.3.3_/node_modules/vuedraggable/dist/vuedraggable.umd.js", "file": "vuedraggable.js", - "fileHash": "90e5354c", + "fileHash": "40170b0a", "needsInterop": true }, "element-plus/es/components/config-provider/style/css": { "src": "../../.pnpm/element-plus@2.9.1_vue@3.5.12_typescript@5.3.3_/node_modules/element-plus/es/components/config-provider/style/css.mjs", "file": "element-plus_es_components_config-provider_style_css.js", - "fileHash": "6bed708c", + "fileHash": "090169b4", "needsInterop": false }, "element-plus/es/components/message/style/css": { "src": "../../.pnpm/element-plus@2.9.1_vue@3.5.12_typescript@5.3.3_/node_modules/element-plus/es/components/message/style/css.mjs", "file": "element-plus_es_components_message_style_css.js", - "fileHash": "d403f9e3", + "fileHash": "6dedb6a2", "needsInterop": false }, "element-plus/es/components/base/style/css": { "src": "../../.pnpm/element-plus@2.9.1_vue@3.5.12_typescript@5.3.3_/node_modules/element-plus/es/components/base/style/css.mjs", "file": "element-plus_es_components_base_style_css.js", - "fileHash": "82b3fcb9", + "fileHash": "06cf3f8b", "needsInterop": false }, "element-plus/es/components/transfer/style/css": { "src": "../../.pnpm/element-plus@2.9.1_vue@3.5.12_typescript@5.3.3_/node_modules/element-plus/es/components/transfer/style/css.mjs", "file": "element-plus_es_components_transfer_style_css.js", - "fileHash": "9525240a", + "fileHash": "83648b93", "needsInterop": false }, "element-plus/es/components/aside/style/css": { "src": "../../.pnpm/element-plus@2.9.1_vue@3.5.12_typescript@5.3.3_/node_modules/element-plus/es/components/aside/style/css.mjs", "file": "element-plus_es_components_aside_style_css.js", - "fileHash": "86f034f8", + "fileHash": "4f0e0905", "needsInterop": false }, "element-plus/es/components/container/style/css": { "src": "../../.pnpm/element-plus@2.9.1_vue@3.5.12_typescript@5.3.3_/node_modules/element-plus/es/components/container/style/css.mjs", "file": "element-plus_es_components_container_style_css.js", - "fileHash": "84f5d161", + "fileHash": "1c389b3f", "needsInterop": false }, "element-plus/es/components/divider/style/css": { "src": "../../.pnpm/element-plus@2.9.1_vue@3.5.12_typescript@5.3.3_/node_modules/element-plus/es/components/divider/style/css.mjs", "file": "element-plus_es_components_divider_style_css.js", - "fileHash": "2f0ebe24", + "fileHash": "0268d025", "needsInterop": false }, "element-plus/es/components/header/style/css": { "src": "../../.pnpm/element-plus@2.9.1_vue@3.5.12_typescript@5.3.3_/node_modules/element-plus/es/components/header/style/css.mjs", "file": "element-plus_es_components_header_style_css.js", - "fileHash": "0071354a", + "fileHash": "5994422a", "needsInterop": false }, "element-plus/es/components/main/style/css": { "src": "../../.pnpm/element-plus@2.9.1_vue@3.5.12_typescript@5.3.3_/node_modules/element-plus/es/components/main/style/css.mjs", "file": "element-plus_es_components_main_style_css.js", - "fileHash": "aea3d79f", + "fileHash": "ef6515aa", "needsInterop": false }, "element-plus/es/components/popconfirm/style/css": { "src": "../../.pnpm/element-plus@2.9.1_vue@3.5.12_typescript@5.3.3_/node_modules/element-plus/es/components/popconfirm/style/css.mjs", "file": "element-plus_es_components_popconfirm_style_css.js", - "fileHash": "535725bb", + "fileHash": "00fd11ec", "needsInterop": false }, "element-plus/es/components/tab-pane/style/css": { "src": "../../.pnpm/element-plus@2.9.1_vue@3.5.12_typescript@5.3.3_/node_modules/element-plus/es/components/tab-pane/style/css.mjs", "file": "element-plus_es_components_tab-pane_style_css.js", - "fileHash": "3c27909e", + "fileHash": "f13f6b66", "needsInterop": false }, "element-plus/es/components/tabs/style/css": { "src": "../../.pnpm/element-plus@2.9.1_vue@3.5.12_typescript@5.3.3_/node_modules/element-plus/es/components/tabs/style/css.mjs", "file": "element-plus_es_components_tabs_style_css.js", - "fileHash": "80847cc9", + "fileHash": "9baf5611", "needsInterop": false }, "element-plus/es/components/loading/style/css": { "src": "../../.pnpm/element-plus@2.9.1_vue@3.5.12_typescript@5.3.3_/node_modules/element-plus/es/components/loading/style/css.mjs", "file": "element-plus_es_components_loading_style_css.js", - "fileHash": "b2605858", + "fileHash": "7efe0622", "needsInterop": false }, "element-plus/es/components/scrollbar/style/css": { "src": "../../.pnpm/element-plus@2.9.1_vue@3.5.12_typescript@5.3.3_/node_modules/element-plus/es/components/scrollbar/style/css.mjs", "file": "element-plus_es_components_scrollbar_style_css.js", - "fileHash": "adc106c0", + "fileHash": "c6a21bcf", "needsInterop": false }, "element-plus/es/components/message-box/style/css": { "src": "../../.pnpm/element-plus@2.9.1_vue@3.5.12_typescript@5.3.3_/node_modules/element-plus/es/components/message-box/style/css.mjs", "file": "element-plus_es_components_message-box_style_css.js", - "fileHash": "02b6484a", + "fileHash": "e1ad0ddb", "needsInterop": false }, "element-plus/es/components/notification/style/css": { "src": "../../.pnpm/element-plus@2.9.1_vue@3.5.12_typescript@5.3.3_/node_modules/element-plus/es/components/notification/style/css.mjs", "file": "element-plus_es_components_notification_style_css.js", - "fileHash": "99cc6031", + "fileHash": "8cb7d25f", "needsInterop": false }, "element-plus/es/components/icon/style/css": { "src": "../../.pnpm/element-plus@2.9.1_vue@3.5.12_typescript@5.3.3_/node_modules/element-plus/es/components/icon/style/css.mjs", "file": "element-plus_es_components_icon_style_css.js", - "fileHash": "0af7347b", + "fileHash": "6752e038", "needsInterop": false }, "element-plus/es/components/popover/style/css": { "src": "../../.pnpm/element-plus@2.9.1_vue@3.5.12_typescript@5.3.3_/node_modules/element-plus/es/components/popover/style/css.mjs", "file": "element-plus_es_components_popover_style_css.js", - "fileHash": "165ea507", + "fileHash": "2f1ae12a", + "needsInterop": false + }, + "element-plus/es/components/steps/style/css": { + "src": "../../.pnpm/element-plus@2.9.1_vue@3.5.12_typescript@5.3.3_/node_modules/element-plus/es/components/steps/style/css.mjs", + "file": "element-plus_es_components_steps_style_css.js", + "fileHash": "029c4b0d", + "needsInterop": false + }, + "element-plus/es/components/step/style/css": { + "src": "../../.pnpm/element-plus@2.9.1_vue@3.5.12_typescript@5.3.3_/node_modules/element-plus/es/components/step/style/css.mjs", + "file": "element-plus_es_components_step_style_css.js", + "fileHash": "63727543", "needsInterop": false } }, @@ -963,26 +975,14 @@ "chunk-M4AQHOXJ": { "file": "chunk-M4AQHOXJ.js" }, - "chunk-VUQJMARV": { - "file": "chunk-VUQJMARV.js" - }, - "chunk-KKQ6WPIB": { - "file": "chunk-KKQ6WPIB.js" + "chunk-FKOWI4VU": { + "file": "chunk-FKOWI4VU.js" }, "chunk-2VL3FEXP": { "file": "chunk-2VL3FEXP.js" }, - "chunk-7TL3JRAD": { - "file": "chunk-7TL3JRAD.js" - }, - "chunk-T4R4535C": { - "file": "chunk-T4R4535C.js" - }, - "chunk-7C6J56BH": { - "file": "chunk-7C6J56BH.js" - }, - "chunk-FKOWI4VU": { - "file": "chunk-FKOWI4VU.js" + "chunk-NTWXIMGM": { + "file": "chunk-NTWXIMGM.js" }, "chunk-BCFMTI3R": { "file": "chunk-BCFMTI3R.js" @@ -993,6 +993,18 @@ "chunk-PBO22ZEO": { "file": "chunk-PBO22ZEO.js" }, + "chunk-UEIE3ZOK": { + "file": "chunk-UEIE3ZOK.js" + }, + "chunk-T4R4535C": { + "file": "chunk-T4R4535C.js" + }, + "chunk-KKQ6WPIB": { + "file": "chunk-KKQ6WPIB.js" + }, + "chunk-7C6J56BH": { + "file": "chunk-7C6J56BH.js" + }, "chunk-FNF472WR": { "file": "chunk-FNF472WR.js" }, @@ -1008,44 +1020,44 @@ "chunk-FBJWDERR": { "file": "chunk-FBJWDERR.js" }, + "chunk-4TBAE7E3": { + "file": "chunk-4TBAE7E3.js" + }, "chunk-DAIKNY7H": { "file": "chunk-DAIKNY7H.js" }, - "chunk-WTG273Z3": { - "file": "chunk-WTG273Z3.js" - }, - "chunk-5MJQOEES": { - "file": "chunk-5MJQOEES.js" - }, "chunk-KYZIX7KK": { "file": "chunk-KYZIX7KK.js" }, + "chunk-OX6JP2AA": { + "file": "chunk-OX6JP2AA.js" + }, + "chunk-5MJQOEES": { + "file": "chunk-5MJQOEES.js" + }, + "chunk-WTG273Z3": { + "file": "chunk-WTG273Z3.js" + }, "chunk-46FTKYZS": { "file": "chunk-46FTKYZS.js" }, - "chunk-4TBAE7E3": { - "file": "chunk-4TBAE7E3.js" - }, "chunk-C373DD4S": { "file": "chunk-C373DD4S.js" }, - "chunk-KARBCTKP": { - "file": "chunk-KARBCTKP.js" - }, "chunk-HZRC7S76": { "file": "chunk-HZRC7S76.js" }, - "chunk-OX6JP2AA": { - "file": "chunk-OX6JP2AA.js" + "chunk-DWEZRTLP": { + "file": "chunk-DWEZRTLP.js" }, - "chunk-MGTDGDA4": { - "file": "chunk-MGTDGDA4.js" + "chunk-5CTUXGGF": { + "file": "chunk-5CTUXGGF.js" }, "chunk-B4L4KVT2": { "file": "chunk-B4L4KVT2.js" }, - "chunk-OKMHUHKP": { - "file": "chunk-OKMHUHKP.js" + "chunk-MGTDGDA4": { + "file": "chunk-MGTDGDA4.js" }, "chunk-JWIHIIT3": { "file": "chunk-JWIHIIT3.js" @@ -1059,6 +1071,9 @@ "chunk-HGRMPKRI": { "file": "chunk-HGRMPKRI.js" }, + "chunk-OKMHUHKP": { + "file": "chunk-OKMHUHKP.js" + }, "chunk-NZR6SVVT": { "file": "chunk-NZR6SVVT.js" }, @@ -1068,39 +1083,6 @@ "chunk-DB6OWVVK": { "file": "chunk-DB6OWVVK.js" }, - "chunk-IE46N2PU": { - "file": "chunk-IE46N2PU.js" - }, - "chunk-T6DOWK6H": { - "file": "chunk-T6DOWK6H.js" - }, - "chunk-DWEZRTLP": { - "file": "chunk-DWEZRTLP.js" - }, - "chunk-5CTUXGGF": { - "file": "chunk-5CTUXGGF.js" - }, - "chunk-ZEGP4DVR": { - "file": "chunk-ZEGP4DVR.js" - }, - "chunk-IIHLKWL5": { - "file": "chunk-IIHLKWL5.js" - }, - "chunk-MB7KUOZ6": { - "file": "chunk-MB7KUOZ6.js" - }, - "chunk-VLWH5T2T": { - "file": "chunk-VLWH5T2T.js" - }, - "chunk-7EBAVFZW": { - "file": "chunk-7EBAVFZW.js" - }, - "chunk-JQ2IYF3Y": { - "file": "chunk-JQ2IYF3Y.js" - }, - "chunk-5KQYIVGF": { - "file": "chunk-5KQYIVGF.js" - }, "chunk-FRMPVTTW": { "file": "chunk-FRMPVTTW.js" }, @@ -1110,18 +1092,48 @@ "chunk-HODVN2HK": { "file": "chunk-HODVN2HK.js" }, + "chunk-JQ2IYF3Y": { + "file": "chunk-JQ2IYF3Y.js" + }, + "chunk-T6DOWK6H": { + "file": "chunk-T6DOWK6H.js" + }, "chunk-3N2VGZJ2": { "file": "chunk-3N2VGZJ2.js" }, - "chunk-DI2SIYDQ": { - "file": "chunk-DI2SIYDQ.js" + "chunk-KARBCTKP": { + "file": "chunk-KARBCTKP.js" }, - "chunk-GVKQVKU2": { - "file": "chunk-GVKQVKU2.js" + "chunk-ZEGP4DVR": { + "file": "chunk-ZEGP4DVR.js" + }, + "chunk-IIHLKWL5": { + "file": "chunk-IIHLKWL5.js" + }, + "chunk-7EBAVFZW": { + "file": "chunk-7EBAVFZW.js" + }, + "chunk-MB7KUOZ6": { + "file": "chunk-MB7KUOZ6.js" + }, + "chunk-VLWH5T2T": { + "file": "chunk-VLWH5T2T.js" + }, + "chunk-5KQYIVGF": { + "file": "chunk-5KQYIVGF.js" + }, + "chunk-IE46N2PU": { + "file": "chunk-IE46N2PU.js" + }, + "chunk-QM5QNHIO": { + "file": "chunk-QM5QNHIO.js" }, "chunk-TQUTZUXW": { "file": "chunk-TQUTZUXW.js" }, + "chunk-GVKQVKU2": { + "file": "chunk-GVKQVKU2.js" + }, "chunk-PHKUHJQP": { "file": "chunk-PHKUHJQP.js" }, @@ -1131,14 +1143,14 @@ "chunk-O7KFMITO": { "file": "chunk-O7KFMITO.js" }, - "chunk-5TRUIT6X": { - "file": "chunk-5TRUIT6X.js" + "chunk-ND6EB7CF": { + "file": "chunk-ND6EB7CF.js" }, - "chunk-B7BHKFMQ": { - "file": "chunk-B7BHKFMQ.js" + "chunk-2I4JXH7Q": { + "file": "chunk-2I4JXH7Q.js" }, - "chunk-AVUFTFUY": { - "file": "chunk-AVUFTFUY.js" + "chunk-KJFX5ANN": { + "file": "chunk-KJFX5ANN.js" }, "chunk-QESB5RLU": { "file": "chunk-QESB5RLU.js" @@ -1149,53 +1161,56 @@ "chunk-UGLGEV52": { "file": "chunk-UGLGEV52.js" }, - "chunk-OK7RLQFU": { - "file": "chunk-OK7RLQFU.js" + "chunk-YNRHTVZR": { + "file": "chunk-YNRHTVZR.js" }, - "chunk-XOGBX6XX": { - "file": "chunk-XOGBX6XX.js" + "chunk-NMP246CO": { + "file": "chunk-NMP246CO.js" }, - "chunk-LMCXLDL6": { - "file": "chunk-LMCXLDL6.js" + "chunk-P7FEEIEF": { + "file": "chunk-P7FEEIEF.js" }, - "chunk-MI64HPK2": { - "file": "chunk-MI64HPK2.js" + "chunk-QQGFJP25": { + "file": "chunk-QQGFJP25.js" }, - "chunk-MJTDC4LM": { - "file": "chunk-MJTDC4LM.js" + "chunk-D6WD7HPM": { + "file": "chunk-D6WD7HPM.js" }, - "chunk-6WG6DCDF": { - "file": "chunk-6WG6DCDF.js" + "chunk-FGVL4PGJ": { + "file": "chunk-FGVL4PGJ.js" }, - "chunk-RT6BLZNS": { - "file": "chunk-RT6BLZNS.js" + "chunk-F5M4HOVH": { + "file": "chunk-F5M4HOVH.js" }, - "chunk-EPSCDAO5": { - "file": "chunk-EPSCDAO5.js" - }, - "chunk-QCHF3BA4": { - "file": "chunk-QCHF3BA4.js" - }, - "chunk-GHX2KDDY": { - "file": "chunk-GHX2KDDY.js" - }, - "chunk-5G7BH44C": { - "file": "chunk-5G7BH44C.js" + "chunk-VW272IHF": { + "file": "chunk-VW272IHF.js" }, "chunk-QAR3K42R": { "file": "chunk-QAR3K42R.js" }, - "chunk-LPIVSPWN": { - "file": "chunk-LPIVSPWN.js" + "chunk-LEHUY6WA": { + "file": "chunk-LEHUY6WA.js" }, - "chunk-TCVRGDT4": { - "file": "chunk-TCVRGDT4.js" + "chunk-XNS7XN3L": { + "file": "chunk-XNS7XN3L.js" }, - "chunk-HOOPLKFT": { - "file": "chunk-HOOPLKFT.js" + "chunk-2TFNBWBF": { + "file": "chunk-2TFNBWBF.js" }, - "chunk-M6ZIMNOI": { - "file": "chunk-M6ZIMNOI.js" + "chunk-X5CQ556A": { + "file": "chunk-X5CQ556A.js" + }, + "chunk-NF6IA4AL": { + "file": "chunk-NF6IA4AL.js" + }, + "chunk-QJLIGECE": { + "file": "chunk-QJLIGECE.js" + }, + "chunk-GVYX3QQL": { + "file": "chunk-GVYX3QQL.js" + }, + "chunk-FFP3QSOD": { + "file": "chunk-FFP3QSOD.js" }, "chunk-UTNX7UL3": { "file": "chunk-UTNX7UL3.js" @@ -1206,11 +1221,8 @@ "chunk-IASSU6T5": { "file": "chunk-IASSU6T5.js" }, - "chunk-FFP3QSOD": { - "file": "chunk-FFP3QSOD.js" - }, - "chunk-YNRHTVZR": { - "file": "chunk-YNRHTVZR.js" + "chunk-5TRUIT6X": { + "file": "chunk-5TRUIT6X.js" }, "chunk-T7HZRRSX": { "file": "chunk-T7HZRRSX.js" diff --git a/node_modules/.vite/deps/bpmn-js_lib_Modeler.js b/node_modules/.vite/deps/bpmn-js_lib_Modeler.js index 4f67cdf3..dd72b7ad 100644 --- a/node_modules/.vite/deps/bpmn-js_lib_Modeler.js +++ b/node_modules/.vite/deps/bpmn-js_lib_Modeler.js @@ -1,19 +1,3 @@ -import { - LANE_INDENTATION, - collectLanes, - computeChildrenBBox, - computeLanesResize, - ensureConstraints, - getChildLanes, - getLanesRoot, - getMinResizeBounds, - resizeBounds, - substractTRBL -} from "./chunk-VUQJMARV.js"; -import { - getParent, - isDirectionHorizontal -} from "./chunk-KKQ6WPIB.js"; import { PaletteProvider } from "./chunk-2VL3FEXP.js"; @@ -58,41 +42,7 @@ import { transform, translate, translate_default -} from "./chunk-7TL3JRAD.js"; -import { - asBounds, - asTRBL, - eachElement, - filterRedundantWaypoints, - findPathIntersections, - getBBox, - getClosure, - getElementLineIntersection, - getEnclosedElements, - getMid, - getMidPoint, - getOrientation, - getParents, - isConnection, - isLabel, - pointDistance, - pointInRect, - pointsAligned, - pointsOnLine, - roundBounds, - roundPoint, - selfAndAllChildren -} from "./chunk-T4R4535C.js"; -import { - hasCompensateEventDefinition, - hasErrorEventDefinition, - hasEscalationEventDefinition, - hasEventDefinition, - isEventSubProcess, - isExpanded, - isHorizontal, - isInterrupting -} from "./chunk-7C6J56BH.js"; +} from "./chunk-NTWXIMGM.js"; import { append, attr as attr2, @@ -118,6 +68,56 @@ import { query, remove } from "./chunk-PBO22ZEO.js"; +import { + LANE_INDENTATION, + collectLanes, + computeChildrenBBox, + computeLanesResize, + ensureConstraints, + getChildLanes, + getLanesRoot, + getMinResizeBounds, + resizeBounds, + substractTRBL +} from "./chunk-UEIE3ZOK.js"; +import { + asBounds, + asTRBL, + eachElement, + filterRedundantWaypoints, + findPathIntersections, + getBBox, + getClosure, + getElementLineIntersection, + getEnclosedElements, + getMid, + getMidPoint, + getOrientation, + getParents, + isConnection, + isLabel, + pointDistance, + pointInRect, + pointsAligned, + pointsOnLine, + roundBounds, + roundPoint, + selfAndAllChildren +} from "./chunk-T4R4535C.js"; +import { + getParent, + isDirectionHorizontal +} from "./chunk-KKQ6WPIB.js"; +import { + hasCompensateEventDefinition, + hasErrorEventDefinition, + hasEscalationEventDefinition, + hasEventDefinition, + isEventSubProcess, + isExpanded, + isHorizontal, + isInterrupting +} from "./chunk-7C6J56BH.js"; import { getBusinessObject, getDi, diff --git a/node_modules/.vite/deps/bpmn-js_lib_Viewer.js b/node_modules/.vite/deps/bpmn-js_lib_Viewer.js index f8327316..338b722f 100644 --- a/node_modules/.vite/deps/bpmn-js_lib_Viewer.js +++ b/node_modules/.vite/deps/bpmn-js_lib_Viewer.js @@ -1,10 +1,10 @@ import { Viewer -} from "./chunk-7TL3JRAD.js"; -import "./chunk-T4R4535C.js"; -import "./chunk-7C6J56BH.js"; +} from "./chunk-NTWXIMGM.js"; import "./chunk-J6RTEKLL.js"; import "./chunk-PBO22ZEO.js"; +import "./chunk-T4R4535C.js"; +import "./chunk-7C6J56BH.js"; import "./chunk-FNF472WR.js"; import "./chunk-YTJ5ESGD.js"; import "./chunk-GFT2G5UO.js"; diff --git a/node_modules/.vite/deps/bpmn-js_lib_features_modeling_util_LaneUtil.js b/node_modules/.vite/deps/bpmn-js_lib_features_modeling_util_LaneUtil.js index f61d5921..4ec5f6d9 100644 --- a/node_modules/.vite/deps/bpmn-js_lib_features_modeling_util_LaneUtil.js +++ b/node_modules/.vite/deps/bpmn-js_lib_features_modeling_util_LaneUtil.js @@ -4,9 +4,9 @@ import { computeLanesResize, getChildLanes, getLanesRoot -} from "./chunk-VUQJMARV.js"; -import "./chunk-KKQ6WPIB.js"; +} from "./chunk-UEIE3ZOK.js"; import "./chunk-T4R4535C.js"; +import "./chunk-KKQ6WPIB.js"; import "./chunk-7C6J56BH.js"; import "./chunk-FNF472WR.js"; import "./chunk-YTJ5ESGD.js"; diff --git a/node_modules/.vite/deps/chunk-5G7BH44C.js b/node_modules/.vite/deps/chunk-5G7BH44C.js deleted file mode 100644 index e564653a..00000000 --- a/node_modules/.vite/deps/chunk-5G7BH44C.js +++ /dev/null @@ -1,575 +0,0 @@ -import { - BezierCurve_default, - Line_default, - SPECIAL_STATES, - createSymbol, - enterEmphasis, - getLabelStatesModels, - initProps, - leaveEmphasis, - normalizeSymbolOffset, - normalizeSymbolSize, - round, - setLabelStyle, - toggleHoverEmphasis, - traverseElements, - updateProps -} from "./chunk-HOOPLKFT.js"; -import { - Group_default, - Path_default, - __extends, - each, - isArray, - normalize, - sub -} from "./chunk-M6ZIMNOI.js"; - -// node_modules/.pnpm/echarts@5.5.1/node_modules/echarts/lib/chart/helper/LinePath.js -var straightLineProto = Line_default.prototype; -var bezierCurveProto = BezierCurve_default.prototype; -var StraightLineShape = ( - /** @class */ - /* @__PURE__ */ function() { - function StraightLineShape2() { - this.x1 = 0; - this.y1 = 0; - this.x2 = 0; - this.y2 = 0; - this.percent = 1; - } - return StraightLineShape2; - }() -); -var CurveShape = ( - /** @class */ - function(_super) { - __extends(CurveShape2, _super); - function CurveShape2() { - return _super !== null && _super.apply(this, arguments) || this; - } - return CurveShape2; - }(StraightLineShape) -); -function isStraightLine(shape) { - return isNaN(+shape.cpx1) || isNaN(+shape.cpy1); -} -var ECLinePath = ( - /** @class */ - function(_super) { - __extends(ECLinePath2, _super); - function ECLinePath2(opts) { - var _this = _super.call(this, opts) || this; - _this.type = "ec-line"; - return _this; - } - ECLinePath2.prototype.getDefaultStyle = function() { - return { - stroke: "#000", - fill: null - }; - }; - ECLinePath2.prototype.getDefaultShape = function() { - return new StraightLineShape(); - }; - ECLinePath2.prototype.buildPath = function(ctx, shape) { - if (isStraightLine(shape)) { - straightLineProto.buildPath.call(this, ctx, shape); - } else { - bezierCurveProto.buildPath.call(this, ctx, shape); - } - }; - ECLinePath2.prototype.pointAt = function(t) { - if (isStraightLine(this.shape)) { - return straightLineProto.pointAt.call(this, t); - } else { - return bezierCurveProto.pointAt.call(this, t); - } - }; - ECLinePath2.prototype.tangentAt = function(t) { - var shape = this.shape; - var p = isStraightLine(shape) ? [shape.x2 - shape.x1, shape.y2 - shape.y1] : bezierCurveProto.tangentAt.call(this, t); - return normalize(p, p); - }; - return ECLinePath2; - }(Path_default) -); -var LinePath_default = ECLinePath; - -// node_modules/.pnpm/echarts@5.5.1/node_modules/echarts/lib/chart/helper/Line.js -var SYMBOL_CATEGORIES = ["fromSymbol", "toSymbol"]; -function makeSymbolTypeKey(symbolCategory) { - return "_" + symbolCategory + "Type"; -} -function makeSymbolTypeValue(name, lineData, idx) { - var symbolType = lineData.getItemVisual(idx, name); - if (!symbolType || symbolType === "none") { - return symbolType; - } - var symbolSize = lineData.getItemVisual(idx, name + "Size"); - var symbolRotate = lineData.getItemVisual(idx, name + "Rotate"); - var symbolOffset = lineData.getItemVisual(idx, name + "Offset"); - var symbolKeepAspect = lineData.getItemVisual(idx, name + "KeepAspect"); - var symbolSizeArr = normalizeSymbolSize(symbolSize); - var symbolOffsetArr = normalizeSymbolOffset(symbolOffset || 0, symbolSizeArr); - return symbolType + symbolSizeArr + symbolOffsetArr + (symbolRotate || "") + (symbolKeepAspect || ""); -} -function createSymbol2(name, lineData, idx) { - var symbolType = lineData.getItemVisual(idx, name); - if (!symbolType || symbolType === "none") { - return; - } - var symbolSize = lineData.getItemVisual(idx, name + "Size"); - var symbolRotate = lineData.getItemVisual(idx, name + "Rotate"); - var symbolOffset = lineData.getItemVisual(idx, name + "Offset"); - var symbolKeepAspect = lineData.getItemVisual(idx, name + "KeepAspect"); - var symbolSizeArr = normalizeSymbolSize(symbolSize); - var symbolOffsetArr = normalizeSymbolOffset(symbolOffset || 0, symbolSizeArr); - var symbolPath = createSymbol(symbolType, -symbolSizeArr[0] / 2 + symbolOffsetArr[0], -symbolSizeArr[1] / 2 + symbolOffsetArr[1], symbolSizeArr[0], symbolSizeArr[1], null, symbolKeepAspect); - symbolPath.__specifiedRotation = symbolRotate == null || isNaN(symbolRotate) ? void 0 : +symbolRotate * Math.PI / 180 || 0; - symbolPath.name = name; - return symbolPath; -} -function createLine(points) { - var line = new LinePath_default({ - name: "line", - subPixelOptimize: true - }); - setLinePoints(line.shape, points); - return line; -} -function setLinePoints(targetShape, points) { - targetShape.x1 = points[0][0]; - targetShape.y1 = points[0][1]; - targetShape.x2 = points[1][0]; - targetShape.y2 = points[1][1]; - targetShape.percent = 1; - var cp1 = points[2]; - if (cp1) { - targetShape.cpx1 = cp1[0]; - targetShape.cpy1 = cp1[1]; - } else { - targetShape.cpx1 = NaN; - targetShape.cpy1 = NaN; - } -} -var Line = ( - /** @class */ - function(_super) { - __extends(Line2, _super); - function Line2(lineData, idx, seriesScope) { - var _this = _super.call(this) || this; - _this._createLine(lineData, idx, seriesScope); - return _this; - } - Line2.prototype._createLine = function(lineData, idx, seriesScope) { - var seriesModel = lineData.hostModel; - var linePoints = lineData.getItemLayout(idx); - var line = createLine(linePoints); - line.shape.percent = 0; - initProps(line, { - shape: { - percent: 1 - } - }, seriesModel, idx); - this.add(line); - each(SYMBOL_CATEGORIES, function(symbolCategory) { - var symbol = createSymbol2(symbolCategory, lineData, idx); - this.add(symbol); - this[makeSymbolTypeKey(symbolCategory)] = makeSymbolTypeValue(symbolCategory, lineData, idx); - }, this); - this._updateCommonStl(lineData, idx, seriesScope); - }; - Line2.prototype.updateData = function(lineData, idx, seriesScope) { - var seriesModel = lineData.hostModel; - var line = this.childOfName("line"); - var linePoints = lineData.getItemLayout(idx); - var target = { - shape: {} - }; - setLinePoints(target.shape, linePoints); - updateProps(line, target, seriesModel, idx); - each(SYMBOL_CATEGORIES, function(symbolCategory) { - var symbolType = makeSymbolTypeValue(symbolCategory, lineData, idx); - var key = makeSymbolTypeKey(symbolCategory); - if (this[key] !== symbolType) { - this.remove(this.childOfName(symbolCategory)); - var symbol = createSymbol2(symbolCategory, lineData, idx); - this.add(symbol); - } - this[key] = symbolType; - }, this); - this._updateCommonStl(lineData, idx, seriesScope); - }; - ; - Line2.prototype.getLinePath = function() { - return this.childAt(0); - }; - Line2.prototype._updateCommonStl = function(lineData, idx, seriesScope) { - var seriesModel = lineData.hostModel; - var line = this.childOfName("line"); - var emphasisLineStyle = seriesScope && seriesScope.emphasisLineStyle; - var blurLineStyle = seriesScope && seriesScope.blurLineStyle; - var selectLineStyle = seriesScope && seriesScope.selectLineStyle; - var labelStatesModels = seriesScope && seriesScope.labelStatesModels; - var emphasisDisabled = seriesScope && seriesScope.emphasisDisabled; - var focus = seriesScope && seriesScope.focus; - var blurScope = seriesScope && seriesScope.blurScope; - if (!seriesScope || lineData.hasItemOption) { - var itemModel = lineData.getItemModel(idx); - var emphasisModel = itemModel.getModel("emphasis"); - emphasisLineStyle = emphasisModel.getModel("lineStyle").getLineStyle(); - blurLineStyle = itemModel.getModel(["blur", "lineStyle"]).getLineStyle(); - selectLineStyle = itemModel.getModel(["select", "lineStyle"]).getLineStyle(); - emphasisDisabled = emphasisModel.get("disabled"); - focus = emphasisModel.get("focus"); - blurScope = emphasisModel.get("blurScope"); - labelStatesModels = getLabelStatesModels(itemModel); - } - var lineStyle = lineData.getItemVisual(idx, "style"); - var visualColor = lineStyle.stroke; - line.useStyle(lineStyle); - line.style.fill = null; - line.style.strokeNoScale = true; - line.ensureState("emphasis").style = emphasisLineStyle; - line.ensureState("blur").style = blurLineStyle; - line.ensureState("select").style = selectLineStyle; - each(SYMBOL_CATEGORIES, function(symbolCategory) { - var symbol = this.childOfName(symbolCategory); - if (symbol) { - symbol.setColor(visualColor); - symbol.style.opacity = lineStyle.opacity; - for (var i = 0; i < SPECIAL_STATES.length; i++) { - var stateName = SPECIAL_STATES[i]; - var lineState = line.getState(stateName); - if (lineState) { - var lineStateStyle = lineState.style || {}; - var state = symbol.ensureState(stateName); - var stateStyle = state.style || (state.style = {}); - if (lineStateStyle.stroke != null) { - stateStyle[symbol.__isEmptyBrush ? "stroke" : "fill"] = lineStateStyle.stroke; - } - if (lineStateStyle.opacity != null) { - stateStyle.opacity = lineStateStyle.opacity; - } - } - } - symbol.markRedraw(); - } - }, this); - var rawVal = seriesModel.getRawValue(idx); - setLabelStyle(this, labelStatesModels, { - labelDataIndex: idx, - labelFetcher: { - getFormattedLabel: function(dataIndex, stateName) { - return seriesModel.getFormattedLabel(dataIndex, stateName, lineData.dataType); - } - }, - inheritColor: visualColor || "#000", - defaultOpacity: lineStyle.opacity, - defaultText: (rawVal == null ? lineData.getName(idx) : isFinite(rawVal) ? round(rawVal) : rawVal) + "" - }); - var label = this.getTextContent(); - if (label) { - var labelNormalModel = labelStatesModels.normal; - label.__align = label.style.align; - label.__verticalAlign = label.style.verticalAlign; - label.__position = labelNormalModel.get("position") || "middle"; - var distance = labelNormalModel.get("distance"); - if (!isArray(distance)) { - distance = [distance, distance]; - } - label.__labelDistance = distance; - } - this.setTextConfig({ - position: null, - local: true, - inside: false - // Can't be inside for stroke element. - }); - toggleHoverEmphasis(this, focus, blurScope, emphasisDisabled); - }; - Line2.prototype.highlight = function() { - enterEmphasis(this); - }; - Line2.prototype.downplay = function() { - leaveEmphasis(this); - }; - Line2.prototype.updateLayout = function(lineData, idx) { - this.setLinePoints(lineData.getItemLayout(idx)); - }; - Line2.prototype.setLinePoints = function(points) { - var linePath = this.childOfName("line"); - setLinePoints(linePath.shape, points); - linePath.dirty(); - }; - Line2.prototype.beforeUpdate = function() { - var lineGroup = this; - var symbolFrom = lineGroup.childOfName("fromSymbol"); - var symbolTo = lineGroup.childOfName("toSymbol"); - var label = lineGroup.getTextContent(); - if (!symbolFrom && !symbolTo && (!label || label.ignore)) { - return; - } - var invScale = 1; - var parentNode = this.parent; - while (parentNode) { - if (parentNode.scaleX) { - invScale /= parentNode.scaleX; - } - parentNode = parentNode.parent; - } - var line = lineGroup.childOfName("line"); - if (!this.__dirty && !line.__dirty) { - return; - } - var percent = line.shape.percent; - var fromPos = line.pointAt(0); - var toPos = line.pointAt(percent); - var d = sub([], toPos, fromPos); - normalize(d, d); - function setSymbolRotation(symbol, percent2) { - var specifiedRotation = symbol.__specifiedRotation; - if (specifiedRotation == null) { - var tangent2 = line.tangentAt(percent2); - symbol.attr("rotation", (percent2 === 1 ? -1 : 1) * Math.PI / 2 - Math.atan2(tangent2[1], tangent2[0])); - } else { - symbol.attr("rotation", specifiedRotation); - } - } - if (symbolFrom) { - symbolFrom.setPosition(fromPos); - setSymbolRotation(symbolFrom, 0); - symbolFrom.scaleX = symbolFrom.scaleY = invScale * percent; - symbolFrom.markRedraw(); - } - if (symbolTo) { - symbolTo.setPosition(toPos); - setSymbolRotation(symbolTo, 1); - symbolTo.scaleX = symbolTo.scaleY = invScale * percent; - symbolTo.markRedraw(); - } - if (label && !label.ignore) { - label.x = label.y = 0; - label.originX = label.originY = 0; - var textAlign = void 0; - var textVerticalAlign = void 0; - var distance = label.__labelDistance; - var distanceX = distance[0] * invScale; - var distanceY = distance[1] * invScale; - var halfPercent = percent / 2; - var tangent = line.tangentAt(halfPercent); - var n = [tangent[1], -tangent[0]]; - var cp = line.pointAt(halfPercent); - if (n[1] > 0) { - n[0] = -n[0]; - n[1] = -n[1]; - } - var dir = tangent[0] < 0 ? -1 : 1; - if (label.__position !== "start" && label.__position !== "end") { - var rotation = -Math.atan2(tangent[1], tangent[0]); - if (toPos[0] < fromPos[0]) { - rotation = Math.PI + rotation; - } - label.rotation = rotation; - } - var dy = void 0; - switch (label.__position) { - case "insideStartTop": - case "insideMiddleTop": - case "insideEndTop": - case "middle": - dy = -distanceY; - textVerticalAlign = "bottom"; - break; - case "insideStartBottom": - case "insideMiddleBottom": - case "insideEndBottom": - dy = distanceY; - textVerticalAlign = "top"; - break; - default: - dy = 0; - textVerticalAlign = "middle"; - } - switch (label.__position) { - case "end": - label.x = d[0] * distanceX + toPos[0]; - label.y = d[1] * distanceY + toPos[1]; - textAlign = d[0] > 0.8 ? "left" : d[0] < -0.8 ? "right" : "center"; - textVerticalAlign = d[1] > 0.8 ? "top" : d[1] < -0.8 ? "bottom" : "middle"; - break; - case "start": - label.x = -d[0] * distanceX + fromPos[0]; - label.y = -d[1] * distanceY + fromPos[1]; - textAlign = d[0] > 0.8 ? "right" : d[0] < -0.8 ? "left" : "center"; - textVerticalAlign = d[1] > 0.8 ? "bottom" : d[1] < -0.8 ? "top" : "middle"; - break; - case "insideStartTop": - case "insideStart": - case "insideStartBottom": - label.x = distanceX * dir + fromPos[0]; - label.y = fromPos[1] + dy; - textAlign = tangent[0] < 0 ? "right" : "left"; - label.originX = -distanceX * dir; - label.originY = -dy; - break; - case "insideMiddleTop": - case "insideMiddle": - case "insideMiddleBottom": - case "middle": - label.x = cp[0]; - label.y = cp[1] + dy; - textAlign = "center"; - label.originY = -dy; - break; - case "insideEndTop": - case "insideEnd": - case "insideEndBottom": - label.x = -distanceX * dir + toPos[0]; - label.y = toPos[1] + dy; - textAlign = tangent[0] >= 0 ? "right" : "left"; - label.originX = distanceX * dir; - label.originY = -dy; - break; - } - label.scaleX = label.scaleY = invScale; - label.setStyle({ - // Use the user specified text align and baseline first - verticalAlign: label.__verticalAlign || textVerticalAlign, - align: label.__align || textAlign - }); - } - }; - return Line2; - }(Group_default) -); -var Line_default2 = Line; - -// node_modules/.pnpm/echarts@5.5.1/node_modules/echarts/lib/chart/helper/LineDraw.js -var LineDraw = ( - /** @class */ - function() { - function LineDraw2(LineCtor) { - this.group = new Group_default(); - this._LineCtor = LineCtor || Line_default2; - } - LineDraw2.prototype.updateData = function(lineData) { - var _this = this; - this._progressiveEls = null; - var lineDraw = this; - var group = lineDraw.group; - var oldLineData = lineDraw._lineData; - lineDraw._lineData = lineData; - if (!oldLineData) { - group.removeAll(); - } - var seriesScope = makeSeriesScope(lineData); - lineData.diff(oldLineData).add(function(idx) { - _this._doAdd(lineData, idx, seriesScope); - }).update(function(newIdx, oldIdx) { - _this._doUpdate(oldLineData, lineData, oldIdx, newIdx, seriesScope); - }).remove(function(idx) { - group.remove(oldLineData.getItemGraphicEl(idx)); - }).execute(); - }; - ; - LineDraw2.prototype.updateLayout = function() { - var lineData = this._lineData; - if (!lineData) { - return; - } - lineData.eachItemGraphicEl(function(el, idx) { - el.updateLayout(lineData, idx); - }, this); - }; - ; - LineDraw2.prototype.incrementalPrepareUpdate = function(lineData) { - this._seriesScope = makeSeriesScope(lineData); - this._lineData = null; - this.group.removeAll(); - }; - ; - LineDraw2.prototype.incrementalUpdate = function(taskParams, lineData) { - this._progressiveEls = []; - function updateIncrementalAndHover(el2) { - if (!el2.isGroup && !isEffectObject(el2)) { - el2.incremental = true; - el2.ensureState("emphasis").hoverLayer = true; - } - } - for (var idx = taskParams.start; idx < taskParams.end; idx++) { - var itemLayout = lineData.getItemLayout(idx); - if (lineNeedsDraw(itemLayout)) { - var el = new this._LineCtor(lineData, idx, this._seriesScope); - el.traverse(updateIncrementalAndHover); - this.group.add(el); - lineData.setItemGraphicEl(idx, el); - this._progressiveEls.push(el); - } - } - }; - ; - LineDraw2.prototype.remove = function() { - this.group.removeAll(); - }; - ; - LineDraw2.prototype.eachRendered = function(cb) { - traverseElements(this._progressiveEls || this.group, cb); - }; - LineDraw2.prototype._doAdd = function(lineData, idx, seriesScope) { - var itemLayout = lineData.getItemLayout(idx); - if (!lineNeedsDraw(itemLayout)) { - return; - } - var el = new this._LineCtor(lineData, idx, seriesScope); - lineData.setItemGraphicEl(idx, el); - this.group.add(el); - }; - LineDraw2.prototype._doUpdate = function(oldLineData, newLineData, oldIdx, newIdx, seriesScope) { - var itemEl = oldLineData.getItemGraphicEl(oldIdx); - if (!lineNeedsDraw(newLineData.getItemLayout(newIdx))) { - this.group.remove(itemEl); - return; - } - if (!itemEl) { - itemEl = new this._LineCtor(newLineData, newIdx, seriesScope); - } else { - itemEl.updateData(newLineData, newIdx, seriesScope); - } - newLineData.setItemGraphicEl(newIdx, itemEl); - this.group.add(itemEl); - }; - return LineDraw2; - }() -); -function isEffectObject(el) { - return el.animators && el.animators.length > 0; -} -function makeSeriesScope(lineData) { - var hostModel = lineData.hostModel; - var emphasisModel = hostModel.getModel("emphasis"); - return { - lineStyle: hostModel.getModel("lineStyle").getLineStyle(), - emphasisLineStyle: emphasisModel.getModel(["lineStyle"]).getLineStyle(), - blurLineStyle: hostModel.getModel(["blur", "lineStyle"]).getLineStyle(), - selectLineStyle: hostModel.getModel(["select", "lineStyle"]).getLineStyle(), - emphasisDisabled: emphasisModel.get("disabled"), - blurScope: emphasisModel.get("blurScope"), - focus: emphasisModel.get("focus"), - labelStatesModels: getLabelStatesModels(hostModel) - }; -} -function isPointNaN(pt) { - return isNaN(pt[0]) || isNaN(pt[1]); -} -function lineNeedsDraw(pts) { - return pts && !isPointNaN(pts[0]) && !isPointNaN(pts[1]); -} -var LineDraw_default = LineDraw; - -export { - Line_default2 as Line_default, - LineDraw_default -}; -//# sourceMappingURL=chunk-5G7BH44C.js.map diff --git a/node_modules/.vite/deps/chunk-5G7BH44C.js.map b/node_modules/.vite/deps/chunk-5G7BH44C.js.map deleted file mode 100644 index d6ce65c8..00000000 --- a/node_modules/.vite/deps/chunk-5G7BH44C.js.map +++ /dev/null @@ -1,7 +0,0 @@ -{ - "version": 3, - "sources": ["../../.pnpm/echarts@5.5.1/node_modules/echarts/lib/chart/helper/LinePath.js", "../../.pnpm/echarts@5.5.1/node_modules/echarts/lib/chart/helper/Line.js", "../../.pnpm/echarts@5.5.1/node_modules/echarts/lib/chart/helper/LineDraw.js"], - "sourcesContent": ["\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\n/**\n * Line path for bezier and straight line draw\n */\nimport * as graphic from '../../util/graphic.js';\nimport * as vec2 from 'zrender/lib/core/vector.js';\nvar straightLineProto = graphic.Line.prototype;\nvar bezierCurveProto = graphic.BezierCurve.prototype;\nvar StraightLineShape = /** @class */function () {\n function StraightLineShape() {\n // Start point\n this.x1 = 0;\n this.y1 = 0;\n // End point\n this.x2 = 0;\n this.y2 = 0;\n this.percent = 1;\n }\n return StraightLineShape;\n}();\nvar CurveShape = /** @class */function (_super) {\n __extends(CurveShape, _super);\n function CurveShape() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n return CurveShape;\n}(StraightLineShape);\nfunction isStraightLine(shape) {\n return isNaN(+shape.cpx1) || isNaN(+shape.cpy1);\n}\nvar ECLinePath = /** @class */function (_super) {\n __extends(ECLinePath, _super);\n function ECLinePath(opts) {\n var _this = _super.call(this, opts) || this;\n _this.type = 'ec-line';\n return _this;\n }\n ECLinePath.prototype.getDefaultStyle = function () {\n return {\n stroke: '#000',\n fill: null\n };\n };\n ECLinePath.prototype.getDefaultShape = function () {\n return new StraightLineShape();\n };\n ECLinePath.prototype.buildPath = function (ctx, shape) {\n if (isStraightLine(shape)) {\n straightLineProto.buildPath.call(this, ctx, shape);\n } else {\n bezierCurveProto.buildPath.call(this, ctx, shape);\n }\n };\n ECLinePath.prototype.pointAt = function (t) {\n if (isStraightLine(this.shape)) {\n return straightLineProto.pointAt.call(this, t);\n } else {\n return bezierCurveProto.pointAt.call(this, t);\n }\n };\n ECLinePath.prototype.tangentAt = function (t) {\n var shape = this.shape;\n var p = isStraightLine(shape) ? [shape.x2 - shape.x1, shape.y2 - shape.y1] : bezierCurveProto.tangentAt.call(this, t);\n return vec2.normalize(p, p);\n };\n return ECLinePath;\n}(graphic.Path);\nexport default ECLinePath;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport { isArray, each } from 'zrender/lib/core/util.js';\nimport * as vector from 'zrender/lib/core/vector.js';\nimport * as symbolUtil from '../../util/symbol.js';\nimport ECLinePath from './LinePath.js';\nimport * as graphic from '../../util/graphic.js';\nimport { toggleHoverEmphasis, enterEmphasis, leaveEmphasis, SPECIAL_STATES } from '../../util/states.js';\nimport { getLabelStatesModels, setLabelStyle } from '../../label/labelStyle.js';\nimport { round } from '../../util/number.js';\nvar SYMBOL_CATEGORIES = ['fromSymbol', 'toSymbol'];\nfunction makeSymbolTypeKey(symbolCategory) {\n return '_' + symbolCategory + 'Type';\n}\nfunction makeSymbolTypeValue(name, lineData, idx) {\n var symbolType = lineData.getItemVisual(idx, name);\n if (!symbolType || symbolType === 'none') {\n return symbolType;\n }\n var symbolSize = lineData.getItemVisual(idx, name + 'Size');\n var symbolRotate = lineData.getItemVisual(idx, name + 'Rotate');\n var symbolOffset = lineData.getItemVisual(idx, name + 'Offset');\n var symbolKeepAspect = lineData.getItemVisual(idx, name + 'KeepAspect');\n var symbolSizeArr = symbolUtil.normalizeSymbolSize(symbolSize);\n var symbolOffsetArr = symbolUtil.normalizeSymbolOffset(symbolOffset || 0, symbolSizeArr);\n return symbolType + symbolSizeArr + symbolOffsetArr + (symbolRotate || '') + (symbolKeepAspect || '');\n}\n/**\n * @inner\n */\nfunction createSymbol(name, lineData, idx) {\n var symbolType = lineData.getItemVisual(idx, name);\n if (!symbolType || symbolType === 'none') {\n return;\n }\n var symbolSize = lineData.getItemVisual(idx, name + 'Size');\n var symbolRotate = lineData.getItemVisual(idx, name + 'Rotate');\n var symbolOffset = lineData.getItemVisual(idx, name + 'Offset');\n var symbolKeepAspect = lineData.getItemVisual(idx, name + 'KeepAspect');\n var symbolSizeArr = symbolUtil.normalizeSymbolSize(symbolSize);\n var symbolOffsetArr = symbolUtil.normalizeSymbolOffset(symbolOffset || 0, symbolSizeArr);\n var symbolPath = symbolUtil.createSymbol(symbolType, -symbolSizeArr[0] / 2 + symbolOffsetArr[0], -symbolSizeArr[1] / 2 + symbolOffsetArr[1], symbolSizeArr[0], symbolSizeArr[1], null, symbolKeepAspect);\n symbolPath.__specifiedRotation = symbolRotate == null || isNaN(symbolRotate) ? void 0 : +symbolRotate * Math.PI / 180 || 0;\n symbolPath.name = name;\n return symbolPath;\n}\nfunction createLine(points) {\n var line = new ECLinePath({\n name: 'line',\n subPixelOptimize: true\n });\n setLinePoints(line.shape, points);\n return line;\n}\nfunction setLinePoints(targetShape, points) {\n targetShape.x1 = points[0][0];\n targetShape.y1 = points[0][1];\n targetShape.x2 = points[1][0];\n targetShape.y2 = points[1][1];\n targetShape.percent = 1;\n var cp1 = points[2];\n if (cp1) {\n targetShape.cpx1 = cp1[0];\n targetShape.cpy1 = cp1[1];\n } else {\n targetShape.cpx1 = NaN;\n targetShape.cpy1 = NaN;\n }\n}\nvar Line = /** @class */function (_super) {\n __extends(Line, _super);\n function Line(lineData, idx, seriesScope) {\n var _this = _super.call(this) || this;\n _this._createLine(lineData, idx, seriesScope);\n return _this;\n }\n Line.prototype._createLine = function (lineData, idx, seriesScope) {\n var seriesModel = lineData.hostModel;\n var linePoints = lineData.getItemLayout(idx);\n var line = createLine(linePoints);\n line.shape.percent = 0;\n graphic.initProps(line, {\n shape: {\n percent: 1\n }\n }, seriesModel, idx);\n this.add(line);\n each(SYMBOL_CATEGORIES, function (symbolCategory) {\n var symbol = createSymbol(symbolCategory, lineData, idx);\n // symbols must added after line to make sure\n // it will be updated after line#update.\n // Or symbol position and rotation update in line#beforeUpdate will be one frame slow\n this.add(symbol);\n this[makeSymbolTypeKey(symbolCategory)] = makeSymbolTypeValue(symbolCategory, lineData, idx);\n }, this);\n this._updateCommonStl(lineData, idx, seriesScope);\n };\n // TODO More strict on the List type in parameters?\n Line.prototype.updateData = function (lineData, idx, seriesScope) {\n var seriesModel = lineData.hostModel;\n var line = this.childOfName('line');\n var linePoints = lineData.getItemLayout(idx);\n var target = {\n shape: {}\n };\n setLinePoints(target.shape, linePoints);\n graphic.updateProps(line, target, seriesModel, idx);\n each(SYMBOL_CATEGORIES, function (symbolCategory) {\n var symbolType = makeSymbolTypeValue(symbolCategory, lineData, idx);\n var key = makeSymbolTypeKey(symbolCategory);\n // Symbol changed\n if (this[key] !== symbolType) {\n this.remove(this.childOfName(symbolCategory));\n var symbol = createSymbol(symbolCategory, lineData, idx);\n this.add(symbol);\n }\n this[key] = symbolType;\n }, this);\n this._updateCommonStl(lineData, idx, seriesScope);\n };\n ;\n Line.prototype.getLinePath = function () {\n return this.childAt(0);\n };\n Line.prototype._updateCommonStl = function (lineData, idx, seriesScope) {\n var seriesModel = lineData.hostModel;\n var line = this.childOfName('line');\n var emphasisLineStyle = seriesScope && seriesScope.emphasisLineStyle;\n var blurLineStyle = seriesScope && seriesScope.blurLineStyle;\n var selectLineStyle = seriesScope && seriesScope.selectLineStyle;\n var labelStatesModels = seriesScope && seriesScope.labelStatesModels;\n var emphasisDisabled = seriesScope && seriesScope.emphasisDisabled;\n var focus = seriesScope && seriesScope.focus;\n var blurScope = seriesScope && seriesScope.blurScope;\n // Optimization for large dataset\n if (!seriesScope || lineData.hasItemOption) {\n var itemModel = lineData.getItemModel(idx);\n var emphasisModel = itemModel.getModel('emphasis');\n emphasisLineStyle = emphasisModel.getModel('lineStyle').getLineStyle();\n blurLineStyle = itemModel.getModel(['blur', 'lineStyle']).getLineStyle();\n selectLineStyle = itemModel.getModel(['select', 'lineStyle']).getLineStyle();\n emphasisDisabled = emphasisModel.get('disabled');\n focus = emphasisModel.get('focus');\n blurScope = emphasisModel.get('blurScope');\n labelStatesModels = getLabelStatesModels(itemModel);\n }\n var lineStyle = lineData.getItemVisual(idx, 'style');\n var visualColor = lineStyle.stroke;\n line.useStyle(lineStyle);\n line.style.fill = null;\n line.style.strokeNoScale = true;\n line.ensureState('emphasis').style = emphasisLineStyle;\n line.ensureState('blur').style = blurLineStyle;\n line.ensureState('select').style = selectLineStyle;\n // Update symbol\n each(SYMBOL_CATEGORIES, function (symbolCategory) {\n var symbol = this.childOfName(symbolCategory);\n if (symbol) {\n // Share opacity and color with line.\n symbol.setColor(visualColor);\n symbol.style.opacity = lineStyle.opacity;\n for (var i = 0; i < SPECIAL_STATES.length; i++) {\n var stateName = SPECIAL_STATES[i];\n var lineState = line.getState(stateName);\n if (lineState) {\n var lineStateStyle = lineState.style || {};\n var state = symbol.ensureState(stateName);\n var stateStyle = state.style || (state.style = {});\n if (lineStateStyle.stroke != null) {\n stateStyle[symbol.__isEmptyBrush ? 'stroke' : 'fill'] = lineStateStyle.stroke;\n }\n if (lineStateStyle.opacity != null) {\n stateStyle.opacity = lineStateStyle.opacity;\n }\n }\n }\n symbol.markRedraw();\n }\n }, this);\n var rawVal = seriesModel.getRawValue(idx);\n setLabelStyle(this, labelStatesModels, {\n labelDataIndex: idx,\n labelFetcher: {\n getFormattedLabel: function (dataIndex, stateName) {\n return seriesModel.getFormattedLabel(dataIndex, stateName, lineData.dataType);\n }\n },\n inheritColor: visualColor || '#000',\n defaultOpacity: lineStyle.opacity,\n defaultText: (rawVal == null ? lineData.getName(idx) : isFinite(rawVal) ? round(rawVal) : rawVal) + ''\n });\n var label = this.getTextContent();\n // Always set `textStyle` even if `normalStyle.text` is null, because default\n // values have to be set on `normalStyle`.\n if (label) {\n var labelNormalModel = labelStatesModels.normal;\n label.__align = label.style.align;\n label.__verticalAlign = label.style.verticalAlign;\n // 'start', 'middle', 'end'\n label.__position = labelNormalModel.get('position') || 'middle';\n var distance = labelNormalModel.get('distance');\n if (!isArray(distance)) {\n distance = [distance, distance];\n }\n label.__labelDistance = distance;\n }\n this.setTextConfig({\n position: null,\n local: true,\n inside: false // Can't be inside for stroke element.\n });\n\n toggleHoverEmphasis(this, focus, blurScope, emphasisDisabled);\n };\n Line.prototype.highlight = function () {\n enterEmphasis(this);\n };\n Line.prototype.downplay = function () {\n leaveEmphasis(this);\n };\n Line.prototype.updateLayout = function (lineData, idx) {\n this.setLinePoints(lineData.getItemLayout(idx));\n };\n Line.prototype.setLinePoints = function (points) {\n var linePath = this.childOfName('line');\n setLinePoints(linePath.shape, points);\n linePath.dirty();\n };\n Line.prototype.beforeUpdate = function () {\n var lineGroup = this;\n var symbolFrom = lineGroup.childOfName('fromSymbol');\n var symbolTo = lineGroup.childOfName('toSymbol');\n var label = lineGroup.getTextContent();\n // Quick reject\n if (!symbolFrom && !symbolTo && (!label || label.ignore)) {\n return;\n }\n var invScale = 1;\n var parentNode = this.parent;\n while (parentNode) {\n if (parentNode.scaleX) {\n invScale /= parentNode.scaleX;\n }\n parentNode = parentNode.parent;\n }\n var line = lineGroup.childOfName('line');\n // If line not changed\n // FIXME Parent scale changed\n if (!this.__dirty && !line.__dirty) {\n return;\n }\n var percent = line.shape.percent;\n var fromPos = line.pointAt(0);\n var toPos = line.pointAt(percent);\n var d = vector.sub([], toPos, fromPos);\n vector.normalize(d, d);\n function setSymbolRotation(symbol, percent) {\n // Fix #12388\n // when symbol is set to be 'arrow' in markLine,\n // symbolRotate value will be ignored, and compulsively use tangent angle.\n // rotate by default if symbol rotation is not specified\n var specifiedRotation = symbol.__specifiedRotation;\n if (specifiedRotation == null) {\n var tangent = line.tangentAt(percent);\n symbol.attr('rotation', (percent === 1 ? -1 : 1) * Math.PI / 2 - Math.atan2(tangent[1], tangent[0]));\n } else {\n symbol.attr('rotation', specifiedRotation);\n }\n }\n if (symbolFrom) {\n symbolFrom.setPosition(fromPos);\n setSymbolRotation(symbolFrom, 0);\n symbolFrom.scaleX = symbolFrom.scaleY = invScale * percent;\n symbolFrom.markRedraw();\n }\n if (symbolTo) {\n symbolTo.setPosition(toPos);\n setSymbolRotation(symbolTo, 1);\n symbolTo.scaleX = symbolTo.scaleY = invScale * percent;\n symbolTo.markRedraw();\n }\n if (label && !label.ignore) {\n label.x = label.y = 0;\n label.originX = label.originY = 0;\n var textAlign = void 0;\n var textVerticalAlign = void 0;\n var distance = label.__labelDistance;\n var distanceX = distance[0] * invScale;\n var distanceY = distance[1] * invScale;\n var halfPercent = percent / 2;\n var tangent = line.tangentAt(halfPercent);\n var n = [tangent[1], -tangent[0]];\n var cp = line.pointAt(halfPercent);\n if (n[1] > 0) {\n n[0] = -n[0];\n n[1] = -n[1];\n }\n var dir = tangent[0] < 0 ? -1 : 1;\n if (label.__position !== 'start' && label.__position !== 'end') {\n var rotation = -Math.atan2(tangent[1], tangent[0]);\n if (toPos[0] < fromPos[0]) {\n rotation = Math.PI + rotation;\n }\n label.rotation = rotation;\n }\n var dy = void 0;\n switch (label.__position) {\n case 'insideStartTop':\n case 'insideMiddleTop':\n case 'insideEndTop':\n case 'middle':\n dy = -distanceY;\n textVerticalAlign = 'bottom';\n break;\n case 'insideStartBottom':\n case 'insideMiddleBottom':\n case 'insideEndBottom':\n dy = distanceY;\n textVerticalAlign = 'top';\n break;\n default:\n dy = 0;\n textVerticalAlign = 'middle';\n }\n switch (label.__position) {\n case 'end':\n label.x = d[0] * distanceX + toPos[0];\n label.y = d[1] * distanceY + toPos[1];\n textAlign = d[0] > 0.8 ? 'left' : d[0] < -0.8 ? 'right' : 'center';\n textVerticalAlign = d[1] > 0.8 ? 'top' : d[1] < -0.8 ? 'bottom' : 'middle';\n break;\n case 'start':\n label.x = -d[0] * distanceX + fromPos[0];\n label.y = -d[1] * distanceY + fromPos[1];\n textAlign = d[0] > 0.8 ? 'right' : d[0] < -0.8 ? 'left' : 'center';\n textVerticalAlign = d[1] > 0.8 ? 'bottom' : d[1] < -0.8 ? 'top' : 'middle';\n break;\n case 'insideStartTop':\n case 'insideStart':\n case 'insideStartBottom':\n label.x = distanceX * dir + fromPos[0];\n label.y = fromPos[1] + dy;\n textAlign = tangent[0] < 0 ? 'right' : 'left';\n label.originX = -distanceX * dir;\n label.originY = -dy;\n break;\n case 'insideMiddleTop':\n case 'insideMiddle':\n case 'insideMiddleBottom':\n case 'middle':\n label.x = cp[0];\n label.y = cp[1] + dy;\n textAlign = 'center';\n label.originY = -dy;\n break;\n case 'insideEndTop':\n case 'insideEnd':\n case 'insideEndBottom':\n label.x = -distanceX * dir + toPos[0];\n label.y = toPos[1] + dy;\n textAlign = tangent[0] >= 0 ? 'right' : 'left';\n label.originX = distanceX * dir;\n label.originY = -dy;\n break;\n }\n label.scaleX = label.scaleY = invScale;\n label.setStyle({\n // Use the user specified text align and baseline first\n verticalAlign: label.__verticalAlign || textVerticalAlign,\n align: label.__align || textAlign\n });\n }\n };\n return Line;\n}(graphic.Group);\nexport default Line;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as graphic from '../../util/graphic.js';\nimport LineGroup from './Line.js';\nimport { getLabelStatesModels } from '../../label/labelStyle.js';\nvar LineDraw = /** @class */function () {\n function LineDraw(LineCtor) {\n this.group = new graphic.Group();\n this._LineCtor = LineCtor || LineGroup;\n }\n LineDraw.prototype.updateData = function (lineData) {\n var _this = this;\n // Remove progressive els.\n this._progressiveEls = null;\n var lineDraw = this;\n var group = lineDraw.group;\n var oldLineData = lineDraw._lineData;\n lineDraw._lineData = lineData;\n // There is no oldLineData only when first rendering or switching from\n // stream mode to normal mode, where previous elements should be removed.\n if (!oldLineData) {\n group.removeAll();\n }\n var seriesScope = makeSeriesScope(lineData);\n lineData.diff(oldLineData).add(function (idx) {\n _this._doAdd(lineData, idx, seriesScope);\n }).update(function (newIdx, oldIdx) {\n _this._doUpdate(oldLineData, lineData, oldIdx, newIdx, seriesScope);\n }).remove(function (idx) {\n group.remove(oldLineData.getItemGraphicEl(idx));\n }).execute();\n };\n ;\n LineDraw.prototype.updateLayout = function () {\n var lineData = this._lineData;\n // Do not support update layout in incremental mode.\n if (!lineData) {\n return;\n }\n lineData.eachItemGraphicEl(function (el, idx) {\n el.updateLayout(lineData, idx);\n }, this);\n };\n ;\n LineDraw.prototype.incrementalPrepareUpdate = function (lineData) {\n this._seriesScope = makeSeriesScope(lineData);\n this._lineData = null;\n this.group.removeAll();\n };\n ;\n LineDraw.prototype.incrementalUpdate = function (taskParams, lineData) {\n this._progressiveEls = [];\n function updateIncrementalAndHover(el) {\n if (!el.isGroup && !isEffectObject(el)) {\n el.incremental = true;\n el.ensureState('emphasis').hoverLayer = true;\n }\n }\n for (var idx = taskParams.start; idx < taskParams.end; idx++) {\n var itemLayout = lineData.getItemLayout(idx);\n if (lineNeedsDraw(itemLayout)) {\n var el = new this._LineCtor(lineData, idx, this._seriesScope);\n el.traverse(updateIncrementalAndHover);\n this.group.add(el);\n lineData.setItemGraphicEl(idx, el);\n this._progressiveEls.push(el);\n }\n }\n };\n ;\n LineDraw.prototype.remove = function () {\n this.group.removeAll();\n };\n ;\n LineDraw.prototype.eachRendered = function (cb) {\n graphic.traverseElements(this._progressiveEls || this.group, cb);\n };\n LineDraw.prototype._doAdd = function (lineData, idx, seriesScope) {\n var itemLayout = lineData.getItemLayout(idx);\n if (!lineNeedsDraw(itemLayout)) {\n return;\n }\n var el = new this._LineCtor(lineData, idx, seriesScope);\n lineData.setItemGraphicEl(idx, el);\n this.group.add(el);\n };\n LineDraw.prototype._doUpdate = function (oldLineData, newLineData, oldIdx, newIdx, seriesScope) {\n var itemEl = oldLineData.getItemGraphicEl(oldIdx);\n if (!lineNeedsDraw(newLineData.getItemLayout(newIdx))) {\n this.group.remove(itemEl);\n return;\n }\n if (!itemEl) {\n itemEl = new this._LineCtor(newLineData, newIdx, seriesScope);\n } else {\n itemEl.updateData(newLineData, newIdx, seriesScope);\n }\n newLineData.setItemGraphicEl(newIdx, itemEl);\n this.group.add(itemEl);\n };\n return LineDraw;\n}();\nfunction isEffectObject(el) {\n return el.animators && el.animators.length > 0;\n}\nfunction makeSeriesScope(lineData) {\n var hostModel = lineData.hostModel;\n var emphasisModel = hostModel.getModel('emphasis');\n return {\n lineStyle: hostModel.getModel('lineStyle').getLineStyle(),\n emphasisLineStyle: emphasisModel.getModel(['lineStyle']).getLineStyle(),\n blurLineStyle: hostModel.getModel(['blur', 'lineStyle']).getLineStyle(),\n selectLineStyle: hostModel.getModel(['select', 'lineStyle']).getLineStyle(),\n emphasisDisabled: emphasisModel.get('disabled'),\n blurScope: emphasisModel.get('blurScope'),\n focus: emphasisModel.get('focus'),\n labelStatesModels: getLabelStatesModels(hostModel)\n };\n}\nfunction isPointNaN(pt) {\n return isNaN(pt[0]) || isNaN(pt[1]);\n}\nfunction lineNeedsDraw(pts) {\n return pts && !isPointNaN(pts[0]) && !isPointNaN(pts[1]);\n}\nexport default LineDraw;"], - "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiDA,IAAI,oBAA4B,aAAK;AACrC,IAAI,mBAA2B,oBAAY;AAC3C,IAAI;AAAA;AAAA,EAAiC,2BAAY;AAC/C,aAASA,qBAAoB;AAE3B,WAAK,KAAK;AACV,WAAK,KAAK;AAEV,WAAK,KAAK;AACV,WAAK,KAAK;AACV,WAAK,UAAU;AAAA,IACjB;AACA,WAAOA;AAAA,EACT,EAAE;AAAA;AACF,IAAI;AAAA;AAAA,EAA0B,SAAU,QAAQ;AAC9C,cAAUC,aAAY,MAAM;AAC5B,aAASA,cAAa;AACpB,aAAO,WAAW,QAAQ,OAAO,MAAM,MAAM,SAAS,KAAK;AAAA,IAC7D;AACA,WAAOA;AAAA,EACT,EAAE,iBAAiB;AAAA;AACnB,SAAS,eAAe,OAAO;AAC7B,SAAO,MAAM,CAAC,MAAM,IAAI,KAAK,MAAM,CAAC,MAAM,IAAI;AAChD;AACA,IAAI;AAAA;AAAA,EAA0B,SAAU,QAAQ;AAC9C,cAAUC,aAAY,MAAM;AAC5B,aAASA,YAAW,MAAM;AACxB,UAAI,QAAQ,OAAO,KAAK,MAAM,IAAI,KAAK;AACvC,YAAM,OAAO;AACb,aAAO;AAAA,IACT;AACA,IAAAA,YAAW,UAAU,kBAAkB,WAAY;AACjD,aAAO;AAAA,QACL,QAAQ;AAAA,QACR,MAAM;AAAA,MACR;AAAA,IACF;AACA,IAAAA,YAAW,UAAU,kBAAkB,WAAY;AACjD,aAAO,IAAI,kBAAkB;AAAA,IAC/B;AACA,IAAAA,YAAW,UAAU,YAAY,SAAU,KAAK,OAAO;AACrD,UAAI,eAAe,KAAK,GAAG;AACzB,0BAAkB,UAAU,KAAK,MAAM,KAAK,KAAK;AAAA,MACnD,OAAO;AACL,yBAAiB,UAAU,KAAK,MAAM,KAAK,KAAK;AAAA,MAClD;AAAA,IACF;AACA,IAAAA,YAAW,UAAU,UAAU,SAAU,GAAG;AAC1C,UAAI,eAAe,KAAK,KAAK,GAAG;AAC9B,eAAO,kBAAkB,QAAQ,KAAK,MAAM,CAAC;AAAA,MAC/C,OAAO;AACL,eAAO,iBAAiB,QAAQ,KAAK,MAAM,CAAC;AAAA,MAC9C;AAAA,IACF;AACA,IAAAA,YAAW,UAAU,YAAY,SAAU,GAAG;AAC5C,UAAI,QAAQ,KAAK;AACjB,UAAI,IAAI,eAAe,KAAK,IAAI,CAAC,MAAM,KAAK,MAAM,IAAI,MAAM,KAAK,MAAM,EAAE,IAAI,iBAAiB,UAAU,KAAK,MAAM,CAAC;AACpH,aAAY,UAAU,GAAG,CAAC;AAAA,IAC5B;AACA,WAAOA;AAAA,EACT,EAAU,YAAI;AAAA;AACd,IAAO,mBAAQ;;;AC1Df,IAAI,oBAAoB,CAAC,cAAc,UAAU;AACjD,SAAS,kBAAkB,gBAAgB;AACzC,SAAO,MAAM,iBAAiB;AAChC;AACA,SAAS,oBAAoB,MAAM,UAAU,KAAK;AAChD,MAAI,aAAa,SAAS,cAAc,KAAK,IAAI;AACjD,MAAI,CAAC,cAAc,eAAe,QAAQ;AACxC,WAAO;AAAA,EACT;AACA,MAAI,aAAa,SAAS,cAAc,KAAK,OAAO,MAAM;AAC1D,MAAI,eAAe,SAAS,cAAc,KAAK,OAAO,QAAQ;AAC9D,MAAI,eAAe,SAAS,cAAc,KAAK,OAAO,QAAQ;AAC9D,MAAI,mBAAmB,SAAS,cAAc,KAAK,OAAO,YAAY;AACtE,MAAI,gBAA2B,oBAAoB,UAAU;AAC7D,MAAI,kBAA6B,sBAAsB,gBAAgB,GAAG,aAAa;AACvF,SAAO,aAAa,gBAAgB,mBAAmB,gBAAgB,OAAO,oBAAoB;AACpG;AAIA,SAASC,cAAa,MAAM,UAAU,KAAK;AACzC,MAAI,aAAa,SAAS,cAAc,KAAK,IAAI;AACjD,MAAI,CAAC,cAAc,eAAe,QAAQ;AACxC;AAAA,EACF;AACA,MAAI,aAAa,SAAS,cAAc,KAAK,OAAO,MAAM;AAC1D,MAAI,eAAe,SAAS,cAAc,KAAK,OAAO,QAAQ;AAC9D,MAAI,eAAe,SAAS,cAAc,KAAK,OAAO,QAAQ;AAC9D,MAAI,mBAAmB,SAAS,cAAc,KAAK,OAAO,YAAY;AACtE,MAAI,gBAA2B,oBAAoB,UAAU;AAC7D,MAAI,kBAA6B,sBAAsB,gBAAgB,GAAG,aAAa;AACvF,MAAI,aAAwB,aAAa,YAAY,CAAC,cAAc,CAAC,IAAI,IAAI,gBAAgB,CAAC,GAAG,CAAC,cAAc,CAAC,IAAI,IAAI,gBAAgB,CAAC,GAAG,cAAc,CAAC,GAAG,cAAc,CAAC,GAAG,MAAM,gBAAgB;AACvM,aAAW,sBAAsB,gBAAgB,QAAQ,MAAM,YAAY,IAAI,SAAS,CAAC,eAAe,KAAK,KAAK,OAAO;AACzH,aAAW,OAAO;AAClB,SAAO;AACT;AACA,SAAS,WAAW,QAAQ;AAC1B,MAAI,OAAO,IAAI,iBAAW;AAAA,IACxB,MAAM;AAAA,IACN,kBAAkB;AAAA,EACpB,CAAC;AACD,gBAAc,KAAK,OAAO,MAAM;AAChC,SAAO;AACT;AACA,SAAS,cAAc,aAAa,QAAQ;AAC1C,cAAY,KAAK,OAAO,CAAC,EAAE,CAAC;AAC5B,cAAY,KAAK,OAAO,CAAC,EAAE,CAAC;AAC5B,cAAY,KAAK,OAAO,CAAC,EAAE,CAAC;AAC5B,cAAY,KAAK,OAAO,CAAC,EAAE,CAAC;AAC5B,cAAY,UAAU;AACtB,MAAI,MAAM,OAAO,CAAC;AAClB,MAAI,KAAK;AACP,gBAAY,OAAO,IAAI,CAAC;AACxB,gBAAY,OAAO,IAAI,CAAC;AAAA,EAC1B,OAAO;AACL,gBAAY,OAAO;AACnB,gBAAY,OAAO;AAAA,EACrB;AACF;AACA,IAAI;AAAA;AAAA,EAAoB,SAAU,QAAQ;AACxC,cAAUC,OAAM,MAAM;AACtB,aAASA,MAAK,UAAU,KAAK,aAAa;AACxC,UAAI,QAAQ,OAAO,KAAK,IAAI,KAAK;AACjC,YAAM,YAAY,UAAU,KAAK,WAAW;AAC5C,aAAO;AAAA,IACT;AACA,IAAAA,MAAK,UAAU,cAAc,SAAU,UAAU,KAAK,aAAa;AACjE,UAAI,cAAc,SAAS;AAC3B,UAAI,aAAa,SAAS,cAAc,GAAG;AAC3C,UAAI,OAAO,WAAW,UAAU;AAChC,WAAK,MAAM,UAAU;AACrB,MAAQ,UAAU,MAAM;AAAA,QACtB,OAAO;AAAA,UACL,SAAS;AAAA,QACX;AAAA,MACF,GAAG,aAAa,GAAG;AACnB,WAAK,IAAI,IAAI;AACb,WAAK,mBAAmB,SAAU,gBAAgB;AAChD,YAAI,SAASD,cAAa,gBAAgB,UAAU,GAAG;AAIvD,aAAK,IAAI,MAAM;AACf,aAAK,kBAAkB,cAAc,CAAC,IAAI,oBAAoB,gBAAgB,UAAU,GAAG;AAAA,MAC7F,GAAG,IAAI;AACP,WAAK,iBAAiB,UAAU,KAAK,WAAW;AAAA,IAClD;AAEA,IAAAC,MAAK,UAAU,aAAa,SAAU,UAAU,KAAK,aAAa;AAChE,UAAI,cAAc,SAAS;AAC3B,UAAI,OAAO,KAAK,YAAY,MAAM;AAClC,UAAI,aAAa,SAAS,cAAc,GAAG;AAC3C,UAAI,SAAS;AAAA,QACX,OAAO,CAAC;AAAA,MACV;AACA,oBAAc,OAAO,OAAO,UAAU;AACtC,MAAQ,YAAY,MAAM,QAAQ,aAAa,GAAG;AAClD,WAAK,mBAAmB,SAAU,gBAAgB;AAChD,YAAI,aAAa,oBAAoB,gBAAgB,UAAU,GAAG;AAClE,YAAI,MAAM,kBAAkB,cAAc;AAE1C,YAAI,KAAK,GAAG,MAAM,YAAY;AAC5B,eAAK,OAAO,KAAK,YAAY,cAAc,CAAC;AAC5C,cAAI,SAASD,cAAa,gBAAgB,UAAU,GAAG;AACvD,eAAK,IAAI,MAAM;AAAA,QACjB;AACA,aAAK,GAAG,IAAI;AAAA,MACd,GAAG,IAAI;AACP,WAAK,iBAAiB,UAAU,KAAK,WAAW;AAAA,IAClD;AACA;AACA,IAAAC,MAAK,UAAU,cAAc,WAAY;AACvC,aAAO,KAAK,QAAQ,CAAC;AAAA,IACvB;AACA,IAAAA,MAAK,UAAU,mBAAmB,SAAU,UAAU,KAAK,aAAa;AACtE,UAAI,cAAc,SAAS;AAC3B,UAAI,OAAO,KAAK,YAAY,MAAM;AAClC,UAAI,oBAAoB,eAAe,YAAY;AACnD,UAAI,gBAAgB,eAAe,YAAY;AAC/C,UAAI,kBAAkB,eAAe,YAAY;AACjD,UAAI,oBAAoB,eAAe,YAAY;AACnD,UAAI,mBAAmB,eAAe,YAAY;AAClD,UAAI,QAAQ,eAAe,YAAY;AACvC,UAAI,YAAY,eAAe,YAAY;AAE3C,UAAI,CAAC,eAAe,SAAS,eAAe;AAC1C,YAAI,YAAY,SAAS,aAAa,GAAG;AACzC,YAAI,gBAAgB,UAAU,SAAS,UAAU;AACjD,4BAAoB,cAAc,SAAS,WAAW,EAAE,aAAa;AACrE,wBAAgB,UAAU,SAAS,CAAC,QAAQ,WAAW,CAAC,EAAE,aAAa;AACvE,0BAAkB,UAAU,SAAS,CAAC,UAAU,WAAW,CAAC,EAAE,aAAa;AAC3E,2BAAmB,cAAc,IAAI,UAAU;AAC/C,gBAAQ,cAAc,IAAI,OAAO;AACjC,oBAAY,cAAc,IAAI,WAAW;AACzC,4BAAoB,qBAAqB,SAAS;AAAA,MACpD;AACA,UAAI,YAAY,SAAS,cAAc,KAAK,OAAO;AACnD,UAAI,cAAc,UAAU;AAC5B,WAAK,SAAS,SAAS;AACvB,WAAK,MAAM,OAAO;AAClB,WAAK,MAAM,gBAAgB;AAC3B,WAAK,YAAY,UAAU,EAAE,QAAQ;AACrC,WAAK,YAAY,MAAM,EAAE,QAAQ;AACjC,WAAK,YAAY,QAAQ,EAAE,QAAQ;AAEnC,WAAK,mBAAmB,SAAU,gBAAgB;AAChD,YAAI,SAAS,KAAK,YAAY,cAAc;AAC5C,YAAI,QAAQ;AAEV,iBAAO,SAAS,WAAW;AAC3B,iBAAO,MAAM,UAAU,UAAU;AACjC,mBAAS,IAAI,GAAG,IAAI,eAAe,QAAQ,KAAK;AAC9C,gBAAI,YAAY,eAAe,CAAC;AAChC,gBAAI,YAAY,KAAK,SAAS,SAAS;AACvC,gBAAI,WAAW;AACb,kBAAI,iBAAiB,UAAU,SAAS,CAAC;AACzC,kBAAI,QAAQ,OAAO,YAAY,SAAS;AACxC,kBAAI,aAAa,MAAM,UAAU,MAAM,QAAQ,CAAC;AAChD,kBAAI,eAAe,UAAU,MAAM;AACjC,2BAAW,OAAO,iBAAiB,WAAW,MAAM,IAAI,eAAe;AAAA,cACzE;AACA,kBAAI,eAAe,WAAW,MAAM;AAClC,2BAAW,UAAU,eAAe;AAAA,cACtC;AAAA,YACF;AAAA,UACF;AACA,iBAAO,WAAW;AAAA,QACpB;AAAA,MACF,GAAG,IAAI;AACP,UAAI,SAAS,YAAY,YAAY,GAAG;AACxC,oBAAc,MAAM,mBAAmB;AAAA,QACrC,gBAAgB;AAAA,QAChB,cAAc;AAAA,UACZ,mBAAmB,SAAU,WAAW,WAAW;AACjD,mBAAO,YAAY,kBAAkB,WAAW,WAAW,SAAS,QAAQ;AAAA,UAC9E;AAAA,QACF;AAAA,QACA,cAAc,eAAe;AAAA,QAC7B,gBAAgB,UAAU;AAAA,QAC1B,cAAc,UAAU,OAAO,SAAS,QAAQ,GAAG,IAAI,SAAS,MAAM,IAAI,MAAM,MAAM,IAAI,UAAU;AAAA,MACtG,CAAC;AACD,UAAI,QAAQ,KAAK,eAAe;AAGhC,UAAI,OAAO;AACT,YAAI,mBAAmB,kBAAkB;AACzC,cAAM,UAAU,MAAM,MAAM;AAC5B,cAAM,kBAAkB,MAAM,MAAM;AAEpC,cAAM,aAAa,iBAAiB,IAAI,UAAU,KAAK;AACvD,YAAI,WAAW,iBAAiB,IAAI,UAAU;AAC9C,YAAI,CAAC,QAAQ,QAAQ,GAAG;AACtB,qBAAW,CAAC,UAAU,QAAQ;AAAA,QAChC;AACA,cAAM,kBAAkB;AAAA,MAC1B;AACA,WAAK,cAAc;AAAA,QACjB,UAAU;AAAA,QACV,OAAO;AAAA,QACP,QAAQ;AAAA;AAAA,MACV,CAAC;AAED,0BAAoB,MAAM,OAAO,WAAW,gBAAgB;AAAA,IAC9D;AACA,IAAAA,MAAK,UAAU,YAAY,WAAY;AACrC,oBAAc,IAAI;AAAA,IACpB;AACA,IAAAA,MAAK,UAAU,WAAW,WAAY;AACpC,oBAAc,IAAI;AAAA,IACpB;AACA,IAAAA,MAAK,UAAU,eAAe,SAAU,UAAU,KAAK;AACrD,WAAK,cAAc,SAAS,cAAc,GAAG,CAAC;AAAA,IAChD;AACA,IAAAA,MAAK,UAAU,gBAAgB,SAAU,QAAQ;AAC/C,UAAI,WAAW,KAAK,YAAY,MAAM;AACtC,oBAAc,SAAS,OAAO,MAAM;AACpC,eAAS,MAAM;AAAA,IACjB;AACA,IAAAA,MAAK,UAAU,eAAe,WAAY;AACxC,UAAI,YAAY;AAChB,UAAI,aAAa,UAAU,YAAY,YAAY;AACnD,UAAI,WAAW,UAAU,YAAY,UAAU;AAC/C,UAAI,QAAQ,UAAU,eAAe;AAErC,UAAI,CAAC,cAAc,CAAC,aAAa,CAAC,SAAS,MAAM,SAAS;AACxD;AAAA,MACF;AACA,UAAI,WAAW;AACf,UAAI,aAAa,KAAK;AACtB,aAAO,YAAY;AACjB,YAAI,WAAW,QAAQ;AACrB,sBAAY,WAAW;AAAA,QACzB;AACA,qBAAa,WAAW;AAAA,MAC1B;AACA,UAAI,OAAO,UAAU,YAAY,MAAM;AAGvC,UAAI,CAAC,KAAK,WAAW,CAAC,KAAK,SAAS;AAClC;AAAA,MACF;AACA,UAAI,UAAU,KAAK,MAAM;AACzB,UAAI,UAAU,KAAK,QAAQ,CAAC;AAC5B,UAAI,QAAQ,KAAK,QAAQ,OAAO;AAChC,UAAI,IAAW,IAAI,CAAC,GAAG,OAAO,OAAO;AACrC,MAAO,UAAU,GAAG,CAAC;AACrB,eAAS,kBAAkB,QAAQC,UAAS;AAK1C,YAAI,oBAAoB,OAAO;AAC/B,YAAI,qBAAqB,MAAM;AAC7B,cAAIC,WAAU,KAAK,UAAUD,QAAO;AACpC,iBAAO,KAAK,aAAaA,aAAY,IAAI,KAAK,KAAK,KAAK,KAAK,IAAI,KAAK,MAAMC,SAAQ,CAAC,GAAGA,SAAQ,CAAC,CAAC,CAAC;AAAA,QACrG,OAAO;AACL,iBAAO,KAAK,YAAY,iBAAiB;AAAA,QAC3C;AAAA,MACF;AACA,UAAI,YAAY;AACd,mBAAW,YAAY,OAAO;AAC9B,0BAAkB,YAAY,CAAC;AAC/B,mBAAW,SAAS,WAAW,SAAS,WAAW;AACnD,mBAAW,WAAW;AAAA,MACxB;AACA,UAAI,UAAU;AACZ,iBAAS,YAAY,KAAK;AAC1B,0BAAkB,UAAU,CAAC;AAC7B,iBAAS,SAAS,SAAS,SAAS,WAAW;AAC/C,iBAAS,WAAW;AAAA,MACtB;AACA,UAAI,SAAS,CAAC,MAAM,QAAQ;AAC1B,cAAM,IAAI,MAAM,IAAI;AACpB,cAAM,UAAU,MAAM,UAAU;AAChC,YAAI,YAAY;AAChB,YAAI,oBAAoB;AACxB,YAAI,WAAW,MAAM;AACrB,YAAI,YAAY,SAAS,CAAC,IAAI;AAC9B,YAAI,YAAY,SAAS,CAAC,IAAI;AAC9B,YAAI,cAAc,UAAU;AAC5B,YAAI,UAAU,KAAK,UAAU,WAAW;AACxC,YAAI,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAChC,YAAI,KAAK,KAAK,QAAQ,WAAW;AACjC,YAAI,EAAE,CAAC,IAAI,GAAG;AACZ,YAAE,CAAC,IAAI,CAAC,EAAE,CAAC;AACX,YAAE,CAAC,IAAI,CAAC,EAAE,CAAC;AAAA,QACb;AACA,YAAI,MAAM,QAAQ,CAAC,IAAI,IAAI,KAAK;AAChC,YAAI,MAAM,eAAe,WAAW,MAAM,eAAe,OAAO;AAC9D,cAAI,WAAW,CAAC,KAAK,MAAM,QAAQ,CAAC,GAAG,QAAQ,CAAC,CAAC;AACjD,cAAI,MAAM,CAAC,IAAI,QAAQ,CAAC,GAAG;AACzB,uBAAW,KAAK,KAAK;AAAA,UACvB;AACA,gBAAM,WAAW;AAAA,QACnB;AACA,YAAI,KAAK;AACT,gBAAQ,MAAM,YAAY;AAAA,UACxB,KAAK;AAAA,UACL,KAAK;AAAA,UACL,KAAK;AAAA,UACL,KAAK;AACH,iBAAK,CAAC;AACN,gCAAoB;AACpB;AAAA,UACF,KAAK;AAAA,UACL,KAAK;AAAA,UACL,KAAK;AACH,iBAAK;AACL,gCAAoB;AACpB;AAAA,UACF;AACE,iBAAK;AACL,gCAAoB;AAAA,QACxB;AACA,gBAAQ,MAAM,YAAY;AAAA,UACxB,KAAK;AACH,kBAAM,IAAI,EAAE,CAAC,IAAI,YAAY,MAAM,CAAC;AACpC,kBAAM,IAAI,EAAE,CAAC,IAAI,YAAY,MAAM,CAAC;AACpC,wBAAY,EAAE,CAAC,IAAI,MAAM,SAAS,EAAE,CAAC,IAAI,OAAO,UAAU;AAC1D,gCAAoB,EAAE,CAAC,IAAI,MAAM,QAAQ,EAAE,CAAC,IAAI,OAAO,WAAW;AAClE;AAAA,UACF,KAAK;AACH,kBAAM,IAAI,CAAC,EAAE,CAAC,IAAI,YAAY,QAAQ,CAAC;AACvC,kBAAM,IAAI,CAAC,EAAE,CAAC,IAAI,YAAY,QAAQ,CAAC;AACvC,wBAAY,EAAE,CAAC,IAAI,MAAM,UAAU,EAAE,CAAC,IAAI,OAAO,SAAS;AAC1D,gCAAoB,EAAE,CAAC,IAAI,MAAM,WAAW,EAAE,CAAC,IAAI,OAAO,QAAQ;AAClE;AAAA,UACF,KAAK;AAAA,UACL,KAAK;AAAA,UACL,KAAK;AACH,kBAAM,IAAI,YAAY,MAAM,QAAQ,CAAC;AACrC,kBAAM,IAAI,QAAQ,CAAC,IAAI;AACvB,wBAAY,QAAQ,CAAC,IAAI,IAAI,UAAU;AACvC,kBAAM,UAAU,CAAC,YAAY;AAC7B,kBAAM,UAAU,CAAC;AACjB;AAAA,UACF,KAAK;AAAA,UACL,KAAK;AAAA,UACL,KAAK;AAAA,UACL,KAAK;AACH,kBAAM,IAAI,GAAG,CAAC;AACd,kBAAM,IAAI,GAAG,CAAC,IAAI;AAClB,wBAAY;AACZ,kBAAM,UAAU,CAAC;AACjB;AAAA,UACF,KAAK;AAAA,UACL,KAAK;AAAA,UACL,KAAK;AACH,kBAAM,IAAI,CAAC,YAAY,MAAM,MAAM,CAAC;AACpC,kBAAM,IAAI,MAAM,CAAC,IAAI;AACrB,wBAAY,QAAQ,CAAC,KAAK,IAAI,UAAU;AACxC,kBAAM,UAAU,YAAY;AAC5B,kBAAM,UAAU,CAAC;AACjB;AAAA,QACJ;AACA,cAAM,SAAS,MAAM,SAAS;AAC9B,cAAM,SAAS;AAAA;AAAA,UAEb,eAAe,MAAM,mBAAmB;AAAA,UACxC,OAAO,MAAM,WAAW;AAAA,QAC1B,CAAC;AAAA,MACH;AAAA,IACF;AACA,WAAOF;AAAA,EACT,EAAU,aAAK;AAAA;AACf,IAAOG,gBAAQ;;;ACnXf,IAAI;AAAA;AAAA,EAAwB,WAAY;AACtC,aAASC,UAAS,UAAU;AAC1B,WAAK,QAAQ,IAAY,cAAM;AAC/B,WAAK,YAAY,YAAYC;AAAA,IAC/B;AACA,IAAAD,UAAS,UAAU,aAAa,SAAU,UAAU;AAClD,UAAI,QAAQ;AAEZ,WAAK,kBAAkB;AACvB,UAAI,WAAW;AACf,UAAI,QAAQ,SAAS;AACrB,UAAI,cAAc,SAAS;AAC3B,eAAS,YAAY;AAGrB,UAAI,CAAC,aAAa;AAChB,cAAM,UAAU;AAAA,MAClB;AACA,UAAI,cAAc,gBAAgB,QAAQ;AAC1C,eAAS,KAAK,WAAW,EAAE,IAAI,SAAU,KAAK;AAC5C,cAAM,OAAO,UAAU,KAAK,WAAW;AAAA,MACzC,CAAC,EAAE,OAAO,SAAU,QAAQ,QAAQ;AAClC,cAAM,UAAU,aAAa,UAAU,QAAQ,QAAQ,WAAW;AAAA,MACpE,CAAC,EAAE,OAAO,SAAU,KAAK;AACvB,cAAM,OAAO,YAAY,iBAAiB,GAAG,CAAC;AAAA,MAChD,CAAC,EAAE,QAAQ;AAAA,IACb;AACA;AACA,IAAAA,UAAS,UAAU,eAAe,WAAY;AAC5C,UAAI,WAAW,KAAK;AAEpB,UAAI,CAAC,UAAU;AACb;AAAA,MACF;AACA,eAAS,kBAAkB,SAAU,IAAI,KAAK;AAC5C,WAAG,aAAa,UAAU,GAAG;AAAA,MAC/B,GAAG,IAAI;AAAA,IACT;AACA;AACA,IAAAA,UAAS,UAAU,2BAA2B,SAAU,UAAU;AAChE,WAAK,eAAe,gBAAgB,QAAQ;AAC5C,WAAK,YAAY;AACjB,WAAK,MAAM,UAAU;AAAA,IACvB;AACA;AACA,IAAAA,UAAS,UAAU,oBAAoB,SAAU,YAAY,UAAU;AACrE,WAAK,kBAAkB,CAAC;AACxB,eAAS,0BAA0BE,KAAI;AACrC,YAAI,CAACA,IAAG,WAAW,CAAC,eAAeA,GAAE,GAAG;AACtC,UAAAA,IAAG,cAAc;AACjB,UAAAA,IAAG,YAAY,UAAU,EAAE,aAAa;AAAA,QAC1C;AAAA,MACF;AACA,eAAS,MAAM,WAAW,OAAO,MAAM,WAAW,KAAK,OAAO;AAC5D,YAAI,aAAa,SAAS,cAAc,GAAG;AAC3C,YAAI,cAAc,UAAU,GAAG;AAC7B,cAAI,KAAK,IAAI,KAAK,UAAU,UAAU,KAAK,KAAK,YAAY;AAC5D,aAAG,SAAS,yBAAyB;AACrC,eAAK,MAAM,IAAI,EAAE;AACjB,mBAAS,iBAAiB,KAAK,EAAE;AACjC,eAAK,gBAAgB,KAAK,EAAE;AAAA,QAC9B;AAAA,MACF;AAAA,IACF;AACA;AACA,IAAAF,UAAS,UAAU,SAAS,WAAY;AACtC,WAAK,MAAM,UAAU;AAAA,IACvB;AACA;AACA,IAAAA,UAAS,UAAU,eAAe,SAAU,IAAI;AAC9C,MAAQ,iBAAiB,KAAK,mBAAmB,KAAK,OAAO,EAAE;AAAA,IACjE;AACA,IAAAA,UAAS,UAAU,SAAS,SAAU,UAAU,KAAK,aAAa;AAChE,UAAI,aAAa,SAAS,cAAc,GAAG;AAC3C,UAAI,CAAC,cAAc,UAAU,GAAG;AAC9B;AAAA,MACF;AACA,UAAI,KAAK,IAAI,KAAK,UAAU,UAAU,KAAK,WAAW;AACtD,eAAS,iBAAiB,KAAK,EAAE;AACjC,WAAK,MAAM,IAAI,EAAE;AAAA,IACnB;AACA,IAAAA,UAAS,UAAU,YAAY,SAAU,aAAa,aAAa,QAAQ,QAAQ,aAAa;AAC9F,UAAI,SAAS,YAAY,iBAAiB,MAAM;AAChD,UAAI,CAAC,cAAc,YAAY,cAAc,MAAM,CAAC,GAAG;AACrD,aAAK,MAAM,OAAO,MAAM;AACxB;AAAA,MACF;AACA,UAAI,CAAC,QAAQ;AACX,iBAAS,IAAI,KAAK,UAAU,aAAa,QAAQ,WAAW;AAAA,MAC9D,OAAO;AACL,eAAO,WAAW,aAAa,QAAQ,WAAW;AAAA,MACpD;AACA,kBAAY,iBAAiB,QAAQ,MAAM;AAC3C,WAAK,MAAM,IAAI,MAAM;AAAA,IACvB;AACA,WAAOA;AAAA,EACT,EAAE;AAAA;AACF,SAAS,eAAe,IAAI;AAC1B,SAAO,GAAG,aAAa,GAAG,UAAU,SAAS;AAC/C;AACA,SAAS,gBAAgB,UAAU;AACjC,MAAI,YAAY,SAAS;AACzB,MAAI,gBAAgB,UAAU,SAAS,UAAU;AACjD,SAAO;AAAA,IACL,WAAW,UAAU,SAAS,WAAW,EAAE,aAAa;AAAA,IACxD,mBAAmB,cAAc,SAAS,CAAC,WAAW,CAAC,EAAE,aAAa;AAAA,IACtE,eAAe,UAAU,SAAS,CAAC,QAAQ,WAAW,CAAC,EAAE,aAAa;AAAA,IACtE,iBAAiB,UAAU,SAAS,CAAC,UAAU,WAAW,CAAC,EAAE,aAAa;AAAA,IAC1E,kBAAkB,cAAc,IAAI,UAAU;AAAA,IAC9C,WAAW,cAAc,IAAI,WAAW;AAAA,IACxC,OAAO,cAAc,IAAI,OAAO;AAAA,IAChC,mBAAmB,qBAAqB,SAAS;AAAA,EACnD;AACF;AACA,SAAS,WAAW,IAAI;AACtB,SAAO,MAAM,GAAG,CAAC,CAAC,KAAK,MAAM,GAAG,CAAC,CAAC;AACpC;AACA,SAAS,cAAc,KAAK;AAC1B,SAAO,OAAO,CAAC,WAAW,IAAI,CAAC,CAAC,KAAK,CAAC,WAAW,IAAI,CAAC,CAAC;AACzD;AACA,IAAO,mBAAQ;", - "names": ["StraightLineShape", "CurveShape", "ECLinePath", "createSymbol", "Line", "percent", "tangent", "Line_default", "LineDraw", "Line_default", "el"] -} diff --git a/node_modules/.vite/deps/chunk-6WG6DCDF.js b/node_modules/.vite/deps/chunk-6WG6DCDF.js deleted file mode 100644 index 7e1fb497..00000000 --- a/node_modules/.vite/deps/chunk-6WG6DCDF.js +++ /dev/null @@ -1,367 +0,0 @@ -import { - MarkerModel_default, - MarkerView_default, - checkMarkerInSeries, - createMarkerDimValueGetter, - dataFilter, - dataTransform, - getAxisInfo, - numCalculate -} from "./chunk-EPSCDAO5.js"; -import { - LineDraw_default -} from "./chunk-5G7BH44C.js"; -import { - isCoordinateSystemType -} from "./chunk-QAR3K42R.js"; -import { - SeriesData_default, - getECData, - getStackedDimension, - getVisualFromData, - makeInner, - parsePercent -} from "./chunk-HOOPLKFT.js"; -import { - __extends, - clone, - curry, - extend, - filter, - isArray, - isNumber, - logError, - map, - merge, - retrieve, - retrieve2 -} from "./chunk-M6ZIMNOI.js"; - -// node_modules/.pnpm/echarts@5.5.1/node_modules/echarts/lib/component/marker/MarkLineModel.js -var MarkLineModel = ( - /** @class */ - function(_super) { - __extends(MarkLineModel2, _super); - function MarkLineModel2() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = MarkLineModel2.type; - return _this; - } - MarkLineModel2.prototype.createMarkerModelFromSeries = function(markerOpt, masterMarkerModel, ecModel) { - return new MarkLineModel2(markerOpt, masterMarkerModel, ecModel); - }; - MarkLineModel2.type = "markLine"; - MarkLineModel2.defaultOption = { - // zlevel: 0, - z: 5, - symbol: ["circle", "arrow"], - symbolSize: [8, 16], - // symbolRotate: 0, - symbolOffset: 0, - precision: 2, - tooltip: { - trigger: "item" - }, - label: { - show: true, - position: "end", - distance: 5 - }, - lineStyle: { - type: "dashed" - }, - emphasis: { - label: { - show: true - }, - lineStyle: { - width: 3 - } - }, - animationEasing: "linear" - }; - return MarkLineModel2; - }(MarkerModel_default) -); -var MarkLineModel_default = MarkLineModel; - -// node_modules/.pnpm/echarts@5.5.1/node_modules/echarts/lib/component/marker/MarkLineView.js -var inner = makeInner(); -var markLineTransform = function(seriesModel, coordSys, mlModel, item) { - var data = seriesModel.getData(); - var itemArray; - if (!isArray(item)) { - var mlType = item.type; - if (mlType === "min" || mlType === "max" || mlType === "average" || mlType === "median" || item.xAxis != null || item.yAxis != null) { - var valueAxis = void 0; - var value = void 0; - if (item.yAxis != null || item.xAxis != null) { - valueAxis = coordSys.getAxis(item.yAxis != null ? "y" : "x"); - value = retrieve(item.yAxis, item.xAxis); - } else { - var axisInfo = getAxisInfo(item, data, coordSys, seriesModel); - valueAxis = axisInfo.valueAxis; - var valueDataDim = getStackedDimension(data, axisInfo.valueDataDim); - value = numCalculate(data, valueDataDim, mlType); - } - var valueIndex = valueAxis.dim === "x" ? 0 : 1; - var baseIndex = 1 - valueIndex; - var mlFrom = clone(item); - var mlTo = { - coord: [] - }; - mlFrom.type = null; - mlFrom.coord = []; - mlFrom.coord[baseIndex] = -Infinity; - mlTo.coord[baseIndex] = Infinity; - var precision = mlModel.get("precision"); - if (precision >= 0 && isNumber(value)) { - value = +value.toFixed(Math.min(precision, 20)); - } - mlFrom.coord[valueIndex] = mlTo.coord[valueIndex] = value; - itemArray = [mlFrom, mlTo, { - type: mlType, - valueIndex: item.valueIndex, - // Force to use the value of calculated value. - value - }]; - } else { - if (true) { - logError("Invalid markLine data."); - } - itemArray = []; - } - } else { - itemArray = item; - } - var normalizedItem = [dataTransform(seriesModel, itemArray[0]), dataTransform(seriesModel, itemArray[1]), extend({}, itemArray[2])]; - normalizedItem[2].type = normalizedItem[2].type || null; - merge(normalizedItem[2], normalizedItem[0]); - merge(normalizedItem[2], normalizedItem[1]); - return normalizedItem; -}; -function isInfinity(val) { - return !isNaN(val) && !isFinite(val); -} -function ifMarkLineHasOnlyDim(dimIndex, fromCoord, toCoord, coordSys) { - var otherDimIndex = 1 - dimIndex; - var dimName = coordSys.dimensions[dimIndex]; - return isInfinity(fromCoord[otherDimIndex]) && isInfinity(toCoord[otherDimIndex]) && fromCoord[dimIndex] === toCoord[dimIndex] && coordSys.getAxis(dimName).containData(fromCoord[dimIndex]); -} -function markLineFilter(coordSys, item) { - if (coordSys.type === "cartesian2d") { - var fromCoord = item[0].coord; - var toCoord = item[1].coord; - if (fromCoord && toCoord && (ifMarkLineHasOnlyDim(1, fromCoord, toCoord, coordSys) || ifMarkLineHasOnlyDim(0, fromCoord, toCoord, coordSys))) { - return true; - } - } - return dataFilter(coordSys, item[0]) && dataFilter(coordSys, item[1]); -} -function updateSingleMarkerEndLayout(data, idx, isFrom, seriesModel, api) { - var coordSys = seriesModel.coordinateSystem; - var itemModel = data.getItemModel(idx); - var point; - var xPx = parsePercent(itemModel.get("x"), api.getWidth()); - var yPx = parsePercent(itemModel.get("y"), api.getHeight()); - if (!isNaN(xPx) && !isNaN(yPx)) { - point = [xPx, yPx]; - } else { - if (seriesModel.getMarkerPosition) { - point = seriesModel.getMarkerPosition(data.getValues(data.dimensions, idx)); - } else { - var dims = coordSys.dimensions; - var x = data.get(dims[0], idx); - var y = data.get(dims[1], idx); - point = coordSys.dataToPoint([x, y]); - } - if (isCoordinateSystemType(coordSys, "cartesian2d")) { - var xAxis = coordSys.getAxis("x"); - var yAxis = coordSys.getAxis("y"); - var dims = coordSys.dimensions; - if (isInfinity(data.get(dims[0], idx))) { - point[0] = xAxis.toGlobalCoord(xAxis.getExtent()[isFrom ? 0 : 1]); - } else if (isInfinity(data.get(dims[1], idx))) { - point[1] = yAxis.toGlobalCoord(yAxis.getExtent()[isFrom ? 0 : 1]); - } - } - if (!isNaN(xPx)) { - point[0] = xPx; - } - if (!isNaN(yPx)) { - point[1] = yPx; - } - } - data.setItemLayout(idx, point); -} -var MarkLineView = ( - /** @class */ - function(_super) { - __extends(MarkLineView2, _super); - function MarkLineView2() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = MarkLineView2.type; - return _this; - } - MarkLineView2.prototype.updateTransform = function(markLineModel, ecModel, api) { - ecModel.eachSeries(function(seriesModel) { - var mlModel = MarkerModel_default.getMarkerModelFromSeries(seriesModel, "markLine"); - if (mlModel) { - var mlData_1 = mlModel.getData(); - var fromData_1 = inner(mlModel).from; - var toData_1 = inner(mlModel).to; - fromData_1.each(function(idx) { - updateSingleMarkerEndLayout(fromData_1, idx, true, seriesModel, api); - updateSingleMarkerEndLayout(toData_1, idx, false, seriesModel, api); - }); - mlData_1.each(function(idx) { - mlData_1.setItemLayout(idx, [fromData_1.getItemLayout(idx), toData_1.getItemLayout(idx)]); - }); - this.markerGroupMap.get(seriesModel.id).updateLayout(); - } - }, this); - }; - MarkLineView2.prototype.renderSeries = function(seriesModel, mlModel, ecModel, api) { - var coordSys = seriesModel.coordinateSystem; - var seriesId = seriesModel.id; - var seriesData = seriesModel.getData(); - var lineDrawMap = this.markerGroupMap; - var lineDraw = lineDrawMap.get(seriesId) || lineDrawMap.set(seriesId, new LineDraw_default()); - this.group.add(lineDraw.group); - var mlData = createList(coordSys, seriesModel, mlModel); - var fromData = mlData.from; - var toData = mlData.to; - var lineData = mlData.line; - inner(mlModel).from = fromData; - inner(mlModel).to = toData; - mlModel.setData(lineData); - var symbolType = mlModel.get("symbol"); - var symbolSize = mlModel.get("symbolSize"); - var symbolRotate = mlModel.get("symbolRotate"); - var symbolOffset = mlModel.get("symbolOffset"); - if (!isArray(symbolType)) { - symbolType = [symbolType, symbolType]; - } - if (!isArray(symbolSize)) { - symbolSize = [symbolSize, symbolSize]; - } - if (!isArray(symbolRotate)) { - symbolRotate = [symbolRotate, symbolRotate]; - } - if (!isArray(symbolOffset)) { - symbolOffset = [symbolOffset, symbolOffset]; - } - mlData.from.each(function(idx) { - updateDataVisualAndLayout(fromData, idx, true); - updateDataVisualAndLayout(toData, idx, false); - }); - lineData.each(function(idx) { - var lineStyle = lineData.getItemModel(idx).getModel("lineStyle").getLineStyle(); - lineData.setItemLayout(idx, [fromData.getItemLayout(idx), toData.getItemLayout(idx)]); - if (lineStyle.stroke == null) { - lineStyle.stroke = fromData.getItemVisual(idx, "style").fill; - } - lineData.setItemVisual(idx, { - fromSymbolKeepAspect: fromData.getItemVisual(idx, "symbolKeepAspect"), - fromSymbolOffset: fromData.getItemVisual(idx, "symbolOffset"), - fromSymbolRotate: fromData.getItemVisual(idx, "symbolRotate"), - fromSymbolSize: fromData.getItemVisual(idx, "symbolSize"), - fromSymbol: fromData.getItemVisual(idx, "symbol"), - toSymbolKeepAspect: toData.getItemVisual(idx, "symbolKeepAspect"), - toSymbolOffset: toData.getItemVisual(idx, "symbolOffset"), - toSymbolRotate: toData.getItemVisual(idx, "symbolRotate"), - toSymbolSize: toData.getItemVisual(idx, "symbolSize"), - toSymbol: toData.getItemVisual(idx, "symbol"), - style: lineStyle - }); - }); - lineDraw.updateData(lineData); - mlData.line.eachItemGraphicEl(function(el) { - getECData(el).dataModel = mlModel; - el.traverse(function(child) { - getECData(child).dataModel = mlModel; - }); - }); - function updateDataVisualAndLayout(data, idx, isFrom) { - var itemModel = data.getItemModel(idx); - updateSingleMarkerEndLayout(data, idx, isFrom, seriesModel, api); - var style = itemModel.getModel("itemStyle").getItemStyle(); - if (style.fill == null) { - style.fill = getVisualFromData(seriesData, "color"); - } - data.setItemVisual(idx, { - symbolKeepAspect: itemModel.get("symbolKeepAspect"), - // `0` should be considered as a valid value, so use `retrieve2` instead of `||` - symbolOffset: retrieve2(itemModel.get("symbolOffset", true), symbolOffset[isFrom ? 0 : 1]), - symbolRotate: retrieve2(itemModel.get("symbolRotate", true), symbolRotate[isFrom ? 0 : 1]), - // TODO: when 2d array is supported, it should ignore parent - symbolSize: retrieve2(itemModel.get("symbolSize"), symbolSize[isFrom ? 0 : 1]), - symbol: retrieve2(itemModel.get("symbol", true), symbolType[isFrom ? 0 : 1]), - style - }); - } - this.markKeep(lineDraw); - lineDraw.group.silent = mlModel.get("silent") || seriesModel.get("silent"); - }; - MarkLineView2.type = "markLine"; - return MarkLineView2; - }(MarkerView_default) -); -function createList(coordSys, seriesModel, mlModel) { - var coordDimsInfos; - if (coordSys) { - coordDimsInfos = map(coordSys && coordSys.dimensions, function(coordDim) { - var info = seriesModel.getData().getDimensionInfo(seriesModel.getData().mapDimension(coordDim)) || {}; - return extend(extend({}, info), { - name: coordDim, - // DON'T use ordinalMeta to parse and collect ordinal. - ordinalMeta: null - }); - }); - } else { - coordDimsInfos = [{ - name: "value", - type: "float" - }]; - } - var fromData = new SeriesData_default(coordDimsInfos, mlModel); - var toData = new SeriesData_default(coordDimsInfos, mlModel); - var lineData = new SeriesData_default([], mlModel); - var optData = map(mlModel.get("data"), curry(markLineTransform, seriesModel, coordSys, mlModel)); - if (coordSys) { - optData = filter(optData, curry(markLineFilter, coordSys)); - } - var dimValueGetter = createMarkerDimValueGetter(!!coordSys, coordDimsInfos); - fromData.initData(map(optData, function(item) { - return item[0]; - }), null, dimValueGetter); - toData.initData(map(optData, function(item) { - return item[1]; - }), null, dimValueGetter); - lineData.initData(map(optData, function(item) { - return item[2]; - })); - lineData.hasItemOption = true; - return { - from: fromData, - to: toData, - line: lineData - }; -} -var MarkLineView_default = MarkLineView; - -// node_modules/.pnpm/echarts@5.5.1/node_modules/echarts/lib/component/marker/installMarkLine.js -function install(registers) { - registers.registerComponentModel(MarkLineModel_default); - registers.registerComponentView(MarkLineView_default); - registers.registerPreprocessor(function(opt) { - if (checkMarkerInSeries(opt.series, "markLine")) { - opt.markLine = opt.markLine || {}; - } - }); -} - -export { - install -}; -//# sourceMappingURL=chunk-6WG6DCDF.js.map diff --git a/node_modules/.vite/deps/chunk-6WG6DCDF.js.map b/node_modules/.vite/deps/chunk-6WG6DCDF.js.map deleted file mode 100644 index 905fdfda..00000000 --- a/node_modules/.vite/deps/chunk-6WG6DCDF.js.map +++ /dev/null @@ -1,7 +0,0 @@ -{ - "version": 3, - "sources": ["../../.pnpm/echarts@5.5.1/node_modules/echarts/lib/component/marker/MarkLineModel.js", "../../.pnpm/echarts@5.5.1/node_modules/echarts/lib/component/marker/MarkLineView.js", "../../.pnpm/echarts@5.5.1/node_modules/echarts/lib/component/marker/installMarkLine.js"], - "sourcesContent": ["\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport MarkerModel from './MarkerModel.js';\nvar MarkLineModel = /** @class */function (_super) {\n __extends(MarkLineModel, _super);\n function MarkLineModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.type = MarkLineModel.type;\n return _this;\n }\n MarkLineModel.prototype.createMarkerModelFromSeries = function (markerOpt, masterMarkerModel, ecModel) {\n return new MarkLineModel(markerOpt, masterMarkerModel, ecModel);\n };\n MarkLineModel.type = 'markLine';\n MarkLineModel.defaultOption = {\n // zlevel: 0,\n z: 5,\n symbol: ['circle', 'arrow'],\n symbolSize: [8, 16],\n // symbolRotate: 0,\n symbolOffset: 0,\n precision: 2,\n tooltip: {\n trigger: 'item'\n },\n label: {\n show: true,\n position: 'end',\n distance: 5\n },\n lineStyle: {\n type: 'dashed'\n },\n emphasis: {\n label: {\n show: true\n },\n lineStyle: {\n width: 3\n }\n },\n animationEasing: 'linear'\n };\n return MarkLineModel;\n}(MarkerModel);\nexport default MarkLineModel;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport SeriesData from '../../data/SeriesData.js';\nimport * as numberUtil from '../../util/number.js';\nimport * as markerHelper from './markerHelper.js';\nimport LineDraw from '../../chart/helper/LineDraw.js';\nimport MarkerView from './MarkerView.js';\nimport { getStackedDimension } from '../../data/helper/dataStackHelper.js';\nimport { isCoordinateSystemType } from '../../coord/CoordinateSystem.js';\nimport { getECData } from '../../util/innerStore.js';\nimport MarkerModel from './MarkerModel.js';\nimport { isArray, retrieve, retrieve2, clone, extend, logError, merge, map, curry, filter, isNumber } from 'zrender/lib/core/util.js';\nimport { makeInner } from '../../util/model.js';\nimport { getVisualFromData } from '../../visual/helper.js';\nvar inner = makeInner();\nvar markLineTransform = function (seriesModel, coordSys, mlModel, item) {\n var data = seriesModel.getData();\n var itemArray;\n if (!isArray(item)) {\n // Special type markLine like 'min', 'max', 'average', 'median'\n var mlType = item.type;\n if (mlType === 'min' || mlType === 'max' || mlType === 'average' || mlType === 'median'\n // In case\n // data: [{\n // yAxis: 10\n // }]\n || item.xAxis != null || item.yAxis != null) {\n var valueAxis = void 0;\n var value = void 0;\n if (item.yAxis != null || item.xAxis != null) {\n valueAxis = coordSys.getAxis(item.yAxis != null ? 'y' : 'x');\n value = retrieve(item.yAxis, item.xAxis);\n } else {\n var axisInfo = markerHelper.getAxisInfo(item, data, coordSys, seriesModel);\n valueAxis = axisInfo.valueAxis;\n var valueDataDim = getStackedDimension(data, axisInfo.valueDataDim);\n value = markerHelper.numCalculate(data, valueDataDim, mlType);\n }\n var valueIndex = valueAxis.dim === 'x' ? 0 : 1;\n var baseIndex = 1 - valueIndex;\n // Normized to 2d data with start and end point\n var mlFrom = clone(item);\n var mlTo = {\n coord: []\n };\n mlFrom.type = null;\n mlFrom.coord = [];\n mlFrom.coord[baseIndex] = -Infinity;\n mlTo.coord[baseIndex] = Infinity;\n var precision = mlModel.get('precision');\n if (precision >= 0 && isNumber(value)) {\n value = +value.toFixed(Math.min(precision, 20));\n }\n mlFrom.coord[valueIndex] = mlTo.coord[valueIndex] = value;\n itemArray = [mlFrom, mlTo, {\n type: mlType,\n valueIndex: item.valueIndex,\n // Force to use the value of calculated value.\n value: value\n }];\n } else {\n // Invalid data\n if (process.env.NODE_ENV !== 'production') {\n logError('Invalid markLine data.');\n }\n itemArray = [];\n }\n } else {\n itemArray = item;\n }\n var normalizedItem = [markerHelper.dataTransform(seriesModel, itemArray[0]), markerHelper.dataTransform(seriesModel, itemArray[1]), extend({}, itemArray[2])];\n // Avoid line data type is extended by from(to) data type\n normalizedItem[2].type = normalizedItem[2].type || null;\n // Merge from option and to option into line option\n merge(normalizedItem[2], normalizedItem[0]);\n merge(normalizedItem[2], normalizedItem[1]);\n return normalizedItem;\n};\nfunction isInfinity(val) {\n return !isNaN(val) && !isFinite(val);\n}\n// If a markLine has one dim\nfunction ifMarkLineHasOnlyDim(dimIndex, fromCoord, toCoord, coordSys) {\n var otherDimIndex = 1 - dimIndex;\n var dimName = coordSys.dimensions[dimIndex];\n return isInfinity(fromCoord[otherDimIndex]) && isInfinity(toCoord[otherDimIndex]) && fromCoord[dimIndex] === toCoord[dimIndex] && coordSys.getAxis(dimName).containData(fromCoord[dimIndex]);\n}\nfunction markLineFilter(coordSys, item) {\n if (coordSys.type === 'cartesian2d') {\n var fromCoord = item[0].coord;\n var toCoord = item[1].coord;\n // In case\n // {\n // markLine: {\n // data: [{ yAxis: 2 }]\n // }\n // }\n if (fromCoord && toCoord && (ifMarkLineHasOnlyDim(1, fromCoord, toCoord, coordSys) || ifMarkLineHasOnlyDim(0, fromCoord, toCoord, coordSys))) {\n return true;\n }\n }\n return markerHelper.dataFilter(coordSys, item[0]) && markerHelper.dataFilter(coordSys, item[1]);\n}\nfunction updateSingleMarkerEndLayout(data, idx, isFrom, seriesModel, api) {\n var coordSys = seriesModel.coordinateSystem;\n var itemModel = data.getItemModel(idx);\n var point;\n var xPx = numberUtil.parsePercent(itemModel.get('x'), api.getWidth());\n var yPx = numberUtil.parsePercent(itemModel.get('y'), api.getHeight());\n if (!isNaN(xPx) && !isNaN(yPx)) {\n point = [xPx, yPx];\n } else {\n // Chart like bar may have there own marker positioning logic\n if (seriesModel.getMarkerPosition) {\n // Use the getMarkerPosition\n point = seriesModel.getMarkerPosition(data.getValues(data.dimensions, idx));\n } else {\n var dims = coordSys.dimensions;\n var x = data.get(dims[0], idx);\n var y = data.get(dims[1], idx);\n point = coordSys.dataToPoint([x, y]);\n }\n // Expand line to the edge of grid if value on one axis is Inifnity\n // In case\n // markLine: {\n // data: [{\n // yAxis: 2\n // // or\n // type: 'average'\n // }]\n // }\n if (isCoordinateSystemType(coordSys, 'cartesian2d')) {\n // TODO: TYPE ts@4.1 may still infer it as Axis instead of Axis2D. Not sure if it's a bug\n var xAxis = coordSys.getAxis('x');\n var yAxis = coordSys.getAxis('y');\n var dims = coordSys.dimensions;\n if (isInfinity(data.get(dims[0], idx))) {\n point[0] = xAxis.toGlobalCoord(xAxis.getExtent()[isFrom ? 0 : 1]);\n } else if (isInfinity(data.get(dims[1], idx))) {\n point[1] = yAxis.toGlobalCoord(yAxis.getExtent()[isFrom ? 0 : 1]);\n }\n }\n // Use x, y if has any\n if (!isNaN(xPx)) {\n point[0] = xPx;\n }\n if (!isNaN(yPx)) {\n point[1] = yPx;\n }\n }\n data.setItemLayout(idx, point);\n}\nvar MarkLineView = /** @class */function (_super) {\n __extends(MarkLineView, _super);\n function MarkLineView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.type = MarkLineView.type;\n return _this;\n }\n MarkLineView.prototype.updateTransform = function (markLineModel, ecModel, api) {\n ecModel.eachSeries(function (seriesModel) {\n var mlModel = MarkerModel.getMarkerModelFromSeries(seriesModel, 'markLine');\n if (mlModel) {\n var mlData_1 = mlModel.getData();\n var fromData_1 = inner(mlModel).from;\n var toData_1 = inner(mlModel).to;\n // Update visual and layout of from symbol and to symbol\n fromData_1.each(function (idx) {\n updateSingleMarkerEndLayout(fromData_1, idx, true, seriesModel, api);\n updateSingleMarkerEndLayout(toData_1, idx, false, seriesModel, api);\n });\n // Update layout of line\n mlData_1.each(function (idx) {\n mlData_1.setItemLayout(idx, [fromData_1.getItemLayout(idx), toData_1.getItemLayout(idx)]);\n });\n this.markerGroupMap.get(seriesModel.id).updateLayout();\n }\n }, this);\n };\n MarkLineView.prototype.renderSeries = function (seriesModel, mlModel, ecModel, api) {\n var coordSys = seriesModel.coordinateSystem;\n var seriesId = seriesModel.id;\n var seriesData = seriesModel.getData();\n var lineDrawMap = this.markerGroupMap;\n var lineDraw = lineDrawMap.get(seriesId) || lineDrawMap.set(seriesId, new LineDraw());\n this.group.add(lineDraw.group);\n var mlData = createList(coordSys, seriesModel, mlModel);\n var fromData = mlData.from;\n var toData = mlData.to;\n var lineData = mlData.line;\n inner(mlModel).from = fromData;\n inner(mlModel).to = toData;\n // Line data for tooltip and formatter\n mlModel.setData(lineData);\n // TODO\n // Functionally, `symbolSize` & `symbolOffset` can also be 2D array now.\n // But the related logic and type definition are not finished yet.\n // Finish it if required\n var symbolType = mlModel.get('symbol');\n var symbolSize = mlModel.get('symbolSize');\n var symbolRotate = mlModel.get('symbolRotate');\n var symbolOffset = mlModel.get('symbolOffset');\n // TODO: support callback function like markPoint\n if (!isArray(symbolType)) {\n symbolType = [symbolType, symbolType];\n }\n if (!isArray(symbolSize)) {\n symbolSize = [symbolSize, symbolSize];\n }\n if (!isArray(symbolRotate)) {\n symbolRotate = [symbolRotate, symbolRotate];\n }\n if (!isArray(symbolOffset)) {\n symbolOffset = [symbolOffset, symbolOffset];\n }\n // Update visual and layout of from symbol and to symbol\n mlData.from.each(function (idx) {\n updateDataVisualAndLayout(fromData, idx, true);\n updateDataVisualAndLayout(toData, idx, false);\n });\n // Update visual and layout of line\n lineData.each(function (idx) {\n var lineStyle = lineData.getItemModel(idx).getModel('lineStyle').getLineStyle();\n // lineData.setItemVisual(idx, {\n // color: lineColor || fromData.getItemVisual(idx, 'color')\n // });\n lineData.setItemLayout(idx, [fromData.getItemLayout(idx), toData.getItemLayout(idx)]);\n if (lineStyle.stroke == null) {\n lineStyle.stroke = fromData.getItemVisual(idx, 'style').fill;\n }\n lineData.setItemVisual(idx, {\n fromSymbolKeepAspect: fromData.getItemVisual(idx, 'symbolKeepAspect'),\n fromSymbolOffset: fromData.getItemVisual(idx, 'symbolOffset'),\n fromSymbolRotate: fromData.getItemVisual(idx, 'symbolRotate'),\n fromSymbolSize: fromData.getItemVisual(idx, 'symbolSize'),\n fromSymbol: fromData.getItemVisual(idx, 'symbol'),\n toSymbolKeepAspect: toData.getItemVisual(idx, 'symbolKeepAspect'),\n toSymbolOffset: toData.getItemVisual(idx, 'symbolOffset'),\n toSymbolRotate: toData.getItemVisual(idx, 'symbolRotate'),\n toSymbolSize: toData.getItemVisual(idx, 'symbolSize'),\n toSymbol: toData.getItemVisual(idx, 'symbol'),\n style: lineStyle\n });\n });\n lineDraw.updateData(lineData);\n // Set host model for tooltip\n // FIXME\n mlData.line.eachItemGraphicEl(function (el) {\n getECData(el).dataModel = mlModel;\n el.traverse(function (child) {\n getECData(child).dataModel = mlModel;\n });\n });\n function updateDataVisualAndLayout(data, idx, isFrom) {\n var itemModel = data.getItemModel(idx);\n updateSingleMarkerEndLayout(data, idx, isFrom, seriesModel, api);\n var style = itemModel.getModel('itemStyle').getItemStyle();\n if (style.fill == null) {\n style.fill = getVisualFromData(seriesData, 'color');\n }\n data.setItemVisual(idx, {\n symbolKeepAspect: itemModel.get('symbolKeepAspect'),\n // `0` should be considered as a valid value, so use `retrieve2` instead of `||`\n symbolOffset: retrieve2(itemModel.get('symbolOffset', true), symbolOffset[isFrom ? 0 : 1]),\n symbolRotate: retrieve2(itemModel.get('symbolRotate', true), symbolRotate[isFrom ? 0 : 1]),\n // TODO: when 2d array is supported, it should ignore parent\n symbolSize: retrieve2(itemModel.get('symbolSize'), symbolSize[isFrom ? 0 : 1]),\n symbol: retrieve2(itemModel.get('symbol', true), symbolType[isFrom ? 0 : 1]),\n style: style\n });\n }\n this.markKeep(lineDraw);\n lineDraw.group.silent = mlModel.get('silent') || seriesModel.get('silent');\n };\n MarkLineView.type = 'markLine';\n return MarkLineView;\n}(MarkerView);\nfunction createList(coordSys, seriesModel, mlModel) {\n var coordDimsInfos;\n if (coordSys) {\n coordDimsInfos = map(coordSys && coordSys.dimensions, function (coordDim) {\n var info = seriesModel.getData().getDimensionInfo(seriesModel.getData().mapDimension(coordDim)) || {};\n // In map series data don't have lng and lat dimension. Fallback to same with coordSys\n return extend(extend({}, info), {\n name: coordDim,\n // DON'T use ordinalMeta to parse and collect ordinal.\n ordinalMeta: null\n });\n });\n } else {\n coordDimsInfos = [{\n name: 'value',\n type: 'float'\n }];\n }\n var fromData = new SeriesData(coordDimsInfos, mlModel);\n var toData = new SeriesData(coordDimsInfos, mlModel);\n // No dimensions\n var lineData = new SeriesData([], mlModel);\n var optData = map(mlModel.get('data'), curry(markLineTransform, seriesModel, coordSys, mlModel));\n if (coordSys) {\n optData = filter(optData, curry(markLineFilter, coordSys));\n }\n var dimValueGetter = markerHelper.createMarkerDimValueGetter(!!coordSys, coordDimsInfos);\n fromData.initData(map(optData, function (item) {\n return item[0];\n }), null, dimValueGetter);\n toData.initData(map(optData, function (item) {\n return item[1];\n }), null, dimValueGetter);\n lineData.initData(map(optData, function (item) {\n return item[2];\n }));\n lineData.hasItemOption = true;\n return {\n from: fromData,\n to: toData,\n line: lineData\n };\n}\nexport default MarkLineView;", "\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\nimport checkMarkerInSeries from './checkMarkerInSeries.js';\nimport MarkLineModel from './MarkLineModel.js';\nimport MarkLineView from './MarkLineView.js';\nexport function install(registers) {\n registers.registerComponentModel(MarkLineModel);\n registers.registerComponentView(MarkLineView);\n registers.registerPreprocessor(function (opt) {\n if (checkMarkerInSeries(opt.series, 'markLine')) {\n // Make sure markLine component is enabled\n opt.markLine = opt.markLine || {};\n }\n });\n}"], - "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6CA,IAAI;AAAA;AAAA,EAA6B,SAAU,QAAQ;AACjD,cAAUA,gBAAe,MAAM;AAC/B,aAASA,iBAAgB;AACvB,UAAI,QAAQ,WAAW,QAAQ,OAAO,MAAM,MAAM,SAAS,KAAK;AAChE,YAAM,OAAOA,eAAc;AAC3B,aAAO;AAAA,IACT;AACA,IAAAA,eAAc,UAAU,8BAA8B,SAAU,WAAW,mBAAmB,SAAS;AACrG,aAAO,IAAIA,eAAc,WAAW,mBAAmB,OAAO;AAAA,IAChE;AACA,IAAAA,eAAc,OAAO;AACrB,IAAAA,eAAc,gBAAgB;AAAA;AAAA,MAE5B,GAAG;AAAA,MACH,QAAQ,CAAC,UAAU,OAAO;AAAA,MAC1B,YAAY,CAAC,GAAG,EAAE;AAAA;AAAA,MAElB,cAAc;AAAA,MACd,WAAW;AAAA,MACX,SAAS;AAAA,QACP,SAAS;AAAA,MACX;AAAA,MACA,OAAO;AAAA,QACL,MAAM;AAAA,QACN,UAAU;AAAA,QACV,UAAU;AAAA,MACZ;AAAA,MACA,WAAW;AAAA,QACT,MAAM;AAAA,MACR;AAAA,MACA,UAAU;AAAA,QACR,OAAO;AAAA,UACL,MAAM;AAAA,QACR;AAAA,QACA,WAAW;AAAA,UACT,OAAO;AAAA,QACT;AAAA,MACF;AAAA,MACA,iBAAiB;AAAA,IACnB;AACA,WAAOA;AAAA,EACT,EAAE,mBAAW;AAAA;AACb,IAAO,wBAAQ;;;AC/Bf,IAAI,QAAQ,UAAU;AACtB,IAAI,oBAAoB,SAAU,aAAa,UAAU,SAAS,MAAM;AACtE,MAAI,OAAO,YAAY,QAAQ;AAC/B,MAAI;AACJ,MAAI,CAAC,QAAQ,IAAI,GAAG;AAElB,QAAI,SAAS,KAAK;AAClB,QAAI,WAAW,SAAS,WAAW,SAAS,WAAW,aAAa,WAAW,YAK5E,KAAK,SAAS,QAAQ,KAAK,SAAS,MAAM;AAC3C,UAAI,YAAY;AAChB,UAAI,QAAQ;AACZ,UAAI,KAAK,SAAS,QAAQ,KAAK,SAAS,MAAM;AAC5C,oBAAY,SAAS,QAAQ,KAAK,SAAS,OAAO,MAAM,GAAG;AAC3D,gBAAQ,SAAS,KAAK,OAAO,KAAK,KAAK;AAAA,MACzC,OAAO;AACL,YAAI,WAAwB,YAAY,MAAM,MAAM,UAAU,WAAW;AACzE,oBAAY,SAAS;AACrB,YAAI,eAAe,oBAAoB,MAAM,SAAS,YAAY;AAClE,gBAAqB,aAAa,MAAM,cAAc,MAAM;AAAA,MAC9D;AACA,UAAI,aAAa,UAAU,QAAQ,MAAM,IAAI;AAC7C,UAAI,YAAY,IAAI;AAEpB,UAAI,SAAS,MAAM,IAAI;AACvB,UAAI,OAAO;AAAA,QACT,OAAO,CAAC;AAAA,MACV;AACA,aAAO,OAAO;AACd,aAAO,QAAQ,CAAC;AAChB,aAAO,MAAM,SAAS,IAAI;AAC1B,WAAK,MAAM,SAAS,IAAI;AACxB,UAAI,YAAY,QAAQ,IAAI,WAAW;AACvC,UAAI,aAAa,KAAK,SAAS,KAAK,GAAG;AACrC,gBAAQ,CAAC,MAAM,QAAQ,KAAK,IAAI,WAAW,EAAE,CAAC;AAAA,MAChD;AACA,aAAO,MAAM,UAAU,IAAI,KAAK,MAAM,UAAU,IAAI;AACpD,kBAAY,CAAC,QAAQ,MAAM;AAAA,QACzB,MAAM;AAAA,QACN,YAAY,KAAK;AAAA;AAAA,QAEjB;AAAA,MACF,CAAC;AAAA,IACH,OAAO;AAEL,UAAI,MAAuC;AACzC,iBAAS,wBAAwB;AAAA,MACnC;AACA,kBAAY,CAAC;AAAA,IACf;AAAA,EACF,OAAO;AACL,gBAAY;AAAA,EACd;AACA,MAAI,iBAAiB,CAAc,cAAc,aAAa,UAAU,CAAC,CAAC,GAAgB,cAAc,aAAa,UAAU,CAAC,CAAC,GAAG,OAAO,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC;AAE5J,iBAAe,CAAC,EAAE,OAAO,eAAe,CAAC,EAAE,QAAQ;AAEnD,QAAM,eAAe,CAAC,GAAG,eAAe,CAAC,CAAC;AAC1C,QAAM,eAAe,CAAC,GAAG,eAAe,CAAC,CAAC;AAC1C,SAAO;AACT;AACA,SAAS,WAAW,KAAK;AACvB,SAAO,CAAC,MAAM,GAAG,KAAK,CAAC,SAAS,GAAG;AACrC;AAEA,SAAS,qBAAqB,UAAU,WAAW,SAAS,UAAU;AACpE,MAAI,gBAAgB,IAAI;AACxB,MAAI,UAAU,SAAS,WAAW,QAAQ;AAC1C,SAAO,WAAW,UAAU,aAAa,CAAC,KAAK,WAAW,QAAQ,aAAa,CAAC,KAAK,UAAU,QAAQ,MAAM,QAAQ,QAAQ,KAAK,SAAS,QAAQ,OAAO,EAAE,YAAY,UAAU,QAAQ,CAAC;AAC7L;AACA,SAAS,eAAe,UAAU,MAAM;AACtC,MAAI,SAAS,SAAS,eAAe;AACnC,QAAI,YAAY,KAAK,CAAC,EAAE;AACxB,QAAI,UAAU,KAAK,CAAC,EAAE;AAOtB,QAAI,aAAa,YAAY,qBAAqB,GAAG,WAAW,SAAS,QAAQ,KAAK,qBAAqB,GAAG,WAAW,SAAS,QAAQ,IAAI;AAC5I,aAAO;AAAA,IACT;AAAA,EACF;AACA,SAAoB,WAAW,UAAU,KAAK,CAAC,CAAC,KAAkB,WAAW,UAAU,KAAK,CAAC,CAAC;AAChG;AACA,SAAS,4BAA4B,MAAM,KAAK,QAAQ,aAAa,KAAK;AACxE,MAAI,WAAW,YAAY;AAC3B,MAAI,YAAY,KAAK,aAAa,GAAG;AACrC,MAAI;AACJ,MAAI,MAAiB,aAAa,UAAU,IAAI,GAAG,GAAG,IAAI,SAAS,CAAC;AACpE,MAAI,MAAiB,aAAa,UAAU,IAAI,GAAG,GAAG,IAAI,UAAU,CAAC;AACrE,MAAI,CAAC,MAAM,GAAG,KAAK,CAAC,MAAM,GAAG,GAAG;AAC9B,YAAQ,CAAC,KAAK,GAAG;AAAA,EACnB,OAAO;AAEL,QAAI,YAAY,mBAAmB;AAEjC,cAAQ,YAAY,kBAAkB,KAAK,UAAU,KAAK,YAAY,GAAG,CAAC;AAAA,IAC5E,OAAO;AACL,UAAI,OAAO,SAAS;AACpB,UAAI,IAAI,KAAK,IAAI,KAAK,CAAC,GAAG,GAAG;AAC7B,UAAI,IAAI,KAAK,IAAI,KAAK,CAAC,GAAG,GAAG;AAC7B,cAAQ,SAAS,YAAY,CAAC,GAAG,CAAC,CAAC;AAAA,IACrC;AAUA,QAAI,uBAAuB,UAAU,aAAa,GAAG;AAEnD,UAAI,QAAQ,SAAS,QAAQ,GAAG;AAChC,UAAI,QAAQ,SAAS,QAAQ,GAAG;AAChC,UAAI,OAAO,SAAS;AACpB,UAAI,WAAW,KAAK,IAAI,KAAK,CAAC,GAAG,GAAG,CAAC,GAAG;AACtC,cAAM,CAAC,IAAI,MAAM,cAAc,MAAM,UAAU,EAAE,SAAS,IAAI,CAAC,CAAC;AAAA,MAClE,WAAW,WAAW,KAAK,IAAI,KAAK,CAAC,GAAG,GAAG,CAAC,GAAG;AAC7C,cAAM,CAAC,IAAI,MAAM,cAAc,MAAM,UAAU,EAAE,SAAS,IAAI,CAAC,CAAC;AAAA,MAClE;AAAA,IACF;AAEA,QAAI,CAAC,MAAM,GAAG,GAAG;AACf,YAAM,CAAC,IAAI;AAAA,IACb;AACA,QAAI,CAAC,MAAM,GAAG,GAAG;AACf,YAAM,CAAC,IAAI;AAAA,IACb;AAAA,EACF;AACA,OAAK,cAAc,KAAK,KAAK;AAC/B;AACA,IAAI;AAAA;AAAA,EAA4B,SAAU,QAAQ;AAChD,cAAUC,eAAc,MAAM;AAC9B,aAASA,gBAAe;AACtB,UAAI,QAAQ,WAAW,QAAQ,OAAO,MAAM,MAAM,SAAS,KAAK;AAChE,YAAM,OAAOA,cAAa;AAC1B,aAAO;AAAA,IACT;AACA,IAAAA,cAAa,UAAU,kBAAkB,SAAU,eAAe,SAAS,KAAK;AAC9E,cAAQ,WAAW,SAAU,aAAa;AACxC,YAAI,UAAU,oBAAY,yBAAyB,aAAa,UAAU;AAC1E,YAAI,SAAS;AACX,cAAI,WAAW,QAAQ,QAAQ;AAC/B,cAAI,aAAa,MAAM,OAAO,EAAE;AAChC,cAAI,WAAW,MAAM,OAAO,EAAE;AAE9B,qBAAW,KAAK,SAAU,KAAK;AAC7B,wCAA4B,YAAY,KAAK,MAAM,aAAa,GAAG;AACnE,wCAA4B,UAAU,KAAK,OAAO,aAAa,GAAG;AAAA,UACpE,CAAC;AAED,mBAAS,KAAK,SAAU,KAAK;AAC3B,qBAAS,cAAc,KAAK,CAAC,WAAW,cAAc,GAAG,GAAG,SAAS,cAAc,GAAG,CAAC,CAAC;AAAA,UAC1F,CAAC;AACD,eAAK,eAAe,IAAI,YAAY,EAAE,EAAE,aAAa;AAAA,QACvD;AAAA,MACF,GAAG,IAAI;AAAA,IACT;AACA,IAAAA,cAAa,UAAU,eAAe,SAAU,aAAa,SAAS,SAAS,KAAK;AAClF,UAAI,WAAW,YAAY;AAC3B,UAAI,WAAW,YAAY;AAC3B,UAAI,aAAa,YAAY,QAAQ;AACrC,UAAI,cAAc,KAAK;AACvB,UAAI,WAAW,YAAY,IAAI,QAAQ,KAAK,YAAY,IAAI,UAAU,IAAI,iBAAS,CAAC;AACpF,WAAK,MAAM,IAAI,SAAS,KAAK;AAC7B,UAAI,SAAS,WAAW,UAAU,aAAa,OAAO;AACtD,UAAI,WAAW,OAAO;AACtB,UAAI,SAAS,OAAO;AACpB,UAAI,WAAW,OAAO;AACtB,YAAM,OAAO,EAAE,OAAO;AACtB,YAAM,OAAO,EAAE,KAAK;AAEpB,cAAQ,QAAQ,QAAQ;AAKxB,UAAI,aAAa,QAAQ,IAAI,QAAQ;AACrC,UAAI,aAAa,QAAQ,IAAI,YAAY;AACzC,UAAI,eAAe,QAAQ,IAAI,cAAc;AAC7C,UAAI,eAAe,QAAQ,IAAI,cAAc;AAE7C,UAAI,CAAC,QAAQ,UAAU,GAAG;AACxB,qBAAa,CAAC,YAAY,UAAU;AAAA,MACtC;AACA,UAAI,CAAC,QAAQ,UAAU,GAAG;AACxB,qBAAa,CAAC,YAAY,UAAU;AAAA,MACtC;AACA,UAAI,CAAC,QAAQ,YAAY,GAAG;AAC1B,uBAAe,CAAC,cAAc,YAAY;AAAA,MAC5C;AACA,UAAI,CAAC,QAAQ,YAAY,GAAG;AAC1B,uBAAe,CAAC,cAAc,YAAY;AAAA,MAC5C;AAEA,aAAO,KAAK,KAAK,SAAU,KAAK;AAC9B,kCAA0B,UAAU,KAAK,IAAI;AAC7C,kCAA0B,QAAQ,KAAK,KAAK;AAAA,MAC9C,CAAC;AAED,eAAS,KAAK,SAAU,KAAK;AAC3B,YAAI,YAAY,SAAS,aAAa,GAAG,EAAE,SAAS,WAAW,EAAE,aAAa;AAI9E,iBAAS,cAAc,KAAK,CAAC,SAAS,cAAc,GAAG,GAAG,OAAO,cAAc,GAAG,CAAC,CAAC;AACpF,YAAI,UAAU,UAAU,MAAM;AAC5B,oBAAU,SAAS,SAAS,cAAc,KAAK,OAAO,EAAE;AAAA,QAC1D;AACA,iBAAS,cAAc,KAAK;AAAA,UAC1B,sBAAsB,SAAS,cAAc,KAAK,kBAAkB;AAAA,UACpE,kBAAkB,SAAS,cAAc,KAAK,cAAc;AAAA,UAC5D,kBAAkB,SAAS,cAAc,KAAK,cAAc;AAAA,UAC5D,gBAAgB,SAAS,cAAc,KAAK,YAAY;AAAA,UACxD,YAAY,SAAS,cAAc,KAAK,QAAQ;AAAA,UAChD,oBAAoB,OAAO,cAAc,KAAK,kBAAkB;AAAA,UAChE,gBAAgB,OAAO,cAAc,KAAK,cAAc;AAAA,UACxD,gBAAgB,OAAO,cAAc,KAAK,cAAc;AAAA,UACxD,cAAc,OAAO,cAAc,KAAK,YAAY;AAAA,UACpD,UAAU,OAAO,cAAc,KAAK,QAAQ;AAAA,UAC5C,OAAO;AAAA,QACT,CAAC;AAAA,MACH,CAAC;AACD,eAAS,WAAW,QAAQ;AAG5B,aAAO,KAAK,kBAAkB,SAAU,IAAI;AAC1C,kBAAU,EAAE,EAAE,YAAY;AAC1B,WAAG,SAAS,SAAU,OAAO;AAC3B,oBAAU,KAAK,EAAE,YAAY;AAAA,QAC/B,CAAC;AAAA,MACH,CAAC;AACD,eAAS,0BAA0B,MAAM,KAAK,QAAQ;AACpD,YAAI,YAAY,KAAK,aAAa,GAAG;AACrC,oCAA4B,MAAM,KAAK,QAAQ,aAAa,GAAG;AAC/D,YAAI,QAAQ,UAAU,SAAS,WAAW,EAAE,aAAa;AACzD,YAAI,MAAM,QAAQ,MAAM;AACtB,gBAAM,OAAO,kBAAkB,YAAY,OAAO;AAAA,QACpD;AACA,aAAK,cAAc,KAAK;AAAA,UACtB,kBAAkB,UAAU,IAAI,kBAAkB;AAAA;AAAA,UAElD,cAAc,UAAU,UAAU,IAAI,gBAAgB,IAAI,GAAG,aAAa,SAAS,IAAI,CAAC,CAAC;AAAA,UACzF,cAAc,UAAU,UAAU,IAAI,gBAAgB,IAAI,GAAG,aAAa,SAAS,IAAI,CAAC,CAAC;AAAA;AAAA,UAEzF,YAAY,UAAU,UAAU,IAAI,YAAY,GAAG,WAAW,SAAS,IAAI,CAAC,CAAC;AAAA,UAC7E,QAAQ,UAAU,UAAU,IAAI,UAAU,IAAI,GAAG,WAAW,SAAS,IAAI,CAAC,CAAC;AAAA,UAC3E;AAAA,QACF,CAAC;AAAA,MACH;AACA,WAAK,SAAS,QAAQ;AACtB,eAAS,MAAM,SAAS,QAAQ,IAAI,QAAQ,KAAK,YAAY,IAAI,QAAQ;AAAA,IAC3E;AACA,IAAAA,cAAa,OAAO;AACpB,WAAOA;AAAA,EACT,EAAE,kBAAU;AAAA;AACZ,SAAS,WAAW,UAAU,aAAa,SAAS;AAClD,MAAI;AACJ,MAAI,UAAU;AACZ,qBAAiB,IAAI,YAAY,SAAS,YAAY,SAAU,UAAU;AACxE,UAAI,OAAO,YAAY,QAAQ,EAAE,iBAAiB,YAAY,QAAQ,EAAE,aAAa,QAAQ,CAAC,KAAK,CAAC;AAEpG,aAAO,OAAO,OAAO,CAAC,GAAG,IAAI,GAAG;AAAA,QAC9B,MAAM;AAAA;AAAA,QAEN,aAAa;AAAA,MACf,CAAC;AAAA,IACH,CAAC;AAAA,EACH,OAAO;AACL,qBAAiB,CAAC;AAAA,MAChB,MAAM;AAAA,MACN,MAAM;AAAA,IACR,CAAC;AAAA,EACH;AACA,MAAI,WAAW,IAAI,mBAAW,gBAAgB,OAAO;AACrD,MAAI,SAAS,IAAI,mBAAW,gBAAgB,OAAO;AAEnD,MAAI,WAAW,IAAI,mBAAW,CAAC,GAAG,OAAO;AACzC,MAAI,UAAU,IAAI,QAAQ,IAAI,MAAM,GAAG,MAAM,mBAAmB,aAAa,UAAU,OAAO,CAAC;AAC/F,MAAI,UAAU;AACZ,cAAU,OAAO,SAAS,MAAM,gBAAgB,QAAQ,CAAC;AAAA,EAC3D;AACA,MAAI,iBAA8B,2BAA2B,CAAC,CAAC,UAAU,cAAc;AACvF,WAAS,SAAS,IAAI,SAAS,SAAU,MAAM;AAC7C,WAAO,KAAK,CAAC;AAAA,EACf,CAAC,GAAG,MAAM,cAAc;AACxB,SAAO,SAAS,IAAI,SAAS,SAAU,MAAM;AAC3C,WAAO,KAAK,CAAC;AAAA,EACf,CAAC,GAAG,MAAM,cAAc;AACxB,WAAS,SAAS,IAAI,SAAS,SAAU,MAAM;AAC7C,WAAO,KAAK,CAAC;AAAA,EACf,CAAC,CAAC;AACF,WAAS,gBAAgB;AACzB,SAAO;AAAA,IACL,MAAM;AAAA,IACN,IAAI;AAAA,IACJ,MAAM;AAAA,EACR;AACF;AACA,IAAO,uBAAQ;;;AC9UR,SAAS,QAAQ,WAAW;AACjC,YAAU,uBAAuB,qBAAa;AAC9C,YAAU,sBAAsB,oBAAY;AAC5C,YAAU,qBAAqB,SAAU,KAAK;AAC5C,QAAI,oBAAoB,IAAI,QAAQ,UAAU,GAAG;AAE/C,UAAI,WAAW,IAAI,YAAY,CAAC;AAAA,IAClC;AAAA,EACF,CAAC;AACH;", - "names": ["MarkLineModel", "MarkLineView"] -} diff --git a/node_modules/.vite/deps/chunk-7TL3JRAD.js b/node_modules/.vite/deps/chunk-7TL3JRAD.js deleted file mode 100644 index 834c9bf7..00000000 --- a/node_modules/.vite/deps/chunk-7TL3JRAD.js +++ /dev/null @@ -1,12937 +0,0 @@ -import { - asBounds, - asTRBL, - getBBox, - getMid, - getType, - isFrameElement, - isLabel -} from "./chunk-T4R4535C.js"; -import { - isEventSubProcess, - isExpanded, - isHorizontal -} from "./chunk-7C6J56BH.js"; -import { - append, - attr as attr2, - classes as classes2, - clear as clear2, - create, - createMatrix, - createTransform, - e, - index_esm_default, - innerSVG, - remove as remove2, - transform -} from "./chunk-J6RTEKLL.js"; -import { - all, - assign as assign2, - attr, - classes, - clear, - delegate, - domify$1, - event, - query, - remove -} from "./chunk-PBO22ZEO.js"; -import { - getBusinessObject, - getDi, - is, - isAny -} from "./chunk-FNF472WR.js"; -import { - assign, - bind, - debounce, - every, - filter, - find, - findIndex, - forEach, - has, - isArray, - isDefined, - isFunction, - isNumber, - isObject, - isString, - map, - matchPattern, - omit, - pick, - reduce, - set, - some -} from "./chunk-YTJ5ESGD.js"; - -// node_modules/.pnpm/diagram-js@14.11.3/node_modules/diagram-js/lib/draw/BaseRenderer.js -var DEFAULT_RENDER_PRIORITY = 1e3; -function BaseRenderer(eventBus, renderPriority) { - var self = this; - renderPriority = renderPriority || DEFAULT_RENDER_PRIORITY; - eventBus.on(["render.shape", "render.connection"], renderPriority, function(evt, context) { - var type = evt.type, element = context.element, visuals = context.gfx, attrs = context.attrs; - if (self.canRender(element)) { - if (type === "render.shape") { - return self.drawShape(visuals, element, attrs); - } else { - return self.drawConnection(visuals, element, attrs); - } - } - }); - eventBus.on(["render.getShapePath", "render.getConnectionPath"], renderPriority, function(evt, element) { - if (self.canRender(element)) { - if (evt.type === "render.getShapePath") { - return self.getShapePath(element); - } else { - return self.getConnectionPath(element); - } - } - }); -} -BaseRenderer.prototype.canRender = function(element) { -}; -BaseRenderer.prototype.drawShape = function(visuals, shape) { -}; -BaseRenderer.prototype.drawConnection = function(visuals, connection) { -}; -BaseRenderer.prototype.getShapePath = function(shape) { -}; -BaseRenderer.prototype.getConnectionPath = function(connection) { -}; - -// node_modules/.pnpm/bpmn-js@17.11.1/node_modules/bpmn-js/lib/util/LabelUtil.js -var DEFAULT_LABEL_SIZE = { - width: 90, - height: 20 -}; -var FLOW_LABEL_INDENT = 15; -function isLabelExternal(semantic) { - return is(semantic, "bpmn:Event") || is(semantic, "bpmn:Gateway") || is(semantic, "bpmn:DataStoreReference") || is(semantic, "bpmn:DataObjectReference") || is(semantic, "bpmn:DataInput") || is(semantic, "bpmn:DataOutput") || is(semantic, "bpmn:SequenceFlow") || is(semantic, "bpmn:MessageFlow") || is(semantic, "bpmn:Group"); -} -function hasExternalLabel(element) { - return isLabel(element.label); -} -function getFlowLabelPosition(waypoints) { - var mid = waypoints.length / 2 - 1; - var first = waypoints[Math.floor(mid)]; - var second = waypoints[Math.ceil(mid + 0.01)]; - var position = getWaypointsMid(waypoints); - var angle = Math.atan((second.y - first.y) / (second.x - first.x)); - var x = position.x, y = position.y; - if (Math.abs(angle) < Math.PI / 2) { - y -= FLOW_LABEL_INDENT; - } else { - x += FLOW_LABEL_INDENT; - } - return { x, y }; -} -function getWaypointsMid(waypoints) { - var mid = waypoints.length / 2 - 1; - var first = waypoints[Math.floor(mid)]; - var second = waypoints[Math.ceil(mid + 0.01)]; - return { - x: first.x + (second.x - first.x) / 2, - y: first.y + (second.y - first.y) / 2 - }; -} -function getExternalLabelMid(element) { - if (element.waypoints) { - return getFlowLabelPosition(element.waypoints); - } else if (is(element, "bpmn:Group")) { - return { - x: element.x + element.width / 2, - y: element.y + DEFAULT_LABEL_SIZE.height / 2 - }; - } else { - return { - x: element.x + element.width / 2, - y: element.y + element.height + DEFAULT_LABEL_SIZE.height / 2 - }; - } -} -function getExternalLabelBounds(di, element) { - var mid, size, bounds, label = di.label; - if (label && label.bounds) { - bounds = label.bounds; - size = { - width: Math.max(DEFAULT_LABEL_SIZE.width, bounds.width), - height: bounds.height - }; - mid = { - x: bounds.x + bounds.width / 2, - y: bounds.y + bounds.height / 2 - }; - } else { - mid = getExternalLabelMid(element); - size = DEFAULT_LABEL_SIZE; - } - return assign({ - x: mid.x - size.width / 2, - y: mid.y - size.height / 2 - }, size); -} -function getLabelAttr(semantic) { - if (is(semantic, "bpmn:FlowElement") || is(semantic, "bpmn:Participant") || is(semantic, "bpmn:Lane") || is(semantic, "bpmn:SequenceFlow") || is(semantic, "bpmn:MessageFlow") || is(semantic, "bpmn:DataInput") || is(semantic, "bpmn:DataOutput")) { - return "name"; - } - if (is(semantic, "bpmn:TextAnnotation")) { - return "text"; - } - if (is(semantic, "bpmn:Group")) { - return "categoryValueRef"; - } -} -function getCategoryValue(semantic) { - var categoryValueRef = semantic["categoryValueRef"]; - if (!categoryValueRef) { - return ""; - } - return categoryValueRef.value || ""; -} -function getLabel(element) { - var semantic = element.businessObject, attr3 = getLabelAttr(semantic); - if (attr3) { - if (attr3 === "categoryValueRef") { - return getCategoryValue(semantic); - } - return semantic[attr3] || ""; - } -} -function setLabel(element, text) { - var semantic = element.businessObject, attr3 = getLabelAttr(semantic); - if (attr3) { - if (attr3 === "categoryValueRef") { - semantic["categoryValueRef"].value = text; - } else { - semantic[attr3] = text; - } - } - return element; -} - -// node_modules/.pnpm/diagram-js@14.11.3/node_modules/diagram-js/lib/util/RenderUtil.js -function componentsToPath(elements) { - return elements.flat().join(",").replace(/,?([A-z]),?/g, "$1"); -} -function move(point) { - return ["M", point.x, point.y]; -} -function lineTo(point) { - return ["L", point.x, point.y]; -} -function curveTo(p1, p2, p3) { - return ["C", p1.x, p1.y, p2.x, p2.y, p3.x, p3.y]; -} -function drawPath(waypoints, cornerRadius) { - const pointCount = waypoints.length; - const path = [move(waypoints[0])]; - for (let i = 1; i < pointCount; i++) { - const pointBefore = waypoints[i - 1]; - const point = waypoints[i]; - const pointAfter = waypoints[i + 1]; - if (!pointAfter || !cornerRadius) { - path.push(lineTo(point)); - continue; - } - const effectiveRadius = Math.min( - cornerRadius, - vectorLength(point.x - pointBefore.x, point.y - pointBefore.y), - vectorLength(pointAfter.x - point.x, pointAfter.y - point.y) - ); - if (!effectiveRadius) { - path.push(lineTo(point)); - continue; - } - const beforePoint = getPointAtLength(point, pointBefore, effectiveRadius); - const beforePoint2 = getPointAtLength(point, pointBefore, effectiveRadius * 0.5); - const afterPoint = getPointAtLength(point, pointAfter, effectiveRadius); - const afterPoint2 = getPointAtLength(point, pointAfter, effectiveRadius * 0.5); - path.push(lineTo(beforePoint)); - path.push(curveTo(beforePoint2, afterPoint2, afterPoint)); - } - return path; -} -function getPointAtLength(start, end, length) { - const deltaX = end.x - start.x; - const deltaY = end.y - start.y; - const totalLength = vectorLength(deltaX, deltaY); - const percent = length / totalLength; - return { - x: start.x + deltaX * percent, - y: start.y + deltaY * percent - }; -} -function vectorLength(x, y) { - return Math.sqrt(Math.pow(x, 2) + Math.pow(y, 2)); -} -function createLine(points, attrs, radius) { - if (isNumber(attrs)) { - radius = attrs; - attrs = null; - } - if (!attrs) { - attrs = {}; - } - const line = create("path", attrs); - if (isNumber(radius)) { - line.dataset.cornerRadius = String(radius); - } - return updateLine(line, points); -} -function updateLine(gfx, points) { - const cornerRadius = parseInt(gfx.dataset.cornerRadius, 10) || 0; - attr2(gfx, { - d: componentsToPath(drawPath(points, cornerRadius)) - }); - return gfx; -} - -// node_modules/.pnpm/bpmn-js@17.11.1/node_modules/bpmn-js/lib/draw/BpmnRenderUtil.js -var black = "hsl(225, 10%, 15%)"; -var white = "white"; -function isTypedEvent(event2, eventDefinitionType) { - return some(event2.eventDefinitions, function(definition) { - return definition.$type === eventDefinitionType; - }); -} -function isThrowEvent(event2) { - return event2.$type === "bpmn:IntermediateThrowEvent" || event2.$type === "bpmn:EndEvent"; -} -function isCollection(element) { - var dataObject = element.dataObjectRef; - return element.isCollection || dataObject && dataObject.isCollection; -} -function getFillColor(element, defaultColor, overrideColor) { - var di = getDi(element); - return overrideColor || di.get("color:background-color") || di.get("bioc:fill") || defaultColor || white; -} -function getStrokeColor(element, defaultColor, overrideColor) { - var di = getDi(element); - return overrideColor || di.get("color:border-color") || di.get("bioc:stroke") || defaultColor || black; -} -function getLabelColor(element, defaultColor, defaultStrokeColor, overrideColor) { - var di = getDi(element), label = di.get("label"); - return overrideColor || label && label.get("color:color") || defaultColor || getStrokeColor(element, defaultStrokeColor); -} -function getCirclePath(shape) { - var cx = shape.x + shape.width / 2, cy = shape.y + shape.height / 2, radius = shape.width / 2; - var circlePath = [ - ["M", cx, cy], - ["m", 0, -radius], - ["a", radius, radius, 0, 1, 1, 0, 2 * radius], - ["a", radius, radius, 0, 1, 1, 0, -2 * radius], - ["z"] - ]; - return componentsToPath(circlePath); -} -function getRoundRectPath(shape, borderRadius) { - var x = shape.x, y = shape.y, width = shape.width, height = shape.height; - var roundRectPath = [ - ["M", x + borderRadius, y], - ["l", width - borderRadius * 2, 0], - ["a", borderRadius, borderRadius, 0, 0, 1, borderRadius, borderRadius], - ["l", 0, height - borderRadius * 2], - ["a", borderRadius, borderRadius, 0, 0, 1, -borderRadius, borderRadius], - ["l", borderRadius * 2 - width, 0], - ["a", borderRadius, borderRadius, 0, 0, 1, -borderRadius, -borderRadius], - ["l", 0, borderRadius * 2 - height], - ["a", borderRadius, borderRadius, 0, 0, 1, borderRadius, -borderRadius], - ["z"] - ]; - return componentsToPath(roundRectPath); -} -function getDiamondPath(shape) { - var width = shape.width, height = shape.height, x = shape.x, y = shape.y, halfWidth = width / 2, halfHeight = height / 2; - var diamondPath = [ - ["M", x + halfWidth, y], - ["l", halfWidth, halfHeight], - ["l", -halfWidth, halfHeight], - ["l", -halfWidth, -halfHeight], - ["z"] - ]; - return componentsToPath(diamondPath); -} -function getRectPath(shape) { - var x = shape.x, y = shape.y, width = shape.width, height = shape.height; - var rectPath = [ - ["M", x, y], - ["l", width, 0], - ["l", 0, height], - ["l", -width, 0], - ["z"] - ]; - return componentsToPath(rectPath); -} -function getBounds(bounds, overrides = {}) { - return { - width: getWidth(bounds, overrides), - height: getHeight(bounds, overrides) - }; -} -function getWidth(bounds, overrides = {}) { - return has(overrides, "width") ? overrides.width : bounds.width; -} -function getHeight(bounds, overrides = {}) { - return has(overrides, "height") ? overrides.height : bounds.height; -} - -// node_modules/.pnpm/diagram-js@14.11.3/node_modules/diagram-js/lib/util/SvgTransformUtil.js -function transform2(gfx, x, y, angle, amount) { - var translate3 = createTransform(); - translate3.setTranslate(x, y); - var rotate2 = createTransform(); - rotate2.setRotate(angle || 0, 0, 0); - var scale = createTransform(); - scale.setScale(amount || 1, amount || 1); - transform(gfx, [translate3, rotate2, scale]); -} -function translate(gfx, x, y) { - var translate3 = createTransform(); - translate3.setTranslate(x, y); - transform(gfx, translate3); -} -function rotate(gfx, angle) { - var rotate2 = createTransform(); - rotate2.setRotate(angle, 0, 0); - transform(gfx, rotate2); -} - -// node_modules/.pnpm/bpmn-js@17.11.1/node_modules/bpmn-js/lib/draw/BpmnRenderer.js -var markerIds = new index_esm_default(); -var ELEMENT_LABEL_DISTANCE = 10; -var INNER_OUTER_DIST = 3; -var PARTICIPANT_STROKE_WIDTH = 1.5; -var TASK_BORDER_RADIUS = 10; -var DEFAULT_OPACITY = 0.95; -var FULL_OPACITY = 1; -var LOW_OPACITY = 0.25; -function BpmnRenderer(config, eventBus, styles, pathMap, canvas, textRenderer, priority) { - BaseRenderer.call(this, eventBus, priority); - var defaultFillColor = config && config.defaultFillColor, defaultStrokeColor = config && config.defaultStrokeColor, defaultLabelColor = config && config.defaultLabelColor; - function shapeStyle(attrs) { - return styles.computeStyle(attrs, { - strokeLinecap: "round", - strokeLinejoin: "round", - stroke: black, - strokeWidth: 2, - fill: "white" - }); - } - function lineStyle(attrs) { - return styles.computeStyle(attrs, ["no-fill"], { - strokeLinecap: "round", - strokeLinejoin: "round", - stroke: black, - strokeWidth: 2 - }); - } - function addMarker(id, options) { - var { - ref = { x: 0, y: 0 }, - scale = 1, - element, - parentGfx = canvas._svg - } = options; - var marker2 = create("marker", { - id, - viewBox: "0 0 20 20", - refX: ref.x, - refY: ref.y, - markerWidth: 20 * scale, - markerHeight: 20 * scale, - orient: "auto" - }); - append(marker2, element); - var defs = query(":scope > defs", parentGfx); - if (!defs) { - defs = create("defs"); - append(parentGfx, defs); - } - append(defs, marker2); - } - function marker(parentGfx, type, fill, stroke) { - var id = markerIds.nextPrefixed("marker-"); - createMarker(parentGfx, id, type, fill, stroke); - return "url(#" + id + ")"; - } - function createMarker(parentGfx, id, type, fill, stroke) { - if (type === "sequenceflow-end") { - var sequenceflowEnd = create("path", { - d: "M 1 5 L 11 10 L 1 15 Z", - ...shapeStyle({ - fill: stroke, - stroke, - strokeWidth: 1 - }) - }); - addMarker(id, { - element: sequenceflowEnd, - ref: { x: 11, y: 10 }, - scale: 0.5, - parentGfx - }); - } - if (type === "messageflow-start") { - var messageflowStart = create("circle", { - cx: 6, - cy: 6, - r: 3.5, - ...shapeStyle({ - fill, - stroke, - strokeWidth: 1, - // fix for safari / chrome / firefox bug not correctly - // resetting stroke dash array - strokeDasharray: [1e4, 1] - }) - }); - addMarker(id, { - element: messageflowStart, - ref: { x: 6, y: 6 }, - parentGfx - }); - } - if (type === "messageflow-end") { - var messageflowEnd = create("path", { - d: "m 1 5 l 0 -3 l 7 3 l -7 3 z", - ...shapeStyle({ - fill, - stroke, - strokeWidth: 1, - // fix for safari / chrome / firefox bug not correctly - // resetting stroke dash array - strokeDasharray: [1e4, 1] - }) - }); - addMarker(id, { - element: messageflowEnd, - ref: { x: 8.5, y: 5 }, - parentGfx - }); - } - if (type === "association-start") { - var associationStart = create("path", { - d: "M 11 5 L 1 10 L 11 15", - ...lineStyle({ - fill: "none", - stroke, - strokeWidth: 1.5, - // fix for safari / chrome / firefox bug not correctly - // resetting stroke dash array - strokeDasharray: [1e4, 1] - }) - }); - addMarker(id, { - element: associationStart, - ref: { x: 1, y: 10 }, - scale: 0.5, - parentGfx - }); - } - if (type === "association-end") { - var associationEnd = create("path", { - d: "M 1 5 L 11 10 L 1 15", - ...lineStyle({ - fill: "none", - stroke, - strokeWidth: 1.5, - // fix for safari / chrome / firefox bug not correctly - // resetting stroke dash array - strokeDasharray: [1e4, 1] - }) - }); - addMarker(id, { - element: associationEnd, - ref: { x: 11, y: 10 }, - scale: 0.5, - parentGfx - }); - } - if (type === "conditional-flow-marker") { - var conditionalFlowMarker = create("path", { - d: "M 0 10 L 8 6 L 16 10 L 8 14 Z", - ...shapeStyle({ - fill, - stroke - }) - }); - addMarker(id, { - element: conditionalFlowMarker, - ref: { x: -1, y: 10 }, - scale: 0.5, - parentGfx - }); - } - if (type === "conditional-default-flow-marker") { - var defaultFlowMarker = create("path", { - d: "M 6 4 L 10 16", - ...shapeStyle({ - stroke, - fill: "none" - }) - }); - addMarker(id, { - element: defaultFlowMarker, - ref: { x: 0, y: 10 }, - scale: 0.5, - parentGfx - }); - } - } - function drawCircle(parentGfx, width, height, offset, attrs = {}) { - if (isObject(offset)) { - attrs = offset; - offset = 0; - } - offset = offset || 0; - attrs = shapeStyle(attrs); - var cx = width / 2, cy = height / 2; - var circle = create("circle", { - cx, - cy, - r: Math.round((width + height) / 4 - offset), - ...attrs - }); - append(parentGfx, circle); - return circle; - } - function drawRect(parentGfx, width, height, r, offset, attrs) { - if (isObject(offset)) { - attrs = offset; - offset = 0; - } - offset = offset || 0; - attrs = shapeStyle(attrs); - var rect = create("rect", { - x: offset, - y: offset, - width: width - offset * 2, - height: height - offset * 2, - rx: r, - ry: r, - ...attrs - }); - append(parentGfx, rect); - return rect; - } - function drawDiamond(parentGfx, width, height, attrs) { - var x_2 = width / 2; - var y_2 = height / 2; - var points = [ - { x: x_2, y: 0 }, - { x: width, y: y_2 }, - { x: x_2, y: height }, - { x: 0, y: y_2 } - ]; - var pointsString = points.map(function(point) { - return point.x + "," + point.y; - }).join(" "); - attrs = shapeStyle(attrs); - var polygon = create("polygon", { - ...attrs, - points: pointsString - }); - append(parentGfx, polygon); - return polygon; - } - function drawLine(parentGfx, waypoints, attrs, radius) { - attrs = lineStyle(attrs); - var line = createLine(waypoints, attrs, radius); - append(parentGfx, line); - return line; - } - function drawConnectionSegments(parentGfx, waypoints, attrs) { - return drawLine(parentGfx, waypoints, attrs, 5); - } - function drawPath2(parentGfx, d, attrs) { - attrs = lineStyle(attrs); - var path = create("path", { - ...attrs, - d - }); - append(parentGfx, path); - return path; - } - function drawMarker(type, parentGfx, path, attrs) { - return drawPath2(parentGfx, path, assign({ "data-marker": type }, attrs)); - } - function renderer(type) { - return handlers[type]; - } - function as(type) { - return function(parentGfx, element, attrs) { - return renderer(type)(parentGfx, element, attrs); - }; - } - var eventIconRenderers = { - "bpmn:MessageEventDefinition": function(parentGfx, element, attrs = {}, isThrowing) { - var pathData = pathMap.getScaledPath("EVENT_MESSAGE", { - xScaleFactor: 0.9, - yScaleFactor: 0.9, - containerWidth: element.width, - containerHeight: element.height, - position: { - mx: 0.235, - my: 0.315 - } - }); - var fill = isThrowing ? getStrokeColor(element, defaultStrokeColor, attrs.stroke) : getFillColor(element, defaultFillColor, attrs.fill); - var stroke = isThrowing ? getFillColor(element, defaultFillColor, attrs.fill) : getStrokeColor(element, defaultStrokeColor, attrs.stroke); - var messagePath = drawPath2(parentGfx, pathData, { - fill, - stroke, - strokeWidth: 1 - }); - return messagePath; - }, - "bpmn:TimerEventDefinition": function(parentGfx, element, attrs = {}) { - var circle = drawCircle(parentGfx, element.width, element.height, 0.2 * element.height, { - fill: getFillColor(element, defaultFillColor, attrs.fill), - stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke), - strokeWidth: 2 - }); - var pathData = pathMap.getScaledPath("EVENT_TIMER_WH", { - xScaleFactor: 0.75, - yScaleFactor: 0.75, - containerWidth: element.width, - containerHeight: element.height, - position: { - mx: 0.5, - my: 0.5 - } - }); - drawPath2(parentGfx, pathData, { - stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke), - strokeWidth: 2 - }); - for (var i = 0; i < 12; i++) { - var linePathData = pathMap.getScaledPath("EVENT_TIMER_LINE", { - xScaleFactor: 0.75, - yScaleFactor: 0.75, - containerWidth: element.width, - containerHeight: element.height, - position: { - mx: 0.5, - my: 0.5 - } - }); - var width = element.width / 2, height = element.height / 2; - drawPath2(parentGfx, linePathData, { - strokeWidth: 1, - stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke), - transform: "rotate(" + i * 30 + "," + height + "," + width + ")" - }); - } - return circle; - }, - "bpmn:EscalationEventDefinition": function(parentGfx, event2, attrs = {}, isThrowing) { - var pathData = pathMap.getScaledPath("EVENT_ESCALATION", { - xScaleFactor: 1, - yScaleFactor: 1, - containerWidth: event2.width, - containerHeight: event2.height, - position: { - mx: 0.5, - my: 0.2 - } - }); - var fill = isThrowing ? getStrokeColor(event2, defaultStrokeColor, attrs.stroke) : getFillColor(event2, defaultFillColor, attrs.fill); - return drawPath2(parentGfx, pathData, { - fill, - stroke: getStrokeColor(event2, defaultStrokeColor, attrs.stroke), - strokeWidth: 1 - }); - }, - "bpmn:ConditionalEventDefinition": function(parentGfx, event2, attrs = {}) { - var pathData = pathMap.getScaledPath("EVENT_CONDITIONAL", { - xScaleFactor: 1, - yScaleFactor: 1, - containerWidth: event2.width, - containerHeight: event2.height, - position: { - mx: 0.5, - my: 0.222 - } - }); - return drawPath2(parentGfx, pathData, { - fill: getFillColor(event2, defaultFillColor, attrs.fill), - stroke: getStrokeColor(event2, defaultStrokeColor, attrs.stroke), - strokeWidth: 1 - }); - }, - "bpmn:LinkEventDefinition": function(parentGfx, event2, attrs = {}, isThrowing) { - var pathData = pathMap.getScaledPath("EVENT_LINK", { - xScaleFactor: 1, - yScaleFactor: 1, - containerWidth: event2.width, - containerHeight: event2.height, - position: { - mx: 0.57, - my: 0.263 - } - }); - var fill = isThrowing ? getStrokeColor(event2, defaultStrokeColor, attrs.stroke) : getFillColor(event2, defaultFillColor, attrs.fill); - return drawPath2(parentGfx, pathData, { - fill, - stroke: getStrokeColor(event2, defaultStrokeColor, attrs.stroke), - strokeWidth: 1 - }); - }, - "bpmn:ErrorEventDefinition": function(parentGfx, event2, attrs = {}, isThrowing) { - var pathData = pathMap.getScaledPath("EVENT_ERROR", { - xScaleFactor: 1.1, - yScaleFactor: 1.1, - containerWidth: event2.width, - containerHeight: event2.height, - position: { - mx: 0.2, - my: 0.722 - } - }); - var fill = isThrowing ? getStrokeColor(event2, defaultStrokeColor, attrs.stroke) : getFillColor(event2, defaultFillColor, attrs.fill); - return drawPath2(parentGfx, pathData, { - fill, - stroke: getStrokeColor(event2, defaultStrokeColor, attrs.stroke), - strokeWidth: 1 - }); - }, - "bpmn:CancelEventDefinition": function(parentGfx, event2, attrs = {}, isThrowing) { - var pathData = pathMap.getScaledPath("EVENT_CANCEL_45", { - xScaleFactor: 1, - yScaleFactor: 1, - containerWidth: event2.width, - containerHeight: event2.height, - position: { - mx: 0.638, - my: -0.055 - } - }); - var fill = isThrowing ? getStrokeColor(event2, defaultStrokeColor, attrs.stroke) : "none"; - var path = drawPath2(parentGfx, pathData, { - fill, - stroke: getStrokeColor(event2, defaultStrokeColor, attrs.stroke), - strokeWidth: 1 - }); - rotate(path, 45); - return path; - }, - "bpmn:CompensateEventDefinition": function(parentGfx, event2, attrs = {}, isThrowing) { - var pathData = pathMap.getScaledPath("EVENT_COMPENSATION", { - xScaleFactor: 1, - yScaleFactor: 1, - containerWidth: event2.width, - containerHeight: event2.height, - position: { - mx: 0.22, - my: 0.5 - } - }); - var fill = isThrowing ? getStrokeColor(event2, defaultStrokeColor, attrs.stroke) : getFillColor(event2, defaultFillColor, attrs.fill); - return drawPath2(parentGfx, pathData, { - fill, - stroke: getStrokeColor(event2, defaultStrokeColor, attrs.stroke), - strokeWidth: 1 - }); - }, - "bpmn:SignalEventDefinition": function(parentGfx, event2, attrs = {}, isThrowing) { - var pathData = pathMap.getScaledPath("EVENT_SIGNAL", { - xScaleFactor: 0.9, - yScaleFactor: 0.9, - containerWidth: event2.width, - containerHeight: event2.height, - position: { - mx: 0.5, - my: 0.2 - } - }); - var fill = isThrowing ? getStrokeColor(event2, defaultStrokeColor, attrs.stroke) : getFillColor(event2, defaultFillColor, attrs.fill); - return drawPath2(parentGfx, pathData, { - strokeWidth: 1, - fill, - stroke: getStrokeColor(event2, defaultStrokeColor, attrs.stroke) - }); - }, - "bpmn:MultipleEventDefinition": function(parentGfx, event2, attrs = {}, isThrowing) { - var pathData = pathMap.getScaledPath("EVENT_MULTIPLE", { - xScaleFactor: 1.1, - yScaleFactor: 1.1, - containerWidth: event2.width, - containerHeight: event2.height, - position: { - mx: 0.222, - my: 0.36 - } - }); - var fill = isThrowing ? getStrokeColor(event2, defaultStrokeColor, attrs.stroke) : getFillColor(event2, defaultFillColor, attrs.fill); - return drawPath2(parentGfx, pathData, { - fill, - strokeWidth: 1 - }); - }, - "bpmn:ParallelMultipleEventDefinition": function(parentGfx, event2, attrs = {}) { - var pathData = pathMap.getScaledPath("EVENT_PARALLEL_MULTIPLE", { - xScaleFactor: 1.2, - yScaleFactor: 1.2, - containerWidth: event2.width, - containerHeight: event2.height, - position: { - mx: 0.458, - my: 0.194 - } - }); - return drawPath2(parentGfx, pathData, { - fill: getFillColor(event2, defaultFillColor, attrs.fill), - stroke: getStrokeColor(event2, defaultStrokeColor, attrs.stroke), - strokeWidth: 1 - }); - }, - "bpmn:TerminateEventDefinition": function(parentGfx, element, attrs = {}) { - var circle = drawCircle(parentGfx, element.width, element.height, 8, { - fill: getStrokeColor(element, defaultStrokeColor, attrs.stroke), - stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke), - strokeWidth: 4 - }); - return circle; - } - }; - function renderEventIcon(element, parentGfx, attrs = {}) { - var semantic = getBusinessObject(element), isThrowing = isThrowEvent(semantic); - if (semantic.get("eventDefinitions") && semantic.get("eventDefinitions").length > 1) { - if (semantic.get("parallelMultiple")) { - return eventIconRenderers["bpmn:ParallelMultipleEventDefinition"](parentGfx, element, attrs, isThrowing); - } else { - return eventIconRenderers["bpmn:MultipleEventDefinition"](parentGfx, element, attrs, isThrowing); - } - } - if (isTypedEvent(semantic, "bpmn:MessageEventDefinition")) { - return eventIconRenderers["bpmn:MessageEventDefinition"](parentGfx, element, attrs, isThrowing); - } - if (isTypedEvent(semantic, "bpmn:TimerEventDefinition")) { - return eventIconRenderers["bpmn:TimerEventDefinition"](parentGfx, element, attrs, isThrowing); - } - if (isTypedEvent(semantic, "bpmn:ConditionalEventDefinition")) { - return eventIconRenderers["bpmn:ConditionalEventDefinition"](parentGfx, element, attrs, isThrowing); - } - if (isTypedEvent(semantic, "bpmn:SignalEventDefinition")) { - return eventIconRenderers["bpmn:SignalEventDefinition"](parentGfx, element, attrs, isThrowing); - } - if (isTypedEvent(semantic, "bpmn:EscalationEventDefinition")) { - return eventIconRenderers["bpmn:EscalationEventDefinition"](parentGfx, element, attrs, isThrowing); - } - if (isTypedEvent(semantic, "bpmn:LinkEventDefinition")) { - return eventIconRenderers["bpmn:LinkEventDefinition"](parentGfx, element, attrs, isThrowing); - } - if (isTypedEvent(semantic, "bpmn:ErrorEventDefinition")) { - return eventIconRenderers["bpmn:ErrorEventDefinition"](parentGfx, element, attrs, isThrowing); - } - if (isTypedEvent(semantic, "bpmn:CancelEventDefinition")) { - return eventIconRenderers["bpmn:CancelEventDefinition"](parentGfx, element, attrs, isThrowing); - } - if (isTypedEvent(semantic, "bpmn:CompensateEventDefinition")) { - return eventIconRenderers["bpmn:CompensateEventDefinition"](parentGfx, element, attrs, isThrowing); - } - if (isTypedEvent(semantic, "bpmn:TerminateEventDefinition")) { - return eventIconRenderers["bpmn:TerminateEventDefinition"](parentGfx, element, attrs, isThrowing); - } - return null; - } - var taskMarkerRenderers = { - "ParticipantMultiplicityMarker": function(parentGfx, element, attrs = {}) { - var width = getWidth(element, attrs), height = getHeight(element, attrs); - var markerPath = pathMap.getScaledPath("MARKER_PARALLEL", { - xScaleFactor: 1, - yScaleFactor: 1, - containerWidth: width, - containerHeight: height, - position: { - mx: (width / 2 - 6) / width, - my: (height - 15) / height - } - }); - drawMarker("participant-multiplicity", parentGfx, markerPath, { - strokeWidth: 2, - fill: getFillColor(element, defaultFillColor, attrs.fill), - stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke) - }); - }, - "SubProcessMarker": function(parentGfx, element, attrs = {}) { - var markerRect = drawRect(parentGfx, 14, 14, 0, { - strokeWidth: 1, - fill: getFillColor(element, defaultFillColor, attrs.fill), - stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke) - }); - translate(markerRect, element.width / 2 - 7.5, element.height - 20); - var markerPath = pathMap.getScaledPath("MARKER_SUB_PROCESS", { - xScaleFactor: 1.5, - yScaleFactor: 1.5, - containerWidth: element.width, - containerHeight: element.height, - position: { - mx: (element.width / 2 - 7.5) / element.width, - my: (element.height - 20) / element.height - } - }); - drawMarker("sub-process", parentGfx, markerPath, { - fill: getFillColor(element, defaultFillColor, attrs.fill), - stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke) - }); - }, - "ParallelMarker": function(parentGfx, element, attrs) { - var width = getWidth(element, attrs), height = getHeight(element, attrs); - var markerPath = pathMap.getScaledPath("MARKER_PARALLEL", { - xScaleFactor: 1, - yScaleFactor: 1, - containerWidth: width, - containerHeight: height, - position: { - mx: (width / 2 + attrs.parallel) / width, - my: (height - 20) / height - } - }); - drawMarker("parallel", parentGfx, markerPath, { - fill: getFillColor(element, defaultFillColor, attrs.fill), - stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke) - }); - }, - "SequentialMarker": function(parentGfx, element, attrs) { - var markerPath = pathMap.getScaledPath("MARKER_SEQUENTIAL", { - xScaleFactor: 1, - yScaleFactor: 1, - containerWidth: element.width, - containerHeight: element.height, - position: { - mx: (element.width / 2 + attrs.seq) / element.width, - my: (element.height - 19) / element.height - } - }); - drawMarker("sequential", parentGfx, markerPath, { - fill: getFillColor(element, defaultFillColor, attrs.fill), - stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke) - }); - }, - "CompensationMarker": function(parentGfx, element, attrs) { - var markerMath = pathMap.getScaledPath("MARKER_COMPENSATION", { - xScaleFactor: 1, - yScaleFactor: 1, - containerWidth: element.width, - containerHeight: element.height, - position: { - mx: (element.width / 2 + attrs.compensation) / element.width, - my: (element.height - 13) / element.height - } - }); - drawMarker("compensation", parentGfx, markerMath, { - strokeWidth: 1, - fill: getFillColor(element, defaultFillColor, attrs.fill), - stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke) - }); - }, - "LoopMarker": function(parentGfx, element, attrs) { - var width = getWidth(element, attrs), height = getHeight(element, attrs); - var markerPath = pathMap.getScaledPath("MARKER_LOOP", { - xScaleFactor: 1, - yScaleFactor: 1, - containerWidth: width, - containerHeight: height, - position: { - mx: (width / 2 + attrs.loop) / width, - my: (height - 7) / height - } - }); - drawMarker("loop", parentGfx, markerPath, { - strokeWidth: 1.5, - fill: "none", - stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke), - strokeMiterlimit: 0.5 - }); - }, - "AdhocMarker": function(parentGfx, element, attrs) { - var width = getWidth(element, attrs), height = getHeight(element, attrs); - var markerPath = pathMap.getScaledPath("MARKER_ADHOC", { - xScaleFactor: 1, - yScaleFactor: 1, - containerWidth: width, - containerHeight: height, - position: { - mx: (width / 2 + attrs.adhoc) / width, - my: (height - 15) / height - } - }); - drawMarker("adhoc", parentGfx, markerPath, { - strokeWidth: 1, - fill: getStrokeColor(element, defaultStrokeColor, attrs.stroke), - stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke) - }); - } - }; - function renderTaskMarker(type, parentGfx, element, attrs) { - taskMarkerRenderers[type](parentGfx, element, attrs); - } - function renderTaskMarkers(parentGfx, element, taskMarkers, attrs = {}) { - attrs = { - fill: attrs.fill, - stroke: attrs.stroke, - width: getWidth(element, attrs), - height: getHeight(element, attrs) - }; - var semantic = getBusinessObject(element); - var subprocess = taskMarkers && taskMarkers.includes("SubProcessMarker"); - if (subprocess) { - attrs = { - ...attrs, - seq: -21, - parallel: -22, - compensation: -42, - loop: -18, - adhoc: 10 - }; - } else { - attrs = { - ...attrs, - seq: -5, - parallel: -6, - compensation: -27, - loop: 0, - adhoc: 10 - }; - } - forEach(taskMarkers, function(marker2) { - renderTaskMarker(marker2, parentGfx, element, attrs); - }); - if (semantic.get("isForCompensation")) { - renderTaskMarker("CompensationMarker", parentGfx, element, attrs); - } - if (is(semantic, "bpmn:AdHocSubProcess")) { - renderTaskMarker("AdhocMarker", parentGfx, element, attrs); - } - var loopCharacteristics = semantic.get("loopCharacteristics"), isSequential = loopCharacteristics && loopCharacteristics.get("isSequential"); - if (loopCharacteristics) { - if (isSequential === void 0) { - renderTaskMarker("LoopMarker", parentGfx, element, attrs); - } - if (isSequential === false) { - renderTaskMarker("ParallelMarker", parentGfx, element, attrs); - } - if (isSequential === true) { - renderTaskMarker("SequentialMarker", parentGfx, element, attrs); - } - } - } - function renderLabel(parentGfx, label, attrs = {}) { - attrs = assign({ - size: { - width: 100 - } - }, attrs); - var text = textRenderer.createText(label || "", attrs); - classes2(text).add("djs-label"); - append(parentGfx, text); - return text; - } - function renderEmbeddedLabel(parentGfx, element, align, attrs = {}) { - var semantic = getBusinessObject(element); - var box = getBounds({ - x: element.x, - y: element.y, - width: element.width, - height: element.height - }, attrs); - return renderLabel(parentGfx, semantic.name, { - align, - box, - padding: 7, - style: { - fill: getLabelColor(element, defaultLabelColor, defaultStrokeColor, attrs.stroke) - } - }); - } - function renderExternalLabel(parentGfx, element, attrs = {}) { - var box = { - width: 90, - height: 30, - x: element.width / 2 + element.x, - y: element.height / 2 + element.y - }; - return renderLabel(parentGfx, getLabel(element), { - box, - fitBox: true, - style: assign( - {}, - textRenderer.getExternalStyle(), - { - fill: getLabelColor(element, defaultLabelColor, defaultStrokeColor, attrs.stroke) - } - ) - }); - } - function renderLaneLabel(parentGfx, text, element, attrs = {}) { - var isHorizontalLane = isHorizontal(element); - var textBox = renderLabel(parentGfx, text, { - box: { - height: 30, - width: isHorizontalLane ? getHeight(element, attrs) : getWidth(element, attrs) - }, - align: "center-middle", - style: { - fill: getLabelColor(element, defaultLabelColor, defaultStrokeColor, attrs.stroke) - } - }); - if (isHorizontalLane) { - var top = -1 * getHeight(element, attrs); - transform2(textBox, 0, -top, 270); - } - } - function renderActivity(parentGfx, element, attrs = {}) { - var { - width, - height - } = getBounds(element, attrs); - return drawRect(parentGfx, width, height, TASK_BORDER_RADIUS, { - ...attrs, - fill: getFillColor(element, defaultFillColor, attrs.fill), - fillOpacity: DEFAULT_OPACITY, - stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke) - }); - } - function renderAssociation(parentGfx, element, attrs = {}) { - var semantic = getBusinessObject(element); - var fill = getFillColor(element, defaultFillColor, attrs.fill), stroke = getStrokeColor(element, defaultStrokeColor, attrs.stroke); - if (semantic.get("associationDirection") === "One" || semantic.get("associationDirection") === "Both") { - attrs.markerEnd = marker(parentGfx, "association-end", fill, stroke); - } - if (semantic.get("associationDirection") === "Both") { - attrs.markerStart = marker(parentGfx, "association-start", fill, stroke); - } - attrs = pickAttrs(attrs, [ - "markerStart", - "markerEnd" - ]); - return drawConnectionSegments(parentGfx, element.waypoints, { - ...attrs, - stroke, - strokeDasharray: "0, 5" - }); - } - function renderDataObject(parentGfx, element, attrs = {}) { - var fill = getFillColor(element, defaultFillColor, attrs.fill), stroke = getStrokeColor(element, defaultStrokeColor, attrs.stroke); - var pathData = pathMap.getScaledPath("DATA_OBJECT_PATH", { - xScaleFactor: 1, - yScaleFactor: 1, - containerWidth: element.width, - containerHeight: element.height, - position: { - mx: 0.474, - my: 0.296 - } - }); - var dataObject = drawPath2(parentGfx, pathData, { - fill, - fillOpacity: DEFAULT_OPACITY, - stroke - }); - var semantic = getBusinessObject(element); - if (isCollection(semantic)) { - var collectionPathData = pathMap.getScaledPath("DATA_OBJECT_COLLECTION_PATH", { - xScaleFactor: 1, - yScaleFactor: 1, - containerWidth: element.width, - containerHeight: element.height, - position: { - mx: 0.33, - my: (element.height - 18) / element.height - } - }); - drawPath2(parentGfx, collectionPathData, { - strokeWidth: 2, - fill, - stroke - }); - } - return dataObject; - } - function renderEvent(parentGfx, element, attrs = {}) { - return drawCircle(parentGfx, element.width, element.height, { - fillOpacity: DEFAULT_OPACITY, - ...attrs, - fill: getFillColor(element, defaultFillColor, attrs.fill), - stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke) - }); - } - function renderGateway(parentGfx, element, attrs = {}) { - return drawDiamond(parentGfx, element.width, element.height, { - fill: getFillColor(element, defaultFillColor, attrs.fill), - fillOpacity: DEFAULT_OPACITY, - stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke) - }); - } - function renderLane(parentGfx, element, attrs = {}) { - var lane = drawRect(parentGfx, getWidth(element, attrs), getHeight(element, attrs), 0, { - fill: getFillColor(element, defaultFillColor, attrs.fill), - fillOpacity: attrs.fillOpacity || DEFAULT_OPACITY, - stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke), - strokeWidth: 1.5 - }); - var semantic = getBusinessObject(element); - if (is(semantic, "bpmn:Lane")) { - var text = semantic.get("name"); - renderLaneLabel(parentGfx, text, element, attrs); - } - return lane; - } - function renderSubProcess(parentGfx, element, attrs = {}) { - var activity = renderActivity(parentGfx, element, attrs); - if (isEventSubProcess(element)) { - attr2(activity, { - strokeDasharray: "0, 5.5", - strokeWidth: 2.5 - }); - } - var expanded = isExpanded(element); - renderEmbeddedLabel(parentGfx, element, expanded ? "center-top" : "center-middle", attrs); - if (expanded) { - renderTaskMarkers(parentGfx, element, void 0, attrs); - } else { - renderTaskMarkers(parentGfx, element, ["SubProcessMarker"], attrs); - } - return activity; - } - function renderTask(parentGfx, element, attrs = {}) { - var activity = renderActivity(parentGfx, element, attrs); - renderEmbeddedLabel(parentGfx, element, "center-middle", attrs); - renderTaskMarkers(parentGfx, element, void 0, attrs); - return activity; - } - var handlers = this.handlers = { - "bpmn:AdHocSubProcess": function(parentGfx, element, attrs = {}) { - if (isExpanded(element)) { - attrs = pickAttrs(attrs, [ - "fill", - "stroke", - "width", - "height" - ]); - } else { - attrs = pickAttrs(attrs, [ - "fill", - "stroke" - ]); - } - return renderSubProcess(parentGfx, element, attrs); - }, - "bpmn:Association": function(parentGfx, element, attrs = {}) { - attrs = pickAttrs(attrs, [ - "fill", - "stroke" - ]); - return renderAssociation(parentGfx, element, attrs); - }, - "bpmn:BoundaryEvent": function(parentGfx, element, attrs = {}) { - var { renderIcon = true } = attrs; - attrs = pickAttrs(attrs, [ - "fill", - "stroke" - ]); - var semantic = getBusinessObject(element), cancelActivity = semantic.get("cancelActivity"); - attrs = { - strokeWidth: 1.5, - fill: getFillColor(element, defaultFillColor, attrs.fill), - fillOpacity: FULL_OPACITY, - stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke) - }; - if (!cancelActivity) { - attrs.strokeDasharray = "6"; - } - var event2 = renderEvent(parentGfx, element, attrs); - drawCircle(parentGfx, element.width, element.height, INNER_OUTER_DIST, { - ...attrs, - fill: "none" - }); - if (renderIcon) { - renderEventIcon(element, parentGfx, attrs); - } - return event2; - }, - "bpmn:BusinessRuleTask": function(parentGfx, element, attrs = {}) { - attrs = pickAttrs(attrs, [ - "fill", - "stroke" - ]); - var task = renderTask(parentGfx, element, attrs); - var headerData = pathMap.getScaledPath("TASK_TYPE_BUSINESS_RULE_MAIN", { - abspos: { - x: 8, - y: 8 - } - }); - var businessPath = drawPath2(parentGfx, headerData); - attr2(businessPath, { - fill: getFillColor(element, defaultFillColor, attrs.fill), - stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke), - strokeWidth: 1 - }); - var headerPathData = pathMap.getScaledPath("TASK_TYPE_BUSINESS_RULE_HEADER", { - abspos: { - x: 8, - y: 8 - } - }); - var businessHeaderPath = drawPath2(parentGfx, headerPathData); - attr2(businessHeaderPath, { - fill: getStrokeColor(element, defaultStrokeColor, attrs.stroke), - stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke), - strokeWidth: 1 - }); - return task; - }, - "bpmn:CallActivity": function(parentGfx, element, attrs = {}) { - attrs = pickAttrs(attrs, [ - "fill", - "stroke" - ]); - return renderSubProcess(parentGfx, element, { - strokeWidth: 5, - ...attrs - }); - }, - "bpmn:ComplexGateway": function(parentGfx, element, attrs = {}) { - attrs = pickAttrs(attrs, [ - "fill", - "stroke" - ]); - var gateway = renderGateway(parentGfx, element, attrs); - var pathData = pathMap.getScaledPath("GATEWAY_COMPLEX", { - xScaleFactor: 0.5, - yScaleFactor: 0.5, - containerWidth: element.width, - containerHeight: element.height, - position: { - mx: 0.46, - my: 0.26 - } - }); - drawPath2(parentGfx, pathData, { - fill: getStrokeColor(element, defaultStrokeColor, attrs.stroke), - stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke), - strokeWidth: 1 - }); - return gateway; - }, - "bpmn:DataInput": function(parentGfx, element, attrs = {}) { - attrs = pickAttrs(attrs, [ - "fill", - "stroke" - ]); - var arrowPathData = pathMap.getRawPath("DATA_ARROW"); - var dataObject = renderDataObject(parentGfx, element, attrs); - drawPath2(parentGfx, arrowPathData, { - fill: "none", - stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke), - strokeWidth: 1 - }); - return dataObject; - }, - "bpmn:DataInputAssociation": function(parentGfx, element, attrs = {}) { - attrs = pickAttrs(attrs, [ - "fill", - "stroke" - ]); - return renderAssociation(parentGfx, element, { - ...attrs, - markerEnd: marker(parentGfx, "association-end", getFillColor(element, defaultFillColor, attrs.fill), getStrokeColor(element, defaultStrokeColor, attrs.stroke)) - }); - }, - "bpmn:DataObject": function(parentGfx, element, attrs = {}) { - attrs = pickAttrs(attrs, [ - "fill", - "stroke" - ]); - return renderDataObject(parentGfx, element, attrs); - }, - "bpmn:DataObjectReference": as("bpmn:DataObject"), - "bpmn:DataOutput": function(parentGfx, element, attrs = {}) { - attrs = pickAttrs(attrs, [ - "fill", - "stroke" - ]); - var arrowPathData = pathMap.getRawPath("DATA_ARROW"); - var dataObject = renderDataObject(parentGfx, element, attrs); - drawPath2(parentGfx, arrowPathData, { - strokeWidth: 1, - fill: getFillColor(element, defaultFillColor, attrs.fill), - stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke) - }); - return dataObject; - }, - "bpmn:DataOutputAssociation": function(parentGfx, element, attrs = {}) { - attrs = pickAttrs(attrs, [ - "fill", - "stroke" - ]); - return renderAssociation(parentGfx, element, { - ...attrs, - markerEnd: marker(parentGfx, "association-end", getFillColor(element, defaultFillColor, attrs.fill), getStrokeColor(element, defaultStrokeColor, attrs.stroke)) - }); - }, - "bpmn:DataStoreReference": function(parentGfx, element, attrs = {}) { - attrs = pickAttrs(attrs, [ - "fill", - "stroke" - ]); - var dataStorePath = pathMap.getScaledPath("DATA_STORE", { - xScaleFactor: 1, - yScaleFactor: 1, - containerWidth: element.width, - containerHeight: element.height, - position: { - mx: 0, - my: 0.133 - } - }); - return drawPath2(parentGfx, dataStorePath, { - fill: getFillColor(element, defaultFillColor, attrs.fill), - fillOpacity: DEFAULT_OPACITY, - stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke), - strokeWidth: 2 - }); - }, - "bpmn:EndEvent": function(parentGfx, element, attrs = {}) { - var { renderIcon = true } = attrs; - attrs = pickAttrs(attrs, [ - "fill", - "stroke" - ]); - var event2 = renderEvent(parentGfx, element, { - ...attrs, - strokeWidth: 4 - }); - if (renderIcon) { - renderEventIcon(element, parentGfx, attrs); - } - return event2; - }, - "bpmn:EventBasedGateway": function(parentGfx, element, attrs = {}) { - attrs = pickAttrs(attrs, [ - "fill", - "stroke" - ]); - var semantic = getBusinessObject(element); - var diamond = renderGateway(parentGfx, element, attrs); - drawCircle(parentGfx, element.width, element.height, element.height * 0.2, { - fill: getFillColor(element, "none", attrs.fill), - stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke), - strokeWidth: 1 - }); - var type = semantic.get("eventGatewayType"), instantiate = !!semantic.get("instantiate"); - function drawEvent() { - var pathData2 = pathMap.getScaledPath("GATEWAY_EVENT_BASED", { - xScaleFactor: 0.18, - yScaleFactor: 0.18, - containerWidth: element.width, - containerHeight: element.height, - position: { - mx: 0.36, - my: 0.44 - } - }); - drawPath2(parentGfx, pathData2, { - fill: "none", - stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke), - strokeWidth: 2 - }); - } - if (type === "Parallel") { - var pathData = pathMap.getScaledPath("GATEWAY_PARALLEL", { - xScaleFactor: 0.4, - yScaleFactor: 0.4, - containerWidth: element.width, - containerHeight: element.height, - position: { - mx: 0.474, - my: 0.296 - } - }); - drawPath2(parentGfx, pathData, { - fill: "none", - stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke), - strokeWidth: 1 - }); - } else if (type === "Exclusive") { - if (!instantiate) { - drawCircle(parentGfx, element.width, element.height, element.height * 0.26, { - fill: "none", - stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke), - strokeWidth: 1 - }); - } - drawEvent(); - } - return diamond; - }, - "bpmn:ExclusiveGateway": function(parentGfx, element, attrs = {}) { - attrs = pickAttrs(attrs, [ - "fill", - "stroke" - ]); - var gateway = renderGateway(parentGfx, element, attrs); - var pathData = pathMap.getScaledPath("GATEWAY_EXCLUSIVE", { - xScaleFactor: 0.4, - yScaleFactor: 0.4, - containerWidth: element.width, - containerHeight: element.height, - position: { - mx: 0.32, - my: 0.3 - } - }); - var di = getDi(element); - if (di.get("isMarkerVisible")) { - drawPath2(parentGfx, pathData, { - fill: getStrokeColor(element, defaultStrokeColor, attrs.stroke), - stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke), - strokeWidth: 1 - }); - } - return gateway; - }, - "bpmn:Gateway": function(parentGfx, element, attrs = {}) { - attrs = pickAttrs(attrs, [ - "fill", - "stroke" - ]); - return renderGateway(parentGfx, element, attrs); - }, - "bpmn:Group": function(parentGfx, element, attrs = {}) { - attrs = pickAttrs(attrs, [ - "fill", - "stroke", - "width", - "height" - ]); - return drawRect(parentGfx, element.width, element.height, TASK_BORDER_RADIUS, { - stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke), - strokeWidth: 1.5, - strokeDasharray: "10, 6, 0, 6", - fill: "none", - pointerEvents: "none", - width: getWidth(element, attrs), - height: getHeight(element, attrs) - }); - }, - "bpmn:InclusiveGateway": function(parentGfx, element, attrs = {}) { - attrs = pickAttrs(attrs, [ - "fill", - "stroke" - ]); - var gateway = renderGateway(parentGfx, element, attrs); - drawCircle(parentGfx, element.width, element.height, element.height * 0.24, { - fill: getFillColor(element, defaultFillColor, attrs.fill), - stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke), - strokeWidth: 2.5 - }); - return gateway; - }, - "bpmn:IntermediateEvent": function(parentGfx, element, attrs = {}) { - var { renderIcon = true } = attrs; - attrs = pickAttrs(attrs, [ - "fill", - "stroke" - ]); - var outer = renderEvent(parentGfx, element, { - ...attrs, - strokeWidth: 1.5 - }); - drawCircle(parentGfx, element.width, element.height, INNER_OUTER_DIST, { - fill: "none", - stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke), - strokeWidth: 1.5 - }); - if (renderIcon) { - renderEventIcon(element, parentGfx, attrs); - } - return outer; - }, - "bpmn:IntermediateCatchEvent": as("bpmn:IntermediateEvent"), - "bpmn:IntermediateThrowEvent": as("bpmn:IntermediateEvent"), - "bpmn:Lane": function(parentGfx, element, attrs = {}) { - attrs = pickAttrs(attrs, [ - "fill", - "stroke", - "width", - "height" - ]); - return renderLane(parentGfx, element, { - ...attrs, - fillOpacity: LOW_OPACITY - }); - }, - "bpmn:ManualTask": function(parentGfx, element, attrs = {}) { - attrs = pickAttrs(attrs, [ - "fill", - "stroke" - ]); - var task = renderTask(parentGfx, element, attrs); - var pathData = pathMap.getScaledPath("TASK_TYPE_MANUAL", { - abspos: { - x: 17, - y: 15 - } - }); - drawPath2(parentGfx, pathData, { - fill: getFillColor(element, defaultFillColor, attrs.fill), - stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke), - strokeWidth: 0.5 - }); - return task; - }, - "bpmn:MessageFlow": function(parentGfx, element, attrs = {}) { - attrs = pickAttrs(attrs, [ - "fill", - "stroke" - ]); - var semantic = getBusinessObject(element), di = getDi(element); - var fill = getFillColor(element, defaultFillColor, attrs.fill), stroke = getStrokeColor(element, defaultStrokeColor, attrs.stroke); - var path = drawConnectionSegments(parentGfx, element.waypoints, { - markerEnd: marker(parentGfx, "messageflow-end", fill, stroke), - markerStart: marker(parentGfx, "messageflow-start", fill, stroke), - stroke, - strokeDasharray: "10, 11", - strokeWidth: 1.5 - }); - if (semantic.get("messageRef")) { - var midPoint = path.getPointAtLength(path.getTotalLength() / 2); - var markerPathData = pathMap.getScaledPath("MESSAGE_FLOW_MARKER", { - abspos: { - x: midPoint.x, - y: midPoint.y - } - }); - var messageAttrs = { - strokeWidth: 1 - }; - if (di.get("messageVisibleKind") === "initiating") { - messageAttrs.fill = fill; - messageAttrs.stroke = stroke; - } else { - messageAttrs.fill = stroke; - messageAttrs.stroke = fill; - } - var message = drawPath2(parentGfx, markerPathData, messageAttrs); - var messageRef = semantic.get("messageRef"), name2 = messageRef.get("name"); - var label = renderLabel(parentGfx, name2, { - align: "center-top", - fitBox: true, - style: { - fill: stroke - } - }); - var messageBounds = message.getBBox(), labelBounds = label.getBBox(); - var translateX = midPoint.x - labelBounds.width / 2, translateY = midPoint.y + messageBounds.height / 2 + ELEMENT_LABEL_DISTANCE; - transform2(label, translateX, translateY, 0); - } - return path; - }, - "bpmn:ParallelGateway": function(parentGfx, element, attrs = {}) { - attrs = pickAttrs(attrs, [ - "fill", - "stroke" - ]); - var diamond = renderGateway(parentGfx, element, attrs); - var pathData = pathMap.getScaledPath("GATEWAY_PARALLEL", { - xScaleFactor: 0.6, - yScaleFactor: 0.6, - containerWidth: element.width, - containerHeight: element.height, - position: { - mx: 0.46, - my: 0.2 - } - }); - drawPath2(parentGfx, pathData, { - fill: getStrokeColor(element, defaultStrokeColor, attrs.stroke), - stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke), - strokeWidth: 1 - }); - return diamond; - }, - "bpmn:Participant": function(parentGfx, element, attrs = {}) { - attrs = pickAttrs(attrs, [ - "fill", - "stroke", - "width", - "height" - ]); - var participant = renderLane(parentGfx, element, attrs); - var expandedParticipant = isExpanded(element); - var horizontalParticipant = isHorizontal(element); - var semantic = getBusinessObject(element), name2 = semantic.get("name"); - if (expandedParticipant) { - var waypoints = horizontalParticipant ? [ - { - x: 30, - y: 0 - }, - { - x: 30, - y: getHeight(element, attrs) - } - ] : [ - { - x: 0, - y: 30 - }, - { - x: getWidth(element, attrs), - y: 30 - } - ]; - drawLine(parentGfx, waypoints, { - stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke), - strokeWidth: PARTICIPANT_STROKE_WIDTH - }); - renderLaneLabel(parentGfx, name2, element, attrs); - } else { - var bounds = getBounds(element, attrs); - if (!horizontalParticipant) { - bounds.height = getWidth(element, attrs); - bounds.width = getHeight(element, attrs); - } - var textBox = renderLabel(parentGfx, name2, { - box: bounds, - align: "center-middle", - style: { - fill: getLabelColor(element, defaultLabelColor, defaultStrokeColor, attrs.stroke) - } - }); - if (!horizontalParticipant) { - var top = -1 * getHeight(element, attrs); - transform2(textBox, 0, -top, 270); - } - } - if (semantic.get("participantMultiplicity")) { - renderTaskMarker("ParticipantMultiplicityMarker", parentGfx, element, attrs); - } - return participant; - }, - "bpmn:ReceiveTask": function(parentGfx, element, attrs = {}) { - attrs = pickAttrs(attrs, [ - "fill", - "stroke" - ]); - var semantic = getBusinessObject(element); - var task = renderTask(parentGfx, element, attrs); - var pathData; - if (semantic.get("instantiate")) { - drawCircle(parentGfx, 28, 28, 20 * 0.22, { - fill: getFillColor(element, defaultFillColor, attrs.fill), - stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke), - strokeWidth: 1 - }); - pathData = pathMap.getScaledPath("TASK_TYPE_INSTANTIATING_SEND", { - abspos: { - x: 7.77, - y: 9.52 - } - }); - } else { - pathData = pathMap.getScaledPath("TASK_TYPE_SEND", { - xScaleFactor: 0.9, - yScaleFactor: 0.9, - containerWidth: 21, - containerHeight: 14, - position: { - mx: 0.3, - my: 0.4 - } - }); - } - drawPath2(parentGfx, pathData, { - fill: getFillColor(element, defaultFillColor, attrs.fill), - stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke), - strokeWidth: 1 - }); - return task; - }, - "bpmn:ScriptTask": function(parentGfx, element, attrs = {}) { - attrs = pickAttrs(attrs, [ - "fill", - "stroke" - ]); - var task = renderTask(parentGfx, element, attrs); - var pathData = pathMap.getScaledPath("TASK_TYPE_SCRIPT", { - abspos: { - x: 15, - y: 20 - } - }); - drawPath2(parentGfx, pathData, { - fill: getFillColor(element, defaultFillColor, attrs.fill), - stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke), - strokeWidth: 1 - }); - return task; - }, - "bpmn:SendTask": function(parentGfx, element, attrs = {}) { - attrs = pickAttrs(attrs, [ - "fill", - "stroke" - ]); - var task = renderTask(parentGfx, element, attrs); - var pathData = pathMap.getScaledPath("TASK_TYPE_SEND", { - xScaleFactor: 1, - yScaleFactor: 1, - containerWidth: 21, - containerHeight: 14, - position: { - mx: 0.285, - my: 0.357 - } - }); - drawPath2(parentGfx, pathData, { - fill: getStrokeColor(element, defaultStrokeColor, attrs.stroke), - stroke: getFillColor(element, defaultFillColor, attrs.fill), - strokeWidth: 1 - }); - return task; - }, - "bpmn:SequenceFlow": function(parentGfx, element, attrs = {}) { - attrs = pickAttrs(attrs, [ - "fill", - "stroke" - ]); - var fill = getFillColor(element, defaultFillColor, attrs.fill), stroke = getStrokeColor(element, defaultStrokeColor, attrs.stroke); - var connection = drawConnectionSegments(parentGfx, element.waypoints, { - markerEnd: marker(parentGfx, "sequenceflow-end", fill, stroke), - stroke - }); - var semantic = getBusinessObject(element); - var { source } = element; - if (source) { - var sourceSemantic = getBusinessObject(source); - if (semantic.get("conditionExpression") && is(sourceSemantic, "bpmn:Activity")) { - attr2(connection, { - markerStart: marker(parentGfx, "conditional-flow-marker", fill, stroke) - }); - } - if (sourceSemantic.get("default") && (is(sourceSemantic, "bpmn:Gateway") || is(sourceSemantic, "bpmn:Activity")) && sourceSemantic.get("default") === semantic) { - attr2(connection, { - markerStart: marker(parentGfx, "conditional-default-flow-marker", fill, stroke) - }); - } - } - return connection; - }, - "bpmn:ServiceTask": function(parentGfx, element, attrs = {}) { - attrs = pickAttrs(attrs, [ - "fill", - "stroke" - ]); - var task = renderTask(parentGfx, element, attrs); - drawCircle(parentGfx, 10, 10, { - fill: getFillColor(element, defaultFillColor, attrs.fill), - stroke: "none", - transform: "translate(6, 6)" - }); - var pathDataService1 = pathMap.getScaledPath("TASK_TYPE_SERVICE", { - abspos: { - x: 12, - y: 18 - } - }); - drawPath2(parentGfx, pathDataService1, { - fill: getFillColor(element, defaultFillColor, attrs.fill), - stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke), - strokeWidth: 1 - }); - drawCircle(parentGfx, 10, 10, { - fill: getFillColor(element, defaultFillColor, attrs.fill), - stroke: "none", - transform: "translate(11, 10)" - }); - var pathDataService2 = pathMap.getScaledPath("TASK_TYPE_SERVICE", { - abspos: { - x: 17, - y: 22 - } - }); - drawPath2(parentGfx, pathDataService2, { - fill: getFillColor(element, defaultFillColor, attrs.fill), - stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke), - strokeWidth: 1 - }); - return task; - }, - "bpmn:StartEvent": function(parentGfx, element, attrs = {}) { - var { renderIcon = true } = attrs; - attrs = pickAttrs(attrs, [ - "fill", - "stroke" - ]); - var semantic = getBusinessObject(element); - if (!semantic.get("isInterrupting")) { - attrs = { - ...attrs, - strokeDasharray: "6" - }; - } - var event2 = renderEvent(parentGfx, element, attrs); - if (renderIcon) { - renderEventIcon(element, parentGfx, attrs); - } - return event2; - }, - "bpmn:SubProcess": function(parentGfx, element, attrs = {}) { - if (isExpanded(element)) { - attrs = pickAttrs(attrs, [ - "fill", - "stroke", - "width", - "height" - ]); - } else { - attrs = pickAttrs(attrs, [ - "fill", - "stroke" - ]); - } - return renderSubProcess(parentGfx, element, attrs); - }, - "bpmn:Task": function(parentGfx, element, attrs = {}) { - attrs = pickAttrs(attrs, [ - "fill", - "stroke" - ]); - return renderTask(parentGfx, element, attrs); - }, - "bpmn:TextAnnotation": function(parentGfx, element, attrs = {}) { - attrs = pickAttrs(attrs, [ - "fill", - "stroke", - "width", - "height" - ]); - var { - width, - height - } = getBounds(element, attrs); - var textElement = drawRect(parentGfx, width, height, 0, 0, { - fill: "none", - stroke: "none" - }); - var textPathData = pathMap.getScaledPath("TEXT_ANNOTATION", { - xScaleFactor: 1, - yScaleFactor: 1, - containerWidth: width, - containerHeight: height, - position: { - mx: 0, - my: 0 - } - }); - drawPath2(parentGfx, textPathData, { - stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke) - }); - var semantic = getBusinessObject(element), text = semantic.get("text") || ""; - renderLabel(parentGfx, text, { - align: "left-top", - box: getBounds(element, attrs), - padding: 7, - style: { - fill: getLabelColor(element, defaultLabelColor, defaultStrokeColor, attrs.stroke) - } - }); - return textElement; - }, - "bpmn:Transaction": function(parentGfx, element, attrs = {}) { - if (isExpanded(element)) { - attrs = pickAttrs(attrs, [ - "fill", - "stroke", - "width", - "height" - ]); - } else { - attrs = pickAttrs(attrs, [ - "fill", - "stroke" - ]); - } - var outer = renderSubProcess(parentGfx, element, { - strokeWidth: 1.5, - ...attrs - }); - var innerAttrs = styles.style(["no-fill", "no-events"], { - stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke), - strokeWidth: 1.5 - }); - var expanded = isExpanded(element); - if (!expanded) { - attrs = {}; - } - drawRect( - parentGfx, - getWidth(element, attrs), - getHeight(element, attrs), - TASK_BORDER_RADIUS - INNER_OUTER_DIST, - INNER_OUTER_DIST, - innerAttrs - ); - return outer; - }, - "bpmn:UserTask": function(parentGfx, element, attrs = {}) { - attrs = pickAttrs(attrs, [ - "fill", - "stroke" - ]); - var task = renderTask(parentGfx, element, attrs); - var x = 15; - var y = 12; - var pathDataUser1 = pathMap.getScaledPath("TASK_TYPE_USER_1", { - abspos: { - x, - y - } - }); - drawPath2(parentGfx, pathDataUser1, { - fill: getFillColor(element, defaultFillColor, attrs.fill), - stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke), - strokeWidth: 0.5 - }); - var pathDataUser2 = pathMap.getScaledPath("TASK_TYPE_USER_2", { - abspos: { - x, - y - } - }); - drawPath2(parentGfx, pathDataUser2, { - fill: getFillColor(element, defaultFillColor, attrs.fill), - stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke), - strokeWidth: 0.5 - }); - var pathDataUser3 = pathMap.getScaledPath("TASK_TYPE_USER_3", { - abspos: { - x, - y - } - }); - drawPath2(parentGfx, pathDataUser3, { - fill: getStrokeColor(element, defaultStrokeColor, attrs.stroke), - stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke), - strokeWidth: 0.5 - }); - return task; - }, - "label": function(parentGfx, element, attrs = {}) { - return renderExternalLabel(parentGfx, element, attrs); - } - }; - this._drawPath = drawPath2; - this._renderer = renderer; -} -e(BpmnRenderer, BaseRenderer); -BpmnRenderer.$inject = [ - "config.bpmnRenderer", - "eventBus", - "styles", - "pathMap", - "canvas", - "textRenderer" -]; -BpmnRenderer.prototype.canRender = function(element) { - return is(element, "bpmn:BaseElement"); -}; -BpmnRenderer.prototype.drawShape = function(parentGfx, shape, attrs = {}) { - var { type } = shape; - var handler = this._renderer(type); - return handler(parentGfx, shape, attrs); -}; -BpmnRenderer.prototype.drawConnection = function(parentGfx, connection, attrs = {}) { - var { type } = connection; - var handler = this._renderer(type); - return handler(parentGfx, connection, attrs); -}; -BpmnRenderer.prototype.getShapePath = function(shape) { - if (is(shape, "bpmn:Event")) { - return getCirclePath(shape); - } - if (is(shape, "bpmn:Activity")) { - return getRoundRectPath(shape, TASK_BORDER_RADIUS); - } - if (is(shape, "bpmn:Gateway")) { - return getDiamondPath(shape); - } - return getRectPath(shape); -}; -function pickAttrs(attrs, keys = []) { - return keys.reduce((pickedAttrs, key) => { - if (attrs[key]) { - pickedAttrs[key] = attrs[key]; - } - return pickedAttrs; - }, {}); -} - -// node_modules/.pnpm/diagram-js@14.11.3/node_modules/diagram-js/lib/util/Text.js -var DEFAULT_BOX_PADDING = 0; -var DEFAULT_LABEL_SIZE2 = { - width: 150, - height: 50 -}; -function parseAlign(align) { - var parts = align.split("-"); - return { - horizontal: parts[0] || "center", - vertical: parts[1] || "top" - }; -} -function parsePadding(padding) { - if (isObject(padding)) { - return assign({ top: 0, left: 0, right: 0, bottom: 0 }, padding); - } else { - return { - top: padding, - left: padding, - right: padding, - bottom: padding - }; - } -} -function getTextBBox(text, fakeText) { - fakeText.textContent = text; - var textBBox; - try { - var bbox, emptyLine = text === ""; - fakeText.textContent = emptyLine ? "dummy" : text; - textBBox = fakeText.getBBox(); - bbox = { - width: textBBox.width + textBBox.x * 2, - height: textBBox.height - }; - if (emptyLine) { - bbox.width = 0; - } - return bbox; - } catch (e2) { - return { width: 0, height: 0 }; - } -} -function layoutNext(lines, maxWidth, fakeText) { - var originalLine = lines.shift(), fitLine = originalLine; - var textBBox; - for (; ; ) { - textBBox = getTextBBox(fitLine, fakeText); - textBBox.width = fitLine ? textBBox.width : 0; - if (fitLine === " " || fitLine === "" || textBBox.width < Math.round(maxWidth) || fitLine.length < 2) { - return fit(lines, fitLine, originalLine, textBBox); - } - fitLine = shortenLine(fitLine, textBBox.width, maxWidth); - } -} -function fit(lines, fitLine, originalLine, textBBox) { - if (fitLine.length < originalLine.length) { - var remainder = originalLine.slice(fitLine.length).trim(); - lines.unshift(remainder); - } - return { - width: textBBox.width, - height: textBBox.height, - text: fitLine - }; -} -var SOFT_BREAK = "­"; -function semanticShorten(line, maxLength) { - var parts = line.split(/(\s|-|\u00AD)/g), part, shortenedParts = [], length = 0; - if (parts.length > 1) { - while (part = parts.shift()) { - if (part.length + length < maxLength) { - shortenedParts.push(part); - length += part.length; - } else { - if (part === "-" || part === SOFT_BREAK) { - shortenedParts.pop(); - } - break; - } - } - } - var last = shortenedParts[shortenedParts.length - 1]; - if (last && last === SOFT_BREAK) { - shortenedParts[shortenedParts.length - 1] = "-"; - } - return shortenedParts.join(""); -} -function shortenLine(line, width, maxWidth) { - var length = Math.max(line.length * (maxWidth / width), 1); - var shortenedLine = semanticShorten(line, length); - if (!shortenedLine) { - shortenedLine = line.slice(0, Math.max(Math.round(length - 1), 1)); - } - return shortenedLine; -} -function getHelperSvg() { - var helperSvg = document.getElementById("helper-svg"); - if (!helperSvg) { - helperSvg = create("svg"); - attr2(helperSvg, { - id: "helper-svg" - }); - assign2(helperSvg, { - visibility: "hidden", - position: "fixed", - width: 0, - height: 0 - }); - document.body.appendChild(helperSvg); - } - return helperSvg; -} -function Text(config) { - this._config = assign({}, { - size: DEFAULT_LABEL_SIZE2, - padding: DEFAULT_BOX_PADDING, - style: {}, - align: "center-top" - }, config || {}); -} -Text.prototype.createText = function(text, options) { - return this.layoutText(text, options).element; -}; -Text.prototype.getDimensions = function(text, options) { - return this.layoutText(text, options).dimensions; -}; -Text.prototype.layoutText = function(text, options) { - var box = assign({}, this._config.size, options.box), style = assign({}, this._config.style, options.style), align = parseAlign(options.align || this._config.align), padding = parsePadding(options.padding !== void 0 ? options.padding : this._config.padding), fitBox = options.fitBox || false; - var lineHeight = getLineHeight(style); - var lines = text.split(/\u00AD?\r?\n/), layouted = []; - var maxWidth = box.width - padding.left - padding.right; - var helperText = create("text"); - attr2(helperText, { x: 0, y: 0 }); - attr2(helperText, style); - var helperSvg = getHelperSvg(); - append(helperSvg, helperText); - while (lines.length) { - layouted.push(layoutNext(lines, maxWidth, helperText)); - } - if (align.vertical === "middle") { - padding.top = padding.bottom = 0; - } - var totalHeight = reduce(layouted, function(sum, line, idx) { - return sum + (lineHeight || line.height); - }, 0) + padding.top + padding.bottom; - var maxLineWidth = reduce(layouted, function(sum, line, idx) { - return line.width > sum ? line.width : sum; - }, 0); - var y = padding.top; - if (align.vertical === "middle") { - y += (box.height - totalHeight) / 2; - } - y -= (lineHeight || layouted[0].height) / 4; - var textElement = create("text"); - attr2(textElement, style); - forEach(layouted, function(line) { - var x; - y += lineHeight || line.height; - switch (align.horizontal) { - case "left": - x = padding.left; - break; - case "right": - x = (fitBox ? maxLineWidth : maxWidth) - padding.right - line.width; - break; - default: - x = Math.max(((fitBox ? maxLineWidth : maxWidth) - line.width) / 2 + padding.left, 0); - } - var tspan = create("tspan"); - attr2(tspan, { x, y }); - tspan.textContent = line.text; - append(textElement, tspan); - }); - remove2(helperText); - var dimensions = { - width: maxLineWidth, - height: totalHeight - }; - return { - dimensions, - element: textElement - }; -}; -function getLineHeight(style) { - if ("fontSize" in style && "lineHeight" in style) { - return style.lineHeight * parseInt(style.fontSize, 10); - } -} - -// node_modules/.pnpm/bpmn-js@17.11.1/node_modules/bpmn-js/lib/draw/TextRenderer.js -var DEFAULT_FONT_SIZE = 12; -var LINE_HEIGHT_RATIO = 1.2; -var MIN_TEXT_ANNOTATION_HEIGHT = 30; -function TextRenderer(config) { - var defaultStyle = assign({ - fontFamily: "Arial, sans-serif", - fontSize: DEFAULT_FONT_SIZE, - fontWeight: "normal", - lineHeight: LINE_HEIGHT_RATIO - }, config && config.defaultStyle || {}); - var fontSize = parseInt(defaultStyle.fontSize, 10) - 1; - var externalStyle = assign({}, defaultStyle, { - fontSize - }, config && config.externalStyle || {}); - var textUtil = new Text({ - style: defaultStyle - }); - this.getExternalLabelBounds = function(bounds, text) { - var layoutedDimensions = textUtil.getDimensions(text, { - box: { - width: 90, - height: 30 - }, - style: externalStyle - }); - return { - x: Math.round(bounds.x + bounds.width / 2 - layoutedDimensions.width / 2), - y: Math.round(bounds.y), - width: Math.ceil(layoutedDimensions.width), - height: Math.ceil(layoutedDimensions.height) - }; - }; - this.getTextAnnotationBounds = function(bounds, text) { - var layoutedDimensions = textUtil.getDimensions(text, { - box: bounds, - style: defaultStyle, - align: "left-top", - padding: 5 - }); - return { - x: bounds.x, - y: bounds.y, - width: bounds.width, - height: Math.max(MIN_TEXT_ANNOTATION_HEIGHT, Math.round(layoutedDimensions.height)) - }; - }; - this.createText = function(text, options) { - return textUtil.createText(text, options || {}); - }; - this.getDefaultStyle = function() { - return defaultStyle; - }; - this.getExternalStyle = function() { - return externalStyle; - }; -} -TextRenderer.$inject = [ - "config.textRenderer" -]; - -// node_modules/.pnpm/bpmn-js@17.11.1/node_modules/bpmn-js/lib/draw/PathMap.js -function PathMap() { - this.pathMap = { - "EVENT_MESSAGE": { - d: "m {mx},{my} l 0,{e.y1} l {e.x1},0 l 0,-{e.y1} z l {e.x0},{e.y0} l {e.x0},-{e.y0}", - height: 36, - width: 36, - heightElements: [6, 14], - widthElements: [10.5, 21] - }, - "EVENT_SIGNAL": { - d: "M {mx},{my} l {e.x0},{e.y0} l -{e.x1},0 Z", - height: 36, - width: 36, - heightElements: [18], - widthElements: [10, 20] - }, - "EVENT_ESCALATION": { - d: "M {mx},{my} l {e.x0},{e.y0} l -{e.x0},-{e.y1} l -{e.x0},{e.y1} Z", - height: 36, - width: 36, - heightElements: [20, 7], - widthElements: [8] - }, - "EVENT_CONDITIONAL": { - d: "M {e.x0},{e.y0} l {e.x1},0 l 0,{e.y2} l -{e.x1},0 Z M {e.x2},{e.y3} l {e.x0},0 M {e.x2},{e.y4} l {e.x0},0 M {e.x2},{e.y5} l {e.x0},0 M {e.x2},{e.y6} l {e.x0},0 M {e.x2},{e.y7} l {e.x0},0 M {e.x2},{e.y8} l {e.x0},0 ", - height: 36, - width: 36, - heightElements: [8.5, 14.5, 18, 11.5, 14.5, 17.5, 20.5, 23.5, 26.5], - widthElements: [10.5, 14.5, 12.5] - }, - "EVENT_LINK": { - d: "m {mx},{my} 0,{e.y0} -{e.x1},0 0,{e.y1} {e.x1},0 0,{e.y0} {e.x0},-{e.y2} -{e.x0},-{e.y2} z", - height: 36, - width: 36, - heightElements: [4.4375, 6.75, 7.8125], - widthElements: [9.84375, 13.5] - }, - "EVENT_ERROR": { - d: "m {mx},{my} {e.x0},-{e.y0} {e.x1},-{e.y1} {e.x2},{e.y2} {e.x3},-{e.y3} -{e.x4},{e.y4} -{e.x5},-{e.y5} z", - height: 36, - width: 36, - heightElements: [0.023, 8.737, 8.151, 16.564, 10.591, 8.714], - widthElements: [0.085, 6.672, 6.97, 4.273, 5.337, 6.636] - }, - "EVENT_CANCEL_45": { - d: "m {mx},{my} -{e.x1},0 0,{e.x0} {e.x1},0 0,{e.y1} {e.x0},0 0,-{e.y1} {e.x1},0 0,-{e.y0} -{e.x1},0 0,-{e.y1} -{e.x0},0 z", - height: 36, - width: 36, - heightElements: [4.75, 8.5], - widthElements: [4.75, 8.5] - }, - "EVENT_COMPENSATION": { - d: "m {mx},{my} {e.x0},-{e.y0} 0,{e.y1} z m {e.x1},-{e.y2} {e.x2},-{e.y3} 0,{e.y1} -{e.x2},-{e.y3} z", - height: 36, - width: 36, - heightElements: [6.5, 13, 0.4, 6.1], - widthElements: [9, 9.3, 8.7] - }, - "EVENT_TIMER_WH": { - d: "M {mx},{my} l {e.x0},-{e.y0} m -{e.x0},{e.y0} l {e.x1},{e.y1} ", - height: 36, - width: 36, - heightElements: [10, 2], - widthElements: [3, 7] - }, - "EVENT_TIMER_LINE": { - d: "M {mx},{my} m {e.x0},{e.y0} l -{e.x1},{e.y1} ", - height: 36, - width: 36, - heightElements: [10, 3], - widthElements: [0, 0] - }, - "EVENT_MULTIPLE": { - d: "m {mx},{my} {e.x1},-{e.y0} {e.x1},{e.y0} -{e.x0},{e.y1} -{e.x2},0 z", - height: 36, - width: 36, - heightElements: [6.28099, 12.56199], - widthElements: [3.1405, 9.42149, 12.56198] - }, - "EVENT_PARALLEL_MULTIPLE": { - d: "m {mx},{my} {e.x0},0 0,{e.y1} {e.x1},0 0,{e.y0} -{e.x1},0 0,{e.y1} -{e.x0},0 0,-{e.y1} -{e.x1},0 0,-{e.y0} {e.x1},0 z", - height: 36, - width: 36, - heightElements: [2.56228, 7.68683], - widthElements: [2.56228, 7.68683] - }, - "GATEWAY_EXCLUSIVE": { - d: "m {mx},{my} {e.x0},{e.y0} {e.x1},{e.y0} {e.x2},0 {e.x4},{e.y2} {e.x4},{e.y1} {e.x2},0 {e.x1},{e.y3} {e.x0},{e.y3} {e.x3},0 {e.x5},{e.y1} {e.x5},{e.y2} {e.x3},0 z", - height: 17.5, - width: 17.5, - heightElements: [8.5, 6.5312, -6.5312, -8.5], - widthElements: [6.5, -6.5, 3, -3, 5, -5] - }, - "GATEWAY_PARALLEL": { - d: "m {mx},{my} 0,{e.y1} -{e.x1},0 0,{e.y0} {e.x1},0 0,{e.y1} {e.x0},0 0,-{e.y1} {e.x1},0 0,-{e.y0} -{e.x1},0 0,-{e.y1} -{e.x0},0 z", - height: 30, - width: 30, - heightElements: [5, 12.5], - widthElements: [5, 12.5] - }, - "GATEWAY_EVENT_BASED": { - d: "m {mx},{my} {e.x0},{e.y0} {e.x0},{e.y1} {e.x1},{e.y2} {e.x2},0 z", - height: 11, - width: 11, - heightElements: [-6, 6, 12, -12], - widthElements: [9, -3, -12] - }, - "GATEWAY_COMPLEX": { - d: "m {mx},{my} 0,{e.y0} -{e.x0},-{e.y1} -{e.x1},{e.y2} {e.x0},{e.y1} -{e.x2},0 0,{e.y3} {e.x2},0 -{e.x0},{e.y1} l {e.x1},{e.y2} {e.x0},-{e.y1} 0,{e.y0} {e.x3},0 0,-{e.y0} {e.x0},{e.y1} {e.x1},-{e.y2} -{e.x0},-{e.y1} {e.x2},0 0,-{e.y3} -{e.x2},0 {e.x0},-{e.y1} -{e.x1},-{e.y2} -{e.x0},{e.y1} 0,-{e.y0} -{e.x3},0 z", - height: 17.125, - width: 17.125, - heightElements: [4.875, 3.4375, 2.125, 3], - widthElements: [3.4375, 2.125, 4.875, 3] - }, - "DATA_OBJECT_PATH": { - d: "m 0,0 {e.x1},0 {e.x0},{e.y0} 0,{e.y1} -{e.x2},0 0,-{e.y2} {e.x1},0 0,{e.y0} {e.x0},0", - height: 61, - width: 51, - heightElements: [10, 50, 60], - widthElements: [10, 40, 50, 60] - }, - "DATA_OBJECT_COLLECTION_PATH": { - d: "m{mx},{my} m 3,2 l 0,10 m 3,-10 l 0,10 m 3,-10 l 0,10", - height: 10, - width: 10, - heightElements: [], - widthElements: [] - }, - "DATA_ARROW": { - d: "m 5,9 9,0 0,-3 5,5 -5,5 0,-3 -9,0 z", - height: 61, - width: 51, - heightElements: [], - widthElements: [] - }, - "DATA_STORE": { - d: "m {mx},{my} l 0,{e.y2} c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0 l 0,-{e.y2} c -{e.x0},-{e.y1} -{e.x1},-{e.y1} -{e.x2},0c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0 m -{e.x2},{e.y0}c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0m -{e.x2},{e.y0}c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0", - height: 61, - width: 61, - heightElements: [7, 10, 45], - widthElements: [2, 58, 60] - }, - "TEXT_ANNOTATION": { - d: "m {mx}, {my} m 10,0 l -10,0 l 0,{e.y0} l 10,0", - height: 30, - width: 10, - heightElements: [30], - widthElements: [10] - }, - "MARKER_SUB_PROCESS": { - d: "m{mx},{my} m 7,2 l 0,10 m -5,-5 l 10,0", - height: 10, - width: 10, - heightElements: [], - widthElements: [] - }, - "MARKER_PARALLEL": { - d: "m{mx},{my} m 3,2 l 0,10 m 3,-10 l 0,10 m 3,-10 l 0,10", - height: 10, - width: 10, - heightElements: [], - widthElements: [] - }, - "MARKER_SEQUENTIAL": { - d: "m{mx},{my} m 0,3 l 10,0 m -10,3 l 10,0 m -10,3 l 10,0", - height: 10, - width: 10, - heightElements: [], - widthElements: [] - }, - "MARKER_COMPENSATION": { - d: "m {mx},{my} 7,-5 0,10 z m 7.1,-0.3 6.9,-4.7 0,10 -6.9,-4.7 z", - height: 10, - width: 21, - heightElements: [], - widthElements: [] - }, - "MARKER_LOOP": { - d: "m {mx},{my} c 3.526979,0 6.386161,-2.829858 6.386161,-6.320661 0,-3.490806 -2.859182,-6.320661 -6.386161,-6.320661 -3.526978,0 -6.38616,2.829855 -6.38616,6.320661 0,1.745402 0.714797,3.325567 1.870463,4.469381 0.577834,0.571908 1.265885,1.034728 2.029916,1.35457 l -0.718163,-3.909793 m 0.718163,3.909793 -3.885211,0.802902", - height: 13.9, - width: 13.7, - heightElements: [], - widthElements: [] - }, - "MARKER_ADHOC": { - d: "m {mx},{my} m 0.84461,2.64411 c 1.05533,-1.23780996 2.64337,-2.07882 4.29653,-1.97997996 2.05163,0.0805 3.85579,1.15803 5.76082,1.79107 1.06385,0.34139996 2.24454,0.1438 3.18759,-0.43767 0.61743,-0.33642 1.2775,-0.64078 1.7542,-1.17511 0,0.56023 0,1.12046 0,1.6807 -0.98706,0.96237996 -2.29792,1.62393996 -3.6918,1.66181996 -1.24459,0.0927 -2.46671,-0.2491 -3.59505,-0.74812 -1.35789,-0.55965 -2.75133,-1.33436996 -4.27027,-1.18121996 -1.37741,0.14601 -2.41842,1.13685996 -3.44288,1.96782996 z", - height: 4, - width: 15, - heightElements: [], - widthElements: [] - }, - "TASK_TYPE_SEND": { - d: "m {mx},{my} l 0,{e.y1} l {e.x1},0 l 0,-{e.y1} z l {e.x0},{e.y0} l {e.x0},-{e.y0}", - height: 14, - width: 21, - heightElements: [6, 14], - widthElements: [10.5, 21] - }, - "TASK_TYPE_SCRIPT": { - d: "m {mx},{my} c 9.966553,-6.27276 -8.000926,-7.91932 2.968968,-14.938 l -8.802728,0 c -10.969894,7.01868 6.997585,8.66524 -2.968967,14.938 z m -7,-12 l 5,0 m -4.5,3 l 4.5,0 m -3,3 l 5,0m -4,3 l 5,0", - height: 15, - width: 12.6, - heightElements: [6, 14], - widthElements: [10.5, 21] - }, - "TASK_TYPE_USER_1": { - d: "m {mx},{my} c 0.909,-0.845 1.594,-2.049 1.594,-3.385 0,-2.554 -1.805,-4.62199999 -4.357,-4.62199999 -2.55199998,0 -4.28799998,2.06799999 -4.28799998,4.62199999 0,1.348 0.974,2.562 1.89599998,3.405 -0.52899998,0.187 -5.669,2.097 -5.794,4.7560005 v 6.718 h 17 v -6.718 c 0,-2.2980005 -5.5279996,-4.5950005 -6.0509996,-4.7760005 zm -8,6 l 0,5.5 m 11,0 l 0,-5" - }, - "TASK_TYPE_USER_2": { - d: "m {mx},{my} m 2.162,1.009 c 0,2.4470005 -2.158,4.4310005 -4.821,4.4310005 -2.66499998,0 -4.822,-1.981 -4.822,-4.4310005 " - }, - "TASK_TYPE_USER_3": { - d: "m {mx},{my} m -6.9,-3.80 c 0,0 2.25099998,-2.358 4.27399998,-1.177 2.024,1.181 4.221,1.537 4.124,0.965 -0.098,-0.57 -0.117,-3.79099999 -4.191,-4.13599999 -3.57499998,0.001 -4.20799998,3.36699999 -4.20699998,4.34799999 z" - }, - "TASK_TYPE_MANUAL": { - d: "m {mx},{my} c 0.234,-0.01 5.604,0.008 8.029,0.004 0.808,0 1.271,-0.172 1.417,-0.752 0.227,-0.898 -0.334,-1.314 -1.338,-1.316 -2.467,-0.01 -7.886,-0.004 -8.108,-0.004 -0.014,-0.079 0.016,-0.533 0,-0.61 0.195,-0.042 8.507,0.006 9.616,0.002 0.877,-0.007 1.35,-0.438 1.353,-1.208 0.003,-0.768 -0.479,-1.09 -1.35,-1.091 -2.968,-0.002 -9.619,-0.013 -9.619,-0.013 v -0.591 c 0,0 5.052,-0.016 7.225,-0.016 0.888,-0.002 1.354,-0.416 1.351,-1.193 -0.006,-0.761 -0.492,-1.196 -1.361,-1.196 -3.473,-0.005 -10.86,-0.003 -11.0829995,-0.003 -0.022,-0.047 -0.045,-0.094 -0.069,-0.139 0.3939995,-0.319 2.0409995,-1.626 2.4149995,-2.017 0.469,-0.4870005 0.519,-1.1650005 0.162,-1.6040005 -0.414,-0.511 -0.973,-0.5 -1.48,-0.236 -1.4609995,0.764 -6.5999995,3.6430005 -7.7329995,4.2710005 -0.9,0.499 -1.516,1.253 -1.882,2.19 -0.37000002,0.95 -0.17,2.01 -0.166,2.979 0.004,0.718 -0.27300002,1.345 -0.055,2.063 0.629,2.087 2.425,3.312 4.859,3.318 4.6179995,0.014 9.2379995,-0.139 13.8569995,-0.158 0.755,-0.004 1.171,-0.301 1.182,-1.033 0.012,-0.754 -0.423,-0.969 -1.183,-0.973 -1.778,-0.01 -5.824,-0.004 -6.04,-0.004 10e-4,-0.084 0.003,-0.586 10e-4,-0.67 z" - }, - "TASK_TYPE_INSTANTIATING_SEND": { - d: "m {mx},{my} l 0,8.4 l 12.6,0 l 0,-8.4 z l 6.3,3.6 l 6.3,-3.6" - }, - "TASK_TYPE_SERVICE": { - d: "m {mx},{my} v -1.71335 c 0.352326,-0.0705 0.703932,-0.17838 1.047628,-0.32133 0.344416,-0.14465 0.665822,-0.32133 0.966377,-0.52145 l 1.19431,1.18005 1.567487,-1.57688 -1.195028,-1.18014 c 0.403376,-0.61394 0.683079,-1.29908 0.825447,-2.01824 l 1.622133,-0.01 v -2.2196 l -1.636514,0.01 c -0.07333,-0.35153 -0.178319,-0.70024 -0.323564,-1.04372 -0.145244,-0.34406 -0.321407,-0.6644 -0.522735,-0.96217 l 1.131035,-1.13631 -1.583305,-1.56293 -1.129598,1.13589 c -0.614052,-0.40108 -1.302883,-0.68093 -2.022633,-0.82247 l 0.0093,-1.61852 h -2.241173 l 0.0042,1.63124 c -0.353763,0.0736 -0.705369,0.17977 -1.049785,0.32371 -0.344415,0.14437 -0.665102,0.32092 -0.9635006,0.52046 l -1.1698628,-1.15823 -1.5667691,1.5792 1.1684265,1.15669 c -0.4026573,0.61283 -0.68308,1.29797 -0.8247287,2.01713 l -1.6588041,0.003 v 2.22174 l 1.6724648,-0.006 c 0.073327,0.35077 0.1797598,0.70243 0.3242851,1.04472 0.1452428,0.34448 0.3214064,0.6644 0.5227339,0.96066 l -1.1993431,1.19723 1.5840256,1.56011 1.1964668,-1.19348 c 0.6140517,0.40346 1.3028827,0.68232 2.0233517,0.82331 l 7.19e-4,1.69892 h 2.226848 z m 0.221462,-3.9957 c -1.788948,0.7502 -3.8576,-0.0928 -4.6097055,-1.87438 -0.7521065,-1.78321 0.090598,-3.84627 1.8802645,-4.59604 1.78823,-0.74936 3.856881,0.0929 4.608987,1.87437 0.752106,1.78165 -0.0906,3.84612 -1.879546,4.59605 z" - }, - "TASK_TYPE_SERVICE_FILL": { - d: "m {mx},{my} c -1.788948,0.7502 -3.8576,-0.0928 -4.6097055,-1.87438 -0.7521065,-1.78321 0.090598,-3.84627 1.8802645,-4.59604 1.78823,-0.74936 3.856881,0.0929 4.608987,1.87437 0.752106,1.78165 -0.0906,3.84612 -1.879546,4.59605 z" - }, - "TASK_TYPE_BUSINESS_RULE_HEADER": { - d: "m {mx},{my} 0,4 20,0 0,-4 z" - }, - "TASK_TYPE_BUSINESS_RULE_MAIN": { - d: "m {mx},{my} 0,12 20,0 0,-12 zm 0,8 l 20,0 m -13,-4 l 0,8" - }, - "MESSAGE_FLOW_MARKER": { - d: "m {mx},{my} m -10.5 ,-7 l 0,14 l 21,0 l 0,-14 z l 10.5,6 l 10.5,-6" - } - }; - this.getRawPath = function getRawPath(pathId) { - return this.pathMap[pathId].d; - }; - this.getScaledPath = function getScaledPath(pathId, param) { - var rawPath = this.pathMap[pathId]; - var mx, my; - if (param.abspos) { - mx = param.abspos.x; - my = param.abspos.y; - } else { - mx = param.containerWidth * param.position.mx; - my = param.containerHeight * param.position.my; - } - var coordinates = {}; - if (param.position) { - var heightRatio = param.containerHeight / rawPath.height * param.yScaleFactor; - var widthRatio = param.containerWidth / rawPath.width * param.xScaleFactor; - for (var heightIndex = 0; heightIndex < rawPath.heightElements.length; heightIndex++) { - coordinates["y" + heightIndex] = rawPath.heightElements[heightIndex] * heightRatio; - } - for (var widthIndex = 0; widthIndex < rawPath.widthElements.length; widthIndex++) { - coordinates["x" + widthIndex] = rawPath.widthElements[widthIndex] * widthRatio; - } - } - var path = format( - rawPath.d, - { - mx, - my, - e: coordinates - } - ); - return path; - }; -} -var tokenRegex = /\{([^{}]+)\}/g; -var objNotationRegex = /(?:(?:^|\.)(.+?)(?=\[|\.|$|\()|\[('|")(.+?)\2\])(\(\))?/g; -function replacer(all2, key, obj) { - var res = obj; - key.replace(objNotationRegex, function(all3, name2, quote, quotedName, isFunc) { - name2 = name2 || quotedName; - if (res) { - if (name2 in res) { - res = res[name2]; - } - typeof res == "function" && isFunc && (res = res()); - } - }); - res = (res == null || res == obj ? all2 : res) + ""; - return res; -} -function format(str, obj) { - return String(str).replace(tokenRegex, function(all2, key) { - return replacer(all2, key, obj); - }); -} - -// node_modules/.pnpm/bpmn-js@17.11.1/node_modules/bpmn-js/lib/draw/index.js -var draw_default = { - __init__: ["bpmnRenderer"], - bpmnRenderer: ["type", BpmnRenderer], - textRenderer: ["type", TextRenderer], - pathMap: ["type", PathMap] -}; - -// node_modules/.pnpm/diagram-js@14.11.3/node_modules/diagram-js/lib/i18n/translate/translate.js -function translate2(template, replacements) { - replacements = replacements || {}; - return template.replace(/{([^}]+)}/g, function(_, key) { - return replacements[key] || "{" + key + "}"; - }); -} - -// node_modules/.pnpm/diagram-js@14.11.3/node_modules/diagram-js/lib/i18n/translate/index.js -var translate_default = { - translate: ["value", translate2] -}; - -// node_modules/.pnpm/bpmn-js@17.11.1/node_modules/bpmn-js/lib/import/Util.js -function elementToString(e2) { - if (!e2) { - return ""; - } - return "<" + e2.$type + (e2.id ? ' id="' + e2.id : "") + '" />'; -} - -// node_modules/.pnpm/bpmn-js@17.11.1/node_modules/bpmn-js/lib/import/BpmnImporter.js -function elementData(semantic, di, attrs) { - return assign({ - id: semantic.id, - type: semantic.$type, - businessObject: semantic, - di - }, attrs); -} -function getWaypoints(di, source, target) { - var waypoints = di.waypoint; - if (!waypoints || waypoints.length < 2) { - return [getMid(source), getMid(target)]; - } - return waypoints.map(function(p) { - return { x: p.x, y: p.y }; - }); -} -function notYetDrawn(semantic, refSemantic, property) { - return new Error( - `element ${elementToString(refSemantic)} referenced by ${elementToString(semantic)}#${property} not yet drawn` - ); -} -function BpmnImporter(eventBus, canvas, elementFactory, elementRegistry, textRenderer) { - this._eventBus = eventBus; - this._canvas = canvas; - this._elementFactory = elementFactory; - this._elementRegistry = elementRegistry; - this._textRenderer = textRenderer; -} -BpmnImporter.$inject = [ - "eventBus", - "canvas", - "elementFactory", - "elementRegistry", - "textRenderer" -]; -BpmnImporter.prototype.add = function(semantic, di, parentElement) { - var element, hidden; - var parentIndex; - if (is(di, "bpmndi:BPMNPlane")) { - var attrs = is(semantic, "bpmn:SubProcess") ? { id: semantic.id + "_plane" } : {}; - element = this._elementFactory.createRoot(elementData(semantic, di, attrs)); - this._canvas.addRootElement(element); - } else if (is(di, "bpmndi:BPMNShape")) { - var collapsed = !isExpanded(semantic, di), isFrame = isFrameElement2(semantic); - hidden = parentElement && (parentElement.hidden || parentElement.collapsed); - var bounds = di.bounds; - element = this._elementFactory.createShape(elementData(semantic, di, { - collapsed, - hidden, - x: Math.round(bounds.x), - y: Math.round(bounds.y), - width: Math.round(bounds.width), - height: Math.round(bounds.height), - isFrame - })); - if (is(semantic, "bpmn:BoundaryEvent")) { - this._attachBoundary(semantic, element); - } - if (is(semantic, "bpmn:Lane")) { - parentIndex = 0; - } - if (is(semantic, "bpmn:DataStoreReference")) { - if (!isPointInsideBBox(parentElement, getMid(bounds))) { - parentElement = this._canvas.findRoot(parentElement); - } - } - this._canvas.addShape(element, parentElement, parentIndex); - } else if (is(di, "bpmndi:BPMNEdge")) { - var source = this._getSource(semantic), target = this._getTarget(semantic); - hidden = parentElement && (parentElement.hidden || parentElement.collapsed); - element = this._elementFactory.createConnection(elementData(semantic, di, { - hidden, - source, - target, - waypoints: getWaypoints(di, source, target) - })); - if (is(semantic, "bpmn:DataAssociation")) { - parentElement = this._canvas.findRoot(parentElement); - } - this._canvas.addConnection(element, parentElement, parentIndex); - } else { - throw new Error( - `unknown di ${elementToString(di)} for element ${elementToString(semantic)}` - ); - } - if (isLabelExternal(semantic) && getLabel(element)) { - this.addLabel(semantic, di, element); - } - this._eventBus.fire("bpmnElement.added", { element }); - return element; -}; -BpmnImporter.prototype._attachBoundary = function(boundarySemantic, boundaryElement) { - var hostSemantic = boundarySemantic.attachedToRef; - if (!hostSemantic) { - throw new Error( - `missing ${elementToString(boundarySemantic)}#attachedToRef` - ); - } - var host = this._elementRegistry.get(hostSemantic.id), attachers = host && host.attachers; - if (!host) { - throw notYetDrawn(boundarySemantic, hostSemantic, "attachedToRef"); - } - boundaryElement.host = host; - if (!attachers) { - host.attachers = attachers = []; - } - if (attachers.indexOf(boundaryElement) === -1) { - attachers.push(boundaryElement); - } -}; -BpmnImporter.prototype.addLabel = function(semantic, di, element) { - var bounds, text, label; - bounds = getExternalLabelBounds(di, element); - text = getLabel(element); - if (text) { - bounds = this._textRenderer.getExternalLabelBounds(bounds, text); - } - label = this._elementFactory.createLabel(elementData(semantic, di, { - id: semantic.id + "_label", - labelTarget: element, - type: "label", - hidden: element.hidden || !getLabel(element), - x: Math.round(bounds.x), - y: Math.round(bounds.y), - width: Math.round(bounds.width), - height: Math.round(bounds.height) - })); - return this._canvas.addShape(label, element.parent); -}; -BpmnImporter.prototype._getConnectedElement = function(semantic, side) { - var element, refSemantic, type = semantic.$type; - refSemantic = semantic[side + "Ref"]; - if (side === "source" && type === "bpmn:DataInputAssociation") { - refSemantic = refSemantic && refSemantic[0]; - } - if (side === "source" && type === "bpmn:DataOutputAssociation" || side === "target" && type === "bpmn:DataInputAssociation") { - refSemantic = semantic.$parent; - } - element = refSemantic && this._getElement(refSemantic); - if (element) { - return element; - } - if (refSemantic) { - throw notYetDrawn(semantic, refSemantic, side + "Ref"); - } else { - throw new Error( - `${elementToString(semantic)}#${side} Ref not specified` - ); - } -}; -BpmnImporter.prototype._getSource = function(semantic) { - return this._getConnectedElement(semantic, "source"); -}; -BpmnImporter.prototype._getTarget = function(semantic) { - return this._getConnectedElement(semantic, "target"); -}; -BpmnImporter.prototype._getElement = function(semantic) { - return this._elementRegistry.get(semantic.id); -}; -function isPointInsideBBox(bbox, point) { - var x = point.x, y = point.y; - return x >= bbox.x && x <= bbox.x + bbox.width && y >= bbox.y && y <= bbox.y + bbox.height; -} -function isFrameElement2(semantic) { - return is(semantic, "bpmn:Group"); -} - -// node_modules/.pnpm/bpmn-js@17.11.1/node_modules/bpmn-js/lib/import/index.js -var import_default = { - __depends__: [ - translate_default - ], - bpmnImporter: ["type", BpmnImporter] -}; - -// node_modules/.pnpm/bpmn-js@17.11.1/node_modules/bpmn-js/lib/core/index.js -var core_default = { - __depends__: [ - draw_default, - import_default - ] -}; - -// node_modules/.pnpm/diagram-js@14.11.3/node_modules/diagram-js/lib/util/IdGenerator.js -function IdGenerator(prefix2) { - this._counter = 0; - this._prefix = (prefix2 ? prefix2 + "-" : "") + Math.floor(Math.random() * 1e9) + "-"; -} -IdGenerator.prototype.next = function() { - return this._prefix + ++this._counter; -}; - -// node_modules/.pnpm/diagram-js@14.11.3/node_modules/diagram-js/lib/features/overlays/Overlays.js -var ids = new IdGenerator("ov"); -var LOW_PRIORITY = 500; -function Overlays(config, eventBus, canvas, elementRegistry) { - this._eventBus = eventBus; - this._canvas = canvas; - this._elementRegistry = elementRegistry; - this._ids = ids; - this._overlayDefaults = assign({ - // no show constraints - show: null, - // always scale - scale: true - }, config && config.defaults); - this._overlays = {}; - this._overlayContainers = []; - this._overlayRoot = createRoot(canvas.getContainer()); - this._init(); -} -Overlays.$inject = [ - "config.overlays", - "eventBus", - "canvas", - "elementRegistry" -]; -Overlays.prototype.get = function(search) { - if (isString(search)) { - search = { id: search }; - } - if (isString(search.element)) { - search.element = this._elementRegistry.get(search.element); - } - if (search.element) { - var container = this._getOverlayContainer(search.element, true); - if (container) { - return search.type ? filter(container.overlays, matchPattern({ type: search.type })) : container.overlays.slice(); - } else { - return []; - } - } else if (search.type) { - return filter(this._overlays, matchPattern({ type: search.type })); - } else { - return search.id ? this._overlays[search.id] : null; - } -}; -Overlays.prototype.add = function(element, type, overlay) { - if (isObject(type)) { - overlay = type; - type = null; - } - if (!element.id) { - element = this._elementRegistry.get(element); - } - if (!overlay.position) { - throw new Error("must specifiy overlay position"); - } - if (!overlay.html) { - throw new Error("must specifiy overlay html"); - } - if (!element) { - throw new Error("invalid element specified"); - } - var id = this._ids.next(); - overlay = assign({}, this._overlayDefaults, overlay, { - id, - type, - element, - html: overlay.html - }); - this._addOverlay(overlay); - return id; -}; -Overlays.prototype.remove = function(filter2) { - var overlays = this.get(filter2) || []; - if (!isArray(overlays)) { - overlays = [overlays]; - } - var self = this; - forEach(overlays, function(overlay) { - var container = self._getOverlayContainer(overlay.element, true); - if (overlay) { - remove(overlay.html); - remove(overlay.htmlContainer); - delete overlay.htmlContainer; - delete overlay.element; - delete self._overlays[overlay.id]; - } - if (container) { - var idx = container.overlays.indexOf(overlay); - if (idx !== -1) { - container.overlays.splice(idx, 1); - } - } - }); -}; -Overlays.prototype.isShown = function() { - return this._overlayRoot.style.display !== "none"; -}; -Overlays.prototype.show = function() { - setVisible(this._overlayRoot); -}; -Overlays.prototype.hide = function() { - setVisible(this._overlayRoot, false); -}; -Overlays.prototype.clear = function() { - this._overlays = {}; - this._overlayContainers = []; - clear(this._overlayRoot); -}; -Overlays.prototype._updateOverlayContainer = function(container) { - var element = container.element, html = container.html; - var x = element.x, y = element.y; - if (element.waypoints) { - var bbox = getBBox(element); - x = bbox.x; - y = bbox.y; - } - setPosition(html, x, y); - attr(container.html, "data-container-id", element.id); -}; -Overlays.prototype._updateOverlay = function(overlay) { - var position = overlay.position, htmlContainer = overlay.htmlContainer, element = overlay.element; - var left = position.left, top = position.top; - if (position.right !== void 0) { - var width; - if (element.waypoints) { - width = getBBox(element).width; - } else { - width = element.width; - } - left = position.right * -1 + width; - } - if (position.bottom !== void 0) { - var height; - if (element.waypoints) { - height = getBBox(element).height; - } else { - height = element.height; - } - top = position.bottom * -1 + height; - } - setPosition(htmlContainer, left || 0, top || 0); - this._updateOverlayVisibilty(overlay, this._canvas.viewbox()); -}; -Overlays.prototype._createOverlayContainer = function(element) { - var html = domify$1('
'); - assign2(html, { position: "absolute" }); - this._overlayRoot.appendChild(html); - var container = { - html, - element, - overlays: [] - }; - this._updateOverlayContainer(container); - this._overlayContainers.push(container); - return container; -}; -Overlays.prototype._updateRoot = function(viewbox) { - var scale = viewbox.scale || 1; - var matrix = "matrix(" + [ - scale, - 0, - 0, - scale, - -1 * viewbox.x * scale, - -1 * viewbox.y * scale - ].join(",") + ")"; - setTransform(this._overlayRoot, matrix); -}; -Overlays.prototype._getOverlayContainer = function(element, raw) { - var container = find(this._overlayContainers, function(c) { - return c.element === element; - }); - if (!container && !raw) { - return this._createOverlayContainer(element); - } - return container; -}; -Overlays.prototype._addOverlay = function(overlay) { - var id = overlay.id, element = overlay.element, html = overlay.html, htmlContainer, overlayContainer; - if (html.get && html.constructor.prototype.jquery) { - html = html.get(0); - } - if (isString(html)) { - html = domify$1(html); - } - overlayContainer = this._getOverlayContainer(element); - htmlContainer = domify$1('
'); - assign2(htmlContainer, { position: "absolute" }); - htmlContainer.appendChild(html); - if (overlay.type) { - classes(htmlContainer).add("djs-overlay-" + overlay.type); - } - var elementRoot = this._canvas.findRoot(element); - var activeRoot = this._canvas.getRootElement(); - setVisible(htmlContainer, elementRoot === activeRoot); - overlay.htmlContainer = htmlContainer; - overlayContainer.overlays.push(overlay); - overlayContainer.html.appendChild(htmlContainer); - this._overlays[id] = overlay; - this._updateOverlay(overlay); - this._updateOverlayVisibilty(overlay, this._canvas.viewbox()); -}; -Overlays.prototype._updateOverlayVisibilty = function(overlay, viewbox) { - var show = overlay.show, rootElement = this._canvas.findRoot(overlay.element), minZoom = show && show.minZoom, maxZoom = show && show.maxZoom, htmlContainer = overlay.htmlContainer, activeRootElement = this._canvas.getRootElement(), visible = true; - if (rootElement !== activeRootElement) { - visible = false; - } else if (show) { - if (isDefined(minZoom) && minZoom > viewbox.scale || isDefined(maxZoom) && maxZoom < viewbox.scale) { - visible = false; - } - } - setVisible(htmlContainer, visible); - this._updateOverlayScale(overlay, viewbox); -}; -Overlays.prototype._updateOverlayScale = function(overlay, viewbox) { - var shouldScale = overlay.scale, minScale, maxScale, htmlContainer = overlay.htmlContainer; - var scale, transform3 = ""; - if (shouldScale !== true) { - if (shouldScale === false) { - minScale = 1; - maxScale = 1; - } else { - minScale = shouldScale.min; - maxScale = shouldScale.max; - } - if (isDefined(minScale) && viewbox.scale < minScale) { - scale = (1 / viewbox.scale || 1) * minScale; - } - if (isDefined(maxScale) && viewbox.scale > maxScale) { - scale = (1 / viewbox.scale || 1) * maxScale; - } - } - if (isDefined(scale)) { - transform3 = "scale(" + scale + "," + scale + ")"; - } - setTransform(htmlContainer, transform3); -}; -Overlays.prototype._updateOverlaysVisibilty = function(viewbox) { - var self = this; - forEach(this._overlays, function(overlay) { - self._updateOverlayVisibilty(overlay, viewbox); - }); -}; -Overlays.prototype._init = function() { - var eventBus = this._eventBus; - var self = this; - function updateViewbox(viewbox) { - self._updateRoot(viewbox); - self._updateOverlaysVisibilty(viewbox); - self.show(); - } - eventBus.on("canvas.viewbox.changing", function(event2) { - self.hide(); - }); - eventBus.on("canvas.viewbox.changed", function(event2) { - updateViewbox(event2.viewbox); - }); - eventBus.on(["shape.remove", "connection.remove"], function(e2) { - var element = e2.element; - var overlays = self.get({ element }); - forEach(overlays, function(o) { - self.remove(o.id); - }); - var container = self._getOverlayContainer(element); - if (container) { - remove(container.html); - var i = self._overlayContainers.indexOf(container); - if (i !== -1) { - self._overlayContainers.splice(i, 1); - } - } - }); - eventBus.on("element.changed", LOW_PRIORITY, function(e2) { - var element = e2.element; - var container = self._getOverlayContainer(element, true); - if (container) { - forEach(container.overlays, function(overlay) { - self._updateOverlay(overlay); - }); - self._updateOverlayContainer(container); - } - }); - eventBus.on("element.marker.update", function(e2) { - var container = self._getOverlayContainer(e2.element, true); - if (container) { - classes(container.html)[e2.add ? "add" : "remove"](e2.marker); - } - }); - eventBus.on("root.set", function() { - self._updateOverlaysVisibilty(self._canvas.viewbox()); - }); - eventBus.on("diagram.clear", this.clear, this); -}; -function createRoot(parentNode) { - var root = domify$1( - '
' - ); - assign2(root, { - position: "absolute", - width: 0, - height: 0 - }); - parentNode.insertBefore(root, parentNode.firstChild); - return root; -} -function setPosition(el, x, y) { - assign2(el, { left: x + "px", top: y + "px" }); -} -function setVisible(el, visible) { - el.style.display = visible === false ? "none" : ""; -} -function setTransform(el, transform3) { - el.style["transform-origin"] = "top left"; - ["", "-ms-", "-webkit-"].forEach(function(prefix2) { - el.style[prefix2 + "transform"] = transform3; - }); -} - -// node_modules/.pnpm/diagram-js@14.11.3/node_modules/diagram-js/lib/features/overlays/index.js -var overlays_default = { - __init__: ["overlays"], - overlays: ["type", Overlays] -}; - -// node_modules/.pnpm/diagram-js@14.11.3/node_modules/diagram-js/lib/features/change-support/ChangeSupport.js -function ChangeSupport(eventBus, canvas, elementRegistry, graphicsFactory) { - eventBus.on("element.changed", function(event2) { - var element = event2.element; - if (element.parent || element === canvas.getRootElement()) { - event2.gfx = elementRegistry.getGraphics(element); - } - if (!event2.gfx) { - return; - } - eventBus.fire(getType(element) + ".changed", event2); - }); - eventBus.on("elements.changed", function(event2) { - var elements = event2.elements; - elements.forEach(function(e2) { - eventBus.fire("element.changed", { element: e2 }); - }); - graphicsFactory.updateContainments(elements); - }); - eventBus.on("shape.changed", function(event2) { - graphicsFactory.update("shape", event2.element, event2.gfx); - }); - eventBus.on("connection.changed", function(event2) { - graphicsFactory.update("connection", event2.element, event2.gfx); - }); -} -ChangeSupport.$inject = [ - "eventBus", - "canvas", - "elementRegistry", - "graphicsFactory" -]; - -// node_modules/.pnpm/diagram-js@14.11.3/node_modules/diagram-js/lib/features/change-support/index.js -var change_support_default = { - __init__: ["changeSupport"], - changeSupport: ["type", ChangeSupport] -}; - -// node_modules/.pnpm/diagram-js@14.11.3/node_modules/diagram-js/lib/command/CommandInterceptor.js -var DEFAULT_PRIORITY = 1e3; -function CommandInterceptor(eventBus) { - this._eventBus = eventBus; -} -CommandInterceptor.$inject = ["eventBus"]; -function unwrapEvent(fn, that) { - return function(event2) { - return fn.call(that || null, event2.context, event2.command, event2); - }; -} -CommandInterceptor.prototype.on = function(events, hook, priority, handlerFn, unwrap, that) { - if (isFunction(hook) || isNumber(hook)) { - that = unwrap; - unwrap = handlerFn; - handlerFn = priority; - priority = hook; - hook = null; - } - if (isFunction(priority)) { - that = unwrap; - unwrap = handlerFn; - handlerFn = priority; - priority = DEFAULT_PRIORITY; - } - if (isObject(unwrap)) { - that = unwrap; - unwrap = false; - } - if (!isFunction(handlerFn)) { - throw new Error("handlerFn must be a function"); - } - if (!isArray(events)) { - events = [events]; - } - var eventBus = this._eventBus; - forEach(events, function(event2) { - var fullEvent = ["commandStack", event2, hook].filter(function(e2) { - return e2; - }).join("."); - eventBus.on(fullEvent, priority, unwrap ? unwrapEvent(handlerFn, that) : handlerFn, that); - }); -}; -CommandInterceptor.prototype.canExecute = createHook("canExecute"); -CommandInterceptor.prototype.preExecute = createHook("preExecute"); -CommandInterceptor.prototype.preExecuted = createHook("preExecuted"); -CommandInterceptor.prototype.execute = createHook("execute"); -CommandInterceptor.prototype.executed = createHook("executed"); -CommandInterceptor.prototype.postExecute = createHook("postExecute"); -CommandInterceptor.prototype.postExecuted = createHook("postExecuted"); -CommandInterceptor.prototype.revert = createHook("revert"); -CommandInterceptor.prototype.reverted = createHook("reverted"); -function createHook(hook) { - const hookFn = function(events, priority, handlerFn, unwrap, that) { - if (isFunction(events) || isNumber(events)) { - that = unwrap; - unwrap = handlerFn; - handlerFn = priority; - priority = events; - events = null; - } - this.on(events, hook, priority, handlerFn, unwrap, that); - }; - return hookFn; -} - -// node_modules/.pnpm/diagram-js@14.11.3/node_modules/diagram-js/lib/features/root-elements/RootElementsBehavior.js -function RootElementsBehavior(canvas, injector) { - injector.invoke(CommandInterceptor, this); - this.executed(function(event2) { - var context = event2.context; - if (context.rootElement) { - canvas.setRootElement(context.rootElement); - } else { - context.rootElement = canvas.getRootElement(); - } - }); - this.revert(function(event2) { - var context = event2.context; - if (context.rootElement) { - canvas.setRootElement(context.rootElement); - } - }); -} -e(RootElementsBehavior, CommandInterceptor); -RootElementsBehavior.$inject = ["canvas", "injector"]; - -// node_modules/.pnpm/diagram-js@14.11.3/node_modules/diagram-js/lib/features/root-elements/index.js -var root_elements_default = { - __init__: ["rootElementsBehavior"], - rootElementsBehavior: ["type", RootElementsBehavior] -}; - -// node_modules/.pnpm/diagram-js@14.11.3/node_modules/diagram-js/lib/util/EscapeUtil.js -function escapeCSS(str) { - return CSS.escape(str); -} -var HTML_ESCAPE_MAP = { - "&": "&", - "<": "<", - ">": ">", - '"': """, - "'": "'" -}; -function escapeHTML(str) { - str = "" + str; - return str && str.replace(/[&<>"']/g, function(match) { - return HTML_ESCAPE_MAP[match]; - }); -} - -// node_modules/.pnpm/bpmn-js@17.11.1/node_modules/bpmn-js/lib/util/DrilldownUtil.js -var planeSuffix = "_plane"; -function getShapeIdFromPlane(element) { - var id = element.id; - return removePlaneSuffix(id); -} -function getPlaneIdFromShape(element) { - var id = element.id; - if (is(element, "bpmn:SubProcess")) { - return addPlaneSuffix(id); - } - return id; -} -function toPlaneId(id) { - return addPlaneSuffix(id); -} -function isPlane(element) { - var di = getDi(element); - return is(di, "bpmndi:BPMNPlane"); -} -function addPlaneSuffix(id) { - return id + planeSuffix; -} -function removePlaneSuffix(id) { - return id.replace(new RegExp(planeSuffix + "$"), ""); -} - -// node_modules/.pnpm/bpmn-js@17.11.1/node_modules/bpmn-js/lib/features/drilldown/DrilldownBreadcrumbs.js -var OPEN_CLASS = "bjs-breadcrumbs-shown"; -function DrilldownBreadcrumbs(eventBus, elementRegistry, canvas) { - var breadcrumbs = domify$1('
    '); - var container = canvas.getContainer(); - var containerClasses = classes(container); - container.appendChild(breadcrumbs); - var businessObjectParents = []; - eventBus.on("element.changed", function(event2) { - var shape = event2.element, businessObject = getBusinessObject(shape); - var isPresent = find(businessObjectParents, function(element) { - return element === businessObject; - }); - if (!isPresent) { - return; - } - updateBreadcrumbs(); - }); - function updateBreadcrumbs(element) { - if (element) { - businessObjectParents = getBusinessObjectParentChain(element); - } - var path = businessObjectParents.flatMap(function(parent) { - var parentPlane = canvas.findRoot(getPlaneIdFromShape(parent)) || canvas.findRoot(parent.id); - if (!parentPlane && is(parent, "bpmn:Process")) { - var participant = elementRegistry.find(function(element2) { - var businessObject = getBusinessObject(element2); - return businessObject && businessObject.get("processRef") === parent; - }); - parentPlane = participant && canvas.findRoot(participant.id); - } - if (!parentPlane) { - return []; - } - var title = escapeHTML(parent.name || parent.id); - var link = domify$1('
  • ' + title + "
  • "); - link.addEventListener("click", function() { - canvas.setRootElement(parentPlane); - }); - return link; - }); - breadcrumbs.innerHTML = ""; - var visible = path.length > 1; - containerClasses.toggle(OPEN_CLASS, visible); - path.forEach(function(element2) { - breadcrumbs.appendChild(element2); - }); - } - eventBus.on("root.set", function(event2) { - updateBreadcrumbs(event2.element); - }); -} -DrilldownBreadcrumbs.$inject = ["eventBus", "elementRegistry", "canvas"]; -function getBusinessObjectParentChain(child) { - var businessObject = getBusinessObject(child); - var parents = []; - for (var element = businessObject; element; element = element.$parent) { - if (is(element, "bpmn:SubProcess") || is(element, "bpmn:Process")) { - parents.push(element); - } - } - return parents.reverse(); -} - -// node_modules/.pnpm/bpmn-js@17.11.1/node_modules/bpmn-js/lib/features/drilldown/DrilldownCentering.js -function DrilldownCentering(eventBus, canvas) { - var currentRoot = null; - var positionMap = new Map(); - eventBus.on("root.set", function(event2) { - var newRoot = event2.element; - var currentViewbox = canvas.viewbox(); - var storedViewbox = positionMap.get(newRoot); - positionMap.set(currentRoot, { - x: currentViewbox.x, - y: currentViewbox.y, - zoom: currentViewbox.scale - }); - currentRoot = newRoot; - if (!is(newRoot, "bpmn:SubProcess") && !storedViewbox) { - return; - } - storedViewbox = storedViewbox || { x: 0, y: 0, zoom: 1 }; - var dx = (currentViewbox.x - storedViewbox.x) * currentViewbox.scale, dy = (currentViewbox.y - storedViewbox.y) * currentViewbox.scale; - if (dx !== 0 || dy !== 0) { - canvas.scroll({ - dx, - dy - }); - } - if (storedViewbox.zoom !== currentViewbox.scale) { - canvas.zoom(storedViewbox.zoom, { x: 0, y: 0 }); - } - }); - eventBus.on("diagram.clear", function() { - positionMap.clear(); - currentRoot = null; - }); -} -DrilldownCentering.$inject = ["eventBus", "canvas"]; -function Map() { - this._entries = []; - this.set = function(key, value) { - var found = false; - for (var k in this._entries) { - if (this._entries[k][0] === key) { - this._entries[k][1] = value; - found = true; - break; - } - } - if (!found) { - this._entries.push([key, value]); - } - }; - this.get = function(key) { - for (var k in this._entries) { - if (this._entries[k][0] === key) { - return this._entries[k][1]; - } - } - return null; - }; - this.clear = function() { - this._entries.length = 0; - }; - this.remove = function(key) { - var idx = -1; - for (var k in this._entries) { - if (this._entries[k][0] === key) { - idx = k; - break; - } - } - if (idx !== -1) { - this._entries.splice(idx, 1); - } - }; -} - -// node_modules/.pnpm/bpmn-js@17.11.1/node_modules/bpmn-js/lib/features/drilldown/SubprocessCompatibility.js -var DEFAULT_POSITION = { - x: 180, - y: 160 -}; -function SubprocessCompatibility(eventBus, moddle) { - this._eventBus = eventBus; - this._moddle = moddle; - var self = this; - eventBus.on("import.render.start", 1500, function(e2, context) { - self._handleImport(context.definitions); - }); -} -SubprocessCompatibility.prototype._handleImport = function(definitions) { - if (!definitions.diagrams) { - return; - } - var self = this; - this._definitions = definitions; - this._processToDiagramMap = {}; - definitions.diagrams.forEach(function(diagram) { - if (!diagram.plane || !diagram.plane.bpmnElement) { - return; - } - self._processToDiagramMap[diagram.plane.bpmnElement.id] = diagram; - }); - var newDiagrams = definitions.diagrams.filter((diagram) => diagram.plane).flatMap((diagram) => self._createNewDiagrams(diagram.plane)); - newDiagrams.forEach(function(diagram) { - self._movePlaneElementsToOrigin(diagram.plane); - }); -}; -SubprocessCompatibility.prototype._createNewDiagrams = function(plane) { - var self = this; - var collapsedElements = []; - var elementsToMove = []; - plane.get("planeElement").forEach(function(diElement) { - var businessObject = diElement.bpmnElement; - if (!businessObject) { - return; - } - var parent = businessObject.$parent; - if (is(businessObject, "bpmn:SubProcess") && !diElement.isExpanded) { - collapsedElements.push(businessObject); - } - if (shouldMoveToPlane(businessObject, plane)) { - elementsToMove.push({ diElement, parent }); - } - }); - var newDiagrams = []; - collapsedElements.forEach(function(element) { - if (!self._processToDiagramMap[element.id]) { - var diagram = self._createDiagram(element); - self._processToDiagramMap[element.id] = diagram; - newDiagrams.push(diagram); - } - }); - elementsToMove.forEach(function(element) { - var diElement = element.diElement; - var parent = element.parent; - while (parent && collapsedElements.indexOf(parent) === -1) { - parent = parent.$parent; - } - if (!parent) { - return; - } - var diagram = self._processToDiagramMap[parent.id]; - self._moveToDiPlane(diElement, diagram.plane); - }); - return newDiagrams; -}; -SubprocessCompatibility.prototype._movePlaneElementsToOrigin = function(plane) { - var elements = plane.get("planeElement"); - var planeBounds = getPlaneBounds(plane); - var offset = { - x: planeBounds.x - DEFAULT_POSITION.x, - y: planeBounds.y - DEFAULT_POSITION.y - }; - elements.forEach(function(diElement) { - if (diElement.waypoint) { - diElement.waypoint.forEach(function(waypoint) { - waypoint.x = waypoint.x - offset.x; - waypoint.y = waypoint.y - offset.y; - }); - } else if (diElement.bounds) { - diElement.bounds.x = diElement.bounds.x - offset.x; - diElement.bounds.y = diElement.bounds.y - offset.y; - } - }); -}; -SubprocessCompatibility.prototype._moveToDiPlane = function(diElement, newPlane) { - var containingDiagram = findRootDiagram(diElement); - var parentPlaneElement = containingDiagram.plane.get("planeElement"); - parentPlaneElement.splice(parentPlaneElement.indexOf(diElement), 1); - newPlane.get("planeElement").push(diElement); -}; -SubprocessCompatibility.prototype._createDiagram = function(businessObject) { - var plane = this._moddle.create("bpmndi:BPMNPlane", { - bpmnElement: businessObject - }); - var diagram = this._moddle.create("bpmndi:BPMNDiagram", { - plane - }); - plane.$parent = diagram; - plane.bpmnElement = businessObject; - diagram.$parent = this._definitions; - this._definitions.diagrams.push(diagram); - return diagram; -}; -SubprocessCompatibility.$inject = ["eventBus", "moddle"]; -function findRootDiagram(element) { - if (is(element, "bpmndi:BPMNDiagram")) { - return element; - } else { - return findRootDiagram(element.$parent); - } -} -function getPlaneBounds(plane) { - var planeTrbl = { - top: Infinity, - right: -Infinity, - bottom: -Infinity, - left: Infinity - }; - plane.planeElement.forEach(function(element) { - if (!element.bounds) { - return; - } - var trbl = asTRBL(element.bounds); - planeTrbl.top = Math.min(trbl.top, planeTrbl.top); - planeTrbl.left = Math.min(trbl.left, planeTrbl.left); - }); - return asBounds(planeTrbl); -} -function shouldMoveToPlane(businessObject, plane) { - var parent = businessObject.$parent; - if (!is(parent, "bpmn:SubProcess") || parent === plane.bpmnElement) { - return false; - } - if (isAny(businessObject, ["bpmn:DataInputAssociation", "bpmn:DataOutputAssociation"])) { - return false; - } - return true; -} - -// node_modules/.pnpm/bpmn-js@17.11.1/node_modules/bpmn-js/lib/features/drilldown/DrilldownOverlayBehavior.js -var LOW_PRIORITY2 = 250; -var ARROW_DOWN_SVG = ''; -var EMPTY_MARKER = "bjs-drilldown-empty"; -function DrilldownOverlayBehavior(canvas, eventBus, elementRegistry, overlays, translate3) { - CommandInterceptor.call(this, eventBus); - this._canvas = canvas; - this._eventBus = eventBus; - this._elementRegistry = elementRegistry; - this._overlays = overlays; - this._translate = translate3; - var self = this; - this.executed("shape.toggleCollapse", LOW_PRIORITY2, function(context) { - var shape = context.shape; - if (self._canDrillDown(shape)) { - self._addOverlay(shape); - } else { - self._removeOverlay(shape); - } - }, true); - this.reverted("shape.toggleCollapse", LOW_PRIORITY2, function(context) { - var shape = context.shape; - if (self._canDrillDown(shape)) { - self._addOverlay(shape); - } else { - self._removeOverlay(shape); - } - }, true); - this.executed( - ["shape.create", "shape.move", "shape.delete"], - LOW_PRIORITY2, - function(context) { - var oldParent = context.oldParent, newParent = context.newParent || context.parent, shape = context.shape; - if (self._canDrillDown(shape)) { - self._addOverlay(shape); - } - self._updateDrilldownOverlay(oldParent); - self._updateDrilldownOverlay(newParent); - self._updateDrilldownOverlay(shape); - }, - true - ); - this.reverted( - ["shape.create", "shape.move", "shape.delete"], - LOW_PRIORITY2, - function(context) { - var oldParent = context.oldParent, newParent = context.newParent || context.parent, shape = context.shape; - if (self._canDrillDown(shape)) { - self._addOverlay(shape); - } - self._updateDrilldownOverlay(oldParent); - self._updateDrilldownOverlay(newParent); - self._updateDrilldownOverlay(shape); - }, - true - ); - eventBus.on("import.render.complete", function() { - elementRegistry.filter(function(e2) { - return self._canDrillDown(e2); - }).map(function(el) { - self._addOverlay(el); - }); - }); -} -e(DrilldownOverlayBehavior, CommandInterceptor); -DrilldownOverlayBehavior.prototype._updateDrilldownOverlay = function(shape) { - var canvas = this._canvas; - if (!shape) { - return; - } - var root = canvas.findRoot(shape); - if (root) { - this._updateOverlayVisibility(root); - } -}; -DrilldownOverlayBehavior.prototype._canDrillDown = function(element) { - var canvas = this._canvas; - return is(element, "bpmn:SubProcess") && canvas.findRoot(getPlaneIdFromShape(element)); -}; -DrilldownOverlayBehavior.prototype._updateOverlayVisibility = function(element) { - var overlays = this._overlays; - var businessObject = getBusinessObject(element); - var overlay = overlays.get({ element: businessObject.id, type: "drilldown" })[0]; - if (!overlay) { - return; - } - var hasFlowElements = businessObject && businessObject.get("flowElements") && businessObject.get("flowElements").length; - classes(overlay.html).toggle(EMPTY_MARKER, !hasFlowElements); -}; -DrilldownOverlayBehavior.prototype._addOverlay = function(element) { - var canvas = this._canvas, overlays = this._overlays, bo = getBusinessObject(element); - var existingOverlays = overlays.get({ element, type: "drilldown" }); - if (existingOverlays.length) { - this._removeOverlay(element); - } - var button = domify$1('"), elementName = bo.get("name") || bo.get("id"), title = this._translate("Open {element}", { element: elementName }); - button.setAttribute("title", title); - button.addEventListener("click", function() { - canvas.setRootElement(canvas.findRoot(getPlaneIdFromShape(element))); - }); - overlays.add(element, "drilldown", { - position: { - bottom: -7, - right: -8 - }, - html: button - }); - this._updateOverlayVisibility(element); -}; -DrilldownOverlayBehavior.prototype._removeOverlay = function(element) { - var overlays = this._overlays; - overlays.remove({ - element, - type: "drilldown" - }); -}; -DrilldownOverlayBehavior.$inject = [ - "canvas", - "eventBus", - "elementRegistry", - "overlays", - "translate" -]; - -// node_modules/.pnpm/bpmn-js@17.11.1/node_modules/bpmn-js/lib/features/drilldown/index.js -var drilldown_default = { - __depends__: [overlays_default, change_support_default, root_elements_default], - __init__: ["drilldownBreadcrumbs", "drilldownOverlayBehavior", "drilldownCentering", "subprocessCompatibility"], - drilldownBreadcrumbs: ["type", DrilldownBreadcrumbs], - drilldownCentering: ["type", DrilldownCentering], - drilldownOverlayBehavior: ["type", DrilldownOverlayBehavior], - subprocessCompatibility: ["type", SubprocessCompatibility] -}; - -// node_modules/.pnpm/diagram-js@14.11.3/node_modules/diagram-js/lib/features/outline/Outline.js -var LOW_PRIORITY3 = 500; -var DEFAULT_PRIORITY2 = 1e3; -function Outline(eventBus, styles) { - this._eventBus = eventBus; - this.offset = 5; - var OUTLINE_STYLE = styles.cls("djs-outline", ["no-fill"]); - var self = this; - function createOutline(gfx) { - var outline = create("rect"); - attr2(outline, assign({ - x: 0, - y: 0, - rx: 4, - width: 100, - height: 100 - }, OUTLINE_STYLE)); - return outline; - } - eventBus.on(["shape.added", "shape.changed"], LOW_PRIORITY3, function(event2) { - var element = event2.element, gfx = event2.gfx; - var outline = query(".djs-outline", gfx); - if (!outline) { - outline = self.getOutline(element) || createOutline(gfx); - append(gfx, outline); - } - self.updateShapeOutline(outline, element); - }); - eventBus.on(["connection.added", "connection.changed"], function(event2) { - var element = event2.element, gfx = event2.gfx; - var outline = query(".djs-outline", gfx); - if (!outline) { - outline = createOutline(gfx); - append(gfx, outline); - } - self.updateConnectionOutline(outline, element); - }); -} -Outline.prototype.updateShapeOutline = function(outline, element) { - var updated = false; - var providers = this._getProviders(); - if (providers.length) { - forEach(providers, function(provider) { - updated = updated || provider.updateOutline(element, outline); - }); - } - if (!updated) { - attr2(outline, { - x: -this.offset, - y: -this.offset, - width: element.width + this.offset * 2, - height: element.height + this.offset * 2 - }); - } -}; -Outline.prototype.updateConnectionOutline = function(outline, connection) { - var bbox = getBBox(connection); - attr2(outline, { - x: bbox.x - this.offset, - y: bbox.y - this.offset, - width: bbox.width + this.offset * 2, - height: bbox.height + this.offset * 2 - }); -}; -Outline.prototype.registerProvider = function(priority, provider) { - if (!provider) { - provider = priority; - priority = DEFAULT_PRIORITY2; - } - this._eventBus.on("outline.getProviders", priority, function(event2) { - event2.providers.push(provider); - }); -}; -Outline.prototype._getProviders = function() { - var event2 = this._eventBus.createEvent({ - type: "outline.getProviders", - providers: [] - }); - this._eventBus.fire(event2); - return event2.providers; -}; -Outline.prototype.getOutline = function(element) { - var outline; - var providers = this._getProviders(); - forEach(providers, function(provider) { - if (!isFunction(provider.getOutline)) { - return; - } - outline = outline || provider.getOutline(element); - }); - return outline; -}; -Outline.$inject = ["eventBus", "styles", "elementRegistry"]; - -// node_modules/.pnpm/diagram-js@14.11.3/node_modules/diagram-js/lib/features/outline/index.js -var outline_default = { - __init__: ["outline"], - outline: ["type", Outline] -}; - -// node_modules/.pnpm/bpmn-js@17.11.1/node_modules/bpmn-js/lib/features/outline/OutlineUtil.js -var DATA_OBJECT_REFERENCE_OUTLINE_PATH = "M44.7648 11.3263L36.9892 2.64074C36.0451 1.58628 34.5651 0.988708 33.1904 0.988708H5.98667C3.22688 0.988708 0.989624 3.34892 0.989624 6.26039V55.0235C0.989624 57.9349 3.22688 60.2952 5.98667 60.2952H40.966C43.7257 60.2952 45.963 57.9349 45.963 55.0235V14.9459C45.963 13.5998 45.6407 12.3048 44.7648 11.3263Z"; -var DATA_STORE_REFERENCE_OUTLINE_PATH = "M1.03845 48.1347C1.03845 49.3511 1.07295 50.758 1.38342 52.064C1.69949 53.3938 2.32428 54.7154 3.56383 55.6428C6.02533 57.4841 10.1161 58.7685 14.8212 59.6067C19.5772 60.4538 25.1388 60.8738 30.6831 60.8738C36.2276 60.8738 41.7891 60.4538 46.545 59.6067C51.2504 58.7687 55.3412 57.4842 57.8028 55.6429C59.0424 54.7156 59.6673 53.3938 59.9834 52.064C60.2938 50.7579 60.3285 49.351 60.3285 48.1344V13.8415C60.3285 12.6249 60.2938 11.218 59.9834 9.91171C59.6673 8.58194 59.0423 7.2602 57.8027 6.33294C55.341 4.49168 51.2503 3.20723 46.545 2.36914C41.7891 1.522 36.2276 1.10204 30.6831 1.10205C25.1388 1.10206 19.5772 1.52206 14.8213 2.36923C10.1162 3.20734 6.02543 4.49183 3.5639 6.33314C2.32433 7.26038 1.69951 8.58206 1.38343 9.91181C1.07295 11.2179 1.03845 12.6247 1.03845 13.8411V48.1347Z"; -var DATA_OBJECT_REFERENCE_STANDARD_SIZE = { width: 36, height: 50 }; -var DATA_STORE_REFERENCE_STANDARD_SIZE = { width: 50, height: 50 }; -function createPath(path, attrs, OUTLINE_STYLE) { - return create("path", { - d: path, - strokeWidth: 2, - transform: `translate(${attrs.x}, ${attrs.y})`, - ...OUTLINE_STYLE - }); -} - -// node_modules/.pnpm/bpmn-js@17.11.1/node_modules/bpmn-js/lib/features/outline/OutlineProvider.js -var DEFAULT_OFFSET = 5; -function OutlineProvider(outline, styles) { - this._styles = styles; - outline.registerProvider(this); -} -OutlineProvider.$inject = [ - "outline", - "styles" -]; -OutlineProvider.prototype.getOutline = function(element) { - const OUTLINE_STYLE = this._styles.cls("djs-outline", ["no-fill"]); - var outline; - if (isLabel(element)) { - return; - } - if (is(element, "bpmn:Gateway")) { - outline = create("rect"); - assign(outline.style, { - "transform-box": "fill-box", - "transform": "rotate(45deg)", - "transform-origin": "center" - }); - attr2(outline, assign({ - x: 2, - y: 2, - rx: 4, - width: element.width - 4, - height: element.height - 4 - }, OUTLINE_STYLE)); - } else if (isAny(element, ["bpmn:Task", "bpmn:SubProcess", "bpmn:Group", "bpmn:CallActivity"])) { - outline = create("rect"); - attr2(outline, assign({ - x: -DEFAULT_OFFSET, - y: -DEFAULT_OFFSET, - rx: 14, - width: element.width + DEFAULT_OFFSET * 2, - height: element.height + DEFAULT_OFFSET * 2 - }, OUTLINE_STYLE)); - } else if (is(element, "bpmn:EndEvent")) { - outline = create("circle"); - attr2(outline, assign({ - cx: element.width / 2, - cy: element.height / 2, - r: element.width / 2 + DEFAULT_OFFSET + 1 - }, OUTLINE_STYLE)); - } else if (is(element, "bpmn:Event")) { - outline = create("circle"); - attr2(outline, assign({ - cx: element.width / 2, - cy: element.height / 2, - r: element.width / 2 + DEFAULT_OFFSET - }, OUTLINE_STYLE)); - } else if (is(element, "bpmn:DataObjectReference") && isStandardSize(element, "bpmn:DataObjectReference")) { - outline = createPath( - DATA_OBJECT_REFERENCE_OUTLINE_PATH, - { x: -6, y: -6 }, - OUTLINE_STYLE - ); - } else if (is(element, "bpmn:DataStoreReference") && isStandardSize(element, "bpmn:DataStoreReference")) { - outline = createPath( - DATA_STORE_REFERENCE_OUTLINE_PATH, - { x: -6, y: -6 }, - OUTLINE_STYLE - ); - } - return outline; -}; -OutlineProvider.prototype.updateOutline = function(element, outline) { - if (isLabel(element)) { - return; - } - if (isAny(element, ["bpmn:SubProcess", "bpmn:Group"])) { - attr2(outline, { - width: element.width + DEFAULT_OFFSET * 2, - height: element.height + DEFAULT_OFFSET * 2 - }); - return true; - } else if (isAny(element, [ - "bpmn:Event", - "bpmn:Gateway", - "bpmn:DataStoreReference", - "bpmn:DataObjectReference" - ])) { - return true; - } - return false; -}; -function isStandardSize(element, type) { - var standardSize; - if (type === "bpmn:DataObjectReference") { - standardSize = DATA_OBJECT_REFERENCE_STANDARD_SIZE; - } else if (type === "bpmn:DataStoreReference") { - standardSize = DATA_STORE_REFERENCE_STANDARD_SIZE; - } - return element.width === standardSize.width && element.height === standardSize.height; -} - -// node_modules/.pnpm/bpmn-js@17.11.1/node_modules/bpmn-js/lib/features/outline/index.js -var outline_default2 = { - __depends__: [ - outline_default - ], - __init__: ["outlineProvider"], - outlineProvider: ["type", OutlineProvider] -}; - -// node_modules/.pnpm/diagram-js@14.11.3/node_modules/diagram-js/lib/util/Event.js -function __stopPropagation(event2) { - if (!event2 || typeof event2.stopPropagation !== "function") { - return; - } - event2.stopPropagation(); -} -function getOriginal(event2) { - return event2.originalEvent || event2.srcEvent; -} -function stopPropagation(event2) { - __stopPropagation(event2); - __stopPropagation(getOriginal(event2)); -} -function toPoint(event2) { - if (event2.pointers && event2.pointers.length) { - event2 = event2.pointers[0]; - } - if (event2.touches && event2.touches.length) { - event2 = event2.touches[0]; - } - return event2 ? { - x: event2.clientX, - y: event2.clientY - } : null; -} - -// node_modules/.pnpm/diagram-js@14.11.3/node_modules/diagram-js/lib/util/Platform.js -function isMac() { - return /mac/i.test(navigator.platform); -} - -// node_modules/.pnpm/diagram-js@14.11.3/node_modules/diagram-js/lib/util/Mouse.js -function isButton(event2, button) { - return (getOriginal(event2) || event2).button === button; -} -function isPrimaryButton(event2) { - return isButton(event2, 0); -} -function isAuxiliaryButton(event2) { - return isButton(event2, 1); -} -function hasPrimaryModifier(event2) { - var originalEvent = getOriginal(event2) || event2; - if (!isPrimaryButton(event2)) { - return false; - } - if (isMac()) { - return originalEvent.metaKey; - } else { - return originalEvent.ctrlKey; - } -} -function hasSecondaryModifier(event2) { - var originalEvent = getOriginal(event2) || event2; - return isPrimaryButton(event2) && originalEvent.shiftKey; -} - -// node_modules/.pnpm/diagram-js@14.11.3/node_modules/diagram-js/lib/features/interaction-events/InteractionEvents.js -function allowAll(event2) { - return true; -} -function allowPrimaryAndAuxiliary(event2) { - return isPrimaryButton(event2) || isAuxiliaryButton(event2); -} -var LOW_PRIORITY4 = 500; -function InteractionEvents(eventBus, elementRegistry, styles) { - var self = this; - function fire(type, event2, element) { - if (isIgnored(type, event2)) { - return; - } - var target, gfx, returnValue; - if (!element) { - target = event2.delegateTarget || event2.target; - if (target) { - gfx = target; - element = elementRegistry.get(gfx); - } - } else { - gfx = elementRegistry.getGraphics(element); - } - if (!gfx || !element) { - return; - } - returnValue = eventBus.fire(type, { - element, - gfx, - originalEvent: event2 - }); - if (returnValue === false) { - event2.stopPropagation(); - event2.preventDefault(); - } - } - var handlers = {}; - function mouseHandler(localEventName) { - return handlers[localEventName]; - } - function isIgnored(localEventName, event2) { - var filter2 = ignoredFilters[localEventName] || isPrimaryButton; - return !filter2(event2); - } - var bindings = { - click: "element.click", - contextmenu: "element.contextmenu", - dblclick: "element.dblclick", - mousedown: "element.mousedown", - mousemove: "element.mousemove", - mouseover: "element.hover", - mouseout: "element.out", - mouseup: "element.mouseup" - }; - var ignoredFilters = { - "element.contextmenu": allowAll, - "element.mousedown": allowPrimaryAndAuxiliary, - "element.mouseup": allowPrimaryAndAuxiliary, - "element.click": allowPrimaryAndAuxiliary, - "element.dblclick": allowPrimaryAndAuxiliary - }; - function triggerMouseEvent(eventName, event2, targetElement) { - var localEventName = bindings[eventName]; - if (!localEventName) { - throw new Error("unmapped DOM event name <" + eventName + ">"); - } - return fire(localEventName, event2, targetElement); - } - var ELEMENT_SELECTOR = "svg, .djs-element"; - function registerEvent(node, event2, localEvent, ignoredFilter) { - var handler = handlers[localEvent] = function(event3) { - fire(localEvent, event3); - }; - if (ignoredFilter) { - ignoredFilters[localEvent] = ignoredFilter; - } - handler.$delegate = delegate.bind(node, ELEMENT_SELECTOR, event2, handler); - } - function unregisterEvent(node, event2, localEvent) { - var handler = mouseHandler(localEvent); - if (!handler) { - return; - } - delegate.unbind(node, event2, handler.$delegate); - } - function registerEvents(svg) { - forEach(bindings, function(val, key) { - registerEvent(svg, key, val); - }); - } - function unregisterEvents(svg) { - forEach(bindings, function(val, key) { - unregisterEvent(svg, key, val); - }); - } - eventBus.on("canvas.destroy", function(event2) { - unregisterEvents(event2.svg); - }); - eventBus.on("canvas.init", function(event2) { - registerEvents(event2.svg); - }); - eventBus.on(["shape.added", "connection.added"], function(event2) { - var element = event2.element, gfx = event2.gfx; - eventBus.fire("interactionEvents.createHit", { element, gfx }); - }); - eventBus.on([ - "shape.changed", - "connection.changed" - ], LOW_PRIORITY4, function(event2) { - var element = event2.element, gfx = event2.gfx; - eventBus.fire("interactionEvents.updateHit", { element, gfx }); - }); - eventBus.on("interactionEvents.createHit", LOW_PRIORITY4, function(event2) { - var element = event2.element, gfx = event2.gfx; - self.createDefaultHit(element, gfx); - }); - eventBus.on("interactionEvents.updateHit", function(event2) { - var element = event2.element, gfx = event2.gfx; - self.updateDefaultHit(element, gfx); - }); - var STROKE_HIT_STYLE = createHitStyle("djs-hit djs-hit-stroke"); - var CLICK_STROKE_HIT_STYLE = createHitStyle("djs-hit djs-hit-click-stroke"); - var ALL_HIT_STYLE = createHitStyle("djs-hit djs-hit-all"); - var NO_MOVE_HIT_STYLE = createHitStyle("djs-hit djs-hit-no-move"); - var HIT_TYPES = { - "all": ALL_HIT_STYLE, - "click-stroke": CLICK_STROKE_HIT_STYLE, - "stroke": STROKE_HIT_STYLE, - "no-move": NO_MOVE_HIT_STYLE - }; - function createHitStyle(classNames, attrs) { - attrs = assign({ - stroke: "white", - strokeWidth: 15 - }, attrs || {}); - return styles.cls(classNames, ["no-fill", "no-border"], attrs); - } - function applyStyle(hit, type) { - var attrs = HIT_TYPES[type]; - if (!attrs) { - throw new Error("invalid hit type <" + type + ">"); - } - attr2(hit, attrs); - return hit; - } - function appendHit(gfx, hit) { - append(gfx, hit); - } - this.removeHits = function(gfx) { - var hits = all(".djs-hit", gfx); - forEach(hits, remove2); - }; - this.createDefaultHit = function(element, gfx) { - var waypoints = element.waypoints, isFrame = element.isFrame, boxType; - if (waypoints) { - return this.createWaypointsHit(gfx, waypoints); - } else { - boxType = isFrame ? "stroke" : "all"; - return this.createBoxHit(gfx, boxType, { - width: element.width, - height: element.height - }); - } - }; - this.createWaypointsHit = function(gfx, waypoints) { - var hit = createLine(waypoints); - applyStyle(hit, "stroke"); - appendHit(gfx, hit); - return hit; - }; - this.createBoxHit = function(gfx, type, attrs) { - attrs = assign({ - x: 0, - y: 0 - }, attrs); - var hit = create("rect"); - applyStyle(hit, type); - attr2(hit, attrs); - appendHit(gfx, hit); - return hit; - }; - this.updateDefaultHit = function(element, gfx) { - var hit = query(".djs-hit", gfx); - if (!hit) { - return; - } - if (element.waypoints) { - updateLine(hit, element.waypoints); - } else { - attr2(hit, { - width: element.width, - height: element.height - }); - } - return hit; - }; - this.fire = fire; - this.triggerMouseEvent = triggerMouseEvent; - this.mouseHandler = mouseHandler; - this.registerEvent = registerEvent; - this.unregisterEvent = unregisterEvent; -} -InteractionEvents.$inject = [ - "eventBus", - "elementRegistry", - "styles" -]; - -// node_modules/.pnpm/diagram-js@14.11.3/node_modules/diagram-js/lib/features/interaction-events/index.js -var interaction_events_default = { - __init__: ["interactionEvents"], - interactionEvents: ["type", InteractionEvents] -}; - -// node_modules/.pnpm/diagram-js@14.11.3/node_modules/diagram-js/lib/features/selection/Selection.js -function Selection(eventBus, canvas) { - this._eventBus = eventBus; - this._canvas = canvas; - this._selectedElements = []; - var self = this; - eventBus.on(["shape.remove", "connection.remove"], function(e2) { - var element = e2.element; - self.deselect(element); - }); - eventBus.on(["diagram.clear", "root.set"], function(e2) { - self.select(null); - }); -} -Selection.$inject = ["eventBus", "canvas"]; -Selection.prototype.deselect = function(element) { - var selectedElements = this._selectedElements; - var idx = selectedElements.indexOf(element); - if (idx !== -1) { - var oldSelection = selectedElements.slice(); - selectedElements.splice(idx, 1); - this._eventBus.fire("selection.changed", { oldSelection, newSelection: selectedElements }); - } -}; -Selection.prototype.get = function() { - return this._selectedElements; -}; -Selection.prototype.isSelected = function(element) { - return this._selectedElements.indexOf(element) !== -1; -}; -Selection.prototype.select = function(elements, add2) { - var selectedElements = this._selectedElements, oldSelection = selectedElements.slice(); - if (!isArray(elements)) { - elements = elements ? [elements] : []; - } - var canvas = this._canvas; - var rootElement = canvas.getRootElement(); - elements = elements.filter(function(element) { - var elementRoot = canvas.findRoot(element); - return rootElement === elementRoot; - }); - if (add2) { - forEach(elements, function(element) { - if (selectedElements.indexOf(element) !== -1) { - return; - } else { - selectedElements.push(element); - } - }); - } else { - this._selectedElements = selectedElements = elements.slice(); - } - this._eventBus.fire("selection.changed", { oldSelection, newSelection: selectedElements }); -}; - -// node_modules/.pnpm/diagram-js@14.11.3/node_modules/diagram-js/lib/features/selection/SelectionVisuals.js -var MARKER_HOVER = "hover"; -var MARKER_SELECTED = "selected"; -var SELECTION_OUTLINE_PADDING = 6; -function SelectionVisuals(canvas, eventBus, selection) { - this._canvas = canvas; - var self = this; - this._multiSelectionBox = null; - function addMarker(e2, cls) { - canvas.addMarker(e2, cls); - } - function removeMarker(e2, cls) { - canvas.removeMarker(e2, cls); - } - eventBus.on("element.hover", function(event2) { - addMarker(event2.element, MARKER_HOVER); - }); - eventBus.on("element.out", function(event2) { - removeMarker(event2.element, MARKER_HOVER); - }); - eventBus.on("selection.changed", function(event2) { - function deselect(s) { - removeMarker(s, MARKER_SELECTED); - } - function select(s) { - addMarker(s, MARKER_SELECTED); - } - var oldSelection = event2.oldSelection, newSelection = event2.newSelection; - forEach(oldSelection, function(e2) { - if (newSelection.indexOf(e2) === -1) { - deselect(e2); - } - }); - forEach(newSelection, function(e2) { - if (oldSelection.indexOf(e2) === -1) { - select(e2); - } - }); - self._updateSelectionOutline(newSelection); - }); - eventBus.on("element.changed", function(event2) { - if (selection.isSelected(event2.element)) { - self._updateSelectionOutline(selection.get()); - } - }); -} -SelectionVisuals.$inject = [ - "canvas", - "eventBus", - "selection" -]; -SelectionVisuals.prototype._updateSelectionOutline = function(selection) { - var layer = this._canvas.getLayer("selectionOutline"); - clear2(layer); - var enabled = selection.length > 1; - var container = this._canvas.getContainer(); - classes2(container)[enabled ? "add" : "remove"]("djs-multi-select"); - if (!enabled) { - return; - } - var bBox = addSelectionOutlinePadding(getBBox(selection)); - var rect = create("rect"); - attr2(rect, assign({ - rx: 3 - }, bBox)); - classes2(rect).add("djs-selection-outline"); - append(layer, rect); -}; -function addSelectionOutlinePadding(bBox) { - return { - x: bBox.x - SELECTION_OUTLINE_PADDING, - y: bBox.y - SELECTION_OUTLINE_PADDING, - width: bBox.width + SELECTION_OUTLINE_PADDING * 2, - height: bBox.height + SELECTION_OUTLINE_PADDING * 2 - }; -} - -// node_modules/.pnpm/diagram-js@14.11.3/node_modules/diagram-js/lib/features/selection/SelectionBehavior.js -function SelectionBehavior(eventBus, selection, canvas, elementRegistry) { - eventBus.on("create.end", 500, function(event2) { - var context = event2.context, canExecute = context.canExecute, elements = context.elements, hints = context.hints || {}, autoSelect = hints.autoSelect; - if (canExecute) { - if (autoSelect === false) { - return; - } - if (isArray(autoSelect)) { - selection.select(autoSelect); - } else { - selection.select(elements.filter(isShown)); - } - } - }); - eventBus.on("connect.end", 500, function(event2) { - var context = event2.context, connection = context.connection; - if (connection) { - selection.select(connection); - } - }); - eventBus.on("shape.move.end", 500, function(event2) { - var previousSelection = event2.previousSelection || []; - var shape = elementRegistry.get(event2.context.shape.id); - var isSelected = find(previousSelection, function(selectedShape) { - return shape.id === selectedShape.id; - }); - if (!isSelected) { - selection.select(shape); - } - }); - eventBus.on("element.click", function(event2) { - if (!isPrimaryButton(event2)) { - return; - } - var element = event2.element; - if (element === canvas.getRootElement()) { - element = null; - } - var isSelected = selection.isSelected(element), isMultiSelect = selection.get().length > 1; - var add2 = hasSecondaryModifier(event2); - if (isSelected && isMultiSelect) { - if (add2) { - return selection.deselect(element); - } else { - return selection.select(element); - } - } else if (!isSelected) { - selection.select(element, add2); - } else { - selection.deselect(element); - } - }); -} -SelectionBehavior.$inject = [ - "eventBus", - "selection", - "canvas", - "elementRegistry" -]; -function isShown(element) { - return !element.hidden; -} - -// node_modules/.pnpm/diagram-js@14.11.3/node_modules/diagram-js/lib/features/selection/index.js -var selection_default = { - __init__: ["selectionVisuals", "selectionBehavior"], - __depends__: [ - interaction_events_default, - outline_default - ], - selection: ["type", Selection], - selectionVisuals: ["type", SelectionVisuals], - selectionBehavior: ["type", SelectionBehavior] -}; - -// node_modules/.pnpm/didi@10.2.2/node_modules/didi/dist/index.js -var CLASS_PATTERN = /^class[ {]/; -function isClass(fn) { - return CLASS_PATTERN.test(fn.toString()); -} -function isArray2(obj) { - return Array.isArray(obj); -} -function hasOwnProp(obj, prop) { - return Object.prototype.hasOwnProperty.call(obj, prop); -} -function annotate(...args) { - if (args.length === 1 && isArray2(args[0])) { - args = args[0]; - } - args = [...args]; - const fn = args.pop(); - fn.$inject = args; - return fn; -} -var CONSTRUCTOR_ARGS = /constructor\s*[^(]*\(\s*([^)]*)\)/m; -var FN_ARGS = /^(?:async\s+)?(?:function\s*[^(]*)?(?:\(\s*([^)]*)\)|(\w+))/m; -var FN_ARG = /\/\*([^*]*)\*\//m; -function parseAnnotations(fn) { - if (typeof fn !== "function") { - throw new Error(`Cannot annotate "${fn}". Expected a function!`); - } - const match = fn.toString().match(isClass(fn) ? CONSTRUCTOR_ARGS : FN_ARGS); - if (!match) { - return []; - } - const args = match[1] || match[2]; - return args && args.split(",").map((arg) => { - const argMatch = arg.match(FN_ARG); - return (argMatch && argMatch[1] || arg).trim(); - }) || []; -} -function Injector(modules, _parent) { - const parent = _parent || /** @type InjectorContext */ - { - get: function(name2, strict) { - currentlyResolving.push(name2); - if (strict === false) { - return null; - } else { - throw error3(`No provider for "${name2}"!`); - } - } - }; - const currentlyResolving = []; - const providers = this._providers = Object.create(parent._providers || null); - const instances = this._instances = /* @__PURE__ */ Object.create(null); - const self = instances.injector = this; - const error3 = function(msg) { - const stack = currentlyResolving.join(" -> "); - currentlyResolving.length = 0; - return new Error(stack ? `${msg} (Resolving: ${stack})` : msg); - }; - function get(name2, strict) { - if (!providers[name2] && name2.includes(".")) { - const parts = name2.split("."); - let pivot = get( - /** @type { string } */ - parts.shift() - ); - while (parts.length) { - pivot = pivot[ - /** @type { string } */ - parts.shift() - ]; - } - return pivot; - } - if (hasOwnProp(instances, name2)) { - return instances[name2]; - } - if (hasOwnProp(providers, name2)) { - if (currentlyResolving.indexOf(name2) !== -1) { - currentlyResolving.push(name2); - throw error3("Cannot resolve circular dependency!"); - } - currentlyResolving.push(name2); - instances[name2] = providers[name2][0](providers[name2][1]); - currentlyResolving.pop(); - return instances[name2]; - } - return parent.get(name2, strict); - } - function fnDef(fn, locals) { - if (typeof locals === "undefined") { - locals = {}; - } - if (typeof fn !== "function") { - if (isArray2(fn)) { - fn = annotate(fn.slice()); - } else { - throw error3(`Cannot invoke "${fn}". Expected a function!`); - } - } - const inject = fn.$inject || parseAnnotations(fn); - const dependencies = inject.map((dep) => { - if (hasOwnProp(locals, dep)) { - return locals[dep]; - } else { - return get(dep); - } - }); - return { - fn, - dependencies - }; - } - function instantiate(type) { - const { - fn, - dependencies - } = fnDef(type); - const Constructor = Function.prototype.bind.call(fn, null, ...dependencies); - return new Constructor(); - } - function invoke(func, context, locals) { - const { - fn, - dependencies - } = fnDef(func, locals); - return fn.apply(context, dependencies); - } - function createPrivateInjectorFactory(childInjector) { - return annotate((key) => childInjector.get(key)); - } - function createChild(modules2, forceNewInstances) { - if (forceNewInstances && forceNewInstances.length) { - const fromParentModule = /* @__PURE__ */ Object.create(null); - const matchedScopes = /* @__PURE__ */ Object.create(null); - const privateInjectorsCache = []; - const privateChildInjectors = []; - const privateChildFactories = []; - let provider; - let cacheIdx; - let privateChildInjector; - let privateChildInjectorFactory; - for (let name2 in providers) { - provider = providers[name2]; - if (forceNewInstances.indexOf(name2) !== -1) { - if (provider[2] === "private") { - cacheIdx = privateInjectorsCache.indexOf(provider[3]); - if (cacheIdx === -1) { - privateChildInjector = provider[3].createChild([], forceNewInstances); - privateChildInjectorFactory = createPrivateInjectorFactory(privateChildInjector); - privateInjectorsCache.push(provider[3]); - privateChildInjectors.push(privateChildInjector); - privateChildFactories.push(privateChildInjectorFactory); - fromParentModule[name2] = [privateChildInjectorFactory, name2, "private", privateChildInjector]; - } else { - fromParentModule[name2] = [privateChildFactories[cacheIdx], name2, "private", privateChildInjectors[cacheIdx]]; - } - } else { - fromParentModule[name2] = [provider[2], provider[1]]; - } - matchedScopes[name2] = true; - } - if ((provider[2] === "factory" || provider[2] === "type") && provider[1].$scope) { - forceNewInstances.forEach((scope) => { - if (provider[1].$scope.indexOf(scope) !== -1) { - fromParentModule[name2] = [provider[2], provider[1]]; - matchedScopes[scope] = true; - } - }); - } - } - forceNewInstances.forEach((scope) => { - if (!matchedScopes[scope]) { - throw new Error('No provider for "' + scope + '". Cannot use provider from the parent!'); - } - }); - modules2.unshift(fromParentModule); - } - return new Injector(modules2, self); - } - const factoryMap = { - factory: invoke, - type: instantiate, - value: function(value) { - return value; - } - }; - function createInitializer(moduleDefinition, injector) { - const initializers = moduleDefinition.__init__ || []; - return function() { - initializers.forEach((initializer) => { - if (typeof initializer === "string") { - injector.get(initializer); - } else { - injector.invoke(initializer); - } - }); - }; - } - function loadModule(moduleDefinition) { - const moduleExports = moduleDefinition.__exports__; - if (moduleExports) { - const nestedModules = moduleDefinition.__modules__; - const clonedModule = Object.keys(moduleDefinition).reduce((clonedModule2, key) => { - if (key !== "__exports__" && key !== "__modules__" && key !== "__init__" && key !== "__depends__") { - clonedModule2[key] = moduleDefinition[key]; - } - return clonedModule2; - }, /* @__PURE__ */ Object.create(null)); - const childModules = (nestedModules || []).concat(clonedModule); - const privateInjector = createChild(childModules); - const getFromPrivateInjector = annotate(function(key) { - return privateInjector.get(key); - }); - moduleExports.forEach(function(key) { - providers[key] = [getFromPrivateInjector, key, "private", privateInjector]; - }); - const initializers = (moduleDefinition.__init__ || []).slice(); - initializers.unshift(function() { - privateInjector.init(); - }); - moduleDefinition = Object.assign({}, moduleDefinition, { - __init__: initializers - }); - return createInitializer(moduleDefinition, privateInjector); - } - Object.keys(moduleDefinition).forEach(function(key) { - if (key === "__init__" || key === "__depends__") { - return; - } - const typeDeclaration = ( - /** @type { TypedDeclaration } */ - moduleDefinition[key] - ); - if (typeDeclaration[2] === "private") { - providers[key] = typeDeclaration; - return; - } - const type = typeDeclaration[0]; - const value = typeDeclaration[1]; - providers[key] = [factoryMap[type], arrayUnwrap(type, value), type]; - }); - return createInitializer(moduleDefinition, self); - } - function resolveDependencies(moduleDefinitions, moduleDefinition) { - if (moduleDefinitions.indexOf(moduleDefinition) !== -1) { - return moduleDefinitions; - } - moduleDefinitions = (moduleDefinition.__depends__ || []).reduce(resolveDependencies, moduleDefinitions); - if (moduleDefinitions.indexOf(moduleDefinition) !== -1) { - return moduleDefinitions; - } - return moduleDefinitions.concat(moduleDefinition); - } - function bootstrap2(moduleDefinitions) { - const initializers = moduleDefinitions.reduce(resolveDependencies, []).map(loadModule); - let initialized = false; - return function() { - if (initialized) { - return; - } - initialized = true; - initializers.forEach((initializer) => initializer()); - }; - } - this.get = get; - this.invoke = invoke; - this.instantiate = instantiate; - this.createChild = createChild; - this.init = bootstrap2(modules); -} -function arrayUnwrap(type, value) { - if (type !== "value" && isArray2(value)) { - value = annotate(value.slice()); - } - return value; -} - -// node_modules/.pnpm/diagram-js@14.11.3/node_modules/diagram-js/lib/draw/DefaultRenderer.js -var DEFAULT_RENDER_PRIORITY2 = 1; -function DefaultRenderer(eventBus, styles) { - BaseRenderer.call(this, eventBus, DEFAULT_RENDER_PRIORITY2); - this.CONNECTION_STYLE = styles.style(["no-fill"], { strokeWidth: 5, stroke: "fuchsia" }); - this.SHAPE_STYLE = styles.style({ fill: "white", stroke: "fuchsia", strokeWidth: 2 }); - this.FRAME_STYLE = styles.style(["no-fill"], { stroke: "fuchsia", strokeDasharray: 4, strokeWidth: 2 }); -} -e(DefaultRenderer, BaseRenderer); -DefaultRenderer.prototype.canRender = function() { - return true; -}; -DefaultRenderer.prototype.drawShape = function drawShape(visuals, element, attrs) { - var rect = create("rect"); - attr2(rect, { - x: 0, - y: 0, - width: element.width || 0, - height: element.height || 0 - }); - if (isFrameElement(element)) { - attr2(rect, assign({}, this.FRAME_STYLE, attrs || {})); - } else { - attr2(rect, assign({}, this.SHAPE_STYLE, attrs || {})); - } - append(visuals, rect); - return rect; -}; -DefaultRenderer.prototype.drawConnection = function drawConnection(visuals, connection, attrs) { - var line = createLine(connection.waypoints, assign({}, this.CONNECTION_STYLE, attrs || {})); - append(visuals, line); - return line; -}; -DefaultRenderer.prototype.getShapePath = function getShapePath(shape) { - var x = shape.x, y = shape.y, width = shape.width, height = shape.height; - var shapePath = [ - ["M", x, y], - ["l", width, 0], - ["l", 0, height], - ["l", -width, 0], - ["z"] - ]; - return componentsToPath(shapePath); -}; -DefaultRenderer.prototype.getConnectionPath = function getConnectionPath(connection) { - var waypoints = connection.waypoints; - var idx, point, connectionPath = []; - for (idx = 0; point = waypoints[idx]; idx++) { - point = point.original || point; - connectionPath.push([idx === 0 ? "M" : "L", point.x, point.y]); - } - return componentsToPath(connectionPath); -}; -DefaultRenderer.$inject = ["eventBus", "styles"]; - -// node_modules/.pnpm/diagram-js@14.11.3/node_modules/diagram-js/lib/draw/Styles.js -function Styles() { - var defaultTraits = { - "no-fill": { - fill: "none" - }, - "no-border": { - strokeOpacity: 0 - }, - "no-events": { - pointerEvents: "none" - } - }; - var self = this; - this.cls = function(className, traits, additionalAttrs) { - var attrs = this.style(traits, additionalAttrs); - return assign(attrs, { "class": className }); - }; - this.style = function(traits, additionalAttrs) { - if (!isArray(traits) && !additionalAttrs) { - additionalAttrs = traits; - traits = []; - } - var attrs = reduce(traits, function(attrs2, t) { - return assign(attrs2, defaultTraits[t] || {}); - }, {}); - return additionalAttrs ? assign(attrs, additionalAttrs) : attrs; - }; - this.computeStyle = function(custom, traits, defaultStyles) { - if (!isArray(traits)) { - defaultStyles = traits; - traits = []; - } - return self.style(traits || [], assign({}, defaultStyles, custom || {})); - }; -} - -// node_modules/.pnpm/diagram-js@14.11.3/node_modules/diagram-js/lib/draw/index.js -var draw_default2 = { - __init__: ["defaultRenderer"], - defaultRenderer: ["type", DefaultRenderer], - styles: ["type", Styles] -}; - -// node_modules/.pnpm/diagram-js@14.11.3/node_modules/diagram-js/lib/util/Collections.js -function remove3(collection, element) { - if (!collection || !element) { - return -1; - } - var idx = collection.indexOf(element); - if (idx !== -1) { - collection.splice(idx, 1); - } - return idx; -} -function add(collection, element, idx) { - if (!collection || !element) { - return; - } - if (typeof idx !== "number") { - idx = -1; - } - var currentIdx = collection.indexOf(element); - if (currentIdx !== -1) { - if (currentIdx === idx) { - return; - } else { - if (idx !== -1) { - collection.splice(currentIdx, 1); - } else { - return; - } - } - } - if (idx !== -1) { - collection.splice(idx, 0, element); - } else { - collection.push(element); - } -} -function indexOf(collection, element) { - if (!collection || !element) { - return -1; - } - return collection.indexOf(element); -} - -// node_modules/.pnpm/diagram-js@14.11.3/node_modules/diagram-js/lib/core/Canvas.js -function round(number, resolution) { - return Math.round(number * resolution) / resolution; -} -function ensurePx(number) { - return isNumber(number) ? number + "px" : number; -} -function findRoot(element) { - while (element.parent) { - element = element.parent; - } - return element; -} -function createContainer(options) { - options = assign({}, { width: "100%", height: "100%" }, options); - const container = options.container || document.body; - const parent = document.createElement("div"); - parent.setAttribute("class", "djs-container djs-parent"); - assign2(parent, { - position: "relative", - overflow: "hidden", - width: ensurePx(options.width), - height: ensurePx(options.height) - }); - container.appendChild(parent); - return parent; -} -function createGroup(parent, cls, childIndex) { - const group = create("g"); - classes2(group).add(cls); - const index = childIndex !== void 0 ? childIndex : parent.childNodes.length - 1; - parent.insertBefore(group, parent.childNodes[index] || null); - return group; -} -var BASE_LAYER = "base"; -var PLANE_LAYER_INDEX = 0; -var UTILITY_LAYER_INDEX = 1; -var REQUIRED_MODEL_ATTRS = { - shape: ["x", "y", "width", "height"], - connection: ["waypoints"] -}; -function Canvas(config, eventBus, graphicsFactory, elementRegistry) { - this._eventBus = eventBus; - this._elementRegistry = elementRegistry; - this._graphicsFactory = graphicsFactory; - this._rootsIdx = 0; - this._layers = {}; - this._planes = []; - this._rootElement = null; - this._init(config || {}); -} -Canvas.$inject = [ - "config.canvas", - "eventBus", - "graphicsFactory", - "elementRegistry" -]; -Canvas.prototype._init = function(config) { - const eventBus = this._eventBus; - const container = this._container = createContainer(config); - const svg = this._svg = create("svg"); - attr2(svg, { width: "100%", height: "100%" }); - append(container, svg); - const viewport = this._viewport = createGroup(svg, "viewport"); - if (config.deferUpdate) { - this._viewboxChanged = debounce(bind(this._viewboxChanged, this), 300); - } - eventBus.on("diagram.init", () => { - eventBus.fire("canvas.init", { - svg, - viewport - }); - }); - eventBus.on([ - "shape.added", - "connection.added", - "shape.removed", - "connection.removed", - "elements.changed", - "root.set" - ], () => { - delete this._cachedViewbox; - }); - eventBus.on("diagram.destroy", 500, this._destroy, this); - eventBus.on("diagram.clear", 500, this._clear, this); -}; -Canvas.prototype._destroy = function() { - this._eventBus.fire("canvas.destroy", { - svg: this._svg, - viewport: this._viewport - }); - const parent = this._container.parentNode; - if (parent) { - parent.removeChild(this._container); - } - delete this._svg; - delete this._container; - delete this._layers; - delete this._planes; - delete this._rootElement; - delete this._viewport; -}; -Canvas.prototype._clear = function() { - const allElements = this._elementRegistry.getAll(); - allElements.forEach((element) => { - const type = getType(element); - if (type === "root") { - this.removeRootElement(element); - } else { - this._removeElement(element, type); - } - }); - this._planes = []; - this._rootElement = null; - delete this._cachedViewbox; -}; -Canvas.prototype.getDefaultLayer = function() { - return this.getLayer(BASE_LAYER, PLANE_LAYER_INDEX); -}; -Canvas.prototype.getLayer = function(name2, index) { - if (!name2) { - throw new Error("must specify a name"); - } - let layer = this._layers[name2]; - if (!layer) { - layer = this._layers[name2] = this._createLayer(name2, index); - } - if (typeof index !== "undefined" && layer.index !== index) { - throw new Error("layer <" + name2 + "> already created at index <" + index + ">"); - } - return layer.group; -}; -Canvas.prototype._getChildIndex = function(index) { - return reduce(this._layers, function(childIndex, layer) { - if (layer.visible && index >= layer.index) { - childIndex++; - } - return childIndex; - }, 0); -}; -Canvas.prototype._createLayer = function(name2, index) { - if (typeof index === "undefined") { - index = UTILITY_LAYER_INDEX; - } - const childIndex = this._getChildIndex(index); - return { - group: createGroup(this._viewport, "layer-" + name2, childIndex), - index, - visible: true - }; -}; -Canvas.prototype.showLayer = function(name2) { - if (!name2) { - throw new Error("must specify a name"); - } - const layer = this._layers[name2]; - if (!layer) { - throw new Error("layer <" + name2 + "> does not exist"); - } - const viewport = this._viewport; - const group = layer.group; - const index = layer.index; - if (layer.visible) { - return group; - } - const childIndex = this._getChildIndex(index); - viewport.insertBefore(group, viewport.childNodes[childIndex] || null); - layer.visible = true; - return group; -}; -Canvas.prototype.hideLayer = function(name2) { - if (!name2) { - throw new Error("must specify a name"); - } - const layer = this._layers[name2]; - if (!layer) { - throw new Error("layer <" + name2 + "> does not exist"); - } - const group = layer.group; - if (!layer.visible) { - return group; - } - remove2(group); - layer.visible = false; - return group; -}; -Canvas.prototype._removeLayer = function(name2) { - const layer = this._layers[name2]; - if (layer) { - delete this._layers[name2]; - remove2(layer.group); - } -}; -Canvas.prototype.getActiveLayer = function() { - const plane = this._findPlaneForRoot(this.getRootElement()); - if (!plane) { - return null; - } - return plane.layer; -}; -Canvas.prototype.findRoot = function(element) { - if (typeof element === "string") { - element = this._elementRegistry.get(element); - } - if (!element) { - return; - } - const plane = this._findPlaneForRoot( - findRoot(element) - ) || {}; - return plane.rootElement; -}; -Canvas.prototype.getRootElements = function() { - return this._planes.map(function(plane) { - return plane.rootElement; - }); -}; -Canvas.prototype._findPlaneForRoot = function(rootElement) { - return find(this._planes, function(plane) { - return plane.rootElement === rootElement; - }); -}; -Canvas.prototype.getContainer = function() { - return this._container; -}; -Canvas.prototype._updateMarker = function(element, marker, add2) { - let container; - if (!element.id) { - element = this._elementRegistry.get(element); - } - element.markers = element.markers || /* @__PURE__ */ new Set(); - container = this._elementRegistry._elements[element.id]; - if (!container) { - return; - } - forEach([container.gfx, container.secondaryGfx], function(gfx) { - if (gfx) { - if (add2) { - element.markers.add(marker); - classes2(gfx).add(marker); - } else { - element.markers.delete(marker); - classes2(gfx).remove(marker); - } - } - }); - this._eventBus.fire("element.marker.update", { element, gfx: container.gfx, marker, add: !!add2 }); -}; -Canvas.prototype.addMarker = function(element, marker) { - this._updateMarker(element, marker, true); -}; -Canvas.prototype.removeMarker = function(element, marker) { - this._updateMarker(element, marker, false); -}; -Canvas.prototype.hasMarker = function(element, marker) { - if (!element.id) { - element = this._elementRegistry.get(element); - } - if (!element.markers) { - return false; - } - return element.markers.has(marker); -}; -Canvas.prototype.toggleMarker = function(element, marker) { - if (this.hasMarker(element, marker)) { - this.removeMarker(element, marker); - } else { - this.addMarker(element, marker); - } -}; -Canvas.prototype.getRootElement = function() { - const rootElement = this._rootElement; - if (rootElement || this._planes.length) { - return rootElement; - } - return this.setRootElement(this.addRootElement(null)); -}; -Canvas.prototype.addRootElement = function(rootElement) { - const idx = this._rootsIdx++; - if (!rootElement) { - rootElement = { - id: "__implicitroot_" + idx, - children: [], - isImplicit: true - }; - } - const layerName = rootElement.layer = "root-" + idx; - this._ensureValid("root", rootElement); - const layer = this.getLayer(layerName, PLANE_LAYER_INDEX); - this.hideLayer(layerName); - this._addRoot(rootElement, layer); - this._planes.push({ - rootElement, - layer - }); - return rootElement; -}; -Canvas.prototype.removeRootElement = function(rootElement) { - if (typeof rootElement === "string") { - rootElement = this._elementRegistry.get(rootElement); - } - const plane = this._findPlaneForRoot(rootElement); - if (!plane) { - return; - } - this._removeRoot(rootElement); - this._removeLayer(rootElement.layer); - this._planes = this._planes.filter(function(plane2) { - return plane2.rootElement !== rootElement; - }); - if (this._rootElement === rootElement) { - this._rootElement = null; - } - return rootElement; -}; -Canvas.prototype.setRootElement = function(rootElement) { - if (rootElement === this._rootElement) { - return rootElement; - } - let plane; - if (!rootElement) { - throw new Error("rootElement required"); - } - plane = this._findPlaneForRoot(rootElement); - if (!plane) { - rootElement = this.addRootElement(rootElement); - } - this._setRoot(rootElement); - return rootElement; -}; -Canvas.prototype._removeRoot = function(element) { - const elementRegistry = this._elementRegistry, eventBus = this._eventBus; - eventBus.fire("root.remove", { element }); - eventBus.fire("root.removed", { element }); - elementRegistry.remove(element); -}; -Canvas.prototype._addRoot = function(element, gfx) { - const elementRegistry = this._elementRegistry, eventBus = this._eventBus; - eventBus.fire("root.add", { element }); - elementRegistry.add(element, gfx); - eventBus.fire("root.added", { element, gfx }); -}; -Canvas.prototype._setRoot = function(rootElement, layer) { - const currentRoot = this._rootElement; - if (currentRoot) { - this._elementRegistry.updateGraphics(currentRoot, null, true); - this.hideLayer(currentRoot.layer); - } - if (rootElement) { - if (!layer) { - layer = this._findPlaneForRoot(rootElement).layer; - } - this._elementRegistry.updateGraphics(rootElement, this._svg, true); - this.showLayer(rootElement.layer); - } - this._rootElement = rootElement; - this._eventBus.fire("root.set", { element: rootElement }); -}; -Canvas.prototype._ensureValid = function(type, element) { - if (!element.id) { - throw new Error("element must have an id"); - } - if (this._elementRegistry.get(element.id)) { - throw new Error("element <" + element.id + "> already exists"); - } - const requiredAttrs = REQUIRED_MODEL_ATTRS[type]; - const valid = every(requiredAttrs, function(attr3) { - return typeof element[attr3] !== "undefined"; - }); - if (!valid) { - throw new Error( - "must supply { " + requiredAttrs.join(", ") + " } with " + type - ); - } -}; -Canvas.prototype._setParent = function(element, parent, parentIndex) { - add(parent.children, element, parentIndex); - element.parent = parent; -}; -Canvas.prototype._addElement = function(type, element, parent, parentIndex) { - parent = parent || this.getRootElement(); - const eventBus = this._eventBus, graphicsFactory = this._graphicsFactory; - this._ensureValid(type, element); - eventBus.fire(type + ".add", { element, parent }); - this._setParent(element, parent, parentIndex); - const gfx = graphicsFactory.create(type, element, parentIndex); - this._elementRegistry.add(element, gfx); - graphicsFactory.update(type, element, gfx); - eventBus.fire(type + ".added", { element, gfx }); - return element; -}; -Canvas.prototype.addShape = function(shape, parent, parentIndex) { - return this._addElement("shape", shape, parent, parentIndex); -}; -Canvas.prototype.addConnection = function(connection, parent, parentIndex) { - return this._addElement("connection", connection, parent, parentIndex); -}; -Canvas.prototype._removeElement = function(element, type) { - const elementRegistry = this._elementRegistry, graphicsFactory = this._graphicsFactory, eventBus = this._eventBus; - element = elementRegistry.get(element.id || element); - if (!element) { - return; - } - eventBus.fire(type + ".remove", { element }); - graphicsFactory.remove(element); - remove3(element.parent && element.parent.children, element); - element.parent = null; - eventBus.fire(type + ".removed", { element }); - elementRegistry.remove(element); - return element; -}; -Canvas.prototype.removeShape = function(shape) { - return this._removeElement(shape, "shape"); -}; -Canvas.prototype.removeConnection = function(connection) { - return this._removeElement(connection, "connection"); -}; -Canvas.prototype.getGraphics = function(element, secondary) { - return this._elementRegistry.getGraphics(element, secondary); -}; -Canvas.prototype._changeViewbox = function(changeFn) { - this._eventBus.fire("canvas.viewbox.changing"); - changeFn.apply(this); - this._cachedViewbox = null; - this._viewboxChanged(); -}; -Canvas.prototype._viewboxChanged = function() { - this._eventBus.fire("canvas.viewbox.changed", { viewbox: this.viewbox() }); -}; -Canvas.prototype.viewbox = function(box) { - if (box === void 0 && this._cachedViewbox) { - return structuredClone(this._cachedViewbox); - } - const viewport = this._viewport, outerBox = this.getSize(); - let innerBox, matrix, activeLayer, transform3, scale, x, y; - if (!box) { - activeLayer = this._rootElement ? this.getActiveLayer() : null; - innerBox = activeLayer && activeLayer.getBBox() || {}; - transform3 = transform(viewport); - matrix = transform3 ? transform3.matrix : createMatrix(); - scale = round(matrix.a, 1e3); - x = round(-matrix.e || 0, 1e3); - y = round(-matrix.f || 0, 1e3); - box = this._cachedViewbox = { - x: x ? x / scale : 0, - y: y ? y / scale : 0, - width: outerBox.width / scale, - height: outerBox.height / scale, - scale, - inner: { - width: innerBox.width || 0, - height: innerBox.height || 0, - x: innerBox.x || 0, - y: innerBox.y || 0 - }, - outer: outerBox - }; - return box; - } else { - this._changeViewbox(function() { - scale = Math.min(outerBox.width / box.width, outerBox.height / box.height); - const matrix2 = this._svg.createSVGMatrix().scale(scale).translate(-box.x, -box.y); - transform(viewport, matrix2); - }); - } - return box; -}; -Canvas.prototype.scroll = function(delta) { - const node = this._viewport; - let matrix = node.getCTM(); - if (delta) { - this._changeViewbox(function() { - delta = assign({ dx: 0, dy: 0 }, delta || {}); - matrix = this._svg.createSVGMatrix().translate(delta.dx, delta.dy).multiply(matrix); - setCTM(node, matrix); - }); - } - return { x: matrix.e, y: matrix.f }; -}; -Canvas.prototype.scrollToElement = function(element, padding) { - let defaultPadding = 100; - if (typeof element === "string") { - element = this._elementRegistry.get(element); - } - const rootElement = this.findRoot(element); - if (rootElement !== this.getRootElement()) { - this.setRootElement(rootElement); - } - if (rootElement === element) { - return; - } - if (!padding) { - padding = {}; - } - if (typeof padding === "number") { - defaultPadding = padding; - } - padding = { - top: padding.top || defaultPadding, - right: padding.right || defaultPadding, - bottom: padding.bottom || defaultPadding, - left: padding.left || defaultPadding - }; - const elementBounds = getBBox(element), elementTrbl = asTRBL(elementBounds), viewboxBounds = this.viewbox(), zoom = this.zoom(); - let dx, dy; - viewboxBounds.y += padding.top / zoom; - viewboxBounds.x += padding.left / zoom; - viewboxBounds.width -= (padding.right + padding.left) / zoom; - viewboxBounds.height -= (padding.bottom + padding.top) / zoom; - const viewboxTrbl = asTRBL(viewboxBounds); - const canFit = elementBounds.width < viewboxBounds.width && elementBounds.height < viewboxBounds.height; - if (!canFit) { - dx = elementBounds.x - viewboxBounds.x; - dy = elementBounds.y - viewboxBounds.y; - } else { - const dRight = Math.max(0, elementTrbl.right - viewboxTrbl.right), dLeft = Math.min(0, elementTrbl.left - viewboxTrbl.left), dBottom = Math.max(0, elementTrbl.bottom - viewboxTrbl.bottom), dTop = Math.min(0, elementTrbl.top - viewboxTrbl.top); - dx = dRight || dLeft; - dy = dBottom || dTop; - } - this.scroll({ dx: -dx * zoom, dy: -dy * zoom }); -}; -Canvas.prototype.zoom = function(newScale, center) { - if (!newScale) { - return this.viewbox(newScale).scale; - } - if (newScale === "fit-viewport") { - return this._fitViewport(center); - } - let outer, matrix; - this._changeViewbox(function() { - if (typeof center !== "object") { - outer = this.viewbox().outer; - center = { - x: outer.width / 2, - y: outer.height / 2 - }; - } - matrix = this._setZoom(newScale, center); - }); - return round(matrix.a, 1e3); -}; -function setCTM(node, m) { - const mstr = "matrix(" + m.a + "," + m.b + "," + m.c + "," + m.d + "," + m.e + "," + m.f + ")"; - node.setAttribute("transform", mstr); -} -Canvas.prototype._fitViewport = function(center) { - const vbox = this.viewbox(), outer = vbox.outer, inner = vbox.inner; - let newScale, newViewbox; - if (inner.x >= 0 && inner.y >= 0 && inner.x + inner.width <= outer.width && inner.y + inner.height <= outer.height && !center) { - newViewbox = { - x: 0, - y: 0, - width: Math.max(inner.width + inner.x, outer.width), - height: Math.max(inner.height + inner.y, outer.height) - }; - } else { - newScale = Math.min(1, outer.width / inner.width, outer.height / inner.height); - newViewbox = { - x: inner.x + (center ? inner.width / 2 - outer.width / newScale / 2 : 0), - y: inner.y + (center ? inner.height / 2 - outer.height / newScale / 2 : 0), - width: outer.width / newScale, - height: outer.height / newScale - }; - } - this.viewbox(newViewbox); - return this.viewbox(false).scale; -}; -Canvas.prototype._setZoom = function(scale, center) { - const svg = this._svg, viewport = this._viewport; - const matrix = svg.createSVGMatrix(); - const point = svg.createSVGPoint(); - let centerPoint, originalPoint, currentMatrix, scaleMatrix, newMatrix; - currentMatrix = viewport.getCTM(); - const currentScale = currentMatrix.a; - if (center) { - centerPoint = assign(point, center); - originalPoint = centerPoint.matrixTransform(currentMatrix.inverse()); - scaleMatrix = matrix.translate(originalPoint.x, originalPoint.y).scale(1 / currentScale * scale).translate(-originalPoint.x, -originalPoint.y); - newMatrix = currentMatrix.multiply(scaleMatrix); - } else { - newMatrix = matrix.scale(scale); - } - setCTM(this._viewport, newMatrix); - return newMatrix; -}; -Canvas.prototype.getSize = function() { - return { - width: this._container.clientWidth, - height: this._container.clientHeight - }; -}; -Canvas.prototype.getAbsoluteBBox = function(element) { - const vbox = this.viewbox(); - let bbox; - if (element.waypoints) { - const gfx = this.getGraphics(element); - bbox = gfx.getBBox(); - } else { - bbox = element; - } - const x = bbox.x * vbox.scale - vbox.x * vbox.scale; - const y = bbox.y * vbox.scale - vbox.y * vbox.scale; - const width = bbox.width * vbox.scale; - const height = bbox.height * vbox.scale; - return { - x, - y, - width, - height - }; -}; -Canvas.prototype.resized = function() { - delete this._cachedViewbox; - this._eventBus.fire("canvas.resized"); -}; - -// node_modules/.pnpm/diagram-js@14.11.3/node_modules/diagram-js/lib/core/ElementRegistry.js -var ELEMENT_ID = "data-element-id"; -function ElementRegistry(eventBus) { - this._elements = {}; - this._eventBus = eventBus; -} -ElementRegistry.$inject = ["eventBus"]; -ElementRegistry.prototype.add = function(element, gfx, secondaryGfx) { - var id = element.id; - this._validateId(id); - attr2(gfx, ELEMENT_ID, id); - if (secondaryGfx) { - attr2(secondaryGfx, ELEMENT_ID, id); - } - this._elements[id] = { element, gfx, secondaryGfx }; -}; -ElementRegistry.prototype.remove = function(element) { - var elements = this._elements, id = element.id || element, container = id && elements[id]; - if (container) { - attr2(container.gfx, ELEMENT_ID, ""); - if (container.secondaryGfx) { - attr2(container.secondaryGfx, ELEMENT_ID, ""); - } - delete elements[id]; - } -}; -ElementRegistry.prototype.updateId = function(element, newId) { - this._validateId(newId); - if (typeof element === "string") { - element = this.get(element); - } - this._eventBus.fire("element.updateId", { - element, - newId - }); - var gfx = this.getGraphics(element), secondaryGfx = this.getGraphics(element, true); - this.remove(element); - element.id = newId; - this.add(element, gfx, secondaryGfx); -}; -ElementRegistry.prototype.updateGraphics = function(filter2, gfx, secondary) { - var id = filter2.id || filter2; - var container = this._elements[id]; - if (secondary) { - container.secondaryGfx = gfx; - } else { - container.gfx = gfx; - } - if (gfx) { - attr2(gfx, ELEMENT_ID, id); - } - return gfx; -}; -ElementRegistry.prototype.get = function(filter2) { - var id; - if (typeof filter2 === "string") { - id = filter2; - } else { - id = filter2 && attr2(filter2, ELEMENT_ID); - } - var container = this._elements[id]; - return container && container.element; -}; -ElementRegistry.prototype.filter = function(fn) { - var filtered = []; - this.forEach(function(element, gfx) { - if (fn(element, gfx)) { - filtered.push(element); - } - }); - return filtered; -}; -ElementRegistry.prototype.find = function(fn) { - var map2 = this._elements, keys = Object.keys(map2); - for (var i = 0; i < keys.length; i++) { - var id = keys[i], container = map2[id], element = container.element, gfx = container.gfx; - if (fn(element, gfx)) { - return element; - } - } -}; -ElementRegistry.prototype.getAll = function() { - return this.filter(function(e2) { - return e2; - }); -}; -ElementRegistry.prototype.forEach = function(fn) { - var map2 = this._elements; - Object.keys(map2).forEach(function(id) { - var container = map2[id], element = container.element, gfx = container.gfx; - return fn(element, gfx); - }); -}; -ElementRegistry.prototype.getGraphics = function(filter2, secondary) { - var id = filter2.id || filter2; - var container = this._elements[id]; - return container && (secondary ? container.secondaryGfx : container.gfx); -}; -ElementRegistry.prototype._validateId = function(id) { - if (!id) { - throw new Error("element must have an id"); - } - if (this._elements[id]) { - throw new Error("element with id " + id + " already added"); - } -}; - -// node_modules/.pnpm/object-refs@0.4.0/node_modules/object-refs/dist/index.js -function extend(collection, refs, property, target) { - var inverseProperty = property.inverse; - Object.defineProperty(collection, "remove", { - value: function(element) { - var idx = this.indexOf(element); - if (idx !== -1) { - this.splice(idx, 1); - refs.unset(element, inverseProperty, target); - } - return element; - } - }); - Object.defineProperty(collection, "contains", { - value: function(element) { - return this.indexOf(element) !== -1; - } - }); - Object.defineProperty(collection, "add", { - value: function(element, idx) { - var currentIdx = this.indexOf(element); - if (typeof idx === "undefined") { - if (currentIdx !== -1) { - return; - } - idx = this.length; - } - if (currentIdx !== -1) { - this.splice(currentIdx, 1); - } - this.splice(idx, 0, element); - if (currentIdx === -1) { - refs.set(element, inverseProperty, target); - } - } - }); - Object.defineProperty(collection, "__refs_collection", { - value: true - }); - return collection; -} -function isExtended(collection) { - return collection.__refs_collection === true; -} -function hasOwnProperty(e2, property) { - return Object.prototype.hasOwnProperty.call(e2, property.name || property); -} -function defineCollectionProperty(ref, property, target) { - var collection = extend(target[property.name] || [], ref, property, target); - Object.defineProperty(target, property.name, { - enumerable: property.enumerable, - value: collection - }); - if (collection.length) { - collection.forEach(function(o) { - ref.set(o, property.inverse, target); - }); - } -} -function defineProperty(ref, property, target) { - var inverseProperty = property.inverse; - var _value = target[property.name]; - Object.defineProperty(target, property.name, { - configurable: property.configurable, - enumerable: property.enumerable, - get: function() { - return _value; - }, - set: function(value) { - if (value === _value) { - return; - } - var old = _value; - _value = null; - if (old) { - ref.unset(old, inverseProperty, target); - } - _value = value; - ref.set(_value, inverseProperty, target); - } - }); -} -function Refs(a, b) { - if (!(this instanceof Refs)) { - return new Refs(a, b); - } - a.inverse = b; - b.inverse = a; - this.props = {}; - this.props[a.name] = a; - this.props[b.name] = b; -} -Refs.prototype.bind = function(target, property) { - if (typeof property === "string") { - if (!this.props[property]) { - throw new Error("no property <" + property + "> in ref"); - } - property = this.props[property]; - } - if (property.collection) { - defineCollectionProperty(this, property, target); - } else { - defineProperty(this, property, target); - } -}; -Refs.prototype.ensureRefsCollection = function(target, property) { - var collection = target[property.name]; - if (!isExtended(collection)) { - defineCollectionProperty(this, property, target); - } - return collection; -}; -Refs.prototype.ensureBound = function(target, property) { - if (!hasOwnProperty(target, property)) { - this.bind(target, property); - } -}; -Refs.prototype.unset = function(target, property, value) { - if (target) { - this.ensureBound(target, property); - if (property.collection) { - this.ensureRefsCollection(target, property).remove(value); - } else { - target[property.name] = void 0; - } - } -}; -Refs.prototype.set = function(target, property, value) { - if (target) { - this.ensureBound(target, property); - if (property.collection) { - this.ensureRefsCollection(target, property).add(value); - } else { - target[property.name] = value; - } - } -}; - -// node_modules/.pnpm/diagram-js@14.11.3/node_modules/diagram-js/lib/model/index.js -var parentRefs = new Refs({ name: "children", enumerable: true, collection: true }, { name: "parent" }); -var labelRefs = new Refs({ name: "labels", enumerable: true, collection: true }, { name: "labelTarget" }); -var attacherRefs = new Refs({ name: "attachers", collection: true }, { name: "host" }); -var outgoingRefs = new Refs({ name: "outgoing", collection: true }, { name: "source" }); -var incomingRefs = new Refs({ name: "incoming", collection: true }, { name: "target" }); -function ElementImpl() { - Object.defineProperty(this, "businessObject", { - writable: true - }); - Object.defineProperty(this, "label", { - get: function() { - return this.labels[0]; - }, - set: function(newLabel) { - var label = this.label, labels = this.labels; - if (!newLabel && label) { - labels.remove(label); - } else { - labels.add(newLabel, 0); - } - } - }); - parentRefs.bind(this, "parent"); - labelRefs.bind(this, "labels"); - outgoingRefs.bind(this, "outgoing"); - incomingRefs.bind(this, "incoming"); -} -function ShapeImpl() { - ElementImpl.call(this); - parentRefs.bind(this, "children"); - attacherRefs.bind(this, "host"); - attacherRefs.bind(this, "attachers"); -} -e(ShapeImpl, ElementImpl); -function RootImpl() { - ElementImpl.call(this); - parentRefs.bind(this, "children"); -} -e(RootImpl, ShapeImpl); -function LabelImpl() { - ShapeImpl.call(this); - labelRefs.bind(this, "labelTarget"); -} -e(LabelImpl, ShapeImpl); -function ConnectionImpl() { - ElementImpl.call(this); - outgoingRefs.bind(this, "source"); - incomingRefs.bind(this, "target"); -} -e(ConnectionImpl, ElementImpl); -var types = { - connection: ConnectionImpl, - shape: ShapeImpl, - label: LabelImpl, - root: RootImpl -}; -function create2(type, attrs) { - var Type = types[type]; - if (!Type) { - throw new Error("unknown type: <" + type + ">"); - } - return assign(new Type(), attrs); -} -function isModelElement(obj) { - return obj instanceof ElementImpl; -} - -// node_modules/.pnpm/diagram-js@14.11.3/node_modules/diagram-js/lib/core/ElementFactory.js -function ElementFactory() { - this._uid = 12; -} -ElementFactory.prototype.createRoot = function(attrs) { - return this.create("root", attrs); -}; -ElementFactory.prototype.createLabel = function(attrs) { - return this.create("label", attrs); -}; -ElementFactory.prototype.createShape = function(attrs) { - return this.create("shape", attrs); -}; -ElementFactory.prototype.createConnection = function(attrs) { - return this.create("connection", attrs); -}; -ElementFactory.prototype.create = function(type, attrs) { - attrs = assign({}, attrs || {}); - if (!attrs.id) { - attrs.id = type + "_" + this._uid++; - } - return create2(type, attrs); -}; - -// node_modules/.pnpm/diagram-js@14.11.3/node_modules/diagram-js/lib/core/EventBus.js -var FN_REF = "__fn"; -var DEFAULT_PRIORITY3 = 1e3; -var slice = Array.prototype.slice; -function EventBus() { - this._listeners = {}; - this.on("diagram.destroy", 1, this._destroy, this); -} -EventBus.prototype.on = function(events, priority, callback, that) { - events = isArray(events) ? events : [events]; - if (isFunction(priority)) { - that = callback; - callback = priority; - priority = DEFAULT_PRIORITY3; - } - if (!isNumber(priority)) { - throw new Error("priority must be a number"); - } - var actualCallback = callback; - if (that) { - actualCallback = bind(callback, that); - actualCallback[FN_REF] = callback[FN_REF] || callback; - } - var self = this; - events.forEach(function(e2) { - self._addListener(e2, { - priority, - callback: actualCallback, - next: null - }); - }); -}; -EventBus.prototype.once = function(events, priority, callback, that) { - var self = this; - if (isFunction(priority)) { - that = callback; - callback = priority; - priority = DEFAULT_PRIORITY3; - } - if (!isNumber(priority)) { - throw new Error("priority must be a number"); - } - function wrappedCallback() { - wrappedCallback.__isTomb = true; - var result = callback.apply(that, arguments); - self.off(events, wrappedCallback); - return result; - } - wrappedCallback[FN_REF] = callback; - this.on(events, priority, wrappedCallback); -}; -EventBus.prototype.off = function(events, callback) { - events = isArray(events) ? events : [events]; - var self = this; - events.forEach(function(event2) { - self._removeListener(event2, callback); - }); -}; -EventBus.prototype.createEvent = function(data) { - var event2 = new InternalEvent(); - event2.init(data); - return event2; -}; -EventBus.prototype.fire = function(type, data) { - var event2, firstListener, returnValue, args; - args = slice.call(arguments); - if (typeof type === "object") { - data = type; - type = data.type; - } - if (!type) { - throw new Error("no event type specified"); - } - firstListener = this._listeners[type]; - if (!firstListener) { - return; - } - if (data instanceof InternalEvent) { - event2 = data; - } else { - event2 = this.createEvent(data); - } - args[0] = event2; - var originalType = event2.type; - if (type !== originalType) { - event2.type = type; - } - try { - returnValue = this._invokeListeners(event2, args, firstListener); - } finally { - if (type !== originalType) { - event2.type = originalType; - } - } - if (returnValue === void 0 && event2.defaultPrevented) { - returnValue = false; - } - return returnValue; -}; -EventBus.prototype.handleError = function(error3) { - return this.fire("error", { error: error3 }) === false; -}; -EventBus.prototype._destroy = function() { - this._listeners = {}; -}; -EventBus.prototype._invokeListeners = function(event2, args, listener) { - var returnValue; - while (listener) { - if (event2.cancelBubble) { - break; - } - returnValue = this._invokeListener(event2, args, listener); - listener = listener.next; - } - return returnValue; -}; -EventBus.prototype._invokeListener = function(event2, args, listener) { - var returnValue; - if (listener.callback.__isTomb) { - return returnValue; - } - try { - returnValue = invokeFunction(listener.callback, args); - if (returnValue !== void 0) { - event2.returnValue = returnValue; - event2.stopPropagation(); - } - if (returnValue === false) { - event2.preventDefault(); - } - } catch (error3) { - if (!this.handleError(error3)) { - console.error("unhandled error in event listener", error3); - throw error3; - } - } - return returnValue; -}; -EventBus.prototype._addListener = function(event2, newListener) { - var listener = this._getListeners(event2), previousListener; - if (!listener) { - this._setListeners(event2, newListener); - return; - } - while (listener) { - if (listener.priority < newListener.priority) { - newListener.next = listener; - if (previousListener) { - previousListener.next = newListener; - } else { - this._setListeners(event2, newListener); - } - return; - } - previousListener = listener; - listener = listener.next; - } - previousListener.next = newListener; -}; -EventBus.prototype._getListeners = function(name2) { - return this._listeners[name2]; -}; -EventBus.prototype._setListeners = function(name2, listener) { - this._listeners[name2] = listener; -}; -EventBus.prototype._removeListener = function(event2, callback) { - var listener = this._getListeners(event2), nextListener, previousListener, listenerCallback; - if (!callback) { - this._setListeners(event2, null); - return; - } - while (listener) { - nextListener = listener.next; - listenerCallback = listener.callback; - if (listenerCallback === callback || listenerCallback[FN_REF] === callback) { - if (previousListener) { - previousListener.next = nextListener; - } else { - this._setListeners(event2, nextListener); - } - } - previousListener = listener; - listener = nextListener; - } -}; -function InternalEvent() { -} -InternalEvent.prototype.stopPropagation = function() { - this.cancelBubble = true; -}; -InternalEvent.prototype.preventDefault = function() { - this.defaultPrevented = true; -}; -InternalEvent.prototype.init = function(data) { - assign(this, data || {}); -}; -function invokeFunction(fn, args) { - return fn.apply(null, args); -} - -// node_modules/.pnpm/diagram-js@14.11.3/node_modules/diagram-js/lib/util/GraphicsUtil.js -function getVisual(gfx) { - return gfx.childNodes[0]; -} -function getChildren(gfx) { - return gfx.parentNode.childNodes[1]; -} - -// node_modules/.pnpm/diagram-js@14.11.3/node_modules/diagram-js/lib/core/GraphicsFactory.js -function GraphicsFactory(eventBus, elementRegistry) { - this._eventBus = eventBus; - this._elementRegistry = elementRegistry; -} -GraphicsFactory.$inject = ["eventBus", "elementRegistry"]; -GraphicsFactory.prototype._getChildrenContainer = function(element) { - var gfx = this._elementRegistry.getGraphics(element); - var childrenGfx; - if (!element.parent) { - childrenGfx = gfx; - } else { - childrenGfx = getChildren(gfx); - if (!childrenGfx) { - childrenGfx = create("g"); - classes2(childrenGfx).add("djs-children"); - append(gfx.parentNode, childrenGfx); - } - } - return childrenGfx; -}; -GraphicsFactory.prototype._clear = function(gfx) { - var visual = getVisual(gfx); - clear(visual); - return visual; -}; -GraphicsFactory.prototype._createContainer = function(type, childrenGfx, parentIndex, isFrame) { - var outerGfx = create("g"); - classes2(outerGfx).add("djs-group"); - if (typeof parentIndex !== "undefined") { - prependTo(outerGfx, childrenGfx, childrenGfx.childNodes[parentIndex]); - } else { - append(childrenGfx, outerGfx); - } - var gfx = create("g"); - classes2(gfx).add("djs-element"); - classes2(gfx).add("djs-" + type); - if (isFrame) { - classes2(gfx).add("djs-frame"); - } - append(outerGfx, gfx); - var visual = create("g"); - classes2(visual).add("djs-visual"); - append(gfx, visual); - return gfx; -}; -GraphicsFactory.prototype.create = function(type, element, parentIndex) { - var childrenGfx = this._getChildrenContainer(element.parent); - return this._createContainer(type, childrenGfx, parentIndex, isFrameElement(element)); -}; -GraphicsFactory.prototype.updateContainments = function(elements) { - var self = this, elementRegistry = this._elementRegistry, parents; - parents = reduce(elements, function(map2, e2) { - if (e2.parent) { - map2[e2.parent.id] = e2.parent; - } - return map2; - }, {}); - forEach(parents, function(parent) { - var children = parent.children; - if (!children) { - return; - } - var childrenGfx = self._getChildrenContainer(parent); - forEach(children.slice().reverse(), function(child) { - var childGfx = elementRegistry.getGraphics(child); - prependTo(childGfx.parentNode, childrenGfx); - }); - }); -}; -GraphicsFactory.prototype.drawShape = function(visual, element, attrs = {}) { - var eventBus = this._eventBus; - return eventBus.fire("render.shape", { gfx: visual, element, attrs }); -}; -GraphicsFactory.prototype.getShapePath = function(element) { - var eventBus = this._eventBus; - return eventBus.fire("render.getShapePath", element); -}; -GraphicsFactory.prototype.drawConnection = function(visual, element, attrs = {}) { - var eventBus = this._eventBus; - return eventBus.fire("render.connection", { gfx: visual, element, attrs }); -}; -GraphicsFactory.prototype.getConnectionPath = function(connection) { - var eventBus = this._eventBus; - return eventBus.fire("render.getConnectionPath", connection); -}; -GraphicsFactory.prototype.update = function(type, element, gfx) { - if (!element.parent) { - return; - } - var visual = this._clear(gfx); - if (type === "shape") { - this.drawShape(visual, element); - translate(gfx, element.x, element.y); - } else if (type === "connection") { - this.drawConnection(visual, element); - } else { - throw new Error("unknown type: " + type); - } - if (element.hidden) { - attr2(gfx, "display", "none"); - } else { - attr2(gfx, "display", "block"); - } -}; -GraphicsFactory.prototype.remove = function(element) { - var gfx = this._elementRegistry.getGraphics(element); - remove2(gfx.parentNode); -}; -function prependTo(newNode, parentNode, siblingNode) { - var node = siblingNode || parentNode.firstChild; - if (newNode === node) { - return; - } - parentNode.insertBefore(newNode, node); -} - -// node_modules/.pnpm/diagram-js@14.11.3/node_modules/diagram-js/lib/core/index.js -var core_default2 = { - __depends__: [draw_default2], - __init__: ["canvas"], - canvas: ["type", Canvas], - elementRegistry: ["type", ElementRegistry], - elementFactory: ["type", ElementFactory], - eventBus: ["type", EventBus], - graphicsFactory: ["type", GraphicsFactory] -}; - -// node_modules/.pnpm/diagram-js@14.11.3/node_modules/diagram-js/lib/Diagram.js -function bootstrap(modules) { - var injector = new Injector(modules); - injector.init(); - return injector; -} -function createInjector(options) { - options = options || {}; - var configModule = { - "config": ["value", options] - }; - var modules = [configModule, core_default2].concat(options.modules || []); - return bootstrap(modules); -} -function Diagram(options, injector) { - this._injector = injector || createInjector(options); - this.get("eventBus").fire("diagram.init"); -} -Diagram.prototype.get = function(name2, strict) { - return this._injector.get(name2, strict); -}; -Diagram.prototype.invoke = function(func, context, locals) { - return this._injector.invoke(func, context, locals); -}; -Diagram.prototype.destroy = function() { - this.get("eventBus").fire("diagram.destroy"); -}; -Diagram.prototype.clear = function() { - this.get("eventBus").fire("diagram.clear"); -}; - -// node_modules/.pnpm/moddle@6.2.3/node_modules/moddle/dist/index.esm.js -function Base() { -} -Base.prototype.get = function(name2) { - return this.$model.properties.get(this, name2); -}; -Base.prototype.set = function(name2, value) { - this.$model.properties.set(this, name2, value); -}; -function Factory(model, properties) { - this.model = model; - this.properties = properties; -} -Factory.prototype.createType = function(descriptor) { - var model = this.model; - var props = this.properties, prototype = Object.create(Base.prototype); - forEach(descriptor.properties, function(p) { - if (!p.isMany && p.default !== void 0) { - prototype[p.name] = p.default; - } - }); - props.defineModel(prototype, model); - props.defineDescriptor(prototype, descriptor); - var name2 = descriptor.ns.name; - function ModdleElement(attrs) { - props.define(this, "$type", { value: name2, enumerable: true }); - props.define(this, "$attrs", { value: {} }); - props.define(this, "$parent", { writable: true }); - forEach(attrs, bind(function(val, key) { - this.set(key, val); - }, this)); - } - ModdleElement.prototype = prototype; - ModdleElement.hasType = prototype.$instanceOf = this.model.hasType; - props.defineModel(ModdleElement, model); - props.defineDescriptor(ModdleElement, descriptor); - return ModdleElement; -}; -var BUILTINS = { - String: true, - Boolean: true, - Integer: true, - Real: true, - Element: true -}; -var TYPE_CONVERTERS = { - String: function(s) { - return s; - }, - Boolean: function(s) { - return s === "true"; - }, - Integer: function(s) { - return parseInt(s, 10); - }, - Real: function(s) { - return parseFloat(s); - } -}; -function coerceType(type, value) { - var converter = TYPE_CONVERTERS[type]; - if (converter) { - return converter(value); - } else { - return value; - } -} -function isBuiltIn(type) { - return !!BUILTINS[type]; -} -function isSimple(type) { - return !!TYPE_CONVERTERS[type]; -} -function parseName(name2, defaultPrefix) { - var parts = name2.split(/:/), localName, prefix2; - if (parts.length === 1) { - localName = name2; - prefix2 = defaultPrefix; - } else if (parts.length === 2) { - localName = parts[1]; - prefix2 = parts[0]; - } else { - throw new Error("expected or , got " + name2); - } - name2 = (prefix2 ? prefix2 + ":" : "") + localName; - return { - name: name2, - prefix: prefix2, - localName - }; -} -function DescriptorBuilder(nameNs) { - this.ns = nameNs; - this.name = nameNs.name; - this.allTypes = []; - this.allTypesByName = {}; - this.properties = []; - this.propertiesByName = {}; -} -DescriptorBuilder.prototype.build = function() { - return pick(this, [ - "ns", - "name", - "allTypes", - "allTypesByName", - "properties", - "propertiesByName", - "bodyProperty", - "idProperty" - ]); -}; -DescriptorBuilder.prototype.addProperty = function(p, idx, validate) { - if (typeof idx === "boolean") { - validate = idx; - idx = void 0; - } - this.addNamedProperty(p, validate !== false); - var properties = this.properties; - if (idx !== void 0) { - properties.splice(idx, 0, p); - } else { - properties.push(p); - } -}; -DescriptorBuilder.prototype.replaceProperty = function(oldProperty, newProperty, replace) { - var oldNameNs = oldProperty.ns; - var props = this.properties, propertiesByName = this.propertiesByName, rename = oldProperty.name !== newProperty.name; - if (oldProperty.isId) { - if (!newProperty.isId) { - throw new Error( - "property <" + newProperty.ns.name + "> must be id property to refine <" + oldProperty.ns.name + ">" - ); - } - this.setIdProperty(newProperty, false); - } - if (oldProperty.isBody) { - if (!newProperty.isBody) { - throw new Error( - "property <" + newProperty.ns.name + "> must be body property to refine <" + oldProperty.ns.name + ">" - ); - } - this.setBodyProperty(newProperty, false); - } - var idx = props.indexOf(oldProperty); - if (idx === -1) { - throw new Error("property <" + oldNameNs.name + "> not found in property list"); - } - props.splice(idx, 1); - this.addProperty(newProperty, replace ? void 0 : idx, rename); - propertiesByName[oldNameNs.name] = propertiesByName[oldNameNs.localName] = newProperty; -}; -DescriptorBuilder.prototype.redefineProperty = function(p, targetPropertyName, replace) { - var nsPrefix = p.ns.prefix; - var parts = targetPropertyName.split("#"); - var name2 = parseName(parts[0], nsPrefix); - var attrName = parseName(parts[1], name2.prefix).name; - var redefinedProperty = this.propertiesByName[attrName]; - if (!redefinedProperty) { - throw new Error("refined property <" + attrName + "> not found"); - } else { - this.replaceProperty(redefinedProperty, p, replace); - } - delete p.redefines; -}; -DescriptorBuilder.prototype.addNamedProperty = function(p, validate) { - var ns = p.ns, propsByName = this.propertiesByName; - if (validate) { - this.assertNotDefined(p, ns.name); - this.assertNotDefined(p, ns.localName); - } - propsByName[ns.name] = propsByName[ns.localName] = p; -}; -DescriptorBuilder.prototype.removeNamedProperty = function(p) { - var ns = p.ns, propsByName = this.propertiesByName; - delete propsByName[ns.name]; - delete propsByName[ns.localName]; -}; -DescriptorBuilder.prototype.setBodyProperty = function(p, validate) { - if (validate && this.bodyProperty) { - throw new Error( - "body property defined multiple times (<" + this.bodyProperty.ns.name + ">, <" + p.ns.name + ">)" - ); - } - this.bodyProperty = p; -}; -DescriptorBuilder.prototype.setIdProperty = function(p, validate) { - if (validate && this.idProperty) { - throw new Error( - "id property defined multiple times (<" + this.idProperty.ns.name + ">, <" + p.ns.name + ">)" - ); - } - this.idProperty = p; -}; -DescriptorBuilder.prototype.assertNotTrait = function(typeDescriptor) { - const _extends = typeDescriptor.extends || []; - if (_extends.length) { - throw new Error( - `cannot create <${typeDescriptor.name}> extending <${typeDescriptor.extends}>` - ); - } -}; -DescriptorBuilder.prototype.assertNotDefined = function(p, name2) { - var propertyName = p.name, definedProperty = this.propertiesByName[propertyName]; - if (definedProperty) { - throw new Error( - "property <" + propertyName + "> already defined; override of <" + definedProperty.definedBy.ns.name + "#" + definedProperty.ns.name + "> by <" + p.definedBy.ns.name + "#" + p.ns.name + "> not allowed without redefines" - ); - } -}; -DescriptorBuilder.prototype.hasProperty = function(name2) { - return this.propertiesByName[name2]; -}; -DescriptorBuilder.prototype.addTrait = function(t, inherited) { - if (inherited) { - this.assertNotTrait(t); - } - var typesByName = this.allTypesByName, types3 = this.allTypes; - var typeName = t.name; - if (typeName in typesByName) { - return; - } - forEach(t.properties, bind(function(p) { - p = assign({}, p, { - name: p.ns.localName, - inherited - }); - Object.defineProperty(p, "definedBy", { - value: t - }); - var replaces = p.replaces, redefines = p.redefines; - if (replaces || redefines) { - this.redefineProperty(p, replaces || redefines, replaces); - } else { - if (p.isBody) { - this.setBodyProperty(p); - } - if (p.isId) { - this.setIdProperty(p); - } - this.addProperty(p); - } - }, this)); - types3.push(t); - typesByName[typeName] = t; -}; -function Registry(packages2, properties) { - this.packageMap = {}; - this.typeMap = {}; - this.packages = []; - this.properties = properties; - forEach(packages2, bind(this.registerPackage, this)); -} -Registry.prototype.getPackage = function(uriOrPrefix) { - return this.packageMap[uriOrPrefix]; -}; -Registry.prototype.getPackages = function() { - return this.packages; -}; -Registry.prototype.registerPackage = function(pkg) { - pkg = assign({}, pkg); - var pkgMap = this.packageMap; - ensureAvailable(pkgMap, pkg, "prefix"); - ensureAvailable(pkgMap, pkg, "uri"); - forEach(pkg.types, bind(function(descriptor) { - this.registerType(descriptor, pkg); - }, this)); - pkgMap[pkg.uri] = pkgMap[pkg.prefix] = pkg; - this.packages.push(pkg); -}; -Registry.prototype.registerType = function(type, pkg) { - type = assign({}, type, { - superClass: (type.superClass || []).slice(), - extends: (type.extends || []).slice(), - properties: (type.properties || []).slice(), - meta: assign(type.meta || {}) - }); - var ns = parseName(type.name, pkg.prefix), name2 = ns.name, propertiesByName = {}; - forEach(type.properties, bind(function(p) { - var propertyNs = parseName(p.name, ns.prefix), propertyName = propertyNs.name; - if (!isBuiltIn(p.type)) { - p.type = parseName(p.type, propertyNs.prefix).name; - } - assign(p, { - ns: propertyNs, - name: propertyName - }); - propertiesByName[propertyName] = p; - }, this)); - assign(type, { - ns, - name: name2, - propertiesByName - }); - forEach(type.extends, bind(function(extendsName) { - var extendsNameNs = parseName(extendsName, ns.prefix); - var extended = this.typeMap[extendsNameNs.name]; - extended.traits = extended.traits || []; - extended.traits.push(name2); - }, this)); - this.definePackage(type, pkg); - this.typeMap[name2] = type; -}; -Registry.prototype.mapTypes = function(nsName2, iterator, trait) { - var type = isBuiltIn(nsName2.name) ? { name: nsName2.name } : this.typeMap[nsName2.name]; - var self = this; - function traverse(cls, trait2) { - var parentNs = parseName(cls, isBuiltIn(cls) ? "" : nsName2.prefix); - self.mapTypes(parentNs, iterator, trait2); - } - function traverseTrait(cls) { - return traverse(cls, true); - } - function traverseSuper(cls) { - return traverse(cls, false); - } - if (!type) { - throw new Error("unknown type <" + nsName2.name + ">"); - } - forEach(type.superClass, trait ? traverseTrait : traverseSuper); - iterator(type, !trait); - forEach(type.traits, traverseTrait); -}; -Registry.prototype.getEffectiveDescriptor = function(name2) { - var nsName2 = parseName(name2); - var builder = new DescriptorBuilder(nsName2); - this.mapTypes(nsName2, function(type, inherited) { - builder.addTrait(type, inherited); - }); - var descriptor = builder.build(); - this.definePackage(descriptor, descriptor.allTypes[descriptor.allTypes.length - 1].$pkg); - return descriptor; -}; -Registry.prototype.definePackage = function(target, pkg) { - this.properties.define(target, "$pkg", { value: pkg }); -}; -function ensureAvailable(packageMap, pkg, identifierKey) { - var value = pkg[identifierKey]; - if (value in packageMap) { - throw new Error("package with " + identifierKey + " <" + value + "> already defined"); - } -} -function Properties(model) { - this.model = model; -} -Properties.prototype.set = function(target, name2, value) { - if (!isString(name2) || !name2.length) { - throw new TypeError("property name must be a non-empty string"); - } - var property = this.getProperty(target, name2); - var propertyName = property && property.name; - if (isUndefined(value)) { - if (property) { - delete target[propertyName]; - } else { - delete target.$attrs[stripGlobal(name2)]; - } - } else { - if (property) { - if (propertyName in target) { - target[propertyName] = value; - } else { - defineProperty2(target, property, value); - } - } else { - target.$attrs[stripGlobal(name2)] = value; - } - } -}; -Properties.prototype.get = function(target, name2) { - var property = this.getProperty(target, name2); - if (!property) { - return target.$attrs[stripGlobal(name2)]; - } - var propertyName = property.name; - if (!target[propertyName] && property.isMany) { - defineProperty2(target, property, []); - } - return target[propertyName]; -}; -Properties.prototype.define = function(target, name2, options) { - if (!options.writable) { - var value = options.value; - options = assign({}, options, { - get: function() { - return value; - } - }); - delete options.value; - } - Object.defineProperty(target, name2, options); -}; -Properties.prototype.defineDescriptor = function(target, descriptor) { - this.define(target, "$descriptor", { value: descriptor }); -}; -Properties.prototype.defineModel = function(target, model) { - this.define(target, "$model", { value: model }); -}; -Properties.prototype.getProperty = function(target, name2) { - var model = this.model; - var property = model.getPropertyDescriptor(target, name2); - if (property) { - return property; - } - if (name2.includes(":")) { - return null; - } - const strict = model.config.strict; - if (typeof strict !== "undefined") { - const error3 = new TypeError(`unknown property <${name2}> on <${target.$type}>`); - if (strict) { - throw error3; - } else { - typeof console !== "undefined" && console.warn(error3); - } - } - return null; -}; -function isUndefined(val) { - return typeof val === "undefined"; -} -function defineProperty2(target, property, value) { - Object.defineProperty(target, property.name, { - enumerable: !property.isReference, - writable: true, - value, - configurable: true - }); -} -function stripGlobal(name2) { - return name2.replace(/^:/, ""); -} -function Moddle(packages2, config = {}) { - this.properties = new Properties(this); - this.factory = new Factory(this, this.properties); - this.registry = new Registry(packages2, this.properties); - this.typeCache = {}; - this.config = config; -} -Moddle.prototype.create = function(descriptor, attrs) { - var Type = this.getType(descriptor); - if (!Type) { - throw new Error("unknown type <" + descriptor + ">"); - } - return new Type(attrs); -}; -Moddle.prototype.getType = function(descriptor) { - var cache = this.typeCache; - var name2 = isString(descriptor) ? descriptor : descriptor.ns.name; - var type = cache[name2]; - if (!type) { - descriptor = this.registry.getEffectiveDescriptor(name2); - type = cache[name2] = this.factory.createType(descriptor); - } - return type; -}; -Moddle.prototype.createAny = function(name2, nsUri, properties) { - var nameNs = parseName(name2); - var element = { - $type: name2, - $instanceOf: function(type) { - return type === this.$type; - }, - get: function(key) { - return this[key]; - }, - set: function(key, value) { - set(this, [key], value); - } - }; - var descriptor = { - name: name2, - isGeneric: true, - ns: { - prefix: nameNs.prefix, - localName: nameNs.localName, - uri: nsUri - } - }; - this.properties.defineDescriptor(element, descriptor); - this.properties.defineModel(element, this); - this.properties.define(element, "get", { enumerable: false, writable: true }); - this.properties.define(element, "set", { enumerable: false, writable: true }); - this.properties.define(element, "$parent", { enumerable: false, writable: true }); - this.properties.define(element, "$instanceOf", { enumerable: false, writable: true }); - forEach(properties, function(a, key) { - if (isObject(a) && a.value !== void 0) { - element[a.name] = a.value; - } else { - element[key] = a; - } - }); - return element; -}; -Moddle.prototype.getPackage = function(uriOrPrefix) { - return this.registry.getPackage(uriOrPrefix); -}; -Moddle.prototype.getPackages = function() { - return this.registry.getPackages(); -}; -Moddle.prototype.getElementDescriptor = function(element) { - return element.$descriptor; -}; -Moddle.prototype.hasType = function(element, type) { - if (type === void 0) { - type = element; - element = this; - } - var descriptor = element.$model.getElementDescriptor(element); - return type in descriptor.allTypesByName; -}; -Moddle.prototype.getPropertyDescriptor = function(element, property) { - return this.getElementDescriptor(element).propertiesByName[property]; -}; -Moddle.prototype.getTypeDescriptor = function(type) { - return this.registry.typeMap[type]; -}; - -// node_modules/.pnpm/saxen@8.1.2/node_modules/saxen/dist/index.esm.js -var fromCharCode = String.fromCharCode; -var hasOwnProperty2 = Object.prototype.hasOwnProperty; -var ENTITY_PATTERN = /&#(\d+);|&#x([0-9a-f]+);|&(\w+);/ig; -var ENTITY_MAPPING = { - "amp": "&", - "apos": "'", - "gt": ">", - "lt": "<", - "quot": '"' -}; -Object.keys(ENTITY_MAPPING).forEach(function(k) { - ENTITY_MAPPING[k.toUpperCase()] = ENTITY_MAPPING[k]; -}); -function replaceEntities(_, d, x, z) { - if (z) { - if (hasOwnProperty2.call(ENTITY_MAPPING, z)) { - return ENTITY_MAPPING[z]; - } else { - return "&" + z + ";"; - } - } - if (d) { - return fromCharCode(d); - } - return fromCharCode(parseInt(x, 16)); -} -function decodeEntities(s) { - if (s.length > 3 && s.indexOf("&") !== -1) { - return s.replace(ENTITY_PATTERN, replaceEntities); - } - return s; -} -var XSI_URI = "http://www.w3.org/2001/XMLSchema-instance"; -var XSI_PREFIX = "xsi"; -var XSI_TYPE = "xsi:type"; -var NON_WHITESPACE_OUTSIDE_ROOT_NODE = "non-whitespace outside of root node"; -function error(msg) { - return new Error(msg); -} -function missingNamespaceForPrefix(prefix2) { - return "missing namespace for prefix <" + prefix2 + ">"; -} -function getter(getFn) { - return { - "get": getFn, - "enumerable": true - }; -} -function cloneNsMatrix(nsMatrix) { - var clone = {}, key; - for (key in nsMatrix) { - clone[key] = nsMatrix[key]; - } - return clone; -} -function uriPrefix(prefix2) { - return prefix2 + "$uri"; -} -function buildNsMatrix(nsUriToPrefix) { - var nsMatrix = {}, uri2, prefix2; - for (uri2 in nsUriToPrefix) { - prefix2 = nsUriToPrefix[uri2]; - nsMatrix[prefix2] = prefix2; - nsMatrix[uriPrefix(prefix2)] = uri2; - } - return nsMatrix; -} -function noopGetContext() { - return { "line": 0, "column": 0 }; -} -function throwFunc(err) { - throw err; -} -function Parser(options) { - if (!this) { - return new Parser(options); - } - var proxy = options && options["proxy"]; - var onText, onOpenTag, onCloseTag, onCDATA, onError = throwFunc, onWarning, onComment, onQuestion, onAttention; - var getContext = noopGetContext; - var maybeNS = false; - var isNamespace = false; - var returnError = null; - var parseStop = false; - var nsUriToPrefix; - function handleError(err) { - if (!(err instanceof Error)) { - err = error(err); - } - returnError = err; - onError(err, getContext); - } - function handleWarning(err) { - if (!onWarning) { - return; - } - if (!(err instanceof Error)) { - err = error(err); - } - onWarning(err, getContext); - } - this["on"] = function(name2, cb) { - if (typeof cb !== "function") { - throw error("required args "); - } - switch (name2) { - case "openTag": - onOpenTag = cb; - break; - case "text": - onText = cb; - break; - case "closeTag": - onCloseTag = cb; - break; - case "error": - onError = cb; - break; - case "warn": - onWarning = cb; - break; - case "cdata": - onCDATA = cb; - break; - case "attention": - onAttention = cb; - break; - case "question": - onQuestion = cb; - break; - case "comment": - onComment = cb; - break; - default: - throw error("unsupported event: " + name2); - } - return this; - }; - this["ns"] = function(nsMap) { - if (typeof nsMap === "undefined") { - nsMap = {}; - } - if (typeof nsMap !== "object") { - throw error("required args "); - } - var _nsUriToPrefix = {}, k; - for (k in nsMap) { - _nsUriToPrefix[k] = nsMap[k]; - } - _nsUriToPrefix[XSI_URI] = XSI_PREFIX; - isNamespace = true; - nsUriToPrefix = _nsUriToPrefix; - return this; - }; - this["parse"] = function(xml2) { - if (typeof xml2 !== "string") { - throw error("required args "); - } - returnError = null; - parse(xml2); - getContext = noopGetContext; - parseStop = false; - return returnError; - }; - this["stop"] = function() { - parseStop = true; - }; - function parse(xml2) { - var nsMatrixStack = isNamespace ? [] : null, nsMatrix = isNamespace ? buildNsMatrix(nsUriToPrefix) : null, _nsMatrix, nodeStack = [], anonymousNsCount = 0, tagStart = false, tagEnd = false, i = 0, j = 0, x, y, q, w, v, xmlns, elementName, _elementName, elementProxy; - var attrsString = "", attrsStart = 0, cachedAttrs; - function getAttrs() { - if (cachedAttrs !== null) { - return cachedAttrs; - } - var nsUri, nsUriPrefix, nsName2, defaultAlias = isNamespace && nsMatrix["xmlns"], attrList = isNamespace && maybeNS ? [] : null, i2 = attrsStart, s = attrsString, l = s.length, hasNewMatrix, newalias, value, alias, name2, attrs = {}, seenAttrs = {}, skipAttr, w2, j2; - parseAttr: - for (; i2 < l; i2++) { - skipAttr = false; - w2 = s.charCodeAt(i2); - if (w2 === 32 || w2 < 14 && w2 > 8) { - continue; - } - if (w2 < 65 || w2 > 122 || w2 > 90 && w2 < 97) { - if (w2 !== 95 && w2 !== 58) { - handleWarning("illegal first char attribute name"); - skipAttr = true; - } - } - for (j2 = i2 + 1; j2 < l; j2++) { - w2 = s.charCodeAt(j2); - if (w2 > 96 && w2 < 123 || w2 > 64 && w2 < 91 || w2 > 47 && w2 < 59 || w2 === 46 || // '.' - w2 === 45 || // '-' - w2 === 95) { - continue; - } - if (w2 === 32 || w2 < 14 && w2 > 8) { - handleWarning("missing attribute value"); - i2 = j2; - continue parseAttr; - } - if (w2 === 61) { - break; - } - handleWarning("illegal attribute name char"); - skipAttr = true; - } - name2 = s.substring(i2, j2); - if (name2 === "xmlns:xmlns") { - handleWarning("illegal declaration of xmlns"); - skipAttr = true; - } - w2 = s.charCodeAt(j2 + 1); - if (w2 === 34) { - j2 = s.indexOf('"', i2 = j2 + 2); - if (j2 === -1) { - j2 = s.indexOf("'", i2); - if (j2 !== -1) { - handleWarning("attribute value quote missmatch"); - skipAttr = true; - } - } - } else if (w2 === 39) { - j2 = s.indexOf("'", i2 = j2 + 2); - if (j2 === -1) { - j2 = s.indexOf('"', i2); - if (j2 !== -1) { - handleWarning("attribute value quote missmatch"); - skipAttr = true; - } - } - } else { - handleWarning("missing attribute value quotes"); - skipAttr = true; - for (j2 = j2 + 1; j2 < l; j2++) { - w2 = s.charCodeAt(j2 + 1); - if (w2 === 32 || w2 < 14 && w2 > 8) { - break; - } - } - } - if (j2 === -1) { - handleWarning("missing closing quotes"); - j2 = l; - skipAttr = true; - } - if (!skipAttr) { - value = s.substring(i2, j2); - } - i2 = j2; - for (; j2 + 1 < l; j2++) { - w2 = s.charCodeAt(j2 + 1); - if (w2 === 32 || w2 < 14 && w2 > 8) { - break; - } - if (i2 === j2) { - handleWarning("illegal character after attribute end"); - skipAttr = true; - } - } - i2 = j2 + 1; - if (skipAttr) { - continue parseAttr; - } - if (name2 in seenAttrs) { - handleWarning("attribute <" + name2 + "> already defined"); - continue; - } - seenAttrs[name2] = true; - if (!isNamespace) { - attrs[name2] = value; - continue; - } - if (maybeNS) { - newalias = name2 === "xmlns" ? "xmlns" : name2.charCodeAt(0) === 120 && name2.substr(0, 6) === "xmlns:" ? name2.substr(6) : null; - if (newalias !== null) { - nsUri = decodeEntities(value); - nsUriPrefix = uriPrefix(newalias); - alias = nsUriToPrefix[nsUri]; - if (!alias) { - if (newalias === "xmlns" || nsUriPrefix in nsMatrix && nsMatrix[nsUriPrefix] !== nsUri) { - do { - alias = "ns" + anonymousNsCount++; - } while (typeof nsMatrix[alias] !== "undefined"); - } else { - alias = newalias; - } - nsUriToPrefix[nsUri] = alias; - } - if (nsMatrix[newalias] !== alias) { - if (!hasNewMatrix) { - nsMatrix = cloneNsMatrix(nsMatrix); - hasNewMatrix = true; - } - nsMatrix[newalias] = alias; - if (newalias === "xmlns") { - nsMatrix[uriPrefix(alias)] = nsUri; - defaultAlias = alias; - } - nsMatrix[nsUriPrefix] = nsUri; - } - attrs[name2] = value; - continue; - } - attrList.push(name2, value); - continue; - } - w2 = name2.indexOf(":"); - if (w2 === -1) { - attrs[name2] = value; - continue; - } - if (!(nsName2 = nsMatrix[name2.substring(0, w2)])) { - handleWarning(missingNamespaceForPrefix(name2.substring(0, w2))); - continue; - } - name2 = defaultAlias === nsName2 ? name2.substr(w2 + 1) : nsName2 + name2.substr(w2); - if (name2 === XSI_TYPE) { - w2 = value.indexOf(":"); - if (w2 !== -1) { - nsName2 = value.substring(0, w2); - nsName2 = nsMatrix[nsName2] || nsName2; - value = nsName2 + value.substring(w2); - } else { - value = defaultAlias + ":" + value; - } - } - attrs[name2] = value; - } - if (maybeNS) { - for (i2 = 0, l = attrList.length; i2 < l; i2++) { - name2 = attrList[i2++]; - value = attrList[i2]; - w2 = name2.indexOf(":"); - if (w2 !== -1) { - if (!(nsName2 = nsMatrix[name2.substring(0, w2)])) { - handleWarning(missingNamespaceForPrefix(name2.substring(0, w2))); - continue; - } - name2 = defaultAlias === nsName2 ? name2.substr(w2 + 1) : nsName2 + name2.substr(w2); - if (name2 === XSI_TYPE) { - w2 = value.indexOf(":"); - if (w2 !== -1) { - nsName2 = value.substring(0, w2); - nsName2 = nsMatrix[nsName2] || nsName2; - value = nsName2 + value.substring(w2); - } else { - value = defaultAlias + ":" + value; - } - } - } - attrs[name2] = value; - } - } - return cachedAttrs = attrs; - } - function getParseContext() { - var splitsRe = /(\r\n|\r|\n)/g; - var line = 0; - var column = 0; - var startOfLine = 0; - var endOfLine = j; - var match; - var data; - while (i >= startOfLine) { - match = splitsRe.exec(xml2); - if (!match) { - break; - } - endOfLine = match[0].length + match.index; - if (endOfLine > i) { - break; - } - line += 1; - startOfLine = endOfLine; - } - if (i == -1) { - column = endOfLine; - data = xml2.substring(j); - } else if (j === 0) { - data = xml2.substring(j, i); - } else { - column = i - startOfLine; - data = j == -1 ? xml2.substring(i) : xml2.substring(i, j + 1); - } - return { - "data": data, - "line": line, - "column": column - }; - } - getContext = getParseContext; - if (proxy) { - elementProxy = Object.create({}, { - "name": getter(function() { - return elementName; - }), - "originalName": getter(function() { - return _elementName; - }), - "attrs": getter(getAttrs), - "ns": getter(function() { - return nsMatrix; - }) - }); - } - while (j !== -1) { - if (xml2.charCodeAt(j) === 60) { - i = j; - } else { - i = xml2.indexOf("<", j); - } - if (i === -1) { - if (nodeStack.length) { - return handleError("unexpected end of file"); - } - if (j === 0) { - return handleError("missing start tag"); - } - if (j < xml2.length) { - if (xml2.substring(j).trim()) { - handleWarning(NON_WHITESPACE_OUTSIDE_ROOT_NODE); - } - } - return; - } - if (j !== i) { - if (nodeStack.length) { - if (onText) { - onText(xml2.substring(j, i), decodeEntities, getContext); - if (parseStop) { - return; - } - } - } else { - if (xml2.substring(j, i).trim()) { - handleWarning(NON_WHITESPACE_OUTSIDE_ROOT_NODE); - if (parseStop) { - return; - } - } - } - } - w = xml2.charCodeAt(i + 1); - if (w === 33) { - q = xml2.charCodeAt(i + 2); - if (q === 91 && xml2.substr(i + 3, 6) === "CDATA[") { - j = xml2.indexOf("]]>", i); - if (j === -1) { - return handleError("unclosed cdata"); - } - if (onCDATA) { - onCDATA(xml2.substring(i + 9, j), getContext); - if (parseStop) { - return; - } - } - j += 3; - continue; - } - if (q === 45 && xml2.charCodeAt(i + 3) === 45) { - j = xml2.indexOf("-->", i); - if (j === -1) { - return handleError("unclosed comment"); - } - if (onComment) { - onComment(xml2.substring(i + 4, j), decodeEntities, getContext); - if (parseStop) { - return; - } - } - j += 3; - continue; - } - } - if (w === 63) { - j = xml2.indexOf("?>", i); - if (j === -1) { - return handleError("unclosed question"); - } - if (onQuestion) { - onQuestion(xml2.substring(i, j + 2), getContext); - if (parseStop) { - return; - } - } - j += 2; - continue; - } - for (x = i + 1; ; x++) { - v = xml2.charCodeAt(x); - if (isNaN(v)) { - j = -1; - return handleError("unclosed tag"); - } - if (v === 34) { - q = xml2.indexOf('"', x + 1); - x = q !== -1 ? q : x; - } else if (v === 39) { - q = xml2.indexOf("'", x + 1); - x = q !== -1 ? q : x; - } else if (v === 62) { - j = x; - break; - } - } - if (w === 33) { - if (onAttention) { - onAttention(xml2.substring(i, j + 1), decodeEntities, getContext); - if (parseStop) { - return; - } - } - j += 1; - continue; - } - cachedAttrs = {}; - if (w === 47) { - tagStart = false; - tagEnd = true; - if (!nodeStack.length) { - return handleError("missing open tag"); - } - x = elementName = nodeStack.pop(); - q = i + 2 + x.length; - if (xml2.substring(i + 2, q) !== x) { - return handleError("closing tag mismatch"); - } - for (; q < j; q++) { - w = xml2.charCodeAt(q); - if (w === 32 || w > 8 && w < 14) { - continue; - } - return handleError("close tag"); - } - } else { - if (xml2.charCodeAt(j - 1) === 47) { - x = elementName = xml2.substring(i + 1, j - 1); - tagStart = true; - tagEnd = true; - } else { - x = elementName = xml2.substring(i + 1, j); - tagStart = true; - tagEnd = false; - } - if (!(w > 96 && w < 123 || w > 64 && w < 91 || w === 95 || w === 58)) { - return handleError("illegal first char nodeName"); - } - for (q = 1, y = x.length; q < y; q++) { - w = x.charCodeAt(q); - if (w > 96 && w < 123 || w > 64 && w < 91 || w > 47 && w < 59 || w === 45 || w === 95 || w == 46) { - continue; - } - if (w === 32 || w < 14 && w > 8) { - elementName = x.substring(0, q); - cachedAttrs = null; - break; - } - return handleError("invalid nodeName"); - } - if (!tagEnd) { - nodeStack.push(elementName); - } - } - if (isNamespace) { - _nsMatrix = nsMatrix; - if (tagStart) { - if (!tagEnd) { - nsMatrixStack.push(_nsMatrix); - } - if (cachedAttrs === null) { - if (maybeNS = x.indexOf("xmlns", q) !== -1) { - attrsStart = q; - attrsString = x; - getAttrs(); - maybeNS = false; - } - } - } - _elementName = elementName; - w = elementName.indexOf(":"); - if (w !== -1) { - xmlns = nsMatrix[elementName.substring(0, w)]; - if (!xmlns) { - return handleError("missing namespace on <" + _elementName + ">"); - } - elementName = elementName.substr(w + 1); - } else { - xmlns = nsMatrix["xmlns"]; - } - if (xmlns) { - elementName = xmlns + ":" + elementName; - } - } - if (tagStart) { - attrsStart = q; - attrsString = x; - if (onOpenTag) { - if (proxy) { - onOpenTag(elementProxy, decodeEntities, tagEnd, getContext); - } else { - onOpenTag(elementName, getAttrs, decodeEntities, tagEnd, getContext); - } - if (parseStop) { - return; - } - } - } - if (tagEnd) { - if (onCloseTag) { - onCloseTag(proxy ? elementProxy : elementName, decodeEntities, tagStart, getContext); - if (parseStop) { - return; - } - } - if (isNamespace) { - if (!tagStart) { - nsMatrix = nsMatrixStack.pop(); - } else { - nsMatrix = _nsMatrix; - } - } - } - j += 1; - } - } -} - -// node_modules/.pnpm/moddle-xml@10.1.0/node_modules/moddle-xml/dist/index.esm.js -function hasLowerCaseAlias(pkg) { - return pkg.xml && pkg.xml.tagAlias === "lowerCase"; -} -var DEFAULT_NS_MAP = { - "xsi": "http://www.w3.org/2001/XMLSchema-instance", - "xml": "http://www.w3.org/XML/1998/namespace" -}; -var XSI_TYPE2 = "xsi:type"; -function serializeFormat(element) { - return element.xml && element.xml.serialize; -} -function serializeAsType(element) { - return serializeFormat(element) === XSI_TYPE2; -} -function serializeAsProperty(element) { - return serializeFormat(element) === "property"; -} -function capitalize(str) { - return str.charAt(0).toUpperCase() + str.slice(1); -} -function aliasToName(aliasNs, pkg) { - if (!hasLowerCaseAlias(pkg)) { - return aliasNs.name; - } - return aliasNs.prefix + ":" + capitalize(aliasNs.localName); -} -function prefixedToName(nameNs, pkg) { - var name2 = nameNs.name, localName = nameNs.localName; - var typePrefix = pkg.xml && pkg.xml.typePrefix; - if (typePrefix && localName.indexOf(typePrefix) === 0) { - return nameNs.prefix + ":" + localName.slice(typePrefix.length); - } else { - return name2; - } -} -function normalizeXsiTypeName(name2, model) { - var nameNs = parseName(name2); - var pkg = model.getPackage(nameNs.prefix); - return prefixedToName(nameNs, pkg); -} -function error2(message) { - return new Error(message); -} -function getModdleDescriptor(element) { - return element.$descriptor; -} -function Context(options) { - assign(this, options); - this.elementsById = {}; - this.references = []; - this.warnings = []; - this.addReference = function(reference) { - this.references.push(reference); - }; - this.addElement = function(element) { - if (!element) { - throw error2("expected element"); - } - var elementsById = this.elementsById; - var descriptor = getModdleDescriptor(element); - var idProperty = descriptor.idProperty, id; - if (idProperty) { - id = element.get(idProperty.name); - if (id) { - if (!/^([a-z][\w-.]*:)?[a-z_][\w-.]*$/i.test(id)) { - throw new Error("illegal ID <" + id + ">"); - } - if (elementsById[id]) { - throw error2("duplicate ID <" + id + ">"); - } - elementsById[id] = element; - } - } - }; - this.addWarning = function(warning) { - this.warnings.push(warning); - }; -} -function BaseHandler() { -} -BaseHandler.prototype.handleEnd = function() { -}; -BaseHandler.prototype.handleText = function() { -}; -BaseHandler.prototype.handleNode = function() { -}; -function NoopHandler() { -} -NoopHandler.prototype = Object.create(BaseHandler.prototype); -NoopHandler.prototype.handleNode = function() { - return this; -}; -function BodyHandler() { -} -BodyHandler.prototype = Object.create(BaseHandler.prototype); -BodyHandler.prototype.handleText = function(text) { - this.body = (this.body || "") + text; -}; -function ReferenceHandler(property, context) { - this.property = property; - this.context = context; -} -ReferenceHandler.prototype = Object.create(BodyHandler.prototype); -ReferenceHandler.prototype.handleNode = function(node) { - if (this.element) { - throw error2("expected no sub nodes"); - } else { - this.element = this.createReference(node); - } - return this; -}; -ReferenceHandler.prototype.handleEnd = function() { - this.element.id = this.body; -}; -ReferenceHandler.prototype.createReference = function(node) { - return { - property: this.property.ns.name, - id: "" - }; -}; -function ValueHandler(propertyDesc, element) { - this.element = element; - this.propertyDesc = propertyDesc; -} -ValueHandler.prototype = Object.create(BodyHandler.prototype); -ValueHandler.prototype.handleEnd = function() { - var value = this.body || "", element = this.element, propertyDesc = this.propertyDesc; - value = coerceType(propertyDesc.type, value); - if (propertyDesc.isMany) { - element.get(propertyDesc.name).push(value); - } else { - element.set(propertyDesc.name, value); - } -}; -function BaseElementHandler() { -} -BaseElementHandler.prototype = Object.create(BodyHandler.prototype); -BaseElementHandler.prototype.handleNode = function(node) { - var parser = this, element = this.element; - if (!element) { - element = this.element = this.createElement(node); - this.context.addElement(element); - } else { - parser = this.handleChild(node); - } - return parser; -}; -function ElementHandler(model, typeName, context) { - this.model = model; - this.type = model.getType(typeName); - this.context = context; -} -ElementHandler.prototype = Object.create(BaseElementHandler.prototype); -ElementHandler.prototype.addReference = function(reference) { - this.context.addReference(reference); -}; -ElementHandler.prototype.handleText = function(text) { - var element = this.element, descriptor = getModdleDescriptor(element), bodyProperty = descriptor.bodyProperty; - if (!bodyProperty) { - throw error2("unexpected body text <" + text + ">"); - } - BodyHandler.prototype.handleText.call(this, text); -}; -ElementHandler.prototype.handleEnd = function() { - var value = this.body, element = this.element, descriptor = getModdleDescriptor(element), bodyProperty = descriptor.bodyProperty; - if (bodyProperty && value !== void 0) { - value = coerceType(bodyProperty.type, value); - element.set(bodyProperty.name, value); - } -}; -ElementHandler.prototype.createElement = function(node) { - var attributes = node.attributes, Type = this.type, descriptor = getModdleDescriptor(Type), context = this.context, instance = new Type({}), model = this.model, propNameNs; - forEach(attributes, function(value, name2) { - var prop = descriptor.propertiesByName[name2], values; - if (prop && prop.isReference) { - if (!prop.isMany) { - context.addReference({ - element: instance, - property: prop.ns.name, - id: value - }); - } else { - values = value.split(" "); - forEach(values, function(v) { - context.addReference({ - element: instance, - property: prop.ns.name, - id: v - }); - }); - } - } else { - if (prop) { - value = coerceType(prop.type, value); - } else if (name2 !== "xmlns") { - propNameNs = parseName(name2, descriptor.ns.prefix); - if (model.getPackage(propNameNs.prefix)) { - context.addWarning({ - message: "unknown attribute <" + name2 + ">", - element: instance, - property: name2, - value - }); - } - } - instance.set(name2, value); - } - }); - return instance; -}; -ElementHandler.prototype.getPropertyForNode = function(node) { - var name2 = node.name; - var nameNs = parseName(name2); - var type = this.type, model = this.model, descriptor = getModdleDescriptor(type); - var propertyName = nameNs.name, property = descriptor.propertiesByName[propertyName], elementTypeName, elementType; - if (property && !property.isAttr) { - if (serializeAsType(property)) { - elementTypeName = node.attributes[XSI_TYPE2]; - if (elementTypeName) { - elementTypeName = normalizeXsiTypeName(elementTypeName, model); - elementType = model.getType(elementTypeName); - return assign({}, property, { - effectiveType: getModdleDescriptor(elementType).name - }); - } - } - return property; - } - var pkg = model.getPackage(nameNs.prefix); - if (pkg) { - elementTypeName = aliasToName(nameNs, pkg); - elementType = model.getType(elementTypeName); - property = find(descriptor.properties, function(p) { - return !p.isVirtual && !p.isReference && !p.isAttribute && elementType.hasType(p.type); - }); - if (property) { - return assign({}, property, { - effectiveType: getModdleDescriptor(elementType).name - }); - } - } else { - property = find(descriptor.properties, function(p) { - return !p.isReference && !p.isAttribute && p.type === "Element"; - }); - if (property) { - return property; - } - } - throw error2("unrecognized element <" + nameNs.name + ">"); -}; -ElementHandler.prototype.toString = function() { - return "ElementDescriptor[" + getModdleDescriptor(this.type).name + "]"; -}; -ElementHandler.prototype.valueHandler = function(propertyDesc, element) { - return new ValueHandler(propertyDesc, element); -}; -ElementHandler.prototype.referenceHandler = function(propertyDesc) { - return new ReferenceHandler(propertyDesc, this.context); -}; -ElementHandler.prototype.handler = function(type) { - if (type === "Element") { - return new GenericElementHandler(this.model, type, this.context); - } else { - return new ElementHandler(this.model, type, this.context); - } -}; -ElementHandler.prototype.handleChild = function(node) { - var propertyDesc, type, element, childHandler; - propertyDesc = this.getPropertyForNode(node); - element = this.element; - type = propertyDesc.effectiveType || propertyDesc.type; - if (isSimple(type)) { - return this.valueHandler(propertyDesc, element); - } - if (propertyDesc.isReference) { - childHandler = this.referenceHandler(propertyDesc).handleNode(node); - } else { - childHandler = this.handler(type).handleNode(node); - } - var newElement = childHandler.element; - if (newElement !== void 0) { - if (propertyDesc.isMany) { - element.get(propertyDesc.name).push(newElement); - } else { - element.set(propertyDesc.name, newElement); - } - if (propertyDesc.isReference) { - assign(newElement, { - element - }); - this.context.addReference(newElement); - } else { - newElement.$parent = element; - } - } - return childHandler; -}; -function RootElementHandler(model, typeName, context) { - ElementHandler.call(this, model, typeName, context); -} -RootElementHandler.prototype = Object.create(ElementHandler.prototype); -RootElementHandler.prototype.createElement = function(node) { - var name2 = node.name, nameNs = parseName(name2), model = this.model, type = this.type, pkg = model.getPackage(nameNs.prefix), typeName = pkg && aliasToName(nameNs, pkg) || name2; - if (!type.hasType(typeName)) { - throw error2("unexpected element <" + node.originalName + ">"); - } - return ElementHandler.prototype.createElement.call(this, node); -}; -function GenericElementHandler(model, typeName, context) { - this.model = model; - this.context = context; -} -GenericElementHandler.prototype = Object.create(BaseElementHandler.prototype); -GenericElementHandler.prototype.createElement = function(node) { - var name2 = node.name, ns = parseName(name2), prefix2 = ns.prefix, uri2 = node.ns[prefix2 + "$uri"], attributes = node.attributes; - return this.model.createAny(name2, uri2, attributes); -}; -GenericElementHandler.prototype.handleChild = function(node) { - var handler = new GenericElementHandler(this.model, "Element", this.context).handleNode(node), element = this.element; - var newElement = handler.element, children; - if (newElement !== void 0) { - children = element.$children = element.$children || []; - children.push(newElement); - newElement.$parent = element; - } - return handler; -}; -GenericElementHandler.prototype.handleEnd = function() { - if (this.body) { - this.element.$body = this.body; - } -}; -function Reader(options) { - if (options instanceof Moddle) { - options = { - model: options - }; - } - assign(this, { lax: false }, options); -} -Reader.prototype.fromXML = function(xml2, options, done) { - var rootHandler = options.rootHandler; - if (options instanceof ElementHandler) { - rootHandler = options; - options = {}; - } else { - if (typeof options === "string") { - rootHandler = this.handler(options); - options = {}; - } else if (typeof rootHandler === "string") { - rootHandler = this.handler(rootHandler); - } - } - var model = this.model, lax = this.lax; - var context = new Context(assign({}, options, { rootHandler })), parser = new Parser({ proxy: true }), stack = createStack(); - rootHandler.context = context; - stack.push(rootHandler); - function handleError(err, getContext, lax2) { - var ctx = getContext(); - var line = ctx.line, column = ctx.column, data = ctx.data; - if (data.charAt(0) === "<" && data.indexOf(" ") !== -1) { - data = data.slice(0, data.indexOf(" ")) + ">"; - } - var message = "unparsable content " + (data ? data + " " : "") + "detected\n line: " + line + "\n column: " + column + "\n nested error: " + err.message; - if (lax2) { - context.addWarning({ - message, - error: err - }); - return true; - } else { - throw error2(message); - } - } - function handleWarning(err, getContext) { - return handleError(err, getContext, true); - } - function resolveReferences() { - var elementsById = context.elementsById; - var references = context.references; - var i, r; - for (i = 0; r = references[i]; i++) { - var element = r.element; - var reference = elementsById[r.id]; - var property = getModdleDescriptor(element).propertiesByName[r.property]; - if (!reference) { - context.addWarning({ - message: "unresolved reference <" + r.id + ">", - element: r.element, - property: r.property, - value: r.id - }); - } - if (property.isMany) { - var collection = element.get(property.name), idx = collection.indexOf(r); - if (idx === -1) { - idx = collection.length; - } - if (!reference) { - collection.splice(idx, 1); - } else { - collection[idx] = reference; - } - } else { - element.set(property.name, reference); - } - } - } - function handleClose() { - stack.pop().handleEnd(); - } - var PREAMBLE_START_PATTERN = /^<\?xml /i; - var ENCODING_PATTERN = / encoding="([^"]+)"/i; - var UTF_8_PATTERN = /^utf-8$/i; - function handleQuestion(question) { - if (!PREAMBLE_START_PATTERN.test(question)) { - return; - } - var match = ENCODING_PATTERN.exec(question); - var encoding = match && match[1]; - if (!encoding || UTF_8_PATTERN.test(encoding)) { - return; - } - context.addWarning({ - message: "unsupported document encoding <" + encoding + ">, falling back to UTF-8" - }); - } - function handleOpen(node, getContext) { - var handler = stack.peek(); - try { - stack.push(handler.handleNode(node)); - } catch (err) { - if (handleError(err, getContext, lax)) { - stack.push(new NoopHandler()); - } - } - } - function handleCData(text, getContext) { - try { - stack.peek().handleText(text); - } catch (err) { - handleWarning(err, getContext); - } - } - function handleText(text, getContext) { - if (!text.trim()) { - return; - } - handleCData(text, getContext); - } - var uriMap = model.getPackages().reduce(function(uriMap2, p) { - uriMap2[p.uri] = p.prefix; - return uriMap2; - }, { - "http://www.w3.org/XML/1998/namespace": "xml" - // add default xml ns - }); - parser.ns(uriMap).on("openTag", function(obj, decodeStr, selfClosing, getContext) { - var attrs = obj.attrs || {}; - var decodedAttrs = Object.keys(attrs).reduce(function(d, key) { - var value = decodeStr(attrs[key]); - d[key] = value; - return d; - }, {}); - var node = { - name: obj.name, - originalName: obj.originalName, - attributes: decodedAttrs, - ns: obj.ns - }; - handleOpen(node, getContext); - }).on("question", handleQuestion).on("closeTag", handleClose).on("cdata", handleCData).on("text", function(text, decodeEntities2, getContext) { - handleText(decodeEntities2(text), getContext); - }).on("error", handleError).on("warn", handleWarning); - return new Promise(function(resolve, reject) { - var err; - try { - parser.parse(xml2); - resolveReferences(); - } catch (e2) { - err = e2; - } - var rootElement = rootHandler.element; - if (!err && !rootElement) { - err = error2("failed to parse document as <" + rootHandler.type.$descriptor.name + ">"); - } - var warnings = context.warnings; - var references = context.references; - var elementsById = context.elementsById; - if (err) { - err.warnings = warnings; - return reject(err); - } else { - return resolve({ - rootElement, - elementsById, - references, - warnings - }); - } - }); -}; -Reader.prototype.handler = function(name2) { - return new RootElementHandler(this.model, name2); -}; -function createStack() { - var stack = []; - Object.defineProperty(stack, "peek", { - value: function() { - return this[this.length - 1]; - } - }); - return stack; -} -var XML_PREAMBLE = '\n'; -var ESCAPE_ATTR_CHARS = /<|>|'|"|&|\n\r|\n/g; -var ESCAPE_CHARS = /<|>|&/g; -function Namespaces(parent) { - var prefixMap = {}; - var uriMap = {}; - var used = {}; - var wellknown = []; - var custom = []; - this.byUri = function(uri2) { - return uriMap[uri2] || parent && parent.byUri(uri2); - }; - this.add = function(ns, isWellknown) { - uriMap[ns.uri] = ns; - if (isWellknown) { - wellknown.push(ns); - } else { - custom.push(ns); - } - this.mapPrefix(ns.prefix, ns.uri); - }; - this.uriByPrefix = function(prefix2) { - return prefixMap[prefix2 || "xmlns"]; - }; - this.mapPrefix = function(prefix2, uri2) { - prefixMap[prefix2 || "xmlns"] = uri2; - }; - this.getNSKey = function(ns) { - return ns.prefix !== void 0 ? ns.uri + "|" + ns.prefix : ns.uri; - }; - this.logUsed = function(ns) { - var uri2 = ns.uri; - var nsKey = this.getNSKey(ns); - used[nsKey] = this.byUri(uri2); - if (parent) { - parent.logUsed(ns); - } - }; - this.getUsed = function(ns) { - function isUsed(ns2) { - var nsKey = self.getNSKey(ns2); - return used[nsKey]; - } - var self = this; - var allNs = [].concat(wellknown, custom); - return allNs.filter(isUsed); - }; -} -function lower(string) { - return string.charAt(0).toLowerCase() + string.slice(1); -} -function nameToAlias(name2, pkg) { - if (hasLowerCaseAlias(pkg)) { - return lower(name2); - } else { - return name2; - } -} -function inherits(ctor, superCtor) { - ctor.super_ = superCtor; - ctor.prototype = Object.create(superCtor.prototype, { - constructor: { - value: ctor, - enumerable: false, - writable: true, - configurable: true - } - }); -} -function nsName(ns) { - if (isString(ns)) { - return ns; - } else { - return (ns.prefix ? ns.prefix + ":" : "") + ns.localName; - } -} -function getNsAttrs(namespaces) { - return namespaces.getUsed().filter(function(ns) { - return ns.prefix !== "xml"; - }).map(function(ns) { - var name2 = "xmlns" + (ns.prefix ? ":" + ns.prefix : ""); - return { name: name2, value: ns.uri }; - }); -} -function getElementNs(ns, descriptor) { - if (descriptor.isGeneric) { - return assign({ localName: descriptor.ns.localName }, ns); - } else { - return assign({ localName: nameToAlias(descriptor.ns.localName, descriptor.$pkg) }, ns); - } -} -function getPropertyNs(ns, descriptor) { - return assign({ localName: descriptor.ns.localName }, ns); -} -function getSerializableProperties(element) { - var descriptor = element.$descriptor; - return filter(descriptor.properties, function(p) { - var name2 = p.name; - if (p.isVirtual) { - return false; - } - if (!has(element, name2)) { - return false; - } - var value = element[name2]; - if (value === p.default) { - return false; - } - if (value === null) { - return false; - } - return p.isMany ? value.length : true; - }); -} -var ESCAPE_ATTR_MAP = { - "\n": "#10", - "\n\r": "#10", - '"': "#34", - "'": "#39", - "<": "#60", - ">": "#62", - "&": "#38" -}; -var ESCAPE_MAP = { - "<": "lt", - ">": "gt", - "&": "amp" -}; -function escape(str, charPattern, replaceMap) { - str = isString(str) ? str : "" + str; - return str.replace(charPattern, function(s) { - return "&" + replaceMap[s] + ";"; - }); -} -function escapeAttr(str) { - return escape(str, ESCAPE_ATTR_CHARS, ESCAPE_ATTR_MAP); -} -function escapeBody(str) { - return escape(str, ESCAPE_CHARS, ESCAPE_MAP); -} -function filterAttributes(props) { - return filter(props, function(p) { - return p.isAttr; - }); -} -function filterContained(props) { - return filter(props, function(p) { - return !p.isAttr; - }); -} -function ReferenceSerializer(tagName) { - this.tagName = tagName; -} -ReferenceSerializer.prototype.build = function(element) { - this.element = element; - return this; -}; -ReferenceSerializer.prototype.serializeTo = function(writer) { - writer.appendIndent().append("<" + this.tagName + ">" + this.element.id + "").appendNewLine(); -}; -function BodySerializer() { -} -BodySerializer.prototype.serializeValue = BodySerializer.prototype.serializeTo = function(writer) { - writer.append( - this.escape ? escapeBody(this.value) : this.value - ); -}; -BodySerializer.prototype.build = function(prop, value) { - this.value = value; - if (prop.type === "String" && value.search(ESCAPE_CHARS) !== -1) { - this.escape = true; - } - return this; -}; -function ValueSerializer(tagName) { - this.tagName = tagName; -} -inherits(ValueSerializer, BodySerializer); -ValueSerializer.prototype.serializeTo = function(writer) { - writer.appendIndent().append("<" + this.tagName + ">"); - this.serializeValue(writer); - writer.append("").appendNewLine(); -}; -function ElementSerializer(parent, propertyDescriptor) { - this.body = []; - this.attrs = []; - this.parent = parent; - this.propertyDescriptor = propertyDescriptor; -} -ElementSerializer.prototype.build = function(element) { - this.element = element; - var elementDescriptor = element.$descriptor, propertyDescriptor = this.propertyDescriptor; - var otherAttrs, properties; - var isGeneric = elementDescriptor.isGeneric; - if (isGeneric) { - otherAttrs = this.parseGeneric(element); - } else { - otherAttrs = this.parseNsAttributes(element); - } - if (propertyDescriptor) { - this.ns = this.nsPropertyTagName(propertyDescriptor); - } else { - this.ns = this.nsTagName(elementDescriptor); - } - this.tagName = this.addTagName(this.ns); - if (!isGeneric) { - properties = getSerializableProperties(element); - this.parseAttributes(filterAttributes(properties)); - this.parseContainments(filterContained(properties)); - } - this.parseGenericAttributes(element, otherAttrs); - return this; -}; -ElementSerializer.prototype.nsTagName = function(descriptor) { - var effectiveNs = this.logNamespaceUsed(descriptor.ns); - return getElementNs(effectiveNs, descriptor); -}; -ElementSerializer.prototype.nsPropertyTagName = function(descriptor) { - var effectiveNs = this.logNamespaceUsed(descriptor.ns); - return getPropertyNs(effectiveNs, descriptor); -}; -ElementSerializer.prototype.isLocalNs = function(ns) { - return ns.uri === this.ns.uri; -}; -ElementSerializer.prototype.nsAttributeName = function(element) { - var ns; - if (isString(element)) { - ns = parseName(element); - } else { - ns = element.ns; - } - if (element.inherited) { - return { localName: ns.localName }; - } - var effectiveNs = this.logNamespaceUsed(ns); - this.getNamespaces().logUsed(effectiveNs); - if (this.isLocalNs(effectiveNs)) { - return { localName: ns.localName }; - } else { - return assign({ localName: ns.localName }, effectiveNs); - } -}; -ElementSerializer.prototype.parseGeneric = function(element) { - var self = this, body = this.body; - var attributes = []; - forEach(element, function(val, key) { - var nonNsAttr; - if (key === "$body") { - body.push(new BodySerializer().build({ type: "String" }, val)); - } else if (key === "$children") { - forEach(val, function(child) { - body.push(new ElementSerializer(self).build(child)); - }); - } else if (key.indexOf("$") !== 0) { - nonNsAttr = self.parseNsAttribute(element, key, val); - if (nonNsAttr) { - attributes.push({ name: key, value: val }); - } - } - }); - return attributes; -}; -ElementSerializer.prototype.parseNsAttribute = function(element, name2, value) { - var model = element.$model; - var nameNs = parseName(name2); - var ns; - if (nameNs.prefix === "xmlns") { - ns = { prefix: nameNs.localName, uri: value }; - } - if (!nameNs.prefix && nameNs.localName === "xmlns") { - ns = { uri: value }; - } - if (!ns) { - return { - name: name2, - value - }; - } - if (model && model.getPackage(value)) { - this.logNamespace(ns, true, true); - } else { - var actualNs = this.logNamespaceUsed(ns, true); - this.getNamespaces().logUsed(actualNs); - } -}; -ElementSerializer.prototype.parseNsAttributes = function(element, attrs) { - var self = this; - var genericAttrs = element.$attrs; - var attributes = []; - forEach(genericAttrs, function(value, name2) { - var nonNsAttr = self.parseNsAttribute(element, name2, value); - if (nonNsAttr) { - attributes.push(nonNsAttr); - } - }); - return attributes; -}; -ElementSerializer.prototype.parseGenericAttributes = function(element, attributes) { - var self = this; - forEach(attributes, function(attr3) { - if (attr3.name === XSI_TYPE2) { - return; - } - try { - self.addAttribute(self.nsAttributeName(attr3.name), attr3.value); - } catch (e2) { - console.warn( - "missing namespace information for ", - attr3.name, - "=", - attr3.value, - "on", - element, - e2 - ); - } - }); -}; -ElementSerializer.prototype.parseContainments = function(properties) { - var self = this, body = this.body, element = this.element; - forEach(properties, function(p) { - var value = element.get(p.name), isReference = p.isReference, isMany = p.isMany; - if (!isMany) { - value = [value]; - } - if (p.isBody) { - body.push(new BodySerializer().build(p, value[0])); - } else if (isSimple(p.type)) { - forEach(value, function(v) { - body.push(new ValueSerializer(self.addTagName(self.nsPropertyTagName(p))).build(p, v)); - }); - } else if (isReference) { - forEach(value, function(v) { - body.push(new ReferenceSerializer(self.addTagName(self.nsPropertyTagName(p))).build(v)); - }); - } else { - var asType = serializeAsType(p), asProperty = serializeAsProperty(p); - forEach(value, function(v) { - var serializer; - if (asType) { - serializer = new TypeSerializer(self, p); - } else if (asProperty) { - serializer = new ElementSerializer(self, p); - } else { - serializer = new ElementSerializer(self); - } - body.push(serializer.build(v)); - }); - } - }); -}; -ElementSerializer.prototype.getNamespaces = function(local) { - var namespaces = this.namespaces, parent = this.parent, parentNamespaces; - if (!namespaces) { - parentNamespaces = parent && parent.getNamespaces(); - if (local || !parentNamespaces) { - this.namespaces = namespaces = new Namespaces(parentNamespaces); - } else { - namespaces = parentNamespaces; - } - } - return namespaces; -}; -ElementSerializer.prototype.logNamespace = function(ns, wellknown, local) { - var namespaces = this.getNamespaces(local); - var nsUri = ns.uri, nsPrefix = ns.prefix; - var existing = namespaces.byUri(nsUri); - if (!existing || local) { - namespaces.add(ns, wellknown); - } - namespaces.mapPrefix(nsPrefix, nsUri); - return ns; -}; -ElementSerializer.prototype.logNamespaceUsed = function(ns, local) { - var element = this.element, model = element.$model, namespaces = this.getNamespaces(local); - var prefix2 = ns.prefix, uri2 = ns.uri, newPrefix, idx, wellknownUri; - if (!prefix2 && !uri2) { - return { localName: ns.localName }; - } - wellknownUri = DEFAULT_NS_MAP[prefix2] || model && (model.getPackage(prefix2) || {}).uri; - uri2 = uri2 || wellknownUri || namespaces.uriByPrefix(prefix2); - if (!uri2) { - throw new Error("no namespace uri given for prefix <" + prefix2 + ">"); - } - ns = namespaces.byUri(uri2); - if (!ns) { - newPrefix = prefix2; - idx = 1; - while (namespaces.uriByPrefix(newPrefix)) { - newPrefix = prefix2 + "_" + idx++; - } - ns = this.logNamespace({ prefix: newPrefix, uri: uri2 }, wellknownUri === uri2); - } - if (prefix2) { - namespaces.mapPrefix(prefix2, uri2); - } - return ns; -}; -ElementSerializer.prototype.parseAttributes = function(properties) { - var self = this, element = this.element; - forEach(properties, function(p) { - var value = element.get(p.name); - if (p.isReference) { - if (!p.isMany) { - value = value.id; - } else { - var values = []; - forEach(value, function(v) { - values.push(v.id); - }); - value = values.join(" "); - } - } - self.addAttribute(self.nsAttributeName(p), value); - }); -}; -ElementSerializer.prototype.addTagName = function(nsTagName) { - var actualNs = this.logNamespaceUsed(nsTagName); - this.getNamespaces().logUsed(actualNs); - return nsName(nsTagName); -}; -ElementSerializer.prototype.addAttribute = function(name2, value) { - var attrs = this.attrs; - if (isString(value)) { - value = escapeAttr(value); - } - var idx = findIndex(attrs, function(element) { - return element.name.localName === name2.localName && element.name.uri === name2.uri && element.name.prefix === name2.prefix; - }); - var attr3 = { name: name2, value }; - if (idx !== -1) { - attrs.splice(idx, 1, attr3); - } else { - attrs.push(attr3); - } -}; -ElementSerializer.prototype.serializeAttributes = function(writer) { - var attrs = this.attrs, namespaces = this.namespaces; - if (namespaces) { - attrs = getNsAttrs(namespaces).concat(attrs); - } - forEach(attrs, function(a) { - writer.append(" ").append(nsName(a.name)).append('="').append(a.value).append('"'); - }); -}; -ElementSerializer.prototype.serializeTo = function(writer) { - var firstBody = this.body[0], indent = firstBody && firstBody.constructor !== BodySerializer; - writer.appendIndent().append("<" + this.tagName); - this.serializeAttributes(writer); - writer.append(firstBody ? ">" : " />"); - if (firstBody) { - if (indent) { - writer.appendNewLine().indent(); - } - forEach(this.body, function(b) { - b.serializeTo(writer); - }); - if (indent) { - writer.unindent().appendIndent(); - } - writer.append(""); - } - writer.appendNewLine(); -}; -function TypeSerializer(parent, propertyDescriptor) { - ElementSerializer.call(this, parent, propertyDescriptor); -} -inherits(TypeSerializer, ElementSerializer); -TypeSerializer.prototype.parseNsAttributes = function(element) { - var attributes = ElementSerializer.prototype.parseNsAttributes.call(this, element); - var descriptor = element.$descriptor; - if (descriptor.name === this.propertyDescriptor.type) { - return attributes; - } - var typeNs = this.typeNs = this.nsTagName(descriptor); - this.getNamespaces().logUsed(this.typeNs); - var pkg = element.$model.getPackage(typeNs.uri), typePrefix = pkg.xml && pkg.xml.typePrefix || ""; - this.addAttribute( - this.nsAttributeName(XSI_TYPE2), - (typeNs.prefix ? typeNs.prefix + ":" : "") + typePrefix + descriptor.ns.localName - ); - return attributes; -}; -TypeSerializer.prototype.isLocalNs = function(ns) { - return ns.uri === (this.typeNs || this.ns).uri; -}; -function SavingWriter() { - this.value = ""; - this.write = function(str) { - this.value += str; - }; -} -function FormatingWriter(out, format2) { - var indent = [""]; - this.append = function(str) { - out.write(str); - return this; - }; - this.appendNewLine = function() { - if (format2) { - out.write("\n"); - } - return this; - }; - this.appendIndent = function() { - if (format2) { - out.write(indent.join(" ")); - } - return this; - }; - this.indent = function() { - indent.push(""); - return this; - }; - this.unindent = function() { - indent.pop(); - return this; - }; -} -function Writer(options) { - options = assign({ format: false, preamble: true }, options || {}); - function toXML(tree, writer) { - var internalWriter = writer || new SavingWriter(); - var formatingWriter = new FormatingWriter(internalWriter, options.format); - if (options.preamble) { - formatingWriter.append(XML_PREAMBLE); - } - new ElementSerializer().build(tree).serializeTo(formatingWriter); - if (!writer) { - return internalWriter.value; - } - } - return { - toXML - }; -} - -// node_modules/.pnpm/bpmn-moddle@8.1.0/node_modules/bpmn-moddle/dist/index.esm.js -function BpmnModdle(packages2, options) { - Moddle.call(this, packages2, options); -} -BpmnModdle.prototype = Object.create(Moddle.prototype); -BpmnModdle.prototype.fromXML = function(xmlStr, typeName, options) { - if (!isString(typeName)) { - options = typeName; - typeName = "bpmn:Definitions"; - } - var reader = new Reader(assign({ model: this, lax: true }, options)); - var rootHandler = reader.handler(typeName); - return reader.fromXML(xmlStr, rootHandler); -}; -BpmnModdle.prototype.toXML = function(element, options) { - var writer = new Writer(options); - return new Promise(function(resolve, reject) { - try { - var result = writer.toXML(element); - return resolve({ - xml: result - }); - } catch (err) { - return reject(err); - } - }); -}; -var name$5 = "BPMN20"; -var uri$5 = "http://www.omg.org/spec/BPMN/20100524/MODEL"; -var prefix$5 = "bpmn"; -var associations$5 = []; -var types$5 = [ - { - name: "Interface", - superClass: [ - "RootElement" - ], - properties: [ - { - name: "name", - isAttr: true, - type: "String" - }, - { - name: "operations", - type: "Operation", - isMany: true - }, - { - name: "implementationRef", - isAttr: true, - type: "String" - } - ] - }, - { - name: "Operation", - superClass: [ - "BaseElement" - ], - properties: [ - { - name: "name", - isAttr: true, - type: "String" - }, - { - name: "inMessageRef", - type: "Message", - isReference: true - }, - { - name: "outMessageRef", - type: "Message", - isReference: true - }, - { - name: "errorRef", - type: "Error", - isMany: true, - isReference: true - }, - { - name: "implementationRef", - isAttr: true, - type: "String" - } - ] - }, - { - name: "EndPoint", - superClass: [ - "RootElement" - ] - }, - { - name: "Auditing", - superClass: [ - "BaseElement" - ] - }, - { - name: "GlobalTask", - superClass: [ - "CallableElement" - ], - properties: [ - { - name: "resources", - type: "ResourceRole", - isMany: true - } - ] - }, - { - name: "Monitoring", - superClass: [ - "BaseElement" - ] - }, - { - name: "Performer", - superClass: [ - "ResourceRole" - ] - }, - { - name: "Process", - superClass: [ - "FlowElementsContainer", - "CallableElement" - ], - properties: [ - { - name: "processType", - type: "ProcessType", - isAttr: true - }, - { - name: "isClosed", - isAttr: true, - type: "Boolean" - }, - { - name: "auditing", - type: "Auditing" - }, - { - name: "monitoring", - type: "Monitoring" - }, - { - name: "properties", - type: "Property", - isMany: true - }, - { - name: "laneSets", - isMany: true, - replaces: "FlowElementsContainer#laneSets", - type: "LaneSet" - }, - { - name: "flowElements", - isMany: true, - replaces: "FlowElementsContainer#flowElements", - type: "FlowElement" - }, - { - name: "artifacts", - type: "Artifact", - isMany: true - }, - { - name: "resources", - type: "ResourceRole", - isMany: true - }, - { - name: "correlationSubscriptions", - type: "CorrelationSubscription", - isMany: true - }, - { - name: "supports", - type: "Process", - isMany: true, - isReference: true - }, - { - name: "definitionalCollaborationRef", - type: "Collaboration", - isAttr: true, - isReference: true - }, - { - name: "isExecutable", - isAttr: true, - type: "Boolean" - } - ] - }, - { - name: "LaneSet", - superClass: [ - "BaseElement" - ], - properties: [ - { - name: "lanes", - type: "Lane", - isMany: true - }, - { - name: "name", - isAttr: true, - type: "String" - } - ] - }, - { - name: "Lane", - superClass: [ - "BaseElement" - ], - properties: [ - { - name: "name", - isAttr: true, - type: "String" - }, - { - name: "partitionElementRef", - type: "BaseElement", - isAttr: true, - isReference: true - }, - { - name: "partitionElement", - type: "BaseElement" - }, - { - name: "flowNodeRef", - type: "FlowNode", - isMany: true, - isReference: true - }, - { - name: "childLaneSet", - type: "LaneSet", - xml: { - serialize: "xsi:type" - } - } - ] - }, - { - name: "GlobalManualTask", - superClass: [ - "GlobalTask" - ] - }, - { - name: "ManualTask", - superClass: [ - "Task" - ] - }, - { - name: "UserTask", - superClass: [ - "Task" - ], - properties: [ - { - name: "renderings", - type: "Rendering", - isMany: true - }, - { - name: "implementation", - isAttr: true, - type: "String" - } - ] - }, - { - name: "Rendering", - superClass: [ - "BaseElement" - ] - }, - { - name: "HumanPerformer", - superClass: [ - "Performer" - ] - }, - { - name: "PotentialOwner", - superClass: [ - "HumanPerformer" - ] - }, - { - name: "GlobalUserTask", - superClass: [ - "GlobalTask" - ], - properties: [ - { - name: "implementation", - isAttr: true, - type: "String" - }, - { - name: "renderings", - type: "Rendering", - isMany: true - } - ] - }, - { - name: "Gateway", - isAbstract: true, - superClass: [ - "FlowNode" - ], - properties: [ - { - name: "gatewayDirection", - type: "GatewayDirection", - "default": "Unspecified", - isAttr: true - } - ] - }, - { - name: "EventBasedGateway", - superClass: [ - "Gateway" - ], - properties: [ - { - name: "instantiate", - "default": false, - isAttr: true, - type: "Boolean" - }, - { - name: "eventGatewayType", - type: "EventBasedGatewayType", - isAttr: true, - "default": "Exclusive" - } - ] - }, - { - name: "ComplexGateway", - superClass: [ - "Gateway" - ], - properties: [ - { - name: "activationCondition", - type: "Expression", - xml: { - serialize: "xsi:type" - } - }, - { - name: "default", - type: "SequenceFlow", - isAttr: true, - isReference: true - } - ] - }, - { - name: "ExclusiveGateway", - superClass: [ - "Gateway" - ], - properties: [ - { - name: "default", - type: "SequenceFlow", - isAttr: true, - isReference: true - } - ] - }, - { - name: "InclusiveGateway", - superClass: [ - "Gateway" - ], - properties: [ - { - name: "default", - type: "SequenceFlow", - isAttr: true, - isReference: true - } - ] - }, - { - name: "ParallelGateway", - superClass: [ - "Gateway" - ] - }, - { - name: "RootElement", - isAbstract: true, - superClass: [ - "BaseElement" - ] - }, - { - name: "Relationship", - superClass: [ - "BaseElement" - ], - properties: [ - { - name: "type", - isAttr: true, - type: "String" - }, - { - name: "direction", - type: "RelationshipDirection", - isAttr: true - }, - { - name: "source", - isMany: true, - isReference: true, - type: "Element" - }, - { - name: "target", - isMany: true, - isReference: true, - type: "Element" - } - ] - }, - { - name: "BaseElement", - isAbstract: true, - properties: [ - { - name: "id", - isAttr: true, - type: "String", - isId: true - }, - { - name: "documentation", - type: "Documentation", - isMany: true - }, - { - name: "extensionDefinitions", - type: "ExtensionDefinition", - isMany: true, - isReference: true - }, - { - name: "extensionElements", - type: "ExtensionElements" - } - ] - }, - { - name: "Extension", - properties: [ - { - name: "mustUnderstand", - "default": false, - isAttr: true, - type: "Boolean" - }, - { - name: "definition", - type: "ExtensionDefinition", - isAttr: true, - isReference: true - } - ] - }, - { - name: "ExtensionDefinition", - properties: [ - { - name: "name", - isAttr: true, - type: "String" - }, - { - name: "extensionAttributeDefinitions", - type: "ExtensionAttributeDefinition", - isMany: true - } - ] - }, - { - name: "ExtensionAttributeDefinition", - properties: [ - { - name: "name", - isAttr: true, - type: "String" - }, - { - name: "type", - isAttr: true, - type: "String" - }, - { - name: "isReference", - "default": false, - isAttr: true, - type: "Boolean" - }, - { - name: "extensionDefinition", - type: "ExtensionDefinition", - isAttr: true, - isReference: true - } - ] - }, - { - name: "ExtensionElements", - properties: [ - { - name: "valueRef", - isAttr: true, - isReference: true, - type: "Element" - }, - { - name: "values", - type: "Element", - isMany: true - }, - { - name: "extensionAttributeDefinition", - type: "ExtensionAttributeDefinition", - isAttr: true, - isReference: true - } - ] - }, - { - name: "Documentation", - superClass: [ - "BaseElement" - ], - properties: [ - { - name: "text", - type: "String", - isBody: true - }, - { - name: "textFormat", - "default": "text/plain", - isAttr: true, - type: "String" - } - ] - }, - { - name: "Event", - isAbstract: true, - superClass: [ - "FlowNode", - "InteractionNode" - ], - properties: [ - { - name: "properties", - type: "Property", - isMany: true - } - ] - }, - { - name: "IntermediateCatchEvent", - superClass: [ - "CatchEvent" - ] - }, - { - name: "IntermediateThrowEvent", - superClass: [ - "ThrowEvent" - ] - }, - { - name: "EndEvent", - superClass: [ - "ThrowEvent" - ] - }, - { - name: "StartEvent", - superClass: [ - "CatchEvent" - ], - properties: [ - { - name: "isInterrupting", - "default": true, - isAttr: true, - type: "Boolean" - } - ] - }, - { - name: "ThrowEvent", - isAbstract: true, - superClass: [ - "Event" - ], - properties: [ - { - name: "dataInputs", - type: "DataInput", - isMany: true - }, - { - name: "dataInputAssociations", - type: "DataInputAssociation", - isMany: true - }, - { - name: "inputSet", - type: "InputSet" - }, - { - name: "eventDefinitions", - type: "EventDefinition", - isMany: true - }, - { - name: "eventDefinitionRef", - type: "EventDefinition", - isMany: true, - isReference: true - } - ] - }, - { - name: "CatchEvent", - isAbstract: true, - superClass: [ - "Event" - ], - properties: [ - { - name: "parallelMultiple", - isAttr: true, - type: "Boolean", - "default": false - }, - { - name: "dataOutputs", - type: "DataOutput", - isMany: true - }, - { - name: "dataOutputAssociations", - type: "DataOutputAssociation", - isMany: true - }, - { - name: "outputSet", - type: "OutputSet" - }, - { - name: "eventDefinitions", - type: "EventDefinition", - isMany: true - }, - { - name: "eventDefinitionRef", - type: "EventDefinition", - isMany: true, - isReference: true - } - ] - }, - { - name: "BoundaryEvent", - superClass: [ - "CatchEvent" - ], - properties: [ - { - name: "cancelActivity", - "default": true, - isAttr: true, - type: "Boolean" - }, - { - name: "attachedToRef", - type: "Activity", - isAttr: true, - isReference: true - } - ] - }, - { - name: "EventDefinition", - isAbstract: true, - superClass: [ - "RootElement" - ] - }, - { - name: "CancelEventDefinition", - superClass: [ - "EventDefinition" - ] - }, - { - name: "ErrorEventDefinition", - superClass: [ - "EventDefinition" - ], - properties: [ - { - name: "errorRef", - type: "Error", - isAttr: true, - isReference: true - } - ] - }, - { - name: "TerminateEventDefinition", - superClass: [ - "EventDefinition" - ] - }, - { - name: "EscalationEventDefinition", - superClass: [ - "EventDefinition" - ], - properties: [ - { - name: "escalationRef", - type: "Escalation", - isAttr: true, - isReference: true - } - ] - }, - { - name: "Escalation", - properties: [ - { - name: "structureRef", - type: "ItemDefinition", - isAttr: true, - isReference: true - }, - { - name: "name", - isAttr: true, - type: "String" - }, - { - name: "escalationCode", - isAttr: true, - type: "String" - } - ], - superClass: [ - "RootElement" - ] - }, - { - name: "CompensateEventDefinition", - superClass: [ - "EventDefinition" - ], - properties: [ - { - name: "waitForCompletion", - isAttr: true, - type: "Boolean", - "default": true - }, - { - name: "activityRef", - type: "Activity", - isAttr: true, - isReference: true - } - ] - }, - { - name: "TimerEventDefinition", - superClass: [ - "EventDefinition" - ], - properties: [ - { - name: "timeDate", - type: "Expression", - xml: { - serialize: "xsi:type" - } - }, - { - name: "timeCycle", - type: "Expression", - xml: { - serialize: "xsi:type" - } - }, - { - name: "timeDuration", - type: "Expression", - xml: { - serialize: "xsi:type" - } - } - ] - }, - { - name: "LinkEventDefinition", - superClass: [ - "EventDefinition" - ], - properties: [ - { - name: "name", - isAttr: true, - type: "String" - }, - { - name: "target", - type: "LinkEventDefinition", - isReference: true - }, - { - name: "source", - type: "LinkEventDefinition", - isMany: true, - isReference: true - } - ] - }, - { - name: "MessageEventDefinition", - superClass: [ - "EventDefinition" - ], - properties: [ - { - name: "messageRef", - type: "Message", - isAttr: true, - isReference: true - }, - { - name: "operationRef", - type: "Operation", - isAttr: true, - isReference: true - } - ] - }, - { - name: "ConditionalEventDefinition", - superClass: [ - "EventDefinition" - ], - properties: [ - { - name: "condition", - type: "Expression", - xml: { - serialize: "xsi:type" - } - } - ] - }, - { - name: "SignalEventDefinition", - superClass: [ - "EventDefinition" - ], - properties: [ - { - name: "signalRef", - type: "Signal", - isAttr: true, - isReference: true - } - ] - }, - { - name: "Signal", - superClass: [ - "RootElement" - ], - properties: [ - { - name: "structureRef", - type: "ItemDefinition", - isAttr: true, - isReference: true - }, - { - name: "name", - isAttr: true, - type: "String" - } - ] - }, - { - name: "ImplicitThrowEvent", - superClass: [ - "ThrowEvent" - ] - }, - { - name: "DataState", - superClass: [ - "BaseElement" - ], - properties: [ - { - name: "name", - isAttr: true, - type: "String" - } - ] - }, - { - name: "ItemAwareElement", - superClass: [ - "BaseElement" - ], - properties: [ - { - name: "itemSubjectRef", - type: "ItemDefinition", - isAttr: true, - isReference: true - }, - { - name: "dataState", - type: "DataState" - } - ] - }, - { - name: "DataAssociation", - superClass: [ - "BaseElement" - ], - properties: [ - { - name: "sourceRef", - type: "ItemAwareElement", - isMany: true, - isReference: true - }, - { - name: "targetRef", - type: "ItemAwareElement", - isReference: true - }, - { - name: "transformation", - type: "FormalExpression", - xml: { - serialize: "property" - } - }, - { - name: "assignment", - type: "Assignment", - isMany: true - } - ] - }, - { - name: "DataInput", - superClass: [ - "ItemAwareElement" - ], - properties: [ - { - name: "name", - isAttr: true, - type: "String" - }, - { - name: "isCollection", - "default": false, - isAttr: true, - type: "Boolean" - }, - { - name: "inputSetRef", - type: "InputSet", - isMany: true, - isVirtual: true, - isReference: true - }, - { - name: "inputSetWithOptional", - type: "InputSet", - isMany: true, - isVirtual: true, - isReference: true - }, - { - name: "inputSetWithWhileExecuting", - type: "InputSet", - isMany: true, - isVirtual: true, - isReference: true - } - ] - }, - { - name: "DataOutput", - superClass: [ - "ItemAwareElement" - ], - properties: [ - { - name: "name", - isAttr: true, - type: "String" - }, - { - name: "isCollection", - "default": false, - isAttr: true, - type: "Boolean" - }, - { - name: "outputSetRef", - type: "OutputSet", - isMany: true, - isVirtual: true, - isReference: true - }, - { - name: "outputSetWithOptional", - type: "OutputSet", - isMany: true, - isVirtual: true, - isReference: true - }, - { - name: "outputSetWithWhileExecuting", - type: "OutputSet", - isMany: true, - isVirtual: true, - isReference: true - } - ] - }, - { - name: "InputSet", - superClass: [ - "BaseElement" - ], - properties: [ - { - name: "name", - isAttr: true, - type: "String" - }, - { - name: "dataInputRefs", - type: "DataInput", - isMany: true, - isReference: true - }, - { - name: "optionalInputRefs", - type: "DataInput", - isMany: true, - isReference: true - }, - { - name: "whileExecutingInputRefs", - type: "DataInput", - isMany: true, - isReference: true - }, - { - name: "outputSetRefs", - type: "OutputSet", - isMany: true, - isReference: true - } - ] - }, - { - name: "OutputSet", - superClass: [ - "BaseElement" - ], - properties: [ - { - name: "dataOutputRefs", - type: "DataOutput", - isMany: true, - isReference: true - }, - { - name: "name", - isAttr: true, - type: "String" - }, - { - name: "inputSetRefs", - type: "InputSet", - isMany: true, - isReference: true - }, - { - name: "optionalOutputRefs", - type: "DataOutput", - isMany: true, - isReference: true - }, - { - name: "whileExecutingOutputRefs", - type: "DataOutput", - isMany: true, - isReference: true - } - ] - }, - { - name: "Property", - superClass: [ - "ItemAwareElement" - ], - properties: [ - { - name: "name", - isAttr: true, - type: "String" - } - ] - }, - { - name: "DataInputAssociation", - superClass: [ - "DataAssociation" - ] - }, - { - name: "DataOutputAssociation", - superClass: [ - "DataAssociation" - ] - }, - { - name: "InputOutputSpecification", - superClass: [ - "BaseElement" - ], - properties: [ - { - name: "dataInputs", - type: "DataInput", - isMany: true - }, - { - name: "dataOutputs", - type: "DataOutput", - isMany: true - }, - { - name: "inputSets", - type: "InputSet", - isMany: true - }, - { - name: "outputSets", - type: "OutputSet", - isMany: true - } - ] - }, - { - name: "DataObject", - superClass: [ - "FlowElement", - "ItemAwareElement" - ], - properties: [ - { - name: "isCollection", - "default": false, - isAttr: true, - type: "Boolean" - } - ] - }, - { - name: "InputOutputBinding", - properties: [ - { - name: "inputDataRef", - type: "InputSet", - isAttr: true, - isReference: true - }, - { - name: "outputDataRef", - type: "OutputSet", - isAttr: true, - isReference: true - }, - { - name: "operationRef", - type: "Operation", - isAttr: true, - isReference: true - } - ] - }, - { - name: "Assignment", - superClass: [ - "BaseElement" - ], - properties: [ - { - name: "from", - type: "Expression", - xml: { - serialize: "xsi:type" - } - }, - { - name: "to", - type: "Expression", - xml: { - serialize: "xsi:type" - } - } - ] - }, - { - name: "DataStore", - superClass: [ - "RootElement", - "ItemAwareElement" - ], - properties: [ - { - name: "name", - isAttr: true, - type: "String" - }, - { - name: "capacity", - isAttr: true, - type: "Integer" - }, - { - name: "isUnlimited", - "default": true, - isAttr: true, - type: "Boolean" - } - ] - }, - { - name: "DataStoreReference", - superClass: [ - "ItemAwareElement", - "FlowElement" - ], - properties: [ - { - name: "dataStoreRef", - type: "DataStore", - isAttr: true, - isReference: true - } - ] - }, - { - name: "DataObjectReference", - superClass: [ - "ItemAwareElement", - "FlowElement" - ], - properties: [ - { - name: "dataObjectRef", - type: "DataObject", - isAttr: true, - isReference: true - } - ] - }, - { - name: "ConversationLink", - superClass: [ - "BaseElement" - ], - properties: [ - { - name: "sourceRef", - type: "InteractionNode", - isAttr: true, - isReference: true - }, - { - name: "targetRef", - type: "InteractionNode", - isAttr: true, - isReference: true - }, - { - name: "name", - isAttr: true, - type: "String" - } - ] - }, - { - name: "ConversationAssociation", - superClass: [ - "BaseElement" - ], - properties: [ - { - name: "innerConversationNodeRef", - type: "ConversationNode", - isAttr: true, - isReference: true - }, - { - name: "outerConversationNodeRef", - type: "ConversationNode", - isAttr: true, - isReference: true - } - ] - }, - { - name: "CallConversation", - superClass: [ - "ConversationNode" - ], - properties: [ - { - name: "calledCollaborationRef", - type: "Collaboration", - isAttr: true, - isReference: true - }, - { - name: "participantAssociations", - type: "ParticipantAssociation", - isMany: true - } - ] - }, - { - name: "Conversation", - superClass: [ - "ConversationNode" - ] - }, - { - name: "SubConversation", - superClass: [ - "ConversationNode" - ], - properties: [ - { - name: "conversationNodes", - type: "ConversationNode", - isMany: true - } - ] - }, - { - name: "ConversationNode", - isAbstract: true, - superClass: [ - "InteractionNode", - "BaseElement" - ], - properties: [ - { - name: "name", - isAttr: true, - type: "String" - }, - { - name: "participantRef", - type: "Participant", - isMany: true, - isReference: true - }, - { - name: "messageFlowRefs", - type: "MessageFlow", - isMany: true, - isReference: true - }, - { - name: "correlationKeys", - type: "CorrelationKey", - isMany: true - } - ] - }, - { - name: "GlobalConversation", - superClass: [ - "Collaboration" - ] - }, - { - name: "PartnerEntity", - superClass: [ - "RootElement" - ], - properties: [ - { - name: "name", - isAttr: true, - type: "String" - }, - { - name: "participantRef", - type: "Participant", - isMany: true, - isReference: true - } - ] - }, - { - name: "PartnerRole", - superClass: [ - "RootElement" - ], - properties: [ - { - name: "name", - isAttr: true, - type: "String" - }, - { - name: "participantRef", - type: "Participant", - isMany: true, - isReference: true - } - ] - }, - { - name: "CorrelationProperty", - superClass: [ - "RootElement" - ], - properties: [ - { - name: "correlationPropertyRetrievalExpression", - type: "CorrelationPropertyRetrievalExpression", - isMany: true - }, - { - name: "name", - isAttr: true, - type: "String" - }, - { - name: "type", - type: "ItemDefinition", - isAttr: true, - isReference: true - } - ] - }, - { - name: "Error", - superClass: [ - "RootElement" - ], - properties: [ - { - name: "structureRef", - type: "ItemDefinition", - isAttr: true, - isReference: true - }, - { - name: "name", - isAttr: true, - type: "String" - }, - { - name: "errorCode", - isAttr: true, - type: "String" - } - ] - }, - { - name: "CorrelationKey", - superClass: [ - "BaseElement" - ], - properties: [ - { - name: "correlationPropertyRef", - type: "CorrelationProperty", - isMany: true, - isReference: true - }, - { - name: "name", - isAttr: true, - type: "String" - } - ] - }, - { - name: "Expression", - superClass: [ - "BaseElement" - ], - isAbstract: false, - properties: [ - { - name: "body", - isBody: true, - type: "String" - } - ] - }, - { - name: "FormalExpression", - superClass: [ - "Expression" - ], - properties: [ - { - name: "language", - isAttr: true, - type: "String" - }, - { - name: "evaluatesToTypeRef", - type: "ItemDefinition", - isAttr: true, - isReference: true - } - ] - }, - { - name: "Message", - superClass: [ - "RootElement" - ], - properties: [ - { - name: "name", - isAttr: true, - type: "String" - }, - { - name: "itemRef", - type: "ItemDefinition", - isAttr: true, - isReference: true - } - ] - }, - { - name: "ItemDefinition", - superClass: [ - "RootElement" - ], - properties: [ - { - name: "itemKind", - type: "ItemKind", - isAttr: true - }, - { - name: "structureRef", - isAttr: true, - type: "String" - }, - { - name: "isCollection", - "default": false, - isAttr: true, - type: "Boolean" - }, - { - name: "import", - type: "Import", - isAttr: true, - isReference: true - } - ] - }, - { - name: "FlowElement", - isAbstract: true, - superClass: [ - "BaseElement" - ], - properties: [ - { - name: "name", - isAttr: true, - type: "String" - }, - { - name: "auditing", - type: "Auditing" - }, - { - name: "monitoring", - type: "Monitoring" - }, - { - name: "categoryValueRef", - type: "CategoryValue", - isMany: true, - isReference: true - } - ] - }, - { - name: "SequenceFlow", - superClass: [ - "FlowElement" - ], - properties: [ - { - name: "isImmediate", - isAttr: true, - type: "Boolean" - }, - { - name: "conditionExpression", - type: "Expression", - xml: { - serialize: "xsi:type" - } - }, - { - name: "sourceRef", - type: "FlowNode", - isAttr: true, - isReference: true - }, - { - name: "targetRef", - type: "FlowNode", - isAttr: true, - isReference: true - } - ] - }, - { - name: "FlowElementsContainer", - isAbstract: true, - superClass: [ - "BaseElement" - ], - properties: [ - { - name: "laneSets", - type: "LaneSet", - isMany: true - }, - { - name: "flowElements", - type: "FlowElement", - isMany: true - } - ] - }, - { - name: "CallableElement", - isAbstract: true, - superClass: [ - "RootElement" - ], - properties: [ - { - name: "name", - isAttr: true, - type: "String" - }, - { - name: "ioSpecification", - type: "InputOutputSpecification", - xml: { - serialize: "property" - } - }, - { - name: "supportedInterfaceRef", - type: "Interface", - isMany: true, - isReference: true - }, - { - name: "ioBinding", - type: "InputOutputBinding", - isMany: true, - xml: { - serialize: "property" - } - } - ] - }, - { - name: "FlowNode", - isAbstract: true, - superClass: [ - "FlowElement" - ], - properties: [ - { - name: "incoming", - type: "SequenceFlow", - isMany: true, - isReference: true - }, - { - name: "outgoing", - type: "SequenceFlow", - isMany: true, - isReference: true - }, - { - name: "lanes", - type: "Lane", - isMany: true, - isVirtual: true, - isReference: true - } - ] - }, - { - name: "CorrelationPropertyRetrievalExpression", - superClass: [ - "BaseElement" - ], - properties: [ - { - name: "messagePath", - type: "FormalExpression" - }, - { - name: "messageRef", - type: "Message", - isAttr: true, - isReference: true - } - ] - }, - { - name: "CorrelationPropertyBinding", - superClass: [ - "BaseElement" - ], - properties: [ - { - name: "dataPath", - type: "FormalExpression" - }, - { - name: "correlationPropertyRef", - type: "CorrelationProperty", - isAttr: true, - isReference: true - } - ] - }, - { - name: "Resource", - superClass: [ - "RootElement" - ], - properties: [ - { - name: "name", - isAttr: true, - type: "String" - }, - { - name: "resourceParameters", - type: "ResourceParameter", - isMany: true - } - ] - }, - { - name: "ResourceParameter", - superClass: [ - "BaseElement" - ], - properties: [ - { - name: "name", - isAttr: true, - type: "String" - }, - { - name: "isRequired", - isAttr: true, - type: "Boolean" - }, - { - name: "type", - type: "ItemDefinition", - isAttr: true, - isReference: true - } - ] - }, - { - name: "CorrelationSubscription", - superClass: [ - "BaseElement" - ], - properties: [ - { - name: "correlationKeyRef", - type: "CorrelationKey", - isAttr: true, - isReference: true - }, - { - name: "correlationPropertyBinding", - type: "CorrelationPropertyBinding", - isMany: true - } - ] - }, - { - name: "MessageFlow", - superClass: [ - "BaseElement" - ], - properties: [ - { - name: "name", - isAttr: true, - type: "String" - }, - { - name: "sourceRef", - type: "InteractionNode", - isAttr: true, - isReference: true - }, - { - name: "targetRef", - type: "InteractionNode", - isAttr: true, - isReference: true - }, - { - name: "messageRef", - type: "Message", - isAttr: true, - isReference: true - } - ] - }, - { - name: "MessageFlowAssociation", - superClass: [ - "BaseElement" - ], - properties: [ - { - name: "innerMessageFlowRef", - type: "MessageFlow", - isAttr: true, - isReference: true - }, - { - name: "outerMessageFlowRef", - type: "MessageFlow", - isAttr: true, - isReference: true - } - ] - }, - { - name: "InteractionNode", - isAbstract: true, - properties: [ - { - name: "incomingConversationLinks", - type: "ConversationLink", - isMany: true, - isVirtual: true, - isReference: true - }, - { - name: "outgoingConversationLinks", - type: "ConversationLink", - isMany: true, - isVirtual: true, - isReference: true - } - ] - }, - { - name: "Participant", - superClass: [ - "InteractionNode", - "BaseElement" - ], - properties: [ - { - name: "name", - isAttr: true, - type: "String" - }, - { - name: "interfaceRef", - type: "Interface", - isMany: true, - isReference: true - }, - { - name: "participantMultiplicity", - type: "ParticipantMultiplicity" - }, - { - name: "endPointRefs", - type: "EndPoint", - isMany: true, - isReference: true - }, - { - name: "processRef", - type: "Process", - isAttr: true, - isReference: true - } - ] - }, - { - name: "ParticipantAssociation", - superClass: [ - "BaseElement" - ], - properties: [ - { - name: "innerParticipantRef", - type: "Participant", - isAttr: true, - isReference: true - }, - { - name: "outerParticipantRef", - type: "Participant", - isAttr: true, - isReference: true - } - ] - }, - { - name: "ParticipantMultiplicity", - properties: [ - { - name: "minimum", - "default": 0, - isAttr: true, - type: "Integer" - }, - { - name: "maximum", - "default": 1, - isAttr: true, - type: "Integer" - } - ], - superClass: [ - "BaseElement" - ] - }, - { - name: "Collaboration", - superClass: [ - "RootElement" - ], - properties: [ - { - name: "name", - isAttr: true, - type: "String" - }, - { - name: "isClosed", - isAttr: true, - type: "Boolean" - }, - { - name: "participants", - type: "Participant", - isMany: true - }, - { - name: "messageFlows", - type: "MessageFlow", - isMany: true - }, - { - name: "artifacts", - type: "Artifact", - isMany: true - }, - { - name: "conversations", - type: "ConversationNode", - isMany: true - }, - { - name: "conversationAssociations", - type: "ConversationAssociation" - }, - { - name: "participantAssociations", - type: "ParticipantAssociation", - isMany: true - }, - { - name: "messageFlowAssociations", - type: "MessageFlowAssociation", - isMany: true - }, - { - name: "correlationKeys", - type: "CorrelationKey", - isMany: true - }, - { - name: "choreographyRef", - type: "Choreography", - isMany: true, - isReference: true - }, - { - name: "conversationLinks", - type: "ConversationLink", - isMany: true - } - ] - }, - { - name: "ChoreographyActivity", - isAbstract: true, - superClass: [ - "FlowNode" - ], - properties: [ - { - name: "participantRef", - type: "Participant", - isMany: true, - isReference: true - }, - { - name: "initiatingParticipantRef", - type: "Participant", - isAttr: true, - isReference: true - }, - { - name: "correlationKeys", - type: "CorrelationKey", - isMany: true - }, - { - name: "loopType", - type: "ChoreographyLoopType", - "default": "None", - isAttr: true - } - ] - }, - { - name: "CallChoreography", - superClass: [ - "ChoreographyActivity" - ], - properties: [ - { - name: "calledChoreographyRef", - type: "Choreography", - isAttr: true, - isReference: true - }, - { - name: "participantAssociations", - type: "ParticipantAssociation", - isMany: true - } - ] - }, - { - name: "SubChoreography", - superClass: [ - "ChoreographyActivity", - "FlowElementsContainer" - ], - properties: [ - { - name: "artifacts", - type: "Artifact", - isMany: true - } - ] - }, - { - name: "ChoreographyTask", - superClass: [ - "ChoreographyActivity" - ], - properties: [ - { - name: "messageFlowRef", - type: "MessageFlow", - isMany: true, - isReference: true - } - ] - }, - { - name: "Choreography", - superClass: [ - "Collaboration", - "FlowElementsContainer" - ] - }, - { - name: "GlobalChoreographyTask", - superClass: [ - "Choreography" - ], - properties: [ - { - name: "initiatingParticipantRef", - type: "Participant", - isAttr: true, - isReference: true - } - ] - }, - { - name: "TextAnnotation", - superClass: [ - "Artifact" - ], - properties: [ - { - name: "text", - type: "String" - }, - { - name: "textFormat", - "default": "text/plain", - isAttr: true, - type: "String" - } - ] - }, - { - name: "Group", - superClass: [ - "Artifact" - ], - properties: [ - { - name: "categoryValueRef", - type: "CategoryValue", - isAttr: true, - isReference: true - } - ] - }, - { - name: "Association", - superClass: [ - "Artifact" - ], - properties: [ - { - name: "associationDirection", - type: "AssociationDirection", - isAttr: true - }, - { - name: "sourceRef", - type: "BaseElement", - isAttr: true, - isReference: true - }, - { - name: "targetRef", - type: "BaseElement", - isAttr: true, - isReference: true - } - ] - }, - { - name: "Category", - superClass: [ - "RootElement" - ], - properties: [ - { - name: "categoryValue", - type: "CategoryValue", - isMany: true - }, - { - name: "name", - isAttr: true, - type: "String" - } - ] - }, - { - name: "Artifact", - isAbstract: true, - superClass: [ - "BaseElement" - ] - }, - { - name: "CategoryValue", - superClass: [ - "BaseElement" - ], - properties: [ - { - name: "categorizedFlowElements", - type: "FlowElement", - isMany: true, - isVirtual: true, - isReference: true - }, - { - name: "value", - isAttr: true, - type: "String" - } - ] - }, - { - name: "Activity", - isAbstract: true, - superClass: [ - "FlowNode" - ], - properties: [ - { - name: "isForCompensation", - "default": false, - isAttr: true, - type: "Boolean" - }, - { - name: "default", - type: "SequenceFlow", - isAttr: true, - isReference: true - }, - { - name: "ioSpecification", - type: "InputOutputSpecification", - xml: { - serialize: "property" - } - }, - { - name: "boundaryEventRefs", - type: "BoundaryEvent", - isMany: true, - isReference: true - }, - { - name: "properties", - type: "Property", - isMany: true - }, - { - name: "dataInputAssociations", - type: "DataInputAssociation", - isMany: true - }, - { - name: "dataOutputAssociations", - type: "DataOutputAssociation", - isMany: true - }, - { - name: "startQuantity", - "default": 1, - isAttr: true, - type: "Integer" - }, - { - name: "resources", - type: "ResourceRole", - isMany: true - }, - { - name: "completionQuantity", - "default": 1, - isAttr: true, - type: "Integer" - }, - { - name: "loopCharacteristics", - type: "LoopCharacteristics" - } - ] - }, - { - name: "ServiceTask", - superClass: [ - "Task" - ], - properties: [ - { - name: "implementation", - isAttr: true, - type: "String" - }, - { - name: "operationRef", - type: "Operation", - isAttr: true, - isReference: true - } - ] - }, - { - name: "SubProcess", - superClass: [ - "Activity", - "FlowElementsContainer", - "InteractionNode" - ], - properties: [ - { - name: "triggeredByEvent", - "default": false, - isAttr: true, - type: "Boolean" - }, - { - name: "artifacts", - type: "Artifact", - isMany: true - } - ] - }, - { - name: "LoopCharacteristics", - isAbstract: true, - superClass: [ - "BaseElement" - ] - }, - { - name: "MultiInstanceLoopCharacteristics", - superClass: [ - "LoopCharacteristics" - ], - properties: [ - { - name: "isSequential", - "default": false, - isAttr: true, - type: "Boolean" - }, - { - name: "behavior", - type: "MultiInstanceBehavior", - "default": "All", - isAttr: true - }, - { - name: "loopCardinality", - type: "Expression", - xml: { - serialize: "xsi:type" - } - }, - { - name: "loopDataInputRef", - type: "ItemAwareElement", - isReference: true - }, - { - name: "loopDataOutputRef", - type: "ItemAwareElement", - isReference: true - }, - { - name: "inputDataItem", - type: "DataInput", - xml: { - serialize: "property" - } - }, - { - name: "outputDataItem", - type: "DataOutput", - xml: { - serialize: "property" - } - }, - { - name: "complexBehaviorDefinition", - type: "ComplexBehaviorDefinition", - isMany: true - }, - { - name: "completionCondition", - type: "Expression", - xml: { - serialize: "xsi:type" - } - }, - { - name: "oneBehaviorEventRef", - type: "EventDefinition", - isAttr: true, - isReference: true - }, - { - name: "noneBehaviorEventRef", - type: "EventDefinition", - isAttr: true, - isReference: true - } - ] - }, - { - name: "StandardLoopCharacteristics", - superClass: [ - "LoopCharacteristics" - ], - properties: [ - { - name: "testBefore", - "default": false, - isAttr: true, - type: "Boolean" - }, - { - name: "loopCondition", - type: "Expression", - xml: { - serialize: "xsi:type" - } - }, - { - name: "loopMaximum", - type: "Integer", - isAttr: true - } - ] - }, - { - name: "CallActivity", - superClass: [ - "Activity", - "InteractionNode" - ], - properties: [ - { - name: "calledElement", - type: "String", - isAttr: true - } - ] - }, - { - name: "Task", - superClass: [ - "Activity", - "InteractionNode" - ] - }, - { - name: "SendTask", - superClass: [ - "Task" - ], - properties: [ - { - name: "implementation", - isAttr: true, - type: "String" - }, - { - name: "operationRef", - type: "Operation", - isAttr: true, - isReference: true - }, - { - name: "messageRef", - type: "Message", - isAttr: true, - isReference: true - } - ] - }, - { - name: "ReceiveTask", - superClass: [ - "Task" - ], - properties: [ - { - name: "implementation", - isAttr: true, - type: "String" - }, - { - name: "instantiate", - "default": false, - isAttr: true, - type: "Boolean" - }, - { - name: "operationRef", - type: "Operation", - isAttr: true, - isReference: true - }, - { - name: "messageRef", - type: "Message", - isAttr: true, - isReference: true - } - ] - }, - { - name: "ScriptTask", - superClass: [ - "Task" - ], - properties: [ - { - name: "scriptFormat", - isAttr: true, - type: "String" - }, - { - name: "script", - type: "String" - } - ] - }, - { - name: "BusinessRuleTask", - superClass: [ - "Task" - ], - properties: [ - { - name: "implementation", - isAttr: true, - type: "String" - } - ] - }, - { - name: "AdHocSubProcess", - superClass: [ - "SubProcess" - ], - properties: [ - { - name: "completionCondition", - type: "Expression", - xml: { - serialize: "xsi:type" - } - }, - { - name: "ordering", - type: "AdHocOrdering", - isAttr: true - }, - { - name: "cancelRemainingInstances", - "default": true, - isAttr: true, - type: "Boolean" - } - ] - }, - { - name: "Transaction", - superClass: [ - "SubProcess" - ], - properties: [ - { - name: "protocol", - isAttr: true, - type: "String" - }, - { - name: "method", - isAttr: true, - type: "String" - } - ] - }, - { - name: "GlobalScriptTask", - superClass: [ - "GlobalTask" - ], - properties: [ - { - name: "scriptLanguage", - isAttr: true, - type: "String" - }, - { - name: "script", - isAttr: true, - type: "String" - } - ] - }, - { - name: "GlobalBusinessRuleTask", - superClass: [ - "GlobalTask" - ], - properties: [ - { - name: "implementation", - isAttr: true, - type: "String" - } - ] - }, - { - name: "ComplexBehaviorDefinition", - superClass: [ - "BaseElement" - ], - properties: [ - { - name: "condition", - type: "FormalExpression" - }, - { - name: "event", - type: "ImplicitThrowEvent" - } - ] - }, - { - name: "ResourceRole", - superClass: [ - "BaseElement" - ], - properties: [ - { - name: "resourceRef", - type: "Resource", - isReference: true - }, - { - name: "resourceParameterBindings", - type: "ResourceParameterBinding", - isMany: true - }, - { - name: "resourceAssignmentExpression", - type: "ResourceAssignmentExpression" - }, - { - name: "name", - isAttr: true, - type: "String" - } - ] - }, - { - name: "ResourceParameterBinding", - properties: [ - { - name: "expression", - type: "Expression", - xml: { - serialize: "xsi:type" - } - }, - { - name: "parameterRef", - type: "ResourceParameter", - isAttr: true, - isReference: true - } - ], - superClass: [ - "BaseElement" - ] - }, - { - name: "ResourceAssignmentExpression", - properties: [ - { - name: "expression", - type: "Expression", - xml: { - serialize: "xsi:type" - } - } - ], - superClass: [ - "BaseElement" - ] - }, - { - name: "Import", - properties: [ - { - name: "importType", - isAttr: true, - type: "String" - }, - { - name: "location", - isAttr: true, - type: "String" - }, - { - name: "namespace", - isAttr: true, - type: "String" - } - ] - }, - { - name: "Definitions", - superClass: [ - "BaseElement" - ], - properties: [ - { - name: "name", - isAttr: true, - type: "String" - }, - { - name: "targetNamespace", - isAttr: true, - type: "String" - }, - { - name: "expressionLanguage", - "default": "http://www.w3.org/1999/XPath", - isAttr: true, - type: "String" - }, - { - name: "typeLanguage", - "default": "http://www.w3.org/2001/XMLSchema", - isAttr: true, - type: "String" - }, - { - name: "imports", - type: "Import", - isMany: true - }, - { - name: "extensions", - type: "Extension", - isMany: true - }, - { - name: "rootElements", - type: "RootElement", - isMany: true - }, - { - name: "diagrams", - isMany: true, - type: "bpmndi:BPMNDiagram" - }, - { - name: "exporter", - isAttr: true, - type: "String" - }, - { - name: "relationships", - type: "Relationship", - isMany: true - }, - { - name: "exporterVersion", - isAttr: true, - type: "String" - } - ] - } -]; -var enumerations$3 = [ - { - name: "ProcessType", - literalValues: [ - { - name: "None" - }, - { - name: "Public" - }, - { - name: "Private" - } - ] - }, - { - name: "GatewayDirection", - literalValues: [ - { - name: "Unspecified" - }, - { - name: "Converging" - }, - { - name: "Diverging" - }, - { - name: "Mixed" - } - ] - }, - { - name: "EventBasedGatewayType", - literalValues: [ - { - name: "Parallel" - }, - { - name: "Exclusive" - } - ] - }, - { - name: "RelationshipDirection", - literalValues: [ - { - name: "None" - }, - { - name: "Forward" - }, - { - name: "Backward" - }, - { - name: "Both" - } - ] - }, - { - name: "ItemKind", - literalValues: [ - { - name: "Physical" - }, - { - name: "Information" - } - ] - }, - { - name: "ChoreographyLoopType", - literalValues: [ - { - name: "None" - }, - { - name: "Standard" - }, - { - name: "MultiInstanceSequential" - }, - { - name: "MultiInstanceParallel" - } - ] - }, - { - name: "AssociationDirection", - literalValues: [ - { - name: "None" - }, - { - name: "One" - }, - { - name: "Both" - } - ] - }, - { - name: "MultiInstanceBehavior", - literalValues: [ - { - name: "None" - }, - { - name: "One" - }, - { - name: "All" - }, - { - name: "Complex" - } - ] - }, - { - name: "AdHocOrdering", - literalValues: [ - { - name: "Parallel" - }, - { - name: "Sequential" - } - ] - } -]; -var xml$1 = { - tagAlias: "lowerCase", - typePrefix: "t" -}; -var BpmnPackage = { - name: name$5, - uri: uri$5, - prefix: prefix$5, - associations: associations$5, - types: types$5, - enumerations: enumerations$3, - xml: xml$1 -}; -var name$4 = "BPMNDI"; -var uri$4 = "http://www.omg.org/spec/BPMN/20100524/DI"; -var prefix$4 = "bpmndi"; -var types$4 = [ - { - name: "BPMNDiagram", - properties: [ - { - name: "plane", - type: "BPMNPlane", - redefines: "di:Diagram#rootElement" - }, - { - name: "labelStyle", - type: "BPMNLabelStyle", - isMany: true - } - ], - superClass: [ - "di:Diagram" - ] - }, - { - name: "BPMNPlane", - properties: [ - { - name: "bpmnElement", - isAttr: true, - isReference: true, - type: "bpmn:BaseElement", - redefines: "di:DiagramElement#modelElement" - } - ], - superClass: [ - "di:Plane" - ] - }, - { - name: "BPMNShape", - properties: [ - { - name: "bpmnElement", - isAttr: true, - isReference: true, - type: "bpmn:BaseElement", - redefines: "di:DiagramElement#modelElement" - }, - { - name: "isHorizontal", - isAttr: true, - type: "Boolean" - }, - { - name: "isExpanded", - isAttr: true, - type: "Boolean" - }, - { - name: "isMarkerVisible", - isAttr: true, - type: "Boolean" - }, - { - name: "label", - type: "BPMNLabel" - }, - { - name: "isMessageVisible", - isAttr: true, - type: "Boolean" - }, - { - name: "participantBandKind", - type: "ParticipantBandKind", - isAttr: true - }, - { - name: "choreographyActivityShape", - type: "BPMNShape", - isAttr: true, - isReference: true - } - ], - superClass: [ - "di:LabeledShape" - ] - }, - { - name: "BPMNEdge", - properties: [ - { - name: "label", - type: "BPMNLabel" - }, - { - name: "bpmnElement", - isAttr: true, - isReference: true, - type: "bpmn:BaseElement", - redefines: "di:DiagramElement#modelElement" - }, - { - name: "sourceElement", - isAttr: true, - isReference: true, - type: "di:DiagramElement", - redefines: "di:Edge#source" - }, - { - name: "targetElement", - isAttr: true, - isReference: true, - type: "di:DiagramElement", - redefines: "di:Edge#target" - }, - { - name: "messageVisibleKind", - type: "MessageVisibleKind", - isAttr: true, - "default": "initiating" - } - ], - superClass: [ - "di:LabeledEdge" - ] - }, - { - name: "BPMNLabel", - properties: [ - { - name: "labelStyle", - type: "BPMNLabelStyle", - isAttr: true, - isReference: true, - redefines: "di:DiagramElement#style" - } - ], - superClass: [ - "di:Label" - ] - }, - { - name: "BPMNLabelStyle", - properties: [ - { - name: "font", - type: "dc:Font" - } - ], - superClass: [ - "di:Style" - ] - } -]; -var enumerations$2 = [ - { - name: "ParticipantBandKind", - literalValues: [ - { - name: "top_initiating" - }, - { - name: "middle_initiating" - }, - { - name: "bottom_initiating" - }, - { - name: "top_non_initiating" - }, - { - name: "middle_non_initiating" - }, - { - name: "bottom_non_initiating" - } - ] - }, - { - name: "MessageVisibleKind", - literalValues: [ - { - name: "initiating" - }, - { - name: "non_initiating" - } - ] - } -]; -var associations$4 = []; -var BpmnDiPackage = { - name: name$4, - uri: uri$4, - prefix: prefix$4, - types: types$4, - enumerations: enumerations$2, - associations: associations$4 -}; -var name$3 = "DC"; -var uri$3 = "http://www.omg.org/spec/DD/20100524/DC"; -var prefix$3 = "dc"; -var types$3 = [ - { - name: "Boolean" - }, - { - name: "Integer" - }, - { - name: "Real" - }, - { - name: "String" - }, - { - name: "Font", - properties: [ - { - name: "name", - type: "String", - isAttr: true - }, - { - name: "size", - type: "Real", - isAttr: true - }, - { - name: "isBold", - type: "Boolean", - isAttr: true - }, - { - name: "isItalic", - type: "Boolean", - isAttr: true - }, - { - name: "isUnderline", - type: "Boolean", - isAttr: true - }, - { - name: "isStrikeThrough", - type: "Boolean", - isAttr: true - } - ] - }, - { - name: "Point", - properties: [ - { - name: "x", - type: "Real", - "default": "0", - isAttr: true - }, - { - name: "y", - type: "Real", - "default": "0", - isAttr: true - } - ] - }, - { - name: "Bounds", - properties: [ - { - name: "x", - type: "Real", - "default": "0", - isAttr: true - }, - { - name: "y", - type: "Real", - "default": "0", - isAttr: true - }, - { - name: "width", - type: "Real", - isAttr: true - }, - { - name: "height", - type: "Real", - isAttr: true - } - ] - } -]; -var associations$3 = []; -var DcPackage = { - name: name$3, - uri: uri$3, - prefix: prefix$3, - types: types$3, - associations: associations$3 -}; -var name$2 = "DI"; -var uri$2 = "http://www.omg.org/spec/DD/20100524/DI"; -var prefix$2 = "di"; -var types$2 = [ - { - name: "DiagramElement", - isAbstract: true, - properties: [ - { - name: "id", - isAttr: true, - isId: true, - type: "String" - }, - { - name: "extension", - type: "Extension" - }, - { - name: "owningDiagram", - type: "Diagram", - isReadOnly: true, - isVirtual: true, - isReference: true - }, - { - name: "owningElement", - type: "DiagramElement", - isReadOnly: true, - isVirtual: true, - isReference: true - }, - { - name: "modelElement", - isReadOnly: true, - isVirtual: true, - isReference: true, - type: "Element" - }, - { - name: "style", - type: "Style", - isReadOnly: true, - isVirtual: true, - isReference: true - }, - { - name: "ownedElement", - type: "DiagramElement", - isReadOnly: true, - isMany: true, - isVirtual: true - } - ] - }, - { - name: "Node", - isAbstract: true, - superClass: [ - "DiagramElement" - ] - }, - { - name: "Edge", - isAbstract: true, - superClass: [ - "DiagramElement" - ], - properties: [ - { - name: "source", - type: "DiagramElement", - isReadOnly: true, - isVirtual: true, - isReference: true - }, - { - name: "target", - type: "DiagramElement", - isReadOnly: true, - isVirtual: true, - isReference: true - }, - { - name: "waypoint", - isUnique: false, - isMany: true, - type: "dc:Point", - xml: { - serialize: "xsi:type" - } - } - ] - }, - { - name: "Diagram", - isAbstract: true, - properties: [ - { - name: "id", - isAttr: true, - isId: true, - type: "String" - }, - { - name: "rootElement", - type: "DiagramElement", - isReadOnly: true, - isVirtual: true - }, - { - name: "name", - isAttr: true, - type: "String" - }, - { - name: "documentation", - isAttr: true, - type: "String" - }, - { - name: "resolution", - isAttr: true, - type: "Real" - }, - { - name: "ownedStyle", - type: "Style", - isReadOnly: true, - isMany: true, - isVirtual: true - } - ] - }, - { - name: "Shape", - isAbstract: true, - superClass: [ - "Node" - ], - properties: [ - { - name: "bounds", - type: "dc:Bounds" - } - ] - }, - { - name: "Plane", - isAbstract: true, - superClass: [ - "Node" - ], - properties: [ - { - name: "planeElement", - type: "DiagramElement", - subsettedProperty: "DiagramElement-ownedElement", - isMany: true - } - ] - }, - { - name: "LabeledEdge", - isAbstract: true, - superClass: [ - "Edge" - ], - properties: [ - { - name: "ownedLabel", - type: "Label", - isReadOnly: true, - subsettedProperty: "DiagramElement-ownedElement", - isMany: true, - isVirtual: true - } - ] - }, - { - name: "LabeledShape", - isAbstract: true, - superClass: [ - "Shape" - ], - properties: [ - { - name: "ownedLabel", - type: "Label", - isReadOnly: true, - subsettedProperty: "DiagramElement-ownedElement", - isMany: true, - isVirtual: true - } - ] - }, - { - name: "Label", - isAbstract: true, - superClass: [ - "Node" - ], - properties: [ - { - name: "bounds", - type: "dc:Bounds" - } - ] - }, - { - name: "Style", - isAbstract: true, - properties: [ - { - name: "id", - isAttr: true, - isId: true, - type: "String" - } - ] - }, - { - name: "Extension", - properties: [ - { - name: "values", - isMany: true, - type: "Element" - } - ] - } -]; -var associations$2 = []; -var xml = { - tagAlias: "lowerCase" -}; -var DiPackage = { - name: name$2, - uri: uri$2, - prefix: prefix$2, - types: types$2, - associations: associations$2, - xml -}; -var name$1 = "bpmn.io colors for BPMN"; -var uri$1 = "http://bpmn.io/schema/bpmn/biocolor/1.0"; -var prefix$1 = "bioc"; -var types$1 = [ - { - name: "ColoredShape", - "extends": [ - "bpmndi:BPMNShape" - ], - properties: [ - { - name: "stroke", - isAttr: true, - type: "String" - }, - { - name: "fill", - isAttr: true, - type: "String" - } - ] - }, - { - name: "ColoredEdge", - "extends": [ - "bpmndi:BPMNEdge" - ], - properties: [ - { - name: "stroke", - isAttr: true, - type: "String" - }, - { - name: "fill", - isAttr: true, - type: "String" - } - ] - } -]; -var enumerations$1 = []; -var associations$1 = []; -var BiocPackage = { - name: name$1, - uri: uri$1, - prefix: prefix$1, - types: types$1, - enumerations: enumerations$1, - associations: associations$1 -}; -var name = "BPMN in Color"; -var uri = "http://www.omg.org/spec/BPMN/non-normative/color/1.0"; -var prefix = "color"; -var types2 = [ - { - name: "ColoredLabel", - "extends": [ - "bpmndi:BPMNLabel" - ], - properties: [ - { - name: "color", - isAttr: true, - type: "String" - } - ] - }, - { - name: "ColoredShape", - "extends": [ - "bpmndi:BPMNShape" - ], - properties: [ - { - name: "background-color", - isAttr: true, - type: "String" - }, - { - name: "border-color", - isAttr: true, - type: "String" - } - ] - }, - { - name: "ColoredEdge", - "extends": [ - "bpmndi:BPMNEdge" - ], - properties: [ - { - name: "border-color", - isAttr: true, - type: "String" - } - ] - } -]; -var enumerations = []; -var associations = []; -var BpmnInColorPackage = { - name, - uri, - prefix, - types: types2, - enumerations, - associations -}; -var packages = { - bpmn: BpmnPackage, - bpmndi: BpmnDiPackage, - dc: DcPackage, - di: DiPackage, - bioc: BiocPackage, - color: BpmnInColorPackage -}; -function simple(additionalPackages, options) { - var pks = assign({}, packages, additionalPackages); - return new BpmnModdle(pks, options); -} - -// node_modules/.pnpm/bpmn-js@17.11.1/node_modules/bpmn-js/lib/util/CompatibilityUtil.js -var DI_ERROR_MESSAGE = "Tried to access di from the businessObject. The di is available through the diagram element only. For more information, see https://github.com/bpmn-io/bpmn-js/issues/1472"; -function ensureCompatDiRef(businessObject) { - if (!has(businessObject, "di")) { - Object.defineProperty(businessObject, "di", { - enumerable: false, - get: function() { - throw new Error(DI_ERROR_MESSAGE); - } - }); - } -} - -// node_modules/.pnpm/bpmn-js@17.11.1/node_modules/bpmn-js/lib/import/BpmnTreeWalker.js -function is2(element, type) { - return element.$instanceOf(type); -} -function findDisplayCandidate(definitions) { - return find(definitions.rootElements, function(e2) { - return is2(e2, "bpmn:Process") || is2(e2, "bpmn:Collaboration"); - }); -} -function BpmnTreeWalker(handler) { - var handledElements = {}; - var deferred = []; - var diMap = {}; - function contextual(fn, ctx) { - return function(e2) { - fn(e2, ctx); - }; - } - function handled(element) { - handledElements[element.id] = element; - } - function isHandled(element) { - return handledElements[element.id]; - } - function visit(element, ctx) { - var gfx = element.gfx; - if (gfx) { - throw new Error( - `already rendered ${elementToString(element)}` - ); - } - return handler.element(element, diMap[element.id], ctx); - } - function visitRoot(element, diagram) { - return handler.root(element, diMap[element.id], diagram); - } - function visitIfDi(element, ctx) { - try { - var gfx = diMap[element.id] && visit(element, ctx); - handled(element); - return gfx; - } catch (error3) { - logError(error3.message, { element, error: error3 }); - console.error(`failed to import ${elementToString(element)}`, error3); - } - } - function logError(message, context) { - handler.error(message, context); - } - var registerDi = this.registerDi = function registerDi2(di) { - var bpmnElement = di.bpmnElement; - if (bpmnElement) { - if (diMap[bpmnElement.id]) { - logError( - `multiple DI elements defined for ${elementToString(bpmnElement)}`, - { element: bpmnElement } - ); - } else { - diMap[bpmnElement.id] = di; - ensureCompatDiRef(bpmnElement); - } - } else { - logError( - `no bpmnElement referenced in ${elementToString(di)}`, - { element: di } - ); - } - }; - function handleDiagram(diagram) { - handlePlane(diagram.plane); - } - function handlePlane(plane) { - registerDi(plane); - forEach(plane.planeElement, handlePlaneElement); - } - function handlePlaneElement(planeElement) { - registerDi(planeElement); - } - this.handleDefinitions = function handleDefinitions(definitions, diagram) { - var diagrams = definitions.diagrams; - if (diagram && diagrams.indexOf(diagram) === -1) { - throw new Error("diagram not part of "); - } - if (!diagram && diagrams && diagrams.length) { - diagram = diagrams[0]; - } - if (!diagram) { - throw new Error("no diagram to display"); - } - diMap = {}; - handleDiagram(diagram); - var plane = diagram.plane; - if (!plane) { - throw new Error( - `no plane for ${elementToString(diagram)}` - ); - } - var rootElement = plane.bpmnElement; - if (!rootElement) { - rootElement = findDisplayCandidate(definitions); - if (!rootElement) { - throw new Error("no process or collaboration to display"); - } else { - logError( - `correcting missing bpmnElement on ${elementToString(plane)} to ${elementToString(rootElement)}` - ); - plane.bpmnElement = rootElement; - registerDi(plane); - } - } - var ctx = visitRoot(rootElement, plane); - if (is2(rootElement, "bpmn:Process") || is2(rootElement, "bpmn:SubProcess")) { - handleProcess(rootElement, ctx); - } else if (is2(rootElement, "bpmn:Collaboration")) { - handleCollaboration(rootElement, ctx); - handleUnhandledProcesses(definitions.rootElements, ctx); - } else { - throw new Error( - `unsupported bpmnElement for ${elementToString(plane)}: ${elementToString(rootElement)}` - ); - } - handleDeferred(deferred); - }; - var handleDeferred = this.handleDeferred = function handleDeferred2() { - var fn; - while (deferred.length) { - fn = deferred.shift(); - fn(); - } - }; - function handleProcess(process, context) { - handleFlowElementsContainer(process, context); - handleIoSpecification(process.ioSpecification, context); - handleArtifacts(process.artifacts, context); - handled(process); - } - function handleUnhandledProcesses(rootElements, ctx) { - var processes = filter(rootElements, function(e2) { - return !isHandled(e2) && is2(e2, "bpmn:Process") && e2.laneSets; - }); - processes.forEach(contextual(handleProcess, ctx)); - } - function handleMessageFlow(messageFlow, context) { - visitIfDi(messageFlow, context); - } - function handleMessageFlows(messageFlows, context) { - forEach(messageFlows, contextual(handleMessageFlow, context)); - } - function handleDataAssociation(association, context) { - visitIfDi(association, context); - } - function handleDataInput(dataInput, context) { - visitIfDi(dataInput, context); - } - function handleDataOutput(dataOutput, context) { - visitIfDi(dataOutput, context); - } - function handleArtifact(artifact, context) { - visitIfDi(artifact, context); - } - function handleArtifacts(artifacts, context) { - forEach(artifacts, function(e2) { - if (is2(e2, "bpmn:Association")) { - deferred.push(function() { - handleArtifact(e2, context); - }); - } else { - handleArtifact(e2, context); - } - }); - } - function handleIoSpecification(ioSpecification, context) { - if (!ioSpecification) { - return; - } - forEach(ioSpecification.dataInputs, contextual(handleDataInput, context)); - forEach(ioSpecification.dataOutputs, contextual(handleDataOutput, context)); - } - var handleSubProcess = this.handleSubProcess = function handleSubProcess2(subProcess, context) { - handleFlowElementsContainer(subProcess, context); - handleArtifacts(subProcess.artifacts, context); - }; - function handleFlowNode(flowNode, context) { - var childCtx = visitIfDi(flowNode, context); - if (is2(flowNode, "bpmn:SubProcess")) { - handleSubProcess(flowNode, childCtx || context); - } - if (is2(flowNode, "bpmn:Activity")) { - handleIoSpecification(flowNode.ioSpecification, context); - } - deferred.push(function() { - forEach(flowNode.dataInputAssociations, contextual(handleDataAssociation, context)); - forEach(flowNode.dataOutputAssociations, contextual(handleDataAssociation, context)); - }); - } - function handleSequenceFlow(sequenceFlow, context) { - visitIfDi(sequenceFlow, context); - } - function handleDataElement(dataObject, context) { - visitIfDi(dataObject, context); - } - function handleLane(lane, context) { - deferred.push(function() { - var newContext = visitIfDi(lane, context); - if (lane.childLaneSet) { - handleLaneSet(lane.childLaneSet, newContext || context); - } - wireFlowNodeRefs(lane); - }); - } - function handleLaneSet(laneSet, context) { - forEach(laneSet.lanes, contextual(handleLane, context)); - } - function handleLaneSets(laneSets, context) { - forEach(laneSets, contextual(handleLaneSet, context)); - } - function handleFlowElementsContainer(container, context) { - handleFlowElements(container.flowElements, context); - if (container.laneSets) { - handleLaneSets(container.laneSets, context); - } - } - function handleFlowElements(flowElements, context) { - forEach(flowElements, function(flowElement) { - if (is2(flowElement, "bpmn:SequenceFlow")) { - deferred.push(function() { - handleSequenceFlow(flowElement, context); - }); - } else if (is2(flowElement, "bpmn:BoundaryEvent")) { - deferred.unshift(function() { - handleFlowNode(flowElement, context); - }); - } else if (is2(flowElement, "bpmn:FlowNode")) { - handleFlowNode(flowElement, context); - } else if (is2(flowElement, "bpmn:DataObject")) { - } else if (is2(flowElement, "bpmn:DataStoreReference")) { - handleDataElement(flowElement, context); - } else if (is2(flowElement, "bpmn:DataObjectReference")) { - handleDataElement(flowElement, context); - } else { - logError( - `unrecognized flowElement ${elementToString(flowElement)} in context ${elementToString(context && context.businessObject)}`, - { - element: flowElement, - context - } - ); - } - }); - } - function handleParticipant(participant, context) { - var newCtx = visitIfDi(participant, context); - var process = participant.processRef; - if (process) { - handleProcess(process, newCtx || context); - } - } - function handleCollaboration(collaboration, context) { - forEach(collaboration.participants, contextual(handleParticipant, context)); - handleArtifacts(collaboration.artifacts, context); - deferred.push(function() { - handleMessageFlows(collaboration.messageFlows, context); - }); - } - function wireFlowNodeRefs(lane) { - forEach(lane.flowNodeRef, function(flowNode) { - var lanes = flowNode.get("lanes"); - if (lanes) { - lanes.push(lane); - } - }); - } -} - -// node_modules/.pnpm/bpmn-js@17.11.1/node_modules/bpmn-js/lib/import/Importer.js -function importBpmnDiagram(diagram, definitions, bpmnDiagram) { - var importer, eventBus, canvas; - var error3, warnings = []; - function render(definitions2, bpmnDiagram2) { - var visitor = { - root: function(element, di) { - return importer.add(element, di); - }, - element: function(element, di, parentShape) { - return importer.add(element, di, parentShape); - }, - error: function(message, context) { - warnings.push({ message, context }); - } - }; - var walker = new BpmnTreeWalker(visitor); - bpmnDiagram2 = bpmnDiagram2 || definitions2.diagrams && definitions2.diagrams[0]; - var diagramsToImport = getDiagramsToImport(definitions2, bpmnDiagram2); - if (!diagramsToImport) { - throw new Error("no diagram to display"); - } - forEach(diagramsToImport, function(diagram2) { - walker.handleDefinitions(definitions2, diagram2); - }); - var rootId = bpmnDiagram2.plane.bpmnElement.id; - canvas.setRootElement( - canvas.findRoot(rootId + "_plane") || canvas.findRoot(rootId) - ); - } - return new Promise(function(resolve, reject) { - try { - importer = diagram.get("bpmnImporter"); - eventBus = diagram.get("eventBus"); - canvas = diagram.get("canvas"); - eventBus.fire("import.render.start", { definitions }); - render(definitions, bpmnDiagram); - eventBus.fire("import.render.complete", { - error: error3, - warnings - }); - return resolve({ warnings }); - } catch (e2) { - e2.warnings = warnings; - return reject(e2); - } - }); -} -function getDiagramsToImport(definitions, bpmnDiagram) { - if (!bpmnDiagram || !bpmnDiagram.plane) { - return; - } - var bpmnElement = bpmnDiagram.plane.bpmnElement, rootElement = bpmnElement; - if (!is(bpmnElement, "bpmn:Process") && !is(bpmnElement, "bpmn:Collaboration")) { - rootElement = findRootProcess(bpmnElement); - } - var collaboration; - if (is(rootElement, "bpmn:Collaboration")) { - collaboration = rootElement; - } else { - collaboration = find(definitions.rootElements, function(element) { - if (!is(element, "bpmn:Collaboration")) { - return; - } - return find(element.participants, function(participant) { - return participant.processRef === rootElement; - }); - }); - } - var rootElements = [rootElement]; - if (collaboration) { - rootElements = map(collaboration.participants, function(participant) { - return participant.processRef; - }); - rootElements.push(collaboration); - } - var allChildren = selfAndAllFlowElements(rootElements); - var diagramsToImport = [bpmnDiagram]; - var handledElements = [bpmnElement]; - forEach(definitions.diagrams, function(diagram) { - if (!diagram.plane) { - return; - } - var businessObject = diagram.plane.bpmnElement; - if (allChildren.indexOf(businessObject) !== -1 && handledElements.indexOf(businessObject) === -1) { - diagramsToImport.push(diagram); - handledElements.push(businessObject); - } - }); - return diagramsToImport; -} -function selfAndAllFlowElements(elements) { - var result = []; - forEach(elements, function(element) { - if (!element) { - return; - } - result.push(element); - result = result.concat(selfAndAllFlowElements(element.flowElements)); - }); - return result; -} -function findRootProcess(element) { - var parent = element; - while (parent) { - if (is(parent, "bpmn:Process")) { - return parent; - } - parent = parent.$parent; - } -} - -// node_modules/.pnpm/bpmn-js@17.11.1/node_modules/bpmn-js/lib/util/PoweredByUtil.js -var BPMNIO_LOGO_SVG = ''; -var BPMNIO_IMG = BPMNIO_LOGO_SVG; -var LOGO_STYLES = { - verticalAlign: "middle" -}; -var LINK_STYLES = { - "color": "#404040" -}; -var LIGHTBOX_STYLES = { - "zIndex": "1001", - "position": "fixed", - "top": "0", - "left": "0", - "right": "0", - "bottom": "0" -}; -var BACKDROP_STYLES = { - "width": "100%", - "height": "100%", - "background": "rgba(40,40,40,0.2)" -}; -var NOTICE_STYLES = { - "position": "absolute", - "left": "50%", - "top": "40%", - "transform": "translate(-50%)", - "width": "260px", - "padding": "10px", - "background": "white", - "boxShadow": "0 1px 4px rgba(0,0,0,0.3)", - "fontFamily": "Helvetica, Arial, sans-serif", - "fontSize": "14px", - "display": "flex", - "lineHeight": "1.3" -}; -var LIGHTBOX_MARKUP = '
    ' + BPMNIO_IMG + 'Web-based tooling for BPMN, DMN and forms powered by bpmn.io.
    '; -var lightbox; -function createLightbox() { - lightbox = domify$1(LIGHTBOX_MARKUP); - assign2(lightbox, LIGHTBOX_STYLES); - assign2(query("svg", lightbox), LOGO_STYLES); - assign2(query(".backdrop", lightbox), BACKDROP_STYLES); - assign2(query(".notice", lightbox), NOTICE_STYLES); - assign2(query(".link", lightbox), LINK_STYLES, { - "margin": "15px 20px 15px 10px", - "alignSelf": "center" - }); -} -function open() { - if (!lightbox) { - createLightbox(); - delegate.bind(lightbox, ".backdrop", "click", function(event2) { - document.body.removeChild(lightbox); - }); - } - document.body.appendChild(lightbox); -} - -// node_modules/.pnpm/bpmn-js@17.11.1/node_modules/bpmn-js/lib/BaseViewer.js -function BaseViewer(options) { - options = assign({}, DEFAULT_OPTIONS, options); - this._moddle = this._createModdle(options); - this._container = this._createContainer(options); - addProjectLogo(this._container); - this._init(this._container, this._moddle, options); -} -e(BaseViewer, Diagram); -BaseViewer.prototype.importXML = async function importXML(xml2, bpmnDiagram) { - const self = this; - function ParseCompleteEvent(data) { - return self.get("eventBus").createEvent(data); - } - let aggregatedWarnings = []; - try { - xml2 = this._emit("import.parse.start", { xml: xml2 }) || xml2; - let parseResult; - try { - parseResult = await this._moddle.fromXML(xml2, "bpmn:Definitions"); - } catch (error3) { - this._emit("import.parse.complete", { - error: error3 - }); - throw error3; - } - let definitions = parseResult.rootElement; - const references = parseResult.references; - const parseWarnings = parseResult.warnings; - const elementsById = parseResult.elementsById; - aggregatedWarnings = aggregatedWarnings.concat(parseWarnings); - definitions = this._emit("import.parse.complete", ParseCompleteEvent({ - error: null, - definitions, - elementsById, - references, - warnings: aggregatedWarnings - })) || definitions; - const importResult = await this.importDefinitions(definitions, bpmnDiagram); - aggregatedWarnings = aggregatedWarnings.concat(importResult.warnings); - this._emit("import.done", { error: null, warnings: aggregatedWarnings }); - return { warnings: aggregatedWarnings }; - } catch (err) { - let error3 = err; - aggregatedWarnings = aggregatedWarnings.concat(error3.warnings || []); - addWarningsToError(error3, aggregatedWarnings); - error3 = checkValidationError(error3); - this._emit("import.done", { error: error3, warnings: error3.warnings }); - throw error3; - } -}; -BaseViewer.prototype.importDefinitions = async function importDefinitions(definitions, bpmnDiagram) { - this._setDefinitions(definitions); - const result = await this.open(bpmnDiagram); - return { warnings: result.warnings }; -}; -BaseViewer.prototype.open = async function open2(bpmnDiagramOrId) { - const definitions = this._definitions; - let bpmnDiagram = bpmnDiagramOrId; - if (!definitions) { - const error3 = new Error("no XML imported"); - addWarningsToError(error3, []); - throw error3; - } - if (typeof bpmnDiagramOrId === "string") { - bpmnDiagram = findBPMNDiagram(definitions, bpmnDiagramOrId); - if (!bpmnDiagram) { - const error3 = new Error("BPMNDiagram <" + bpmnDiagramOrId + "> not found"); - addWarningsToError(error3, []); - throw error3; - } - } - try { - this.clear(); - } catch (error3) { - addWarningsToError(error3, []); - throw error3; - } - const { warnings } = await importBpmnDiagram(this, definitions, bpmnDiagram); - return { warnings }; -}; -BaseViewer.prototype.saveXML = async function saveXML(options) { - options = options || {}; - let definitions = this._definitions, error3, xml2; - try { - if (!definitions) { - throw new Error("no definitions loaded"); - } - definitions = this._emit("saveXML.start", { - definitions - }) || definitions; - const result2 = await this._moddle.toXML(definitions, options); - xml2 = result2.xml; - xml2 = this._emit("saveXML.serialized", { - xml: xml2 - }) || xml2; - } catch (err) { - error3 = err; - } - const result = error3 ? { error: error3 } : { xml: xml2 }; - this._emit("saveXML.done", result); - if (error3) { - throw error3; - } - return result; -}; -BaseViewer.prototype.saveSVG = async function saveSVG() { - this._emit("saveSVG.start"); - let svg, err; - try { - const canvas = this.get("canvas"); - const contentNode = canvas.getActiveLayer(), defsNode = query(":scope > defs", canvas._svg); - const contents = innerSVG(contentNode), defs = defsNode ? "" + innerSVG(defsNode) + "" : ""; - const bbox = contentNode.getBBox(); - svg = '\n\n\n' + defs + contents + ""; - } catch (e2) { - err = e2; - } - this._emit("saveSVG.done", { - error: err, - svg - }); - if (err) { - throw err; - } - return { svg }; -}; -BaseViewer.prototype._setDefinitions = function(definitions) { - this._definitions = definitions; -}; -BaseViewer.prototype.getModules = function() { - return this._modules; -}; -BaseViewer.prototype.clear = function() { - if (!this.getDefinitions()) { - return; - } - Diagram.prototype.clear.call(this); -}; -BaseViewer.prototype.destroy = function() { - Diagram.prototype.destroy.call(this); - remove(this._container); -}; -BaseViewer.prototype.on = function(events, priority, callback, that) { - return this.get("eventBus").on(events, priority, callback, that); -}; -BaseViewer.prototype.off = function(events, callback) { - this.get("eventBus").off(events, callback); -}; -BaseViewer.prototype.attachTo = function(parentNode) { - if (!parentNode) { - throw new Error("parentNode required"); - } - this.detach(); - if (parentNode.get && parentNode.constructor.prototype.jquery) { - parentNode = parentNode.get(0); - } - if (typeof parentNode === "string") { - parentNode = query(parentNode); - } - parentNode.appendChild(this._container); - this._emit("attach", {}); - this.get("canvas").resized(); -}; -BaseViewer.prototype.getDefinitions = function() { - return this._definitions; -}; -BaseViewer.prototype.detach = function() { - const container = this._container, parentNode = container.parentNode; - if (!parentNode) { - return; - } - this._emit("detach", {}); - parentNode.removeChild(container); -}; -BaseViewer.prototype._init = function(container, moddle, options) { - const baseModules = options.modules || this.getModules(options), additionalModules = options.additionalModules || [], staticModules = [ - { - bpmnjs: ["value", this], - moddle: ["value", moddle] - } - ]; - const diagramModules = [].concat(staticModules, baseModules, additionalModules); - const diagramOptions = assign(omit(options, ["additionalModules"]), { - canvas: assign({}, options.canvas, { container }), - modules: diagramModules - }); - Diagram.call(this, diagramOptions); - if (options && options.container) { - this.attachTo(options.container); - } -}; -BaseViewer.prototype._emit = function(type, event2) { - return this.get("eventBus").fire(type, event2); -}; -BaseViewer.prototype._createContainer = function(options) { - const container = domify$1('
    '); - assign2(container, { - width: ensureUnit(options.width), - height: ensureUnit(options.height), - position: options.position - }); - return container; -}; -BaseViewer.prototype._createModdle = function(options) { - const moddleOptions = assign({}, this._moddleExtensions, options.moddleExtensions); - return new simple(moddleOptions); -}; -BaseViewer.prototype._modules = []; -function addWarningsToError(err, warningsAry) { - err.warnings = warningsAry; - return err; -} -function checkValidationError(err) { - const pattern = /unparsable content <([^>]+)> detected([\s\S]*)$/; - const match = pattern.exec(err.message); - if (match) { - err.message = "unparsable content <" + match[1] + "> detected; this may indicate an invalid BPMN 2.0 diagram file" + match[2]; - } - return err; -} -var DEFAULT_OPTIONS = { - width: "100%", - height: "100%", - position: "relative" -}; -function ensureUnit(val) { - return val + (isNumber(val) ? "px" : ""); -} -function findBPMNDiagram(definitions, diagramId) { - if (!diagramId) { - return null; - } - return find(definitions.diagrams, function(element) { - return element.id === diagramId; - }) || null; -} -function addProjectLogo(container) { - const img = BPMNIO_IMG; - const linkMarkup = '' + img + ""; - const linkElement = domify$1(linkMarkup); - assign2(query("svg", linkElement), LOGO_STYLES); - assign2(linkElement, LINK_STYLES, { - position: "absolute", - bottom: "15px", - right: "15px", - zIndex: "100" - }); - container.appendChild(linkElement); - event.bind(linkElement, "click", function(event2) { - open(); - event2.preventDefault(); - }); -} - -// node_modules/.pnpm/bpmn-js@17.11.1/node_modules/bpmn-js/lib/Viewer.js -function Viewer(options) { - BaseViewer.call(this, options); -} -e(Viewer, BaseViewer); -Viewer.prototype._modules = [ - core_default, - drilldown_default, - outline_default2, - overlays_default, - selection_default, - translate_default -]; -Viewer.prototype._moddleExtensions = {}; - -export { - createLine, - remove3 as remove, - add, - indexOf, - isModelElement, - ElementFactory, - getVisual, - transform2 as transform, - translate, - rotate, - ensureCompatDiRef, - BaseViewer, - DEFAULT_LABEL_SIZE, - isLabelExternal, - hasExternalLabel, - getExternalLabelMid, - getLabel, - setLabel, - translate_default, - IdGenerator, - overlays_default, - change_support_default, - CommandInterceptor, - escapeCSS, - escapeHTML, - getShapeIdFromPlane, - getPlaneIdFromShape, - toPlaneId, - isPlane, - outline_default, - getOriginal, - stopPropagation, - toPoint, - isMac, - isPrimaryButton, - hasPrimaryModifier, - hasSecondaryModifier, - interaction_events_default, - selection_default, - Viewer -}; -//# sourceMappingURL=chunk-7TL3JRAD.js.map diff --git a/node_modules/.vite/deps/chunk-7TL3JRAD.js.map b/node_modules/.vite/deps/chunk-7TL3JRAD.js.map deleted file mode 100644 index cb72abcd..00000000 --- a/node_modules/.vite/deps/chunk-7TL3JRAD.js.map +++ /dev/null @@ -1,7 +0,0 @@ -{ - "version": 3, - "sources": ["../../.pnpm/diagram-js@14.11.3/node_modules/diagram-js/lib/draw/BaseRenderer.js", "../../.pnpm/bpmn-js@17.11.1/node_modules/bpmn-js/lib/util/LabelUtil.js", "../../.pnpm/diagram-js@14.11.3/node_modules/diagram-js/lib/util/RenderUtil.js", "../../.pnpm/bpmn-js@17.11.1/node_modules/bpmn-js/lib/draw/BpmnRenderUtil.js", "../../.pnpm/diagram-js@14.11.3/node_modules/diagram-js/lib/util/SvgTransformUtil.js", "../../.pnpm/bpmn-js@17.11.1/node_modules/bpmn-js/lib/draw/BpmnRenderer.js", "../../.pnpm/diagram-js@14.11.3/node_modules/diagram-js/lib/util/Text.js", "../../.pnpm/bpmn-js@17.11.1/node_modules/bpmn-js/lib/draw/TextRenderer.js", "../../.pnpm/bpmn-js@17.11.1/node_modules/bpmn-js/lib/draw/PathMap.js", "../../.pnpm/bpmn-js@17.11.1/node_modules/bpmn-js/lib/draw/index.js", "../../.pnpm/diagram-js@14.11.3/node_modules/diagram-js/lib/i18n/translate/translate.js", "../../.pnpm/diagram-js@14.11.3/node_modules/diagram-js/lib/i18n/translate/index.js", "../../.pnpm/bpmn-js@17.11.1/node_modules/bpmn-js/lib/import/Util.js", "../../.pnpm/bpmn-js@17.11.1/node_modules/bpmn-js/lib/import/BpmnImporter.js", "../../.pnpm/bpmn-js@17.11.1/node_modules/bpmn-js/lib/import/index.js", "../../.pnpm/bpmn-js@17.11.1/node_modules/bpmn-js/lib/core/index.js", "../../.pnpm/diagram-js@14.11.3/node_modules/diagram-js/lib/util/IdGenerator.js", "../../.pnpm/diagram-js@14.11.3/node_modules/diagram-js/lib/features/overlays/Overlays.js", "../../.pnpm/diagram-js@14.11.3/node_modules/diagram-js/lib/features/overlays/index.js", "../../.pnpm/diagram-js@14.11.3/node_modules/diagram-js/lib/features/change-support/ChangeSupport.js", "../../.pnpm/diagram-js@14.11.3/node_modules/diagram-js/lib/features/change-support/index.js", "../../.pnpm/diagram-js@14.11.3/node_modules/diagram-js/lib/command/CommandInterceptor.js", "../../.pnpm/diagram-js@14.11.3/node_modules/diagram-js/lib/features/root-elements/RootElementsBehavior.js", "../../.pnpm/diagram-js@14.11.3/node_modules/diagram-js/lib/features/root-elements/index.js", "../../.pnpm/diagram-js@14.11.3/node_modules/diagram-js/lib/util/EscapeUtil.js", "../../.pnpm/bpmn-js@17.11.1/node_modules/bpmn-js/lib/util/DrilldownUtil.js", "../../.pnpm/bpmn-js@17.11.1/node_modules/bpmn-js/lib/features/drilldown/DrilldownBreadcrumbs.js", "../../.pnpm/bpmn-js@17.11.1/node_modules/bpmn-js/lib/features/drilldown/DrilldownCentering.js", "../../.pnpm/bpmn-js@17.11.1/node_modules/bpmn-js/lib/features/drilldown/SubprocessCompatibility.js", "../../.pnpm/bpmn-js@17.11.1/node_modules/bpmn-js/lib/features/drilldown/DrilldownOverlayBehavior.js", "../../.pnpm/bpmn-js@17.11.1/node_modules/bpmn-js/lib/features/drilldown/index.js", "../../.pnpm/diagram-js@14.11.3/node_modules/diagram-js/lib/features/outline/Outline.js", "../../.pnpm/diagram-js@14.11.3/node_modules/diagram-js/lib/features/outline/index.js", "../../.pnpm/bpmn-js@17.11.1/node_modules/bpmn-js/lib/features/outline/OutlineUtil.js", "../../.pnpm/bpmn-js@17.11.1/node_modules/bpmn-js/lib/features/outline/OutlineProvider.js", "../../.pnpm/bpmn-js@17.11.1/node_modules/bpmn-js/lib/features/outline/index.js", "../../.pnpm/diagram-js@14.11.3/node_modules/diagram-js/lib/util/Event.js", "../../.pnpm/diagram-js@14.11.3/node_modules/diagram-js/lib/util/Platform.js", "../../.pnpm/diagram-js@14.11.3/node_modules/diagram-js/lib/util/Mouse.js", "../../.pnpm/diagram-js@14.11.3/node_modules/diagram-js/lib/features/interaction-events/InteractionEvents.js", "../../.pnpm/diagram-js@14.11.3/node_modules/diagram-js/lib/features/interaction-events/index.js", "../../.pnpm/diagram-js@14.11.3/node_modules/diagram-js/lib/features/selection/Selection.js", "../../.pnpm/diagram-js@14.11.3/node_modules/diagram-js/lib/features/selection/SelectionVisuals.js", "../../.pnpm/diagram-js@14.11.3/node_modules/diagram-js/lib/features/selection/SelectionBehavior.js", "../../.pnpm/diagram-js@14.11.3/node_modules/diagram-js/lib/features/selection/index.js", "../../.pnpm/didi@10.2.2/node_modules/didi/lib/util.js", "../../.pnpm/didi@10.2.2/node_modules/didi/lib/annotation.js", "../../.pnpm/didi@10.2.2/node_modules/didi/lib/injector.js", "../../.pnpm/diagram-js@14.11.3/node_modules/diagram-js/lib/draw/DefaultRenderer.js", "../../.pnpm/diagram-js@14.11.3/node_modules/diagram-js/lib/draw/Styles.js", "../../.pnpm/diagram-js@14.11.3/node_modules/diagram-js/lib/draw/index.js", "../../.pnpm/diagram-js@14.11.3/node_modules/diagram-js/lib/util/Collections.js", "../../.pnpm/diagram-js@14.11.3/node_modules/diagram-js/lib/core/Canvas.js", "../../.pnpm/diagram-js@14.11.3/node_modules/diagram-js/lib/core/ElementRegistry.js", "../../.pnpm/object-refs@0.4.0/node_modules/object-refs/dist/index.js", "../../.pnpm/diagram-js@14.11.3/node_modules/diagram-js/lib/model/index.js", "../../.pnpm/diagram-js@14.11.3/node_modules/diagram-js/lib/core/ElementFactory.js", "../../.pnpm/diagram-js@14.11.3/node_modules/diagram-js/lib/core/EventBus.js", "../../.pnpm/diagram-js@14.11.3/node_modules/diagram-js/lib/util/GraphicsUtil.js", "../../.pnpm/diagram-js@14.11.3/node_modules/diagram-js/lib/core/GraphicsFactory.js", "../../.pnpm/diagram-js@14.11.3/node_modules/diagram-js/lib/core/index.js", "../../.pnpm/diagram-js@14.11.3/node_modules/diagram-js/lib/Diagram.js", "../../.pnpm/moddle@6.2.3/node_modules/moddle/lib/base.js", "../../.pnpm/moddle@6.2.3/node_modules/moddle/lib/factory.js", "../../.pnpm/moddle@6.2.3/node_modules/moddle/lib/types.js", "../../.pnpm/moddle@6.2.3/node_modules/moddle/lib/ns.js", "../../.pnpm/moddle@6.2.3/node_modules/moddle/lib/descriptor-builder.js", "../../.pnpm/moddle@6.2.3/node_modules/moddle/lib/registry.js", "../../.pnpm/moddle@6.2.3/node_modules/moddle/lib/properties.js", "../../.pnpm/moddle@6.2.3/node_modules/moddle/lib/moddle.js", "../../.pnpm/saxen@8.1.2/node_modules/saxen/dist/index.esm.js", "../../.pnpm/moddle-xml@10.1.0/node_modules/moddle-xml/lib/common.js", "../../.pnpm/moddle-xml@10.1.0/node_modules/moddle-xml/lib/read.js", "../../.pnpm/moddle-xml@10.1.0/node_modules/moddle-xml/lib/write.js", "../../.pnpm/bpmn-moddle@8.1.0/node_modules/bpmn-moddle/dist/index.esm.js", "../../.pnpm/bpmn-js@17.11.1/node_modules/bpmn-js/lib/util/CompatibilityUtil.js", "../../.pnpm/bpmn-js@17.11.1/node_modules/bpmn-js/lib/import/BpmnTreeWalker.js", "../../.pnpm/bpmn-js@17.11.1/node_modules/bpmn-js/lib/import/Importer.js", "../../.pnpm/bpmn-js@17.11.1/node_modules/bpmn-js/lib/util/PoweredByUtil.js", "../../.pnpm/bpmn-js@17.11.1/node_modules/bpmn-js/lib/BaseViewer.js", "../../.pnpm/bpmn-js@17.11.1/node_modules/bpmn-js/lib/Viewer.js"], - "sourcesContent": ["var DEFAULT_RENDER_PRIORITY = 1000;\n\n/**\n * @typedef {import('../core/Types').ElementLike} Element\n * @typedef {import('../core/Types').ConnectionLike} Connection\n * @typedef {import('../core/Types').ShapeLike} Shape\n *\n * @typedef {import('../core/EventBus').default} EventBus\n */\n\n/**\n * The base implementation of shape and connection renderers.\n *\n * @param {EventBus} eventBus\n * @param {number} [renderPriority=1000]\n */\nexport default function BaseRenderer(eventBus, renderPriority) {\n var self = this;\n\n renderPriority = renderPriority || DEFAULT_RENDER_PRIORITY;\n\n eventBus.on([ 'render.shape', 'render.connection' ], renderPriority, function(evt, context) {\n var type = evt.type,\n element = context.element,\n visuals = context.gfx,\n attrs = context.attrs;\n\n if (self.canRender(element)) {\n if (type === 'render.shape') {\n return self.drawShape(visuals, element, attrs);\n } else {\n return self.drawConnection(visuals, element, attrs);\n }\n }\n });\n\n eventBus.on([ 'render.getShapePath', 'render.getConnectionPath' ], renderPriority, function(evt, element) {\n if (self.canRender(element)) {\n if (evt.type === 'render.getShapePath') {\n return self.getShapePath(element);\n } else {\n return self.getConnectionPath(element);\n }\n }\n });\n}\n\n/**\n * Checks whether an element can be rendered.\n *\n * @param {Element} element The element to be rendered.\n *\n * @return {boolean} Whether the element can be rendered.\n */\nBaseRenderer.prototype.canRender = function(element) {};\n\n/**\n * Draws a shape.\n *\n * @param {SVGElement} visuals The SVG element to draw the shape into.\n * @param {Shape} shape The shape to be drawn.\n *\n * @return {SVGElement} The SVG element of the shape drawn.\n */\nBaseRenderer.prototype.drawShape = function(visuals, shape) {};\n\n/**\n * Draws a connection.\n *\n * @param {SVGElement} visuals The SVG element to draw the connection into.\n * @param {Connection} connection The connection to be drawn.\n *\n * @return {SVGElement} The SVG element of the connection drawn.\n */\nBaseRenderer.prototype.drawConnection = function(visuals, connection) {};\n\n/**\n * Gets the SVG path of the graphical representation of a shape.\n *\n * @param {Shape} shape The shape.\n *\n * @return {string} The SVG path of the shape.\n */\nBaseRenderer.prototype.getShapePath = function(shape) {};\n\n/**\n * Gets the SVG path of the graphical representation of a connection.\n *\n * @param {Connection} connection The connection.\n *\n * @return {string} The SVG path of the connection.\n */\nBaseRenderer.prototype.getConnectionPath = function(connection) {};\n", "import {\n assign\n} from 'min-dash';\n\nimport { is } from './ModelUtil';\n\nimport { isLabel } from 'diagram-js/lib/util/ModelUtil';\n\nexport { isLabel } from 'diagram-js/lib/util/ModelUtil';\n\n/**\n * @typedef {import('diagram-js/lib/util/Types').Point} Point\n * @typedef {import('diagram-js/lib/util/Types').Rect} Rect\n *\n * @typedef {import('../model/Types').Element} Element\n * @typedef {import('../model/Types').ModdleElement} ModdleElement\n */\n\nexport var DEFAULT_LABEL_SIZE = {\n width: 90,\n height: 20\n};\n\nexport var FLOW_LABEL_INDENT = 15;\n\n\n/**\n * Return true if the given semantic has an external label.\n *\n * @param {Element} semantic\n *\n * @return {boolean}\n */\nexport function isLabelExternal(semantic) {\n return is(semantic, 'bpmn:Event') ||\n is(semantic, 'bpmn:Gateway') ||\n is(semantic, 'bpmn:DataStoreReference') ||\n is(semantic, 'bpmn:DataObjectReference') ||\n is(semantic, 'bpmn:DataInput') ||\n is(semantic, 'bpmn:DataOutput') ||\n is(semantic, 'bpmn:SequenceFlow') ||\n is(semantic, 'bpmn:MessageFlow') ||\n is(semantic, 'bpmn:Group');\n}\n\n/**\n * Return true if the given element has an external label.\n *\n * @param {Element} element\n *\n * @return {boolean}\n */\nexport function hasExternalLabel(element) {\n return isLabel(element.label);\n}\n\n/**\n * Get the position of a sequence flow label.\n *\n * @param {Point[]} waypoints\n *\n * @return {Point}\n */\nexport function getFlowLabelPosition(waypoints) {\n\n // get the waypoints mid\n var mid = waypoints.length / 2 - 1;\n\n var first = waypoints[Math.floor(mid)];\n var second = waypoints[Math.ceil(mid + 0.01)];\n\n // get position\n var position = getWaypointsMid(waypoints);\n\n // calculate angle\n var angle = Math.atan((second.y - first.y) / (second.x - first.x));\n\n var x = position.x,\n y = position.y;\n\n if (Math.abs(angle) < Math.PI / 2) {\n y -= FLOW_LABEL_INDENT;\n } else {\n x += FLOW_LABEL_INDENT;\n }\n\n return { x: x, y: y };\n}\n\n\n/**\n * Get the middle of a number of waypoints.\n *\n * @param {Point[]} waypoints\n *\n * @return {Point}\n */\nexport function getWaypointsMid(waypoints) {\n\n var mid = waypoints.length / 2 - 1;\n\n var first = waypoints[Math.floor(mid)];\n var second = waypoints[Math.ceil(mid + 0.01)];\n\n return {\n x: first.x + (second.x - first.x) / 2,\n y: first.y + (second.y - first.y) / 2\n };\n}\n\n/**\n * Get the middle of the external label of an element.\n *\n * @param {Element} element\n *\n * @return {Point}\n */\nexport function getExternalLabelMid(element) {\n\n if (element.waypoints) {\n return getFlowLabelPosition(element.waypoints);\n } else if (is(element, 'bpmn:Group')) {\n return {\n x: element.x + element.width / 2,\n y: element.y + DEFAULT_LABEL_SIZE.height / 2\n };\n } else {\n return {\n x: element.x + element.width / 2,\n y: element.y + element.height + DEFAULT_LABEL_SIZE.height / 2\n };\n }\n}\n\n\n/**\n * Return the bounds of an elements label, parsed from the elements DI or\n * generated from its bounds.\n *\n * @param {ModdleElement} di\n * @param {Element} element\n *\n * @return {Rect}\n */\nexport function getExternalLabelBounds(di, element) {\n\n var mid,\n size,\n bounds,\n label = di.label;\n\n if (label && label.bounds) {\n bounds = label.bounds;\n\n size = {\n width: Math.max(DEFAULT_LABEL_SIZE.width, bounds.width),\n height: bounds.height\n };\n\n mid = {\n x: bounds.x + bounds.width / 2,\n y: bounds.y + bounds.height / 2\n };\n } else {\n\n mid = getExternalLabelMid(element);\n\n size = DEFAULT_LABEL_SIZE;\n }\n\n return assign({\n x: mid.x - size.width / 2,\n y: mid.y - size.height / 2\n }, size);\n}\n\n/**\n * @param {ModdleElement} semantic\n *\n * @returns {string}\n */\nfunction getLabelAttr(semantic) {\n if (\n is(semantic, 'bpmn:FlowElement') ||\n is(semantic, 'bpmn:Participant') ||\n is(semantic, 'bpmn:Lane') ||\n is(semantic, 'bpmn:SequenceFlow') ||\n is(semantic, 'bpmn:MessageFlow') ||\n is(semantic, 'bpmn:DataInput') ||\n is(semantic, 'bpmn:DataOutput')\n ) {\n return 'name';\n }\n\n if (is(semantic, 'bpmn:TextAnnotation')) {\n return 'text';\n }\n\n if (is(semantic, 'bpmn:Group')) {\n return 'categoryValueRef';\n }\n}\n\n/**\n * @param {ModdleElement} semantic\n *\n * @returns {string}\n */\nfunction getCategoryValue(semantic) {\n var categoryValueRef = semantic['categoryValueRef'];\n\n if (!categoryValueRef) {\n return '';\n }\n\n\n return categoryValueRef.value || '';\n}\n\n/**\n * @param {Element} element\n *\n * @return {string}\n */\nexport function getLabel(element) {\n var semantic = element.businessObject,\n attr = getLabelAttr(semantic);\n\n if (attr) {\n\n if (attr === 'categoryValueRef') {\n\n return getCategoryValue(semantic);\n }\n\n return semantic[attr] || '';\n }\n}\n\n\n/**\n * @param {Element} element\n * @param {string} text\n *\n * @return {Element}\n */\nexport function setLabel(element, text) {\n var semantic = element.businessObject,\n attr = getLabelAttr(semantic);\n\n if (attr) {\n\n if (attr === 'categoryValueRef') {\n semantic['categoryValueRef'].value = text;\n } else {\n semantic[attr] = text;\n }\n\n }\n\n return element;\n}\n", "import {\n isNumber\n} from 'min-dash';\n\nimport {\n attr as svgAttr,\n create as svgCreate\n} from 'tiny-svg';\n\n\n/**\n * @typedef {(string|number)[]} Component\n *\n * @typedef {import('../util/Types').Point} Point\n */\n\n/**\n * @param {Component[] | Component[][]} elements\n *\n * @return {string}\n */\nexport function componentsToPath(elements) {\n return elements.flat().join(',').replace(/,?([A-z]),?/g, '$1');\n}\n\n/**\n * @param {Point[]} points\n *\n * @return {string}\n */\nexport function toSVGPoints(points) {\n var result = '';\n\n for (var i = 0, p; (p = points[i]); i++) {\n result += p.x + ',' + p.y + ' ';\n }\n\n return result;\n}\n\n/**\n * @param {Point} point\n *\n * @return {Component[]}\n */\nfunction move(point) {\n return [ 'M', point.x, point.y ];\n}\n\n/**\n * @param {Point} point\n *\n * @return {Component[]}\n */\nfunction lineTo(point) {\n return [ 'L', point.x, point.y ];\n}\n\n/**\n * @param {Point} p1\n * @param {Point} p2\n * @param {Point} p3\n *\n * @return {Component[]}\n */\nfunction curveTo(p1, p2, p3) {\n return [ 'C', p1.x, p1.y, p2.x, p2.y, p3.x, p3.y ];\n}\n\n/**\n * @param {Point[]} waypoints\n * @param {number} [cornerRadius]\n * @return {Component[][]}\n */\nfunction drawPath(waypoints, cornerRadius) {\n const pointCount = waypoints.length;\n\n const path = [ move(waypoints[0]) ];\n\n for (let i = 1; i < pointCount; i++) {\n\n const pointBefore = waypoints[i - 1];\n const point = waypoints[i];\n const pointAfter = waypoints[i + 1];\n\n if (!pointAfter || !cornerRadius) {\n path.push(lineTo(point));\n\n continue;\n }\n\n const effectiveRadius = Math.min(\n cornerRadius,\n vectorLength(point.x - pointBefore.x, point.y - pointBefore.y),\n vectorLength(pointAfter.x - point.x, pointAfter.y - point.y)\n );\n\n if (!effectiveRadius) {\n path.push(lineTo(point));\n\n continue;\n }\n\n const beforePoint = getPointAtLength(point, pointBefore, effectiveRadius);\n const beforePoint2 = getPointAtLength(point, pointBefore, effectiveRadius * .5);\n\n const afterPoint = getPointAtLength(point, pointAfter, effectiveRadius);\n const afterPoint2 = getPointAtLength(point, pointAfter, effectiveRadius * .5);\n\n path.push(lineTo(beforePoint));\n path.push(curveTo(beforePoint2, afterPoint2, afterPoint));\n }\n\n return path;\n}\n\nfunction getPointAtLength(start, end, length) {\n\n const deltaX = end.x - start.x;\n const deltaY = end.y - start.y;\n\n const totalLength = vectorLength(deltaX, deltaY);\n\n const percent = length / totalLength;\n\n return {\n x: start.x + deltaX * percent,\n y: start.y + deltaY * percent\n };\n}\n\nfunction vectorLength(x, y) {\n return Math.sqrt(Math.pow(x, 2) + Math.pow(y, 2));\n}\n\n/**\n * @param {Point[]} points\n * @param {number|Object} [attrs]\n * @param {number} [radius]\n *\n * @return {SVGElement}\n */\nexport function createLine(points, attrs, radius) {\n\n if (isNumber(attrs)) {\n radius = attrs;\n attrs = null;\n }\n\n if (!attrs) {\n attrs = {};\n }\n\n const line = svgCreate('path', attrs);\n\n if (isNumber(radius)) {\n line.dataset.cornerRadius = String(radius);\n }\n\n return updateLine(line, points);\n}\n\n/**\n * @param {SVGElement} gfx\n * @param {Point[]} points\n *\n * @return {SVGElement}\n */\nexport function updateLine(gfx, points) {\n\n const cornerRadius = parseInt(gfx.dataset.cornerRadius, 10) || 0;\n\n svgAttr(gfx, {\n d: componentsToPath(drawPath(points, cornerRadius))\n });\n\n return gfx;\n}\n", "import {\n has,\n some\n} from 'min-dash';\n\nimport {\n getDi\n} from '../util/ModelUtil';\n\nimport {\n componentsToPath\n} from 'diagram-js/lib/util/RenderUtil';\n\n\n/**\n * @typedef {import('../model').ModdleElement} ModdleElement\n * @typedef {import('../model').Element} Element\n *\n * @typedef {import('../model').ShapeLike} ShapeLike\n *\n * @typedef {import('diagram-js/lib/util/Types').Dimensions} Dimensions\n * @typedef {import('diagram-js/lib/util/Types').Rect} Rect\n */\n\n// re-export for compatibility\nexport {\n getDi,\n getBusinessObject as getSemantic\n} from '../util/ModelUtil';\n\n\nexport var black = 'hsl(225, 10%, 15%)';\nexport var white = 'white';\n\n// element utils //////////////////////\n\n/**\n * Checks if eventDefinition of the given element matches with semantic type.\n *\n * @param {ModdleElement} event\n * @param {string} eventDefinitionType\n *\n * @return {boolean}\n */\nexport function isTypedEvent(event, eventDefinitionType) {\n return some(event.eventDefinitions, function(definition) {\n return definition.$type === eventDefinitionType;\n });\n}\n\n/**\n * Check if element is a throw event.\n *\n * @param {ModdleElement} event\n *\n * @return {boolean}\n */\nexport function isThrowEvent(event) {\n return (event.$type === 'bpmn:IntermediateThrowEvent') || (event.$type === 'bpmn:EndEvent');\n}\n\n/**\n * Check if element is a throw event.\n *\n * @param {ModdleElement} element\n *\n * @return {boolean}\n */\nexport function isCollection(element) {\n var dataObject = element.dataObjectRef;\n\n return element.isCollection || (dataObject && dataObject.isCollection);\n}\n\n\n// color access //////////////////////\n\n/**\n * @param {Element} element\n * @param {string} [defaultColor]\n * @param {string} [overrideColor]\n *\n * @return {string}\n */\nexport function getFillColor(element, defaultColor, overrideColor) {\n var di = getDi(element);\n\n return overrideColor || di.get('color:background-color') || di.get('bioc:fill') || defaultColor || white;\n}\n\n/**\n * @param {Element} element\n * @param {string} [defaultColor]\n * @param {string} [overrideColor]\n *\n * @return {string}\n */\nexport function getStrokeColor(element, defaultColor, overrideColor) {\n var di = getDi(element);\n\n return overrideColor || di.get('color:border-color') || di.get('bioc:stroke') || defaultColor || black;\n}\n\n/**\n * @param {Element} element\n * @param {string} [defaultColor]\n * @param {string} [defaultStrokeColor]\n * @param {string} [overrideColor]\n *\n * @return {string}\n */\nexport function getLabelColor(element, defaultColor, defaultStrokeColor, overrideColor) {\n var di = getDi(element),\n label = di.get('label');\n\n return overrideColor || (label && label.get('color:color')) || defaultColor ||\n getStrokeColor(element, defaultStrokeColor);\n}\n\n// cropping path customizations //////////////////////\n\n/**\n * @param {ShapeLike} shape\n *\n * @return {string} path\n */\nexport function getCirclePath(shape) {\n\n var cx = shape.x + shape.width / 2,\n cy = shape.y + shape.height / 2,\n radius = shape.width / 2;\n\n var circlePath = [\n [ 'M', cx, cy ],\n [ 'm', 0, -radius ],\n [ 'a', radius, radius, 0, 1, 1, 0, 2 * radius ],\n [ 'a', radius, radius, 0, 1, 1, 0, -2 * radius ],\n [ 'z' ]\n ];\n\n return componentsToPath(circlePath);\n}\n\n/**\n * @param {ShapeLike} shape\n * @param {number} [borderRadius]\n *\n * @return {string} path\n */\nexport function getRoundRectPath(shape, borderRadius) {\n\n var x = shape.x,\n y = shape.y,\n width = shape.width,\n height = shape.height;\n\n var roundRectPath = [\n [ 'M', x + borderRadius, y ],\n [ 'l', width - borderRadius * 2, 0 ],\n [ 'a', borderRadius, borderRadius, 0, 0, 1, borderRadius, borderRadius ],\n [ 'l', 0, height - borderRadius * 2 ],\n [ 'a', borderRadius, borderRadius, 0, 0, 1, -borderRadius, borderRadius ],\n [ 'l', borderRadius * 2 - width, 0 ],\n [ 'a', borderRadius, borderRadius, 0, 0, 1, -borderRadius, -borderRadius ],\n [ 'l', 0, borderRadius * 2 - height ],\n [ 'a', borderRadius, borderRadius, 0, 0, 1, borderRadius, -borderRadius ],\n [ 'z' ]\n ];\n\n return componentsToPath(roundRectPath);\n}\n\n/**\n * @param {ShapeLike} shape\n *\n * @return {string} path\n */\nexport function getDiamondPath(shape) {\n\n var width = shape.width,\n height = shape.height,\n x = shape.x,\n y = shape.y,\n halfWidth = width / 2,\n halfHeight = height / 2;\n\n var diamondPath = [\n [ 'M', x + halfWidth, y ],\n [ 'l', halfWidth, halfHeight ],\n [ 'l', -halfWidth, halfHeight ],\n [ 'l', -halfWidth, -halfHeight ],\n [ 'z' ]\n ];\n\n return componentsToPath(diamondPath);\n}\n\n/**\n * @param {ShapeLike} shape\n *\n * @return {string} path\n */\nexport function getRectPath(shape) {\n var x = shape.x,\n y = shape.y,\n width = shape.width,\n height = shape.height;\n\n var rectPath = [\n [ 'M', x, y ],\n [ 'l', width, 0 ],\n [ 'l', 0, height ],\n [ 'l', -width, 0 ],\n [ 'z' ]\n ];\n\n return componentsToPath(rectPath);\n}\n\n/**\n * Get width and height from element or overrides.\n *\n * @param {Dimensions|Rect|ShapeLike} bounds\n * @param {Object} overrides\n *\n * @returns {Dimensions}\n */\nexport function getBounds(bounds, overrides = {}) {\n return {\n width: getWidth(bounds, overrides),\n height: getHeight(bounds, overrides)\n };\n}\n\n/**\n * Get width from element or overrides.\n *\n * @param {Dimensions|Rect|ShapeLike} bounds\n * @param {Object} overrides\n *\n * @returns {number}\n */\nexport function getWidth(bounds, overrides = {}) {\n return has(overrides, 'width') ? overrides.width : bounds.width;\n}\n\n/**\n * Get height from element or overrides.\n *\n * @param {Dimensions|Rect|ShapeLike} bounds\n * @param {Object} overrides\n *\n * @returns {number}\n */\nexport function getHeight(bounds, overrides = {}) {\n return has(overrides, 'height') ? overrides.height : bounds.height;\n}", "import {\r\n transform as svgTransform,\r\n createTransform\r\n} from 'tiny-svg';\r\n\r\n\r\n/**\r\n * @param {SVGElement} gfx\r\n * @param {number} x\r\n * @param {number} y\r\n * @param {number} [angle]\r\n * @param {number} [amount]\r\n */\r\nexport function transform(gfx, x, y, angle, amount) {\r\n var translate = createTransform();\r\n translate.setTranslate(x, y);\r\n\r\n var rotate = createTransform();\r\n rotate.setRotate(angle || 0, 0, 0);\r\n\r\n var scale = createTransform();\r\n scale.setScale(amount || 1, amount || 1);\r\n\r\n svgTransform(gfx, [ translate, rotate, scale ]);\r\n}\r\n\r\n\r\n/**\r\n * @param {SVGElement} gfx\r\n * @param {number} x\r\n * @param {number} y\r\n */\r\nexport function translate(gfx, x, y) {\r\n var translate = createTransform();\r\n translate.setTranslate(x, y);\r\n\r\n svgTransform(gfx, translate);\r\n}\r\n\r\n\r\n/**\r\n * @param {SVGElement} gfx\r\n * @param {number} angle\r\n */\r\nexport function rotate(gfx, angle) {\r\n var rotate = createTransform();\r\n rotate.setRotate(angle, 0, 0);\r\n\r\n svgTransform(gfx, rotate);\r\n}\r\n\r\n\r\n/**\r\n * @param {SVGElement} gfx\r\n * @param {number} amount\r\n */\r\nexport function scale(gfx, amount) {\r\n var scale = createTransform();\r\n scale.setScale(amount, amount);\r\n\r\n svgTransform(gfx, scale);\r\n}\r\n", "import inherits from 'inherits-browser';\n\nimport {\n assign,\n forEach,\n isObject\n} from 'min-dash';\n\nimport BaseRenderer from 'diagram-js/lib/draw/BaseRenderer';\n\nimport {\n isExpanded,\n isHorizontal,\n isEventSubProcess\n} from '../util/DiUtil';\n\nimport {\n getLabel\n} from '../util/LabelUtil';\n\nimport {\n is\n} from '../util/ModelUtil';\n\nimport {\n createLine\n} from 'diagram-js/lib/util/RenderUtil';\n\nimport {\n isTypedEvent,\n isThrowEvent,\n isCollection,\n getBounds,\n getDi,\n getSemantic,\n getCirclePath,\n getRoundRectPath,\n getDiamondPath,\n getRectPath,\n getFillColor,\n getStrokeColor,\n getLabelColor,\n getHeight,\n getWidth\n} from './BpmnRenderUtil';\n\nimport {\n query as domQuery\n} from 'min-dom';\n\nimport {\n append as svgAppend,\n attr as svgAttr,\n create as svgCreate,\n classes as svgClasses\n} from 'tiny-svg';\n\nimport {\n rotate,\n transform,\n translate\n} from 'diagram-js/lib/util/SvgTransformUtil';\n\nimport Ids from 'ids';\n\nimport { black } from './BpmnRenderUtil';\n\nvar markerIds = new Ids();\n\nvar ELEMENT_LABEL_DISTANCE = 10,\n INNER_OUTER_DIST = 3,\n PARTICIPANT_STROKE_WIDTH = 1.5,\n TASK_BORDER_RADIUS = 10;\n\nvar DEFAULT_OPACITY = 0.95,\n FULL_OPACITY = 1,\n LOW_OPACITY = 0.25;\n\n/**\n * @typedef { Partial<{\n * defaultFillColor: string,\n * defaultStrokeColor: string,\n * defaultLabelColor: string\n * }> } BpmnRendererConfig\n *\n * @typedef { Partial<{\n * fill: string,\n * stroke: string,\n * width: string,\n * height: string\n * }> } Attrs\n */\n\n/**\n * @typedef { import('../model/Types').Element } Element\n * @typedef { import('../model/Types').Shape } Shape\n * @typedef { import('../model/Types').Connection } Connection\n */\n\n/**\n * A renderer for BPMN elements\n *\n * @param {BpmnRendererConfig} config\n * @param {import('diagram-js/lib/core/EventBus').default} eventBus\n * @param {import('diagram-js/lib/draw/Styles').default} styles\n * @param {import('./PathMap').default} pathMap\n * @param {import('diagram-js/lib/core/Canvas').default} canvas\n * @param {import('./TextRenderer').default} textRenderer\n * @param {number} [priority]\n */\nexport default function BpmnRenderer(\n config, eventBus, styles, pathMap,\n canvas, textRenderer, priority) {\n\n BaseRenderer.call(this, eventBus, priority);\n\n var defaultFillColor = config && config.defaultFillColor,\n defaultStrokeColor = config && config.defaultStrokeColor,\n defaultLabelColor = config && config.defaultLabelColor;\n\n function shapeStyle(attrs) {\n return styles.computeStyle(attrs, {\n strokeLinecap: 'round',\n strokeLinejoin: 'round',\n stroke: black,\n strokeWidth: 2,\n fill: 'white'\n });\n }\n\n function lineStyle(attrs) {\n return styles.computeStyle(attrs, [ 'no-fill' ], {\n strokeLinecap: 'round',\n strokeLinejoin: 'round',\n stroke: black,\n strokeWidth: 2\n });\n }\n\n function addMarker(id, options) {\n var {\n ref = { x: 0, y: 0 },\n scale = 1,\n element,\n parentGfx = canvas._svg\n } = options;\n\n var marker = svgCreate('marker', {\n id: id,\n viewBox: '0 0 20 20',\n refX: ref.x,\n refY: ref.y,\n markerWidth: 20 * scale,\n markerHeight: 20 * scale,\n orient: 'auto'\n });\n\n svgAppend(marker, element);\n\n var defs = domQuery(':scope > defs', parentGfx);\n\n if (!defs) {\n defs = svgCreate('defs');\n\n svgAppend(parentGfx, defs);\n }\n\n svgAppend(defs, marker);\n }\n\n function marker(parentGfx, type, fill, stroke) {\n\n\n var id = markerIds.nextPrefixed('marker-');\n\n createMarker(parentGfx, id, type, fill, stroke);\n\n return 'url(#' + id + ')';\n }\n\n function createMarker(parentGfx, id, type, fill, stroke) {\n\n if (type === 'sequenceflow-end') {\n var sequenceflowEnd = svgCreate('path', {\n d: 'M 1 5 L 11 10 L 1 15 Z',\n ...shapeStyle({\n fill: stroke,\n stroke: stroke,\n strokeWidth: 1\n })\n });\n\n addMarker(id, {\n element: sequenceflowEnd,\n ref: { x: 11, y: 10 },\n scale: 0.5,\n parentGfx\n });\n }\n\n if (type === 'messageflow-start') {\n var messageflowStart = svgCreate('circle', {\n cx: 6,\n cy: 6,\n r: 3.5,\n ...shapeStyle({\n fill,\n stroke: stroke,\n strokeWidth: 1,\n\n // fix for safari / chrome / firefox bug not correctly\n // resetting stroke dash array\n strokeDasharray: [ 10000, 1 ]\n })\n });\n\n addMarker(id, {\n element: messageflowStart,\n ref: { x: 6, y: 6 },\n parentGfx\n });\n }\n\n if (type === 'messageflow-end') {\n var messageflowEnd = svgCreate('path', {\n d: 'm 1 5 l 0 -3 l 7 3 l -7 3 z',\n ...shapeStyle({\n fill,\n stroke: stroke,\n strokeWidth: 1,\n\n // fix for safari / chrome / firefox bug not correctly\n // resetting stroke dash array\n strokeDasharray: [ 10000, 1 ]\n })\n });\n\n addMarker(id, {\n element: messageflowEnd,\n ref: { x: 8.5, y: 5 },\n parentGfx\n });\n }\n\n if (type === 'association-start') {\n var associationStart = svgCreate('path', {\n d: 'M 11 5 L 1 10 L 11 15',\n ...lineStyle({\n fill: 'none',\n stroke,\n strokeWidth: 1.5,\n\n // fix for safari / chrome / firefox bug not correctly\n // resetting stroke dash array\n strokeDasharray: [ 10000, 1 ]\n })\n });\n\n addMarker(id, {\n element: associationStart,\n ref: { x: 1, y: 10 },\n scale: 0.5,\n parentGfx\n });\n }\n\n if (type === 'association-end') {\n var associationEnd = svgCreate('path', {\n d: 'M 1 5 L 11 10 L 1 15',\n ...lineStyle({\n fill: 'none',\n stroke,\n strokeWidth: 1.5,\n\n // fix for safari / chrome / firefox bug not correctly\n // resetting stroke dash array\n strokeDasharray: [ 10000, 1 ]\n })\n });\n\n addMarker(id, {\n element: associationEnd,\n ref: { x: 11, y: 10 },\n scale: 0.5,\n parentGfx\n });\n }\n\n if (type === 'conditional-flow-marker') {\n var conditionalFlowMarker = svgCreate('path', {\n d: 'M 0 10 L 8 6 L 16 10 L 8 14 Z',\n ...shapeStyle({\n fill,\n stroke: stroke\n })\n });\n\n addMarker(id, {\n element: conditionalFlowMarker,\n ref: { x: -1, y: 10 },\n scale: 0.5,\n parentGfx\n });\n }\n\n if (type === 'conditional-default-flow-marker') {\n var defaultFlowMarker = svgCreate('path', {\n d: 'M 6 4 L 10 16',\n ...shapeStyle({\n stroke: stroke,\n fill: 'none'\n })\n });\n\n addMarker(id, {\n element: defaultFlowMarker,\n ref: { x: 0, y: 10 },\n scale: 0.5,\n parentGfx\n });\n }\n }\n\n function drawCircle(parentGfx, width, height, offset, attrs = {}) {\n\n if (isObject(offset)) {\n attrs = offset;\n offset = 0;\n }\n\n offset = offset || 0;\n\n attrs = shapeStyle(attrs);\n\n var cx = width / 2,\n cy = height / 2;\n\n var circle = svgCreate('circle', {\n cx: cx,\n cy: cy,\n r: Math.round((width + height) / 4 - offset),\n ...attrs\n });\n\n svgAppend(parentGfx, circle);\n\n return circle;\n }\n\n function drawRect(parentGfx, width, height, r, offset, attrs) {\n\n if (isObject(offset)) {\n attrs = offset;\n offset = 0;\n }\n\n offset = offset || 0;\n\n attrs = shapeStyle(attrs);\n\n var rect = svgCreate('rect', {\n x: offset,\n y: offset,\n width: width - offset * 2,\n height: height - offset * 2,\n rx: r,\n ry: r,\n ...attrs\n });\n\n svgAppend(parentGfx, rect);\n\n return rect;\n }\n\n function drawDiamond(parentGfx, width, height, attrs) {\n\n var x_2 = width / 2;\n var y_2 = height / 2;\n\n var points = [\n { x: x_2, y: 0 },\n { x: width, y: y_2 },\n { x: x_2, y: height },\n { x: 0, y: y_2 }\n ];\n\n var pointsString = points.map(function(point) {\n return point.x + ',' + point.y;\n }).join(' ');\n\n attrs = shapeStyle(attrs);\n\n var polygon = svgCreate('polygon', {\n ...attrs,\n points: pointsString\n });\n\n svgAppend(parentGfx, polygon);\n\n return polygon;\n }\n\n /**\n * @param {SVGElement} parentGfx\n * @param {Point[]} waypoints\n * @param {any} attrs\n * @param {number} [radius]\n *\n * @return {SVGElement}\n */\n function drawLine(parentGfx, waypoints, attrs, radius) {\n attrs = lineStyle(attrs);\n\n var line = createLine(waypoints, attrs, radius);\n\n svgAppend(parentGfx, line);\n\n return line;\n }\n\n /**\n * @param {SVGElement} parentGfx\n * @param {Point[]} waypoints\n * @param {any} attrs\n *\n * @return {SVGElement}\n */\n function drawConnectionSegments(parentGfx, waypoints, attrs) {\n return drawLine(parentGfx, waypoints, attrs, 5);\n }\n\n function drawPath(parentGfx, d, attrs) {\n attrs = lineStyle(attrs);\n\n var path = svgCreate('path', {\n ...attrs,\n d\n });\n\n svgAppend(parentGfx, path);\n\n return path;\n }\n\n function drawMarker(type, parentGfx, path, attrs) {\n return drawPath(parentGfx, path, assign({ 'data-marker': type }, attrs));\n }\n\n function renderer(type) {\n return handlers[type];\n }\n\n function as(type) {\n return function(parentGfx, element, attrs) {\n return renderer(type)(parentGfx, element, attrs);\n };\n }\n\n var eventIconRenderers = {\n 'bpmn:MessageEventDefinition': function(parentGfx, element, attrs = {}, isThrowing) {\n var pathData = pathMap.getScaledPath('EVENT_MESSAGE', {\n xScaleFactor: 0.9,\n yScaleFactor: 0.9,\n containerWidth: element.width,\n containerHeight: element.height,\n position: {\n mx: 0.235,\n my: 0.315\n }\n });\n\n var fill = isThrowing\n ? getStrokeColor(element, defaultStrokeColor, attrs.stroke)\n : getFillColor(element, defaultFillColor, attrs.fill);\n\n var stroke = isThrowing\n ? getFillColor(element, defaultFillColor, attrs.fill)\n : getStrokeColor(element, defaultStrokeColor, attrs.stroke);\n\n var messagePath = drawPath(parentGfx, pathData, {\n fill,\n stroke,\n strokeWidth: 1\n });\n\n return messagePath;\n },\n 'bpmn:TimerEventDefinition': function(parentGfx, element, attrs = {}) {\n var circle = drawCircle(parentGfx, element.width, element.height, 0.2 * element.height, {\n fill: getFillColor(element, defaultFillColor, attrs.fill),\n stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke),\n strokeWidth: 2\n });\n\n var pathData = pathMap.getScaledPath('EVENT_TIMER_WH', {\n xScaleFactor: 0.75,\n yScaleFactor: 0.75,\n containerWidth: element.width,\n containerHeight: element.height,\n position: {\n mx: 0.5,\n my: 0.5\n }\n });\n\n drawPath(parentGfx, pathData, {\n stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke),\n strokeWidth: 2\n });\n\n for (var i = 0; i < 12; i++) {\n var linePathData = pathMap.getScaledPath('EVENT_TIMER_LINE', {\n xScaleFactor: 0.75,\n yScaleFactor: 0.75,\n containerWidth: element.width,\n containerHeight: element.height,\n position: {\n mx: 0.5,\n my: 0.5\n }\n });\n\n var width = element.width / 2,\n height = element.height / 2;\n\n drawPath(parentGfx, linePathData, {\n strokeWidth: 1,\n stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke),\n transform: 'rotate(' + (i * 30) + ',' + height + ',' + width + ')'\n });\n }\n\n return circle;\n },\n 'bpmn:EscalationEventDefinition': function(parentGfx, event, attrs = {}, isThrowing) {\n var pathData = pathMap.getScaledPath('EVENT_ESCALATION', {\n xScaleFactor: 1,\n yScaleFactor: 1,\n containerWidth: event.width,\n containerHeight: event.height,\n position: {\n mx: 0.5,\n my: 0.2\n }\n });\n\n var fill = isThrowing\n ? getStrokeColor(event, defaultStrokeColor, attrs.stroke)\n : getFillColor(event, defaultFillColor, attrs.fill);\n\n return drawPath(parentGfx, pathData, {\n fill,\n stroke: getStrokeColor(event, defaultStrokeColor, attrs.stroke),\n strokeWidth: 1\n });\n },\n 'bpmn:ConditionalEventDefinition': function(parentGfx, event, attrs = {}) {\n var pathData = pathMap.getScaledPath('EVENT_CONDITIONAL', {\n xScaleFactor: 1,\n yScaleFactor: 1,\n containerWidth: event.width,\n containerHeight: event.height,\n position: {\n mx: 0.5,\n my: 0.222\n }\n });\n\n return drawPath(parentGfx, pathData, {\n fill: getFillColor(event, defaultFillColor, attrs.fill),\n stroke: getStrokeColor(event, defaultStrokeColor, attrs.stroke),\n strokeWidth: 1\n });\n },\n 'bpmn:LinkEventDefinition': function(parentGfx, event, attrs = {}, isThrowing) {\n var pathData = pathMap.getScaledPath('EVENT_LINK', {\n xScaleFactor: 1,\n yScaleFactor: 1,\n containerWidth: event.width,\n containerHeight: event.height,\n position: {\n mx: 0.57,\n my: 0.263\n }\n });\n\n var fill = isThrowing\n ? getStrokeColor(event, defaultStrokeColor, attrs.stroke)\n : getFillColor(event, defaultFillColor, attrs.fill);\n\n return drawPath(parentGfx, pathData, {\n fill,\n stroke: getStrokeColor(event, defaultStrokeColor, attrs.stroke),\n strokeWidth: 1\n });\n },\n 'bpmn:ErrorEventDefinition': function(parentGfx, event, attrs = {}, isThrowing) {\n var pathData = pathMap.getScaledPath('EVENT_ERROR', {\n xScaleFactor: 1.1,\n yScaleFactor: 1.1,\n containerWidth: event.width,\n containerHeight: event.height,\n position: {\n mx: 0.2,\n my: 0.722\n }\n });\n\n var fill = isThrowing\n ? getStrokeColor(event, defaultStrokeColor, attrs.stroke)\n : getFillColor(event, defaultFillColor, attrs.fill);\n\n return drawPath(parentGfx, pathData, {\n fill,\n stroke: getStrokeColor(event, defaultStrokeColor, attrs.stroke),\n strokeWidth: 1\n });\n },\n 'bpmn:CancelEventDefinition': function(parentGfx, event, attrs = {}, isThrowing) {\n var pathData = pathMap.getScaledPath('EVENT_CANCEL_45', {\n xScaleFactor: 1.0,\n yScaleFactor: 1.0,\n containerWidth: event.width,\n containerHeight: event.height,\n position: {\n mx: 0.638,\n my: -0.055\n }\n });\n\n var fill = isThrowing ? getStrokeColor(event, defaultStrokeColor, attrs.stroke) : 'none';\n\n var path = drawPath(parentGfx, pathData, {\n fill,\n stroke: getStrokeColor(event, defaultStrokeColor, attrs.stroke),\n strokeWidth: 1\n });\n\n rotate(path, 45);\n\n return path;\n },\n 'bpmn:CompensateEventDefinition': function(parentGfx, event, attrs = {}, isThrowing) {\n var pathData = pathMap.getScaledPath('EVENT_COMPENSATION', {\n xScaleFactor: 1,\n yScaleFactor: 1,\n containerWidth: event.width,\n containerHeight: event.height,\n position: {\n mx: 0.22,\n my: 0.5\n }\n });\n\n var fill = isThrowing\n ? getStrokeColor(event, defaultStrokeColor, attrs.stroke)\n : getFillColor(event, defaultFillColor, attrs.fill);\n\n return drawPath(parentGfx, pathData, {\n fill,\n stroke: getStrokeColor(event, defaultStrokeColor, attrs.stroke),\n strokeWidth: 1\n });\n },\n 'bpmn:SignalEventDefinition': function(parentGfx, event, attrs = {}, isThrowing) {\n var pathData = pathMap.getScaledPath('EVENT_SIGNAL', {\n xScaleFactor: 0.9,\n yScaleFactor: 0.9,\n containerWidth: event.width,\n containerHeight: event.height,\n position: {\n mx: 0.5,\n my: 0.2\n }\n });\n\n var fill = isThrowing\n ? getStrokeColor(event, defaultStrokeColor, attrs.stroke)\n : getFillColor(event, defaultFillColor, attrs.fill);\n\n return drawPath(parentGfx, pathData, {\n strokeWidth: 1,\n fill,\n stroke: getStrokeColor(event, defaultStrokeColor, attrs.stroke)\n });\n },\n 'bpmn:MultipleEventDefinition': function(parentGfx, event, attrs = {}, isThrowing) {\n var pathData = pathMap.getScaledPath('EVENT_MULTIPLE', {\n xScaleFactor: 1.1,\n yScaleFactor: 1.1,\n containerWidth: event.width,\n containerHeight: event.height,\n position: {\n mx: 0.222,\n my: 0.36\n }\n });\n\n var fill = isThrowing\n ? getStrokeColor(event, defaultStrokeColor, attrs.stroke)\n : getFillColor(event, defaultFillColor, attrs.fill);\n\n return drawPath(parentGfx, pathData, {\n fill,\n strokeWidth: 1\n });\n },\n 'bpmn:ParallelMultipleEventDefinition': function(parentGfx, event, attrs = {}) {\n var pathData = pathMap.getScaledPath('EVENT_PARALLEL_MULTIPLE', {\n xScaleFactor: 1.2,\n yScaleFactor: 1.2,\n containerWidth: event.width,\n containerHeight: event.height,\n position: {\n mx: 0.458,\n my: 0.194\n }\n });\n\n return drawPath(parentGfx, pathData, {\n fill: getFillColor(event, defaultFillColor, attrs.fill),\n stroke: getStrokeColor(event, defaultStrokeColor, attrs.stroke),\n strokeWidth: 1\n });\n },\n 'bpmn:TerminateEventDefinition': function(parentGfx, element, attrs = {}) {\n var circle = drawCircle(parentGfx, element.width, element.height, 8, {\n fill: getStrokeColor(element, defaultStrokeColor, attrs.stroke),\n stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke),\n strokeWidth: 4\n });\n\n return circle;\n }\n };\n\n function renderEventIcon(element, parentGfx, attrs = {}) {\n var semantic = getSemantic(element),\n isThrowing = isThrowEvent(semantic);\n\n if (semantic.get('eventDefinitions') && semantic.get('eventDefinitions').length > 1) {\n if (semantic.get('parallelMultiple')) {\n return eventIconRenderers[ 'bpmn:ParallelMultipleEventDefinition' ](parentGfx, element, attrs, isThrowing);\n }\n else {\n return eventIconRenderers[ 'bpmn:MultipleEventDefinition' ](parentGfx, element, attrs, isThrowing);\n }\n }\n\n if (isTypedEvent(semantic, 'bpmn:MessageEventDefinition')) {\n return eventIconRenderers[ 'bpmn:MessageEventDefinition' ](parentGfx, element, attrs, isThrowing);\n }\n\n if (isTypedEvent(semantic, 'bpmn:TimerEventDefinition')) {\n return eventIconRenderers[ 'bpmn:TimerEventDefinition' ](parentGfx, element, attrs, isThrowing);\n }\n\n if (isTypedEvent(semantic, 'bpmn:ConditionalEventDefinition')) {\n return eventIconRenderers[ 'bpmn:ConditionalEventDefinition' ](parentGfx, element, attrs, isThrowing);\n }\n\n if (isTypedEvent(semantic, 'bpmn:SignalEventDefinition')) {\n return eventIconRenderers[ 'bpmn:SignalEventDefinition' ](parentGfx, element, attrs, isThrowing);\n }\n\n if (isTypedEvent(semantic, 'bpmn:EscalationEventDefinition')) {\n return eventIconRenderers[ 'bpmn:EscalationEventDefinition' ](parentGfx, element, attrs, isThrowing);\n }\n\n if (isTypedEvent(semantic, 'bpmn:LinkEventDefinition')) {\n return eventIconRenderers[ 'bpmn:LinkEventDefinition' ](parentGfx, element, attrs, isThrowing);\n }\n\n if (isTypedEvent(semantic, 'bpmn:ErrorEventDefinition')) {\n return eventIconRenderers[ 'bpmn:ErrorEventDefinition' ](parentGfx, element, attrs, isThrowing);\n }\n\n if (isTypedEvent(semantic, 'bpmn:CancelEventDefinition')) {\n return eventIconRenderers[ 'bpmn:CancelEventDefinition' ](parentGfx, element, attrs, isThrowing);\n }\n\n if (isTypedEvent(semantic, 'bpmn:CompensateEventDefinition')) {\n return eventIconRenderers[ 'bpmn:CompensateEventDefinition' ](parentGfx, element, attrs, isThrowing);\n }\n\n if (isTypedEvent(semantic, 'bpmn:TerminateEventDefinition')) {\n return eventIconRenderers[ 'bpmn:TerminateEventDefinition' ](parentGfx, element, attrs, isThrowing);\n }\n\n return null;\n }\n\n var taskMarkerRenderers = {\n 'ParticipantMultiplicityMarker': function(parentGfx, element, attrs = {}) {\n var width = getWidth(element, attrs),\n height = getHeight(element, attrs);\n\n var markerPath = pathMap.getScaledPath('MARKER_PARALLEL', {\n xScaleFactor: 1,\n yScaleFactor: 1,\n containerWidth: width,\n containerHeight: height,\n position: {\n mx: ((width / 2 - 6) / width),\n my: (height - 15) / height\n }\n });\n\n drawMarker('participant-multiplicity', parentGfx, markerPath, {\n strokeWidth: 2,\n fill: getFillColor(element, defaultFillColor, attrs.fill),\n stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke)\n });\n },\n 'SubProcessMarker': function(parentGfx, element, attrs = {}) {\n var markerRect = drawRect(parentGfx, 14, 14, 0, {\n strokeWidth: 1,\n fill: getFillColor(element, defaultFillColor, attrs.fill),\n stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke)\n });\n\n translate(markerRect, element.width / 2 - 7.5, element.height - 20);\n\n var markerPath = pathMap.getScaledPath('MARKER_SUB_PROCESS', {\n xScaleFactor: 1.5,\n yScaleFactor: 1.5,\n containerWidth: element.width,\n containerHeight: element.height,\n position: {\n mx: (element.width / 2 - 7.5) / element.width,\n my: (element.height - 20) / element.height\n }\n });\n\n drawMarker('sub-process', parentGfx, markerPath, {\n fill: getFillColor(element, defaultFillColor, attrs.fill),\n stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke)\n });\n },\n 'ParallelMarker': function(parentGfx, element, attrs) {\n var width = getWidth(element, attrs),\n height = getHeight(element, attrs);\n\n var markerPath = pathMap.getScaledPath('MARKER_PARALLEL', {\n xScaleFactor: 1,\n yScaleFactor: 1,\n containerWidth: width,\n containerHeight: height,\n position: {\n mx: ((width / 2 + attrs.parallel) / width),\n my: (height - 20) / height\n }\n });\n\n drawMarker('parallel', parentGfx, markerPath, {\n fill: getFillColor(element, defaultFillColor, attrs.fill),\n stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke)\n });\n },\n 'SequentialMarker': function(parentGfx, element, attrs) {\n var markerPath = pathMap.getScaledPath('MARKER_SEQUENTIAL', {\n xScaleFactor: 1,\n yScaleFactor: 1,\n containerWidth: element.width,\n containerHeight: element.height,\n position: {\n mx: ((element.width / 2 + attrs.seq) / element.width),\n my: (element.height - 19) / element.height\n }\n });\n\n drawMarker('sequential', parentGfx, markerPath, {\n fill: getFillColor(element, defaultFillColor, attrs.fill),\n stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke)\n });\n },\n 'CompensationMarker': function(parentGfx, element, attrs) {\n var markerMath = pathMap.getScaledPath('MARKER_COMPENSATION', {\n xScaleFactor: 1,\n yScaleFactor: 1,\n containerWidth: element.width,\n containerHeight: element.height,\n position: {\n mx: ((element.width / 2 + attrs.compensation) / element.width),\n my: (element.height - 13) / element.height\n }\n });\n\n drawMarker('compensation', parentGfx, markerMath, {\n strokeWidth: 1,\n fill: getFillColor(element, defaultFillColor, attrs.fill),\n stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke)\n });\n },\n 'LoopMarker': function(parentGfx, element, attrs) {\n var width = getWidth(element, attrs),\n height = getHeight(element, attrs);\n\n var markerPath = pathMap.getScaledPath('MARKER_LOOP', {\n xScaleFactor: 1,\n yScaleFactor: 1,\n containerWidth: width,\n containerHeight: height,\n position: {\n mx: ((width / 2 + attrs.loop) / width),\n my: (height - 7) / height\n }\n });\n\n drawMarker('loop', parentGfx, markerPath, {\n strokeWidth: 1.5,\n fill: 'none',\n stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke),\n strokeMiterlimit: 0.5\n });\n },\n 'AdhocMarker': function(parentGfx, element, attrs) {\n var width = getWidth(element, attrs),\n height = getHeight(element, attrs);\n\n var markerPath = pathMap.getScaledPath('MARKER_ADHOC', {\n xScaleFactor: 1,\n yScaleFactor: 1,\n containerWidth: width,\n containerHeight: height,\n position: {\n mx: ((width / 2 + attrs.adhoc) / width),\n my: (height - 15) / height\n }\n });\n\n drawMarker('adhoc', parentGfx, markerPath, {\n strokeWidth: 1,\n fill: getStrokeColor(element, defaultStrokeColor, attrs.stroke),\n stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke)\n });\n }\n };\n\n function renderTaskMarker(type, parentGfx, element, attrs) {\n taskMarkerRenderers[ type ](parentGfx, element, attrs);\n }\n\n function renderTaskMarkers(parentGfx, element, taskMarkers, attrs = {}) {\n attrs = {\n fill: attrs.fill,\n stroke: attrs.stroke,\n width: getWidth(element, attrs),\n height: getHeight(element, attrs)\n };\n\n var semantic = getSemantic(element);\n\n var subprocess = taskMarkers && taskMarkers.includes('SubProcessMarker');\n\n if (subprocess) {\n attrs = {\n ...attrs,\n seq: -21,\n parallel: -22,\n compensation: -42,\n loop: -18,\n adhoc: 10\n };\n } else {\n attrs = {\n ...attrs,\n seq: -5,\n parallel: -6,\n compensation: -27,\n loop: 0,\n adhoc: 10\n };\n }\n\n forEach(taskMarkers, function(marker) {\n renderTaskMarker(marker, parentGfx, element, attrs);\n });\n\n if (semantic.get('isForCompensation')) {\n renderTaskMarker('CompensationMarker', parentGfx, element, attrs);\n }\n\n if (is(semantic, 'bpmn:AdHocSubProcess')) {\n renderTaskMarker('AdhocMarker', parentGfx, element, attrs);\n }\n\n var loopCharacteristics = semantic.get('loopCharacteristics'),\n isSequential = loopCharacteristics && loopCharacteristics.get('isSequential');\n\n if (loopCharacteristics) {\n\n if (isSequential === undefined) {\n renderTaskMarker('LoopMarker', parentGfx, element, attrs);\n }\n\n if (isSequential === false) {\n renderTaskMarker('ParallelMarker', parentGfx, element, attrs);\n }\n\n if (isSequential === true) {\n renderTaskMarker('SequentialMarker', parentGfx, element, attrs);\n }\n }\n }\n\n function renderLabel(parentGfx, label, attrs = {}) {\n attrs = assign({\n size: {\n width: 100\n }\n }, attrs);\n\n var text = textRenderer.createText(label || '', attrs);\n\n svgClasses(text).add('djs-label');\n\n svgAppend(parentGfx, text);\n\n return text;\n }\n\n function renderEmbeddedLabel(parentGfx, element, align, attrs = {}) {\n var semantic = getSemantic(element);\n\n var box = getBounds({\n x: element.x,\n y: element.y,\n width: element.width,\n height: element.height\n }, attrs);\n\n return renderLabel(parentGfx, semantic.name, {\n align,\n box,\n padding: 7,\n style: {\n fill: getLabelColor(element, defaultLabelColor, defaultStrokeColor, attrs.stroke)\n }\n });\n }\n\n function renderExternalLabel(parentGfx, element, attrs = {}) {\n var box = {\n width: 90,\n height: 30,\n x: element.width / 2 + element.x,\n y: element.height / 2 + element.y\n };\n\n return renderLabel(parentGfx, getLabel(element), {\n box: box,\n fitBox: true,\n style: assign(\n {},\n textRenderer.getExternalStyle(),\n {\n fill: getLabelColor(element, defaultLabelColor, defaultStrokeColor, attrs.stroke)\n }\n )\n });\n }\n\n function renderLaneLabel(parentGfx, text, element, attrs = {}) {\n var isHorizontalLane = isHorizontal(element);\n\n var textBox = renderLabel(parentGfx, text, {\n box: {\n height: 30,\n width: isHorizontalLane ? getHeight(element, attrs) : getWidth(element, attrs),\n },\n align: 'center-middle',\n style: {\n fill: getLabelColor(element, defaultLabelColor, defaultStrokeColor, attrs.stroke)\n }\n });\n\n if (isHorizontalLane) {\n var top = -1 * getHeight(element, attrs);\n transform(textBox, 0, -top, 270);\n }\n }\n\n function renderActivity(parentGfx, element, attrs = {}) {\n var {\n width,\n height\n } = getBounds(element, attrs);\n\n return drawRect(parentGfx, width, height, TASK_BORDER_RADIUS, {\n ...attrs,\n fill: getFillColor(element, defaultFillColor, attrs.fill),\n fillOpacity: DEFAULT_OPACITY,\n stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke)\n });\n }\n\n function renderAssociation(parentGfx, element, attrs = {}) {\n var semantic = getSemantic(element);\n\n var fill = getFillColor(element, defaultFillColor, attrs.fill),\n stroke = getStrokeColor(element, defaultStrokeColor, attrs.stroke);\n\n if (semantic.get('associationDirection') === 'One' ||\n semantic.get('associationDirection') === 'Both') {\n attrs.markerEnd = marker(parentGfx, 'association-end', fill, stroke);\n }\n\n if (semantic.get('associationDirection') === 'Both') {\n attrs.markerStart = marker(parentGfx, 'association-start', fill, stroke);\n }\n\n attrs = pickAttrs(attrs, [\n 'markerStart',\n 'markerEnd'\n ]);\n\n return drawConnectionSegments(parentGfx, element.waypoints, {\n ...attrs,\n stroke,\n strokeDasharray: '0, 5'\n });\n }\n\n function renderDataObject(parentGfx, element, attrs = {}) {\n var fill = getFillColor(element, defaultFillColor, attrs.fill),\n stroke = getStrokeColor(element, defaultStrokeColor, attrs.stroke);\n\n var pathData = pathMap.getScaledPath('DATA_OBJECT_PATH', {\n xScaleFactor: 1,\n yScaleFactor: 1,\n containerWidth: element.width,\n containerHeight: element.height,\n position: {\n mx: 0.474,\n my: 0.296\n }\n });\n\n var dataObject = drawPath(parentGfx, pathData, {\n fill,\n fillOpacity: DEFAULT_OPACITY,\n stroke\n });\n\n var semantic = getSemantic(element);\n\n if (isCollection(semantic)) {\n var collectionPathData = pathMap.getScaledPath('DATA_OBJECT_COLLECTION_PATH', {\n xScaleFactor: 1,\n yScaleFactor: 1,\n containerWidth: element.width,\n containerHeight: element.height,\n position: {\n mx: 0.33,\n my: (element.height - 18) / element.height\n }\n });\n\n drawPath(parentGfx, collectionPathData, {\n strokeWidth: 2,\n fill,\n stroke\n });\n }\n\n return dataObject;\n }\n\n function renderEvent(parentGfx, element, attrs = {}) {\n return drawCircle(parentGfx, element.width, element.height, {\n fillOpacity: DEFAULT_OPACITY,\n ...attrs,\n fill: getFillColor(element, defaultFillColor, attrs.fill),\n stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke)\n });\n }\n\n function renderGateway(parentGfx, element, attrs = {}) {\n return drawDiamond(parentGfx, element.width, element.height, {\n fill: getFillColor(element, defaultFillColor, attrs.fill),\n fillOpacity: DEFAULT_OPACITY,\n stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke)\n });\n }\n\n function renderLane(parentGfx, element, attrs = {}) {\n var lane = drawRect(parentGfx, getWidth(element, attrs), getHeight(element, attrs), 0, {\n fill: getFillColor(element, defaultFillColor, attrs.fill),\n fillOpacity: attrs.fillOpacity || DEFAULT_OPACITY,\n stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke),\n strokeWidth: 1.5\n });\n\n var semantic = getSemantic(element);\n\n if (is(semantic, 'bpmn:Lane')) {\n var text = semantic.get('name');\n\n renderLaneLabel(parentGfx, text, element, attrs);\n }\n\n return lane;\n }\n\n function renderSubProcess(parentGfx, element, attrs = {}) {\n var activity = renderActivity(parentGfx, element, attrs);\n\n if (isEventSubProcess(element)) {\n svgAttr(activity, {\n strokeDasharray: '0, 5.5',\n strokeWidth: 2.5\n });\n }\n\n var expanded = isExpanded(element);\n\n renderEmbeddedLabel(parentGfx, element, expanded ? 'center-top' : 'center-middle', attrs);\n\n if (expanded) {\n renderTaskMarkers(parentGfx, element, undefined, attrs);\n } else {\n renderTaskMarkers(parentGfx, element, [ 'SubProcessMarker' ], attrs);\n }\n\n return activity;\n }\n\n function renderTask(parentGfx, element, attrs = {}) {\n var activity = renderActivity(parentGfx, element, attrs);\n\n renderEmbeddedLabel(parentGfx, element, 'center-middle', attrs);\n\n renderTaskMarkers(parentGfx, element, undefined, attrs);\n\n return activity;\n }\n\n var handlers = this.handlers = {\n 'bpmn:AdHocSubProcess': function(parentGfx, element, attrs = {}) {\n if (isExpanded(element)) {\n attrs = pickAttrs(attrs, [\n 'fill',\n 'stroke',\n 'width',\n 'height'\n ]);\n } else {\n attrs = pickAttrs(attrs, [\n 'fill',\n 'stroke'\n ]);\n }\n\n return renderSubProcess(parentGfx, element, attrs);\n },\n 'bpmn:Association': function(parentGfx, element, attrs = {}) {\n attrs = pickAttrs(attrs, [\n 'fill',\n 'stroke'\n ]);\n\n return renderAssociation(parentGfx, element, attrs);\n },\n 'bpmn:BoundaryEvent': function(parentGfx, element, attrs = {}) {\n var { renderIcon = true } = attrs;\n\n attrs = pickAttrs(attrs, [\n 'fill',\n 'stroke'\n ]);\n\n var semantic = getSemantic(element),\n cancelActivity = semantic.get('cancelActivity');\n\n attrs = {\n strokeWidth: 1.5,\n fill: getFillColor(element, defaultFillColor, attrs.fill),\n fillOpacity: FULL_OPACITY,\n stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke)\n };\n\n if (!cancelActivity) {\n attrs.strokeDasharray = '6';\n }\n\n var event = renderEvent(parentGfx, element, attrs);\n\n drawCircle(parentGfx, element.width, element.height, INNER_OUTER_DIST, {\n ...attrs,\n fill: 'none'\n });\n\n if (renderIcon) {\n renderEventIcon(element, parentGfx, attrs);\n }\n\n return event;\n },\n 'bpmn:BusinessRuleTask': function(parentGfx, element, attrs = {}) {\n attrs = pickAttrs(attrs, [\n 'fill',\n 'stroke'\n ]);\n\n var task = renderTask(parentGfx, element, attrs);\n\n var headerData = pathMap.getScaledPath('TASK_TYPE_BUSINESS_RULE_MAIN', {\n abspos: {\n x: 8,\n y: 8\n }\n });\n\n var businessPath = drawPath(parentGfx, headerData);\n\n svgAttr(businessPath, {\n fill: getFillColor(element, defaultFillColor, attrs.fill),\n stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke),\n strokeWidth: 1\n });\n\n var headerPathData = pathMap.getScaledPath('TASK_TYPE_BUSINESS_RULE_HEADER', {\n abspos: {\n x: 8,\n y: 8\n }\n });\n\n var businessHeaderPath = drawPath(parentGfx, headerPathData);\n\n svgAttr(businessHeaderPath, {\n fill: getStrokeColor(element, defaultStrokeColor, attrs.stroke),\n stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke),\n strokeWidth: 1\n });\n\n return task;\n },\n 'bpmn:CallActivity': function(parentGfx, element, attrs = {}) {\n attrs = pickAttrs(attrs, [\n 'fill',\n 'stroke'\n ]);\n\n return renderSubProcess(parentGfx, element, {\n strokeWidth: 5,\n ...attrs\n });\n },\n 'bpmn:ComplexGateway': function(parentGfx, element, attrs = {}) {\n attrs = pickAttrs(attrs, [\n 'fill',\n 'stroke'\n ]);\n\n var gateway = renderGateway(parentGfx, element, attrs);\n\n var pathData = pathMap.getScaledPath('GATEWAY_COMPLEX', {\n xScaleFactor: 0.5,\n yScaleFactor:0.5,\n containerWidth: element.width,\n containerHeight: element.height,\n position: {\n mx: 0.46,\n my: 0.26\n }\n });\n\n drawPath(parentGfx, pathData, {\n fill: getStrokeColor(element, defaultStrokeColor, attrs.stroke),\n stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke),\n strokeWidth: 1\n });\n\n return gateway;\n },\n 'bpmn:DataInput': function(parentGfx, element, attrs = {}) {\n attrs = pickAttrs(attrs, [\n 'fill',\n 'stroke'\n ]);\n\n var arrowPathData = pathMap.getRawPath('DATA_ARROW');\n\n var dataObject = renderDataObject(parentGfx, element, attrs);\n\n drawPath(parentGfx, arrowPathData, {\n fill: 'none',\n stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke),\n strokeWidth: 1\n });\n\n return dataObject;\n },\n 'bpmn:DataInputAssociation': function(parentGfx, element, attrs = {}) {\n attrs = pickAttrs(attrs, [\n 'fill',\n 'stroke'\n ]);\n\n return renderAssociation(parentGfx, element, {\n ...attrs,\n markerEnd: marker(parentGfx, 'association-end', getFillColor(element, defaultFillColor, attrs.fill), getStrokeColor(element, defaultStrokeColor, attrs.stroke))\n });\n },\n 'bpmn:DataObject': function(parentGfx, element, attrs = {}) {\n attrs = pickAttrs(attrs, [\n 'fill',\n 'stroke'\n ]);\n\n return renderDataObject(parentGfx, element, attrs);\n },\n 'bpmn:DataObjectReference': as('bpmn:DataObject'),\n 'bpmn:DataOutput': function(parentGfx, element, attrs = {}) {\n attrs = pickAttrs(attrs, [\n 'fill',\n 'stroke'\n ]);\n\n var arrowPathData = pathMap.getRawPath('DATA_ARROW');\n\n var dataObject = renderDataObject(parentGfx, element, attrs);\n\n drawPath(parentGfx, arrowPathData, {\n strokeWidth: 1,\n fill: getFillColor(element, defaultFillColor, attrs.fill),\n stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke)\n });\n\n return dataObject;\n },\n 'bpmn:DataOutputAssociation': function(parentGfx, element, attrs = {}) {\n attrs = pickAttrs(attrs, [\n 'fill',\n 'stroke'\n ]);\n\n return renderAssociation(parentGfx, element, {\n ...attrs,\n markerEnd: marker(parentGfx, 'association-end', getFillColor(element, defaultFillColor, attrs.fill), getStrokeColor(element, defaultStrokeColor, attrs.stroke))\n });\n },\n 'bpmn:DataStoreReference': function(parentGfx, element, attrs = {}) {\n attrs = pickAttrs(attrs, [\n 'fill',\n 'stroke'\n ]);\n\n var dataStorePath = pathMap.getScaledPath('DATA_STORE', {\n xScaleFactor: 1,\n yScaleFactor: 1,\n containerWidth: element.width,\n containerHeight: element.height,\n position: {\n mx: 0,\n my: 0.133\n }\n });\n\n return drawPath(parentGfx, dataStorePath, {\n fill: getFillColor(element, defaultFillColor, attrs.fill),\n fillOpacity: DEFAULT_OPACITY,\n stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke),\n strokeWidth: 2\n });\n },\n 'bpmn:EndEvent': function(parentGfx, element, attrs = {}) {\n var { renderIcon = true } = attrs;\n\n attrs = pickAttrs(attrs, [\n 'fill',\n 'stroke'\n ]);\n\n var event = renderEvent(parentGfx, element, {\n ...attrs,\n strokeWidth: 4\n });\n\n if (renderIcon) {\n renderEventIcon(element, parentGfx, attrs);\n }\n\n return event;\n },\n 'bpmn:EventBasedGateway': function(parentGfx, element, attrs = {}) {\n attrs = pickAttrs(attrs, [\n 'fill',\n 'stroke'\n ]);\n\n var semantic = getSemantic(element);\n\n var diamond = renderGateway(parentGfx, element, attrs);\n\n drawCircle(parentGfx, element.width, element.height, element.height * 0.20, {\n fill: getFillColor(element, 'none', attrs.fill),\n stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke),\n strokeWidth: 1\n });\n\n var type = semantic.get('eventGatewayType'),\n instantiate = !!semantic.get('instantiate');\n\n function drawEvent() {\n\n var pathData = pathMap.getScaledPath('GATEWAY_EVENT_BASED', {\n xScaleFactor: 0.18,\n yScaleFactor: 0.18,\n containerWidth: element.width,\n containerHeight: element.height,\n position: {\n mx: 0.36,\n my: 0.44\n }\n });\n\n drawPath(parentGfx, pathData, {\n fill: 'none',\n stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke),\n strokeWidth: 2\n });\n }\n\n if (type === 'Parallel') {\n var pathData = pathMap.getScaledPath('GATEWAY_PARALLEL', {\n xScaleFactor: 0.4,\n yScaleFactor: 0.4,\n containerWidth: element.width,\n containerHeight: element.height,\n position: {\n mx: 0.474,\n my: 0.296\n }\n });\n\n drawPath(parentGfx, pathData, {\n fill: 'none',\n stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke),\n strokeWidth: 1\n });\n } else if (type === 'Exclusive') {\n if (!instantiate) {\n drawCircle(parentGfx, element.width, element.height, element.height * 0.26, {\n fill: 'none',\n stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke),\n strokeWidth: 1\n });\n }\n\n drawEvent();\n }\n\n\n return diamond;\n },\n 'bpmn:ExclusiveGateway': function(parentGfx, element, attrs = {}) {\n attrs = pickAttrs(attrs, [\n 'fill',\n 'stroke'\n ]);\n\n var gateway = renderGateway(parentGfx, element, attrs);\n\n var pathData = pathMap.getScaledPath('GATEWAY_EXCLUSIVE', {\n xScaleFactor: 0.4,\n yScaleFactor: 0.4,\n containerWidth: element.width,\n containerHeight: element.height,\n position: {\n mx: 0.32,\n my: 0.3\n }\n });\n\n var di = getDi(element);\n\n if (di.get('isMarkerVisible')) {\n drawPath(parentGfx, pathData, {\n fill: getStrokeColor(element, defaultStrokeColor, attrs.stroke),\n stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke),\n strokeWidth: 1\n });\n }\n\n return gateway;\n },\n 'bpmn:Gateway': function(parentGfx, element, attrs = {}) {\n attrs = pickAttrs(attrs, [\n 'fill',\n 'stroke'\n ]);\n\n return renderGateway(parentGfx, element, attrs);\n },\n 'bpmn:Group': function(parentGfx, element, attrs = {}) {\n attrs = pickAttrs(attrs, [\n 'fill',\n 'stroke',\n 'width',\n 'height'\n ]);\n\n return drawRect(parentGfx, element.width, element.height, TASK_BORDER_RADIUS, {\n stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke),\n strokeWidth: 1.5,\n strokeDasharray: '10, 6, 0, 6',\n fill: 'none',\n pointerEvents: 'none',\n width: getWidth(element, attrs),\n height: getHeight(element, attrs)\n });\n },\n 'bpmn:InclusiveGateway': function(parentGfx, element, attrs = {}) {\n attrs = pickAttrs(attrs, [\n 'fill',\n 'stroke'\n ]);\n\n var gateway = renderGateway(parentGfx, element, attrs);\n\n drawCircle(parentGfx, element.width, element.height, element.height * 0.24, {\n fill: getFillColor(element, defaultFillColor, attrs.fill),\n stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke),\n strokeWidth: 2.5\n });\n\n return gateway;\n },\n 'bpmn:IntermediateEvent': function(parentGfx, element, attrs = {}) {\n var { renderIcon = true } = attrs;\n\n attrs = pickAttrs(attrs, [\n 'fill',\n 'stroke'\n ]);\n\n var outer = renderEvent(parentGfx, element, {\n ...attrs,\n strokeWidth: 1.5\n });\n\n drawCircle(parentGfx, element.width, element.height, INNER_OUTER_DIST, {\n fill: 'none',\n stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke),\n strokeWidth: 1.5\n });\n\n if (renderIcon) {\n renderEventIcon(element, parentGfx, attrs);\n }\n\n return outer;\n },\n 'bpmn:IntermediateCatchEvent': as('bpmn:IntermediateEvent'),\n 'bpmn:IntermediateThrowEvent': as('bpmn:IntermediateEvent'),\n 'bpmn:Lane': function(parentGfx, element, attrs = {}) {\n attrs = pickAttrs(attrs, [\n 'fill',\n 'stroke',\n 'width',\n 'height'\n ]);\n\n return renderLane(parentGfx, element, {\n ...attrs,\n fillOpacity: LOW_OPACITY\n });\n },\n 'bpmn:ManualTask': function(parentGfx, element, attrs = {}) {\n attrs = pickAttrs(attrs, [\n 'fill',\n 'stroke'\n ]);\n\n var task = renderTask(parentGfx, element, attrs);\n\n var pathData = pathMap.getScaledPath('TASK_TYPE_MANUAL', {\n abspos: {\n x: 17,\n y: 15\n }\n });\n\n drawPath(parentGfx, pathData, {\n fill: getFillColor(element, defaultFillColor, attrs.fill),\n stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke),\n strokeWidth: 0.5\n });\n\n return task;\n },\n 'bpmn:MessageFlow': function(parentGfx, element, attrs = {}) {\n attrs = pickAttrs(attrs, [\n 'fill',\n 'stroke'\n ]);\n\n var semantic = getSemantic(element),\n di = getDi(element);\n\n var fill = getFillColor(element, defaultFillColor, attrs.fill),\n stroke = getStrokeColor(element, defaultStrokeColor, attrs.stroke);\n\n var path = drawConnectionSegments(parentGfx, element.waypoints, {\n markerEnd: marker(parentGfx, 'messageflow-end', fill, stroke),\n markerStart: marker(parentGfx, 'messageflow-start', fill, stroke),\n stroke,\n strokeDasharray: '10, 11',\n strokeWidth: 1.5\n });\n\n if (semantic.get('messageRef')) {\n var midPoint = path.getPointAtLength(path.getTotalLength() / 2);\n\n var markerPathData = pathMap.getScaledPath('MESSAGE_FLOW_MARKER', {\n abspos: {\n x: midPoint.x,\n y: midPoint.y\n }\n });\n\n var messageAttrs = {\n strokeWidth: 1\n };\n\n if (di.get('messageVisibleKind') === 'initiating') {\n messageAttrs.fill = fill;\n messageAttrs.stroke = stroke;\n } else {\n messageAttrs.fill = stroke;\n messageAttrs.stroke = fill;\n }\n\n var message = drawPath(parentGfx, markerPathData, messageAttrs);\n\n var messageRef = semantic.get('messageRef'),\n name = messageRef.get('name');\n\n var label = renderLabel(parentGfx, name, {\n align: 'center-top',\n fitBox: true,\n style: {\n fill: stroke\n }\n });\n\n var messageBounds = message.getBBox(),\n labelBounds = label.getBBox();\n\n var translateX = midPoint.x - labelBounds.width / 2,\n translateY = midPoint.y + messageBounds.height / 2 + ELEMENT_LABEL_DISTANCE;\n\n transform(label, translateX, translateY, 0);\n }\n\n return path;\n },\n 'bpmn:ParallelGateway': function(parentGfx, element, attrs = {}) {\n attrs = pickAttrs(attrs, [\n 'fill',\n 'stroke'\n ]);\n\n var diamond = renderGateway(parentGfx, element, attrs);\n\n var pathData = pathMap.getScaledPath('GATEWAY_PARALLEL', {\n xScaleFactor: 0.6,\n yScaleFactor: 0.6,\n containerWidth: element.width,\n containerHeight: element.height,\n position: {\n mx: 0.46,\n my: 0.2\n }\n });\n\n drawPath(parentGfx, pathData, {\n fill: getStrokeColor(element, defaultStrokeColor, attrs.stroke),\n stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke),\n strokeWidth: 1\n });\n\n return diamond;\n },\n 'bpmn:Participant': function(parentGfx, element, attrs = {}) {\n attrs = pickAttrs(attrs, [\n 'fill',\n 'stroke',\n 'width',\n 'height'\n ]);\n\n var participant = renderLane(parentGfx, element, attrs);\n\n var expandedParticipant = isExpanded(element);\n var horizontalParticipant = isHorizontal(element);\n\n var semantic = getSemantic(element),\n name = semantic.get('name');\n\n if (expandedParticipant) {\n var waypoints = horizontalParticipant ? [\n {\n x: 30,\n y: 0\n },\n {\n x: 30,\n y: getHeight(element, attrs)\n }\n ] : [\n {\n x: 0,\n y: 30\n },\n {\n x: getWidth(element, attrs),\n y: 30\n }\n ];\n\n drawLine(parentGfx, waypoints, {\n stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke),\n strokeWidth: PARTICIPANT_STROKE_WIDTH\n });\n\n renderLaneLabel(parentGfx, name, element, attrs);\n } else {\n var bounds = getBounds(element, attrs);\n\n if (!horizontalParticipant) {\n bounds.height = getWidth(element, attrs);\n bounds.width = getHeight(element, attrs);\n }\n\n var textBox = renderLabel(parentGfx, name, {\n box: bounds,\n align: 'center-middle',\n style: {\n fill: getLabelColor(element, defaultLabelColor, defaultStrokeColor, attrs.stroke)\n }\n });\n\n if (!horizontalParticipant) {\n var top = -1 * getHeight(element, attrs);\n transform(textBox, 0, -top, 270);\n }\n }\n\n if (semantic.get('participantMultiplicity')) {\n renderTaskMarker('ParticipantMultiplicityMarker', parentGfx, element, attrs);\n }\n\n return participant;\n },\n 'bpmn:ReceiveTask' : function(parentGfx, element, attrs = {}) {\n attrs = pickAttrs(attrs, [\n 'fill',\n 'stroke'\n ]);\n\n var semantic = getSemantic(element);\n\n var task = renderTask(parentGfx, element, attrs);\n\n var pathData;\n\n if (semantic.get('instantiate')) {\n drawCircle(parentGfx, 28, 28, 20 * 0.22, {\n fill: getFillColor(element, defaultFillColor, attrs.fill),\n stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke),\n strokeWidth: 1\n });\n\n pathData = pathMap.getScaledPath('TASK_TYPE_INSTANTIATING_SEND', {\n abspos: {\n x: 7.77,\n y: 9.52\n }\n });\n } else {\n pathData = pathMap.getScaledPath('TASK_TYPE_SEND', {\n xScaleFactor: 0.9,\n yScaleFactor: 0.9,\n containerWidth: 21,\n containerHeight: 14,\n position: {\n mx: 0.3,\n my: 0.4\n }\n });\n }\n\n drawPath(parentGfx, pathData, {\n fill: getFillColor(element, defaultFillColor, attrs.fill),\n stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke),\n strokeWidth: 1\n });\n\n return task;\n },\n 'bpmn:ScriptTask': function(parentGfx, element, attrs = {}) {\n attrs = pickAttrs(attrs, [\n 'fill',\n 'stroke'\n ]);\n\n var task = renderTask(parentGfx, element, attrs);\n\n var pathData = pathMap.getScaledPath('TASK_TYPE_SCRIPT', {\n abspos: {\n x: 15,\n y: 20\n }\n });\n\n drawPath(parentGfx, pathData, {\n fill: getFillColor(element, defaultFillColor, attrs.fill),\n stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke),\n strokeWidth: 1\n });\n\n return task;\n },\n 'bpmn:SendTask': function(parentGfx, element, attrs = {}) {\n attrs = pickAttrs(attrs, [\n 'fill',\n 'stroke'\n ]);\n\n var task = renderTask(parentGfx, element, attrs);\n\n var pathData = pathMap.getScaledPath('TASK_TYPE_SEND', {\n xScaleFactor: 1,\n yScaleFactor: 1,\n containerWidth: 21,\n containerHeight: 14,\n position: {\n mx: 0.285,\n my: 0.357\n }\n });\n\n drawPath(parentGfx, pathData, {\n fill: getStrokeColor(element, defaultStrokeColor, attrs.stroke),\n stroke: getFillColor(element, defaultFillColor, attrs.fill),\n strokeWidth: 1\n });\n\n return task;\n },\n 'bpmn:SequenceFlow': function(parentGfx, element, attrs = {}) {\n attrs = pickAttrs(attrs, [\n 'fill',\n 'stroke'\n ]);\n\n var fill = getFillColor(element, defaultFillColor, attrs.fill),\n stroke = getStrokeColor(element, defaultStrokeColor, attrs.stroke);\n\n var connection = drawConnectionSegments(parentGfx, element.waypoints, {\n markerEnd: marker(parentGfx, 'sequenceflow-end', fill, stroke),\n stroke\n });\n\n var semantic = getSemantic(element);\n\n var { source } = element;\n\n if (source) {\n var sourceSemantic = getSemantic(source);\n\n // conditional flow marker\n if (semantic.get('conditionExpression') && is(sourceSemantic, 'bpmn:Activity')) {\n svgAttr(connection, {\n markerStart: marker(parentGfx, 'conditional-flow-marker', fill, stroke)\n });\n }\n\n // default marker\n if (sourceSemantic.get('default') && (is(sourceSemantic, 'bpmn:Gateway') || is(sourceSemantic, 'bpmn:Activity')) &&\n sourceSemantic.get('default') === semantic) {\n svgAttr(connection, {\n markerStart: marker(parentGfx, 'conditional-default-flow-marker', fill, stroke)\n });\n }\n }\n\n return connection;\n },\n 'bpmn:ServiceTask': function(parentGfx, element, attrs = {}) {\n attrs = pickAttrs(attrs, [\n 'fill',\n 'stroke'\n ]);\n\n var task = renderTask(parentGfx, element, attrs);\n\n drawCircle(parentGfx, 10, 10, {\n fill: getFillColor(element, defaultFillColor, attrs.fill),\n stroke: 'none',\n transform: 'translate(6, 6)'\n });\n\n var pathDataService1 = pathMap.getScaledPath('TASK_TYPE_SERVICE', {\n abspos: {\n x: 12,\n y: 18\n }\n });\n\n drawPath(parentGfx, pathDataService1, {\n fill: getFillColor(element, defaultFillColor, attrs.fill),\n stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke),\n strokeWidth: 1\n });\n\n drawCircle(parentGfx, 10, 10, {\n fill: getFillColor(element, defaultFillColor, attrs.fill),\n stroke: 'none',\n transform: 'translate(11, 10)'\n });\n\n var pathDataService2 = pathMap.getScaledPath('TASK_TYPE_SERVICE', {\n abspos: {\n x: 17,\n y: 22\n }\n });\n\n drawPath(parentGfx, pathDataService2, {\n fill: getFillColor(element, defaultFillColor, attrs.fill),\n stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke),\n strokeWidth: 1\n });\n\n return task;\n },\n 'bpmn:StartEvent': function(parentGfx, element, attrs = {}) {\n var { renderIcon = true } = attrs;\n\n attrs = pickAttrs(attrs, [\n 'fill',\n 'stroke'\n ]);\n\n var semantic = getSemantic(element);\n\n if (!semantic.get('isInterrupting')) {\n attrs = {\n ...attrs,\n strokeDasharray: '6'\n };\n }\n\n var event = renderEvent(parentGfx, element, attrs);\n\n if (renderIcon) {\n renderEventIcon(element, parentGfx, attrs);\n }\n\n return event;\n },\n 'bpmn:SubProcess': function(parentGfx, element, attrs = {}) {\n if (isExpanded(element)) {\n attrs = pickAttrs(attrs, [\n 'fill',\n 'stroke',\n 'width',\n 'height'\n ]);\n } else {\n attrs = pickAttrs(attrs, [\n 'fill',\n 'stroke'\n ]);\n }\n\n return renderSubProcess(parentGfx, element, attrs);\n },\n 'bpmn:Task': function(parentGfx, element, attrs = {}) {\n attrs = pickAttrs(attrs, [\n 'fill',\n 'stroke'\n ]);\n\n return renderTask(parentGfx, element, attrs);\n },\n 'bpmn:TextAnnotation': function(parentGfx, element, attrs = {}) {\n attrs = pickAttrs(attrs, [\n 'fill',\n 'stroke',\n 'width',\n 'height'\n ]);\n\n var {\n width,\n height\n } = getBounds(element, attrs);\n\n var textElement = drawRect(parentGfx, width, height, 0, 0, {\n fill: 'none',\n stroke: 'none'\n });\n\n var textPathData = pathMap.getScaledPath('TEXT_ANNOTATION', {\n xScaleFactor: 1,\n yScaleFactor: 1,\n containerWidth: width,\n containerHeight: height,\n position: {\n mx: 0.0,\n my: 0.0\n }\n });\n\n drawPath(parentGfx, textPathData, {\n stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke)\n });\n\n var semantic = getSemantic(element),\n text = semantic.get('text') || '';\n\n renderLabel(parentGfx, text, {\n align: 'left-top',\n box: getBounds(element, attrs),\n padding: 7,\n style: {\n fill: getLabelColor(element, defaultLabelColor, defaultStrokeColor, attrs.stroke)\n }\n });\n\n return textElement;\n },\n 'bpmn:Transaction': function(parentGfx, element, attrs = {}) {\n if (isExpanded(element)) {\n attrs = pickAttrs(attrs, [\n 'fill',\n 'stroke',\n 'width',\n 'height'\n ]);\n } else {\n attrs = pickAttrs(attrs, [\n 'fill',\n 'stroke'\n ]);\n }\n\n var outer = renderSubProcess(parentGfx, element, {\n strokeWidth: 1.5,\n ...attrs\n });\n\n var innerAttrs = styles.style([ 'no-fill', 'no-events' ], {\n stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke),\n strokeWidth: 1.5\n });\n\n var expanded = isExpanded(element);\n\n if (!expanded) {\n attrs = {};\n }\n\n drawRect(\n parentGfx,\n getWidth(element, attrs),\n getHeight(element, attrs),\n TASK_BORDER_RADIUS - INNER_OUTER_DIST,\n INNER_OUTER_DIST,\n innerAttrs\n );\n\n return outer;\n },\n 'bpmn:UserTask': function(parentGfx, element, attrs = {}) {\n attrs = pickAttrs(attrs, [\n 'fill',\n 'stroke'\n ]);\n\n var task = renderTask(parentGfx, element, attrs);\n\n var x = 15;\n var y = 12;\n\n var pathDataUser1 = pathMap.getScaledPath('TASK_TYPE_USER_1', {\n abspos: {\n x: x,\n y: y\n }\n });\n\n drawPath(parentGfx, pathDataUser1, {\n fill: getFillColor(element, defaultFillColor, attrs.fill),\n stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke),\n strokeWidth: 0.5\n });\n\n var pathDataUser2 = pathMap.getScaledPath('TASK_TYPE_USER_2', {\n abspos: {\n x: x,\n y: y\n }\n });\n\n drawPath(parentGfx, pathDataUser2, {\n fill: getFillColor(element, defaultFillColor, attrs.fill),\n stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke),\n strokeWidth: 0.5\n });\n\n var pathDataUser3 = pathMap.getScaledPath('TASK_TYPE_USER_3', {\n abspos: {\n x: x,\n y: y\n }\n });\n\n drawPath(parentGfx, pathDataUser3, {\n fill: getStrokeColor(element, defaultStrokeColor, attrs.stroke),\n stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke),\n strokeWidth: 0.5\n });\n\n return task;\n },\n 'label': function(parentGfx, element, attrs = {}) {\n return renderExternalLabel(parentGfx, element, attrs);\n }\n };\n\n // extension API, use at your own risk\n this._drawPath = drawPath;\n\n this._renderer = renderer;\n}\n\n\ninherits(BpmnRenderer, BaseRenderer);\n\nBpmnRenderer.$inject = [\n 'config.bpmnRenderer',\n 'eventBus',\n 'styles',\n 'pathMap',\n 'canvas',\n 'textRenderer'\n];\n\n\n/**\n * @param {Element} element\n *\n * @return {boolean}\n */\nBpmnRenderer.prototype.canRender = function(element) {\n return is(element, 'bpmn:BaseElement');\n};\n\n/**\n * Draw shape into parentGfx.\n *\n * @param {SVGElement} parentGfx\n * @param {Shape} shape\n * @param {Attrs} [attrs]\n *\n * @return {SVGElement} mainGfx\n */\nBpmnRenderer.prototype.drawShape = function(parentGfx, shape, attrs = {}) {\n var { type } = shape;\n\n var handler = this._renderer(type);\n\n return handler(parentGfx, shape, attrs);\n};\n\n/**\n * Draw connection into parentGfx.\n *\n * @param {SVGElement} parentGfx\n * @param {Connection} connection\n * @param {Attrs} [attrs]\n *\n * @return {SVGElement} mainGfx\n */\nBpmnRenderer.prototype.drawConnection = function(parentGfx, connection, attrs = {}) {\n var { type } = connection;\n\n var handler = this._renderer(type);\n\n return handler(parentGfx, connection, attrs);\n};\n\n/**\n * Get shape path.\n *\n * @param {Shape} shape\n *\n * @return {string} path\n */\nBpmnRenderer.prototype.getShapePath = function(shape) {\n if (is(shape, 'bpmn:Event')) {\n return getCirclePath(shape);\n }\n\n if (is(shape, 'bpmn:Activity')) {\n return getRoundRectPath(shape, TASK_BORDER_RADIUS);\n }\n\n if (is(shape, 'bpmn:Gateway')) {\n return getDiamondPath(shape);\n }\n\n return getRectPath(shape);\n};\n\n/**\n * Pick attributes if they exist.\n *\n * @param {Object} attrs\n * @param {string[]} keys\n *\n * @returns {Object}\n */\nfunction pickAttrs(attrs, keys = []) {\n return keys.reduce((pickedAttrs, key) => {\n if (attrs[ key ]) {\n pickedAttrs[ key ] = attrs[ key ];\n }\n\n return pickedAttrs;\n }, {});\n}", "import {\n isObject,\n assign,\n forEach,\n reduce\n} from 'min-dash';\n\nimport {\n append as svgAppend,\n attr as svgAttr,\n create as svgCreate,\n remove as svgRemove\n} from 'tiny-svg';\n\nimport {\n assignStyle\n} from 'min-dom';\n\n\n/**\n * @typedef {import('../util/Types').Dimensions} Dimensions\n *\n * @typedef { {\n * top: number;\n * left: number;\n * right: number;\n * bottom: number;\n * } } Padding\n *\n * @typedef { number | Partial } PaddingConfig\n *\n * @typedef { {\n * horizontal: 'center' | 'left' | 'right';\n * vertical: 'top' | 'middle';\n * } } Alignment\n *\n * @typedef { 'center-middle' | 'center-top' } AlignmentConfig\n *\n * @typedef { Partial<{\n * align: AlignmentConfig;\n * style: Record;\n * padding: PaddingConfig;\n * }> } BaseTextConfig\n *\n * @typedef { BaseTextConfig & Partial<{\n * size: Dimensions;\n * }> } TextConfig\n *\n * @typedef { BaseTextConfig & Partial<{\n * box: Dimensions;\n * fitBox: boolean;\n * }> } TextLayoutConfig\n *\n * @typedef { Dimensions & {\n * text: string;\n * } } LineDescriptor\n */\n\nvar DEFAULT_BOX_PADDING = 0;\n\nvar DEFAULT_LABEL_SIZE = {\n width: 150,\n height: 50\n};\n\n\n/**\n * @param {AlignmentConfig} align\n * @return {Alignment}\n */\nfunction parseAlign(align) {\n\n var parts = align.split('-');\n\n return {\n horizontal: parts[0] || 'center',\n vertical: parts[1] || 'top'\n };\n}\n\n/**\n * @param {PaddingConfig} padding\n *\n * @return {Padding}\n */\nfunction parsePadding(padding) {\n\n if (isObject(padding)) {\n return assign({ top: 0, left: 0, right: 0, bottom: 0 }, padding);\n } else {\n return {\n top: padding,\n left: padding,\n right: padding,\n bottom: padding\n };\n }\n}\n\n/**\n * @param {string} text\n * @param {SVGTextElement} fakeText\n *\n * @return {import('../util/Types').Dimensions}\n */\nfunction getTextBBox(text, fakeText) {\n\n fakeText.textContent = text;\n\n var textBBox;\n\n try {\n var bbox,\n emptyLine = text === '';\n\n // add dummy text, when line is empty to\n // determine correct height\n fakeText.textContent = emptyLine ? 'dummy' : text;\n\n textBBox = fakeText.getBBox();\n\n // take text rendering related horizontal\n // padding into account\n bbox = {\n width: textBBox.width + textBBox.x * 2,\n height: textBBox.height\n };\n\n if (emptyLine) {\n\n // correct width\n bbox.width = 0;\n }\n\n return bbox;\n } catch (e) {\n return { width: 0, height: 0 };\n }\n}\n\n\n/**\n * Layout the next line and return the layouted element.\n *\n * Alters the lines passed.\n *\n * @param {string[]} lines\n * @param {number} maxWidth\n * @param {SVGTextElement} fakeText\n *\n * @return {LineDescriptor} the line descriptor\n */\nfunction layoutNext(lines, maxWidth, fakeText) {\n\n var originalLine = lines.shift(),\n fitLine = originalLine;\n\n var textBBox;\n\n for (;;) {\n textBBox = getTextBBox(fitLine, fakeText);\n\n textBBox.width = fitLine ? textBBox.width : 0;\n\n // try to fit\n if (fitLine === ' ' || fitLine === '' || textBBox.width < Math.round(maxWidth) || fitLine.length < 2) {\n return fit(lines, fitLine, originalLine, textBBox);\n }\n\n fitLine = shortenLine(fitLine, textBBox.width, maxWidth);\n }\n}\n\n/**\n * @param {string[]} lines\n * @param {string} fitLine\n * @param {string} originalLine\n * @param {Dimensions} textBBox\n *\n * @return {LineDescriptor}\n */\nfunction fit(lines, fitLine, originalLine, textBBox) {\n if (fitLine.length < originalLine.length) {\n var remainder = originalLine.slice(fitLine.length).trim();\n\n lines.unshift(remainder);\n }\n\n return {\n width: textBBox.width,\n height: textBBox.height,\n text: fitLine\n };\n}\n\nvar SOFT_BREAK = '\\u00AD';\n\n\n/**\n * Shortens a line based on spacing and hyphens.\n * Returns the shortened result on success.\n *\n * @param {string} line\n * @param {number} maxLength the maximum characters of the string\n *\n * @return {string} the shortened string\n */\nfunction semanticShorten(line, maxLength) {\n\n var parts = line.split(/(\\s|-|\\u00AD)/g),\n part,\n shortenedParts = [],\n length = 0;\n\n // try to shorten via break chars\n if (parts.length > 1) {\n\n while ((part = parts.shift())) {\n if (part.length + length < maxLength) {\n shortenedParts.push(part);\n length += part.length;\n } else {\n\n // remove previous part, too if hyphen does not fit anymore\n if (part === '-' || part === SOFT_BREAK) {\n shortenedParts.pop();\n }\n\n break;\n }\n }\n }\n\n var last = shortenedParts[shortenedParts.length - 1];\n\n // translate trailing soft break to actual hyphen\n if (last && last === SOFT_BREAK) {\n shortenedParts[shortenedParts.length - 1] = '-';\n }\n\n return shortenedParts.join('');\n}\n\n\n/**\n * @param {string} line\n * @param {number} width\n * @param {number} maxWidth\n *\n * @return {string}\n */\nfunction shortenLine(line, width, maxWidth) {\n var length = Math.max(line.length * (maxWidth / width), 1);\n\n // try to shorten semantically (i.e. based on spaces and hyphens)\n var shortenedLine = semanticShorten(line, length);\n\n if (!shortenedLine) {\n\n // force shorten by cutting the long word\n shortenedLine = line.slice(0, Math.max(Math.round(length - 1), 1));\n }\n\n return shortenedLine;\n}\n\n\n/**\n * @return {SVGSVGElement}\n */\nfunction getHelperSvg() {\n var helperSvg = document.getElementById('helper-svg');\n\n if (!helperSvg) {\n helperSvg = svgCreate('svg');\n\n svgAttr(helperSvg, {\n id: 'helper-svg'\n });\n\n assignStyle(helperSvg, {\n visibility: 'hidden',\n position: 'fixed',\n width: 0,\n height: 0\n });\n\n document.body.appendChild(helperSvg);\n }\n\n return helperSvg;\n}\n\n\n/**\n * Creates a new label utility\n *\n * @param {TextConfig} [config]\n */\nexport default function Text(config) {\n\n this._config = assign({}, {\n size: DEFAULT_LABEL_SIZE,\n padding: DEFAULT_BOX_PADDING,\n style: {},\n align: 'center-top'\n }, config || {});\n}\n\n/**\n * Returns the layouted text as an SVG element.\n *\n * @param {string} text\n * @param {TextLayoutConfig} options\n *\n * @return {SVGElement}\n */\nText.prototype.createText = function(text, options) {\n return this.layoutText(text, options).element;\n};\n\n/**\n * Returns a labels layouted dimensions.\n *\n * @param {string} text to layout\n * @param {TextLayoutConfig} options\n *\n * @return {Dimensions}\n */\nText.prototype.getDimensions = function(text, options) {\n return this.layoutText(text, options).dimensions;\n};\n\n/**\n * Creates and returns a label and its bounding box.\n *\n * @param {string} text the text to render on the label\n * @param {TextLayoutConfig} options\n *\n * @return { {\n * element: SVGElement,\n * dimensions: Dimensions\n * } }\n */\nText.prototype.layoutText = function(text, options) {\n var box = assign({}, this._config.size, options.box),\n style = assign({}, this._config.style, options.style),\n align = parseAlign(options.align || this._config.align),\n padding = parsePadding(options.padding !== undefined ? options.padding : this._config.padding),\n fitBox = options.fitBox || false;\n\n var lineHeight = getLineHeight(style);\n\n // we split text by lines and normalize\n // {soft break} + {line break} => { line break }\n var lines = text.split(/\\u00AD?\\r?\\n/),\n layouted = [];\n\n var maxWidth = box.width - padding.left - padding.right;\n\n // ensure correct rendering by attaching helper text node to invisible SVG\n var helperText = svgCreate('text');\n svgAttr(helperText, { x: 0, y: 0 });\n svgAttr(helperText, style);\n\n var helperSvg = getHelperSvg();\n\n svgAppend(helperSvg, helperText);\n\n while (lines.length) {\n layouted.push(layoutNext(lines, maxWidth, helperText));\n }\n\n if (align.vertical === 'middle') {\n padding.top = padding.bottom = 0;\n }\n\n var totalHeight = reduce(layouted, function(sum, line, idx) {\n return sum + (lineHeight || line.height);\n }, 0) + padding.top + padding.bottom;\n\n var maxLineWidth = reduce(layouted, function(sum, line, idx) {\n return line.width > sum ? line.width : sum;\n }, 0);\n\n // the y position of the next line\n var y = padding.top;\n\n if (align.vertical === 'middle') {\n y += (box.height - totalHeight) / 2;\n }\n\n // magic number initial offset\n y -= (lineHeight || layouted[0].height) / 4;\n\n\n var textElement = svgCreate('text');\n\n svgAttr(textElement, style);\n\n // layout each line taking into account that parent\n // shape might resize to fit text size\n forEach(layouted, function(line) {\n\n var x;\n\n y += (lineHeight || line.height);\n\n switch (align.horizontal) {\n case 'left':\n x = padding.left;\n break;\n\n case 'right':\n x = ((fitBox ? maxLineWidth : maxWidth)\n - padding.right - line.width);\n break;\n\n default:\n\n // aka center\n x = Math.max((((fitBox ? maxLineWidth : maxWidth)\n - line.width) / 2 + padding.left), 0);\n }\n\n var tspan = svgCreate('tspan');\n svgAttr(tspan, { x: x, y: y });\n\n tspan.textContent = line.text;\n\n svgAppend(textElement, tspan);\n });\n\n svgRemove(helperText);\n\n var dimensions = {\n width: maxLineWidth,\n height: totalHeight\n };\n\n return {\n dimensions: dimensions,\n element: textElement\n };\n};\n\n\nfunction getLineHeight(style) {\n if ('fontSize' in style && 'lineHeight' in style) {\n return style.lineHeight * parseInt(style.fontSize, 10);\n }\n}\n", "import { assign } from 'min-dash';\n\nimport TextUtil from 'diagram-js/lib/util/Text';\n\nvar DEFAULT_FONT_SIZE = 12;\nvar LINE_HEIGHT_RATIO = 1.2;\n\nvar MIN_TEXT_ANNOTATION_HEIGHT = 30;\n\n/**\n * @typedef { {\n * fontFamily: string;\n * fontSize: number;\n * fontWeight: string;\n * lineHeight: number;\n * } } TextRendererStyle\n *\n * @typedef { {\n * defaultStyle?: Partial;\n * externalStyle?: Partial;\n * } } TextRendererConfig\n *\n * @typedef { import('diagram-js/lib/util/Text').TextLayoutConfig } TextLayoutConfig\n *\n * @typedef { import('diagram-js/lib/util/Types').Rect } Rect\n */\n\n\n/**\n * Renders text and computes text bounding boxes.\n *\n * @param {TextRendererConfig} [config]\n */\nexport default function TextRenderer(config) {\n\n var defaultStyle = assign({\n fontFamily: 'Arial, sans-serif',\n fontSize: DEFAULT_FONT_SIZE,\n fontWeight: 'normal',\n lineHeight: LINE_HEIGHT_RATIO\n }, config && config.defaultStyle || {});\n\n var fontSize = parseInt(defaultStyle.fontSize, 10) - 1;\n\n var externalStyle = assign({}, defaultStyle, {\n fontSize: fontSize\n }, config && config.externalStyle || {});\n\n var textUtil = new TextUtil({\n style: defaultStyle\n });\n\n /**\n * Get the new bounds of an externally rendered,\n * layouted label.\n *\n * @param {Rect} bounds\n * @param {string} text\n *\n * @return {Rect}\n */\n this.getExternalLabelBounds = function(bounds, text) {\n\n var layoutedDimensions = textUtil.getDimensions(text, {\n box: {\n width: 90,\n height: 30\n },\n style: externalStyle\n });\n\n // resize label shape to fit label text\n return {\n x: Math.round(bounds.x + bounds.width / 2 - layoutedDimensions.width / 2),\n y: Math.round(bounds.y),\n width: Math.ceil(layoutedDimensions.width),\n height: Math.ceil(layoutedDimensions.height)\n };\n\n };\n\n /**\n * Get the new bounds of text annotation.\n *\n * @param {Rect} bounds\n * @param {string} text\n *\n * @return {Rect}\n */\n this.getTextAnnotationBounds = function(bounds, text) {\n\n var layoutedDimensions = textUtil.getDimensions(text, {\n box: bounds,\n style: defaultStyle,\n align: 'left-top',\n padding: 5\n });\n\n return {\n x: bounds.x,\n y: bounds.y,\n width: bounds.width,\n height: Math.max(MIN_TEXT_ANNOTATION_HEIGHT, Math.round(layoutedDimensions.height))\n };\n };\n\n /**\n * Create a layouted text element.\n *\n * @param {string} text\n * @param {TextLayoutConfig} [options]\n *\n * @return {SVGElement} rendered text\n */\n this.createText = function(text, options) {\n return textUtil.createText(text, options || {});\n };\n\n /**\n * Get default text style.\n */\n this.getDefaultStyle = function() {\n return defaultStyle;\n };\n\n /**\n * Get the external text style.\n */\n this.getExternalStyle = function() {\n return externalStyle;\n };\n\n}\n\nTextRenderer.$inject = [\n 'config.textRenderer'\n];", "/**\n * Map containing SVG paths needed by BpmnRenderer\n */\nexport default function PathMap() {\n\n /**\n * Contains a map of path elements\n *\n *

    Path definition

    \n * A parameterized path is defined like this:\n *
    \n   * 'GATEWAY_PARALLEL': {\n   *   d: 'm {mx},{my} {e.x0},0 0,{e.x1} {e.x1},0 0,{e.y0} -{e.x1},0 0,{e.y1} ' +\n          '-{e.x0},0 0,-{e.y1} -{e.x1},0 0,-{e.y0} {e.x1},0 z',\n   *   height: 17.5,\n   *   width:  17.5,\n   *   heightElements: [2.5, 7.5],\n   *   widthElements: [2.5, 7.5]\n   * }\n   * 
    \n *

    It's important to specify a correct height and width for the path as the scaling\n * is based on the ratio between the specified height and width in this object and the\n * height and width that is set as scale target (Note x,y coordinates will be scaled with\n * individual ratios).

    \n *

    The 'heightElements' and 'widthElements' array must contain the values that will be scaled.\n * The scaling is based on the computed ratios.\n * Coordinates on the y axis should be in the heightElement's array, they will be scaled using\n * the computed ratio coefficient.\n * In the parameterized path the scaled values can be accessed through the 'e' object in {} brackets.\n *

      \n *
    • The values for the y axis can be accessed in the path string using {e.y0}, {e.y1}, ....
    • \n *
    • The values for the x axis can be accessed in the path string using {e.x0}, {e.x1}, ....
    • \n *
    \n * The numbers x0, x1 respectively y0, y1, ... map to the corresponding array index.\n *

    \n */\n this.pathMap = {\n 'EVENT_MESSAGE': {\n d: 'm {mx},{my} l 0,{e.y1} l {e.x1},0 l 0,-{e.y1} z l {e.x0},{e.y0} l {e.x0},-{e.y0}',\n height: 36,\n width: 36,\n heightElements: [ 6, 14 ],\n widthElements: [ 10.5, 21 ]\n },\n 'EVENT_SIGNAL': {\n d: 'M {mx},{my} l {e.x0},{e.y0} l -{e.x1},0 Z',\n height: 36,\n width: 36,\n heightElements: [ 18 ],\n widthElements: [ 10, 20 ]\n },\n 'EVENT_ESCALATION': {\n d: 'M {mx},{my} l {e.x0},{e.y0} l -{e.x0},-{e.y1} l -{e.x0},{e.y1} Z',\n height: 36,\n width: 36,\n heightElements: [ 20, 7 ],\n widthElements: [ 8 ]\n },\n 'EVENT_CONDITIONAL': {\n d: 'M {e.x0},{e.y0} l {e.x1},0 l 0,{e.y2} l -{e.x1},0 Z ' +\n 'M {e.x2},{e.y3} l {e.x0},0 ' +\n 'M {e.x2},{e.y4} l {e.x0},0 ' +\n 'M {e.x2},{e.y5} l {e.x0},0 ' +\n 'M {e.x2},{e.y6} l {e.x0},0 ' +\n 'M {e.x2},{e.y7} l {e.x0},0 ' +\n 'M {e.x2},{e.y8} l {e.x0},0 ',\n height: 36,\n width: 36,\n heightElements: [ 8.5, 14.5, 18, 11.5, 14.5, 17.5, 20.5, 23.5, 26.5 ],\n widthElements: [ 10.5, 14.5, 12.5 ]\n },\n 'EVENT_LINK': {\n d: 'm {mx},{my} 0,{e.y0} -{e.x1},0 0,{e.y1} {e.x1},0 0,{e.y0} {e.x0},-{e.y2} -{e.x0},-{e.y2} z',\n height: 36,\n width: 36,\n heightElements: [ 4.4375, 6.75, 7.8125 ],\n widthElements: [ 9.84375, 13.5 ]\n },\n 'EVENT_ERROR': {\n d: 'm {mx},{my} {e.x0},-{e.y0} {e.x1},-{e.y1} {e.x2},{e.y2} {e.x3},-{e.y3} -{e.x4},{e.y4} -{e.x5},-{e.y5} z',\n height: 36,\n width: 36,\n heightElements: [ 0.023, 8.737, 8.151, 16.564, 10.591, 8.714 ],\n widthElements: [ 0.085, 6.672, 6.97, 4.273, 5.337, 6.636 ]\n },\n 'EVENT_CANCEL_45': {\n d: 'm {mx},{my} -{e.x1},0 0,{e.x0} {e.x1},0 0,{e.y1} {e.x0},0 ' +\n '0,-{e.y1} {e.x1},0 0,-{e.y0} -{e.x1},0 0,-{e.y1} -{e.x0},0 z',\n height: 36,\n width: 36,\n heightElements: [ 4.75, 8.5 ],\n widthElements: [ 4.75, 8.5 ]\n },\n 'EVENT_COMPENSATION': {\n d: 'm {mx},{my} {e.x0},-{e.y0} 0,{e.y1} z m {e.x1},-{e.y2} {e.x2},-{e.y3} 0,{e.y1} -{e.x2},-{e.y3} z',\n height: 36,\n width: 36,\n heightElements: [ 6.5, 13, 0.4, 6.1 ],\n widthElements: [ 9, 9.3, 8.7 ]\n },\n 'EVENT_TIMER_WH': {\n d: 'M {mx},{my} l {e.x0},-{e.y0} m -{e.x0},{e.y0} l {e.x1},{e.y1} ',\n height: 36,\n width: 36,\n heightElements: [ 10, 2 ],\n widthElements: [ 3, 7 ]\n },\n 'EVENT_TIMER_LINE': {\n d: 'M {mx},{my} ' +\n 'm {e.x0},{e.y0} l -{e.x1},{e.y1} ',\n height: 36,\n width: 36,\n heightElements: [ 10, 3 ],\n widthElements: [ 0, 0 ]\n },\n 'EVENT_MULTIPLE': {\n d:'m {mx},{my} {e.x1},-{e.y0} {e.x1},{e.y0} -{e.x0},{e.y1} -{e.x2},0 z',\n height: 36,\n width: 36,\n heightElements: [ 6.28099, 12.56199 ],\n widthElements: [ 3.1405, 9.42149, 12.56198 ]\n },\n 'EVENT_PARALLEL_MULTIPLE': {\n d:'m {mx},{my} {e.x0},0 0,{e.y1} {e.x1},0 0,{e.y0} -{e.x1},0 0,{e.y1} ' +\n '-{e.x0},0 0,-{e.y1} -{e.x1},0 0,-{e.y0} {e.x1},0 z',\n height: 36,\n width: 36,\n heightElements: [ 2.56228, 7.68683 ],\n widthElements: [ 2.56228, 7.68683 ]\n },\n 'GATEWAY_EXCLUSIVE': {\n d:'m {mx},{my} {e.x0},{e.y0} {e.x1},{e.y0} {e.x2},0 {e.x4},{e.y2} ' +\n '{e.x4},{e.y1} {e.x2},0 {e.x1},{e.y3} {e.x0},{e.y3} ' +\n '{e.x3},0 {e.x5},{e.y1} {e.x5},{e.y2} {e.x3},0 z',\n height: 17.5,\n width: 17.5,\n heightElements: [ 8.5, 6.5312, -6.5312, -8.5 ],\n widthElements: [ 6.5, -6.5, 3, -3, 5, -5 ]\n },\n 'GATEWAY_PARALLEL': {\n d:'m {mx},{my} 0,{e.y1} -{e.x1},0 0,{e.y0} {e.x1},0 0,{e.y1} {e.x0},0 ' +\n '0,-{e.y1} {e.x1},0 0,-{e.y0} -{e.x1},0 0,-{e.y1} -{e.x0},0 z',\n height: 30,\n width: 30,\n heightElements: [ 5, 12.5 ],\n widthElements: [ 5, 12.5 ]\n },\n 'GATEWAY_EVENT_BASED': {\n d:'m {mx},{my} {e.x0},{e.y0} {e.x0},{e.y1} {e.x1},{e.y2} {e.x2},0 z',\n height: 11,\n width: 11,\n heightElements: [ -6, 6, 12, -12 ],\n widthElements: [ 9, -3, -12 ]\n },\n 'GATEWAY_COMPLEX': {\n d:'m {mx},{my} 0,{e.y0} -{e.x0},-{e.y1} -{e.x1},{e.y2} {e.x0},{e.y1} -{e.x2},0 0,{e.y3} ' +\n '{e.x2},0 -{e.x0},{e.y1} l {e.x1},{e.y2} {e.x0},-{e.y1} 0,{e.y0} {e.x3},0 0,-{e.y0} {e.x0},{e.y1} ' +\n '{e.x1},-{e.y2} -{e.x0},-{e.y1} {e.x2},0 0,-{e.y3} -{e.x2},0 {e.x0},-{e.y1} -{e.x1},-{e.y2} ' +\n '-{e.x0},{e.y1} 0,-{e.y0} -{e.x3},0 z',\n height: 17.125,\n width: 17.125,\n heightElements: [ 4.875, 3.4375, 2.125, 3 ],\n widthElements: [ 3.4375, 2.125, 4.875, 3 ]\n },\n 'DATA_OBJECT_PATH': {\n d:'m 0,0 {e.x1},0 {e.x0},{e.y0} 0,{e.y1} -{e.x2},0 0,-{e.y2} {e.x1},0 0,{e.y0} {e.x0},0',\n height: 61,\n width: 51,\n heightElements: [ 10, 50, 60 ],\n widthElements: [ 10, 40, 50, 60 ]\n },\n 'DATA_OBJECT_COLLECTION_PATH': {\n d: 'm{mx},{my} m 3,2 l 0,10 m 3,-10 l 0,10 m 3,-10 l 0,10',\n height: 10,\n width: 10,\n heightElements: [],\n widthElements: []\n },\n 'DATA_ARROW': {\n d:'m 5,9 9,0 0,-3 5,5 -5,5 0,-3 -9,0 z',\n height: 61,\n width: 51,\n heightElements: [],\n widthElements: []\n },\n 'DATA_STORE': {\n d:'m {mx},{my} ' +\n 'l 0,{e.y2} ' +\n 'c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0 ' +\n 'l 0,-{e.y2} ' +\n 'c -{e.x0},-{e.y1} -{e.x1},-{e.y1} -{e.x2},0' +\n 'c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0 ' +\n 'm -{e.x2},{e.y0}' +\n 'c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0' +\n 'm -{e.x2},{e.y0}' +\n 'c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0',\n height: 61,\n width: 61,\n heightElements: [ 7, 10, 45 ],\n widthElements: [ 2, 58, 60 ]\n },\n 'TEXT_ANNOTATION': {\n d: 'm {mx}, {my} m 10,0 l -10,0 l 0,{e.y0} l 10,0',\n height: 30,\n width: 10,\n heightElements: [ 30 ],\n widthElements: [ 10 ]\n },\n 'MARKER_SUB_PROCESS': {\n d: 'm{mx},{my} m 7,2 l 0,10 m -5,-5 l 10,0',\n height: 10,\n width: 10,\n heightElements: [],\n widthElements: []\n },\n 'MARKER_PARALLEL': {\n d: 'm{mx},{my} m 3,2 l 0,10 m 3,-10 l 0,10 m 3,-10 l 0,10',\n height: 10,\n width: 10,\n heightElements: [],\n widthElements: []\n },\n 'MARKER_SEQUENTIAL': {\n d: 'm{mx},{my} m 0,3 l 10,0 m -10,3 l 10,0 m -10,3 l 10,0',\n height: 10,\n width: 10,\n heightElements: [],\n widthElements: []\n },\n 'MARKER_COMPENSATION': {\n d: 'm {mx},{my} 7,-5 0,10 z m 7.1,-0.3 6.9,-4.7 0,10 -6.9,-4.7 z',\n height: 10,\n width: 21,\n heightElements: [],\n widthElements: []\n },\n 'MARKER_LOOP': {\n d: 'm {mx},{my} c 3.526979,0 6.386161,-2.829858 6.386161,-6.320661 0,-3.490806 -2.859182,-6.320661 ' +\n '-6.386161,-6.320661 -3.526978,0 -6.38616,2.829855 -6.38616,6.320661 0,1.745402 ' +\n '0.714797,3.325567 1.870463,4.469381 0.577834,0.571908 1.265885,1.034728 2.029916,1.35457 ' +\n 'l -0.718163,-3.909793 m 0.718163,3.909793 -3.885211,0.802902',\n height: 13.9,\n width: 13.7,\n heightElements: [],\n widthElements: []\n },\n 'MARKER_ADHOC': {\n d: 'm {mx},{my} m 0.84461,2.64411 c 1.05533,-1.23780996 2.64337,-2.07882 4.29653,-1.97997996 2.05163,0.0805 ' +\n '3.85579,1.15803 5.76082,1.79107 1.06385,0.34139996 2.24454,0.1438 3.18759,-0.43767 0.61743,-0.33642 ' +\n '1.2775,-0.64078 1.7542,-1.17511 0,0.56023 0,1.12046 0,1.6807 -0.98706,0.96237996 -2.29792,1.62393996 ' +\n '-3.6918,1.66181996 -1.24459,0.0927 -2.46671,-0.2491 -3.59505,-0.74812 -1.35789,-0.55965 ' +\n '-2.75133,-1.33436996 -4.27027,-1.18121996 -1.37741,0.14601 -2.41842,1.13685996 -3.44288,1.96782996 z',\n height: 4,\n width: 15,\n heightElements: [],\n widthElements: []\n },\n 'TASK_TYPE_SEND': {\n d: 'm {mx},{my} l 0,{e.y1} l {e.x1},0 l 0,-{e.y1} z l {e.x0},{e.y0} l {e.x0},-{e.y0}',\n height: 14,\n width: 21,\n heightElements: [ 6, 14 ],\n widthElements: [ 10.5, 21 ]\n },\n 'TASK_TYPE_SCRIPT': {\n d: 'm {mx},{my} c 9.966553,-6.27276 -8.000926,-7.91932 2.968968,-14.938 l -8.802728,0 ' +\n 'c -10.969894,7.01868 6.997585,8.66524 -2.968967,14.938 z ' +\n 'm -7,-12 l 5,0 ' +\n 'm -4.5,3 l 4.5,0 ' +\n 'm -3,3 l 5,0' +\n 'm -4,3 l 5,0',\n height: 15,\n width: 12.6,\n heightElements: [ 6, 14 ],\n widthElements: [ 10.5, 21 ]\n },\n 'TASK_TYPE_USER_1': {\n d: 'm {mx},{my} c 0.909,-0.845 1.594,-2.049 1.594,-3.385 0,-2.554 -1.805,-4.62199999 ' +\n '-4.357,-4.62199999 -2.55199998,0 -4.28799998,2.06799999 -4.28799998,4.62199999 0,1.348 ' +\n '0.974,2.562 1.89599998,3.405 -0.52899998,0.187 -5.669,2.097 -5.794,4.7560005 v 6.718 ' +\n 'h 17 v -6.718 c 0,-2.2980005 -5.5279996,-4.5950005 -6.0509996,-4.7760005 z' +\n 'm -8,6 l 0,5.5 m 11,0 l 0,-5'\n },\n 'TASK_TYPE_USER_2': {\n d: 'm {mx},{my} m 2.162,1.009 c 0,2.4470005 -2.158,4.4310005 -4.821,4.4310005 ' +\n '-2.66499998,0 -4.822,-1.981 -4.822,-4.4310005 '\n },\n 'TASK_TYPE_USER_3': {\n d: 'm {mx},{my} m -6.9,-3.80 c 0,0 2.25099998,-2.358 4.27399998,-1.177 2.024,1.181 4.221,1.537 ' +\n '4.124,0.965 -0.098,-0.57 -0.117,-3.79099999 -4.191,-4.13599999 -3.57499998,0.001 ' +\n '-4.20799998,3.36699999 -4.20699998,4.34799999 z'\n },\n 'TASK_TYPE_MANUAL': {\n d: 'm {mx},{my} c 0.234,-0.01 5.604,0.008 8.029,0.004 0.808,0 1.271,-0.172 1.417,-0.752 0.227,-0.898 ' +\n '-0.334,-1.314 -1.338,-1.316 -2.467,-0.01 -7.886,-0.004 -8.108,-0.004 -0.014,-0.079 0.016,-0.533 0,-0.61 ' +\n '0.195,-0.042 8.507,0.006 9.616,0.002 0.877,-0.007 1.35,-0.438 1.353,-1.208 0.003,-0.768 -0.479,-1.09 ' +\n '-1.35,-1.091 -2.968,-0.002 -9.619,-0.013 -9.619,-0.013 v -0.591 c 0,0 5.052,-0.016 7.225,-0.016 ' +\n '0.888,-0.002 1.354,-0.416 1.351,-1.193 -0.006,-0.761 -0.492,-1.196 -1.361,-1.196 -3.473,-0.005 ' +\n '-10.86,-0.003 -11.0829995,-0.003 -0.022,-0.047 -0.045,-0.094 -0.069,-0.139 0.3939995,-0.319 ' +\n '2.0409995,-1.626 2.4149995,-2.017 0.469,-0.4870005 0.519,-1.1650005 0.162,-1.6040005 -0.414,-0.511 ' +\n '-0.973,-0.5 -1.48,-0.236 -1.4609995,0.764 -6.5999995,3.6430005 -7.7329995,4.2710005 -0.9,0.499 ' +\n '-1.516,1.253 -1.882,2.19 -0.37000002,0.95 -0.17,2.01 -0.166,2.979 0.004,0.718 -0.27300002,1.345 ' +\n '-0.055,2.063 0.629,2.087 2.425,3.312 4.859,3.318 4.6179995,0.014 9.2379995,-0.139 13.8569995,-0.158 ' +\n '0.755,-0.004 1.171,-0.301 1.182,-1.033 0.012,-0.754 -0.423,-0.969 -1.183,-0.973 -1.778,-0.01 ' +\n '-5.824,-0.004 -6.04,-0.004 10e-4,-0.084 0.003,-0.586 10e-4,-0.67 z'\n },\n 'TASK_TYPE_INSTANTIATING_SEND': {\n d: 'm {mx},{my} l 0,8.4 l 12.6,0 l 0,-8.4 z l 6.3,3.6 l 6.3,-3.6'\n },\n 'TASK_TYPE_SERVICE': {\n d: 'm {mx},{my} v -1.71335 c 0.352326,-0.0705 0.703932,-0.17838 1.047628,-0.32133 ' +\n '0.344416,-0.14465 0.665822,-0.32133 0.966377,-0.52145 l 1.19431,1.18005 1.567487,-1.57688 ' +\n '-1.195028,-1.18014 c 0.403376,-0.61394 0.683079,-1.29908 0.825447,-2.01824 l 1.622133,-0.01 ' +\n 'v -2.2196 l -1.636514,0.01 c -0.07333,-0.35153 -0.178319,-0.70024 -0.323564,-1.04372 ' +\n '-0.145244,-0.34406 -0.321407,-0.6644 -0.522735,-0.96217 l 1.131035,-1.13631 -1.583305,-1.56293 ' +\n '-1.129598,1.13589 c -0.614052,-0.40108 -1.302883,-0.68093 -2.022633,-0.82247 l 0.0093,-1.61852 ' +\n 'h -2.241173 l 0.0042,1.63124 c -0.353763,0.0736 -0.705369,0.17977 -1.049785,0.32371 -0.344415,0.14437 ' +\n '-0.665102,0.32092 -0.9635006,0.52046 l -1.1698628,-1.15823 -1.5667691,1.5792 1.1684265,1.15669 ' +\n 'c -0.4026573,0.61283 -0.68308,1.29797 -0.8247287,2.01713 l -1.6588041,0.003 v 2.22174 ' +\n 'l 1.6724648,-0.006 c 0.073327,0.35077 0.1797598,0.70243 0.3242851,1.04472 0.1452428,0.34448 ' +\n '0.3214064,0.6644 0.5227339,0.96066 l -1.1993431,1.19723 1.5840256,1.56011 1.1964668,-1.19348 ' +\n 'c 0.6140517,0.40346 1.3028827,0.68232 2.0233517,0.82331 l 7.19e-4,1.69892 h 2.226848 z ' +\n 'm 0.221462,-3.9957 c -1.788948,0.7502 -3.8576,-0.0928 -4.6097055,-1.87438 -0.7521065,-1.78321 ' +\n '0.090598,-3.84627 1.8802645,-4.59604 1.78823,-0.74936 3.856881,0.0929 4.608987,1.87437 ' +\n '0.752106,1.78165 -0.0906,3.84612 -1.879546,4.59605 z'\n },\n 'TASK_TYPE_SERVICE_FILL': {\n d: 'm {mx},{my} c -1.788948,0.7502 -3.8576,-0.0928 -4.6097055,-1.87438 -0.7521065,-1.78321 ' +\n '0.090598,-3.84627 1.8802645,-4.59604 1.78823,-0.74936 3.856881,0.0929 4.608987,1.87437 ' +\n '0.752106,1.78165 -0.0906,3.84612 -1.879546,4.59605 z'\n },\n 'TASK_TYPE_BUSINESS_RULE_HEADER': {\n d: 'm {mx},{my} 0,4 20,0 0,-4 z'\n },\n 'TASK_TYPE_BUSINESS_RULE_MAIN': {\n d: 'm {mx},{my} 0,12 20,0 0,-12 z' +\n 'm 0,8 l 20,0 ' +\n 'm -13,-4 l 0,8'\n },\n 'MESSAGE_FLOW_MARKER': {\n d: 'm {mx},{my} m -10.5 ,-7 l 0,14 l 21,0 l 0,-14 z l 10.5,6 l 10.5,-6'\n }\n };\n\n /**\n * Return raw path for the given ID.\n *\n * @param {string} pathId\n *\n * @return {string} raw path\n */\n this.getRawPath = function getRawPath(pathId) {\n return this.pathMap[pathId].d;\n };\n\n /**\n * Scales the path to the given height and width.\n *

    Use case

    \n *

    Use case is to scale the content of elements (event, gateways) based\n * on the element bounding box's size.\n *

    \n *

    Why not transform

    \n *

    Scaling a path with transform() will also scale the stroke and IE does not support\n * the option 'non-scaling-stroke' to prevent this.\n * Also there are use cases where only some parts of a path should be\n * scaled.

    \n *\n * @param {string} pathId The ID of the path.\n * @param {Object} param

    \n * Example param object scales the path to 60% size of the container (data.width, data.height).\n *

    \n   *   {\n   *     xScaleFactor: 0.6,\n   *     yScaleFactor:0.6,\n   *     containerWidth: data.width,\n   *     containerHeight: data.height,\n   *     position: {\n   *       mx: 0.46,\n   *       my: 0.2,\n   *     }\n   *   }\n   *   
    \n *
      \n *
    • targetpathwidth = xScaleFactor * containerWidth
    • \n *
    • targetpathheight = yScaleFactor * containerHeight
    • \n *
    • Position is used to set the starting coordinate of the path. M is computed:\n *
        \n *
      • position.x * containerWidth
      • \n *
      • position.y * containerHeight
      • \n *
      \n * Center of the container
       position: {\n   *       mx: 0.5,\n   *       my: 0.5,\n   *     }
      \n * Upper left corner of the container\n *
       position: {\n   *       mx: 0.0,\n   *       my: 0.0,\n   *     }
      \n *
    • \n *
    \n *

    \n *\n * @return {string} scaled path\n */\n this.getScaledPath = function getScaledPath(pathId, param) {\n var rawPath = this.pathMap[pathId];\n\n // positioning\n // compute the start point of the path\n var mx, my;\n\n if (param.abspos) {\n mx = param.abspos.x;\n my = param.abspos.y;\n } else {\n mx = param.containerWidth * param.position.mx;\n my = param.containerHeight * param.position.my;\n }\n\n var coordinates = {}; // map for the scaled coordinates\n if (param.position) {\n\n // path\n var heightRatio = (param.containerHeight / rawPath.height) * param.yScaleFactor;\n var widthRatio = (param.containerWidth / rawPath.width) * param.xScaleFactor;\n\n\n // Apply height ratio\n for (var heightIndex = 0; heightIndex < rawPath.heightElements.length; heightIndex++) {\n coordinates['y' + heightIndex] = rawPath.heightElements[heightIndex] * heightRatio;\n }\n\n // Apply width ratio\n for (var widthIndex = 0; widthIndex < rawPath.widthElements.length; widthIndex++) {\n coordinates['x' + widthIndex] = rawPath.widthElements[widthIndex] * widthRatio;\n }\n }\n\n // Apply value to raw path\n var path = format(\n rawPath.d, {\n mx: mx,\n my: my,\n e: coordinates\n }\n );\n return path;\n };\n}\n\n// helpers //////////////////////\n\n// copied and adjusted from https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js\nvar tokenRegex = /\\{([^{}]+)\\}/g,\n objNotationRegex = /(?:(?:^|\\.)(.+?)(?=\\[|\\.|$|\\()|\\[('|\")(.+?)\\2\\])(\\(\\))?/g; // matches .xxxxx or [\"xxxxx\"] to run over object properties\n\nfunction replacer(all, key, obj) {\n var res = obj;\n key.replace(objNotationRegex, function(all, name, quote, quotedName, isFunc) {\n name = name || quotedName;\n if (res) {\n if (name in res) {\n res = res[name];\n }\n typeof res == 'function' && isFunc && (res = res());\n }\n });\n res = (res == null || res == obj ? all : res) + '';\n\n return res;\n}\n\nfunction format(str, obj) {\n return String(str).replace(tokenRegex, function(all, key) {\n return replacer(all, key, obj);\n });\n}\n", "import BpmnRenderer from './BpmnRenderer';\nimport TextRenderer from './TextRenderer';\n\nimport PathMap from './PathMap';\n\nexport default {\n __init__: [ 'bpmnRenderer' ],\n bpmnRenderer: [ 'type', BpmnRenderer ],\n textRenderer: [ 'type', TextRenderer ],\n pathMap: [ 'type', PathMap ]\n};\n", "/**\n * @typedef { {\n * [key: string]: string;\n * } } TranslateReplacements\n */\n\n/**\n * A simple translation stub to be used for multi-language support\n * in diagrams. Can be easily replaced with a more sophisticated\n * solution.\n *\n * @example\n *\n * ```javascript\n * // use it inside any diagram component by injecting `translate`.\n *\n * function MyService(translate) {\n * alert(translate('HELLO {you}', { you: 'You!' }));\n * }\n * ```\n *\n * @param {string} template to interpolate\n * @param {TranslateReplacements} [replacements] a map with substitutes\n *\n * @return {string} the translated string\n */\nexport default function translate(template, replacements) {\n\n replacements = replacements || {};\n\n return template.replace(/{([^}]+)}/g, function(_, key) {\n return replacements[key] || '{' + key + '}';\n });\n}", "import translate from './translate';\n\n\n/**\n * @type { import('didi').ModuleDeclaration }\n */\nexport default {\n translate: [ 'value', translate ]\n};", "export function elementToString(e) {\n if (!e) {\n return '';\n }\n\n return '<' + e.$type + (e.id ? ' id=\"' + e.id : '') + '\" />';\n}", "import {\n assign\n} from 'min-dash';\n\nimport { is } from '../util/ModelUtil';\n\nimport {\n isLabelExternal,\n getExternalLabelBounds,\n getLabel\n} from '../util/LabelUtil';\n\nimport {\n getMid\n} from 'diagram-js/lib/layout/LayoutUtil';\n\nimport {\n isExpanded\n} from '../util/DiUtil';\n\nimport {\n elementToString\n} from './Util';\n\n/**\n * @typedef {import('diagram-js/lib/core/Canvas').default} Canvas\n * @typedef {import('diagram-js/lib/core/ElementRegistry').default} ElementRegistry\n * @typedef {import('diagram-js/lib/core/EventBus').default} EventBus\n *\n * @typedef {import('../features/modeling/ElementFactory').default} ElementFactory\n * @typedef {import('../draw/TextRenderer').default} TextRenderer\n *\n * @typedef {import('../model/Types').Element} Element\n * @typedef {import('../model/Types').Label} Label\n * @typedef {import('../model/Types').Shape} Shape\n * @typedef {import('../model/Types').Connection} Connection\n * @typedef {import('../model/Types').Root} Root\n * @typedef {import('../model/Types').ModdleElement} ModdleElement\n */\n\n/**\n * @param {ModdleElement} semantic\n * @param {ModdleElement} di\n * @param {Object} [attrs=null]\n *\n * @return {Object}\n */\nfunction elementData(semantic, di, attrs) {\n return assign({\n id: semantic.id,\n type: semantic.$type,\n businessObject: semantic,\n di: di\n }, attrs);\n}\n\nfunction getWaypoints(di, source, target) {\n\n var waypoints = di.waypoint;\n\n if (!waypoints || waypoints.length < 2) {\n return [ getMid(source), getMid(target) ];\n }\n\n return waypoints.map(function(p) {\n return { x: p.x, y: p.y };\n });\n}\n\nfunction notYetDrawn(semantic, refSemantic, property) {\n return new Error(\n `element ${ elementToString(refSemantic) } referenced by ${ elementToString(semantic) }#${ property } not yet drawn`\n );\n}\n\n\n/**\n * An importer that adds bpmn elements to the canvas\n *\n * @param {EventBus} eventBus\n * @param {Canvas} canvas\n * @param {ElementFactory} elementFactory\n * @param {ElementRegistry} elementRegistry\n * @param {TextRenderer} textRenderer\n */\nexport default function BpmnImporter(\n eventBus, canvas, elementFactory,\n elementRegistry, textRenderer) {\n\n this._eventBus = eventBus;\n this._canvas = canvas;\n this._elementFactory = elementFactory;\n this._elementRegistry = elementRegistry;\n this._textRenderer = textRenderer;\n}\n\nBpmnImporter.$inject = [\n 'eventBus',\n 'canvas',\n 'elementFactory',\n 'elementRegistry',\n 'textRenderer'\n];\n\n\n/**\n * Add a BPMN element (semantic) to the canvas making it a child of the\n * given parent.\n *\n * @param {ModdleElement} semantic\n * @param {ModdleElement} di\n * @param {Shape} parentElement\n *\n * @return {Shape | Root | Connection}\n */\nBpmnImporter.prototype.add = function(semantic, di, parentElement) {\n var element,\n hidden;\n\n var parentIndex;\n\n // ROOT ELEMENT\n // handle the special case that we deal with a\n // invisible root element (process, subprocess or collaboration)\n if (is(di, 'bpmndi:BPMNPlane')) {\n\n var attrs = is(semantic, 'bpmn:SubProcess')\n ? { id: semantic.id + '_plane' }\n : {};\n\n // add a virtual element (not being drawn)\n element = this._elementFactory.createRoot(elementData(semantic, di, attrs));\n\n this._canvas.addRootElement(element);\n }\n\n // SHAPE\n else if (is(di, 'bpmndi:BPMNShape')) {\n\n var collapsed = !isExpanded(semantic, di),\n isFrame = isFrameElement(semantic);\n\n hidden = parentElement && (parentElement.hidden || parentElement.collapsed);\n\n var bounds = di.bounds;\n\n element = this._elementFactory.createShape(elementData(semantic, di, {\n collapsed: collapsed,\n hidden: hidden,\n x: Math.round(bounds.x),\n y: Math.round(bounds.y),\n width: Math.round(bounds.width),\n height: Math.round(bounds.height),\n isFrame: isFrame\n }));\n\n if (is(semantic, 'bpmn:BoundaryEvent')) {\n this._attachBoundary(semantic, element);\n }\n\n // insert lanes behind other flow nodes (cf. #727)\n if (is(semantic, 'bpmn:Lane')) {\n parentIndex = 0;\n }\n\n if (is(semantic, 'bpmn:DataStoreReference')) {\n\n // check whether data store is inside our outside of its semantic parent\n if (!isPointInsideBBox(parentElement, getMid(bounds))) {\n parentElement = this._canvas.findRoot(parentElement);\n }\n }\n\n this._canvas.addShape(element, parentElement, parentIndex);\n }\n\n // CONNECTION\n else if (is(di, 'bpmndi:BPMNEdge')) {\n\n var source = this._getSource(semantic),\n target = this._getTarget(semantic);\n\n hidden = parentElement && (parentElement.hidden || parentElement.collapsed);\n\n element = this._elementFactory.createConnection(elementData(semantic, di, {\n hidden: hidden,\n source: source,\n target: target,\n waypoints: getWaypoints(di, source, target)\n }));\n\n if (is(semantic, 'bpmn:DataAssociation')) {\n\n // render always on top; this ensures DataAssociations\n // are rendered correctly across different \"hacks\" people\n // love to model such as cross participant / sub process\n // associations\n parentElement = this._canvas.findRoot(parentElement);\n }\n\n this._canvas.addConnection(element, parentElement, parentIndex);\n } else {\n throw new Error(\n `unknown di ${ elementToString(di) } for element ${ elementToString(semantic) }`\n );\n }\n\n // (optional) LABEL\n if (isLabelExternal(semantic) && getLabel(element)) {\n this.addLabel(semantic, di, element);\n }\n\n this._eventBus.fire('bpmnElement.added', { element: element });\n\n return element;\n};\n\n\n/**\n * Attach a boundary element to the given host.\n *\n * @param {ModdleElement} boundarySemantic\n * @param {Shape} boundaryElement\n */\nBpmnImporter.prototype._attachBoundary = function(boundarySemantic, boundaryElement) {\n var hostSemantic = boundarySemantic.attachedToRef;\n\n if (!hostSemantic) {\n throw new Error(\n `missing ${ elementToString(boundarySemantic) }#attachedToRef`\n );\n }\n\n var host = this._elementRegistry.get(hostSemantic.id),\n attachers = host && host.attachers;\n\n if (!host) {\n throw notYetDrawn(boundarySemantic, hostSemantic, 'attachedToRef');\n }\n\n // wire element.host <> host.attachers\n boundaryElement.host = host;\n\n if (!attachers) {\n host.attachers = attachers = [];\n }\n\n if (attachers.indexOf(boundaryElement) === -1) {\n attachers.push(boundaryElement);\n }\n};\n\n\n/**\n * Add a label to a given element.\n *\n * @param {ModdleElement} semantic\n * @param {ModdleElement} di\n * @param {Element} element\n *\n * @return {Label}\n */\nBpmnImporter.prototype.addLabel = function(semantic, di, element) {\n var bounds,\n text,\n label;\n\n bounds = getExternalLabelBounds(di, element);\n\n text = getLabel(element);\n\n if (text) {\n\n // get corrected bounds from actual layouted text\n bounds = this._textRenderer.getExternalLabelBounds(bounds, text);\n }\n\n label = this._elementFactory.createLabel(elementData(semantic, di, {\n id: semantic.id + '_label',\n labelTarget: element,\n type: 'label',\n hidden: element.hidden || !getLabel(element),\n x: Math.round(bounds.x),\n y: Math.round(bounds.y),\n width: Math.round(bounds.width),\n height: Math.round(bounds.height)\n }));\n\n return this._canvas.addShape(label, element.parent);\n};\n\n/**\n * Get the source or target of the given connection.\n *\n * @param {ModdleElement} semantic\n * @param {'source' | 'target'} side\n *\n * @return {Element}\n */\nBpmnImporter.prototype._getConnectedElement = function(semantic, side) {\n\n var element,\n refSemantic,\n type = semantic.$type;\n\n refSemantic = semantic[side + 'Ref'];\n\n // handle mysterious isMany DataAssociation#sourceRef\n if (side === 'source' && type === 'bpmn:DataInputAssociation') {\n refSemantic = refSemantic && refSemantic[0];\n }\n\n // fix source / target for DataInputAssociation / DataOutputAssociation\n if (side === 'source' && type === 'bpmn:DataOutputAssociation' ||\n side === 'target' && type === 'bpmn:DataInputAssociation') {\n\n refSemantic = semantic.$parent;\n }\n\n element = refSemantic && this._getElement(refSemantic);\n\n if (element) {\n return element;\n }\n\n if (refSemantic) {\n throw notYetDrawn(semantic, refSemantic, side + 'Ref');\n } else {\n throw new Error(\n `${ elementToString(semantic) }#${ side } Ref not specified`\n );\n }\n};\n\nBpmnImporter.prototype._getSource = function(semantic) {\n return this._getConnectedElement(semantic, 'source');\n};\n\nBpmnImporter.prototype._getTarget = function(semantic) {\n return this._getConnectedElement(semantic, 'target');\n};\n\n\nBpmnImporter.prototype._getElement = function(semantic) {\n return this._elementRegistry.get(semantic.id);\n};\n\n\n// helpers ////////////////////\n\nfunction isPointInsideBBox(bbox, point) {\n var x = point.x,\n y = point.y;\n\n return x >= bbox.x &&\n x <= bbox.x + bbox.width &&\n y >= bbox.y &&\n y <= bbox.y + bbox.height;\n}\n\nfunction isFrameElement(semantic) {\n return is(semantic, 'bpmn:Group');\n}\n", "import translate from 'diagram-js/lib/i18n/translate';\n\nimport BpmnImporter from './BpmnImporter';\n\nexport default {\n __depends__: [\n translate\n ],\n bpmnImporter: [ 'type', BpmnImporter ]\n};", "import DrawModule from '../draw';\nimport ImportModule from '../import';\n\nexport default {\n __depends__: [\n DrawModule,\n ImportModule\n ]\n};", "/**\n * Util that provides unique IDs.\n *\n * @class\n * @constructor\n *\n * The ids can be customized via a given prefix and contain a random value to avoid collisions.\n *\n * @param {string} [prefix] a prefix to prepend to generated ids (for better readability)\n */\nexport default function IdGenerator(prefix) {\n\n this._counter = 0;\n this._prefix = (prefix ? prefix + '-' : '') + Math.floor(Math.random() * 1000000000) + '-';\n}\n\n/**\n * Returns a next unique ID.\n *\n * @return {string} the id\n */\nIdGenerator.prototype.next = function() {\n return this._prefix + (++this._counter);\n};\n", "import {\n isArray,\n isString,\n isObject,\n assign,\n forEach,\n find,\n filter,\n matchPattern,\n isDefined\n} from 'min-dash';\n\nimport {\n assignStyle,\n domify,\n classes as domClasses,\n attr as domAttr,\n remove as domRemove,\n clear as domClear\n} from 'min-dom';\n\nimport {\n getBBox\n} from '../../util/Elements';\n\nimport Ids from '../../util/IdGenerator';\n\n// document wide unique overlay ids\nvar ids = new Ids('ov');\n\nvar LOW_PRIORITY = 500;\n\n/**\n * @typedef {import('../../core/Canvas').default} Canvas\n * @typedef {import('../../core/ElementRegistry').default} ElementRegistry\n * @typedef {import('../../core/EventBus').default} EventBus\n *\n * @typedef {import('../../model/Types').Element} Element\n *\n * @typedef { {\n * minZoom?: number,\n * maxZoom?: number\n * } } OverlaysConfigShow\n *\n * @typedef { {\n * min?: number,\n * max?: number\n * } } OverlaysConfigScale\n *\n * @typedef { {\n* id: string,\n* type: string | null,\n* element: Element | string\n* } & OverlayAttrs } Overlay\n*\n * @typedef { {\n * html: HTMLElement | string,\n * position: {\n * top?: number,\n * right?: number,\n * bottom?: number,\n * left?: number\n * }\n * } & OverlaysConfigDefault } OverlayAttrs\n *\n * @typedef { {\n * html: HTMLElement,\n * element: Element,\n * overlays: Overlay[]\n * } } OverlayContainer\n *\n * @typedef {{\n * defaults?: OverlaysConfigDefault\n * }} OverlaysConfig\n *\n * @typedef { {\n * show?: OverlaysConfigShow,\n * scale?: OverlaysConfigScale | boolean\n * } } OverlaysConfigDefault\n *\n * @typedef { {\n * id?: string;\n * element?: Element | string;\n * type?: string;\n * } | string } OverlaysFilter\n */\n\n/**\n * A service that allows users to attach overlays to diagram elements.\n *\n * The overlay service will take care of overlay positioning during updates.\n *\n * @example\n *\n * ```javascript\n * // add a pink badge on the top left of the shape\n *\n * overlays.add(someShape, {\n * position: {\n * top: -5,\n * left: -5\n * },\n * html: '
    0
    '\n * });\n *\n * // or add via shape id\n *\n * overlays.add('some-element-id', {\n * position: {\n * top: -5,\n * left: -5\n * }\n * html: '
    0
    '\n * });\n *\n * // or add with optional type\n *\n * overlays.add(someShape, 'badge', {\n * position: {\n * top: -5,\n * left: -5\n * }\n * html: '
    0
    '\n * });\n * ```\n *\n * ```javascript\n * // remove an overlay\n *\n * var id = overlays.add(...);\n * overlays.remove(id);\n *\n *\n * You may configure overlay defaults during tool by providing a `config` module\n * with `overlays.defaults` as an entry:\n *\n * {\n * overlays: {\n * defaults: {\n * show: {\n * minZoom: 0.7,\n * maxZoom: 5.0\n * },\n * scale: {\n * min: 1\n * }\n * }\n * }\n * ```\n *\n * @param {OverlaysConfig} config\n * @param {EventBus} eventBus\n * @param {Canvas} canvas\n * @param {ElementRegistry} elementRegistry\n */\nexport default function Overlays(config, eventBus, canvas, elementRegistry) {\n this._eventBus = eventBus;\n this._canvas = canvas;\n this._elementRegistry = elementRegistry;\n\n this._ids = ids;\n\n /**\n * @type {OverlaysConfigDefault}\n */\n this._overlayDefaults = assign({\n\n // no show constraints\n show: null,\n\n // always scale\n scale: true\n }, config && config.defaults);\n\n /**\n * @type {Record}\n */\n this._overlays = {};\n\n /**\n * @type {OverlayContainer[]}\n */\n this._overlayContainers = [];\n\n /**\n * @type {HTMLElement}\n */\n this._overlayRoot = createRoot(canvas.getContainer());\n\n this._init();\n}\n\n\nOverlays.$inject = [\n 'config.overlays',\n 'eventBus',\n 'canvas',\n 'elementRegistry'\n];\n\n\n/**\n * Returns the overlay with the specified ID or a list of overlays\n * for an element with a given type.\n *\n * @example\n *\n * ```javascript\n * // return the single overlay with the given ID\n * overlays.get('some-id');\n *\n * // return all overlays for the shape\n * overlays.get({ element: someShape });\n *\n * // return all overlays on shape with type 'badge'\n * overlays.get({ element: someShape, type: 'badge' });\n *\n * // shape can also be specified as ID\n * overlays.get({ element: 'element-id', type: 'badge' });\n * ```\n *\n * @param {OverlaysFilter} search The filter to be used to find the overlay(s).\n *\n * @return {Overlay|Overlay[]} The overlay(s).\n */\nOverlays.prototype.get = function(search) {\n\n if (isString(search)) {\n search = { id: search };\n }\n\n if (isString(search.element)) {\n search.element = this._elementRegistry.get(search.element);\n }\n\n if (search.element) {\n var container = this._getOverlayContainer(search.element, true);\n\n // return a list of overlays when searching by element (+type)\n if (container) {\n return search.type ? filter(container.overlays, matchPattern({ type: search.type })) : container.overlays.slice();\n } else {\n return [];\n }\n } else if (search.type) {\n return filter(this._overlays, matchPattern({ type: search.type }));\n } else {\n\n // return single element when searching by id\n return search.id ? this._overlays[search.id] : null;\n }\n};\n\n/**\n * Adds an HTML overlay to an element.\n *\n * @param {Element|string} element The element to add the overlay to.\n * @param {string} [type] An optional type that can be used to filter.\n * @param {OverlayAttrs} overlay The overlay.\n *\n * @return {string} The overlay's ID that can be used to get or remove it.\n */\nOverlays.prototype.add = function(element, type, overlay) {\n\n if (isObject(type)) {\n overlay = type;\n type = null;\n }\n\n if (!element.id) {\n element = this._elementRegistry.get(element);\n }\n\n if (!overlay.position) {\n throw new Error('must specifiy overlay position');\n }\n\n if (!overlay.html) {\n throw new Error('must specifiy overlay html');\n }\n\n if (!element) {\n throw new Error('invalid element specified');\n }\n\n var id = this._ids.next();\n\n overlay = assign({}, this._overlayDefaults, overlay, {\n id: id,\n type: type,\n element: element,\n html: overlay.html\n });\n\n this._addOverlay(overlay);\n\n return id;\n};\n\n\n/**\n * Remove an overlay with the given ID or all overlays matching the given filter.\n *\n * @see Overlays#get for filter options.\n *\n * @param {OverlaysFilter} filter The filter to be used to find the overlay.\n */\nOverlays.prototype.remove = function(filter) {\n\n var overlays = this.get(filter) || [];\n\n if (!isArray(overlays)) {\n overlays = [ overlays ];\n }\n\n var self = this;\n\n forEach(overlays, function(overlay) {\n\n var container = self._getOverlayContainer(overlay.element, true);\n\n if (overlay) {\n domRemove(overlay.html);\n domRemove(overlay.htmlContainer);\n\n delete overlay.htmlContainer;\n delete overlay.element;\n\n delete self._overlays[overlay.id];\n }\n\n if (container) {\n var idx = container.overlays.indexOf(overlay);\n if (idx !== -1) {\n container.overlays.splice(idx, 1);\n }\n }\n });\n\n};\n\n/**\n * Checks whether overlays are shown.\n *\n * @return {boolean} Whether overlays are shown.\n */\nOverlays.prototype.isShown = function() {\n return this._overlayRoot.style.display !== 'none';\n};\n\n/**\n * Show all overlays.\n */\nOverlays.prototype.show = function() {\n setVisible(this._overlayRoot);\n};\n\n/**\n * Hide all overlays.\n */\nOverlays.prototype.hide = function() {\n setVisible(this._overlayRoot, false);\n};\n\n/**\n * Remove all overlays and their container.\n */\nOverlays.prototype.clear = function() {\n this._overlays = {};\n\n this._overlayContainers = [];\n\n domClear(this._overlayRoot);\n};\n\nOverlays.prototype._updateOverlayContainer = function(container) {\n var element = container.element,\n html = container.html;\n\n // update container left,top according to the elements x,y coordinates\n // this ensures we can attach child elements relative to this container\n\n var x = element.x,\n y = element.y;\n\n if (element.waypoints) {\n var bbox = getBBox(element);\n x = bbox.x;\n y = bbox.y;\n }\n\n setPosition(html, x, y);\n\n domAttr(container.html, 'data-container-id', element.id);\n};\n\n\nOverlays.prototype._updateOverlay = function(overlay) {\n\n var position = overlay.position,\n htmlContainer = overlay.htmlContainer,\n element = overlay.element;\n\n // update overlay html relative to shape because\n // it is already positioned on the element\n\n // update relative\n var left = position.left,\n top = position.top;\n\n if (position.right !== undefined) {\n\n var width;\n\n if (element.waypoints) {\n width = getBBox(element).width;\n } else {\n width = element.width;\n }\n\n left = position.right * -1 + width;\n }\n\n if (position.bottom !== undefined) {\n\n var height;\n\n if (element.waypoints) {\n height = getBBox(element).height;\n } else {\n height = element.height;\n }\n\n top = position.bottom * -1 + height;\n }\n\n setPosition(htmlContainer, left || 0, top || 0);\n this._updateOverlayVisibilty(overlay, this._canvas.viewbox());\n};\n\n\nOverlays.prototype._createOverlayContainer = function(element) {\n var html = domify('
    ');\n assignStyle(html, { position: 'absolute' });\n\n this._overlayRoot.appendChild(html);\n\n var container = {\n html: html,\n element: element,\n overlays: []\n };\n\n this._updateOverlayContainer(container);\n\n this._overlayContainers.push(container);\n\n return container;\n};\n\n\nOverlays.prototype._updateRoot = function(viewbox) {\n var scale = viewbox.scale || 1;\n\n var matrix = 'matrix(' +\n [\n scale,\n 0,\n 0,\n scale,\n -1 * viewbox.x * scale,\n -1 * viewbox.y * scale\n ].join(',') +\n ')';\n\n setTransform(this._overlayRoot, matrix);\n};\n\n\nOverlays.prototype._getOverlayContainer = function(element, raw) {\n var container = find(this._overlayContainers, function(c) {\n return c.element === element;\n });\n\n\n if (!container && !raw) {\n return this._createOverlayContainer(element);\n }\n\n return container;\n};\n\n\nOverlays.prototype._addOverlay = function(overlay) {\n\n var id = overlay.id,\n element = overlay.element,\n html = overlay.html,\n htmlContainer,\n overlayContainer;\n\n // unwrap jquery (for those who need it)\n if (html.get && html.constructor.prototype.jquery) {\n html = html.get(0);\n }\n\n // create proper html elements from\n // overlay HTML strings\n if (isString(html)) {\n html = domify(html);\n }\n\n overlayContainer = this._getOverlayContainer(element);\n\n htmlContainer = domify('
    ');\n assignStyle(htmlContainer, { position: 'absolute' });\n\n htmlContainer.appendChild(html);\n\n if (overlay.type) {\n domClasses(htmlContainer).add('djs-overlay-' + overlay.type);\n }\n\n var elementRoot = this._canvas.findRoot(element);\n var activeRoot = this._canvas.getRootElement();\n\n setVisible(htmlContainer, elementRoot === activeRoot);\n\n overlay.htmlContainer = htmlContainer;\n\n overlayContainer.overlays.push(overlay);\n overlayContainer.html.appendChild(htmlContainer);\n\n this._overlays[id] = overlay;\n\n this._updateOverlay(overlay);\n this._updateOverlayVisibilty(overlay, this._canvas.viewbox());\n};\n\n\nOverlays.prototype._updateOverlayVisibilty = function(overlay, viewbox) {\n var show = overlay.show,\n rootElement = this._canvas.findRoot(overlay.element),\n minZoom = show && show.minZoom,\n maxZoom = show && show.maxZoom,\n htmlContainer = overlay.htmlContainer,\n activeRootElement = this._canvas.getRootElement(),\n visible = true;\n\n if (rootElement !== activeRootElement) {\n visible = false;\n } else if (show) {\n if (\n (isDefined(minZoom) && minZoom > viewbox.scale) ||\n (isDefined(maxZoom) && maxZoom < viewbox.scale)\n ) {\n visible = false;\n }\n }\n\n setVisible(htmlContainer, visible);\n\n this._updateOverlayScale(overlay, viewbox);\n};\n\n\nOverlays.prototype._updateOverlayScale = function(overlay, viewbox) {\n var shouldScale = overlay.scale,\n minScale,\n maxScale,\n htmlContainer = overlay.htmlContainer;\n\n var scale, transform = '';\n\n if (shouldScale !== true) {\n\n if (shouldScale === false) {\n minScale = 1;\n maxScale = 1;\n } else {\n minScale = shouldScale.min;\n maxScale = shouldScale.max;\n }\n\n if (isDefined(minScale) && viewbox.scale < minScale) {\n scale = (1 / viewbox.scale || 1) * minScale;\n }\n\n if (isDefined(maxScale) && viewbox.scale > maxScale) {\n scale = (1 / viewbox.scale || 1) * maxScale;\n }\n }\n\n if (isDefined(scale)) {\n transform = 'scale(' + scale + ',' + scale + ')';\n }\n\n setTransform(htmlContainer, transform);\n};\n\n\nOverlays.prototype._updateOverlaysVisibilty = function(viewbox) {\n\n var self = this;\n\n forEach(this._overlays, function(overlay) {\n self._updateOverlayVisibilty(overlay, viewbox);\n });\n};\n\n\nOverlays.prototype._init = function() {\n\n var eventBus = this._eventBus;\n\n var self = this;\n\n\n // scroll/zoom integration\n\n function updateViewbox(viewbox) {\n self._updateRoot(viewbox);\n self._updateOverlaysVisibilty(viewbox);\n\n self.show();\n }\n\n eventBus.on('canvas.viewbox.changing', function(event) {\n self.hide();\n });\n\n eventBus.on('canvas.viewbox.changed', function(event) {\n updateViewbox(event.viewbox);\n });\n\n\n // remove integration\n\n eventBus.on([ 'shape.remove', 'connection.remove' ], function(e) {\n var element = e.element;\n var overlays = self.get({ element: element });\n\n forEach(overlays, function(o) {\n self.remove(o.id);\n });\n\n var container = self._getOverlayContainer(element);\n\n if (container) {\n domRemove(container.html);\n var i = self._overlayContainers.indexOf(container);\n if (i !== -1) {\n self._overlayContainers.splice(i, 1);\n }\n }\n });\n\n\n // move integration\n\n eventBus.on('element.changed', LOW_PRIORITY, function(e) {\n var element = e.element;\n\n var container = self._getOverlayContainer(element, true);\n\n if (container) {\n forEach(container.overlays, function(overlay) {\n self._updateOverlay(overlay);\n });\n\n self._updateOverlayContainer(container);\n }\n });\n\n\n // marker integration, simply add them on the overlays as classes, too.\n\n eventBus.on('element.marker.update', function(e) {\n var container = self._getOverlayContainer(e.element, true);\n if (container) {\n domClasses(container.html)[e.add ? 'add' : 'remove'](e.marker);\n }\n });\n\n\n eventBus.on('root.set', function() {\n self._updateOverlaysVisibilty(self._canvas.viewbox());\n });\n\n // clear overlays with diagram\n\n eventBus.on('diagram.clear', this.clear, this);\n};\n\n\n\n// helpers /////////////////////////////\n\nfunction createRoot(parentNode) {\n var root = domify(\n '
    '\n );\n\n assignStyle(root, {\n position: 'absolute',\n width: 0,\n height: 0\n });\n\n parentNode.insertBefore(root, parentNode.firstChild);\n\n return root;\n}\n\nfunction setPosition(el, x, y) {\n assignStyle(el, { left: x + 'px', top: y + 'px' });\n}\n\n/**\n * Set element visible\n *\n * @param {DOMElement} el\n * @param {boolean} [visible=true]\n */\nfunction setVisible(el, visible) {\n el.style.display = visible === false ? 'none' : '';\n}\n\nfunction setTransform(el, transform) {\n\n el.style['transform-origin'] = 'top left';\n\n [ '', '-ms-', '-webkit-' ].forEach(function(prefix) {\n el.style[prefix + 'transform'] = transform;\n });\n}", "import Overlays from './Overlays';\n\n\n/**\n * @type { import('didi').ModuleDeclaration }\n */\nexport default {\n __init__: [ 'overlays' ],\n overlays: [ 'type', Overlays ]\n};", "import {\n getType as getElementType\n} from '../../util/Elements';\n\n/**\n * @typedef {import('../../core/Canvas').default} Canvas\n * @typedef {import('../../core/ElementRegistry').default} ElementRegistry\n * @typedef {import('../../core/EventBus').default} EventBus\n * @typedef {import('../../core/GraphicsFactory').default} GraphicsFactory\n */\n\n/**\n * Adds change support to the diagram, including\n *\n *
      \n *
    • redrawing shapes and connections on change
    • \n *
    \n *\n * @param {EventBus} eventBus\n * @param {Canvas} canvas\n * @param {ElementRegistry} elementRegistry\n * @param {GraphicsFactory} graphicsFactory\n */\nexport default function ChangeSupport(\n eventBus, canvas, elementRegistry,\n graphicsFactory) {\n\n\n // redraw shapes / connections on change\n\n eventBus.on('element.changed', function(event) {\n\n var element = event.element;\n\n // element might have been deleted and replaced by new element with same ID\n // thus check for parent of element except for root element\n if (element.parent || element === canvas.getRootElement()) {\n event.gfx = elementRegistry.getGraphics(element);\n }\n\n // shape + gfx may have been deleted\n if (!event.gfx) {\n return;\n }\n\n eventBus.fire(getElementType(element) + '.changed', event);\n });\n\n eventBus.on('elements.changed', function(event) {\n\n var elements = event.elements;\n\n elements.forEach(function(e) {\n eventBus.fire('element.changed', { element: e });\n });\n\n graphicsFactory.updateContainments(elements);\n });\n\n eventBus.on('shape.changed', function(event) {\n graphicsFactory.update('shape', event.element, event.gfx);\n });\n\n eventBus.on('connection.changed', function(event) {\n graphicsFactory.update('connection', event.element, event.gfx);\n });\n}\n\nChangeSupport.$inject = [\n 'eventBus',\n 'canvas',\n 'elementRegistry',\n 'graphicsFactory'\n];", "import ChangeSupport from './ChangeSupport';\n\n\n/**\n * @type { import('didi').ModuleDeclaration }\n */\nexport default {\n __init__: [ 'changeSupport' ],\n changeSupport: [ 'type', ChangeSupport ]\n};", "import {\n forEach,\n isFunction,\n isArray,\n isNumber,\n isObject\n} from 'min-dash';\n\n/**\n * @typedef {import('../core/Types').ElementLike} ElementLike\n * @typedef {import('../core/EventBus').default} EventBus\n * @typedef {import('./CommandStack').CommandContext} CommandContext\n *\n * @typedef {string|string[]} Events\n * @typedef { (context: CommandContext) => ElementLike[] | void } HandlerFunction\n * @typedef { (context: CommandContext) => void } ComposeHandlerFunction\n */\n\nvar DEFAULT_PRIORITY = 1000;\n\n/**\n * A utility that can be used to plug into the command execution for\n * extension and/or validation.\n *\n * @class\n * @constructor\n *\n * @example\n *\n * ```javascript\n * import CommandInterceptor from 'diagram-js/lib/command/CommandInterceptor';\n *\n * class CommandLogger extends CommandInterceptor {\n * constructor(eventBus) {\n * super(eventBus);\n *\n * this.preExecute('shape.create', (event) => {\n * console.log('commandStack.shape-create.preExecute', event);\n * });\n * }\n * ```\n *\n * @param {EventBus} eventBus\n */\nexport default function CommandInterceptor(eventBus) {\n\n /**\n * @type {EventBus}\n */\n this._eventBus = eventBus;\n}\n\nCommandInterceptor.$inject = [ 'eventBus' ];\n\nfunction unwrapEvent(fn, that) {\n return function(event) {\n return fn.call(that || null, event.context, event.command, event);\n };\n}\n\n\n/**\n * Intercept a command during one of the phases.\n *\n * @param {Events} [events] command(s) to intercept\n * @param {string} [hook] phase to intercept\n * @param {number} [priority]\n * @param {ComposeHandlerFunction|HandlerFunction} handlerFn\n * @param {boolean} [unwrap] whether the event should be unwrapped\n * @param {any} [that]\n */\nCommandInterceptor.prototype.on = function(events, hook, priority, handlerFn, unwrap, that) {\n\n if (isFunction(hook) || isNumber(hook)) {\n that = unwrap;\n unwrap = handlerFn;\n handlerFn = priority;\n priority = hook;\n hook = null;\n }\n\n if (isFunction(priority)) {\n that = unwrap;\n unwrap = handlerFn;\n handlerFn = priority;\n priority = DEFAULT_PRIORITY;\n }\n\n if (isObject(unwrap)) {\n that = unwrap;\n unwrap = false;\n }\n\n if (!isFunction(handlerFn)) {\n throw new Error('handlerFn must be a function');\n }\n\n if (!isArray(events)) {\n events = [ events ];\n }\n\n var eventBus = this._eventBus;\n\n forEach(events, function(event) {\n\n // concat commandStack(.event)?(.hook)?\n var fullEvent = [ 'commandStack', event, hook ].filter(function(e) { return e; }).join('.');\n\n eventBus.on(fullEvent, priority, unwrap ? unwrapEvent(handlerFn, that) : handlerFn, that);\n });\n};\n\n/**\n * Add a phase of command interceptor.\n *\n * @param {Events} [events] command(s) to intercept\n * @param {number} [priority]\n * @param {ComposeHandlerFunction|HandlerFunction} handlerFn\n * @param {boolean} [unwrap] whether the event should be unwrapped\n * @param {any} [that]\n */\nCommandInterceptor.prototype.canExecute = createHook('canExecute');\n\n/**\n * Add a phase of command interceptor.\n *\n * @param {Events} [events] command(s) to intercept\n * @param {number} [priority]\n * @param {ComposeHandlerFunction|HandlerFunction} handlerFn\n * @param {boolean} [unwrap] whether the event should be unwrapped\n * @param {any} [that]\n */\nCommandInterceptor.prototype.preExecute = createHook('preExecute');\n\n/**\n * Add a phase of command interceptor.\n *\n * @param {Events} [events] command(s) to intercept\n * @param {number} [priority]\n * @param {ComposeHandlerFunction|HandlerFunction} handlerFn\n * @param {boolean} [unwrap] whether the event should be unwrapped\n * @param {any} [that]\n */\nCommandInterceptor.prototype.preExecuted = createHook('preExecuted');\n\n/**\n * Add a phase of command interceptor.\n *\n * @param {Events} [events] command(s) to intercept\n * @param {number} [priority]\n * @param {ComposeHandlerFunction|HandlerFunction} handlerFn\n * @param {boolean} [unwrap] whether the event should be unwrapped\n * @param {any} [that]\n */\nCommandInterceptor.prototype.execute = createHook('execute');\n\n/**\n * Add a phase of command interceptor.\n *\n * @param {Events} [events] command(s) to intercept\n * @param {number} [priority]\n * @param {ComposeHandlerFunction|HandlerFunction} handlerFn\n * @param {boolean} [unwrap] whether the event should be unwrapped\n * @param {any} [that]\n */\nCommandInterceptor.prototype.executed = createHook('executed');\n\n/**\n * Add a phase of command interceptor.\n *\n * @param {Events} [events] command(s) to intercept\n * @param {number} [priority]\n * @param {ComposeHandlerFunction|HandlerFunction} handlerFn\n * @param {boolean} [unwrap] whether the event should be unwrapped\n * @param {any} [that]\n */\nCommandInterceptor.prototype.postExecute = createHook('postExecute');\n\n/**\n * Add a phase of command interceptor.\n *\n * @param {Events} [events] command(s) to intercept\n * @param {number} [priority]\n * @param {ComposeHandlerFunction|HandlerFunction} handlerFn\n * @param {boolean} [unwrap] whether the event should be unwrapped\n * @param {any} [that]\n */\nCommandInterceptor.prototype.postExecuted = createHook('postExecuted');\n\n/**\n * Add a phase of command interceptor.\n *\n * @param {Events} [events] command(s) to intercept\n * @param {number} [priority]\n * @param {ComposeHandlerFunction|HandlerFunction} handlerFn\n * @param {boolean} [unwrap] whether the event should be unwrapped\n * @param {any} [that]\n */\nCommandInterceptor.prototype.revert = createHook('revert');\n\n/**\n * Add a phase of command interceptor.\n *\n * @param {Events} [events] command(s) to intercept\n * @param {number} [priority]\n * @param {ComposeHandlerFunction|HandlerFunction} handlerFn\n * @param {boolean} [unwrap] whether the event should be unwrapped\n * @param {any} [that]\n */\nCommandInterceptor.prototype.reverted = createHook('reverted');\n\n/*\n * Add prototype methods for each phase of command execution (e.g. execute,\n * revert).\n *\n * @param {string} hook\n *\n * @return { (\n * events?: Events,\n * priority?: number,\n * handlerFn: ComposeHandlerFunction|HandlerFunction,\n * unwrap?: boolean\n * ) => any }\n */\nfunction createHook(hook) {\n\n /**\n * @this {CommandInterceptor}\n *\n * @param {Events} [events]\n * @param {number} [priority]\n * @param {ComposeHandlerFunction|HandlerFunction} handlerFn\n * @param {boolean} [unwrap]\n * @param {any} [that]\n */\n const hookFn = function(events, priority, handlerFn, unwrap, that) {\n\n if (isFunction(events) || isNumber(events)) {\n that = unwrap;\n unwrap = handlerFn;\n handlerFn = priority;\n priority = events;\n events = null;\n }\n\n this.on(events, hook, priority, handlerFn, unwrap, that);\n };\n\n return hookFn;\n}\n", "import inherits from 'inherits-browser';\n\nimport CommandInterceptor from '../../command/CommandInterceptor';\n\n/**\n * @typedef {import('didi').Injector} Injector\n *\n * @typedef {import('../../core/Canvas').default} Canvas\n */\n\n/**\n * A modeling behavior that ensures we set the correct root element\n * as we undo and redo commands.\n *\n * @param {Canvas} canvas\n * @param {Injector} injector\n */\nexport default function RootElementsBehavior(canvas, injector) {\n\n injector.invoke(CommandInterceptor, this);\n\n this.executed(function(event) {\n var context = event.context;\n\n if (context.rootElement) {\n canvas.setRootElement(context.rootElement);\n } else {\n context.rootElement = canvas.getRootElement();\n }\n });\n\n this.revert(function(event) {\n var context = event.context;\n\n if (context.rootElement) {\n canvas.setRootElement(context.rootElement);\n }\n });\n}\n\ninherits(RootElementsBehavior, CommandInterceptor);\n\nRootElementsBehavior.$inject = [ 'canvas', 'injector' ];", "import RootElementsBehavior from './RootElementsBehavior';\n\n\n/**\n * @type { import('didi').ModuleDeclaration }\n */\nexport default {\n __init__: [ 'rootElementsBehavior' ],\n rootElementsBehavior: [ 'type', RootElementsBehavior ]\n};\n", "/**\n * @param {string} str\n *\n * @return {string}\n */\nexport function escapeCSS(str) {\n return CSS.escape(str);\n}\n\nvar HTML_ESCAPE_MAP = {\n '&': '&',\n '<': '<',\n '>': '>',\n '\"': '"',\n '\\'': '''\n};\n\n/**\n * @param {string} str\n *\n * @return {string}\n */\nexport function escapeHTML(str) {\n str = '' + str;\n\n return str && str.replace(/[&<>\"']/g, function(match) {\n return HTML_ESCAPE_MAP[match];\n });\n}\n", "import { getDi, is } from './ModelUtil';\n\n/**\n * @typedef {import('../model/Types').Element} Element\n * @typedef {import('../model/Types').ModdleElement} ModdleElement\n */\n\nexport var planeSuffix = '_plane';\n\n/**\n * Get primary shape ID for a plane.\n *\n * @param {Element|ModdleElement} element\n *\n * @return {string}\n */\nexport function getShapeIdFromPlane(element) {\n var id = element.id;\n\n return removePlaneSuffix(id);\n}\n\n/**\n * Get plane ID for a primary shape.\n *\n * @param {Element|ModdleElement} element\n *\n * @return {string}\n */\nexport function getPlaneIdFromShape(element) {\n var id = element.id;\n\n if (is(element, 'bpmn:SubProcess')) {\n return addPlaneSuffix(id);\n }\n\n return id;\n}\n\n/**\n * Get plane ID for primary shape ID.\n *\n * @param {string} id\n *\n * @return {string}\n */\nexport function toPlaneId(id) {\n return addPlaneSuffix(id);\n}\n\n/**\n * Check wether element is plane.\n *\n * @param {Element|ModdleElement} element\n *\n * @return {boolean}\n */\nexport function isPlane(element) {\n var di = getDi(element);\n\n return is(di, 'bpmndi:BPMNPlane');\n}\n\nfunction addPlaneSuffix(id) {\n return id + planeSuffix;\n}\n\nfunction removePlaneSuffix(id) {\n return id.replace(new RegExp(planeSuffix + '$'), '');\n}", "import { domify, classes } from 'min-dom';\nimport { find } from 'min-dash';\n\nimport { escapeHTML } from 'diagram-js/lib/util/EscapeUtil';\nimport { getBusinessObject, is } from '../../util/ModelUtil';\nimport {\n getPlaneIdFromShape\n} from '../../util/DrilldownUtil';\n\n/**\n * @typedef {import('diagram-js/lib/core/Canvas').default} Canvas\n * @typedef {import('diagram-js/lib/core/ElementRegistry').default} ElementRegistry\n * @typedef {import('diagram-js/lib/core/EventBus').default} EventBus\n *\n * @typedef {import('../../model/Types').Element} Element\n * @typedef {import('../../model/Types').Shape} Shape\n */\n\nvar OPEN_CLASS = 'bjs-breadcrumbs-shown';\n\n\n/**\n * Adds overlays that allow switching planes on collapsed subprocesses.\n *\n * @param {EventBus} eventBus\n * @param {ElementRegistry} elementRegistry\n * @param {Canvas} canvas\n */\nexport default function DrilldownBreadcrumbs(eventBus, elementRegistry, canvas) {\n var breadcrumbs = domify('
      ');\n var container = canvas.getContainer();\n var containerClasses = classes(container);\n container.appendChild(breadcrumbs);\n\n var businessObjectParents = [];\n\n // update breadcrumbs if name or ID of the primary shape changes\n eventBus.on('element.changed', function(event) {\n var shape = event.element,\n businessObject = getBusinessObject(shape);\n\n var isPresent = find(businessObjectParents, function(element) {\n return element === businessObject;\n });\n\n if (!isPresent) {\n return;\n }\n\n updateBreadcrumbs();\n });\n\n /**\n * Updates the displayed breadcrumbs. If no element is provided, only the\n * labels are updated.\n *\n * @param {Element} [element]\n */\n function updateBreadcrumbs(element) {\n if (element) {\n businessObjectParents = getBusinessObjectParentChain(element);\n }\n\n var path = businessObjectParents.flatMap(function(parent) {\n var parentPlane =\n canvas.findRoot(getPlaneIdFromShape(parent)) ||\n canvas.findRoot(parent.id);\n\n // when the root is a collaboration, the process does not have a\n // corresponding element in the elementRegisty. Instead, we search\n // for the corresponding participant\n if (!parentPlane && is(parent, 'bpmn:Process')) {\n var participant = elementRegistry.find(function(element) {\n var businessObject = getBusinessObject(element);\n\n return businessObject && businessObject.get('processRef') === parent;\n });\n\n parentPlane = participant && canvas.findRoot(participant.id);\n }\n\n if (!parentPlane) {\n return [];\n }\n\n var title = escapeHTML(parent.name || parent.id);\n var link = domify('
    • ' + title + '
    • ');\n\n link.addEventListener('click', function() {\n canvas.setRootElement(parentPlane);\n });\n\n return link;\n });\n\n breadcrumbs.innerHTML = '';\n\n // show breadcrumbs and expose state to .djs-container\n var visible = path.length > 1;\n\n containerClasses.toggle(OPEN_CLASS, visible);\n\n path.forEach(function(element) {\n breadcrumbs.appendChild(element);\n });\n }\n\n eventBus.on('root.set', function(event) {\n updateBreadcrumbs(event.element);\n });\n\n}\n\nDrilldownBreadcrumbs.$inject = [ 'eventBus', 'elementRegistry', 'canvas' ];\n\n\n// helpers //////////\n\n/**\n * Returns the parents for the element using the business object chain,\n * starting with the root element.\n *\n * @param {Shape} child\n *\n * @return {Shape}\n */\nfunction getBusinessObjectParentChain(child) {\n var businessObject = getBusinessObject(child);\n\n var parents = [];\n\n for (var element = businessObject; element; element = element.$parent) {\n if (is(element, 'bpmn:SubProcess') || is(element, 'bpmn:Process')) {\n parents.push(element);\n }\n }\n\n return parents.reverse();\n}", "import { is } from '../../util/ModelUtil';\n\n/**\n * @typedef {import('diagram-js/lib/core/Canvas').default} Canvas\n * @typedef {import('diagram-js/lib/core/EventBus').default} EventBus\n */\n\n/**\n * Move collapsed subprocesses into view when drilling down.\n *\n * Zoom and scroll are saved in a session.\n *\n * @param {EventBus} eventBus\n * @param {Canvas} canvas\n */\nexport default function DrilldownCentering(eventBus, canvas) {\n\n var currentRoot = null;\n var positionMap = new Map();\n\n eventBus.on('root.set', function(event) {\n var newRoot = event.element;\n var currentViewbox = canvas.viewbox();\n var storedViewbox = positionMap.get(newRoot);\n\n positionMap.set(currentRoot, {\n x: currentViewbox.x,\n y: currentViewbox.y,\n zoom: currentViewbox.scale\n });\n\n currentRoot = newRoot;\n\n // Keep viewbox when replacing root elements\n if (!is(newRoot, 'bpmn:SubProcess') && !storedViewbox) {\n return;\n }\n\n storedViewbox = storedViewbox || { x: 0, y: 0, zoom: 1 };\n\n var dx = (currentViewbox.x - storedViewbox.x) * currentViewbox.scale,\n dy = (currentViewbox.y - storedViewbox.y) * currentViewbox.scale;\n\n if (dx !== 0 || dy !== 0) {\n canvas.scroll({\n dx: dx,\n dy: dy\n });\n }\n\n if (storedViewbox.zoom !== currentViewbox.scale) {\n canvas.zoom(storedViewbox.zoom, { x: 0, y: 0 });\n }\n });\n\n eventBus.on('diagram.clear', function() {\n positionMap.clear();\n currentRoot = null;\n });\n\n}\n\nDrilldownCentering.$inject = [ 'eventBus', 'canvas' ];\n\n\n/**\n * ES5 Map implementation. Works.\n */\nfunction Map() {\n\n this._entries = [];\n\n this.set = function(key, value) {\n\n var found = false;\n\n for (var k in this._entries) {\n if (this._entries[k][0] === key) {\n this._entries[k][1] = value;\n\n found = true;\n\n break;\n }\n }\n\n if (!found) {\n this._entries.push([ key, value ]);\n }\n };\n\n this.get = function(key) {\n\n for (var k in this._entries) {\n if (this._entries[k][0] === key) {\n return this._entries[k][1];\n }\n }\n\n return null;\n };\n\n this.clear = function() {\n this._entries.length = 0;\n };\n\n this.remove = function(key) {\n\n var idx = -1;\n\n for (var k in this._entries) {\n if (this._entries[k][0] === key) {\n idx = k;\n\n break;\n }\n }\n\n if (idx !== -1) {\n this._entries.splice(idx, 1);\n }\n };\n}", "\nimport { asBounds, asTRBL } from 'diagram-js/lib/layout/LayoutUtil';\nimport { is, isAny } from '../../util/ModelUtil';\n\n/**\n * @typedef {import('diagram-js/lib/core/EventBus').default} EventBus\n * @typedef {import('../../model/Types').Moddle} Moddle\n *\n * @typedef {import('../../model/Types').Element} Element\n * @typedef {import('../../model/Types').Shape} Shape\n *\n * @typedef {import('diagram-js/lib/core/Canvas').CanvasPlane} CanvasPlane\n *\n * @typedef {import('diagram-js/lib/util/Types').Rect} Rect\n */\n\nvar DEFAULT_POSITION = {\n x: 180,\n y: 160\n};\n\n/**\n * Hook into `import.render.start` and create new planes for diagrams with\n * collapsed subprocesses and all DI elements on the same plane.\n *\n * @param {EventBus} eventBus\n * @param {Moddle} moddle\n */\nexport default function SubprocessCompatibility(eventBus, moddle) {\n this._eventBus = eventBus;\n this._moddle = moddle;\n\n var self = this;\n\n eventBus.on('import.render.start', 1500, function(e, context) {\n self._handleImport(context.definitions);\n });\n}\n\n/**\n * @param {ModdleElement} definitions\n */\nSubprocessCompatibility.prototype._handleImport = function(definitions) {\n if (!definitions.diagrams) {\n return;\n }\n\n var self = this;\n this._definitions = definitions;\n this._processToDiagramMap = {};\n\n definitions.diagrams.forEach(function(diagram) {\n if (!diagram.plane || !diagram.plane.bpmnElement) {\n return;\n }\n\n self._processToDiagramMap[diagram.plane.bpmnElement.id] = diagram;\n });\n\n var newDiagrams = definitions.diagrams\n .filter(diagram => diagram.plane)\n .flatMap(diagram => self._createNewDiagrams(diagram.plane));\n\n newDiagrams.forEach(function(diagram) {\n self._movePlaneElementsToOrigin(diagram.plane);\n });\n};\n\n\n/**\n * Moves all DI elements from collapsed subprocesses to a new plane.\n *\n * @param {CanvasPlane} plane\n *\n * @return {ModdleElement[]} new diagrams created for the collapsed subprocesses\n */\nSubprocessCompatibility.prototype._createNewDiagrams = function(plane) {\n var self = this;\n\n var collapsedElements = [];\n var elementsToMove = [];\n\n plane.get('planeElement').forEach(function(diElement) {\n var businessObject = diElement.bpmnElement;\n\n if (!businessObject) {\n return;\n }\n\n var parent = businessObject.$parent;\n\n if (is(businessObject, 'bpmn:SubProcess') && !diElement.isExpanded) {\n collapsedElements.push(businessObject);\n }\n\n if (shouldMoveToPlane(businessObject, plane)) {\n\n // don't change the array while we iterate over it\n elementsToMove.push({ diElement: diElement, parent: parent });\n }\n });\n\n var newDiagrams = [];\n\n // create new planes for all collapsed subprocesses, even when they are empty\n collapsedElements.forEach(function(element) {\n if (!self._processToDiagramMap[ element.id ]) {\n var diagram = self._createDiagram(element);\n\n self._processToDiagramMap[element.id] = diagram;\n\n newDiagrams.push(diagram);\n }\n });\n\n elementsToMove.forEach(function(element) {\n var diElement = element.diElement;\n var parent = element.parent;\n\n // parent is expanded, get nearest collapsed parent\n while (parent && collapsedElements.indexOf(parent) === -1) {\n parent = parent.$parent;\n }\n\n // false positive, all parents are expanded\n if (!parent) {\n return;\n }\n\n var diagram = self._processToDiagramMap[ parent.id ];\n\n self._moveToDiPlane(diElement, diagram.plane);\n });\n\n return newDiagrams;\n};\n\n/**\n * @param {CanvasPlane} plane\n */\nSubprocessCompatibility.prototype._movePlaneElementsToOrigin = function(plane) {\n var elements = plane.get('planeElement');\n\n // get bounding box of all elements\n var planeBounds = getPlaneBounds(plane);\n\n var offset = {\n x: planeBounds.x - DEFAULT_POSITION.x,\n y: planeBounds.y - DEFAULT_POSITION.y\n };\n\n elements.forEach(function(diElement) {\n if (diElement.waypoint) {\n diElement.waypoint.forEach(function(waypoint) {\n waypoint.x = waypoint.x - offset.x;\n waypoint.y = waypoint.y - offset.y;\n });\n } else if (diElement.bounds) {\n diElement.bounds.x = diElement.bounds.x - offset.x;\n diElement.bounds.y = diElement.bounds.y - offset.y;\n }\n });\n};\n\n/**\n * @param {ModdleElement} diElement\n * @param {CanvasPlane} newPlane\n */\nSubprocessCompatibility.prototype._moveToDiPlane = function(diElement, newPlane) {\n var containingDiagram = findRootDiagram(diElement);\n\n // remove DI from old Plane and add it to the new one\n var parentPlaneElement = containingDiagram.plane.get('planeElement');\n\n parentPlaneElement.splice(parentPlaneElement.indexOf(diElement), 1);\n\n newPlane.get('planeElement').push(diElement);\n};\n\n/**\n * @param {ModdleElement} businessObject\n *\n * @return {ModdleElement}\n */\nSubprocessCompatibility.prototype._createDiagram = function(businessObject) {\n var plane = this._moddle.create('bpmndi:BPMNPlane', {\n bpmnElement: businessObject\n });\n\n var diagram = this._moddle.create('bpmndi:BPMNDiagram', {\n plane: plane\n });\n\n plane.$parent = diagram;\n\n plane.bpmnElement = businessObject;\n\n diagram.$parent = this._definitions;\n\n this._definitions.diagrams.push(diagram);\n\n return diagram;\n};\n\nSubprocessCompatibility.$inject = [ 'eventBus', 'moddle' ];\n\n\n// helpers //////////\n\nfunction findRootDiagram(element) {\n if (is(element, 'bpmndi:BPMNDiagram')) {\n return element;\n } else {\n return findRootDiagram(element.$parent);\n }\n}\n\n/**\n * @param {CanvasPlane} plane\n *\n * @return {Rect}\n */\nfunction getPlaneBounds(plane) {\n var planeTrbl = {\n top: Infinity,\n right: -Infinity,\n bottom: -Infinity,\n left: Infinity\n };\n\n plane.planeElement.forEach(function(element) {\n if (!element.bounds) {\n return;\n }\n\n var trbl = asTRBL(element.bounds);\n\n planeTrbl.top = Math.min(trbl.top, planeTrbl.top);\n planeTrbl.left = Math.min(trbl.left, planeTrbl.left);\n });\n\n return asBounds(planeTrbl);\n}\n\n/**\n * @param {ModdleElement} businessObject\n * @param {CanvasPlane} plane\n *\n * @return {boolean}\n */\nfunction shouldMoveToPlane(businessObject, plane) {\n var parent = businessObject.$parent;\n\n // don't move elements that are already on the plane\n if (!is(parent, 'bpmn:SubProcess') || parent === plane.bpmnElement) {\n return false;\n }\n\n // dataAssociations are children of the subprocess but rendered on process level\n // cf. https://github.com/bpmn-io/bpmn-js/issues/1619\n if (isAny(businessObject, [ 'bpmn:DataInputAssociation', 'bpmn:DataOutputAssociation' ])) {\n return false;\n }\n\n return true;\n}\n", "import inherits from 'inherits-browser';\n\nimport CommandInterceptor from 'diagram-js/lib/command/CommandInterceptor';\nimport { getBusinessObject, is } from '../../util/ModelUtil';\nimport { classes, domify } from 'min-dom';\nimport { getPlaneIdFromShape } from '../../util/DrilldownUtil';\n\n/**\n * @typedef {import('diagram-js/lib/core/Canvas').default} Canvas\n * @typedef {import('diagram-js/lib/core/ElementRegistry').default} ElementRegistry\n * @typedef {import('diagram-js/lib/core/EventBus').default} EventBus\n * @typedef {import('diagram-js/lib/features/overlays/Overlays').default} Overlays\n * @typedef {import('diagram-js/lib/i18n/translate/translate').default} Translate\n *\n * @typedef {import('../../model/Types').Element} Element\n * @typedef {import('../../model/Types').Parent} Parent\n * @typedef {import('../../model/Types').Shape} Shape\n */\n\nvar LOW_PRIORITY = 250;\nvar ARROW_DOWN_SVG = '';\n\nvar EMPTY_MARKER = 'bjs-drilldown-empty';\n\n/**\n * @param {Canvas} canvas\n * @param {EventBus} eventBus\n * @param {ElementRegistry} elementRegistry\n * @param {Overlays} overlays\n * @param {Translate} translate\n */\nexport default function DrilldownOverlayBehavior(\n canvas, eventBus, elementRegistry, overlays, translate\n) {\n CommandInterceptor.call(this, eventBus);\n\n this._canvas = canvas;\n this._eventBus = eventBus;\n this._elementRegistry = elementRegistry;\n this._overlays = overlays;\n this._translate = translate;\n\n var self = this;\n\n this.executed('shape.toggleCollapse', LOW_PRIORITY, function(context) {\n var shape = context.shape;\n\n // Add overlay to the collapsed shape\n if (self._canDrillDown(shape)) {\n self._addOverlay(shape);\n } else {\n self._removeOverlay(shape);\n }\n }, true);\n\n\n this.reverted('shape.toggleCollapse', LOW_PRIORITY, function(context) {\n var shape = context.shape;\n\n // Add overlay to the collapsed shape\n if (self._canDrillDown(shape)) {\n self._addOverlay(shape);\n } else {\n self._removeOverlay(shape);\n }\n }, true);\n\n\n this.executed([ 'shape.create', 'shape.move', 'shape.delete' ], LOW_PRIORITY,\n function(context) {\n var oldParent = context.oldParent,\n newParent = context.newParent || context.parent,\n shape = context.shape;\n\n // Add overlay to the collapsed shape\n if (self._canDrillDown(shape)) {\n self._addOverlay(shape);\n }\n\n self._updateDrilldownOverlay(oldParent);\n self._updateDrilldownOverlay(newParent);\n self._updateDrilldownOverlay(shape);\n }, true);\n\n\n this.reverted([ 'shape.create', 'shape.move', 'shape.delete' ], LOW_PRIORITY,\n function(context) {\n var oldParent = context.oldParent,\n newParent = context.newParent || context.parent,\n shape = context.shape;\n\n // Add overlay to the collapsed shape\n if (self._canDrillDown(shape)) {\n self._addOverlay(shape);\n }\n\n self._updateDrilldownOverlay(oldParent);\n self._updateDrilldownOverlay(newParent);\n self._updateDrilldownOverlay(shape);\n }, true);\n\n\n eventBus.on('import.render.complete', function() {\n elementRegistry.filter(function(e) {\n return self._canDrillDown(e);\n }).map(function(el) {\n self._addOverlay(el);\n });\n });\n\n}\n\ninherits(DrilldownOverlayBehavior, CommandInterceptor);\n\n/**\n * @param {Shape} shape\n */\nDrilldownOverlayBehavior.prototype._updateDrilldownOverlay = function(shape) {\n var canvas = this._canvas;\n\n if (!shape) {\n return;\n }\n\n var root = canvas.findRoot(shape);\n\n if (root) {\n this._updateOverlayVisibility(root);\n }\n};\n\n/**\n * @param {Element} element\n *\n * @return {boolean}\n */\nDrilldownOverlayBehavior.prototype._canDrillDown = function(element) {\n var canvas = this._canvas;\n\n return is(element, 'bpmn:SubProcess') && canvas.findRoot(getPlaneIdFromShape(element));\n};\n\n/**\n * Update the visibility of the drilldown overlay. If the plane has no elements,\n * the drilldown will only be shown when the element is selected.\n *\n * @param {Parent} element The collapsed root or shape.\n */\nDrilldownOverlayBehavior.prototype._updateOverlayVisibility = function(element) {\n var overlays = this._overlays;\n\n var businessObject = getBusinessObject(element);\n\n var overlay = overlays.get({ element: businessObject.id, type: 'drilldown' })[0];\n\n if (!overlay) {\n return;\n }\n\n var hasFlowElements = businessObject\n && businessObject.get('flowElements')\n && businessObject.get('flowElements').length;\n\n classes(overlay.html).toggle(EMPTY_MARKER, !hasFlowElements);\n};\n\n/**\n * Add a drilldown button to the given element assuming the plane has the same\n * ID as the element.\n *\n * @param {Shape} element The collapsed shape.\n */\nDrilldownOverlayBehavior.prototype._addOverlay = function(element) {\n var canvas = this._canvas,\n overlays = this._overlays,\n bo = getBusinessObject(element);\n\n var existingOverlays = overlays.get({ element: element, type: 'drilldown' });\n\n if (existingOverlays.length) {\n this._removeOverlay(element);\n }\n\n var button = domify(''),\n elementName = bo.get('name') || bo.get('id'),\n title = this._translate('Open {element}', { element: elementName });\n button.setAttribute('title', title);\n\n button.addEventListener('click', function() {\n canvas.setRootElement(canvas.findRoot(getPlaneIdFromShape(element)));\n });\n\n overlays.add(element, 'drilldown', {\n position: {\n bottom: -7,\n right: -8\n },\n html: button\n });\n\n this._updateOverlayVisibility(element);\n};\n\nDrilldownOverlayBehavior.prototype._removeOverlay = function(element) {\n var overlays = this._overlays;\n\n overlays.remove({\n element: element,\n type: 'drilldown'\n });\n};\n\nDrilldownOverlayBehavior.$inject = [\n 'canvas',\n 'eventBus',\n 'elementRegistry',\n 'overlays',\n 'translate'\n];", "import OverlaysModule from 'diagram-js/lib/features/overlays';\nimport ChangeSupportModule from 'diagram-js/lib/features/change-support';\nimport RootElementsModule from 'diagram-js/lib/features/root-elements';\n\nimport DrilldownBreadcrumbs from './DrilldownBreadcrumbs';\nimport DrilldownCentering from './DrilldownCentering';\nimport SubprocessCompatibility from './SubprocessCompatibility';\nimport DrilldownOverlayBehavior from './DrilldownOverlayBehavior';\n\nexport default {\n __depends__: [ OverlaysModule, ChangeSupportModule, RootElementsModule ],\n __init__: [ 'drilldownBreadcrumbs', 'drilldownOverlayBehavior', 'drilldownCentering', 'subprocessCompatibility' ],\n drilldownBreadcrumbs: [ 'type', DrilldownBreadcrumbs ],\n drilldownCentering: [ 'type', DrilldownCentering ],\n drilldownOverlayBehavior: [ 'type', DrilldownOverlayBehavior ],\n subprocessCompatibility: [ 'type', SubprocessCompatibility ]\n};", "import { getBBox } from '../../util/Elements';\n\nvar LOW_PRIORITY = 500;\n\nimport {\n append as svgAppend,\n attr as svgAttr,\n create as svgCreate\n} from 'tiny-svg';\n\nimport {\n query as domQuery\n} from 'min-dom';\n\nimport {\n assign,\n forEach,\n isFunction\n} from 'min-dash';\n\nvar DEFAULT_PRIORITY = 1000;\n\n/**\n * @typedef {import('../../model/Types').Element} Element\n *\n * @typedef {import('./OutlineProvider').default} OutlineProvider\n * @typedef {import('../../core/EventBus').default} EventBus\n * @typedef {import('../../draw/Styles').default} Styles\n */\n\n/**\n * @class\n *\n * A plugin that adds an outline to shapes and connections that may be activated and styled\n * via CSS classes.\n *\n * @param {EventBus} eventBus\n * @param {Styles} styles\n */\nexport default function Outline(eventBus, styles) {\n\n this._eventBus = eventBus;\n\n this.offset = 5;\n\n var OUTLINE_STYLE = styles.cls('djs-outline', [ 'no-fill' ]);\n\n var self = this;\n\n /**\n * @param {SVGElement} gfx\n *\n * @return {SVGElement} outline\n */\n function createOutline(gfx) {\n var outline = svgCreate('rect');\n\n svgAttr(outline, assign({\n x: 0,\n y: 0,\n rx: 4,\n width: 100,\n height: 100\n }, OUTLINE_STYLE));\n\n return outline;\n }\n\n // A low priortity is necessary, because outlines of labels have to be updated\n // after the label bounds have been updated in the renderer.\n eventBus.on([ 'shape.added', 'shape.changed' ], LOW_PRIORITY, function(event) {\n var element = event.element,\n gfx = event.gfx;\n\n var outline = domQuery('.djs-outline', gfx);\n\n if (!outline) {\n outline = self.getOutline(element) || createOutline(gfx);\n svgAppend(gfx, outline);\n }\n\n self.updateShapeOutline(outline, element);\n });\n\n eventBus.on([ 'connection.added', 'connection.changed' ], function(event) {\n var element = event.element,\n gfx = event.gfx;\n\n var outline = domQuery('.djs-outline', gfx);\n\n if (!outline) {\n outline = createOutline(gfx);\n svgAppend(gfx, outline);\n }\n\n self.updateConnectionOutline(outline, element);\n });\n}\n\n\n/**\n * Updates the outline of a shape respecting the dimension of the\n * element and an outline offset.\n *\n * @param {SVGElement} outline\n * @param {Element} element\n */\nOutline.prototype.updateShapeOutline = function(outline, element) {\n\n var updated = false;\n var providers = this._getProviders();\n\n if (providers.length) {\n forEach(providers, function(provider) {\n updated = updated || provider.updateOutline(element, outline);\n });\n }\n\n if (!updated) {\n svgAttr(outline, {\n x: -this.offset,\n y: -this.offset,\n width: element.width + this.offset * 2,\n height: element.height + this.offset * 2\n });\n }\n};\n\n/**\n * Updates the outline of a connection respecting the bounding box of\n * the connection and an outline offset.\n * Register an outline provider with the given priority.\n *\n * @param {SVGElement} outline\n * @param {Element} connection\n */\nOutline.prototype.updateConnectionOutline = function(outline, connection) {\n var bbox = getBBox(connection);\n\n svgAttr(outline, {\n x: bbox.x - this.offset,\n y: bbox.y - this.offset,\n width: bbox.width + this.offset * 2,\n height: bbox.height + this.offset * 2\n });\n};\n\n/**\n * Register an outline provider with the given priority.\n *\n * @param {number} priority\n * @param {OutlineProvider} provider\n */\nOutline.prototype.registerProvider = function(priority, provider) {\n if (!provider) {\n provider = priority;\n priority = DEFAULT_PRIORITY;\n }\n\n this._eventBus.on('outline.getProviders', priority, function(event) {\n event.providers.push(provider);\n });\n};\n\n/**\n * Returns the registered outline providers.\n *\n * @returns {OutlineProvider[]}\n */\nOutline.prototype._getProviders = function() {\n var event = this._eventBus.createEvent({\n type: 'outline.getProviders',\n providers: []\n });\n\n this._eventBus.fire(event);\n\n return event.providers;\n};\n\n/**\n * Returns the outline for an element.\n *\n * @param {Element} element\n */\nOutline.prototype.getOutline = function(element) {\n var outline;\n var providers = this._getProviders();\n\n forEach(providers, function(provider) {\n\n if (!isFunction(provider.getOutline)) {\n return;\n }\n\n outline = outline || provider.getOutline(element);\n });\n\n return outline;\n};\n\nOutline.$inject = [ 'eventBus', 'styles', 'elementRegistry' ];", "import Outline from './Outline';\n\n\n/**\n * @type { import('didi').ModuleDeclaration }\n */\nexport default {\n __init__: [ 'outline' ],\n outline: [ 'type', Outline ]\n};", "import {\n create as svgCreate\n} from 'tiny-svg';\n\nexport const DATA_OBJECT_REFERENCE_OUTLINE_PATH = 'M44.7648 11.3263L36.9892 2.64074C36.0451 1.58628 34.5651 0.988708 33.1904 0.988708H5.98667C3.22688 0.988708 0.989624 3.34892 0.989624 6.26039V55.0235C0.989624 57.9349 3.22688 60.2952 5.98667 60.2952H40.966C43.7257 60.2952 45.963 57.9349 45.963 55.0235V14.9459C45.963 13.5998 45.6407 12.3048 44.7648 11.3263Z';\nexport const DATA_STORE_REFERENCE_OUTLINE_PATH = 'M1.03845 48.1347C1.03845 49.3511 1.07295 50.758 1.38342 52.064C1.69949 53.3938 2.32428 54.7154 3.56383 55.6428C6.02533 57.4841 10.1161 58.7685 14.8212 59.6067C19.5772 60.4538 25.1388 60.8738 30.6831 60.8738C36.2276 60.8738 41.7891 60.4538 46.545 59.6067C51.2504 58.7687 55.3412 57.4842 57.8028 55.6429C59.0424 54.7156 59.6673 53.3938 59.9834 52.064C60.2938 50.7579 60.3285 49.351 60.3285 48.1344V13.8415C60.3285 12.6249 60.2938 11.218 59.9834 9.91171C59.6673 8.58194 59.0423 7.2602 57.8027 6.33294C55.341 4.49168 51.2503 3.20723 46.545 2.36914C41.7891 1.522 36.2276 1.10204 30.6831 1.10205C25.1388 1.10206 19.5772 1.52206 14.8213 2.36923C10.1162 3.20734 6.02543 4.49183 3.5639 6.33314C2.32433 7.26038 1.69951 8.58206 1.38343 9.91181C1.07295 11.2179 1.03845 12.6247 1.03845 13.8411V48.1347Z';\n\n/**\n * @typedef { import('diagram-js/lib/util/Types').Dimensions} Dimensions\n */\n\n/**\n * @type {Dimensions}\n */\nexport const DATA_OBJECT_REFERENCE_STANDARD_SIZE = { width: 36, height: 50 };\n\n/**\n * @type {Dimensions}\n */\nexport const DATA_STORE_REFERENCE_STANDARD_SIZE = { width: 50, height: 50 };\n\n/**\n * Create a path element with given attributes.\n * @param {string} path\n * @param {Object} attrs\n * @param {Object} OUTLINE_STYLE\n * @return {SVGElement}\n */\nexport function createPath(path, attrs, OUTLINE_STYLE) {\n return svgCreate('path', {\n d: path,\n strokeWidth: 2,\n transform: `translate(${attrs.x}, ${attrs.y})`,\n ...OUTLINE_STYLE\n });\n}", "import { assign } from 'min-dash';\n\nimport {\n attr as svgAttr,\n create as svgCreate\n} from 'tiny-svg';\n\nimport {\n is,\n isAny\n} from '../../util/ModelUtil';\n\nimport { isLabel } from '../../util/LabelUtil';\n\nimport {\n DATA_OBJECT_REFERENCE_OUTLINE_PATH,\n DATA_STORE_REFERENCE_OUTLINE_PATH,\n DATA_OBJECT_REFERENCE_STANDARD_SIZE,\n DATA_STORE_REFERENCE_STANDARD_SIZE,\n createPath\n} from './OutlineUtil';\n\n/**\n * @typedef { import('diagram-js/lib/features/outline/OutlineProvider').default } BaseOutlineProvider\n *\n * @typedef { import('diagram-js/lib/features/outline/OutlineProvider').Outline } Outline\n *\n * @typedef { import('diagram-js/lib/draw/Styles').default } Styles\n *\n * @typedef { import('diagram-js/lib/model/Types').Element } Element\n */\n\nconst DEFAULT_OFFSET = 5;\n\n/**\n * BPMN-specific outline provider.\n *\n * @implements {BaseOutlineProvider}\n *\n * @param {Outline} outline\n * @param {Styles} styles\n */\nexport default function OutlineProvider(outline, styles) {\n\n this._styles = styles;\n outline.registerProvider(this);\n}\n\nOutlineProvider.$inject = [\n 'outline',\n 'styles'\n];\n\n/**\n * Returns outline for a given element.\n *\n * @param {Element} element\n *\n * @return {Outline}\n */\nOutlineProvider.prototype.getOutline = function(element) {\n\n const OUTLINE_STYLE = this._styles.cls('djs-outline', [ 'no-fill' ]);\n\n var outline;\n\n if (isLabel(element)) {\n return;\n }\n\n if (is(element, 'bpmn:Gateway')) {\n outline = svgCreate('rect');\n\n assign(outline.style, {\n 'transform-box': 'fill-box',\n 'transform': 'rotate(45deg)',\n 'transform-origin': 'center'\n });\n\n svgAttr(outline, assign({\n x: 2,\n y: 2,\n rx: 4,\n width: element.width - 4,\n height: element.height - 4,\n }, OUTLINE_STYLE));\n\n } else if (isAny(element, [ 'bpmn:Task', 'bpmn:SubProcess', 'bpmn:Group', 'bpmn:CallActivity' ])) {\n outline = svgCreate('rect');\n\n svgAttr(outline, assign({\n x: -DEFAULT_OFFSET,\n y: -DEFAULT_OFFSET,\n rx: 14,\n width: element.width + DEFAULT_OFFSET * 2,\n height: element.height + DEFAULT_OFFSET * 2\n }, OUTLINE_STYLE));\n\n } else if (is(element, 'bpmn:EndEvent')) {\n\n outline = svgCreate('circle');\n\n // Extra 1px offset needed due to increased stroke-width of end event\n // which makes it bigger than other events.\n\n svgAttr(outline, assign({\n cx: element.width / 2,\n cy: element.height / 2,\n r: element.width / 2 + DEFAULT_OFFSET + 1\n }, OUTLINE_STYLE));\n\n } else if (is(element, 'bpmn:Event')) {\n outline = svgCreate('circle');\n\n svgAttr(outline, assign({\n cx: element.width / 2,\n cy: element.height / 2,\n r: element.width / 2 + DEFAULT_OFFSET\n }, OUTLINE_STYLE));\n\n } else if (is(element, 'bpmn:DataObjectReference') && isStandardSize(element, 'bpmn:DataObjectReference')) {\n\n outline = createPath(\n DATA_OBJECT_REFERENCE_OUTLINE_PATH,\n { x: -6, y: -6 },\n OUTLINE_STYLE\n );\n\n } else if (is(element, 'bpmn:DataStoreReference') && isStandardSize(element, 'bpmn:DataStoreReference')) {\n\n outline = createPath(\n DATA_STORE_REFERENCE_OUTLINE_PATH,\n { x: -6, y: -6 },\n OUTLINE_STYLE\n );\n }\n\n return outline;\n};\n\n/**\n * Updates the outline for a given element.\n * Returns true if the update for the given element was handled by this provider.\n *\n * @param {Element} element\n * @param {Outline} outline\n * @returns {boolean}\n */\nOutlineProvider.prototype.updateOutline = function(element, outline) {\n\n if (isLabel(element)) {\n return;\n }\n\n if (isAny(element, [ 'bpmn:SubProcess', 'bpmn:Group' ])) {\n\n svgAttr(outline, {\n width: element.width + DEFAULT_OFFSET * 2,\n height: element.height + DEFAULT_OFFSET * 2\n });\n\n return true;\n\n } else if (isAny(element, [\n 'bpmn:Event',\n 'bpmn:Gateway',\n 'bpmn:DataStoreReference',\n 'bpmn:DataObjectReference'\n ])) {\n return true;\n }\n\n return false;\n};\n\n\n// helpers //////////\n\nfunction isStandardSize(element, type) {\n var standardSize;\n\n if (type === 'bpmn:DataObjectReference') {\n standardSize = DATA_OBJECT_REFERENCE_STANDARD_SIZE;\n } else if (type === 'bpmn:DataStoreReference') {\n standardSize = DATA_STORE_REFERENCE_STANDARD_SIZE;\n }\n\n return element.width === standardSize.width\n && element.height === standardSize.height;\n}", "import Ouline from 'diagram-js/lib/features/outline';\nimport OulineProvider from './OutlineProvider';\n\nexport default {\n __depends__: [\n Ouline\n ],\n __init__: [ 'outlineProvider' ],\n outlineProvider: [ 'type', OulineProvider ]\n};\n", "/**\n * @typedef {import('../util/Types').Point} Point\n */\n\nfunction __stopPropagation(event) {\n if (!event || typeof event.stopPropagation !== 'function') {\n return;\n }\n\n event.stopPropagation();\n}\n\n/**\n * @param {import('../core/EventBus').Event} event\n *\n * @return {Event}\n */\nexport function getOriginal(event) {\n return event.originalEvent || event.srcEvent;\n}\n\n/**\n * @param {Event|import('../core/EventBus').Event} event\n */\nexport function stopPropagation(event) {\n __stopPropagation(event);\n __stopPropagation(getOriginal(event));\n}\n\n/**\n * @param {Event} event\n *\n * @return {Point|null}\n */\nexport function toPoint(event) {\n\n if (event.pointers && event.pointers.length) {\n event = event.pointers[0];\n }\n\n if (event.touches && event.touches.length) {\n event = event.touches[0];\n }\n\n return event ? {\n x: event.clientX,\n y: event.clientY\n } : null;\n}", "export function isMac() {\n return (/mac/i).test(navigator.platform);\n}", "import {\n getOriginal as getOriginalEvent\n} from './Event';\n\nimport {\n isMac\n} from './Platform';\n\nexport {\n isMac\n} from './Platform';\n\n/**\n * @param {MouseEvent} event\n * @param {string} button\n *\n * @return {boolean}\n */\nexport function isButton(event, button) {\n return (getOriginalEvent(event) || event).button === button;\n}\n\n/**\n * @param {MouseEvent} event\n *\n * @return {boolean}\n */\nexport function isPrimaryButton(event) {\n\n // button === 0 -> left áka primary mouse button\n return isButton(event, 0);\n}\n\n/**\n * @param {MouseEvent} event\n *\n * @return {boolean}\n */\nexport function isAuxiliaryButton(event) {\n\n // button === 1 -> auxiliary áka wheel button\n return isButton(event, 1);\n}\n\n/**\n * @param {MouseEvent} event\n *\n * @return {boolean}\n */\nexport function isSecondaryButton(event) {\n\n // button === 2 -> right áka secondary button\n return isButton(event, 2);\n}\n\n/**\n * @param {MouseEvent} event\n *\n * @return {boolean}\n */\nexport function hasPrimaryModifier(event) {\n var originalEvent = getOriginalEvent(event) || event;\n\n if (!isPrimaryButton(event)) {\n return false;\n }\n\n // Use cmd as primary modifier key for mac OS\n if (isMac()) {\n return originalEvent.metaKey;\n } else {\n return originalEvent.ctrlKey;\n }\n}\n\n/**\n * @param {MouseEvent} event\n *\n * @return {boolean}\n */\nexport function hasSecondaryModifier(event) {\n var originalEvent = getOriginalEvent(event) || event;\n\n return isPrimaryButton(event) && originalEvent.shiftKey;\n}\n", "import {\n forEach,\n assign\n} from 'min-dash';\n\nimport {\n delegate as domDelegate,\n query as domQuery,\n queryAll as domQueryAll\n} from 'min-dom';\n\nimport {\n isPrimaryButton,\n isAuxiliaryButton\n} from '../../util/Mouse';\n\nimport {\n append as svgAppend,\n attr as svgAttr,\n create as svgCreate,\n remove as svgRemove\n} from 'tiny-svg';\n\nimport {\n createLine,\n updateLine\n} from '../../util/RenderUtil';\n\n/**\n * @typedef {import('../../model/Types').Element} Element\n *\n * @typedef {import('../../core/ElementRegistry').default} ElementRegistry\n * @typedef {import('../../core/EventBus').default} EventBus\n * @typedef {import('../../draw/Styles').default} Styles\n *\n * @typedef {import('../../util/Types').Point} Point\n */\n\nfunction allowAll(event) { return true; }\n\nfunction allowPrimaryAndAuxiliary(event) {\n return isPrimaryButton(event) || isAuxiliaryButton(event);\n}\n\nvar LOW_PRIORITY = 500;\n\n\n/**\n * A plugin that provides interaction events for diagram elements.\n *\n * It emits the following events:\n *\n * * element.click\n * * element.contextmenu\n * * element.dblclick\n * * element.hover\n * * element.mousedown\n * * element.mousemove\n * * element.mouseup\n * * element.out\n *\n * Each event is a tuple { element, gfx, originalEvent }.\n *\n * Canceling the event via Event#preventDefault()\n * prevents the original DOM operation.\n *\n * @param {EventBus} eventBus\n * @param {ElementRegistry} elementRegistry\n * @param {Styles} styles\n */\nexport default function InteractionEvents(eventBus, elementRegistry, styles) {\n\n var self = this;\n\n /**\n * Fire an interaction event.\n *\n * @param {string} type local event name, e.g. element.click.\n * @param {MouseEvent|TouchEvent} event native event\n * @param {Element} [element] the diagram element to emit the event on;\n * defaults to the event target\n */\n function fire(type, event, element) {\n\n if (isIgnored(type, event)) {\n return;\n }\n\n var target, gfx, returnValue;\n\n if (!element) {\n target = event.delegateTarget || event.target;\n\n if (target) {\n gfx = target;\n element = elementRegistry.get(gfx);\n }\n } else {\n gfx = elementRegistry.getGraphics(element);\n }\n\n if (!gfx || !element) {\n return;\n }\n\n returnValue = eventBus.fire(type, {\n element: element,\n gfx: gfx,\n originalEvent: event\n });\n\n if (returnValue === false) {\n event.stopPropagation();\n event.preventDefault();\n }\n }\n\n // TODO(nikku): document this\n var handlers = {};\n\n function mouseHandler(localEventName) {\n return handlers[localEventName];\n }\n\n function isIgnored(localEventName, event) {\n\n var filter = ignoredFilters[localEventName] || isPrimaryButton;\n\n // only react on left mouse button interactions\n // except for interaction events that are enabled\n // for secundary mouse button\n return !filter(event);\n }\n\n var bindings = {\n click: 'element.click',\n contextmenu: 'element.contextmenu',\n dblclick: 'element.dblclick',\n mousedown: 'element.mousedown',\n mousemove: 'element.mousemove',\n mouseover: 'element.hover',\n mouseout: 'element.out',\n mouseup: 'element.mouseup',\n };\n\n var ignoredFilters = {\n 'element.contextmenu': allowAll,\n 'element.mousedown': allowPrimaryAndAuxiliary,\n 'element.mouseup': allowPrimaryAndAuxiliary,\n 'element.click': allowPrimaryAndAuxiliary,\n 'element.dblclick': allowPrimaryAndAuxiliary\n };\n\n\n // manual event trigger //////////\n\n /**\n * Trigger an interaction event (based on a native dom event)\n * on the target shape or connection.\n *\n * @param {string} eventName the name of the triggered DOM event\n * @param {MouseEvent|TouchEvent} event\n * @param {Element} targetElement\n */\n function triggerMouseEvent(eventName, event, targetElement) {\n\n // i.e. element.mousedown...\n var localEventName = bindings[eventName];\n\n if (!localEventName) {\n throw new Error('unmapped DOM event name <' + eventName + '>');\n }\n\n return fire(localEventName, event, targetElement);\n }\n\n\n var ELEMENT_SELECTOR = 'svg, .djs-element';\n\n // event handling ///////\n\n function registerEvent(node, event, localEvent, ignoredFilter) {\n\n var handler = handlers[localEvent] = function(event) {\n fire(localEvent, event);\n };\n\n if (ignoredFilter) {\n ignoredFilters[localEvent] = ignoredFilter;\n }\n\n handler.$delegate = domDelegate.bind(node, ELEMENT_SELECTOR, event, handler);\n }\n\n function unregisterEvent(node, event, localEvent) {\n\n var handler = mouseHandler(localEvent);\n\n if (!handler) {\n return;\n }\n\n domDelegate.unbind(node, event, handler.$delegate);\n }\n\n function registerEvents(svg) {\n forEach(bindings, function(val, key) {\n registerEvent(svg, key, val);\n });\n }\n\n function unregisterEvents(svg) {\n forEach(bindings, function(val, key) {\n unregisterEvent(svg, key, val);\n });\n }\n\n eventBus.on('canvas.destroy', function(event) {\n unregisterEvents(event.svg);\n });\n\n eventBus.on('canvas.init', function(event) {\n registerEvents(event.svg);\n });\n\n\n // hit box updating ////////////////\n\n eventBus.on([ 'shape.added', 'connection.added' ], function(event) {\n var element = event.element,\n gfx = event.gfx;\n\n eventBus.fire('interactionEvents.createHit', { element: element, gfx: gfx });\n });\n\n // Update djs-hit on change.\n // A low priortity is necessary, because djs-hit of labels has to be updated\n // after the label bounds have been updated in the renderer.\n eventBus.on([\n 'shape.changed',\n 'connection.changed'\n ], LOW_PRIORITY, function(event) {\n\n var element = event.element,\n gfx = event.gfx;\n\n eventBus.fire('interactionEvents.updateHit', { element: element, gfx: gfx });\n });\n\n eventBus.on('interactionEvents.createHit', LOW_PRIORITY, function(event) {\n var element = event.element,\n gfx = event.gfx;\n\n self.createDefaultHit(element, gfx);\n });\n\n eventBus.on('interactionEvents.updateHit', function(event) {\n var element = event.element,\n gfx = event.gfx;\n\n self.updateDefaultHit(element, gfx);\n });\n\n\n // hit styles ////////////\n\n var STROKE_HIT_STYLE = createHitStyle('djs-hit djs-hit-stroke');\n\n var CLICK_STROKE_HIT_STYLE = createHitStyle('djs-hit djs-hit-click-stroke');\n\n var ALL_HIT_STYLE = createHitStyle('djs-hit djs-hit-all');\n\n var NO_MOVE_HIT_STYLE = createHitStyle('djs-hit djs-hit-no-move');\n\n var HIT_TYPES = {\n 'all': ALL_HIT_STYLE,\n 'click-stroke': CLICK_STROKE_HIT_STYLE,\n 'stroke': STROKE_HIT_STYLE,\n 'no-move': NO_MOVE_HIT_STYLE\n };\n\n function createHitStyle(classNames, attrs) {\n\n attrs = assign({\n stroke: 'white',\n strokeWidth: 15\n }, attrs || {});\n\n return styles.cls(classNames, [ 'no-fill', 'no-border' ], attrs);\n }\n\n\n // style helpers ///////////////\n\n function applyStyle(hit, type) {\n\n var attrs = HIT_TYPES[type];\n\n if (!attrs) {\n throw new Error('invalid hit type <' + type + '>');\n }\n\n svgAttr(hit, attrs);\n\n return hit;\n }\n\n function appendHit(gfx, hit) {\n svgAppend(gfx, hit);\n }\n\n\n // API\n\n /**\n * Remove hints on the given graphics.\n *\n * @param {SVGElement} gfx\n */\n this.removeHits = function(gfx) {\n var hits = domQueryAll('.djs-hit', gfx);\n\n forEach(hits, svgRemove);\n };\n\n /**\n * Create default hit for the given element.\n *\n * @param {Element} element\n * @param {SVGElement} gfx\n *\n * @return {SVGElement} created hit\n */\n this.createDefaultHit = function(element, gfx) {\n var waypoints = element.waypoints,\n isFrame = element.isFrame,\n boxType;\n\n if (waypoints) {\n return this.createWaypointsHit(gfx, waypoints);\n } else {\n\n boxType = isFrame ? 'stroke' : 'all';\n\n return this.createBoxHit(gfx, boxType, {\n width: element.width,\n height: element.height\n });\n }\n };\n\n /**\n * Create hits for the given waypoints.\n *\n * @param {SVGElement} gfx\n * @param {Point[]} waypoints\n *\n * @return {SVGElement}\n */\n this.createWaypointsHit = function(gfx, waypoints) {\n\n var hit = createLine(waypoints);\n\n applyStyle(hit, 'stroke');\n\n appendHit(gfx, hit);\n\n return hit;\n };\n\n /**\n * Create hits for a box.\n *\n * @param {SVGElement} gfx\n * @param {string} type\n * @param {Object} attrs\n *\n * @return {SVGElement}\n */\n this.createBoxHit = function(gfx, type, attrs) {\n\n attrs = assign({\n x: 0,\n y: 0\n }, attrs);\n\n var hit = svgCreate('rect');\n\n applyStyle(hit, type);\n\n svgAttr(hit, attrs);\n\n appendHit(gfx, hit);\n\n return hit;\n };\n\n /**\n * Update default hit of the element.\n *\n * @param {Element} element\n * @param {SVGElement} gfx\n *\n * @return {SVGElement} updated hit\n */\n this.updateDefaultHit = function(element, gfx) {\n\n var hit = domQuery('.djs-hit', gfx);\n\n if (!hit) {\n return;\n }\n\n if (element.waypoints) {\n updateLine(hit, element.waypoints);\n } else {\n svgAttr(hit, {\n width: element.width,\n height: element.height\n });\n }\n\n return hit;\n };\n\n this.fire = fire;\n\n this.triggerMouseEvent = triggerMouseEvent;\n\n this.mouseHandler = mouseHandler;\n\n this.registerEvent = registerEvent;\n this.unregisterEvent = unregisterEvent;\n}\n\n\nInteractionEvents.$inject = [\n 'eventBus',\n 'elementRegistry',\n 'styles'\n];\n\n\n/**\n * An event indicating that the mouse hovered over an element\n *\n * @event element.hover\n *\n * @type {Object}\n * @property {Element} element\n * @property {SVGElement} gfx\n * @property {Event} originalEvent\n */\n\n/**\n * An event indicating that the mouse has left an element\n *\n * @event element.out\n *\n * @type {Object}\n * @property {Element} element\n * @property {SVGElement} gfx\n * @property {Event} originalEvent\n */\n\n/**\n * An event indicating that the mouse has clicked an element\n *\n * @event element.click\n *\n * @type {Object}\n * @property {Element} element\n * @property {SVGElement} gfx\n * @property {Event} originalEvent\n */\n\n/**\n * An event indicating that the mouse has double clicked an element\n *\n * @event element.dblclick\n *\n * @type {Object}\n * @property {Element} element\n * @property {SVGElement} gfx\n * @property {Event} originalEvent\n */\n\n/**\n * An event indicating that the mouse has gone down on an element.\n *\n * @event element.mousedown\n *\n * @type {Object}\n * @property {Element} element\n * @property {SVGElement} gfx\n * @property {Event} originalEvent\n */\n\n/**\n * An event indicating that the mouse has gone up on an element.\n *\n * @event element.mouseup\n *\n * @type {Object}\n * @property {Element} element\n * @property {SVGElement} gfx\n * @property {Event} originalEvent\n */\n\n/**\n * An event indicating that the context menu action is triggered\n * via mouse or touch controls.\n *\n * @event element.contextmenu\n *\n * @type {Object}\n * @property {Element} element\n * @property {SVGElement} gfx\n * @property {Event} originalEvent\n */", "import InteractionEvents from './InteractionEvents';\n\n\n/**\n * @type { import('didi').ModuleDeclaration }\n */\nexport default {\n __init__: [ 'interactionEvents' ],\n interactionEvents: [ 'type', InteractionEvents ]\n};", "import {\n isArray,\n forEach\n} from 'min-dash';\n\n/**\n * @typedef {import('../../core/Canvas').default} Canvas\n * @typedef {import('../../core/EventBus').default} EventBus\n */\n\n/**\n * A service that offers the current selection in a diagram.\n * Offers the api to control the selection, too.\n *\n * @param {EventBus} eventBus\n * @param {Canvas} canvas\n */\nexport default function Selection(eventBus, canvas) {\n\n this._eventBus = eventBus;\n this._canvas = canvas;\n\n /**\n * @type {Object[]}\n */\n this._selectedElements = [];\n\n var self = this;\n\n eventBus.on([ 'shape.remove', 'connection.remove' ], function(e) {\n var element = e.element;\n self.deselect(element);\n });\n\n eventBus.on([ 'diagram.clear', 'root.set' ], function(e) {\n self.select(null);\n });\n}\n\nSelection.$inject = [ 'eventBus', 'canvas' ];\n\n/**\n * Deselect an element.\n *\n * @param {Object} element The element to deselect.\n */\nSelection.prototype.deselect = function(element) {\n var selectedElements = this._selectedElements;\n\n var idx = selectedElements.indexOf(element);\n\n if (idx !== -1) {\n var oldSelection = selectedElements.slice();\n\n selectedElements.splice(idx, 1);\n\n this._eventBus.fire('selection.changed', { oldSelection: oldSelection, newSelection: selectedElements });\n }\n};\n\n/**\n * Get the selected elements.\n *\n * @return {Object[]} The selected elements.\n */\nSelection.prototype.get = function() {\n return this._selectedElements;\n};\n\n/**\n * Check whether an element is selected.\n *\n * @param {Object} element The element.\n *\n * @return {boolean} Whether the element is selected.\n */\nSelection.prototype.isSelected = function(element) {\n return this._selectedElements.indexOf(element) !== -1;\n};\n\n\n/**\n * Select one or many elements.\n *\n * @param {Object|Object[]} elements The element(s) to select.\n * @param {boolean} [add] Whether to add the element(s) to the selected elements.\n * Defaults to `false`.\n */\nSelection.prototype.select = function(elements, add) {\n var selectedElements = this._selectedElements,\n oldSelection = selectedElements.slice();\n\n if (!isArray(elements)) {\n elements = elements ? [ elements ] : [];\n }\n\n var canvas = this._canvas;\n\n var rootElement = canvas.getRootElement();\n\n elements = elements.filter(function(element) {\n var elementRoot = canvas.findRoot(element);\n\n return rootElement === elementRoot;\n });\n\n // selection may be cleared by passing an empty array or null\n // to the method\n if (add) {\n forEach(elements, function(element) {\n if (selectedElements.indexOf(element) !== -1) {\n\n // already selected\n return;\n } else {\n selectedElements.push(element);\n }\n });\n } else {\n this._selectedElements = selectedElements = elements.slice();\n }\n\n this._eventBus.fire('selection.changed', { oldSelection: oldSelection, newSelection: selectedElements });\n};\n", "import {\n assign,\n forEach\n} from 'min-dash';\n\nimport {\n append as svgAppend,\n attr as svgAttr,\n classes as svgClasses,\n clear as svgClear,\n create as svgCreate\n} from 'tiny-svg';\n\nimport { getBBox } from '../../util/Elements';\n\n/**\n * @typedef {import('../../core/Canvas').default} Canvas\n * @typedef {import('../../core/EventBus').default} EventBus\n * @typedef {import('./Selection').default} Selection\n */\n\nvar MARKER_HOVER = 'hover',\n MARKER_SELECTED = 'selected';\n\nvar SELECTION_OUTLINE_PADDING = 6;\n\n\n/**\n * A plugin that adds a visible selection UI to shapes and connections\n * by appending the hover and selected classes to them.\n *\n * @class\n *\n * Makes elements selectable, too.\n *\n * @param {Canvas} canvas\n * @param {EventBus} eventBus\n * @param {Selection} selection\n */\nexport default function SelectionVisuals(canvas, eventBus, selection) {\n this._canvas = canvas;\n\n var self = this;\n\n this._multiSelectionBox = null;\n\n function addMarker(e, cls) {\n canvas.addMarker(e, cls);\n }\n\n function removeMarker(e, cls) {\n canvas.removeMarker(e, cls);\n }\n\n eventBus.on('element.hover', function(event) {\n addMarker(event.element, MARKER_HOVER);\n });\n\n eventBus.on('element.out', function(event) {\n removeMarker(event.element, MARKER_HOVER);\n });\n\n eventBus.on('selection.changed', function(event) {\n\n function deselect(s) {\n removeMarker(s, MARKER_SELECTED);\n }\n\n function select(s) {\n addMarker(s, MARKER_SELECTED);\n }\n\n var oldSelection = event.oldSelection,\n newSelection = event.newSelection;\n\n forEach(oldSelection, function(e) {\n if (newSelection.indexOf(e) === -1) {\n deselect(e);\n }\n });\n\n forEach(newSelection, function(e) {\n if (oldSelection.indexOf(e) === -1) {\n select(e);\n }\n });\n\n self._updateSelectionOutline(newSelection);\n });\n\n\n eventBus.on('element.changed', function(event) {\n if (selection.isSelected(event.element)) {\n self._updateSelectionOutline(selection.get());\n }\n });\n}\n\nSelectionVisuals.$inject = [\n 'canvas',\n 'eventBus',\n 'selection'\n];\n\nSelectionVisuals.prototype._updateSelectionOutline = function(selection) {\n var layer = this._canvas.getLayer('selectionOutline');\n\n svgClear(layer);\n\n var enabled = selection.length > 1;\n\n var container = this._canvas.getContainer();\n\n svgClasses(container)[enabled ? 'add' : 'remove']('djs-multi-select');\n\n if (!enabled) {\n return;\n }\n\n var bBox = addSelectionOutlinePadding(getBBox(selection));\n\n var rect = svgCreate('rect');\n\n svgAttr(rect, assign({\n rx: 3\n }, bBox));\n\n svgClasses(rect).add('djs-selection-outline');\n\n svgAppend(layer, rect);\n};\n\n// helpers //////////\n\nfunction addSelectionOutlinePadding(bBox) {\n return {\n x: bBox.x - SELECTION_OUTLINE_PADDING,\n y: bBox.y - SELECTION_OUTLINE_PADDING,\n width: bBox.width + SELECTION_OUTLINE_PADDING * 2,\n height: bBox.height + SELECTION_OUTLINE_PADDING * 2\n };\n}", "import {\n hasSecondaryModifier,\n isPrimaryButton\n} from '../../util/Mouse';\n\nimport {\n find,\n isArray\n} from 'min-dash';\n\n/**\n * @typedef {import('../../core/Canvas').default} Canvas\n * @typedef {import('../../core/ElementRegistry').default} ElementRegistry\n * @typedef {import('../../core/EventBus').default} EventBus\n * @typedef {import('./Selection').default} Selection\n */\n\n/**\n * @param {EventBus} eventBus\n * @param {Selection} selection\n * @param {Canvas} canvas\n * @param {ElementRegistry} elementRegistry\n */\nexport default function SelectionBehavior(eventBus, selection, canvas, elementRegistry) {\n\n // Select elements on create\n eventBus.on('create.end', 500, function(event) {\n var context = event.context,\n canExecute = context.canExecute,\n elements = context.elements,\n hints = context.hints || {},\n autoSelect = hints.autoSelect;\n\n if (canExecute) {\n if (autoSelect === false) {\n\n // Select no elements\n return;\n }\n\n if (isArray(autoSelect)) {\n selection.select(autoSelect);\n } else {\n\n // Select all elements by default\n selection.select(elements.filter(isShown));\n }\n }\n });\n\n // Select connection targets on connect\n eventBus.on('connect.end', 500, function(event) {\n var context = event.context,\n connection = context.connection;\n\n if (connection) {\n selection.select(connection);\n }\n });\n\n // Select shapes on move\n eventBus.on('shape.move.end', 500, function(event) {\n var previousSelection = event.previousSelection || [];\n\n var shape = elementRegistry.get(event.context.shape.id);\n\n // Always select main shape on move\n var isSelected = find(previousSelection, function(selectedShape) {\n return shape.id === selectedShape.id;\n });\n\n if (!isSelected) {\n selection.select(shape);\n }\n });\n\n // Select elements on click\n eventBus.on('element.click', function(event) {\n\n if (!isPrimaryButton(event)) {\n return;\n }\n\n var element = event.element;\n\n if (element === canvas.getRootElement()) {\n element = null;\n }\n\n var isSelected = selection.isSelected(element),\n isMultiSelect = selection.get().length > 1;\n\n // Add to selection if SHIFT pressed\n var add = hasSecondaryModifier(event);\n\n if (isSelected && isMultiSelect) {\n if (add) {\n\n // Deselect element\n return selection.deselect(element);\n } else {\n\n // Select element only\n return selection.select(element);\n }\n } else if (!isSelected) {\n\n // Select element\n selection.select(element, add);\n } else {\n\n // Deselect element\n selection.deselect(element);\n }\n });\n}\n\nSelectionBehavior.$inject = [\n 'eventBus',\n 'selection',\n 'canvas',\n 'elementRegistry'\n];\n\n\nfunction isShown(element) {\n return !element.hidden;\n}\n", "import InteractionEventsModule from '../interaction-events';\nimport OutlineModule from '../outline';\n\nimport Selection from './Selection';\nimport SelectionVisuals from './SelectionVisuals';\nimport SelectionBehavior from './SelectionBehavior';\n\n\n/**\n * @type { import('didi').ModuleDeclaration }\n */\nexport default {\n __init__: [ 'selectionVisuals', 'selectionBehavior' ],\n __depends__: [\n InteractionEventsModule,\n OutlineModule\n ],\n selection: [ 'type', Selection ],\n selectionVisuals: [ 'type', SelectionVisuals ],\n selectionBehavior: [ 'type', SelectionBehavior ]\n};\n", "const CLASS_PATTERN = /^class[ {]/;\n\n\n/**\n * @param {function} fn\n *\n * @return {boolean}\n */\nexport function isClass(fn) {\n return CLASS_PATTERN.test(fn.toString());\n}\n\n/**\n * @param {any} obj\n *\n * @return {boolean}\n */\nexport function isArray(obj) {\n return Array.isArray(obj);\n}\n\n/**\n * @param {any} obj\n * @param {string} prop\n *\n * @return {boolean}\n */\nexport function hasOwnProp(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}", "import {\n isArray,\n isClass\n} from './util.js';\n\n/**\n * @typedef {import('./index.js').InjectAnnotated } InjectAnnotated\n */\n\n/**\n * @template T\n *\n * @params {[...string[], T] | ...string[], T} args\n *\n * @return {T & InjectAnnotated}\n */\nexport function annotate(...args) {\n\n if (args.length === 1 && isArray(args[0])) {\n args = args[0];\n }\n\n args = [ ...args ];\n\n const fn = args.pop();\n\n fn.$inject = args;\n\n return fn;\n}\n\n\n// Current limitations:\n// - can't put into \"function arg\" comments\n// function /* (no parenthesis like this) */ (){}\n// function abc( /* xx (no parenthesis like this) */ a, b) {}\n//\n// Just put the comment before function or inside:\n// /* (((this is fine))) */ function(a, b) {}\n// function abc(a) { /* (((this is fine))) */}\n//\n// - can't reliably auto-annotate constructor; we'll match the\n// first constructor(...) pattern found which may be the one\n// of a nested class, too.\n\nconst CONSTRUCTOR_ARGS = /constructor\\s*[^(]*\\(\\s*([^)]*)\\)/m;\nconst FN_ARGS = /^(?:async\\s+)?(?:function\\s*[^(]*)?(?:\\(\\s*([^)]*)\\)|(\\w+))/m;\nconst FN_ARG = /\\/\\*([^*]*)\\*\\//m;\n\n/**\n * @param {unknown} fn\n *\n * @return {string[]}\n */\nexport function parseAnnotations(fn) {\n\n if (typeof fn !== 'function') {\n throw new Error(`Cannot annotate \"${fn}\". Expected a function!`);\n }\n\n const match = fn.toString().match(isClass(fn) ? CONSTRUCTOR_ARGS : FN_ARGS);\n\n // may parse class without constructor\n if (!match) {\n return [];\n }\n\n const args = match[1] || match[2];\n\n return args && args.split(',').map(arg => {\n const argMatch = arg.match(FN_ARG);\n return (argMatch && argMatch[1] || arg).trim();\n }) || [];\n}", "import {\n parseAnnotations,\n annotate\n} from './annotation.js';\n\nimport {\n isArray,\n hasOwnProp\n} from './util.js';\n\n/**\n * @typedef { import('./index.js').ModuleDeclaration } ModuleDeclaration\n * @typedef { import('./index.js').ModuleDefinition } ModuleDefinition\n * @typedef { import('./index.js').InjectorContext } InjectorContext\n *\n * @typedef { import('./index.js').TypedDeclaration } TypedDeclaration\n */\n\n/**\n * Create a new injector with the given modules.\n *\n * @param {ModuleDefinition[]} modules\n * @param {InjectorContext} [_parent]\n */\nexport default function Injector(modules, _parent) {\n\n const parent = _parent || /** @type InjectorContext */ ({\n get: function(name, strict) {\n currentlyResolving.push(name);\n\n if (strict === false) {\n return null;\n } else {\n throw error(`No provider for \"${ name }\"!`);\n }\n }\n });\n\n const currentlyResolving = [];\n const providers = this._providers = Object.create(parent._providers || null);\n const instances = this._instances = Object.create(null);\n\n const self = instances.injector = this;\n\n const error = function(msg) {\n const stack = currentlyResolving.join(' -> ');\n currentlyResolving.length = 0;\n return new Error(stack ? `${ msg } (Resolving: ${ stack })` : msg);\n };\n\n /**\n * Return a named service.\n *\n * @param {string} name\n * @param {boolean} [strict=true] if false, resolve missing services to null\n *\n * @return {any}\n */\n function get(name, strict) {\n if (!providers[name] && name.includes('.')) {\n\n const parts = name.split('.');\n let pivot = get(/** @type { string } */ (parts.shift()));\n\n while (parts.length) {\n pivot = pivot[/** @type { string } */ (parts.shift())];\n }\n\n return pivot;\n }\n\n if (hasOwnProp(instances, name)) {\n return instances[name];\n }\n\n if (hasOwnProp(providers, name)) {\n if (currentlyResolving.indexOf(name) !== -1) {\n currentlyResolving.push(name);\n throw error('Cannot resolve circular dependency!');\n }\n\n currentlyResolving.push(name);\n instances[name] = providers[name][0](providers[name][1]);\n currentlyResolving.pop();\n\n return instances[name];\n }\n\n return parent.get(name, strict);\n }\n\n function fnDef(fn, locals) {\n\n if (typeof locals === 'undefined') {\n locals = {};\n }\n\n if (typeof fn !== 'function') {\n if (isArray(fn)) {\n fn = annotate(fn.slice());\n } else {\n throw error(`Cannot invoke \"${ fn }\". Expected a function!`);\n }\n }\n\n /**\n * @type {string[]}\n */\n const inject = fn.$inject || parseAnnotations(fn);\n const dependencies = inject.map(dep => {\n if (hasOwnProp(locals, dep)) {\n return locals[dep];\n } else {\n return get(dep);\n }\n });\n\n return {\n fn: fn,\n dependencies\n };\n }\n\n /**\n * Instantiate the given type, injecting dependencies.\n *\n * @template T\n *\n * @param { Function | [...string[], Function ]} type\n *\n * @return T\n */\n function instantiate(type) {\n const {\n fn,\n dependencies\n } = fnDef(type);\n\n // instantiate var args constructor\n const Constructor = Function.prototype.bind.call(fn, null, ...dependencies);\n\n return new Constructor();\n }\n\n /**\n * Invoke the given function, injecting dependencies. Return the result.\n *\n * @template T\n *\n * @param { Function | [...string[], Function ]} func\n * @param { Object } [context]\n * @param { Object } [locals]\n *\n * @return {T} invocation result\n */\n function invoke(func, context, locals) {\n const {\n fn,\n dependencies\n } = fnDef(func, locals);\n\n return fn.apply(context, dependencies);\n }\n\n /**\n * @param {Injector} childInjector\n *\n * @return {Function}\n */\n function createPrivateInjectorFactory(childInjector) {\n return annotate(key => childInjector.get(key));\n }\n\n /**\n * @param {ModuleDefinition[]} modules\n * @param {string[]} [forceNewInstances]\n *\n * @return {Injector}\n */\n function createChild(modules, forceNewInstances) {\n if (forceNewInstances && forceNewInstances.length) {\n const fromParentModule = Object.create(null);\n const matchedScopes = Object.create(null);\n\n const privateInjectorsCache = [];\n const privateChildInjectors = [];\n const privateChildFactories = [];\n\n let provider;\n let cacheIdx;\n let privateChildInjector;\n let privateChildInjectorFactory;\n\n for (let name in providers) {\n provider = providers[name];\n\n if (forceNewInstances.indexOf(name) !== -1) {\n if (provider[2] === 'private') {\n cacheIdx = privateInjectorsCache.indexOf(provider[3]);\n if (cacheIdx === -1) {\n privateChildInjector = provider[3].createChild([], forceNewInstances);\n privateChildInjectorFactory = createPrivateInjectorFactory(privateChildInjector);\n privateInjectorsCache.push(provider[3]);\n privateChildInjectors.push(privateChildInjector);\n privateChildFactories.push(privateChildInjectorFactory);\n fromParentModule[name] = [ privateChildInjectorFactory, name, 'private', privateChildInjector ];\n } else {\n fromParentModule[name] = [ privateChildFactories[cacheIdx], name, 'private', privateChildInjectors[cacheIdx] ];\n }\n } else {\n fromParentModule[name] = [ provider[2], provider[1] ];\n }\n matchedScopes[name] = true;\n }\n\n if ((provider[2] === 'factory' || provider[2] === 'type') && provider[1].$scope) {\n /* jshint -W083 */\n forceNewInstances.forEach(scope => {\n if (provider[1].$scope.indexOf(scope) !== -1) {\n fromParentModule[name] = [ provider[2], provider[1] ];\n matchedScopes[scope] = true;\n }\n });\n }\n }\n\n forceNewInstances.forEach(scope => {\n if (!matchedScopes[scope]) {\n throw new Error('No provider for \"' + scope + '\". Cannot use provider from the parent!');\n }\n });\n\n modules.unshift(fromParentModule);\n }\n\n return new Injector(modules, self);\n }\n\n const factoryMap = {\n factory: invoke,\n type: instantiate,\n value: function(value) {\n return value;\n }\n };\n\n /**\n * @param {ModuleDefinition} moduleDefinition\n * @param {Injector} injector\n */\n function createInitializer(moduleDefinition, injector) {\n\n const initializers = moduleDefinition.__init__ || [];\n\n return function() {\n initializers.forEach(initializer => {\n\n // eagerly resolve component (fn or string)\n if (typeof initializer === 'string') {\n injector.get(initializer);\n } else {\n injector.invoke(initializer);\n }\n });\n };\n }\n\n /**\n * @param {ModuleDefinition} moduleDefinition\n */\n function loadModule(moduleDefinition) {\n\n const moduleExports = moduleDefinition.__exports__;\n\n // private module\n if (moduleExports) {\n const nestedModules = moduleDefinition.__modules__;\n\n const clonedModule = Object.keys(moduleDefinition).reduce((clonedModule, key) => {\n\n if (key !== '__exports__' && key !== '__modules__' && key !== '__init__' && key !== '__depends__') {\n clonedModule[key] = moduleDefinition[key];\n }\n\n return clonedModule;\n }, Object.create(null));\n\n const childModules = (nestedModules || []).concat(clonedModule);\n\n const privateInjector = createChild(childModules);\n const getFromPrivateInjector = annotate(function(key) {\n return privateInjector.get(key);\n });\n\n moduleExports.forEach(function(key) {\n providers[key] = [ getFromPrivateInjector, key, 'private', privateInjector ];\n });\n\n // ensure child injector initializes\n const initializers = (moduleDefinition.__init__ || []).slice();\n\n initializers.unshift(function() {\n privateInjector.init();\n });\n\n moduleDefinition = Object.assign({}, moduleDefinition, {\n __init__: initializers\n });\n\n return createInitializer(moduleDefinition, privateInjector);\n }\n\n // normal module\n Object.keys(moduleDefinition).forEach(function(key) {\n\n if (key === '__init__' || key === '__depends__') {\n return;\n }\n\n const typeDeclaration = /** @type { TypedDeclaration } */ (\n moduleDefinition[key]\n );\n\n if (typeDeclaration[2] === 'private') {\n providers[key] = typeDeclaration;\n return;\n }\n\n const type = typeDeclaration[0];\n const value = typeDeclaration[1];\n\n providers[key] = [ factoryMap[type], arrayUnwrap(type, value), type ];\n });\n\n return createInitializer(moduleDefinition, self);\n }\n\n /**\n * @param {ModuleDefinition[]} moduleDefinitions\n * @param {ModuleDefinition} moduleDefinition\n *\n * @return {ModuleDefinition[]}\n */\n function resolveDependencies(moduleDefinitions, moduleDefinition) {\n\n if (moduleDefinitions.indexOf(moduleDefinition) !== -1) {\n return moduleDefinitions;\n }\n\n moduleDefinitions = (moduleDefinition.__depends__ || []).reduce(resolveDependencies, moduleDefinitions);\n\n if (moduleDefinitions.indexOf(moduleDefinition) !== -1) {\n return moduleDefinitions;\n }\n\n return moduleDefinitions.concat(moduleDefinition);\n }\n\n /**\n * @param {ModuleDefinition[]} moduleDefinitions\n *\n * @return { () => void } initializerFn\n */\n function bootstrap(moduleDefinitions) {\n\n const initializers = moduleDefinitions\n .reduce(resolveDependencies, [])\n .map(loadModule);\n\n let initialized = false;\n\n return function() {\n\n if (initialized) {\n return;\n }\n\n initialized = true;\n\n initializers.forEach(initializer => initializer());\n };\n }\n\n // public API\n this.get = get;\n this.invoke = invoke;\n this.instantiate = instantiate;\n this.createChild = createChild;\n\n // setup\n this.init = bootstrap(modules);\n}\n\n\n// helpers ///////////////\n\nfunction arrayUnwrap(type, value) {\n if (type !== 'value' && isArray(value)) {\n value = annotate(value.slice());\n }\n\n return value;\n}", "import inherits from 'inherits-browser';\n\nimport BaseRenderer from './BaseRenderer';\n\nimport {\n componentsToPath,\n createLine\n} from '../util/RenderUtil';\n\nimport {\n append as svgAppend,\n attr as svgAttr,\n create as svgCreate\n} from 'tiny-svg';\n\nimport { assign } from 'min-dash';\n\nimport {\n isFrameElement\n} from '../util/Elements';\n\n/**\n * @typedef {import('../core/EventBus').default} EventBus\n * @typedef {import('./Styles').default} Styles\n */\n\n// apply default renderer with lowest possible priority\n// so that it only kicks in if noone else could render\nvar DEFAULT_RENDER_PRIORITY = 1;\n\n/**\n * The default renderer used for shapes and connections.\n *\n * @param {EventBus} eventBus\n * @param {Styles} styles\n */\nexport default function DefaultRenderer(eventBus, styles) {\n\n BaseRenderer.call(this, eventBus, DEFAULT_RENDER_PRIORITY);\n\n this.CONNECTION_STYLE = styles.style([ 'no-fill' ], { strokeWidth: 5, stroke: 'fuchsia' });\n this.SHAPE_STYLE = styles.style({ fill: 'white', stroke: 'fuchsia', strokeWidth: 2 });\n this.FRAME_STYLE = styles.style([ 'no-fill' ], { stroke: 'fuchsia', strokeDasharray: 4, strokeWidth: 2 });\n}\n\ninherits(DefaultRenderer, BaseRenderer);\n\n\n/**\n * @private\n */\nDefaultRenderer.prototype.canRender = function() {\n return true;\n};\n\n/**\n * @private\n */\nDefaultRenderer.prototype.drawShape = function drawShape(visuals, element, attrs) {\n var rect = svgCreate('rect');\n\n svgAttr(rect, {\n x: 0,\n y: 0,\n width: element.width || 0,\n height: element.height || 0\n });\n\n if (isFrameElement(element)) {\n svgAttr(rect, assign({}, this.FRAME_STYLE, attrs || {}));\n } else {\n svgAttr(rect, assign({}, this.SHAPE_STYLE, attrs || {}));\n }\n\n svgAppend(visuals, rect);\n\n return rect;\n};\n\n/**\n * @private\n */\nDefaultRenderer.prototype.drawConnection = function drawConnection(visuals, connection, attrs) {\n\n var line = createLine(connection.waypoints, assign({}, this.CONNECTION_STYLE, attrs || {}));\n svgAppend(visuals, line);\n\n return line;\n};\n\n/**\n * @private\n */\nDefaultRenderer.prototype.getShapePath = function getShapePath(shape) {\n\n var x = shape.x,\n y = shape.y,\n width = shape.width,\n height = shape.height;\n\n var shapePath = [\n [ 'M', x, y ],\n [ 'l', width, 0 ],\n [ 'l', 0, height ],\n [ 'l', -width, 0 ],\n [ 'z' ]\n ];\n\n return componentsToPath(shapePath);\n};\n\n/**\n * @private\n */\nDefaultRenderer.prototype.getConnectionPath = function getConnectionPath(connection) {\n var waypoints = connection.waypoints;\n\n var idx, point, connectionPath = [];\n\n for (idx = 0; (point = waypoints[idx]); idx++) {\n\n // take invisible docking into account\n // when creating the path\n point = point.original || point;\n\n connectionPath.push([ idx === 0 ? 'M' : 'L', point.x, point.y ]);\n }\n\n return componentsToPath(connectionPath);\n};\n\nDefaultRenderer.$inject = [ 'eventBus', 'styles' ];\n", "import {\n isArray,\n assign,\n reduce\n} from 'min-dash';\n\n\n/**\n * A component that manages shape styles\n */\nexport default function Styles() {\n\n var defaultTraits = {\n\n 'no-fill': {\n fill: 'none'\n },\n 'no-border': {\n strokeOpacity: 0.0\n },\n 'no-events': {\n pointerEvents: 'none'\n }\n };\n\n var self = this;\n\n /**\n * Builds a style definition from a className, a list of traits and an object\n * of additional attributes.\n *\n * @param {string} className\n * @param {string[]} [traits]\n * @param {Object} [additionalAttrs]\n *\n * @return {Object} the style definition\n */\n this.cls = function(className, traits, additionalAttrs) {\n var attrs = this.style(traits, additionalAttrs);\n\n return assign(attrs, { 'class': className });\n };\n\n /**\n * Builds a style definition from a list of traits and an object of additional\n * attributes.\n *\n * @param {string[]} [traits]\n * @param {Object} additionalAttrs\n *\n * @return {Object} the style definition\n */\n this.style = function(traits, additionalAttrs) {\n\n if (!isArray(traits) && !additionalAttrs) {\n additionalAttrs = traits;\n traits = [];\n }\n\n var attrs = reduce(traits, function(attrs, t) {\n return assign(attrs, defaultTraits[t] || {});\n }, {});\n\n return additionalAttrs ? assign(attrs, additionalAttrs) : attrs;\n };\n\n\n /**\n * Computes a style definition from a list of traits and an object of\n * additional attributes, with custom style definition object.\n *\n * @param {Object} custom\n * @param {string[]} [traits]\n * @param {Object} defaultStyles\n *\n * @return {Object} the style definition\n */\n this.computeStyle = function(custom, traits, defaultStyles) {\n if (!isArray(traits)) {\n defaultStyles = traits;\n traits = [];\n }\n\n return self.style(traits || [], assign({}, defaultStyles, custom || {}));\n };\n}\n", "import DefaultRenderer from './DefaultRenderer';\nimport Styles from './Styles';\n\n/**\n * @type { import('didi').ModuleDeclaration }\n */\nexport default {\n __init__: [ 'defaultRenderer' ],\n defaultRenderer: [ 'type', DefaultRenderer ],\n styles: [ 'type', Styles ]\n};\n", "/**\n * Failsafe remove an element from a collection\n *\n * @param {Array} [collection]\n * @param {Object} [element]\n *\n * @return {number} the previous index of the element\n */\nexport function remove(collection, element) {\n\n if (!collection || !element) {\n return -1;\n }\n\n var idx = collection.indexOf(element);\n\n if (idx !== -1) {\n collection.splice(idx, 1);\n }\n\n return idx;\n}\n\n/**\n * Fail save add an element to the given connection, ensuring\n * it does not yet exist.\n *\n * @param {Array} collection\n * @param {Object} element\n * @param {number} [idx]\n */\nexport function add(collection, element, idx) {\n\n if (!collection || !element) {\n return;\n }\n\n if (typeof idx !== 'number') {\n idx = -1;\n }\n\n var currentIdx = collection.indexOf(element);\n\n if (currentIdx !== -1) {\n\n if (currentIdx === idx) {\n\n // nothing to do, position has not changed\n return;\n } else {\n\n if (idx !== -1) {\n\n // remove from current position\n collection.splice(currentIdx, 1);\n } else {\n\n // already exists in collection\n return;\n }\n }\n }\n\n if (idx !== -1) {\n\n // insert at specified position\n collection.splice(idx, 0, element);\n } else {\n\n // push to end\n collection.push(element);\n }\n}\n\n\n/**\n * Fail save get the index of an element in a collection.\n *\n * @param {Array} collection\n * @param {Object} element\n *\n * @return {number} the index or -1 if collection or element do\n * not exist or the element is not contained.\n */\nexport function indexOf(collection, element) {\n\n if (!collection || !element) {\n return -1;\n }\n\n return collection.indexOf(element);\n}\n", "import {\n isNumber,\n assign,\n forEach,\n every,\n debounce,\n bind,\n reduce,\n find\n} from 'min-dash';\n\nimport {\n assignStyle\n} from 'min-dom';\n\nimport {\n add as collectionAdd,\n remove as collectionRemove\n} from '../util/Collections';\n\nimport {\n getType,\n getBBox as getBoundingBox\n} from '../util/Elements';\n\nimport { asTRBL } from '../layout/LayoutUtil';\n\nimport {\n append as svgAppend,\n attr as svgAttr,\n classes as svgClasses,\n create as svgCreate,\n transform as svgTransform,\n remove as svgRemove\n} from 'tiny-svg';\n\nimport { createMatrix as createMatrix } from 'tiny-svg';\n\n\n/**\n * @typedef {import('./Types').ConnectionLike} ConnectionLike\n * @typedef {import('./Types').RootLike} RootLike\n * @typedef {import('./Types').ParentLike } ParentLike\n * @typedef {import('./Types').ShapeLike} ShapeLike\n *\n * @typedef { {\n * container?: HTMLElement;\n * deferUpdate?: boolean;\n * width?: number;\n * height?: number;\n * } } CanvasConfig\n * @typedef { {\n * group: SVGElement;\n * index: number;\n * visible: boolean;\n * } } CanvasLayer\n * @typedef { {\n * [key: string]: CanvasLayer;\n * } } CanvasLayers\n * @typedef { {\n * rootElement: ShapeLike;\n * layer: CanvasLayer;\n * } } CanvasPlane\n * @typedef { {\n * scale: number;\n * inner: Rect;\n * outer: Dimensions;\n * } & Rect } CanvasViewbox\n *\n * @typedef {import('./ElementRegistry').default} ElementRegistry\n * @typedef {import('./EventBus').default} EventBus\n * @typedef {import('./GraphicsFactory').default} GraphicsFactory\n *\n * @typedef {import('../util/Types').Dimensions} Dimensions\n * @typedef {import('../util/Types').Point} Point\n * @typedef {import('../util/Types').Rect} Rect\n * @typedef {import('../util/Types').RectTRBL} RectTRBL\n * @typedef {import('../util/Types').ScrollDelta} ScrollDelta\n */\n\nfunction round(number, resolution) {\n return Math.round(number * resolution) / resolution;\n}\n\nfunction ensurePx(number) {\n return isNumber(number) ? number + 'px' : number;\n}\n\nfunction findRoot(element) {\n while (element.parent) {\n element = element.parent;\n }\n\n return element;\n}\n\n/**\n * Creates a HTML container element for a SVG element with\n * the given configuration\n *\n * @param {CanvasConfig} options\n *\n * @return {HTMLElement} the container element\n */\nfunction createContainer(options) {\n\n options = assign({}, { width: '100%', height: '100%' }, options);\n\n const container = options.container || document.body;\n\n // create a
      around the svg element with the respective size\n // this way we can always get the correct container size\n // (this is impossible for elements at the moment)\n const parent = document.createElement('div');\n parent.setAttribute('class', 'djs-container djs-parent');\n\n assignStyle(parent, {\n position: 'relative',\n overflow: 'hidden',\n width: ensurePx(options.width),\n height: ensurePx(options.height)\n });\n\n container.appendChild(parent);\n\n return parent;\n}\n\nfunction createGroup(parent, cls, childIndex) {\n const group = svgCreate('g');\n svgClasses(group).add(cls);\n\n const index = childIndex !== undefined ? childIndex : parent.childNodes.length - 1;\n\n // must ensure second argument is node or _null_\n // cf. https://developer.mozilla.org/en-US/docs/Web/API/Node/insertBefore\n parent.insertBefore(group, parent.childNodes[index] || null);\n\n return group;\n}\n\nconst BASE_LAYER = 'base';\n\n// render plane contents behind utility layers\nconst PLANE_LAYER_INDEX = 0;\nconst UTILITY_LAYER_INDEX = 1;\n\n\nconst REQUIRED_MODEL_ATTRS = {\n shape: [ 'x', 'y', 'width', 'height' ],\n connection: [ 'waypoints' ]\n};\n\n/**\n * The main drawing canvas.\n *\n * @class\n * @constructor\n *\n * @emits Canvas#canvas.init\n *\n * @param {CanvasConfig|null} config\n * @param {EventBus} eventBus\n * @param {GraphicsFactory} graphicsFactory\n * @param {ElementRegistry} elementRegistry\n */\nexport default function Canvas(config, eventBus, graphicsFactory, elementRegistry) {\n this._eventBus = eventBus;\n this._elementRegistry = elementRegistry;\n this._graphicsFactory = graphicsFactory;\n\n /**\n * @type {number}\n */\n this._rootsIdx = 0;\n\n /**\n * @type {CanvasLayers}\n */\n this._layers = {};\n\n /**\n * @type {CanvasPlane[]}\n */\n this._planes = [];\n\n /**\n * @type {RootLike|null}\n */\n this._rootElement = null;\n\n this._init(config || {});\n}\n\nCanvas.$inject = [\n 'config.canvas',\n 'eventBus',\n 'graphicsFactory',\n 'elementRegistry'\n];\n\n/**\n * Creates a element that is wrapped into a
      .\n * This way we are always able to correctly figure out the size of the svg element\n * by querying the parent node.\n\n * (It is not possible to get the size of a svg element cross browser @ 2014-04-01)\n\n *
      \n * \n * ...\n * \n *
      \n *\n * @param {CanvasConfig} config\n */\nCanvas.prototype._init = function(config) {\n\n const eventBus = this._eventBus;\n\n // html container\n const container = this._container = createContainer(config);\n\n const svg = this._svg = svgCreate('svg');\n svgAttr(svg, { width: '100%', height: '100%' });\n\n svgAppend(container, svg);\n\n const viewport = this._viewport = createGroup(svg, 'viewport');\n\n // debounce canvas.viewbox.changed events when deferUpdate is set\n // to help with potential performance issues\n if (config.deferUpdate) {\n this._viewboxChanged = debounce(bind(this._viewboxChanged, this), 300);\n }\n\n eventBus.on('diagram.init', () => {\n\n /**\n * An event indicating that the canvas is ready to be drawn on.\n *\n * @memberOf Canvas\n *\n * @event canvas.init\n *\n * @type {Object}\n * @property {SVGElement} svg the created svg element\n * @property {SVGElement} viewport the direct parent of diagram elements and shapes\n */\n eventBus.fire('canvas.init', {\n svg: svg,\n viewport: viewport\n });\n\n });\n\n // reset viewbox on shape changes to\n // recompute the viewbox\n eventBus.on([\n 'shape.added',\n 'connection.added',\n 'shape.removed',\n 'connection.removed',\n 'elements.changed',\n 'root.set'\n ], () => {\n delete this._cachedViewbox;\n });\n\n eventBus.on('diagram.destroy', 500, this._destroy, this);\n eventBus.on('diagram.clear', 500, this._clear, this);\n};\n\nCanvas.prototype._destroy = function() {\n this._eventBus.fire('canvas.destroy', {\n svg: this._svg,\n viewport: this._viewport\n });\n\n const parent = this._container.parentNode;\n\n if (parent) {\n parent.removeChild(this._container);\n }\n\n delete this._svg;\n delete this._container;\n delete this._layers;\n delete this._planes;\n delete this._rootElement;\n delete this._viewport;\n};\n\nCanvas.prototype._clear = function() {\n\n const allElements = this._elementRegistry.getAll();\n\n // remove all elements\n allElements.forEach(element => {\n const type = getType(element);\n\n if (type === 'root') {\n this.removeRootElement(element);\n } else {\n this._removeElement(element, type);\n }\n });\n\n // remove all planes\n this._planes = [];\n this._rootElement = null;\n\n // force recomputation of view box\n delete this._cachedViewbox;\n};\n\n/**\n * Returns the default layer on which\n * all elements are drawn.\n *\n * @return {SVGElement} The SVG element of the layer.\n */\nCanvas.prototype.getDefaultLayer = function() {\n return this.getLayer(BASE_LAYER, PLANE_LAYER_INDEX);\n};\n\n/**\n * Returns a layer that is used to draw elements\n * or annotations on it.\n *\n * Non-existing layers retrieved through this method\n * will be created. During creation, the optional index\n * may be used to create layers below or above existing layers.\n * A layer with a certain index is always created above all\n * existing layers with the same index.\n *\n * @param {string} name The name of the layer.\n * @param {number} [index] The index of the layer.\n *\n * @return {SVGElement} The SVG element of the layer.\n */\nCanvas.prototype.getLayer = function(name, index) {\n\n if (!name) {\n throw new Error('must specify a name');\n }\n\n let layer = this._layers[name];\n\n if (!layer) {\n layer = this._layers[name] = this._createLayer(name, index);\n }\n\n // throw an error if layer creation / retrival is\n // requested on different index\n if (typeof index !== 'undefined' && layer.index !== index) {\n throw new Error('layer <' + name + '> already created at index <' + index + '>');\n }\n\n return layer.group;\n};\n\n/**\n * For a given index, return the number of layers that have a higher index and\n * are visible.\n *\n * This is used to determine the node a layer should be inserted at.\n *\n * @param {number} index\n *\n * @return {number}\n */\nCanvas.prototype._getChildIndex = function(index) {\n return reduce(this._layers, function(childIndex, layer) {\n if (layer.visible && index >= layer.index) {\n childIndex++;\n }\n\n return childIndex;\n }, 0);\n};\n\n/**\n * Creates a given layer and returns it.\n *\n * @param {string} name\n * @param {number} [index=0]\n *\n * @return {CanvasLayer}\n */\nCanvas.prototype._createLayer = function(name, index) {\n\n if (typeof index === 'undefined') {\n index = UTILITY_LAYER_INDEX;\n }\n\n const childIndex = this._getChildIndex(index);\n\n return {\n group: createGroup(this._viewport, 'layer-' + name, childIndex),\n index: index,\n visible: true\n };\n};\n\n\n/**\n * Shows a given layer.\n *\n * @param {string} name The name of the layer.\n *\n * @return {SVGElement} The SVG element of the layer.\n */\nCanvas.prototype.showLayer = function(name) {\n\n if (!name) {\n throw new Error('must specify a name');\n }\n\n const layer = this._layers[name];\n\n if (!layer) {\n throw new Error('layer <' + name + '> does not exist');\n }\n\n const viewport = this._viewport;\n const group = layer.group;\n const index = layer.index;\n\n if (layer.visible) {\n return group;\n }\n\n const childIndex = this._getChildIndex(index);\n\n viewport.insertBefore(group, viewport.childNodes[childIndex] || null);\n\n layer.visible = true;\n\n return group;\n};\n\n/**\n * Hides a given layer.\n *\n * @param {string} name The name of the layer.\n *\n * @return {SVGElement} The SVG element of the layer.\n */\nCanvas.prototype.hideLayer = function(name) {\n\n if (!name) {\n throw new Error('must specify a name');\n }\n\n const layer = this._layers[name];\n\n if (!layer) {\n throw new Error('layer <' + name + '> does not exist');\n }\n\n const group = layer.group;\n\n if (!layer.visible) {\n return group;\n }\n\n svgRemove(group);\n\n layer.visible = false;\n\n return group;\n};\n\n\nCanvas.prototype._removeLayer = function(name) {\n\n const layer = this._layers[name];\n\n if (layer) {\n delete this._layers[name];\n\n svgRemove(layer.group);\n }\n};\n\n/**\n * Returns the currently active layer. Can be null.\n *\n * @return {CanvasLayer|null} The active layer of `null`.\n */\nCanvas.prototype.getActiveLayer = function() {\n const plane = this._findPlaneForRoot(this.getRootElement());\n\n if (!plane) {\n return null;\n }\n\n return plane.layer;\n};\n\n\n/**\n * Returns the plane which contains the given element.\n *\n * @param {ShapeLike|ConnectionLike|string} element The element or its ID.\n *\n * @return {RootLike|undefined} The root of the element.\n */\nCanvas.prototype.findRoot = function(element) {\n if (typeof element === 'string') {\n element = this._elementRegistry.get(element);\n }\n\n if (!element) {\n return;\n }\n\n const plane = this._findPlaneForRoot(\n findRoot(element)\n ) || {};\n\n return plane.rootElement;\n};\n\n/**\n * Return a list of all root elements on the diagram.\n *\n * @return {(RootLike)[]} The list of root elements.\n */\nCanvas.prototype.getRootElements = function() {\n return this._planes.map(function(plane) {\n return plane.rootElement;\n });\n};\n\nCanvas.prototype._findPlaneForRoot = function(rootElement) {\n return find(this._planes, function(plane) {\n return plane.rootElement === rootElement;\n });\n};\n\n\n/**\n * Returns the html element that encloses the\n * drawing canvas.\n *\n * @return {HTMLElement} The HTML element of the container.\n */\nCanvas.prototype.getContainer = function() {\n return this._container;\n};\n\n\n// markers //////////////////////\n\nCanvas.prototype._updateMarker = function(element, marker, add) {\n let container;\n\n if (!element.id) {\n element = this._elementRegistry.get(element);\n }\n\n element.markers = element.markers || new Set();\n\n // we need to access all\n container = this._elementRegistry._elements[element.id];\n\n if (!container) {\n return;\n }\n\n forEach([ container.gfx, container.secondaryGfx ], function(gfx) {\n if (gfx) {\n\n // invoke either addClass or removeClass based on mode\n if (add) {\n element.markers.add(marker);\n svgClasses(gfx).add(marker);\n } else {\n element.markers.delete(marker);\n svgClasses(gfx).remove(marker);\n }\n }\n });\n\n /**\n * An event indicating that a marker has been updated for an element\n *\n * @event element.marker.update\n * @type {Object}\n * @property {Element} element the shape\n * @property {SVGElement} gfx the graphical representation of the shape\n * @property {string} marker\n * @property {boolean} add true if the marker was added, false if it got removed\n */\n this._eventBus.fire('element.marker.update', { element: element, gfx: container.gfx, marker: marker, add: !!add });\n};\n\n\n/**\n * Adds a marker to an element (basically a css class).\n *\n * Fires the element.marker.update event, making it possible to\n * integrate extension into the marker life-cycle, too.\n *\n * @example\n *\n * ```javascript\n * canvas.addMarker('foo', 'some-marker');\n *\n * const fooGfx = canvas.getGraphics('foo');\n *\n * fooGfx; // ... \n * ```\n *\n * @param {ShapeLike|ConnectionLike|string} element The element or its ID.\n * @param {string} marker The marker.\n */\nCanvas.prototype.addMarker = function(element, marker) {\n this._updateMarker(element, marker, true);\n};\n\n\n/**\n * Remove a marker from an element.\n *\n * Fires the element.marker.update event, making it possible to\n * integrate extension into the marker life-cycle, too.\n *\n * @param {ShapeLike|ConnectionLike|string} element The element or its ID.\n * @param {string} marker The marker.\n */\nCanvas.prototype.removeMarker = function(element, marker) {\n this._updateMarker(element, marker, false);\n};\n\n/**\n * Check whether an element has a given marker.\n *\n * @param {ShapeLike|ConnectionLike|string} element The element or its ID.\n * @param {string} marker The marker.\n */\nCanvas.prototype.hasMarker = function(element, marker) {\n if (!element.id) {\n element = this._elementRegistry.get(element);\n }\n\n if (!element.markers) {\n return false;\n }\n\n return element.markers.has(marker);\n};\n\n/**\n * Toggles a marker on an element.\n *\n * Fires the element.marker.update event, making it possible to\n * integrate extension into the marker life-cycle, too.\n *\n * @param {ShapeLike|ConnectionLike|string} element The element or its ID.\n * @param {string} marker The marker.\n */\nCanvas.prototype.toggleMarker = function(element, marker) {\n if (this.hasMarker(element, marker)) {\n this.removeMarker(element, marker);\n } else {\n this.addMarker(element, marker);\n }\n};\n\n/**\n * Returns the current root element.\n *\n * Supports two different modes for handling root elements:\n *\n * 1. if no root element has been added before, an implicit root will be added\n * and returned. This is used in applications that don't require explicit\n * root elements.\n *\n * 2. when root elements have been added before calling `getRootElement`,\n * root elements can be null. This is used for applications that want to manage\n * root elements themselves.\n *\n * @return {RootLike} The current root element.\n */\nCanvas.prototype.getRootElement = function() {\n const rootElement = this._rootElement;\n\n // can return null if root elements are present but none was set yet\n if (rootElement || this._planes.length) {\n return rootElement;\n }\n\n return this.setRootElement(this.addRootElement(null));\n};\n\n/**\n * Adds a given root element and returns it.\n *\n * @param {RootLike} [rootElement] The root element to be added.\n *\n * @return {RootLike} The added root element or an implicit root element.\n */\nCanvas.prototype.addRootElement = function(rootElement) {\n const idx = this._rootsIdx++;\n\n if (!rootElement) {\n rootElement = {\n id: '__implicitroot_' + idx,\n children: [],\n isImplicit: true\n };\n }\n\n const layerName = rootElement.layer = 'root-' + idx;\n\n this._ensureValid('root', rootElement);\n\n const layer = this.getLayer(layerName, PLANE_LAYER_INDEX);\n\n this.hideLayer(layerName);\n\n this._addRoot(rootElement, layer);\n\n this._planes.push({\n rootElement: rootElement,\n layer: layer\n });\n\n return rootElement;\n};\n\n/**\n * Removes a given root element and returns it.\n *\n * @param {RootLike|string} rootElement element or element ID\n *\n * @return {RootLike|undefined} removed element\n */\nCanvas.prototype.removeRootElement = function(rootElement) {\n\n if (typeof rootElement === 'string') {\n rootElement = this._elementRegistry.get(rootElement);\n }\n\n const plane = this._findPlaneForRoot(rootElement);\n\n if (!plane) {\n return;\n }\n\n // hook up life-cycle events\n this._removeRoot(rootElement);\n\n // clean up layer\n this._removeLayer(rootElement.layer);\n\n // clean up plane\n this._planes = this._planes.filter(function(plane) {\n return plane.rootElement !== rootElement;\n });\n\n // clean up active root\n if (this._rootElement === rootElement) {\n this._rootElement = null;\n }\n\n return rootElement;\n};\n\n\n/**\n * Sets a given element as the new root element for the canvas\n * and returns the new root element.\n *\n * @param {RootLike} rootElement The root element to be set.\n *\n * @return {RootLike} The set root element.\n */\nCanvas.prototype.setRootElement = function(rootElement) {\n\n if (rootElement === this._rootElement) {\n return rootElement;\n }\n\n let plane;\n\n if (!rootElement) {\n throw new Error('rootElement required');\n }\n\n plane = this._findPlaneForRoot(rootElement);\n\n // give set add semantics for backwards compatibility\n if (!plane) {\n rootElement = this.addRootElement(rootElement);\n }\n\n this._setRoot(rootElement);\n\n return rootElement;\n};\n\n\nCanvas.prototype._removeRoot = function(element) {\n const elementRegistry = this._elementRegistry,\n eventBus = this._eventBus;\n\n // simulate element remove event sequence\n eventBus.fire('root.remove', { element: element });\n eventBus.fire('root.removed', { element: element });\n\n elementRegistry.remove(element);\n};\n\n\nCanvas.prototype._addRoot = function(element, gfx) {\n const elementRegistry = this._elementRegistry,\n eventBus = this._eventBus;\n\n // resemble element add event sequence\n eventBus.fire('root.add', { element: element });\n\n elementRegistry.add(element, gfx);\n\n eventBus.fire('root.added', { element: element, gfx: gfx });\n};\n\n\nCanvas.prototype._setRoot = function(rootElement, layer) {\n\n const currentRoot = this._rootElement;\n\n if (currentRoot) {\n\n // un-associate previous root element \n this._elementRegistry.updateGraphics(currentRoot, null, true);\n\n // hide previous layer\n this.hideLayer(currentRoot.layer);\n }\n\n if (rootElement) {\n\n if (!layer) {\n layer = this._findPlaneForRoot(rootElement).layer;\n }\n\n // associate element with \n this._elementRegistry.updateGraphics(rootElement, this._svg, true);\n\n // show root layer\n this.showLayer(rootElement.layer);\n }\n\n this._rootElement = rootElement;\n\n this._eventBus.fire('root.set', { element: rootElement });\n};\n\nCanvas.prototype._ensureValid = function(type, element) {\n if (!element.id) {\n throw new Error('element must have an id');\n }\n\n if (this._elementRegistry.get(element.id)) {\n throw new Error('element <' + element.id + '> already exists');\n }\n\n const requiredAttrs = REQUIRED_MODEL_ATTRS[type];\n\n const valid = every(requiredAttrs, function(attr) {\n return typeof element[attr] !== 'undefined';\n });\n\n if (!valid) {\n throw new Error(\n 'must supply { ' + requiredAttrs.join(', ') + ' } with ' + type);\n }\n};\n\nCanvas.prototype._setParent = function(element, parent, parentIndex) {\n collectionAdd(parent.children, element, parentIndex);\n element.parent = parent;\n};\n\n/**\n * Adds an element to the canvas.\n *\n * This wires the parent <-> child relationship between the element and\n * a explicitly specified parent or an implicit root element.\n *\n * During add it emits the events\n *\n * * <{type}.add> (element, parent)\n * * <{type}.added> (element, gfx)\n *\n * Extensions may hook into these events to perform their magic.\n *\n * @param {string} type\n * @param {ConnectionLike|ShapeLike} element\n * @param {ShapeLike} [parent]\n * @param {number} [parentIndex]\n *\n * @return {ConnectionLike|ShapeLike} The added element.\n */\nCanvas.prototype._addElement = function(type, element, parent, parentIndex) {\n\n parent = parent || this.getRootElement();\n\n const eventBus = this._eventBus,\n graphicsFactory = this._graphicsFactory;\n\n this._ensureValid(type, element);\n\n eventBus.fire(type + '.add', { element: element, parent: parent });\n\n this._setParent(element, parent, parentIndex);\n\n // create graphics\n const gfx = graphicsFactory.create(type, element, parentIndex);\n\n this._elementRegistry.add(element, gfx);\n\n // update its visual\n graphicsFactory.update(type, element, gfx);\n\n eventBus.fire(type + '.added', { element: element, gfx: gfx });\n\n return element;\n};\n\n/**\n * Adds a shape to the canvas.\n *\n * @param {ShapeLike} shape The shape to be added\n * @param {ParentLike} [parent] The shape's parent.\n * @param {number} [parentIndex] The index at which to add the shape to the parent's children.\n *\n * @return {ShapeLike} The added shape.\n */\nCanvas.prototype.addShape = function(shape, parent, parentIndex) {\n return this._addElement('shape', shape, parent, parentIndex);\n};\n\n/**\n * Adds a connection to the canvas.\n *\n * @param {ConnectionLike} connection The connection to be added.\n * @param {ParentLike} [parent] The connection's parent.\n * @param {number} [parentIndex] The index at which to add the connection to the parent's children.\n *\n * @return {ConnectionLike} The added connection.\n */\nCanvas.prototype.addConnection = function(connection, parent, parentIndex) {\n return this._addElement('connection', connection, parent, parentIndex);\n};\n\n\n/**\n * Internal remove element\n */\nCanvas.prototype._removeElement = function(element, type) {\n\n const elementRegistry = this._elementRegistry,\n graphicsFactory = this._graphicsFactory,\n eventBus = this._eventBus;\n\n element = elementRegistry.get(element.id || element);\n\n if (!element) {\n\n // element was removed already\n return;\n }\n\n eventBus.fire(type + '.remove', { element: element });\n\n graphicsFactory.remove(element);\n\n // unset parent <-> child relationship\n collectionRemove(element.parent && element.parent.children, element);\n element.parent = null;\n\n eventBus.fire(type + '.removed', { element: element });\n\n elementRegistry.remove(element);\n\n return element;\n};\n\n\n/**\n * Removes a shape from the canvas.\n *\n * @fires ShapeRemoveEvent\n * @fires ShapeRemovedEvent\n *\n * @param {ShapeLike|string} shape The shape or its ID.\n *\n * @return {ShapeLike} The removed shape.\n */\nCanvas.prototype.removeShape = function(shape) {\n\n /**\n * An event indicating that a shape is about to be removed from the canvas.\n *\n * @memberOf Canvas\n *\n * @event ShapeRemoveEvent\n * @type {Object}\n * @property {ShapeLike} element The shape.\n * @property {SVGElement} gfx The graphical element.\n */\n\n /**\n * An event indicating that a shape has been removed from the canvas.\n *\n * @memberOf Canvas\n *\n * @event ShapeRemovedEvent\n * @type {Object}\n * @property {ShapeLike} element The shape.\n * @property {SVGElement} gfx The graphical element.\n */\n return this._removeElement(shape, 'shape');\n};\n\n\n/**\n * Removes a connection from the canvas.\n *\n * @fires ConnectionRemoveEvent\n * @fires ConnectionRemovedEvent\n *\n * @param {ConnectionLike|string} connection The connection or its ID.\n *\n * @return {ConnectionLike} The removed connection.\n */\nCanvas.prototype.removeConnection = function(connection) {\n\n /**\n * An event indicating that a connection is about to be removed from the canvas.\n *\n * @memberOf Canvas\n *\n * @event ConnectionRemoveEvent\n * @type {Object}\n * @property {ConnectionLike} element The connection.\n * @property {SVGElement} gfx The graphical element.\n */\n\n /**\n * An event indicating that a connection has been removed from the canvas.\n *\n * @memberOf Canvas\n *\n * @event ConnectionRemovedEvent\n * @type {Object}\n * @property {ConnectionLike} element The connection.\n * @property {SVGElement} gfx The graphical element.\n */\n return this._removeElement(connection, 'connection');\n};\n\n\n/**\n * Returns the graphical element of an element.\n *\n * @param {ShapeLike|ConnectionLike|string} element The element or its ID.\n * @param {boolean} [secondary=false] Whether to return the secondary graphical element.\n *\n * @return {SVGElement} The graphical element.\n */\nCanvas.prototype.getGraphics = function(element, secondary) {\n return this._elementRegistry.getGraphics(element, secondary);\n};\n\n\n/**\n * Perform a viewbox update via a given change function.\n *\n * @param {Function} changeFn\n */\nCanvas.prototype._changeViewbox = function(changeFn) {\n\n // notify others of the upcoming viewbox change\n this._eventBus.fire('canvas.viewbox.changing');\n\n // perform actual change\n changeFn.apply(this);\n\n // reset the cached viewbox so that\n // a new get operation on viewbox or zoom\n // triggers a viewbox re-computation\n this._cachedViewbox = null;\n\n // notify others of the change; this step\n // may or may not be debounced\n this._viewboxChanged();\n};\n\nCanvas.prototype._viewboxChanged = function() {\n this._eventBus.fire('canvas.viewbox.changed', { viewbox: this.viewbox() });\n};\n\n\n/**\n * Gets or sets the view box of the canvas, i.e. the\n * area that is currently displayed.\n *\n * The getter may return a cached viewbox (if it is currently\n * changing). To force a recomputation, pass `false` as the first argument.\n *\n * @example\n *\n * ```javascript\n * canvas.viewbox({ x: 100, y: 100, width: 500, height: 500 })\n *\n * // sets the visible area of the diagram to (100|100) -> (600|100)\n * // and and scales it according to the diagram width\n *\n * const viewbox = canvas.viewbox(); // pass `false` to force recomputing the box.\n *\n * console.log(viewbox);\n * // {\n * // inner: Dimensions,\n * // outer: Dimensions,\n * // scale,\n * // x, y,\n * // width, height\n * // }\n *\n * // if the current diagram is zoomed and scrolled, you may reset it to the\n * // default zoom via this method, too:\n *\n * const zoomedAndScrolledViewbox = canvas.viewbox();\n *\n * canvas.viewbox({\n * x: 0,\n * y: 0,\n * width: zoomedAndScrolledViewbox.outer.width,\n * height: zoomedAndScrolledViewbox.outer.height\n * });\n * ```\n *\n * @param {Rect} [box] The viewbox to be set.\n *\n * @return {CanvasViewbox} The set viewbox.\n */\nCanvas.prototype.viewbox = function(box) {\n\n if (box === undefined && this._cachedViewbox) {\n return structuredClone(this._cachedViewbox);\n }\n\n const viewport = this._viewport,\n outerBox = this.getSize();\n let innerBox,\n matrix,\n activeLayer,\n transform,\n scale,\n x, y;\n\n if (!box) {\n\n // compute the inner box based on the\n // diagrams active layer. This allows us to exclude\n // external components, such as overlays\n\n activeLayer = this._rootElement ? this.getActiveLayer() : null;\n innerBox = activeLayer && activeLayer.getBBox() || {};\n\n transform = svgTransform(viewport);\n matrix = transform ? transform.matrix : createMatrix();\n scale = round(matrix.a, 1000);\n\n x = round(-matrix.e || 0, 1000);\n y = round(-matrix.f || 0, 1000);\n\n box = this._cachedViewbox = {\n x: x ? x / scale : 0,\n y: y ? y / scale : 0,\n width: outerBox.width / scale,\n height: outerBox.height / scale,\n scale: scale,\n inner: {\n width: innerBox.width || 0,\n height: innerBox.height || 0,\n x: innerBox.x || 0,\n y: innerBox.y || 0\n },\n outer: outerBox\n };\n\n return box;\n } else {\n\n this._changeViewbox(function() {\n scale = Math.min(outerBox.width / box.width, outerBox.height / box.height);\n\n const matrix = this._svg.createSVGMatrix()\n .scale(scale)\n .translate(-box.x, -box.y);\n\n svgTransform(viewport, matrix);\n });\n }\n\n return box;\n};\n\n\n/**\n * Gets or sets the scroll of the canvas.\n *\n * @param {ScrollDelta} [delta] The scroll to be set.\n *\n * @return {Point}\n */\nCanvas.prototype.scroll = function(delta) {\n\n const node = this._viewport;\n let matrix = node.getCTM();\n\n if (delta) {\n this._changeViewbox(function() {\n delta = assign({ dx: 0, dy: 0 }, delta || {});\n\n matrix = this._svg.createSVGMatrix().translate(delta.dx, delta.dy).multiply(matrix);\n\n setCTM(node, matrix);\n });\n }\n\n return { x: matrix.e, y: matrix.f };\n};\n\n/**\n * Scrolls the viewbox to contain the given element.\n * Optionally specify a padding to be applied to the edges.\n *\n * @param {ShapeLike|ConnectionLike|string} element The element to scroll to or its ID.\n * @param {RectTRBL|number} [padding=100] The padding to be applied. Can also specify top, bottom, left and right.\n */\nCanvas.prototype.scrollToElement = function(element, padding) {\n let defaultPadding = 100;\n\n if (typeof element === 'string') {\n element = this._elementRegistry.get(element);\n }\n\n // set to correct rootElement\n const rootElement = this.findRoot(element);\n\n if (rootElement !== this.getRootElement()) {\n this.setRootElement(rootElement);\n }\n\n // element is rootElement, do not change viewport\n if (rootElement === element) {\n return;\n }\n\n if (!padding) {\n padding = {};\n }\n if (typeof padding === 'number') {\n defaultPadding = padding;\n }\n\n padding = {\n top: padding.top || defaultPadding,\n right: padding.right || defaultPadding,\n bottom: padding.bottom || defaultPadding,\n left: padding.left || defaultPadding\n };\n\n const elementBounds = getBoundingBox(element),\n elementTrbl = asTRBL(elementBounds),\n viewboxBounds = this.viewbox(),\n zoom = this.zoom();\n let dx, dy;\n\n // shrink viewboxBounds with padding\n viewboxBounds.y += padding.top / zoom;\n viewboxBounds.x += padding.left / zoom;\n viewboxBounds.width -= (padding.right + padding.left) / zoom;\n viewboxBounds.height -= (padding.bottom + padding.top) / zoom;\n\n const viewboxTrbl = asTRBL(viewboxBounds);\n\n const canFit = elementBounds.width < viewboxBounds.width && elementBounds.height < viewboxBounds.height;\n\n if (!canFit) {\n\n // top-left when element can't fit\n dx = elementBounds.x - viewboxBounds.x;\n dy = elementBounds.y - viewboxBounds.y;\n\n } else {\n\n const dRight = Math.max(0, elementTrbl.right - viewboxTrbl.right),\n dLeft = Math.min(0, elementTrbl.left - viewboxTrbl.left),\n dBottom = Math.max(0, elementTrbl.bottom - viewboxTrbl.bottom),\n dTop = Math.min(0, elementTrbl.top - viewboxTrbl.top);\n\n dx = dRight || dLeft;\n dy = dBottom || dTop;\n\n }\n\n this.scroll({ dx: -dx * zoom, dy: -dy * zoom });\n};\n\n/**\n * Gets or sets the current zoom of the canvas, optionally zooming to the\n * specified position.\n *\n * The getter may return a cached zoom level. Call it with `false` as the first\n * argument to force recomputation of the current level.\n *\n * @param {number|'fit-viewport'} [newScale] The new zoom level, either a number,\n * i.e. 0.9, or `fit-viewport` to adjust the size to fit the current viewport.\n * @param {Point} [center] The reference point { x: ..., y: ...} to zoom to.\n *\n * @return {number} The set zoom level.\n */\nCanvas.prototype.zoom = function(newScale, center) {\n\n if (!newScale) {\n return this.viewbox(newScale).scale;\n }\n\n if (newScale === 'fit-viewport') {\n return this._fitViewport(center);\n }\n\n let outer,\n matrix;\n\n this._changeViewbox(function() {\n\n if (typeof center !== 'object') {\n outer = this.viewbox().outer;\n\n center = {\n x: outer.width / 2,\n y: outer.height / 2\n };\n }\n\n matrix = this._setZoom(newScale, center);\n });\n\n return round(matrix.a, 1000);\n};\n\nfunction setCTM(node, m) {\n const mstr = 'matrix(' + m.a + ',' + m.b + ',' + m.c + ',' + m.d + ',' + m.e + ',' + m.f + ')';\n node.setAttribute('transform', mstr);\n}\n\nCanvas.prototype._fitViewport = function(center) {\n\n const vbox = this.viewbox(),\n outer = vbox.outer,\n inner = vbox.inner;\n let newScale,\n newViewbox;\n\n // display the complete diagram without zooming in.\n // instead of relying on internal zoom, we perform a\n // hard reset on the canvas viewbox to realize this\n //\n // if diagram does not need to be zoomed in, we focus it around\n // the diagram origin instead\n\n if (inner.x >= 0 &&\n inner.y >= 0 &&\n inner.x + inner.width <= outer.width &&\n inner.y + inner.height <= outer.height &&\n !center) {\n\n newViewbox = {\n x: 0,\n y: 0,\n width: Math.max(inner.width + inner.x, outer.width),\n height: Math.max(inner.height + inner.y, outer.height)\n };\n } else {\n\n newScale = Math.min(1, outer.width / inner.width, outer.height / inner.height);\n newViewbox = {\n x: inner.x + (center ? inner.width / 2 - outer.width / newScale / 2 : 0),\n y: inner.y + (center ? inner.height / 2 - outer.height / newScale / 2 : 0),\n width: outer.width / newScale,\n height: outer.height / newScale\n };\n }\n\n this.viewbox(newViewbox);\n\n return this.viewbox(false).scale;\n};\n\n\nCanvas.prototype._setZoom = function(scale, center) {\n\n const svg = this._svg,\n viewport = this._viewport;\n\n const matrix = svg.createSVGMatrix();\n const point = svg.createSVGPoint();\n\n let centerPoint,\n originalPoint,\n currentMatrix,\n scaleMatrix,\n newMatrix;\n\n currentMatrix = viewport.getCTM();\n\n const currentScale = currentMatrix.a;\n\n if (center) {\n centerPoint = assign(point, center);\n\n // revert applied viewport transformations\n originalPoint = centerPoint.matrixTransform(currentMatrix.inverse());\n\n // create scale matrix\n scaleMatrix = matrix\n .translate(originalPoint.x, originalPoint.y)\n .scale(1 / currentScale * scale)\n .translate(-originalPoint.x, -originalPoint.y);\n\n newMatrix = currentMatrix.multiply(scaleMatrix);\n } else {\n newMatrix = matrix.scale(scale);\n }\n\n setCTM(this._viewport, newMatrix);\n\n return newMatrix;\n};\n\n\n/**\n * Returns the size of the canvas.\n *\n * @return {Dimensions} The size of the canvas.\n */\nCanvas.prototype.getSize = function() {\n return {\n width: this._container.clientWidth,\n height: this._container.clientHeight\n };\n};\n\n\n/**\n * Returns the absolute bounding box of an element.\n *\n * The absolute bounding box may be used to display overlays in the callers\n * (browser) coordinate system rather than the zoomed in/out canvas coordinates.\n *\n * @param {ShapeLike|ConnectionLike} element The element.\n *\n * @return {Rect} The element's absolute bounding box.\n */\nCanvas.prototype.getAbsoluteBBox = function(element) {\n const vbox = this.viewbox();\n let bbox;\n\n // connection\n // use svg bbox\n if (element.waypoints) {\n const gfx = this.getGraphics(element);\n\n bbox = gfx.getBBox();\n }\n\n // shapes\n // use data\n else {\n bbox = element;\n }\n\n const x = bbox.x * vbox.scale - vbox.x * vbox.scale;\n const y = bbox.y * vbox.scale - vbox.y * vbox.scale;\n\n const width = bbox.width * vbox.scale;\n const height = bbox.height * vbox.scale;\n\n return {\n x: x,\n y: y,\n width: width,\n height: height\n };\n};\n\n/**\n * Fires an event so other modules can react to the canvas resizing.\n */\nCanvas.prototype.resized = function() {\n\n // force recomputation of view box\n delete this._cachedViewbox;\n\n this._eventBus.fire('canvas.resized');\n};\n", "var ELEMENT_ID = 'data-element-id';\n\nimport { attr as svgAttr } from 'tiny-svg';\n\n/**\n * @typedef {import('./Types').ElementLike} ElementLike\n *\n * @typedef {import('./EventBus').default} EventBus\n *\n * @typedef { (element: ElementLike, gfx: SVGElement) => boolean|any } ElementRegistryFilterCallback\n * @typedef { (element: ElementLike, gfx: SVGElement) => any } ElementRegistryForEachCallback\n */\n\n/**\n * A registry that keeps track of all shapes in the diagram.\n *\n * @class\n * @constructor\n *\n * @param {EventBus} eventBus\n */\nexport default function ElementRegistry(eventBus) {\n\n /**\n * @type { {\n * [id: string]: {\n * element: ElementLike;\n * gfx?: SVGElement;\n * secondaryGfx?: SVGElement;\n * }\n * } }\n */\n this._elements = {};\n\n this._eventBus = eventBus;\n}\n\nElementRegistry.$inject = [ 'eventBus' ];\n\n/**\n * Add an element and its graphical representation(s) to the registry.\n *\n * @param {ElementLike} element The element to be added.\n * @param {SVGElement} gfx The primary graphical representation.\n * @param {SVGElement} [secondaryGfx] The secondary graphical representation.\n */\nElementRegistry.prototype.add = function(element, gfx, secondaryGfx) {\n\n var id = element.id;\n\n this._validateId(id);\n\n // associate dom node with element\n svgAttr(gfx, ELEMENT_ID, id);\n\n if (secondaryGfx) {\n svgAttr(secondaryGfx, ELEMENT_ID, id);\n }\n\n this._elements[id] = { element: element, gfx: gfx, secondaryGfx: secondaryGfx };\n};\n\n/**\n * Remove an element from the registry.\n *\n * @param {ElementLike|string} element\n */\nElementRegistry.prototype.remove = function(element) {\n var elements = this._elements,\n id = element.id || element,\n container = id && elements[id];\n\n if (container) {\n\n // unset element id on gfx\n svgAttr(container.gfx, ELEMENT_ID, '');\n\n if (container.secondaryGfx) {\n svgAttr(container.secondaryGfx, ELEMENT_ID, '');\n }\n\n delete elements[id];\n }\n};\n\n/**\n * Update an elements ID.\n *\n * @param {ElementLike|string} element The element or its ID.\n * @param {string} newId The new ID.\n */\nElementRegistry.prototype.updateId = function(element, newId) {\n\n this._validateId(newId);\n\n if (typeof element === 'string') {\n element = this.get(element);\n }\n\n this._eventBus.fire('element.updateId', {\n element: element,\n newId: newId\n });\n\n var gfx = this.getGraphics(element),\n secondaryGfx = this.getGraphics(element, true);\n\n this.remove(element);\n\n element.id = newId;\n\n this.add(element, gfx, secondaryGfx);\n};\n\n/**\n * Update the graphical representation of an element.\n *\n * @param {ElementLike|string} filter The element or its ID.\n * @param {SVGElement} gfx The new graphical representation.\n * @param {boolean} [secondary=false] Whether to update the secondary graphical representation.\n */\nElementRegistry.prototype.updateGraphics = function(filter, gfx, secondary) {\n var id = filter.id || filter;\n\n var container = this._elements[id];\n\n if (secondary) {\n container.secondaryGfx = gfx;\n } else {\n container.gfx = gfx;\n }\n\n if (gfx) {\n svgAttr(gfx, ELEMENT_ID, id);\n }\n\n return gfx;\n};\n\n/**\n * Get the element with the given ID or graphical representation.\n *\n * @example\n *\n * ```javascript\n * elementRegistry.get('SomeElementId_1');\n *\n * elementRegistry.get(gfx);\n * ```\n *\n * @param {string|SVGElement} filter The elements ID or graphical representation.\n *\n * @return {ElementLike|undefined} The element.\n */\nElementRegistry.prototype.get = function(filter) {\n var id;\n\n if (typeof filter === 'string') {\n id = filter;\n } else {\n id = filter && svgAttr(filter, ELEMENT_ID);\n }\n\n var container = this._elements[id];\n return container && container.element;\n};\n\n/**\n * Return all elements that match a given filter function.\n *\n * @param {ElementRegistryFilterCallback} fn The filter function.\n *\n * @return {ElementLike[]} The matching elements.\n */\nElementRegistry.prototype.filter = function(fn) {\n\n var filtered = [];\n\n this.forEach(function(element, gfx) {\n if (fn(element, gfx)) {\n filtered.push(element);\n }\n });\n\n return filtered;\n};\n\n/**\n * Return the first element that matches the given filter function.\n *\n * @param {ElementRegistryFilterCallback} fn The filter function.\n *\n * @return {ElementLike|undefined} The matching element.\n */\nElementRegistry.prototype.find = function(fn) {\n var map = this._elements,\n keys = Object.keys(map);\n\n for (var i = 0; i < keys.length; i++) {\n var id = keys[i],\n container = map[id],\n element = container.element,\n gfx = container.gfx;\n\n if (fn(element, gfx)) {\n return element;\n }\n }\n};\n\n/**\n * Get all elements.\n *\n * @return {ElementLike[]} All elements.\n */\nElementRegistry.prototype.getAll = function() {\n return this.filter(function(e) { return e; });\n};\n\n/**\n * Execute a given function for each element.\n *\n * @param {ElementRegistryForEachCallback} fn The function to execute.\n */\nElementRegistry.prototype.forEach = function(fn) {\n\n var map = this._elements;\n\n Object.keys(map).forEach(function(id) {\n var container = map[id],\n element = container.element,\n gfx = container.gfx;\n\n return fn(element, gfx);\n });\n};\n\n/**\n * Return the graphical representation of an element.\n *\n * @example\n *\n * ```javascript\n * elementRegistry.getGraphics('SomeElementId_1');\n *\n * elementRegistry.getGraphics(rootElement); // \n *\n * elementRegistry.getGraphics(rootElement, true); // \n * ```\n *\n * @param {ElementLike|string} filter The element or its ID.\n * @param {boolean} [secondary=false] Whether to return the secondary graphical representation.\n *\n * @return {SVGElement} The graphical representation.\n */\nElementRegistry.prototype.getGraphics = function(filter, secondary) {\n var id = filter.id || filter;\n\n var container = this._elements[id];\n return container && (secondary ? container.secondaryGfx : container.gfx);\n};\n\n/**\n * Validate an ID and throw an error if invalid.\n *\n * @param {string} id\n *\n * @throws {Error} Error indicating that the ID is invalid or already assigned.\n */\nElementRegistry.prototype._validateId = function(id) {\n if (!id) {\n throw new Error('element must have an id');\n }\n\n if (this._elements[id]) {\n throw new Error('element with id ' + id + ' already added');\n }\n};\n", "/**\n * Extends a collection with {@link Refs} aware methods\n *\n * @param {Array} collection\n * @param {Refs} refs instance\n * @param {Object} property represented by the collection\n * @param {Object} target object the collection is attached to\n *\n * @return {RefsCollection} the extended array\n */\nfunction extend(collection, refs, property, target) {\n var inverseProperty = property.inverse;\n\n /**\n * Removes the given element from the array and returns it.\n *\n * @method RefsCollection#remove\n *\n * @param {Object} element the element to remove\n */\n Object.defineProperty(collection, 'remove', {\n value: function (element) {\n var idx = this.indexOf(element);\n if (idx !== -1) {\n this.splice(idx, 1);\n\n // unset inverse\n refs.unset(element, inverseProperty, target);\n }\n return element;\n }\n });\n\n /**\n * Returns true if the collection contains the given element\n *\n * @method RefsCollection#contains\n *\n * @param {Object} element the element to check for\n */\n Object.defineProperty(collection, 'contains', {\n value: function (element) {\n return this.indexOf(element) !== -1;\n }\n });\n\n /**\n * Adds an element to the array, unless it exists already (set semantics).\n *\n * @method RefsCollection#add\n *\n * @param {Object} element the element to add\n * @param {Number} optional index to add element to\n * (possibly moving other elements around)\n */\n Object.defineProperty(collection, 'add', {\n value: function (element, idx) {\n var currentIdx = this.indexOf(element);\n if (typeof idx === 'undefined') {\n if (currentIdx !== -1) {\n // element already in collection (!)\n return;\n }\n\n // add to end of array, as no idx is specified\n idx = this.length;\n }\n\n // handle already in collection\n if (currentIdx !== -1) {\n // remove element from currentIdx\n this.splice(currentIdx, 1);\n }\n\n // add element at idx\n this.splice(idx, 0, element);\n if (currentIdx === -1) {\n // set inverse, unless element was\n // in collection already\n refs.set(element, inverseProperty, target);\n }\n }\n });\n\n // a simple marker, identifying this element\n // as being a refs collection\n Object.defineProperty(collection, '__refs_collection', {\n value: true\n });\n return collection;\n}\n\n/**\n * Checks if a given collection is extended\n *\n * @param {Array} collection\n *\n * @return {boolean}\n */\nfunction isExtended(collection) {\n return collection.__refs_collection === true;\n}\n\nvar collection = {\n __proto__: null,\n extend: extend,\n isExtended: isExtended\n};\n\nfunction hasOwnProperty(e, property) {\n return Object.prototype.hasOwnProperty.call(e, property.name || property);\n}\nfunction defineCollectionProperty(ref, property, target) {\n var collection = extend(target[property.name] || [], ref, property, target);\n Object.defineProperty(target, property.name, {\n enumerable: property.enumerable,\n value: collection\n });\n if (collection.length) {\n collection.forEach(function (o) {\n ref.set(o, property.inverse, target);\n });\n }\n}\nfunction defineProperty(ref, property, target) {\n var inverseProperty = property.inverse;\n var _value = target[property.name];\n Object.defineProperty(target, property.name, {\n configurable: property.configurable,\n enumerable: property.enumerable,\n get: function () {\n return _value;\n },\n set: function (value) {\n // return if we already performed all changes\n if (value === _value) {\n return;\n }\n var old = _value;\n\n // temporary set null\n _value = null;\n if (old) {\n ref.unset(old, inverseProperty, target);\n }\n\n // set new value\n _value = value;\n\n // set inverse value\n ref.set(_value, inverseProperty, target);\n }\n });\n}\n\n/**\n * Creates a new references object defining two inversly related\n * attribute descriptors a and b.\n *\n *

      \n * When bound to an object using {@link Refs#bind} the references\n * get activated and ensure that add and remove operations are applied\n * reversely, too.\n *

      \n *\n *

      \n * For attributes represented as collections {@link Refs} provides the\n * {@link RefsCollection#add}, {@link RefsCollection#remove} and {@link RefsCollection#contains} extensions\n * that must be used to properly hook into the inverse change mechanism.\n *

      \n *\n * @class Refs\n *\n * @classdesc A bi-directional reference between two attributes.\n *\n * @param {Refs.AttributeDescriptor} a property descriptor\n * @param {Refs.AttributeDescriptor} b property descriptor\n *\n * @example\n *\n * var refs = Refs({ name: 'wheels', collection: true, enumerable: true }, { name: 'car' });\n *\n * var car = { name: 'toyota' };\n * var wheels = [{ pos: 'front-left' }, { pos: 'front-right' }];\n *\n * refs.bind(car, 'wheels');\n *\n * car.wheels // []\n * car.wheels.add(wheels[0]);\n * car.wheels.add(wheels[1]);\n *\n * car.wheels // [{ pos: 'front-left' }, { pos: 'front-right' }]\n *\n * wheels[0].car // { name: 'toyota' };\n * car.wheels.remove(wheels[0]);\n *\n * wheels[0].car // undefined\n */\nfunction Refs(a, b) {\n if (!(this instanceof Refs)) {\n return new Refs(a, b);\n }\n\n // link\n a.inverse = b;\n b.inverse = a;\n this.props = {};\n this.props[a.name] = a;\n this.props[b.name] = b;\n}\n\n/**\n * Binds one side of a bi-directional reference to a\n * target object.\n *\n * @memberOf Refs\n *\n * @param {Object} target\n * @param {String} property\n */\nRefs.prototype.bind = function (target, property) {\n if (typeof property === 'string') {\n if (!this.props[property]) {\n throw new Error('no property <' + property + '> in ref');\n }\n property = this.props[property];\n }\n if (property.collection) {\n defineCollectionProperty(this, property, target);\n } else {\n defineProperty(this, property, target);\n }\n};\nRefs.prototype.ensureRefsCollection = function (target, property) {\n var collection = target[property.name];\n if (!isExtended(collection)) {\n defineCollectionProperty(this, property, target);\n }\n return collection;\n};\nRefs.prototype.ensureBound = function (target, property) {\n if (!hasOwnProperty(target, property)) {\n this.bind(target, property);\n }\n};\nRefs.prototype.unset = function (target, property, value) {\n if (target) {\n this.ensureBound(target, property);\n if (property.collection) {\n this.ensureRefsCollection(target, property).remove(value);\n } else {\n target[property.name] = undefined;\n }\n }\n};\nRefs.prototype.set = function (target, property, value) {\n if (target) {\n this.ensureBound(target, property);\n if (property.collection) {\n this.ensureRefsCollection(target, property).add(value);\n } else {\n target[property.name] = value;\n }\n }\n};\n\n/**\n * An attribute descriptor to be used specify an attribute in a {@link Refs} instance\n *\n * @typedef {Object} Refs.AttributeDescriptor\n * @property {String} name\n * @property {boolean} [collection=false]\n * @property {boolean} [enumerable=false]\n */\n\nexport { collection as Collection, Refs };\n", "import { assign } from 'min-dash';\nimport inherits from 'inherits-browser';\n\nimport { Refs } from 'object-refs';\n\nvar parentRefs = new Refs({ name: 'children', enumerable: true, collection: true }, { name: 'parent' }),\n labelRefs = new Refs({ name: 'labels', enumerable: true, collection: true }, { name: 'labelTarget' }),\n attacherRefs = new Refs({ name: 'attachers', collection: true }, { name: 'host' }),\n outgoingRefs = new Refs({ name: 'outgoing', collection: true }, { name: 'source' }),\n incomingRefs = new Refs({ name: 'incoming', collection: true }, { name: 'target' });\n\n/**\n * @typedef {import('./Types').Element} Element\n * @typedef {import('./Types').Shape} Shape\n * @typedef {import('./Types').Root} Root\n * @typedef {import('./Types').Label} Label\n * @typedef {import('./Types').Connection} Connection\n */\n\n/**\n * The basic graphical representation\n *\n * @class\n * @constructor\n */\nfunction ElementImpl() {\n\n /**\n * The object that backs up the shape\n *\n * @name Element#businessObject\n * @type Object\n */\n Object.defineProperty(this, 'businessObject', {\n writable: true\n });\n\n\n /**\n * Single label support, will mapped to multi label array\n *\n * @name Element#label\n * @type Object\n */\n Object.defineProperty(this, 'label', {\n get: function() {\n return this.labels[0];\n },\n set: function(newLabel) {\n\n var label = this.label,\n labels = this.labels;\n\n if (!newLabel && label) {\n labels.remove(label);\n } else {\n labels.add(newLabel, 0);\n }\n }\n });\n\n /**\n * The parent shape\n *\n * @name Element#parent\n * @type Shape\n */\n parentRefs.bind(this, 'parent');\n\n /**\n * The list of labels\n *\n * @name Element#labels\n * @type Label\n */\n labelRefs.bind(this, 'labels');\n\n /**\n * The list of outgoing connections\n *\n * @name Element#outgoing\n * @type Array\n */\n outgoingRefs.bind(this, 'outgoing');\n\n /**\n * The list of incoming connections\n *\n * @name Element#incoming\n * @type Array\n */\n incomingRefs.bind(this, 'incoming');\n}\n\n\n/**\n * A graphical object\n *\n * @class\n * @constructor\n *\n * @extends ElementImpl\n */\nfunction ShapeImpl() {\n ElementImpl.call(this);\n\n /**\n * Indicates frame shapes\n *\n * @name ShapeImpl#isFrame\n * @type boolean\n */\n\n /**\n * The list of children\n *\n * @name ShapeImpl#children\n * @type Element[]\n */\n parentRefs.bind(this, 'children');\n\n /**\n * @name ShapeImpl#host\n * @type Shape\n */\n attacherRefs.bind(this, 'host');\n\n /**\n * @name ShapeImpl#attachers\n * @type Shape\n */\n attacherRefs.bind(this, 'attachers');\n}\n\ninherits(ShapeImpl, ElementImpl);\n\n\n/**\n * A root graphical object\n *\n * @class\n * @constructor\n *\n * @extends ElementImpl\n */\nfunction RootImpl() {\n ElementImpl.call(this);\n\n /**\n * The list of children\n *\n * @name RootImpl#children\n * @type Element[]\n */\n parentRefs.bind(this, 'children');\n}\n\ninherits(RootImpl, ShapeImpl);\n\n\n/**\n * A label for an element\n *\n * @class\n * @constructor\n *\n * @extends ShapeImpl\n */\nfunction LabelImpl() {\n ShapeImpl.call(this);\n\n /**\n * The labeled element\n *\n * @name LabelImpl#labelTarget\n * @type Element\n */\n labelRefs.bind(this, 'labelTarget');\n}\n\ninherits(LabelImpl, ShapeImpl);\n\n\n/**\n * A connection between two elements\n *\n * @class\n * @constructor\n *\n * @extends ElementImpl\n */\nfunction ConnectionImpl() {\n ElementImpl.call(this);\n\n /**\n * The element this connection originates from\n *\n * @name ConnectionImpl#source\n * @type Element\n */\n outgoingRefs.bind(this, 'source');\n\n /**\n * The element this connection points to\n *\n * @name ConnectionImpl#target\n * @type Element\n */\n incomingRefs.bind(this, 'target');\n}\n\ninherits(ConnectionImpl, ElementImpl);\n\n\nvar types = {\n connection: ConnectionImpl,\n shape: ShapeImpl,\n label: LabelImpl,\n root: RootImpl\n};\n\n/**\n * Creates a root element.\n *\n * @overlord\n *\n * @example\n *\n * ```javascript\n * import * as Model from 'diagram-js/lib/model';\n *\n * const root = Model.create('root', {\n * x: 100,\n * y: 100,\n * width: 100,\n * height: 100\n * });\n * ```\n *\n * @param {'root'} type\n * @param {any} [attrs]\n *\n * @return {Root}\n */\n\n/**\n * Creates a connection.\n *\n * @overlord\n *\n * @example\n *\n * ```javascript\n * import * as Model from 'diagram-js/lib/model';\n *\n * const connection = Model.create('connection', {\n * waypoints: [\n * { x: 100, y: 100 },\n * { x: 200, y: 100 }\n * ]\n * });\n * ```\n *\n * @param {'connection'} type\n * @param {any} [attrs]\n *\n * @return {Connection}\n */\n\n/**\n * Creates a shape.\n *\n * @overlord\n *\n * @example\n *\n * ```javascript\n * import * as Model from 'diagram-js/lib/model';\n *\n * const shape = Model.create('shape', {\n * x: 100,\n * y: 100,\n * width: 100,\n * height: 100\n * });\n * ```\n *\n * @param {'shape'} type\n * @param {any} [attrs]\n *\n * @return {Shape}\n */\n\n/**\n * Creates a label.\n *\n * @example\n *\n * ```javascript\n * import * as Model from 'diagram-js/lib/model';\n *\n * const label = Model.create('label', {\n * x: 100,\n * y: 100,\n * width: 100,\n * height: 100,\n * labelTarget: shape\n * });\n * ```\n *\n * @param {'label'} type\n * @param {Object} [attrs]\n *\n * @return {Label}\n */\nexport function create(type, attrs) {\n var Type = types[type];\n if (!Type) {\n throw new Error('unknown type: <' + type + '>');\n }\n return assign(new Type(), attrs);\n}\n\n/**\n * Checks whether an object is a model instance.\n *\n * @param {any} obj\n *\n * @return {boolean}\n */\nexport function isModelElement(obj) {\n return obj instanceof ElementImpl;\n}", "import {\n create\n} from '../model';\n\nimport { assign } from 'min-dash';\n\n/**\n * @typedef {import('../model/Types').Element} Element\n * @typedef {import('../model/Types').Connection} Connection\n * @typedef {import('../model/Types').Label} Label\n * @typedef {import('../model/Types').Root} Root\n * @typedef {import('../model/Types').Shape} Shape\n */\n\n/**\n * A factory for model elements.\n *\n * @template {Connection} [T=Connection]\n * @template {Label} [U=Label]\n * @template {Root} [V=Root]\n * @template {Shape} [W=Shape]\n */\nexport default function ElementFactory() {\n this._uid = 12;\n}\n\n/**\n * Create a root element.\n *\n * @param {Partial} [attrs]\n *\n * @return {V} The created root element.\n */\nElementFactory.prototype.createRoot = function(attrs) {\n return this.create('root', attrs);\n};\n\n/**\n * Create a label.\n *\n * @param {Partial