diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 00000000..c44e609d --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,43 @@ +--- +name: Bug Report +about: Report a bug to help us improve +title: '[Bug]: ' +labels: 'bug' +assignees: '' + +--- + +**Checked for duplicates** + +> Have you checked for duplicate issue tickets? + +- Ex. Yes - I've already checked +- Ex. No - I haven't checked + +**Describe the bug** + +> A clear and concise description of what the bug is. Plain-text snippets preferred but screenshots welcome. + +Ex. When I did [...] action, I noticed [...] + +**What did you expect?** + +> A clear and concise description of what you expect to happen + +Ex. I expected [...] + +**Reproducible steps** + +> How would we reproduce this bug? Please walk us through it step by step. Plain-text snippets preferred but screenshots welcome. + +1. +2. +3. + +**What is your environment?** + +> Include any computer hardware, operating system, framework, browser, time-of-day or other contextual information related to your issue + +- Ex. Version of this software [e.g. vX.Y.Z] +- Ex. Operating System: [e.g. MacOSX with Docker Desktop vX.Y] +- ... diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 00000000..0b74a7aa --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,34 @@ +--- +name: New Feature +about: Suggest a new feature for us to implement +title: '[New Feature]: ' +labels: 'enhancement' +assignees: '' + +--- + +**Checked for duplicates** + +> Have you checked for duplicate issue tickets? + +- Ex. Yes - I've already checked +- Ex. No - I haven't checked + +**Alternatives considered** + +> Have you considered alternative solutions to your feature request? + +- Ex. Yes - and alternatives don't suffice +- Ex. No - I haven't considered + +**Related problems** + +> Is your feature request related to any problems? Please help us understand if so, including linking to any other issue tickets. + +Ex. I'm frustrated when [...] happens as documented in issue-XYZ + +**Describe the feature request** + +> A clear and concise description of your request. + +Ex. I need or want [...] diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 00000000..8ef73bbc --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,13 @@ +## Purpose +- Clear, easy-to-understand sentences outlining the purpose of the PR +## Proposed Changes +- [ADD] ... +- [CHANGE] ... +- [FIX] ... +## Issues +- Links to relevant issues +- Example: issue-XYZ +## Testing +- Provide some proof you've tested your changes +- Example: test results available at ... +- Example: tested on operating system ... diff --git a/.github/workflows/README.md b/.github/workflows/README.md index 1409eb80..b0f10bb1 100644 --- a/.github/workflows/README.md +++ b/.github/workflows/README.md @@ -37,7 +37,7 @@ The `publish-cws-image` job is the CD component of the workflow, triggered upon - **Download Logstash**: - [**download-file-action**](https://github.com/marketplace/actions/download-file-to-workspace): This action downloads a file from the internet into the workspace - Downloads Logstash using a URL - - Renames the file as `logstash-8.8.0.zip` + - Renames the file as `logstash-8.12.0.zip` - Stores Logstash in appropriate directory - **Check for Logstash**: - List files in the directory where Logstash is expected diff --git a/.github/workflows/camunda.yml b/.github/workflows/camunda.yml index 1e5af4af..460f5a52 100644 --- a/.github/workflows/camunda.yml +++ b/.github/workflows/camunda.yml @@ -31,12 +31,12 @@ jobs: --name mdb103 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - - name: Set up JDK 11 - uses: actions/setup-java@v3 + - name: Set up JDK 17 + uses: actions/setup-java@v4 with: - java-version: '11' + java-version: '17' distribution: 'temurin' cache: maven @@ -46,11 +46,18 @@ jobs: chmod +x generate-certs.sh ./generate-certs.sh + - name: Set up Keystore storepass + run: | + mkdir ~/.cws/ + chmod 700 ~/.cws/ + echo ${{ secrets.KEYSTORE_PASSWORD }} > ~/.cws/creds + chmod 600 ~/.cws/creds + - name: Download Logstash uses: carlosperate/download-file-action@v1 with: - file-url: https://artifacts.elastic.co/downloads/logstash/logstash-8.8.0-windows-x86_64.zip - file-name: logstash-8.8.0.zip + file-url: https://artifacts.elastic.co/downloads/logstash/logstash-8.12.0-windows-x86_64.zip + file-name: logstash-8.12.0.zip location: install/logging/ - name: Check for Logstash @@ -100,14 +107,14 @@ jobs: shell: bash - name: Upload Jacoco report - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: jacoco-report path: jacoco-reports/aggregate/index.html - name: Upload test screenshots if: ${{ always() && steps.build.outcome == 'success' }} - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: test-screenshots path: test-screenshots/ @@ -115,7 +122,7 @@ jobs: - name: Send custom JSON data to Slack workflow if: ${{ always() && contains(env.TEAM, github.actor) }} id: slack - uses: slackapi/slack-github-action@v1.19.0 + uses: slackapi/slack-github-action@v1.25.0 with: # This data can be any valid JSON from a previous step in the GitHub Action payload: | @@ -154,12 +161,12 @@ jobs: --name mdb103 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - - name: Set up JDK 11 - uses: actions/setup-java@v3 + - name: Set up JDK 17 + uses: actions/setup-java@v4 with: - java-version: '11' + java-version: '17' distribution: 'temurin' cache: maven @@ -169,11 +176,18 @@ jobs: chmod +x generate-certs.sh ./generate-certs.sh + - name: Set up Keystore storepass + run: | + mkdir ~/.cws/ + chmod 700 ~/.cws/ + echo ${{ secrets.KEYSTORE_PASSWORD }} > ~/.cws/creds + chmod 600 ~/.cws/creds + - name: Download Logstash uses: carlosperate/download-file-action@v1 with: - file-url: https://artifacts.elastic.co/downloads/logstash/logstash-8.8.0-windows-x86_64.zip - file-name: logstash-8.8.0.zip + file-url: https://artifacts.elastic.co/downloads/logstash/logstash-8.12.0-windows-x86_64.zip + file-name: logstash-8.12.0.zip location: install/logging/ - name: Check for Logstash @@ -219,7 +233,7 @@ jobs: - name: Upload test screenshots if: ${{ always() && steps.build.outcome == 'success' }} - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: test-screenshots-advanced path: test-screenshots/ @@ -227,7 +241,7 @@ jobs: - name: Send custom JSON data to Slack workflow if: ${{ always() && contains(env.TEAM, github.actor) }} id: slack - uses: slackapi/slack-github-action@v1.19.0 + uses: slackapi/slack-github-action@v1.25.0 with: # This data can be any valid JSON from a previous step in the GitHub Action payload: | @@ -255,10 +269,10 @@ jobs: steps: - name: Check out the repo - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Set up JDK 11 - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: java-version: '11' distribution: 'temurin' diff --git a/.github/workflows/ldap.yml b/.github/workflows/ldap.yml index d2330e07..8359a3e1 100644 --- a/.github/workflows/ldap.yml +++ b/.github/workflows/ldap.yml @@ -31,12 +31,12 @@ jobs: --name mdb103 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - - name: Set up JDK 11 - uses: actions/setup-java@v3 + - name: Set up JDK 17 + uses: actions/setup-java@v4 with: - java-version: '11' + java-version: '17' distribution: 'temurin' cache: maven @@ -46,11 +46,18 @@ jobs: chmod +x generate-certs.sh ./generate-certs.sh + - name: Set up Keystore storepass + run: | + mkdir ~/.cws/ + chmod 700 ~/.cws/ + echo ${{ secrets.KEYSTORE_PASSWORD }} > ~/.cws/creds + chmod 600 ~/.cws/creds + - name: Download Logstash - uses: carlosperate/download-file-action@v1 + uses: carlosperate/download-file-action@v2 with: - file-url: https://artifacts.elastic.co/downloads/logstash/logstash-8.8.0-windows-x86_64.zip - file-name: logstash-8.8.0.zip + file-url: https://artifacts.elastic.co/downloads/logstash/logstash-8.12.0-windows-x86_64.zip + file-name: logstash-8.12.0.zip location: install/logging/ - name: Check for Logstash @@ -102,7 +109,7 @@ jobs: - name: Send custom JSON data to Slack workflow if: ${{ always() && contains(env.TEAM, github.actor) }} id: slack - uses: slackapi/slack-github-action@v1.19.0 + uses: slackapi/slack-github-action@v1.25.0 with: # This data can be any valid JSON from a previous step in the GitHub Action payload: | diff --git a/.gitignore b/.gitignore index d3b907a3..e866a95a 100644 --- a/.gitignore +++ b/.gitignore @@ -34,4 +34,4 @@ install/logging/logstash-*.zip /jacoco-reports /test-screenshots -*.cnf \ No newline at end of file +*.cnf diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 00000000..fb130d61 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,13 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [X.Y.Z](https://github.com/NASA-AMMOS//releases/tag/X.Y.Z) - 2023-MM-DD + +### Added + +- + diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 00000000..211738d9 --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,135 @@ + +# Code of Conduct + +## Our Pledge + +We as members, contributors, and leaders pledge to make participation in our +community a harassment-free experience for everyone, regardless of age, body +size, visible or invisible disability, ethnicity, sex characteristics, gender +identity and expression, level of experience, education, socio-economic status, +nationality, personal appearance, race, caste, color, religion, or sexual +identity and orientation. + +We pledge to act and interact in ways that contribute to an open, welcoming, +diverse, inclusive, and healthy community. + +## Our Standards + +Examples of behavior that contributes to a positive environment for our +community include: + +* Demonstrating empathy and kindness toward other people +* Being respectful of differing opinions, viewpoints, and experiences +* Giving and gracefully accepting constructive feedback +* Accepting responsibility and apologizing to those affected by our mistakes, + and learning from the experience +* Focusing on what is best not just for us as individuals, but for the overall + community + +Examples of unacceptable behavior include: + +* The use of sexualized language or imagery, and sexual attention or advances of + any kind +* Trolling, insulting or derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or email address, + without their explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Enforcement Responsibilities + +Community leaders are responsible for clarifying and enforcing our standards of +acceptable behavior and will take appropriate and fair corrective action in +response to any behavior that they deem inappropriate, threatening, offensive, +or harmful. + +Community leaders have the right and responsibility to remove, edit, or reject +comments, commits, code, wiki edits, issues, and other contributions that are +not aligned to this Code of Conduct, and will communicate reasons for moderation +decisions when appropriate. + +## Scope + +This Code of Conduct applies within all community spaces, and also applies when +an individual is officially representing the community in public spaces. +Examples of representing our community include using an official e-mail address, +posting via an official social media account, or acting as an appointed +representative at an online or offline event. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported to the community administrators responsible for enforcement at +[@NikJPL (Aniwat.Nik.Sheurpukdi@jpl.nasa.gov)](https://github.com/NikJPL), +[@snnjpl (Shawn.N.Nguyen@jpl.nasa.gov)](https://github.com/snnjpl) or +[@sharimayer — Configuration Manager](https://github.com/sharimayer). +All complaints will be reviewed and investigated promptly and fairly. + +All community leaders are obligated to respect the privacy and security of the +reporter of any incident. + +## Enforcement Guidelines + +Community leaders will follow these Community Impact Guidelines in determining +the consequences for any action they deem in violation of this Code of Conduct: + +### 1. Correction + +**Community Impact**: Use of inappropriate language or other behavior deemed +unprofessional or unwelcome in the community. + +**Consequence**: A private, written warning from community leaders, providing +clarity around the nature of the violation and an explanation of why the +behavior was inappropriate. A public apology may be requested. + +### 2. Warning + +**Community Impact**: A violation through a single incident or series of +actions. + +**Consequence**: A warning with consequences for continued behavior. No +interaction with the people involved, including unsolicited interaction with +those enforcing the Code of Conduct, for a specified period of time. This +includes avoiding interactions in community spaces as well as external channels +like social media. Violating these terms may lead to a temporary or permanent +ban. + +### 3. Temporary Ban + +**Community Impact**: A serious violation of community standards, including +sustained inappropriate behavior. + +**Consequence**: A temporary ban from any sort of interaction or public +communication with the community for a specified period of time. No public or +private interaction with the people involved, including unsolicited interaction +with those enforcing the Code of Conduct, is allowed during this period. +Violating these terms may lead to a permanent ban. + +### 4. Permanent Ban + +**Community Impact**: Demonstrating a pattern of violation of community +standards, including sustained inappropriate behavior, harassment of an +individual, or aggression toward or disparagement of classes of individuals. + +**Consequence**: A permanent ban from any sort of public interaction within the +community. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], +version 2.1, available at +[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1]. + +Community Impact Guidelines were inspired by +[Mozilla's code of conduct enforcement ladder][Mozilla CoC]. + +For answers to common questions about this code of conduct, see the FAQ at +[https://www.contributor-covenant.org/faq][FAQ]. Translations are available at +[https://www.contributor-covenant.org/translations][translations]. + +[homepage]: https://www.contributor-covenant.org +[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html +[Mozilla CoC]: https://github.com/mozilla/diversity +[FAQ]: https://www.contributor-covenant.org/faq +[translations]: https://www.contributor-covenant.org/translations diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 5119547a..d1874f1e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,3 +1,329 @@ -# How to Contribute +# Contributing to Common-workflow-service + +Thanks for taking the time to consider contributing! We very much appreciate your time and effort. This document outlines the many ways you can contribute to our project, and provides detailed guidance on best practices. We look forward to your help! + +## Prerequisites + +Before you begin contributing to our project, it'll be a good idea to ensure you've satisfied the below pre-requisites. + +### License + +Our project has our licensing terms, including rules governing redistribution, documented in our [LICENSE](LICENSE) file. Please take a look at that file and ensure you understand the terms. This will impact how we, or others, use your contributions. + +### Code of Conduct + +Our Code of Conduct helps facilitate a positive interaction environment for everyone involved with the team, and provides guidance on what to do if you experience problematic behavior. Read more in our [CODE_OF_CONDUCT.md](CODE_OF_CONDUCT.md), and make sure you agree to its terms. + +### Developer Environment + +For patch contributions, see our [Developer Documentation](https://github.com/NASA-AMMOS/common-workflow-service/wiki) for more details on how to set up your local environment, to best contribute to our project. + +At a minimum however to submit patches (if using Git), you'll want to ensure you have: +1. An account on the Version Control System our project uses (i.e. GitHub). +2. The Version Control System client (i.e. Git) installed on your local machine. +3. The ability to edit, build, and test our project on your local machine. Again, see our [README.md](README.md) or detailed developer guide for more details + +### Communication Channels + +Before contributing changes to our project, it's a great idea to be familiar with our communication channels and to socialize your potential contributions to get feedback early. This will help give you context for your contributions, no matter their form. + +Our communication channels are: +- [Issue tracking system](https://github.com/NASA-AMMOS/common-workflow-service/issues) - a regularly monitored area to report issues with our software or propose changes +- [Discussion board](https://github.com/NASA-AMMOS/common-workflow-service/discussions) - a permanently archived place to hold conversations related to our project, and to propose as well as show+tell topics to the contributor team. This resource can be searched for old discussions. + +## Our Development Process + +Our project integrates contributions from many people, and so we'd like to outline a process you can use to visualize how your contributions may be integrated if you provide something. + +```mermaid +flowchart TD + repo_proj[(Our Repository)]-->|Fork|repo_fork[(Your Forked Repository)] + repo_fork-->|Make|patch(Your Changes) + patch-->|Submit|pr(Pull Request) + pr==>|Approved|repo_proj + pr-->|Changes Requested|repo_fork +``` + +### Fork our Repository + +Forking our repository, as opposed to directly committing to a branch is the preferred way to propose changes. + +See [this GitHub guide](https://docs.github.com/en/get-started/quickstart/fork-a-repo) on forking for information specific to GitHub.com + +#### Find or File an Issue + +Make sure people are aware you're working on a patch! Check out our [issue tracking system](https://github.com/NASA-AMMOS/common-workflow-service/issues) and find an open issue you'd like to work against, or alternatively file a new issue and mention you're working on a patch. + +#### Choose the Right Branch to Fork + +Our project typically has the following branches available, make sure to fork either the default branch or a branch someone else already tagged with a particular issue ticket you're working with. +- `main` — release branch +- `develop` — optional default branch, used primarily for new code development + +### Make your Modifications + +Within your local development environment, this is the stage at which you'll propose your changes, and commit those changes back to version control. See the [README.md](README.md) or development guide for more specifics on what you'll need as prerequisites to setup your local development environment. + +#### Commit Messages + +Commit messages to version control should reference a ticket in their title / summary line: + +``` +Issue #248 - Show an example commit message title +``` + +This makes sure that tickets are updated on GitHub with references to commits that are related to them. + +Commit should always be atomic. Keep solutions isolated whenever possible. Filler commits such as "clean up white space" or "fix typo" should be merged together before making a pull request, and significant sub-feature branches should be [rebased](https://www.youtube.com/results?search_query=git+rebase) to preserve commit history. Please ensure your commit history is clean and meaningful! + +### Submit a Pull Request + +Pull requests are the core way our project will receive your patch contributions. Navigate to your branch on your own fork within the version control system, and submit a pull request or submit the patch text to our project. + +Please make sure to provide a meaningful text description to your pull requests, whenever submitted. Our pull-request template will be auto-generated for you when you create your pull-request. See the template [here](.github/PULL_REQUEST_TEMPLATE.md). + +**Working on your first Pull Request?** See guide: [How to Contribute to an Open Source Project on GitHub](https://kcd.im/pull-request) + +### Reviewing your Pull Request + +Reviewing pull-requests, or any kinds of proposed patch changes, is an art. That being said, we follow the following best practices: +- **Intent** - is the purpose of your pull-request clearly stated? +- **Solution** - is your pull-request doing what you want it to? +- **Correctness** - is your pull-request doing what you want it to *correctly*? +- **Small Patches** - is your patch of a level of complexity and brevity that it can actually be reviewed by a human being? Or is does it involve too much content for one pull request? +- **Coding best practices** - are you following best practices in the coding / contribution language being used? +- **Readability** - is your patch readable, and ultimately maintainable, by others? +- **Reproducibility** - is your patch reproducible by others? +- **Tests** - do you have or have conducted meaningful tests? + +## Ways to Contribute + +### ⚠️ Issue Tickets + +> *Do you like to talk about new features, changes, requests?* + +Issue tickets are a very simple way to get involved in our project. It also helps new contributors get an understanding of the project more comprehensively. This is a great place to get started with the project if you're not sure where to start. + +See our list of issues at: https://github.com/NASA-AMMOS/common-workflow-service/issues + +#### Cleaning up Duplicate Issues + +Often we receive duplicate issues that can confuse project members on *which* issue ticket to hold conversations upon. + +Here's how you can help: +1. Scan the list of *open* issue tickets for duplicate titles, or internal wording +2. If you find duplicates, copy / paste the below message on the conversation thread of the issue ticket *that has less participants* involved + +``` +This is a duplicate issue. Please migrate conversations over to [issue-XYZ](hyperlink to issue) +``` + +#### Good First Issues + +Issue tickets can vary in complexity, and issues labeled with `good first issue` labels are often a great way to get started with the project as a newcomer. + +Take a look at our [issue tracking system](https://github.com/NASA-AMMOS/common-workflow-service/issues), and filter by `good first issue` for issues that are low-complexity, and that will help you get familiar with our issue tracking and patch submission process. + +#### Suggesting New Issue Labels + +Labels within our [issue tracking system](https://github.com/NASA-AMMOS/common-workflow-service/issues) are a great way to quickly sort through tickets. The project may not yet have labels to cover the full variety of issue tickets. Take a look through our list of issues, and if you notice a set of issue tickets that seem similar but are not categorized with an existing label, go ahead submit a request within one of the issues you've looked at with the following text: + +``` +I've noticed several other issues that are of the same category as this issue. Shall we make a new label for these types of issues? +``` + +#### Submitting Bug Issues + +Resolving bugs is a priority for our project. We welcome bug reports. However, please make sure to do the following prior to submitting a bug report: +- **Check for duplicates** - there may be a bug report already describing your issue, so check the [issue tracking system](https://github.com/NASA-AMMOS/common-workflow-service/issues) first. + +Here's some guidance on submitting a bug issue: +1. Navigate to our [issue tracking system](https://github.com/NASA-AMMOS/common-workflow-service/issues) and file a new issue +2. Select a bug template (if available) for your issue + 1. Fill out the template fields to the best of your ability, including output snippets or screenshots where applicable +3. Follow the general guidelines below for extra information about your bug + 1. Include a code snippet if you have it showcasing the bug + 2. Provide reproducible steps of how to recreate the bug + 3. If the bug triggers an exception or error message, include the *full message* or *stacktrace* + 4. Provide information about your operating system and the version of our project you're using + +#### Submitting New Feature Issues + +We welcome new feature requests to help grow our project. However, please make sure to do the following prior to submitting a new feature request: +- **Check for duplicates** - there may be a new feature issue already describing your issue, so check the [issue tracking system](https://github.com/NASA-AMMOS/common-workflow-service/issues) first +- **Consider alternatives** - is your feature really needed? Or is there a feature within our project or with a third-party that may help you achieve what you want? + +Here's some guidance on submitting a new feature issue: +1. Navigate to our [issue tracking system](https://github.com/NASA-AMMOS/common-workflow-service/issues) and file a new issue +2. Select a new feature template (if available) for your issue + 1. Fill out the template fields to the best of your ability + +#### Submitting Security Vulnerability Issues + +Security vulnerabilities should **not** be filed to the regular issue tracking system. + +Report your security vulnerabilities to (see contact links): [@jl-0](https://github.com/jl-0) or [@sharimayer](https://github.com/sharimayer) + +Please be sure to: +* Indicate the severity of the vulnerability +* Provide any workarounds, if you know them +* Provide return-contact information to follow-up with you if needed + +#### Reviewing Pull Requests + +Reviewing others' contributions is a great way to learn about best practices in both contributions as well as software. + +Take a look at our [pull requests tracking system](https://github.com/NASA-AMMOS/common-workflow-service/pulls), and try the following options for providing a review: +1. Read the code / patch associated with the pull-request, and take note of any coding, bug, or documentation issues if found +2. Try to recreate the pull-request patch on your local machine, and report if it has issues with your system in particular +3. Scan over suggested feedback from other contributors, and provide feedback if necessary + +### 💻 Code + +⚠️ It's **highly** advised that you take a look at our [issue tracking system](https://github.com/NASA-AMMOS/common-workflow-service/issues) before considering any code contributions. Here's some guidelines: +1. Check if any duplicate issues exist that cover your code contribution idea / task, and add comments to those tickets with your thoughts. +2. If no duplicates exist, create a new issue ticket and get a conversation started before making code changes using our [communication channels](#communication-channels). + +Once you have a solid issue ticket in hand and are ready to work on code, you'll want to: +1. Ensure you have development [prerequisites](#prerequisites) cleared. +2. Have your [development environment](#developer-environment) set up properly. +3. Go through our [development process](#our-development-process), including proposing changes to our project. + +Some guidelines for code-specific contributions: +- **Do your homework** - read-up on necessary documentation, like `README.md`s, developer documentation, and pre-existing code to see the intention and context necessary to make your contribution a success. It's important to _communicate_ what you're working on through our project [communication channels](#communication-channels) and get buy-in from frequent contributors - this will help the project be more receptive to your contributions! +- **Ask questions** - its important to ask questions while you work on your contributions, to check-in with frequent contributors on the style and the set of expectations to make your code contribution work well with pre-existing project code. Use our [communication channels](#communication-channels) +- **Keep positive** - code contributions, by their nature, have direct impacts on the output and functionality of the project. Keep a positive spirit as your code is reviewed, and take it in stride if core contributors take time to review, give you suggestions for your code or respectfully decline your contribution. This is all part of the process for quality open source development. +- **Comments** - include *useful* comments throughout your code that explain the intention of a code block, not a step-by-step analysis. See our [inline code documentation](#inline-code-documentation) section for specifics. + + +### 📖 Documentation + +Documentation is the core way our users and contributors learn about the project. We place a high value on the quality, thoroughness, and readability of our documentation. Writing or editing documentation is an excellent way to contribute to our project without performing active coding. + +⚠️ It's **highly** advised that you take a look at our [issue-tracking system](https://github.com/NASA-AMMOS/common-workflow-service/issues) before considering any documentation contributions. Here's some guidelines: +1. Check if any duplicate issues exist that cover your documentation contribution idea / task, and add comments to those tickets with your thoughts. +2. If no duplicates exist, create a new issue ticket and get a conversation started before making documentation changes. + +Some guidelines for documentation best practices (summarized from Google's [excellent documentation guide](https://google.github.io/styleguide/docguide/best_practices.html)): +- **Minimum viable docs** - don't do less documentation than your users / developers need, but also don't do more +- **Changed code = changed docs** - if your code has changed, remember to update your documentation +- **Delete old docs** - continually clean your documentation tree, and remove outdated docs regularly + +#### Documentation Organization + +The overall structure of our project documentation is as follows: +- Source-controlled documentation + - [README.md](README.md) - top-level information about how to run, build, and contribute to the project + - [CODE_OF_CONDUCT.md](CODE_OF_CONDUCT.md) - best practices and guidance on how to work well with other people in the project, and suggestions on dealing with interpersonal issues + - [CONTRIBUTING.md](CONTRIBUTING.md) - guidance on contributing to the project + - `*.java`, `*.py`, `*.sh`, etc. - inline documentation available inside code files +- Hosted documentation + - [Wiki Main-page](https://github.com/NASA-AMMOS/common-workflow-service/wiki) +- Discussion Boards + - [Discussions](https://github.com/NASA-AMMOS/common-workflow-service/discussions) + + + +For directions on contributing to our source-controlled documentation: +1. Ensure you have development [prerequisites](#prerequisites) cleared. +2. Have your [development environment](#developer-environment) set up properly. +3. Go through our [development process](#our-development-process), including proposing changes to our project. + + + +#### Writing Style + +To ensure documentation is readable and consistent by newcomers and experts alike, here are some suggestions on writing style for English: +- Use gender neutral pronouns (they/their/them) instead of he/she/his/her +- Avoid qualifiers that minimize the difficulty of a task at hand, e.g. avoid words like “easily”, “simply”, “just”, “merely”, “straightforward”, etc. Readers' expertise may not match your own, and qualifying complexity may deter some readers if the task does not match their level of experience. That being said, if a particular task is difficult or complex, do mention that. + +#### Common Wording + +Below are some commonly used words you'll want to leverage in your documentation contributions: +- **AMMOS** - Advanced Multi-Mission Operations System tool set. AMMOS is also the eponymous organization that sponsors this repository. +- **Docker** - Containerization service used to perform automated build, release and deployment. +- **GitHub** - one word, and capitalization of the 'G' and the 'H' +- **GitHub Actions** - Continuous Integration (CI) services that facilitate build automation + +#### Inline Code Documentation + +For language-specific guidance on code documentation, including style guides, see [Google's list of language style guides](https://google.github.io/styleguide/) for a variety of languages. + +Additionally, take a look at Google's recommendations on [inline code documentation](https://google.github.io/styleguide/docguide/best_practices.html#documentation-is-the-story-of-your-code) for best practices. + +#### Media + +Media, such as images, videos, sound files, etc., are an excellent way to explain documentation to a wider audience more easily. Include media in your contributions as often as possible. + +When including media into our version-control system, it is recommended to use formats such as: +- Diagrams: [Mermaid](https://mermaid-js.github.io/mermaid/#/) format +- Images: JPEG format +- Videos: H264 MPEG format +- Sounds: MP3 format + + +### ❓ Questions + +Answering questions is an excellent way to learn more about our project, as well as get better known in our project community. + +Here are just a few ways you can help answer questions for our project: +- Answer open questions in our [discussion forum](https://github.com/NASA-AMMOS/common-workflow-service/discussions) +- Answer open questions mentioned in our [issue tracking system](https://github.com/NASA-AMMOS/common-workflow-service/issues) + + +When answering questions, keep the following in mind: +- Be polite and friendly. See our [Code of Conduct](CODE_OF_CONDUCT.md) recommendations as you interact with others in the team. +- Repeat the specific question you are answering, followed by your suggestion. +- If suggesting code, repeat the line of code that needs to be altered, followed by your alteration +- Include any post-steps or checks to verify your answer can be reproduced + +### 🎨 Design + +Design files can help to guide new features and new areas of expansion for our project. We welcome these kinds of contributions. + +Here are just a few ways you can help provide design recommendations for our project: +- Create visual mockups or diagrams to increase usability of our project applications. This can apply to user interfaces, documentation structuring, or even code architecture diagrams. +- Conduct user research to understand user needs better. Save your findings within spreadsheets that the project team / contributors can review. +- Create art, such as logos or icons, to support the user experience for the project + +Each of the above can be contributed directly to repository code, and you should use our [development process](#our-development-process) to contribute your additions. + +### 🎟️ Meetups + +A great way to contribute towards our project goals is to socialize and encourage people to meet and learn more about each other. Consider ideas like: +- Propose workshops or meetups regarding some topic within our project +- Help point project contributors and community members to conferences and publications where they may socialize their unique innovations +- Schedule in-person or virtual happy-hours to help create a more social atmosphere within the project community + +For the above ideas, use our [communication channels](#communication-channels) to propose get-togethers. -TODO \ No newline at end of file diff --git a/LICENSE.txt b/LICENSE similarity index 100% rename from LICENSE.txt rename to LICENSE diff --git a/README.md b/README.md index 7ea9dde6..8e81e1f9 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,12 @@ See the [wiki](https://github.com/NASA-AMMOS/common-workflow-service/wiki) for m ## Prerequisites +- [**Java 17 JDK**](https://formulae.brew.sh/formula/openjdk@17): CWS only runs on JDK 17. (NOTE: Cannot use JRE) + - For Homebrew users: + - Install OpenJDK 17 using: `brew install openjdk@17` + - Check the exact version installed using `/usr/libexec/java_home -V` + - Add to your Shell startup (e.g. .zprofile): `export JAVA_HOME=$(/usr/libexec/java_home -v X.X.X)` + - Replace the X.X.X version above with the OpenJDK 17 output from the `/usr/libexec/java_home -V` command. - [**Maven**](https://maven.apache.org/download.cgi): Used to dynamically download libraries and other required project dependencies. - For Home-brew users: - Install Maven using: `brew install maven` @@ -31,19 +37,17 @@ See the [wiki](https://github.com/NASA-AMMOS/common-workflow-service/wiki) for m - A database for CWS to use. `cws_dev` is a good default name. - A database user with full access to the above database. - [**ITerm2**](https://iterm2.com/): Currently these build scripts include commands to open new terminal windows using ITerm2, so they are best run from that terminal. -- **Logstash 8.8.0+**: Download Logstash for your platform. Uncompress it (only if it is a .tar.gz) and then ZIP back it up with the filename 'logstash-8.8.0.zip' and place in `install/logging/`. This is a temporary workaround while we clean up our installation process. You can find the zip download [here](https://www.elastic.co/downloads/logstash). -- **Elasticsearch 8.8.0+**: CWS requires an externally-configured elasticsearch cluster to be set up. You can use an SSL Secure Elasticsearch with or without authentication, or an Insecure HTTP Elasticsearch. +- **Logstash 8.12.0+**: Download Logstash for your platform. Uncompress it (only if it is a .tar.gz) and then ZIP back it up with the filename 'logstash-8.12.0.zip' and place in `install/logging/`. This is a temporary workaround while we clean up our installation process. You can find the zip download [here](https://www.elastic.co/downloads/logstash). +- **Elasticsearch 8.12.0+**: CWS requires an externally-configured elasticsearch cluster to be set up. You can use an SSL Secure Elasticsearch with or without authentication, or an Insecure HTTP Elasticsearch. - The "Elasticsearch Setup" instruction below provides a contained Dockerized way of running Elasticsearch. This serves as an alternative to installing Elasticsearch. -- Tomcat **keystore and truststore files** (needed for CWS web console to work properly): +- Tomcat **keystore, truststore, storepass files** (needed for CWS web console to work properly). To generate an open-source **.keystore** and **cws_truststore.jks** use the script `./generate-certs.sh` [here](https://github.com/NASA-AMMOS/common-workflow-service/tree/develop/cws-certs) - You will need to add your own Tomcat keystore file to this path: `install/.keystore` - You will need to add your own truststore file to this path: `install/tomcat_lib/cws_truststore.jks` - See: https://tomcat.apache.org/tomcat-9.0-doc/ssl-howto.html - - **Java 11 JDK**: CWS only runs on JDK 11 now, but planning for JDK 17 soon. - - For Homebrew users: - - Install OpenJDK 11 using: `brew install openjdk@11` - - Check the exact version installed using `/usr/libexec/java_home -V` - - Add to your Shell startup (e.g. .zprofile): `export JAVA_HOME=$(/usr/libexec/java_home -v X.X.X)` - - Replace the X.X.X version above with the OpenJDK 11 output from the `/usr/libexec/java_home -V` command. +- **Store Your Keystore Password**: You will need to add your own creds file, which carries the keystore password, to this path: `~/.cws/creds` + - Set the permissions for the **~/.cws/** directory and **creds** file as Owner-Only. + - **~/.cws/** directory: `chmod 700 ~/.cws/` + - **~/.cws/creds** file: `chmod 600 ~/.cws/creds` ### **Development Environment Configuration** @@ -180,6 +184,8 @@ Start `test.sh` script by running: This will produce jacoco reports with code coverage measurements. +## [Adaptation Setup Guide](cws-adaptation/README.md) + # Contributing Please see our [contribution guidelines](https://github.com/NASA-AMMOS/common-workflow-service/blob/main/CONTRIBUTING.md). diff --git a/ci/ci.sh b/ci/ci.sh index de585416..297156a1 100755 --- a/ci/ci.sh +++ b/ci/ci.sh @@ -36,26 +36,26 @@ function worker_conf_data() { INSTALL_TYPE=${1} if [[ "${INSTALL_TYPE}" == "worker1" ]]; then - sed -i 's/__WORKER_TYPE__/run_all/' ${ROOT}/ci_worker.conf - sed -i 's/__CWS_WEB_PORT__/37080/' ${ROOT}/ci_worker.conf - sed -i 's/__CWS_SSL_PORT__/37443/' ${ROOT}/ci_worker.conf - sed -i 's/__CWS_AJP_PORT__/37009/' ${ROOT}/ci_worker.conf - sed -i 's/__CWS_SHUTDOWN_PORT__/37005/' ${ROOT}/ci_worker.conf - sed -i 's/__CWS_JMX_PORT__/31098/' ${ROOT}/ci_worker.conf + sed -i '' -e 's/__WORKER_TYPE__/run_all/' ${ROOT}/ci_worker.conf + sed -i '' -e 's/__CWS_WEB_PORT__/37080/' ${ROOT}/ci_worker.conf + sed -i '' -e 's/__CWS_SSL_PORT__/37443/' ${ROOT}/ci_worker.conf + sed -i '' -e 's/__CWS_AJP_PORT__/37009/' ${ROOT}/ci_worker.conf + sed -i '' -e 's/__CWS_SHUTDOWN_PORT__/37005/' ${ROOT}/ci_worker.conf + sed -i '' -e 's/__CWS_JMX_PORT__/31098/' ${ROOT}/ci_worker.conf elif [[ "${INSTALL_TYPE}" == "worker2" ]]; then - sed -i 's/__WORKER_TYPE__/run_models_only/' ${ROOT}/ci_worker.conf - sed -i 's/__CWS_WEB_PORT__/36080/' ${ROOT}/ci_worker.conf - sed -i 's/__CWS_SSL_PORT__/36443/' ${ROOT}/ci_worker.conf - sed -i 's/__CWS_AJP_PORT__/36009/' ${ROOT}/ci_worker.conf - sed -i 's/__CWS_SHUTDOWN_PORT__/36005/' ${ROOT}/ci_worker.conf - sed -i 's/__CWS_JMX_PORT__/31097/' ${ROOT}/ci_worker.conf + sed -i '' -e 's/__WORKER_TYPE__/run_models_only/' ${ROOT}/ci_worker.conf + sed -i '' -e 's/__CWS_WEB_PORT__/36080/' ${ROOT}/ci_worker.conf + sed -i '' -e 's/__CWS_SSL_PORT__/36443/' ${ROOT}/ci_worker.conf + sed -i '' -e 's/__CWS_AJP_PORT__/36009/' ${ROOT}/ci_worker.conf + sed -i '' -e 's/__CWS_SHUTDOWN_PORT__/36005/' ${ROOT}/ci_worker.conf + sed -i '' -e 's/__CWS_JMX_PORT__/31097/' ${ROOT}/ci_worker.conf elif [[ "${INSTALL_TYPE}" == "worker3" ]]; then - sed -i 's/__WORKER_TYPE__/run_external_tasks_only/' ${ROOT}/ci_worker.conf - sed -i 's/__CWS_WEB_PORT__/33080/' ${ROOT}/ci_worker.conf - sed -i 's/__CWS_SSL_PORT__/33443/' ${ROOT}/ci_worker.conf - sed -i 's/__CWS_AJP_PORT__/33009/' ${ROOT}/ci_worker.conf - sed -i 's/__CWS_SHUTDOWN_PORT__/33005/' ${ROOT}/ci_worker.conf - sed -i 's/__CWS_JMX_PORT__/31096/' ${ROOT}/ci_worker.conf + sed -i '' -e 's/__WORKER_TYPE__/run_external_tasks_only/' ${ROOT}/ci_worker.conf + sed -i '' -e 's/__CWS_WEB_PORT__/33080/' ${ROOT}/ci_worker.conf + sed -i '' -e 's/__CWS_SSL_PORT__/33443/' ${ROOT}/ci_worker.conf + sed -i '' -e 's/__CWS_AJP_PORT__/33009/' ${ROOT}/ci_worker.conf + sed -i '' -e 's/__CWS_SHUTDOWN_PORT__/33005/' ${ROOT}/ci_worker.conf + sed -i '' -e 's/__CWS_JMX_PORT__/31096/' ${ROOT}/ci_worker.conf else print "ERROR: UNEXPECTED INSTALL TYPE VALUE: '${INSTALL_TYPE}'" exit 1; @@ -123,9 +123,6 @@ default_cws_auth_scheme=CAMUNDA default_history_level=full default_shutdown_port=38005 metrics_publishing_interval=10 -camunda_version=${CAMUNDA_VER} -java_version=${JAVA_HOME_VERSION} -java_home=${JAVA_HOME} EOF @@ -184,9 +181,6 @@ aws_cloudwatch_endpoint=monitoring.us-west-1.amazonaws.com default_history_level=full default_shutdown_port=38005 metrics_publishing_interval=10 -camunda_version=${CAMUNDA_VER} -java_version=${JAVA_HOME_VERSION} -java_home=${JAVA_HOME} EOF diff --git a/create_server_dist.sh b/create_server_dist.sh index 7312733c..6c5f2f89 100755 --- a/create_server_dist.sh +++ b/create_server_dist.sh @@ -69,6 +69,7 @@ cp ${INSTALL_DIR}/tomcat_lib/css-jaas.cfg ${CONFIG_TEMPLATES cp ${INSTALL_DIR}/tomcat_bin/setenv.sh ${CONFIG_TEMPLATES_DIR}/tomcat_bin cp ${INSTALL_DIR}/tomcat_conf/bpm-platform.xml ${CONFIG_TEMPLATES_DIR}/tomcat_conf cp ${INSTALL_DIR}/tomcat_conf/server.xml ${CONFIG_TEMPLATES_DIR}/tomcat_conf +cp ${INSTALL_DIR}/tomcat_conf/server_adaptation.xml ${CONFIG_TEMPLATES_DIR}/tomcat_conf cp ${INSTALL_DIR}/tomcat_conf/web.xml ${CONFIG_TEMPLATES_DIR}/tomcat_conf cp ${INSTALL_DIR}/tomcat_conf/ldap_plugin_bean.xml ${CONFIG_TEMPLATES_DIR}/tomcat_conf cp ${INSTALL_DIR}/tomcat_conf/ldap_plugin_ref.xml ${CONFIG_TEMPLATES_DIR}/tomcat_conf @@ -186,6 +187,17 @@ awk 'NR==FNR { a[n++]=$0; next } cp ${INSTALL_DIR}/sql/core.afterstartup.sql.template ${CWS}/sql/cws/core.afterstartup.sql +if [[ -f ${INSTALL_DIR}/sql/adaptation.sql.template && -f ${INSTALL_DIR}/sql/adaptation_core.sql.template && -f ${INSTALL_DIR}/sql/adaptation_external.sql.template ]]; then + print "Building adaptation (external) sql..." + awk 'NR==FNR { a[n++]=$0; next } + /__CUSTOM_METHODS_JAVA__/ { for (i=0;i ${CWS}/sql/cws/adaptation.sql + awk 'NR==FNR { a[n++]=$0; next } + /__CUSTOM_METHODS_JAVA__/ { for (i=0;i ${CWS}/sql/cws/adaptation_core.sql + awk 'NR==FNR { a[n++]=$0; next } + /__CUSTOM_METHODS_JAVA__/ { for (i=0;i ${CWS}/sql/cws/adaptation_external.sql +fi + + rm ${DIST}/snippets.java rm ${DIST}/snippets.java.bak diff --git a/cws-adaptation-engine/pom.xml b/cws-adaptation-engine/pom.xml index 1d7f6203..1dc22c83 100644 --- a/cws-adaptation-engine/pom.xml +++ b/cws-adaptation-engine/pom.xml @@ -3,7 +3,7 @@ gov.nasa.jpl.ammos.ids.cws common-workflow-service - 2.5.0 + 2.6.0-pre.1 cws-adaptation-engine diff --git a/cws-adaptation/README.md b/cws-adaptation/README.md new file mode 100644 index 00000000..3ee90353 --- /dev/null +++ b/cws-adaptation/README.md @@ -0,0 +1,54 @@ +## Adaptation Setup Guide + +CWS can be adapted and tailored for a mission. This can be done by modifying certain resources and source code of CWS-CORE. + +Create new functionalities by adding: + +* External Database Config +* Custom Java code +* Custom Rest Service API +* Custom Initiators +* etc... + +### Adaptation Database + +Adaptation Database feature lets you connect to a external database separate from that of the main `cws_dev` database. + +**(1)** You must first include the following SQL Template files to the `install/sql/` directory: +* `install/sql/adaptation.sql.template` **(Core Database: `cws_dev`)** +* `install/sql/adaptation_core.sql.template` **(Core Database: `cws_dev`)** +* `install/sql/adaptation_external.sql.template` **(Adaptation Database: `cws_external_db`)** + +**(2)** Create your schema/tables within the added Adaptation SQL Template files. +* Example (`adaptation_external.sql.template`): +``` +CREATE TABLE IF NOT EXISTS `cws_external_table` ( + ... + ... +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin; +``` + +**(3)** Write Custom Java Code. + +By referencing your adaptation tables, you can connect and communicate with your external database. + +Write Java custom code that extends from DbService and use the `jdbcTemplate` or `jdbcAdaptationTemplate` JDBC source to query the core and external databases. +``` +jdbcAdaptationTemplate (adaptation external database) +jdbcTemplate (core database) +``` + +### Adaptation Workers Modal + +Custom your Deployment page Workers view with add-ons and filters. + +The UI for the Worker listview is customizable with through the javascript `addAdaptationWorkersInfo` function. + +File: `cws-ui/src/main/webapp/js/adaptation-workers-modal.js` + +Write your custom code here: +``` +function addAdaptationWorkersInfo(dataProcKey, listWorkers) { + return; +} +``` \ No newline at end of file diff --git a/cws-adaptation/pom.xml b/cws-adaptation/pom.xml index a6249342..15881661 100644 --- a/cws-adaptation/pom.xml +++ b/cws-adaptation/pom.xml @@ -3,7 +3,7 @@ gov.nasa.jpl.ammos.ids.cws common-workflow-service - 2.5.0 + 2.6.0-pre.1 cws-adaptation diff --git a/cws-core/pom.xml b/cws-core/pom.xml index f24f422a..ba2d75e1 100644 --- a/cws-core/pom.xml +++ b/cws-core/pom.xml @@ -3,7 +3,7 @@ gov.nasa.jpl.ammos.ids.cws common-workflow-service - 2.5.0 + 2.6.0-pre.1 cws-core diff --git a/cws-core/src/main/java/jpl/cws/core/db/DbService.java b/cws-core/src/main/java/jpl/cws/core/db/DbService.java index 5366bd04..59842a0a 100644 --- a/cws-core/src/main/java/jpl/cws/core/db/DbService.java +++ b/cws-core/src/main/java/jpl/cws/core/db/DbService.java @@ -9,6 +9,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.jdbc.core.JdbcTemplate; import org.springframework.jdbc.core.namedparam.MapSqlParameterSource; import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate; @@ -22,9 +23,15 @@ public class DbService { private static final Logger log = LoggerFactory.getLogger(DbService.class); - @Autowired protected JdbcTemplate jdbcTemplate; - @Autowired protected NamedParameterJdbcTemplate namedJdbcTemplate; - + @Autowired + protected JdbcTemplate jdbcTemplate; + + @Autowired + protected NamedParameterJdbcTemplate namedJdbcTemplate; + + @Autowired + protected JdbcTemplate jdbcAdaptationTemplate; + protected static final long SLOW_WARN_THRESHOLD = 100; protected static final int IN_CLAUSE_MAX_ELEMENTS = 100; diff --git a/cws-core/src/main/java/jpl/cws/core/db/SchedulerDbService.java b/cws-core/src/main/java/jpl/cws/core/db/SchedulerDbService.java index 83d015bd..7dd9c353 100644 --- a/cws-core/src/main/java/jpl/cws/core/db/SchedulerDbService.java +++ b/cws-core/src/main/java/jpl/cws/core/db/SchedulerDbService.java @@ -398,6 +398,13 @@ public int getCountForClaimedProcInstPerKey(String procDefKey, List clai return jdbcTemplate.queryForObject(query, Integer.class); } + public List> getProcDefKeyLatestCompleteInst(String procDefKey) { + return jdbcTemplate.queryForList( + "SELECT proc_inst_id, start_time, end_time FROM cws_proc_inst_status WHERE proc_def_key=? AND status='complete' ORDER BY start_time DESC LIMIT 1", + new Object[]{procDefKey} + ); + } + public String getProcDefKeyFromUuid(String uuid) { String query = "SELECT proc_def_key FROM cws_sched_worker_proc_inst " + "WHERE uuid='" + uuid + "'"; diff --git a/cws-engine-service/pom.xml b/cws-engine-service/pom.xml index 315042e5..3bc75c28 100644 --- a/cws-engine-service/pom.xml +++ b/cws-engine-service/pom.xml @@ -3,7 +3,7 @@ gov.nasa.jpl.ammos.ids.cws common-workflow-service - 2.5.0 + 2.6.0-pre.1 cws-engine-service @@ -123,6 +123,19 @@ junit + + org.graalvm.js + js + 23.0.2 + runtime + + + org.graalvm.js + js-scriptengine + 23.0.2 + runtime + + org.apache.tomcat diff --git a/cws-engine-service/src/main/java/jpl/cws/engine/WorkerService.java b/cws-engine-service/src/main/java/jpl/cws/engine/WorkerService.java index 17e58997..cebb0c1a 100644 --- a/cws-engine-service/src/main/java/jpl/cws/engine/WorkerService.java +++ b/cws-engine-service/src/main/java/jpl/cws/engine/WorkerService.java @@ -756,6 +756,13 @@ public List> claimWithCounter(String limitToProcDefKey) { "(remainders = " + remainders + ", procMaxNumbers = " + workerMaxProcInstances.entrySet() + ", currentCounts = " + currentCounts + ")"); + + for (Entry entry : remainders.entrySet()) { + List> lastCompleteProcInst = schedulerDbService.getProcDefKeyLatestCompleteInst(entry.getKey().toString()); + if (lastCompleteProcInst.size() > 0) { + log.debug("Last completed process instance for procDefKey '" + entry.getKey().toString() + "': " + lastCompleteProcInst); + } + } } @@ -895,7 +902,8 @@ public boolean syncCounters(String reason) { public void setJobExecutorMaxPoolSize(Integer executorServiceMaxPoolSize, boolean doDbUpdate) { if (executorServiceMaxPoolSize != null) { try { - + // we are getting errors if we go beyond 10? + executorServiceMaxPoolSize = Math.min(10, executorServiceMaxPoolSize); // Log information about JMX remote interface if (System.getProperty("com.sun.management.jmxremote") == null) { log.warn("JMX remote appears to be disabled"); diff --git a/cws-engine/pom.xml b/cws-engine/pom.xml index 612377a9..8a55fe72 100644 --- a/cws-engine/pom.xml +++ b/cws-engine/pom.xml @@ -4,7 +4,7 @@ gov.nasa.jpl.ammos.ids.cws common-workflow-service - 2.5.0 + 2.6.0-pre.1 cws-engine @@ -24,6 +24,18 @@ gov.nasa.jpl.ammos.ids.cws cws-adaptation-engine + + org.graalvm.js + js + 23.0.2 + runtime + + + org.graalvm.js + js-scriptengine + 23.0.2 + runtime + diff --git a/cws-installer/pom.xml b/cws-installer/pom.xml index 332f7883..545c6caf 100644 --- a/cws-installer/pom.xml +++ b/cws-installer/pom.xml @@ -3,7 +3,7 @@ gov.nasa.jpl.ammos.ids.cws common-workflow-service - 2.5.0 + 2.6.0-pre.1 cws-installer diff --git a/cws-installer/src/main/java/jpl/cws/task/CwsInstaller.java b/cws-installer/src/main/java/jpl/cws/task/CwsInstaller.java index 9cbd3fbd..560bd241 100755 --- a/cws-installer/src/main/java/jpl/cws/task/CwsInstaller.java +++ b/cws-installer/src/main/java/jpl/cws/task/CwsInstaller.java @@ -42,6 +42,9 @@ import org.w3c.dom.*; import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.DocumentBuilder; +import java.io.FileInputStream; +import java.util.Enumeration; +import java.io.IOException; import java.io.BufferedReader; import java.io.File; @@ -49,6 +52,9 @@ import java.io.IOException; import java.io.InputStreamReader; import java.lang.Math; +import java.util.Date; +import java.text.SimpleDateFormat; +import java.util.*; import java.nio.file.Path; import java.nio.file.Paths; import java.sql.Connection; @@ -65,8 +71,14 @@ import java.util.TimeZone; import javax.naming.AuthenticationNotSupportedException; import javax.naming.AuthenticationException; -import javax.naming.NamingEnumeration; import javax.naming.NamingException; +import java.security.cert.Certificate; +import java.security.cert.CertificateException; +import java.security.cert.X509Certificate; +import java.security.KeyStore; +import java.security.KeyStoreException; +import java.security.NoSuchAlgorithmException; +import java.security.UnrecoverableEntryException; import javax.tools.ToolProvider; @@ -155,6 +167,16 @@ public class CwsInstaller { private static String cws_db_username; private static String cws_db_password; + private static String cws_adapt_use_shared_db; + private static String cws_adapt_db_type; + private static String cws_adapt_db_host; + private static String cws_adapt_db_port; + private static String cws_adapt_db_name; + private static String cws_adapt_db_url; + private static String cws_adapt_db_driver; + private static String cws_adapt_db_username; + private static String cws_adapt_db_password; + private static String cws_auth_scheme; private static String cws_user; private static String cws_user_firstname; @@ -167,6 +189,8 @@ public class CwsInstaller { private static String cws_shutdown_port; private static String cws_tomcat_ajp_port; + private static String cws_keystore_storepass; + private static String cws_smtp_hostname; private static String cws_smtp_port; @@ -212,11 +236,6 @@ public class CwsInstaller { private static String aws_sqs_dispatcher_sqsUrl; private static String aws_sqs_dispatcher_msgFetchLimit; - private static String camunda_version; - - private static String java_version; - private static String java_home = System.getenv("JAVA_HOME"); - private static Boolean reconfigure = false; @@ -258,6 +277,7 @@ public static void main(String args[]) { setupNotificationEmails(); setupTokenExpirationHours(); setupPorts(); + getKeystorePassword(); setupTaskAssigmentEmails(); setupSMTP(); setupElasticsearch(); @@ -349,9 +369,6 @@ private static void init() { ldap_identity_plugin_class = getPreset(LDAP_IDENTITY_PLUGIN_CLASS); ldap_security_filter_class = getPreset(LDAP_SECURITY_FILTER_CLASS); camunda_security_filter_class = getPreset(CAMUNDA_SECURITY_FILTER_CLASS); - camunda_version = getPreset("camunda_version"); - - java_version = getPreset("java_version"); } private static void exit(int status) { @@ -1056,6 +1073,41 @@ private static void setupLimitToRemoveAbandonedWorkersByDays() { } + private static void getKeystorePassword() { + cws_keystore_storepass = getPreset("cws_keystore_storepass"); + + if (cws_keystore_storepass == null) { + Path filePath; + filePath = Paths.get("~/.cws/creds"); + String storepassFilePath = filePath.toString(); + storepassFilePath = storepassFilePath.replaceFirst("^~", System.getProperty("user.home")); + File storepassReadFile = new File(storepassFilePath); + boolean fileExists = storepassReadFile.exists(); + + if (fileExists == true) { + if (!storepassReadFile.canRead()) { + print("ERROR: creds in path '" + "~/.cws/creds" + "' is NOT readable by system user."); + print(" "); + print("WARNING: Read and fulfill the Keystore/Truststore prerequisites before continuing installation: "); + print(" https://github.com/NASA-AMMOS/common-workflow-service?tab=readme-ov-file#prerequisites"); + exit(1); + } + } else { + print("ERROR: creds does NOT exist in path '" + "~/.cws/creds" + "' "); + print(" "); + print("WARNING: Make sure to place creds in the correct path and satisfy the following Keystore/Truststore prerequisites: "); + print(" https://github.com/NASA-AMMOS/common-workflow-service?tab=readme-ov-file#prerequisites"); + exit(1); + } + + try { + cws_keystore_storepass = Files.readString(Paths.get(storepassFilePath)).trim(); + } catch (IOException e) { + log.error("Read-in Keystore Storepass ERROR: " + e.getMessage()); + } + } + } + private static void setupPorts() { // PROMPT USER FOR CWS WEB PORT cws_tomcat_connector_port = getPreset("cws_web_port"); @@ -1667,6 +1719,34 @@ private static void showInstallationInfo() { print("Database User = " + cws_db_username); print("Database Password = ****** (hidden) "); print("...................................................................................."); + + cws_adapt_use_shared_db = getPreset("adaptation_use_shared_db"); + cws_adapt_db_type = getPreset("adaptation_db_type"); + cws_adapt_db_host = getPreset("adaptation_db_host"); + cws_adapt_db_port = getPreset("adaptation_db_port"); + cws_adapt_db_name = getPreset("adaptation_db_name"); + cws_adapt_db_username = getPreset("adaptation_db_username"); + cws_adapt_db_password = getPreset("adaptation_db_password"); + cws_adapt_db_url = "jdbc:" + cws_adapt_db_type + "://" + cws_adapt_db_host + ":" + cws_adapt_db_port + "/" + cws_adapt_db_name + "?autoReconnect=true"; + + if (cws_adapt_use_shared_db != null) { + if (cws_adapt_use_shared_db.equalsIgnoreCase("y")) { + + if (cws_adapt_db_type.equals("mariadb")) { + cws_adapt_db_driver = "org.mariadb.jdbc.Driver"; + } else if (cws_adapt_db_type.equals("mysql")) { + cws_adapt_db_driver = "com.mysql.jdbc.Driver"; + } + print(" CWS Adapt Database "); + print(" Database Type = " + cws_adapt_db_type); + print(" Database URL = " + cws_adapt_db_url); + print(" Database Driver = " + cws_adapt_db_driver); + print(" Database User = " + cws_adapt_db_username); + print(" Database Password = ****** (hidden) "); + print("...................................................................................."); + } + } + if (cws_auth_scheme.equals("LDAP")) { print("LDAP User = " + cws_user); } @@ -1678,6 +1758,7 @@ private static void showInstallationInfo() { print("Admin Last Name = " + cws_user_lastname); print("Admin Email = " + cws_user_email); } + print("...................................................................................."); print("CWS web port = " + cws_tomcat_connector_port); print("CWS SSL port = " + cws_tomcat_ssl_port); print("CWS AJP port = " + cws_tomcat_ajp_port); @@ -1774,6 +1855,9 @@ private static void validateConfig() { // Check that user provided Elasticsearch service is up and healthy warningCount += validateElasticsearch(); + // Check that keystore and truststore is valid, not expired + warningCount += validateKeystoreTruststore(); + if (installWorker && !installConsole) { // Validate the AMQ host/port for worker only installations. warningCount += validateAmqConfig(); @@ -2379,6 +2463,54 @@ private static int validateElasticsearch() { } } + /** + * Validates the .keystore file in tomcat_lab. Checks for correct file name and expiration + */ + private static int validateKeystoreTruststore() { + print("checking that user provided valid .keystore file and certificate chain..."); + Path filePath; + filePath = Paths.get(cws_tomcat_conf + SEP + ".keystore"); + String keystoreFilePath = filePath.toString(); + long ONE_DAY_MS = 24 * 60 * 60 * 1000; // 24 hours or 1 day + try { + KeyStore ks = KeyStore.getInstance("JKS"); + ks.load(new FileInputStream(keystoreFilePath), cws_keystore_storepass.toCharArray()); + Enumeration aliases = ks.aliases(); + while(aliases.hasMoreElements()) { + String keystoreRoot = (String) aliases.nextElement(); + Date expirationDate = ((X509Certificate) ks.getCertificate(keystoreRoot)).getNotAfter(); + Date currentTime = new Date(); + long daysInterval = expirationDate.getTime() - currentTime.getTime(); + long numDays = daysInterval / (ONE_DAY_MS); + if (numDays <= 0) { + print(" [WARNING]"); + print(" The Certificate Chain in Keystore '" + keystoreFilePath + "' is expired. "); + print(" Expiration Date: " + expirationDate); + print(""); + return 1; + } else if (numDays > 0 && numDays < 90) { + print(" [OK]"); + print(" NOTICE: Make sure to renew the certificates within the .keystore certificate chain soon."); + print(" Certificate(s): '" + keystoreFilePath + "' "); + print(" Expiration Date: " + expirationDate); + print(" Days Until expiration: " + numDays + " days"); + print(""); + return 0; + } + } + } catch (Exception e) { + print(" [WARNING]"); + print(" The path '" + cws_tomcat_conf + SEP + "' "); + print(" may NOT contain .keystore file OR holds a keystore that is mismatched with password in '~/.cws/creds' or cws_keystore_storepass configuration."); + print(""); + log.error("Keystore Storepass ERROR: " + e.getMessage()); + return 1; + } + print(" [OK]"); + print(""); + return 0; // no warnings + } + /** * Validates that some sort of time syncing service * such as NTP or chrony is running on this installation machine. @@ -2486,6 +2618,8 @@ private static void createFreshWorkDir() { Paths.get(config_work_dir + SEP + "tomcat_conf" + SEP + "bpm-platform.xml")); copy(Paths.get( config_templates_dir + SEP + "tomcat_conf" + SEP + "server.xml"), Paths.get(config_work_dir + SEP + "tomcat_conf" + SEP + "server.xml")); + copy(Paths.get( config_templates_dir + SEP + "tomcat_conf" + SEP + "server_adaptation.xml"), + Paths.get(config_work_dir + SEP + "tomcat_conf" + SEP + "server_adaptation.xml")); copy(Paths.get( config_templates_dir + SEP + "tomcat_conf" + SEP + "web.xml"), Paths.get(config_work_dir + SEP + "tomcat_conf" + SEP + "web.xml")); copy(Paths.get( config_templates_dir + SEP + "engine-rest_mods" + SEP + "web.xml"), @@ -2554,6 +2688,29 @@ private static void updateFiles() throws IOException { content = content.replace("__CWS_DB_DRIVER__", cws_db_driver); content = content.replace("__CWS_DB_USERNAME__", cws_db_username); content = content.replace("__CWS_DB_PASSWORD__", cws_db_password); + + writeToFile(filePath, content); + copy( + Paths.get(config_work_dir + SEP + "tomcat_conf" + SEP + "server_adaptation.xml"), + Paths.get(cws_tomcat_root + SEP + "conf" + SEP + "server_adaptation.xml")); + if (cws_adapt_db_url != null && cws_adapt_db_driver != null && + cws_adapt_db_username != null && cws_adapt_db_password != null) { + + // Fill in the __ADAPTATION_SERVER_RESOURCE__ + String serverAdaptationContent = getFileContents( + Paths.get(config_work_dir + SEP + "tomcat_conf" + SEP + "server_adaptation.xml")); + content = content.replace(""); + content = content.replace("__CWS_ADAPTATION_BEAN__", "\n" + + "\t\t\n" + + "\t"); + } else { + content = content.replace("__CWS_ADAPTATION_JNDI__", ""); + content = content.replace("__CWS_ADAPTATION_BEAN__", ""); + } + content = content.replace("__CWS_DB_DRIVER__", cws_db_driver); content = content.replace("__CWS_DB_URL__", cws_db_url); content = content.replace("__CWS_DB_USERNAME__", cws_db_username); @@ -2850,10 +3018,6 @@ private static void updateCwsUiProperties() throws IOException { content = content.replace("__AWS_SQS_DISPATCHER_MSG_FETCH_LIMIT__", aws_sqs_dispatcher_msgFetchLimit); } - content = content.replace("__CWS_CAMUNDA_VERSION__", camunda_version); - content = content.replace("__CWS_JAVA_VERSION__", java_version); - content = content.replace("__CWS_JAVA_HOME__", java_home); - writeToFile(filePath, content); copy( Paths.get(config_work_dir + SEP + "cws-ui" + SEP + "cws-ui.properties"), @@ -2865,6 +3029,18 @@ private static void updateCwsUiConfig() throws IOException { print(" Updating cws-ui/applicationContext.xml..."); Path path = Paths.get(config_work_dir + SEP + "cws-ui" + SEP + "applicationContext.xml"); String content = getFileContents(path); + + if (cws_adapt_db_url != null && cws_adapt_db_driver != null && + cws_adapt_db_username != null && cws_adapt_db_password != null) { + content = content.replace("__CWS_ADAPTATION_JNDI__", ""); + content = content.replace("__CWS_ADAPTATION_BEAN__", "\n" + + "\t\t\n" + + "\t"); + } else { + content = content.replace("__CWS_ADAPTATION_JNDI__", ""); + content = content.replace("__CWS_ADAPTATION_BEAN__", ""); + } + content = content.replace("__CWS_DB_DRIVER__", cws_db_driver); content = content.replace("__CWS_DB_URL__", cws_db_url); content = content.replace("__CWS_DB_USERNAME__", cws_db_username); @@ -3261,4 +3437,4 @@ private static void setPreset(String key, String value) { } } -} \ No newline at end of file +} diff --git a/cws-service/pom.xml b/cws-service/pom.xml index 49d4311b..e2310289 100644 --- a/cws-service/pom.xml +++ b/cws-service/pom.xml @@ -4,7 +4,7 @@ gov.nasa.jpl.ammos.ids.cws common-workflow-service - 2.5.0 + 2.6.0-pre.1 cws-service diff --git a/cws-service/src/main/java/jpl/cws/controller/MvcCore.java b/cws-service/src/main/java/jpl/cws/controller/MvcCore.java index 0c246098..fa2bd808 100755 --- a/cws-service/src/main/java/jpl/cws/controller/MvcCore.java +++ b/cws-service/src/main/java/jpl/cws/controller/MvcCore.java @@ -40,11 +40,6 @@ public class MvcCore { @Value("${cws.history.days.to.live}") private String historyDaysToLive; @Value("${cws.history.level}") private String historyLevel; - @Value("${cws.camunda.version}") private String camundaVersion; - - @Value("${cws.java.home}") private String javaHome; - @Value("${cws.java.version}") private String javaVersion; - public MvcCore() {} protected ModelAndView buildModel(String page, String message) { @@ -188,11 +183,9 @@ protected ModelAndView buildConfigurationModel(String message) { model.addObject("tomcatWebapps", tomcatWebapps); model.addObject("historyDaysToLive", historyDaysToLive); model.addObject("historyLevel", historyLevel); - - model.addObject("camundaVersion", camundaVersion); - - model.addObject("javaHome", javaHome); - model.addObject("javaVersion", javaVersion); + model.addObject("javaHome", System.getenv("JAVA_HOME")); + model.addObject("javaVersion", Runtime.version().toString()); + model.addObject("camundaVersion", System.getenv("CAMUNDA_VER")); DiskUsage diskUsage = cwsConsoleService.getDiskUsage(); diff --git a/cws-service/src/main/java/jpl/cws/scheduler/Scheduler.java b/cws-service/src/main/java/jpl/cws/scheduler/Scheduler.java index 83bd9e15..f43e8745 100644 --- a/cws-service/src/main/java/jpl/cws/scheduler/Scheduler.java +++ b/cws-service/src/main/java/jpl/cws/scheduler/Scheduler.java @@ -3,9 +3,7 @@ import static jpl.cws.core.db.SchedulerDbService.FAILED_TO_SCHEDULE; import static jpl.cws.core.db.SchedulerDbService.PENDING; -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.io.UnsupportedEncodingException; +import java.io.*; import java.net.URLDecoder; import java.sql.Timestamp; import java.util.HashMap; @@ -129,8 +127,8 @@ public SchedulerJob scheduleProcess(String procDefKey, String procBusinessKey, String initiationKey, int priority) throws Exception { - log.trace("Scheduling process definition '" + procDefKey + "' ..."); - log.trace(" with variables=" + processVariables); + log.info("Scheduling process definition '" + procDefKey + "' ..."); + log.info(" with variables=" + processVariables); String schedulerJobUuid = null; boolean rowCreated = false; diff --git a/cws-tasks/pom.xml b/cws-tasks/pom.xml index 5a575d95..af11cd5a 100644 --- a/cws-tasks/pom.xml +++ b/cws-tasks/pom.xml @@ -4,7 +4,7 @@ gov.nasa.jpl.ammos.ids.cws common-workflow-service - 2.5.0 + 2.6.0-pre.1 cws-tasks diff --git a/cws-tasks/src/main/java/jpl/cws/task/CwsTask.java b/cws-tasks/src/main/java/jpl/cws/task/CwsTask.java index f76473d6..a1f343b5 100644 --- a/cws-tasks/src/main/java/jpl/cws/task/CwsTask.java +++ b/cws-tasks/src/main/java/jpl/cws/task/CwsTask.java @@ -15,7 +15,7 @@ /** * Abstract base class for all CWS built-in (and custom user-added) task * implementations. - * + * */ public abstract class CwsTask implements JavaDelegate { @@ -55,32 +55,32 @@ public CwsTask() { * 1) initializes parameters * 2) runs the task implementation * 3) throws any qualified exceptions - * + * */ public void execute(final DelegateExecution execution) { this.execution = execution; - + // setup tags on logging log.setProcTags(getProcDefKey(execution), - execution.getProcessInstanceId(), + execution.getProcessInstanceId(), execution.getActivityInstanceId()); - + try { // setup base params throwOnTruncatedVariableBoolean = getBooleanParam( throwOnTruncatedVariable, "throwOnTruncatedVariable", DEFAULT_THROW_ON_TRUNCATED_VARIABLE); - + // Evaluate preCondition. // If preCondition passes, then execute task, // otherwise skip task execution. if (evaluateTaskPreCondition()) { setOutputVariable("preConditionPassed", true); - + // get params log.trace("INITIALIZING PARAMETERS FOR TASK: " + this); initParams(); - + // execute the task log.trace("EXECUTING TASK: " + this); executeTask(); @@ -91,17 +91,17 @@ public void execute(final DelegateExecution execution) { } catch (BpmnError e) { log.warn("Propagating BpmnError(" + e.getErrorCode() + ")..."); setOutputVariable("bpmnErrorMessage", e.getErrorCode()); - + // We saw an error, but we want to check with Camunda because this is by-passing our end-event listener notifyWorkerOfFailedProcess(); - + throw e; // propagate so engine can handle (if boundary catch defined) } catch (Throwable t) { log.error("Unexpected Throwable while executing " + this, t); setOutputVariable("unexpectedErrorMessage", t.getMessage()); - + notifyWorkerOfFailedProcess(); - + // wrap and propagate so engine can (if boundary catch defined) handle throw new BpmnError(UNEXPECTED_ERROR); } finally { @@ -109,7 +109,7 @@ public void execute(final DelegateExecution execution) { this.execution = null; } } - + private void notifyWorkerOfFailedProcess() { log.debug("notifying workers of failed process..."); @@ -128,8 +128,8 @@ public void run() { } }).start(); } - - + + private String getProcDefKey(final DelegateExecution execution) { String procDefKey = "UNKNOWN"; @@ -159,34 +159,34 @@ private String getProcDefKey(final DelegateExecution execution) { /** * Implementation must be filled out by subclasses. - * + * */ protected abstract void initParams() throws Exception; /** * Implementation must be filled out by subclasses. - * + * */ protected abstract void executeTask() throws Exception; /** * Evaluates the task preCondition. - * + * * @return true if preCondition passes false if preCondition fails - * + * * @throws Exception if unexpected exception occurs * @throws BpmnError if process is to be determined. */ private boolean evaluateTaskPreCondition() throws Exception { - + if (!getBooleanParam(preCondition, "preCondition", DEFAULT_PRE_CONDITION)) { - + // Check special case for preCondition is "none" and pass as true if (preCondition != null && preCondition.getValue(execution).equals("none")) { return true; } - + log.warn("preCondition was not satisfied"); PreConditionFailBehavior failBehavior = PreConditionFailBehavior .valueOf(getStringParam(onPreConditionFail, @@ -269,7 +269,7 @@ protected String getStringParam(Expression expression, String paramName) } protected String getStringParam(Expression expression, String paramName, - String defaultValue) throws Exception { + String defaultValue) throws Exception { if (expression == null) { // return default return defaultValue; @@ -292,7 +292,7 @@ protected Boolean getBooleanParam(Expression expression, String paramName) } protected Boolean getBooleanParam(Expression expression, String paramName, - Boolean defaultValue) throws Exception { + Boolean defaultValue) throws Exception { if (expression == null) { // return default return defaultValue; @@ -322,7 +322,7 @@ protected Integer getIntegerParam(Expression expression, String paramName) } protected Integer getIntegerParam(Expression expression, String paramName, - Integer defaultValue) throws Exception { + Integer defaultValue) throws Exception { if (expression == null) { // return default return defaultValue; @@ -352,7 +352,7 @@ protected Long getLongParam(Expression expression, String paramName) } protected Long getLongParam(Expression expression, String paramName, - Long defaultValue) throws Exception { + Long defaultValue) throws Exception { if (expression == null) { // return default return defaultValue; @@ -384,7 +384,7 @@ protected Float getFloatParam(Expression expression, String paramName) } protected Float getFloatParam(Expression expression, String paramName, - Float defaultValue) throws Exception { + Float defaultValue) throws Exception { if (expression == null) { // return default return defaultValue; @@ -414,7 +414,7 @@ protected Double getDoubleParam(Expression expression, String paramName) } protected Double getDoubleParam(Expression expression, String paramName, - Double defaultValue) throws Exception { + Double defaultValue) throws Exception { if (expression == null) { // return default return defaultValue; @@ -437,10 +437,10 @@ private Double getDoubleValue(Object value, String paramName) /** * For now only supports Map but may want to support * generics/others in future... - * + * */ protected Map getMapParam(Expression expression, - String paramName) throws Exception { + String paramName) throws Exception { if (expression == null) { // no default, so throw exception throw new Exception("Mandatory parameter '" + paramName + "' not specified"); @@ -449,7 +449,7 @@ protected Map getMapParam(Expression expression, } protected Map getMapParam(Expression expression, - String paramName, Map defaultValue) + String paramName, Map defaultValue) throws Exception { if (expression == null) { // return default @@ -482,4 +482,4 @@ private Map getMapValue(Object value, String paramName) } } -} +} \ No newline at end of file diff --git a/cws-test/pom.xml b/cws-test/pom.xml index 4c388439..6f189183 100644 --- a/cws-test/pom.xml +++ b/cws-test/pom.xml @@ -3,7 +3,7 @@ gov.nasa.jpl.ammos.ids.cws common-workflow-service - 2.5.0 + 2.6.0-pre.1 cws-test diff --git a/cws-test/src/test/java/jpl/cws/test/WebTestUtil.java b/cws-test/src/test/java/jpl/cws/test/WebTestUtil.java index f0b2330b..fa227def 100644 --- a/cws-test/src/test/java/jpl/cws/test/WebTestUtil.java +++ b/cws-test/src/test/java/jpl/cws/test/WebTestUtil.java @@ -28,6 +28,10 @@ import org.apache.commons.io.FileUtils; +import org.openqa.selenium.JavascriptExecutor; +import org.openqa.selenium.Point; + + /** * @@ -289,20 +293,46 @@ public void startProcDef(String procDef, String procName, long procTime) { public void enableWorkers(String procDef) { WebDriverWait wait = new WebDriverWait(driver, Duration.ofSeconds(30)); - TakesScreenshot screenshot = (TakesScreenshot)driver; + // wait.until(ExpectedConditions.elementToBeClickable(By.id("pv-"+procDef))); + sleep(5000); + WebElement enable = findElById("pv-"+procDef); + String elementHTML = enable.getAttribute("outerHTML"); + + JavascriptExecutor js = (JavascriptExecutor) driver; + js.executeScript("arguments[0].scrollIntoViewIfNeeded();", enable); + + TakesScreenshot screenshot = (TakesScreenshot)driver; //Saving the screenshot in desired location File source = screenshot.getScreenshotAs(OutputType.FILE); //Path to the location to save screenshot - try{FileUtils.copyFile(source, new File("/tmp/Screen.png"));} + try{FileUtils.copyFile(source, new File("/tmp/Before-"+procDef+".png"));} + +catch(IOException e) { + e.printStackTrace(); +} + System.out.println("Src attribute is: "+ elementHTML); + sleep(5000); + + // Point point = enable.getLocation(); + // int xCoord = point.getX(); + // int yCoord = point.getY(); + // js.executeScript("arguments[0].scroll(arguments[1], arguments[2]);", enable, xCoord, yCoord - 50); + // sleep(5000); + + +File source2 = screenshot.getScreenshotAs(OutputType.FILE); + try{FileUtils.copyFile(source2, new File("/tmp/After-"+procDef+".png"));} catch(IOException e) { e.printStackTrace(); } - wait.until(ExpectedConditions.elementToBeClickable(By.id("pv-"+procDef))); - WebElement enable = findElById("pv-"+procDef); enable.click(); sleep(1000); + + + + WebElement allWorkers = findElById("all-workers"); WebElement allWorkersDone = findElById("done-workers-btn"); log.info("Enabling workers."); @@ -325,6 +355,11 @@ public void disableWorkers(String procDef) { wait.until(ExpectedConditions.elementToBeClickable(By.id("pv-"+procDef))); WebElement enable = findElById("pv-"+procDef); + + JavascriptExecutor js = (JavascriptExecutor) driver; + js.executeScript("arguments[0].scrollIntoViewIfNeeded();", enable); + sleep(1000); + enable.click(); sleep(1000); @@ -460,8 +495,25 @@ public void deleteProc(String procName) { if(driver.getPageSource().contains(procName)) { disableWorkers(procName); - wait.until(ExpectedConditions.elementToBeClickable(By.id("delete-"+procName))); WebElement delButton = driver.findElement(By.id("delete-"+procName)); + JavascriptExecutor js = (JavascriptExecutor) driver; + js.executeScript("arguments[0].scrollIntoViewIfNeeded();", delButton); + + + TakesScreenshot screenshot = (TakesScreenshot)driver; + //Saving the screenshot in desired location + File source = screenshot.getScreenshotAs(OutputType.FILE); + //Path to the location to save screenshot + try{FileUtils.copyFile(source, new File("/tmp/Before-"+procName+".png"));} + +catch(IOException e) { + e.printStackTrace(); +} + + String elementHTML = delButton.getAttribute("outerHTML"); + System.out.println("Src attribute is: "+ elementHTML); + + delButton.click(); waitForElementID("delete-proc-def"); diff --git a/cws-test/src/test/resources/configure_with_jacoco.sh b/cws-test/src/test/resources/configure_with_jacoco.sh index 1f6c8156..e62af2a5 100755 --- a/cws-test/src/test/resources/configure_with_jacoco.sh +++ b/cws-test/src/test/resources/configure_with_jacoco.sh @@ -48,13 +48,13 @@ else exit 1 fi -if [[ "$java_version" > "11" && "$java_version" < "12" ]]; then - echo " Java version == 11x [OK]" +if [[ "$java_version" > "17" && "$java_version" < "18" ]]; then + echo " Java version == 17x [OK]" else echo " +-------+----------------------------------------------------" echo " | ERROR | " echo " +-------+ " - echo " | Java version is less than 11. Must run with Java 11x " + echo " | Java version is not 17. Must run with Java 17x " echo " | Aborting program... " echo "--------------------------------------------------------------" exit 1 @@ -264,7 +264,7 @@ rm -f ${ROOT}/config/my.cnf sleep 1 if [ "$RECONFIGURE" = true ]; then - ${JAVA_HOME}/bin/java -classpath "./installer/*" -javaagent:./server/apache-tomcat-${TOMCAT_VER}/lib/org.jacoco.agent-0.8.2-runtime.jar=destfile=./installer-jacoco.exec,append=false jpl.cws.task.CwsInstaller --reconfigure + ${JAVA_HOME}/bin/java -classpath "./installer/*" -javaagent:./server/apache-tomcat-${TOMCAT_VER}/lib/org.jacoco.agent-0.8.7-runtime.jar=destfile=./installer-jacoco.exec,append=false jpl.cws.task.CwsInstaller --reconfigure else - ${JAVA_HOME}/bin/java -classpath "./installer/*" -javaagent:./server/apache-tomcat-${TOMCAT_VER}/lib/org.jacoco.agent-0.8.2-runtime.jar=destfile=./installer-jacoco.exec,append=false jpl.cws.task.CwsInstaller + ${JAVA_HOME}/bin/java -classpath "./installer/*" -javaagent:./server/apache-tomcat-${TOMCAT_VER}/lib/org.jacoco.agent-0.8.7-runtime.jar=destfile=./installer-jacoco.exec,append=false jpl.cws.task.CwsInstaller fi diff --git a/cws-ui/pom.xml b/cws-ui/pom.xml index 18693985..b986c342 100644 --- a/cws-ui/pom.xml +++ b/cws-ui/pom.xml @@ -5,7 +5,7 @@ gov.nasa.jpl.ammos.ids.cws common-workflow-service - 2.5.0 + 2.6.0-pre.1 cws-ui diff --git a/cws-ui/src/main/webapp/WEB-INF/springmvc-servlet.xml b/cws-ui/src/main/webapp/WEB-INF/springmvc-servlet.xml index 2cac8eba..c63e7d1e 100644 --- a/cws-ui/src/main/webapp/WEB-INF/springmvc-servlet.xml +++ b/cws-ui/src/main/webapp/WEB-INF/springmvc-servlet.xml @@ -15,7 +15,9 @@ - + + + ', i); + if (j === -1) { + return handleError('unclosed comment'); + } + if (onComment) { + onComment(xml.substring(i + 4, j), decodeEntities, getContext); + if (parseStop) { + return; + } + } + j += 3; + continue; + } + } + + // parse question + if (w === 63) { + // "?" + j = xml.indexOf('?>', i); + if (j === -1) { + return handleError('unclosed question'); + } + if (onQuestion) { + onQuestion(xml.substring(i, j + 2), getContext); + if (parseStop) { + return; + } + } + j += 2; + continue; + } + + // find matching closing tag for attention or standard tags + // for that we must skip through attribute values + // (enclosed in single or double quotes) + for (x = i + 1;; x++) { + v = xml.charCodeAt(x); + if (isNaN(v)) { + j = -1; + return handleError('unclosed tag'); + } + + // [10] AttValue ::= '"' ([^<&"] | Reference)* '"' | "'" ([^<&'] | Reference)* "'" + // skips the quoted string + // (double quotes) does not appear in a literal enclosed by (double quotes) + // (single quote) does not appear in a literal enclosed by (single quote) + if (v === 34) { + // '"' + q = xml.indexOf('"', x + 1); + x = q !== -1 ? q : x; + } else if (v === 39) { + // "'" + q = xml.indexOf("'", x + 1); + x = q !== -1 ? q : x; + } else if (v === 62) { + // '>' + j = x; + break; + } + } + + // parse attention + // previously comment and CDATA have already been parsed + if (w === 33) { + // "!" + + if (onAttention) { + onAttention(xml.substring(i, j + 1), decodeEntities, getContext); + if (parseStop) { + return; + } + } + j += 1; + continue; + } + + // don't process attributes; + // there are none + cachedAttrs = {}; + + // if (xml.charCodeAt(i+1) === 47) { // close tag match + x = elementName = nodeStack.pop(); + q = i + 2 + x.length; + if (xml.substring(i + 2, q) !== x) { + return handleError('closing tag mismatch'); + } + + // verify chars in close tag + for (; q < j; q++) { + w = xml.charCodeAt(q); + if (w === 32 || w > 8 && w < 14) { + // \f\n\r\t\v space + continue; + } + return handleError('close tag'); + } + } else { + if (xml.charCodeAt(j - 1) === 47) { + // .../> + x = elementName = xml.substring(i + 1, j - 1); + tagStart = true; + tagEnd = true; + } else { + x = elementName = xml.substring(i + 1, j); + tagStart = true; + tagEnd = false; + } + if (!(w > 96 && w < 123 || w > 64 && w < 91 || w === 95 || w === 58)) { + // char 95"_" 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) { + // \f\n\r\t\v space + elementName = x.substring(0, q); + + // maybe there are attributes + cachedAttrs = null; + break; + } + return handleError('invalid nodeName'); + } + if (!tagEnd) { + nodeStack.push(elementName); + } + } + if (isNamespace) { + _nsMatrix = nsMatrix; + if (tagStart) { + // remember old namespace + // unless we're self-closing + if (!tagEnd) { + nsMatrixStack.push(_nsMatrix); + } + if (cachedAttrs === null) { + // quick check, whether there may be namespace + // declarations on the node; if that is the case + // we need to eagerly parse the node attributes + 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)]; + + // prefix given; namespace must exist + if (!xmlns) { + return handleError('missing namespace on <' + _elementName + '>'); + } + elementName = elementName.substr(w + 1); + } else { + xmlns = nsMatrix['xmlns']; + + // if no default namespace is defined, + // we'll import the element as anonymous. + // + // it is up to users to correct that to the document defined + // targetNamespace, or whatever their undersanding of the + // XML spec mandates. + } + + // adjust namespace prefixs as configured + 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; + } + } + + // restore old namespace + if (isNamespace) { + if (!tagStart) { + nsMatrix = nsMatrixStack.pop(); + } else { + nsMatrix = _nsMatrix; + } + } + } + j += 1; + } + } /** end parse */ +} + +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_TYPE = 'xsi:type'; +function serializeFormat(element) { + return element.xml && element.xml.serialize; +} +function serializeAsType(element) { + return serializeFormat(element) === XSI_TYPE; +} +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 name = 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 name; + } +} +function normalizeXsiTypeName(name, model) { + var nameNs = parseName(name); + var pkg = model.getPackage(nameNs.prefix); + return prefixedToName(nameNs, pkg); +} +function error(message) { + return new Error(message); +} + +/** + * Get the moddle descriptor for a given instance or type. + * + * @param {ModdleElement|Function} element + * + * @return {Object} the moddle descriptor + */ +function getModdleDescriptor(element) { + return element.$descriptor; +} - module.exports.getRoot = getRoot; +/** + * A parse context. + * + * @class + * + * @param {Object} options + * @param {ElementHandler} options.rootHandler the root handler for parsing a document + * @param {boolean} [options.lax=false] whether or not to ignore invalid elements + */ +function Context(options) { + /** + * @property {ElementHandler} rootHandler + */ + /** + * @property {Boolean} lax + */ - /** - * filters all elements in the list which have a given type. - * removes a new list - */ - function filterElementsByType(objectList, type) { - var list = objectList || []; - var result = []; - forEach(list, function(obj) { - if (is(obj, type)) { - result.push(obj); - } - }); - return result; - } + (0,min_dash__WEBPACK_IMPORTED_MODULE_13__.assign)(this, options); + this.elementsById = {}; + this.references = []; + this.warnings = []; - module.exports.filterElementsByType = filterElementsByType; + /** + * Add an unresolved reference. + * + * @param {Object} reference + */ + this.addReference = function (reference) { + this.references.push(reference); + }; + /** + * Add a processed element. + * + * @param {ModdleElement} element + */ + this.addElement = function (element) { + if (!element) { + throw error('expected element'); + } + var elementsById = this.elementsById; + var descriptor = getModdleDescriptor(element); + var idProperty = descriptor.idProperty, + id; + if (idProperty) { + id = element.get(idProperty.name); + if (id) { + // for QName validation as per http://www.w3.org/TR/REC-xml/#NT-NameChar + if (!/^([a-z][\w-.]*:)?[a-z_][\w-.]*$/i.test(id)) { + throw new Error('illegal ID <' + id + '>'); + } + if (elementsById[id]) { + throw error('duplicate ID <' + id + '>'); + } + elementsById[id] = element; + } + } + }; + + /** + * Add an import warning. + * + * @param {Object} warning + * @param {String} warning.message + * @param {Error} [warning.error] + */ + this.addWarning = function (warning) { + this.warnings.push(warning); + }; +} +function BaseHandler() {} +BaseHandler.prototype.handleEnd = function () {}; +BaseHandler.prototype.handleText = function () {}; +BaseHandler.prototype.handleNode = function () {}; + +/** + * A simple pass through handler that does nothing except for + * ignoring all input it receives. + * + * This is used to ignore unknown elements and + * attributes. + */ +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 error('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; +}; + +/** + * @class Reader.ElementHandler + * + */ +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 error('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 !== undefined) { + value = coerceType(bodyProperty.type, value); + element.set(bodyProperty.name, value); + } +}; + +/** + * Create an instance of the model from the given node. + * + * @param {Element} node the xml node + */ +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; + (0,min_dash__WEBPACK_IMPORTED_MODULE_13__.forEach)(attributes, function (value, name) { + var prop = descriptor.propertiesByName[name], + values; + if (prop && prop.isReference) { + if (!prop.isMany) { + context.addReference({ + element: instance, + property: prop.ns.name, + id: value + }); + } else { + // IDREFS: parse references as whitespace-separated list + values = value.split(' '); + (0,min_dash__WEBPACK_IMPORTED_MODULE_13__.forEach)(values, function (v) { + context.addReference({ + element: instance, + property: prop.ns.name, + id: v + }); + }); + } + } else { + if (prop) { + value = coerceType(prop.type, value); + } else if (name !== 'xmlns') { + propNameNs = parseName(name, descriptor.ns.prefix); + + // check whether attribute is defined in a well-known namespace + // if that is the case we emit a warning to indicate potential misuse + if (model.getPackage(propNameNs.prefix)) { + context.addWarning({ + message: 'unknown attribute <' + name + '>', + element: instance, + property: name, + value: value + }); + } + } + instance.set(name, value); + } + }); + return instance; +}; +ElementHandler.prototype.getPropertyForNode = function (node) { + var name = node.name; + var nameNs = parseName(name); + var type = this.type, + model = this.model, + descriptor = getModdleDescriptor(type); + var propertyName = nameNs.name, + property = descriptor.propertiesByName[propertyName], + elementTypeName, + elementType; + + // search for properties by name first + + if (property && !property.isAttr) { + if (serializeAsType(property)) { + elementTypeName = node.attributes[XSI_TYPE]; + + // xsi type is optional, if it does not exists the + // default type is assumed + if (elementTypeName) { + // take possible type prefixes from XML + // into account, i.e.: xsi:type="t{ActualType}" + elementTypeName = normalizeXsiTypeName(elementTypeName, model); + elementType = model.getType(elementTypeName); + return (0,min_dash__WEBPACK_IMPORTED_MODULE_13__.assign)({}, property, { + effectiveType: getModdleDescriptor(elementType).name + }); + } + } + + // search for properties by name first + return property; + } + var pkg = model.getPackage(nameNs.prefix); + if (pkg) { + elementTypeName = aliasToName(nameNs, pkg); + elementType = model.getType(elementTypeName); + + // search for collection members later + property = (0,min_dash__WEBPACK_IMPORTED_MODULE_13__.find)(descriptor.properties, function (p) { + return !p.isVirtual && !p.isReference && !p.isAttribute && elementType.hasType(p.type); + }); + if (property) { + return (0,min_dash__WEBPACK_IMPORTED_MODULE_13__.assign)({}, property, { + effectiveType: getModdleDescriptor(elementType).name + }); + } + } else { + // parse unknown element (maybe extension) + property = (0,min_dash__WEBPACK_IMPORTED_MODULE_13__.find)(descriptor.properties, function (p) { + return !p.isReference && !p.isAttribute && p.type === 'Element'; + }); + if (property) { + return property; + } + } + throw error('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); + } +}; + +/** + * Handle the child element parsing + * + * @param {Element} node the xml node + */ +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; + + // child handles may decide to skip elements + // by not returning anything + if (newElement !== undefined) { + if (propertyDesc.isMany) { + element.get(propertyDesc.name).push(newElement); + } else { + element.set(propertyDesc.name, newElement); + } + if (propertyDesc.isReference) { + (0,min_dash__WEBPACK_IMPORTED_MODULE_13__.assign)(newElement, { + element: element + }); + this.context.addReference(newElement); + } else { + // establish child -> parent relationship + newElement.$parent = element; + } + } + return childHandler; +}; + +/** + * An element handler that performs special validation + * to ensure the node it gets initialized with matches + * the handlers type (namespace wise). + * + * @param {Moddle} model + * @param {String} typeName + * @param {Context} context + */ +function RootElementHandler(model, typeName, context) { + ElementHandler.call(this, model, typeName, context); +} +RootElementHandler.prototype = Object.create(ElementHandler.prototype); +RootElementHandler.prototype.createElement = function (node) { + var name = node.name, + nameNs = parseName(name), + model = this.model, + type = this.type, + pkg = model.getPackage(nameNs.prefix), + typeName = pkg && aliasToName(nameNs, pkg) || name; + + // verify the correct namespace if we parse + // the first element in the handler tree + // + // this ensures we don't mistakenly import wrong namespace elements + if (!type.hasType(typeName)) { + throw error('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 name = node.name, + ns = parseName(name), + prefix = ns.prefix, + uri = node.ns[prefix + '$uri'], + attributes = node.attributes; + return this.model.createAny(name, uri, 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 !== undefined) { + children = element.$children = element.$children || []; + children.push(newElement); + + // establish child -> parent relationship + newElement.$parent = element; + } + return handler; +}; +GenericElementHandler.prototype.handleEnd = function () { + if (this.body) { + this.element.$body = this.body; + } +}; + +/** + * A reader for a meta-model + * + * @param {Object} options + * @param {Model} options.model used to read xml files + * @param {Boolean} options.lax whether to make parse errors warnings + */ +function Reader(options) { + if (options instanceof Moddle) { + options = { + model: options + }; + } + (0,min_dash__WEBPACK_IMPORTED_MODULE_13__.assign)(this, { + lax: false + }, options); +} + +/** + * The fromXML result. + * + * @typedef {Object} ParseResult + * + * @property {ModdleElement} rootElement + * @property {Array} references + * @property {Array} warnings + * @property {Object} elementsById - a mapping containing each ID -> ModdleElement + */ - function findRootElementsByType(businessObject, referencedType) { - var root = getRoot(businessObject); +/** + * The fromXML result. + * + * @typedef {Error} ParseError + * + * @property {Array} warnings + */ - return filterElementsByType(root.rootElements, referencedType); - } +/** + * Parse the given XML into a moddle document tree. + * + * @param {String} xml + * @param {ElementHandler|Object} options or rootHandler + * + * @returns {Promise} + */ +Reader.prototype.fromXML = function (xml, options, done) { + var rootHandler = options.rootHandler; + if (options instanceof ElementHandler) { + // root handler passed via (xml, { rootHandler: ElementHandler }, ...) + rootHandler = options; + options = {}; + } else { + if (typeof options === 'string') { + // rootHandler passed via (xml, 'someString', ...) + rootHandler = this.handler(options); + options = {}; + } else if (typeof rootHandler === 'string') { + // rootHandler passed via (xml, { rootHandler: 'someString' }, ...) + rootHandler = this.handler(rootHandler); + } + } + var model = this.model, + lax = this.lax; + var context = new Context((0,min_dash__WEBPACK_IMPORTED_MODULE_13__.assign)({}, options, { + rootHandler: rootHandler + })), + parser = new Parser({ + proxy: true + }), + stack = createStack(); + rootHandler.context = context; + + // push root handler + stack.push(rootHandler); + + /** + * Handle error. + * + * @param {Error} err + * @param {Function} getContext + * @param {boolean} lax + * + * @return {boolean} true if handled + */ + function handleError(err, getContext, lax) { + var ctx = getContext(); + var line = ctx.line, + column = ctx.column, + data = ctx.data; + + // we receive the full context data here, + // for elements trim down the information + // to the tag name, only + if (data.charAt(0) === '<' && data.indexOf(' ') !== -1) { + data = data.slice(0, data.indexOf(' ')) + '>'; + } + var message = 'unparsable content ' + (data ? data + ' ' : '') + 'detected\n\t' + 'line: ' + line + '\n\t' + 'column: ' + column + '\n\t' + 'nested error: ' + err.message; + if (lax) { + context.addWarning({ + message: message, + error: err + }); + return true; + } else { + throw error(message); + } + } + function handleWarning(err, getContext) { + // just like handling errors in mode + return handleError(err, getContext, true); + } + + /** + * Resolve collected references on parse end. + */ + 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); + + // we replace an existing place holder (idx != -1) or + // append to the collection instead + if (idx === -1) { + idx = collection.length; + } + if (!reference) { + // remove unresolvable reference + collection.splice(idx, 1); + } else { + // add or update reference in collection + 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) { + // strip whitespace only nodes, i.e. before + // sections and in between tags + + if (!text.trim()) { + return; + } + handleCData(text, getContext); + } + var uriMap = model.getPackages().reduce(function (uriMap, p) { + uriMap[p.uri] = p.prefix; + return uriMap; + }, { + 'http://www.w3.org/XML/1998/namespace': 'xml' // add default xml ns + }); + parser.ns(uriMap).on('openTag', function (obj, decodeStr, selfClosing, getContext) { + // gracefully handle unparsable attributes (attrs=false) + 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, decodeEntities, getContext) { + handleText(decodeEntities(text), getContext); + }).on('error', handleError).on('warn', handleWarning); + + // async XML parsing to make sure the execution environment + // (node or brower) is kept responsive and that certain optimization + // strategies can kick in. + return new Promise(function (resolve, reject) { + var err; + try { + parser.parse(xml); + resolveReferences(); + } catch (e) { + err = e; + } + var rootElement = rootHandler.element; + if (!err && !rootElement) { + err = error('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: rootElement, + elementsById: elementsById, + references: references, + warnings: warnings + }); + } + }); +}; +Reader.prototype.handler = function (name) { + return new RootElementHandler(this.model, name); +}; + +// helpers ////////////////////////// + +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 = []; + + // API + + this.byUri = function (uri) { + return uriMap[uri] || parent && parent.byUri(uri); + }; + 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 (prefix) { + return prefixMap[prefix || 'xmlns']; + }; + this.mapPrefix = function (prefix, uri) { + prefixMap[prefix || 'xmlns'] = uri; + }; + this.getNSKey = function (ns) { + return ns.prefix !== undefined ? ns.uri + '|' + ns.prefix : ns.uri; + }; + this.logUsed = function (ns) { + var uri = ns.uri; + var nsKey = this.getNSKey(ns); + used[nsKey] = this.byUri(uri); + + // Inform parent recursively about the usage of this NS + if (parent) { + parent.logUsed(ns); + } + }; + this.getUsed = function (ns) { + function isUsed(ns) { + var nsKey = self.getNSKey(ns); + 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(name, pkg) { + if (hasLowerCaseAlias(pkg)) { + return lower(name); + } else { + return name; + } +} +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 ((0,min_dash__WEBPACK_IMPORTED_MODULE_13__.isString)(ns)) { + return ns; + } else { + return (ns.prefix ? ns.prefix + ':' : '') + ns.localName; + } +} +function getNsAttrs(namespaces) { + return namespaces.getUsed().filter(function (ns) { + // do not serialize built in namespace + return ns.prefix !== 'xml'; + }).map(function (ns) { + var name = 'xmlns' + (ns.prefix ? ':' + ns.prefix : ''); + return { + name: name, + value: ns.uri + }; + }); +} +function getElementNs(ns, descriptor) { + if (descriptor.isGeneric) { + return (0,min_dash__WEBPACK_IMPORTED_MODULE_13__.assign)({ + localName: descriptor.ns.localName + }, ns); + } else { + return (0,min_dash__WEBPACK_IMPORTED_MODULE_13__.assign)({ + localName: nameToAlias(descriptor.ns.localName, descriptor.$pkg) + }, ns); + } +} +function getPropertyNs(ns, descriptor) { + return (0,min_dash__WEBPACK_IMPORTED_MODULE_13__.assign)({ + localName: descriptor.ns.localName + }, ns); +} +function getSerializableProperties(element) { + var descriptor = element.$descriptor; + return (0,min_dash__WEBPACK_IMPORTED_MODULE_13__.filter)(descriptor.properties, function (p) { + var name = p.name; + if (p.isVirtual) { + return false; + } + + // do not serialize defaults + if (!(0,min_dash__WEBPACK_IMPORTED_MODULE_13__.has)(element, name)) { + return false; + } + var value = element[name]; + + // do not serialize default equals + if (value === p.default) { + return false; + } + + // do not serialize null properties + 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) { + // ensure we are handling strings here + str = (0,min_dash__WEBPACK_IMPORTED_MODULE_13__.isString)(str) ? str : '' + str; + return str.replace(charPattern, function (s) { + return '&' + replaceMap[s] + ';'; + }); +} + +/** + * Escape a string attribute to not contain any bad values (line breaks, '"', ...) + * + * @param {String} str the string to escape + * @return {String} the escaped string + */ +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 (0,min_dash__WEBPACK_IMPORTED_MODULE_13__.filter)(props, function (p) { + return p.isAttr; + }); +} +function filterContained(props) { + return (0,min_dash__WEBPACK_IMPORTED_MODULE_13__.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); + } + + // compute tag name + 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; +}; + +/** + * Get the actual ns attribute name for the given element. + * + * @param {Object} element + * @param {Boolean} [element.inherited=false] + * + * @return {Object} nsName + */ +ElementSerializer.prototype.nsAttributeName = function (element) { + var ns; + if ((0,min_dash__WEBPACK_IMPORTED_MODULE_13__.isString)(element)) { + ns = parseName(element); + } else { + ns = element.ns; + } + + // return just local name for inherited attributes + if (element.inherited) { + return { + localName: ns.localName + }; + } + + // parse + log effective ns + var effectiveNs = this.logNamespaceUsed(ns); + + // LOG ACTUAL namespace use + this.getNamespaces().logUsed(effectiveNs); + + // strip prefix if same namespace like parent + if (this.isLocalNs(effectiveNs)) { + return { + localName: ns.localName + }; + } else { + return (0,min_dash__WEBPACK_IMPORTED_MODULE_13__.assign)({ + localName: ns.localName + }, effectiveNs); + } +}; +ElementSerializer.prototype.parseGeneric = function (element) { + var self = this, + body = this.body; + var attributes = []; + (0,min_dash__WEBPACK_IMPORTED_MODULE_13__.forEach)(element, function (val, key) { + var nonNsAttr; + if (key === '$body') { + body.push(new BodySerializer().build({ + type: 'String' + }, val)); + } else if (key === '$children') { + (0,min_dash__WEBPACK_IMPORTED_MODULE_13__.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, name, value) { + var model = element.$model; + var nameNs = parseName(name); + var ns; + + // parse xmlns:foo="http://foo.bar" + if (nameNs.prefix === 'xmlns') { + ns = { + prefix: nameNs.localName, + uri: value + }; + } + + // parse xmlns="http://foo.bar" + if (!nameNs.prefix && nameNs.localName === 'xmlns') { + ns = { + uri: value + }; + } + if (!ns) { + return { + name: name, + value: value + }; + } + if (model && model.getPackage(value)) { + // register well known namespace + this.logNamespace(ns, true, true); + } else { + // log custom namespace directly as used + var actualNs = this.logNamespaceUsed(ns, true); + this.getNamespaces().logUsed(actualNs); + } +}; + +/** + * Parse namespaces and return a list of left over generic attributes + * + * @param {Object} element + * @return {Array} + */ +ElementSerializer.prototype.parseNsAttributes = function (element, attrs) { + var self = this; + var genericAttrs = element.$attrs; + var attributes = []; + + // parse namespace attributes first + // and log them. push non namespace attributes to a list + // and process them later + (0,min_dash__WEBPACK_IMPORTED_MODULE_13__.forEach)(genericAttrs, function (value, name) { + var nonNsAttr = self.parseNsAttribute(element, name, value); + if (nonNsAttr) { + attributes.push(nonNsAttr); + } + }); + return attributes; +}; +ElementSerializer.prototype.parseGenericAttributes = function (element, attributes) { + var self = this; + (0,min_dash__WEBPACK_IMPORTED_MODULE_13__.forEach)(attributes, function (attr) { + // do not serialize xsi:type attribute + // it is set manually based on the actual implementation type + if (attr.name === XSI_TYPE) { + return; + } + try { + self.addAttribute(self.nsAttributeName(attr.name), attr.value); + } catch (e) { + /* global console */ + + console.warn('missing namespace information for ', attr.name, '=', attr.value, 'on', element, e); + } + }); +}; +ElementSerializer.prototype.parseContainments = function (properties) { + var self = this, + body = this.body, + element = this.element; + (0,min_dash__WEBPACK_IMPORTED_MODULE_13__.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)) { + (0,min_dash__WEBPACK_IMPORTED_MODULE_13__.forEach)(value, function (v) { + body.push(new ValueSerializer(self.addTagName(self.nsPropertyTagName(p))).build(p, v)); + }); + } else if (isReference) { + (0,min_dash__WEBPACK_IMPORTED_MODULE_13__.forEach)(value, function (v) { + body.push(new ReferenceSerializer(self.addTagName(self.nsPropertyTagName(p))).build(v)); + }); + } else { + // allow serialization via type + // rather than element name + var asType = serializeAsType(p), + asProperty = serializeAsProperty(p); + (0,min_dash__WEBPACK_IMPORTED_MODULE_13__.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); + + // ns may be + // + // * prefix only + // * prefix:uri + // * localName only + + var prefix = ns.prefix, + uri = ns.uri, + newPrefix, + idx, + wellknownUri; + + // handle anonymous namespaces (elementForm=unqualified), cf. #23 + if (!prefix && !uri) { + return { + localName: ns.localName + }; + } + wellknownUri = DEFAULT_NS_MAP[prefix] || model && (model.getPackage(prefix) || {}).uri; + uri = uri || wellknownUri || namespaces.uriByPrefix(prefix); + if (!uri) { + throw new Error('no namespace uri given for prefix <' + prefix + '>'); + } + ns = namespaces.byUri(uri); + if (!ns) { + newPrefix = prefix; + idx = 1; + + // find a prefix that is not mapped yet + while (namespaces.uriByPrefix(newPrefix)) { + newPrefix = prefix + '_' + idx++; + } + ns = this.logNamespace({ + prefix: newPrefix, + uri: uri + }, wellknownUri === uri); + } + if (prefix) { + namespaces.mapPrefix(prefix, uri); + } + return ns; +}; +ElementSerializer.prototype.parseAttributes = function (properties) { + var self = this, + element = this.element; + (0,min_dash__WEBPACK_IMPORTED_MODULE_13__.forEach)(properties, function (p) { + var value = element.get(p.name); + if (p.isReference) { + if (!p.isMany) { + value = value.id; + } else { + var values = []; + (0,min_dash__WEBPACK_IMPORTED_MODULE_13__.forEach)(value, function (v) { + values.push(v.id); + }); - module.exports.findRootElementsByType = findRootElementsByType; + // IDREFS is a whitespace-separated list of references. + 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 (name, value) { + var attrs = this.attrs; + if ((0,min_dash__WEBPACK_IMPORTED_MODULE_13__.isString)(value)) { + value = escapeAttr(value); + } + + // de-duplicate attributes + // https://github.com/bpmn-io/moddle-xml/issues/66 + var idx = (0,min_dash__WEBPACK_IMPORTED_MODULE_13__.findIndex)(attrs, function (element) { + return element.name.localName === name.localName && element.name.uri === name.uri && element.name.prefix === name.prefix; + }); + var attr = { + name: name, + value: value + }; + if (idx !== -1) { + attrs.splice(idx, 1, attr); + } else { + attrs.push(attr); + } +}; +ElementSerializer.prototype.serializeAttributes = function (writer) { + var attrs = this.attrs, + namespaces = this.namespaces; + if (namespaces) { + attrs = getNsAttrs(namespaces).concat(attrs); + } + (0,min_dash__WEBPACK_IMPORTED_MODULE_13__.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(); + } + (0,min_dash__WEBPACK_IMPORTED_MODULE_13__.forEach)(this.body, function (b) { + b.serializeTo(writer); + }); + if (indent) { + writer.unindent().appendIndent(); + } + writer.append(''); + } + writer.appendNewLine(); +}; + +/** + * A serializer for types that handles serialization of data types + */ +function TypeSerializer(parent, propertyDescriptor) { + ElementSerializer.call(this, parent, propertyDescriptor); +} +inherits(TypeSerializer, ElementSerializer); +TypeSerializer.prototype.parseNsAttributes = function (element) { + // extracted attributes + var attributes = ElementSerializer.prototype.parseNsAttributes.call(this, element); + var descriptor = element.$descriptor; + + // only serialize xsi:type if necessary + if (descriptor.name === this.propertyDescriptor.type) { + return attributes; + } + var typeNs = this.typeNs = this.nsTagName(descriptor); + this.getNamespaces().logUsed(this.typeNs); + + // add xsi:type attribute to represent the elements + // actual type + + var pkg = element.$model.getPackage(typeNs.uri), + typePrefix = pkg.xml && pkg.xml.typePrefix || ''; + this.addAttribute(this.nsAttributeName(XSI_TYPE), (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, format) { + var indent = ['']; + this.append = function (str) { + out.write(str); + return this; + }; + this.appendNewLine = function () { + if (format) { + out.write('\n'); + } + return this; + }; + this.appendIndent = function () { + if (format) { + out.write(indent.join(' ')); + } + return this; + }; + this.indent = function () { + indent.push(''); + return this; + }; + this.unindent = function () { + indent.pop(); + return this; + }; +} + +/** + * A writer for meta-model backed document trees + * + * @param {Object} options output options to pass into the writer + */ +function Writer(options) { + options = (0,min_dash__WEBPACK_IMPORTED_MODULE_13__.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: toXML + }; +} + +/** + * A sub class of {@link Moddle} with support for import and export of BPMN 2.0 xml files. + * + * @class BpmnModdle + * @extends Moddle + * + * @param {Object|Array} packages to use for instantiating the model + * @param {Object} [options] additional options to pass over + */ +function BpmnModdle(packages, options) { + Moddle.call(this, packages, options); +} +BpmnModdle.prototype = Object.create(Moddle.prototype); +/** + * The fromXML result. + * + * @typedef {Object} ParseResult + * + * @property {ModdleElement} rootElement + * @property {Array} references + * @property {Array} warnings + * @property {Object} elementsById - a mapping containing each ID -> ModdleElement + */ - function removeAllChildren(domElement) { - while (domElement.firstChild) { - domElement.removeChild(domElement.firstChild); - } - } +/** + * The fromXML error. + * + * @typedef {Error} ParseError + * + * @property {Array} warnings + */ - module.exports.removeAllChildren = removeAllChildren; +/** + * Instantiates a BPMN model tree from a given xml string. + * + * @param {String} xmlStr + * @param {String} [typeName='bpmn:Definitions'] name of the root element + * @param {Object} [options] options to pass to the underlying reader + * + * @returns {Promise} + */ +BpmnModdle.prototype.fromXML = function (xmlStr, typeName, options) { + if (!(0,min_dash__WEBPACK_IMPORTED_MODULE_13__.isString)(typeName)) { + options = typeName; + typeName = 'bpmn:Definitions'; + } + var reader = new Reader((0,min_dash__WEBPACK_IMPORTED_MODULE_13__.assign)({ + model: this, + lax: true + }, options)); + var rootHandler = reader.handler(typeName); + return reader.fromXML(xmlStr, rootHandler); +}; + +/** + * The toXML result. + * + * @typedef {Object} SerializationResult + * + * @property {String} xml + */ +/** + * Serializes a BPMN 2.0 object tree to XML. + * + * @param {String} element the root element, typically an instance of `bpmn:Definitions` + * @param {Object} [options] to pass to the underlying writer + * + * @returns {Promise} + */ +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$2 = { + tagAlias: "lowerCase" +}; +var DiPackage = { + name: name$2, + uri: uri$2, + prefix: prefix$2, + types: types$2, + associations: associations$2, + xml: xml$2 +}; +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$6 = "BPMN in Color"; +var uri$6 = "http://www.omg.org/spec/BPMN/non-normative/color/1.0"; +var prefix$6 = "color"; +var types$6 = [{ + 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$6 = []; +var BpmnInColorPackage = { + name: name$6, + uri: uri$6, + prefix: prefix$6, + types: types$6, + enumerations: enumerations, + associations: associations$6 +}; +var packages = { + bpmn: BpmnPackage, + bpmndi: BpmnDiPackage, + dc: DcPackage, + di: DiPackage, + bioc: BiocPackage, + color: BpmnInColorPackage +}; +function simple(additionalPackages, options) { + var pks = (0,min_dash__WEBPACK_IMPORTED_MODULE_13__.assign)({}, packages, additionalPackages); + return new BpmnModdle(pks, options); +} + +var name = "zeebe"; +var prefix = "zeebe"; +var uri = "http://camunda.org/schema/zeebe/1.0"; +var xml = { + tagAlias: "lowerCase" +}; +var associations = [ +]; +var types = [ + { + name: "ZeebeServiceTask", + "extends": [ + "bpmn:ServiceTask", + "bpmn:BusinessRuleTask", + "bpmn:ScriptTask", + "bpmn:SendTask", + "bpmn:EndEvent", + "bpmn:IntermediateThrowEvent" + ], + properties: [ + { + name: "retryCounter", + type: "String", + isAttr: true + } + ] + }, + { + name: "IoMapping", + superClass: [ + "Element" + ], + properties: [ + { + name: "ioMapping", + type: "IoMapping" + }, + { + name: "inputParameters", + isMany: true, + type: "Input" + }, + { + name: "outputParameters", + isMany: true, + type: "Output" + } + ], + meta: { + allowedIn: [ + "bpmn:CallActivity", + "bpmn:Event", + "bpmn:ReceiveTask", + "zeebe:ZeebeServiceTask", + "bpmn:SubProcess", + "bpmn:UserTask" + ] + } + }, + { + name: "InputOutputParameter", + properties: [ + { + name: "source", + isAttr: true, + type: "String" + }, + { + name: "target", + isAttr: true, + type: "String" + } + ] + }, + { + name: "Subscription", + superClass: [ + "Element" + ], + properties: [ + { + name: "correlationKey", + isAttr: true, + type: "String" + } + ] + }, + { + name: "Input", + superClass: [ + "InputOutputParameter" + ], + meta: { + allowedIn: [ + "bpmn:CallActivity", + "zeebe:ZeebeServiceTask", + "bpmn:SubProcess", + "bpmn:UserTask" + ] + } + }, + { + name: "Output", + superClass: [ + "InputOutputParameter" + ], + meta: { + allowedIn: [ + "bpmn:CallActivity", + "bpmn:Event", + "bpmn:ReceiveTask", + "zeebe:ZeebeServiceTask", + "bpmn:SubProcess", + "bpmn:UserTask" + ] + } + }, + { + name: "TaskHeaders", + superClass: [ + "Element" + ], + meta: { + allowedIn: [ + "zeebe:ZeebeServiceTask", + "bpmn:UserTask" + ] + }, + properties: [ + { + name: "values", + type: "Header", + isMany: true + } + ] + }, + { + name: "Header", + superClass: [ + "Element" + ], + properties: [ + { + name: "id", + type: "String", + isAttr: true + }, + { + name: "key", + type: "String", + isAttr: true + }, + { + name: "value", + type: "String", + isAttr: true + } + ] + }, + { + name: "TaskDefinition", + superClass: [ + "Element" + ], + meta: { + allowedIn: [ + "zeebe:ZeebeServiceTask" + ] + }, + properties: [ + { + name: "type", + type: "String", + isAttr: true + }, + { + name: "retries", + type: "String", + isAttr: true + } + ] + }, + { + name: "LoopCharacteristics", + superClass: [ + "Element" + ], + meta: { + allowedIn: [ + "zeebe:ZeebeServiceTask", + "bpmn:ReceiveTask", + "bpmn:SubProcess" + ] + }, + properties: [ + { + name: "inputCollection", + type: "String", + isAttr: true + }, + { + name: "inputElement", + type: "String", + isAttr: true + }, + { + name: "outputCollection", + type: "String", + isAttr: true + }, + { + name: "outputElement", + type: "String", + isAttr: true + } + ] + }, + { + name: "CalledElement", + superClass: [ + "Element" + ], + meta: { + allowedIn: [ + "bpmn:CallActivity" + ] + }, + properties: [ + { + name: "processId", + type: "String", + isAttr: true + }, + { + name: "processIdExpression", + type: "String", + isAttr: true + }, + { + name: "propagateAllChildVariables", + isAttr: true, + type: "Boolean" + }, + { + name: "propagateAllParentVariables", + isAttr: true, + type: "Boolean", + "default": true + } + ] + }, + { + name: "UserTaskForm", + superClass: [ + "Element" + ], + meta: { + allowedIn: [ + "bpmn:Process" + ] + }, + properties: [ + { + name: "id", + type: "String", + isAttr: true + }, + { + name: "body", + type: "String", + isBody: true + } + ] + }, + { + name: "FormDefinition", + superClass: [ + "Element" + ], + meta: { + allowedIn: [ + "bpmn:UserTask" + ] + }, + properties: [ + { + name: "formKey", + type: "String", + isAttr: true + }, + { + name: "formId", + type: "String", + isAttr: true + } + ] + }, + { + name: "CalledDecision", + superClass: [ + "Element" + ], + meta: { + allowedIn: [ + "bpmn:BusinessRuleTask" + ] + }, + properties: [ + { + name: "decisionId", + type: "String", + isAttr: true + }, + { + name: "resultVariable", + type: "String", + isAttr: true + } + ] + }, + { + name: "AssignmentDefinition", + superClass: [ + "Element" + ], + meta: { + allowedIn: [ + "bpmn:UserTask" + ] + }, + properties: [ + { + name: "assignee", + type: "String", + isAttr: true + }, + { + name: "candidateGroups", + type: "String", + isAttr: true + }, + { + name: "candidateUsers", + type: "String", + isAttr: true + } + ] + }, + { + name: "TaskSchedule", + superClass: [ + "Element" + ], + meta: { + allowedIn: [ + "bpmn:UserTask" + ] + }, + properties: [ + { + name: "dueDate", + type: "String", + isAttr: true + }, + { + name: "followUpDate", + type: "String", + isAttr: true + } + ] + }, + { + name: "Properties", + superClass: [ + "Element" + ], + properties: [ + { + name: "properties", + type: "Property", + isMany: true + } + ] + }, + { + name: "Property", + properties: [ + { + name: "name", + type: "String", + isAttr: true + }, + { + name: "value", + type: "String", + isAttr: true + } + ] + }, + { + name: "TemplateSupported", + isAbstract: true, + "extends": [ + "bpmn:Collaboration", + "bpmn:Process", + "bpmn:FlowElement" + ], + properties: [ + { + name: "modelerTemplate", + isAttr: true, + type: "String" + }, + { + name: "modelerTemplateVersion", + isAttr: true, + type: "Integer" + }, + { + name: "modelerTemplateIcon", + isAttr: true, + type: "String" + } + ] + }, + { + name: "TemplatedRootElement", + isAbstract: true, + "extends": [ + "bpmn:Error", + "bpmn:Escalation", + "bpmn:Message", + "bpmn:Signal" + ], + properties: [ + { + name: "modelerTemplate", + isAttr: true, + type: "String" + } + ] + }, + { + name: "Script", + superClass: [ + "Element" + ], + meta: { + allowedIn: [ + "bpmn:ScriptTask" + ] + }, + properties: [ + { + name: "expression", + type: "String", + isAttr: true + }, + { + name: "resultVariable", + type: "String", + isAttr: true + } + ] + } +]; +var zeebeModdle = { + name: name, + prefix: prefix, + uri: uri, + xml: xml, + associations: associations, + types: types +}; + +/** + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. + * + * Camunda licenses this file to you under the MIT; you may not use this file + * except in compliance with the MIT License. + */ - /** - * adds an empty option to the list - */ - function addEmptyParameter(list) { - return list.push({ 'label': '', 'value': '', 'name': '' }); - } +const elementTemplateLintRule = ({ + templates = [] +}) => { + const moddle = new simple({ + zeebe: zeebeModdle + }); + const validator = new Validator(moddle).addAll(templates); + const validTemplates = validator.getValidTemplates(); + + // We use the ElementTemplates Module without the required bpmn-js modules + // As we only use it to facilitate template ID and version lookup, + // access to commandstack etc. is not required + const elementTemplates = new ElementTemplates(); + elementTemplates.set(validTemplates); + function check(node, reporter) { + if (!(0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_11__.is)(node, 'bpmn:FlowElement')) { + return; + } + let template = elementTemplates.get(node); + const templateId = elementTemplates._getTemplateId(node); + + // Handle missing template + if (templateId && !template) { + reporter.report(node.id, 'Linked element template not found', { + name: node.name + }); + return; + } + if (!template) { + return; + } + template = applyConditions(node, template); + + // Check attributes + template.properties.forEach(property => { + const value = getPropertyValue(node, property); + const error = validateProperty(value, property); + if (!error) { + return; + } + reporter.report(node.id, error, { + propertiesPanel: { + entryIds: [getEntryId(property, template)] + }, + name: node.name + }); + }); + } + return { + check + }; +}; +const ElementTemplateLinterPlugin = function (templates) { + return { + config: { + rules: { + 'element-templates/validate': ['error', { + templates + }] + } + }, + resolver: new (bpmnlint_lib_resolver_static_resolver__WEBPACK_IMPORTED_MODULE_10___default())({ + 'rule:bpmnlint-plugin-element-templates/validate': elementTemplateLintRule + }) + }; +}; + +// helpers ////////////////////// + +function getEntryId(property, template) { + const index = template.properties.filter(p => p.group === property.group).indexOf(property); + const path = ['custom-entry', template.id]; + if (property.group) { + path.push(property.group); + } + path.push(index); + return path.join('-'); +} + + +//# sourceMappingURL=index.esm.js.map + + +/***/ }), + +/***/ "../node_modules/bpmn-js-properties-panel/dist/index.esm.js": +/*!******************************************************************!*\ + !*** ../node_modules/bpmn-js-properties-panel/dist/index.esm.js ***! + \******************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ BpmnPropertiesPanelModule: () => (/* binding */ index$3), +/* harmony export */ BpmnPropertiesProviderModule: () => (/* binding */ index$2), +/* harmony export */ CamundaPlatformPropertiesProviderModule: () => (/* binding */ index), +/* harmony export */ ZeebePropertiesProviderModule: () => (/* binding */ index$1), +/* harmony export */ ZeebeTooltipProvider: () => (/* binding */ TooltipProvider), +/* harmony export */ useService: () => (/* binding */ useService) +/* harmony export */ }); +/* harmony import */ var _bpmn_io_properties_panel_preact_hooks__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @bpmn-io/properties-panel/preact/hooks */ "../node_modules/@bpmn-io/properties-panel/preact/hooks/dist/hooks.module.js"); +/* harmony import */ var min_dash__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! min-dash */ "../node_modules/min-dash/dist/index.esm.js"); +/* harmony import */ var _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @bpmn-io/properties-panel */ "../node_modules/@bpmn-io/properties-panel/dist/index.esm.js"); +/* harmony import */ var _bpmn_io_properties_panel_preact__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @bpmn-io/properties-panel/preact */ "../node_modules/@bpmn-io/properties-panel/preact/dist/preact.module.js"); +/* harmony import */ var bpmn_js_lib_features_label_editing_LabelUtil__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! bpmn-js/lib/features/label-editing/LabelUtil */ "../node_modules/bpmn-js/lib/util/LabelUtil.js"); +/* harmony import */ var bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! bpmn-js/lib/features/modeling/util/ModelingUtil */ "../node_modules/bpmn-js/lib/util/ModelUtil.js"); +/* harmony import */ var bpmn_js_lib_util_DiUtil__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! bpmn-js/lib/util/DiUtil */ "../node_modules/bpmn-js/lib/util/DiUtil.js"); +/* harmony import */ var _bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @bpmn-io/properties-panel/preact/compat */ "../node_modules/@bpmn-io/properties-panel/preact/compat/dist/compat.module.js"); +/* harmony import */ var _bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @bpmn-io/properties-panel/preact/jsx-runtime */ "../node_modules/@bpmn-io/properties-panel/preact/jsx-runtime/dist/jsxRuntime.module.js"); +/* harmony import */ var diagram_js_lib_features_keyboard_KeyboardUtil__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! diagram-js/lib/features/keyboard/KeyboardUtil */ "../node_modules/diagram-js/lib/features/keyboard/KeyboardUtil.js"); +/* harmony import */ var min_dom__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! min-dom */ "../node_modules/min-dom/dist/index.esm.js"); +/* harmony import */ var ids__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ids */ "../node_modules/ids/dist/index.esm.js"); +/* harmony import */ var diagram_js_lib_util_Collections__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! diagram-js/lib/util/Collections */ "../node_modules/diagram-js/lib/util/Collections.js"); +/* harmony import */ var _bpmn_io_extract_process_variables_zeebe__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @bpmn-io/extract-process-variables/zeebe */ "../node_modules/@bpmn-io/extract-process-variables/zeebe/index.js"); +/* harmony import */ var array_move__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! array-move */ "../node_modules/array-move/index.js"); +/* harmony import */ var _bpmn_io_extract_process_variables__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @bpmn-io/extract-process-variables */ "../node_modules/@bpmn-io/extract-process-variables/dist/index.js"); + + + + + + + + + + + + + + + + + + +const BpmnPropertiesPanelContext = (0,_bpmn_io_properties_panel_preact__WEBPACK_IMPORTED_MODULE_2__.createContext)({ + selectedElement: null, + injector: null, + getService() { + return null; + } +}); + +function useService(type, strict) { + const { + getService + } = (0,_bpmn_io_properties_panel_preact_hooks__WEBPACK_IMPORTED_MODULE_0__.useContext)(BpmnPropertiesPanelContext); + return getService(type, strict); +} + +function _extends$1o() { _extends$1o = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$1o.apply(this, arguments); } +var AssociationIcon = (({ + styles = {}, + ...props +}) => /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("svg", _extends$1o({ + width: "32", + height: "32", + xmlns: "http://www.w3.org/2000/svg" +}, props), /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("path", { + stroke: "#000", + strokeWidth: "2", + fill: "none", + strokeDasharray: "3.3,6", + strokeLinecap: "square", + d: "M1.5 30.5l29-29" +}))); + +function _extends$1n() { _extends$1n = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$1n.apply(this, arguments); } +var BusinessRuleTaskIcon = (({ + styles = {}, + ...props +}) => /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("svg", _extends$1n({ + xmlns: "http://www.w3.org/2000/svg", + width: "32", + height: "32" +}, props), /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("path", { + d: "M6.494 3C2.916 3 0 5.903 0 9.475v13.383c0 3.572 2.916 6.475 6.494 6.475h19.012c3.578 0 6.494-2.903 6.494-6.475V9.475C32 5.903 29.084 3 25.506 3H6.494zm0 2h19.012C28.015 5 30 6.98 30 9.475v13.383c0 2.495-1.985 4.475-4.494 4.475H6.494C3.985 27.333 2 25.353 2 22.858V9.475C2 6.98 3.985 5 6.494 5zM5.296 7.398v12.665h16.87V7.398H5.296zm.718 4.386h15.433v3.44H9.985v-3.432h-.719v3.431H6.014v-3.44zm0 4.158h3.252v3.403H6.014v-3.403zm3.97 0h11.463v3.403H9.985v-3.403z" +}), /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("path", { + d: "M6.079 8.209v3.587H21.44V8.209z" +}))); + +function _extends$1m() { _extends$1m = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$1m.apply(this, arguments); } +var CallActivityIcon = (({ + styles = {}, + ...props +}) => /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("svg", _extends$1m({ + xmlns: "http://www.w3.org/2000/svg", + width: "32", + height: "32" +}, props), /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("path", { + d: "M24.978 3c3.761 0 6.89 2.979 7.018 6.695l.004.238V22.4c0 3.747-3.05 6.804-6.783 6.93l-.24.003H7.023c-3.761 0-6.89-2.978-7.018-6.695L0 22.4V9.933C0 6.187 3.05 3.13 6.783 3.004L7.023 3h17.955zm0 3.667H7.022c-1.842 0-3.255 1.344-3.35 3.079l-.005.187V22.4c0 1.761 1.35 3.167 3.16 3.262l.195.005L10 25.666V15h12v10.666h2.978c1.842 0 3.255-1.344 3.35-3.079l.005-.187V9.933c0-1.761-1.35-3.166-3.16-3.261l-.195-.005zm-3.732 9.087H10.754v9.912h10.491v-9.912zm-4.475 1.817v2.658h2.658v1.542H16.77v2.658H15.23V21.77H12.57V20.23h2.658V17.57h1.542z" +}))); + +function _extends$1l() { _extends$1l = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$1l.apply(this, arguments); } +var CollaborationIcon = (({ + styles = {}, + ...props +}) => /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("svg", _extends$1l({ + xmlns: "http://www.w3.org/2000/svg", + width: "32", + height: "32" +}, props), /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("g", { + fillRule: "evenodd" +}, /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("path", { + fillRule: "nonzero", + d: "M0 0v8.62h32V0H0zm1.655 7.054v-5.37h28.62v5.37H1.656zM0 23.38V32h32v-8.62H0zm1.655 7.054v-5.37h28.62v5.37H1.656z" +}), /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("path", { + d: "M24 8l4 7h-8l4-7zm0 2l-2.28 4h4.56L24 10zM23.5 21h1v3h-1zM23.5 15h1v3h-1zM8 24l-4-7h8l-4 7zm0-2l2.28-4H5.72L8 22zM7.5 8h1v3h-1zM7.5 14h1v3h-1z" +})))); + +function _extends$1k() { _extends$1k = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$1k.apply(this, arguments); } +var ConditionalFlowIcon = (({ + styles = {}, + ...props +}) => /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("svg", _extends$1k({ + xmlns: "http://www.w3.org/2000/svg", + width: "32", + height: "32" +}, props), /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("path", { + d: "M32 .041S20.42 5.95 14.537 8.713c1.26 1.15 2.432 2.392 3.648 3.588-5.703 5.78-3.15 3.303-8.087 8.316l-8.472 1.377L0 32l10.006-1.626.098-.598 1.279-7.873c4.975-5.052 2.403-2.555 8.118-8.346 1.218 1.214 2.43 2.435 3.648 3.648C26.29 11.018 32 .041 32 .041zM9.603 22.397L8.54 28.91 2.03 29.97l1.061-6.515 6.512-1.058z" +}))); + +function _extends$1j() { _extends$1j = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$1j.apply(this, arguments); } +var ConnectionIcon = (({ + styles = {}, + ...props +}) => /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("svg", _extends$1j({ + xmlns: "http://www.w3.org/2000/svg", + width: "32", + height: "32" +}, props), /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("path", { + d: "M32 .06S20.33 6.014 14.403 8.798c1.27 1.16 2.451 2.41 3.676 3.616L0 30.734 1.325 32l18.08-18.32c1.227 1.223 2.448 2.453 3.676 3.676C26.247 11.12 32 .06 32 .06z" +}))); + +function _extends$1i() { _extends$1i = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$1i.apply(this, arguments); } +var DataInputOutputAssociationIcon = (({ + styles = {}, + ...props +}) => /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("svg", _extends$1i({ + width: "32", + height: "32", + xmlns: "http://www.w3.org/2000/svg" +}, props), /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("path", { + stroke: "#000", + strokeWidth: "2", + strokeLinecap: "round", + strokeDasharray: "1.1,4.3", + d: "M1.5 30.5L27 5" +}), /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("path", { + d: "M31.803.197L26.5 16.107l-1.52-1.52 3.783-11.35-11.35 3.783-1.52-1.52z" +}))); + +function _extends$1h() { _extends$1h = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$1h.apply(this, arguments); } +var DataInputIcon = (({ + styles = {}, + ...props +}) => /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("svg", _extends$1h({ + xmlns: "http://www.w3.org/2000/svg", + width: "32", + height: "32" +}, props), /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("path", { + d: "M20.833 0H3.488v32H28V7.36L20.833 0zm-2.105 1.818v7.507h7.454v20.857H5.306V1.818h13.422zm1.818.493l5.06 5.196h-5.06V2.311zm-9.182.86v3.744H7.081v3.222h4.283v3.743l5.7-5.354-5.7-5.354zm.808 1.868l3.711 3.487-3.71 3.487V9.329H7.888V7.723h4.283V5.039z" +}))); + +function _extends$1g() { _extends$1g = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$1g.apply(this, arguments); } +var DataObjectIcon = (({ + styles = {}, + ...props +}) => /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("svg", _extends$1g({ + xmlns: "http://www.w3.org/2000/svg", + width: "32", + height: "32" +}, props), /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("path", { + d: "M21.345 0H4v32h24.512V7.36L21.345 0zM19.24 1.818v7.507h7.454v20.857H5.818V1.818H19.24zm1.818.493l5.06 5.196h-5.06V2.311z" +}))); + +function _extends$1f() { _extends$1f = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$1f.apply(this, arguments); } +var DataOutputIcon = (({ + styles = {}, + ...props +}) => /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("svg", _extends$1f({ + xmlns: "http://www.w3.org/2000/svg", + width: "32", + height: "32" +}, props), /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("path", { + d: "M20.833 0H3.488v32H28V7.36L20.833 0zm-2.105 1.818v7.507h7.454v20.857H5.306V1.818h13.422zm1.818.493l5.06 5.196h-5.06V2.311zm-9.182.86v3.744H7.081v3.222h4.283v3.743l5.7-5.354-5.7-5.354z" +}))); + +function _extends$1e() { _extends$1e = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$1e.apply(this, arguments); } +var DataStoreIcon = (({ + styles = {}, + ...props +}) => /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("svg", _extends$1e({ + xmlns: "http://www.w3.org/2000/svg", + width: "32", + height: "32" +}, props), /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("path", { + d: "M16.008 1c-3.712 0-7.417.306-10.319.939-1.45.316-2.7.71-3.68 1.226C1.065 3.662.297 4.304.061 5.23a.823.823 0 00-.035.15L0 5.502l.017.084c-.012 7.41 0 14.46 0 22.08l.017.082c.203.985.995 1.656 1.975 2.172.98.517 2.23.91 3.68 1.226 2.902.633 6.607.94 10.319.94 3.711 0 7.416-.307 10.318-.94 1.451-.316 2.701-.71 3.68-1.226.98-.516 1.772-1.187 1.975-2.172l.017-.082V5.541a.825.825 0 000-.106v-.016l-.002-.013a.823.823 0 00-.046-.197c-.244-.916-1.007-1.55-1.943-2.044-.98-.516-2.23-.91-3.68-1.226C23.423 1.306 19.718 1 16.006 1zm0 1.646c3.62 0 7.245.308 9.968.901 1.36.297 2.497.67 3.263 1.074.612.323.932.643 1.063.882-.131.24-.451.56-1.063.882-.766.404-1.902.777-3.263 1.074-2.723.594-6.349.901-9.968.901-3.62 0-7.245-.307-9.968-.901-1.361-.297-2.497-.67-3.264-1.074-.611-.322-.931-.642-1.062-.882.13-.24.451-.56 1.062-.882.767-.403 1.903-.777 3.264-1.074 2.723-.593 6.348-.9 9.968-.9zM1.664 7.647c.112.067.227.132.345.194.98.517 2.23.91 3.68 1.226 2.902.633 6.607.94 10.319.94 3.711 0 7.416-.307 10.318-.94 1.451-.316 2.701-.71 3.68-1.226.119-.062.234-.127.346-.194v1.93c-.08.245-.398.619-1.113.995-.766.404-1.902.777-3.263 1.074-2.723.594-6.349.901-9.968.901-3.62 0-7.245-.307-9.968-.9-1.361-.298-2.497-.671-3.264-1.075-.714-.376-1.032-.75-1.112-.995v-1.93zm0 4.187c.112.067.227.132.345.195.98.516 2.23.91 3.68 1.226 2.902.632 6.607.938 10.319.938 3.711 0 7.416-.306 10.318-.938 1.451-.317 2.701-.71 3.68-1.226.119-.063.234-.128.346-.195v1.93c-.08.245-.398.619-1.113.995-.766.404-1.902.777-3.263 1.074-2.723.594-6.349.901-9.968.901-3.62 0-7.245-.307-9.968-.9-1.361-.298-2.497-.67-3.264-1.075-.714-.376-1.032-.75-1.112-.995v-1.93zm0 4.188c.112.067.227.131.345.194.98.516 2.23.91 3.68 1.226 2.902.633 6.607.939 10.319.939 3.711 0 7.416-.306 10.318-.94 1.451-.316 2.701-.709 3.68-1.225.119-.063.234-.127.346-.194V27.47c-.08.245-.398.618-1.113.995-.766.404-1.902.777-3.263 1.074-2.723.594-6.349.9-9.968.9-3.62 0-7.245-.306-9.968-.9-1.361-.297-2.497-.67-3.264-1.074-.714-.377-1.032-.75-1.112-.995V16.022z" +}))); + +function _extends$1d() { _extends$1d = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$1d.apply(this, arguments); } +var DefaultFlowIcon = (({ + styles = {}, + ...props +}) => /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("svg", _extends$1d({ + xmlns: "http://www.w3.org/2000/svg", + width: "32", + height: "32" +}, props), /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("path", { + d: "M32 .06S20.33 6.014 14.403 8.798c1.27 1.16 2.451 2.41 3.676 3.616L6.84 23.804H.046v1.755h5.063L0 30.735 1.325 32l6.357-6.441h7.145v-1.756H9.414l9.99-10.123c1.228 1.223 2.45 2.453 3.677 3.676C26.247 11.12 32 .06 32 .06z" +}))); + +function _extends$1c() { _extends$1c = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$1c.apply(this, arguments); } +var EndEventCancelIcon = (({ + styles = {}, + ...props +}) => /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("svg", _extends$1c({ + xmlns: "http://www.w3.org/2000/svg", + width: "32", + height: "32" +}, props), /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("path", { + d: "M15.676.051C7.943.058.834 6.501.104 14.21c-.783 6.565 2.912 13.427 8.942 16.216 5.6 2.737 12.789 1.87 17.434-2.344 4.725-4.09 6.79-11.06 4.714-17.006C29.22 5.009 23.394.364 16.978.083A18.532 18.532 0 0015.676.05zm.317 5.006c5.695-.165 10.916 4.858 10.983 10.555.246 5.212-3.67 10.33-8.864 11.204-5.026 1.007-10.6-1.898-12.36-6.777-1.894-4.826.039-10.928 4.649-13.46a11.082 11.082 0 015.592-1.522zm-3.955 3.918L8.94 12.072l3.985 3.985-3.913 3.913 3.048 3.047 3.913-3.913 3.987 3.987 3.096-3.096-3.987-3.987 3.913-3.913-3.047-3.048-3.913 3.913-3.985-3.985z" +}))); + +function _extends$1b() { _extends$1b = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$1b.apply(this, arguments); } +var EndEventCompensationIcon = (({ + styles = {}, + ...props +}) => /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("svg", _extends$1b({ + xmlns: "http://www.w3.org/2000/svg", + width: "32", + height: "32" +}, props), /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("path", { + d: "M15.676.051C7.943.058.834 6.501.104 14.21c-.783 6.565 2.912 13.427 8.942 16.216 5.6 2.737 12.789 1.87 17.434-2.344 4.725-4.09 6.79-11.06 4.714-17.006C29.22 5.009 23.394.364 16.978.083A18.532 18.532 0 0015.676.05zm.317 5.006c5.695-.165 10.916 4.858 10.983 10.555.246 5.212-3.67 10.33-8.864 11.204-5.026 1.007-10.6-1.898-12.36-6.777-1.894-4.826.039-10.928 4.649-13.46a11.082 11.082 0 015.592-1.522zm-.56 5.744l-7.407 5.23 7.408 5.234v-5.057c2.384 1.687 4.771 3.371 7.157 5.057V10.801l-7.157 5.054v-5.054z" +}))); + +function _extends$1a() { _extends$1a = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$1a.apply(this, arguments); } +var EndEventErrorIcon = (({ + styles = {}, + ...props +}) => /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("svg", _extends$1a({ + xmlns: "http://www.w3.org/2000/svg", + width: "32", + height: "32" +}, props), /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("path", { + d: "M15.676.051C7.943.058.834 6.501.104 14.21c-.783 6.565 2.912 13.427 8.942 16.216 5.6 2.737 12.789 1.87 17.434-2.344 4.725-4.09 6.79-11.06 4.714-17.006C29.22 5.009 23.394.364 16.978.083A18.532 18.532 0 0015.676.05zm.317 5.006c5.695-.165 10.916 4.858 10.983 10.555.246 5.212-3.67 10.33-8.864 11.204-5.026 1.007-10.6-1.898-12.36-6.777-1.894-4.826.039-10.928 4.649-13.46a11.082 11.082 0 015.592-1.522zm6.132 4.166l-3.633 7.363-4.516-5.874-4.102 12.131 4.599-5.91 4.743 5.427 2.909-13.137z" +}))); + +function _extends$19() { _extends$19 = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$19.apply(this, arguments); } +var EndEventEscalationIcon = (({ + styles = {}, + ...props +}) => /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("svg", _extends$19({ + xmlns: "http://www.w3.org/2000/svg", + width: "32", + height: "32" +}, props), /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("path", { + d: "M15.676.051C7.943.058.834 6.501.104 14.21c-.783 6.565 2.912 13.427 8.942 16.216 5.6 2.737 12.789 1.87 17.434-2.344 4.725-4.09 6.79-11.06 4.714-17.006C29.22 5.009 23.394.364 16.978.083A18.532 18.532 0 0015.676.05zm.317 5.006c5.695-.165 10.916 4.858 10.983 10.555.246 5.212-3.67 10.33-8.864 11.204-5.026 1.007-10.6-1.898-12.36-6.777-1.894-4.826.039-10.928 4.649-13.46a11.082 11.082 0 015.592-1.522zm.006 3.9c-1.672 4.653-2.733 9.5-4.406 14.153 1.535-1.525 2.872-3.234 4.406-4.759l4.406 4.76c-1.497-4.71-2.91-9.445-4.406-14.155z" +}))); + +function _extends$18() { _extends$18 = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$18.apply(this, arguments); } +var EndEventLinkIcon = (({ + styles = {}, + ...props +}) => /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("svg", _extends$18({ + xmlns: "http://www.w3.org/2000/svg", + width: "32", + height: "32" +}, props), /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("path", { + d: "M15.676 0C7.943.007.834 6.45.104 14.16c-.783 6.565 2.912 13.427 8.942 16.216 5.6 2.737 12.789 1.87 17.434-2.344 4.725-4.09 6.79-11.06 4.714-17.006C29.22 4.958 23.394.313 16.978.032A18.532 18.532 0 0015.676 0zm.317 5.006c5.695-.165 10.916 4.858 10.983 10.555.246 5.212-3.67 10.33-8.864 11.204-5.026 1.007-10.6-1.898-12.36-6.777-1.894-4.826.039-10.928 4.649-13.46a11.082 11.082 0 015.592-1.522zm1.78 4.065v3.555H9.779v6.713h7.994v3.554l5.828-6.91-5.828-6.912z" +}))); + +function _extends$17() { _extends$17 = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$17.apply(this, arguments); } +var EndEventMessageIcon = (({ + styles = {}, + ...props +}) => /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("svg", _extends$17({ + xmlns: "http://www.w3.org/2000/svg", + width: "32", + height: "32" +}, props), /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("path", { + d: "M15.676 0C7.943.007.834 6.45.104 14.16c-.783 6.565 2.912 13.427 8.942 16.216 5.6 2.737 12.789 1.87 17.434-2.344 4.725-4.09 6.79-11.06 4.714-17.006C29.22 4.958 23.394.313 16.978.032A18.532 18.532 0 0015.676 0zm.317 5.006c5.695-.165 10.916 4.858 10.983 10.555.246 5.212-3.67 10.33-8.864 11.204-5.026 1.007-10.6-1.898-12.36-6.777-1.894-4.826.039-10.928 4.649-13.46a11.082 11.082 0 015.592-1.522zm-5.91 5.448l6.041 4.9 6.04-4.9H10.084zm-1.34 1.137v9.92h14.513v-9.718l-7.132 5.786-7.381-5.988z" +}))); + +function _extends$16() { _extends$16 = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$16.apply(this, arguments); } +var EndEventMultipleIcon = (({ + styles = {}, + ...props +}) => /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("svg", _extends$16({ + xmlns: "http://www.w3.org/2000/svg", + width: "32", + height: "32" +}, props), /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("path", { + d: "M15.676 0C7.943.007.834 6.45.104 14.16c-.783 6.565 2.912 13.427 8.942 16.216 5.6 2.737 12.789 1.87 17.434-2.344 4.725-4.09 6.79-11.06 4.714-17.006C29.22 4.958 23.394.313 16.978.032A18.529 18.529 0 0015.676 0zm.317 5.006c5.695-.165 10.916 4.858 10.983 10.555.246 5.212-3.67 10.33-8.864 11.204-5.026 1.007-10.6-1.898-12.36-6.777-1.894-4.826.039-10.928 4.649-13.46a11.082 11.082 0 015.592-1.522zm.011 3.039l-7.619 5.53 2.91 8.95h9.418l2.91-8.95-7.619-5.53z" +}))); + +function _extends$15() { _extends$15 = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$15.apply(this, arguments); } +var EndEventNoneIcon = (({ + styles = {}, + ...props +}) => /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("svg", _extends$15({ + xmlns: "http://www.w3.org/2000/svg", + width: "32", + height: "32" +}, props), /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("path", { + d: "M15.84.042C8.654-.01 1.913 5.437.4 12.454-1.057 18.62 1.554 25.495 6.784 29.09c5.076 3.636 12.31 3.92 17.59.544 5.309-3.251 8.435-9.744 7.445-15.921C30.91 7.307 25.795 1.738 19.442.422a16.064 16.064 0 00-3.602-.38zm.382 5.01c5.28-.017 10.13 4.353 10.669 9.61.687 5.025-2.552 10.281-7.423 11.792-4.754 1.617-10.486-.447-12.962-4.856-2.74-4.575-1.574-11.094 2.768-14.27a11.05 11.05 0 016.948-2.276z" +}))); + +function _extends$14() { _extends$14 = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$14.apply(this, arguments); } +var EndEventSignalIcon = (({ + styles = {}, + ...props +}) => /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("svg", _extends$14({ + xmlns: "http://www.w3.org/2000/svg", + width: "32", + height: "32" +}, props), /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("path", { + d: "M15.676.051C7.943.058.834 6.501.104 14.21c-.783 6.565 2.912 13.427 8.942 16.216 5.6 2.737 12.789 1.87 17.434-2.344 4.725-4.09 6.79-11.06 4.714-17.006C29.22 5.009 23.394.364 16.978.083A18.532 18.532 0 0015.676.05zm.317 5.006c5.695-.165 10.916 4.858 10.983 10.555.246 5.212-3.67 10.33-8.864 11.204-5.026 1.007-10.6-1.898-12.36-6.777-1.894-4.826.039-10.928 4.649-13.46a11.082 11.082 0 015.592-1.522zm.006 3.492c-2.261 4.07-4.532 8.136-6.797 12.204h13.595L15.999 8.55z" +}))); + +function _extends$13() { _extends$13 = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$13.apply(this, arguments); } +var EndEventTerminateIcon = (({ + styles = {}, + ...props +}) => /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("svg", _extends$13({ + xmlns: "http://www.w3.org/2000/svg", + width: "32", + height: "32" +}, props), /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("path", { + d: "M15.676.051C7.943.058.834 6.501.104 14.21c-.783 6.565 2.912 13.427 8.942 16.216 5.6 2.737 12.789 1.87 17.434-2.344 4.725-4.09 6.79-11.06 4.714-17.006C29.22 5.009 23.394.364 16.978.083A18.532 18.532 0 0015.676.05zm.317 5.006c5.695-.165 10.916 4.858 10.983 10.555.246 5.212-3.67 10.33-8.864 11.204-5.026 1.007-10.6-1.898-12.36-6.777-1.894-4.826.039-10.928 4.649-13.46a11.082 11.082 0 015.592-1.522zm.006 2.859c-5.264-.2-9.495 5.551-7.755 10.516 1.366 5.085 8.108 7.436 12.339 4.301 4.455-2.807 4.708-9.943.462-13.058A8.128 8.128 0 0016 7.915z" +}))); + +function _extends$12() { _extends$12 = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$12.apply(this, arguments); } +var EventSubProcessExpandedIcon = (({ + styles = {}, + ...props +}) => /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("svg", _extends$12({ + xmlns: "http://www.w3.org/2000/svg", + width: "32", + height: "32" +}, props), /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("path", { + d: "M7.295 4.78h1.779V3.003h-1.78V4.78zm3.558 0h1.779V3.003h-1.78V4.78zm3.557 0h1.78V3.003h-1.78V4.78zm3.558 0h1.78V3.003h-1.78V4.78zm3.558 0h1.779V3.003h-1.779V4.78zm3.558 0c.55.014 1.106-.034 1.654.045l.245-1.762c-.629-.096-1.266-.05-1.9-.061V4.78zM5.732 3.004a5.933 5.933 0 00-.915.093c.111.582.226 1.164.315 1.75.358-.101.947.098.746-.483-.096-.382.164-1.208-.146-1.36zm22.372 2.281c.427.234.812.547 1.13.915.42-.4 1.002-.777 1.33-1.18a5.863 5.863 0 00-1.593-1.289l-.867 1.554zm-25.27-1.44c-.587.354-1.11.811-1.539 1.345.47.333.96.86 1.417 1.077.299-.362.66-.673 1.065-.913-.328-.493-.55-1.055-.944-1.509zM30.515 7.26c-.563.046-.557.342-.378.784.154.25-.097.862.25.85.525-.023 1.14.043 1.612-.032a5.891 5.891 0 00-.362-2.027l-1.122.425zM.268 7.114A6.042 6.042 0 000 9.052h1.78c-.013-.5.047-1.003.208-1.478L.296 7.027l-.026.079-.002.008zM30.22 12.45H32v-1.779h-1.779v1.779zm-30.22.16h1.78v-1.779H0v1.78zm30.22 3.398H32v-1.78h-1.779v1.78zm-30.22.16h1.78v-1.779H0v1.779zm30.22 3.398H32v-1.78h-1.779v1.78zm-30.22.16h1.78v-1.78H0v1.78zm30.22 3.397H32v-1.779h-1.779v1.78zm-30.22.16h1.78v-1.778H0v1.778zm30.137 1.47a4.059 4.059 0 01-.522 1.32c.506.283 1.046.715 1.53.908a5.836 5.836 0 00.744-1.918c-.576-.094-1.209-.264-1.752-.31zm-29.984.51c.157.676.435 1.325.82 1.904l1.486-.977a4.065 4.065 0 01-.577-1.347l-1.73.42zm28.427 1.943c-.371.277-.79.49-1.234.627l.548 1.693a5.84 5.84 0 001.835-.96l-1.082-1.412-.066.05-.001.002zm-26.164 1.47c.567.413 1.21.722 1.886.907.14-.569.343-1.175.444-1.722a4.062 4.062 0 01-1.283-.624l-1.047 1.438zm3.88 1.119h1.779v-1.78h-1.78v1.78zm3.55 0h1.787v-1.78H9.846v1.78zm3.565 0h1.78v-1.78h-1.78v1.78zm3.558 0h1.78v-1.78h-1.78v1.78zm3.451 0h1.743v-1.78h-1.743v1.78zm3.665 0h1.779v-1.78h-1.78v1.78zm-1.922-.545V16.776H9.846V29.25h12.318zM10.967 17.905h10.068V27.97H10.967V17.905zm1.336 3.998v1.711h7.396v-1.711h-7.396z", + opacity: ".97" +}))); + +function _extends$11() { _extends$11 = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$11.apply(this, arguments); } +var GatewayComplexIcon = (({ + styles = {}, + ...props +}) => /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("svg", _extends$11({ + xmlns: "http://www.w3.org/2000/svg", + width: "32", + height: "32" +}, props), /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("path", { + d: "M16.001 0a1.29 1.29 0 00-.917.373L.373 15.084a1.316 1.316 0 00.002 1.834l14.71 14.709a1.313 1.313 0 001.833 0l14.711-14.711a1.316 1.316 0 00-.002-1.834L16.917.372A1.294 1.294 0 0016.002 0zM16 2.181l13.821 13.821L16 29.823 2.179 16.003 16 2.18zm-.327 6.79v.007l-.145.027-.118.08-.083.123-.028.145v4.954L11.793 10.8l-.125-.08-.14-.029-.144.027-.122.082-.46.46-.085.125-.026.142.028.14.08.125 3.505 3.505H9.347l-.001-.002-.145.032-.118.08-.083.122-.028.146v.652l.029.147.082.119.12.08.144.032h4.956L10.8 20.207v-.001l-.084.124-.026.142.028.14.08.124.46.461.126.082.14.029.143-.027.124-.084L15.3 17.69v4.964-.001l.028.147.082.12.12.08.144.031h.652l.148-.03.118-.08.083-.12.028-.146v-4.962l3.505 3.505.126.082.14.027.142-.027.124-.084.461-.46.083-.123s.028-.144.027-.146l-.028-.14-.082-.126-3.496-3.496h4.948l.148-.03.119-.08.082-.12.028-.147v-.652l-.028-.145-.083-.122-.119-.08s-.147-.033-.147-.031h-4.964l3.512-3.512.082-.122.029-.144-.028-.14-.084-.124-.46-.461-.123-.082-.14-.027-.145.027-.122.082-3.507 3.507V9.348l-.028-.146-.082-.122-.12-.08-.147-.029h-.652z" +}))); + +function _extends$10() { _extends$10 = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$10.apply(this, arguments); } +var GatewayEventBasedIcon = (({ + styles = {}, + ...props +}) => /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("svg", _extends$10({ + xmlns: "http://www.w3.org/2000/svg", + width: "32", + height: "32" +}, props), /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("path", { + d: "M16 0a1.29 1.29 0 00-.918.373L.371 15.084a1.316 1.316 0 00.002 1.834l14.71 14.709a1.313 1.313 0 001.833 0l14.711-14.711a1.316 1.316 0 00-.002-1.834L16.915.372A1.294 1.294 0 0016 0zm-.002 2.181l13.821 13.821-13.821 13.821-13.821-13.82L15.998 2.18zm0 5.876l-.254.185-7.377 5.355 2.915 8.964h9.433l2.915-8.964-7.631-5.54zm0 1.07l6.614 4.8-2.526 7.769h-8.175l-2.526-7.768 6.614-4.802z" +}))); + +function _extends$$() { _extends$$ = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$$.apply(this, arguments); } +var GatewayNoneIcon = (({ + styles = {}, + ...props +}) => /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("svg", _extends$$({ + xmlns: "http://www.w3.org/2000/svg", + width: "32", + height: "32" +}, props), /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("path", { + d: "M.373 15.084a1.316 1.316 0 00.002 1.834l14.71 14.709a1.313 1.313 0 001.833 0l14.711-14.711a1.316 1.316 0 00-.002-1.834L16.917.373a1.313 1.313 0 00-1.833 0L.373 15.084zm1.806.918L16 2.182l13.821 13.82L16 29.823 2.179 16.003z" +}))); + +function _extends$_() { _extends$_ = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$_.apply(this, arguments); } +var GatewayOrIcon = (({ + styles = {}, + ...props +}) => /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("svg", _extends$_({ + xmlns: "http://www.w3.org/2000/svg", + width: "32", + height: "32" +}, props), /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("path", { + d: "M16.001 0a1.29 1.29 0 00-.917.373L.373 15.084a1.316 1.316 0 00.002 1.834l14.71 14.709a1.313 1.313 0 001.833 0l14.711-14.711a1.316 1.316 0 00-.002-1.834L16.917.372A1.294 1.294 0 0016.002 0zM16 2.181l13.821 13.821L16 29.823 2.179 16.003 16 2.18zm0 6.379a7.447 7.447 0 00-7.44 7.441A7.447 7.447 0 0016 23.443 7.447 7.447 0 0023.443 16a7.447 7.447 0 00-7.441-7.441zm0 .825a6.61 6.61 0 016.617 6.616A6.61 6.61 0 0116 22.618 6.61 6.61 0 019.385 16 6.61 6.61 0 0116 9.385z" +}))); + +function _extends$Z() { _extends$Z = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$Z.apply(this, arguments); } +var GatewayParallelIcon = (({ + styles = {}, + ...props +}) => /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("svg", _extends$Z({ + xmlns: "http://www.w3.org/2000/svg", + width: "32", + height: "32" +}, props), /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("path", { + d: "M16.001 0a1.29 1.29 0 00-.917.373L.373 15.084a1.316 1.316 0 00.002 1.834l14.71 14.709a1.313 1.313 0 001.833 0l14.711-14.711a1.316 1.316 0 00-.002-1.834L16.917.372A1.294 1.294 0 0016.002 0zM16 2.181l13.821 13.821L16 29.823 2.179 16.003 16 2.18zm-.377 5.708l-.168.032-.136.092-.096.14-.032.168v6.868h-6.87l-.002-.002-.166.037-.137.092v-.002l-.095.141-.033.167v.753s.032.169.034.17l.094.138.138.092.167.036h6.87v6.867l-.001-.001.033.17.095.138.138.092s.166.035.167.037h.752l.17-.036.137-.092.095-.137.033-.17v-6.867h6.868l.17-.035.137-.092.095-.137.033-.17v-.753s-.033-.165-.032-.167l-.096-.14-.138-.093s-.17-.037-.17-.035H16.81V8.323l-.033-.168-.094-.14-.138-.092-.17-.034h-.752z" +}))); + +function _extends$Y() { _extends$Y = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$Y.apply(this, arguments); } +var GatewayXorIcon = (({ + styles = {}, + ...props +}) => /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("svg", _extends$Y({ + xmlns: "http://www.w3.org/2000/svg", + width: "32", + height: "32" +}, props), /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("path", { + d: "M16 0a1.29 1.29 0 00-.918.373L.371 15.084a1.316 1.316 0 00.002 1.834l14.71 14.709a1.313 1.313 0 001.833 0l14.711-14.711a1.316 1.316 0 00-.002-1.834L16.915.372A1.294 1.294 0 0016 0zm-.002 2.181l13.821 13.821-13.821 13.821-13.821-13.82L15.998 2.18zm-5.162 7.69l-.166.032-.141.096-.532.532s-.097.142-.097.144l-.03.164.032.162.093.144 4.857 4.858-4.855 4.855v-.001L9.9 21l-.03.164.032.162s.093.142.093.144l.531.532.146.095.162.032.164-.03.144-.097 4.855-4.856 4.857 4.857.145.095.162.032.164-.03.144-.097.531-.532.095-.14.033-.168-.033-.162-.095-.146L17.144 16 22 11.144l.095-.14.033-.166-.033-.163-.097-.144-.532-.532-.14-.095-.163-.032-.166.032-.141.095L16 14.855l-4.858-4.858v-.002l-.144-.092-.162-.032z" +}))); + +function _extends$X() { _extends$X = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$X.apply(this, arguments); } +var GroupIcon = (({ + styles = {}, + ...props +}) => /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("svg", _extends$X({ + xmlns: "http://www.w3.org/2000/svg", + width: "32", + height: "32" +}, props), /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("path", { + d: "M6.34.016c-2.333.025-4.684 1.77-5.29 4.17C.608 5.848.88 7.608.804 9.314v2.922h2.041c.038-2.332-.076-4.673.062-7C3.14 3.355 4.869 1.938 6.643 2.04h8.956V.009c-3.086 0-6.173-.02-9.258 0v.007zm13.094 2.023h1.92V.009h-1.92v2.03zm5.756 0c1.265-.069 2.66.045 3.602 1.055 1.036.983 1.201 2.523 1.122 3.91v6.313h2.078c-.03-2.677.062-5.36-.047-8.032-.17-2.743-2.62-5.111-5.215-5.236-.511-.064-1.027-.02-1.54-.033v2.023zM.803 18.319h2.041v-2.026H.804v2.026zm29.11 1.084h2.08v-2.03h-2.08v2.03zM.804 26.148c.004 2.218 1.393 4.366 3.313 5.28 1.728.853 3.681.448 5.521.544.43-.112 1.29.231 1.435-.183v-1.847c-1.788-.043-3.584.094-5.365-.082-1.67-.354-2.919-2.048-2.863-3.844v-3.644H.804v3.777zm29.11-.068c.04 1.961-1.508 3.787-3.381 3.842-1.954.06-3.914.02-5.87.026v2.03c2.118-.042 4.242.08 6.355-.063 2.524-.264 4.818-2.644 4.94-5.323.08-1.039.014-2.085.035-3.126h-2.078v2.613zm-15.006 5.898h1.92v-2.03h-1.92v2.03z" +}))); + +function _extends$W() { _extends$W = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$W.apply(this, arguments); } +var IntermediateEventCatchCancelIcon = (({ + styles = {}, + ...props +}) => /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("svg", _extends$W({ + xmlns: "http://www.w3.org/2000/svg", + width: "32", + height: "32" +}, props), /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("path", { + d: "M15.975.049C8.195-.111.935 6.286.125 14.03c-.855 6.55 2.741 13.46 8.74 16.314 5.666 2.847 13.012 1.99 17.71-2.33 4.745-4.162 6.727-11.243 4.532-17.206C29.09 4.93 23.445.454 17.201.095c-.408-.03-.817-.046-1.226-.046zm-.181 1.724c7.134-.269 13.84 5.68 14.399 12.804.686 6.283-3.267 12.792-9.283 14.862-5.847 2.162-13.025.06-16.557-5.141C.728 19.22.872 11.725 4.985 6.962c2.632-3.171 6.671-5.174 10.809-5.19zm.283 1.553c-6.6-.21-12.671 5.585-12.79 12.185-.292 5.964 4.129 11.817 10.034 12.953 5.47 1.198 11.584-1.613 14.025-6.702 2.525-4.97 1.396-11.585-2.912-15.215-2.282-2.022-5.3-3.217-8.357-3.22zM16 5.021c5.818-.154 11.117 5.082 11.024 10.905.103 5.384-4.23 10.5-9.636 11.043-5.075.667-10.426-2.587-11.885-7.552-1.53-4.73.48-10.428 4.888-12.864A11.082 11.082 0 0116 5.021zm-3.956 3.946l-3.096 3.097 3.985 3.985-3.913 3.913 3.047 3.048 3.913-3.913 3.988 3.987 3.097-3.096L19.076 16l3.914-3.913-3.048-3.048-3.913 3.913-3.986-3.985zm-.002 1.222l3.988 3.987 3.913-3.913 1.826 1.826-3.913 3.913 3.985 3.986-1.873 1.873-3.985-3.985-3.913 3.913-1.827-1.827 3.914-3.913-3.988-3.987 1.873-1.873z" +}))); + +function _extends$V() { _extends$V = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$V.apply(this, arguments); } +var IntermediateEventCatchCompensationIcon = (({ + styles = {}, + ...props +}) => /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("svg", _extends$V({ + xmlns: "http://www.w3.org/2000/svg", + width: "32", + height: "32" +}, props), /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("path", { + d: "M15.975.049C8.195-.11.935 6.286.125 14.03c-.855 6.55 2.741 13.46 8.74 16.314 5.666 2.847 13.012 1.99 17.71-2.33 4.745-4.162 6.727-11.243 4.532-17.206C29.09 4.93 23.445.453 17.201.095c-.408-.03-.817-.046-1.226-.046zm-.181 1.724c7.134-.269 13.84 5.68 14.399 12.804.686 6.283-3.267 12.792-9.283 14.862-5.847 2.162-13.025.06-16.557-5.141C.728 19.22.872 11.725 4.985 6.962c2.632-3.171 6.671-5.174 10.809-5.19zm.283 1.553c-6.6-.21-12.671 5.585-12.79 12.185-.292 5.964 4.129 11.817 10.034 12.953 5.47 1.198 11.584-1.613 14.025-6.702 2.525-4.97 1.396-11.585-2.912-15.216-2.282-2.021-5.3-3.216-8.357-3.22zM16 5.021c5.818-.154 11.117 5.082 11.024 10.905.103 5.384-4.23 10.5-9.636 11.043-5.075.667-10.426-2.587-11.885-7.552-1.53-4.73.48-10.428 4.888-12.864A11.083 11.083 0 0116 5.021zm-.56 5.772l-7.408 5.231 7.409 5.234v-5.057c2.385 1.687 4.771 3.371 7.157 5.057V10.793l-7.157 5.055v-5.055zm-.865 1.665v7.125l-5.048-3.562 5.048-3.563zm7.161 0v7.132l-5.048-3.566 5.048-3.566z" +}))); + +function _extends$U() { _extends$U = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$U.apply(this, arguments); } +var IntermediateEventCatchConditionIcon = (({ + styles = {}, + ...props +}) => /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("svg", _extends$U({ + xmlns: "http://www.w3.org/2000/svg", + width: "32", + height: "32" +}, props), /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("path", { + d: "M15.97.04h-.127C8.713-.018 2.003 5.334.437 12.286c-1.51 6.123.98 13.005 6.136 16.665 5.125 3.788 12.546 4.105 17.912.623 5.272-3.276 8.33-9.766 7.325-15.916-.904-6.241-5.79-11.7-11.95-13.143A16.082 16.082 0 0015.97.04zm-.181 1.724c.115 0 .23 0 .347.003 6.625-.066 12.823 5.149 13.89 11.69 1.13 5.91-1.908 12.349-7.262 15.138-5.473 3.013-12.866 1.884-17.116-2.726C1.291 21.372.444 13.914 3.802 8.602c2.493-4.112 7.169-6.819 11.987-6.838zm.283 1.554c-.117 0-.234.002-.351.005-6.1 0-11.691 5.049-12.346 11.114-.78 5.684 2.795 11.612 8.218 13.52 5.139 1.943 11.416.101 14.624-4.38 3.461-4.583 3.262-11.538-.596-15.831-2.36-2.747-5.924-4.423-9.549-4.428zm-.078 1.695c.078 0 .156 0 .234.003 5.4 0 10.321 4.556 10.734 9.942.563 5.13-2.958 10.364-7.971 11.678-4.832 1.41-10.457-.935-12.746-5.446-2.463-4.559-1.2-10.795 3.014-13.883a11.072 11.072 0 016.735-2.294zm-5.352 4.266V22.761h10.716V9.279H10.642zm.863.866h8.987v11.75h-8.987v-11.75zm.927 1.323v.862h7.133v-.862h-7.133zm0 2.602v.866h7.133v-.866h-7.133zm0 3.008v.862h7.133v-.862h-7.133zm0 2.717v.863h7.133v-.863h-7.133z" +}))); + +function _extends$T() { _extends$T = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$T.apply(this, arguments); } +var IntermediateEventCatchErrorIcon = (({ + styles = {}, + ...props +}) => /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("svg", _extends$T({ + xmlns: "http://www.w3.org/2000/svg", + width: "32", + height: "32" +}, props), /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("path", { + d: "M15.975.049C8.195-.11.935 6.286.125 14.03c-.855 6.55 2.741 13.46 8.74 16.314 5.666 2.847 13.012 1.99 17.71-2.33 4.745-4.162 6.727-11.243 4.532-17.206C29.09 4.93 23.445.453 17.201.095c-.408-.03-.817-.046-1.226-.046zm-.181 1.724c7.134-.269 13.84 5.68 14.399 12.804.686 6.283-3.267 12.792-9.283 14.862-5.847 2.162-13.025.06-16.557-5.141C.728 19.22.872 11.725 4.985 6.962c2.632-3.171 6.671-5.174 10.809-5.19zm.283 1.553c-6.6-.21-12.671 5.585-12.79 12.185-.292 5.964 4.129 11.817 10.034 12.953 5.47 1.198 11.584-1.613 14.025-6.702 2.525-4.97 1.396-11.585-2.912-15.216-2.282-2.021-5.3-3.216-8.357-3.22zM16 5.021c5.818-.154 11.117 5.082 11.024 10.905.103 5.384-4.23 10.5-9.636 11.043-5.075.667-10.426-2.587-11.885-7.552-1.53-4.73.48-10.428 4.888-12.864A11.083 11.083 0 0116 5.021zm6.132 4.194c-1.21 2.455-2.422 4.91-3.633 7.364l-4.516-5.875-4.103 12.133 4.6-5.912c1.58 1.81 3.162 3.619 4.744 5.429L22.13 9.215zM14.383 13.1l4.295 5.445 1.073-2.387-1.027 4.131-4.384-5.157-1.778 2.75 1.821-4.782z" +}))); + +function _extends$S() { _extends$S = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$S.apply(this, arguments); } +var IntermediateEventCatchEscalationIcon = (({ + styles = {}, + ...props +}) => /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("svg", _extends$S({ + xmlns: "http://www.w3.org/2000/svg", + width: "32", + height: "32" +}, props), /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("path", { + d: "M15.975.049C8.195-.11.935 6.286.125 14.03c-.855 6.55 2.741 13.46 8.74 16.314 5.666 2.847 13.012 1.99 17.71-2.33 4.745-4.162 6.727-11.243 4.532-17.206C29.09 4.93 23.445.453 17.201.095c-.408-.03-.817-.046-1.226-.046zm-.181 1.724c7.134-.269 13.84 5.68 14.399 12.804.686 6.283-3.267 12.792-9.283 14.862-5.847 2.162-13.025.06-16.557-5.141C.728 19.22.872 11.725 4.985 6.962c2.632-3.171 6.671-5.174 10.809-5.19zm.283 1.553c-6.6-.21-12.671 5.585-12.79 12.185-.292 5.964 4.129 11.817 10.034 12.953 5.47 1.198 11.584-1.613 14.025-6.702 2.525-4.97 1.396-11.585-2.912-15.216-2.282-2.021-5.3-3.216-8.357-3.22zM16 5.021c5.818-.154 11.117 5.082 11.024 10.905.103 5.384-4.23 10.5-9.636 11.043-5.075.667-10.426-2.587-11.885-7.552-1.53-4.73.48-10.428 4.888-12.864A11.083 11.083 0 0116 5.021zm.006 3.927c-1.672 4.654-2.734 9.502-4.406 14.155 1.534-1.525 2.872-3.234 4.406-4.759l4.406 4.76c-1.496-4.71-2.91-9.446-4.406-14.156zm.032 2.929c.822 2.586 1.598 5.186 2.42 7.771l-2.42-2.612c-.682.597-2.452 2.884-2.338 2.388.87-2.487 1.447-5.067 2.338-7.547z" +}))); + +function _extends$R() { _extends$R = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$R.apply(this, arguments); } +var IntermediateEventCatchLinkIcon = (({ + styles = {}, + ...props +}) => /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("svg", _extends$R({ + xmlns: "http://www.w3.org/2000/svg", + width: "32", + height: "32" +}, props), /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("path", { + d: "M15.975.049C8.195-.11.935 6.286.125 14.03c-.855 6.55 2.741 13.46 8.74 16.314 5.666 2.847 13.012 1.99 17.71-2.33 4.745-4.162 6.727-11.243 4.532-17.206C29.09 4.93 23.445.453 17.201.095c-.408-.03-.817-.046-1.226-.046zm-.181 1.724c7.134-.269 13.84 5.68 14.399 12.804.686 6.283-3.267 12.792-9.283 14.862-5.847 2.162-13.025.06-16.557-5.141C.728 19.22.872 11.725 4.985 6.962c2.632-3.171 6.671-5.174 10.809-5.19zm.283 1.553c-6.6-.21-12.671 5.585-12.79 12.185-.292 5.964 4.129 11.817 10.034 12.953 5.47 1.198 11.584-1.613 14.025-6.702 2.525-4.97 1.396-11.585-2.912-15.216-2.282-2.021-5.3-3.216-8.357-3.22zM16 5.021c5.818-.154 11.117 5.082 11.024 10.905.103 5.384-4.23 10.5-9.636 11.043-5.075.667-10.426-2.587-11.885-7.552-1.53-4.73.48-10.428 4.888-12.864A11.083 11.083 0 0116 5.021zm1.78 4.093v3.555H9.785v6.714h7.994v3.554l5.829-6.911-5.83-6.912zm.974 2.584l3.61 4.295-3.61 4.294v-1.933h-7.88v-4.688h7.88v-1.968z" +}))); + +function _extends$Q() { _extends$Q = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$Q.apply(this, arguments); } +var IntermediateEventCatchMessageIcon = (({ + styles = {}, + ...props +}) => /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("svg", _extends$Q({ + xmlns: "http://www.w3.org/2000/svg", + width: "32", + height: "32" +}, props), /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("path", { + d: "M15.975.049C8.195-.11.935 6.286.125 14.03c-.855 6.55 2.741 13.46 8.74 16.314 5.666 2.847 13.012 1.99 17.71-2.33 4.745-4.162 6.727-11.243 4.532-17.206C29.09 4.93 23.445.453 17.201.095c-.408-.03-.817-.046-1.226-.046zm-.181 1.724c7.134-.269 13.84 5.68 14.399 12.804.686 6.283-3.267 12.792-9.283 14.862-5.847 2.162-13.025.06-16.557-5.141C.728 19.22.872 11.725 4.985 6.962c2.632-3.171 6.671-5.174 10.809-5.19zm.283 1.553c-6.6-.21-12.671 5.585-12.79 12.185-.292 5.964 4.129 11.817 10.034 12.953 5.47 1.198 11.584-1.613 14.025-6.702 2.525-4.97 1.396-11.585-2.912-15.216-2.282-2.021-5.3-3.216-8.357-3.22zM16 5.021c5.818-.154 11.117 5.082 11.024 10.905.103 5.384-4.23 10.5-9.636 11.043-5.075.667-10.426-2.587-11.885-7.552-1.53-4.73.48-10.428 4.888-12.864A11.083 11.083 0 0116 5.021zm-7.245 5.475v11.06h14.502v-11.06H8.754zm3.222 1.728h8.057c-1.427.878-2.854 2.806-4.281 3.016l-3.776-3.016zm9.554 1.017v6.587H10.48V13.24l5.524 4.414 5.526-4.414z" +}))); + +function _extends$P() { _extends$P = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$P.apply(this, arguments); } +var IntermediateEventCatchMultipleIcon = (({ + styles = {}, + ...props +}) => /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("svg", _extends$P({ + xmlns: "http://www.w3.org/2000/svg", + width: "32", + height: "32" +}, props), /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("path", { + d: "M15.975.003C8.195-.156.935 6.24.125 13.985c-.855 6.55 2.741 13.46 8.74 16.314 5.666 2.847 13.012 1.99 17.71-2.33 4.745-4.162 6.727-11.243 4.532-17.206C29.09 4.884 23.445.407 17.201.049c-.408-.03-.817-.046-1.226-.046zm-.181 1.724c7.134-.269 13.84 5.68 14.399 12.804.686 6.283-3.267 12.792-9.283 14.862-5.847 2.162-13.025.06-16.557-5.141C.728 19.174.872 11.679 4.985 6.916c2.632-3.171 6.671-5.174 10.809-5.19zm.283 1.553c-6.6-.21-12.671 5.585-12.79 12.185-.292 5.964 4.129 11.817 10.034 12.953 5.47 1.198 11.584-1.613 14.025-6.702 2.525-4.97 1.396-11.585-2.912-15.216-2.282-2.021-5.3-3.216-8.357-3.22zM16 4.975c5.818-.154 11.117 5.082 11.024 10.905.103 5.384-4.23 10.5-9.636 11.043-5.075.667-10.426-2.587-11.885-7.552-1.53-4.73.48-10.428 4.888-12.864A11.083 11.083 0 0116 4.975zm.006 3.073l-7.62 5.531 2.91 8.95h9.42l2.91-8.95-7.62-5.53zm0 1.067l6.604 4.794-2.523 7.757h-8.162l-2.522-7.757 6.603-4.794z" +}))); + +function _extends$O() { _extends$O = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$O.apply(this, arguments); } +var IntermediateEventCatchNonInterruptingConditionIcon = (({ + styles = {}, + ...props +}) => /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("svg", _extends$O({ + xmlns: "http://www.w3.org/2000/svg", + width: "32", + height: "32" +}, props), /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("path", { + d: "M10.638 9.563V23.056h10.724V9.563H10.638zm.863.866h8.995v11.76H11.5V10.43zm.928 1.324v.862h7.139v-.862h-7.14zm0 2.605v.866h7.139v-.866h-7.14zm0 3.01v.863h7.139v-.863h-7.14zm0 2.72v.863h7.139v-.864h-7.14zM15.999.308h-.004l-.188.001h-.011l-.188.004h-.011L15.41.32h-.011l-.187.008h-.005L15.2.33l-.187.01h-.005l-.005.001-.187.013h-.011L14.62.37h-.01l-.186.018h-.011l-.185.02-.005.001h-.006l-.185.022-.005.001h-.005l-.185.025h-.005l-.005.001-.185.027h-.005l-.005.001-.184.029h-.005l-.005.001-.183.031-.006.001-.005.001-.182.033-.006.001-.005.001-.182.035-.005.001-.005.001-.182.038h-.005l-.005.002-.181.04h-.005l-.005.002-.18.042-.006.001-.005.001-.18.044-.005.002h-.005l-.17.045-.152.054-.139.082-.121.106-.1.127-.074.143-.046.155-.017.16.013.16.043.156.07.145.097.13.119.108.137.085.15.058.159.03.16-.001.133-.023.165-.043.168-.041.171-.04.171-.037.172-.036.17-.033.173-.03.17-.03.177-.027.171-.025.175-.022.175-.02.175-.02.176-.016.175-.014.177-.012.176-.01.177-.007.174-.006.177-.003.178-.001h.177l.178.004.174.006.177.007.176.01.177.012.175.014.176.017.175.018.175.02.175.023.171.025.176.027.17.03.174.03.17.033.171.036.154.033.16.02.161-.01.156-.04.146-.069.131-.094.111-.117.087-.135.061-.15.032-.158.002-.16-.027-.16-.057-.15L20 1.023l-.108-.12-.128-.097-.145-.073-.128-.038-.158-.035-.005-.001-.005-.001L19.14.62h-.005l-.005-.002-.182-.035h-.006L18.938.58l-.182-.033h-.006l-.005-.002-.183-.03-.005-.001-.006-.001-.183-.029h-.005l-.006-.001-.184-.027h-.005l-.005-.001-.185-.024h-.005L17.968.43 17.783.41l-.006-.001h-.005l-.185-.02h-.006l-.005-.001L17.39.37h-.005L17.38.368l-.187-.015h-.005l-.005-.001-.187-.013h-.011L16.8.328h-.011L16.6.32h-.011l-.187-.006h-.011L16.204.31h-.011L16.005.31H16zm9.016 2.935l-.16.004-.158.033-.15.062-.134.09-.116.111-.093.132-.067.147-.038.156-.01.161.022.16.05.153.078.141.103.124.102.087.045.034.142.106.137.105.14.11.136.11.135.112.134.115.134.117.13.115.132.122.128.12.127.122.126.125.124.126.124.128.121.13.118.128.118.132.117.133.113.134.113.136.11.136.109.137.109.142.104.14.103.14.101.142.1.144.099.146.095.145.094.147.093.15.092.15.087.149.087.15.084.152.084.155.08.152.08.155.04.081.084.138.11.119.128.096.145.072.155.043.16.013.16-.016.155-.046.144-.074.127-.099.106-.12.083-.14.055-.151.026-.16-.004-.16-.034-.158-.05-.124-.042-.085-.002-.004-.003-.005-.084-.165-.002-.004-.003-.005-.086-.164-.002-.004-.003-.005-.088-.162-.002-.005-.003-.005-.09-.161-.002-.005-.003-.004-.092-.16-.003-.005-.002-.005-.094-.16-.003-.004-.003-.004-.096-.159-.002-.004-.003-.005-.098-.157-.003-.004-.003-.005-.1-.156-.003-.004-.003-.005-.101-.154-.003-.005-.003-.004-.104-.154-.003-.004-.003-.005-.106-.152-.003-.005-.003-.004-.108-.151-.003-.004-.003-.005-.11-.15-.003-.004-.003-.004-.111-.15-.004-.003-.003-.005-.113-.147-.004-.004-.003-.005-.115-.146-.004-.004-.003-.004-.117-.145-.004-.004-.003-.004-.12-.144-.003-.004-.003-.004-.121-.142-.004-.004-.003-.004-.123-.141-.003-.004-.004-.004-.125-.14-.003-.004-.004-.004-.127-.138-.003-.004-.004-.004-.128-.136-.004-.004-.004-.004-.13-.135-.004-.004-.004-.004-.132-.134-.003-.004-.004-.003-.134-.133-.004-.003-.004-.004-.135-.13-.004-.004-.004-.004-.136-.128-.004-.004-.004-.004-.138-.126-.004-.004-.004-.003-.14-.125-.004-.004-.004-.003-.14-.123-.005-.004-.004-.003-.142-.121-.004-.004-.004-.003-.144-.12-.004-.003-.004-.003-.145-.117-.004-.004-.004-.003-.147-.115-.004-.004-.004-.003-.148-.113-.004-.003-.004-.004-.149-.111-.004-.003-.004-.004-.05-.036-.14-.083-.15-.055-.16-.027zm-18.381.344l-.161.008-.157.037-.147.066-.111.074-.04.032-.005.003-.004.004-.145.117-.004.003-.004.004-.144.119-.004.003-.004.004-.142.12-.004.004-.004.004-.141.123-.004.003-.004.004-.14.125-.004.003-.004.004-.138.126-.004.004-.004.004-.136.128-.004.004-.004.004-.135.13-.004.004-.004.003-.134.133-.004.003L4.682 5l-.132.134-.003.004-.004.004-.13.135-.004.004-.004.004-.128.136-.004.004-.004.004-.126.138-.004.004-.003.004-.125.14-.004.004-.003.004-.123.14-.004.005-.003.004-.121.142-.004.004-.003.004-.12.144-.003.004-.003.004-.117.145-.004.004-.003.004-.115.146-.004.005-.003.004-.113.147-.003.005-.004.004-.111.149-.003.004-.004.004-.11.15-.002.005-.003.004-.108.151-.003.004-.003.005-.106.152-.003.005-.003.004-.104.154-.003.004-.003.005-.102.154-.003.005-.002.004-.1.156-.003.005-.003.004-.098.157-.003.005-.003.004-.096.159-.002.004-.003.005-.094.16-.003.004-.002.004-.092.16-.003.005-.003.005-.09.161-.002.005-.003.005-.088.162-.002.005-.003.004-.086.164-.002.005-.002.004-.084.165-.003.005-.002.004-.082.166-.002.004-.003.005-.08.167-.002.004-.002.005-.078.168-.002.004-.002.005-.045.1-.053.153-.023.16.007.16.037.157.065.148.092.132.114.114.134.09.148.064.157.035.161.006.16-.025.152-.054.14-.08.121-.106.1-.126.065-.118.043-.095.074-.16.075-.155.077-.157.08-.155.08-.152.083-.155.085-.152.086-.15.088-.149.091-.15.094-.15.094-.147.095-.145.099-.146.1-.144.1-.142.104-.14.104-.14.11-.142.107-.137.11-.136.114-.136.113-.134.117-.133.118-.132.117-.129.122-.13.124-.127.123-.126.127-.125.127-.122.128-.12.132-.122.13-.115.133-.117.135-.115.135-.111.136-.11.037-.03.117-.11.094-.132.068-.146.04-.156.01-.161-.02-.16-.05-.154-.076-.141-.102-.125-.123-.104-.14-.08-.153-.051-.16-.023zM16 3.595h-.005l-.148.001h-.01l-.147.003h-.011l-.147.005h-.011l-.146.007h-.011l-.146.009h-.011l-.146.01h-.005l-.005.001-.146.012h-.011l-.145.014h-.006l-.005.001-.05.006-.158.031-.15.06-.135.088-.117.111-.094.13-.069.147-.04.156-.01.16.019.16.049.154.076.142.102.125.123.105.14.08.152.051.16.023.134-.003.045-.005.135-.013.133-.01.136-.01.135-.007.137-.006.136-.004.136-.003h.274l.136.003.136.004.136.006.136.007.136.01.133.01.135.013.135.014.135.016.134.018.132.018.134.021.133.023.133.024.133.025.13.027.132.03.132.03.129.031.13.034.129.035.129.036.13.04.126.038.128.042.126.042.128.045.127.047.126.047.12.048.127.051.123.052.006.002.147.048.16.021.16-.009.157-.038.147-.067.131-.093.112-.116.089-.135.062-.149.033-.158.004-.16-.027-.16-.055-.151-.083-.139-.107-.12-.127-.099-.118-.063-.004-.001-.005-.003-.005-.002-.133-.056-.005-.002-.005-.002-.134-.054-.004-.002-.005-.002-.135-.053-.005-.002-.005-.002-.135-.051-.005-.002-.005-.002-.135-.05-.005-.001-.005-.002-.137-.048-.005-.001-.005-.002-.137-.046-.005-.002-.005-.002-.137-.044-.005-.002-.005-.001-.138-.043-.006-.002-.005-.001-.138-.042-.005-.001-.005-.002-.14-.04H19.4l-.005-.002-.14-.038-.005-.001-.005-.002-.14-.036-.005-.001-.005-.001-.141-.035-.005-.001-.005-.001-.142-.033-.005-.001-.005-.001-.142-.031-.005-.002h-.005l-.142-.03-.005-.001-.005-.001-.143-.028h-.005l-.005-.002-.143-.025-.006-.001-.005-.001-.143-.024-.005-.001-.006-.001-.143-.022-.006-.001h-.005l-.144-.022h-.005l-.006-.001-.144-.019h-.005l-.006-.001-.144-.017h-.006l-.005-.001-.145-.016h-.011l-.145-.014H17.1l-.005-.001-.146-.012h-.01l-.146-.01-.006-.001h-.005l-.146-.009h-.011l-.147-.006h-.01L16.32 3.6h-.011l-.147-.003h-.011l-.147-.001H16zm-5.482 1.366l-.16.008-.157.037-.123.053-.06.032-.005.002-.004.003-.128.069-.004.002-.005.003-.126.07-.005.003-.004.002-.126.072-.005.003-.004.003-.125.073-.004.003-.005.003-.124.075-.004.003-.005.002-.123.077-.004.003-.005.003-.122.078-.004.003-.005.003-.121.08-.004.002-.005.003-.12.082-.005.003-.004.003-.12.083-.004.003-.004.003-.118.084-.005.003-.004.003-.118.086-.004.003-.004.003-.117.088-.004.003-.004.003-.116.089-.004.003-.004.004-.114.09-.005.003-.004.003-.113.092-.004.004-.004.003-.113.093-.004.004-.004.003-.111.095-.005.003-.004.004-.11.096-.004.004-.004.003-.11.098-.003.003-.004.004-.108.1-.004.003-.004.003-.107.101-.004.004-.004.003-.106.102-.004.004-.003.004-.105.103-.004.004-.004.004-.103.105-.004.004-.004.003-.102.106-.003.004-.004.004-.1.107-.004.004-.004.004-.099.108-.004.004-.003.004-.098.11-.003.003-.004.004-.096.11-.004.005-.003.004-.095.111-.003.004-.004.004-.093.113-.003.004-.004.004-.092.113-.003.004-.003.005-.09.114-.004.004-.003.004-.089.116-.003.004-.003.004-.088.117-.003.004-.003.004-.086.118-.003.004-.003.005-.084.118-.003.004-.003.005-.083.12-.003.003-.003.005-.082.12-.003.005-.002.004-.068.103-.076.142-.048.154-.018.16.011.161.041.156.07.146.095.13.117.11.136.086.15.06.158.03.162.002.158-.03.15-.057.138-.085.119-.109.082-.105.065-.099.075-.11.077-.113.077-.107.08-.11.08-.108.084-.108.083-.105.086-.106.086-.104.088-.104.089-.101.09-.102.093-.101.093-.099.094-.097.095-.096.098-.097.098-.095.099-.093.1-.092.103-.091.101-.089.104-.088.104-.086.106-.086.106-.083.106-.082.109-.082.108-.079.11-.078.11-.076.112-.076.112-.074.113-.072.113-.071.115-.07.115-.068.118-.067.117-.065.12-.065.054-.029.135-.088.116-.111.094-.132.068-.146.04-.156.009-.161-.02-.16-.05-.153-.078-.142-.102-.125-.123-.103-.141-.079-.153-.051-.16-.022zm13.91 2.116l-.162.008-.157.037-.147.066-.132.092-.113.116-.09.134-.063.148-.034.157-.005.162.025.159.055.152.082.138.086.103.09.09.094.098.092.099.093.1.091.103.089.101.088.104.086.104.086.106.083.105.083.108.08.108.081.11.077.107.077.112.075.111.075.114.072.113.071.113.07.114.068.118.067.115.065.118.064.117.062.117.061.121.059.119.059.122.056.121.054.12.055.125.051.123.051.125.048.123.048.127.047.126.044.125.043.128.042.129.039.126.038.13.022.076.058.15.085.137.11.119.129.096.145.07.155.043.16.013.161-.017.154-.046.144-.075.126-.1.106-.12.082-.14.055-.151.025-.16-.005-.16-.026-.132-.023-.082-.002-.005-.001-.005-.042-.139-.001-.005-.002-.005-.043-.138-.001-.005-.002-.005-.044-.137-.002-.005-.002-.005-.046-.137-.002-.005-.001-.005-.048-.137-.002-.005-.002-.005-.05-.135-.001-.005-.002-.005-.051-.135-.002-.005-.002-.005-.053-.135-.002-.005-.002-.005-.054-.133-.002-.005-.002-.005-.057-.133-.002-.005-.002-.005-.057-.132-.003-.005-.002-.005-.06-.132-.001-.005-.002-.004-.061-.132-.003-.004-.002-.005-.063-.13-.002-.005-.002-.005-.064-.13-.003-.004-.002-.005-.066-.129-.002-.004-.003-.005-.067-.128-.002-.005-.003-.004-.069-.128-.002-.004-.003-.005-.07-.126-.003-.005-.003-.004-.072-.126-.002-.005-.003-.004-.074-.125-.002-.004-.003-.005-.075-.124-.003-.004-.003-.005-.076-.123-.003-.004-.003-.005-.078-.122-.003-.004-.003-.005-.08-.121-.003-.004-.003-.005-.081-.12-.003-.005-.003-.004-.083-.12-.003-.004-.003-.004-.084-.118-.003-.005-.003-.004-.086-.118-.003-.004-.004-.004-.087-.117-.003-.004-.003-.004-.09-.116-.002-.004-.004-.004-.09-.114-.003-.005-.004-.004-.091-.113-.004-.004-.003-.004-.094-.113-.003-.004-.003-.004-.095-.111-.004-.004-.003-.004-.096-.11-.004-.005-.003-.004-.098-.11-.004-.003-.003-.004-.1-.108-.003-.004-.004-.004-.1-.107-.004-.004-.004-.004-.102-.106-.003-.003-.004-.004-.093-.095-.124-.103-.14-.08-.153-.05-.16-.023zM4.45 13.135l-.161.002-.158.032-.15.06-.135.088-.118.11-.094.131-.069.146-.035.129-.026.132v.005l-.002.005-.025.143-.001.005-.001.006-.024.143-.001.005-.001.006-.022.143-.001.006-.001.005-.02.144-.001.005-.001.005-.019.145v.005l-.001.006-.017.144v.006l-.001.005-.016.145v.011l-.014.145v.005l-.001.006-.012.146v.01l-.01.146-.001.006v.005l-.009.146v.011l-.007.146v.011l-.004.147v.011l-.003.147v.01l-.002.148v.01l.001.148v.01l.003.147v.011l.005.147v.01l.007.147v.011l.009.146v.011l.01.146v.01l.013.146v.011l.014.145v.005l.001.006.016.145v.011l.018.144v.006l.001.005.019.144v.006l.001.005.021.144v.005l.002.006.022.143v.006l.002.005.024.143v.005l.002.006.025.143.001.005.001.005.028.143.001.005.001.005.03.142v.005l.002.006.03.141.002.005.001.005.033.142v.005l.002.005.035.14v.006l.002.005.036.14.002.005.001.005.038.14.001.005.002.005.04.14v.005l.002.005.042.138.001.006.002.005.042.138.002.005.002.005.017.054.064.148.09.134.114.114.132.092.148.065.157.037.16.007.16-.023.153-.052.14-.08.123-.104.102-.125.076-.142.049-.153.02-.16-.011-.161-.031-.13-.017-.051-.039-.126-.038-.13-.037-.128-.035-.13-.033-.128-.033-.134-.03-.13-.029-.131-.026-.13-.026-.133-.024-.133-.023-.133-.02-.132-.02-.136-.017-.132-.016-.135-.014-.135-.012-.133-.012-.138-.009-.133-.007-.136-.006-.138-.004-.134-.003-.136v-.274l.003-.136.004-.134.006-.139.007-.136.01-.133.01-.138.013-.132.014-.135.016-.135.017-.132.02-.137.02-.13.023-.134.024-.133.024-.126.016-.16-.014-.161-.044-.155-.072-.145-.098-.128-.12-.108-.137-.084-.15-.057-.16-.029zm26.698 1.601l-.161.01-.157.04-.146.067-.131.093-.112.117-.088.135-.061.149-.033.157-.005.134.006.14.006.176.003.177.001.178-.001.177-.003.178-.006.177-.007.176-.01.177-.012.176-.015.176-.016.173-.018.175-.02.175-.024.174-.025.175-.026.17-.03.174-.03.173-.033.17-.036.172-.037.17-.04.17-.042.172-.043.168-.045.166-.048.169-.05.167-.052.168-.053.164-.056.166-.058.166-.06.16-.062.165-.062.158-.066.165-.068.16-.07.16-.07.158-.075.159-.074.155-.079.158-.08.158-.06.15-.03.158-.001.161.029.159.058.15.085.137.108.119.13.097.144.07.156.044.16.013.16-.017.155-.046.143-.074.127-.1.107-.12.07-.115.083-.164.003-.005.002-.004.082-.166.002-.005.003-.004.08-.167.002-.005.002-.004.078-.168.002-.005.002-.004.076-.169.002-.004.002-.005.074-.17.002-.004.002-.005.072-.17.002-.005.002-.005.07-.171.001-.005.002-.005.068-.172.002-.004.002-.005.065-.173.002-.005.002-.005.063-.173.002-.005.002-.005.06-.174.003-.005.001-.005.06-.175.001-.005.002-.005.057-.176.001-.005.002-.005.055-.177.001-.005.002-.005.052-.177.002-.005.001-.005.051-.178.001-.005.002-.005.048-.179.002-.005v-.005l.047-.179.001-.005.002-.005.044-.18v-.005l.002-.005.042-.18.001-.006.001-.005.04-.181.001-.005.001-.005.037-.182.002-.005v-.005l.036-.182v-.006l.002-.005.033-.182v-.006l.002-.005.03-.183.001-.005.001-.005.029-.184v-.005l.001-.006.027-.184v-.005l.001-.005.024-.185v-.005l.001-.005.022-.185v-.006l.001-.005.02-.185v-.006l.001-.005.017-.186v-.005l.001-.005.015-.187v-.005l.001-.005.013-.187v-.01l.01-.187.001-.006v-.005l.009-.187v-.011l.006-.187V16.7l.004-.188v-.011l.001-.188v-.01l-.001-.188v-.011l-.004-.188v-.011l-.006-.187v-.011l-.007-.145-.022-.16-.05-.152-.08-.141-.103-.124-.125-.102-.141-.077-.153-.05-.16-.02zm-30.21.572l-.161.001-.158.032-.15.06-.136.087-.117.11-.095.131-.068.146-.04.156-.012.133-.001.14v.01l.001.188v.011l.004.188v.011l.006.187v.011l.008.187v.011l.011.187v.005l.001.005.013.187v.01l.016.187v.01l.018.186v.011l.02.185.001.005v.006l.022.185.001.005v.005l.025.185v.005l.001.005.027.184v.006l.001.005.029.184v.005l.001.005.031.183.001.005.001.006.033.182.001.005.001.006.035.182.001.005.001.005.038.182v.005l.002.005.04.181v.005l.002.005.042.18.001.006.001.005.044.18.002.005v.005l.047.18.001.004.002.005.048.179.002.005.001.005.05.178.002.005.001.005.053.177.002.005.001.005.055.177.002.005.001.005.057.176.002.005.001.005.06.175.001.005.002.005.061.174.002.005.002.005.063.173.002.005.002.005.065.173.002.005.002.004.067.172.002.005.002.005.07.171.002.005.002.005.072.17.002.005.002.004.074.17.002.005.002.004.076.169.002.004.002.005.078.168.002.004.002.005.08.167.003.004.002.005.082.166.002.004.003.005.02.04.086.136.11.118.13.095.146.07.156.041.16.012.16-.019.155-.048.142-.075.126-.1.105-.123.08-.14.054-.152.024-.16-.006-.16-.036-.158-.051-.123-.018-.034-.078-.158-.074-.155-.074-.16-.071-.157-.07-.16-.068-.16-.067-.165-.062-.158-.062-.164-.059-.161-.058-.166-.056-.166-.053-.164-.052-.168-.05-.167-.048-.17-.045-.165-.043-.168-.043-.172-.039-.17-.037-.17-.036-.172-.033-.17-.03-.173-.03-.174-.027-.17-.025-.175-.022-.174-.021-.175-.018-.175-.017-.173-.014-.176-.012-.176-.01-.177-.007-.176-.006-.177-.003-.178-.001-.177v-.134l-.013-.16-.044-.156-.072-.144-.097-.129-.12-.108-.137-.085-.15-.057-.159-.028zm26.798 2.024l-.16.007-.157.038-.148.066-.132.092-.113.115-.09.134-.062.148-.03.127-.001.004-.023.134-.024.133-.026.133-.026.13-.03.132-.03.129-.032.134-.033.128-.035.13-.037.128-.038.13-.04.126-.04.128-.044.128-.044.126-.046.126-.048.126-.05.125-.05.125-.051.122-.054.123-.055.122-.056.12-.058.122-.06.12-.061.12-.063.119-.062.116-.067.119-.066.116-.069.115-.069.115-.07.113-.073.113-.074.112-.076.113-.077.112-.077.107-.08.11-.08.107-.085.11-.044.056-.088.135-.06.15-.033.158-.002.16.027.16.057.15.083.138.108.12.128.098.144.072.155.045.16.015.161-.016.155-.044.144-.073.128-.098.09-.099.05-.061.003-.004.003-.005.089-.115.003-.004.003-.005.088-.116.003-.004.003-.005.086-.117.003-.004.003-.005.084-.118.003-.004.003-.005.083-.12.003-.004.003-.004.081-.12.003-.005.003-.004.08-.121.003-.005.003-.004.078-.122.003-.005.003-.004.077-.123.002-.005.003-.004.075-.124.003-.005.003-.004.073-.125.003-.005.003-.004.072-.126.002-.004.003-.005.07-.126.003-.005.002-.005.07-.127.002-.004.002-.005.068-.128.002-.005.002-.004.066-.13.003-.004.002-.005.064-.13.002-.004.003-.005.062-.13.002-.005.003-.005.06-.13.003-.005.002-.005.06-.132.002-.005.002-.005.057-.132.003-.005.002-.005.056-.133.002-.005.002-.005.054-.134.002-.004.002-.005.053-.135.002-.005.002-.005.051-.135.002-.005.002-.005.05-.135.001-.005.002-.005.048-.137.001-.005.002-.005.046-.137.002-.005.002-.005.044-.137.002-.005.002-.005.042-.138.002-.005.001-.006.042-.138.001-.005.002-.005.04-.14v-.005l.002-.005.038-.14.001-.005.002-.005.036-.14.001-.005.001-.005.035-.141.001-.005.001-.005.033-.142.001-.005.001-.005.031-.141.001-.006.002-.005.029-.142v-.005l.002-.005.028-.143v-.005l.002-.005.025-.143.001-.006.001-.005.024-.143.001-.005.001-.006.001-.006.01-.161-.02-.16-.05-.154-.077-.141-.102-.125-.123-.104-.141-.079-.153-.051-.16-.022zM6.841 23.019l-.16.024-.152.053-.14.08-.122.105-.101.126-.076.142-.048.154-.018.16.011.161.041.156.07.146.077.109.04.048.003.004.003.004.095.111.003.004.004.004.096.11.004.005.003.004.098.109.003.004.004.004.1.108.003.004.003.004.101.107.004.004.003.004.102.105.004.004.004.004.103.105.004.004.004.003.105.104.003.004.004.003.106.102.004.004.004.004.107.1.004.004.004.004.108.099.004.003.004.004.11.098.003.003.004.004.11.096.004.003.005.004.11.095.005.003.004.004.113.093.004.003.004.004.113.091.004.004.005.003.114.09.004.004.004.003.116.089.004.003.004.003.117.088.004.003.004.003.118.086.004.003.005.003.118.084.004.003.005.003.119.083.004.003.005.003.12.081.005.003.004.003.121.08.005.003.004.003.122.078.005.003.004.003.123.076.005.003.004.003.124.075.005.003.004.003.125.073.004.003.005.002.126.073.004.002.005.003.126.07.005.003.004.002.128.07.004.002.005.002.128.067.005.003.004.002.13.066.004.002.005.003.13.064.004.002.005.003.13.062.005.002.004.003.132.06.004.003.005.002.132.06.005.002.005.002.132.057.005.002.005.002.133.057.005.002.005.002.133.054.005.002.005.002.13.05.154.045.16.016.16-.015.156-.045.144-.072.128-.098.108-.12.083-.138.057-.15.028-.16-.003-.16-.032-.159-.061-.149-.088-.135-.11-.117-.132-.094-.12-.058-.124-.049-.126-.051-.122-.051-.122-.054-.12-.054-.126-.058-.119-.057-.12-.06-.12-.06-.118-.063-.117-.064-.119-.066-.116-.066-.115-.068-.115-.07-.113-.07-.115-.074-.112-.074-.11-.075-.11-.076-.112-.08-.11-.08-.109-.081-.106-.082-.104-.082-.106-.086-.105-.087-.101-.086-.105-.091-.1-.09-.1-.091-.1-.094-.097-.094-.1-.098-.093-.095-.096-.1-.093-.098-.092-.101-.089-.1-.09-.102-.088-.104-.036-.043-.114-.114-.133-.091-.148-.065-.157-.036-.161-.006zm15.063 2.701l-.16.014-.156.044-.12.057-.06.034-.12.066-.117.064-.118.062-.12.061-.12.06-.118.057-.126.058-.12.054-.122.054-.122.05-.126.052-.125.05-.124.046-.127.047-.125.044-.129.043-.126.04-.13.042-.128.038-.127.035-.13.036-.131.034-.129.031-.132.03-.13.03-.135.027-.133.026-.13.023-.13.022-.137.021-.132.02-.134.017-.132.015-.138.015-.135.013-.133.01-.138.01-.136.007-.134.006-.136.004-.14.003-.16.018-.155.047-.142.076-.127.1-.105.122-.08.14-.054.151-.025.16.006.16.035.158.064.148.09.134.114.114.133.092.147.065.157.036.134.008.145-.002h.011l.147-.005h.01l.147-.007h.011l.146-.009h.011l.146-.01h.005l.005-.001.146-.012h.011l.145-.014h.005l.006-.001.145-.016h.011l.144-.018h.006l.005-.001.144-.02h.011l.144-.021.005-.001h.006l.143-.023.006-.001h.005l.143-.025h.005l.006-.002.143-.026h.005l.005-.002.143-.027.005-.001.005-.001.142-.03h.005l.005-.002.142-.03.005-.002.005-.001.142-.033.005-.001.005-.001.14-.035.006-.001.005-.001.14-.037h.005l.005-.002.14-.038.005-.002h.005l.14-.04.005-.002.005-.001.138-.042.005-.001.006-.002.138-.043.005-.001.005-.002.137-.044.005-.002.005-.002.137-.046.005-.002.005-.001.137-.048.005-.002.005-.002.135-.05.005-.001.005-.002.135-.051.005-.002.005-.002.135-.053.005-.002.004-.002.134-.054.005-.002.005-.002.133-.057.005-.002.005-.002.132-.057.005-.003.005-.002.132-.06.005-.001.004-.002.131-.061.005-.003.005-.002.13-.062.005-.003.005-.002.13-.064.004-.003.005-.002.128-.066.005-.002.005-.003.128-.067.005-.002.004-.003.127-.069.005-.002.005-.003.126-.07.005-.003.004-.003.065-.037.132-.093.112-.115.089-.135.062-.149.034-.157.003-.161-.026-.16-.055-.15-.082-.14-.107-.12-.127-.1-.144-.073-.154-.046-.16-.016zM6.33 27.127l-.16.023-.152.053-.14.08-.122.105-.101.126-.076.142-.048.154-.02.16.012.161.041.156.07.146.094.13.096.093.032.026.004.003.004.004.145.117.004.003.004.004.146.115.005.003.004.004.147.113.005.003.004.004.149.111.004.003.004.003.15.11.005.003.004.003.151.108.004.003.005.003.152.106.005.003.004.003.154.104.004.003.005.003.154.102.005.002.004.003.156.1.005.003.004.003.157.098.005.003.004.002.159.096.004.003.005.003.16.094.004.003.004.002.16.092.005.003.005.002.161.09.005.003.005.002.162.088.005.003.004.002.164.086.005.003.004.002.165.084.005.003.004.002.166.082.004.002.005.003.167.08.004.002.005.002.168.078.004.002.005.002.168.076.005.002.005.002.17.074.004.002.005.002.17.072.005.002.005.002.17.07.006.002.005.001.171.068.005.002.005.002.173.065.005.002.005.002.173.063.005.002.005.002.174.06.005.003.005.001.175.06.005.001.005.002.176.057.005.001.005.002.176.055.006.001.005.002.177.052.005.002.005.001.178.05.005.002.005.002.178.048.006.001.005.002.179.046.005.001.005.002.18.044h.005l.005.002.18.042.006.001.005.001.159.035.16.02.16-.01.157-.04.146-.069.13-.094.112-.117.087-.136.06-.149.033-.158.002-.161-.028-.159-.057-.15-.084-.138-.108-.12-.128-.098-.144-.072-.128-.039-.154-.033-.168-.04-.171-.041-.17-.044-.168-.046-.167-.047-.168-.05-.165-.051-.166-.054-.166-.056-.163-.057-.165-.06-.161-.062-.164-.064-.16-.065-.16-.068-.162-.07-.157-.07-.157-.074-.157-.075-.156-.077-.153-.079-.156-.082-.153-.082-.154-.086-.15-.086-.152-.09-.148-.09-.147-.092-.149-.095-.145-.095-.144-.098-.145-.1-.143-.102-.14-.103-.14-.104-.14-.108-.139-.11-.136-.11-.027-.022-.133-.091-.148-.065-.157-.036-.161-.006zm19.215.087l-.16.01-.157.039-.146.067-.11.076-.064.051-.139.11-.14.108-.14.104-.14.103-.143.101-.145.101-.144.098-.145.095-.149.095-.148.093-.147.089-.152.09-.15.086-.154.086-.153.082-.156.082-.153.079-.156.077-.157.075-.158.073-.157.071-.16.07-.16.068-.161.065-.164.064-.161.061-.165.06-.163.058-.166.056-.166.054-.166.051-.167.05-.167.047-.17.046-.168.044-.171.042-.168.039-.17.037-.11.023-.154.047-.143.075-.126.1-.106.122-.081.139-.054.152-.025.16.006.16.035.158.063.148.09.133.114.115.132.092.148.065.157.037.16.007.133-.016.115-.024.005-.001.005-.001.181-.04h.005l.005-.002.18-.042.006-.001.005-.001.18-.044.005-.002.005-.001.18-.046.004-.002h.005l.179-.05h.005l.005-.002.178-.05.005-.002.005-.002.177-.052.005-.002.005-.001.177-.055.005-.002.005-.001.176-.057.005-.002.005-.002.175-.059.005-.001.005-.002.174-.061.005-.002.005-.002.173-.063.005-.002.005-.002.173-.065.004-.002.005-.002.172-.068.005-.002.005-.002.171-.07.005-.001.005-.002.17-.072.005-.002.004-.002.17-.074.005-.002.004-.002.169-.076.004-.002.005-.002.168-.078.004-.002.005-.003.167-.08.004-.002.005-.002.166-.082.004-.002.005-.003.165-.084.004-.002.005-.003.163-.086.005-.002.005-.003.162-.088.005-.002.005-.003.161-.09.005-.002.004-.003.16-.092.005-.003.005-.002.16-.094.004-.003.004-.003.158-.096.005-.002.004-.003.158-.098.004-.003.005-.003.156-.1.004-.003.004-.003.155-.101.005-.003.004-.003.154-.104.004-.003.004-.003.153-.106.004-.003.005-.003.151-.108.004-.003.005-.003.15-.11.004-.003.004-.003.149-.112.004-.003.004-.003.148-.113.004-.004.004-.003.147-.115.004-.004.004-.003.068-.055.116-.113.092-.132.066-.147.038-.157.008-.16-.022-.16-.05-.153-.08-.14-.103-.125-.124-.102-.142-.077-.153-.05-.16-.02z" +}))); + +function _extends$N() { _extends$N = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$N.apply(this, arguments); } +var IntermediateEventCatchNonInterruptingEscalationIcon = (({ + styles = {}, + ...props +}) => /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("svg", _extends$N({ + xmlns: "http://www.w3.org/2000/svg", + width: "32", + height: "32" +}, props), /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("path", { + d: "M16.012 9.222c-1.673 4.657-2.735 9.508-4.409 14.164 1.536-1.526 2.874-3.236 4.41-4.762l4.408 4.762c-1.497-4.712-2.911-9.451-4.409-14.164zm.032 2.93c.823 2.588 1.599 5.19 2.421 7.777l-2.42-2.614c-.683.598-2.454 2.886-2.34 2.39.871-2.489 1.448-5.07 2.34-7.552zM16.012.312c-1.448.02-2.93.157-4.302.628-.852.447-.255 1.863.66 1.574 2.255-.608 4.648-.607 6.922-.108.934.075 1.228-1.376.338-1.67C18.451.44 17.227.317 16.012.311zm9.012 2.934c-.913-.104-1.272 1.258-.454 1.648 1.834 1.36 3.293 3.185 4.31 5.22.526.776 1.842.098 1.515-.78a15.522 15.522 0 00-5.06-6.006c-.1-.044-.203-.07-.31-.082zM6.65 3.59c-.762.089-1.24.809-1.805 1.267C3.38 6.295 2.163 8.007 1.37 9.905c-.266.898 1.094 1.484 1.564.675a14.825 14.825 0 014.327-5.56c.476-.515.09-1.419-.612-1.431zm9.362.007c-.698.066-1.689-.16-2.033.635-.282.733.535 1.358 1.217 1.125 1.806-.147 3.63.203 5.293.907.902.255 1.472-1.112.656-1.573-1.6-.735-3.374-1.089-5.133-1.094zm-5.479 1.365c-.835.15-1.517.76-2.21 1.226-1.203.94-2.318 2.061-3.057 3.402-.33.904 1.063 1.552 1.547.723 1.045-1.656 2.596-2.925 4.285-3.873.545-.499.171-1.463-.565-1.478zm13.903 2.115c-.875-.07-1.22 1.173-.501 1.627 1.325 1.34 2.188 3.062 2.748 4.84.468.84 1.869.21 1.557-.699-.604-2.118-1.751-4.097-3.351-5.615a.93.93 0 00-.453-.153zM4.467 13.132c-.822-.07-.996.826-1.046 1.455-.256 1.93-.094 3.933.562 5.769.406.844 1.807.365 1.612-.551a11.498 11.498 0 01-.334-5.808.874.874 0 00-.794-.865zm26.687 1.6c-.746-.037-1.014.785-.879 1.395.043 2.393-.57 4.771-1.66 6.894-.31.884 1.02 1.536 1.53.75a15.632 15.632 0 001.821-8.372.876.876 0 00-.812-.667zm-30.197.571c-.782-.073-1.044.775-.933 1.404.068 2.414.661 4.833 1.809 6.962.534.77 1.842.076 1.505-.798a14.833 14.833 0 01-1.603-6.861.876.876 0 00-.778-.707zm26.787 2.024c-.777-.048-.952.797-1.021 1.392-.354 1.692-1.202 3.231-2.216 4.608-.407.872.925 1.638 1.48.852 1.361-1.733 2.296-3.827 2.582-6.017a.874.874 0 00-.825-.835zM6.857 23.012c-.808.018-1.082 1.122-.47 1.59 1.393 1.607 3.187 2.886 5.194 3.599.91.222 1.43-1.165.598-1.596a11.495 11.495 0 01-4.723-3.396.899.899 0 00-.599-.197zm15.057 2.7c-.81.194-1.504.76-2.325.972-1.203.458-2.5.536-3.758.664-.869.307-.573 1.728.346 1.663 2.201-.034 4.412-.626 6.293-1.778.604-.495.227-1.532-.556-1.521zM6.346 27.118c-.833.008-1.11 1.218-.395 1.617 1.986 1.602 4.358 2.749 6.868 3.226.933.076 1.227-1.376.338-1.67a14.838 14.838 0 01-6.345-3.066.929.929 0 00-.466-.107zm19.208.087c-.766.09-1.241.841-1.922 1.158-1.516.991-3.251 1.58-4.996 2.005-.872.405-.346 1.849.584 1.604 2.543-.526 4.98-1.66 6.963-3.344.47-.52.072-1.42-.63-1.423z" +}))); + +function _extends$M() { _extends$M = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$M.apply(this, arguments); } +var IntermediateEventCatchNonInterruptingMessageIcon = (({ + styles = {}, + ...props +}) => /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("svg", _extends$M({ + xmlns: "http://www.w3.org/2000/svg", + width: "32", + height: "32" +}, props), /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("path", { + d: "M8.742 10.464v11.072h14.516V10.464H8.742zm3.224 1.73h8.066a69569 69569 0 00-4.034 3.22l-4.032-3.22zm9.565 1.018v6.594H10.469v-6.593L16 17.63l5.532-4.419zM16 0h-.005l-.188.001h-.011l-.188.004h-.011l-.187.006h-.011l-.187.008h-.005L15.2.02l-.187.01h-.005l-.005.001-.187.013h-.011L14.62.06h-.01l-.186.018h-.011l-.185.02-.005.001h-.006l-.185.022-.005.001h-.005l-.185.025h-.005l-.005.001-.185.027h-.005l-.005.001-.184.029h-.005l-.005.001-.183.031-.006.001-.005.001-.182.033-.006.001-.005.001-.182.035-.005.001-.005.001-.182.038h-.005l-.005.002-.181.04h-.005l-.005.002-.18.042-.006.001-.005.001-.18.044-.005.002h-.005l-.17.045-.152.054-.139.082-.121.106-.1.127-.074.143-.046.155-.017.16.013.16.043.156.07.145.097.13.119.108.137.085.15.058.159.03.16-.001.133-.023.165-.043.168-.041.171-.04.171-.037.172-.036.17-.033.173-.03.17-.03.177-.027.171-.025.175-.022.175-.02.175-.02.176-.016.175-.014.177-.012.176-.01.177-.007.174-.006.177-.003L16 1.73h.177l.178.004.174.006.177.007.176.01.177.012.175.014.176.017.175.018.175.02.175.023.171.025.176.027.17.03.174.03.17.033.171.036.154.033.16.02.161-.01.156-.04.146-.069.131-.094.111-.117.087-.135.061-.15.032-.158.002-.16-.027-.16-.057-.15L20 .714l-.108-.12-.128-.097-.145-.073-.128-.038-.158-.035-.005-.001-.005-.001L19.14.31h-.005l-.005-.002-.182-.035h-.006l-.005-.002-.182-.033h-.006l-.005-.002-.183-.03-.005-.001-.006-.001-.183-.029h-.005l-.006-.001-.184-.027h-.005l-.005-.001-.185-.024h-.005L17.968.12 17.783.1l-.006-.001h-.005l-.185-.02h-.006l-.005-.001L17.39.06h-.005L17.38.06l-.187-.015h-.005l-.005-.001-.187-.013h-.011L16.8.02h-.011L16.6.01h-.011l-.187-.006h-.011L16.204 0h-.011L16.005 0H16zm9.015 2.935l-.16.004-.158.033-.15.062-.134.09-.116.111-.093.132-.067.147-.038.156-.01.161.022.16.05.153.078.141.103.124.102.087.045.034.142.106.137.105.14.11.136.11.135.112.134.115.134.117.13.115.132.122.128.12.127.122.126.125.124.126.124.128.121.13.118.128.118.132.117.133.113.134.113.136.11.136.109.137.109.142.104.14.103.14.101.142.1.144.099.146.095.145.094.147.093.15.092.15.087.149.087.15.084.152.084.155.08.152.08.155.04.081.084.138.11.119.128.096.145.072.155.043.16.013.16-.016.155-.046.144-.074.127-.099.106-.12.083-.14.055-.151.026-.16-.004-.16-.034-.158-.05-.124-.042-.085-.002-.004-.003-.005-.084-.165-.002-.004-.003-.005-.086-.164-.002-.004-.003-.005-.088-.162-.002-.005-.003-.005-.09-.161-.002-.005-.003-.004-.092-.16-.003-.005-.002-.005-.094-.16-.003-.004-.003-.004-.096-.159-.002-.004-.003-.005-.098-.157-.003-.004-.003-.005-.1-.156-.003-.004-.003-.005-.101-.154-.003-.005-.003-.004-.104-.154-.003-.004-.003-.005-.106-.152-.003-.005-.003-.004-.108-.151-.003-.004-.003-.005-.11-.15-.003-.004-.003-.004-.111-.15-.004-.003-.003-.005-.113-.147-.004-.004-.003-.005-.115-.146-.004-.004-.003-.004-.117-.145-.004-.004-.003-.004-.12-.144-.003-.004-.003-.004-.121-.142-.004-.004-.003-.004-.123-.141-.003-.004-.004-.004-.125-.14-.003-.004-.004-.004-.127-.138-.003-.004-.004-.004-.128-.136-.004-.004-.004-.004-.13-.135-.004-.004-.004-.004-.132-.134-.003-.004-.004-.003-.134-.133-.004-.003-.004-.004-.135-.13-.004-.004-.004-.004-.136-.128-.004-.004-.004-.004-.138-.126-.004-.004-.004-.003-.14-.125-.004-.004-.004-.003-.14-.123-.005-.004-.004-.003-.142-.121-.004-.004-.004-.003-.144-.12-.004-.003-.004-.003-.145-.117-.004-.004-.004-.003-.147-.115-.004-.004-.004-.003-.148-.113-.004-.003-.004-.004-.149-.111-.004-.003-.004-.004-.05-.036-.14-.083-.15-.055-.16-.027zM6.634 3.28l-.161.008-.157.037-.147.066-.111.074-.04.032-.005.003-.004.004-.145.117-.004.003-.004.004-.144.119-.004.003-.004.004-.142.12-.004.004-.004.004-.141.123-.004.003-.004.004-.14.125-.004.003-.004.004-.138.126-.004.004-.004.004-.136.128-.004.004-.004.004-.135.13-.004.004-.004.003-.134.133-.004.003-.004.004-.132.134-.003.004-.004.004-.13.135-.004.004-.004.004-.128.136-.004.004-.004.004-.126.138-.004.004-.003.004-.125.14-.004.004-.003.004-.123.14-.004.005-.003.004-.121.142-.004.004-.003.004-.12.144-.003.004-.003.004-.117.145-.004.004-.003.004-.115.146-.004.005-.003.004-.113.147-.003.005-.004.004-.111.149-.003.004-.004.004-.11.15-.002.005-.003.004-.108.151-.003.004-.003.005-.106.152-.003.005-.003.004-.104.154-.003.004-.003.005-.102.154-.003.005-.002.004-.1.156-.003.005-.003.004-.098.157-.003.005-.003.004-.096.159-.002.004-.003.005-.094.16-.003.004-.002.004-.092.16-.003.005-.003.005-.09.161-.002.005-.003.005-.088.162-.002.005-.003.004-.086.164-.002.005-.002.004-.084.165-.003.005-.002.004-.082.166-.002.004-.003.005-.08.167-.002.004-.002.005-.078.168-.002.004-.002.005-.045.1-.053.153-.023.16.007.16.037.157.065.148.092.132.114.114.134.09.148.064.157.035.161.006.16-.025.152-.054.14-.08.121-.106.1-.126.065-.118.043-.095.074-.16.075-.155.077-.157.08-.155.08-.152.083-.155.085-.152.086-.15.088-.149.091-.15.094-.15.094-.147.095-.145.099-.146.1-.144.1-.142.104-.14.104-.14.11-.142.107-.137.11-.136.114-.136.113-.134.117-.133.118-.132.117-.129.122-.13.124-.127.123-.126.127-.125.127-.122.128-.12.132-.122.13-.115.133-.117.135-.115.135-.111.136-.11.037-.03.117-.11.094-.132.068-.146.04-.156.01-.161-.02-.16-.05-.154-.076-.141-.102-.125-.123-.104-.14-.08-.153-.051-.16-.023zM16 3.286h-.005l-.148.001h-.01l-.147.003h-.011l-.147.005h-.011l-.146.007h-.011l-.146.009h-.011l-.146.01h-.005l-.005.001-.146.012h-.011l-.145.014h-.006l-.005.001-.05.006-.158.031-.15.06-.135.088-.117.111-.094.13-.069.147-.04.156-.01.16.019.16.049.154.076.142.102.125.123.105.14.08.152.051.16.023.134-.003.045-.005.135-.013.133-.01.136-.01.135-.007.137-.006.136-.004.136-.003h.274l.136.003.136.004.136.006.136.007.136.01.133.01.135.013.135.014.135.016.134.018.132.018.134.021.133.023.133.024.133.025.13.027.132.03.132.03.129.031.13.034.129.035.129.036.13.04.126.038.128.042.126.042.128.045.127.047.126.047.12.048.127.051.123.052.006.002.147.048.16.021.16-.009.157-.038.147-.067.131-.093.112-.116.089-.135.062-.149.033-.158.004-.16-.027-.16-.055-.151-.083-.139-.107-.12-.127-.099-.118-.063-.004-.001-.005-.003-.005-.002-.133-.056-.005-.002-.005-.002-.134-.054-.004-.002-.005-.002-.135-.053-.005-.002-.005-.002-.135-.051-.005-.002-.005-.002-.135-.05-.005-.001-.005-.002-.137-.048-.005-.001-.005-.002-.137-.046-.005-.002-.005-.002-.137-.044-.005-.002-.005-.001-.138-.043-.006-.002-.005-.001-.138-.042-.005-.001-.005-.002-.14-.04H19.4l-.005-.002-.14-.038-.005-.001-.005-.002-.14-.036-.005-.001-.005-.001-.141-.035-.005-.001-.005-.001-.142-.033-.005-.001-.005-.001-.142-.031-.005-.002h-.005l-.142-.03-.005-.001-.005-.001-.143-.028h-.005l-.005-.002-.143-.025-.006-.001-.005-.001-.143-.024-.005-.001-.006-.001-.143-.022-.006-.001h-.005l-.144-.022h-.005l-.006-.001-.144-.019h-.005l-.006-.001-.144-.017h-.006l-.005-.001-.145-.016h-.011l-.145-.014H17.1l-.005-.001-.146-.012h-.01l-.146-.01-.006-.001h-.005l-.146-.009h-.011l-.147-.006h-.01l-.147-.005h-.011l-.147-.003h-.011l-.147-.001H16zm-5.482 1.366l-.16.008-.157.037-.123.053-.06.032-.005.002-.004.003-.128.069-.004.002-.005.003-.126.07-.005.003-.004.002-.126.072-.005.003-.004.003-.125.073-.004.003-.005.003-.124.075-.004.003-.005.002-.123.077-.004.003-.005.003-.122.078-.004.003-.005.003-.121.08-.004.002-.005.003-.12.082-.005.003-.004.003-.12.083-.004.003-.004.003-.118.084-.005.003-.004.003-.118.086-.004.003-.004.003-.117.088-.004.003-.004.003-.116.089-.004.003-.004.004-.114.09-.005.003-.004.003-.113.092-.004.004-.004.003-.113.093-.004.004-.004.003-.111.095-.005.003-.004.004-.11.096-.004.004-.004.003-.11.098-.003.003-.004.004-.108.1-.004.003-.004.003-.107.101-.004.004-.004.003-.106.102-.004.004-.003.004-.105.103-.004.004-.004.004-.103.105-.004.004-.004.003-.102.106-.003.004-.004.004-.1.107-.004.004-.004.004-.099.108-.004.004-.003.004-.098.11-.003.003-.004.004-.096.11-.004.005-.003.004-.095.111-.003.004-.004.004-.093.113-.003.004-.004.004-.092.113-.003.004-.003.005-.09.114-.004.004-.003.004-.089.116-.003.004-.003.004-.088.117-.003.004-.003.004-.086.118-.003.004-.003.005-.084.118-.003.004-.003.005-.083.12-.003.003-.003.005-.082.12-.003.005-.002.004-.068.103-.076.142-.048.154-.018.16.011.161.041.156.07.146.095.13.117.11.136.086.15.06.158.03.162.002.158-.03.15-.057.138-.085.119-.109.082-.105.065-.099.075-.11.077-.113.077-.107.08-.11.08-.108.084-.108.083-.105.086-.106.086-.104.088-.104.089-.101.09-.102.093-.101.093-.099.094-.097.095-.096.098-.097.098-.095.099-.093.1-.092.103-.091.101-.089.104-.088.104-.086.106-.086.106-.083.106-.082.109-.082.108-.079.11-.078.11-.076.112-.076.112-.074.113-.072.113-.071.115-.07.115-.068.118-.067.117-.065.12-.065.054-.029.135-.088.116-.111.094-.132.068-.146.04-.156.009-.161-.02-.16-.05-.153-.078-.142-.102-.125-.123-.103-.141-.079-.153-.051-.16-.022zm13.91 2.116l-.162.008-.157.037-.147.066-.132.092-.113.116-.09.134-.063.148-.034.157-.005.162.025.159.055.152.082.138.086.103.09.09.094.098.092.099.093.1.091.103.089.101.088.104.086.104.086.106.083.105.083.108.08.108.081.11.077.107.077.112.075.111.075.114.072.113.071.113.07.114.068.118.067.115.065.118.064.117.062.117.061.121.059.119.059.122.056.121.054.12.055.125.051.123.051.125.048.123.048.127.047.126.044.125.043.128.042.129.039.126.038.13.022.076.058.15.085.137.11.119.129.096.145.07.155.043.16.013.161-.017.154-.046.144-.075.126-.1.106-.12.082-.14.055-.151.025-.16-.005-.16-.026-.132-.023-.082-.002-.005-.001-.005-.042-.139-.001-.005-.002-.005-.043-.138-.001-.005-.002-.005-.044-.137-.002-.005-.002-.005-.046-.137-.002-.005-.001-.005-.048-.137-.002-.005-.002-.005-.05-.135-.001-.005-.002-.005-.051-.135-.002-.005-.002-.005-.053-.135-.002-.005-.002-.005-.054-.133-.002-.005-.002-.005-.057-.133-.002-.005-.002-.005-.057-.132-.003-.005-.002-.005-.06-.132-.001-.005-.002-.004-.061-.132-.003-.004-.002-.005-.063-.13-.002-.005-.002-.005-.064-.13-.003-.004-.002-.005-.066-.129-.002-.004-.003-.005-.067-.128-.002-.005-.003-.004-.069-.128-.002-.004-.003-.005-.07-.126-.003-.005-.003-.004-.072-.126-.002-.005-.003-.004-.074-.125-.002-.004-.003-.005-.075-.124-.003-.004-.003-.005-.076-.123-.003-.004-.003-.005-.078-.122-.003-.004-.003-.005-.08-.121-.003-.004-.003-.005-.081-.12-.003-.005-.003-.004-.083-.12-.003-.004-.003-.004-.084-.118-.003-.005-.003-.004-.086-.118-.003-.004-.004-.004-.087-.117-.003-.004-.003-.004-.09-.116-.002-.004-.004-.004-.09-.114-.003-.005-.004-.004-.091-.113-.004-.004-.003-.004-.094-.113-.003-.004-.003-.004-.095-.111-.004-.004-.003-.004-.096-.11-.004-.005-.003-.004-.098-.11-.004-.003-.003-.004-.1-.108-.003-.004-.004-.004-.1-.107-.004-.004-.004-.004-.102-.106-.003-.003-.004-.004-.093-.095-.124-.103-.14-.08-.153-.05-.16-.023zM4.45 12.826l-.161.002-.158.032-.15.06-.135.088-.118.11-.094.131-.069.146-.035.129-.026.132v.005l-.002.005-.025.143-.001.005-.001.006-.024.143-.001.005-.001.006-.022.143-.001.006-.001.005-.02.144-.001.005-.001.005-.019.145v.005l-.001.006-.017.144v.006l-.001.005-.016.145v.011l-.014.145v.005l-.001.006-.012.146v.01l-.01.146-.001.006v.005l-.009.146v.011l-.007.146v.011l-.004.147v.011l-.003.147v.01l-.002.148v.01l.001.148v.01l.003.147v.011l.005.147v.01l.007.147v.011l.009.146v.011l.01.146v.01l.013.146v.011l.014.145v.005l.001.006.016.145v.011l.018.144v.006l.001.005.019.144v.006l.001.005.021.144v.005l.002.006.022.143v.006l.002.005.024.143v.005l.002.006.025.143.001.005.001.005.028.143.001.005.001.005.03.142v.005l.002.006.03.141.002.005.001.005.033.142v.005l.002.005.035.14v.006l.002.005.036.14.002.005.001.005.038.14.001.005.002.005.04.14v.005l.002.005.042.138.001.006.002.005.042.138.002.005.002.005.017.054.064.148.09.134.114.114.132.092.148.065.157.037.16.007.16-.023.153-.052.14-.08.123-.104.102-.125.076-.142.049-.153.02-.16-.011-.161-.031-.13-.017-.051-.039-.126-.038-.13-.037-.128-.035-.13-.033-.128-.033-.134-.03-.13-.029-.131-.026-.13-.026-.133-.024-.133-.023-.133-.02-.132-.02-.136-.017-.132-.016-.135-.014-.135-.012-.133-.012-.138-.009-.133-.007-.136-.006-.138-.004-.134-.003-.136v-.274l.003-.136.004-.134.006-.139.007-.136.01-.133.01-.138.013-.132.014-.135.016-.135.017-.132.02-.137.02-.13.023-.134.024-.133.024-.126.016-.16-.014-.161-.044-.155-.072-.145-.098-.128-.12-.108-.137-.084-.15-.057-.16-.029zm26.698 1.601l-.161.01-.157.04-.146.067-.131.093-.112.117-.088.135-.061.149-.033.157-.005.134.006.14.006.176.003.177.001.178-.001.177-.003.178-.006.177-.007.176-.01.177-.012.176-.015.176-.016.173-.018.175-.02.175-.024.174-.025.175-.026.17-.03.174-.03.173-.033.17-.036.172-.037.17-.04.17-.042.172-.043.168-.045.166-.048.169-.05.167-.052.168-.053.164-.056.166-.058.166-.06.16-.062.165-.062.158-.066.165-.068.16-.07.16-.07.158-.075.159-.074.155-.079.158-.08.158-.06.15-.03.158-.001.161.029.159.058.15.085.137.108.119.13.097.144.07.156.044.16.013.16-.017.155-.046.143-.074.127-.1.107-.12.07-.115.083-.164.003-.005.002-.004.082-.166.002-.005.003-.004.08-.167.002-.005.002-.004.078-.168.002-.005.002-.004.076-.169.002-.004.002-.005.074-.17.002-.004.002-.005.072-.17.002-.005.002-.005.07-.171.001-.005.002-.005.068-.172.002-.004.002-.005.065-.173.002-.005.002-.005.063-.173.002-.005.002-.005.06-.174.003-.005.001-.005.06-.175.001-.005.002-.005.057-.176.001-.005.002-.005.055-.177.001-.005.002-.005.052-.177.002-.005.001-.005.051-.178.001-.005.002-.005.048-.179.002-.005v-.005l.047-.179.001-.005.002-.005.044-.18v-.005l.002-.005.042-.18.001-.006.001-.005.04-.181.001-.005.001-.005.037-.182.002-.005v-.005l.036-.182v-.006l.002-.005.033-.182v-.006l.002-.005.03-.183.001-.005.001-.005.029-.184v-.005l.001-.006.027-.184v-.005l.001-.005.024-.185v-.005l.001-.005.022-.185v-.006l.001-.005.02-.185v-.006l.001-.005.017-.186v-.005l.001-.005.015-.187v-.005l.001-.005.013-.187v-.01l.01-.187.001-.006v-.005l.009-.187v-.011l.006-.187v-.011l.004-.188v-.011l.001-.188v-.01l-.001-.188v-.011l-.004-.188v-.011l-.006-.187v-.011l-.007-.145-.022-.16-.05-.152-.08-.141-.103-.124-.125-.102-.141-.077-.153-.05-.16-.02zM.938 15L.777 15l-.158.032-.15.06-.136.087-.117.11-.095.131-.068.146-.04.156-.012.133-.001.14v.01l.001.188v.011l.004.188v.011l.006.187v.011l.008.187v.011l.011.187v.005l.001.005.013.187v.01l.016.187v.01l.018.186v.011l.02.185.001.005v.006l.022.185.001.005v.005l.025.185v.005l.001.005.027.184v.006l.001.005.029.184v.005l.001.005.031.183.001.005.001.006.033.182.001.005.001.006.035.182.001.005.001.005.038.182v.005l.002.005.04.181v.005l.002.005.042.18.001.006.001.005.044.18.002.005v.005l.047.18.001.004.002.005.048.179.002.005.001.005.05.178.002.005.001.005.053.177.002.005.001.005.055.177.002.005.001.005.057.176.002.005.001.005.06.175.001.005.002.005.061.174.002.005.002.005.063.173.002.005.002.005.065.173.002.005.002.004.067.172.002.005.002.005.07.171.002.005.002.005.072.17.002.005.002.004.074.17.002.005.002.004.076.169.002.004.002.005.078.168.002.004.002.005.08.167.003.004.002.005.082.166.002.004.003.005.02.04.086.136.11.118.13.095.146.07.156.041.16.012.16-.019.155-.048.142-.075.126-.1.105-.123.08-.14.054-.152.024-.16-.006-.16-.036-.158-.051-.123-.018-.034-.078-.158L3.1 22.1l-.074-.16-.071-.157-.07-.16-.068-.16-.067-.165-.062-.158-.062-.164-.059-.161-.058-.166-.056-.166-.053-.164-.052-.168-.05-.167-.048-.17-.045-.165-.043-.168-.043-.172-.039-.17-.037-.17-.036-.172-.033-.17-.03-.173-.03-.174-.027-.17-.025-.175-.022-.174-.021-.175-.018-.175-.017-.173-.014-.176-.012-.176-.01-.177-.007-.176-.006-.177-.003-.178L1.73 16v-.134l-.013-.16-.044-.156-.072-.144-.097-.129-.12-.108-.137-.085-.15-.057L.938 15zm26.798 2.024l-.16.007-.157.038-.148.066-.132.092-.113.115-.09.134-.062.148-.03.127-.001.004-.023.134-.024.133-.026.133-.026.13-.03.132-.03.129-.032.134-.033.128-.035.13-.037.128-.038.13-.04.126-.04.128-.044.128-.044.126-.046.126-.048.126-.05.125-.05.125-.051.122-.054.123-.055.122-.056.12-.058.122-.06.12-.061.12-.063.119-.062.116-.067.119-.066.116-.069.115-.069.115-.07.113-.073.113-.074.112-.076.113-.077.112-.077.107-.08.11-.08.107-.085.11-.044.056-.088.135-.06.15-.033.158-.002.16.027.16.057.15.083.138.108.12.128.098.144.072.155.045.16.015.161-.016.155-.044.144-.073.128-.098.09-.099.05-.061.003-.004.003-.005.089-.115.003-.004.003-.005.088-.116.003-.004.003-.005.086-.117.003-.004.003-.005.084-.118.003-.004.003-.005.083-.12.003-.004.003-.004.081-.12.003-.005.003-.004.08-.121.003-.005.003-.004.078-.122.003-.005.003-.004.077-.123.002-.005.003-.004.075-.124.003-.005.003-.004.073-.125.003-.005.003-.004.072-.126.002-.004.003-.005.07-.126.003-.005.002-.005.07-.127.002-.004.002-.005.068-.128.002-.005.002-.004.066-.13.003-.004.002-.005.064-.13.002-.004.003-.005.062-.13.002-.005.003-.005.06-.13.003-.005.002-.005.06-.132.002-.005.002-.005.057-.132.003-.005.002-.005.056-.133.002-.005.002-.005.054-.134.002-.004.002-.005.053-.135.002-.005.002-.005.051-.135.002-.005.002-.005.05-.135.001-.005.002-.005.048-.137.001-.005.002-.005.046-.137.002-.005.002-.005.044-.137.002-.005.002-.005.042-.138.002-.005.001-.006.042-.138.001-.005.002-.005.04-.14V19.4l.002-.005.038-.14.001-.005.002-.005.036-.14.001-.005.001-.005.035-.141.001-.005.001-.005.033-.142.001-.005.001-.005.031-.141.001-.006.002-.005.029-.142v-.005l.002-.005.028-.143v-.005l.002-.005.025-.143.001-.006.001-.005.024-.143.001-.005.001-.006.001-.006.01-.161-.02-.16-.05-.154-.077-.141-.102-.125-.123-.104-.141-.079-.153-.051-.16-.022zM6.841 22.71l-.16.024-.152.053-.14.08-.122.105-.101.126-.076.142-.048.154-.018.16.011.161.041.156.07.146.077.109.04.048.003.004.003.004.095.111.003.004.004.004.096.11.004.005.003.004.098.109.003.004.004.004.1.108.003.004.003.004.101.107.004.004.003.004.102.105.004.004.004.004.103.105.004.004.004.003.105.104.003.004.004.003.106.102.004.004.004.004.107.1.004.004.004.004.108.099.004.003.004.004.11.098.003.003.004.004.11.096.004.003.005.004.11.095.005.003.004.004.113.093.004.003.004.004.113.091.004.004.005.003.114.09.004.004.004.003.116.089.004.003.004.003.117.088.004.003.004.003.118.086.004.003.005.003.118.084.004.003.005.003.119.083.004.003.005.003.12.081.005.003.004.003.121.08.005.003.004.003.122.078.005.003.004.003.123.076.005.003.004.003.124.075.005.003.004.003.125.073.004.003.005.002.126.073.004.002.005.003.126.07.005.003.004.002.128.07.004.002.005.002.128.067.005.003.004.002.13.066.004.002.005.003.13.064.004.002.005.003.13.062.005.002.004.003.132.06.004.003.005.002.132.06.005.002.005.002.132.057.005.002.005.002.133.057.005.002.005.002.133.054.005.002.005.002.13.05.154.045.16.016.16-.015.156-.045.144-.072.128-.098.108-.12.083-.138.057-.15.028-.16-.003-.16-.032-.159-.061-.149-.088-.135-.11-.117-.132-.094-.12-.058-.124-.049-.126-.051-.122-.051-.122-.054-.12-.054-.126-.058-.119-.057-.12-.06-.12-.06-.118-.063-.117-.064-.119-.066-.116-.066-.115-.068-.115-.07-.113-.07-.115-.074-.112-.074-.11-.075-.11-.076-.112-.08-.11-.08-.109-.081-.106-.082-.104-.082-.106-.086-.105-.087-.101-.086-.105-.091-.1-.09-.1-.091-.1-.094-.097-.094-.1-.098-.093-.095-.096-.1-.093-.098-.092-.101-.089-.1-.09-.102-.088-.104-.036-.043-.114-.114-.133-.091-.148-.065-.157-.036-.161-.006zm15.063 2.701l-.16.014-.156.044-.12.057-.06.034-.12.066-.117.064-.118.062-.12.061-.12.06-.118.057-.126.058-.12.054-.122.054-.122.05-.126.052-.125.05-.124.046-.127.047-.125.044-.129.043-.126.04-.13.042-.128.038-.127.035-.13.036-.131.034-.129.031-.132.03-.13.03-.135.027-.133.026-.13.023-.13.022-.137.021-.132.02-.134.017-.132.015-.138.015-.135.013-.133.01-.138.01-.136.007-.134.006-.136.004-.14.003-.16.018-.155.047-.142.076-.127.1-.105.122-.08.14-.054.151-.025.16.006.16.035.158.064.148.09.134.114.114.133.092.147.065.157.036.134.008.145-.002h.011l.147-.005h.01l.147-.007h.011l.146-.009h.011l.146-.01h.005l.005-.001.146-.012h.011l.145-.014h.005l.006-.001.145-.016h.011l.144-.018h.006l.005-.001.144-.02h.011l.144-.021.005-.001h.006l.143-.023.006-.001h.005l.143-.025h.005l.006-.002.143-.026h.005l.005-.002.143-.027.005-.001.005-.001.142-.03h.005l.005-.002.142-.03.005-.002.005-.001.142-.033.005-.001.005-.001.14-.035.006-.001.005-.001.14-.037h.005l.005-.002.14-.038.005-.002h.005l.14-.04.005-.002.005-.001.138-.042.005-.001.006-.002.138-.043.005-.001.005-.002.137-.044.005-.002.005-.002.137-.046.005-.002.005-.001.137-.048.005-.002.005-.002.135-.05.005-.001.005-.002.135-.051.005-.002.005-.002.135-.053.005-.002.004-.002.134-.054.005-.002.005-.002.133-.057.005-.002.005-.002.132-.057.005-.003.005-.002.132-.06.005-.001.004-.002.131-.061.005-.003.005-.002.13-.062.005-.003.005-.002.13-.064.004-.003.005-.002.128-.066.005-.002.005-.003.128-.067.005-.002.004-.003.127-.069.005-.002.005-.003.126-.07.005-.003.004-.003.065-.037.132-.093.112-.115.089-.135.062-.149.034-.157.003-.161-.026-.16-.055-.15-.082-.14-.107-.12-.127-.1-.144-.073-.154-.046-.16-.016zM6.33 26.818l-.16.023-.152.053-.14.08-.122.105-.101.126-.076.142-.048.154-.02.16.012.161.041.156.07.146.094.13.096.093.032.026.004.003.004.004.145.117.004.003.004.004.146.115.005.003.004.004.147.113.005.003.004.004.149.111.004.003.004.003.15.11.005.003.004.003.151.108.004.003.005.003.152.106.005.003.004.003.154.104.004.003.005.003.154.102.005.002.004.003.156.1.005.003.004.003.157.098.005.003.004.002.159.096.004.003.005.003.16.094.004.003.004.002.16.092.005.003.005.002.161.09.005.003.005.002.162.088.005.003.004.002.164.086.005.003.004.002.165.084.005.003.004.002.166.082.004.002.005.003.167.08.004.002.005.002.168.078.004.002.005.002.168.076.005.002.005.002.17.074.004.002.005.002.17.072.005.002.005.002.17.07.006.002.005.001.171.068.005.002.005.002.173.065.005.002.005.002.173.063.005.002.005.002.174.06.005.003.005.001.175.06.005.001.005.002.176.057.005.001.005.002.176.055.006.001.005.002.177.052.005.002.005.001.178.05.005.002.005.002.178.048.006.001.005.002.179.046.005.001.005.002.18.044h.005l.005.002.18.042.006.001.005.001.159.035.16.02.16-.01.157-.04.146-.069.13-.094.112-.117.087-.136.06-.149.033-.158.002-.161-.028-.159-.057-.15-.084-.138-.108-.12-.128-.098-.144-.072-.128-.039-.154-.033-.168-.04-.171-.041-.17-.044-.168-.046-.167-.047-.168-.05-.165-.051-.166-.054-.166-.056-.163-.057-.165-.06-.161-.062-.164-.064-.16-.065-.16-.068-.162-.07-.157-.07-.157-.074-.157-.075-.156-.077-.153-.079-.156-.082-.153-.082-.154-.086-.15-.086-.152-.09-.148-.09-.147-.092-.149-.095-.145-.095-.144-.098-.145-.1-.143-.102-.14-.103-.14-.104-.14-.108-.139-.11-.136-.11-.027-.022-.133-.091-.148-.065-.157-.036-.161-.006zm19.215.087l-.16.01-.157.039-.146.067-.11.076-.064.051-.139.11-.14.108-.14.104-.14.103-.143.101-.145.101-.144.098-.145.095-.149.095-.148.093-.147.089-.152.09-.15.086-.154.086-.153.082-.156.082-.153.079-.156.077-.157.075-.158.073-.157.071-.16.07-.16.068-.161.065-.164.064-.161.061-.165.06-.163.058-.166.056-.166.054-.166.051-.167.05-.167.047-.17.046-.168.044-.171.042-.168.039-.17.037-.11.023-.154.047-.143.075-.126.1-.106.122-.081.139-.054.152-.025.16.006.16.035.158.063.148.09.133.114.115.132.092.148.065.157.037.16.007.133-.016.115-.024.005-.001.005-.001.181-.04h.005l.005-.002.18-.042.006-.001.005-.001.18-.044.005-.002.005-.001.18-.046.004-.002h.005l.179-.05h.005l.005-.002.178-.05.005-.002.005-.002.177-.052.005-.002.005-.001.177-.055.005-.002.005-.001.176-.057.005-.002.005-.002.175-.059.005-.001.005-.002.174-.061.005-.002.005-.002.173-.063.005-.002.005-.002.173-.065.004-.002.005-.002.172-.068.005-.002.005-.002.171-.07.005-.001.005-.002.17-.072.005-.002.004-.002.17-.074.005-.002.004-.002.169-.076.004-.002.005-.002.168-.078.004-.002.005-.003.167-.08.004-.002.005-.002.166-.082.004-.002.005-.003.165-.084.004-.002.005-.003.163-.086.005-.002.005-.003.162-.088.005-.002.005-.003.161-.09.005-.002.004-.003.16-.092.005-.003.005-.002.16-.094.004-.003.004-.003.158-.096.005-.002.004-.003.158-.098.004-.003.005-.003.156-.1.004-.003.004-.003.155-.101.005-.003.004-.003.154-.104.004-.003.004-.003.153-.106.004-.003.005-.003.151-.108.004-.003.005-.003.15-.11.004-.003.004-.003.149-.112.004-.003.004-.003.148-.113.004-.004.004-.003.147-.115.004-.004.004-.003.068-.055.116-.113.092-.132.066-.147.038-.157.008-.16-.022-.16-.05-.153-.08-.14-.103-.125-.124-.102-.142-.077-.153-.05-.16-.02z" +}))); + +function _extends$L() { _extends$L = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$L.apply(this, arguments); } +var IntermediateEventCatchNonInterruptingMultipleIcon = (({ + styles = {}, + ...props +}) => /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("svg", _extends$L({ + xmlns: "http://www.w3.org/2000/svg", + width: "32", + height: "32" +}, props), /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("path", { + d: "M23.637 13.902l-7.625-5.535-7.624 5.535 2.912 8.956h9.425l2.912-8.956zm-1.017.33l-2.524 7.762H11.93l-2.524-7.762 6.607-4.796 6.608 4.796zM16.012.311c-1.448.02-2.93.157-4.302.628-.852.447-.255 1.863.66 1.574 2.255-.608 4.648-.607 6.922-.108.934.075 1.228-1.376.338-1.67C18.451.44 17.227.317 16.012.311zm9.012 2.934c-.913-.104-1.272 1.258-.454 1.648 1.834 1.36 3.293 3.185 4.31 5.22.526.776 1.842.098 1.515-.78a15.522 15.522 0 00-5.06-6.006c-.1-.044-.203-.07-.31-.082zM6.65 3.59c-.762.089-1.24.809-1.805 1.267C3.38 6.295 2.163 8.007 1.37 9.905c-.266.898 1.094 1.484 1.564.675a14.825 14.825 0 014.327-5.56c.476-.515.09-1.419-.612-1.431zm9.362.007c-.698.066-1.689-.16-2.033.635-.282.733.535 1.358 1.217 1.125 1.806-.147 3.63.203 5.293.907.902.255 1.472-1.112.656-1.573-1.6-.735-3.374-1.089-5.133-1.094zm-5.479 1.365c-.835.15-1.517.76-2.21 1.226-1.203.94-2.318 2.061-3.057 3.402-.33.904 1.063 1.552 1.547.723 1.045-1.656 2.596-2.925 4.285-3.873.545-.499.171-1.463-.565-1.478zm13.903 2.115c-.875-.07-1.22 1.173-.501 1.627 1.325 1.34 2.188 3.062 2.748 4.84.468.84 1.869.21 1.557-.699-.604-2.118-1.751-4.097-3.351-5.615a.93.93 0 00-.453-.153zM4.467 13.132c-.822-.07-.996.826-1.046 1.455-.256 1.93-.094 3.933.562 5.769.406.844 1.807.365 1.612-.551a11.498 11.498 0 01-.334-5.808.874.874 0 00-.794-.865zm26.687 1.6c-.746-.037-1.014.785-.879 1.395.043 2.393-.57 4.771-1.66 6.894-.31.884 1.02 1.536 1.53.75a15.632 15.632 0 001.821-8.372.876.876 0 00-.812-.667zm-30.197.571c-.782-.073-1.044.775-.933 1.404.068 2.414.661 4.833 1.809 6.962.534.77 1.842.076 1.505-.798a14.833 14.833 0 01-1.603-6.861.876.876 0 00-.778-.707zm26.787 2.024c-.777-.048-.952.797-1.021 1.392-.354 1.692-1.202 3.231-2.216 4.608-.407.872.925 1.638 1.48.852 1.361-1.733 2.296-3.827 2.582-6.017a.874.874 0 00-.825-.835zM6.857 23.012c-.808.018-1.082 1.122-.47 1.59 1.393 1.607 3.187 2.886 5.194 3.599.91.222 1.43-1.165.598-1.596a11.495 11.495 0 01-4.723-3.396.899.899 0 00-.599-.197zm15.057 2.7c-.81.194-1.504.76-2.325.972-1.203.458-2.5.536-3.758.664-.869.307-.573 1.728.346 1.663 2.201-.034 4.412-.626 6.293-1.778.604-.495.227-1.532-.556-1.521zM6.346 27.118c-.833.008-1.11 1.218-.395 1.617 1.986 1.602 4.358 2.749 6.868 3.226.933.076 1.227-1.376.338-1.67a14.838 14.838 0 01-6.345-3.066.929.929 0 00-.466-.107zm19.208.087c-.766.09-1.241.841-1.922 1.158-1.516.991-3.251 1.58-4.996 2.005-.872.405-.346 1.849.584 1.604 2.543-.526 4.98-1.66 6.963-3.344.47-.52.072-1.42-.63-1.423z" +}))); + +function _extends$K() { _extends$K = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$K.apply(this, arguments); } +var IntermediateEventCatchNonInterruptingParallelIcon = (({ + styles = {}, + ...props +}) => /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("svg", _extends$K({ + xmlns: "http://www.w3.org/2000/svg", + width: "32", + height: "32" +}, props), /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("path", { + d: "M13.51 9.081v4.428H9.08v4.982h4.428v4.428h4.982V18.49h4.428v-4.982H18.49V9.081h-4.982zm.83.83h3.32v4.428h4.429v3.322H17.66v4.428h-3.32v-4.454H9.91v-3.296h4.428V9.911zM16 0h-.005l-.188.001h-.011l-.188.004h-.011l-.187.006h-.011l-.187.008h-.005L15.2.02l-.187.01h-.005l-.005.001-.187.013h-.011L14.62.06h-.01l-.186.018h-.011l-.185.02-.005.001h-.006l-.185.022-.005.001h-.005l-.185.025h-.005l-.005.001-.185.027h-.005l-.005.001-.184.029h-.005l-.005.001-.183.031-.006.001-.005.001-.182.033-.006.001-.005.001-.182.035-.005.001-.005.001-.182.038h-.005l-.005.002-.181.04h-.005l-.005.002-.18.042-.006.001-.005.001-.18.044-.005.002h-.005l-.17.045-.152.054-.139.082-.121.106-.1.127-.074.143-.046.155-.017.16.013.16.043.156.07.145.097.13.119.108.137.085.15.058.159.03.16-.001.133-.023.165-.043.168-.041.171-.04.171-.037.172-.036.17-.033.173-.03.17-.03.177-.027.171-.025.175-.022.175-.02.175-.02.176-.016.175-.014.177-.012.176-.01.177-.007.174-.006.177-.003L16 1.73h.177l.178.004.174.006.177.007.176.01.177.012.175.014.176.017.175.018.175.02.175.023.171.025.176.027.17.03.174.03.17.033.171.036.154.033.16.02.161-.01.156-.04.146-.069.131-.094.111-.117.087-.135.061-.15.032-.158.002-.16-.027-.16-.057-.15L20 .714l-.108-.12-.128-.097-.145-.073-.128-.038-.158-.035-.005-.001-.005-.001L19.14.31h-.005l-.005-.002-.182-.035h-.006l-.005-.002-.182-.033h-.006l-.005-.002-.183-.03-.005-.001-.006-.001-.183-.029h-.005l-.006-.001-.184-.027h-.005l-.005-.001-.185-.024h-.005L17.968.12 17.783.1l-.006-.001h-.005l-.185-.02h-.006l-.005-.001L17.39.06h-.005L17.38.06l-.187-.015h-.005l-.005-.001-.187-.013h-.011L16.8.02h-.011L16.6.01h-.011l-.187-.006h-.011L16.204 0h-.011L16.005 0H16zm9.015 2.935l-.16.004-.158.033-.15.062-.134.09-.116.111-.093.132-.067.147-.038.156-.01.161.022.16.05.153.078.141.103.124.102.087.045.034.142.106.137.105.14.11.136.11.135.112.134.115.134.117.13.115.132.122.128.12.127.122.126.125.124.126.124.128.121.13.118.128.118.132.117.133.113.134.113.136.11.136.109.137.109.142.104.14.103.14.101.142.1.144.099.146.095.145.094.147.093.15.092.15.087.149.087.15.084.152.084.155.08.152.08.155.04.081.084.138.11.119.128.096.145.072.155.043.16.013.16-.016.155-.046.144-.074.127-.099.106-.12.083-.14.055-.151.026-.16-.004-.16-.034-.158-.05-.124-.042-.085-.002-.004-.003-.005-.084-.165-.002-.004-.003-.005-.086-.164-.002-.004-.003-.005-.088-.162-.002-.005-.003-.005-.09-.161-.002-.005-.003-.004-.092-.16-.003-.005-.002-.005-.094-.16-.003-.004-.003-.004-.096-.159-.002-.004-.003-.005-.098-.157-.003-.004-.003-.005-.1-.156-.003-.004-.003-.005-.101-.154-.003-.005-.003-.004-.104-.154-.003-.004-.003-.005-.106-.152-.003-.005-.003-.004-.108-.151-.003-.004-.003-.005-.11-.15-.003-.004-.003-.004-.111-.15-.004-.003-.003-.005-.113-.147-.004-.004-.003-.005-.115-.146-.004-.004-.003-.004-.117-.145-.004-.004-.003-.004-.12-.144-.003-.004-.003-.004-.121-.142-.004-.004-.003-.004-.123-.141-.003-.004-.004-.004-.125-.14-.003-.004-.004-.004-.127-.138-.003-.004-.004-.004-.128-.136-.004-.004-.004-.004-.13-.135-.004-.004-.004-.004-.132-.134-.003-.004-.004-.003-.134-.133-.004-.003-.004-.004-.135-.13-.004-.004-.004-.004-.136-.128-.004-.004-.004-.004-.138-.126-.004-.004-.004-.003-.14-.125-.004-.004-.004-.003-.14-.123-.005-.004-.004-.003-.142-.121-.004-.004-.004-.003-.144-.12-.004-.003-.004-.003-.145-.117-.004-.004-.004-.003-.147-.115-.004-.004-.004-.003-.148-.113-.004-.003-.004-.004-.149-.111-.004-.003-.004-.004-.05-.036-.14-.083-.15-.055-.16-.027zM6.634 3.28l-.161.008-.157.037-.147.066-.111.074-.04.032-.005.003-.004.004-.145.117-.004.003-.004.004-.144.119-.004.003-.004.004-.142.12-.004.004-.004.004-.141.123-.004.003-.004.004-.14.125-.004.003-.004.004-.138.126-.004.004-.004.004-.136.128-.004.004-.004.004-.135.13-.004.004-.004.003-.134.133-.004.003-.004.004-.132.134-.003.004-.004.004-.13.135-.004.004-.004.004-.128.136-.004.004-.004.004-.126.138-.004.004-.003.004-.125.14-.004.004-.003.004-.123.14-.004.005-.003.004-.121.142-.004.004-.003.004-.12.144-.003.004-.003.004-.117.145-.004.004-.003.004-.115.146-.004.005-.003.004-.113.147-.003.005-.004.004-.111.149-.003.004-.004.004-.11.15-.002.005-.003.004-.108.151-.003.004-.003.005-.106.152-.003.005-.003.004-.104.154-.003.004-.003.005-.102.154-.003.005-.002.004-.1.156-.003.005-.003.004-.098.157-.003.005-.003.004-.096.159-.002.004-.003.005-.094.16-.003.004-.002.004-.092.16-.003.005-.003.005-.09.161-.002.005-.003.005-.088.162-.002.005-.003.004-.086.164-.002.005-.002.004-.084.165-.003.005-.002.004-.082.166-.002.004-.003.005-.08.167-.002.004-.002.005-.078.168-.002.004-.002.005-.045.1-.053.153-.023.16.007.16.037.157.065.148.092.132.114.114.134.09.148.064.157.035.161.006.16-.025.152-.054.14-.08.121-.106.1-.126.065-.118.043-.095.074-.16.075-.155.077-.157.08-.155.08-.152.083-.155.085-.152.086-.15.088-.149.091-.15.094-.15.094-.147.095-.145.099-.146.1-.144.1-.142.104-.14.104-.14.11-.142.107-.137.11-.136.114-.136.113-.134.117-.133.118-.132.117-.129.122-.13.124-.127.123-.126.127-.125.127-.122.128-.12.132-.122.13-.115.133-.117.135-.115.135-.111.136-.11.037-.03.117-.11.094-.132.068-.146.04-.156.01-.161-.02-.16-.05-.154-.076-.141-.102-.125-.123-.104-.14-.08-.153-.051-.16-.023zM16 3.286h-.005l-.148.001h-.01l-.147.003h-.011l-.147.005h-.011l-.146.007h-.011l-.146.009h-.011l-.146.01h-.005l-.005.001-.146.012h-.011l-.145.014h-.006l-.005.001-.05.006-.158.031-.15.06-.135.088-.117.111-.094.13-.069.147-.04.156-.01.16.019.16.049.154.076.142.102.125.123.105.14.08.152.051.16.023.134-.003.045-.005.135-.013.133-.01.136-.01.135-.007.137-.006.136-.004.136-.003h.274l.136.003.136.004.136.006.136.007.136.01.133.01.135.013.135.014.135.016.134.018.132.018.134.021.133.023.133.024.133.025.13.027.132.03.132.03.129.031.13.034.129.035.129.036.13.04.126.038.128.042.126.042.128.045.127.047.126.047.12.048.127.051.123.052.006.002.147.048.16.021.16-.009.157-.038.147-.067.131-.093.112-.116.089-.135.062-.149.033-.158.004-.16-.027-.16-.055-.151-.083-.139-.107-.12-.127-.099-.118-.063-.004-.001-.005-.003-.005-.002-.133-.056-.005-.002-.005-.002-.134-.054-.004-.002-.005-.002-.135-.053-.005-.002-.005-.002-.135-.051-.005-.002-.005-.002-.135-.05-.005-.001-.005-.002-.137-.048-.005-.001-.005-.002-.137-.046-.005-.002-.005-.002-.137-.044-.005-.002-.005-.001-.138-.043-.006-.002-.005-.001-.138-.042-.005-.001-.005-.002-.14-.04H19.4l-.005-.002-.14-.038-.005-.001-.005-.002-.14-.036-.005-.001-.005-.001-.141-.035-.005-.001-.005-.001-.142-.033-.005-.001-.005-.001-.142-.031-.005-.002h-.005l-.142-.03-.005-.001-.005-.001-.143-.028h-.005l-.005-.002-.143-.025-.006-.001-.005-.001-.143-.024-.005-.001-.006-.001-.143-.022-.006-.001h-.005l-.144-.022h-.005l-.006-.001-.144-.019h-.005l-.006-.001-.144-.017h-.006l-.005-.001-.145-.016h-.011l-.145-.014H17.1l-.005-.001-.146-.012h-.01l-.146-.01-.006-.001h-.005l-.146-.009h-.011l-.147-.006h-.01l-.147-.005h-.011l-.147-.003h-.011l-.147-.001H16zm-5.482 1.366l-.16.008-.157.037-.123.053-.06.032-.005.002-.004.003-.128.069-.004.002-.005.003-.126.07-.005.003-.004.002-.126.072-.005.003-.004.003-.125.073-.004.003-.005.003-.124.075-.004.003-.005.002-.123.077-.004.003-.005.003-.122.078-.004.003-.005.003-.121.08-.004.002-.005.003-.12.082-.005.003-.004.003-.12.083-.004.003-.004.003-.118.084-.005.003-.004.003-.118.086-.004.003-.004.003-.117.088-.004.003-.004.003-.116.089-.004.003-.004.004-.114.09-.005.003-.004.003-.113.092-.004.004-.004.003-.113.093-.004.004-.004.003-.111.095-.005.003-.004.004-.11.096-.004.004-.004.003-.11.098-.003.003-.004.004-.108.1-.004.003-.004.003-.107.101-.004.004-.004.003-.106.102-.004.004-.003.004-.105.103-.004.004-.004.004-.103.105-.004.004-.004.003-.102.106-.003.004-.004.004-.1.107-.004.004-.004.004-.099.108-.004.004-.003.004-.098.11-.003.003-.004.004-.096.11-.004.005-.003.004-.095.111-.003.004-.004.004-.093.113-.003.004-.004.004-.092.113-.003.004-.003.005-.09.114-.004.004-.003.004-.089.116-.003.004-.003.004-.088.117-.003.004-.003.004-.086.118-.003.004-.003.005-.084.118-.003.004-.003.005-.083.12-.003.003-.003.005-.082.12-.003.005-.002.004-.068.103-.076.142-.048.154-.018.16.011.161.041.156.07.146.095.13.117.11.136.086.15.06.158.03.162.002.158-.03.15-.057.138-.085.119-.109.082-.105.065-.099.075-.11.077-.113.077-.107.08-.11.08-.108.084-.108.083-.105.086-.106.086-.104.088-.104.089-.101.09-.102.093-.101.093-.099.094-.097.095-.096.098-.097.098-.095.099-.093.1-.092.103-.091.101-.089.104-.088.104-.086.106-.086.106-.083.106-.082.109-.082.108-.079.11-.078.11-.076.112-.076.112-.074.113-.072.113-.071.115-.07.115-.068.118-.067.117-.065.12-.065.054-.029.135-.088.116-.111.094-.132.068-.146.04-.156.009-.161-.02-.16-.05-.153-.078-.142-.102-.125-.123-.103-.141-.079-.153-.051-.16-.022zm13.91 2.116l-.162.008-.157.037-.147.066-.132.092-.113.116-.09.134-.063.148-.034.157-.005.162.025.159.055.152.082.138.086.103.09.09.094.098.092.099.093.1.091.103.089.101.088.104.086.104.086.106.083.105.083.108.08.108.081.11.077.107.077.112.075.111.075.114.072.113.071.113.07.114.068.118.067.115.065.118.064.117.062.117.061.121.059.119.059.122.056.121.054.12.055.125.051.123.051.125.048.123.048.127.047.126.044.125.043.128.042.129.039.126.038.13.022.076.058.15.085.137.11.119.129.096.145.07.155.043.16.013.161-.017.154-.046.144-.075.126-.1.106-.12.082-.14.055-.151.025-.16-.005-.16-.026-.132-.023-.082-.002-.005-.001-.005-.042-.139-.001-.005-.002-.005-.043-.138-.001-.005-.002-.005-.044-.137-.002-.005-.002-.005-.046-.137-.002-.005-.001-.005-.048-.137-.002-.005-.002-.005-.05-.135-.001-.005-.002-.005-.051-.135-.002-.005-.002-.005-.053-.135-.002-.005-.002-.005-.054-.133-.002-.005-.002-.005-.057-.133-.002-.005-.002-.005-.057-.132-.003-.005-.002-.005-.06-.132-.001-.005-.002-.004-.061-.132-.003-.004-.002-.005-.063-.13-.002-.005-.002-.005-.064-.13-.003-.004-.002-.005-.066-.129-.002-.004-.003-.005-.067-.128-.002-.005-.003-.004-.069-.128-.002-.004-.003-.005-.07-.126-.003-.005-.003-.004-.072-.126-.002-.005-.003-.004-.074-.125-.002-.004-.003-.005-.075-.124-.003-.004-.003-.005-.076-.123-.003-.004-.003-.005-.078-.122-.003-.004-.003-.005-.08-.121-.003-.004-.003-.005-.081-.12-.003-.005-.003-.004-.083-.12-.003-.004-.003-.004-.084-.118-.003-.005-.003-.004-.086-.118-.003-.004-.004-.004-.087-.117-.003-.004-.003-.004-.09-.116-.002-.004-.004-.004-.09-.114-.003-.005-.004-.004-.091-.113-.004-.004-.003-.004-.094-.113-.003-.004-.003-.004-.095-.111-.004-.004-.003-.004-.096-.11-.004-.005-.003-.004-.098-.11-.004-.003-.003-.004-.1-.108-.003-.004-.004-.004-.1-.107-.004-.004-.004-.004-.102-.106-.003-.003-.004-.004-.093-.095-.124-.103-.14-.08-.153-.05-.16-.023zM4.45 12.826l-.161.002-.158.032-.15.06-.135.088-.118.11-.094.131-.069.146-.035.129-.026.132v.005l-.002.005-.025.143-.001.005-.001.006-.024.143-.001.005-.001.006-.022.143-.001.006-.001.005-.02.144-.001.005-.001.005-.019.145v.005l-.001.006-.017.144v.006l-.001.005-.016.145v.011l-.014.145v.005l-.001.006-.012.146v.01l-.01.146-.001.006v.005l-.009.146v.011l-.007.146v.011l-.004.147v.011l-.003.147v.01l-.002.148v.01l.001.148v.01l.003.147v.011l.005.147v.01l.007.147v.011l.009.146v.011l.01.146v.01l.013.146v.011l.014.145v.005l.001.006.016.145v.011l.018.144v.006l.001.005.019.144v.006l.001.005.021.144v.005l.002.006.022.143v.006l.002.005.024.143v.005l.002.006.025.143.001.005.001.005.028.143.001.005.001.005.03.142v.005l.002.006.03.141.002.005.001.005.033.142v.005l.002.005.035.14v.006l.002.005.036.14.002.005.001.005.038.14.001.005.002.005.04.14v.005l.002.005.042.138.001.006.002.005.042.138.002.005.002.005.017.054.064.148.09.134.114.114.132.092.148.065.157.037.16.007.16-.023.153-.052.14-.08.123-.104.102-.125.076-.142.049-.153.02-.16-.011-.161-.031-.13-.017-.051-.039-.126-.038-.13-.037-.128-.035-.13-.033-.128-.033-.134-.03-.13-.029-.131-.026-.13-.026-.133-.024-.133-.023-.133-.02-.132-.02-.136-.017-.132-.016-.135-.014-.135-.012-.133-.012-.138-.009-.133-.007-.136-.006-.138-.004-.134-.003-.136v-.274l.003-.136.004-.134.006-.139.007-.136.01-.133.01-.138.013-.132.014-.135.016-.135.017-.132.02-.137.02-.13.023-.134.024-.133.024-.126.016-.16-.014-.161-.044-.155-.072-.145-.098-.128-.12-.108-.137-.084-.15-.057-.16-.029zm26.698 1.601l-.161.01-.157.04-.146.067-.131.093-.112.117-.088.135-.061.149-.033.157-.005.134.006.14.006.176.003.177.001.178-.001.177-.003.178-.006.177-.007.176-.01.177-.012.176-.015.176-.016.173-.018.175-.02.175-.024.174-.025.175-.026.17-.03.174-.03.173-.033.17-.036.172-.037.17-.04.17-.042.172-.043.168-.045.166-.048.169-.05.167-.052.168-.053.164-.056.166-.058.166-.06.16-.062.165-.062.158-.066.165-.068.16-.07.16-.07.158-.075.159-.074.155-.079.158-.08.158-.06.15-.03.158-.001.161.029.159.058.15.085.137.108.119.13.097.144.07.156.044.16.013.16-.017.155-.046.143-.074.127-.1.107-.12.07-.115.083-.164.003-.005.002-.004.082-.166.002-.005.003-.004.08-.167.002-.005.002-.004.078-.168.002-.005.002-.004.076-.169.002-.004.002-.005.074-.17.002-.004.002-.005.072-.17.002-.005.002-.005.07-.171.001-.005.002-.005.068-.172.002-.004.002-.005.065-.173.002-.005.002-.005.063-.173.002-.005.002-.005.06-.174.003-.005.001-.005.06-.175.001-.005.002-.005.057-.176.001-.005.002-.005.055-.177.001-.005.002-.005.052-.177.002-.005.001-.005.051-.178.001-.005.002-.005.048-.179.002-.005v-.005l.047-.179.001-.005.002-.005.044-.18v-.005l.002-.005.042-.18.001-.006.001-.005.04-.181.001-.005.001-.005.037-.182.002-.005v-.005l.036-.182v-.006l.002-.005.033-.182v-.006l.002-.005.03-.183.001-.005.001-.005.029-.184v-.005l.001-.006.027-.184v-.005l.001-.005.024-.185v-.005l.001-.005.022-.185v-.006l.001-.005.02-.185v-.006l.001-.005.017-.186v-.005l.001-.005.015-.187v-.005l.001-.005.013-.187v-.01l.01-.187.001-.006v-.005l.009-.187v-.011l.006-.187v-.011l.004-.188v-.011l.001-.188v-.01l-.001-.188v-.011l-.004-.188v-.011l-.006-.187v-.011l-.007-.145-.022-.16-.05-.152-.08-.141-.103-.124-.125-.102-.141-.077-.153-.05-.16-.02zM.938 15L.777 15l-.158.032-.15.06-.136.087-.117.11-.095.131-.068.146-.04.156-.012.133-.001.14v.01l.001.188v.011l.004.188v.011l.006.187v.011l.008.187v.011l.011.187v.005l.001.005.013.187v.01l.016.187v.01l.018.186v.011l.02.185.001.005v.006l.022.185.001.005v.005l.025.185v.005l.001.005.027.184v.006l.001.005.029.184v.005l.001.005.031.183.001.005.001.006.033.182.001.005.001.006.035.182.001.005.001.005.038.182v.005l.002.005.04.181v.005l.002.005.042.18.001.006.001.005.044.18.002.005v.005l.047.18.001.004.002.005.048.179.002.005.001.005.05.178.002.005.001.005.053.177.002.005.001.005.055.177.002.005.001.005.057.176.002.005.001.005.06.175.001.005.002.005.061.174.002.005.002.005.063.173.002.005.002.005.065.173.002.005.002.004.067.172.002.005.002.005.07.171.002.005.002.005.072.17.002.005.002.004.074.17.002.005.002.004.076.169.002.004.002.005.078.168.002.004.002.005.08.167.003.004.002.005.082.166.002.004.003.005.02.04.086.136.11.118.13.095.146.07.156.041.16.012.16-.019.155-.048.142-.075.126-.1.105-.123.08-.14.054-.152.024-.16-.006-.16-.036-.158-.051-.123-.018-.034-.078-.158L3.1 22.1l-.074-.16-.071-.157-.07-.16-.068-.16-.067-.165-.062-.158-.062-.164-.059-.161-.058-.166-.056-.166-.053-.164-.052-.168-.05-.167-.048-.17-.045-.165-.043-.168-.043-.172-.039-.17-.037-.17-.036-.172-.033-.17-.03-.173-.03-.174-.027-.17-.025-.175-.022-.174-.021-.175-.018-.175-.017-.173-.014-.176-.012-.176-.01-.177-.007-.176-.006-.177-.003-.178L1.73 16v-.134l-.013-.16-.044-.156-.072-.144-.097-.129-.12-.108-.137-.085-.15-.057L.938 15zm26.798 2.024l-.16.007-.157.038-.148.066-.132.092-.113.115-.09.134-.062.148-.03.127-.001.004-.023.134-.024.133-.026.133-.026.13-.03.132-.03.129-.032.134-.033.128-.035.13-.037.128-.038.13-.04.126-.04.128-.044.128-.044.126-.046.126-.048.126-.05.125-.05.125-.051.122-.054.123-.055.122-.056.12-.058.122-.06.12-.061.12-.063.119-.062.116-.067.119-.066.116-.069.115-.069.115-.07.113-.073.113-.074.112-.076.113-.077.112-.077.107-.08.11-.08.107-.085.11-.044.056-.088.135-.06.15-.033.158-.002.16.027.16.057.15.083.138.108.12.128.098.144.072.155.045.16.015.161-.016.155-.044.144-.073.128-.098.09-.099.05-.061.003-.004.003-.005.089-.115.003-.004.003-.005.088-.116.003-.004.003-.005.086-.117.003-.004.003-.005.084-.118.003-.004.003-.005.083-.12.003-.004.003-.004.081-.12.003-.005.003-.004.08-.121.003-.005.003-.004.078-.122.003-.005.003-.004.077-.123.002-.005.003-.004.075-.124.003-.005.003-.004.073-.125.003-.005.003-.004.072-.126.002-.004.003-.005.07-.126.003-.005.002-.005.07-.127.002-.004.002-.005.068-.128.002-.005.002-.004.066-.13.003-.004.002-.005.064-.13.002-.004.003-.005.062-.13.002-.005.003-.005.06-.13.003-.005.002-.005.06-.132.002-.005.002-.005.057-.132.003-.005.002-.005.056-.133.002-.005.002-.005.054-.134.002-.004.002-.005.053-.135.002-.005.002-.005.051-.135.002-.005.002-.005.05-.135.001-.005.002-.005.048-.137.001-.005.002-.005.046-.137.002-.005.002-.005.044-.137.002-.005.002-.005.042-.138.002-.005.001-.006.042-.138.001-.005.002-.005.04-.14V19.4l.002-.005.038-.14.001-.005.002-.005.036-.14.001-.005.001-.005.035-.141.001-.005.001-.005.033-.142.001-.005.001-.005.031-.141.001-.006.002-.005.029-.142v-.005l.002-.005.028-.143v-.005l.002-.005.025-.143.001-.006.001-.005.024-.143.001-.005.001-.006.001-.006.01-.161-.02-.16-.05-.154-.077-.141-.102-.125-.123-.104-.141-.079-.153-.051-.16-.022zM6.841 22.71l-.16.024-.152.053-.14.08-.122.105-.101.126-.076.142-.048.154-.018.16.011.161.041.156.07.146.077.109.04.048.003.004.003.004.095.111.003.004.004.004.096.11.004.005.003.004.098.109.003.004.004.004.1.108.003.004.003.004.101.107.004.004.003.004.102.105.004.004.004.004.103.105.004.004.004.003.105.104.003.004.004.003.106.102.004.004.004.004.107.1.004.004.004.004.108.099.004.003.004.004.11.098.003.003.004.004.11.096.004.003.005.004.11.095.005.003.004.004.113.093.004.003.004.004.113.091.004.004.005.003.114.09.004.004.004.003.116.089.004.003.004.003.117.088.004.003.004.003.118.086.004.003.005.003.118.084.004.003.005.003.119.083.004.003.005.003.12.081.005.003.004.003.121.08.005.003.004.003.122.078.005.003.004.003.123.076.005.003.004.003.124.075.005.003.004.003.125.073.004.003.005.002.126.073.004.002.005.003.126.07.005.003.004.002.128.07.004.002.005.002.128.067.005.003.004.002.13.066.004.002.005.003.13.064.004.002.005.003.13.062.005.002.004.003.132.06.004.003.005.002.132.06.005.002.005.002.132.057.005.002.005.002.133.057.005.002.005.002.133.054.005.002.005.002.13.05.154.045.16.016.16-.015.156-.045.144-.072.128-.098.108-.12.083-.138.057-.15.028-.16-.003-.16-.032-.159-.061-.149-.088-.135-.11-.117-.132-.094-.12-.058-.124-.049-.126-.051-.122-.051-.122-.054-.12-.054-.126-.058-.119-.057-.12-.06-.12-.06-.118-.063-.117-.064-.119-.066-.116-.066-.115-.068-.115-.07-.113-.07-.115-.074-.112-.074-.11-.075-.11-.076-.112-.08-.11-.08-.109-.081-.106-.082-.104-.082-.106-.086-.105-.087-.101-.086-.105-.091-.1-.09-.1-.091-.1-.094-.097-.094-.1-.098-.093-.095-.096-.1-.093-.098-.092-.101-.089-.1-.09-.102-.088-.104-.036-.043-.114-.114-.133-.091-.148-.065-.157-.036-.161-.006zm15.063 2.701l-.16.014-.156.044-.12.057-.06.034-.12.066-.117.064-.118.062-.12.061-.12.06-.118.057-.126.058-.12.054-.122.054-.122.05-.126.052-.125.05-.124.046-.127.047-.125.044-.129.043-.126.04-.13.042-.128.038-.127.035-.13.036-.131.034-.129.031-.132.03-.13.03-.135.027-.133.026-.13.023-.13.022-.137.021-.132.02-.134.017-.132.015-.138.015-.135.013-.133.01-.138.01-.136.007-.134.006-.136.004-.14.003-.16.018-.155.047-.142.076-.127.1-.105.122-.08.14-.054.151-.025.16.006.16.035.158.064.148.09.134.114.114.133.092.147.065.157.036.134.008.145-.002h.011l.147-.005h.01l.147-.007h.011l.146-.009h.011l.146-.01h.005l.005-.001.146-.012h.011l.145-.014h.005l.006-.001.145-.016h.011l.144-.018h.006l.005-.001.144-.02h.011l.144-.021.005-.001h.006l.143-.023.006-.001h.005l.143-.025h.005l.006-.002.143-.026h.005l.005-.002.143-.027.005-.001.005-.001.142-.03h.005l.005-.002.142-.03.005-.002.005-.001.142-.033.005-.001.005-.001.14-.035.006-.001.005-.001.14-.037h.005l.005-.002.14-.038.005-.002h.005l.14-.04.005-.002.005-.001.138-.042.005-.001.006-.002.138-.043.005-.001.005-.002.137-.044.005-.002.005-.002.137-.046.005-.002.005-.001.137-.048.005-.002.005-.002.135-.05.005-.001.005-.002.135-.051.005-.002.005-.002.135-.053.005-.002.004-.002.134-.054.005-.002.005-.002.133-.057.005-.002.005-.002.132-.057.005-.003.005-.002.132-.06.005-.001.004-.002.131-.061.005-.003.005-.002.13-.062.005-.003.005-.002.13-.064.004-.003.005-.002.128-.066.005-.002.005-.003.128-.067.005-.002.004-.003.127-.069.005-.002.005-.003.126-.07.005-.003.004-.003.065-.037.132-.093.112-.115.089-.135.062-.149.034-.157.003-.161-.026-.16-.055-.15-.082-.14-.107-.12-.127-.1-.144-.073-.154-.046-.16-.016zM6.33 26.818l-.16.023-.152.053-.14.08-.122.105-.101.126-.076.142-.048.154-.02.16.012.161.041.156.07.146.094.13.096.093.032.026.004.003.004.004.145.117.004.003.004.004.146.115.005.003.004.004.147.113.005.003.004.004.149.111.004.003.004.003.15.11.005.003.004.003.151.108.004.003.005.003.152.106.005.003.004.003.154.104.004.003.005.003.154.102.005.002.004.003.156.1.005.003.004.003.157.098.005.003.004.002.159.096.004.003.005.003.16.094.004.003.004.002.16.092.005.003.005.002.161.09.005.003.005.002.162.088.005.003.004.002.164.086.005.003.004.002.165.084.005.003.004.002.166.082.004.002.005.003.167.08.004.002.005.002.168.078.004.002.005.002.168.076.005.002.005.002.17.074.004.002.005.002.17.072.005.002.005.002.17.07.006.002.005.001.171.068.005.002.005.002.173.065.005.002.005.002.173.063.005.002.005.002.174.06.005.003.005.001.175.06.005.001.005.002.176.057.005.001.005.002.176.055.006.001.005.002.177.052.005.002.005.001.178.05.005.002.005.002.178.048.006.001.005.002.179.046.005.001.005.002.18.044h.005l.005.002.18.042.006.001.005.001.159.035.16.02.16-.01.157-.04.146-.069.13-.094.112-.117.087-.136.06-.149.033-.158.002-.161-.028-.159-.057-.15-.084-.138-.108-.12-.128-.098-.144-.072-.128-.039-.154-.033-.168-.04-.171-.041-.17-.044-.168-.046-.167-.047-.168-.05-.165-.051-.166-.054-.166-.056-.163-.057-.165-.06-.161-.062-.164-.064-.16-.065-.16-.068-.162-.07-.157-.07-.157-.074-.157-.075-.156-.077-.153-.079-.156-.082-.153-.082-.154-.086-.15-.086-.152-.09-.148-.09-.147-.092-.149-.095-.145-.095-.144-.098-.145-.1-.143-.102-.14-.103-.14-.104-.14-.108-.139-.11-.136-.11-.027-.022-.133-.091-.148-.065-.157-.036-.161-.006zm19.215.087l-.16.01-.157.039-.146.067-.11.076-.064.051-.139.11-.14.108-.14.104-.14.103-.143.101-.145.101-.144.098-.145.095-.149.095-.148.093-.147.089-.152.09-.15.086-.154.086-.153.082-.156.082-.153.079-.156.077-.157.075-.158.073-.157.071-.16.07-.16.068-.161.065-.164.064-.161.061-.165.06-.163.058-.166.056-.166.054-.166.051-.167.05-.167.047-.17.046-.168.044-.171.042-.168.039-.17.037-.11.023-.154.047-.143.075-.126.1-.106.122-.081.139-.054.152-.025.16.006.16.035.158.063.148.09.133.114.115.132.092.148.065.157.037.16.007.133-.016.115-.024.005-.001.005-.001.181-.04h.005l.005-.002.18-.042.006-.001.005-.001.18-.044.005-.002.005-.001.18-.046.004-.002h.005l.179-.05h.005l.005-.002.178-.05.005-.002.005-.002.177-.052.005-.002.005-.001.177-.055.005-.002.005-.001.176-.057.005-.002.005-.002.175-.059.005-.001.005-.002.174-.061.005-.002.005-.002.173-.063.005-.002.005-.002.173-.065.004-.002.005-.002.172-.068.005-.002.005-.002.171-.07.005-.001.005-.002.17-.072.005-.002.004-.002.17-.074.005-.002.004-.002.169-.076.004-.002.005-.002.168-.078.004-.002.005-.003.167-.08.004-.002.005-.002.166-.082.004-.002.005-.003.165-.084.004-.002.005-.003.163-.086.005-.002.005-.003.162-.088.005-.002.005-.003.161-.09.005-.002.004-.003.16-.092.005-.003.005-.002.16-.094.004-.003.004-.003.158-.096.005-.002.004-.003.158-.098.004-.003.005-.003.156-.1.004-.003.004-.003.155-.101.005-.003.004-.003.154-.104.004-.003.004-.003.153-.106.004-.003.005-.003.151-.108.004-.003.005-.003.15-.11.004-.003.004-.003.149-.112.004-.003.004-.003.148-.113.004-.004.004-.003.147-.115.004-.004.004-.003.068-.055.116-.113.092-.132.066-.147.038-.157.008-.16-.022-.16-.05-.153-.08-.14-.103-.125-.124-.102-.142-.077-.153-.05-.16-.02z", + opacity: ".98" +}))); + +function _extends$J() { _extends$J = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$J.apply(this, arguments); } +var IntermediateEventCatchNonInterruptingSignalIcon = (({ + styles = {}, + ...props +}) => /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("svg", _extends$J({ + xmlns: "http://www.w3.org/2000/svg", + width: "32", + height: "32" +}, props), /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("path", { + d: "M16.012 8.816L9.21 21.026h13.606l-6.803-12.21zm0 1.776l5.332 9.57H10.681l5.331-9.57zm0-10.281c-1.448.02-2.93.157-4.302.628-.852.447-.255 1.863.66 1.574 2.255-.608 4.648-.607 6.922-.108.934.075 1.228-1.376.338-1.67C18.451.44 17.227.317 16.012.311zm9.012 2.934c-.913-.104-1.272 1.258-.454 1.648 1.834 1.36 3.293 3.185 4.31 5.22.526.776 1.842.098 1.515-.78a15.522 15.522 0 00-5.06-6.006c-.1-.044-.203-.07-.31-.082zM6.65 3.59c-.762.089-1.24.809-1.805 1.267C3.38 6.295 2.163 8.007 1.37 9.905c-.266.898 1.094 1.484 1.564.675a14.825 14.825 0 014.327-5.56c.476-.515.09-1.419-.612-1.431zm9.362.007c-.698.066-1.689-.16-2.033.635-.282.733.535 1.358 1.217 1.125 1.806-.147 3.63.203 5.293.907.902.255 1.472-1.112.656-1.573-1.6-.735-3.374-1.089-5.133-1.094zm-5.479 1.365c-.835.15-1.517.76-2.21 1.226-1.203.94-2.318 2.061-3.057 3.402-.33.904 1.063 1.552 1.547.723 1.045-1.656 2.596-2.925 4.285-3.873.545-.499.171-1.463-.565-1.478zm13.903 2.115c-.875-.07-1.22 1.173-.501 1.627 1.325 1.34 2.188 3.062 2.748 4.84.468.84 1.869.21 1.557-.699-.604-2.118-1.751-4.097-3.351-5.615a.93.93 0 00-.453-.153zM4.467 13.132c-.822-.07-.996.826-1.046 1.455-.256 1.93-.094 3.933.562 5.769.406.844 1.807.365 1.612-.551a11.498 11.498 0 01-.334-5.808.874.874 0 00-.794-.865zm26.687 1.6c-.746-.037-1.014.785-.879 1.395.043 2.393-.57 4.771-1.66 6.894-.31.884 1.02 1.536 1.53.75a15.632 15.632 0 001.821-8.372.876.876 0 00-.812-.667zm-30.197.571c-.782-.073-1.044.775-.933 1.404.068 2.414.661 4.833 1.809 6.962.534.77 1.842.076 1.505-.798a14.833 14.833 0 01-1.603-6.861.876.876 0 00-.778-.707zm26.787 2.024c-.777-.048-.952.797-1.021 1.392-.354 1.692-1.202 3.231-2.216 4.608-.407.872.925 1.638 1.48.852 1.361-1.733 2.296-3.827 2.582-6.017a.874.874 0 00-.825-.835zM6.857 23.012c-.808.018-1.082 1.122-.47 1.59 1.393 1.607 3.187 2.886 5.194 3.599.91.222 1.43-1.165.598-1.596a11.495 11.495 0 01-4.723-3.396.899.899 0 00-.599-.197zm15.057 2.7c-.81.194-1.504.76-2.325.972-1.203.458-2.5.536-3.758.664-.869.307-.573 1.728.346 1.663 2.201-.034 4.412-.626 6.293-1.778.604-.495.227-1.532-.556-1.521zM6.346 27.118c-.833.008-1.11 1.218-.395 1.617 1.986 1.602 4.358 2.749 6.868 3.226.933.076 1.227-1.376.338-1.67a14.838 14.838 0 01-6.345-3.066.929.929 0 00-.466-.107zm19.208.087c-.766.09-1.241.841-1.922 1.158-1.516.991-3.251 1.58-4.996 2.005-.872.405-.346 1.849.584 1.604 2.543-.526 4.98-1.66 6.963-3.344.47-.52.072-1.42-.63-1.423z" +}))); + +function _extends$I() { _extends$I = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$I.apply(this, arguments); } +var IntermediateEventCatchNonInterruptingTimerIcon = (({ + styles = {}, + ...props +}) => /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("svg", _extends$I({ + xmlns: "http://www.w3.org/2000/svg", + width: "32", + height: "32" +}, props), /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("path", { + d: "M15.998 8.406c-3.018-.041-5.92 1.926-7.031 4.727-1.138 2.695-.51 6.012 1.537 8.103 1.99 2.141 5.268 2.93 8.014 1.927 2.878-.98 4.992-3.827 5.068-6.87.153-2.957-1.624-5.88-4.3-7.137a7.552 7.552 0 00-3.288-.75zm0 1.384c2.759-.052 5.373 1.973 6.015 4.655.704 2.578-.482 5.517-2.791 6.867-2.358 1.48-5.682 1.086-7.618-.918-2.043-1.971-2.407-5.381-.84-7.745 1.11-1.763 3.15-2.88 5.234-2.86zm1.962 1.765l-2.074 3.762c-.64.068-.793 1.04-.202 1.3.39.27.696-.18 1.052-.165h3.17v-.865h-3.182l1.993-3.615c-.252-.14-.505-.278-.757-.417zm-1.965-8.268h-.158l-.147.003h-.011l-.147.005h-.011l-.146.007h-.011l-.146.009h-.011l-.146.01h-.005l-.005.001-.146.012h-.011l-.145.014h-.006l-.005.001-.05.006-.158.031-.15.06-.135.088-.117.111-.094.13-.069.147-.04.156-.01.16.019.16.049.154.076.142.102.125.123.105.14.08.152.051.16.023.134-.003.045-.005.135-.013.133-.01.136-.01.135-.007.137-.006.136-.004.136-.003h.274l.136.003.136.004.136.006.136.007.136.01.133.01.135.013.135.014.135.016.134.018.132.018.134.021.133.023.133.024.133.025.13.027.132.03.132.03.129.031.13.034.129.035.129.036.13.04.126.038.128.042.126.042.128.045.127.047.126.048.12.047.127.051.123.052.006.002.147.048.16.021.16-.009.157-.038.147-.067.131-.093.112-.116.089-.135.062-.149.033-.158.004-.16-.027-.16-.055-.151-.083-.138-.107-.121-.127-.099-.118-.063-.004-.001-.005-.003-.005-.002-.133-.056-.005-.002-.005-.002-.134-.054-.004-.002-.005-.002-.135-.053-.005-.002-.005-.002-.135-.051-.005-.002-.005-.002-.135-.05-.005-.001-.005-.002-.137-.048-.005-.001-.005-.002-.137-.046-.005-.002-.005-.002-.137-.044-.005-.002-.005-.001-.138-.043-.005-.002-.006-.001-.138-.042-.005-.001-.005-.002-.14-.04H19.4l-.005-.002-.14-.038-.005-.001-.005-.002-.14-.036-.005-.001-.005-.001-.141-.035-.005-.001-.005-.001-.142-.033-.005-.001-.005-.001-.141-.031-.006-.002h-.005l-.142-.03-.005-.001-.005-.001-.143-.028h-.005l-.005-.001-.143-.026-.006-.001-.005-.001-.143-.024-.005-.001-.006-.001-.143-.022-.006-.001h-.005l-.144-.022h-.005l-.006-.001-.144-.019h-.005l-.006-.001-.144-.017h-.006l-.005-.001-.145-.016h-.011l-.145-.014H17.1l-.005-.001-.146-.012h-.01l-.146-.01-.006-.001h-.005l-.146-.009h-.011l-.147-.006h-.01l-.147-.005h-.011l-.147-.003h-.01l-.148-.001h-.01zM10.357 4.66l-.156.037-.123.053-.06.032-.005.002-.004.003-.128.069-.004.002-.005.003-.126.07-.005.003-.004.002-.126.072-.005.003-.004.003-.125.073-.004.003-.005.003-.124.075-.004.003-.005.002-.123.077-.004.003-.005.003-.122.078-.004.003-.005.003-.121.08-.004.002-.005.003-.12.082-.005.003-.004.003-.12.083-.004.003-.004.003-.118.084-.005.003-.004.003-.118.086-.004.003-.004.003-.117.088-.004.003-.004.003-.116.089-.004.003-.004.004-.114.09-.005.003-.004.003-.113.092-.004.004-.004.003-.113.093-.004.004-.004.003-.111.095-.004.003-.005.004-.11.096-.004.004-.004.003-.109.098-.004.003-.004.004-.108.1-.004.003-.004.003-.107.101-.004.004-.004.003-.106.102-.003.004-.004.004-.105.103-.004.004-.004.004-.103.105-.004.004-.004.003-.102.106-.003.004-.004.004-.1.107-.004.004-.004.004-.099.108-.004.004-.003.004-.098.11-.003.003-.004.004-.096.11-.004.005-.003.004-.095.111-.003.004-.004.004-.093.113-.003.004-.004.004-.092.113-.003.004-.003.005-.09.114-.004.004-.003.004-.089.116-.003.004-.003.004-.088.117-.003.004-.003.005-.086.117-.003.004-.003.005-.084.118-.003.004-.003.005-.083.12-.003.003-.003.005-.082.12-.003.005-.002.004-.068.103-.076.142-.048.154-.018.16.011.161.041.156.07.146.095.13.117.11.136.086.15.06.158.03.162.002.158-.029.15-.058.138-.085.119-.108.082-.106.065-.099.075-.11.077-.113.077-.107.08-.11.08-.108.084-.108.083-.105.086-.106.086-.104.088-.104.089-.101.09-.102.093-.101.093-.099.094-.097.095-.096.098-.097.098-.095.099-.093.1-.092.103-.091.101-.089.104-.088.104-.086.106-.086.106-.083.106-.082.109-.082.108-.079.11-.078.11-.076.112-.076.112-.074.113-.072.113-.071.115-.07.115-.068.118-.067.117-.065.12-.065.054-.029.135-.088.116-.111.094-.132.068-.146.04-.156.009-.161-.02-.16-.05-.153-.078-.142-.102-.125-.123-.103-.141-.079-.153-.051-.16-.022-.16.008zm13.91 2.116l-.158.037-.147.066-.132.092-.113.116-.09.134-.063.148-.034.157-.005.162.026.159.054.152.082.139.086.102.09.09.094.098.093.099.092.1.091.103.089.101.088.104.086.104.086.106.083.105.083.108.08.108.081.11.077.107.077.112.075.111.075.114.072.113.071.113.07.115.068.117.067.115.065.118.064.117.062.118.061.12.059.119.059.122.056.121.054.12.055.125.051.123.051.125.048.123.049.127.046.126.044.125.043.128.042.129.039.126.038.13.022.076.058.15.086.137.109.119.129.096.145.07.155.043.16.013.161-.017.155-.046.143-.074.126-.1.106-.122.082-.138.055-.152.025-.16-.005-.16-.026-.132-.023-.082-.002-.005-.001-.005-.042-.139-.001-.005-.002-.005-.043-.138-.001-.005-.002-.005-.044-.137-.002-.005-.002-.005-.046-.137-.002-.005-.001-.005-.048-.137-.002-.005-.002-.005-.05-.135-.001-.005-.002-.005-.051-.135-.002-.005-.002-.005-.053-.135-.002-.005-.002-.005-.054-.133-.002-.005-.002-.005-.057-.133-.002-.005-.002-.005-.057-.132-.003-.005-.002-.005-.059-.132-.002-.005-.002-.004-.061-.132-.003-.004-.002-.005-.062-.13-.003-.005-.002-.005-.064-.13-.003-.004-.002-.005-.066-.129-.002-.004-.003-.005-.067-.128-.002-.005-.003-.004-.069-.128-.002-.004-.003-.005-.07-.126-.003-.005-.003-.004-.072-.126-.002-.005-.003-.004-.073-.125-.003-.004-.003-.005-.075-.124-.003-.004-.003-.005-.076-.123-.003-.004-.003-.005-.078-.122-.003-.004-.003-.005-.08-.121-.003-.004-.003-.005-.08-.12-.004-.005-.003-.004-.083-.12-.003-.004-.003-.004-.084-.118-.003-.005-.003-.004-.086-.117-.003-.005-.003-.004-.088-.117-.003-.004-.003-.004-.09-.116-.002-.004-.004-.004-.09-.114-.003-.005-.004-.004-.091-.113-.004-.004-.003-.004-.093-.113-.004-.004-.003-.004-.095-.111-.004-.004-.003-.004-.096-.11-.004-.005-.003-.004-.098-.109-.004-.004-.003-.004-.1-.108-.003-.004-.004-.004-.1-.107-.004-.004-.004-.004-.102-.106-.003-.003-.004-.004-.093-.095-.124-.103-.14-.08-.153-.05-.16-.023-.16.008zM4.288 12.828l-.158.032-.15.06-.135.088-.117.11-.095.131-.069.146-.035.129-.026.132v.005l-.002.005-.025.143-.001.005-.001.006-.024.143-.001.005-.001.006-.022.143-.001.006-.001.005-.02.144-.001.005-.001.006-.019.144v.005l-.001.006-.017.144v.006l-.001.005-.016.145v.011l-.014.145v.006l-.001.005-.012.146v.01l-.01.146-.001.006v.005l-.009.146v.011l-.007.146v.011l-.004.147v.011l-.003.147v.01l-.002.148v.01l.001.148v.01l.003.147v.011l.005.147v.01l.007.147v.011l.009.146v.011l.01.146v.01l.013.146v.011l.014.145v.005l.001.006.016.145v.011l.018.144v.006l.001.005.019.144v.006l.001.005.021.144v.005l.002.006.022.143v.006l.002.005.024.143v.005l.002.006.025.143.001.005.001.005.028.143.001.005.001.005.03.142v.005l.002.006.03.141.002.005.001.006.033.14v.006l.002.005.035.14v.006l.002.005.036.14.002.005.001.005.038.14.001.005.002.005.04.14v.005l.002.005.042.138.001.006.002.005.042.138.002.005.002.005.017.054.064.148.09.134.114.114.132.092.148.065.157.037.16.007.16-.023.153-.052.14-.08.123-.103.102-.126.076-.142.049-.153.02-.16-.01-.161-.032-.13-.017-.051-.039-.126-.038-.13-.037-.128-.035-.13-.033-.128-.033-.134-.03-.13-.029-.131-.026-.13-.026-.132-.024-.134-.023-.133-.02-.132-.02-.136-.017-.132-.016-.135-.014-.135-.012-.133-.012-.138-.009-.133-.007-.136-.006-.138-.004-.134-.003-.136v-.274l.003-.136.004-.134.006-.139.007-.136.01-.132.01-.139.013-.132.014-.135.016-.135.017-.132.02-.137.02-.13.023-.134.024-.133.024-.126.016-.16-.014-.161-.044-.155-.072-.145-.098-.128-.12-.108-.137-.084-.15-.057-.16-.029-.16.002zm23.286 4.202l-.156.038-.148.066-.132.092-.113.115-.09.134-.062.148-.03.127-.001.004-.023.134-.024.134-.026.132-.026.13-.03.132-.03.129-.032.134-.033.128-.035.13-.037.128-.038.13-.04.126-.04.128-.044.128-.044.126-.046.126-.048.126-.05.125-.05.125-.051.122-.054.123-.055.122-.056.12-.058.122-.06.12-.061.12-.062.119-.063.116-.067.119-.066.116-.068.115-.07.115-.07.113-.073.113-.074.112-.076.113-.077.112-.077.107-.08.11-.08.108-.085.109-.044.056-.088.135-.06.15-.033.158-.002.16.027.16.057.15.083.138.108.12.128.098.144.072.155.045.16.015.161-.016.155-.044.144-.073.128-.098.09-.099.05-.061.003-.004.003-.005.089-.115.003-.004.003-.005.088-.116.003-.004.003-.005.086-.117.003-.004.003-.005.084-.118.003-.004.003-.005.083-.12.003-.004.003-.004.082-.12.003-.005.002-.004.08-.121.003-.005.003-.004.078-.122.003-.005.003-.004.077-.123.002-.005.003-.004.075-.124.003-.005.003-.004.073-.125.003-.004.003-.005.072-.126.002-.004.003-.005.07-.126.003-.005.002-.005.07-.127.002-.004.002-.005.068-.128.002-.005.002-.004.066-.13.003-.004.002-.005.064-.13.002-.004.003-.005.062-.13.003-.005.002-.005.06-.13.003-.005.002-.005.06-.132.002-.005.002-.005.057-.132.003-.005.002-.005.056-.133.002-.005.002-.005.054-.134.002-.004.002-.005.053-.135.002-.005.002-.005.051-.135.002-.005.002-.005.05-.135.001-.005.002-.005.048-.137.001-.005.002-.005.046-.137.002-.005.002-.005.044-.137.002-.005.002-.005.042-.138.002-.005.002-.006.04-.138.002-.005.002-.005.04-.14V19.4l.002-.005.038-.14.001-.005.002-.005.036-.14.001-.005.001-.005.035-.141.001-.005.001-.005.033-.141.001-.006.001-.005.031-.141.002-.006v-.005l.03-.142.001-.005.001-.005.028-.143v-.005l.002-.005.025-.143.001-.006.001-.005.024-.143.001-.005.001-.006.001-.006.01-.161-.02-.16-.05-.154-.077-.141-.102-.125-.123-.104-.141-.079-.153-.051-.16-.022-.16.007zM6.681 22.734l-.152.053-.14.08-.122.105-.101.126-.076.142-.048.154-.018.16.011.161.041.156.07.146.077.11.04.047.003.004.003.004.095.111.003.004.004.004.096.11.004.005.003.004.098.109.003.004.004.004.1.108.003.004.003.004.101.107.004.004.003.004.102.106.004.003.004.004.103.105.004.004.004.004.105.103.004.004.003.003.106.102.004.004.004.004.107.1.004.004.004.004.108.099.004.003.004.004.11.098.003.003.004.004.11.096.005.004.004.003.11.095.005.003.004.004.113.093.004.003.004.004.113.091.004.004.005.003.114.09.004.004.004.003.116.089.004.003.004.003.117.088.004.003.004.003.118.086.004.003.005.003.118.084.004.003.005.003.119.083.004.003.005.003.12.081.005.003.004.003.121.08.005.003.004.003.122.078.005.003.004.003.123.076.005.003.004.003.124.075.005.003.004.003.125.073.004.003.005.003.126.072.004.002.005.003.126.07.005.003.004.002.128.07.004.002.005.002.128.068.005.002.004.002.13.066.004.003.005.002.13.064.004.002.005.003.13.062.005.002.004.003.132.06.004.003.005.002.132.06.005.002.005.002.132.057.005.002.005.003.133.056.005.002.005.002.133.054.005.002.005.002.13.05.154.045.16.016.161-.015.155-.045.144-.072.128-.098.108-.12.083-.138.057-.15.028-.16-.003-.16-.032-.158-.061-.15-.088-.135-.11-.117-.132-.094-.12-.058-.124-.049-.126-.051-.122-.051-.122-.054-.12-.054-.126-.058-.119-.057-.12-.06-.12-.06-.118-.063-.117-.064-.119-.066-.116-.066-.115-.068-.115-.07-.113-.07-.115-.074-.112-.074-.11-.075-.11-.076-.112-.079-.11-.08-.109-.082-.106-.082-.104-.082-.106-.086-.105-.087-.101-.086-.105-.091-.1-.09-.1-.091-.1-.094-.097-.094-.1-.098-.093-.095-.096-.1-.093-.098-.092-.101-.089-.1-.09-.102-.088-.104-.036-.043-.114-.114-.133-.091-.148-.065-.157-.036-.161-.006-.16.024zm15.063 2.691l-.156.044-.12.057-.06.034-.12.066-.116.064-.119.062-.12.061-.12.06-.118.057-.126.058-.12.054-.122.054-.122.05-.126.052-.125.05-.124.046-.127.047-.125.044-.129.043-.126.04-.13.042-.128.038-.127.036-.13.035-.131.034-.129.031-.132.03-.13.03-.135.027-.133.026-.13.023-.13.022-.137.021-.132.02-.134.017-.132.015-.138.015-.135.013-.133.01-.138.01-.136.007-.134.006-.136.004-.14.003-.16.018-.155.047-.142.076-.127.1-.105.122-.08.14-.054.151-.025.16.006.16.035.158.064.148.09.134.114.114.133.092.147.065.157.036.134.008.145-.002h.011l.147-.005h.01l.147-.007h.011l.146-.009h.011l.146-.01h.005l.005-.001.146-.012h.011l.145-.014h.005l.006-.001.145-.016h.011l.144-.018h.006l.005-.001.144-.02h.011l.144-.021h.005l.006-.002.143-.022h.006l.005-.002.143-.024h.005l.006-.002.143-.026h.005l.005-.002.143-.027.005-.001.005-.001.142-.03h.005l.005-.002.142-.03.005-.002.005-.001.142-.033.005-.001.005-.001.14-.035.006-.001.005-.001.14-.036.005-.002.005-.001.14-.038.005-.001.005-.002.14-.04h.005l.005-.002.138-.042.005-.001.006-.002.138-.043.005-.001.005-.002.137-.044.005-.002.005-.002.137-.046.005-.002.005-.001.137-.048.005-.002.005-.002.135-.05.005-.001.005-.002.135-.051.005-.002.005-.002.135-.053.005-.002.004-.002.134-.054.005-.002.005-.002.133-.056.005-.003.005-.002.132-.057.005-.002.005-.003.132-.059.005-.002.004-.002.131-.061.005-.003.005-.002.13-.062.005-.003.005-.002.13-.064.004-.002.005-.003.129-.066.004-.002.005-.003.128-.067.005-.002.004-.003.127-.069.005-.002.005-.003.126-.07.005-.003.004-.002.065-.038.132-.093.112-.115.089-.135.062-.149.034-.157.004-.161-.027-.16-.055-.15-.082-.14-.107-.12-.127-.1-.144-.073-.154-.045-.16-.017-.161.014zM15.994 0l-.187.001h-.011l-.188.004h-.011l-.187.006h-.011l-.187.008h-.005L15.2.02l-.187.01h-.005l-.005.001-.187.013h-.01L14.62.06h-.01l-.186.018h-.011l-.185.02-.005.001h-.006l-.185.022-.005.001h-.005l-.185.025h-.005l-.005.001-.184.027h-.006l-.005.001-.184.029h-.005l-.005.001-.183.031-.005.001-.006.001-.182.033-.006.001-.005.001-.182.035-.005.001-.005.001-.182.038h-.005l-.005.002-.181.04h-.005l-.005.002-.18.042-.006.001-.005.001-.18.044-.005.002h-.005l-.17.045-.152.054-.139.082-.121.106-.1.127-.074.143-.046.155-.017.16.013.16.043.156.07.145.097.13.119.108.137.085.15.058.159.03.16-.001.133-.023.165-.043.168-.041.171-.04.171-.037.172-.036.17-.033.173-.03.17-.03.177-.027.171-.025.175-.022.175-.02.175-.02.176-.016.175-.014.177-.012.176-.01.177-.007.174-.006.177-.003L16 1.73h.177l.178.004.174.006.177.007.176.01.177.012.175.014.176.017.175.018.175.02.175.023.171.025.177.027.17.03.173.03.17.033.171.036.154.033.16.02.161-.01.156-.04.146-.069.131-.094.111-.117.088-.135.06-.15.032-.158.002-.16-.027-.16-.057-.15L20 .714l-.108-.12-.128-.097-.144-.073-.129-.038-.158-.035-.005-.001-.005-.001L19.14.31h-.005l-.005-.002-.182-.035h-.006l-.005-.002-.182-.033h-.006l-.005-.002-.183-.03-.005-.001-.005-.001-.184-.029h-.005l-.006-.001-.184-.027h-.005l-.005-.001-.185-.024h-.005L17.968.12 17.783.1l-.006-.001h-.005l-.185-.02h-.006l-.005-.001L17.39.06 17.385.06h-.005l-.187-.015h-.005l-.005-.001-.187-.013h-.01L16.799.02h-.011L16.6.01h-.011l-.187-.006h-.011L16.204 0h-.011L16.005 0h-.01zm8.86 2.939l-.157.033-.15.062-.134.09-.116.111-.093.132-.067.147-.038.156-.01.161.022.16.05.153.078.141.103.124.102.087.045.034.142.106.137.105.14.11.136.11.135.112.134.115.134.117.13.115.132.122.128.12.127.122.127.125.123.126.124.128.121.13.118.128.118.132.117.133.113.134.113.136.11.136.109.137.109.142.104.14.103.14.101.142.1.144.099.146.095.145.094.147.093.15.092.15.087.149.087.15.085.152.083.155.08.152.08.155.04.081.084.138.11.119.128.096.145.072.155.043.16.013.161-.016.155-.046.143-.074.127-.099.106-.12.083-.14.055-.151.026-.16-.004-.16-.034-.158-.05-.124-.042-.085-.002-.004-.003-.005-.084-.165-.002-.004-.003-.005-.086-.164-.002-.004-.003-.005-.088-.162-.002-.005-.003-.005-.09-.161-.002-.005-.003-.004-.092-.16-.002-.005-.003-.005-.094-.16-.003-.004-.003-.004-.096-.159-.002-.004-.003-.005-.098-.157-.003-.004-.003-.005-.1-.156-.003-.004-.002-.005-.102-.154-.003-.005-.003-.004-.104-.154-.003-.004-.003-.005-.106-.152-.003-.004-.003-.005-.108-.151-.003-.004-.003-.005-.11-.15-.003-.004-.003-.004-.111-.15-.004-.003-.003-.005-.113-.147-.004-.004-.003-.005-.115-.146-.004-.004-.003-.004-.117-.145-.004-.004-.003-.004-.12-.144-.003-.004-.003-.004-.121-.142-.003-.004-.004-.004-.123-.141-.003-.004-.004-.004-.125-.14-.003-.004-.004-.004-.127-.138-.003-.004-.004-.004-.128-.136-.004-.004-.004-.004-.13-.135-.004-.004-.003-.004-.133-.134-.003-.004-.004-.003-.134-.133-.004-.003-.004-.004-.135-.13-.004-.004-.004-.004-.136-.128-.004-.004-.004-.004-.138-.126-.004-.004-.004-.003-.14-.125-.004-.004-.004-.003-.14-.123-.005-.004-.004-.003-.142-.121-.004-.004-.004-.003-.144-.12-.004-.003-.004-.003-.145-.117-.004-.004-.004-.003-.147-.115-.004-.004-.004-.003-.148-.113-.004-.003-.004-.004-.149-.111-.004-.003-.004-.004-.05-.036-.14-.083-.15-.055-.16-.027-.16.004zm-18.381.348l-.157.037-.147.066-.111.074-.04.032-.005.003-.004.004-.145.117-.004.003-.004.004-.144.119-.004.003-.004.004-.142.12-.004.004-.004.004-.141.123-.004.003-.004.004-.14.125-.004.003-.004.004-.138.126-.004.004-.004.004-.136.128-.004.004-.004.004-.135.13-.004.004-.004.003-.134.133-.004.003-.004.004-.132.134-.003.004-.004.004-.13.135-.004.004-.004.004-.128.136-.004.004-.004.004-.126.138-.004.004-.003.004-.125.14-.004.004-.003.004-.123.14-.004.005-.003.004-.121.142-.004.004-.003.004-.12.144-.003.004-.003.004-.117.145-.004.004-.003.004-.115.146-.004.005-.003.004-.113.147-.003.005-.004.004-.111.149-.003.004-.004.004-.11.15-.002.005-.003.004-.108.151-.003.005-.003.004-.106.152-.003.005-.003.004-.104.154-.003.004-.003.005-.102.154-.003.005-.002.004-.1.156-.003.005-.003.004-.098.157-.003.005-.003.004-.096.159-.002.004-.003.005-.094.16-.003.004-.002.004-.092.16-.003.005-.003.005-.09.161-.002.005-.003.005-.088.162-.002.005-.003.004-.086.164-.002.005-.002.004-.084.165-.003.005-.002.004-.082.166-.002.005-.003.004-.08.167-.002.004-.002.005-.078.168-.002.004-.002.005-.045.1-.053.153-.023.16.007.16.037.157.065.148.092.132.114.114.134.09.148.064.157.035.161.006.16-.025.152-.054.14-.08.121-.106.1-.126.065-.118.043-.095.074-.16.075-.155.077-.157.08-.155.08-.152.083-.155.085-.152.086-.15.088-.149.091-.15.094-.15.094-.147.095-.145.099-.146.1-.144.1-.142.104-.14.104-.14.11-.142.107-.137.11-.136.114-.136.113-.134.117-.133.118-.132.117-.129.122-.13.124-.127.123-.126.127-.125.127-.122.128-.12.132-.122.13-.115.133-.117.135-.115.135-.111.136-.11.037-.03.117-.11.094-.132.068-.146.04-.156.01-.161-.02-.16-.05-.154-.076-.141-.102-.125-.123-.104-.14-.08-.153-.051-.16-.023-.161.008zm24.514 11.15l-.157.04-.146.067-.131.093-.112.117-.088.135-.061.149-.033.157-.005.134.006.14.006.176.003.177.001.178-.001.177-.003.178-.006.177-.007.176-.01.177-.012.176-.015.176-.016.173-.018.175-.02.175-.024.174-.024.175-.027.17-.03.174-.03.173-.033.17-.036.172-.037.17-.04.17-.042.172-.043.168-.045.166-.048.169-.05.167-.052.168-.053.164-.056.166-.058.166-.06.161-.061.164-.063.158-.066.165-.068.16-.07.16-.07.158-.075.159-.074.155-.078.158-.081.158-.06.15-.03.158-.001.161.029.159.058.15.085.137.108.12.13.096.144.07.156.044.16.013.16-.017.155-.046.143-.074.127-.1.107-.12.07-.115.083-.164.003-.005.002-.004.082-.166.002-.005.003-.004.08-.167.002-.005.002-.004.078-.168.002-.004.002-.005.076-.169.002-.004.002-.005.074-.17.002-.004.002-.005.072-.17.002-.005.002-.005.07-.17.002-.006.001-.005.068-.172.002-.004.002-.005.065-.173.002-.005.002-.005.063-.173.002-.005.002-.005.06-.174.003-.005.001-.005.06-.175.001-.005.002-.005.057-.176.001-.005.002-.005.055-.177.001-.005.002-.005.052-.177.002-.005.001-.005.051-.178.001-.005.002-.005.048-.179.002-.005v-.005l.047-.179.001-.005.002-.005.044-.18v-.005l.002-.005.042-.18.001-.006.001-.005.04-.18.001-.006.001-.005.038-.182v-.005l.002-.005.035-.182v-.006l.002-.005.033-.182v-.006l.002-.005.03-.183.001-.005.001-.005.029-.184v-.005l.001-.006.027-.184v-.005l.001-.005.024-.185v-.005l.001-.005.022-.185v-.006l.001-.005.02-.185v-.006l.001-.005.017-.186v-.005l.001-.005.015-.187v-.005l.001-.005.013-.187v-.01l.01-.187.001-.006v-.005l.009-.187v-.011l.006-.187v-.011l.004-.188v-.011l.001-.188v-.01l-.001-.188v-.011l-.004-.188v-.011l-.006-.187v-.011l-.007-.145-.022-.16-.05-.152-.08-.141-.103-.124-.125-.102-.141-.077-.153-.05-.16-.02-.161.009zM.777 15l-.158.032-.15.06-.136.087-.117.11-.095.131-.068.146-.04.156-.012.133-.001.14v.01l.001.188v.011l.004.188v.011l.006.187v.011l.008.187v.011l.011.187v.005l.001.005.013.187v.01l.016.187v.01l.018.186v.011l.02.185.001.005v.006l.022.185.001.005v.005l.025.185v.005l.001.005.027.184v.006l.001.005.029.184v.005l.001.005.031.183.001.005.001.006.033.182.001.005.001.006.035.182.001.005.001.005.038.182v.005l.002.005.04.181v.005l.002.005.042.18.001.006.001.005.044.18.002.005v.005l.047.18.001.004.002.005.048.179.002.005.001.005.05.178.002.005.001.005.053.177.002.005.001.005.055.177.002.005.001.005.057.176.002.005.001.005.06.175.001.005.002.005.061.174.002.005.002.005.063.173.002.005.002.005.065.173.002.005.002.004.067.172.002.005.002.005.07.171.002.005.002.005.072.17.002.005.002.005.074.169.002.005.002.004.076.169.002.005.002.004.078.168.002.004.002.005.08.167.003.004.002.005.082.166.002.004.003.005.02.04.086.136.11.118.13.095.146.07.156.041.16.012.16-.019.155-.048.142-.075.126-.1.105-.123.08-.14.054-.152.024-.16-.006-.16-.036-.158-.051-.123-.018-.034-.078-.158L3.1 22.1l-.074-.16-.071-.156-.07-.162-.068-.16-.067-.164-.062-.158-.062-.164-.059-.161-.058-.166-.056-.166-.053-.164-.052-.168-.05-.167-.048-.17-.045-.165-.043-.168-.043-.172-.039-.17-.037-.17-.036-.172-.033-.17-.03-.173-.03-.174-.027-.17-.025-.175-.022-.174-.021-.175-.018-.175-.017-.173-.014-.176-.012-.176-.01-.177-.007-.176-.006-.177-.003-.178L1.73 16v-.134l-.013-.16-.044-.156-.072-.144-.097-.129-.12-.108-.137-.085-.15-.057L.938 15 .777 15zM6.17 26.842l-.152.052-.14.08-.122.105-.101.126-.076.142-.048.154-.02.16.012.161.041.156.07.146.094.13.096.093.032.026.004.003.004.004.145.117.004.003.004.004.146.115.005.003.004.004.147.113.005.003.004.004.149.111.004.003.004.003.15.11.005.003.004.003.151.108.005.003.004.003.152.106.005.003.004.003.154.104.004.003.005.003.154.102.005.002.004.003.156.1.005.003.004.003.157.098.005.003.004.002.159.096.004.003.005.003.16.094.004.003.004.002.16.092.005.003.005.002.161.09.005.003.005.003.162.088.005.002.004.002.164.087.005.002.004.002.165.084.005.003.004.002.166.082.004.002.005.003.167.08.004.002.005.002.168.078.004.002.005.002.169.076.004.002.005.002.17.074.004.002.005.002.17.072.005.002.005.002.17.07.006.002.005.001.171.068.005.002.005.002.173.065.005.002.005.002.173.063.005.002.005.002.174.061.005.002.005.001.175.06.005.001.005.002.176.057.005.001.005.002.177.055.005.001.005.002.177.052.005.002.005.001.178.051.005.001.005.002.178.048.006.002h.005l.179.047.005.001.005.002.18.044h.005l.005.002.18.042.006.001.005.001.159.035.16.02.16-.01.157-.04.146-.069.13-.094.112-.117.087-.136.06-.149.033-.158.002-.161-.028-.159-.057-.15-.084-.138-.108-.12-.128-.098-.144-.072-.128-.039-.154-.033-.168-.04-.171-.041-.169-.044-.17-.045-.166-.048-.168-.05-.165-.051-.166-.054-.166-.056-.163-.057-.165-.06-.161-.062-.164-.064-.16-.065-.16-.068-.162-.07-.157-.07-.157-.074-.157-.075-.156-.077-.153-.079-.156-.082-.153-.082-.154-.086-.15-.086-.152-.09-.148-.09-.147-.092-.149-.095-.145-.095-.144-.098-.145-.1-.143-.102-.14-.103-.14-.104-.14-.108-.139-.11-.136-.11-.027-.022-.133-.091-.148-.065-.157-.036-.161-.006-.16.024zm19.214.073l-.156.039-.146.067-.11.076-.064.051-.139.11-.14.108-.14.104-.14.103-.143.101-.145.101-.144.098-.145.095-.149.095-.148.093-.147.089-.152.09-.15.086-.154.086-.153.082-.156.082-.153.079-.156.077-.157.075-.157.073-.158.071-.16.07-.16.068-.161.065-.164.064-.161.061-.165.06-.163.058-.166.056-.166.054-.166.051-.167.05-.167.048-.17.045-.168.044-.171.042-.168.039-.17.037-.11.023-.154.047-.143.075-.126.1-.106.122-.081.139-.054.152-.025.16.006.16.035.158.063.148.09.133.114.115.132.092.148.065.157.037.16.008.133-.017.115-.024h.005l.005-.002.181-.04h.005l.005-.002.18-.042.006-.001.005-.001.18-.044.005-.002h.005l.18-.047.004-.001.005-.002.179-.048.005-.002.005-.001.178-.05.005-.002.005-.002.177-.052.005-.002.005-.001.177-.055.005-.002.005-.001.176-.057.005-.002.005-.002.175-.059.005-.001.005-.002.174-.061.005-.002.005-.002.173-.063.005-.002.005-.002.173-.065.005-.002.004-.002.172-.068.005-.001.005-.002.171-.07.005-.002.005-.002.17-.072.005-.002.005-.002.169-.074.005-.002.004-.002.169-.076.004-.002.005-.002.168-.078.004-.002.005-.002.167-.08.004-.003.005-.002.166-.082.004-.002.005-.003.165-.084.004-.002.005-.002.163-.087.005-.002.005-.002.162-.088.005-.003.005-.003.161-.09.005-.002.004-.003.16-.092.005-.002.005-.003.16-.094.004-.003.004-.003.158-.096.005-.002.004-.003.158-.098.004-.003.005-.003.156-.1.004-.003.004-.002.155-.102.005-.003.004-.003.154-.104.004-.003.005-.003.152-.106.004-.003.005-.003.151-.108.004-.003.005-.003.15-.11.004-.003.004-.003.149-.111.004-.004.004-.003.148-.113.004-.004.004-.003.147-.115.004-.004.004-.003.068-.055.116-.113.092-.132.066-.147.038-.157.008-.16-.022-.16-.05-.153-.08-.14-.103-.125-.124-.102-.142-.077-.153-.05-.16-.02-.16.009z" +}))); + +function _extends$H() { _extends$H = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$H.apply(this, arguments); } +var IntermediateEventCatchParallelMultipleIcon = (({ + styles = {}, + ...props +}) => /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("svg", _extends$H({ + xmlns: "http://www.w3.org/2000/svg", + width: "32", + height: "32" +}, props), /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("path", { + d: "M15.975.003C8.195-.157.935 6.24.125 13.985c-.855 6.55 2.741 13.46 8.74 16.314 5.666 2.847 13.012 1.99 17.71-2.33 4.745-4.162 6.727-11.243 4.532-17.206C29.09 4.884 23.445.408 17.201.049c-.408-.03-.817-.046-1.226-.046zm-.181 1.724c7.134-.269 13.84 5.68 14.399 12.804.686 6.283-3.267 12.792-9.283 14.862-5.847 2.162-13.025.06-16.557-5.141C.728 19.174.872 11.679 4.985 6.916c2.632-3.171 6.671-5.174 10.809-5.19zm.283 1.553c-6.6-.21-12.671 5.585-12.79 12.185-.292 5.964 4.129 11.817 10.034 12.953 5.47 1.198 11.584-1.613 14.025-6.702 2.525-4.97 1.396-11.585-2.912-15.215-2.282-2.022-5.3-3.217-8.357-3.22zM16 4.975c5.818-.154 11.117 5.082 11.024 10.905.103 5.384-4.23 10.5-9.636 11.043-5.075.667-10.426-2.587-11.885-7.552-1.53-4.73.48-10.428 4.888-12.864A11.082 11.082 0 0116 4.975zm-2.15 3.281v5.534H8.213v4.38h5.636v5.534h4.31V18.17h5.639v-4.38h-5.64V8.256h-4.31zm.865.865h2.583v5.534h5.635v2.65h-5.635v5.533h-2.583v-5.534h-5.64v-2.649h5.64V9.121z" +}))); + +function _extends$G() { _extends$G = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$G.apply(this, arguments); } +var IntermediateEventCatchSignalIcon = (({ + styles = {}, + ...props +}) => /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("svg", _extends$G({ + xmlns: "http://www.w3.org/2000/svg", + width: "32", + height: "32" +}, props), /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("path", { + d: "M15.975.049C8.195-.11.935 6.286.125 14.03c-.855 6.55 2.741 13.46 8.74 16.314 5.666 2.847 13.012 1.99 17.71-2.33 4.745-4.162 6.727-11.243 4.532-17.206C29.09 4.93 23.445.453 17.201.095c-.408-.03-.817-.046-1.226-.046zm-.181 1.724c7.134-.269 13.84 5.68 14.399 12.804.686 6.283-3.267 12.792-9.283 14.862-5.847 2.162-13.025.06-16.557-5.141C.728 19.22.872 11.725 4.985 6.962c2.632-3.171 6.671-5.174 10.809-5.19zm.283 1.553c-6.6-.21-12.671 5.585-12.79 12.185-.292 5.964 4.129 11.817 10.034 12.953 5.47 1.198 11.584-1.613 14.025-6.702 2.525-4.97 1.396-11.585-2.912-15.216-2.282-2.021-5.3-3.216-8.357-3.22zM16 5.021c5.818-.154 11.117 5.082 11.024 10.905.103 5.384-4.23 10.5-9.636 11.043-5.075.667-10.426-2.587-11.885-7.552-1.53-4.73.48-10.428 4.888-12.864A11.083 11.083 0 0116 5.021zm.006 3.521L9.206 20.745h13.598L16.005 8.542zm0 1.775l5.329 9.564H10.677l5.328-9.564z" +}))); + +function _extends$F() { _extends$F = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$F.apply(this, arguments); } +var IntermediateEventCatchTimerIcon = (({ + styles = {}, + ...props +}) => /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("svg", _extends$F({ + xmlns: "http://www.w3.org/2000/svg", + width: "32", + height: "32" +}, props), /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("path", { + d: "M15.97.04h-.127C8.713-.018 2.003 5.334.437 12.286c-1.51 6.123.98 13.005 6.136 16.665 5.125 3.788 12.546 4.105 17.912.623 5.272-3.276 8.33-9.766 7.325-15.916-.904-6.241-5.79-11.7-11.95-13.143A16.082 16.082 0 0015.97.04zm-.181 1.724c.115 0 .23 0 .347.003 6.625-.066 12.823 5.149 13.89 11.69 1.13 5.91-1.908 12.349-7.262 15.138-5.473 3.013-12.866 1.884-17.116-2.726C1.291 21.372.444 13.914 3.802 8.602c2.493-4.112 7.169-6.819 11.987-6.838zm.283 1.554c-.117 0-.234.002-.351.005-6.1 0-11.691 5.049-12.346 11.114-.78 5.684 2.795 11.612 8.218 13.52 5.139 1.943 11.416.101 14.624-4.38 3.461-4.583 3.262-11.538-.596-15.831-2.36-2.747-5.924-4.423-9.549-4.428zm-.078 1.695c.078 0 .156 0 .234.003 5.4 0 10.321 4.556 10.734 9.942.563 5.13-2.958 10.364-7.971 11.678-4.832 1.41-10.457-.935-12.746-5.446-2.463-4.559-1.2-10.795 3.014-13.883a11.072 11.072 0 016.735-2.294zm-.137 3.42c-2.965.02-5.792 1.968-6.884 4.722-1.137 2.693-.509 6.007 1.536 8.096 1.988 2.14 5.263 2.929 8.007 1.926 2.875-.98 4.987-3.824 5.063-6.865.154-2.954-1.622-5.875-4.295-7.13a7.545 7.545 0 00-3.427-.75zm.27 1.381c2.708.013 5.249 2.014 5.88 4.652.704 2.576-.481 5.512-2.788 6.862-2.356 1.478-5.677 1.084-7.611-.918-2.042-1.97-2.405-5.376-.839-7.738 1.11-1.762 3.146-2.877 5.229-2.857h.13zm1.831 1.764l-2.072 3.76c-.64.068-.792 1.039-.202 1.298.39.27.696-.18 1.051-.164h3.168v-.864h-3.18l1.992-3.612-.757-.418z" +}))); + +function _extends$E() { _extends$E = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$E.apply(this, arguments); } +var IntermediateEventNoneIcon = (({ + styles = {}, + ...props +}) => /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("svg", _extends$E({ + xmlns: "http://www.w3.org/2000/svg", + width: "32", + height: "32" +}, props), /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("path", { + d: "M15.848.001C8.113-.093.931 6.281.125 13.983c-.855 6.55 2.741 13.46 8.74 16.314 5.666 2.847 13.012 1.99 17.71-2.33 4.745-4.162 6.727-11.243 4.532-17.207C29.105 4.938 23.55.48 17.367.06A16.448 16.448 0 0015.848 0v.001zm.293 1.727c7.113-.099 13.662 5.97 14.077 13.08.56 6.299-3.516 12.735-9.582 14.679-5.798 2.004-12.806-.12-16.283-5.237C.717 19.159.874 11.638 5.016 6.876 7.722 3.638 11.902 1.63 16.14 1.728zm-.415 1.555C9.157 3.258 3.256 9.156 3.278 15.729c-.16 5.965 4.365 11.725 10.293 12.737 5.409 1.065 11.37-1.744 13.775-6.753 2.534-4.986 1.386-11.627-2.953-15.251-2.364-2.077-5.512-3.27-8.667-3.18zm.507 1.692c5.82-.026 11.013 5.318 10.79 11.143-.024 5.3-4.313 10.267-9.636 10.803-5.075.667-10.426-2.588-11.885-7.553-1.535-4.744.494-10.46 4.925-12.885a11.072 11.072 0 015.806-1.508z" +}))); + +function _extends$D() { _extends$D = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$D.apply(this, arguments); } +var IntermediateEventThrowCompensationIcon = (({ + styles = {}, + ...props +}) => /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("svg", _extends$D({ + xmlns: "http://www.w3.org/2000/svg", + width: "32", + height: "32" +}, props), /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("path", { + d: "M15.975.003C8.195-.156.935 6.24.125 13.985c-.855 6.55 2.741 13.46 8.74 16.314 5.666 2.847 13.012 1.99 17.71-2.33 4.745-4.162 6.727-11.243 4.532-17.206C29.09 4.884 23.445.407 17.201.049c-.408-.03-.817-.046-1.226-.046zm-.181 1.724c7.134-.269 13.84 5.68 14.399 12.804.686 6.283-3.267 12.792-9.283 14.862-5.847 2.162-13.025.06-16.557-5.141C.728 19.174.872 11.679 4.985 6.916c2.632-3.171 6.671-5.174 10.809-5.19zm.283 1.553c-6.6-.21-12.671 5.585-12.79 12.185-.292 5.964 4.129 11.817 10.034 12.953 5.47 1.198 11.584-1.613 14.025-6.702 2.525-4.97 1.396-11.585-2.912-15.216-2.282-2.021-5.3-3.216-8.357-3.22zM16 4.975c5.818-.154 11.117 5.082 11.024 10.905.103 5.384-4.23 10.5-9.636 11.043-5.075.667-10.426-2.587-11.885-7.552-1.53-4.73.48-10.428 4.888-12.864A11.083 11.083 0 0116 4.975zm-.56 5.772l-7.408 5.231 7.409 5.234v-5.057c2.385 1.687 4.771 3.371 7.157 5.057V10.747l-7.157 5.055v-5.055z" +}))); + +function _extends$C() { _extends$C = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$C.apply(this, arguments); } +var IntermediateEventThrowEscalationIcon = (({ + styles = {}, + ...props +}) => /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("svg", _extends$C({ + xmlns: "http://www.w3.org/2000/svg", + width: "32", + height: "32" +}, props), /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("path", { + d: "M15.975.049C8.195-.11.935 6.286.125 14.03c-.855 6.55 2.741 13.46 8.74 16.314 5.666 2.847 13.012 1.99 17.71-2.33 4.745-4.162 6.727-11.243 4.532-17.206C29.09 4.93 23.445.453 17.201.095c-.408-.03-.817-.046-1.226-.046zm-.181 1.724c7.134-.269 13.84 5.68 14.399 12.804.686 6.283-3.267 12.792-9.283 14.862-5.847 2.162-13.025.06-16.557-5.141C.728 19.22.872 11.725 4.985 6.962c2.632-3.171 6.671-5.174 10.809-5.19zm.283 1.553c-6.6-.21-12.671 5.585-12.79 12.185-.292 5.964 4.129 11.817 10.034 12.953 5.47 1.198 11.584-1.613 14.025-6.702 2.525-4.97 1.396-11.585-2.912-15.216-2.282-2.021-5.3-3.216-8.357-3.22zM16 5.021c5.818-.154 11.117 5.082 11.024 10.905.103 5.384-4.23 10.5-9.636 11.043-5.075.667-10.426-2.587-11.885-7.552-1.53-4.73.48-10.428 4.888-12.864A11.083 11.083 0 0116 5.021zm.006 3.927c-1.672 4.654-2.734 9.502-4.406 14.155 1.534-1.525 2.872-3.234 4.406-4.759l4.406 4.76c-1.496-4.71-2.91-9.446-4.406-14.156z" +}))); + +function _extends$B() { _extends$B = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$B.apply(this, arguments); } +var IntermediateEventThrowLinkIcon = (({ + styles = {}, + ...props +}) => /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("svg", _extends$B({ + xmlns: "http://www.w3.org/2000/svg", + width: "32", + height: "32" +}, props), /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("path", { + d: "M15.975.049C8.195-.11.935 6.286.125 14.03c-.855 6.55 2.741 13.46 8.74 16.314 5.666 2.847 13.012 1.99 17.71-2.33 4.745-4.162 6.727-11.243 4.532-17.206C29.09 4.93 23.445.453 17.201.095c-.408-.03-.817-.046-1.226-.046zm-.181 1.724c7.134-.269 13.84 5.68 14.399 12.804.686 6.283-3.267 12.792-9.283 14.862-5.847 2.162-13.025.06-16.557-5.141C.728 19.22.872 11.725 4.985 6.962c2.632-3.171 6.671-5.174 10.809-5.19zm.283 1.553c-6.6-.21-12.671 5.585-12.79 12.185-.292 5.964 4.129 11.817 10.034 12.953 5.47 1.198 11.584-1.613 14.025-6.702 2.525-4.97 1.396-11.585-2.912-15.216-2.282-2.021-5.3-3.216-8.357-3.22zM16 5.021c5.818-.154 11.117 5.082 11.024 10.905.103 5.384-4.23 10.5-9.636 11.043-5.075.667-10.426-2.587-11.885-7.552-1.53-4.73.48-10.428 4.888-12.864A11.083 11.083 0 0116 5.021zm1.78 4.093v3.555H9.785v6.714h7.994v3.554l5.829-6.911-5.83-6.912z" +}))); + +function _extends$A() { _extends$A = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$A.apply(this, arguments); } +var IntermediateEventThrowMessageIcon = (({ + styles = {}, + ...props +}) => /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("svg", _extends$A({ + xmlns: "http://www.w3.org/2000/svg", + width: "32", + height: "32" +}, props), /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("path", { + d: "M15.975.003C8.195-.156.935 6.24.125 13.985c-.855 6.55 2.741 13.46 8.74 16.314 5.666 2.847 13.012 1.99 17.71-2.33 4.745-4.162 6.727-11.243 4.532-17.206C29.09 4.884 23.445.407 17.201.049c-.408-.03-.817-.046-1.226-.046zm-.181 1.724c7.134-.269 13.84 5.68 14.399 12.804.686 6.283-3.267 12.792-9.283 14.862-5.847 2.162-13.025.06-16.557-5.141C.728 19.174.872 11.679 4.985 6.916c2.632-3.171 6.671-5.174 10.809-5.19zm.283 1.553c-6.6-.21-12.671 5.585-12.79 12.185-.292 5.964 4.129 11.817 10.034 12.953 5.47 1.198 11.584-1.613 14.025-6.702 2.525-4.97 1.396-11.585-2.912-15.216-2.282-2.021-5.3-3.216-8.357-3.22zM16 4.975c5.818-.154 11.117 5.082 11.024 10.905.103 5.384-4.23 10.5-9.636 11.043-5.075.667-10.426-2.587-11.885-7.552-1.53-4.73.48-10.428 4.888-12.864A11.083 11.083 0 0116 4.975zm-5.91 5.475l6.04 4.901 6.042-4.9H10.088zm-1.341 1.138v9.921h14.514V11.79l-7.132 5.787-7.382-5.99z" +}))); + +function _extends$z() { _extends$z = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$z.apply(this, arguments); } +var IntermediateEventThrowMultipleIcon = (({ + styles = {}, + ...props +}) => /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("svg", _extends$z({ + xmlns: "http://www.w3.org/2000/svg", + width: "32", + height: "32" +}, props), /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("path", { + d: "M15.975.003C8.195-.156.935 6.24.125 13.985c-.855 6.55 2.741 13.46 8.74 16.314 5.666 2.847 13.012 1.99 17.71-2.33 4.745-4.162 6.727-11.243 4.532-17.206C29.09 4.884 23.445.407 17.201.049c-.408-.03-.817-.046-1.226-.046zm-.181 1.724c7.134-.269 13.84 5.68 14.399 12.804.686 6.283-3.267 12.792-9.283 14.862-5.847 2.162-13.025.06-16.557-5.141C.728 19.174.872 11.679 4.985 6.916c2.632-3.171 6.671-5.174 10.809-5.19zm.283 1.553c-6.6-.21-12.671 5.585-12.79 12.185-.292 5.964 4.129 11.817 10.034 12.953 5.47 1.198 11.584-1.613 14.025-6.702 2.525-4.97 1.396-11.585-2.912-15.216-2.282-2.021-5.3-3.216-8.357-3.22zM16 4.975c5.818-.154 11.117 5.082 11.024 10.905.103 5.384-4.23 10.5-9.636 11.043-5.075.667-10.426-2.587-11.885-7.552-1.53-4.73.48-10.428 4.888-12.864A11.083 11.083 0 0116 4.975zm.006 3.073l-7.62 5.532 2.91 8.95h9.42l2.91-8.95-7.62-5.532z" +}))); + +function _extends$y() { _extends$y = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$y.apply(this, arguments); } +var IntermediateEventThrowSignalIcon = (({ + styles = {}, + ...props +}) => /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("svg", _extends$y({ + xmlns: "http://www.w3.org/2000/svg", + width: "32", + height: "32" +}, props), /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("path", { + d: "M15.975.003C8.195-.156.935 6.24.125 13.985c-.855 6.55 2.741 13.46 8.74 16.314 5.666 2.847 13.012 1.99 17.71-2.33 4.745-4.162 6.727-11.243 4.532-17.206C29.09 4.884 23.445.407 17.201.049c-.408-.03-.817-.046-1.226-.046zm-.181 1.724c7.134-.269 13.84 5.68 14.399 12.804.686 6.283-3.267 12.792-9.283 14.862-5.847 2.162-13.025.06-16.557-5.141C.728 19.174.872 11.679 4.985 6.916c2.632-3.171 6.671-5.174 10.809-5.19zm.283 1.553c-6.6-.21-12.671 5.585-12.79 12.185-.292 5.964 4.129 11.817 10.034 12.953 5.47 1.198 11.584-1.613 14.025-6.702 2.525-4.97 1.396-11.585-2.912-15.216-2.282-2.021-5.3-3.216-8.357-3.22zM16 4.975c5.818-.154 11.117 5.082 11.024 10.905.103 5.384-4.23 10.5-9.636 11.043-5.075.667-10.426-2.587-11.885-7.552-1.53-4.73.48-10.428 4.888-12.864A11.083 11.083 0 0116 4.975zm.006 3.52c-2.261 4.07-4.533 8.136-6.798 12.205h13.596L16.005 8.495z" +}))); + +function _extends$x() { _extends$x = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$x.apply(this, arguments); } +var LaneIcon = (({ + styles = {}, + ...props +}) => /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("svg", _extends$x({ + xmlns: "http://www.w3.org/2000/svg", + width: "32", + height: "32" +}, props), /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("path", { + d: "M0 7v18.62h32V7H0zm1.655 17.056V8.684h28.62v15.372H1.656z" +}))); + +function _extends$w() { _extends$w = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$w.apply(this, arguments); } +var ManualTaskIcon = (({ + styles = {}, + ...props +}) => /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("svg", _extends$w({ + xmlns: "http://www.w3.org/2000/svg", + width: "32", + height: "32" +}, props), /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("path", { + d: "M6.494 3C2.916 3 0 5.903 0 9.475v13.383c0 3.572 2.916 6.475 6.494 6.475h19.012c3.578 0 6.494-2.903 6.494-6.475V9.475C32 5.903 29.084 3 25.506 3H6.494zm0 2h19.012C28.015 5 30 6.98 30 9.475v13.383c0 2.495-1.985 4.475-4.494 4.475H6.494C3.985 27.333 2 25.353 2 22.858V9.475C2 6.98 3.985 5 6.494 5zm4.43 1.328c-.222.005-.43.09-.606.203-.985.638-4.356 2.977-5.096 3.486-.67.46-1.12 1.153-1.38 1.974-.27.858-.235 1.793-.232 2.576.002.59.016 1.104.17 1.727.22.908.634 1.63 1.23 2.118.597.49 1.363.732 2.23.734 3.038.012 6.078.016 9.119 0 .327-.002.645-.127.848-.37.204-.241.287-.56.291-.914a1.732 1.732 0 00-.097-.625h.327c.335 0 .641-.11.852-.316.21-.206.317-.475.374-.754a1.783 1.783 0 00-.126-1.143 1.18 1.18 0 00.877-.521c.196-.306.257-.666.258-1.025.001-.375-.088-.738-.293-1.033a1.179 1.179 0 00-.958-.512h-.478c.108-.237.156-.505.155-.782-.003-.373-.098-.721-.316-.99a1.21 1.21 0 00-.943-.43c-2.273-.004-4.236.018-6.412.012l-.19-.001c.102-.104.202-.205.312-.314.337-.336.662-.652.83-.869.4-.516.46-1.215.123-1.729-.178-.272-.439-.456-.72-.494a.93.93 0 00-.148-.008zm.029.728l.022.001c.055.008.115.027.209.172.132.201.126.606-.09.884-.079.102-.431.465-.767.8-.337.334-.657.643-.815.836-.153.186-.096.338-.056.435.04.096.085.212.298.263.063.014.066.01.086.012l.066.003c2.429.027 4.986-.004 7.223-.003.194 0 .293.056.379.162.086.105.151.286.153.533 0 .257-.065.467-.155.59-.09.124-.183.182-.37.183-1.706-.001-3.411-.005-5.117-.009v.731c2.23.004 4.461.01 6.692.012.17 0 .265.06.361.2.096.138.164.364.163.615 0 .268-.058.501-.143.634-.085.132-.162.193-.385.195-2.32-.001-4.554-.006-6.688-.003v.73c1.905 0 3.809.003 5.713.001.194.005.316.09.416.26.102.173.151.442.093.728-.04.193-.102.313-.17.38-.067.065-.148.108-.343.108h-5.71l.002.734c1.445 0 2.89-.01 4.334-.001.162 0 .232.041.297.123.064.081.123.238.12.488-.003.244-.061.385-.12.455-.06.07-.127.11-.296.11-3.037.016-6.076.012-9.113 0-.735-.002-1.316-.196-1.77-.568-.454-.372-.793-.935-.986-1.728-.134-.546-.146-.978-.148-1.558-.003-.796-.018-1.664.199-2.354.222-.705.582-1.24 1.096-1.593.75-.515 4.14-2.866 5.079-3.474a.504.504 0 01.241-.087z" +}))); + +function _extends$v() { _extends$v = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$v.apply(this, arguments); } +var MessageFlowIcon = (({ + styles = {}, + ...props +}) => /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("svg", _extends$v({ + xmlns: "http://www.w3.org/2000/svg", + width: "32", + height: "32" +}, props), /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("path", { + d: "M4.073 26.607l1.295 1.296L1.325 32l-.662-.633L0 30.735l4.073-4.128zm6.953-7.046l1.296 1.296L1.325 32l7.555-7.656-1.295-1.296 1.455-1.474 1.986-2.013zM32 .06s-2.699 5.189-5.417 10.462l-.326.633c-1.14 2.214-2.265 4.407-3.176 6.2-1.228-1.222-2.449-2.452-3.676-3.675l-3.57 3.618-1.297-1.296 3.541-3.588c-.98-.964-1.932-1.958-2.923-2.91l-.753-.706c2.68-1.258 6.533-3.165 9.95-4.876l.617-.309C28.838 1.673 32 .06 32 .06zm-4.126 4.06l-.015.007-.115.057-.048.024-.115.057L17.7 9.172l5.017 4.948 5.157-10z" +}))); + +function _extends$u() { _extends$u = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$u.apply(this, arguments); } +var ParticipantIcon = (({ + styles = {}, + ...props +}) => /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("svg", _extends$u({ + xmlns: "http://www.w3.org/2000/svg", + width: "32", + height: "32" +}, props), /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("path", { + d: "M0 5v22.069h32V5H0zm30.276 1.684v18.82H6.62V6.684h23.655zm-28.62 0h3.31v18.82h-3.31V6.684z" +}))); + +function _extends$t() { _extends$t = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$t.apply(this, arguments); } +var ProcessIcon = (({ + styles = {}, + ...props +}) => /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("svg", _extends$t({ + xmlns: "http://www.w3.org/2000/svg", + width: "32", + height: "32" +}, props), /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("path", { + fillRule: "evenodd", + d: "M16.177 0l.137.002c.452.009.9.037 1.342.082.346.036.62.303.68.646l.437 2.536c.055.319.296.57.608.655.986.269 1.923.653 2.796 1.14.28.155.624.145.885-.039l2.083-1.47a.775.775 0 01.937.022c.86.699 1.645 1.484 2.343 2.343.22.27.223.653.023.937l-1.439 2.038a.833.833 0 00-.031.896c.512.889.92 1.846 1.204 2.855a.833.833 0 00.653.601l2.435.42c.342.059.61.333.645.679a15.928 15.928 0 01.08 2.064l-.003.114c-.012.382-.038.76-.077 1.134a.775.775 0 01-.645.68l-2.396.412a.835.835 0 00-.656.61 12.511 12.511 0 01-1.2 2.917.832.832 0 00.034.892l1.396 1.978c.2.284.196.667-.023.936a16.104 16.104 0 01-2.343 2.343.775.775 0 01-.937.023l-1.99-1.404a.833.833 0 00-.88-.026c-.907.516-1.886.922-2.916 1.2a.833.833 0 00-.61.656l-.414 2.396a.775.775 0 01-.679.646 16.096 16.096 0 01-3.312 0 .775.775 0 01-.679-.646l-.423-2.452a.834.834 0 00-.598-.636 12.474 12.474 0 01-1.468-.514 12.49 12.49 0 01-1.417-.68.833.833 0 00-.878.03l-2.026 1.43a.775.775 0 01-.937-.023 16.069 16.069 0 01-2.342-2.342.774.774 0 01-.024-.936l1.402-1.986a.833.833 0 00.032-.896 12.507 12.507 0 01-1.214-2.911.833.833 0 00-.655-.606l-2.386-.412a.775.775 0 01-.646-.678 16.097 16.097 0 010-3.314.775.775 0 01.646-.678l2.386-.412a.833.833 0 00.655-.606 12.507 12.507 0 011.214-2.911.833.833 0 00-.032-.896L3.552 6.853a.774.774 0 01.023-.936 16.091 16.091 0 012.343-2.343.775.775 0 01.937-.023l2.03 1.433c.26.177.6.182.874.028.915-.512 1.88-.9 2.87-1.167a.833.833 0 00.612-.656l.424-2.46a.775.775 0 01.679-.645C14.845.032 15.348.004 15.85 0h.326zM16 6.4c-5.302 0-9.6 4.297-9.6 9.599 0 5.302 4.298 9.6 9.6 9.6s9.6-4.298 9.6-9.6-4.298-9.6-9.6-9.6zm-3 4.283c0-1.425 1.637-2.203 2.715-1.29l5.69 4.815c.794.672.794 1.91 0 2.583l-5.69 4.815c-1.078.913-2.715.134-2.715-1.29z" +}))); + +function _extends$s() { _extends$s = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$s.apply(this, arguments); } +var ReceiveTaskIcon = (({ + styles = {}, + ...props +}) => /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("svg", _extends$s({ + xmlns: "http://www.w3.org/2000/svg", + width: "32", + height: "32" +}, props), /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("path", { + d: "M6.494 3C2.916 3 0 5.903 0 9.475v13.383c0 3.572 2.916 6.475 6.494 6.475h19.012c3.578 0 6.494-2.903 6.494-6.475V9.475C32 5.903 29.084 3 25.506 3H6.494zm0 2h19.012C28.015 5 30 6.98 30 9.475v13.383c0 2.495-1.985 4.475-4.494 4.475H6.494C3.985 27.333 2 25.353 2 22.858V9.475C2 6.98 3.985 5 6.494 5zM5.23 7.764v11.577h17.55V7.764H5.23zm1.816.758h13.917l-6.959 4.577-6.958-4.577zm-1.06.21l8.018 5.274 8.018-5.275v9.853H5.987V8.73z" +}))); + +function _extends$r() { _extends$r = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$r.apply(this, arguments); } +var ScriptTaskIcon = (({ + styles = {}, + ...props +}) => /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("svg", _extends$r({ + xmlns: "http://www.w3.org/2000/svg", + width: "32", + height: "32" +}, props), /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("path", { + d: "M6.494 3C2.916 3 0 5.903 0 9.475v13.383c0 3.572 2.916 6.475 6.494 6.475h19.012c3.578 0 6.494-2.903 6.494-6.475V9.475C32 5.903 29.084 3 25.506 3H6.494zm0 2h19.012C28.015 5 30 6.98 30 9.475v13.383c0 2.495-1.985 4.475-4.494 4.475H6.494C3.985 27.333 2 25.353 2 22.858V9.475C2 6.98 3.985 5 6.494 5zm2.99 3.077l-.077.045-.026.015c-1.09.646-1.84 1.239-2.336 1.818-.496.579-.735 1.162-.742 1.725-.014 1.119.812 1.958 1.544 2.708.732.75 1.385 1.456 1.446 2.041.032.298-.039.598-.364 1.008-.324.408-.911.897-1.85 1.445l-1.388.808h8.56l.101-.059c.996-.58 1.667-1.116 2.094-1.655.429-.54.603-1.107.547-1.638-.11-1.052-.967-1.818-1.688-2.556-.721-.739-1.306-1.436-1.298-2.092.004-.331.132-.7.535-1.171.402-.47 1.08-1.02 2.119-1.636l1.362-.806h-8.54zm.241.867h5.271a6.83 6.83 0 00-1.113 1.01c-.496.58-.736 1.163-.743 1.726-.014 1.119.812 1.958 1.544 2.708.732.75 1.385 1.456 1.446 2.041.032.298-.039.598-.364 1.008-.312.393-.872.862-1.753 1.386H8.728c.367-.286.658-.566.88-.847.43-.54.604-1.107.548-1.638-.11-1.052-.968-1.818-1.688-2.556-.721-.739-1.306-1.435-1.298-2.092.004-.331.132-.7.534-1.171.389-.454 1.04-.984 2.021-1.575zm-1.233 1.48v.4h4.12v-.4h-4.12zm-.154 2.158v.4H12.6v-.4H8.34zm1.931 2.158v.4h4.126v-.4H10.27zm.59 2.158v.4h4.276v-.4h-4.276z" +}))); + +function _extends$q() { _extends$q = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$q.apply(this, arguments); } +var SendTaskIcon = (({ + styles = {}, + ...props +}) => /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("svg", _extends$q({ + xmlns: "http://www.w3.org/2000/svg", + width: "32", + height: "32" +}, props), /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("path", { + d: "M6.494 3C2.916 3 0 5.903 0 9.475v13.383c0 3.572 2.916 6.475 6.494 6.475h19.012c3.578 0 6.494-2.903 6.494-6.475V9.475C32 5.903 29.084 3 25.506 3H6.494zm0 2h19.012C28.015 5 30 6.98 30 9.475v13.383c0 2.495-1.985 4.475-4.494 4.475H6.494C3.985 27.333 2 25.353 2 22.858V9.475C2 6.98 3.985 5 6.494 5zm-1.38 3.16l8.332 4.717L21.78 8.16H5.114zm.021 1.745v9.309H21.8V9.905l-8.353 4.655-8.31-4.655z" +}))); + +function _extends$p() { _extends$p = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$p.apply(this, arguments); } +var ServiceTaskIcon = (({ + styles = {}, + ...props +}) => /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("svg", _extends$p({ + xmlns: "http://www.w3.org/2000/svg", + width: "32", + height: "32" +}, props), /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("path", { + d: "M6.494 3C2.916 3 0 5.903 0 9.475v13.383c0 3.572 2.916 6.475 6.494 6.475h19.012c3.578 0 6.494-2.903 6.494-6.475V9.475C32 5.903 29.084 3 25.506 3H6.494zm0 2h19.012C28.015 5 30 6.98 30 9.475v13.383c0 2.495-1.985 4.475-4.494 4.475H6.494C3.985 27.333 2 25.353 2 22.858V9.475C2 6.98 3.985 5 6.494 5zm1.22 1.681V7.84c-.329.093-.63.223-.914.382l-.83-.82-1.554 1.561.83.82c-.16.288-.285.594-.372.911l-1.177.002v2.2l1.189-.004c.109.431.345.819.58 1.165v-1.898l-1.038.004v-.737l1.034-.002.058-.294c.084-.429.252-.838.493-1.203l.165-.25-.727-.718.523-.526.728.719.247-.165c.379-.25.793-.417 1.206-.505l.291-.06-.002-1.01h.75L9.19 8.417H11.16c-.185-.221-.951-.508-1.237-.588L9.93 6.68H7.713zm2.078 2.105l.003 1.158a4.19 4.19 0 00-.915.383l-.83-.821-1.553 1.562.83.82c-.16.288-.286.593-.373.91l-1.176.003v2.2l1.188-.004c.094.326.224.624.383.905l-.85.847 1.57 1.543.847-.843c.29.161.599.286.919.373v1.198c.756.006 1.56.003 2.206.003V17.81a4.19 4.19 0 00.915-.383l.847.835 1.554-1.56-.848-.836c.16-.288.286-.594.373-.912l1.152-.007V12.75l-1.165.007a4.09 4.09 0 00-.382-.905l.805-.807-1.57-1.546-.804.806a4.16 4.16 0 00-.915-.372l.007-1.147H9.792zm.732.73h.751l-.006 1.005.297.058c.43.085.844.252 1.21.492l.25.162.701-.704.528.52-.702.704.169.25c.248.374.412.779.505 1.196l.061.292 1.016-.006v.737l-1.01.006-.058.292c-.085.43-.252.838-.494 1.205l-.165.25.744.733-.523.525-.743-.734-.248.165c-.378.247-.789.418-1.203.503l-.294.058v1.067h-.745v-1.059l-.295-.057a3.395 3.395 0 01-1.21-.492l-.248-.162-.747.743-.528-.52.747-.744-.17-.25a3.546 3.546 0 01-.506-1.196l-.06-.291-1.04.004v-.738l1.034-.002.058-.294c.085-.428.252-.837.493-1.203l.165-.25-.726-.718.522-.526.728.72.248-.166a3.546 3.546 0 011.205-.504l.292-.06-.003-1.01zm.388 2.685a1.65 1.65 0 00-1.645 1.645c0 .904.74 1.645 1.645 1.645a1.65 1.65 0 001.645-1.645 1.65 1.65 0 00-1.645-1.645zm0 .73a.91.91 0 01.915.915.91.91 0 01-.915.914.91.91 0 01-.915-.914.91.91 0 01.915-.915z" +}))); + +function _extends$o() { _extends$o = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$o.apply(this, arguments); } +var StartEventCompensationIcon = (({ + styles = {}, + ...props +}) => /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("svg", _extends$o({ + xmlns: "http://www.w3.org/2000/svg", + width: "32", + height: "32" +}, props), /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("path", { + d: "M15.995.001C9.705-.084 3.643 3.964 1.257 9.775-1.235 15.485.06 22.577 4.42 27.03c4.193 4.513 11.102 6.17 16.887 4.058 5.996-2.042 10.423-7.93 10.664-14.269.403-6.227-3.26-12.44-8.87-15.153A15.924 15.924 0 0015.994 0zm0 1.73c6.213-.108 12.122 4.355 13.726 10.357 1.678 5.653-.592 12.198-5.463 15.547-5.06 3.719-12.564 3.45-17.343-.626C2.101 23.171.377 16.07 2.848 10.44c2.14-5.205 7.515-8.774 13.147-8.708zm-.566 9.03l-7.415 5.235 7.415 5.238v-5.062c2.386 1.689 4.775 3.375 7.163 5.062V10.761l-7.163 5.058v-5.058zm-.866 1.666v7.13L9.51 15.993l5.052-3.565zm7.166 0v7.137l-5.052-3.568 5.052-3.569z" +}))); + +function _extends$n() { _extends$n = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$n.apply(this, arguments); } +var StartEventConditionIcon = (({ + styles = {}, + ...props +}) => /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("svg", _extends$n({ + xmlns: "http://www.w3.org/2000/svg", + width: "32", + height: "32" +}, props), /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("path", { + d: "M16 0C7.174 0 0 7.174 0 16s7.174 16 16 16 16-7.174 16-16S24.826 0 16 0zm0 1.73c7.892 0 14.27 6.378 14.27 14.27 0 7.891-6.379 14.27-14.27 14.27S1.73 23.891 1.73 16C1.73 8.108 8.108 1.73 16 1.73zm-5.362 7.523v13.493h10.724V9.253H10.638zm.863.866h8.995V21.88H11.501V10.12zm.928 1.324v.863h7.139v-.863h-7.139zm0 2.605v.867h7.139v-.867h-7.139zm0 3.01v.864h7.139v-.863h-7.139zm0 2.72v.863h7.139v-.863h-7.139z" +}))); + +function _extends$m() { _extends$m = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$m.apply(this, arguments); } +var StartEventErrorIcon = (({ + styles = {}, + ...props +}) => /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("svg", _extends$m({ + xmlns: "http://www.w3.org/2000/svg", + width: "32", + height: "32" +}, props), /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("path", { + d: "M15.995.005C9.705-.08 3.643 3.968 1.257 9.78-1.235 15.49.06 22.581 4.42 27.034c4.193 4.513 11.102 6.17 16.887 4.058 5.996-2.042 10.423-7.93 10.664-14.269.403-6.227-3.26-12.44-8.87-15.153A15.924 15.924 0 0015.994.005zm0 1.73c6.213-.108 12.122 4.355 13.726 10.357 1.678 5.653-.592 12.198-5.463 15.547-5.06 3.719-12.564 3.45-17.343-.626-4.814-3.838-6.538-10.939-4.067-16.57 2.14-5.205 7.515-8.774 13.147-8.708zm6.13 7.45l-3.635 7.37-4.52-5.88c-1.37 4.048-2.738 8.095-4.106 12.143l4.603-5.917 4.748 5.433 2.91-13.149zm-7.754 3.889l4.299 5.449 1.073-2.39-1.028 4.135-4.387-5.16-1.78 2.75 1.823-4.784z" +}))); + +function _extends$l() { _extends$l = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$l.apply(this, arguments); } +var StartEventEscalationIcon = (({ + styles = {}, + ...props +}) => /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("svg", _extends$l({ + xmlns: "http://www.w3.org/2000/svg", + width: "32", + height: "32" +}, props), /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("path", { + d: "M15.995.001C9.705-.084 3.643 3.964 1.257 9.775-1.235 15.485.06 22.577 4.42 27.03c4.193 4.513 11.102 6.17 16.887 4.058 5.996-2.042 10.423-7.93 10.664-14.269.403-6.227-3.26-12.44-8.87-15.153A15.924 15.924 0 0015.994 0zm0 1.73c6.213-.108 12.122 4.355 13.726 10.357 1.678 5.653-.592 12.198-5.463 15.547-5.06 3.719-12.564 3.45-17.343-.626C2.101 23.171.377 16.07 2.848 10.44c2.14-5.205 7.515-8.774 13.147-8.708zm0 7.183c-1.674 4.658-2.736 9.509-4.41 14.166 1.535-1.526 2.874-3.236 4.41-4.763l4.41 4.763c-1.499-4.713-2.913-9.453-4.41-14.166zm.032 2.931c.822 2.588 1.598 5.19 2.42 7.778l-2.42-2.615c-.683.598-2.455 2.887-2.34 2.39.871-2.489 1.448-5.07 2.34-7.553z" +}))); + +function _extends$k() { _extends$k = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$k.apply(this, arguments); } +var StartEventMessageIcon = (({ + styles = {}, + ...props +}) => /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("svg", _extends$k({ + xmlns: "http://www.w3.org/2000/svg", + width: "32", + height: "32" +}, props), /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("path", { + d: "M15.995.001C9.705-.084 3.643 3.964 1.257 9.775-1.235 15.485.06 22.577 4.42 27.03c4.193 4.513 11.102 6.17 16.887 4.058 5.996-2.042 10.423-7.93 10.664-14.269.403-6.227-3.26-12.44-8.87-15.153A15.924 15.924 0 0015.994 0zm0 1.73c6.213-.108 12.122 4.355 13.726 10.357 1.678 5.653-.592 12.198-5.463 15.547-5.06 3.719-12.564 3.45-17.343-.626C2.101 23.171.377 16.07 2.848 10.44c2.14-5.205 7.515-8.774 13.147-8.708zm-7.257 8.732v11.069h14.513v-11.07H8.738zm3.224 1.73h8.064c-1.428.878-2.857 2.807-4.285 3.018l-3.779-3.019zm9.562 1.017v6.593H10.465V13.21l5.528 4.417 5.53-4.418z" +}))); + +function _extends$j() { _extends$j = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$j.apply(this, arguments); } +var StartEventMultipleIcon = (({ + styles = {}, + ...props +}) => /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("svg", _extends$j({ + xmlns: "http://www.w3.org/2000/svg", + width: "32", + height: "32" +}, props), /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("path", { + d: "M15.995.001C9.705-.084 3.643 3.964 1.257 9.775-1.235 15.485.06 22.577 4.42 27.03c4.193 4.513 11.102 6.17 16.887 4.058 5.996-2.042 10.423-7.93 10.664-14.269.403-6.227-3.26-12.44-8.87-15.153A15.924 15.924 0 0015.994 0zm0 1.73c6.213-.108 12.122 4.355 13.726 10.357 1.678 5.653-.592 12.198-5.463 15.547-5.06 3.719-12.564 3.45-17.343-.626C2.101 23.171.377 16.07 2.848 10.44c2.14-5.205 7.515-8.774 13.147-8.708zm0 6.328l-7.626 5.536c.97 2.986 1.942 5.971 2.913 8.957h9.426l2.912-8.957-7.625-5.536zm0 1.068l6.609 4.798-2.525 7.763H11.91l-2.524-7.763 6.609-4.798z" +}))); + +function _extends$i() { _extends$i = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$i.apply(this, arguments); } +var StartEventNonInterruptingConditionIcon = (({ + styles = {}, + ...props +}) => /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("svg", _extends$i({ + xmlns: "http://www.w3.org/2000/svg", + width: "32", + height: "32" +}, props), /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("path", { + d: "M10.632 9.189V22.68h10.723V9.189H10.632zm.862.865h8.994v11.76H11.494v-11.76zm.928 1.324v.863h7.138v-.863h-7.138zm0 2.605v.866h7.138v-.866h-7.138zm0 3.01v.863h7.138v-.863h-7.138zm0 2.72v.862h7.138v-.863h-7.138zM16.12 0h-.232l-.22.004h-.012l-.221.006h-.012l-.22.01h-.012l-.22.013h-.012l-.22.016h-.012l-.22.019h-.005l-.006.001-.22.021h-.006l-.005.001-.22.025h-.011l-.22.028h-.005l-.006.002-.219.03h-.005l-.006.001-.218.033-.006.001-.006.001-.217.036-.006.001-.006.001-.217.039-.006.001-.006.001-.216.042-.006.001-.006.001-.215.045-.006.001-.006.002-.215.047-.006.002-.006.001-.214.05-.006.002-.006.002-.115.029-.152.053-.14.081-.122.106-.1.126-.075.143-.047.154-.018.16.012.16.042.156.07.145.095.13.118.11.137.086.15.059.158.03h.161l.132-.022.11-.028.202-.047.203-.046.208-.043.202-.039.206-.037.206-.034.205-.03.208-.03.205-.025.209-.023.208-.02.21-.017.209-.015.207-.011.21-.009.21-.006.207-.003h.21l.21.002.207.005.207.008.212.011.207.014.208.017.209.019.208.022.205.025.206.028.207.03.208.035.205.036.202.039.052.01.16.018.16-.012.156-.042.146-.07.13-.096.109-.119.085-.136.06-.15.03-.159v-.16l-.03-.16-.059-.15-.086-.136-.109-.118-.13-.096-.145-.07-.128-.038-.057-.011-.006-.002h-.006l-.216-.042-.006-.001-.006-.001-.217-.039H18.9l-.006-.002-.217-.035-.006-.001-.006-.001-.218-.032-.006-.001-.006-.001-.218-.03h-.006l-.006-.001-.219-.027h-.011l-.22-.024-.005-.001h-.006l-.22-.021h-.006l-.006-.001-.22-.017-.005-.001h-.006L17.06.03h-.012l-.22-.012h-.012l-.22-.01h-.012l-.22-.005h-.012L16.132 0h-.012zm8.715 2.783l-.157.034-.149.063-.134.089-.116.112-.092.132-.067.147-.038.157-.008.16.021.16.051.153.079.141.103.124.102.087.052.038h.001l.087.064v.001l.082.061.002.001.076.059h.001l.084.065.082.066.002.001.079.063.002.002.077.063.081.067.002.002.077.065.076.065.001.002.08.07.078.07h.002l.075.068.077.072.002.001.073.069.077.073.072.07.002.001.077.076.07.07v.001l.075.076.07.073.002.001.074.079.002.002.069.074.069.075.074.082.07.08.002.001.068.079h.001l.067.079.068.082.065.078.001.002.068.083.067.084.063.081.001.002.067.087.002.002.063.084.001.001.064.087.008.01.008.01.095.12.093.121.09.119.087.119.088.122.086.123.084.12.081.122.001.002.084.126.08.126.08.127.077.126.079.131.074.127.075.131.073.131.07.13.07.133.069.133.045.09.086.137.109.119.13.096.144.07.156.042.16.013.16-.017.155-.047.143-.075.126-.1.106-.121.082-.14.054-.151.025-.16-.005-.16-.035-.158-.05-.124-.048-.095-.002-.004-.002-.004-.073-.14-.002-.005-.002-.004-.074-.14-.002-.004-.002-.004-.076-.14-.002-.003-.002-.004-.077-.139-.003-.004-.002-.004-.078-.138-.003-.004-.002-.003-.08-.137-.002-.004-.003-.004-.081-.136-.002-.004-.003-.004-.083-.136-.002-.003-.002-.004-.085-.135-.002-.004-.003-.003-.085-.134-.003-.004-.002-.004-.087-.132-.003-.004-.003-.004-.088-.132-.003-.003-.002-.004-.09-.13-.003-.005-.003-.003-.091-.13-.003-.004-.002-.004-.093-.129-.003-.003-.003-.004-.094-.128-.003-.004-.003-.003-.095-.127-.003-.004-.003-.004-.097-.125-.003-.004-.003-.004-.09-.114-.06-.082-.003-.003-.002-.003-.069-.091-.002-.004-.002-.003-.07-.09-.003-.003-.002-.003-.07-.09-.003-.003-.002-.003-.071-.09-.002-.003-.003-.002-.072-.089-.002-.003-.002-.003-.073-.088-.002-.003-.002-.002-.074-.087-.002-.003-.002-.003-.074-.086-.003-.003-.002-.003-.074-.086-.003-.002-.002-.003-.075-.085-.003-.003-.002-.002-.076-.084-.002-.003-.003-.003-.076-.083-.002-.003-.003-.003-.077-.082-.002-.003-.003-.002-.077-.082-.003-.003-.003-.002-.078-.081-.002-.003-.003-.003-.078-.08-.003-.002-.003-.003-.079-.08-.002-.002-.003-.002-.08-.08-.002-.002-.003-.002-.08-.078-.003-.003-.003-.002-.08-.077-.003-.003-.003-.002-.082-.077-.002-.002-.003-.002-.082-.076-.003-.002-.002-.003-.083-.075-.003-.002-.002-.003-.084-.074-.002-.002-.003-.002-.084-.074-.003-.002-.002-.002-.085-.073-.002-.002-.003-.003-.085-.071-.003-.003-.002-.002-.086-.07-.003-.003-.002-.002-.086-.07-.003-.003-.003-.002-.086-.07-.003-.002-.003-.002-.087-.069-.002-.002-.003-.002-.088-.068-.002-.002-.003-.002-.088-.067-.003-.003-.003-.002-.088-.066-.003-.002-.003-.002-.089-.066-.003-.002-.003-.002-.057-.042-.14-.082-.15-.055-.16-.026-.16.004zM6.377 3.21l-.157.037-.148.066-.111.074-.007.006-.003.002-.003.002-.086.069-.003.002-.002.002-.086.07-.003.002-.002.002-.086.07-.002.003-.003.002-.085.071-.002.002-.003.003-.084.071-.003.003-.002.002-.084.072-.003.003-.002.002-.083.073-.003.003-.002.002-.083.074-.002.002-.003.003-.082.074-.003.003-.002.002-.081.076-.003.002-.003.002-.08.077-.003.002-.003.003-.08.076-.002.003-.003.002-.08.078-.002.002-.003.003-.079.078-.002.003-.003.002-.078.08-.003.002-.002.002-.078.08-.002.003-.003.002-.077.08-.003.004-.002.002-.077.081-.002.003-.003.003-.076.082-.002.002-.003.003-.075.082-.002.003-.003.003-.074.083-.003.003-.002.003-.074.084-.003.003-.002.002-.074.085-.002.003-.002.003-.073.085-.003.003-.002.003-.072.086-.002.003-.003.003-.071.087-.003.003-.002.002-.07.088-.003.003-.002.003-.07.088-.003.003-.002.003-.07.09-.002.002-.002.003-.069.09-.002.003-.003.003-.068.09-.002.003-.002.003-.067.092-.003.003-.002.003-.067.092-.002.003-.002.003-.066.092-.002.003-.002.004-.066.093-.002.003-.002.003-.065.094-.002.003-.002.004-.064.094-.002.003-.002.004-.063.095-.002.003-.002.003-.063.097-.002.003-.002.003-.046.073-.05.07-.003.002-.002.003-.067.093-.003.003-.002.003-.066.094-.002.003-.002.003-.066.094-.002.003-.002.003-.064.094-.002.004-.002.003-.064.094-.002.004-.002.003-.062.095-.002.003-.002.003-.062.096-.002.003-.002.003-.06.096-.003.003-.002.003-.06.096-.001.004-.002.003-.059.096-.002.004-.002.003-.058.097-.002.003-.001.003-.057.098-.002.003-.002.003-.056.098-.002.003-.002.003-.055.098-.002.004-.001.003-.055.098-.001.004-.002.003-.054.099-.001.003-.002.003-.052.1-.002.002-.002.004-.051.1-.002.002-.002.004-.05.1-.002.003-.002.003-.05.1v.003l-.002.004-.05.1v.003l-.002.004-.048.1-.002.004-.001.003-.047.101-.002.003-.001.004-.013.027-.052.152-.024.16.006.16.037.157.064.148.091.133.114.114.134.09.147.065.157.036.162.006.159-.024.152-.053.14-.08.122-.105.1-.126.066-.117.01-.023.044-.095.045-.095.002-.003.042-.087.048-.097.048-.095v-.001l.048-.092.001-.001.047-.09.05-.093.002-.002.049-.09.052-.092.001-.002.051-.089.001-.002.051-.087.053-.088.001-.002.055-.091.057-.091.057-.09.001-.002.057-.089.055-.083.001-.002.06-.09.06-.088.062-.089.001-.001.06-.084.063-.088.065-.089.017-.023.016-.025.06-.094.059-.09v-.002l.058-.086.057-.086.001-.001.062-.09.062-.088.001-.002.06-.085.002-.002.06-.082.063-.087.064-.084.002-.002.061-.08.065-.084.064-.08v-.001l.067-.083.067-.082.07-.083.069-.08.063-.074.074-.083.068-.077.002-.002.07-.076.07-.075.072-.077.001-.001.067-.07.076-.078.002-.002.07-.07.075-.075.002-.002.072-.07.075-.072.002-.002.073-.069.074-.068.001-.001.08-.073.076-.068.002-.002.072-.063v-.001l.078-.067.079-.068.002-.001.08-.068.002-.002.077-.063.082-.066.001-.001.075-.06.002-.002.006-.004.117-.111.094-.131.068-.146.04-.156.01-.161-.019-.16-.049-.154-.076-.141-.102-.125-.123-.105-.14-.079-.153-.052-.16-.023-.16.007zm24.596 11.088l-.156.04-.146.067-.131.094-.112.117-.087.135-.061.15-.033.157-.004.134.007.142.005.152.004.15.002.149v.153l.001.011v.015l.004.11.002.11v.002l.002.106v.321l-.003.102-.002.106-.004.107-.005.105-.006.106-.006.106-.008.106v.002l-.008.103v.002l-.01.1-.01.105-.01.105-.013.105-.012.099v.002l-.014.108-.014.1-.016.105-.016.103v.002l-.017.099-.018.104-.019.103v.002l-.019.097-.02.104-.022.103v.001l-.022.098-.023.103v.002l-.024.096-.025.103v.002l-.024.096-.027.102v.003l-.026.093v.001l-.029.103v.002l-.03.099-.028.097v.002l-.03.095-.03.096v.001l-.033.1-.031.095v.002l-.035.1v.003l-.034.094v.003l-.035.096v.001l-.034.09v.002l-.038.098-.036.093v.002l-.038.095-.079.194-.08.188-.085.189-.087.19-.09.184-.092.183-.095.184-.05.093-.064.148-.034.158-.005.16.026.16.054.151.082.14.106.12.127.1.143.075.154.046.16.017.161-.013.156-.042.144-.071.13-.096.109-.119.072-.112.053-.099.003-.005.003-.006.102-.195.003-.006.003-.006.098-.196.003-.006.003-.006.096-.197.002-.006.003-.006.093-.2.002-.006.003-.006.09-.2.002-.006.003-.007.086-.202.003-.006.002-.006.084-.203.002-.005.001-.005.04-.102.002-.003.001-.003.04-.103.001-.003.001-.003.04-.103v-.004l.001-.003.039-.103v-.003l.002-.003.037-.104.001-.003.001-.003.037-.104v-.004l.002-.003.035-.104.002-.003v-.004l.035-.104.002-.004v-.003l.034-.105.002-.003v-.003l.034-.105v-.004l.002-.003.032-.106.001-.003.001-.003.031-.106.001-.003.001-.004.031-.106.001-.003.001-.004.03-.106v-.003l.002-.004.028-.107.001-.003.001-.003.028-.107.001-.004.001-.003.027-.107.001-.004v-.003l.027-.108.001-.003v-.004l.026-.108.001-.003v-.004l.025-.108.001-.003v-.004l.025-.108v-.004l.001-.003.023-.109v-.003l.001-.004.022-.109v-.003l.002-.004.02-.109.001-.004v-.003l.02-.11.002-.003v-.004l.02-.11v-.007l.019-.11v-.003l.001-.004.017-.11v-.004l.001-.003.017-.11v-.008l.016-.11v-.004l.001-.004.015-.11v-.008l.015-.111v-.008l.013-.111v-.007l.013-.112v-.007l.011-.112v-.004l.001-.004.01-.112v-.007l.01-.112v-.008l.008-.112v-.008l.007-.113v-.007l.007-.113v-.008l.005-.113v-.007l.005-.114v-.007l.003-.114v-.007l.003-.114v-.129l.001-.114v-.13l-.003-.114v-.008l-.003-.115v-.007l-.003-.102v-.155l-.003-.158v-.01l-.004-.158v-.01l-.006-.158v-.01l-.007-.148-.023-.16-.051-.152-.08-.14-.103-.124-.125-.102-.142-.077-.153-.05-.16-.02-.161.01zm-30.213.66l-.157.034-.149.063-.134.09-.115.113-.092.132-.067.147-.037.156-.009.134.001.11V15.95l.006.22v.012l.01.22v.012l.012.22v.006l.001.006.015.22v.005l.001.006.018.22.001.006v.006l.022.219v.006l.001.006.024.219.001.006v.006l.028.218.001.006v.006l.031.218.001.006.001.006.033.218.001.006.001.005.037.218v.006l.002.005.04.217v.006l.001.006.043.216.001.006.001.006.046.216v.005l.002.006.048.215.002.006.001.006.051.214.002.006v.006l.055.214.002.005.001.006.057.213.002.006.001.005.06.213.002.005.001.006.063.212.002.005.001.006.066.21.002.006.002.006.068.21.002.005.002.005.07.21.003.005.002.005.074.208.002.006.002.005.077.207.002.006.002.005.08.206.002.005.002.006.082.204.002.006.002.005.086.204.002.005.002.006.088.202.002.005.003.006.09.2.003.006.002.005.094.2.002.006.003.005.096.199.002.005.003.005.03.062.086.137.11.118.128.097.145.07.156.043.16.013.16-.017.155-.047.143-.074.127-.1.106-.121.081-.14.055-.15.025-.16-.005-.161-.034-.158-.05-.124-.028-.055-.092-.19-.087-.188-.087-.192-.083-.19-.08-.193-.078-.194-.076-.196-.073-.195-.07-.197-.067-.198-.065-.199-.063-.2-.059-.2-.056-.2-.055-.204-.05-.201-.049-.202-.046-.205-.043-.206-.04-.203-.038-.207-.034-.204-.032-.207-.028-.205-.026-.207-.023-.208-.02-.207-.018-.207-.014-.208-.011-.207-.009-.208-.005-.207-.002-.104-.017-.16-.046-.155-.074-.143-.1-.126-.121-.107-.139-.081-.152-.055-.159-.025-.161.004zm24.585 11.83l-.156.039-.146.068-.11.076-.015.012-.163.129-.166.127-.168.125-.17.124-.17.12-.172.118-.173.115-.176.114-.177.111-.18.11-.178.105-.182.104-.182.101-.184.1-.184.095-.189.095-.186.09-.188.089-.19.086-.19.082-.193.081-.195.078-.191.074-.197.073-.195.07-.196.065-.198.064-.198.061-.2.058-.2.055-.2.052-.2.049-.151.035-.153.05-.141.078-.125.103-.103.124-.078.14-.05.154-.022.16.009.16.038.157.067.147.093.132.116.112.134.089.149.062.158.034.16.003.133-.02.158-.035.006-.002.006-.001.213-.052.006-.002.007-.001.212-.056.006-.001.006-.002.212-.058.006-.002.006-.002.211-.061.006-.002.006-.002.21-.064.006-.002.006-.002.21-.067.005-.002.006-.002.208-.07.006-.002.006-.003.207-.073.006-.002.006-.002.206-.077.006-.002.005-.002.206-.08.005-.001.006-.003.204-.082.006-.002.005-.002.203-.085.006-.003.005-.002.202-.088.006-.002.005-.003.2-.09.006-.003.006-.003.2-.093.005-.003.005-.002.198-.096.006-.003.005-.003.197-.099.005-.002.005-.003.196-.102.005-.002.005-.003.195-.105.005-.002.005-.003.193-.107.005-.003.005-.003.191-.11.005-.003.005-.003.19-.112.005-.003.005-.003.189-.115.005-.003.005-.003.187-.117.005-.003.004-.004.186-.12.005-.003.004-.003.184-.122.005-.003.005-.004.182-.125.004-.003.005-.003.18-.128.005-.003.005-.003.179-.13.004-.003.005-.004.177-.132.004-.004.005-.003.175-.135.005-.003.004-.004.173-.137.005-.003.004-.004.019-.015.115-.113.092-.132.066-.147.038-.157.008-.16-.022-.16-.052-.153-.079-.14-.103-.124-.125-.102-.142-.078-.153-.05-.16-.02-.16.01zm-19.17.054l-.153.051-.14.079-.124.103-.103.125-.077.141-.05.153-.02.16.009.161.04.156.067.147.093.131.095.094.047.04.005.004.005.004.17.14.005.004.005.004.172.137.004.004.005.003.086.067.003.002.003.002.087.067.003.002.003.002.088.066.002.003.003.002.089.065.002.002.003.002.09.065.002.002.003.002.09.064.002.002.003.002.09.063.003.002.003.002.09.063.003.002.003.002.092.062.002.002.003.002.092.061.003.002.003.002.092.06.003.003.003.001.093.06.003.002.003.002.093.06.003.001.003.002.094.058.003.002.003.002.095.058.003.001.003.002.095.057.003.002.003.002.095.056.003.002.003.002.096.055.004.002.003.001.096.055.003.002.003.002.098.053.003.002.003.002.097.053.004.002.003.001.098.053.003.001.003.002.099.052.003.001.003.002.1.05.003.002.003.002.1.05.003.002.003.001.1.05h.003l.004.003.1.048.004.001.003.002.101.048.003.001.004.002.101.046.004.002.003.001.102.046.004.002.003.001.103.045.003.002.003.001.103.045.004.001.003.002.104.043.003.001.004.002.104.042.003.002.004.001.104.042.004.001.003.002.105.04.004.002.003.001.106.04.003.002h.004l.106.04.004.001.003.002.107.038.003.001.004.001.107.038.003.001.004.001.107.037.004.001.004.001.108.036.003.001.004.001.108.035.004.001.003.001.11.034.003.001.004.001.109.033.004.002h.003l.11.033h.004l.003.002.11.031.004.001.004.001.084.023.081.028.004.001.003.001.109.037.003.001.004.001.109.036.003.001.004.001.109.035h.003l.004.002.11.033.003.001.003.001.11.033.003.001.004.001.109.031.004.002h.003l.11.031.003.001.004.001.11.03h.003l.003.001.11.029h.004l.003.002.11.027.003.001.004.001.11.027h.003l.004.001.004.001.16.022.16-.008.157-.038.147-.067.132-.092.112-.116.09-.134.062-.149.034-.157.004-.161-.025-.16-.055-.151-.082-.139-.107-.12-.127-.1-.143-.074-.124-.04h-.003l-.104-.025-.103-.026h-.002l-.095-.026h-.001l-.101-.027h-.002l-.1-.028h-.002l-.103-.03-.104-.032-.097-.03h-.002l-.103-.033-.102-.033-.101-.034-.106-.036-.027-.01-.027-.007-.107-.03-.104-.029-.104-.03h-.002l-.097-.03-.102-.032-.102-.032-.102-.034-.103-.035-.096-.034-.1-.036-.101-.037h-.002l-.094-.036-.096-.037-.097-.04h-.002l-.099-.04-.098-.042h-.002l-.092-.04-.097-.043-.095-.043-.097-.044h-.002l-.09-.043-.094-.045-.094-.046-.093-.047-.09-.046-.096-.05-.088-.047-.002-.001-.09-.049-.094-.052-.002-.002-.087-.049-.087-.05h-.002l-.088-.053h-.001l-.09-.055-.086-.052-.002-.001-.089-.055-.084-.054h-.002l-.09-.059h-.001l-.085-.056-.001-.001-.084-.056-.082-.056h-.001l-.086-.06-.082-.058H7.79l-.086-.062-.002-.002-.08-.058-.081-.06h-.001l-.085-.064-.002-.002-.076-.058-.002-.002-.082-.064-.161-.128-.162-.133-.04-.034-.132-.092-.147-.066-.157-.038-.16-.008-.16.022z" +}))); + +function _extends$h() { _extends$h = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$h.apply(this, arguments); } +var StartEventNonInterruptingEscalationIcon = (({ + styles = {}, + ...props +}) => /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("svg", _extends$h({ + xmlns: "http://www.w3.org/2000/svg", + width: "32", + height: "32" +}, props), /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("path", { + d: "M16 9.209c-1.674 4.655-2.735 9.504-4.408 14.16 1.534-1.526 2.873-3.235 4.407-4.761l4.408 4.76c-1.497-4.71-2.91-9.448-4.408-14.16zm.031 2.93c.822 2.586 1.598 5.187 2.42 7.774l-2.42-2.614c-.682.598-2.453 2.886-2.34 2.389.873-2.488 1.45-5.068 2.34-7.55zM16.132.364c-1.51.016-3.055.139-4.492.614-.854.442-.266 1.861.651 1.578 2.266-.58 4.656-.596 6.944-.144.935.063 1.21-1.391.318-1.674-1.118-.26-2.274-.361-3.42-.374zm8.865 2.777c-.931-.1-1.262 1.29-.425 1.666 1.863 1.364 3.222 3.298 4.322 5.296.617.737 1.875-.145 1.398-.979-1.184-2.275-2.808-4.384-4.923-5.866a.863.863 0 00-.372-.117zM6.55 3.564c-.734.078-1.196.762-1.735 1.206C3.552 6.02 2.55 7.511 1.681 9.053c-.31.533-.71 1.33-.03 1.767.615.432 1.282-.132 1.446-.742.796-1.475 1.746-2.89 2.934-4.08.43-.548 1.292-.822 1.34-1.595a.874.874 0 00-.822-.839zm24.582 11.078c-.771-.033-1.004.82-.873 1.437.13 2.395-.471 4.797-1.615 6.897-.33.876.984 1.559 1.512.785a14.276 14.276 0 001.761-8.54.865.865 0 00-.785-.579zm-30.195.666c-.774-.06-1.032.785-.905 1.407.117 2.41.732 4.81 1.858 6.945.528.774 1.84.09 1.51-.786A15.932 15.932 0 011.728 16a.876.876 0 00-.79-.692zm24.57 11.817c-.762.099-1.243.835-1.919 1.16-1.514 1.002-3.237 1.632-4.978 2.092-.864.423-.307 1.855.616 1.591 2.528-.578 4.93-1.75 6.913-3.421.469-.522.07-1.42-.631-1.422zm-19.16.042c-.845.001-1.12 1.228-.395 1.628 1.665 1.401 3.667 2.348 5.76 2.912.618.178 1.482.565 1.893-.177.355-.628-.226-1.297-.87-1.326-1.972-.515-3.912-1.285-5.5-2.594-.26-.213-.522-.472-.888-.443z" +}))); + +function _extends$g() { _extends$g = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$g.apply(this, arguments); } +var StartEventNonInterruptingMessageIcon = (({ + styles = {}, + ...props +}) => /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("svg", _extends$g({ + xmlns: "http://www.w3.org/2000/svg", + width: "32", + height: "32" +}, props), /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("path", { + d: "M8.746 10.393v11.064h14.506V10.393H8.746zm3.223 1.728h8.06c-1.428.879-2.856 2.807-4.283 3.018l-3.777-3.018zm9.557 1.018v6.59H10.473v-6.59l5.525 4.416 5.528-4.416zM16.132 0c-1.51.016-3.055.139-4.492.614-.854.442-.266 1.861.651 1.578 2.266-.58 4.656-.596 6.944-.144.935.063 1.21-1.391.318-1.674-1.118-.26-2.274-.361-3.42-.374zm8.865 2.777c-.931-.1-1.262 1.29-.425 1.666 1.863 1.364 3.222 3.298 4.322 5.296.617.737 1.875-.145 1.398-.979-1.184-2.275-2.808-4.384-4.923-5.866a.863.863 0 00-.372-.117zM6.55 3.2c-.734.078-1.196.762-1.735 1.206C3.552 5.656 2.55 7.147 1.681 8.69c-.31.533-.71 1.33-.03 1.767.615.432 1.282-.132 1.446-.742.796-1.475 1.746-2.89 2.934-4.08.43-.548 1.292-.822 1.34-1.595a.874.874 0 00-.822-.839zm24.582 11.078c-.771-.033-1.004.82-.873 1.437.13 2.395-.471 4.797-1.615 6.897-.33.876.984 1.559 1.512.785a14.276 14.276 0 001.761-8.54.865.865 0 00-.785-.579zm-30.195.666c-.774-.06-1.032.785-.905 1.407.117 2.41.732 4.81 1.858 6.945.528.774 1.84.09 1.51-.786a15.932 15.932 0 01-1.672-6.874.876.876 0 00-.79-.692zm24.57 11.817c-.762.099-1.243.835-1.919 1.16-1.514 1.002-3.237 1.632-4.978 2.092-.864.423-.307 1.855.616 1.591 2.528-.578 4.93-1.75 6.913-3.421.469-.522.07-1.42-.631-1.422zm-19.16.042c-.845.001-1.12 1.228-.395 1.628 1.665 1.401 3.667 2.348 5.76 2.912.618.178 1.482.565 1.893-.177.355-.628-.226-1.297-.87-1.326-1.972-.515-3.912-1.285-5.5-2.594-.26-.213-.522-.472-.888-.443z" +}))); + +function _extends$f() { _extends$f = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$f.apply(this, arguments); } +var StartEventNonInterruptingMultipleIcon = (({ + styles = {}, + ...props +}) => /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("svg", _extends$f({ + xmlns: "http://www.w3.org/2000/svg", + width: "32", + height: "32" +}, props), /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("path", { + d: "M23.621 13.524L16 7.99l-7.622 5.534 2.911 8.952h9.422l2.911-8.952zm-1.016.33l-2.523 7.759h-8.165l-2.524-7.76L16 9.059l6.606 4.796zM16.132 0c-1.51.016-3.055.139-4.492.614-.854.442-.266 1.861.651 1.578 2.266-.58 4.656-.596 6.944-.144.935.063 1.21-1.391.318-1.674-1.118-.26-2.274-.361-3.42-.374zm8.865 2.777c-.931-.1-1.262 1.29-.425 1.666 1.863 1.364 3.222 3.298 4.322 5.296.617.737 1.875-.145 1.398-.979-1.184-2.275-2.808-4.384-4.923-5.866a.863.863 0 00-.372-.117zM6.55 3.2c-.734.078-1.196.762-1.735 1.206C3.552 5.656 2.55 7.147 1.681 8.69c-.31.533-.71 1.33-.03 1.767.615.432 1.282-.132 1.446-.742.796-1.475 1.746-2.89 2.934-4.08.43-.548 1.292-.822 1.34-1.595a.874.874 0 00-.822-.839zm24.582 11.078c-.771-.033-1.004.82-.873 1.437.13 2.395-.471 4.797-1.615 6.897-.33.876.984 1.559 1.512.785a14.276 14.276 0 001.761-8.54.865.865 0 00-.785-.579zm-30.195.666c-.774-.06-1.032.785-.905 1.407.117 2.41.732 4.81 1.858 6.945.528.774 1.84.09 1.51-.786a15.932 15.932 0 01-1.672-6.874.876.876 0 00-.79-.692zm24.57 11.817c-.762.099-1.243.835-1.919 1.16-1.514 1.002-3.237 1.632-4.978 2.092-.864.423-.307 1.855.616 1.591 2.528-.578 4.93-1.75 6.913-3.421.469-.522.07-1.42-.631-1.422zm-19.16.042c-.845.001-1.12 1.228-.395 1.628 1.665 1.401 3.667 2.348 5.76 2.912.618.178 1.482.565 1.893-.177.355-.628-.226-1.297-.87-1.326-1.972-.515-3.912-1.285-5.5-2.594-.26-.213-.522-.472-.888-.443z" +}))); + +function _extends$e() { _extends$e = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$e.apply(this, arguments); } +var StartEventNonInterruptingParallelMultipleIcon = (({ + styles = {}, + ...props +}) => /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("svg", _extends$e({ + xmlns: "http://www.w3.org/2000/svg", + width: "32", + height: "32" +}, props), /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("path", { + d: "M13.503 9.016v4.428H9.075v4.98h4.428v4.428h4.98v-4.427h4.428v-4.981h-4.427V9.016h-4.981zm.83.83h3.32v4.428h4.428v3.32h-4.428v4.428h-3.32v-4.454H9.905v-3.294h4.428V9.846zM16.12 0h-.232l-.22.004h-.012l-.221.006h-.012l-.22.01h-.012l-.22.013h-.012l-.22.016h-.012l-.22.019h-.005l-.006.001-.22.021h-.006l-.005.001-.22.025h-.011l-.22.028h-.005l-.006.002-.219.03h-.005l-.006.001-.218.033-.006.001-.006.001-.217.036-.006.001-.006.001-.217.039-.006.001-.006.001-.216.042-.006.001-.006.001-.215.045-.006.001-.006.002-.215.047-.006.002-.006.001-.214.05-.006.002-.006.002-.115.029-.152.053-.14.081-.122.106-.1.126-.075.143-.047.154-.018.16.012.16.042.156.07.145.095.13.118.11.137.086.15.059.158.03h.161l.132-.022.11-.028.202-.047.203-.046.208-.043.202-.039.206-.037.206-.034.205-.03.208-.03.205-.025.209-.023.208-.02.21-.017.209-.015.207-.011.21-.009.21-.006.207-.003h.21l.21.002.207.005.207.008.212.011.207.014.208.017.209.019.208.022.205.025.206.028.207.03.208.035.205.036.202.039.052.01.16.018.16-.012.156-.042.146-.07.13-.096.109-.119.085-.136.06-.15.03-.159v-.16l-.03-.16-.059-.15-.086-.136-.109-.118-.13-.096-.145-.07-.128-.038-.057-.011-.006-.002h-.006l-.216-.042-.006-.001-.006-.001-.217-.039H18.9l-.006-.002-.217-.035-.006-.001-.006-.001-.218-.032-.006-.001-.006-.001-.218-.03h-.006l-.006-.001-.219-.027h-.011l-.22-.024-.005-.001h-.006l-.22-.021h-.006l-.006-.001-.22-.017-.005-.001h-.006L17.06.03h-.012l-.22-.012h-.012l-.22-.01h-.012l-.22-.005h-.012L16.132 0h-.012zm8.715 2.783l-.157.034-.149.063-.134.089-.116.112-.092.132-.067.147-.038.157-.008.16.021.16.051.153.079.141.103.124.102.087.052.038h.001l.087.064v.001l.082.061.002.001.076.059h.001l.084.065.082.066.002.001.079.063.002.002.077.063.081.067.002.002.077.065.076.065.001.002.08.07.078.07h.002l.075.068.077.072.002.001.073.069.077.073.072.07.002.001.077.076.07.07v.001l.075.076.07.073.002.001.074.079.002.002.069.074.069.075.074.082.07.08.002.001.068.079h.001l.067.079.068.082.065.078.001.002.068.083.067.084.063.081.001.002.067.087.002.002.063.084.001.001.064.087.008.01.008.01.095.12.093.121.09.119.087.119.088.122.086.123.084.12.081.122.001.002.084.126.08.126.08.127.077.126.079.131.074.127.075.131.073.131.07.13.07.133.069.133.045.09.086.137.109.119.13.096.144.07.156.042.16.013.16-.017.155-.047.143-.075.126-.1.106-.121.082-.14.054-.151.025-.16-.005-.16-.035-.158-.05-.124-.048-.095-.002-.004-.002-.004-.073-.14-.002-.005-.002-.004-.074-.14-.002-.004-.002-.004-.076-.14-.002-.003-.002-.004-.077-.139-.003-.004-.002-.004-.078-.138-.003-.004-.002-.003-.08-.137-.002-.004-.003-.004-.081-.136-.002-.004-.003-.004-.083-.136-.002-.003-.002-.004-.085-.135-.002-.004-.003-.003-.085-.134-.003-.004-.002-.004-.087-.132-.003-.004-.003-.004-.088-.132-.003-.003-.002-.004-.09-.13-.003-.005-.003-.003-.091-.13-.003-.004-.002-.004-.093-.129-.003-.003-.003-.004-.094-.128-.003-.004-.003-.003-.095-.127-.003-.004-.003-.004-.097-.125-.003-.004-.003-.004-.09-.114-.06-.082-.003-.003-.002-.003-.069-.091-.002-.004-.002-.003-.07-.09-.003-.003-.002-.003-.07-.09-.003-.003-.002-.003-.071-.09-.002-.003-.003-.002-.072-.089-.002-.003-.002-.003-.073-.088-.002-.003-.002-.002-.074-.087-.002-.003-.002-.003-.074-.086-.003-.003-.002-.003-.074-.086-.003-.002-.002-.003-.075-.085-.003-.003-.002-.002-.076-.084-.002-.003-.003-.003-.076-.083-.002-.003-.003-.003-.077-.082-.002-.003-.003-.002-.077-.082-.003-.003-.003-.002-.078-.081-.002-.003-.003-.003-.078-.08-.003-.002-.003-.003-.079-.08-.002-.002-.003-.002-.08-.08-.002-.002-.003-.002-.08-.078-.003-.003-.003-.002-.08-.077-.003-.003-.003-.002-.082-.077-.002-.002-.003-.002-.082-.076-.003-.002-.002-.003-.083-.075-.003-.002-.002-.003-.084-.074-.002-.002-.003-.002-.084-.074-.003-.002-.002-.002-.085-.073-.002-.002-.003-.003-.085-.071-.003-.003-.002-.002-.086-.07-.003-.003-.002-.002-.086-.07-.003-.003-.003-.002-.086-.07-.003-.002-.003-.002-.087-.069-.002-.002-.003-.002-.088-.068-.002-.002-.003-.002-.088-.067-.003-.003-.003-.002-.088-.066-.003-.002-.003-.002-.089-.066-.003-.002-.003-.002-.057-.042-.14-.082-.15-.055-.16-.026-.16.004zM6.377 3.21l-.157.037-.148.066-.111.074-.007.006-.003.002-.003.002-.086.069-.003.002-.002.002-.086.07-.003.002-.002.002-.086.07-.002.003-.003.002-.085.071-.002.002-.003.003-.084.071-.003.003-.002.002-.084.072-.003.003-.002.002-.083.073-.003.003-.002.002-.083.074-.002.002-.003.003-.082.074-.003.003-.002.002-.081.076-.003.002-.003.002-.08.077-.003.002-.003.003-.08.076-.002.003-.003.002-.08.078-.002.002-.003.003-.079.078-.002.003-.003.002-.078.08-.003.002-.002.002-.078.08-.002.003-.003.002-.077.08-.003.004-.002.002-.077.081-.002.003-.003.003-.076.082-.002.002-.003.003-.075.082-.002.003-.003.003-.074.083-.003.003-.002.003-.074.084-.003.003-.002.002-.074.085-.002.003-.002.003-.073.085-.003.003-.002.003-.072.086-.002.003-.003.003-.071.087-.003.003-.002.002-.07.088-.003.003-.002.003-.07.088-.003.003-.002.003-.07.09-.002.002-.002.003-.069.09-.002.003-.003.003-.068.09-.002.003-.002.003-.067.092-.003.003-.002.003-.067.092-.002.003-.002.003-.066.092-.002.003-.002.004-.066.093-.002.003-.002.003-.065.094-.002.003-.002.004-.064.094-.002.003-.002.004-.063.095-.002.003-.002.003-.063.097-.002.003-.002.003-.046.073-.05.07-.003.002-.002.003-.067.093-.003.003-.002.003-.066.094-.002.003-.002.003-.066.094-.002.003-.002.003-.064.094-.002.004-.002.003-.064.094-.002.004-.002.003-.062.095-.002.003-.002.003-.062.096-.002.003-.002.003-.06.096-.003.003-.002.003-.06.096-.001.004-.002.003-.059.096-.002.004-.002.003-.058.097-.002.003-.001.003-.057.098-.002.003-.002.003-.056.098-.002.003-.002.003-.055.098-.002.004-.001.003-.055.098-.001.004-.002.003-.054.099-.001.003-.002.003-.052.1-.002.002-.002.004-.051.1-.002.002-.002.004-.05.1-.002.003-.002.003-.05.1v.003l-.002.004-.05.1v.003l-.002.004-.048.1-.002.004-.001.003-.047.101-.002.003-.001.004-.013.027-.052.152-.024.16.006.16.037.157.064.148.091.133.114.114.134.09.147.065.157.036.162.006.159-.024.152-.053.14-.08.122-.105.1-.126.066-.117.01-.023.044-.095.045-.095.002-.003.042-.087.048-.097.048-.095v-.001l.048-.092.001-.001.047-.09.05-.093.002-.002.049-.09.052-.092.001-.002.051-.089.001-.002.051-.087.053-.088.001-.002.055-.091.057-.091.057-.09.001-.002.057-.089.055-.083.001-.002.06-.09.06-.088.062-.089.001-.001.06-.084.063-.088.065-.089.017-.023.016-.025.06-.094.059-.09v-.002l.058-.086.057-.086.001-.001.062-.09.062-.088.001-.002.06-.085.002-.002.06-.082.063-.087.064-.084.002-.002.061-.08.065-.084.064-.08v-.001l.067-.083.067-.082.07-.083.069-.08.063-.074.074-.083.068-.077.002-.002.07-.076.07-.075.072-.077.001-.001.067-.07.076-.078.002-.002.07-.07.075-.075.002-.002.072-.07.075-.072.002-.002.073-.069.074-.068.001-.001.08-.073.076-.068.002-.002.072-.063v-.001l.078-.067.079-.068.002-.001.08-.068.002-.002.077-.063.082-.066.001-.001.075-.06.002-.002.006-.004.117-.111.094-.131.068-.146.04-.156.01-.161-.019-.16-.049-.154-.076-.141-.102-.125-.123-.105-.14-.079-.153-.052-.16-.023-.16.007zm24.596 11.088l-.156.04-.146.067-.131.094-.112.117-.087.135-.061.15-.033.157-.004.134.007.142.005.152.004.15.002.149v.153l.001.011v.015l.004.11.002.11v.002l.002.106v.321l-.003.102-.002.106-.004.107-.005.105-.006.106-.006.106-.008.106v.002l-.008.103v.002l-.01.1-.01.105-.01.105-.013.105-.012.099v.002l-.014.108-.014.1-.016.105-.016.103v.002l-.017.099-.018.104-.019.103v.002l-.019.097-.02.104-.022.103v.001l-.022.098-.023.103v.002l-.024.096-.025.103v.002l-.024.096-.027.102v.003l-.026.093v.001l-.029.103v.002l-.03.099-.028.097v.002l-.03.095-.03.096v.001l-.033.1-.031.095v.002l-.035.1v.003l-.034.094v.003l-.035.096v.001l-.034.09v.002l-.038.098-.036.093v.002l-.038.095-.079.194-.08.188-.085.189-.087.19-.09.184-.092.183-.095.184-.05.093-.064.148-.034.158-.005.16.026.16.054.151.082.14.106.12.127.1.143.075.154.046.16.017.161-.013.156-.042.144-.071.13-.096.109-.119.072-.112.053-.099.003-.005.003-.006.102-.195.003-.006.003-.006.098-.196.003-.006.003-.006.096-.197.002-.006.003-.006.093-.2.002-.006.003-.006.09-.2.002-.006.003-.007.086-.202.003-.006.002-.006.084-.203.002-.005.001-.005.04-.102.002-.003.001-.003.04-.103.001-.003.001-.003.04-.103v-.004l.001-.003.039-.103v-.003l.002-.003.037-.104.001-.003.001-.003.037-.104v-.004l.002-.003.035-.104.002-.003v-.004l.035-.104.002-.004v-.003l.034-.105.002-.003v-.003l.034-.105v-.004l.002-.003.032-.106.001-.003.001-.003.031-.106.001-.003.001-.004.031-.106.001-.003.001-.004.03-.106v-.003l.002-.004.028-.107.001-.003.001-.003.028-.107.001-.004.001-.003.027-.107.001-.004v-.003l.027-.108.001-.003v-.004l.026-.108.001-.003v-.004l.025-.108.001-.003v-.004l.025-.108v-.004l.001-.003.023-.109v-.003l.001-.004.022-.109v-.003l.002-.004.02-.109.001-.004v-.003l.02-.11.002-.003v-.004l.02-.11v-.007l.019-.11v-.003l.001-.004.017-.11v-.004l.001-.003.017-.11v-.008l.016-.11v-.004l.001-.004.015-.11v-.008l.015-.111v-.008l.013-.111v-.007l.013-.112v-.007l.011-.112v-.004l.001-.004.01-.112v-.007l.01-.112v-.008l.008-.112v-.008l.007-.113v-.007l.007-.113v-.008l.005-.113v-.007l.005-.114v-.007l.003-.114v-.007l.003-.114v-.129l.001-.114v-.13l-.003-.114v-.008l-.003-.115v-.007l-.003-.102v-.155l-.003-.158v-.01l-.004-.158v-.01l-.006-.158v-.01l-.007-.148-.023-.16-.051-.152-.08-.14-.103-.124-.125-.102-.142-.077-.153-.05-.16-.02-.161.01zm-30.213.66l-.157.034-.149.063-.134.09-.115.113-.092.132-.067.147-.037.156-.009.134.001.11V15.95l.006.22v.012l.01.22v.012l.012.22v.006l.001.006.015.22v.005l.001.006.018.22.001.006v.006l.022.219v.006l.001.006.024.219.001.006v.006l.028.218.001.006v.006l.031.218.001.006.001.006.033.218.001.006.001.005.037.218v.006l.002.005.04.217v.006l.001.006.043.216.001.006.001.006.046.216v.005l.002.006.048.215.002.006.001.006.051.214.002.006v.006l.055.214.002.005.001.006.057.213.002.006.001.005.06.213.002.005.001.006.063.212.002.005.001.006.066.21.002.006.002.006.068.21.002.005.002.005.07.21.003.005.002.005.074.208.002.006.002.005.077.207.002.006.002.005.08.206.002.005.002.006.082.204.002.006.002.005.086.204.002.005.002.006.088.202.002.005.003.006.09.2.003.006.002.005.094.2.002.006.003.005.096.199.002.005.003.005.03.062.086.137.11.118.128.097.145.07.156.043.16.013.16-.017.155-.047.143-.074.127-.1.106-.121.081-.14.055-.15.025-.16-.005-.161-.034-.158-.05-.124-.028-.055-.092-.19-.087-.188-.087-.192-.083-.19-.08-.193-.078-.194-.076-.196-.073-.195-.07-.197-.067-.198-.065-.199-.063-.2-.059-.2-.056-.2-.055-.204-.05-.201-.049-.202-.046-.205-.043-.206-.04-.203-.038-.207-.034-.204-.032-.207-.028-.205-.026-.207-.023-.208-.02-.207-.018-.207-.014-.208-.011-.207-.009-.208-.005-.207-.002-.104-.017-.16-.046-.155-.074-.143-.1-.126-.121-.107-.139-.081-.152-.055-.159-.025-.161.004zm24.585 11.83l-.156.039-.146.068-.11.076-.015.012-.163.129-.166.127-.168.125-.17.124-.17.12-.172.118-.173.115-.176.114-.177.111-.18.11-.178.105-.182.104-.182.101-.184.1-.184.095-.189.095-.186.09-.188.089-.19.086-.19.082-.193.081-.195.078-.191.074-.197.073-.195.07-.196.065-.198.064-.198.061-.2.058-.2.055-.2.052-.2.049-.151.035-.153.05-.141.078-.125.103-.103.124-.078.14-.05.154-.022.16.009.16.038.157.067.147.093.132.116.112.134.089.149.062.158.034.16.003.133-.02.158-.035.006-.002.006-.001.213-.052.006-.002.007-.001.212-.056.006-.001.006-.002.212-.058.006-.002.006-.002.211-.061.006-.002.006-.002.21-.064.006-.002.006-.002.21-.067.005-.002.006-.002.208-.07.006-.002.006-.003.207-.073.006-.002.006-.002.206-.077.006-.002.005-.002.206-.08.005-.001.006-.003.204-.082.006-.002.005-.002.203-.085.006-.003.005-.002.202-.088.006-.002.005-.003.2-.09.006-.003.006-.003.2-.093.005-.003.005-.002.198-.096.006-.003.005-.003.197-.099.005-.002.005-.003.196-.102.005-.002.005-.003.195-.105.005-.002.005-.003.193-.107.005-.003.005-.003.191-.11.005-.003.005-.003.19-.112.005-.003.005-.003.189-.115.005-.003.005-.003.187-.117.005-.003.004-.004.186-.12.005-.003.004-.003.184-.122.005-.003.005-.004.182-.125.004-.003.005-.003.18-.128.005-.003.005-.003.179-.13.004-.003.005-.004.177-.132.004-.004.005-.003.175-.135.005-.003.004-.004.173-.137.005-.003.004-.004.019-.015.115-.113.092-.132.066-.147.038-.157.008-.16-.022-.16-.052-.153-.079-.14-.103-.124-.125-.102-.142-.078-.153-.05-.16-.02-.16.01zm-19.17.054l-.153.051-.14.079-.124.103-.103.125-.077.141-.05.153-.02.16.009.161.04.156.067.147.093.131.095.094.047.04.005.004.005.004.17.14.005.004.005.004.172.137.004.004.005.003.086.067.003.002.003.002.087.067.003.002.003.002.088.066.002.003.003.002.089.065.002.002.003.002.09.065.002.002.003.002.09.064.002.002.003.002.09.063.003.002.003.002.09.063.003.002.003.002.092.062.002.002.003.002.092.061.003.002.003.002.092.06.003.003.003.001.093.06.003.002.003.002.093.06.003.001.003.002.094.058.003.002.003.002.095.058.003.001.003.002.095.057.003.002.003.002.095.056.003.002.003.002.096.055.004.002.003.001.096.055.003.002.003.002.098.053.003.002.003.002.097.053.004.002.003.001.098.053.003.001.003.002.099.052.003.001.003.002.1.05.003.002.003.002.1.05.003.002.003.001.1.05h.003l.004.003.1.048.004.001.003.002.101.048.003.001.004.002.101.046.004.002.003.001.102.046.004.002.003.001.103.045.003.002.003.001.103.045.004.001.003.002.104.043.003.001.004.002.104.042.003.002.004.001.104.042.004.001.003.002.105.04.004.002.003.001.106.04.003.002h.004l.106.04.004.001.003.002.107.038.003.001.004.001.107.038.003.001.004.001.107.037.004.001.004.001.108.036.003.001.004.001.108.035.004.001.003.001.11.034.003.001.004.001.109.033.004.002h.003l.11.033h.004l.003.002.11.031.004.001.004.001.084.023.081.028.004.001.003.001.109.037.003.001.004.001.109.036.003.001.004.001.109.035h.003l.004.002.11.033.003.001.003.001.11.033.003.001.004.001.109.031.004.002h.003l.11.031.003.001.004.001.11.03h.003l.003.001.11.029h.004l.003.002.11.027.003.001.004.001.11.027h.003l.004.001.004.001.16.022.16-.008.157-.038.147-.067.132-.092.112-.116.09-.134.062-.149.034-.157.004-.161-.025-.16-.055-.151-.082-.139-.107-.12-.127-.1-.143-.074-.124-.04h-.003l-.104-.025-.103-.026h-.002l-.095-.026h-.001l-.101-.027h-.002l-.1-.028h-.002l-.103-.03-.104-.032-.097-.03h-.002l-.103-.033-.102-.033-.101-.034-.106-.036-.027-.01-.027-.007-.107-.03-.104-.029-.104-.03h-.002l-.097-.03-.102-.032-.102-.032-.102-.034-.103-.035-.096-.034-.1-.036-.101-.037h-.002l-.094-.036-.096-.037-.097-.04h-.002l-.099-.04-.098-.042h-.002l-.092-.04-.097-.043-.095-.043-.097-.044h-.002l-.09-.043-.094-.045-.094-.046-.093-.047-.09-.046-.096-.05-.088-.047-.002-.001-.09-.049-.094-.052-.002-.002-.087-.049-.087-.05h-.002l-.088-.053h-.001l-.09-.055-.086-.052-.002-.001-.089-.055-.084-.054h-.002l-.09-.059h-.001l-.085-.056-.001-.001-.084-.056-.082-.056h-.001l-.086-.06-.082-.058H7.79l-.086-.062-.002-.002-.08-.058-.081-.06h-.001l-.085-.064-.002-.002-.076-.058-.002-.002-.082-.064-.161-.128-.162-.133-.04-.034-.132-.092-.147-.066-.157-.038-.16-.008-.16.022z", + opacity: ".98" +}))); + +function _extends$d() { _extends$d = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$d.apply(this, arguments); } +var StartEventNonInterruptingSignalIcon = (({ + styles = {}, + ...props +}) => /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("svg", _extends$d({ + xmlns: "http://www.w3.org/2000/svg", + width: "32", + height: "32" +}, props), /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("path", { + d: "M16.007 8.82L9.21 21.022h13.596L16.007 8.82zm0 1.775l5.328 9.563H10.68l5.327-9.563zM16.14.386c-1.571.236-4.195-.284-4.9 1.381.619 1.703 2.745.069 4.085.365 1.421-.13 2.84.2 4.235.259C21.27.784 18.19.344 17 .413a20.456 20.456 0 00-.86-.027zM25 3.162c-2.19.694.401 2.26 1.181 3.094 1.083 1.152 1.954 2.484 2.715 3.864 1.48 1.005 1.845-1.26.81-2.03-1.158-1.897-2.613-3.704-4.513-4.89l-.192-.038zm-18.438.423c-1.793.712-2.909 2.548-4.01 4.061-.773.814-2.211 3.653.005 3.211 1.123-1.469 1.87-3.306 3.267-4.614.664-.7 2.73-2.013.738-2.658zm24.57 11.072c-1.659.435-.468 2.667-.99 3.895a13.427 13.427 0 01-1.497 4.435c-.23 1.659 1.991 1.165 2.018-.199a14.277 14.277 0 001.254-7.552.865.865 0 00-.785-.579zm-30.18.666c-1.677.386-.633 2.667-.608 3.876.371 1.623.792 3.35 1.79 4.696 2.382.321.571-2.338.292-3.492a15.92 15.92 0 01-.684-4.39.877.877 0 00-.79-.69zm24.558 11.81c-1.755.865-3.303 2.266-5.274 2.765-1.162-.016-3.074 1.271-1.331 2.102 2.66-.447 5.163-1.733 7.236-3.445.472-.506.06-1.432-.631-1.421zm-19.151.043c-2.004.786.416 2.405 1.43 2.913 1.608.904 3.379 1.636 5.208 1.877 1.77-.804-.228-2.094-1.357-2.073-1.75-.537-3.403-1.396-4.798-2.586l-.227-.104-.256-.027z" +}))); + +function _extends$c() { _extends$c = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$c.apply(this, arguments); } +var StartEventNonInterruptingTimerIcon = (({ + styles = {}, + ...props +}) => /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("svg", _extends$c({ + xmlns: "http://www.w3.org/2000/svg", + width: "32", + height: "32" +}, props), /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("path", { + d: "M15.991 8.7c-3.018-.042-5.92 1.925-7.03 4.725-1.138 2.695-.509 6.011 1.537 8.102 1.99 2.142 5.267 2.93 8.013 1.927 2.877-.98 4.99-3.826 5.067-6.87.153-2.956-1.624-5.88-4.299-7.135a7.551 7.551 0 00-3.288-.75zm0 1.383c2.758-.052 5.372 1.972 6.014 4.654.704 2.578-.482 5.516-2.79 6.867-2.358 1.48-5.682 1.085-7.617-.919-2.043-1.97-2.407-5.38-.84-7.743 1.11-1.764 3.149-2.88 5.233-2.86zm1.962 1.764l-2.074 3.762c-.64.068-.793 1.04-.202 1.3.39.27.696-.18 1.052-.165h3.17v-.865h-3.182l1.993-3.614-.757-.418zM16.12.358h-.232l-.22.004h-.012l-.221.006h-.012l-.22.01h-.012l-.22.013h-.012l-.22.016h-.012l-.22.019h-.005l-.006.001-.22.021h-.006l-.005.001-.22.025h-.011l-.22.028h-.005l-.006.002-.219.03h-.005l-.006.001-.218.033-.006.001-.006.001-.217.036-.006.001-.006.001-.217.039-.006.001-.006.001-.216.042-.006.001-.006.001-.215.045-.006.001-.006.002-.215.047-.006.002-.006.001-.214.05-.006.002-.006.002-.115.029-.152.053-.14.081-.122.106-.1.126-.075.143-.047.154-.018.16.012.16.042.156.07.145.095.13.118.11.137.086.15.059.158.03h.161l.132-.022.11-.028.202-.047.203-.046.208-.043.202-.039.206-.037.206-.034.205-.03.208-.03.205-.025.209-.023.208-.02.21-.017.209-.015.207-.011.21-.009.21-.006.207-.003h.21l.21.002.207.005.207.008.212.011.207.014.208.017.209.019.208.022.205.025.206.028.207.03.208.035.205.036.202.039.052.01.16.018.16-.012.156-.042.146-.07.13-.096.109-.119.085-.136.06-.15.03-.159v-.16l-.03-.16-.059-.15-.086-.136L19.823.9l-.13-.096-.145-.07-.128-.038-.057-.011-.006-.002h-.006L19.135.64l-.006-.001-.006-.001-.217-.039H18.9l-.006-.002-.217-.035-.006-.001-.006-.001-.218-.032-.006-.001-.006-.001-.218-.03h-.006l-.006-.001-.219-.027h-.011l-.22-.024-.005-.001h-.006l-.22-.021h-.006L17.512.42l-.22-.017-.005-.001h-.006l-.22-.015h-.012l-.22-.012h-.012l-.22-.01h-.012l-.22-.005h-.012l-.221-.003h-.012zm8.715 2.783l-.157.034-.149.063-.134.089-.116.112-.092.132-.067.147-.038.157-.008.16.021.16.051.153.079.141.103.124.102.087.052.038h.001l.087.064v.001l.082.061.002.001.076.059h.001l.084.065.082.066.002.001.079.063.002.002.077.063.081.067.002.002.077.065.076.065.001.002.08.07.078.07h.002l.075.068.077.072.002.001.073.069.077.073.072.07.002.001.077.076.07.07v.001l.075.076.07.073.002.001.074.079.002.002.069.074.069.075.074.082.07.08.002.001.068.079h.001l.067.079.068.082.065.078.001.002.068.083.067.084.063.081.001.002.067.087.002.002.063.084.001.001.064.087.008.01.008.01.095.12.093.121.09.119.087.119.088.122.086.123.084.12.081.122.001.002.084.126.08.126.08.127.077.126.079.131.074.127.075.131.073.131.07.13.07.133.069.133.045.09.086.137.109.119.13.096.144.07.156.042.16.013.16-.017.155-.047.143-.075.126-.1.106-.121.082-.14.054-.151.025-.16-.005-.16-.035-.158-.05-.124-.048-.095-.002-.004-.002-.004-.073-.14-.002-.005-.002-.004-.074-.14-.002-.004-.002-.004-.076-.14-.002-.003-.002-.004-.077-.139-.003-.004-.002-.004-.078-.138-.003-.004-.002-.003-.08-.137-.002-.004-.003-.004-.081-.136-.002-.004-.003-.004-.083-.136-.002-.003-.002-.004-.085-.135-.002-.004-.003-.003-.085-.134-.003-.004-.002-.004-.087-.132-.003-.004-.003-.004-.088-.132-.003-.003-.002-.004-.09-.13-.003-.005-.003-.003-.091-.13-.003-.004-.002-.004-.093-.129-.003-.003-.003-.004-.094-.128-.003-.004-.003-.003-.095-.127-.003-.004-.003-.004-.097-.125-.003-.004-.003-.004-.09-.114-.06-.082-.003-.003-.002-.003-.069-.091-.002-.004-.002-.003-.07-.09-.003-.003-.002-.003-.07-.09-.003-.003-.002-.003-.071-.09-.002-.003-.003-.002-.072-.089-.002-.003-.002-.003-.073-.088-.002-.003-.002-.002-.074-.087-.002-.003-.002-.003-.074-.086-.003-.003-.002-.003-.074-.086-.003-.002-.002-.003-.075-.085-.003-.003-.002-.002-.076-.084-.002-.003-.003-.003-.076-.083-.002-.003-.003-.003-.077-.082-.002-.003-.003-.002-.077-.082-.003-.003-.003-.002-.078-.081-.002-.003-.003-.003-.078-.08-.003-.002-.003-.003-.079-.08-.002-.002-.003-.002-.08-.08-.002-.002-.003-.002-.08-.078-.003-.003-.003-.002-.08-.077-.003-.003-.003-.002-.082-.077-.002-.002-.003-.002-.082-.076-.003-.002-.002-.003-.083-.075-.003-.002-.002-.003-.084-.074-.002-.002-.003-.002-.084-.074-.003-.002-.002-.002-.085-.073-.002-.002-.003-.003-.085-.071-.003-.003-.002-.002-.086-.07-.003-.003-.002-.002-.086-.07-.003-.003-.003-.002-.086-.07-.003-.002-.003-.002-.087-.069-.002-.002-.003-.002-.088-.068-.002-.002-.003-.002-.088-.067-.003-.003-.003-.002-.088-.066-.003-.002-.003-.002-.089-.066-.003-.002-.003-.002-.057-.042-.14-.082-.15-.055-.16-.026-.16.004zm-18.458.426l-.157.037-.148.066-.111.074-.007.006-.003.002-.003.002-.086.069-.003.002-.002.002-.086.07-.003.002-.002.002-.086.07-.002.003-.003.002-.085.071-.002.002-.003.003-.084.071-.003.003-.002.002-.084.072-.003.003-.002.002-.083.073-.003.003-.002.002-.083.074-.002.002-.003.003-.082.074-.003.003-.002.002-.081.076-.003.002-.003.002-.08.077-.003.002-.003.003-.08.076-.002.003-.003.002-.08.078-.002.002-.003.003-.079.078-.002.003-.003.002-.078.08-.003.002-.002.002-.078.08-.002.003-.003.002-.077.08-.003.004-.002.002-.077.081-.002.003-.003.003-.076.082-.002.002-.003.003-.075.082-.002.003-.003.003-.074.083-.003.003-.002.003-.074.084-.003.003-.002.002-.074.085-.002.003-.002.003-.073.085-.003.003-.002.003-.072.086-.002.003-.003.003-.071.087-.003.003-.002.002-.07.088-.003.003-.002.003-.07.088-.003.003-.002.003-.07.09-.002.002-.002.003-.069.09-.002.003-.003.003-.068.09-.002.003-.002.003-.067.092-.003.003-.002.003-.067.092-.002.003-.002.003-.066.092-.002.003-.002.004-.066.093-.002.003-.002.003-.065.094-.002.003-.002.004-.064.094-.002.003-.002.004-.063.095-.002.003-.002.003-.063.097-.002.003-.002.003-.046.073-.05.07-.003.002-.002.003-.067.093-.003.003-.002.003-.066.094-.002.003-.002.003-.066.094-.002.003-.002.003-.064.094-.002.004-.002.003-.064.094-.002.004-.002.003-.062.095-.002.003-.002.003-.062.096-.002.003-.002.003-.06.096-.003.003-.002.003-.06.096-.001.004-.002.003-.059.096-.002.004-.002.003-.058.097-.002.003-.001.003-.057.098-.002.003-.002.003-.056.098-.002.003-.002.003-.055.098-.002.004-.001.003-.055.098-.001.004-.002.003-.054.099-.001.003-.002.003-.052.1-.002.002-.002.004-.051.1-.002.002-.002.004-.05.1-.002.003-.002.003-.05.1v.003l-.002.004-.05.1V9.5l-.002.004-.048.1-.002.004-.001.003-.047.101-.002.003-.001.004-.013.027-.052.152-.024.16.006.16.037.157.064.148.091.133.114.114.134.09.147.065.157.036.162.006.159-.024.152-.053.14-.08.122-.105.1-.126.066-.117.01-.023.044-.095.045-.095.002-.003.042-.087.048-.097.048-.095v-.001l.048-.092.001-.001.047-.09.05-.093.002-.002.049-.09.052-.092.001-.002.051-.089.001-.002.051-.087.053-.088.001-.002.055-.091.057-.091.057-.09.001-.002.057-.089.055-.083.001-.002.06-.09.06-.088.062-.089.001-.001.06-.084.063-.088.065-.089.017-.023.016-.025.06-.094.059-.09v-.002l.058-.086.057-.086.001-.001.062-.09.062-.088.001-.002.06-.085.002-.002.06-.082.063-.087.064-.084.002-.002.061-.08.065-.084.064-.08v-.001l.067-.083.067-.082.07-.083.069-.08.063-.074.074-.083.068-.077.002-.002.07-.076.07-.075.072-.077.001-.001.067-.07.076-.078.002-.002.07-.07.075-.075.002-.002.072-.07.075-.072.002-.002.073-.069.074-.068.001-.001.08-.073.076-.068.002-.002.072-.063v-.001l.078-.067.079-.068.002-.001.08-.068.002-.002.077-.063.082-.066.001-.001.075-.06.002-.002.006-.004.117-.111.094-.131.068-.146.04-.156.01-.161-.019-.16-.049-.154-.076-.141-.102-.125-.123-.105-.14-.079-.153-.052-.16-.023-.16.007zm24.596 11.088l-.156.04-.146.067-.131.094-.112.117-.087.135-.061.15-.033.157-.004.134.007.142.005.152.004.15.002.149v.153l.001.011v.015l.004.11.002.11v.002l.002.106v.321l-.003.102-.002.106-.004.107-.005.105-.006.106-.006.106-.008.106v.002l-.008.103v.002l-.01.1-.01.105-.01.105-.013.105-.012.099v.002l-.014.108-.014.1-.016.105-.016.103v.002l-.017.099-.018.104-.019.103v.002l-.019.097-.02.104-.022.103v.001l-.022.098-.023.103v.002l-.024.096-.025.103v.002l-.024.096-.027.102v.003l-.026.093v.001l-.029.103v.002l-.03.099-.028.097v.002l-.03.095-.03.096v.001l-.033.1-.031.095v.002l-.035.1v.003l-.034.094v.003l-.035.096v.001l-.034.09v.002l-.038.098-.036.093v.002l-.038.095-.079.194-.08.188-.085.189-.087.19-.09.184-.092.183-.095.184-.05.093-.064.148-.034.158-.005.16.026.16.054.151.082.14.106.12.127.1.143.075.154.046.16.017.161-.013.156-.042.144-.071.13-.096.109-.119.072-.112.053-.099.003-.005.003-.006.102-.195.003-.006.003-.006.098-.196.003-.006.003-.006.096-.197.002-.006.003-.006.093-.2.002-.006.003-.006.09-.2.002-.006.003-.007.086-.202.003-.006.002-.006.084-.203.002-.005.001-.005.04-.102.002-.003.001-.003.04-.103.001-.003.001-.003.04-.103v-.004l.001-.003.039-.103v-.003l.002-.003.037-.104.001-.003.001-.003.037-.104v-.004l.002-.003.035-.104.002-.003v-.004l.035-.104.002-.004v-.003l.034-.105.002-.003v-.003l.034-.105v-.004l.002-.003.032-.106.001-.003.001-.003.031-.106.001-.003.001-.004.031-.106.001-.003.001-.004.03-.106v-.003l.002-.004.028-.107.001-.003.001-.003.028-.107.001-.004.001-.003.027-.107.001-.004v-.003l.027-.108.001-.003v-.004l.026-.108.001-.003v-.004l.025-.108.001-.003v-.004l.025-.108v-.004l.001-.003.023-.109v-.003l.001-.004.022-.109v-.003l.002-.004.02-.109.001-.004v-.003l.02-.11.002-.003v-.004l.02-.11v-.007l.019-.11v-.003l.001-.004.017-.11v-.004l.001-.003.017-.11v-.008l.016-.11v-.004l.001-.004.015-.11v-.008l.015-.111v-.008l.013-.111v-.007l.013-.112v-.007l.011-.112v-.004l.001-.004.01-.112v-.007l.01-.112v-.008l.008-.112v-.008l.007-.113v-.007l.007-.113v-.008l.005-.113v-.007l.005-.114v-.007l.003-.114v-.007l.003-.114v-.129l.001-.114v-.13l-.003-.114V16.5l-.003-.115v-.007l-.003-.102v-.155l-.003-.158v-.01l-.004-.158v-.01l-.006-.158v-.01l-.007-.148-.023-.16-.051-.152-.08-.14-.103-.124-.125-.102-.142-.077-.153-.05-.16-.02-.161.01zm-30.213.66l-.157.034-.149.063-.134.09-.115.113-.092.132-.067.147-.037.156-.009.134.001.11V16.308l.006.22v.012l.01.22v.012l.012.22v.006l.001.006.015.22v.005l.001.006.018.22.001.006v.006l.022.219v.006l.001.006.024.219.001.006v.006l.028.218.001.006v.006l.031.218.001.006.001.006.033.218.001.006.001.005.037.218v.006l.002.005.04.217v.006l.001.006.043.216.001.006.001.006.046.216v.005l.002.006.048.215.002.006.001.006.051.214.002.006v.006l.055.214.002.005.001.006.057.213.002.006.001.005.06.213.002.005.001.006.063.212.002.005.001.006.066.21.002.006.002.006.068.21.002.005.002.005.07.21.003.005.002.005.074.208.002.006.002.005.077.207.002.006.002.005.08.206.002.005.002.006.082.204.002.006.002.005.086.204.002.005.002.006.088.202.002.005.003.006.09.2.003.006.002.005.094.2.002.006.003.005.096.199.002.005.003.005.03.062.086.137.11.118.128.097.145.07.156.043.16.013.16-.017.155-.047.143-.074.127-.1.106-.121.081-.14.055-.15.025-.16-.005-.161-.034-.158-.05-.124-.028-.055-.092-.19-.087-.188-.087-.192-.083-.19-.08-.193-.078-.194-.076-.196-.073-.195-.07-.197-.067-.198-.065-.199-.063-.2-.059-.2-.056-.2-.055-.204-.05-.201-.049-.202-.046-.205-.043-.206-.04-.203-.038-.207-.034-.204-.032-.207-.028-.205-.026-.207-.023-.208-.02-.207-.018-.207-.014-.208-.011-.207-.009-.208-.005-.207-.002-.104-.017-.16-.046-.155-.074-.143-.1-.126-.121-.107-.139-.081-.152-.055-.159-.025-.161.004zm24.585 11.83l-.156.039-.146.068-.11.076-.015.012-.163.129-.166.127-.168.125-.17.124-.17.12-.172.118-.173.115-.176.114-.177.111-.18.11-.178.105-.182.104-.182.101-.184.1-.184.095-.189.095-.186.09-.188.089-.19.086-.19.082-.193.081-.195.078-.191.074-.197.073-.195.07-.196.065-.198.064-.198.061-.2.058-.2.055-.2.052-.2.049-.151.035-.153.05-.141.078-.125.103-.103.124-.078.14-.05.154-.022.16.009.16.038.157.067.147.093.132.116.112.134.089.149.062.158.034.16.003.133-.02.158-.035.006-.002.006-.001.213-.052.006-.002.007-.001.212-.056.006-.001.006-.002.212-.058.006-.002.006-.002.211-.061.006-.002.006-.002.21-.064.006-.002.006-.002.21-.067.005-.002.006-.002.208-.07.006-.002.006-.003.207-.073.006-.002.006-.002.206-.077.006-.002.005-.002.206-.08.005-.001.006-.003.204-.082.006-.002.005-.002.203-.085.006-.003.005-.002.202-.088.006-.002.005-.003.2-.09.006-.003.006-.003.2-.093.005-.003.005-.002.198-.096.006-.003.005-.003.197-.099.005-.002.005-.003.196-.102.005-.002.005-.003.195-.105.005-.002.005-.003.193-.107.005-.003.005-.003.191-.11.005-.003.005-.003.19-.112.005-.003.005-.003.189-.115.005-.003.005-.003.187-.117.005-.003.004-.004.186-.12.005-.003.004-.003.184-.122.005-.003.005-.004.182-.125.004-.003.005-.003.18-.128.005-.003.005-.003.179-.13.004-.003.005-.004.177-.132.004-.004.005-.003.175-.135.005-.003.004-.004.173-.137.005-.003.004-.004.019-.015.115-.113.092-.132.066-.147.038-.157.008-.16-.022-.16-.052-.153-.079-.14-.103-.124-.125-.102-.142-.078-.153-.05-.16-.02-.16.01zm-19.17.054l-.153.051-.14.079-.124.103-.103.125-.077.141-.05.153-.02.16.009.161.04.156.067.147.093.131.095.094.047.04.005.004.005.004.17.14.005.004.005.004.172.137.004.004.005.003.086.067.003.002.003.002.087.067.003.002.003.002.088.066.002.003.003.002.089.065.002.002.003.002.09.065.002.002.003.002.09.064.002.002.003.002.09.063.003.002.003.002.09.063.003.002.003.002.092.062.002.002.003.002.092.061.003.002.003.002.092.06.003.003.003.001.093.06.003.002.003.002.093.06.003.001.003.002.094.058.003.002.003.002.095.058.003.001.003.002.095.057.003.002.003.002.095.056.003.002.003.002.096.055.004.002.003.001.096.055.003.002.003.002.098.053.003.002.003.002.097.053.004.002.003.001.098.053.003.001.003.002.099.052.003.001.003.002.1.05.003.002.003.002.1.05.003.002.003.001.1.05h.003l.004.003.1.048.004.001.003.002.101.048.003.001.004.002.101.046.004.002.003.001.102.046.004.002.003.001.103.045.003.002.003.001.103.045.004.001.003.002.104.043.003.001.004.002.104.042.003.002.004.001.104.042.004.001.003.002.105.04.004.002.003.001.106.04.003.002h.004l.106.04.004.001.003.002.107.038.003.001.004.001.107.038.003.001.004.001.107.037.004.001.004.001.108.036.003.001.004.001.108.035.004.001.003.001.11.034.003.001.004.001.109.033.004.002h.003l.11.033h.004l.003.002.11.031.004.001.004.001.084.023.081.028.004.001.003.001.109.037.003.001.004.001.109.036.003.001.004.001.109.035h.003l.004.002.11.033.003.001.003.001.11.033.003.001.004.001.109.031.004.002h.003l.11.031.003.001.004.001.11.03h.003l.003.001.11.029h.004l.003.002.11.027.003.001.004.001.11.027h.003l.004.001.004.001.16.022.16-.008.157-.038.147-.067.132-.092.112-.116.09-.134.062-.149.034-.157.004-.161-.025-.16-.055-.151-.082-.139-.107-.12-.127-.1-.143-.074-.124-.04h-.003l-.104-.025-.103-.026h-.002l-.095-.026h-.001l-.101-.027h-.002l-.1-.028h-.002l-.103-.03-.104-.032-.097-.03h-.002l-.103-.033-.102-.033-.101-.034-.106-.036-.027-.01-.027-.007-.107-.03-.104-.029-.104-.03h-.002l-.097-.03-.102-.032-.102-.032-.102-.034-.103-.035-.096-.034-.1-.036-.101-.037h-.002l-.094-.036-.096-.037-.097-.04h-.002l-.099-.04-.098-.042h-.002l-.092-.04-.097-.043-.095-.043-.097-.044h-.002l-.09-.043-.094-.045-.094-.046-.093-.047-.09-.046-.096-.05-.088-.047-.002-.001-.09-.049-.094-.052-.002-.002-.087-.049-.087-.05h-.002l-.088-.053h-.001l-.09-.055-.086-.052-.002-.001-.089-.055-.084-.054h-.002l-.09-.059h-.001l-.085-.056-.001-.001-.084-.056-.082-.056h-.001l-.086-.06-.082-.058H7.79l-.086-.062-.002-.002-.08-.058-.081-.06h-.001l-.085-.064-.002-.002-.076-.058-.002-.002-.082-.064-.161-.128-.162-.133-.04-.034-.132-.092-.147-.066-.157-.038-.16-.008-.16.022z" +}))); + +function _extends$b() { _extends$b = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$b.apply(this, arguments); } +var StartEventNoneIcon = (({ + styles = {}, + ...props +}) => /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("svg", _extends$b({ + xmlns: "http://www.w3.org/2000/svg", + width: "32", + height: "32" +}, props), /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("path", { + d: "M15.847.004C9.61-.016 3.624 4.014 1.257 9.78-1.235 15.49.06 22.581 4.42 27.034c4.193 4.513 11.101 6.17 16.887 4.058 5.996-2.042 10.423-7.93 10.664-14.268.403-6.228-3.26-12.441-8.87-15.154A15.924 15.924 0 0015.846.004zm.439 1.729c6.105.033 11.856 4.45 13.435 10.359 1.678 5.653-.592 12.198-5.463 15.547-5.06 3.719-12.564 3.45-17.343-.625-4.814-3.84-6.538-10.94-4.067-16.57 2.14-5.206 7.515-8.775 13.147-8.71.097-.001.194-.002.29-.001z" +}))); + +function _extends$a() { _extends$a = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$a.apply(this, arguments); } +var StartEventParallelMultipleIcon = (({ + styles = {}, + ...props +}) => /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("svg", _extends$a({ + xmlns: "http://www.w3.org/2000/svg", + width: "32", + height: "32" +}, props), /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("path", { + d: "M15.847 0C9.61-.02 3.624 4.01 1.257 9.775-1.235 15.485.06 22.577 4.42 27.03c4.193 4.513 11.101 6.17 16.887 4.058 5.996-2.042 10.423-7.93 10.664-14.268.403-6.228-3.26-12.441-8.87-15.154A15.924 15.924 0 0015.846 0zm.439 1.729c6.105.033 11.856 4.45 13.435 10.359 1.678 5.653-.592 12.198-5.463 15.547-5.06 3.719-12.564 3.45-17.343-.625C2.101 23.17.377 16.07 2.848 10.44c2.134-5.2 7.522-8.78 13.147-8.71.097-.001.194-.002.29-.001zM13.504 9.08v4.427H9.077v4.98h4.427v4.427h4.98v-4.427h4.428v-4.98h-4.427V9.08h-4.98zm.83.83h3.32v4.427h4.428v3.32h-4.427v4.427h-3.32v-4.453H9.906v-3.294h4.427V9.91z" +}))); + +function _extends$9() { _extends$9 = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$9.apply(this, arguments); } +var StartEventSignalIcon = (({ + styles = {}, + ...props +}) => /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("svg", _extends$9({ + xmlns: "http://www.w3.org/2000/svg", + width: "32", + height: "32" +}, props), /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("path", { + d: "M15.995.005C9.705-.08 3.643 3.968 1.257 9.78-1.235 15.49.06 22.581 4.42 27.034c4.193 4.513 11.102 6.17 16.887 4.058 5.996-2.042 10.423-7.93 10.664-14.269.403-6.227-3.26-12.44-8.87-15.153A15.924 15.924 0 0015.994.005zm0 1.73c6.213-.108 12.122 4.355 13.726 10.357 1.678 5.653-.592 12.198-5.463 15.547-5.06 3.719-12.564 3.45-17.343-.626-4.814-3.838-6.538-10.939-4.067-16.57 2.14-5.205 7.515-8.774 13.147-8.708zm0 6.776L9.19 20.724H22.8L15.995 8.511zm0 1.777l5.332 9.572H10.662l5.333-9.572z" +}))); + +function _extends$8() { _extends$8 = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$8.apply(this, arguments); } +var StartEventTimerIcon = (({ + styles = {}, + ...props +}) => /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("svg", _extends$8({ + xmlns: "http://www.w3.org/2000/svg", + width: "32", + height: "32" +}, props), /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("path", { + d: "M16 0C7.174 0 0 7.174 0 16s7.174 16 16 16 16-7.174 16-16S24.826 0 16 0zm0 1.73c7.892 0 14.27 6.378 14.27 14.27 0 7.891-6.379 14.27-14.27 14.27S1.73 23.891 1.73 16C1.73 8.108 8.108 1.73 16 1.73zm-.143 6.676c-2.967.02-5.797 1.97-6.89 4.727-1.138 2.695-.51 6.012 1.537 8.102 1.99 2.142 5.268 2.932 8.014 1.928 2.878-.98 4.992-3.827 5.068-6.87.153-2.957-1.624-5.881-4.3-7.137a7.552 7.552 0 00-3.43-.75zm.27 1.383c2.71.012 5.254 2.015 5.886 4.656.704 2.577-.482 5.517-2.791 6.867-2.358 1.48-5.682 1.085-7.618-.918-2.043-1.971-2.407-5.381-.84-7.745 1.11-1.763 3.15-2.88 5.234-2.86h.13zm1.833 1.765l-2.074 3.763c-.64.068-.793 1.04-.202 1.3.39.27.696-.18 1.052-.165h3.17v-.865h-3.181l1.992-3.615-.757-.418z" +}))); + +function _extends$7() { _extends$7 = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$7.apply(this, arguments); } +var SubprocessCollapsedIcon = (({ + styles = {}, + ...props +}) => /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("svg", _extends$7({ + xmlns: "http://www.w3.org/2000/svg", + width: "32", + height: "32" +}, props), /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("path", { + d: "M5.637 3A5.644 5.644 0 000 8.637v15.417a5.644 5.644 0 005.637 5.637h20.726A5.644 5.644 0 0032 24.054V8.637A5.644 5.644 0 0026.363 3H5.637zm0 1.778h20.726a3.83 3.83 0 013.859 3.859v15.417a3.83 3.83 0 01-3.859 3.858h-4.201V16.695H9.838v11.217H5.637a3.83 3.83 0 01-3.859-3.858V8.637a3.83 3.83 0 013.859-3.859zm5.33 13.046h10.066v10.065H10.967V17.824zm4.189 1.431V22.06H12.35v1.689h2.804V26.554h1.69V23.749h2.804V22.06h-2.804V19.255h-1.69z" +}))); + +function _extends$6() { _extends$6 = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$6.apply(this, arguments); } +var SubprocessExpandedIcon = (({ + styles = {}, + ...props +}) => /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("svg", _extends$6({ + xmlns: "http://www.w3.org/2000/svg", + width: "32", + height: "32" +}, props), /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("path", { + d: "M5.636 3A5.642 5.642 0 000 8.636v15.418a5.643 5.643 0 005.636 5.636h20.728A5.643 5.643 0 0032 24.054V8.636A5.642 5.642 0 0026.364 3H5.636zm0 1.778h20.728a3.83 3.83 0 013.858 3.858v15.418a3.83 3.83 0 01-3.858 3.858h-4.203V16.723H9.84v11.189H5.636a3.83 3.83 0 01-3.858-3.858V8.636a3.83 3.83 0 013.858-3.858zm5.331 13.074h10.066v10.06H10.967v-10.06zm1.336 3.996v1.711h7.394v-1.71h-7.394z" +}))); + +function _extends$5() { _extends$5 = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$5.apply(this, arguments); } +var TaskNoneIcon = (({ + styles = {}, + ...props +}) => /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("svg", _extends$5({ + xmlns: "http://www.w3.org/2000/svg", + width: "32", + height: "32" +}, props), /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("path", { + d: "M6.494 2.667C2.916 2.667 0 5.57 0 9.142v13.383C0 26.097 2.916 29 6.494 29h19.012C29.084 29 32 26.097 32 22.525V9.142c0-3.572-2.916-6.475-6.494-6.475H6.494zm0 2h19.012c2.509 0 4.494 1.98 4.494 4.475v13.383C30 25.02 28.015 27 25.506 27H6.494C3.985 27 2 25.02 2 22.525V9.142c0-2.495 1.985-4.475 4.494-4.475z" +}))); + +function _extends$4() { _extends$4 = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$4.apply(this, arguments); } +var TextAnnotationicon = (({ + styles = {}, + ...props +}) => /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("svg", _extends$4({ + xmlns: "http://www.w3.org/2000/svg", + width: "32", + height: "32" +}, props), /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("path", { + d: "M22.087 0v31.647H32v-1.788h-8.125V1.788H32V0h-9.913zm-2.924 13.999l-2.737 2.167 2.167 2.738 2.738-2.167-2.168-2.738zm-5.475 4.335L10.95 20.5l2.168 2.738 2.737-2.168-2.167-2.737zm-5.475 4.335l-2.738 2.167 2.168 2.738 2.737-2.168-2.167-2.737zm-5.476 4.335L0 29.17l2.167 2.738 2.738-2.168-2.168-2.737z" +}))); + +function _extends$3() { _extends$3 = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$3.apply(this, arguments); } +var TransactionIcon = (({ + styles = {}, + ...props +}) => /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("svg", _extends$3({ + xmlns: "http://www.w3.org/2000/svg", + width: "32", + height: "32" +}, props), /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("path", { + d: "M5.422 3A5.424 5.424 0 000 8.422v15.822a5.424 5.424 0 005.422 5.423h21.156A5.424 5.424 0 0032 24.244V8.422A5.424 5.424 0 0026.578 3H5.422zm0 1.244h21.156a4.155 4.155 0 014.178 4.178v15.822a4.155 4.155 0 01-4.178 4.178H5.422a4.155 4.155 0 01-4.178-4.178V8.422a4.155 4.155 0 014.178-4.178zm1.056 1.778a3.373 3.373 0 00-3.367 3.366v13.89a3.373 3.373 0 003.367 3.366h19.044a3.373 3.373 0 003.367-3.366V9.388a3.373 3.373 0 00-3.367-3.366H6.478zm0 1.245h19.044c1.187 0 2.122.935 2.122 2.121v13.89a2.104 2.104 0 01-2.122 2.122H6.478a2.104 2.104 0 01-2.122-2.122V9.388c0-1.186.935-2.121 2.122-2.121z" +}))); + +function _extends$2() { _extends$2 = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$2.apply(this, arguments); } +var UserTaskIcon = (({ + styles = {}, + ...props +}) => /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("svg", _extends$2({ + xmlns: "http://www.w3.org/2000/svg", + width: "32", + height: "32" +}, props), /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("path", { + fillRule: "evenodd", + d: "M10.263 7.468c-1.698 0-2.912 1.305-2.915 2.791v.001c0 .45.121.924.311 1.352.138.309.308.593.516.82-1.235.423-2.683 1.119-3.414 2.49l-.04.075v4.44h11.083v-4.44l-.04-.074c-.72-1.352-2.136-2.047-3.36-2.471.597-.608.774-1.392.774-2.192-.004-1.487-1.218-2.792-2.915-2.792zm-1.16 1.583c.08 0 .165.003.26.008.757.045 1.012.181 1.207.31.196.13.334.252.851.268.404-.016.598-.087.737-.169.056-.033.103-.067.152-.1.128.275.197.578.198.893 0 .894-.154 1.52-.975 2.034l.08.604c.171.052.348.11.527.171.025.105.054.242.073.387.02.153.029.311.016.43a.422.422 0 01-.056.19c-.417.417-1.157.66-1.908.66-.75 0-1.49-.243-1.908-.66a.422.422 0 01-.056-.19 1.949 1.949 0 01.016-.43c.02-.146.049-.284.074-.388.177-.062.352-.118.521-.17l.048-.648a.616.616 0 00-.126-.118c-.183-.138-.405-.44-.562-.793-.157-.353-.254-.757-.254-1.08 0-.387.105-.758.297-1.079l.11-.04c.143-.046.339-.09.679-.09zm-1.448 4.304l-.002.014c-.025.185-.04.387-.018.589.021.202.074.42.248.593.595.594 1.494.857 2.382.857.889 0 1.788-.263 2.382-.857.174-.174.227-.391.249-.593a2.496 2.496 0 00-.018-.59l-.002-.01c.903.396 1.776.963 2.258 1.81v3.599H13.53v-2.538h-.67v2.538H7.651v-2.538h-.67v2.538H5.39v-3.599c.483-.849 1.359-1.416 2.264-1.813zM6.495 3C2.914 3 0 5.903 0 9.475v13.383c0 3.572 2.916 6.475 6.494 6.475h19.012c3.578 0 6.494-2.903 6.494-6.475V9.475C32 5.903 29.084 3 25.506 3H6.494zm0 2h19.01C28.016 5 30 6.98 30 9.475v13.383c0 2.495-1.985 4.475-4.494 4.475H6.494C3.985 27.333 2 25.353 2 22.858V9.475C2 6.98 3.985 5 6.494 5z" +}))); + +var iconsByType = { + 'Association': AssociationIcon, + 'BusinessRuleTask': BusinessRuleTaskIcon, + 'CallActivity': CallActivityIcon, + 'Collaboration': CollaborationIcon, + 'ConditionalFlow': ConditionalFlowIcon, + 'SequenceFlow': ConnectionIcon, + 'DataInput': DataInputIcon, + 'DataInputAssociation': DataInputOutputAssociationIcon, + 'DataOutput': DataOutputIcon, + 'DataOutputAssociation': DataInputOutputAssociationIcon, + 'DataObjectReference': DataObjectIcon, + 'DataStoreReference': DataStoreIcon, + 'DefaultFlow': DefaultFlowIcon, + 'CancelEndEvent': EndEventCancelIcon, + 'CompensateEndEvent': EndEventCompensationIcon, + 'ErrorEndEvent': EndEventErrorIcon, + 'EscalationEndEvent': EndEventEscalationIcon, + 'LinkEndEvent': EndEventLinkIcon, + 'MessageEndEvent': EndEventMessageIcon, + 'MultipleEndEvent': EndEventMultipleIcon, + 'EndEvent': EndEventNoneIcon, + 'SignalEndEvent': EndEventSignalIcon, + 'TerminateEndEvent': EndEventTerminateIcon, + 'EventSubProcess': EventSubProcessExpandedIcon, + 'ComplexGateway': GatewayComplexIcon, + 'EventBasedGateway': GatewayEventBasedIcon, + 'ExclusiveGateway': GatewayXorIcon, + 'Gateway': GatewayNoneIcon, + 'InclusiveGateway': GatewayOrIcon, + 'ParallelGateway': GatewayParallelIcon, + 'Group': GroupIcon, + 'CancelIntermediateCatchEvent': IntermediateEventCatchCancelIcon, + 'CompensateIntermediateCatchEvent': IntermediateEventCatchCompensationIcon, + 'ConditionalIntermediateCatchEvent': IntermediateEventCatchConditionIcon, + 'ErrorIntermediateCatchEvent': IntermediateEventCatchErrorIcon, + 'EscalationIntermediateCatchEvent': IntermediateEventCatchEscalationIcon, + 'LinkIntermediateCatchEvent': IntermediateEventCatchLinkIcon, + 'MessageIntermediateCatchEvent': IntermediateEventCatchMessageIcon, + 'MultipleIntermediateCatchEvent': IntermediateEventCatchMultipleIcon, + 'ConditionalIntermediateCatchEventNonInterrupting': IntermediateEventCatchNonInterruptingConditionIcon, + 'EscalationIntermediateCatchEventNonInterrupting': IntermediateEventCatchNonInterruptingEscalationIcon, + 'MessageIntermediateCatchEventNonInterrupting': IntermediateEventCatchNonInterruptingMessageIcon, + 'MultipleIntermediateCatchEventNonInterrupting': IntermediateEventCatchNonInterruptingMultipleIcon, + 'ParallelIntermediateCatchEventNonInterrupting': IntermediateEventCatchNonInterruptingParallelIcon, + 'SignalIntermediateCatchEventNonInterrupting': IntermediateEventCatchNonInterruptingSignalIcon, + 'TimerIntermediateCatchEventNonInterrupting': IntermediateEventCatchNonInterruptingTimerIcon, + 'ParallelMultipleIntermediateCatchEvent': IntermediateEventCatchParallelMultipleIcon, + 'SignalIntermediateCatchEvent': IntermediateEventCatchSignalIcon, + 'TimerIntermediateCatchEvent': IntermediateEventCatchTimerIcon, + 'IntermediateThrowEvent': IntermediateEventNoneIcon, + 'CompensateIntermediateThrowEvent': IntermediateEventThrowCompensationIcon, + 'EscalationIntermediateThrowEvent': IntermediateEventThrowEscalationIcon, + 'LinkIntermediateThrowEvent': IntermediateEventThrowLinkIcon, + 'MessageIntermediateThrowEvent': IntermediateEventThrowMessageIcon, + 'MultipleIntermediateThrowEvent': IntermediateEventThrowMultipleIcon, + 'SignalIntermediateThrowEvent': IntermediateEventThrowSignalIcon, + 'Lane': LaneIcon, + 'ManualTask': ManualTaskIcon, + 'MessageFlow': MessageFlowIcon, + 'Participant': ParticipantIcon, + 'Process': ProcessIcon, + 'ReceiveTask': ReceiveTaskIcon, + 'ScriptTask': ScriptTaskIcon, + 'SendTask': SendTaskIcon, + 'ServiceTask': ServiceTaskIcon, + 'CompensateStartEvent': StartEventCompensationIcon, + 'ConditionalStartEvent': StartEventConditionIcon, + 'ErrorStartEvent': StartEventErrorIcon, + 'EscalationStartEvent': StartEventEscalationIcon, + 'MessageStartEvent': StartEventMessageIcon, + 'MultipleStartEvent': StartEventMultipleIcon, + 'ConditionalStartEventNonInterrupting': StartEventNonInterruptingConditionIcon, + 'EscalationStartEventNonInterrupting': StartEventNonInterruptingEscalationIcon, + 'MessageStartEventNonInterrupting': StartEventNonInterruptingMessageIcon, + 'MultipleStartEventNonInterrupting': StartEventNonInterruptingMultipleIcon, + 'ParallelMultipleStartEventNonInterrupting': StartEventNonInterruptingParallelMultipleIcon, + 'SignalStartEventNonInterrupting': StartEventNonInterruptingSignalIcon, + 'TimerStartEventNonInterrupting': StartEventNonInterruptingTimerIcon, + 'CancelBoundaryEvent': IntermediateEventCatchCancelIcon, + 'CompensateBoundaryEvent': IntermediateEventCatchCompensationIcon, + 'ConditionalBoundaryEvent': IntermediateEventCatchConditionIcon, + 'ErrorBoundaryEvent': IntermediateEventCatchErrorIcon, + 'EscalationBoundaryEvent': IntermediateEventCatchEscalationIcon, + 'LinkBoundaryEvent': IntermediateEventCatchLinkIcon, + 'MessageBoundaryEvent': IntermediateEventCatchMessageIcon, + 'MultipleBoundaryEvent': IntermediateEventCatchMultipleIcon, + 'BoundaryEvent': IntermediateEventNoneIcon, + 'ConditionalBoundaryEventNonInterrupting': IntermediateEventCatchNonInterruptingConditionIcon, + 'EscalationBoundaryEventNonInterrupting': IntermediateEventCatchNonInterruptingEscalationIcon, + 'MessageBoundaryEventNonInterrupting': IntermediateEventCatchNonInterruptingMessageIcon, + 'MultipleBoundaryEventNonInterrupting': IntermediateEventCatchNonInterruptingMultipleIcon, + 'ParallelBoundaryEventNonInterrupting': IntermediateEventCatchNonInterruptingParallelIcon, + 'SignalBoundaryEventNonInterrupting': IntermediateEventCatchNonInterruptingSignalIcon, + 'TimerBoundaryEventNonInterrupting': IntermediateEventCatchNonInterruptingTimerIcon, + 'ParallelMultipleBoundaryEvent': IntermediateEventCatchParallelMultipleIcon, + 'SignalBoundaryEvent': IntermediateEventCatchSignalIcon, + 'TimerBoundaryEvent': IntermediateEventCatchTimerIcon, + 'StartEvent': StartEventNoneIcon, + 'ParallelMultipleStartEvent': StartEventParallelMultipleIcon, + 'SignalStartEvent': StartEventSignalIcon, + 'TimerStartEvent': StartEventTimerIcon, + 'CollapsedSubProcess': SubprocessCollapsedIcon, + 'CollapsedAdHocSubProcess': SubprocessCollapsedIcon, + 'ExpandedSubProcess': SubprocessExpandedIcon, + 'ExpandedAdHocSubProcess': SubprocessExpandedIcon, + 'Task': TaskNoneIcon, + 'TextAnnotation': TextAnnotationicon, + 'Transaction': TransactionIcon, + 'UserTask': UserTaskIcon +}; + +function getConcreteType(element) { + const { + type: elementType + } = element; + let type = getRawType(elementType); + + // (1) event definition types + const eventDefinition = getEventDefinition$2(element); + if (eventDefinition) { + type = `${getEventDefinitionPrefix(eventDefinition)}${type}`; + + // (1.1) interrupting / non interrupting + if ((0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.is)(element, 'bpmn:StartEvent') && !(0,bpmn_js_lib_util_DiUtil__WEBPACK_IMPORTED_MODULE_10__.isInterrupting)(element) || (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.is)(element, 'bpmn:BoundaryEvent') && !isCancelActivity(element)) { + type = `${type}NonInterrupting`; + } + return type; + } + + // (2) sub process types + if ((0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.is)(element, 'bpmn:SubProcess') && !(0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.is)(element, 'bpmn:Transaction')) { + if ((0,bpmn_js_lib_util_DiUtil__WEBPACK_IMPORTED_MODULE_10__.isEventSubProcess)(element)) { + type = `Event${type}`; + } else { + const expanded = (0,bpmn_js_lib_util_DiUtil__WEBPACK_IMPORTED_MODULE_10__.isExpanded)(element) && !isPlane(element); + type = `${expanded ? 'Expanded' : 'Collapsed'}${type}`; + } + } + + // (3) conditional + default flows + if (isDefaultFlow(element)) { + type = 'DefaultFlow'; + } + if (isConditionalFlow(element)) { + type = 'ConditionalFlow'; + } + return type; +} +const PanelHeaderProvider = { + getDocumentationRef: element => { + const elementTemplates = getTemplatesService(); + if (elementTemplates) { + return getTemplateDocumentation(element, elementTemplates); + } + }, + getElementLabel: element => { + if ((0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.is)(element, 'bpmn:Process')) { + return (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element).name; + } + return (0,bpmn_js_lib_features_label_editing_LabelUtil__WEBPACK_IMPORTED_MODULE_11__.getLabel)(element); + }, + getElementIcon: element => { + const concreteType = getConcreteType(element); + + // eslint-disable-next-line react-hooks/rules-of-hooks + const config = useService('config.elementTemplateIconRenderer', false); + const { + iconProperty = 'zeebe:modelerTemplateIcon' + } = config || {}; + const templateIcon = (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element).get(iconProperty); + if (templateIcon) { + return () => (0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("img", { + class: "bio-properties-panel-header-template-icon", + width: "32", + height: "32", + src: templateIcon + }); + } + return iconsByType[concreteType]; + }, + getTypeLabel: element => { + const elementTemplates = getTemplatesService(); + if (elementTemplates) { + const template = getTemplate(element, elementTemplates); + if (template && template.name) { + return template.name; + } + } + const concreteType = getConcreteType(element); + return concreteType.replace(/(\B[A-Z])/g, ' $1').replace(/(\bNon Interrupting)/g, '($1)'); + } +}; + +// helpers /////////////////////// + +function isCancelActivity(element) { + const businessObject = (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element); + return businessObject && businessObject.cancelActivity !== false; +} +function getEventDefinition$2(element) { + const businessObject = (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element), + eventDefinitions = businessObject.eventDefinitions; + return eventDefinitions && eventDefinitions[0]; +} +function getRawType(type) { + return type.split(':')[1]; +} +function getEventDefinitionPrefix(eventDefinition) { + const rawType = getRawType(eventDefinition.$type); + return rawType.replace('EventDefinition', ''); +} +function isDefaultFlow(element) { + const businessObject = (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element); + const sourceBusinessObject = (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element.source); + if (!(0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.is)(element, 'bpmn:SequenceFlow') || !sourceBusinessObject) { + return false; + } + return sourceBusinessObject.default && sourceBusinessObject.default === businessObject && ((0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.is)(sourceBusinessObject, 'bpmn:Gateway') || (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.is)(sourceBusinessObject, 'bpmn:Activity')); +} +function isConditionalFlow(element) { + const businessObject = (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element); + const sourceBusinessObject = (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element.source); + if (!(0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.is)(element, 'bpmn:SequenceFlow') || !sourceBusinessObject) { + return false; + } + return businessObject.conditionExpression && (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.is)(sourceBusinessObject, 'bpmn:Activity'); +} +function isPlane(element) { + // Backwards compatibility for bpmn-js<8 + const di = element && (element.di || (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element).di); + return (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.is)(di, 'bpmndi:BPMNPlane'); +} +function getTemplatesService() { + // eslint-disable-next-line react-hooks/rules-of-hooks + return useService('elementTemplates', false); +} +function getTemplate(element, elementTemplates) { + return elementTemplates.get(element); +} +function getTemplateDocumentation(element, elementTemplates) { + const template = getTemplate(element, elementTemplates); + return template && template.documentationRef; +} + +function _extends$1() { _extends$1 = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$1.apply(this, arguments); } +var EmptyIcon = (({ + styles = {}, + ...props +}) => /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("svg", _extends$1({ + xmlns: "http://www.w3.org/2000/svg", + xmlnsXlink: "http://www.w3.org/1999/xlink", + width: "64", + height: "64" +}, props), /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("defs", null, /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("rect", { + id: "a", + width: "57", + height: "47", + x: "3", + y: "8", + rx: "7" +}), /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("mask", { + id: "b", + width: "57", + height: "47", + x: "0", + y: "0", + fill: "#fff", + maskContentUnits: "userSpaceOnUse", + maskUnits: "objectBoundingBox" +}, /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("use", { + xlinkHref: "#a" +}))), /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("g", { + fill: "none", + fillRule: "evenodd" +}, /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("path", { + fill: "#818798", + d: "M52 11a5 5 0 015 5v31a5 5 0 01-5 5H11a5 5 0 01-5-5V16a5 5 0 015-5h41zm0 2H11a3 3 0 00-2.995 2.824L8 16v31a3 3 0 002.824 2.995L11 50h41a3 3 0 002.995-2.824L55 47V16a3 3 0 00-2.824-2.995L52 13z" +}), /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("path", { + fill: "#D5D7DD", + d: "M16 24h31v6H16zM21 33h21v6H21z" +}), /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("use", { + stroke: "#B9BCC6", + strokeDasharray: "5 2", + strokeWidth: "2", + mask: "url(#b)", + xlinkHref: "#a" +})))); + +function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } +var MultipleIcon = (({ + styles = {}, + ...props +}) => /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("svg", _extends({ + xmlns: "http://www.w3.org/2000/svg", + xmlnsXlink: "http://www.w3.org/1999/xlink", + width: "128", + height: "64" +}, props), /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("defs", null, /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("path", { + id: "a", + d: "M9 9h110v47H9z" +}), /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("mask", { + id: "b", + width: "110", + height: "47", + x: "0", + y: "0", + fill: "#fff", + maskContentUnits: "userSpaceOnUse", + maskUnits: "objectBoundingBox" +}, /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("use", { + xlinkHref: "#a" +}))), /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("g", { + fill: "none", + fillRule: "evenodd" +}, /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("path", { + fill: "#818798", + d: "M25 20.272L37.728 33 25 45.728 12.272 33 25 20.272zm0 2.829L15.1 33l9.9 9.9 9.9-9.9-9.9-9.9z" +}), /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("path", { + fill: "#D5D7DD", + d: "M17 47h16v6H17z" +}), /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("path", { + fill: "#818798", + d: "M35 32h27v2H35z" +}), /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("path", { + fill: "#818798", + d: "M60 30v6l6-3z" +}), /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("path", { + fill: "#D5D7DD", + d: "M80 34h21v6H80z" +}), /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("g", null, /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("path", { + fill: "#818798", + d: "M111 12a5 5 0 015 5v31a5 5 0 01-5 5H70a5 5 0 01-5-5V17a5 5 0 015-5h41zm0 2H70a3 3 0 00-3 3v31a3 3 0 003 3h41a3 3 0 003-3V17a3 3 0 00-3-3z" +}), /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("path", { + fill: "#D5D7DD", + d: "M75 25h31v6H75z" +})), /*#__PURE__*/_bpmn_io_properties_panel_preact_compat__WEBPACK_IMPORTED_MODULE_3__["default"].createElement("use", { + stroke: "#B9BCC6", + strokeDasharray: "5 2", + strokeWidth: "2", + mask: "url(#b)", + xlinkHref: "#a" +})))); + +const PanelPlaceholderProvider = translate => { + if (!translate) translate = text => text; + return { + getEmpty: () => { + return { + text: translate('Select an element to edit its properties.'), + icon: EmptyIcon + }; + }, + getMultiple: () => { + return { + text: translate('Multiple elements are selected. Select a single element to edit its properties.'), + icon: MultipleIcon + }; + } + }; +}; + +function BpmnPropertiesPanel(props) { + const { + element, + injector, + getProviders, + layoutConfig: initialLayoutConfig, + descriptionConfig, + tooltipConfig, + feelPopupContainer + } = props; + const canvas = injector.get('canvas'); + const elementRegistry = injector.get('elementRegistry'); + const eventBus = injector.get('eventBus'); + const translate = injector.get('translate'); + const [state, setState] = (0,_bpmn_io_properties_panel_preact_hooks__WEBPACK_IMPORTED_MODULE_0__.useState)({ + selectedElement: element + }); + const selectedElement = state.selectedElement; + + /** + * @param {djs.model.Base | Array} element + */ + const _update = element => { + if (!element) { + return; + } + let newSelectedElement = element; + + // handle labels + if (newSelectedElement && newSelectedElement.type === 'label') { + newSelectedElement = newSelectedElement.labelTarget; + } + setState({ + ...state, + selectedElement: newSelectedElement + }); + + // notify interested parties on property panel updates + eventBus.fire('propertiesPanel.updated', { + element: newSelectedElement + }); + }; + + // (2) react on element changes + + // (2a) selection changed + (0,_bpmn_io_properties_panel_preact_hooks__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => { + const onSelectionChanged = e => { + const { + newSelection = [] + } = e; + if (newSelection.length > 1) { + return _update(newSelection); + } + const newElement = newSelection[0]; + const rootElement = canvas.getRootElement(); + if (isImplicitRoot$1(rootElement)) { + return; + } + _update(newElement || rootElement); + }; + eventBus.on('selection.changed', onSelectionChanged); + return () => { + eventBus.off('selection.changed', onSelectionChanged); + }; + }, []); + + // (2b) selected element changed + (0,_bpmn_io_properties_panel_preact_hooks__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => { + const onElementsChanged = e => { + const elements = e.elements; + const updatedElement = findElement(elements, selectedElement); + if (updatedElement && elementExists(updatedElement, elementRegistry)) { + _update(updatedElement); + } + }; + eventBus.on('elements.changed', onElementsChanged); + return () => { + eventBus.off('elements.changed', onElementsChanged); + }; + }, [selectedElement]); + + // (2c) root element changed + (0,_bpmn_io_properties_panel_preact_hooks__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => { + const onRootAdded = e => { + const element = e.element; + _update(element); + }; + eventBus.on('root.added', onRootAdded); + return () => { + eventBus.off('root.added', onRootAdded); + }; + }, [selectedElement]); + + // (2d) provided entries changed + (0,_bpmn_io_properties_panel_preact_hooks__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => { + const onProvidersChanged = () => { + _update(selectedElement); + }; + eventBus.on('propertiesPanel.providersChanged', onProvidersChanged); + return () => { + eventBus.off('propertiesPanel.providersChanged', onProvidersChanged); + }; + }, [selectedElement]); + + // (2e) element templates changed + (0,_bpmn_io_properties_panel_preact_hooks__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => { + const onTemplatesChanged = () => { + _update(selectedElement); + }; + eventBus.on('elementTemplates.changed', onTemplatesChanged); + return () => { + eventBus.off('elementTemplates.changed', onTemplatesChanged); + }; + }, [selectedElement]); + + // (3) create properties panel context + const bpmnPropertiesPanelContext = { + selectedElement, + injector, + getService(type, strict) { + return injector.get(type, strict); + } + }; + + // (4) retrieve groups for selected element + const providers = getProviders(selectedElement); + const groups = (0,_bpmn_io_properties_panel_preact_hooks__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => { + return (0,min_dash__WEBPACK_IMPORTED_MODULE_12__.reduce)(providers, function (groups, provider) { + // do not collect groups for multi element state + if ((0,min_dash__WEBPACK_IMPORTED_MODULE_12__.isArray)(selectedElement)) { + return []; + } + const updater = provider.getGroups(selectedElement); + return updater(groups); + }, []); + }, [providers, selectedElement]); + + // (5) notify layout changes + const [layoutConfig, setLayoutConfig] = (0,_bpmn_io_properties_panel_preact_hooks__WEBPACK_IMPORTED_MODULE_0__.useState)(initialLayoutConfig || {}); + const onLayoutChanged = (0,_bpmn_io_properties_panel_preact_hooks__WEBPACK_IMPORTED_MODULE_0__.useCallback)(newLayout => { + eventBus.fire('propertiesPanel.layoutChanged', { + layout: newLayout + }); + }, [eventBus]); + + // React to external layout changes + (0,_bpmn_io_properties_panel_preact_hooks__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => { + const cb = e => { + const { + layout + } = e; + setLayoutConfig(layout); + }; + eventBus.on('propertiesPanel.setLayout', cb); + return () => eventBus.off('propertiesPanel.setLayout', cb); + }, [eventBus, setLayoutConfig]); + + // (6) notify description changes + const onDescriptionLoaded = description => { + eventBus.fire('propertiesPanel.descriptionLoaded', { + description + }); + }; + + // (7) notify tooltip changes + const onTooltipLoaded = tooltip => { + eventBus.fire('propertiesPanel.tooltipLoaded', { + tooltip + }); + }; + return (0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(BpmnPropertiesPanelContext.Provider, { + value: bpmnPropertiesPanelContext, + children: (0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.PropertiesPanel, { + element: selectedElement, + headerProvider: PanelHeaderProvider, + placeholderProvider: PanelPlaceholderProvider(translate), + groups: groups, + layoutConfig: layoutConfig, + layoutChanged: onLayoutChanged, + descriptionConfig: descriptionConfig, + descriptionLoaded: onDescriptionLoaded, + tooltipConfig: tooltipConfig, + tooltipLoaded: onTooltipLoaded, + feelPopupContainer: feelPopupContainer, + eventBus: eventBus + }) + }); +} + +// helpers ////////////////////////// + +function isImplicitRoot$1(element) { + // Backwards compatibility for diagram-js<7.4.0, see https://github.com/bpmn-io/bpmn-properties-panel/pull/102 + return element && (element.isImplicit || element.id === '__implicitroot'); +} +function findElement(elements, element) { + return (0,min_dash__WEBPACK_IMPORTED_MODULE_12__.find)(elements, e => e === element); +} +function elementExists(element, elementRegistry) { + return element && elementRegistry.get(element.id); +} + +const DEFAULT_PRIORITY = 1000; + +/** + * @typedef { import('@bpmn-io/properties-panel').GroupDefinition } GroupDefinition + * @typedef { import('@bpmn-io/properties-panel').ListGroupDefinition } ListGroupDefinition + * @typedef { { getGroups: (ModdleElement) => (Array{GroupDefinition|ListGroupDefinition}) => Array{GroupDefinition|ListGroupDefinition}) } PropertiesProvider + */ - module.exports.addEmptyParameter = addEmptyParameter; +class BpmnPropertiesPanelRenderer { + constructor(config, injector, eventBus) { + const { + parent, + layout: layoutConfig, + description: descriptionConfig, + tooltip: tooltipConfig, + feelPopupContainer + } = config || {}; + this._eventBus = eventBus; + this._injector = injector; + this._layoutConfig = layoutConfig; + this._descriptionConfig = descriptionConfig; + this._tooltipConfig = tooltipConfig; + this._feelPopupContainer = feelPopupContainer; + this._container = (0,min_dom__WEBPACK_IMPORTED_MODULE_13__.domify)('
'); + var commandStack = injector.get('commandStack', false); + commandStack && setupKeyboard(this._container, eventBus, commandStack); + eventBus.on('diagram.init', () => { + if (parent) { + this.attachTo(parent); + } + }); + eventBus.on('diagram.destroy', () => { + this.detach(); + }); + eventBus.on('root.added', event => { + const { + element + } = event; + this._render(element); + }); + } + + /** + * Attach the properties panel to a parent node. + * + * @param {HTMLElement} container + */ + attachTo(container) { + if (!container) { + throw new Error('container required'); + } + + // unwrap jQuery if provided + if (container.get && container.constructor.prototype.jquery) { + container = container.get(0); + } + if (typeof container === 'string') { + container = (0,min_dom__WEBPACK_IMPORTED_MODULE_13__.query)(container); + } + + // (1) detach from old parent + this.detach(); + + // (2) append to parent container + container.appendChild(this._container); + + // (3) notify interested parties + this._eventBus.fire('propertiesPanel.attach'); + } + + /** + * Detach the properties panel from its parent node. + */ + detach() { + const parentNode = this._container.parentNode; + if (parentNode) { + parentNode.removeChild(this._container); + this._eventBus.fire('propertiesPanel.detach'); + } + } + + /** + * Register a new properties provider to the properties panel. + * + * @param {Number} [priority] + * @param {PropertiesProvider} provider + */ + registerProvider(priority, provider) { + if (!provider) { + provider = priority; + priority = DEFAULT_PRIORITY; + } + if (typeof provider.getGroups !== 'function') { + console.error('Properties provider does not implement #getGroups(element) API'); + return; + } + this._eventBus.on('propertiesPanel.getProviders', priority, function (event) { + event.providers.push(provider); + }); + this._eventBus.fire('propertiesPanel.providersChanged'); + } + + /** + * Updates the layout of the properties panel. + * @param {Object} layout + */ + setLayout(layout) { + this._eventBus.fire('propertiesPanel.setLayout', { + layout + }); + } + _getProviders() { + const event = this._eventBus.createEvent({ + type: 'propertiesPanel.getProviders', + providers: [] + }); + this._eventBus.fire(event); + return event.providers; + } + _render(element) { + const canvas = this._injector.get('canvas'); + if (!element) { + element = canvas.getRootElement(); + } + if (isImplicitRoot(element)) { + return; + } + (0,_bpmn_io_properties_panel_preact__WEBPACK_IMPORTED_MODULE_2__.render)((0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(BpmnPropertiesPanel, { + element: element, + injector: this._injector, + getProviders: this._getProviders.bind(this), + layoutConfig: this._layoutConfig, + descriptionConfig: this._descriptionConfig, + tooltipConfig: this._tooltipConfig, + feelPopupContainer: this._feelPopupContainer + }), this._container); + this._eventBus.fire('propertiesPanel.rendered'); + } + _destroy() { + if (this._container) { + (0,_bpmn_io_properties_panel_preact__WEBPACK_IMPORTED_MODULE_2__.render)(null, this._container); + this._eventBus.fire('propertiesPanel.destroyed'); + } + } +} +BpmnPropertiesPanelRenderer.$inject = ['config.propertiesPanel', 'injector', 'eventBus']; + +// helpers /////////////////////// + +function isImplicitRoot(element) { + // Backwards compatibility for diagram-js<7.4.0, see https://github.com/bpmn-io/bpmn-properties-panel/pull/102 + return element && (element.isImplicit || element.id === '__implicitroot'); +} + +/** + * Setup keyboard bindings (undo, redo) on the given container. + * + * @param {Element} container + * @param {EventBus} eventBus + * @param {CommandStack} commandStack + */ +function setupKeyboard(container, eventBus, commandStack) { + function cancel(event) { + event.preventDefault(); + event.stopPropagation(); + } + function handleKeys(event) { + if ((0,diagram_js_lib_features_keyboard_KeyboardUtil__WEBPACK_IMPORTED_MODULE_14__.isUndo)(event)) { + commandStack.undo(); + return cancel(event); + } + if ((0,diagram_js_lib_features_keyboard_KeyboardUtil__WEBPACK_IMPORTED_MODULE_14__.isRedo)(event)) { + commandStack.redo(); + return cancel(event); + } + } + eventBus.on('keyboard.bind', function () { + min_dom__WEBPACK_IMPORTED_MODULE_13__.event.bind(container, 'keydown', handleKeys); + }); + eventBus.on('keyboard.unbind', function () { + min_dom__WEBPACK_IMPORTED_MODULE_13__.event.unbind(container, 'keydown', handleKeys); + }); +} + +/** + * A handler that combines and executes multiple commands. + * + * All updates are bundled on the command stack and executed in one step. + * This also makes it possible to revert the changes in one step. + * + * Example use case: remove the camunda:formKey attribute and in addition + * add all form fields needed for the camunda:formData property. + */ +class MultiCommandHandler { + constructor(commandStack) { + this._commandStack = commandStack; + } + preExecute(context) { + const commandStack = this._commandStack; + (0,min_dash__WEBPACK_IMPORTED_MODULE_12__.forEach)(context, function (command) { + commandStack.execute(command.cmd, command.context); + }); + } +} +MultiCommandHandler.$inject = ['commandStack']; + +const HANDLERS = { + 'properties-panel.multi-command-executor': MultiCommandHandler +}; +function CommandInitializer(eventBus, commandStack) { + eventBus.on('diagram.init', function () { + (0,min_dash__WEBPACK_IMPORTED_MODULE_12__.forEach)(HANDLERS, function (handler, id) { + commandStack.registerHandler(id, handler); + }); + }); +} +CommandInitializer.$inject = ['eventBus', 'commandStack']; +var Commands = { + __init__: [CommandInitializer] +}; + +var index$3 = { + __depends__: [Commands, _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.DebounceInputModule, _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.FeelPopupModule], + __init__: ['propertiesPanel'], + propertiesPanel: ['type', BpmnPropertiesPanelRenderer] +}; + +function ReferenceSelectEntry(props) { + const { + autoFocusEntry, + element, + getOptions + } = props; + const options = getOptions(element); + const prevOptions = (0,_bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.usePrevious)(options); + + // auto focus specifc other entry when options changed + (0,_bpmn_io_properties_panel_preact_hooks__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => { + if (autoFocusEntry && prevOptions && options.length > prevOptions.length) { + const entry = (0,min_dom__WEBPACK_IMPORTED_MODULE_13__.query)(`[data-entry-id="${autoFocusEntry}"]`); + const focusableInput = (0,min_dom__WEBPACK_IMPORTED_MODULE_13__.query)('.bio-properties-panel-input', entry); + if (focusableInput) { + focusableInput.select(); + } + } + }, [options]); + return (0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.SelectEntry, { + ...props + }); +} + +function isErrorSupported(element) { + return (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.isAny)(element, ['bpmn:StartEvent', 'bpmn:BoundaryEvent', 'bpmn:EndEvent']) && !!getErrorEventDefinition(element); +} +function getErrorEventDefinition(element) { + return getEventDefinition$1(element, 'bpmn:ErrorEventDefinition'); +} +function getTimerEventDefinition$1(element) { + return getEventDefinition$1(element, 'bpmn:TimerEventDefinition'); +} +function getError(element) { + const errorEventDefinition = getErrorEventDefinition(element); + return errorEventDefinition && errorEventDefinition.get('errorRef'); +} +function getEventDefinition$1(element, eventType) { + const businessObject = (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element); + const eventDefinitions = businessObject.get('eventDefinitions') || []; + return (0,min_dash__WEBPACK_IMPORTED_MODULE_12__.find)(eventDefinitions, function (definition) { + return (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.is)(definition, eventType); + }); +} +function isMessageSupported(element) { + return (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.is)(element, 'bpmn:ReceiveTask') || (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.isAny)(element, ['bpmn:StartEvent', 'bpmn:EndEvent', 'bpmn:IntermediateThrowEvent', 'bpmn:BoundaryEvent', 'bpmn:IntermediateCatchEvent']) && !!getMessageEventDefinition(element); +} +function getMessageEventDefinition(element) { + if ((0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.is)(element, 'bpmn:ReceiveTask')) { + return (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element); + } + return getEventDefinition$1(element, 'bpmn:MessageEventDefinition'); +} +function getMessage(element) { + const messageEventDefinition = getMessageEventDefinition(element); + return messageEventDefinition && messageEventDefinition.get('messageRef'); +} +function getLinkEventDefinition(element) { + return getEventDefinition$1(element, 'bpmn:LinkEventDefinition'); +} +function getSignalEventDefinition$1(element) { + return getEventDefinition$1(element, 'bpmn:SignalEventDefinition'); +} +function isLinkSupported(element) { + return (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.isAny)(element, ['bpmn:IntermediateThrowEvent', 'bpmn:IntermediateCatchEvent']) && !!getLinkEventDefinition(element); +} +function isSignalSupported$1(element) { + return (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.is)(element, 'bpmn:Event') && !!getSignalEventDefinition$1(element); +} +function getSignal$1(element) { + const signalEventDefinition = getSignalEventDefinition$1(element); + return signalEventDefinition && signalEventDefinition.get('signalRef'); +} +function getEscalationEventDefinition(element) { + return getEventDefinition$1(element, 'bpmn:EscalationEventDefinition'); +} +function isEscalationSupported(element) { + return (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.is)(element, 'bpmn:Event') && !!getEscalationEventDefinition(element); +} +function getEscalation(element) { + const escalationEventDefinition = getEscalationEventDefinition(element); + return escalationEventDefinition && escalationEventDefinition.get('escalationRef'); +} +function isCompensationSupported(element) { + return (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.isAny)(element, ['bpmn:EndEvent', 'bpmn:IntermediateThrowEvent']) && !!getCompensateEventDefinition(element); +} +function getCompensateEventDefinition(element) { + return getEventDefinition$1(element, 'bpmn:CompensateEventDefinition'); +} +function getCompensateActivity(element) { + const compensateEventDefinition = getCompensateEventDefinition(element); + return compensateEventDefinition && compensateEventDefinition.get('activityRef'); +} + +/** + * @typedef { import('@bpmn-io/properties-panel').EntryDefinition } Entry + */ +/** + * @returns {Array} entries + */ +function CompensationProps(props) { + const { + element + } = props; + if (!isCompensationSupported(element)) { + return []; + } + return [{ + id: 'waitForCompletion', + component: WaitForCompletion, + isEdited: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.isCheckboxEntryEdited + }, { + id: 'activityRef', + component: ActivityRef, + isEdited: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.isSelectEntryEdited + }]; +} +function WaitForCompletion(props) { + const { + element + } = props; + const commandStack = useService('commandStack'); + const translate = useService('translate'); + const compensateEventDefinition = getCompensateEventDefinition(element); + const getValue = () => { + return compensateEventDefinition.get('waitForCompletion'); + }; + const setValue = value => { + commandStack.execute('element.updateModdleProperties', { + element, + moddleElement: compensateEventDefinition, + properties: { + waitForCompletion: value + } + }); + }; + return (0,_bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.CheckboxEntry)({ + element, + id: 'waitForCompletion', + label: translate('Wait for completion'), + getValue, + setValue + }); +} +function ActivityRef(props) { + const { + element + } = props; + const commandStack = useService('commandStack'); + const elementRegistry = useService('elementRegistry'); + const translate = useService('translate'); + const compensateEventDefinition = getCompensateEventDefinition(element); + const getValue = () => { + const activityRef = getCompensateActivity(element); + return activityRef && activityRef.get('id'); + }; + const setValue = value => { + // update (or remove) activityRef + const activityRef = value ? (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(elementRegistry.get(value)) : undefined; + commandStack.execute('element.updateModdleProperties', { + element, + moddleElement: compensateEventDefinition, + properties: { + activityRef + } + }); + }; + const getOptions = () => { + let options = [{ + value: '', + label: translate('') + }]; + const activities = findActivityRefs(element); + sortByName$6(activities).forEach(function (activity) { + options.push({ + value: activity.id, + label: createOptionLabel(activity) + }); + }); + return options; + }; + return ReferenceSelectEntry({ + element, + id: 'activityRef', + label: translate('Activity reference'), + getValue, + setValue, + getOptions + }); +} + +// helper ///////////////////////// + +function getFlowElements(element, type) { + const { + flowElements + } = element; + return flowElements.filter(function (flowElement) { + return (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.is)(flowElement, type); + }); +} +function getContainedActivities(element) { + return getFlowElements(element, 'bpmn:Activity'); +} +function getContainedBoundaryEvents(element) { + return getFlowElements(element, 'bpmn:BoundaryEvent'); +} + +/** + * Checks whether an Activity is attaching a CompensateEvent of the parent container. + * + * @param {ModdleElement} activity + * @param {Array} boundaryEvents + * @returns {Boolean} + */ +function hasCompensationEventAttached(activity, boundaryEvents) { + const { + id: activityId + } = activity; + return !!(0,min_dash__WEBPACK_IMPORTED_MODULE_12__.find)(boundaryEvents, function (boundaryEvent) { + const { + attachedToRef + } = boundaryEvent; + const compensateEventDefinition = getCompensateEventDefinition(boundaryEvent); + return attachedToRef && compensateEventDefinition && attachedToRef.id === activityId; + }); +} + +/** + * Checks whether an Activity can be compensated. That's the case when it is + * a) a CallActivity + * b) a SubProcess, when it is not event based and not a compensation + * c) any other Activity, when it is attaching a CompensateEvent of the parent container + * + * @param {ModdleElement} activity + * @param {Array} boundaryEvents + * @returns {Boolean} + */ +function canBeCompensated(activity, boundaryEvents) { + return (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.is)(activity, 'bpmn:CallActivity') || (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.is)(activity, 'bpmn:SubProcess') && !activity.triggeredByEvent && !activity.isForCompensation || hasCompensationEventAttached(activity, boundaryEvents); +} +function getActivitiesForCompensation(element) { + const activities = getContainedActivities(element); + const boundaryEvents = getContainedBoundaryEvents(element); + return activities.filter(function (activity) { + return canBeCompensated(activity, boundaryEvents); + }); +} + +/** + * Retrieves all possible activities to reference for a Compensation. + * + * @param {djs.model.Base} element + * @returns {Array} + */ +function findActivityRefs(element) { + const businessObject = (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element); + let parent = businessObject.$parent; + + // (1) get all activities in parent container + let activities = getActivitiesForCompensation(parent); + + // (2) if throwing compensation event is inside an EventSubProcess, + // also get all activities outside of the event sub process + if ((0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.is)(parent, 'bpmn:SubProcess') && parent.triggeredByEvent) { + parent = parent.$parent; + if (parent) { + activities = [...activities, ...getActivitiesForCompensation(parent)]; + } + } + return activities; +} + +/** + * Retrieves an option label in the form + * a) with name: "my Task (id=Task_1)" + * b) without name: "(id=Task_1)" + * + * @param {ModdleElement} activity + * @returns {String} + */ +function createOptionLabel(activity) { + const { + id, + name + } = activity; + return `${name ? name + ' ' : ''}(id=${id})`; +} +function sortByName$6(elements) { + return (0,min_dash__WEBPACK_IMPORTED_MODULE_12__.sortBy)(elements, e => (e.name || '').toLowerCase()); +} + +const DOCUMENTATION_TEXT_FORMAT = 'text/plain'; + +/** + * @typedef { import('@bpmn-io/properties-panel').EntryDefinition } Entry + */ - /** - * returns a list with all root elements for the given parameter 'referencedType' - */ - function refreshOptionsModel(businessObject, referencedType) { - var model = []; - var referableObjects = findRootElementsByType(businessObject, referencedType); - forEach(referableObjects, function(obj) { - model.push({ - label: (obj.name || '') + ' (id='+obj.id+')', - value: obj.id, - name: obj.name - }); - }); - return model; - } +/** + * @returns {Array} entries + */ +function DocumentationProps(props) { + const { + element + } = props; + const entries = [{ + id: 'documentation', + component: ElementDocumentationProperty, + isEdited: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.isTextAreaEntryEdited + }]; + if (hasProcessRef$2(element)) { + entries.push({ + id: 'processDocumentation', + component: ProcessDocumentationProperty, + isEdited: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.isTextAreaEntryEdited + }); + } + return entries; +} +function ElementDocumentationProperty(props) { + const { + element + } = props; + const bpmnFactory = useService('bpmnFactory'); + const commandStack = useService('commandStack'); + const translate = useService('translate'); + const debounce = useService('debounceInput'); + const getValue = getDocumentation((0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element)); + const setValue = setDocumentation(element, (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element), bpmnFactory, commandStack); + return (0,_bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.TextAreaEntry)({ + element, + id: 'documentation', + label: translate('Element documentation'), + getValue, + setValue, + debounce + }); +} +function ProcessDocumentationProperty(props) { + const { + element + } = props; + const bpmnFactory = useService('bpmnFactory'); + const commandStack = useService('commandStack'); + const translate = useService('translate'); + const debounce = useService('debounceInput'); + const processRef = (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element).processRef; + const getValue = getDocumentation(processRef); + const setValue = setDocumentation(element, processRef, bpmnFactory, commandStack); + return (0,_bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.TextAreaEntry)({ + element, + id: 'processDocumentation', + label: translate('Process documentation'), + getValue, + setValue, + debounce + }); +} + +// helper //////////////////////////// + +function hasProcessRef$2(element) { + return (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.is)(element, 'bpmn:Participant') && element.businessObject.get('processRef'); +} +function findDocumentation(docs) { + return docs.find(function (d) { + return (d.textFormat || DOCUMENTATION_TEXT_FORMAT) === DOCUMENTATION_TEXT_FORMAT; + }); +} + +/** + * Retrieves a documentation element from a given moddle element. + * + * @param {ModdleElement} businessObject + * + * @returns {ModdleElement} documentation element inside the given moddle element. + */ +function getDocumentation(businessObject) { + return function () { + const documentation = findDocumentation(businessObject && businessObject.get('documentation')); + return documentation && documentation.text; + }; +} + +/** + * Sets a documentation element for a given moddle element. + * + * @param {ModdleElement} businessObject + */ +function setDocumentation(element, businessObject, bpmnFactory, commandStack) { + return function (value) { + let documentation = findDocumentation(businessObject && businessObject.get('documentation')); + + // (1) update or removing existing documentation + if (documentation) { + if (value) { + return commandStack.execute('element.updateModdleProperties', { + element, + moddleElement: documentation, + properties: { + text: value + } + }); + } else { + return commandStack.execute('element.updateModdleProperties', { + element, + moddleElement: businessObject, + properties: { + documentation: (0,min_dash__WEBPACK_IMPORTED_MODULE_12__.without)(businessObject.get('documentation'), documentation) + } + }); + } + } + + // (2) create new documentation entry + if (value) { + documentation = bpmnFactory.create('bpmn:Documentation', { + text: value + }); + return commandStack.execute('element.updateModdleProperties', { + element, + moddleElement: businessObject, + properties: { + documentation: [...businessObject.get('documentation'), documentation] + } + }); + } + }; +} + +/** + * Create a new element and (optionally) set its parent. + * + * @param {string} type + * @param {Object} properties + * @param {import('bpmn-js/lib/model/Types').ModdleElement} parent + * @param {import('bpmn-js/lib/features/modeling/BpmnFactory').default} bpmnFactory + * + * @returns {import('bpmn-js/lib/model/Types').ModdleElement} + */ +function createElement(type, properties, parent, bpmnFactory) { + const element = bpmnFactory.create(type, properties); + if (parent) { + element.$parent = parent; + } + return element; +} + +/** + * generate a semantic id with given prefix + */ +function nextId(prefix) { + const ids = new ids__WEBPACK_IMPORTED_MODULE_5__["default"]([32, 32, 1]); + return ids.nextPrefixed(prefix); +} +function getRoot(businessObject) { + let parent = businessObject; + while (parent.$parent) { + parent = parent.$parent; + } + return parent; +} +function filterElementsByType(objectList, type) { + const list = objectList || []; + return list.filter(element => (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.is)(element, type)); +} +function findRootElementsByType(businessObject, referencedType) { + const root = getRoot(businessObject); + return filterElementsByType(root.get('rootElements'), referencedType); +} +function findRootElementById(businessObject, type, id) { + const elements = findRootElementsByType(businessObject, type); + return elements.find(element => element.id === id); +} + +const EMPTY_OPTION$4 = ''; +const CREATE_NEW_OPTION$4 = 'create-new'; + +/** + * @typedef { import('@bpmn-io/properties-panel').EntryDefinition } Entry + */ - module.exports.refreshOptionsModel = refreshOptionsModel; +/** + * @returns {Array} entries + */ +function ErrorProps$2(props) { + const { + element + } = props; + if (!isErrorSupported(element)) { + return []; + } + const error = getError(element); + let entries = [{ + id: 'errorRef', + component: ErrorRef$1, + isEdited: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.isSelectEntryEdited + }]; + if (error) { + entries = [...entries, { + id: 'errorName', + component: ErrorName$1, + isEdited: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.isTextFieldEntryEdited + }, { + id: 'errorCode', + component: ErrorCode$2, + isEdited: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.isTextFieldEntryEdited + }]; + } + return entries; +} +function ErrorRef$1(props) { + const { + element + } = props; + const bpmnFactory = useService('bpmnFactory'); + const commandStack = useService('commandStack'); + const translate = useService('translate'); + const errorEventDefinition = getErrorEventDefinition(element); + const getValue = () => { + const error = getError(element); + if (error) { + return error.get('id'); + } + return EMPTY_OPTION$4; + }; + const setValue = value => { + const root = getRoot(errorEventDefinition); + const commands = []; + let error; + + // (1) create new error + if (value === CREATE_NEW_OPTION$4) { + error = createElement('bpmn:Error', { + name: nextId('Error_') + }, root, bpmnFactory); + value = error.get('id'); + commands.push({ + cmd: 'element.updateModdleProperties', + context: { + element, + moddleElement: root, + properties: { + rootElements: [...root.get('rootElements'), error] + } + } + }); + } + + // (2) update (or remove) errorRef + error = error || findRootElementById(errorEventDefinition, 'bpmn:Error', value); + commands.push({ + cmd: 'element.updateModdleProperties', + context: { + element, + moddleElement: errorEventDefinition, + properties: { + errorRef: error + } + } + }); + + // (3) commit all updates + return commandStack.execute('properties-panel.multi-command-executor', commands); + }; + const getOptions = () => { + let options = [{ + value: EMPTY_OPTION$4, + label: translate('') + }, { + value: CREATE_NEW_OPTION$4, + label: translate('Create new ...') + }]; + const errors = findRootElementsByType((0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element), 'bpmn:Error'); + sortByName$5(errors).forEach(error => { + options.push({ + value: error.get('id'), + label: error.get('name') + }); + }); + return options; + }; + return ReferenceSelectEntry({ + element, + id: 'errorRef', + label: translate('Global error reference'), + autoFocusEntry: 'errorName', + getValue, + setValue, + getOptions + }); +} +function ErrorName$1(props) { + const { + element + } = props; + const commandStack = useService('commandStack'); + const translate = useService('translate'); + const debounce = useService('debounceInput'); + const error = getError(element); + const getValue = () => { + return error.get('name'); + }; + const setValue = value => { + return commandStack.execute('element.updateModdleProperties', { + element, + moddleElement: error, + properties: { + name: value + } + }); + }; + return (0,_bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.TextFieldEntry)({ + element, + id: 'errorName', + label: translate('Name'), + getValue, + setValue, + debounce + }); +} +function ErrorCode$2(props) { + const { + element + } = props; + const commandStack = useService('commandStack'); + const translate = useService('translate'); + const debounce = useService('debounceInput'); + const error = getError(element); + const getValue = () => { + return error.get('errorCode'); + }; + const setValue = value => { + return commandStack.execute('element.updateModdleProperties', { + element, + moddleElement: error, + properties: { + errorCode: value + } + }); + }; + return (0,_bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.TextFieldEntry)({ + element, + id: 'errorCode', + label: translate('Code'), + getValue, + setValue, + debounce + }); +} + +// helper ///////////////////////// + +function sortByName$5(elements) { + return (0,min_dash__WEBPACK_IMPORTED_MODULE_12__.sortBy)(elements, e => (e.name || '').toLowerCase()); +} + +const CREATE_NEW_OPTION$3 = 'create-new'; + +/** + * @typedef { import('@bpmn-io/properties-panel').EntryDefinition } Entry + */ +/** + * @returns {Array} entries + */ +function EscalationProps$2(props) { + const { + element + } = props; + if (!isEscalationSupported(element)) { + return []; + } + const escalation = getEscalation(element); + let entries = [{ + id: 'escalationRef', + component: EscalationRef, + isEdited: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.isSelectEntryEdited + }]; + if (escalation) { + entries = [...entries, { + id: 'escalationName', + component: EscalationName, + isEdited: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.isTextFieldEntryEdited + }, { + id: 'escalationCode', + component: EscalationCode$1, + isEdited: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.isTextFieldEntryEdited + }]; + } + return entries; +} +function EscalationRef(props) { + const { + element + } = props; + const bpmnFactory = useService('bpmnFactory'); + const commandStack = useService('commandStack'); + const translate = useService('translate'); + const escalationEventDefinition = getEscalationEventDefinition(element); + const getValue = () => { + const escalation = getEscalation(element); + return escalation && escalation.get('id'); + }; + const setValue = value => { + const root = getRoot(escalationEventDefinition); + const commands = []; + let escalation; + + // (1) create new escalation + if (value === CREATE_NEW_OPTION$3) { + const id = nextId('Escalation_'); + escalation = createElement('bpmn:Escalation', { + id, + name: id + }, root, bpmnFactory); + value = escalation.get('id'); + commands.push({ + cmd: 'element.updateModdleProperties', + context: { + element, + moddleElement: root, + properties: { + rootElements: [...root.get('rootElements'), escalation] + } + } + }); + } + + // (2) update (or remove) escalationRef + escalation = escalation || findRootElementById(escalationEventDefinition, 'bpmn:Escalation', value); + commands.push({ + cmd: 'element.updateModdleProperties', + context: { + element, + moddleElement: escalationEventDefinition, + properties: { + escalationRef: escalation + } + } + }); + + // (3) commit all updates + return commandStack.execute('properties-panel.multi-command-executor', commands); + }; + const getOptions = () => { + let options = [{ + value: '', + label: translate('') + }, { + value: CREATE_NEW_OPTION$3, + label: translate('Create new ...') + }]; + const escalations = findRootElementsByType((0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element), 'bpmn:Escalation'); + sortByName$4(escalations).forEach(escalation => { + options.push({ + value: escalation.get('id'), + label: escalation.get('name') + }); + }); + return options; + }; + return ReferenceSelectEntry({ + element, + id: 'escalationRef', + label: translate('Global escalation reference'), + autoFocusEntry: 'escalationName', + getValue, + setValue, + getOptions + }); +} +function EscalationName(props) { + const { + element + } = props; + const commandStack = useService('commandStack'); + const translate = useService('translate'); + const debounce = useService('debounceInput'); + const escalation = getEscalation(element); + const getValue = () => { + return escalation.get('name'); + }; + const setValue = value => { + return commandStack.execute('element.updateModdleProperties', { + element, + moddleElement: escalation, + properties: { + name: value + } + }); + }; + return (0,_bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.TextFieldEntry)({ + element, + id: 'escalationName', + label: translate('Name'), + getValue, + setValue, + debounce + }); +} +function EscalationCode$1(props) { + const { + element + } = props; + const commandStack = useService('commandStack'); + const translate = useService('translate'); + const debounce = useService('debounceInput'); + const escalation = getEscalation(element); + const getValue = () => { + return escalation.get('escalationCode'); + }; + const setValue = value => { + return commandStack.execute('element.updateModdleProperties', { + element, + moddleElement: escalation, + properties: { + escalationCode: value + } + }); + }; + return (0,_bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.TextFieldEntry)({ + element, + id: 'escalationCode', + label: translate('Code'), + getValue, + setValue, + debounce + }); +} + +// helper ///////////////////////// + +function sortByName$4(elements) { + return (0,min_dash__WEBPACK_IMPORTED_MODULE_12__.sortBy)(elements, e => (e.name || '').toLowerCase()); +} + +/** + * @typedef { import('@bpmn-io/properties-panel').EntryDefinition } Entry + */ - /** - * fills the drop down with options - */ - function updateOptionsDropDown(domSelector, businessObject, referencedType, entryNode) { - var options = refreshOptionsModel(businessObject, referencedType); - addEmptyParameter(options); - var selectBox = domQuery(domSelector, entryNode); - domClear(selectBox); - - forEach(options, function(option) { - var optionEntry = domify(''); - selectBox.appendChild(optionEntry); - }); - return options; - } +/** + * @returns {Array} entries + */ +function ExecutableProps(props) { + const { + element + } = props; + if (!(0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.is)(element, 'bpmn:Process') && !hasProcessRef$1(element)) { + return []; + } + return [{ + id: 'isExecutable', + component: Executable, + isEdited: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.isCheckboxEntryEdited + }]; +} +function Executable(props) { + const { + element + } = props; + const modeling = useService('modeling'); + const commandStack = useService('commandStack'); + const translate = useService('translate'); + let getValue, setValue; + setValue = value => { + modeling.updateProperties(element, { + isExecutable: value + }); + }; + getValue = element => { + return element.businessObject.isExecutable; + }; + + // handle properties on processRef level for participants + if ((0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.is)(element, 'bpmn:Participant')) { + const process = element.businessObject.get('processRef'); + setValue = value => { + commandStack.execute('element.updateModdleProperties', { + element, + moddleElement: process, + properties: { + isExecutable: value + } + }); + }; + getValue = () => { + return process.get('isExecutable'); + }; + } + return (0,_bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.CheckboxEntry)({ + element, + id: 'isExecutable', + label: translate('Executable'), + getValue, + setValue + }); +} + +// helper ///////////////////// + +function hasProcessRef$1(element) { + return (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.is)(element, 'bpmn:Participant') && element.businessObject.get('processRef'); +} + +const SPACE_REGEX = /\s/; - module.exports.updateOptionsDropDown = updateOptionsDropDown; +// for QName validation as per http://www.w3.org/TR/REC-xml/#NT-NameChar +const QNAME_REGEX = /^([a-z][\w-.]*:)?[a-z_][\w-.]*$/i; +// for ID validation as per BPMN Schema (QName - Namespace) +const ID_REGEX = /^[a-z_][\w-.]*$/i; - /** - * checks whether the id value is valid - * - * @param {ModdleElement} bo - * @param {String} idValue - * @param {Function} translate - * - * @return {String} error message - */ - function isIdValid(bo, idValue, translate) { - var assigned = bo.$model.ids.assigned(idValue); +/** + * checks whether the id value is valid + * + * @param {ModdleElement} element + * @param {String} idValue + * @param {Function} translate + * + * @return {String} error message + */ +function isIdValid(element, idValue, translate) { + const assigned = element.$model.ids.assigned(idValue); + const idAlreadyExists = assigned && assigned !== element; + if (!idValue) { + return translate('ID must not be empty.'); + } + if (idAlreadyExists) { + return translate('ID must be unique.'); + } + return validateId(idValue, translate); +} +function validateId(idValue, translate) { + if (containsSpace(idValue)) { + return translate('ID must not contain spaces.'); + } + if (!ID_REGEX.test(idValue)) { + if (QNAME_REGEX.test(idValue)) { + return translate('ID must not contain prefix.'); + } + return translate('ID must be a valid QName.'); + } +} +function containsSpace(value) { + return SPACE_REGEX.test(value); +} + +/** + * @typedef { import('@bpmn-io/properties-panel').EntryDefinition } Entry + */ - var idExists = assigned && assigned !== bo; +/** + * @returns {Array} entries + */ +function IdProps() { + return [{ + id: 'id', + component: Id$3, + isEdited: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.isTextFieldEntryEdited + }]; +} +function Id$3(props) { + const { + element + } = props; + const modeling = useService('modeling'); + const debounce = useService('debounceInput'); + const translate = useService('translate'); + const setValue = (value, error) => { + if (error) { + return; + } + modeling.updateProperties(element, { + id: value + }); + }; + const getValue = (0,_bpmn_io_properties_panel_preact_hooks__WEBPACK_IMPORTED_MODULE_0__.useCallback)(element => { + return (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element).id; + }, [element]); + const validate = (0,_bpmn_io_properties_panel_preact_hooks__WEBPACK_IMPORTED_MODULE_0__.useCallback)(value => { + const businessObject = (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element); + return isIdValid(businessObject, value, translate); + }, [element, translate]); + return (0,_bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.TextFieldEntry)({ + element, + id: 'id', + label: translate((0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.is)(element, 'bpmn:Participant') ? 'Participant ID' : 'ID'), + getValue, + setValue, + debounce, + validate + }); +} + +/** + * @typedef { import('@bpmn-io/properties-panel').EntryDefinition } Entry + */ - if (!idValue || idExists) { - return translate('Element must have an unique id.'); - } +/** + * @returns {Array} entries + */ +function LinkProps(props) { + const { + element + } = props; + if (!isLinkSupported(element)) { + return []; + } + return [{ + id: 'linkName', + component: LinkName, + isEdited: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.isTextFieldEntryEdited + }]; +} +function LinkName(props) { + const { + element + } = props; + const commandStack = useService('commandStack'); + const translate = useService('translate'); + const debounce = useService('debounceInput'); + const linkEventDefinition = getLinkEventDefinition(element); + const getValue = () => { + return linkEventDefinition.get('name'); + }; + const setValue = value => { + commandStack.execute('element.updateModdleProperties', { + element, + moddleElement: linkEventDefinition, + properties: { + name: value + } + }); + }; + return (0,_bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.TextFieldEntry)({ + element, + id: 'linkName', + label: translate('Name'), + getValue, + setValue, + debounce + }); +} + +const EMPTY_OPTION$3 = ''; +const CREATE_NEW_OPTION$2 = 'create-new'; + +/** + * @typedef { import('@bpmn-io/properties-panel').EntryDefinition } Entry + */ - return validateId(idValue, translate); - } +/** + * @returns {Array} entries + */ +function MessageProps$1(props) { + const { + element + } = props; + if (!isMessageSupported(element)) { + return []; + } + const message = getMessage(element); + let entries = [{ + id: 'messageRef', + component: MessageRef, + isEdited: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.isSelectEntryEdited + }]; + if (message) { + entries = [...entries, { + id: 'messageName', + component: MessageName$1, + isEdited: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.isTextFieldEntryEdited + }]; + } + return entries; +} +function MessageRef(props) { + const { + element + } = props; + const bpmnFactory = useService('bpmnFactory'); + const commandStack = useService('commandStack'); + const translate = useService('translate'); + const messageEventDefinition = getMessageEventDefinition(element); + const getValue = () => { + const message = getMessage(element); + if (message) { + return message.get('id'); + } + return EMPTY_OPTION$3; + }; + const setValue = value => { + const root = getRoot(messageEventDefinition); + const commands = []; + let message; + + // (1) create new message + if (value === CREATE_NEW_OPTION$2) { + const id = nextId('Message_'); + message = createElement('bpmn:Message', { + id, + name: id + }, root, bpmnFactory); + value = message.get('id'); + commands.push({ + cmd: 'element.updateModdleProperties', + context: { + element, + moddleElement: root, + properties: { + rootElements: [...root.get('rootElements'), message] + } + } + }); + } + + // (2) update (or remove) messageRef + message = message || findRootElementById(messageEventDefinition, 'bpmn:Message', value); + commands.push({ + cmd: 'element.updateModdleProperties', + context: { + element, + moddleElement: messageEventDefinition, + properties: { + messageRef: message + } + } + }); + + // (3) commit all updates + return commandStack.execute('properties-panel.multi-command-executor', commands); + }; + const getOptions = () => { + let options = [{ + value: EMPTY_OPTION$3, + label: translate('') + }, { + value: CREATE_NEW_OPTION$2, + label: translate('Create new ...') + }]; + const messages = findRootElementsByType((0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element), 'bpmn:Message'); + sortByName$3(messages).forEach(message => { + options.push({ + value: message.get('id'), + label: message.get('name') + }); + }); + return options; + }; + return ReferenceSelectEntry({ + element, + id: 'messageRef', + label: translate('Global message reference'), + autoFocusEntry: 'messageName', + getValue, + setValue, + getOptions + }); +} +function MessageName$1(props) { + const { + element + } = props; + const commandStack = useService('commandStack'); + const translate = useService('translate'); + const debounce = useService('debounceInput'); + const message = getMessage(element); + const getValue = () => { + return message.get('name'); + }; + const setValue = value => { + return commandStack.execute('element.updateModdleProperties', { + element, + moddleElement: message, + properties: { + name: value + } + }); + }; + return (0,_bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.TextFieldEntry)({ + element, + id: 'messageName', + label: translate('Name'), + getValue, + setValue, + debounce + }); +} + +// helper ///////////////////////// + +function sortByName$3(elements) { + return (0,min_dash__WEBPACK_IMPORTED_MODULE_12__.sortBy)(elements, e => (e.name || '').toLowerCase()); +} + +/** + * @typedef { import('@bpmn-io/properties-panel').EntryDefinition } Entry + */ - module.exports.isIdValid = isIdValid; +/** + * @returns {Array} entries + */ +function MultiInstanceProps$2(props) { + const { + element + } = props; + if (!isMultiInstanceSupported$1(element)) { + return []; + } + const entries = [{ + id: 'loopCardinality', + component: LoopCardinality, + isEdited: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.isTextFieldEntryEdited + }, { + id: 'completionCondition', + component: CompletionCondition$1, + isEdited: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.isTextFieldEntryEdited + }]; + return entries; +} +function LoopCardinality(props) { + const { + element + } = props; + const bpmnFactory = useService('bpmnFactory'); + const debounce = useService('debounceInput'); + const commandStack = useService('commandStack'); + const translate = useService('translate'); + const getValue = () => { + return getLoopCardinalityValue(element); + }; + const setValue = value => { + return commandStack.execute('element.updateModdleProperties', updateFormalExpression(element, 'loopCardinality', value, bpmnFactory)); + }; + return (0,_bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.TextFieldEntry)({ + element, + id: 'loopCardinality', + label: translate('Loop cardinality'), + getValue, + setValue, + debounce + }); +} +function CompletionCondition$1(props) { + const { + element + } = props; + const bpmnFactory = useService('bpmnFactory'); + const debounce = useService('debounceInput'); + const commandStack = useService('commandStack'); + const translate = useService('translate'); + const getValue = () => { + return getCompletionConditionValue(element); + }; + const setValue = value => { + return commandStack.execute('element.updateModdleProperties', updateFormalExpression(element, 'completionCondition', value, bpmnFactory)); + }; + return (0,_bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.TextFieldEntry)({ + element, + id: 'completionCondition', + label: translate('Completion condition'), + getValue, + setValue, + debounce + }); +} + +// helper //////////////////////////// + +// generic /////////////////////////// + +/** + * isMultiInstanceSupported - check whether given element supports MultiInstanceLoopCharacteristics. + * + * @param {djs.model.Base} element + * @return {boolean} + */ +function isMultiInstanceSupported$1(element) { + const loopCharacteristics = getLoopCharacteristics$2(element); + return !!loopCharacteristics && (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.is)(loopCharacteristics, 'bpmn:MultiInstanceLoopCharacteristics'); +} +/** + * getBody - get the body of a given expression. + * + * @param {ModdleElement} expression + * @return {string} the body (value) of the expression + */ +function getBody(expression) { + return expression && expression.get('body'); +} - function validateId(idValue, translate) { +/** + * getProperty - get a property value of the loop characteristics. + * + * @param {djs.model.Base} element + * @param {string} propertyName + * + * @return {any} the property value + */ +function getProperty$2(element, propertyName) { + const loopCharacteristics = getLoopCharacteristics$2(element); + return loopCharacteristics && loopCharacteristics.get(propertyName); +} - if (containsSpace(idValue)) { - return translate('Id must not contain spaces.'); - } +/** + * getLoopCharacteristics - get loopCharacteristics of a given element. + * + * @param {djs.model.Base} element + * @return {ModdleElement | undefined} + */ +function getLoopCharacteristics$2(element) { + const bo = (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element); + return bo.loopCharacteristics; +} - if (!ID_REGEX.test(idValue)) { +/** + * createFormalExpression - creates a 'bpmn:FormalExpression' element. + * + * @param {ModdleElement} parent + * @param {string} body + * @param {BpmnFactory} bpmnFactory + * + * @result {ModdleElement} a formal expression + */ +function createFormalExpression$1(parent, body, bpmnFactory) { + return createElement('bpmn:FormalExpression', { + body: body + }, parent, bpmnFactory); +} + +/** + * updateFormalExpression - updates a specific formal expression of the loop characteristics. + * + * @param {djs.model.Base} element + * @param {string} propertyName + * @param {string} newValue + * @param {BpmnFactory} bpmnFactory + */ +function updateFormalExpression(element, propertyName, newValue, bpmnFactory) { + const loopCharacteristics = getLoopCharacteristics$2(element); + const expressionProps = {}; + if (!newValue) { + // remove formal expression + expressionProps[propertyName] = undefined; + return { + element, + moddleElement: loopCharacteristics, + properties: expressionProps + }; + } + const existingExpression = loopCharacteristics.get(propertyName); + if (!existingExpression) { + // add formal expression + expressionProps[propertyName] = createFormalExpression$1(loopCharacteristics, newValue, bpmnFactory); + return { + element, + moddleElement: loopCharacteristics, + properties: expressionProps + }; + } + + // edit existing formal expression + return { + element, + moddleElement: existingExpression, + properties: { + body: newValue + } + }; +} + +// loopCardinality + +/** + * getLoopCardinality - get the loop cardinality of the loop characteristics. + * + * @param {djs.model.Base} element + * + * @return {ModdleElement} an expression representing the loop cardinality + */ +function getLoopCardinality(element) { + return getProperty$2(element, 'loopCardinality'); +} - if (QNAME_REGEX.test(idValue)) { - return translate('Id must not contain prefix.'); - } +/** + * getLoopCardinalityValue - get the loop cardinality value of the loop characteristics. + * + * @param {djs.model.Base} element + * + * @return {string} the loop cardinality value + */ +function getLoopCardinalityValue(element) { + const loopCardinality = getLoopCardinality(element); + return getBody(loopCardinality); +} - return translate('Id must be a valid QName.'); - } - } +// completionCondition ///////////////////// - module.exports.validateId = validateId; +/** + * getCompletionCondition - get the completion condition of the loop characteristics. + * + * @param {djs.model.Base} element + * + * @return {ModdleElement} an expression representing the completion condition + */ +function getCompletionCondition$1(element) { + return getProperty$2(element, 'completionCondition'); +} +/** + * getCompletionConditionValue - get the completion condition value of the loop characteristics. + * + * @param {djs.model.Base} element + * + * @return {string} the completion condition value + */ +function getCompletionConditionValue(element) { + const completionCondition = getCompletionCondition$1(element); + return getBody(completionCondition); +} - function containsSpace(value) { - return SPACE_REGEX.test(value); - } +/** + * @typedef { import('@bpmn-io/properties-panel').EntryDefinition } Entry + */ - module.exports.containsSpace = containsSpace; +/** + * @returns {Array} entries + */ +function NameProps(props) { + const { + element + } = props; + if ((0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.isAny)(element, ['bpmn:Collaboration', 'bpmn:DataAssociation', 'bpmn:Association'])) { + return []; + } + return [{ + id: 'name', + component: Name$3, + isEdited: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.isTextAreaEntryEdited + }]; +} +function Name$3(props) { + const { + element + } = props; + const modeling = useService('modeling'); + const debounce = useService('debounceInput'); + const canvas = useService('canvas'); + const bpmnFactory = useService('bpmnFactory'); + const translate = useService('translate'); + + // (1) default: name + let options = { + element, + id: 'name', + label: translate('Name'), + debounce, + setValue: value => { + modeling.updateProperties(element, { + name: value + }); + }, + getValue: element => { + return element.businessObject.name; + }, + autoResize: true + }; + + // (2) text annotations + if ((0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.is)(element, 'bpmn:TextAnnotation')) { + options = { + ...options, + setValue: value => { + modeling.updateProperties(element, { + text: value + }); + }, + getValue: element => { + return element.businessObject.text; + } + }; + } + + // (3) groups + else if ((0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.is)(element, 'bpmn:Group')) { + options = { + ...options, + setValue: value => { + const businessObject = (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element), + categoryValueRef = businessObject.categoryValueRef; + if (!categoryValueRef) { + initializeCategory(businessObject, canvas.getRootElement(), bpmnFactory); + } + modeling.updateLabel(element, value); + }, + getValue: element => { + const businessObject = (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element), + categoryValueRef = businessObject.categoryValueRef; + return categoryValueRef && categoryValueRef.value; + } + }; + } + + // (4) participants (only update label) + else if ((0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.is)(element, 'bpmn:Participant')) { + options.label = translate('Participant Name'); + } + return (0,_bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.TextAreaEntry)(options); +} + +// helpers //////////////////////// + +function initializeCategory(businessObject, rootElement, bpmnFactory) { + const definitions = (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(rootElement).$parent; + const categoryValue = createCategoryValue(definitions, bpmnFactory); + businessObject.categoryValueRef = categoryValue; +} +function createCategoryValue(definitions, bpmnFactory) { + const categoryValue = bpmnFactory.create('bpmn:CategoryValue'); + const category = bpmnFactory.create('bpmn:Category', { + categoryValue: [categoryValue] + }); + + // add to correct place + (0,diagram_js_lib_util_Collections__WEBPACK_IMPORTED_MODULE_15__.add)(definitions.get('rootElements'), category); + (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(category).$parent = definitions; + (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(categoryValue).$parent = category; + return categoryValue; +} + +/** + * @typedef { import('@bpmn-io/properties-panel').EntryDefinition } Entry + */ - /** - * generate a semantic id with given prefix - */ - function nextId(prefix) { - var ids = new Ids([32,32,1]); +/** + * @returns {Array} entries + */ +function ProcessProps(props) { + const { + element + } = props; + if (!hasProcessRef(element)) { + return []; + } + return [{ + id: 'processId', + component: ProcessId, + isEdited: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.isTextFieldEntryEdited + }, { + id: 'processName', + component: ProcessName, + isEdited: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.isTextFieldEntryEdited + }]; +} +function ProcessName(props) { + const { + element + } = props; + const commandStack = useService('commandStack'); + const translate = useService('translate'); + const debounce = useService('debounceInput'); + const process = element.businessObject.get('processRef'); + const getValue = () => { + return process.get('name'); + }; + const setValue = value => { + commandStack.execute('element.updateModdleProperties', { + element, + moddleElement: process, + properties: { + name: value + } + }); + }; + return (0,_bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.TextFieldEntry)({ + element, + id: 'processName', + label: translate('Process name'), + getValue, + setValue, + debounce + }); +} +function ProcessId(props) { + const { + element + } = props; + const commandStack = useService('commandStack'); + const translate = useService('translate'); + const debounce = useService('debounceInput'); + const process = element.businessObject.get('processRef'); + const getValue = () => { + return process.get('id'); + }; + const setValue = (value, error) => { + if (error) { + return; + } + commandStack.execute('element.updateModdleProperties', { + element, + moddleElement: process, + properties: { + id: value + } + }); + }; + const validate = (0,_bpmn_io_properties_panel_preact_hooks__WEBPACK_IMPORTED_MODULE_0__.useCallback)(value => { + return isIdValid(process, value, translate); + }, [process, translate]); + return (0,_bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.TextFieldEntry)({ + element, + id: 'processId', + label: translate('Process ID'), + getValue, + setValue, + debounce, + validate + }); +} + +// helper //////////////// + +function hasProcessRef(element) { + return (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.is)(element, 'bpmn:Participant') && element.businessObject.get('processRef'); +} + +/** + * @typedef { import('@bpmn-io/properties-panel').EntryDefinition } Entry + */ - return ids.nextPrefixed(prefix); - } +const EMPTY_OPTION$2 = ''; +const CREATE_NEW_OPTION$1 = 'create-new'; - module.exports.nextId = nextId; +/** + * @returns {Entry[]} + */ +function SignalProps$1(props) { + const { + element + } = props; + if (!isSignalSupported$1(element)) { + return []; + } + const signal = getSignal$1(element); + let entries = [{ + id: 'signalRef', + component: SignalRef, + isEdited: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.isSelectEntryEdited + }]; + if (signal) { + entries = [...entries, { + id: 'signalName', + component: SignalName$1, + isEdited: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.isTextFieldEntryEdited + }]; + } + return entries; +} +function SignalRef(props) { + const { + element + } = props; + const bpmnFactory = useService('bpmnFactory'); + const commandStack = useService('commandStack'); + const translate = useService('translate'); + const signalEventDefinition = getSignalEventDefinition$1(element); + const getValue = () => { + const signal = getSignal$1(element); + if (signal) { + return signal.get('id'); + } + return EMPTY_OPTION$2; + }; + const setValue = value => { + const root = getRoot(signalEventDefinition); + const commands = []; + let signal; + + // (1) create new signal + if (value === CREATE_NEW_OPTION$1) { + const id = nextId('Signal_'); + signal = createElement('bpmn:Signal', { + id, + name: id + }, root, bpmnFactory); + value = signal.get('id'); + commands.push({ + cmd: 'element.updateModdleProperties', + context: { + element, + moddleElement: root, + properties: { + rootElements: [...root.get('rootElements'), signal] + } + } + }); + } + + // (2) update (or remove) signalRef + signal = signal || findRootElementById(signalEventDefinition, 'bpmn:Signal', value); + commands.push({ + cmd: 'element.updateModdleProperties', + context: { + element, + moddleElement: signalEventDefinition, + properties: { + signalRef: signal + } + } + }); + + // (3) commit all updates + return commandStack.execute('properties-panel.multi-command-executor', commands); + }; + const getOptions = () => { + let options = [{ + value: EMPTY_OPTION$2, + label: translate('') + }, { + value: CREATE_NEW_OPTION$1, + label: translate('Create new ...') + }]; + const signals = findRootElementsByType((0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element), 'bpmn:Signal'); + sortByName$2(signals).forEach(signal => { + options.push({ + value: signal.get('id'), + label: signal.get('name') + }); + }); + return options; + }; + return ReferenceSelectEntry({ + element, + id: 'signalRef', + label: translate('Global signal reference'), + autoFocusEntry: 'signalName', + getValue, + setValue, + getOptions + }); +} +function SignalName$1(props) { + const { + element + } = props; + const commandStack = useService('commandStack'); + const translate = useService('translate'); + const debounce = useService('debounceInput'); + const signal = getSignal$1(element); + const getValue = () => { + return signal.get('name'); + }; + const setValue = value => { + return commandStack.execute('element.updateModdleProperties', { + element, + moddleElement: signal, + properties: { + name: value + } + }); + }; + return (0,_bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.TextFieldEntry)({ + element, + id: 'signalName', + label: translate('Name'), + getValue, + setValue, + debounce + }); +} + +// helper ///////////////////////// + +function sortByName$2(elements) { + return (0,min_dash__WEBPACK_IMPORTED_MODULE_12__.sortBy)(elements, e => (e.name || '').toLowerCase()); +} + +function isTimerSupported(element) { + return (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.isAny)(element, ['bpmn:StartEvent', 'bpmn:IntermediateCatchEvent', 'bpmn:BoundaryEvent']) && !!getTimerEventDefinition(element); +} + +/** + * Get the timer definition type for a given timer event definition. + * + * @param {ModdleElement} timer + * + * @return {string|undefined} the timer definition type + */ +function getTimerDefinitionType(timer) { + if (!timer) { + return; + } + const timeDate = timer.get('timeDate'); + if (typeof timeDate !== 'undefined') { + return 'timeDate'; + } + const timeCycle = timer.get('timeCycle'); + if (typeof timeCycle !== 'undefined') { + return 'timeCycle'; + } + const timeDuration = timer.get('timeDuration'); + if (typeof timeDuration !== 'undefined') { + return 'timeDuration'; + } +} +function getTimerEventDefinition(element) { + return getEventDefinition(element, 'bpmn:TimerEventDefinition'); +} +function getEventDefinition(element, eventType) { + const businessObject = (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element); + const eventDefinitions = businessObject.get('eventDefinitions') || []; + return (0,min_dash__WEBPACK_IMPORTED_MODULE_12__.find)(eventDefinitions, function (definition) { + return (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.is)(definition, eventType); + }); +} +function getSignalEventDefinition(element) { + return getEventDefinition(element, 'bpmn:SignalEventDefinition'); +} +function isSignalSupported(element) { + return (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.is)(element, 'bpmn:Event') && !!getSignalEventDefinition(element); +} +function getSignal(element) { + const signalEventDefinition = getSignalEventDefinition(element); + return signalEventDefinition && signalEventDefinition.get('signalRef'); +} + +function TimerProps$2(props) { + const { + element, + idPrefix + } = props; + let { + timerEventDefinition + } = props; + if (!timerEventDefinition) { + const businessObject = (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element); + timerEventDefinition = getTimerEventDefinition(businessObject); + } + const timerEventDefinitionType = getTimerDefinitionType(timerEventDefinition); + + // (1) Only show for supported elements + if (!isTimerSupported(element)) { + return []; + } + + // (2) Provide entries, have a value only if selection was made + const entries = []; + entries.push({ + id: getId$1(idPrefix, 'timerEventDefinitionType'), + component: TimerEventDefinitionType$2, + isEdited: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.isSelectEntryEdited, + timerEventDefinition, + timerEventDefinitionType + }); + if (timerEventDefinitionType) { + entries.push({ + id: getId$1(idPrefix, 'timerEventDefinitionValue'), + component: TimerEventDefinitionValue$2, + isEdited: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.isTextFieldEntryEdited, + timerEventDefinition, + timerEventDefinitionType + }); + } + return entries; +} + +/** + * TimerEventDefinitionType - Generic select entry allowing to select a specific + * timerEventDefintionType. To be used together with timerEventDefinitionValue. + * + * @param {type} props + * @return {SelectEntry} + */ +function TimerEventDefinitionType$2(props) { + const { + element, + timerEventDefinition, + timerEventDefinitionType + } = props; + const commandStack = useService('commandStack'), + bpmnFactory = useService('bpmnFactory'), + translate = useService('translate'); + const getValue = () => { + return timerEventDefinitionType || ''; + }; + const setValue = value => { + // (1) Check if value is different to current type + if (value === timerEventDefinitionType) { + return; + } + + // (2) Create empty formalExpression element + const formalExpression = bpmnFactory.create('bpmn:FormalExpression', { + body: undefined + }); + formalExpression.$parent = timerEventDefinition; + + // (3) Set the value for selected timerEventDefinitionType + const newProps = { + timeDuration: undefined, + timeDate: undefined, + timeCycle: undefined + }; + if (value !== '') { + newProps[value] = formalExpression; + } + + // (4) Execute businessObject update + commandStack.execute('element.updateModdleProperties', { + element, + moddleElement: timerEventDefinition, + properties: newProps + }); + }; + const getOptions = element => { + return [{ + value: '', + label: translate('') + }, { + value: 'timeDate', + label: translate('Date') + }, { + value: 'timeDuration', + label: translate('Duration') + }, { + value: 'timeCycle', + label: translate('Cycle') + }]; + }; + return (0,_bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.SelectEntry)({ + element, + id: 'timerEventDefinitionType', + label: translate('Type'), + getValue, + setValue, + getOptions + }); +} + +/** + * TimerEventDefinitionValue - Generic textField entry allowing to specify the + * timerEventDefintionValue based on the set timerEventDefintionType. To be used + * together with timerEventDefinitionType. + * + * @param {type} props + * @return {TextFieldEntry} + */ +function TimerEventDefinitionValue$2(props) { + const { + element, + timerEventDefinition, + timerEventDefinitionType + } = props; + const commandStack = useService('commandStack'), + translate = useService('translate'), + debounce = useService('debounceInput'); + const timerEventFormalExpression = timerEventDefinition.get(timerEventDefinitionType); + const getValue = () => { + return timerEventFormalExpression && timerEventFormalExpression.get('body'); + }; + const setValue = value => { + commandStack.execute('element.updateModdleProperties', { + element, + moddleElement: timerEventFormalExpression, + properties: { + body: value + } + }); + }; + return (0,_bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.TextFieldEntry)({ + element, + id: 'timerEventDefinitionValue', + label: translate('Value'), + getValue, + setValue, + debounce, + tooltip: getTimerEventDefinitionValueDescription$2(timerEventDefinitionType, translate) + }); +} + +// helper ////////////////////////// + +function getTimerEventDefinitionValueDescription$2(timerDefinitionType, translate) { + switch (timerDefinitionType) { + case 'timeDate': + return (0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("div", { + children: [(0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("p", { + children: translate('A specific point in time defined as ISO 8601 combined date and time representation.') + }), (0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("ul", { + children: [(0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("li", { + children: [(0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("code", { + children: "2019-10-01T12:00:00Z" + }), " - ", translate('UTC time')] + }), (0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("li", { + children: [(0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("code", { + children: "2019-10-02T08:09:40+02:00" + }), " - ", translate('UTC plus 2 hours zone offset')] + })] + }), (0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("a", { + href: "https://docs.camunda.org/manual/latest/reference/bpmn20/events/timer-events/#time-date", + target: "_blank", + rel: "noopener", + children: translate('Documentation: Timer events') + })] + }); + case 'timeCycle': + return (0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("div", { + children: [(0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("p", { + children: translate('A cycle defined as ISO 8601 repeating intervals format.') + }), (0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("ul", { + children: [(0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("li", { + children: [(0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("code", { + children: "R5/PT10S" + }), " - ", translate('every 10 seconds, up to 5 times')] + }), (0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("li", { + children: [(0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("code", { + children: "R/P1D" + }), " - ", translate('every day, infinitely')] + })] + }), (0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("a", { + href: "https://docs.camunda.org/manual/latest/reference/bpmn20/events/timer-events/#time-cycle", + target: "_blank", + rel: "noopener", + children: translate('Documentation: Timer events') + })] + }); + case 'timeDuration': + return (0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("div", { + children: [(0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("p", { + children: translate('A time duration defined as ISO 8601 durations format.') + }), (0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("ul", { + children: [(0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("li", { + children: [(0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("code", { + children: "PT15S" + }), " - ", translate('15 seconds')] + }), (0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("li", { + children: [(0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("code", { + children: "PT1H30M" + }), " - ", translate('1 hour and 30 minutes')] + }), (0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("li", { + children: [(0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("code", { + children: "P14D" + }), " - ", translate('14 days')] + })] + }), (0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("a", { + href: "https://docs.camunda.org/manual/latest/reference/bpmn20/events/timer-events/#time-duration", + target: "_blank", + rel: "noopener", + children: translate('Documentation: Timer events') + })] + }); + } +} +function getId$1(idPrefix, id) { + return idPrefix ? idPrefix + id : id; +} + +function GeneralGroup(element, injector) { + const translate = injector.get('translate'); + const entries = [...NameProps({ + element + }), ...IdProps(), ...ProcessProps({ + element + }), ...ExecutableProps({ + element + })]; + return { + id: 'general', + label: translate('General'), + entries, + component: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.Group + }; +} +function CompensationGroup(element, injector) { + const translate = injector.get('translate'); + const group = { + label: translate('Compensation'), + id: 'compensation', + component: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.Group, + entries: [...CompensationProps({ + element + })] + }; + if (group.entries.length) { + return group; + } + return null; +} +function DocumentationGroup(element, injector) { + const translate = injector.get('translate'); + const entries = [...DocumentationProps({ + element + })]; + return { + id: 'documentation', + label: translate('Documentation'), + entries, + component: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.Group + }; +} +function ErrorGroup(element, injector) { + const translate = injector.get('translate'); + const group = { + id: 'error', + label: translate('Error'), + component: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.Group, + entries: [...ErrorProps$2({ + element + })] + }; + if (group.entries.length) { + return group; + } + return null; +} +function MessageGroup(element, injector) { + const translate = injector.get('translate'); + const group = { + id: 'message', + label: translate('Message'), + component: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.Group, + entries: [...MessageProps$1({ + element + })] + }; + if (group.entries.length) { + return group; + } + return null; +} +function SignalGroup(element, injector) { + const translate = injector.get('translate'); + const group = { + id: 'signal', + label: translate('Signal'), + component: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.Group, + entries: [...SignalProps$1({ + element + })] + }; + if (group.entries.length) { + return group; + } + return null; +} +function LinkGroup(element, injector) { + const translate = injector.get('translate'); + const group = { + label: translate('Link'), + id: 'link', + component: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.Group, + entries: [...LinkProps({ + element + })] + }; + if (group.entries.length) { + return group; + } + return null; +} +function EscalationGroup(element, injector) { + const translate = injector.get('translate'); + const group = { + id: 'escalation', + label: translate('Escalation'), + component: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.Group, + entries: [...EscalationProps$2({ + element + })] + }; + if (group.entries.length) { + return group; + } + return null; +} +function TimerGroup(element, injector) { + const translate = injector.get('translate'); + const group = { + label: translate('Timer'), + id: 'timer', + component: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.Group, + entries: [...TimerProps$2({ + element + })] + }; + if (group.entries.length) { + return group; + } + return null; +} +function MultiInstanceGroup(element, injector) { + const translate = injector.get('translate'); + const group = { + label: translate('Multi-instance'), + id: 'multiInstance', + component: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.Group, + entries: [...MultiInstanceProps$2({ + element + })] + }; + if (group.entries.length) { + return group; + } + return null; +} +function getGroups(element, injector) { + const groups = [GeneralGroup(element, injector), DocumentationGroup(element, injector), CompensationGroup(element, injector), ErrorGroup(element, injector), LinkGroup(element, injector), MessageGroup(element, injector), MultiInstanceGroup(element, injector), SignalGroup(element, injector), EscalationGroup(element, injector), TimerGroup(element, injector)]; + + // contract: if a group returns null, it should not be displayed at all + return groups.filter(group => group !== null); +} +class BpmnPropertiesProvider { + constructor(propertiesPanel, injector) { + propertiesPanel.registerProvider(this); + this._injector = injector; + } + getGroups(element) { + return groups => { + groups = groups.concat(getGroups(element, this._injector)); + return groups; + }; + } +} +BpmnPropertiesProvider.$inject = ['propertiesPanel', 'injector']; + +var index$2 = { + __init__: ['bpmnPropertiesProvider'], + bpmnPropertiesProvider: ['type', BpmnPropertiesProvider] +}; + +/** + * Get extension elements of business object. Optionally filter by type. + * + * @param {ModdleElement} businessObject + * @param {string} [type=undefined] + * @returns {Array} + */ +function getExtensionElementsList(businessObject, type = undefined) { + const extensionElements = businessObject.get('extensionElements'); + if (!extensionElements) { + return []; + } + const values = extensionElements.get('values'); + if (!values || !values.length) { + return []; + } + if (type) { + return values.filter(value => (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.is)(value, type)); + } + return values; +} + +/** + * Add one or more extension elements. Create bpmn:ExtensionElements if it doesn't exist. + * + * @param {ModdleElement} element + * @param {ModdleElement} businessObject + * @param {ModdleElement|Array} extensionElementsToAdd + * @param {CommandStack} commandStack + */ +function addExtensionElements(element, businessObject, extensionElementToAdd, bpmnFactory, commandStack) { + const commands = []; + let extensionElements = businessObject.get('extensionElements'); + + // (1) create bpmn:ExtensionElements if it doesn't exist + if (!extensionElements) { + extensionElements = createElement('bpmn:ExtensionElements', { + values: [] + }, businessObject, bpmnFactory); + commands.push({ + cmd: 'element.updateModdleProperties', + context: { + element, + moddleElement: businessObject, + properties: { + extensionElements + } + } + }); + } + extensionElementToAdd.$parent = extensionElements; + + // (2) add extension element to list + commands.push({ + cmd: 'element.updateModdleProperties', + context: { + element, + moddleElement: extensionElements, + properties: { + values: [...extensionElements.get('values'), extensionElementToAdd] + } + } + }); + commandStack.execute('properties-panel.multi-command-executor', commands); +} + +/** + * Remove one or more extension elements. Remove bpmn:ExtensionElements afterwards if it's empty. + * + * @param {ModdleElement} element + * @param {ModdleElement} businessObject + * @param {ModdleElement|Array} extensionElementsToRemove + * @param {CommandStack} commandStack + */ +function removeExtensionElements(element, businessObject, extensionElementsToRemove, commandStack) { + if (!(0,min_dash__WEBPACK_IMPORTED_MODULE_12__.isArray)(extensionElementsToRemove)) { + extensionElementsToRemove = [extensionElementsToRemove]; + } + const extensionElements = businessObject.get('extensionElements'), + values = extensionElements.get('values').filter(value => !extensionElementsToRemove.includes(value)); + commandStack.execute('element.updateModdleProperties', { + element, + moddleElement: extensionElements, + properties: { + values + } + }); +} + +const fallbackResolver = { + getVariablesForElement: bo => (0,_bpmn_io_extract_process_variables_zeebe__WEBPACK_IMPORTED_MODULE_6__.getVariablesForElement)(bo) +}; +function withVariableContext(Component) { + return props => { + const { + bpmnElement, + element + } = props; + const bo = (bpmnElement || element).businessObject; + const [variables, setVariables] = (0,_bpmn_io_properties_panel_preact_hooks__WEBPACK_IMPORTED_MODULE_0__.useState)([]); + const eventBus = useService('eventBus'); + const variableResolver = useServiceIfAvailable('variableResolver', fallbackResolver); + (0,_bpmn_io_properties_panel_preact_hooks__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => { + const extractVariables = async () => { + const variables = await variableResolver.getVariablesForElement(bo, element); + setVariables(variables.map(variable => { + return { + ...variable, + info: variable.info || variable.origin && 'Written in ' + variable.origin.map(origin => origin.name || origin.id).join(', ') + }; + })); + }; + + // The callback must return undefined, so the event propagation is not canceled. + // Cf. https://github.com/camunda/camunda-modeler/issues/3392 + const callback = () => { + extractVariables(); + }; + eventBus.on('commandStack.changed', callback); + callback(); + return () => { + eventBus.off('commandStack.changed', callback); + }; + }, [bo]); + return (0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(Component, { + ...props, + variables: variables + }); + }; +} + +// helpers ////////// + +function useServiceIfAvailable(service, fallback) { + const resolved = useService(service, false); + if (!resolved) { + return fallback; + } + return resolved; +} + +function withTooltipContainer(Component) { + return props => { + const tooltipContainer = (0,_bpmn_io_properties_panel_preact_hooks__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => { + const config = useService('config'); + return config && config.propertiesPanel && config.propertiesPanel.feelTooltipContainer; + }, []); + return (0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(Component, { + ...props, + tooltipContainer: tooltipContainer + }); + }; +} + +const FeelEntry = withTooltipContainer(_bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.FeelEntry); +const FeelEntryWithVariableContext = withVariableContext(FeelEntry); + +function AssignmentDefinitionProps(props) { + const { + element + } = props; + if (!(0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.is)(element, 'bpmn:UserTask')) { + return []; + } + return [{ + id: 'assignmentDefinitionAssignee', + component: Assignee$1, + isEdited: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.isFeelEntryEdited + }, { + id: 'assignmentDefinitionCandidateGroups', + component: CandidateGroups$1, + isEdited: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.isFeelEntryEdited + }, { + id: 'assignmentDefinitionCandidateUsers', + component: CandidateUsers$1, + isEdited: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.isFeelEntryEdited + }]; +} +function Assignee$1(props) { + const { + element + } = props; + const commandStack = useService('commandStack'); + const bpmnFactory = useService('bpmnFactory'); + const translate = useService('translate'); + const debounce = useService('debounceInput'); + const getValue = () => { + return (getAssignmentDefinition(element) || {}).assignee; + }; + const setValue = value => { + const commands = []; + const businessObject = (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element); + let extensionElements = businessObject.get('extensionElements'); + + // (1) ensure extension elements + if (!extensionElements) { + extensionElements = createElement('bpmn:ExtensionElements', { + values: [] + }, businessObject, bpmnFactory); + commands.push({ + cmd: 'element.updateModdleProperties', + context: { + element, + moddleElement: businessObject, + properties: { + extensionElements + } + } + }); + } + + // (2) ensure AssignmentDefinition + let assignmentDefinition = getAssignmentDefinition(element); + if (!assignmentDefinition) { + assignmentDefinition = createElement('zeebe:AssignmentDefinition', {}, extensionElements, bpmnFactory); + commands.push({ + cmd: 'element.updateModdleProperties', + context: { + element, + moddleElement: extensionElements, + properties: { + values: [...extensionElements.get('values'), assignmentDefinition] + } + } + }); + } + + // (3) update assignee definition type + commands.push({ + cmd: 'element.updateModdleProperties', + context: { + element, + moddleElement: assignmentDefinition, + properties: { + assignee: value + } + } + }); + + // (4) commit all updates + commandStack.execute('properties-panel.multi-command-executor', commands); + }; + return FeelEntryWithVariableContext({ + element, + id: 'assignmentDefinitionAssignee', + label: translate('Assignee'), + feel: 'optional', + getValue, + setValue, + debounce + }); +} +function CandidateGroups$1(props) { + const { + element + } = props; + const commandStack = useService('commandStack'); + const bpmnFactory = useService('bpmnFactory'); + const translate = useService('translate'); + const debounce = useService('debounceInput'); + const getValue = () => { + return (getAssignmentDefinition(element) || {}).candidateGroups; + }; + const setValue = value => { + let commands = []; + const businessObject = (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element); + let extensionElements = businessObject.get('extensionElements'); + + // (1) ensure extension elements + if (!extensionElements) { + extensionElements = createElement('bpmn:ExtensionElements', { + values: [] + }, businessObject, bpmnFactory); + commands.push({ + cmd: 'element.updateModdleProperties', + context: { + element, + moddleElement: businessObject, + properties: { + extensionElements + } + } + }); + } + + // (2) ensure assignmentDefinition + let assignmentDefinition = getAssignmentDefinition(element); + if (!assignmentDefinition) { + assignmentDefinition = createElement('zeebe:AssignmentDefinition', {}, extensionElements, bpmnFactory); + commands.push({ + cmd: 'element.updateModdleProperties', + context: { + element, + moddleElement: extensionElements, + properties: { + values: [...extensionElements.get('values'), assignmentDefinition] + } + } + }); + } + + // (3) update candidateGroups + commands.push({ + cmd: 'element.updateModdleProperties', + context: { + element, + moddleElement: assignmentDefinition, + properties: { + candidateGroups: value + } + } + }); + commandStack.execute('properties-panel.multi-command-executor', commands); + }; + return FeelEntryWithVariableContext({ + element, + id: 'assignmentDefinitionCandidateGroups', + label: translate('Candidate groups'), + feel: 'optional', + getValue, + setValue, + debounce + }); +} +function CandidateUsers$1(props) { + const { + element + } = props; + const commandStack = useService('commandStack'); + const bpmnFactory = useService('bpmnFactory'); + const translate = useService('translate'); + const debounce = useService('debounceInput'); + const getValue = () => { + return (getAssignmentDefinition(element) || {}).candidateUsers; + }; + const setValue = value => { + let commands = []; + const businessObject = (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element); + let extensionElements = businessObject.get('extensionElements'); + + // (1) ensure extension elements + if (!extensionElements) { + extensionElements = createElement('bpmn:ExtensionElements', { + values: [] + }, businessObject, bpmnFactory); + commands.push({ + cmd: 'element.updateModdleProperties', + context: { + element, + moddleElement: businessObject, + properties: { + extensionElements + } + } + }); + } + + // (2) ensure assignmentDefinition + let assignmentDefinition = getAssignmentDefinition(element); + if (!assignmentDefinition) { + assignmentDefinition = createElement('zeebe:AssignmentDefinition', {}, extensionElements, bpmnFactory); + commands.push({ + cmd: 'element.updateModdleProperties', + context: { + element, + moddleElement: extensionElements, + properties: { + values: [...extensionElements.get('values'), assignmentDefinition] + } + } + }); + } + + // (3) update candidateUsers + commands.push({ + cmd: 'element.updateModdleProperties', + context: { + element, + moddleElement: assignmentDefinition, + properties: { + candidateUsers: value + } + } + }); + commandStack.execute('properties-panel.multi-command-executor', commands); + }; + return FeelEntryWithVariableContext({ + element, + id: 'assignmentDefinitionCandidateUsers', + label: translate('Candidate users'), + feel: 'optional', + getValue, + setValue, + debounce + }); +} + +// helper /////////////////////// + +function getAssignmentDefinition(element) { + const businessObject = (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element); + return getExtensionElementsList(businessObject, 'zeebe:AssignmentDefinition')[0]; +} + +function isZeebeServiceTask(element) { + if (!(0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.is)(element, 'zeebe:ZeebeServiceTask')) return false; + if ((0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.is)(element, 'bpmn:EndEvent') || (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.is)(element, 'bpmn:IntermediateThrowEvent')) { + return !!getMessageEventDefinition(element); + } + + // BusinessRuleTask and ScriptTask are ServiceTasks only if they have a TaskDefinition + // (ie. if the implementation is set to ==JobWorker) + if ((0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.isAny)(element, ['bpmn:BusinessRuleTask', 'bpmn:ScriptTask']) && !getTaskDefinition$3(element)) { + return false; + } + return true; +} +function isMessageEndEvent(element) { + return (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.is)(element, 'bpmn:EndEvent') && !!getMessageEventDefinition(element); +} +function isMessageThrowEvent(element) { + return (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.is)(element, 'bpmn:IntermediateThrowEvent') && !!getMessageEventDefinition(element); +} + +// helper //////////////// + +function getTaskDefinition$3(element) { + const businessObject = (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element); + return getExtensionElementsList(businessObject, 'zeebe:TaskDefinition')[0]; +} + +function areHeadersSupported(element) { + return (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.is)(element, 'bpmn:UserTask') || isZeebeServiceTask(element); +} + +/** + * Get first zeebe:TaskHeaders element for a specific element. + * + * @param {ModdleElement} element + * + * @return {ModdleElement} a zeebe:TaskHeader element + */ +function getTaskHeaders$1(element) { + const businessObject = (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element); + return getExtensionElementsList(businessObject, 'zeebe:TaskHeaders')[0]; +} +/** + * Retrieve all zeebe:Header elements for a specific element. + * + * @param {ModdleElement} element + * + * @return {Array} a list of zeebe:Header elements + */ +function getHeaders(element) { + const taskHeaders = getTaskHeaders$1(element); + return taskHeaders ? taskHeaders.get('values') : []; +} + +const DMN_IMPLEMENTATION_OPTION = 'dmn', + JOB_WORKER_IMPLEMENTATION_OPTION$1 = 'jobWorker', + DEFAULT_IMPLEMENTATION_OPTION$1 = ''; +function BusinessRuleImplementationProps(props) { + const { + element + } = props; + if (!(0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.is)(element, 'bpmn:BusinessRuleTask')) { + return []; + } + return [{ + id: 'businessRuleImplementation', + component: BusinessRuleImplementation, + isEdited: () => isBusinessRuleImplementationEdited(element) + }]; +} +function BusinessRuleImplementation(props) { + const { + element, + id + } = props; + const commandStack = useService('commandStack'); + const bpmnFactory = useService('bpmnFactory'); + const translate = useService('translate'); + const getValue = () => { + if (getCalledDecision$1(element)) { + return DMN_IMPLEMENTATION_OPTION; + } + if (getTaskDefinition$2(element)) { + return JOB_WORKER_IMPLEMENTATION_OPTION$1; + } + return DEFAULT_IMPLEMENTATION_OPTION$1; + }; + + /** + * Set value by either creating a zeebe:calledDecision or a zeebe:taskDefintion + * extension element. Note that they must not exist both at the same time, however + * this will be ensured by a bpmn-js behavior (and not by the propPanel). + */ + const setValue = value => { + let extensionElement, extensionElementType; + if (value === DMN_IMPLEMENTATION_OPTION) { + extensionElement = getCalledDecision$1(element); + extensionElementType = 'zeebe:CalledDecision'; + } else if (value === JOB_WORKER_IMPLEMENTATION_OPTION$1) { + extensionElement = getTaskDefinition$2(element); + extensionElementType = 'zeebe:TaskDefinition'; + } else { + resetElement$1(element, commandStack); + } + if (!extensionElement && extensionElementType) { + extensionElement = createElement(extensionElementType, {}, null, bpmnFactory); + updateExtensionElements$1(element, extensionElement, bpmnFactory, commandStack); + } + }; + const getOptions = () => { + const options = [{ + value: DEFAULT_IMPLEMENTATION_OPTION$1, + label: translate('') + }, { + value: DMN_IMPLEMENTATION_OPTION, + label: translate('DMN decision') + }, { + value: JOB_WORKER_IMPLEMENTATION_OPTION$1, + label: translate('Job worker') + }]; + return options; + }; + return (0,_bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.SelectEntry)({ + element, + id, + label: translate('Implementation'), + getValue, + setValue, + getOptions + }); +} + +// helper /////////////////////// + +function getTaskDefinition$2(element) { + const businessObject = (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element); + return getExtensionElementsList(businessObject, 'zeebe:TaskDefinition')[0]; +} +function getCalledDecision$1(element) { + const businessObject = (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element); + return getExtensionElementsList(businessObject, 'zeebe:CalledDecision')[0]; +} +function isBusinessRuleImplementationEdited(element) { + return getTaskDefinition$2(element); +} +function resetElement$1(element, commandStack) { + const businessObject = (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element); + const toRemove = [getTaskDefinition$2(element), getTaskHeaders$1(element), getCalledDecision$1(element)].filter(Boolean); + removeExtensionElements(element, businessObject, toRemove, commandStack); +} +function updateExtensionElements$1(element, extensionElementToAdd, bpmnFactory, commandStack) { + const businessObject = (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element); + const commands = []; + let extensionElements = businessObject.get('extensionElements'); + let extensionElementValues; + + // (1) create bpmn:ExtensionElements if it doesn't exist + if (!extensionElements) { + extensionElements = createElement('bpmn:ExtensionElements', { + values: [] + }, businessObject, bpmnFactory); + commands.push({ + cmd: 'element.updateModdleProperties', + context: { + element, + moddleElement: businessObject, + properties: { + extensionElements + } + } + }); + } + extensionElementToAdd.$parent = extensionElements; + + // (2) remove old exension element from extensionElements + if ((0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.is)(extensionElementToAdd, 'zeebe:TaskDefinition')) { + extensionElementValues = (0,min_dash__WEBPACK_IMPORTED_MODULE_12__.without)(extensionElements.get('values'), getCalledDecision$1(element)); + } else if ((0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.is)(extensionElementToAdd, 'zeebe:CalledDecision')) { + extensionElementValues = (0,min_dash__WEBPACK_IMPORTED_MODULE_12__.without)(extensionElements.get('values'), getTaskDefinition$2(element)); + } + + // (3) add extension element to list + commands.push({ + cmd: 'element.updateModdleProperties', + context: { + element, + moddleElement: extensionElements, + properties: { + values: [...extensionElementValues, extensionElementToAdd] + } + } + }); + commandStack.execute('properties-panel.multi-command-executor', commands); +} + +function CalledDecisionProps(props) { + const { + element + } = props; + if (!(0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.is)(element, 'bpmn:BusinessRuleTask') || !getCalledDecision(element)) { + return []; + } + return [{ + id: 'decisionId', + component: DecisionID, + isEdited: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.isFeelEntryEdited + }, { + id: 'resultVariable', + component: ResultVariable$4, + isEdited: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.isTextFieldEntryEdited + }]; +} +function DecisionID(props) { + const { + element, + id + } = props; + const commandStack = useService('commandStack'); + const bpmnFactory = useService('bpmnFactory'); + const translate = useService('translate'); + const debounce = useService('debounceInput'); + const getValue = () => { + return (getCalledDecision(element) || {}).decisionId; + }; + const setValue = value => { + const commands = []; + const businessObject = (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element); + let extensionElements = businessObject.get('extensionElements'); + + // (1) ensure extension elements + if (!extensionElements) { + extensionElements = createElement('bpmn:ExtensionElements', { + values: [] + }, businessObject, bpmnFactory); + commands.push({ + cmd: 'element.updateModdleProperties', + context: { + element, + moddleElement: businessObject, + properties: { + extensionElements + } + } + }); + } + + // (2) ensure calledDecision + let calledDecision = getCalledDecision(element); + if (!calledDecision) { + calledDecision = createElement('zeebe:CalledDecision', {}, extensionElements, bpmnFactory); + commands.push({ + cmd: 'element.updateModdleProperties', + context: { + element, + moddleElement: extensionElements, + properties: { + values: [...extensionElements.get('values'), calledDecision] + } + } + }); + } + + // (3) update caledDecision.decisionId + commands.push({ + cmd: 'element.updateModdleProperties', + context: { + element, + moddleElement: calledDecision, + properties: { + decisionId: value + } + } + }); + + // (4) commit all updates + commandStack.execute('properties-panel.multi-command-executor', commands); + }; + return FeelEntryWithVariableContext({ + element, + id, + label: translate('Decision ID'), + feel: 'optional', + getValue, + setValue, + debounce + }); +} +function ResultVariable$4(props) { + const { + element, + id + } = props; + const commandStack = useService('commandStack'); + const bpmnFactory = useService('bpmnFactory'); + const translate = useService('translate'); + const debounce = useService('debounceInput'); + const getValue = () => { + return (getCalledDecision(element) || {}).resultVariable; + }; + const setValue = value => { + const commands = []; + const businessObject = (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element); + let extensionElements = businessObject.get('extensionElements'); + + // (1) ensure extension elements + if (!extensionElements) { + extensionElements = createElement('bpmn:ExtensionElements', { + values: [] + }, businessObject, bpmnFactory); + commands.push({ + cmd: 'element.updateModdleProperties', + context: { + element, + moddleElement: businessObject, + properties: { + extensionElements + } + } + }); + } + + // (2) ensure calledDecision + let calledDecision = getCalledDecision(element); + if (!calledDecision) { + calledDecision = createElement('zeebe:CalledDecision', {}, extensionElements, bpmnFactory); + commands.push({ + cmd: 'element.updateModdleProperties', + context: { + element, + moddleElement: extensionElements, + properties: { + values: [...extensionElements.get('values'), calledDecision] + } + } + }); + } + + // (3) update caledDecision.decisionId + commands.push({ + cmd: 'element.updateModdleProperties', + context: { + element, + moddleElement: calledDecision, + properties: { + resultVariable: value + } + } + }); + + // (4) commit all updates + commandStack.execute('properties-panel.multi-command-executor', commands); + }; + return (0,_bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.TextFieldEntry)({ + element, + id, + label: translate('Result variable'), + getValue, + setValue, + debounce + }); +} + +// helper /////////////////////// + +function getCalledDecision(element) { + const businessObject = (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element); + return getExtensionElementsList(businessObject, 'zeebe:CalledDecision')[0]; +} + +function ConditionProps$1(props) { + const { + element + } = props; + if (!(0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.is)(element, 'bpmn:SequenceFlow')) { + return []; + } + const conditionProps = []; + if (isConditionalSource$1(element.source)) { + conditionProps.push({ + id: 'conditionExpression', + component: ConditionExpression$1, + isEdited: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.isFeelEntryEdited + }); + } + return conditionProps; +} +function ConditionExpression$1(props) { + const { + element + } = props; + const commandStack = useService('commandStack'), + bpmnFactory = useService('bpmnFactory'), + translate = useService('translate'), + debounce = useService('debounceInput'); + const getValue = () => { + return getConditionExpression$1(element); + }; + const setValue = value => { + const commands = []; + const businessObject = (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element); + + // (1) If we set value to a default flow, make it a non-default flow + // by updating the element source + const source = element.source; + if (source.businessObject.default === businessObject) { + commands.push({ + cmd: 'element.updateProperties', + context: { + element: source, + properties: { + 'default': undefined + } + } + }); + } + + // (2) Create and set formalExpression element containing the conditionExpression, + // unless the provided value is empty + const formalExpressionElement = value && value != '' ? createElement('bpmn:FormalExpression', { + body: value + }, businessObject, bpmnFactory) : undefined; + commands.push({ + cmd: 'element.updateProperties', + context: { + element: element, + properties: { + conditionExpression: formalExpressionElement + } + } + }); + + // (3) Execute the commands + commandStack.execute('properties-panel.multi-command-executor', commands); + }; + return FeelEntryWithVariableContext({ + element, + id: 'conditionExpression', + label: translate('Condition expression'), + feel: 'required', + getValue, + setValue, + debounce + }); +} + +// helper ////////////////////////// + +const CONDITIONAL_SOURCES$1 = ['bpmn:Activity', 'bpmn:ExclusiveGateway', 'bpmn:InclusiveGateway']; +function isConditionalSource$1(element) { + return (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.isAny)(element, CONDITIONAL_SOURCES$1); +} + +/** + * getConditionExpression - get the body value of a condition expression for a given element + * + * @param {ModdleElement} element + * + * @return {string|undefined} + */ +function getConditionExpression$1(element) { + const businessObject = (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element); + const conditionExpression = businessObject.conditionExpression; + if (conditionExpression) { + return conditionExpression.get('body'); + } +} + +function ErrorProps$1(props) { + const { + element + } = props; + const error = getError(element); + const entries = []; + if (error && (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.is)(element, 'bpmn:ThrowEvent')) { + entries.push({ + id: 'errorCode', + component: ErrorCode$1, + isEdited: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.isFeelEntryEdited + }); + } + return entries; +} +function ErrorCode$1(props) { + const { + element + } = props; + const commandStack = useService('commandStack'); + const translate = useService('translate'); + const debounce = useService('debounceInput'); + const error = getError(element); + const getValue = () => { + return error.get('errorCode'); + }; + const setValue = value => { + return commandStack.execute('element.updateModdleProperties', { + element, + moddleElement: error, + properties: { + errorCode: value + } + }); + }; + return FeelEntryWithVariableContext({ + element, + id: 'errorCode', + label: translate('Code'), + feel: 'optional', + getValue, + setValue, + debounce + }); +} + +/** + * @typedef { import('@bpmn-io/properties-panel').EntryDefinition } Entry + */ - function triggerClickEvent(element) { - var evt; - var eventType = 'click'; +/** + * @returns {Array} entries + */ +function EscalationProps$1(props) { + const { + element + } = props; + + // update throw events only + if (!(0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.is)(element, 'bpmn:ThrowEvent')) { + return []; + } + const escalation = getEscalation(element); + const entries = []; + if (escalation) { + entries.push({ + id: 'escalationCode', + component: EscalationCode, + isEdited: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.isFeelEntryEdited + }); + } + return entries; +} +function EscalationCode(props) { + const { + element + } = props; + const commandStack = useService('commandStack'); + const translate = useService('translate'); + const debounce = useService('debounceInput'); + const escalation = getEscalation(element); + const getValue = () => { + return escalation.get('escalationCode'); + }; + const setValue = value => { + return commandStack.execute('element.updateModdleProperties', { + element, + moddleElement: escalation, + properties: { + escalationCode: value + } + }); + }; + return FeelEntryWithVariableContext({ + element, + id: 'escalationCode', + label: translate('Code'), + feel: 'optional', + getValue, + setValue, + debounce + }); +} + +const FORM_KEY_PREFIX = 'camunda-forms:bpmn:', + USER_TASK_FORM_ID_PREFIX = 'UserTaskForm_'; +const FORM_TYPES = { + CAMUNDA_FORM_EMBEDDED: 'camunda-form-embedded', + CAMUNDA_FORM_LINKED: 'camunda-form-linked', + CUSTOM_FORM: 'custom-form' +}; +function getFormDefinition(element) { + const businessObject = (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element); + const formDefinitions = getExtensionElementsList(businessObject, 'zeebe:FormDefinition'); + return formDefinitions[0]; +} +function getUserTaskForm(element, rootElement) { + rootElement = rootElement || getRootElement$1(element); + const formDefinition = getFormDefinition(element); + if (!formDefinition) { + return; + } + const formKey = formDefinition.get('formKey'); + const userTaskForms = getExtensionElementsList(rootElement, 'zeebe:UserTaskForm'); + return userTaskForms.find(userTaskForm => { + return userTaskFormIdToFormKey(userTaskForm.get('id')) === formKey; + }); +} +function userTaskFormIdToFormKey(userTaskFormId) { + return `${FORM_KEY_PREFIX}${userTaskFormId}`; +} +function createUserTaskFormId() { + return nextId(USER_TASK_FORM_ID_PREFIX); +} +function getRootElement$1(element) { + const businessObject = (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element); + let parent = businessObject; + while (parent.$parent && !(0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.is)(parent, 'bpmn:Process')) { + parent = parent.$parent; + } + return parent; +} +function getFormType$1(element) { + const formDefinition = getFormDefinition(element); + if (!formDefinition) { + return; + } + const formId = formDefinition.get('formId'), + formKey = formDefinition.get('formKey'); + if ((0,min_dash__WEBPACK_IMPORTED_MODULE_12__.isDefined)(formId)) { + return FORM_TYPES.CAMUNDA_FORM_LINKED; + } + if ((0,min_dash__WEBPACK_IMPORTED_MODULE_12__.isDefined)(formKey)) { + if (getUserTaskForm(element)) { + return FORM_TYPES.CAMUNDA_FORM_EMBEDDED; + } + return FORM_TYPES.CUSTOM_FORM; + } +} + +function FormProps$1(props) { + const { + element + } = props; + if (!(0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.is)(element, 'bpmn:UserTask')) { + return []; + } + const entries = [{ + id: 'formType', + component: FormType$1, + isEdited: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.isSelectEntryEdited + }]; + const formType = getFormType$1(element); + if (formType === FORM_TYPES.CAMUNDA_FORM_EMBEDDED) { + entries.push({ + id: 'formConfiguration', + component: FormConfiguration, + isEdited: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.isTextAreaEntryEdited + }); + } else if (formType === FORM_TYPES.CAMUNDA_FORM_LINKED) { + entries.push({ + id: 'formId', + component: FormId, + isEdited: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.isTextFieldEntryEdited + }); + } else if (formType === FORM_TYPES.CUSTOM_FORM) { + entries.push({ + id: 'customFormKey', + component: CustomFormKey, + isEdited: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.isTextFieldEntryEdited + }); + } + return entries; +} +function FormType$1(props) { + const { + element + } = props; + const injector = useService('injector'), + translate = useService('translate'); + const getValue = () => { + return getFormType$1(element) || ''; + }; + const setValue = value => { + if (value === FORM_TYPES.CAMUNDA_FORM_EMBEDDED) { + setUserTaskForm(injector, element, ''); + } else if (value === FORM_TYPES.CAMUNDA_FORM_LINKED) { + setFormId(injector, element, ''); + } else if (value === FORM_TYPES.CUSTOM_FORM) { + setCustomFormKey(injector, element, ''); + } else { + removeFormDefinition(injector, element); + } + }; + const getOptions = () => { + return [{ + value: '', + label: translate('') + }, { + value: FORM_TYPES.CAMUNDA_FORM_LINKED, + label: translate('Camunda Form (linked)') + }, { + value: FORM_TYPES.CAMUNDA_FORM_EMBEDDED, + label: translate('Camunda Form (embedded)') + }, { + value: FORM_TYPES.CUSTOM_FORM, + label: translate('Custom form key') + }]; + }; + return (0,_bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.SelectEntry)({ + element, + id: 'formType', + label: translate('Type'), + getValue, + setValue, + getOptions + }); +} +function FormConfiguration(props) { + const { + element + } = props; + const debounce = useService('debounceInput'), + injector = useService('injector'), + translate = useService('translate'); + const getValue = () => { + return getUserTaskForm(element).get('body'); + }; + const setValue = value => { + setUserTaskForm(injector, element, (0,min_dash__WEBPACK_IMPORTED_MODULE_12__.isUndefined)(value) ? '' : value); + }; + return (0,_bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.TextAreaEntry)({ + element, + id: 'formConfiguration', + label: translate('Form JSON configuration'), + rows: 4, + getValue, + setValue, + debounce + }); +} +function FormId(props) { + const { + element + } = props; + const debounce = useService('debounceInput'), + injector = useService('injector'), + translate = useService('translate'); + const getValue = () => { + return getFormDefinition(element).get('formId'); + }; + const setValue = value => { + setFormId(injector, element, (0,min_dash__WEBPACK_IMPORTED_MODULE_12__.isUndefined)(value) ? '' : value); + }; + return (0,_bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.TextFieldEntry)({ + element, + id: 'formId', + label: translate('Form ID'), + getValue, + setValue, + debounce + }); +} +function CustomFormKey(props) { + const { + element + } = props; + const debounce = useService('debounceInput'), + injector = useService('injector'), + translate = useService('translate'); + const getValue = () => { + return getFormDefinition(element).get('formKey'); + }; + const setValue = value => { + setCustomFormKey(injector, element, (0,min_dash__WEBPACK_IMPORTED_MODULE_12__.isUndefined)(value) ? '' : value); + }; + return (0,_bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.TextFieldEntry)({ + element, + id: 'customFormKey', + label: translate('Form key'), + getValue, + setValue, + debounce + }); +} + +// helpers ///////////// + +/** + * @typedef { { cmd: string, context: Object } } Command + * @typedef {Command[]} Commands + * + * @typedef {import('diagram-js/lib/model/Types').Element} Element + * @typedef {import('bpmn-js/lib/model/Types').ModdleElement} ModdleElement + * + * @param {import('didi').Injector} Injector + */ - if (document.createEvent) { - try { - // Chrome, Safari, Firefox - evt = new MouseEvent((eventType), { view: window, bubbles: true, cancelable: true }); - } catch (e) { - // IE 11, PhantomJS (wat!) - evt = document.createEvent('MouseEvent'); +/** + * @param {Injector} injector + * @param {Element} element + * + * @returns { { + * commands: Commands, + * extensionElements: ModdleElement + * } } + */ +function getOrCreateExtensionElements(injector, element, moddleElement) { + const businessObject = moddleElement || (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element); + let extensionElements = businessObject.get('extensionElements'); + if (extensionElements) { + return { + commands: [], + extensionElements + }; + } + const bpmnFactory = injector.get('bpmnFactory'); + extensionElements = createElement('bpmn:ExtensionElements', { + values: [] + }, businessObject, bpmnFactory); + return { + commands: [createUpdateModdlePropertiesCommand(element, businessObject, { + extensionElements + })], + extensionElements + }; +} + +/** + * @param {Injector} injector + * @param {Element} element + * + * @returns { { +* commands: Commands, +* formDefinition: ModdleElement +* } } +*/ +function getOrCreateFormDefintition(injector, element) { + let formDefinition = getFormDefinition(element); + if (formDefinition) { + return { + commands: [], + formDefinition + }; + } + const { + extensionElements, + commands + } = getOrCreateExtensionElements(injector, element); + formDefinition = createFormDefinition(injector, {}, extensionElements); + return { + commands: [...commands, createUpdateModdlePropertiesCommand(element, extensionElements, { + values: [...extensionElements.get('values'), formDefinition] + })], + formDefinition + }; +} + +/** + * @param {Injector} injector + * @param {Element} element + * + * @returns { { + * commands: Commands, + * formDefinition: ModdleElement, + * userTaskForm: ModdleElement + * } } + */ +function getOrCreateUserTaskForm(injector, element) { + let userTaskForm = getUserTaskForm(element); + if (userTaskForm) { + return { + commands: [], + formDefinition: getFormDefinition(element), + userTaskForm + }; + } + const rootElement = getRootElement$1(element); + const { + extensionElements, + commands: extensionElementsCommands + } = getOrCreateExtensionElements(injector, element, rootElement); + const { + formDefinition, + commands: formDefinitionCommands + } = getOrCreateFormDefintition(injector, element); + const formId = createUserTaskFormId(); + userTaskForm = createUserTaskForm(injector, { + id: formId + }, extensionElements); + return { + commands: [...extensionElementsCommands, ...formDefinitionCommands, createUpdateModdlePropertiesCommand(element, extensionElements, { + values: [...extensionElements.get('values'), userTaskForm] + }), createUpdateModdlePropertiesCommand(element, formDefinition, { + formKey: userTaskFormIdToFormKey(formId) + })], + formDefinition, + userTaskForm + }; +} +function setFormId(injector, element, formId) { + let { + commands, + formDefinition + } = getOrCreateFormDefintition(injector, element); + const commandStack = injector.get('commandStack'); + commandStack.execute('properties-panel.multi-command-executor', [...commands, createUpdateModdlePropertiesCommand(element, formDefinition, { + formId + })]); +} +function setCustomFormKey(injector, element, formKey) { + let { + commands, + formDefinition + } = getOrCreateFormDefintition(injector, element); + const commandStack = injector.get('commandStack'); + commandStack.execute('properties-panel.multi-command-executor', [...commands, createUpdateModdlePropertiesCommand(element, formDefinition, { + formKey + })]); +} +function setUserTaskForm(injector, element, body) { + let { + commands, + userTaskForm + } = getOrCreateUserTaskForm(injector, element); + const commandStack = injector.get('commandStack'); + commandStack.execute('properties-panel.multi-command-executor', [...commands, createUpdateModdlePropertiesCommand(element, userTaskForm, { + body + })]); +} +function removeFormDefinition(injector, element) { + const formDefinition = getFormDefinition(element); + + /** + * @type {import('bpmn-js/lib/features/modeling/Modeling').default} + */ + const modeling = injector.get('modeling'); + if (formDefinition) { + const businessObject = (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element), + extensionElements = businessObject.get('extensionElements'); + modeling.updateModdleProperties(element, extensionElements, { + values: (0,min_dash__WEBPACK_IMPORTED_MODULE_12__.without)(extensionElements.get('values'), formDefinition) + }); + } +} + +/** + * @param {Injector} injector + * @param {Object} properties + * @param {ModdleElement} parent + * + * @returns {ModdleElement} + */ +function createFormDefinition(injector, properties, parent) { + const bpmnFactory = injector.get('bpmnFactory'); + return createElement('zeebe:FormDefinition', properties, parent, bpmnFactory); +} + +/** + * @param {Injector} injector + * @param {Object} properties + * @param {ModdleElement} parent + * + * @returns {ModdleElement} + */ +function createUserTaskForm(injector, properties, parent) { + const bpmnFactory = injector.get('bpmnFactory'); + return createElement('zeebe:UserTaskForm', properties, parent, bpmnFactory); +} + +/** + * @param {Element} element + * @param {ModdleElement} moddleElement + * @param {Object} properties + * + * @returns {Command} + */ +function createUpdateModdlePropertiesCommand(element, moddleElement, properties) { + return { + cmd: 'element.updateModdleProperties', + context: { + element, + moddleElement, + properties + } + }; +} + +function Header(props) { + const { + idPrefix, + header + } = props; + const entries = [{ + id: idPrefix + '-key', + component: KeyProperty, + header, + idPrefix + }, { + id: idPrefix + '-value', + component: ValueProperty$2, + header, + idPrefix + }]; + return entries; +} +function KeyProperty(props) { + const { + idPrefix, + element, + header + } = props; + const commandStack = useService('commandStack'); + const translate = useService('translate'); + const debounce = useService('debounceInput'); + const setValue = value => { + commandStack.execute('element.updateModdleProperties', { + element, + moddleElement: header, + properties: { + key: value + } + }); + }; + const getValue = header => { + return header.key; + }; + return (0,_bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.TextFieldEntry)({ + element: header, + id: idPrefix + '-key', + label: translate('Key'), + getValue, + setValue, + debounce + }); +} +function ValueProperty$2(props) { + const { + idPrefix, + element, + header + } = props; + const commandStack = useService('commandStack'); + const translate = useService('translate'); + const debounce = useService('debounceInput'); + const setValue = value => { + commandStack.execute('element.updateModdleProperties', { + element, + moddleElement: header, + properties: { + value + } + }); + }; + const getValue = header => { + return header.value; + }; + return (0,_bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.TextFieldEntry)({ + element: header, + id: idPrefix + '-value', + label: translate('Value'), + getValue, + setValue, + debounce + }); +} + +function HeaderProps({ + element, + injector +}) { + if (!areHeadersSupported(element)) { + return null; + } + const headers = getHeaders(element) || []; + const bpmnFactory = injector.get('bpmnFactory'), + commandStack = injector.get('commandStack'); + const items = headers.map((header, index) => { + const id = element.id + '-header-' + index; + return { + id, + label: header.get('key') || '', + entries: Header({ + idPrefix: id, + element, + header + }), + autoFocusEntry: id + '-key', + remove: removeFactory$c({ + commandStack, + element, + header + }) + }; + }); + return { + items, + add: addFactory$9({ + bpmnFactory, + commandStack, + element + }), + shouldSort: false + }; +} +function removeFactory$c({ + commandStack, + element, + header +}) { + return function (event) { + event.stopPropagation(); + let commands = []; + const taskHeaders = getTaskHeaders$1(element); + if (!taskHeaders) { + return; + } + const newTaskHeaders = (0,min_dash__WEBPACK_IMPORTED_MODULE_12__.without)(taskHeaders.get('values'), header); + commands.push({ + cmd: 'element.updateModdleProperties', + context: { + element, + moddleElement: taskHeaders, + properties: { + values: newTaskHeaders + } + } + }); + + // remove zeebe:TaskHeaders if there are no headers anymore + if (!newTaskHeaders.length) { + const businessObject = (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element), + extensionElements = businessObject.get('extensionElements'); + commands.push({ + cmd: 'element.updateModdleProperties', + context: { + element, + moddleElement: extensionElements, + properties: { + values: (0,min_dash__WEBPACK_IMPORTED_MODULE_12__.without)(extensionElements.get('values'), taskHeaders) + } + } + }); + } + commandStack.execute('properties-panel.multi-command-executor', commands); + }; +} +function addFactory$9({ + bpmnFactory, + commandStack, + element +}) { + return function (event) { + event.stopPropagation(); + let commands = []; + const businessObject = (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element); + let extensionElements = businessObject.get('extensionElements'); + + // (1) ensure extension elements + if (!extensionElements) { + extensionElements = createElement('bpmn:ExtensionElements', { + values: [] + }, businessObject, bpmnFactory); + commands.push({ + cmd: 'element.updateModdleProperties', + context: { + element, + moddleElement: businessObject, + properties: { + extensionElements + } + } + }); + } + + // (2) ensure zeebe:TaskHeaders + let taskHeaders = getTaskHeaders$1(element); + if (!taskHeaders) { + const parent = extensionElements; + taskHeaders = createElement('zeebe:TaskHeaders', { + values: [] + }, parent, bpmnFactory); + commands.push({ + cmd: 'element.updateModdleProperties', + context: { + element, + moddleElement: extensionElements, + properties: { + values: [...extensionElements.get('values'), taskHeaders] + } + } + }); + } + + // (3) create header + const header = createElement('zeebe:Header', {}, taskHeaders, bpmnFactory); + + // (4) add header to list + commands.push({ + cmd: 'element.updateModdleProperties', + context: { + element, + moddleElement: taskHeaders, + properties: { + values: [...taskHeaders.get('values'), header] + } + } + }); + commandStack.execute('properties-panel.multi-command-executor', commands); + }; +} + +function getProcessId(element) { + const calledElement = getCalledElement(element); + return calledElement ? calledElement.get('processId') : ''; +} +function getCalledElement(element) { + const calledElements = getCalledElements(element); + return calledElements[0]; +} +function getCalledElements(element) { + const bo = (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element); + const extElements = getExtensionElementsList(bo, 'zeebe:CalledElement'); + return extElements; +} + +function InputPropagationProps(props) { + const { + element + } = props; + if (!(0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.is)(element, 'bpmn:CallActivity')) { + return []; + } + return [{ + id: 'propagateAllParentVariables', + component: PropagateAllParentVariables, + isEdited: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.isToggleSwitchEntryEdited + }]; +} +function PropagateAllParentVariables(props) { + const { + element + } = props; + const commandStack = useService('commandStack'), + bpmnFactory = useService('bpmnFactory'), + translate = useService('translate'); + const propagateAllParentVariables = isPropagateAllParentVariables(element); + const getValue = () => { + return propagateAllParentVariables; + }; + const setValue = value => { + const commands = []; + const businessObject = (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element); + + // (1) ensure extension elements + let extensionElements = businessObject.get('extensionElements'); + if (!extensionElements) { + extensionElements = createElement('bpmn:ExtensionElements', { + values: [] + }, businessObject, bpmnFactory); + commands.push({ + cmd: 'element.updateModdleProperties', + context: { + element, + moddleElement: businessObject, + properties: { + extensionElements + } + } + }); + } + + // (2) ensure zeebe:calledElement + let calledElement = getCalledElement(businessObject); + if (!calledElement) { + calledElement = createElement('zeebe:CalledElement', {}, extensionElements, bpmnFactory); + commands.push({ + cmd: 'element.updateModdleProperties', + context: { + element, + moddleElement: extensionElements, + properties: { + values: [...extensionElements.get('values'), calledElement] + } + } + }); + } + + // (3) Update propagateAllParentVariables attribute + commands.push({ + cmd: 'element.updateModdleProperties', + context: { + element, + moddleElement: calledElement, + properties: { + propagateAllParentVariables: value + } + } + }); + + // (4) Execute the commands + commandStack.execute('properties-panel.multi-command-executor', commands); + }; + return (0,_bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.ToggleSwitchEntry)({ + id: 'propagateAllParentVariables', + label: translate('Propagate all parent process variables'), + switcherLabel: propagateAllParentVariables ? translate('On') : translate('Off'), + tooltip: (0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("div", { + children: [(0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("p", { + children: translate('If turned on, all variables from the parent process instance will be propagated to the child process instance.') + }), (0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("p", { + children: translate('Otherwise, only variables defined via input mappings will be propagated.') + })] + }), + getValue, + setValue + }); +} + +// helper ////////////////////////// + +/** + * Check whether the propagateAllParentVariables attribute is set on an element. + * @param {Object} element + * + * @returns {boolean} + */ +function isPropagateAllParentVariables(element) { + if (!(0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.is)(element, 'bpmn:CallActivity')) { + return undefined; + } + const bo = (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element), + calledElement = getCalledElement(bo); + return calledElement && (0,min_dash__WEBPACK_IMPORTED_MODULE_12__.has)(calledElement, 'propagateAllParentVariables') ? calledElement.get('propagateAllParentVariables') : /* default value */true; +} + +function InputOutputParameter$1(props) { + const { + idPrefix, + parameter + } = props; + const entries = [{ + id: idPrefix + '-target', + component: TargetProperty, + idPrefix, + parameter + }, { + id: idPrefix + '-source', + component: SourceProperty, + idPrefix, + parameter + }]; + return entries; +} +function TargetProperty(props) { + const { + idPrefix, + element, + parameter + } = props; + const commandStack = useService('commandStack'); + const translate = useService('translate'); + const debounce = useService('debounceInput'); + const setValue = value => { + commandStack.execute('element.updateModdleProperties', { + element, + moddleElement: parameter, + properties: { + target: value + } + }); + }; + const getValue = parameter => { + return parameter.target; + }; + return (0,_bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.TextFieldEntry)({ + element: parameter, + id: idPrefix + '-target', + label: translate((0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.is)(parameter, 'zeebe:Input') ? 'Local variable name' : 'Process variable name'), + getValue, + setValue, + debounce + }); +} +function SourceProperty(props) { + const { + idPrefix, + element, + parameter + } = props; + const commandStack = useService('commandStack'); + const translate = useService('translate'); + const debounce = useService('debounceInput'); + const setValue = value => { + commandStack.execute('element.updateModdleProperties', { + element, + moddleElement: parameter, + properties: { + source: value + } + }); + }; + const getValue = parameter => { + return parameter.source; + }; + return FeelEntryWithVariableContext({ + bpmnElement: element, + element: parameter, + id: idPrefix + '-source', + label: translate('Variable assignment value'), + feel: 'required', + getValue, + setValue, + debounce + }); +} + +function getElements$1(bo, type, prop) { + const elems = getExtensionElementsList(bo, type); + return !prop ? elems : (elems[0] || {})[prop] || []; +} +function getParameters$1(element, prop) { + const ioMapping = getIoMapping(element); + return ioMapping && ioMapping.get(prop) || []; +} + +/** + * Get a ioMapping from the business object + * + * @param {djs.model.Base} element + * + * @return {ModdleElement} the ioMapping object + */ +function getIoMapping(element) { + const bo = (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element); + return (getElements$1(bo, 'zeebe:IoMapping') || [])[0]; +} + +/** + * Return all input parameters existing in the business object, and + * an empty array if none exist. + * + * @param {djs.model.Base} element + * + * @return {Array} a list of input parameter objects + */ +function getInputParameters$1(element) { + return getParameters$1.apply(this, [element, 'inputParameters']); +} - evt.initEvent((eventType), true, true); - } - return element.dispatchEvent(evt); - } else { - // Welcome IE - evt = document.createEventObject(); +/** + * Return all output parameters existing in the business object, and + * an empty array if none exist. + * + * @param {djs.model.Base} element + * + * @return {Array} a list of output parameter objects + */ +function getOutputParameters$1(element) { + return getParameters$1.apply(this, [element, 'outputParameters']); +} +function areInputParametersSupported$1(element) { + return (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.isAny)(element, ['bpmn:UserTask', 'bpmn:SubProcess', 'bpmn:CallActivity', 'bpmn:BusinessRuleTask', 'bpmn:ScriptTask']) || isZeebeServiceTask(element) || isSignalThrowEvent(element); +} +function areOutputParametersSupported$1(element) { + if ((0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.is)(element, 'bpmn:EndEvent') && getErrorEventDefinition(element)) { + return false; + } + return (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.isAny)(element, ['zeebe:ZeebeServiceTask', 'bpmn:UserTask', 'bpmn:SubProcess', 'bpmn:ReceiveTask', 'bpmn:CallActivity', 'bpmn:Event', 'bpmn:BusinessRuleTask']); +} +function createIOMapping(properties, parent, bpmnFactory) { + return createElement('zeebe:IoMapping', properties, parent, bpmnFactory); +} +function isSignalThrowEvent(element) { + if (!(0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.isAny)(element, ['bpmn:EndEvent', 'bpmn:IntermediateThrowEvent'])) { + return false; + } + return !!getEventDefinition$1(element, 'bpmn:SignalEventDefinition'); +} + +function InputProps$1({ + element, + injector +}) { + if (!areInputParametersSupported$1(element)) { + return null; + } + const inputParameters = getInputParameters$1(element) || []; + const bpmnFactory = injector.get('bpmnFactory'), + commandStack = injector.get('commandStack'); + const items = inputParameters.map((parameter, index) => { + const id = element.id + '-input-' + index; + return { + id, + label: parameter.get('target') || '', + entries: InputOutputParameter$1({ + idPrefix: id, + element, + parameter + }), + autoFocusEntry: id + '-target', + remove: removeFactory$b({ + commandStack, + element, + parameter + }) + }; + }); + return { + items, + add: addFactory$8({ + element, + bpmnFactory, + commandStack + }), + shouldSort: false + }; +} +function removeFactory$b({ + commandStack, + element, + parameter +}) { + return function (event) { + event.stopPropagation(); + const commands = []; + const ioMapping = getIoMapping(element); + if (!ioMapping) { + return; + } + const inputParameters = (0,min_dash__WEBPACK_IMPORTED_MODULE_12__.without)(ioMapping.get('inputParameters'), parameter); + commands.push({ + cmd: 'element.updateModdleProperties', + context: { + element, + moddleElement: ioMapping, + properties: { + inputParameters + } + } + }); + const businessObject = (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element), + extensionElements = businessObject.get('extensionElements'), + values = (0,min_dash__WEBPACK_IMPORTED_MODULE_12__.without)(extensionElements.get('values'), ioMapping); + + // remove ioMapping if there are no input/output parameters anymore + if (!inputParameters.length && !ioMapping.get('outputParameters').length) { + commands.push({ + cmd: 'element.updateModdleProperties', + context: { + element, + moddleElement: extensionElements, + properties: { + values + } + } + }); + } + commandStack.execute('properties-panel.multi-command-executor', commands); + }; +} +function addFactory$8({ + element, + bpmnFactory, + commandStack +}) { + return function (event) { + event.stopPropagation(); + const commands = []; + const businessObject = (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element); + let extensionElements = businessObject.get('extensionElements'); + + // (1) ensure extension elements + if (!extensionElements) { + extensionElements = createElement('bpmn:ExtensionElements', { + values: [] + }, businessObject, bpmnFactory); + commands.push({ + cmd: 'element.updateModdleProperties', + context: { + element, + moddleElement: businessObject, + properties: { + extensionElements + } + } + }); + } + + // (2) ensure IoMapping + let ioMapping = getIoMapping(element); + if (!ioMapping) { + ioMapping = createIOMapping({ + inputParameters: [], + outputParameters: [] + }, extensionElements, bpmnFactory); + commands.push({ + cmd: 'element.updateModdleProperties', + context: { + element, + moddleElement: extensionElements, + properties: { + values: [...extensionElements.get('values'), ioMapping] + } + } + }); + } + + // (3) create parameter + const newParameter = createElement('zeebe:Input', { + target: nextId('InputVariable_') + }, ioMapping, bpmnFactory); + + // (4) add parameter to list + commands.push({ + cmd: 'element.updateModdleProperties', + context: { + element, + moddleElement: ioMapping, + properties: { + inputParameters: [...ioMapping.get('inputParameters'), newParameter] + } + } + }); + commandStack.execute('properties-panel.multi-command-executor', commands); + }; +} + +function MessageProps(props) { + const { + element + } = props; + const message = getMessage(element); + const entries = []; + if (message) { + entries.push({ + id: 'messageName', + component: MessageName, + isEdited: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.isFeelEntryEdited + }); + } + if (message && canHaveSubscriptionCorrelationKey(element)) { + entries.push({ + id: 'messageSubscriptionCorrelationKey', + component: SubscriptionCorrelationKey, + isEdited: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.isFeelEntryEdited + }); + } + return entries; +} +function MessageName(props) { + const { + element + } = props; + const commandStack = useService('commandStack'); + const translate = useService('translate'); + const debounce = useService('debounceInput'); + const message = getMessage(element); + const getValue = () => { + return message.get('name'); + }; + const setValue = value => { + return commandStack.execute('element.updateModdleProperties', { + element, + moddleElement: message, + properties: { + name: value + } + }); + }; + return FeelEntryWithVariableContext({ + element, + id: 'messageName', + label: translate('Name'), + feel: 'optional', + getValue, + setValue, + debounce + }); +} +function SubscriptionCorrelationKey(props) { + const { + element + } = props; + const bpmnFactory = useService('bpmnFactory'); + const commandStack = useService('commandStack'); + const translate = useService('translate'); + const debounce = useService('debounceInput'); + const getValue = () => { + return getCorrelationKey(element); + }; + const setValue = value => { + const commands = []; + const properties = { + correlationKey: value + }; + const message = getMessage(element); + let extensionElements = message.get('extensionElements'); + + // (1) ensure extension elements + if (!extensionElements) { + extensionElements = createElement('bpmn:ExtensionElements', { + values: [] + }, message, bpmnFactory); + commands.push({ + cmd: 'element.updateModdleProperties', + context: { + element, + moddleElement: message, + properties: { + extensionElements + } + } + }); + } + let subscription = getSubscription(element); + + // (2a) add subscription with correlation key + if (!subscription) { + subscription = createElement('zeebe:Subscription', properties, extensionElements, bpmnFactory); + commands.push({ + cmd: 'element.updateModdleProperties', + context: { + element, + moddleElement: extensionElements, + properties: { + values: [...extensionElements.get('values'), subscription] + } + } + }); + } else { + // (2b) update existing subscription's correlation key + commands.push({ + cmd: 'element.updateModdleProperties', + context: { + element, + properties, + moddleElement: subscription + } + }); + } + + // (3) commit all updates + commandStack.execute('properties-panel.multi-command-executor', commands); + }; + return FeelEntryWithVariableContext({ + element, + id: 'messageSubscriptionCorrelationKey', + label: translate('Subscription correlation key'), + feel: 'required', + getValue, + setValue, + debounce + }); +} + +// helper /////////////////////// + +function canHaveSubscriptionCorrelationKey(element) { + // (1) allow for receive task + if ((0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.is)(element, 'bpmn:ReceiveTask')) { + return true; + } + + // (2) allow for non start events + if (!(0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.is)(element, 'bpmn:StartEvent')) { + return true; + } + + // (3) allow for start events inside event sub processes + if ((0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.is)(element, 'bpmn:StartEvent') && (0,bpmn_js_lib_util_DiUtil__WEBPACK_IMPORTED_MODULE_10__.isEventSubProcess)(element.parent)) { + return true; + } + return false; +} +function getCorrelationKey(element) { + const subscription = getSubscription(element); + return subscription ? subscription.get('correlationKey') : ''; +} +function getSubscription(element) { + const message = getMessage(element); + const subscriptions = getSubscriptions(message); + return subscriptions[0]; +} +function getSubscriptions(message) { + const extensionElements = getExtensionElementsList(message, 'zeebe:Subscription'); + return extensionElements; +} + +function MultiInstanceProps$1(props) { + const { + element + } = props; + if (!supportsMultiInstances(element)) { + return []; + } + return [{ + id: 'multiInstance-inputCollection', + component: InputCollection, + isEdited: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.isFeelEntryEdited + }, { + id: 'multiInstance-inputElement', + component: InputElement, + isEdited: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.isTextFieldEntryEdited + }, { + id: 'multiInstance-outputCollection', + component: OutputCollection, + isEdited: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.isTextFieldEntryEdited + }, { + id: 'multiInstance-outputElement', + component: OutputElement, + isEdited: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.isFeelEntryEdited + }, { + id: 'multiInstance-completionCondition', + component: CompletionCondition, + isEdited: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.isFeelEntryEdited + }]; +} +function InputCollection(props) { + const { + element + } = props; + const commandStack = useService('commandStack'); + const bpmnFactory = useService('bpmnFactory'); + const translate = useService('translate'); + const debounce = useService('debounceInput'); + const getValue = () => { + return getProperty$1(element, 'inputCollection'); + }; + const setValue = value => { + return setProperty(element, 'inputCollection', value, commandStack, bpmnFactory); + }; + return FeelEntryWithVariableContext({ + element, + id: 'multiInstance-inputCollection', + label: translate('Input collection'), + feel: 'required', + getValue, + setValue, + debounce + }); +} +function InputElement(props) { + const { + element + } = props; + const commandStack = useService('commandStack'); + const bpmnFactory = useService('bpmnFactory'); + const translate = useService('translate'); + const debounce = useService('debounceInput'); + const getValue = () => { + return getProperty$1(element, 'inputElement'); + }; + const setValue = value => { + return setProperty(element, 'inputElement', value, commandStack, bpmnFactory); + }; + return (0,_bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.TextFieldEntry)({ + element, + id: 'multiInstance-inputElement', + label: translate('Input element'), + getValue, + setValue, + debounce + }); +} +function OutputCollection(props) { + const { + element + } = props; + const commandStack = useService('commandStack'); + const bpmnFactory = useService('bpmnFactory'); + const translate = useService('translate'); + const debounce = useService('debounceInput'); + const getValue = () => { + return getProperty$1(element, 'outputCollection'); + }; + const setValue = value => { + return setProperty(element, 'outputCollection', value, commandStack, bpmnFactory); + }; + return (0,_bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.TextFieldEntry)({ + element, + id: 'multiInstance-outputCollection', + label: translate('Output collection'), + getValue, + setValue, + debounce + }); +} +function OutputElement(props) { + const { + element + } = props; + const commandStack = useService('commandStack'); + const bpmnFactory = useService('bpmnFactory'); + const translate = useService('translate'); + const debounce = useService('debounceInput'); + const getValue = () => { + return getProperty$1(element, 'outputElement'); + }; + const setValue = value => { + return setProperty(element, 'outputElement', value, commandStack, bpmnFactory); + }; + return FeelEntryWithVariableContext({ + element, + id: 'multiInstance-outputElement', + label: translate('Output element'), + feel: 'required', + getValue, + setValue, + debounce + }); +} +function CompletionCondition(props) { + const { + element + } = props; + const commandStack = useService('commandStack'); + const bpmnFactory = useService('bpmnFactory'); + const translate = useService('translate'); + const debounce = useService('debounceInput'); + const getValue = () => { + const completionCondition = getCompletionCondition(element); + return completionCondition && completionCondition.get('body'); + }; + const setValue = value => { + if (value && value !== '') { + const loopCharacteristics = getLoopCharacteristics$1(element); + const completionCondition = createElement('bpmn:FormalExpression', { + body: value + }, loopCharacteristics, bpmnFactory); + setCompletionCondition(element, commandStack, completionCondition); + } else { + setCompletionCondition(element, commandStack, undefined); + } + }; + return FeelEntryWithVariableContext({ + element, + id: 'multiInstance-completionCondition', + label: translate('Completion condition'), + feel: 'required', + getValue, + setValue, + debounce + }); +} + +// helper /////////////////////// + +function getLoopCharacteristics$1(element) { + const businessObject = (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element); + return businessObject.get('loopCharacteristics'); +} +function getZeebeLoopCharacteristics(loopCharacteristics) { + const extensionElements = getExtensionElementsList(loopCharacteristics, 'zeebe:LoopCharacteristics'); + return extensionElements && extensionElements[0]; +} +function supportsMultiInstances(element) { + return !!getLoopCharacteristics$1(element); +} +function getCompletionCondition(element) { + return getLoopCharacteristics$1(element).get('completionCondition'); +} +function setCompletionCondition(element, commandStack, completionCondition = undefined) { + commandStack.execute('element.updateModdleProperties', { + element, + moddleElement: getLoopCharacteristics$1(element), + properties: { + completionCondition + } + }); +} +function getProperty$1(element, propertyName) { + const loopCharacteristics = getLoopCharacteristics$1(element), + zeebeLoopCharacteristics = getZeebeLoopCharacteristics(loopCharacteristics); + return zeebeLoopCharacteristics && zeebeLoopCharacteristics.get(propertyName); +} +function setProperty(element, propertyName, value, commandStack, bpmnFactory) { + const loopCharacteristics = getLoopCharacteristics$1(element); + const commands = []; + + // (1) ensure extension elements + let extensionElements = loopCharacteristics.get('extensionElements'); + if (!extensionElements) { + extensionElements = createElement('bpmn:ExtensionElements', { + values: [] + }, loopCharacteristics, bpmnFactory); + commands.push({ + cmd: 'element.updateModdleProperties', + context: { + element, + moddleElement: loopCharacteristics, + properties: { + extensionElements + } + } + }); + } + + // (2) ensure zeebe loop characteristics + let zeebeLoopCharacteristics = getZeebeLoopCharacteristics(loopCharacteristics); + if (!zeebeLoopCharacteristics) { + zeebeLoopCharacteristics = createElement('zeebe:LoopCharacteristics', {}, extensionElements, bpmnFactory); + commands.push({ + cmd: 'element.updateModdleProperties', + context: { + element, + moddleElement: extensionElements, + properties: { + values: [...extensionElements.get('values'), zeebeLoopCharacteristics] + } + } + }); + } + + // (3) update defined property + commands.push({ + cmd: 'element.updateModdleProperties', + context: { + element, + moddleElement: zeebeLoopCharacteristics, + properties: { + [propertyName]: value + } + } + }); + + // (4) commit all updates + commandStack.execute('properties-panel.multi-command-executor', commands); +} + +function OutputPropagationProps(props) { + const { + element + } = props; + if (!(0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.is)(element, 'bpmn:CallActivity')) { + return []; + } + return [{ + id: 'propagateAllChildVariables', + component: PropagateAllChildVariables, + isEdited: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.isToggleSwitchEntryEdited + }]; +} +function PropagateAllChildVariables(props) { + const { + element + } = props; + const commandStack = useService('commandStack'), + bpmnFactory = useService('bpmnFactory'), + translate = useService('translate'); + const propagateAllChildVariables = isPropagateAllChildVariables(element); + const getValue = () => { + return propagateAllChildVariables; + }; + const setValue = value => { + const commands = []; + const businessObject = (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element); + + // (1) ensure extension elements + let extensionElements = businessObject.get('extensionElements'); + if (!extensionElements) { + extensionElements = createElement('bpmn:ExtensionElements', { + values: [] + }, businessObject, bpmnFactory); + commands.push({ + cmd: 'element.updateModdleProperties', + context: { + element, + moddleElement: businessObject, + properties: { + extensionElements + } + } + }); + } + + // (2) ensure zeebe:calledElement + let calledElement = getCalledElement(businessObject); + if (!calledElement) { + calledElement = createElement('zeebe:CalledElement', {}, extensionElements, bpmnFactory); + commands.push({ + cmd: 'element.updateModdleProperties', + context: { + element, + moddleElement: extensionElements, + properties: { + values: [...extensionElements.get('values'), calledElement] + } + } + }); + } + + // (3) Update propagateAllChildVariables attribute + commands.push({ + cmd: 'element.updateModdleProperties', + context: { + element, + moddleElement: calledElement, + properties: { + propagateAllChildVariables: value + } + } + }); + + // (4) Execute the commands + commandStack.execute('properties-panel.multi-command-executor', commands); + }; + return (0,_bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.ToggleSwitchEntry)({ + id: 'propagateAllChildVariables', + label: translate('Propagate all child process variables'), + switcherLabel: propagateAllChildVariables ? translate('On') : translate('Off'), + tooltip: (0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("div", { + children: [(0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("p", { + children: translate('If turned on, all variables from the child process instance will be propagated to the parent process instance.') + }), (0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("p", { + children: translate('Otherwise, only variables defined via output mappings will be propagated.') + })] + }), + getValue, + setValue + }); +} + +// helper ////////////////////////// + +/** + * Determine default value for propagateAllChildVariables attribute + * @param {Object} element representing a bpmn:CallActivity + * + * @returns {boolean} + */ +function determinePropAllChildVariablesDefault(element) { + const outputParameters = getOutputParameters$1(element); + if (outputParameters) { + return outputParameters.length > 0 ? false : true; + } +} + +/** + * Check whether the propagateAllChildVariables attribute is set on an element. + * Note that a default logic will be determine if it is not explicitly set. + * @param {Object} element + * + * @returns {boolean} + */ +function isPropagateAllChildVariables(element) { + if (!(0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.is)(element, 'bpmn:CallActivity')) { + return undefined; + } + const bo = (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element), + calledElement = getCalledElement(bo); + return calledElement && (0,min_dash__WEBPACK_IMPORTED_MODULE_12__.has)(calledElement, 'propagateAllChildVariables') ? calledElement.get('propagateAllChildVariables') : determinePropAllChildVariablesDefault(element); +} + +function OutputProps$1({ + element, + injector +}) { + if (!areOutputParametersSupported$1(element)) { + return null; + } + const outputParameters = getOutputParameters$1(element) || []; + const bpmnFactory = injector.get('bpmnFactory'), + commandStack = injector.get('commandStack'); + const items = outputParameters.map((parameter, index) => { + const id = element.id + '-output-' + index; + return { + id, + label: parameter.get('target') || '', + entries: InputOutputParameter$1({ + idPrefix: id, + element, + parameter + }), + autoFocusEntry: id + '-target', + remove: removeFactory$a({ + commandStack, + element, + parameter + }) + }; + }); + return { + items, + add: addFactory$7({ + element, + bpmnFactory, + commandStack + }), + shouldSort: false + }; +} +function removeFactory$a({ + commandStack, + element, + parameter +}) { + return function (event) { + event.stopPropagation(); + let commands = []; + const ioMapping = getIoMapping(element); + if (!ioMapping) { + return; + } + const outputParameters = (0,min_dash__WEBPACK_IMPORTED_MODULE_12__.without)(ioMapping.get('outputParameters'), parameter); + commands.push({ + cmd: 'element.updateModdleProperties', + context: { + element, + moddleElement: ioMapping, + properties: { + outputParameters + } + } + }); + + // remove ioMapping if there are no input/output parameters anymore + if (!ioMapping.get('inputParameters').length && !outputParameters.length) { + const businessObject = (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element), + extensionElements = businessObject.get('extensionElements'), + values = (0,min_dash__WEBPACK_IMPORTED_MODULE_12__.without)(extensionElements.get('values'), ioMapping); + commands.push({ + cmd: 'element.updateModdleProperties', + context: { + element, + moddleElement: extensionElements, + properties: { + values + } + } + }); + } + commandStack.execute('properties-panel.multi-command-executor', commands); + }; +} +function addFactory$7({ + element, + bpmnFactory, + commandStack +}) { + return function (event) { + event.stopPropagation(); + let commands = []; + const businessObject = (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element); + let extensionElements = businessObject.get('extensionElements'); + + // (1) ensure extension elements + if (!extensionElements) { + extensionElements = createElement('bpmn:ExtensionElements', { + values: [] + }, businessObject, bpmnFactory); + commands.push({ + cmd: 'element.updateModdleProperties', + context: { + element, + moddleElement: businessObject, + properties: { + extensionElements + } + } + }); + } + + // (2) ensure IoMapping + let ioMapping = getIoMapping(element); + if (!ioMapping) { + const parent = extensionElements; + ioMapping = createIOMapping({ + inputParameters: [], + outputParameters: [] + }, parent, bpmnFactory); + commands.push({ + cmd: 'element.updateModdleProperties', + context: { + element, + moddleElement: extensionElements, + properties: { + values: [...extensionElements.get('values'), ioMapping] + } + } + }); + } + + // (3) create parameter + const newParameter = createElement('zeebe:Output', { + target: nextId('OutputVariable_') + }, ioMapping, bpmnFactory); + + // (4) add parameter to list + commands.push({ + cmd: 'element.updateModdleProperties', + context: { + element, + moddleElement: ioMapping, + properties: { + outputParameters: [...ioMapping.get('outputParameters'), newParameter] + } + } + }); + commandStack.execute('properties-panel.multi-command-executor', commands); + }; +} + +const SCRIPT_IMPLEMENTATION_OPTION = 'script', + JOB_WORKER_IMPLEMENTATION_OPTION = 'jobWorker', + DEFAULT_IMPLEMENTATION_OPTION = ''; +function ScriptImplementationProps(props) { + const { + element + } = props; + if (!(0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.is)(element, 'bpmn:ScriptTask')) { + return []; + } + return [{ + id: 'scriptImplementation', + component: ScriptImplementation, + isEdited: () => isScriptImplementationEdited(element) + }]; +} +function ScriptImplementation(props) { + const { + element, + id + } = props; + const commandStack = useService('commandStack'); + const bpmnFactory = useService('bpmnFactory'); + const translate = useService('translate'); + const getValue = () => { + if (getScript$1(element)) { + return SCRIPT_IMPLEMENTATION_OPTION; + } + if (getTaskDefinition$1(element)) { + return JOB_WORKER_IMPLEMENTATION_OPTION; + } + return DEFAULT_IMPLEMENTATION_OPTION; + }; + + /** + * Set value by either creating a zeebe:script or a zeebe:taskDefintion + * extension element. Note that they must not exist both at the same time, however + * this will be ensured by a bpmn-js behavior (and not by the propPanel). + */ + const setValue = value => { + let extensionElement, extensionElementType; + if (value === SCRIPT_IMPLEMENTATION_OPTION) { + extensionElement = getScript$1(element); + extensionElementType = 'zeebe:Script'; + } else if (value === JOB_WORKER_IMPLEMENTATION_OPTION) { + extensionElement = getTaskDefinition$1(element); + extensionElementType = 'zeebe:TaskDefinition'; + } else { + resetElement(element, commandStack); + } + if (!extensionElement && extensionElementType) { + extensionElement = createElement(extensionElementType, {}, null, bpmnFactory); + updateExtensionElements(element, extensionElement, bpmnFactory, commandStack); + } + }; + const getOptions = () => { + const options = [{ + value: DEFAULT_IMPLEMENTATION_OPTION, + label: translate('') + }, { + value: SCRIPT_IMPLEMENTATION_OPTION, + label: translate('FEEL expression') + }, { + value: JOB_WORKER_IMPLEMENTATION_OPTION, + label: translate('Job worker') + }]; + return options; + }; + return (0,_bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.SelectEntry)({ + element, + id, + label: translate('Implementation'), + getValue, + setValue, + getOptions + }); +} + +// helper /////////////////////// + +function getTaskDefinition$1(element) { + const businessObject = (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element); + return getExtensionElementsList(businessObject, 'zeebe:TaskDefinition')[0]; +} +function getScript$1(element) { + const businessObject = (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element); + return getExtensionElementsList(businessObject, 'zeebe:Script')[0]; +} +function getTaskHeaders(element) { + const businessObject = (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element); + return getExtensionElementsList(businessObject, 'zeebe:TaskHeaders'); +} +function isScriptImplementationEdited(element) { + return getTaskDefinition$1(element) || getScript$1(element); +} +function resetElement(element, commandStack) { + const businessObject = (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element); + const taskDefinition = getTaskDefinition$1(element); + const taskHeaders = getTaskHeaders(element); + const script = getScript$1(element); + if (taskDefinition) { + const removed = [taskDefinition, taskHeaders].filter(Boolean); + removeExtensionElements(element, businessObject, removed, commandStack); + return; + } + if (script) { + removeExtensionElements(element, businessObject, script, commandStack); + } +} +function updateExtensionElements(element, extensionElementToAdd, bpmnFactory, commandStack) { + const businessObject = (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element); + const commands = []; + let extensionElements = businessObject.get('extensionElements'); + let extensionElementValues; + + // (1) create bpmn:ExtensionElements if it doesn't exist + if (!extensionElements) { + extensionElements = createElement('bpmn:ExtensionElements', { + values: [] + }, businessObject, bpmnFactory); + commands.push({ + cmd: 'element.updateModdleProperties', + context: { + element, + moddleElement: businessObject, + properties: { + extensionElements + } + } + }); + } + extensionElementToAdd.$parent = extensionElements; + + // (2) remove old exension element from extensionElements + if ((0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.is)(extensionElementToAdd, 'zeebe:TaskDefinition')) { + extensionElementValues = (0,min_dash__WEBPACK_IMPORTED_MODULE_12__.without)(extensionElements.get('values'), getScript$1(element)); + } else if ((0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.is)(extensionElementToAdd, 'zeebe:Script')) { + const matcher = extension => (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.isAny)(extension, ['zeebe:TaskDefinition', 'zeebe:TaskHeaders']); + extensionElementValues = (0,min_dash__WEBPACK_IMPORTED_MODULE_12__.without)(extensionElements.get('values'), matcher); + } + + // (3) add extension element to list + commands.push({ + cmd: 'element.updateModdleProperties', + context: { + element, + moddleElement: extensionElements, + properties: { + values: [...extensionElementValues, extensionElementToAdd] + } + } + }); + commandStack.execute('properties-panel.multi-command-executor', commands); +} + +function ScriptProps$1(props) { + const { + element + } = props; + if (!(0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.is)(element, 'bpmn:ScriptTask') || !getScript(element)) { + return []; + } + return [{ + id: 'resultVariable', + component: ResultVariable$3, + isEdited: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.isTextFieldEntryEdited + }, { + id: 'scriptExpression', + component: Expression$2, + isEdited: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.isFeelEntryEdited + }]; +} +function Expression$2(props) { + const { + element, + id + } = props; + const commandStack = useService('commandStack'); + const bpmnFactory = useService('bpmnFactory'); + const translate = useService('translate'); + const debounce = useService('debounceInput'); + const getValue = () => { + return (getScript(element) || {}).get('expression'); + }; + const setValue = value => { + const commands = []; + const businessObject = (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element); + let extensionElements = businessObject.get('extensionElements'); + + // (1) ensure extension elements + if (!extensionElements) { + extensionElements = createElement('bpmn:ExtensionElements', { + values: [] + }, businessObject, bpmnFactory); + commands.push({ + cmd: 'element.updateModdleProperties', + context: { + element, + moddleElement: businessObject, + properties: { + extensionElements + } + } + }); + } + + // (2) ensure script + let script = getScript(element); + if (!script) { + script = createElement('zeebe:Script', {}, extensionElements, bpmnFactory); + commands.push({ + cmd: 'element.updateModdleProperties', + context: { + element, + moddleElement: extensionElements, + properties: { + values: [...extensionElements.get('values'), script] + } + } + }); + } + + // (3) update script.expression + commands.push({ + cmd: 'element.updateModdleProperties', + context: { + element, + moddleElement: script, + properties: { + expression: value + } + } + }); + + // (4) commit all updates + commandStack.execute('properties-panel.multi-command-executor', commands); + }; + return FeelEntryWithVariableContext({ + element, + id, + label: translate('FEEL expression'), + feel: 'required', + getValue, + setValue, + debounce + }); +} +function ResultVariable$3(props) { + const { + element, + id + } = props; + const commandStack = useService('commandStack'); + const bpmnFactory = useService('bpmnFactory'); + const translate = useService('translate'); + const debounce = useService('debounceInput'); + const getValue = () => { + return (getScript(element) || {}).resultVariable; + }; + const setValue = value => { + const commands = []; + const businessObject = (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element); + let extensionElements = businessObject.get('extensionElements'); + + // (1) ensure extension elements + if (!extensionElements) { + extensionElements = createElement('bpmn:ExtensionElements', { + values: [] + }, businessObject, bpmnFactory); + commands.push({ + cmd: 'element.updateModdleProperties', + context: { + element, + moddleElement: businessObject, + properties: { + extensionElements + } + } + }); + } + + // (2) ensure script + let script = getScript(element); + if (!script) { + script = createElement('zeebe:Script', {}, extensionElements, bpmnFactory); + commands.push({ + cmd: 'element.updateModdleProperties', + context: { + element, + moddleElement: extensionElements, + properties: { + values: [...extensionElements.get('values'), script] + } + } + }); + } + + // (3) update script.resultVariable + commands.push({ + cmd: 'element.updateModdleProperties', + context: { + element, + moddleElement: script, + properties: { + resultVariable: value + } + } + }); + + // (4) commit all updates + commandStack.execute('properties-panel.multi-command-executor', commands); + }; + return (0,_bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.TextFieldEntry)({ + element, + id, + label: translate('Result variable'), + getValue, + setValue, + debounce + }); +} + +// helper /////////////////////// + +function getScript(element) { + const businessObject = (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element); + return getExtensionElementsList(businessObject, 'zeebe:Script')[0]; +} + +/** + * @returns {Entry[]} + */ +function SignalProps(props) { + const { + element + } = props; + if (!isSignalSupported(element)) { + return []; + } + const signal = getSignal(element); + let entries = []; + if (signal) { + entries = [...entries, { + id: 'signalName', + component: SignalName, + isEdited: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.isFeelEntryEdited + }]; + } + return entries; +} +function SignalName(props) { + const { + element + } = props; + const commandStack = useService('commandStack'); + const translate = useService('translate'); + const debounce = useService('debounceInput'); + const signal = getSignal(element); + const getValue = () => { + return signal.get('name'); + }; + const setValue = value => { + return commandStack.execute('element.updateModdleProperties', { + element, + moddleElement: signal, + properties: { + name: value + } + }); + }; + return FeelEntryWithVariableContext({ + element, + id: 'signalName', + label: translate('Name'), + feel: 'optional', + getValue, + setValue, + debounce + }); +} + +function TargetProps(props) { + const { + element + } = props; + if (!(0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.is)(element, 'bpmn:CallActivity')) { + return []; + } + return [{ + id: 'targetProcessId', + component: TargetProcessId, + isEdited: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.isFeelEntryEdited + }]; +} +function TargetProcessId(props) { + const { + element, + id + } = props; + const commandStack = useService('commandStack'), + bpmnFactory = useService('bpmnFactory'), + translate = useService('translate'), + debounce = useService('debounceInput'); + const getValue = () => { + return getProcessId(element); + }; + const setValue = value => { + const commands = []; + const businessObject = (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element); + + // (1) ensure extension elements + let extensionElements = businessObject.get('extensionElements'); + if (!extensionElements) { + extensionElements = createElement('bpmn:ExtensionElements', { + values: [] + }, businessObject, bpmnFactory); + commands.push({ + cmd: 'element.updateModdleProperties', + context: { + element, + moddleElement: businessObject, + properties: { + extensionElements + } + } + }); + } + + // (2) ensure zeebe:calledElement + let calledElement = getCalledElement(businessObject); + if (!calledElement) { + calledElement = createElement('zeebe:CalledElement', {}, extensionElements, bpmnFactory); + commands.push({ + cmd: 'element.updateModdleProperties', + context: { + element, + moddleElement: extensionElements, + properties: { + values: [...extensionElements.get('values'), calledElement] + } + } + }); + } + + // (3) Update processId attribute + commands.push({ + cmd: 'element.updateModdleProperties', + context: { + element, + moddleElement: calledElement, + properties: { + processId: value + } + } + }); + + // (4) Execute the commands + commandStack.execute('properties-panel.multi-command-executor', commands); + }; + return FeelEntryWithVariableContext({ + element, + id, + label: translate('Process ID'), + feel: 'optional', + getValue, + setValue, + debounce + }); +} + +function TaskDefinitionProps(props) { + const { + element + } = props; + if (!isZeebeServiceTask(element)) { + return []; + } + return [{ + id: 'taskDefinitionType', + component: TaskDefinitionType, + isEdited: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.isFeelEntryEdited + }, { + id: 'taskDefinitionRetries', + component: TaskDefinitionRetries, + isEdited: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.isFeelEntryEdited + }]; +} +function TaskDefinitionType(props) { + const { + element, + id + } = props; + const commandStack = useService('commandStack'); + const bpmnFactory = useService('bpmnFactory'); + const translate = useService('translate'); + const debounce = useService('debounceInput'); + const getValue = () => { + return (getTaskDefinition(element) || {}).type; + }; + const setValue = value => { + const commands = []; + const businessObject = (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element); + let extensionElements = businessObject.get('extensionElements'); + + // (1) ensure extension elements + if (!extensionElements) { + extensionElements = createElement('bpmn:ExtensionElements', { + values: [] + }, businessObject, bpmnFactory); + commands.push({ + cmd: 'element.updateModdleProperties', + context: { + element, + moddleElement: businessObject, + properties: { + extensionElements + } + } + }); + } + + // (2) ensure task definition + let taskDefinition = getTaskDefinition(element); + if (!taskDefinition) { + taskDefinition = createElement('zeebe:TaskDefinition', {}, extensionElements, bpmnFactory); + commands.push({ + cmd: 'element.updateModdleProperties', + context: { + element, + moddleElement: extensionElements, + properties: { + values: [...extensionElements.get('values'), taskDefinition] + } + } + }); + } + + // (3) update task definition type + commands.push({ + cmd: 'element.updateModdleProperties', + context: { + element, + moddleElement: taskDefinition, + properties: { + type: value + } + } + }); + + // (4) commit all updates + commandStack.execute('properties-panel.multi-command-executor', commands); + }; + return FeelEntryWithVariableContext({ + element, + id, + label: translate('Type'), + feel: 'optional', + getValue, + setValue, + debounce + }); +} +function TaskDefinitionRetries(props) { + const { + element, + id + } = props; + const commandStack = useService('commandStack'); + const bpmnFactory = useService('bpmnFactory'); + const translate = useService('translate'); + const debounce = useService('debounceInput'); + const getValue = () => { + return (getTaskDefinition(element) || {}).retries; + }; + const setValue = value => { + let commands = []; + const businessObject = (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element); + let extensionElements = businessObject.get('extensionElements'); + + // (1) ensure extension elements + if (!extensionElements) { + extensionElements = createElement('bpmn:ExtensionElements', { + values: [] + }, businessObject, bpmnFactory); + commands.push({ + cmd: 'element.updateModdleProperties', + context: { + element, + moddleElement: businessObject, + properties: { + extensionElements + } + } + }); + } + + // (2) ensure task definition + let taskDefinition = getTaskDefinition(element); + if (!taskDefinition) { + taskDefinition = createElement('zeebe:TaskDefinition', {}, extensionElements, bpmnFactory); + commands.push({ + cmd: 'element.updateModdleProperties', + context: { + element, + moddleElement: extensionElements, + properties: { + values: [...extensionElements.get('values'), taskDefinition] + } + } + }); + } + + // (3) update task definition retries + commands.push({ + cmd: 'element.updateModdleProperties', + context: { + element, + moddleElement: taskDefinition, + properties: { + retries: value + } + } + }); + commandStack.execute('properties-panel.multi-command-executor', commands); + }; + return FeelEntryWithVariableContext({ + element, + id, + label: translate('Retries'), + feel: 'optional', + getValue, + setValue, + debounce, + tooltip: translate('Specifies the number of times the job is retried when a worker signals failure. The default is three.') + }); +} + +// helper /////////////////////// + +function getTaskDefinition(element) { + const businessObject = (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element); + return getExtensionElementsList(businessObject, 'zeebe:TaskDefinition')[0]; +} + +function TaskScheduleProps(props) { + const { + element + } = props; + if (!(0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.is)(element, 'bpmn:UserTask')) { + return []; + } + return [{ + id: 'taskScheduleDueDate', + component: DueDate$1, + isEdited: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.isFeelEntryEdited + }, { + id: 'taskScheduleFollowUpDate', + component: FollowUpDate$1, + isEdited: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.isFeelEntryEdited + }]; +} +function DueDate$1(props) { + const { + element + } = props; + const commandStack = useService('commandStack'); + const bpmnFactory = useService('bpmnFactory'); + const translate = useService('translate'); + const debounce = useService('debounceInput'); + const getValue = () => { + const taskSchedule = getTaskSchedule(element); + if (!taskSchedule) { + return; + } + return taskSchedule.get('dueDate'); + }; + const setValue = value => { + let commands = []; + const businessObject = (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element); + let extensionElements = businessObject.get('extensionElements'); + + // (1) ensure extension elements + if (!extensionElements) { + extensionElements = createElement('bpmn:ExtensionElements', { + values: [] + }, businessObject, bpmnFactory); + commands.push({ + cmd: 'element.updateModdleProperties', + context: { + element, + moddleElement: businessObject, + properties: { + extensionElements + } + } + }); + } + + // (2) ensure zeebe:TaskSchedule + let taskSchedule = getTaskSchedule(element); + if (!taskSchedule) { + taskSchedule = createElement('zeebe:TaskSchedule', {}, extensionElements, bpmnFactory); + commands.push({ + cmd: 'element.updateModdleProperties', + context: { + element, + moddleElement: extensionElements, + properties: { + values: [...extensionElements.get('values'), taskSchedule] + } + } + }); + } + + // (3) update zeebe:dueDate + commands.push({ + cmd: 'element.updateModdleProperties', + context: { + element, + moddleElement: taskSchedule, + properties: { + dueDate: value + } + } + }); + commandStack.execute('properties-panel.multi-command-executor', commands); + }; + return FeelEntryWithVariableContext({ + element, + id: 'taskScheduleDueDate', + label: translate('Due date'), + feel: 'optional', + getValue, + setValue, + debounce + }); +} +function FollowUpDate$1(props) { + const { + element + } = props; + const commandStack = useService('commandStack'); + const bpmnFactory = useService('bpmnFactory'); + const translate = useService('translate'); + const debounce = useService('debounceInput'); + const getValue = () => { + const taskSchedule = getTaskSchedule(element); + if (!taskSchedule) { + return; + } + return taskSchedule.get('followUpDate'); + }; + const setValue = value => { + let commands = []; + const businessObject = (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element); + let extensionElements = businessObject.get('extensionElements'); + + // (1) ensure extension elements + if (!extensionElements) { + extensionElements = createElement('bpmn:ExtensionElements', { + values: [] + }, businessObject, bpmnFactory); + commands.push({ + cmd: 'element.updateModdleProperties', + context: { + element, + moddleElement: businessObject, + properties: { + extensionElements + } + } + }); + } + + // (2) ensure zeebe:TaskSchedule + let taskSchedule = getTaskSchedule(element); + if (!taskSchedule) { + taskSchedule = createElement('zeebe:TaskSchedule', {}, extensionElements, bpmnFactory); + commands.push({ + cmd: 'element.updateModdleProperties', + context: { + element, + moddleElement: extensionElements, + properties: { + values: [...extensionElements.get('values'), taskSchedule] + } + } + }); + } + + // (3) update zeebe:followUpDate + commands.push({ + cmd: 'element.updateModdleProperties', + context: { + element, + moddleElement: taskSchedule, + properties: { + followUpDate: value + } + } + }); + commandStack.execute('properties-panel.multi-command-executor', commands); + }; + return FeelEntryWithVariableContext({ + element, + id: 'taskScheduleFollowUpDate', + label: translate('Follow up date'), + feel: 'optional', + getValue, + setValue, + debounce + }); +} + +// helper /////////////////////// + +function getTaskSchedule(element) { + const businessObject = (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element); + return getExtensionElementsList(businessObject, 'zeebe:TaskSchedule')[0]; +} + +/** + * Check whether a given timer expression type is supported for a given element. + * + * @param {string} type + * @param {Element|ModdleElement} element + * + * @return {boolean} + */ +function isTimerExpressionTypeSupported(type, element) { + const businessObject = (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element); + switch (type) { + case 'timeDate': + return (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.isAny)(element, ['bpmn:BoundaryEvent', 'bpmn:IntermediateCatchEvent', 'bpmn:StartEvent']); + case 'timeCycle': + if ((0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.is)(element, 'bpmn:StartEvent') && !hasParentEventSubProcess(businessObject) || !isInterrupting(businessObject)) { + return true; + } + if ((0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.is)(element, 'bpmn:BoundaryEvent') && !isInterrupting(businessObject)) { + return true; + } + return false; + case 'timeDuration': + if ((0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.isAny)(element, ['bpmn:BoundaryEvent', 'bpmn:IntermediateCatchEvent'])) { + return true; + } + if ((0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.is)(element, 'bpmn:StartEvent') && hasParentEventSubProcess(businessObject)) { + return true; + } + return false; + default: + return false; + } +} +function isInterrupting(businessObject) { + if ((0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.is)(businessObject, 'bpmn:BoundaryEvent')) { + return businessObject.get('cancelActivity') !== false; + } + return businessObject.get('isInterrupting') !== false; +} +function hasParentEventSubProcess(businessObject) { + const parent = businessObject.$parent; + return parent && (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.is)(parent, 'bpmn:SubProcess') && parent.get('triggeredByEvent'); +} + +function TimerProps$1(props) { + const { + element, + injector + } = props; + const translate = injector.get('translate'); + const businessObject = (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element), + timerEventDefinition = getTimerEventDefinition(businessObject), + timerEventDefinitionType = getTimerDefinitionType(timerEventDefinition); + + // (1) Only show for supported elements + if (!isTimerSupported(element)) { + return []; + } + const timerOptions = getTimerOptions(element, translate); + const entries = []; + entries.push({ + id: 'timerEventDefinitionType', + component: TimerEventDefinitionType$1, + isEdited: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.isSelectEntryEdited, + options: timerOptions + }); + if (timerEventDefinitionType) { + entries.push({ + id: 'timerEventDefinitionValue', + component: TimerEventDefinitionValue$1, + isEdited: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.isFeelEntryEdited, + timerEventDefinitionType: timerEventDefinitionType || timerOptions[0].value + }); + } + return entries; +} +function getTimerOptions(element, translate) { + const options = []; + if (isTimerExpressionTypeSupported('timeDate', element)) { + options.push({ + value: 'timeDate', + label: translate('Date') + }); + } + if (isTimerExpressionTypeSupported('timeDuration', element)) { + options.push({ + value: 'timeDuration', + label: translate('Duration') + }); + } + if (isTimerExpressionTypeSupported('timeCycle', element)) { + options.push({ + value: 'timeCycle', + label: translate('Cycle') + }); + } + return options; +} + +/** + * TimerEventDefinitionType - Generic select entry allowing to select a specific + * timerEventDefintionType. To be used together with timerEventDefinitionValue. + * + * @param {type} props + * @return {SelectEntry} + */ +function TimerEventDefinitionType$1(props) { + const { + element, + options + } = props; + const commandStack = useService('commandStack'), + bpmnFactory = useService('bpmnFactory'), + translate = useService('translate'); + const businessObject = (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element), + timerEventDefinition = getTimerEventDefinition(businessObject), + timerEventDefinitionType = getTimerDefinitionType(timerEventDefinition); + const getValue = () => { + return timerEventDefinitionType || ''; + }; + const setValue = value => { + // (1) Check if value is different to current type + if (value === timerEventDefinitionType) { + return; + } + + // (2) Create empty formalExpression element + const formalExpression = createTimerFormalExpression(bpmnFactory, timerEventDefinition); + + // (3) Set the value for selected timerEventDefinitionType + const newProps = { + timeDuration: undefined, + timeDate: undefined, + timeCycle: undefined + }; + if (value !== '') { + newProps[value] = formalExpression; + } + + // (4) Execute businessObject update + commandStack.execute('element.updateModdleProperties', { + element, + moddleElement: timerEventDefinition, + properties: newProps + }); + }; + const getOptions = element => { + return [{ + value: '', + label: translate('') + }, ...options]; + }; + return (0,_bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.SelectEntry)({ + element, + id: 'timerEventDefinitionType', + label: translate('Type'), + getValue, + setValue, + getOptions + }); +} + +/** + * TimerEventDefinitionValue - Generic textField entry allowing to specify the + * timerEventDefintionValue based on the set timerEventDefintionType. To be used + * together with timerEventDefinitionType. + * + * @param {object} props + * @param {ModdleElement} props.element + * @param {'timeCycle'|'timeDate'|'timeDuration'} props.timerEventDefinitionType? + * @param {string} props.label? + * @return {TextFieldEntry} + */ +function TimerEventDefinitionValue$1(props) { + const { + element, + label, + timerEventDefinitionType + } = props; + const commandStack = useService('commandStack'), + translate = useService('translate'), + debounce = useService('debounceInput'), + bpmnFactory = useService('bpmnFactory'); + const businessObject = (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element), + timerEventDefinition = getTimerEventDefinition(businessObject), + timerEventFormalExpression = timerEventDefinition.get(timerEventDefinitionType); + const getValue = () => { + return timerEventFormalExpression && timerEventFormalExpression.get('body'); + }; + const setValue = value => { + if (!timerEventFormalExpression) { + const expression = createTimerFormalExpression(bpmnFactory, timerEventDefinition); + expression.set('body', value); + commandStack.execute('element.updateModdleProperties', { + element, + moddleElement: timerEventDefinition, + properties: { + [timerEventDefinitionType]: expression + } + }); + return; + } + commandStack.execute('element.updateModdleProperties', { + element, + moddleElement: timerEventFormalExpression, + properties: { + body: value + } + }); + }; + return FeelEntryWithVariableContext({ + element, + id: 'timerEventDefinitionValue', + label: label || translate('Value'), + feel: 'optional', + getValue, + setValue, + debounce, + tooltip: getTimerEventDefinitionValueDescription$1(timerEventDefinitionType, translate) + }); +} + +// helper ////////////////////////// + +function createTimerFormalExpression(bpmnFactory, eventDefinition) { + const formalExpression = bpmnFactory.create('bpmn:FormalExpression', { + body: undefined + }); + formalExpression.$parent = eventDefinition; + return formalExpression; +} +function getTimerEventDefinitionValueDescription$1(timerDefinitionType, translate) { + switch (timerDefinitionType) { + case 'timeDate': + return (0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("div", { + children: [(0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("p", { + children: translate('A specific point in time defined as ISO 8601 combined date and time representation.') + }), (0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("ul", { + children: [(0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("li", { + children: [(0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("code", { + children: "2019-10-01T12:00:00Z" + }), " - ", translate('UTC time')] + }), (0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("li", { + children: [(0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("code", { + children: "2019-10-02T08:09:40+02:00" + }), " - ", translate('UTC plus 2 hours zone offset')] + })] + }), (0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("a", { + href: "https://docs.camunda.io/docs/reference/bpmn-processes/timer-events/timer-events#time-date", + target: "_blank", + rel: "noopener", + title: translate('Timer documentation'), + children: translate('How to configure a timer') + })] + }); + case 'timeCycle': + return (0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("div", { + children: [(0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("p", { + children: translate('A cycle defined as ISO 8601 repeating intervals format, or a cron expression.') + }), (0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("ul", { + children: [(0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("li", { + children: [(0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("code", { + children: "R5/PT10S" + }), " - ", translate('every 10 seconds, up to 5 times')] + }), (0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("li", { + children: [(0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("code", { + children: "R/P1D" + }), " - ", translate('every day, infinitely')] + }), (0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("li", { + children: [(0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("code", { + children: "0 0 9-17 * * MON-FRI" + }), " - ", translate('every hour on the hour from 9-5 p.m. UTC Monday-Friday')] + })] + }), (0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("a", { + href: "https://docs.camunda.io/docs/reference/bpmn-processes/timer-events/timer-events#time-cycle", + target: "_blank", + rel: "noopener", + title: translate('Timer documentation'), + children: translate('How to configure a timer') + })] + }); + case 'timeDuration': + return (0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("div", { + children: [(0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("p", { + children: translate('A time duration defined as ISO 8601 durations format.') + }), (0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("ul", { + children: [(0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("li", { + children: [(0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("code", { + children: "PT15S" + }), " - ", translate('15 seconds')] + }), (0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("li", { + children: [(0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("code", { + children: "PT1H30M" + }), " - ", translate('1 hour and 30 minutes')] + }), (0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("li", { + children: [(0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("code", { + children: "P14D" + }), " - ", translate('14 days')] + })] + }), (0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("a", { + href: "https://docs.camunda.io/docs/reference/bpmn-processes/timer-events/timer-events#time-duration", + target: "_blank", + rel: "noopener", + title: translate('Timer documentation'), + children: translate('How to configure a timer') + })] + }); + } +} + +function ExtensionProperty(props) { + const { + idPrefix, + property + } = props; + const entries = [{ + id: idPrefix + '-name', + component: NameProperty$1, + idPrefix, + property + }, { + id: idPrefix + '-value', + component: ValueProperty$1, + idPrefix, + property + }]; + return entries; +} +function NameProperty$1(props) { + const { + idPrefix, + element, + property + } = props; + const commandStack = useService('commandStack'); + const translate = useService('translate'); + const debounce = useService('debounceInput'); + const setValue = value => { + commandStack.execute('element.updateModdleProperties', { + element, + moddleElement: property, + properties: { + name: value + } + }); + }; + const getValue = () => { + return property.name; + }; + return (0,_bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.TextFieldEntry)({ + element: property, + id: idPrefix + '-name', + label: translate('Name'), + getValue, + setValue, + debounce + }); +} +function ValueProperty$1(props) { + const { + idPrefix, + element, + property + } = props; + const commandStack = useService('commandStack'); + const translate = useService('translate'); + const debounce = useService('debounceInput'); + const setValue = value => { + commandStack.execute('element.updateModdleProperties', { + element, + moddleElement: property, + properties: { + value + } + }); + }; + const getValue = () => { + return property.value; + }; + return (0,_bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.TextFieldEntry)({ + element: property, + id: idPrefix + '-value', + label: translate('Value'), + getValue, + setValue, + debounce + }); +} + +function ExtensionPropertiesProps({ + element, + injector, + namespace = 'camunda' +}) { + let businessObject = getRelevantBusinessObject(element); + + // do not offer for empty pools + if (!businessObject) { + return; + } + const properties = getPropertiesList(businessObject, namespace) || []; + const bpmnFactory = injector.get('bpmnFactory'), + commandStack = injector.get('commandStack'); + const items = properties.map((property, index) => { + const id = element.id + '-extensionProperty-' + index; + return { + id, + label: property.get('name') || '', + entries: ExtensionProperty({ + idPrefix: id, + element, + property + }), + autoFocusEntry: id + '-name', + remove: removeFactory$9({ + commandStack, + element, + property, + namespace + }) + }; + }); + return { + items, + add: addFactory$6({ + bpmnFactory, + commandStack, + element, + namespace + }), + shouldSort: false + }; +} +function removeFactory$9({ + commandStack, + element, + property, + namespace +}) { + return function (event) { + event.stopPropagation(); + const commands = []; + const businessObject = getRelevantBusinessObject(element); + const extensionElements = businessObject.get('extensionElements'); + const properties = getProperties(businessObject, namespace); + if (!properties) { + return; + } + const propertyName = getPropertyName(namespace); + const values = (0,min_dash__WEBPACK_IMPORTED_MODULE_12__.without)(properties.get(propertyName), property); + commands.push({ + cmd: 'element.updateModdleProperties', + context: { + element, + moddleElement: properties, + properties: { + [propertyName]: values + } + } + }); + + // remove camunda:Properties if there are no properties anymore + if (!values.length) { + commands.push({ + cmd: 'element.updateModdleProperties', + context: { + element, + moddleElement: extensionElements, + properties: { + values: (0,min_dash__WEBPACK_IMPORTED_MODULE_12__.without)(extensionElements.get('values'), properties) + } + } + }); + } + commandStack.execute('properties-panel.multi-command-executor', commands); + }; +} +function addFactory$6({ + bpmnFactory, + commandStack, + element, + namespace +}) { + return function (event) { + event.stopPropagation(); + let commands = []; + const businessObject = getRelevantBusinessObject(element); + let extensionElements = businessObject.get('extensionElements'); + + // (1) ensure extension elements + if (!extensionElements) { + extensionElements = createElement('bpmn:ExtensionElements', { + values: [] + }, businessObject, bpmnFactory); + commands.push({ + cmd: 'element.updateModdleProperties', + context: { + element, + moddleElement: businessObject, + properties: { + extensionElements + } + } + }); + } + const propertyName = getPropertyName(namespace); + + // (2) ensure camunda:Properties + let properties = getProperties(businessObject, namespace); + if (!properties) { + const parent = extensionElements; + properties = createElement(`${namespace}:Properties`, { + [propertyName]: [] + }, parent, bpmnFactory); + commands.push({ + cmd: 'element.updateModdleProperties', + context: { + element, + moddleElement: extensionElements, + properties: { + values: [...extensionElements.get('values'), properties] + } + } + }); + } + + // (3) create camunda:Property + const property = createElement(`${namespace}:Property`, {}, properties, bpmnFactory); + + // (4) add property to list + commands.push({ + cmd: 'element.updateModdleProperties', + context: { + element, + moddleElement: properties, + properties: { + [propertyName]: [...properties.get(propertyName), property] + } + } + }); + + // (5) commit all updates + commandStack.execute('properties-panel.multi-command-executor', commands); + }; +} + +// helper ////////////////// + +function getRelevantBusinessObject(element) { + let businessObject = (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element); + if ((0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.is)(element, 'bpmn:Participant')) { + return businessObject.get('processRef'); + } + return businessObject; +} +function getPropertyName(namespace = 'camunda') { + if (namespace === 'zeebe') { + return 'properties'; + } + return 'values'; +} +function getProperties(element, namespace = 'camunda') { + const businessObject = getRelevantBusinessObject(element); + return getExtensionElementsList(businessObject, `${namespace}:Properties`)[0]; +} +function getPropertiesList(element, namespace = 'camunda') { + const businessObject = getRelevantBusinessObject(element); + const properties = getProperties(businessObject, namespace); + return properties && properties.get(getPropertyName(namespace)); +} + +/** + * @typedef { import('@bpmn-io/properties-panel').EntryDefinition } Entry + */ - return element.fireEvent('on' + eventType, evt); - } - } +const LOW_PRIORITY$1 = 500; +const ZEEBE_GROUPS = [BusinessRuleImplementationGroup, CalledDecisionGroup, ScriptImplementationGroup, ScriptGroup$1, TaskDefinitionGroup, AssignmentDefinitionGroup, FormGroup$1, ConditionGroup$1, TargetGroup, InputPropagationGroup, InputGroup$1, OutputPropagationGroup, OutputGroup$1, HeaderGroup, ExtensionPropertiesGroup$1]; +class ZeebePropertiesProvider { + constructor(propertiesPanel, injector) { + propertiesPanel.registerProvider(LOW_PRIORITY$1, this); + this._injector = injector; + } + getGroups(element) { + return groups => { + // (1) add zeebe specific groups + groups = groups.concat(this._getGroups(element)); + + // (2) update existing groups with zeebe specific properties + updateErrorGroup$1(groups, element); + updateEscalationGroup$1(groups, element); + updateMessageGroup(groups, element); + updateSignalGroup(groups, element); + updateTimerGroup$1(groups, element, this._injector); + updateMultiInstanceGroup$1(groups, element); + + // (3) remove message group when not applicable + groups = removeMessageGroup(groups, element); + return groups; + }; + } + _getGroups(element) { + const groups = ZEEBE_GROUPS.map(createGroup => createGroup(element, this._injector)); + return groups.filter(group => group !== null); + } +} +ZeebePropertiesProvider.$inject = ['propertiesPanel', 'injector']; +function CalledDecisionGroup(element) { + const group = { + id: 'calledDecision', + label: 'Called decision', + entries: [...CalledDecisionProps({ + element + })], + component: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.Group + }; + return group.entries.length ? group : null; +} +function ScriptGroup$1(element) { + const group = { + id: 'script', + label: 'Script', + entries: [...ScriptProps$1({ + element + })], + component: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.Group + }; + return group.entries.length ? group : null; +} +function TaskDefinitionGroup(element) { + const group = { + id: 'taskDefinition', + label: 'Task definition', + entries: [...TaskDefinitionProps({ + element + })], + component: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.Group + }; + return group.entries.length ? group : null; +} +function InputGroup$1(element, injector) { + const group = { + id: 'inputs', + label: 'Inputs', + component: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.ListGroup, + ...InputProps$1({ + element, + injector + }) + }; + return group.items ? group : null; +} +function OutputGroup$1(element, injector) { + const group = { + id: 'outputs', + label: 'Outputs', + component: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.ListGroup, + ...OutputProps$1({ + element, + injector + }) + }; + return group.items ? group : null; +} +function ConditionGroup$1(element) { + const group = { + id: 'condition', + label: 'Condition', + entries: [...ConditionProps$1({ + element + })], + component: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.Group + }; + return group.entries.length ? group : null; +} +function FormGroup$1(element, injector) { + const group = { + id: 'form', + label: 'Form', + entries: [...FormProps$1({ + element, + injector + })], + component: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.Group + }; + return group.entries.length ? group : null; +} +function TargetGroup(element) { + const group = { + id: 'calledElement', + label: 'Called element', + entries: [...TargetProps({ + element + })], + component: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.Group + }; + return group.entries.length ? group : null; +} +function HeaderGroup(element, injector) { + const group = { + id: 'headers', + label: 'Headers', + component: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.ListGroup, + ...HeaderProps({ + element, + injector + }) + }; + return group.items ? group : null; +} +function OutputPropagationGroup(element) { + const group = { + id: 'outputPropagation', + label: 'Output propagation', + entries: [...OutputPropagationProps({ + element + })], + component: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.Group + }; + return group.entries.length ? group : null; +} +function InputPropagationGroup(element) { + const group = { + id: 'inputPropagation', + label: 'Input propagation', + entries: [...InputPropagationProps({ + element + })], + component: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.Group + }; + return group.entries.length ? group : null; +} +function BusinessRuleImplementationGroup(element) { + const group = { + id: 'businessRuleImplementation', + label: 'Implementation', + entries: [...BusinessRuleImplementationProps({ + element + })], + component: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.Group + }; + return group.entries.length ? group : null; +} +function ScriptImplementationGroup(element) { + const group = { + id: 'scriptImplementation', + label: 'Implementation', + entries: [...ScriptImplementationProps({ + element + })], + component: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.Group + }; + return group.entries.length ? group : null; +} +function AssignmentDefinitionGroup(element) { + const group = { + id: 'assignmentDefinition', + label: 'Assignment', + entries: [...AssignmentDefinitionProps({ + element + }), ...TaskScheduleProps({ + element + })], + component: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.Group + }; + return group.entries.length ? group : null; +} +function ExtensionPropertiesGroup$1(element, injector) { + const group = { + label: 'Extension properties', + id: 'Zeebe__ExtensionProperties', + component: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.ListGroup, + ...ExtensionPropertiesProps({ + element, + injector, + namespace: 'zeebe' + }) + }; + if (group.items) { + return group; + } + return null; +} +function updateErrorGroup$1(groups, element) { + const errorGroup = findGroup$1(groups, 'error'); + if (!errorGroup) { + return; + } + errorGroup.entries = replaceEntries(errorGroup.entries, ErrorProps$1({ + element + })); +} +function updateEscalationGroup$1(groups, element) { + const escalationGroup = findGroup$1(groups, 'escalation'); + if (!escalationGroup) { + return; + } + escalationGroup.entries = replaceEntries(escalationGroup.entries, EscalationProps$1({ + element + })); +} +function updateSignalGroup(groups, element) { + const signalGroup = findGroup$1(groups, 'signal'); + if (!signalGroup) { + return; + } + signalGroup.entries = replaceEntries(signalGroup.entries, SignalProps({ + element + })); +} +function updateMessageGroup(groups, element) { + const messageGroup = findGroup$1(groups, 'message'); + if (!messageGroup) { + return; + } + messageGroup.entries = replaceEntries(messageGroup.entries, MessageProps({ + element + })); +} + +// overwrite bpmn generic timerEventDefinition group with zeebe-specific one +function updateTimerGroup$1(groups, element, injector) { + const timerEventGroup = findGroup$1(groups, 'timer'); + if (!timerEventGroup) { + return; + } + timerEventGroup.entries = [...TimerProps$1({ + element, + injector + })]; +} + +// overwrite bpmn generic multiInstance group with zeebe-specific one +function updateMultiInstanceGroup$1(groups, element) { + const multiInstanceGroup = findGroup$1(groups, 'multiInstance'); + if (!multiInstanceGroup) { + return; + } + multiInstanceGroup.entries = [...MultiInstanceProps$1({ + element + })]; +} + +// remove message group from Message End Event & Message Throw Event +function removeMessageGroup(groups, element) { + const messageGroup = findGroup$1(groups, 'message'); + if (isMessageEndEvent(element) || isMessageThrowEvent(element)) { + groups = groups.filter(g => g != messageGroup); + } + return groups; +} + +// helper ///////////////////// + +function findGroup$1(groups, id) { + return groups.find(g => g.id === id); +} + +/** + * Replace entries with the same ID. + *s + * @param {Entry[]} oldEntries + * @param {Entry[]} newEntries + * + * @returns {Entry[]} combined entries + */ +function replaceEntries(oldEntries, newEntries) { + const filteredEntries = oldEntries.filter(oldEntry => !newEntries.find(newEntry => newEntry.id === oldEntry.id)); + return [...filteredEntries, ...newEntries]; +} + +var index$1 = { + __init__: ['zeebePropertiesProvider'], + zeebePropertiesProvider: ['type', ZeebePropertiesProvider] +}; + +function AsynchronousContinuationsProps(props) { + const { + element + } = props; + const checkboxIsEditedInverted = node => { + return node && !node.checked; + }; + const businessObject = (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element); + const entries = []; + if ((0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.is)(element, 'camunda:AsyncCapable')) { + entries.push({ + id: 'asynchronousContinuationBefore', + component: AsynchronousContinuationBefore, + isEdited: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.isCheckboxEntryEdited + }, { + id: 'asynchronousContinuationAfter', + component: AsynchronousContinuationAfter, + isEdited: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.isCheckboxEntryEdited + }); + if (isAsyncBefore$2(businessObject) || isAsyncAfter$2(businessObject)) { + entries.push({ + id: 'exclusive', + component: Exclusive, + isEdited: checkboxIsEditedInverted + }); + } + } + return entries; +} +function AsynchronousContinuationBefore(props) { + const { + element + } = props; + const commandStack = useService('commandStack'), + translate = useService('translate'); + const businessObject = (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element); + const getValue = () => { + return isAsyncBefore$2(businessObject); + }; + const setValue = value => { + // overwrite the legacy `async` property, we will use the more explicit `asyncBefore` + const props = { + 'camunda:asyncBefore': value, + 'camunda:async': undefined + }; + commandStack.execute('element.updateModdleProperties', { + element, + moddleElement: businessObject, + properties: props + }); + }; + return (0,_bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.CheckboxEntry)({ + element, + id: 'asynchronousContinuationBefore', + label: translate('Before'), + getValue, + setValue + }); +} +function AsynchronousContinuationAfter(props) { + const { + element + } = props; + const commandStack = useService('commandStack'), + translate = useService('translate'); + const businessObject = (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element); + const getValue = () => { + return isAsyncAfter$2(businessObject); + }; + const setValue = value => { + commandStack.execute('element.updateModdleProperties', { + element, + moddleElement: businessObject, + properties: { + 'camunda:asyncAfter': value + } + }); + }; + return (0,_bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.CheckboxEntry)({ + element, + id: 'asynchronousContinuationAfter', + label: translate('After'), + getValue, + setValue + }); +} +function Exclusive(props) { + const { + element + } = props; + const commandStack = useService('commandStack'), + translate = useService('translate'); + const businessObject = (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element); + const getValue = () => { + return isExclusive$1(businessObject); + }; + const setValue = value => { + commandStack.execute('element.updateModdleProperties', { + element, + moddleElement: businessObject, + properties: { + 'camunda:exclusive': value + } + }); + }; + return (0,_bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.CheckboxEntry)({ + element, + id: 'exclusive', + label: translate('Exclusive'), + getValue, + setValue + }); +} + +// helper ////////////////// + +/** + * Returns true if the attribute 'camunda:asyncBefore' is set + * to true. + * + * @param {ModdleElement} bo + * + * @return {boolean} a boolean value + */ +function isAsyncBefore$2(bo) { + return !!(bo.get('camunda:asyncBefore') || bo.get('camunda:async')); +} - module.exports.triggerClickEvent = triggerClickEvent; +/** + * Returns true if the attribute 'camunda:asyncAfter' is set + * to true. + * + * @param {ModdleElement} bo + * + * @return {boolean} a boolean value + */ +function isAsyncAfter$2(bo) { + return !!bo.get('camunda:asyncAfter'); +} +/** + * Returns true if the attribute 'camunda:exclusive' is set + * to true. + * + * @param {ModdleElement} bo + * + * @return {boolean} a boolean value + */ +function isExclusive$1(bo) { + return !!bo.get('camunda:exclusive'); +} + +const EMPTY_OPTION$1 = ''; +function BusinessKeyProps$1(props) { + const { + element + } = props; + if (!(0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.is)(element, 'bpmn:StartEvent') || !hasFormFields(element)) { + return []; + } + return [{ + id: 'businessKey', + component: BusinessKey$1, + isEdited: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.isSelectEntryEdited + }]; +} +function BusinessKey$1(props) { + const { + element + } = props; + const commandStack = useService('commandStack'); + const translate = useService('translate'); + const formData = getFormData$2(element); + const getValue = () => { + return formData.get('camunda:businessKey') || ''; + }; + const setValue = value => { + commandStack.execute('element.updateModdleProperties', { + element, + moddleElement: formData, + properties: { + 'camunda:businessKey': value + } + }); + }; + const getOptions = () => { + const options = [{ + value: EMPTY_OPTION$1, + label: translate('') + }]; + const fields = formData.get('fields'); + fields.forEach(field => { + const id = field.get('camunda:id'); + if (id) { + options.push({ + value: id, + label: id + }); + } + }); + return options; + }; + return (0,_bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.SelectEntry)({ + element, + id: 'businessKey', + label: translate('Key'), + getValue, + setValue, + getOptions + }); +} + +// helper /////////////////// + +function getFormData$2(element) { + const businessObject = (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element); + return getExtensionElementsList(businessObject, 'camunda:FormData')[0]; +} +function hasFormFields(element) { + const businessObject = (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element); + const formData = getFormData$2(businessObject); + return formData && formData.get('camunda:fields').length; +} + +function CalledBpmnProps(props) { + const { + element + } = props; + const entries = [{ + id: 'calledElement', + component: CalledElement, + isEdited: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.isTextFieldEntryEdited + }, { + id: 'calledElementBinding', + component: CalledElementBinding, + isEdited: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.isSelectEntryEdited + }, { + id: 'calledElementTenantId', + component: CalledElementTenantId, + isEdited: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.isTextFieldEntryEdited + }]; + const binding = (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element).get('camunda:calledElementBinding'); + if (binding === 'version') { + entries.splice(-1, 0, { + id: 'calledElementVersion', + component: CalledElementVersion, + isEdited: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.isTextFieldEntryEdited + }); + } else if (binding === 'versionTag') { + entries.splice(-1, 0, { + id: 'calledElementVersionTag', + component: CalledElementVersionTag, + isEdited: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.isTextFieldEntryEdited + }); + } + return entries; +} +function CalledElement(props) { + const { + element + } = props; + const modeling = useService('modeling'); + const translate = useService('translate'); + const debounce = useService('debounceInput'); + const getValue = () => { + return (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element).get('calledElement'); + }; + const setValue = value => { + modeling.updateProperties(element, { + calledElement: value || '' + }); + }; + return (0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.TextFieldEntry, { + element: element, + id: "calledElement", + label: translate('Called element'), + getValue: getValue, + setValue: setValue, + debounce: debounce + }); +} +function CalledElementBinding(props) { + const { + element + } = props; + const modeling = useService('modeling'); + const translate = useService('translate'); + const getValue = () => { + return (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element).get('camunda:calledElementBinding') || 'latest'; + }; + const setValue = value => { + modeling.updateProperties(element, { + calledElementBinding: value === 'latest' ? undefined : value, + calledElementVersion: undefined, + calledElementVersionTag: undefined + }); + }; + const getOptions = () => [{ + value: 'latest', + label: translate('latest') + }, { + value: 'deployment', + label: translate('deployment') + }, { + value: 'version', + label: translate('version') + }, { + value: 'versionTag', + label: translate('version tag') + }]; + return (0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.SelectEntry, { + element: element, + id: "calledElementBinding", + label: translate('Binding'), + getValue: getValue, + setValue: setValue, + getOptions: getOptions + }); +} +function CalledElementVersion(props) { + const { + element + } = props; + const modeling = useService('modeling'); + const translate = useService('translate'); + const debounce = useService('debounceInput'); + const getValue = () => { + return (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element).get('camunda:calledElementVersion'); + }; + const setValue = value => { + modeling.updateProperties(element, { + calledElementVersion: value + }); + }; + return (0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.TextFieldEntry, { + element: element, + id: "calledElementVersion", + label: translate('Version'), + getValue: getValue, + setValue: setValue, + debounce: debounce + }); +} +function CalledElementVersionTag(props) { + const { + element + } = props; + const modeling = useService('modeling'); + const translate = useService('translate'); + const debounce = useService('debounceInput'); + const getValue = () => { + return (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element).get('camunda:calledElementVersionTag'); + }; + const setValue = value => { + modeling.updateProperties(element, { + calledElementVersionTag: value + }); + }; + return (0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.TextFieldEntry, { + element: element, + id: "calledElementVersionTag", + label: translate('Version tag'), + getValue: getValue, + setValue: setValue, + debounce: debounce + }); +} +function CalledElementTenantId(props) { + const { + element + } = props; + const modeling = useService('modeling'); + const translate = useService('translate'); + const debounce = useService('debounceInput'); + const getValue = () => { + return (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element).get('camunda:calledElementTenantId'); + }; + const setValue = value => { + modeling.updateProperties(element, { + calledElementTenantId: value + }); + }; + return (0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.TextFieldEntry, { + element: element, + id: "calledElementTenantId", + label: translate('Tenant ID'), + getValue: getValue, + setValue: setValue, + debounce: debounce + }); +} + +function CalledCmmnProps(props) { + const { + element + } = props; + const entries = [{ + id: 'calledElementCaseRef', + component: CaseRef, + isEdited: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.isTextFieldEntryEdited + }, { + id: 'calledElementCaseBinding', + component: CaseBinding, + isEdited: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.isSelectEntryEdited + }, { + id: 'calledElementCaseTenantId', + component: CaseTenantId, + isEdited: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.isTextFieldEntryEdited + }]; + if ((0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element).get('camunda:caseBinding') === 'version') { + entries.splice(-1, 0, { + id: 'calledElementCaseVersion', + component: CaseVersion, + isEdited: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.isTextFieldEntryEdited + }); + } + return entries; +} +function CaseRef(props) { + const { + element + } = props; + const modeling = useService('modeling'); + const translate = useService('translate'); + const debounce = useService('debounceInput'); + const getValue = () => { + return (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element).get('camunda:caseRef'); + }; + const setValue = value => { + modeling.updateProperties(element, { + caseRef: value || '' + }); + }; + return (0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.TextFieldEntry, { + element: element, + id: "calledElementCaseRef", + label: translate('Case ref'), + getValue: getValue, + setValue: setValue, + debounce: debounce + }); +} +function CaseBinding(props) { + const { + element + } = props; + const modeling = useService('modeling'); + const translate = useService('translate'); + const getValue = () => { + return (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element).get('camunda:caseBinding') || 'latest'; + }; + const setValue = value => { + modeling.updateProperties(element, { + caseBinding: value === 'latest' ? undefined : value, + caseVersion: undefined + }); + }; + const getOptions = () => [{ + value: 'latest', + label: translate('latest') + }, { + value: 'deployment', + label: translate('deployment') + }, { + value: 'version', + label: translate('version') + }]; + return (0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.SelectEntry, { + element: element, + id: "calledElementCaseBinding", + label: translate('Binding'), + getValue: getValue, + setValue: setValue, + getOptions: getOptions + }); +} +function CaseVersion(props) { + const { + element + } = props; + const modeling = useService('modeling'); + const translate = useService('translate'); + const debounce = useService('debounceInput'); + const getValue = () => { + return (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element).get('camunda:caseVersion'); + }; + const setValue = value => { + modeling.updateProperties(element, { + caseVersion: value + }); + }; + return (0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.TextFieldEntry, { + element: element, + id: "calledElementCaseVersion", + label: translate('Version'), + getValue: getValue, + setValue: setValue, + debounce: debounce + }); +} +function CaseTenantId(props) { + const { + element + } = props; + const modeling = useService('modeling'); + const translate = useService('translate'); + const debounce = useService('debounceInput'); + const getValue = () => { + return (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element).get('camunda:caseTenantId'); + }; + const setValue = value => { + modeling.updateProperties(element, { + caseTenantId: value + }); + }; + return (0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.TextFieldEntry, { + element: element, + id: "calledElementCaseTenantId", + label: translate('Tenant ID'), + getValue: getValue, + setValue: setValue, + debounce: debounce + }); +} + +function DelegateVariableMappingProps(props) { + const { + element + } = props; + const entries = [{ + id: 'calledElementDelegateVariableMappingType', + component: DelegateVariableMappingType, + isEdited: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.isSelectEntryEdited + }]; + const type = getDelegateVariableMappingType(element); + if (type === 'class') { + entries.push({ + id: 'calledElementVariableMappingClass', + component: VariableMappingClass, + isEdited: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.isTextFieldEntryEdited + }); + } else if (type === 'delegateExpression') { + entries.push({ + id: 'calledElementVariableMappingDelegateExpression', + component: VariableMappingDelegateExpression, + isEdited: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.isTextFieldEntryEdited + }); + } + return entries; +} +const DEFAULT_PROPS$5 = { + 'camunda:variableMappingClass': undefined, + 'camunda:variableMappingDelegateExpression': undefined +}; +function DelegateVariableMappingType(props) { + const { + element + } = props; + const commandStack = useService('commandStack'); + const translate = useService('translate'); + const getValue = () => { + return getDelegateVariableMappingType(element); + }; + const setValue = value => { + const properties = { + ...DEFAULT_PROPS$5 + }; + if (value === 'class') { + properties['camunda:variableMappingClass'] = ''; + } else if (value === 'delegateExpression') { + properties['camunda:variableMappingDelegateExpression'] = ''; + } + commandStack.execute('element.updateProperties', { + element, + properties + }); + }; + const getOptions = () => [{ + value: 'none', + label: translate('') + }, { + value: 'class', + label: translate('Class') + }, { + value: 'delegateExpression', + label: translate('Delegate expression') + }]; + return (0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.SelectEntry, { + element: element, + id: "calledElementDelegateVariableMappingType", + label: translate('Delegate Variable Mapping'), + getValue: getValue, + setValue: setValue, + getOptions: getOptions + }); +} +function VariableMappingDelegateExpression(props) { + const { + element + } = props; + const modeling = useService('modeling'); + const translate = useService('translate'); + const debounce = useService('debounceInput'); + const getValue = () => { + return (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element).get('camunda:variableMappingDelegateExpression'); + }; + const setValue = value => { + modeling.updateProperties(element, { + variableMappingDelegateExpression: value || '', + variableMappingClass: undefined + }); + }; + return (0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.TextFieldEntry, { + element: element, + id: "calledElementVariableMappingDelegateExpression", + label: translate('Delegate Expression'), + getValue: getValue, + setValue: setValue, + debounce: debounce + }); +} +function VariableMappingClass(props) { + const { + element + } = props; + const modeling = useService('modeling'); + const translate = useService('translate'); + const debounce = useService('debounceInput'); + const getValue = () => { + return (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element).get('camunda:variableMappingClass'); + }; + const setValue = value => { + modeling.updateProperties(element, { + variableMappingDelegateExpression: undefined, + variableMappingClass: value || '' + }); + }; + return (0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.TextFieldEntry, { + element: element, + id: "calledElementVariableMappingClass", + label: translate('Delegate Class'), + getValue: getValue, + setValue: setValue, + debounce: debounce + }); +} + +// helper ///// + +function getDelegateVariableMappingType(element) { + const businessObject = (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element); + if (businessObject.get('camunda:variableMappingClass') !== undefined) { + return 'class'; + } else if (businessObject.get('camunda:variableMappingDelegateExpression') !== undefined) { + return 'delegateExpression'; + } + return 'none'; +} + +function CallActivityProps(props) { + const { + element + } = props; + if (!(0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.is)(element, 'bpmn:CallActivity')) { + return []; + } + const entries = []; + entries.push({ + id: 'calledElementType', + component: CalledElementType, + isEdited: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.isSelectEntryEdited + }); + const calledElementType = getCalledElementType(element); + if (calledElementType === 'bpmn') { + entries.push(...CalledBpmnProps({ + element + }), ...BusinessKeyProps({ + element + }), ...DelegateVariableMappingProps({ + element + })); + } else if (calledElementType === 'cmmn') { + entries.push(...CalledCmmnProps({ + element + }), ...BusinessKeyProps({ + element + })); + } else { + entries.push(...BusinessKeyProps({ + element + })); + } + return entries; +} +const DEFAULT_PROPS$4 = { + calledElement: undefined, + 'camunda:calledElementBinding': undefined, + 'camunda:calledElementVersion': undefined, + 'camunda:calledElementTenantId': undefined, + 'camunda:variableMappingClass': undefined, + 'camunda:variableMappingDelegateExpression': undefined, + 'camunda:caseRef': undefined, + 'camunda:caseBinding': undefined, + 'camunda:caseVersion': undefined, + 'camunda:caseTenantId': undefined +}; +const DEFAULT_BUSINESS_KEY = '#{execution.processBusinessKey}'; +function CalledElementType(props) { + const { + element + } = props; + const commandStack = useService('commandStack'); + const translate = useService('translate'); + const getValue = () => { + return getCalledElementType(element); + }; + const setValue = value => { + const properties = { + ...DEFAULT_PROPS$4 + }; + if (value === 'bpmn') { + properties['calledElement'] = ''; + } else if (value === 'cmmn') { + properties['camunda:caseRef'] = ''; + } + commandStack.execute('element.updateProperties', { + element, + properties + }); + }; + const getOptions = () => [{ + value: '', + label: translate('') + }, { + value: 'bpmn', + label: translate('BPMN') + }, { + value: 'cmmn', + label: translate('CMMN') + }]; + return (0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.SelectEntry, { + element: element, + id: "calledElementType", + label: translate('Type'), + getValue: getValue, + setValue: setValue, + getOptions: getOptions + }); +} +function BusinessKeyProps(props) { + const { + element + } = props; + const entries = [{ + id: 'calledElementBusinessKey', + component: BusinessKey, + isEdited: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.isCheckboxEntryEdited + }]; + if (hasBusinessKey(element)) { + entries.push({ + id: 'calledElementBusinessKeyExpression', + component: BusinessKeyExpression, + isEdited: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.isTextFieldEntryEdited + }); + } + return entries; +} +function BusinessKey(props) { + const { + element + } = props; + const commandStack = useService('commandStack'); + const modeling = useService('modeling'); + const bpmnFactory = useService('bpmnFactory'); + const translate = useService('translate'); + const getValue = () => { + return hasBusinessKey(element); + }; + const setValue = value => { + if (value) { + addBusinessKey(); + } else { + removeBusinessKey(); + } + }; + function addBusinessKey() { + const businessObject = (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element); + let extensionElements = businessObject.get('extensionElements'); + + // (1) If there are no extension elements, create camunda:In and update element's properties + if (!extensionElements) { + extensionElements = createElement('bpmn:ExtensionElements', {}, businessObject, bpmnFactory); + const businessKeyItem = createBusinessKey(extensionElements); + extensionElements.set('values', [businessKeyItem]); + modeling.updateProperties(element, { + extensionElements + }); + } else { + // (2) Otherwise, add camunda:In to the existing values + const businessKeyItem = createBusinessKey(extensionElements); + addExtensionElements(element, businessObject, businessKeyItem, bpmnFactory, commandStack); + } + } + function createBusinessKey(parent) { + return createElement('camunda:In', { + businessKey: DEFAULT_BUSINESS_KEY + }, parent, bpmnFactory); + } + function removeBusinessKey() { + const businessObject = (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element); + const camundaInList = getExtensionElementsList(businessObject, 'camunda:In'); + const businessKeyItems = camundaInList.filter(camundaIn => camundaIn.get('businessKey') !== undefined); + removeExtensionElements(element, businessObject, businessKeyItems, commandStack); + } + return (0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.CheckboxEntry, { + element: element, + id: "calledElementBusinessKey", + label: translate('Business key'), + getValue: getValue, + setValue: setValue + }); +} +function BusinessKeyExpression(props) { + const { + element + } = props; + const commandStack = useService('commandStack'); + const translate = useService('translate'); + const debounce = useService('debounceInput'); + const getValue = () => getBusinessKey(element); + const setValue = value => { + const camundaIn = findCamundaInWithBusinessKey(element); + commandStack.execute('element.updateModdleProperties', { + element, + moddleElement: camundaIn, + properties: { + businessKey: value || '' + } + }); + }; + return (0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.TextFieldEntry, { + element: element, + id: "calledElementBusinessKeyExpression", + label: translate('Business key expression'), + getValue: getValue, + setValue: setValue, + debounce: debounce + }); +} + +// helper ////// + +function getCalledElementType(element) { + const businessObject = (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element); + if (businessObject.get('calledElement') !== undefined) { + return 'bpmn'; + } else if (businessObject.get('camunda:caseRef') !== undefined) { + return 'cmmn'; + } + return ''; +} +function hasBusinessKey(element) { + return getBusinessKey(element) !== undefined; +} +function getBusinessKey(element) { + const camundaIn = findCamundaInWithBusinessKey(element); + if (camundaIn) { + return camundaIn.get('businessKey'); + } +} +function findCamundaInWithBusinessKey(element) { + const businessObject = (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element); + const camundaInList = getExtensionElementsList(businessObject, 'camunda:In'); + for (const camundaIn of camundaInList) { + const businessKey = camundaIn.get('businessKey'); + if (businessKey !== undefined) { + return camundaIn; + } + } +} + +function CandidateStarterProps(props) { + const { + element + } = props; + const businessObject = (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element); + if (!(0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.is)(element, 'bpmn:Process') && !((0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.is)(element, 'bpmn:Participant') && businessObject.get('processRef'))) { + return []; + } + return [{ + id: 'candidateStarterGroups', + component: CandidateStarterGroups, + isEdited: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.isTextFieldEntryEdited + }, { + id: 'candidateStarterUsers', + component: CandidateStarterUsers, + isEdited: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.isTextFieldEntryEdited + }]; +} +function CandidateStarterGroups(props) { + const { + element + } = props; + const commandStack = useService('commandStack'), + translate = useService('translate'), + debounce = useService('debounceInput'); + const process = getProcess$3(element); + const getValue = () => { + return process.get('camunda:candidateStarterGroups') || ''; + }; + const setValue = value => { + commandStack.execute('element.updateModdleProperties', { + element: element, + moddleElement: process, + properties: { + 'camunda:candidateStarterGroups': value + } + }); + }; + return (0,_bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.TextFieldEntry)({ + element, + id: 'candidateStarterGroups', + label: translate('Candidate starter groups'), + description: translate('Specify more than one group as a comma separated list.'), + getValue, + setValue, + debounce + }); +} +function CandidateStarterUsers(props) { + const { + element + } = props; + const commandStack = useService('commandStack'), + translate = useService('translate'), + debounce = useService('debounceInput'); + const process = getProcess$3(element); + const getValue = () => { + return process.get('camunda:candidateStarterUsers') || ''; + }; + const setValue = value => { + commandStack.execute('element.updateModdleProperties', { + element: element, + moddleElement: process, + properties: { + 'camunda:candidateStarterUsers': value + } + }); + }; + return (0,_bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.TextFieldEntry)({ + element, + id: 'candidateStarterUsers', + label: translate('Candidate starter users'), + description: translate('Specify more than one user as a comma separated list.'), + getValue, + setValue, + debounce + }); +} + +// helper ////////////////// + +/** + * getProcess - get the businessObject of the process referred to by a bpmn:Process + * or by a bpmn:Participant + * + * @param {ModdleElement} element either a bpmn:Process or a bpmn:Participant + * @return {BusinessObject} + */ +function getProcess$3(element) { + return (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.is)(element, 'bpmn:Process') ? (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element) : (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element).get('processRef'); +} + +function ConditionProps(props) { + const { + element + } = props; + if (!((0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.is)(element, 'bpmn:SequenceFlow') && isConditionalSource(element.source)) && !getConditionalEventDefinition(element)) { + return []; + } + const entries = []; + if (getConditionalEventDefinition(element)) { + entries.push(...VariableEventProps({ + element + })); + } + entries.push({ + id: 'conditionType', + component: ConditionType, + isEdited: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.isSelectEntryEdited + }); + const conditionType = getConditionType(element); + if (conditionType === 'script') { + entries.push(...ConditionScriptProps({ + element + })); + } else if (conditionType === 'expression') { + entries.push({ + id: 'conditionExpression', + component: ConditionExpression, + isEdited: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.isTextFieldEntryEdited + }); + } + return entries; +} +function ConditionType(props) { + const { + element + } = props; + const commandStack = useService('commandStack'); + const bpmnFactory = useService('bpmnFactory'); + const translate = useService('translate'); + const getValue = () => { + return getConditionType(element); + }; + const setValue = value => { + // (1) Remove formalExpression if is selected + if (value === '') { + updateCondition(element, commandStack, undefined); + } else { + // (2) Create and set formalExpression element containing the conditionExpression + const attributes = { + body: '', + language: value === 'script' ? '' : undefined + }; + const formalExpressionElement = createFormalExpression(element, attributes, bpmnFactory); + updateCondition(element, commandStack, formalExpressionElement); + } + }; + const getOptions = () => [{ + value: '', + label: translate('') + }, { + value: 'script', + label: translate('Script') + }, { + value: 'expression', + label: translate('Expression') + }]; + return (0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.SelectEntry, { + element: element, + id: "conditionType", + label: translate('Type'), + getValue: getValue, + setValue: setValue, + getOptions: getOptions + }); +} +function ConditionExpression(props) { + const { + element + } = props; + const commandStack = useService('commandStack'), + bpmnFactory = useService('bpmnFactory'), + translate = useService('translate'), + debounce = useService('debounceInput'); + const getValue = () => { + return getConditionExpression(element).get('body'); + }; + const setValue = value => { + const conditionExpression = createFormalExpression(element, { + body: value + }, bpmnFactory); + updateCondition(element, commandStack, conditionExpression); + }; + return (0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.TextFieldEntry, { + element: element, + id: "conditionExpression", + label: translate('Condition Expression'), + getValue: getValue, + setValue: setValue, + debounce: debounce + }); +} +function ConditionScriptProps(props) { + const { + element + } = props; + const entries = []; + const scriptType = getScriptType$1(element); + + // (1) language + entries.push({ + id: 'conditionScriptLanguage', + component: Language, + isEdited: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.isTextFieldEntryEdited + }); + + // (2) type + entries.push({ + id: 'conditionScriptType', + component: ScriptType, + isEdited: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.isSelectEntryEdited + }); + + // (3) script + if (scriptType === 'script') { + entries.push({ + id: 'conditionScriptValue', + component: Script$1, + isEdited: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.isTextAreaEntryEdited + }); + } else if (scriptType === 'resource') { + // (4) resource + entries.push({ + id: 'conditionScriptResource', + component: Resource$1, + isEdited: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.isTextFieldEntryEdited + }); + } + return entries; +} +function Language(props) { + const { + element + } = props; + const commandStack = useService('commandStack'); + const translate = useService('translate'); + const debounce = useService('debounceInput'); + const getValue = () => { + return getConditionExpression(element).get('language'); + }; + const setValue = value => { + commandStack.execute('element.updateModdleProperties', { + element: element, + moddleElement: getConditionExpression(element), + properties: { + language: value || '' + } + }); + }; + return (0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.TextFieldEntry, { + element: element, + id: "conditionScriptLanguage", + label: translate('Format'), + getValue: getValue, + setValue: setValue, + debounce: debounce + }); +} +function ScriptType(props) { + const { + element + } = props; + const commandStack = useService('commandStack'); + const translate = useService('translate'); + const getValue = () => { + return getScriptType$1(element); + }; + const setValue = value => { + // reset script properties on type change + const updatedProperties = { + 'body': value === 'script' ? '' : undefined, + 'camunda:resource': value === 'resource' ? '' : undefined + }; + commandStack.execute('element.updateModdleProperties', { + element: element, + moddleElement: getConditionExpression(element), + properties: updatedProperties + }); + }; + const getOptions = () => { + const options = [{ + value: 'resource', + label: translate('External resource') + }, { + value: 'script', + label: translate('Inline script') + }]; + return options; + }; + return (0,_bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.SelectEntry)({ + element, + id: 'conditionScriptType', + label: translate('Script type'), + getValue, + setValue, + getOptions + }); +} +function Script$1(props) { + const { + element + } = props; + const commandStack = useService('commandStack'); + const translate = useService('translate'); + const debounce = useService('debounceInput'); + const getValue = () => { + return getConditionExpression(element).get('body'); + }; + const setValue = value => { + commandStack.execute('element.updateModdleProperties', { + element: element, + moddleElement: getConditionExpression(element), + properties: { + 'body': value || '' + } + }); + }; + return (0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.TextAreaEntry, { + element: element, + id: "conditionScriptValue", + label: translate('Script'), + getValue: getValue, + setValue: setValue, + debounce: debounce, + monospace: true + }); +} +function Resource$1(props) { + const { + element + } = props; + const commandStack = useService('commandStack'); + const translate = useService('translate'); + const debounce = useService('debounceInput'); + const getValue = () => { + return getConditionExpression(element).get('camunda:resource'); + }; + const setValue = value => { + commandStack.execute('element.updateModdleProperties', { + element: element, + moddleElement: getConditionExpression(element), + properties: { + 'camunda:resource': value || '' + } + }); + }; + return (0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.TextFieldEntry, { + element: true, + id: "conditionScriptResource", + label: translate('Resource'), + getValue: getValue, + setValue: setValue, + debounce: debounce + }); +} +function VariableEventProps(props) { + const { + element + } = props; + const entries = []; + entries.push({ + id: 'conditionVariableName', + component: VariableName, + isEdited: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.isTextFieldEntryEdited + }); + if (!(0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.is)(element, 'bpmn:StartEvent') || isInEventSubProcess(element)) { + entries.push({ + id: 'conditionVariableEvents', + component: VariableEvents, + isEdited: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.isTextFieldEntryEdited + }); + } + return entries; +} +function VariableName(props) { + const { + element + } = props; + const commandStack = useService('commandStack'); + const translate = useService('translate'); + const debounce = useService('debounceInput'); + const getValue = () => { + return getConditionalEventDefinition(element).get('variableName'); + }; + const setValue = value => { + commandStack.execute('element.updateModdleProperties', { + element: element, + moddleElement: getConditionalEventDefinition(element), + properties: { + variableName: value || '' + } + }); + }; + return (0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.TextFieldEntry, { + element: element, + id: "conditionVariableName", + label: translate('Variable name'), + getValue: getValue, + setValue: setValue, + debounce: debounce + }); +} +function VariableEvents(props) { + const { + element + } = props; + const commandStack = useService('commandStack'); + const translate = useService('translate'); + const debounce = useService('debounceInput'); + const getValue = () => { + return getConditionalEventDefinition(element).get('variableEvents'); + }; + const setValue = value => { + commandStack.execute('element.updateModdleProperties', { + element: element, + moddleElement: getConditionalEventDefinition(element), + properties: { + variableEvents: value || '' + } + }); + }; + const tooltip = (0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("div", { + children: [(0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("p", { + children: translate('Specify more than one variable change event as a comma separated list. Variable change events are:') + }), (0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("ul", { + children: [(0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("li", { + children: (0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("code", { + children: "create" + }) + }), (0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("li", { + children: (0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("code", { + children: "update" + }) + }), (0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("li", { + children: (0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("code", { + children: "delete" + }) + })] + }), (0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("a", { + href: "https://docs.camunda.org/manual/latest/reference/bpmn20/custom-extensions/extension-attributes/#variableevents", + target: "_blank", + rel: "noopener", + children: translate('Documentation: Variable events') + })] + }); + return (0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.TextFieldEntry, { + element: element, + id: "conditionVariableEvents", + label: translate('Variable events'), + getValue: getValue, + setValue: setValue, + debounce: debounce, + tooltip: tooltip + }); +} + +// helper //////////////////// + +const CONDITIONAL_SOURCES = ['bpmn:Activity', 'bpmn:ExclusiveGateway', 'bpmn:InclusiveGateway', 'bpmn:ComplexGateway']; +function isConditionalSource(element) { + return (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.isAny)(element, CONDITIONAL_SOURCES); +} +function getConditionalEventDefinition(element) { + if (!(0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.is)(element, 'bpmn:Event')) { + return false; + } + return getEventDefinition$1(element, 'bpmn:ConditionalEventDefinition'); +} +function getConditionType(element) { + const conditionExpression = getConditionExpression(element); + if (!conditionExpression) { + return ''; + } else { + return conditionExpression.get('language') === undefined ? 'expression' : 'script'; + } +} + +/** + * getConditionExpression - get the body value of a condition expression for a given element + * + * @param {ModdleElement} element + * + * @return {string|undefined} + */ +function getConditionExpression(element) { + const businessObject = (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element); + if ((0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.is)(businessObject, 'bpmn:SequenceFlow')) { + return businessObject.get('conditionExpression'); + } else if (getConditionalEventDefinition(businessObject)) { + return getConditionalEventDefinition(businessObject).get('condition'); + } +} +function getScriptType$1(element) { + const conditionExpression = getConditionExpression(element); + const resource = conditionExpression.get('camunda:resource'); + if (typeof resource !== 'undefined') { + return 'resource'; + } else { + return 'script'; + } +} +function updateCondition(element, commandStack, condition = undefined) { + if ((0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.is)(element, 'bpmn:SequenceFlow')) { + commandStack.execute('element.updateProperties', { + element, + properties: { + conditionExpression: condition + } + }); + } else { + commandStack.execute('element.updateModdleProperties', { + element, + moddleElement: getConditionalEventDefinition(element), + properties: { + condition + } + }); + } +} +function createFormalExpression(parent, attributes, bpmnFactory) { + return createElement('bpmn:FormalExpression', attributes, (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.is)(parent, 'bpmn:SequenceFlow') ? (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(parent) : getConditionalEventDefinition(parent), bpmnFactory); +} +function isInEventSubProcess(element) { + const bo = (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element), + parent = bo.$parent; + return (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.is)(parent, 'bpmn:SubProcess') && parent.triggeredByEvent; +} + +/** + * Cf. https://docs.camunda.org/manual/latest/user-guide/process-engine/scripting/ + */ +function ScriptProps(props) { + const { + element, + script, + prefix + } = props; + const entries = []; + const scriptType = getScriptType(script || element); + const idPrefix = prefix || ''; + + // (1) scriptFormat + entries.push({ + id: idPrefix + 'scriptFormat', + component: Format, + isEdited: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.isTextFieldEntryEdited, + idPrefix, + script + }); + + // (2) type + entries.push({ + id: idPrefix + 'scriptType', + component: Type$3, + isEdited: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.isSelectEntryEdited, + idPrefix, + script + }); + + // (3) script + if (scriptType === 'script') { + entries.push({ + id: idPrefix + 'scriptValue', + component: Script, + isEdited: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.isTextAreaEntryEdited, + idPrefix, + script + }); + } + + // (4) resource + if (scriptType === 'resource') { + entries.push({ + id: idPrefix + 'scriptResource', + component: Resource, + isEdited: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.isTextFieldEntryEdited, + idPrefix, + script + }); + } + return entries; +} +function Format(props) { + const { + element, + idPrefix, + script + } = props; + const commandStack = useService('commandStack'); + const translate = useService('translate'); + const debounce = useService('debounceInput'); + const businessObject = script || (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element); + const getValue = () => { + return businessObject.get('scriptFormat'); + }; + const setValue = value => { + commandStack.execute('element.updateModdleProperties', { + element, + moddleElement: businessObject, + properties: { + scriptFormat: value + } + }); + }; + return (0,_bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.TextFieldEntry)({ + element, + id: idPrefix + 'scriptFormat', + label: translate('Format'), + getValue, + setValue, + debounce + }); +} +function Type$3(props) { + const { + element, + idPrefix, + script + } = props; + const commandStack = useService('commandStack'); + const translate = useService('translate'); + const businessObject = script || (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element); + const scriptProperty = getScriptProperty(businessObject); + const getValue = () => { + return getScriptType(businessObject); + }; + const setValue = value => { + // reset script properties on type change + const properties = { + [scriptProperty]: value === 'script' ? '' : undefined, + 'camunda:resource': value === 'resource' ? '' : undefined + }; + commandStack.execute('element.updateModdleProperties', { + element, + moddleElement: businessObject, + properties + }); + }; + const getOptions = () => { + const options = [{ + value: '', + label: translate('') + }, { + value: 'resource', + label: translate('External resource') + }, { + value: 'script', + label: translate('Inline script') + }]; + return options; + }; + return (0,_bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.SelectEntry)({ + element, + id: idPrefix + 'scriptType', + label: translate('Type'), + getValue, + setValue, + getOptions + }); +} +function Script(props) { + const { + element, + idPrefix, + script + } = props; + const commandStack = useService('commandStack'); + const translate = useService('translate'); + const debounce = useService('debounceInput'); + const businessObject = script || (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element); + const scriptProperty = getScriptProperty(businessObject); + const getValue = () => { + return getScriptValue(businessObject); + }; + const setValue = value => { + commandStack.execute('element.updateModdleProperties', { + element, + moddleElement: businessObject, + properties: { + [scriptProperty]: value || '' + } + }); + }; + return (0,_bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.TextAreaEntry)({ + element, + id: idPrefix + 'scriptValue', + label: translate('Script'), + getValue, + setValue, + debounce, + monospace: true + }); +} +function Resource(props) { + const { + element, + idPrefix, + script + } = props; + const commandStack = useService('commandStack'); + const translate = useService('translate'); + const debounce = useService('debounceInput'); + const businessObject = script || (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element); + const getValue = () => { + return businessObject.get('camunda:resource'); + }; + const setValue = value => { + commandStack.execute('element.updateModdleProperties', { + element, + moddleElement: businessObject, + properties: { + 'camunda:resource': value || '' + } + }); + }; + return (0,_bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.TextFieldEntry)({ + element, + id: idPrefix + 'scriptResource', + label: translate('Resource'), + getValue, + setValue, + debounce + }); +} + +// helper //////////////////// + +function getScriptType(element) { + const businessObject = (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element); + const scriptValue = getScriptValue(businessObject); + if (typeof scriptValue !== 'undefined') { + return 'script'; + } + const resource = businessObject.get('camunda:resource'); + if (typeof resource !== 'undefined') { + return 'resource'; + } +} +function getScriptValue(businessObject) { + return businessObject.get(getScriptProperty(businessObject)); +} +function isScript$2(element) { + return (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.is)(element, 'camunda:Script'); +} +function getScriptProperty(businessObject) { + return isScript$2(businessObject) ? 'value' : 'script'; +} + +function getElements(businessObject, type, property) { + const elements = getExtensionElementsList(businessObject, type); + return !property ? elements : (elements[0] || {})[property] || []; +} +function getParameters(element, prop) { + const inputOutput = getInputOutput(element); + return inputOutput && inputOutput.get(prop) || []; +} + +/** + * Get a camunda:inputOutput from the business object + * + * @param {djs.model.Base | ModdleElement} element + * + * @return {ModdleElement} the inputOutput object + */ +function getInputOutput(element) { + if ((0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.is)(element, 'camunda:Connector')) { + return element.get('inputOutput'); + } + const businessObject = (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element); + return (getElements(businessObject, 'camunda:InputOutput') || [])[0]; +} + +/** + * Return all input parameters existing in the business object, and + * an empty array if none exist. + * + * @param {djs.model.Base} element + * + * @return {Array} a list of input parameter objects + */ +function getInputParameters(element) { + return getParameters(element, 'inputParameters'); +} - function escapeHTML(str) { - str = '' + str; +/** + * Return all output parameters existing in the business object, and + * an empty array if none exist. + * + * @param {djs.model.Base} element + * + * @return {Array} a list of output parameter objects + */ +function getOutputParameters(element) { + return getParameters(element, 'outputParameters'); +} +function isInputOutputSupported(element) { + const businessObject = (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element); + return (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.is)(businessObject, 'bpmn:FlowNode') && !((0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.isAny)(businessObject, ['bpmn:StartEvent', 'bpmn:BoundaryEvent', 'bpmn:Gateway']) || (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.is)(businessObject, 'bpmn:SubProcess') && businessObject.get('triggeredByEvent')); +} +function areInputParametersSupported(element) { + return isInputOutputSupported(element); +} +function areOutputParametersSupported(element) { + const businessObject = (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element); + return isInputOutputSupported(element) && !(0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.is)(businessObject, 'bpmn:EndEvent') && !businessObject.loopCharacteristics; +} +function getInputOutputType(parameter) { + const definitionTypes = { + 'camunda:Map': 'map', + 'camunda:List': 'list', + 'camunda:Script': 'script' + }; + let type = 'stringOrExpression'; + const definition = parameter.get('definition'); + if (typeof definition !== 'undefined') { + type = definitionTypes[definition.$type]; + } + return type; +} +function CreateParameterCmd(element, type, parent, bpmnFactory) { + const isInput = type === 'camunda:InputParameter'; + const newParameter = createElement(type, { + name: nextId(isInput ? 'Input_' : 'Output_') + }, parent, bpmnFactory); + const propertyName = isInput ? 'inputParameters' : 'outputParameters'; + return { + cmd: 'element.updateModdleProperties', + context: { + element, + moddleElement: parent, + properties: { + [propertyName]: [...parent.get(propertyName), newParameter] + } + } + }; +} +function AddParameterCmd(element, type, bpmnFactory) { + const commands = []; + const businessObject = (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element); + let extensionElements = businessObject.get('extensionElements'); + + // (1) ensure extension elements + if (!extensionElements) { + extensionElements = createElement('bpmn:ExtensionElements', { + values: [] + }, businessObject, bpmnFactory); + commands.push({ + cmd: 'element.updateModdleProperties', + context: { + element, + moddleElement: businessObject, + properties: { + extensionElements + } + } + }); + } + + // (2) ensure inputOutput + let inputOutput = getInputOutput(element); + if (!inputOutput) { + const parent = extensionElements; + inputOutput = createElement('camunda:InputOutput', { + inputParameters: [], + outputParameters: [] + }, parent, bpmnFactory); + commands.push({ + cmd: 'element.updateModdleProperties', + context: { + element, + moddleElement: extensionElements, + properties: { + values: [...extensionElements.get('values'), inputOutput] + } + } + }); + } + + // (3) create + add parameter + commands.push(CreateParameterCmd(element, type, inputOutput, bpmnFactory)); + return commands; +} + +function ListProp(props) { + const { + element, + id: idPrefix, + index, + item + } = props; + const id = `${idPrefix}-listItem-${index}`; + return (0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(ListItem, { + idPrefix: id, + element: element, + item: item + }); +} +function ListProps(props) { + const { + idPrefix, + element, + parameter + } = props; + const bpmnFactory = useService('bpmnFactory'); + const commandStack = useService('commandStack'); + const translate = useService('translate'); + const list = parameter.get('definition'); + const items = list.get('items'); + function addItem() { + const value = createElement('camunda:Value', {}, parameter, bpmnFactory); + commandStack.execute('element.updateModdleProperties', { + element, + moddleElement: list, + properties: { + items: [...list.get('items'), value] + } + }); + } + function removeItem(item) { + commandStack.execute('element.updateModdleProperties', { + element, + moddleElement: list, + properties: { + items: (0,min_dash__WEBPACK_IMPORTED_MODULE_12__.without)(list.get('items'), item) + } + }); + } + function compareFn(item, anotherItem) { + const [value = '', anotherValue = ''] = [item.value, anotherItem.value]; + return value === anotherValue ? 0 : value > anotherValue ? 1 : -1; + } + return (0,_bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.ListEntry)({ + element, + autoFocusEntry: true, + compareFn, + id: idPrefix + '-list', + items, + label: translate('List values'), + onAdd: addItem, + onRemove: removeItem, + component: ListProp + }); +} +function ListItem(props) { + const { + idPrefix, + element, + item + } = props; + const commandStack = useService('commandStack'); + const translate = useService('translate'); + const definitionLabels = { + 'camunda:Map': translate('Map'), + 'camunda:List': translate('List'), + 'camunda:Script': translate('Script') + }; + const getValue = () => { + if (isDefinitionType$1(item)) { + return definitionLabels[item.$type]; + } + return item.get('value'); + }; + const setValue = value => { + commandStack.execute('element.updateModdleProperties', { + element, + moddleElement: item, + properties: { + value + } + }); + }; + return ListValue({ + id: idPrefix + '-value', + disabled: isDefinitionType$1(item), + getValue, + setValue + }); +} +function ListValue(props) { + const { + id, + disabled, + getValue, + setValue + } = props; + const debounce = useService('debounceInput', true); + return (0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.SimpleEntry, { + id: id, + getValue: getValue, + setValue: setValue, + disabled: disabled, + debounce: debounce + }); +} + +// helper ////////////////////// + +function isScript$1(element) { + return (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.is)(element, 'camunda:Script'); +} +function isList$1(element) { + return (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.is)(element, 'camunda:List'); +} +function isMap$1(element) { + return (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.is)(element, 'camunda:Map'); +} +function isDefinitionType$1(element) { + return isScript$1(element) || isList$1(element) || isMap$1(element); +} + +function MapProp(props) { + const { + element, + id: idPrefix, + index, + item: entry, + open + } = props; + const id = `${idPrefix}-mapEntry-${index}`; + const translate = useService('translate'); + return (0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.CollapsibleEntry, { + id: id, + element: element, + entries: MapEntry({ + element, + entry, + idPrefix: id + }), + label: entry.get('key') || translate(''), + open: open + }); +} +function MapProps(props) { + const { + idPrefix, + element, + parameter + } = props; + const bpmnFactory = useService('bpmnFactory'); + const commandStack = useService('commandStack'); + const translate = useService('translate'); + const map = parameter.get('definition'); + const entries = map.get('entries'); + function addEntry() { + const entry = createElement('camunda:Entry', {}, parameter, bpmnFactory); + commandStack.execute('element.updateModdleProperties', { + element, + moddleElement: map, + properties: { + entries: [...map.get('entries'), entry] + } + }); + } + function removeEntry(entry) { + commandStack.execute('element.updateModdleProperties', { + element, + moddleElement: map, + properties: { + entries: (0,min_dash__WEBPACK_IMPORTED_MODULE_12__.without)(map.get('entries'), entry) + } + }); + } + function compareFn(entry, anotherEntry) { + const [key = '', anotherKey = ''] = [entry.key, anotherEntry.key]; + return key === anotherKey ? 0 : key > anotherKey ? 1 : -1; + } + return (0,_bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.ListEntry)({ + element, + autoFocusEntry: true, + compareFn, + id: idPrefix + '-map', + items: entries, + label: translate('Map entries'), + onAdd: addEntry, + onRemove: removeEntry, + component: MapProp + }); +} +function MapEntry(props) { + const { + element, + entry, + idPrefix + } = props; + const entries = [{ + id: idPrefix + '-key', + component: MapKey, + entry, + idPrefix, + element + }, { + id: idPrefix + '-value', + component: MapValue, + entry, + idPrefix, + element + }]; + return entries; +} +function MapKey(props) { + const { + element, + entry, + idPrefix + } = props; + const commandStack = useService('commandStack'); + const translate = useService('translate'); + const debounce = useService('debounceInput'); + const setValue = value => { + commandStack.execute('element.updateModdleProperties', { + element, + moddleElement: entry, + properties: { + key: value + } + }); + }; + const getValue = () => { + return entry.get('key'); + }; + return (0,_bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.TextFieldEntry)({ + element: entry, + id: idPrefix + '-key', + label: translate('Key'), + getValue, + setValue, + debounce + }); +} +function MapValue(props) { + const { + element, + entry, + idPrefix + } = props; + const commandStack = useService('commandStack'); + const translate = useService('translate'); + const debounce = useService('debounceInput'); + const definition = entry.get('definition'); + const definitionLabels = { + 'camunda:Map': translate('Map'), + 'camunda:List': translate('List'), + 'camunda:Script': translate('Script') + }; + const setValue = value => { + commandStack.execute('element.updateModdleProperties', { + element, + moddleElement: entry, + properties: { + value + } + }); + }; + const getValue = () => { + if (isDefinitionType(definition)) { + return definitionLabels[definition.$type]; + } + return entry.get('value'); + }; + return (0,_bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.TextFieldEntry)({ + element: entry, + id: idPrefix + '-value', + label: translate('Value'), + getValue, + setValue, + disabled: isDefinitionType(definition), + debounce + }); +} + +// helper /////////////////// + +function isScript(element) { + return (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.is)(element, 'camunda:Script'); +} +function isList(element) { + return (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.is)(element, 'camunda:List'); +} +function isMap(element) { + return (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.is)(element, 'camunda:Map'); +} +function isDefinitionType(element) { + return isScript(element) || isList(element) || isMap(element); +} + +const DEFAULT_PROPS$3 = { + value: undefined, + definition: undefined +}; +function InputOutputParameter(props) { + const { + idPrefix, + element, + parameter + } = props; + const inputOutputType = getInputOutputType(parameter); + let entries = [{ + id: idPrefix + '-name', + component: Name$2, + isEdited: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.isTextFieldEntryEdited, + idPrefix, + parameter + }, { + id: idPrefix + '-type', + component: Type$2, + isEdited: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.isSelectEntryEdited, + idPrefix, + parameter + }]; + + // (1) String or expression + if (inputOutputType === 'stringOrExpression') { + entries.push({ + id: idPrefix + '-stringOrExpression', + component: StringOrExpression, + isEdited: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.isTextAreaEntryEdited, + idPrefix, + parameter + }); + + // (2) Script + } else if (inputOutputType === 'script') { + const script = parameter.get('definition'); + entries = [...entries, ...ScriptProps({ + element, + prefix: idPrefix + '-', + script + })]; + + // (3) List + } else if (inputOutputType === 'list') { + entries.push({ + id: `${idPrefix}-list`, + component: ListProps, + idPrefix, + parameter + }); + + // (4) Map + } else if (inputOutputType === 'map') { + entries.push({ + id: `${idPrefix}-map`, + component: MapProps, + idPrefix, + parameter + }); + } + return entries; +} +function Name$2(props) { + const { + idPrefix, + element, + parameter + } = props; + const commandStack = useService('commandStack'); + const translate = useService('translate'); + const debounce = useService('debounceInput'); + const setValue = value => { + commandStack.execute('element.updateModdleProperties', { + element, + moddleElement: parameter, + properties: { + name: value + } + }); + }; + const getValue = parameter => { + return parameter.get('name'); + }; + return (0,_bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.TextFieldEntry)({ + element: parameter, + id: idPrefix + '-name', + label: translate(isInput(parameter) ? 'Local variable name' : 'Process variable name'), + getValue, + setValue, + debounce + }); +} +function Type$2(props) { + const { + idPrefix, + element, + parameter + } = props; + const bpmnFactory = useService('bpmnFactory'); + const commandStack = useService('commandStack'); + const translate = useService('translate'); + const createDefinitionElement = type => { + return createElement(type, {}, parameter, bpmnFactory); + }; + const getValue = mapping => { + return getInputOutputType(mapping); + }; + const setValue = value => { + let properties = { + ...DEFAULT_PROPS$3 + }; + if (value === 'script') { + properties.definition = createDefinitionElement('camunda:Script'); + } else if (value === 'list') { + properties.definition = createDefinitionElement('camunda:List'); + } else if (value === 'map') { + properties.definition = createDefinitionElement('camunda:Map'); + } + commandStack.execute('element.updateModdleProperties', { + element, + moddleElement: parameter, + properties + }); + }; + const getOptions = () => { + const options = [{ + label: translate('List'), + value: 'list' + }, { + label: translate('Map'), + value: 'map' + }, { + label: translate('Script'), + value: 'script' + }, { + label: translate('String or expression'), + value: 'stringOrExpression' + }]; + return options; + }; + return (0,_bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.SelectEntry)({ + element: parameter, + id: idPrefix + '-type', + label: translate('Assignment type'), + getValue, + setValue, + getOptions + }); +} +function StringOrExpression(props) { + const { + idPrefix, + element, + parameter + } = props; + const commandStack = useService('commandStack'); + const translate = useService('translate'); + const debounce = useService('debounceInput'); + const setValue = value => { + commandStack.execute('element.updateModdleProperties', { + element, + moddleElement: parameter, + properties: { + value + } + }); + }; + const getValue = parameter => { + return parameter.get('value'); + }; + return (0,_bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.TextAreaEntry)({ + element: parameter, + id: idPrefix + '-stringOrExpression', + label: translate('Value'), + description: translate('Start typing "${}" to create an expression.'), + getValue, + setValue, + rows: 1, + debounce + }); +} + +// helper ///////////////////// + +function isInput(parameter) { + return (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.is)(parameter, 'camunda:InputParameter'); +} + +/** + * Check whether an element is camunda:ServiceTaskLike + * + * @param {djs.model.Base} element + * + * @return {boolean} a boolean value + */ +function isServiceTaskLike(element) { + return (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.is)(element, 'camunda:ServiceTaskLike'); +} - return str && str.replace(/[&<>"']/g, function(match) { - return HTML_ESCAPE_MAP[match]; - }); - } +/** + * Returns 'true' if the given element is 'camunda:DmnCapable' + * + * @param {djs.model.Base} element + * + * @return {boolean} a boolean value + */ +function isDmnCapable(element) { + return (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.is)(element, 'camunda:DmnCapable'); +} - module.exports.escapeHTML = escapeHTML; +/** + * Returns 'true' if the given element is 'camunda:ExternalCapable' + * + * @param {djs.model.Base} element + * + * @return {boolean} a boolean value + */ +function isExternalCapable(element) { + return (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.is)(element, 'camunda:ExternalCapable'); +} - },{"bpmn-js/lib/util/ModelUtil":240,"ids":437,"lodash/forEach":613,"min-dom":647}],6:[function(require,module,exports){ - 'use strict'; +/** + * getServiceTaskLikeBusinessObject - Get a 'camunda:ServiceTaskLike' business object. + * + * If the given element is not a 'camunda:ServiceTaskLike', then 'false' + * is returned. + * + * @param {djs.model.Base} element + * @return {ModdleElement} the 'camunda:ServiceTaskLike' business object + */ +function getServiceTaskLikeBusinessObject(element) { + if ((0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.is)(element, 'bpmn:IntermediateThrowEvent') || (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.is)(element, 'bpmn:EndEvent')) { + // change business object to 'messageEventDefinition' when + // the element is a message intermediate throw event or message end event + // because the camunda extensions (e.g. camunda:class) are in the message + // event definition tag and not in the intermediate throw event or end event tag + const messageEventDefinition = getMessageEventDefinition(element); + if (messageEventDefinition) { + element = messageEventDefinition; + } + } + return isServiceTaskLike(element) && (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element); +} + +/** + * Returns the implementation type of the given element. + * + * Possible implementation types are: + * - dmn + * - connector + * - external + * - class + * - expression + * - delegateExpression + * - script + * - or undefined, when no matching implementation type is found + * + * @param {djs.model.Base} element + * + * @return {String} the implementation type + */ +function getImplementationType(element) { + const businessObject = getListenerBusinessObject(element) || getServiceTaskLikeBusinessObject(element); + if (!businessObject) { + return; + } + if (isDmnCapable(businessObject)) { + const decisionRef = businessObject.get('camunda:decisionRef'); + if (typeof decisionRef !== 'undefined') { + return 'dmn'; + } + } + if (isServiceTaskLike(businessObject)) { + const connectors = getExtensionElementsList(businessObject, 'camunda:Connector'); + if (connectors.length) { + return 'connector'; + } + } + if (isExternalCapable(businessObject)) { + const type = businessObject.get('camunda:type'); + if (type === 'external') { + return 'external'; + } + } + const cls = businessObject.get('camunda:class'); + if (typeof cls !== 'undefined') { + return 'class'; + } + const expression = businessObject.get('camunda:expression'); + if (typeof expression !== 'undefined') { + return 'expression'; + } + const delegateExpression = businessObject.get('camunda:delegateExpression'); + if (typeof delegateExpression !== 'undefined') { + return 'delegateExpression'; + } + const script = businessObject.get('script'); + if (typeof script !== 'undefined') { + return 'script'; + } +} +function getListenerBusinessObject(businessObject) { + if ((0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.isAny)(businessObject, ['camunda:ExecutionListener', 'camunda:TaskListener'])) { + return businessObject; + } +} + +function areConnectorsSupported(element) { + const businessObject = getServiceTaskLikeBusinessObject(element); + return businessObject && getImplementationType(businessObject) === 'connector'; +} +function getConnectors$2(businessObject) { + return getExtensionElementsList(businessObject, 'camunda:Connector'); +} +function getConnector$1(element) { + const businessObject = getServiceTaskLikeBusinessObject(element); + const connectors = getConnectors$2(businessObject); + return connectors[0]; +} + +function ConnectorInputProps(props) { + const { + element, + injector + } = props; + if (!areConnectorsSupported(element)) { + return null; + } + const connector = getConnector$1(element); + const commandStack = injector.get('commandStack'), + bpmnFactory = injector.get('bpmnFactory'); + const inputParameters = getInputParameters(connector) || []; + const items = inputParameters.map((parameter, index) => { + const id = element.id + '-connector-inputParameter-' + index; + return { + id, + label: parameter.get('name') || '', + entries: InputOutputParameter({ + element, + idPrefix: id, + parameter + }), + autoFocusEntry: id + '-name', + remove: removeFactory$8({ + connector, + element, + parameter, + commandStack + }) + }; + }); + function add(event) { + event.stopPropagation(); + const commands = []; + + // (1) ensure inputOutput + let inputOutput = getInputOutput(connector); + if (!inputOutput) { + inputOutput = createElement('camunda:InputOutput', { + inputParameters: [], + outputParameters: [] + }, connector, bpmnFactory); + commands.push({ + cmd: 'element.updateModdleProperties', + context: { + element: element, + moddleElement: connector, + properties: { + inputOutput + } + } + }); + } + + // (2) create + add parameter + commands.push(CreateParameterCmd(element, 'camunda:InputParameter', inputOutput, bpmnFactory)); + + // (3) commit all updates + commandStack.execute('properties-panel.multi-command-executor', commands); + } + return { + items, + add + }; +} +function removeFactory$8(props) { + const { + commandStack, + connector, + element, + parameter + } = props; + return function (event) { + event.stopPropagation(); + const inputOutput = getInputOutput(connector); + if (!inputOutput) { + return; + } + commandStack.execute('element.updateModdleProperties', { + element: element, + moddleElement: inputOutput, + properties: { + inputParameters: (0,min_dash__WEBPACK_IMPORTED_MODULE_12__.without)(inputOutput.get('inputParameters'), parameter) + } + }); + }; +} + +function ConnectorOutputProps(props) { + const { + element, + injector + } = props; + if (!areConnectorsSupported(element)) { + return null; + } + const connector = getConnector$1(element); + const commandStack = injector.get('commandStack'), + bpmnFactory = injector.get('bpmnFactory'); + const outputParameters = getOutputParameters(connector) || []; + const items = outputParameters.map((parameter, index) => { + const id = element.id + '-connector-outputParameter-' + index; + return { + id, + label: parameter.get('name') || '', + entries: InputOutputParameter({ + idPrefix: id, + element, + parameter + }), + autoFocusEntry: id + '-name', + remove: removeFactory$7({ + connector, + element, + commandStack, + parameter + }) + }; + }); + function add(event) { + event.stopPropagation(); + const commands = []; + + // (1) ensure inputOutput + let inputOutput = getInputOutput(connector); + if (!inputOutput) { + inputOutput = createElement('camunda:InputOutput', { + inputParameters: [], + outputParameters: [] + }, connector, bpmnFactory); + commands.push({ + cmd: 'element.updateModdleProperties', + context: { + element: element, + moddleElement: connector, + properties: { + inputOutput + } + } + }); + } + + // (2) create + add parameter + commands.push(CreateParameterCmd(element, 'camunda:OutputParameter', inputOutput, bpmnFactory)); + + // (3) commit all updates + commandStack.execute('properties-panel.multi-command-executor', commands); + } + return { + items, + add + }; +} +function removeFactory$7(props) { + const { + commandStack, + connector, + element, + parameter + } = props; + return function (event) { + event.stopPropagation(); + const inputOutput = getInputOutput(connector); + if (!inputOutput) { + return; + } + commandStack.execute('element.updateModdleProperties', { + element: element, + moddleElement: inputOutput, + properties: { + outputParameters: (0,min_dash__WEBPACK_IMPORTED_MODULE_12__.without)(inputOutput.get('outputParameters'), parameter) + } + }); + }; +} + +function ErrorProps(props) { + const { + element, + entries + } = props; + if (!isErrorSupported(element)) { + return entries; + } + const error = getError(element); + + // (1) errorMessage (error) + if (error) { + const idx = findPlaceToInsert(entries, 'errorCode'); + + // place below errorCode + entries.splice(idx, 0, { + id: 'errorMessage', + component: ErrorMessage$1, + isEdited: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.isTextFieldEntryEdited + }); + } + if (!canHaveErrorVariables(element)) { + return entries; + } + + // (2) errorCodeVariable + errorMessageVariable (errorEventDefinition) + entries.push({ + id: 'errorCodeVariable', + component: ErrorCodeVariable, + isEdited: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.isTextFieldEntryEdited + }, { + id: 'errorMessageVariable', + component: ErrorMessageVariable, + isEdited: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.isTextFieldEntryEdited + }); + return entries; +} +function ErrorMessage$1(props) { + const { + element + } = props; + const commandStack = useService('commandStack'); + const translate = useService('translate'); + const debounce = useService('debounceInput'); + const error = getError(element); + const getValue = () => { + return error.get('camunda:errorMessage'); + }; + const setValue = value => { + return commandStack.execute('element.updateModdleProperties', { + element, + moddleElement: error, + properties: { + 'camunda:errorMessage': value + } + }); + }; + return (0,_bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.TextFieldEntry)({ + element, + id: 'errorMessage', + label: translate('Message'), + getValue, + setValue, + debounce + }); +} +function ErrorCodeVariable(props) { + const { + element + } = props; + const commandStack = useService('commandStack'); + const translate = useService('translate'); + const debounce = useService('debounceInput'); + const errorEventDefinition = getErrorEventDefinition(element); + const getValue = () => { + return errorEventDefinition.get('camunda:errorCodeVariable'); + }; + const setValue = value => { + return commandStack.execute('element.updateModdleProperties', { + element, + moddleElement: errorEventDefinition, + properties: { + 'camunda:errorCodeVariable': value + } + }); + }; + return (0,_bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.TextFieldEntry)({ + element, + id: 'errorCodeVariable', + label: translate('Code variable'), + description: translate('Define the name of the variable that will contain the error code.'), + getValue, + setValue, + debounce + }); +} +function ErrorMessageVariable(props) { + const { + element + } = props; + const commandStack = useService('commandStack'); + const translate = useService('translate'); + const debounce = useService('debounceInput'); + const errorEventDefinition = getErrorEventDefinition(element); + const getValue = () => { + return errorEventDefinition.get('camunda:errorMessageVariable'); + }; + const setValue = value => { + return commandStack.execute('element.updateModdleProperties', { + element, + moddleElement: errorEventDefinition, + properties: { + 'camunda:errorMessageVariable': value + } + }); + }; + return (0,_bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.TextFieldEntry)({ + element, + id: 'errorMessageVariable', + label: translate('Message variable'), + description: translate('Define the name of the variable that will contain the error message.'), + getValue, + setValue, + debounce + }); +} + +// helper /////////////////////// + +function canHaveErrorVariables(element) { + return (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.is)(element, 'bpmn:StartEvent') || (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.is)(element, 'bpmn:BoundaryEvent'); +} +function findPlaceToInsert(entries, idx) { + const entryIndex = (0,min_dash__WEBPACK_IMPORTED_MODULE_12__.findIndex)(entries, entry => entry.id === idx); + return entryIndex >= 0 ? entryIndex + 1 : entries.length; +} + +const EMPTY_OPTION = ''; +const CREATE_NEW_OPTION = 'create-new'; +function Error$1(props) { + const { + idPrefix, + errorEventDefinition + } = props; + let entries = [{ + id: idPrefix + '-errorRef', + component: ErrorRef, + isEdited: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.isSelectEntryEdited, + errorEventDefinition, + idPrefix + }]; + const error = errorEventDefinition.get('errorRef'); + if (error) { + entries = [...entries, { + id: idPrefix + '-errorName', + component: ErrorName, + isEdited: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.isTextFieldEntryEdited, + error, + errorEventDefinition, + idPrefix + }, { + id: idPrefix + '-errorCode', + component: ErrorCode, + isEdited: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.isTextFieldEntryEdited, + error, + errorEventDefinition, + idPrefix + }, { + id: idPrefix + '-errorMessage', + component: ErrorMessage, + isEdited: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.isTextFieldEntryEdited, + error, + errorEventDefinition, + idPrefix + }]; + } + entries.push({ + id: idPrefix + '-expression', + component: Expression$1, + errorEventDefinition, + idPrefix + }); + return entries; +} +function ErrorRef(props) { + const { + element, + errorEventDefinition, + idPrefix + } = props; + const bpmnFactory = useService('bpmnFactory'); + const commandStack = useService('commandStack'); + const translate = useService('translate'); + const businessObject = (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element); + const getValue = () => { + const error = errorEventDefinition.get('errorRef'); + if (error) { + return error.get('id'); + } + return EMPTY_OPTION; + }; + const setValue = value => { + const root = getRoot(businessObject); + const commands = []; + let error; + + // (1) create new error + if (value === CREATE_NEW_OPTION) { + error = createElement('bpmn:Error', { + name: nextId('Error_') + }, root, bpmnFactory); + value = error.get('id'); + commands.push({ + cmd: 'element.updateModdleProperties', + context: { + element, + moddleElement: root, + properties: { + rootElements: [...root.get('rootElements'), error] + } + } + }); + } + + // (2) update (or remove) errorRef + error = error || findRootElementById(businessObject, 'bpmn:Error', value); + commands.push({ + cmd: 'element.updateModdleProperties', + context: { + element, + moddleElement: errorEventDefinition, + properties: { + errorRef: error + } + } + }); + + // (3) commit all updates + return commandStack.execute('properties-panel.multi-command-executor', commands); + }; + const getOptions = () => { + let options = [{ + value: EMPTY_OPTION, + label: translate('') + }, { + value: CREATE_NEW_OPTION, + label: translate('Create new ...') + }]; + const errors = findRootElementsByType((0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element), 'bpmn:Error'); + sortByName$1(errors).forEach(error => { + options.push({ + value: error.get('id'), + label: error.get('name') || error.get('id') + }); + }); + return options; + }; + return ReferenceSelectEntry({ + element, + id: idPrefix + '-errorRef', + label: translate('Global error reference'), + autoFocusEntry: idPrefix + '-errorName', + getValue, + setValue, + getOptions + }); +} +function ErrorName(props) { + const { + element, + error, + idPrefix + } = props; + const commandStack = useService('commandStack'); + const translate = useService('translate'); + const debounce = useService('debounceInput'); + const getValue = () => { + return error.get('name'); + }; + const setValue = value => { + return commandStack.execute('element.updateModdleProperties', { + element, + moddleElement: error, + properties: { + name: value + } + }); + }; + return (0,_bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.TextFieldEntry)({ + element, + id: idPrefix + '-errorName', + label: translate('Name'), + getValue, + setValue, + debounce + }); +} +function ErrorCode(props) { + const { + element, + error, + idPrefix + } = props; + const commandStack = useService('commandStack'); + const translate = useService('translate'); + const debounce = useService('debounceInput'); + const getValue = () => { + return error.get('errorCode'); + }; + const setValue = value => { + return commandStack.execute('element.updateModdleProperties', { + element, + moddleElement: error, + properties: { + errorCode: value + } + }); + }; + return (0,_bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.TextFieldEntry)({ + element, + id: idPrefix + '-errorCode', + label: translate('Code'), + getValue, + setValue, + debounce + }); +} +function ErrorMessage(props) { + const { + element, + error, + idPrefix + } = props; + const commandStack = useService('commandStack'); + const translate = useService('translate'); + const debounce = useService('debounceInput'); + const getValue = () => { + return error.get('errorMessage'); + }; + const setValue = value => { + return commandStack.execute('element.updateModdleProperties', { + element, + moddleElement: error, + properties: { + errorMessage: value + } + }); + }; + return (0,_bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.TextFieldEntry)({ + element, + id: idPrefix + '-errorMessage', + label: translate('Message'), + getValue, + setValue, + debounce + }); +} +function Expression$1(props) { + const { + element, + errorEventDefinition, + idPrefix + } = props; + const commandStack = useService('commandStack'); + const translate = useService('translate'); + const debounce = useService('debounceInput'); + const setValue = value => { + commandStack.execute('element.updateModdleProperties', { + element, + moddleElement: errorEventDefinition, + properties: { + 'camunda:expression': value + } + }); + }; + const getValue = () => { + return errorEventDefinition.get('camunda:expression'); + }; + return (0,_bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.TextFieldEntry)({ + element: errorEventDefinition, + id: idPrefix + '-expression', + label: translate('Throw expression'), + getValue, + setValue, + debounce + }); +} + +// helpers ////////// + +function sortByName$1(elements) { + return (0,min_dash__WEBPACK_IMPORTED_MODULE_12__.sortBy)(elements, e => (e.name || '').toLowerCase()); +} + +function ErrorsProps({ + element, + injector +}) { + const businessObject = (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element); + if (!(0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.is)(element, 'bpmn:ServiceTask') || getImplementationType(element) !== 'external') { + return null; + } + const errorEventDefinitions = getExtensionElementsList(businessObject, 'camunda:ErrorEventDefinition'); + const bpmnFactory = injector.get('bpmnFactory'), + commandStack = injector.get('commandStack'); + const items = errorEventDefinitions.map((errorEventDefinition, index) => { + const id = element.id + '-error-' + index; + return { + id, + label: getErrorLabel(errorEventDefinition), + entries: Error$1({ + idPrefix: id, + element, + errorEventDefinition + }), + autoFocusEntry: id + '-errorRef', + remove: removeFactory$6({ + commandStack, + element, + errorEventDefinition + }) + }; + }); + return { + items, + add: addFactory$5({ + bpmnFactory, + commandStack, + element + }), + shouldSort: false + }; +} +function removeFactory$6({ + commandStack, + element, + errorEventDefinition +}) { + return function (event) { + event.stopPropagation(); + const businessObject = (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element); + removeExtensionElements(element, businessObject, errorEventDefinition, commandStack); + }; +} +function addFactory$5({ + bpmnFactory, + commandStack, + element +}) { + return function (event) { + event.stopPropagation(); + const businessObject = (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element); + const error = createElement('camunda:ErrorEventDefinition', {}, undefined, bpmnFactory); + addExtensionElements(element, businessObject, error, bpmnFactory, commandStack); + }; +} + +// helpers ////////// + +function getErrorLabel(errorEventDefinition) { + const error = errorEventDefinition.get('errorRef'); + if (!error) { + return ''; + } + const errorCode = error.get('errorCode'), + name = error.get('name') || ''; + if (errorCode) { + return `${name} (code = ${errorCode})`; + } + return name; +} + +/** + * @typedef { import('@bpmn-io/properties-panel').EntryDefinition } Entry + */ - var elementHelper = require('../helper/ElementHelper'); +/** + * @returns {Array} entries + */ +function EscalationProps(props) { + const { + element, + entries + } = props; + if (!(isEscalationSupported(element) && canHaveEscalationVariables(element))) { + return entries; + } + entries.push({ + id: 'escalationCodeVariable', + component: EscalationCodeVariable, + isEdited: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.isTextFieldEntryEdited + }); + return entries; +} +function EscalationCodeVariable(props) { + const { + element + } = props; + const commandStack = useService('commandStack'); + const translate = useService('translate'); + const debounce = useService('debounceInput'); + const escalationEventDefinition = getEscalationEventDefinition(element); + const getValue = () => { + return escalationEventDefinition.get('camunda:escalationCodeVariable'); + }; + const setValue = value => { + return commandStack.execute('element.updateModdleProperties', { + element, + moddleElement: escalationEventDefinition, + properties: { + 'camunda:escalationCodeVariable': value + } + }); + }; + return (0,_bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.TextFieldEntry)({ + element, + id: 'escalationCodeVariable', + label: translate('Code variable'), + description: translate('Define the name of the variable that will contain the escalation code.'), + getValue, + setValue, + debounce + }); +} + +// helper /////////////////////// + +function canHaveEscalationVariables(element) { + return (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.is)(element, 'bpmn:StartEvent') || (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.is)(element, 'bpmn:BoundaryEvent'); +} + +function ExternalTaskPriorityProps(props) { + const { + element + } = props; + const businessObject = (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element); + if (!(0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.is)(element, 'bpmn:Process') && !((0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.is)(element, 'bpmn:Participant') && businessObject.get('processRef')) && !isExternalTaskLike(element)) { + return []; + } + return [{ + id: 'externalTaskPriority', + component: ExternalTaskPriority, + isEdited: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.isTextFieldEntryEdited + }]; +} +function ExternalTaskPriority(props) { + const { + element + } = props; + const commandStack = useService('commandStack'), + translate = useService('translate'), + debounce = useService('debounceInput'); + let businessObject; + if ((0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.is)(element, 'bpmn:Participant')) { + businessObject = (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element).get('processRef'); + } else if (isExternalTaskLike(element)) { + businessObject = getServiceTaskLikeBusinessObject(element); + } else { + businessObject = (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element); + } + const getValue = () => { + return businessObject.get('camunda:taskPriority'); + }; + const setValue = value => { + commandStack.execute('element.updateModdleProperties', { + element, + moddleElement: businessObject, + properties: { + 'camunda:taskPriority': value + } + }); + }; + return (0,_bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.TextFieldEntry)({ + element, + id: 'externalTaskPriority', + label: translate('Priority'), + getValue, + setValue, + debounce + }); +} + +// helper ////////////////// + +function isExternalTaskLike(element) { + const bo = getServiceTaskLikeBusinessObject(element), + type = bo && bo.get('camunda:type'); + return (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.is)(bo, 'camunda:ServiceTaskLike') && type && type === 'external'; +} + +const DEFAULT_PROPS$2 = { + 'stringValue': undefined, + 'string': undefined, + 'expression': undefined +}; +function FieldInjection(props) { + const { + element, + idPrefix, + field + } = props; + const entries = [{ + id: idPrefix + '-name', + component: NameProperty, + field, + idPrefix, + element + }, { + id: idPrefix + '-type', + component: TypeProperty, + field, + idPrefix, + element + }, { + id: idPrefix + '-value', + component: ValueProperty, + field, + idPrefix, + element + }]; + return entries; +} +function NameProperty(props) { + const { + idPrefix, + element, + field + } = props; + const commandStack = useService('commandStack'), + translate = useService('translate'), + debounce = useService('debounceInput'); + const setValue = value => { + commandStack.execute('element.updateModdleProperties', { + element, + moddleElement: field, + properties: { + name: value + } + }); + }; + const getValue = field => { + return field.name; + }; + return (0,_bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.TextFieldEntry)({ + element: field, + id: idPrefix + '-name', + label: translate('Name'), + getValue, + setValue, + debounce + }); +} +function TypeProperty(props) { + const { + idPrefix, + element, + field + } = props; + const commandStack = useService('commandStack'), + translate = useService('translate'); + const getValue = field => { + return determineType(field); + }; + const setValue = value => { + const properties = Object.assign({}, DEFAULT_PROPS$2); + properties[value] = ''; + commandStack.execute('element.updateModdleProperties', { + element, + moddleElement: field, + properties + }); + }; + const getOptions = element => { + const options = [{ + value: 'string', + label: translate('String') + }, { + value: 'expression', + label: translate('Expression') + }]; + return options; + }; + return (0,_bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.SelectEntry)({ + element: field, + id: idPrefix + '-type', + label: translate('Type'), + getValue, + setValue, + getOptions + }); +} +function ValueProperty(props) { + const { + idPrefix, + element, + field + } = props; + const commandStack = useService('commandStack'); + const translate = useService('translate'); + const debounce = useService('debounceInput'); + const setValue = value => { + // (1) determine which type we have set + const type = determineType(field); + + // (2) set property accordingly + const properties = Object.assign({}, DEFAULT_PROPS$2); + properties[type] = value || ''; + + // (3) execute the update command + commandStack.execute('element.updateModdleProperties', { + element, + moddleElement: field, + properties + }); + }; + const getValue = field => { + return field.string || field.stringValue || field.expression; + }; + return (0,_bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.TextFieldEntry)({ + element: field, + id: idPrefix + '-value', + label: translate('Value'), + getValue, + setValue, + debounce + }); +} + +// helper /////////////////// + +/** + * determineType - get the type of a fieldInjection based on the attributes + * set on it + * + * @param {ModdleElement} field + * @return {('string'|'expression')} + */ +function determineType(field) { + // string is the default type + return 'string' in field && 'string' || 'expression' in field && 'expression' || 'stringValue' in field && 'string' || 'string'; +} + +function FieldInjectionProps({ + element, + injector +}) { + const businessObject = getServiceTaskLikeBusinessObject(element); + if (!businessObject) { + return null; + } + const fieldInjections = getExtensionElementsList(businessObject, 'camunda:Field'); + const bpmnFactory = injector.get('bpmnFactory'), + commandStack = injector.get('commandStack'); + const items = fieldInjections.map((field, index) => { + const id = element.id + '-fieldInjection-' + index; + return { + id, + label: getFieldLabel(field), + entries: FieldInjection({ + idPrefix: id, + element, + field + }), + autoFocusEntry: id + '-name', + remove: removeFactory$5({ + commandStack, + element, + field + }) + }; + }); + return { + items, + add: addFactory$4({ + bpmnFactory, + commandStack, + element + }) + }; +} +function removeFactory$5({ + commandStack, + element, + field +}) { + return function (event) { + event.stopPropagation(); + const businessObject = getServiceTaskLikeBusinessObject(element); + removeExtensionElements(element, businessObject, field, commandStack); + }; +} +function addFactory$4({ + bpmnFactory, + commandStack, + element +}) { + return function (event) { + event.stopPropagation(); + const businessObject = getServiceTaskLikeBusinessObject(element); + const fieldInjection = createElement('camunda:Field', { + name: undefined, + string: '', + // string is the default type + stringValue: undefined + }, null, bpmnFactory); + addExtensionElements(element, businessObject, fieldInjection, bpmnFactory, commandStack); + }; +} + +// helper /////////////// + +function getFieldLabel(field) { + return field.name || ''; +} + +function FormFieldConstraint(props) { + const { + constraint, + element, + idPrefix + } = props; + const entries = [{ + id: idPrefix + '-name', + component: Name$1, + constraint, + idPrefix, + element + }, { + id: idPrefix + '-config', + component: Config, + constraint, + idPrefix, + element + }]; + return entries; +} +function Name$1(props) { + const { + idPrefix, + element, + constraint + } = props; + const commandStack = useService('commandStack'), + translate = useService('translate'), + debounce = useService('debounceInput'); + const setValue = value => { + commandStack.execute('element.updateModdleProperties', { + element, + moddleElement: constraint, + properties: { + name: value + } + }); + }; + const getValue = () => { + return constraint.name; + }; + return (0,_bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.TextFieldEntry)({ + element: constraint, + id: idPrefix + '-name', + label: translate('Name'), + getValue, + setValue, + debounce + }); +} +function Config(props) { + const { + idPrefix, + element, + constraint + } = props; + const commandStack = useService('commandStack'), + translate = useService('translate'), + debounce = useService('debounceInput'); + const setValue = value => { + commandStack.execute('element.updateModdleProperties', { + element, + moddleElement: constraint, + properties: { + config: value + } + }); + }; + const getValue = () => { + return constraint.config; + }; + return (0,_bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.TextFieldEntry)({ + element: constraint, + id: idPrefix + '-config', + label: translate('Config'), + getValue, + setValue, + debounce + }); +} + +function FormFieldProperty(props) { + const { + element, + idPrefix, + property + } = props; + const entries = [{ + id: idPrefix + '-id', + component: Id$2, + idPrefix, + property, + element + }, { + id: idPrefix + '-value', + component: Value$1, + idPrefix, + property, + element + }]; + return entries; +} +function Id$2(props) { + const { + idPrefix, + element, + property + } = props; + const commandStack = useService('commandStack'), + translate = useService('translate'), + debounce = useService('debounceInput'); + const setValue = value => { + commandStack.execute('element.updateModdleProperties', { + element, + moddleElement: property, + properties: { + id: value + } + }); + }; + const getValue = () => { + return property.id; + }; + return (0,_bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.TextFieldEntry)({ + element: property, + id: idPrefix + '-id', + label: translate('ID'), + getValue, + setValue, + debounce + }); +} +function Value$1(props) { + const { + idPrefix, + element, + property + } = props; + const commandStack = useService('commandStack'), + translate = useService('translate'), + debounce = useService('debounceInput'); + const setValue = value => { + commandStack.execute('element.updateModdleProperties', { + element, + moddleElement: property, + properties: { + value + } + }); + }; + const getValue = () => { + return property.value; + }; + return (0,_bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.TextFieldEntry)({ + element: property, + id: idPrefix + '-value', + label: translate('Value'), + getValue, + setValue, + debounce + }); +} + +function FormFieldValue(props) { + const { + element, + idPrefix, + value + } = props; + const entries = [{ + id: idPrefix + '-id', + component: Id$1, + idPrefix, + value, + element + }, { + id: idPrefix + '-name', + component: Name, + idPrefix, + value, + element + }]; + return entries; +} +function Id$1(props) { + const { + idPrefix, + element, + value + } = props; + const commandStack = useService('commandStack'), + translate = useService('translate'), + debounce = useService('debounceInput'); + const setValue = val => { + commandStack.execute('element.updateModdleProperties', { + element, + moddleElement: value, + properties: { + id: val + } + }); + }; + const getValue = () => { + return value.id; + }; + return (0,_bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.TextFieldEntry)({ + element: value, + id: idPrefix + '-id', + label: translate('ID'), + getValue, + setValue, + debounce + }); +} +function Name(props) { + const { + idPrefix, + element, + value + } = props; + const commandStack = useService('commandStack'), + translate = useService('translate'), + debounce = useService('debounceInput'); + const setValue = val => { + commandStack.execute('element.updateModdleProperties', { + element, + moddleElement: value, + properties: { + name: val + } + }); + }; + const getValue = () => { + return value.name; + }; + return (0,_bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.TextFieldEntry)({ + element: value, + id: idPrefix + '-name', + label: translate('Name'), + getValue, + setValue, + debounce + }); +} + +const CUSTOM_TYPE_VALUE = '', + DEFINED_TYPE_VALUES = ['boolean', 'date', 'enum', 'long', 'string', undefined]; +function FormField(props) { + const { + idPrefix, + formField + } = props; + const entries = [{ + id: idPrefix + '-formFieldID', + component: Id, + idPrefix, + formField + }, { + id: idPrefix + '-formFieldLabel', + component: Label, + idPrefix, + formField + }, { + id: idPrefix + '-formFieldType', + component: Type$1, + idPrefix, + formField + }]; + if (!DEFINED_TYPE_VALUES.includes(formField.get('type'))) { + entries.push({ + id: idPrefix + '-formFieldCustomType', + component: CustomType, + idPrefix, + formField + }); + } + entries.push({ + id: idPrefix + '-formFieldDefaultValue', + component: DefaultValue, + idPrefix, + formField + }); + if (formField.get('type') === 'enum') { + entries.push({ + id: idPrefix + '-formFieldValues', + component: ValueList, + formField, + idPrefix + }); + } + entries.push({ + id: idPrefix + '-formFieldConstraints', + component: ConstraintList, + formField, + idPrefix + }, { + id: idPrefix + '-formFieldProperties', + component: PropertiesList, + formField, + idPrefix + }); + return entries; +} +function Id(props) { + const { + idPrefix, + element, + formField + } = props; + const commandStack = useService('commandStack'); + const translate = useService('translate'); + const debounce = useService('debounceInput'); + const setValue = value => { + commandStack.execute('element.updateModdleProperties', { + element, + moddleElement: formField, + properties: { + id: value + } + }); + }; + const getValue = () => { + return formField.get('id'); + }; + return (0,_bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.TextFieldEntry)({ + element: formField, + id: idPrefix + '-formFieldID', + label: translate('ID'), + description: translate('Refers to the process variable name'), + getValue, + setValue, + debounce + }); +} +function Label(props) { + const { + idPrefix, + element, + formField + } = props; + const commandStack = useService('commandStack'); + const translate = useService('translate'); + const debounce = useService('debounceInput'); + const setValue = value => { + commandStack.execute('element.updateModdleProperties', { + element, + moddleElement: formField, + properties: { + label: value + } + }); + }; + const getValue = () => { + return formField.get('label'); + }; + return (0,_bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.TextFieldEntry)({ + element: formField, + id: idPrefix + '-formFieldLabel', + label: translate('Label'), + getValue, + setValue, + debounce + }); +} +function Type$1(props) { + const { + idPrefix, + element, + formField + } = props; + const commandStack = useService('commandStack'); + const translate = useService('translate'); + const setValue = value => { + commandStack.execute('element.updateModdleProperties', { + element, + moddleElement: formField, + properties: { + type: value + } + }); + }; + const getValue = () => { + const type = formField.get('type'); + return DEFINED_TYPE_VALUES.includes(type) ? type : CUSTOM_TYPE_VALUE; + }; + const getOptions = () => { + const options = [{ + label: translate('boolean'), + value: 'boolean' + }, { + label: translate('date'), + value: 'date' + }, { + label: translate('enum'), + value: 'enum' + }, { + label: translate('long'), + value: 'long' + }, { + label: translate('string'), + value: 'string' + }, { + label: translate(''), + value: CUSTOM_TYPE_VALUE + }]; + + // for the initial state only, we want to show an empty state + if (formField.get('type') === undefined) { + options.unshift({ + label: translate(''), + value: '' + }); + } + return options; + }; + return (0,_bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.SelectEntry)({ + element: formField, + id: idPrefix + '-formFieldType', + label: translate('Type'), + getValue, + setValue, + getOptions + }); +} +function CustomType(props) { + const { + idPrefix, + element, + formField + } = props; + const commandStack = useService('commandStack'); + const translate = useService('translate'); + const debounce = useService('debounceInput'); + const setValue = value => { + const type = value || ''; + commandStack.execute('element.updateModdleProperties', { + element, + moddleElement: formField, + properties: { + type + } + }); + }; + const getValue = () => { + return formField.get('type'); + }; + return (0,_bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.TextFieldEntry)({ + element: formField, + id: idPrefix + '-formFieldCustomType', + label: translate('Custom type'), + getValue, + setValue, + debounce + }); +} +function DefaultValue(props) { + const { + idPrefix, + element, + formField + } = props; + const commandStack = useService('commandStack'); + const translate = useService('translate'); + const debounce = useService('debounceInput'); + const setValue = value => { + commandStack.execute('element.updateModdleProperties', { + element, + moddleElement: formField, + properties: { + defaultValue: value + } + }); + }; + const getValue = () => { + return formField.get('defaultValue'); + }; + return (0,_bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.TextFieldEntry)({ + element: formField, + id: idPrefix + '-formFieldDefaultValue', + label: translate('Default value'), + getValue, + setValue, + debounce + }); +} +function Value(props) { + const { + element, + id: idPrefix, + index, + item: value, + open + } = props; + const translate = useService('translate'); + const id = `${idPrefix}-value-${index}`; + return (0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.CollapsibleEntry, { + id: id, + element: element, + entries: FormFieldValue({ + idPrefix: id, + element, + value + }), + label: value.get('id') || translate(''), + open: open + }); +} +function ValueList(props) { + const { + element, + formField, + idPrefix + } = props; + const id = `${idPrefix}-formFieldValues`; + const bpmnFactory = useService('bpmnFactory'); + const commandStack = useService('commandStack'); + const translate = useService('translate'); + const values = formField.get('values') || []; + function addValue() { + const value = createElement('camunda:Value', { + id: undefined, + name: undefined + }, formField, bpmnFactory); + commandStack.execute('element.updateModdleProperties', { + element: element, + moddleElement: formField, + properties: { + values: [...formField.get('values'), value] + } + }); + } + function removeValue(value) { + commandStack.execute('element.updateModdleProperties', { + element: element, + moddleElement: formField, + properties: { + values: (0,min_dash__WEBPACK_IMPORTED_MODULE_12__.without)(formField.get('values'), value) + } + }); + } + return (0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.ListEntry, { + element: element, + autoFocusEntry: `[data-entry-id="${id}-value-${values.length - 1}"] input`, + id: id, + label: translate('Values'), + items: values, + component: Value, + onAdd: addValue, + onRemove: removeValue + }); +} +function Constraint(props) { + const { + element, + id: idPrefix, + index, + item: constraint, + open + } = props; + const translate = useService('translate'); + const id = `${idPrefix}-constraint-${index}`; + return (0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.CollapsibleEntry, { + id: id, + element: element, + entries: FormFieldConstraint({ + constraint, + element, + idPrefix: id + }), + label: constraint.get('name') || translate(''), + open: open + }); +} +function ConstraintList(props) { + const { + element, + formField, + idPrefix + } = props; + const id = `${idPrefix}-formFieldConstraints`; + const bpmnFactory = useService('bpmnFactory'); + const commandStack = useService('commandStack'); + const translate = useService('translate'); + const businessObject = (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element); + let validation = formField.get('validation'); + const constraints = validation && validation.get('constraints') || []; + function addConstraint() { + const commands = []; + + // (1) ensure validation + if (!validation) { + validation = createElement('camunda:Validation', {}, businessObject, bpmnFactory); + commands.push({ + cmd: 'element.updateModdleProperties', + context: { + element, + moddleElement: formField, + properties: { + validation + } + } + }); + } + + // (2) add constraint + const constraint = createElement('camunda:Constraint', { + name: undefined, + config: undefined + }, validation, bpmnFactory); + commands.push({ + cmd: 'element.updateModdleProperties', + context: { + element, + moddleElement: validation, + properties: { + constraints: [...validation.get('constraints'), constraint] + } + } + }); + + // (3) commit updates + commandStack.execute('properties-panel.multi-command-executor', commands); + } + function removeConstraint(constraint) { + commandStack.execute('element.updateModdleProperties', { + element, + moddleElement: validation, + properties: { + constraints: (0,min_dash__WEBPACK_IMPORTED_MODULE_12__.without)(validation.get('constraints'), constraint) + } + }); + } + return (0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.ListEntry, { + element: element, + autoFocusEntry: `[data-entry-id="${id}-constraint-${constraints.length - 1}"] input`, + id: id, + label: translate('Constraints'), + items: constraints, + component: Constraint, + onAdd: addConstraint, + onRemove: removeConstraint + }); +} +function Property(props) { + const { + element, + id: idPrefix, + index, + item: property, + open + } = props; + const translate = useService('translate'); + const id = `${idPrefix}-property-${index}`; + return (0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.CollapsibleEntry, { + id: id, + element: element, + entries: FormFieldProperty({ + element, + idPrefix: id, + property + }), + label: property.get('id') || translate(''), + open: open + }); +} +function PropertiesList(props) { + const { + element, + formField, + idPrefix + } = props; + const id = `${idPrefix}-formFieldProperties`; + const bpmnFactory = useService('bpmnFactory'); + const commandStack = useService('commandStack'); + const translate = useService('translate'); + const businessObject = (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element); + let properties = formField.get('properties'); + const propertyEntries = properties && properties.get('values') || []; + function addProperty() { + const commands = []; + + // (1) ensure properties + if (!properties) { + properties = createElement('camunda:Properties', {}, businessObject, bpmnFactory); + commands.push({ + cmd: 'element.updateModdleProperties', + context: { + element, + moddleElement: formField, + properties: { + properties + } + } + }); + } + + // (2) add property + const property = createElement('camunda:Property', { + id: undefined, + value: undefined + }, properties, bpmnFactory); + commands.push({ + cmd: 'element.updateModdleProperties', + context: { + element, + moddleElement: properties, + properties: { + values: [...properties.get('values'), property] + } + } + }); + + // (3) commit updates + commandStack.execute('properties-panel.multi-command-executor', commands); + } + function removeProperty(property) { + commandStack.execute('element.updateModdleProperties', { + element, + moddleElement: properties, + properties: { + values: (0,min_dash__WEBPACK_IMPORTED_MODULE_12__.without)(properties.get('values'), property) + } + }); + } + return (0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.ListEntry, { + element: element, + autoFocusEntry: true, + id: id, + compareFn: createAlphanumericCompare('id'), + label: translate('Properties'), + items: propertyEntries, + component: Property, + onAdd: addProperty, + onRemove: removeProperty + }); +} + +// helper ////////////////// + +function createAlphanumericCompare(field) { + return function (entry, anotherEntry) { + const [key = '', anotherKey = ''] = [entry[field], anotherEntry[field]]; + return key === anotherKey ? 0 : key > anotherKey ? 1 : -1; + }; +} + +function FormDataProps({ + element, + injector +}) { + if (!isFormDataSupported(element)) { + return; + } + const formFields = getFormFieldsList(element) || []; + const bpmnFactory = injector.get('bpmnFactory'), + commandStack = injector.get('commandStack'); + const items = formFields.map((formField, index) => { + const id = element.id + '-formField-' + index; + return { + id, + label: formField.get('id') || '', + entries: FormField({ + idPrefix: id, + element, + formField + }), + autoFocusEntry: id + '-formFieldID', + remove: removeFactory$4({ + commandStack, + element, + formField + }) + }; + }); + return { + items, + add: addFactory$3({ + bpmnFactory, + commandStack, + element + }), + shouldSort: false + }; +} +function addFactory$3({ + bpmnFactory, + commandStack, + element +}) { + return function (event) { + event.stopPropagation(); + const commands = []; + + // (1) get camunda:FormData + const formData = getFormData$1(element); + + // (2) create camunda:FormField + const formField = createElement('camunda:FormField', {}, formData, bpmnFactory); + + // (3) add formField to list + commands.push({ + cmd: 'element.updateModdleProperties', + context: { + element, + moddleElement: formData, + properties: { + fields: [...formData.get('fields'), formField] + } + } + }); + + // (4) commit all updates + commandStack.execute('properties-panel.multi-command-executor', commands); + }; +} +function removeFactory$4({ + commandStack, + element, + formField +}) { + return function (event) { + event.stopPropagation(); + const formData = getFormData$1(element), + formFields = getFormFieldsList(element); + if (!formFields || !formFields.length) { + return; + } + const fields = (0,min_dash__WEBPACK_IMPORTED_MODULE_12__.without)(formData.get('fields'), formField); + + // update formData + commandStack.execute('element.updateModdleProperties', { + element, + moddleElement: formData, + properties: { + fields + } + }); + }; +} + +// helper /////////////////////////////// + +function isFormDataSupported(element) { + const formData = getFormData$1(element); + return ((0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.is)(element, 'bpmn:StartEvent') && !(0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.is)(element.parent, 'bpmn:SubProcess') || (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.is)(element, 'bpmn:UserTask')) && formData; +} +function getFormData$1(element) { + const bo = (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element); + return getExtensionElementsList(bo, 'camunda:FormData')[0]; +} +function getFormFieldsList(element) { + const businessObject = (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element); + const formData = getFormData$1(businessObject); + return formData && formData.fields; +} + +const FORM_KEY_PROPS = { + 'camunda:formRef': undefined, + 'camunda:formRefBinding': undefined, + 'camunda:formRefVersion': undefined +}; +const FORM_REF_PROPS = { + 'camunda:formKey': undefined +}; +function FormTypeProps(props) { + return [{ + id: 'formType', + component: FormType, + isEdited: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.isSelectEntryEdited + }]; +} +function FormType(props) { + const { + element + } = props; + const translate = useService('translate'); + const bpmnFactory = useService('bpmnFactory'); + const businessObject = (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element); + const commandStack = useService('commandStack'); + let extensionElements = businessObject.get('extensionElements'); + const getValue = () => { + if ((0,min_dash__WEBPACK_IMPORTED_MODULE_12__.isDefined)(businessObject.get('camunda:formKey'))) { + return 'formKey'; + } else if ((0,min_dash__WEBPACK_IMPORTED_MODULE_12__.isDefined)(businessObject.get('camunda:formRef'))) { + return 'formRef'; + } else if (getFormData(element)) { + return 'formData'; + } + return ''; + }; + const setValue = value => { + const commands = removePropertiesCommands(element); + if (value === 'formData') { + // (1) ensure extension elements + if (!extensionElements) { + extensionElements = createElement('bpmn:ExtensionElements', { + values: [] + }, businessObject, bpmnFactory); + commands.push({ + cmd: 'element.updateModdleProperties', + context: { + element, + moddleElement: businessObject, + properties: { + extensionElements + } + } + }); + } + + // (2) create camunda:FormData + const parent = extensionElements; + const formData = createElement('camunda:FormData', { + fields: [] + }, parent, bpmnFactory); + commands.push({ + cmd: 'element.updateModdleProperties', + context: { + element, + moddleElement: extensionElements, + properties: { + values: [...extensionElements.get('values'), formData] + } + } + }); + } else if (value === 'formKey') { + commands.push({ + cmd: 'element.updateModdleProperties', + context: { + element, + moddleElement: businessObject, + properties: { + 'camunda:formKey': '' + } + } + }); + } else if (value === 'formRef') { + commands.push({ + cmd: 'element.updateModdleProperties', + context: { + element, + moddleElement: businessObject, + properties: { + 'camunda:formRef': '' + } + } + }); + } + commandStack.execute('properties-panel.multi-command-executor', commands); + }; + const getOptions = () => { + return [{ + value: '', + label: translate('') + }, { + value: 'formRef', + label: translate('Camunda Forms') + }, { + value: 'formKey', + label: translate('Embedded or External Task Forms') + }, { + value: 'formData', + label: translate('Generated Task Forms') + }]; + }; + return (0,_bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.SelectEntry)({ + element, + id: 'formType', + label: translate('Type'), + getValue, + setValue, + getOptions + }); +} +function getFormData(element) { + const bo = (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element); + return getExtensionElementsList(bo, 'camunda:FormData')[0]; +} +function removePropertiesCommands(element, commandStack) { + const businessObject = (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element); + const extensionElements = businessObject.get('extensionElements'); + const commands = []; + + // (1) reset formKey and formRef + commands.push({ + cmd: 'element.updateModdleProperties', + context: { + element, + moddleElement: businessObject, + properties: { + ...FORM_KEY_PROPS, + ...FORM_REF_PROPS + } + } + }); + + // (2) remove formData if defined + if (extensionElements && getFormData(element)) { + commands.push({ + cmd: 'element.updateModdleProperties', + context: { + element, + moddleElement: extensionElements, + properties: { + values: (0,min_dash__WEBPACK_IMPORTED_MODULE_12__.without)(extensionElements.get('values'), getFormData(element)) + } + } + }); + } + return commands; +} + +function getFormRefBinding(element) { + const businessObject = (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element); + return businessObject.get('camunda:formRefBinding') || 'latest'; +} +function getFormType(element) { + const businessObject = (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element); + if ((0,min_dash__WEBPACK_IMPORTED_MODULE_12__.isDefined)(businessObject.get('camunda:formKey'))) { + return 'formKey'; + } else if ((0,min_dash__WEBPACK_IMPORTED_MODULE_12__.isDefined)(businessObject.get('camunda:formRef'))) { + return 'formRef'; + } +} +function isFormSupported(element) { + return (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.is)(element, 'bpmn:StartEvent') && !(0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.is)(element.parent, 'bpmn:SubProcess') || (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.is)(element, 'bpmn:UserTask'); +} + +function FormProps(props) { + const { + element + } = props; + if (!isFormSupported(element)) { + return []; + } + const formType = getFormType(element), + bindingType = getFormRefBinding(element); + + // (1) display form type select + const entries = [...FormTypeProps()]; + + // (2) display form properties based on type + if (formType === 'formKey') { + entries.push({ + id: 'formKey', + component: FormKey, + isEdited: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.isTextFieldEntryEdited + }); + } else if (formType === 'formRef') { + entries.push({ + id: 'formRef', + component: FormRef, + isEdited: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.isTextFieldEntryEdited + }, { + id: 'formRefBinding', + component: Binding$1, + isEdited: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.isSelectEntryEdited + }); + if (bindingType === 'version') { + entries.push({ + id: 'formRefVersion', + component: Version$1, + isEdited: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.isTextFieldEntryEdited + }); + } + } + return entries; +} +function FormKey(props) { + const { + element + } = props; + const debounce = useService('debounceInput'); + const modeling = useService('modeling'); + const translate = useService('translate'); + const businessObject = (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element); + const getValue = () => { + return businessObject.get('camunda:formKey'); + }; + const setValue = value => { + modeling.updateProperties(element, { + 'camunda:formKey': (0,min_dash__WEBPACK_IMPORTED_MODULE_12__.isUndefined)(value) ? '' : value + }); + }; + return (0,_bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.TextFieldEntry)({ + element, + id: 'formKey', + label: translate('Form key'), + getValue, + setValue, + debounce + }); +} +function FormRef(props) { + const { + element + } = props; + const debounce = useService('debounceInput'); + const modeling = useService('modeling'); + const translate = useService('translate'); + const businessObject = (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element); + const getValue = () => { + return businessObject.get('camunda:formRef'); + }; + const setValue = value => { + modeling.updateProperties(element, { + 'camunda:formRef': (0,min_dash__WEBPACK_IMPORTED_MODULE_12__.isUndefined)(value) ? '' : value + }); + }; + return (0,_bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.TextFieldEntry)({ + element, + id: 'formRef', + label: translate('Form reference'), + getValue, + setValue, + debounce + }); +} +function Binding$1(props) { + const { + element + } = props; + const modeling = useService('modeling'); + const translate = useService('translate'); + const getValue = () => { + return getFormRefBinding(element); + }; + const setValue = value => { + modeling.updateProperties(element, { + 'camunda:formRefBinding': value + }); + }; + + // Note: default is "latest", + // cf. https://docs.camunda.org/manual/develop/reference/bpmn20/custom-extensions/extension-attributes/#formrefbinding + const getOptions = () => { + const options = [{ + value: 'deployment', + label: translate('deployment') + }, { + value: 'latest', + label: translate('latest') + }, { + value: 'version', + label: translate('version') + }]; + return options; + }; + return (0,_bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.SelectEntry)({ + element, + id: 'formRefBinding', + label: translate('Binding'), + getValue, + setValue, + getOptions + }); +} +function Version$1(props) { + const { + element + } = props; + const debounce = useService('debounceInput'); + const modeling = useService('modeling'); + const translate = useService('translate'); + const businessObject = (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element); + const getValue = () => { + return businessObject.get('camunda:formRefVersion'); + }; + const setValue = value => { + modeling.updateProperties(element, { + 'camunda:formRefVersion': value + }); + }; + return (0,_bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.TextFieldEntry)({ + element, + id: 'formRefVersion', + label: translate('Version'), + getValue, + setValue, + debounce + }); +} + +function HistoryCleanupProps(props) { + const { + element + } = props; + const businessObject = (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element); + if (!(0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.is)(element, 'bpmn:Process') && !((0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.is)(element, 'bpmn:Participant') && businessObject.get('processRef'))) { + return []; + } + return [{ + id: 'historyTimeToLive', + component: HistoryTimeToLive, + isEdited: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.isTextFieldEntryEdited + }]; +} +function HistoryTimeToLive(props) { + const { + element + } = props; + const commandStack = useService('commandStack'); + const translate = useService('translate'); + const debounce = useService('debounceInput'); + const process = getProcess$2(element); + const getValue = () => { + return process.get('camunda:historyTimeToLive') || ''; + }; + const setValue = value => { + commandStack.execute('element.updateModdleProperties', { + element, + moddleElement: process, + properties: { + 'camunda:historyTimeToLive': value + } + }); + }; + return (0,_bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.TextFieldEntry)({ + element, + id: 'historyTimeToLive', + label: translate('Time to live'), + getValue, + setValue, + debounce + }); +} + +// helper ////////////////// + +function getProcess$2(element) { + return (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.is)(element, 'bpmn:Process') ? (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element) : (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element).get('processRef'); +} + +function DmnImplementationProps(props) { + const { + element + } = props; + const entries = []; + const implementationType = getImplementationType(element); + const bindingType = getDecisionRefBinding(element); + if (implementationType !== 'dmn') { + return entries; + } + + // (1) decisionRef + entries.push({ + id: 'decisionRef', + component: DecisionRef, + isEdited: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.isTextFieldEntryEdited + }); + + // (2) binding + entries.push({ + id: 'decisionRefBinding', + component: Binding, + isEdited: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.isSelectEntryEdited + }); + + // (3) version + if (bindingType === 'version') { + entries.push({ + id: 'decisionRefVersion', + component: Version, + isEdited: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.isTextFieldEntryEdited + }); + } + + // (4) versionTag + if (bindingType === 'versionTag') { + entries.push({ + id: 'decisionRefVersionTag', + component: VersionTag$1, + isEdited: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.isTextFieldEntryEdited + }); + } + + // (5) tenantId + entries.push({ + id: 'decisionRefTenantId', + component: TenantId, + isEdited: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.isTextFieldEntryEdited + }); + + // (6) resultVariable + entries.push({ + id: 'decisionRefResultVariable', + component: ResultVariable$2, + isEdited: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.isTextFieldEntryEdited + }); + + // (7) mapDecisionResult + if (getResultVariable(element)) { + entries.push({ + id: 'mapDecisionResult', + component: MapDecisionResult, + isEdited: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.isSelectEntryEdited + }); + } + return entries; +} +function DecisionRef(props) { + const { + element + } = props; + const commandStack = useService('commandStack'); + const translate = useService('translate'); + const debounce = useService('debounceInput'); + const businessObject = (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element); + const getValue = () => { + return businessObject.get('camunda:decisionRef'); + }; + const setValue = value => { + commandStack.execute('element.updateModdleProperties', { + element, + moddleElement: businessObject, + properties: { + 'camunda:decisionRef': value || '' + } + }); + }; + return (0,_bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.TextFieldEntry)({ + element, + id: 'decisionRef', + label: translate('Decision reference'), + getValue, + setValue, + debounce + }); +} +function Binding(props) { + const { + element + } = props; + const commandStack = useService('commandStack'); + const translate = useService('translate'); + const getValue = () => { + return getDecisionRefBinding(element); + }; + const setValue = value => { + const businessObject = (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element); + + // reset version properties on binding type change + const updatedProperties = { + 'camunda:decisionRefVersion': undefined, + 'camunda:decisionRefVersionTag': undefined, + 'camunda:decisionRefBinding': value + }; + commandStack.execute('element.updateModdleProperties', { + element, + moddleElement: businessObject, + properties: updatedProperties + }); + }; + + // Note: default is "latest", + // cf. https://docs.camunda.org/manual/latest/reference/bpmn20/custom-extensions/extension-attributes/#decisionrefbinding + const getOptions = () => { + const options = [{ + value: 'deployment', + label: translate('deployment') + }, { + value: 'latest', + label: translate('latest') + }, { + value: 'version', + label: translate('version') + }, { + value: 'versionTag', + label: translate('versionTag') + }]; + return options; + }; + return (0,_bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.SelectEntry)({ + element, + id: 'decisionRefBinding', + label: translate('Binding'), + getValue, + setValue, + getOptions + }); +} +function Version(props) { + const { + element + } = props; + const commandStack = useService('commandStack'); + const translate = useService('translate'); + const debounce = useService('debounceInput'); + const businessObject = (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element); + const getValue = () => { + return businessObject.get('camunda:decisionRefVersion'); + }; + const setValue = value => { + commandStack.execute('element.updateModdleProperties', { + element, + moddleElement: businessObject, + properties: { + 'camunda:decisionRefVersion': value + } + }); + }; + return (0,_bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.TextFieldEntry)({ + element, + id: 'decisionRefVersion', + label: translate('Version'), + getValue, + setValue, + debounce + }); +} +function VersionTag$1(props) { + const { + element + } = props; + const commandStack = useService('commandStack'); + const translate = useService('translate'); + const debounce = useService('debounceInput'); + const businessObject = (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element); + const getValue = () => { + return businessObject.get('camunda:decisionRefVersionTag'); + }; + const setValue = value => { + commandStack.execute('element.updateModdleProperties', { + element, + moddleElement: businessObject, + properties: { + 'camunda:decisionRefVersionTag': value + } + }); + }; + return (0,_bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.TextFieldEntry)({ + element, + id: 'decisionRefVersionTag', + label: translate('Version tag'), + getValue, + setValue, + debounce + }); +} +function TenantId(props) { + const { + element + } = props; + const commandStack = useService('commandStack'); + const translate = useService('translate'); + const debounce = useService('debounceInput'); + const businessObject = (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element); + const getValue = () => { + return businessObject.get('camunda:decisionRefTenantId'); + }; + const setValue = value => { + commandStack.execute('element.updateModdleProperties', { + element, + moddleElement: businessObject, + properties: { + 'camunda:decisionRefTenantId': value + } + }); + }; + return (0,_bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.TextFieldEntry)({ + element, + id: 'decisionRefTenantId', + label: translate('Tenant ID'), + getValue, + setValue, + debounce + }); +} +function ResultVariable$2(props) { + const { + element + } = props; + const commandStack = useService('commandStack'); + const translate = useService('translate'); + const debounce = useService('debounceInput'); + const businessObject = (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element); + const getValue = () => { + return getResultVariable(businessObject); + }; + + // Note: camunda:mapDecisionResult got cleaned up in modeling behavior + // cf. https://github.com/camunda/camunda-bpmn-js/blob/main/lib/camunda-platform/features/modeling/behavior/UpdateResultVariableBehavior.js + const setValue = value => { + commandStack.execute('element.updateModdleProperties', { + element, + moddleElement: businessObject, + properties: { + 'camunda:resultVariable': value + } + }); + }; + return (0,_bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.TextFieldEntry)({ + element, + id: 'decisionRefResultVariable', + label: translate('Result variable'), + getValue, + setValue, + debounce + }); +} +function MapDecisionResult(props) { + const { + element + } = props; + const commandStack = useService('commandStack'); + const translate = useService('translate'); + const businessObject = (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element); + const getValue = () => { + return businessObject.get('camunda:mapDecisionResult') || 'resultList'; + }; + const setValue = value => { + commandStack.execute('element.updateModdleProperties', { + element, + moddleElement: businessObject, + properties: { + 'camunda:mapDecisionResult': value + } + }); + }; + + // Note: default is "resultList", + // cf. https://docs.camunda.org/manual/latest/reference/bpmn20/custom-extensions/extension-attributes/#mapdecisionresult + const getOptions = () => { + const options = [{ + value: 'collectEntries', + label: translate('collectEntries (List)') + }, { + value: 'resultList', + label: translate('resultList (List>)') + }, { + value: 'singleEntry', + label: translate('singleEntry (TypedValue)') + }, { + value: 'singleResult', + label: translate('singleResult (Map)') + }]; + return options; + }; + return (0,_bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.SelectEntry)({ + element, + id: 'mapDecisionResult', + label: translate('Map decision result'), + getValue, + setValue, + getOptions + }); +} + +// helper //////////////////// + +function getDecisionRefBinding(element) { + const businessObject = (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element); + return businessObject.get('camunda:decisionRefBinding') || 'latest'; +} +function getResultVariable(element) { + const businessObject = (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element); + return businessObject.get('camunda:resultVariable'); +} + +const DELEGATE_PROPS = { + 'camunda:class': undefined, + 'camunda:expression': undefined, + 'camunda:delegateExpression': undefined, + 'camunda:resultVariable': undefined +}; +const DMN_CAPABLE_PROPS = { + 'camunda:decisionRef': undefined, + 'camunda:decisionRefBinding': 'latest', + 'camunda:decisionRefVersion': undefined, + 'camunda:mapDecisionResult': 'resultList', + 'camunda:decisionRefTenantId': undefined +}; +const EXTERNAL_CAPABLE_PROPS = { + 'camunda:type': undefined, + 'camunda:topic': undefined +}; +const IMPLEMENTATION_TYPE_NONE_LABEL = '', + IMPLEMENTATION_TYPE_JAVA_LABEL = 'Java class', + IMPLEMENTATION_TYPE_EXPRESSION_LABEL = 'Expression', + IMPLEMENTATION_TYPE_DELEGATE_LABEL = 'Delegate expression', + IMPLEMENTATION_TYPE_DMN_LABEL = 'DMN', + IMPLEMENTATION_TYPE_EXTERNAL_LABEL = 'External', + IMPLEMENTATION_TYPE_CONNECTOR_LABEL = 'Connector'; +function ImplementationTypeProps(props) { + return [{ + id: 'implementationType', + component: ImplementationType, + isEdited: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.isSelectEntryEdited + }]; +} +function ImplementationType(props) { + const { + element + } = props; + const bpmnFactory = useService('bpmnFactory'); + const commandStack = useService('commandStack'); + const translate = useService('translate'); + const getValue = () => { + return getImplementationType(element) || ''; + }; + const setValue = value => { + const oldType = getImplementationType(element); + const businessObject = getServiceTaskLikeBusinessObject(element); + const commands = []; + let updatedProperties = DELEGATE_PROPS; + let extensionElements = businessObject.get('extensionElements'); + + // (1) class, expression, delegateExpression + if (isDelegateType(value)) { + updatedProperties = { + ...updatedProperties, + [value]: isDelegateType(oldType) ? businessObject.get(`camunda:${oldType}`) : '' + }; + } + + // (2) dmn + if (isDmnCapable(businessObject)) { + updatedProperties = { + ...updatedProperties, + ...DMN_CAPABLE_PROPS + }; + if (value === 'dmn') { + updatedProperties = { + ...updatedProperties, + 'camunda:decisionRef': '' + }; + } + } + + // (3) external + // Note: error event definition elements got cleaned up in modeling behavior + // cf. https://github.com/camunda/camunda-bpmn-js/blob/main/lib/camunda-platform/features/modeling/behavior/DeleteErrorEventDefinitionBehavior.js + if (isExternalCapable(businessObject)) { + updatedProperties = { + ...updatedProperties, + ...EXTERNAL_CAPABLE_PROPS + }; + if (value === 'external') { + updatedProperties = { + ...updatedProperties, + 'camunda:type': 'external', + 'camunda:topic': '' + }; + } + } + + // (4) connector + if (isServiceTaskLike(businessObject)) { + // (4.1) remove all connectors on type change + const connectors = getConnectors$1(businessObject); + if (connectors.length) { + commands.push({ + cmd: 'element.updateModdleProperties', + context: { + element, + moddleElement: extensionElements, + properties: { + values: (0,min_dash__WEBPACK_IMPORTED_MODULE_12__.without)(extensionElements.get('values'), value => connectors.includes(value)) + } + } + }); + } + + // (4.2) create connector + if (value === 'connector') { + // ensure extension elements + if (!extensionElements) { + extensionElements = createElement('bpmn:ExtensionElements', { + values: [] + }, businessObject, bpmnFactory); + commands.push(UpdateModdlePropertiesCommand(element, businessObject, { + extensionElements + })); + } + const connector = createElement('camunda:Connector', {}, extensionElements, bpmnFactory); + commands.push({ + cmd: 'element.updateModdleProperties', + context: { + element, + moddleElement: extensionElements, + properties: { + values: [...extensionElements.get('values'), connector] + } + } + }); + } + } + + // (5) collect all property updates + commands.push(UpdateModdlePropertiesCommand(element, businessObject, updatedProperties)); + + // (6) commit all updates + commandStack.execute('properties-panel.multi-command-executor', commands); + }; + const getOptions = () => { + const businessObject = getServiceTaskLikeBusinessObject(element); + const options = [{ + value: '', + label: translate(IMPLEMENTATION_TYPE_NONE_LABEL) + }, { + value: 'class', + label: translate(IMPLEMENTATION_TYPE_JAVA_LABEL) + }, { + value: 'expression', + label: translate(IMPLEMENTATION_TYPE_EXPRESSION_LABEL) + }, { + value: 'delegateExpression', + label: translate(IMPLEMENTATION_TYPE_DELEGATE_LABEL) + }]; + if (isDmnCapable(businessObject)) { + options.push({ + value: 'dmn', + label: translate(IMPLEMENTATION_TYPE_DMN_LABEL) + }); + } + if (isExternalCapable(businessObject)) { + options.push({ + value: 'external', + label: translate(IMPLEMENTATION_TYPE_EXTERNAL_LABEL) + }); + } + if (isServiceTaskLike(businessObject)) { + options.push({ + value: 'connector', + label: translate(IMPLEMENTATION_TYPE_CONNECTOR_LABEL) + }); + } + return sortByPriority(options); + }; + return (0,_bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.SelectEntry)({ + element, + id: 'implementationType', + label: translate('Type'), + getValue, + setValue, + getOptions + }); +} + +// helper /////////////////////// + +function isDelegateType(type) { + return ['class', 'expression', 'delegateExpression'].includes(type); +} +function getConnectors$1(businessObject) { + return getExtensionElementsList(businessObject, 'camunda:Connector'); +} +function UpdateModdlePropertiesCommand(element, businessObject, newProperties) { + return { + cmd: 'element.updateModdleProperties', + context: { + element, + moddleElement: businessObject, + properties: newProperties + } + }; +} +function sortByPriority(options) { + const priorities = { + [IMPLEMENTATION_TYPE_NONE_LABEL]: 0, + [IMPLEMENTATION_TYPE_JAVA_LABEL]: 3, + [IMPLEMENTATION_TYPE_EXPRESSION_LABEL]: 4, + [IMPLEMENTATION_TYPE_DELEGATE_LABEL]: 5, + [IMPLEMENTATION_TYPE_DMN_LABEL]: 1, + [IMPLEMENTATION_TYPE_EXTERNAL_LABEL]: 2, + [IMPLEMENTATION_TYPE_CONNECTOR_LABEL]: 6 + }; + return (0,min_dash__WEBPACK_IMPORTED_MODULE_12__.sortBy)(options, o => priorities[o.label]); +} + +function ImplementationProps(props) { + const { + element + } = props; + if (!getServiceTaskLikeBusinessObject(element)) { + return []; + } + const implementationType = getImplementationType(element); + + // (1) display implementation type select + const entries = [...ImplementationTypeProps()]; + + // (2) display implementation properties based on type + if (implementationType === 'class') { + entries.push({ + id: 'javaClass', + component: JavaClass, + isEdited: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.isTextFieldEntryEdited + }); + } else if (implementationType === 'expression') { + entries.push({ + id: 'expression', + component: Expression, + isEdited: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.isTextFieldEntryEdited + }, { + id: 'expressionResultVariable', + component: ResultVariable$1, + isEdited: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.isTextFieldEntryEdited + }); + } else if (implementationType === 'delegateExpression') { + entries.push({ + id: 'delegateExpression', + component: DelegateExpression, + isEdited: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.isTextFieldEntryEdited + }); + } else if (implementationType === 'dmn') { + entries.push(...DmnImplementationProps({ + element + })); + } else if (implementationType === 'external') { + entries.push({ + id: 'externalTopic', + component: Topic, + isEdited: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.isTextFieldEntryEdited + }); + } else if (implementationType === 'connector') { + entries.push({ + id: 'connectorId', + component: ConnectorId, + isEdited: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.isTextFieldEntryEdited + }); + } + return entries; +} +function JavaClass(props) { + const { + element, + businessObject = getServiceTaskLikeBusinessObject(element), + id = 'javaClass' + } = props; + const commandStack = useService('commandStack'); + const translate = useService('translate'); + const debounce = useService('debounceInput'); + const getValue = () => { + return businessObject.get('camunda:class'); + }; + const setValue = value => { + commandStack.execute('element.updateModdleProperties', { + element, + moddleElement: businessObject, + properties: { + 'camunda:class': value || '' + } + }); + }; + return (0,_bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.TextFieldEntry)({ + element, + id, + label: translate('Java class'), + getValue, + setValue, + debounce + }); +} +function Expression(props) { + const { + element, + businessObject = getServiceTaskLikeBusinessObject(element), + id = 'expression' + } = props; + const commandStack = useService('commandStack'); + const translate = useService('translate'); + const debounce = useService('debounceInput'); + const getValue = () => { + return businessObject.get('camunda:expression'); + }; + const setValue = value => { + commandStack.execute('element.updateModdleProperties', { + element, + moddleElement: businessObject, + properties: { + 'camunda:expression': value || '' + } + }); + }; + return (0,_bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.TextFieldEntry)({ + element, + id, + label: translate('Expression'), + getValue, + setValue, + debounce + }); +} +function ResultVariable$1(props) { + const { + element + } = props; + const commandStack = useService('commandStack'); + const translate = useService('translate'); + const debounce = useService('debounceInput'); + const businessObject = getServiceTaskLikeBusinessObject(element); + const getValue = () => { + return businessObject.get('camunda:resultVariable'); + }; + const setValue = value => { + commandStack.execute('element.updateModdleProperties', { + element, + moddleElement: businessObject, + properties: { + 'camunda:resultVariable': value + } + }); + }; + return (0,_bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.TextFieldEntry)({ + element, + id: 'expressionResultVariable', + label: translate('Result variable'), + getValue, + setValue, + debounce + }); +} +function DelegateExpression(props) { + const { + element, + businessObject = getServiceTaskLikeBusinessObject(element), + id = 'delegateExpression' + } = props; + const commandStack = useService('commandStack'); + const translate = useService('translate'); + const debounce = useService('debounceInput'); + const getValue = () => { + return businessObject.get('camunda:delegateExpression'); + }; + const setValue = value => { + commandStack.execute('element.updateModdleProperties', { + element, + moddleElement: businessObject, + properties: { + 'camunda:delegateExpression': value || '' + } + }); + }; + return (0,_bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.TextFieldEntry)({ + element, + id, + label: translate('Delegate expression'), + getValue, + setValue, + debounce + }); +} +function Topic(props) { + const { + element + } = props; + const commandStack = useService('commandStack'); + const translate = useService('translate'); + const debounce = useService('debounceInput'); + const businessObject = getServiceTaskLikeBusinessObject(element); + const getValue = () => { + return businessObject.get('camunda:topic'); + }; + const setValue = value => { + commandStack.execute('element.updateModdleProperties', { + element, + moddleElement: businessObject, + properties: { + 'camunda:topic': value + } + }); + }; + return (0,_bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.TextFieldEntry)({ + element, + id: 'externalTopic', + label: translate('Topic'), + getValue, + setValue, + debounce + }); +} +function ConnectorId(props) { + const { + element + } = props; + const commandStack = useService('commandStack'); + const translate = useService('translate'); + const debounce = useService('debounceInput'); + const connector = getConnector(element); + const getValue = () => { + return connector.get('camunda:connectorId'); + }; + const setValue = value => { + commandStack.execute('element.updateModdleProperties', { + element, + moddleElement: connector, + properties: { + 'camunda:connectorId': value + } + }); + }; + return (0,_bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.TextFieldEntry)({ + element, + id: 'connectorId', + label: translate('Connector ID'), + getValue, + setValue, + debounce + }); +} + +// helper ////////////////// + +function getConnectors(businessObject) { + return getExtensionElementsList(businessObject, 'camunda:Connector'); +} +function getConnector(element) { + const businessObject = getServiceTaskLikeBusinessObject(element); + const connectors = getConnectors(businessObject); + return connectors[0]; +} + +function InitiatorProps(props) { + const { + element + } = props; + if (!isInitiator(element)) { + return []; + } + return [{ + id: 'initiator', + component: Initiator, + isEdited: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.isTextFieldEntryEdited + }]; +} +function Initiator(props) { + const { + element + } = props; + const commandStack = useService('commandStack'); + const translate = useService('translate'); + const debounce = useService('debounceInput'); + const businessObject = (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element); + const getValue = () => { + return businessObject.get('camunda:initiator'); + }; + const setValue = value => { + commandStack.execute('element.updateModdleProperties', { + element, + moddleElement: businessObject, + properties: { + 'camunda:initiator': value + } + }); + }; + return (0,_bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.TextFieldEntry)({ + element, + id: 'initiator', + label: translate('Initiator'), + getValue, + setValue, + debounce + }); +} + +// helper /////////////////// + +function isInitiator(element) { + return (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.is)(element, 'camunda:Initiator') && !(0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.is)(element.parent, 'bpmn:SubProcess'); +} + +/** + * Cf. https://docs.camunda.org/manual/7.15/reference/bpmn20/subprocesses/call-activity/#passing-variables + */ +function InMappingPropagationProps(props) { + const { + element + } = props; + if (!areInMappingsSupported$1(element)) { + return []; + } + const entries = [{ + id: 'inMapping-propagation', + component: PropagateAll$1, + isEdited: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.isCheckboxEntryEdited + }]; + if (isPropagateAll$1(element)) { + entries.push({ + id: 'inMapping-propagation-local', + component: Local$2, + isEdited: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.isCheckboxEntryEdited + }); + } + return entries; +} +function PropagateAll$1(props) { + const { + element + } = props; + const commandStack = useService('commandStack'); + const bpmnFactory = useService('bpmnFactory'); + const translate = useService('translate'); + const getValue = () => { + return isPropagateAll$1(element); + }; + const setValue = value => { + if (value) { + addInMapping(); + } else { + removeInMapping(); + } + }; + function addInMapping() { + const businessObject = getSignalEventDefinition$1(element) || (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element); + const mapping = createElement('camunda:In', { + variables: 'all' + }, null, bpmnFactory); + addExtensionElements(element, businessObject, mapping, bpmnFactory, commandStack); + } + function removeInMapping() { + const businessObject = getSignalEventDefinition$1(element) || (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element); + const mappings = findRelevantInMappings(element); + removeExtensionElements(element, businessObject, mappings, commandStack); + } + return (0,_bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.CheckboxEntry)({ + id: 'inMapping-propagation', + label: translate('Propagate all variables'), + getValue, + setValue + }); +} +function Local$2(props) { + const { + element + } = props; + const commandStack = useService('commandStack'); + const translate = useService('translate'); + const mapping = findRelevantInMappings(element)[0]; + const getValue = () => { + return mapping.get('camunda:local'); + }; + const setValue = value => { + commandStack.execute('element.updateModdleProperties', { + element, + moddleElement: mapping, + properties: { + local: value + } + }); + }; + return (0,_bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.CheckboxEntry)({ + element, + id: 'inMapping-propagation-local', + label: translate('Local'), + getValue, + setValue + }); +} + +// helper ////////////////////////// + +function areInMappingsSupported$1(element) { + const signalEventDefinition = getSignalEventDefinition$1(element); + if (signalEventDefinition) { + return (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.isAny)(element, ['bpmn:IntermediateThrowEvent', 'bpmn:EndEvent']); + } + return (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.is)(element, 'bpmn:CallActivity'); +} +function getInMappings$1(element) { + const businessObject = (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element); + const signalEventDefinition = getSignalEventDefinition$1(businessObject); + return getExtensionElementsList(signalEventDefinition || businessObject, 'camunda:In'); +} +function findRelevantInMappings(element) { + const inMappings = getInMappings$1(element); + return (0,min_dash__WEBPACK_IMPORTED_MODULE_12__.filter)(inMappings, function (mapping) { + const variables = mapping.get('variables'); + return variables && variables === 'all'; + }); +} +function isPropagateAll$1(element) { + const mappings = findRelevantInMappings(element); + return !!mappings.length; +} + +const DEFAULT_PROPS$1 = { + 'source': undefined, + 'sourceExpression': undefined +}; +function InOutMapping(props) { + const { + idPrefix, + mapping + } = props; + const type = getInOutType(mapping); + const entries = []; + + // (1) Type + entries.push({ + id: idPrefix + '-type', + component: Type, + idPrefix, + mapping + }); + + // (2) Source + if (type === 'source') { + entries.push({ + id: idPrefix + '-source', + component: Source, + idPrefix, + mapping + }); + } + + // (3) Source expression + if (type === 'sourceExpression') { + entries.push({ + id: idPrefix + '-sourceExpression', + component: SourceExpression, + idPrefix, + mapping + }); + } + + // (4) Target + entries.push({ + id: idPrefix + '-target', + component: Target, + idPrefix, + mapping + }); + + // (5) Local + entries.push({ + id: idPrefix + '-local', + component: Local$1, + idPrefix, + mapping + }); + return entries; +} +function Type(props) { + const { + idPrefix, + element, + mapping + } = props; + const commandStack = useService('commandStack'); + const translate = useService('translate'); + const getValue = mapping => { + return getInOutType(mapping); + }; + const setValue = value => { + const properties = { + ...DEFAULT_PROPS$1, + [value]: '' + }; + commandStack.execute('element.updateModdleProperties', { + element, + moddleElement: mapping, + properties + }); + }; + const getOptions = () => { + const options = [{ + label: translate('Source'), + value: 'source' + }, { + label: translate('Source expression'), + value: 'sourceExpression' + }]; + return options; + }; + return (0,_bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.SelectEntry)({ + element: mapping, + id: idPrefix + '-type', + label: translate('Type'), + getValue, + setValue, + getOptions + }); +} +function Source(props) { + const { + idPrefix, + element, + mapping + } = props; + const commandStack = useService('commandStack'); + const translate = useService('translate'); + const debounce = useService('debounceInput'); + const setValue = value => { + commandStack.execute('element.updateModdleProperties', { + element, + moddleElement: mapping, + properties: { + source: value + } + }); + }; + const getValue = mapping => { + return mapping.get('camunda:source'); + }; + return (0,_bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.TextFieldEntry)({ + element: mapping, + id: idPrefix + '-source', + label: translate('Source'), + getValue, + setValue, + debounce + }); +} +function SourceExpression(props) { + const { + idPrefix, + element, + mapping + } = props; + const commandStack = useService('commandStack'); + const translate = useService('translate'); + const debounce = useService('debounceInput'); + const setValue = value => { + commandStack.execute('element.updateModdleProperties', { + element, + moddleElement: mapping, + properties: { + sourceExpression: value + } + }); + }; + const getValue = mapping => { + return mapping.get('camunda:sourceExpression'); + }; + return (0,_bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.TextFieldEntry)({ + element: mapping, + id: idPrefix + '-sourceExpression', + label: translate('Source expression'), + getValue, + setValue, + debounce + }); +} +function Target(props) { + const { + idPrefix, + element, + mapping + } = props; + const commandStack = useService('commandStack'); + const translate = useService('translate'); + const debounce = useService('debounceInput'); + const setValue = value => { + commandStack.execute('element.updateModdleProperties', { + element, + moddleElement: mapping, + properties: { + target: value + } + }); + }; + const getValue = mapping => { + return mapping.get('camunda:target'); + }; + return (0,_bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.TextFieldEntry)({ + element: mapping, + id: idPrefix + '-target', + label: translate('Target'), + getValue, + setValue, + debounce + }); +} +function Local$1(props) { + const { + idPrefix, + element, + mapping + } = props; + const commandStack = useService('commandStack'); + const translate = useService('translate'); + const getValue = () => { + return mapping.get('camunda:local'); + }; + const setValue = value => { + commandStack.execute('element.updateModdleProperties', { + element, + moddleElement: mapping, + properties: { + local: value + } + }); + }; + return (0,_bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.CheckboxEntry)({ + element, + id: idPrefix + '-local', + label: translate('Local'), + getValue, + setValue + }); +} + +// helper /////////////////// + +function getInOutType(mapping) { + let inOutType = ''; + if (typeof mapping.source !== 'undefined') { + inOutType = 'source'; + } else if (typeof mapping.sourceExpression !== 'undefined') { + inOutType = 'sourceExpression'; + } + return inOutType; +} + +/** + * Cf. https://docs.camunda.org/manual/latest/reference/bpmn20/custom-extensions/extension-elements/#in + */ +function InMappingProps({ + element, + injector +}) { + if (!areInMappingsSupported(element)) { + return null; + } + const variableMappings = getInMappings(element) || []; + const bpmnFactory = injector.get('bpmnFactory'), + commandStack = injector.get('commandStack'); + const items = variableMappings.map((mapping, index) => { + const id = element.id + '-inMapping-' + index; + return { + id, + label: mapping.get('target') || '', + entries: InOutMapping({ + idPrefix: id, + element, + mapping + }), + autoFocusEntry: id + '-target', + remove: removeFactory$3({ + commandStack, + element, + mapping + }) + }; + }); + return { + items, + add: addFactory$2({ + bpmnFactory, + commandStack, + element + }) + }; +} +function removeFactory$3({ + commandStack, + element, + mapping +}) { + return function (event) { + event.stopPropagation(); + const businessObject = getSignalEventDefinition$1(element) || (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element); + removeExtensionElements(element, businessObject, mapping, commandStack); + }; +} +function addFactory$2({ + bpmnFactory, + commandStack, + element +}) { + return function (event) { + event.stopPropagation(); + const businessObject = getSignalEventDefinition$1(element) || (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element); + const newMapping = createElement('camunda:In', { + source: '' // source is the default type + }, null, bpmnFactory); + addExtensionElements(element, businessObject, newMapping, bpmnFactory, commandStack); + }; +} + +// helper /////////////// + +function getInMappings(element) { + const businessObject = (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element); + const signalEventDefinition = getSignalEventDefinition$1(businessObject); + const mappings = getExtensionElementsList(signalEventDefinition || businessObject, 'camunda:In'); + + // only retrieve relevant mappings here, others are handled in other groups + // mapping.businessKey => camunda-platform/CallAvtivityProps + // mapping.variables => camunda-platform/InMappingPropagationProps + return (0,min_dash__WEBPACK_IMPORTED_MODULE_12__.filter)(mappings, function (mapping) { + return !mapping.businessKey && !(mapping.variables && mapping.variables === 'all'); + }); +} +function areInMappingsSupported(element) { + const signalEventDefinition = getSignalEventDefinition$1(element); + if (signalEventDefinition) { + return (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.isAny)(element, ['bpmn:IntermediateThrowEvent', 'bpmn:EndEvent']); + } + return (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.is)(element, 'bpmn:CallActivity'); +} + +function InputProps(props) { + const { + element, + injector + } = props; + if (!areInputParametersSupported(element)) { + return null; + } + const inputParameters = getInputParameters(element) || []; + const bpmnFactory = injector.get('bpmnFactory'), + commandStack = injector.get('commandStack'); + const items = inputParameters.map((parameter, index) => { + const id = element.id + '-inputParameter-' + index; + return { + id, + label: parameter.get('name') || '', + entries: InputOutputParameter({ + idPrefix: id, + element, + parameter + }), + autoFocusEntry: id + '-name', + remove: removeFactory$2({ + element, + commandStack, + parameter + }) + }; + }); + function add(event) { + event.stopPropagation(); + commandStack.execute('properties-panel.multi-command-executor', AddParameterCmd(element, 'camunda:InputParameter', bpmnFactory)); + } + return { + items, + add, + shouldSort: false + }; +} +function removeFactory$2(props) { + const { + commandStack, + element, + parameter + } = props; + return function (event) { + event.stopPropagation(); + const inputOutput = getInputOutput(element); + if (!inputOutput) { + return; + } + commandStack.execute('element.updateModdleProperties', { + element, + moddleElement: inputOutput, + properties: { + inputParameters: (0,min_dash__WEBPACK_IMPORTED_MODULE_12__.without)(inputOutput.get('inputParameters'), parameter) + } + }); + }; +} + +function JobExecutionProps(props) { + const { + element + } = props; + const businessObject = (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element); + const entries = []; + + // (1) add retryTimeCycle field for camunda:asyncCapable enabled Elements + // or TimerEvents + if ((0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.is)(element, 'camunda:AsyncCapable') && isAsync$1(businessObject) || isTimerEvent(element)) { + entries.push({ + id: 'retryTimeCycle', + component: RetryTimeCycle, + isEdited: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.isTextFieldEntryEdited + }); + } + + // (2) add jobPriority field for camunda:jobPriorized with async enabled + // or Processes + // or Processes referred to by participants + // or TimerEvents + if ((0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.is)(element, 'camunda:JobPriorized') && isAsync$1(businessObject) || (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.is)(element, 'bpmn:Process') || (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.is)(element, 'bpmn:Participant') && businessObject.get('processRef') || isTimerEvent(element)) { + entries.push({ + id: 'jobPriority', + component: JobPriority, + isEdited: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.isTextFieldEntryEdited + }); + } + return entries; +} +function JobPriority(props) { + const { + element + } = props; + const commandStack = useService('commandStack'), + translate = useService('translate'), + debounce = useService('debounceInput'); + const businessObject = (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.is)(element, 'bpmn:Participant') ? (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element).get('processRef') : (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element); + const getValue = () => { + return businessObject.get('camunda:jobPriority'); + }; + const setValue = value => { + commandStack.execute('element.updateModdleProperties', { + element, + moddleElement: businessObject, + properties: { + 'camunda:jobPriority': value + } + }); + }; + return (0,_bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.TextFieldEntry)({ + element, + id: 'jobPriority', + label: translate('Priority'), + getValue, + setValue, + debounce + }); +} +function RetryTimeCycle(props) { + const { + element + } = props; + const bpmnFactory = useService('bpmnFactory'), + commandStack = useService('commandStack'), + translate = useService('translate'), + debounce = useService('debounceInput'); + const businessObject = (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element); + const getValue = () => { + const failedJobRetryTimeCycle = getExtensionElementsList(businessObject, 'camunda:FailedJobRetryTimeCycle')[0]; + return failedJobRetryTimeCycle && failedJobRetryTimeCycle.body; + }; + const setValue = value => { + const commands = []; + let extensionElements = businessObject.get('extensionElements'); + + // (1) ensure extension elements + if (!extensionElements) { + extensionElements = createElement('bpmn:ExtensionElements', { + values: [] + }, businessObject, bpmnFactory); + commands.push({ + cmd: 'element.updateModdleProperties', + context: { + element, + moddleElement: businessObject, + properties: { + extensionElements + } + } + }); + } + + // (2) ensure failedJobRetryTimeCycle + let failedJobRetryTimeCycle = getExtensionElementsList(businessObject, 'camunda:FailedJobRetryTimeCycle')[0]; + if (!failedJobRetryTimeCycle) { + failedJobRetryTimeCycle = createElement('camunda:FailedJobRetryTimeCycle', {}, extensionElements, bpmnFactory); + commands.push({ + cmd: 'element.updateModdleProperties', + context: { + element, + moddleElement: extensionElements, + properties: { + values: [...extensionElements.get('values'), failedJobRetryTimeCycle] + } + } + }); + } + + // (3) update failedJobRetryTimeCycle value + commands.push({ + cmd: 'element.updateModdleProperties', + context: { + element, + moddleElement: failedJobRetryTimeCycle, + properties: { + body: value + } + } + }); + + // (4) commit all updates + commandStack.execute('properties-panel.multi-command-executor', commands); + }; + return (0,_bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.TextFieldEntry)({ + element, + id: 'retryTimeCycle', + label: translate('Retry time cycle'), + getValue, + setValue, + debounce + }); +} + +// helper ////////////////// + +/** + * @param {ModdleElement} bo + * @return {boolean} a boolean value + */ +function isAsyncBefore$1(bo) { + return !!(bo.get('camunda:asyncBefore') || bo.get('camunda:async')); +} - /** - * A handler capable of creating a new element under a provided parent - * and updating / creating a reference to it in one atomic action. - * - * @class - * @constructor - */ - function CreateAndReferenceElementHandler(elementRegistry, bpmnFactory) { - this._elementRegistry = elementRegistry; - this._bpmnFactory = bpmnFactory; - } +/** + * @param {ModdleElement} bo + * @return {boolean} + */ +function isAsyncAfter$1(bo) { + return !!bo.get('camunda:asyncAfter'); +} - CreateAndReferenceElementHandler.$inject = [ 'elementRegistry', 'bpmnFactory' ]; +/** + * isAsync - returns true if the attribute 'camunda:asyncAfter' or 'camunda:asyncBefore' + * is set to true. + * + * @param {ModdleElement} bo + * @return {boolean} + */ +function isAsync$1(bo) { + return isAsyncAfter$1(bo) || isAsyncBefore$1(bo); +} - module.exports = CreateAndReferenceElementHandler; +/** + * isTimerEvent - returns true if the element is a bpmn:Event with a timerEventDefinition + * + * @param {ModdleElement} element + * @return {boolean} + */ +function isTimerEvent(element) { + return (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.is)(element, 'bpmn:Event') && getTimerEventDefinition$1(element); +} +/** + * @typedef { import('@bpmn-io/properties-panel').EntryDefinition } Entry + */ -// api //////////////////// +/** + * @returns {Array} entries + */ +function MultiInstanceProps(props) { + const { + element + } = props; + const loopCharacteristics = getLoopCharacteristics(element); + let entries = props.entries || []; + if (!isMultiInstanceSupported(element)) { + return entries; + } + entries.push({ + id: 'collection', + component: Collection, + isEdited: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.isTextFieldEntryEdited + }, { + id: 'elementVariable', + component: ElementVariable, + isEdited: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.isTextFieldEntryEdited + }, { + id: 'multiInstanceAsynchronousBefore', + component: MultiInstanceAsynchronousBefore, + isEdited: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.isCheckboxEntryEdited + }, { + id: 'multiInstanceAsynchronousAfter', + component: MultiInstanceAsynchronousAfter, + isEdited: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.isCheckboxEntryEdited + }); + if (isAsync(loopCharacteristics)) { + entries.push({ + id: 'multiInstanceExclusive', + component: MultiInstanceExclusive, + isEdited: checkboxIsEditedInverted + }, { + id: 'multiInstanceRetryTimeCycle', + component: MultiInstanceRetryTimeCycle, + isEdited: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.isTextFieldEntryEdited + }); + } + return entries; +} +function Collection(props) { + const { + element + } = props; + const debounce = useService('debounceInput'); + const commandStack = useService('commandStack'); + const translate = useService('translate'); + const loopCharacteristics = getLoopCharacteristics(element); + const getValue = () => { + return getCollection(element); + }; + const setValue = value => { + return commandStack.execute('element.updateModdleProperties', { + element, + moddleElement: loopCharacteristics, + properties: { + 'camunda:collection': value + } + }); + }; + return (0,_bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.TextFieldEntry)({ + element, + id: 'collection', + label: translate('Collection'), + getValue, + setValue, + debounce + }); +} +function ElementVariable(props) { + const { + element + } = props; + const debounce = useService('debounceInput'); + const commandStack = useService('commandStack'); + const translate = useService('translate'); + const loopCharacteristics = getLoopCharacteristics(element); + const getValue = () => { + return getElementVariable(element); + }; + const setValue = value => { + return commandStack.execute('element.updateModdleProperties', { + element, + moddleElement: loopCharacteristics, + properties: { + 'camunda:elementVariable': value + } + }); + }; + return (0,_bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.TextFieldEntry)({ + element, + id: 'elementVariable', + label: translate('Element variable'), + getValue, + setValue, + debounce + }); +} +function MultiInstanceAsynchronousBefore(props) { + const { + element + } = props; + const commandStack = useService('commandStack'); + const translate = useService('translate'); + const loopCharacteristics = getLoopCharacteristics(element); + const getValue = () => { + return isAsyncBefore(loopCharacteristics); + }; + const setValue = value => { + // overwrite the legacy `async` property, we will use the more explicit `asyncBefore` + const properties = { + 'camunda:asyncBefore': value, + 'camunda:async': undefined + }; + commandStack.execute('element.updateModdleProperties', { + element, + moddleElement: loopCharacteristics, + properties + }); + }; + return (0,_bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.CheckboxEntry)({ + element, + id: 'multiInstanceAsynchronousBefore', + label: translate('Asynchronous before'), + getValue, + setValue + }); +} +function MultiInstanceAsynchronousAfter(props) { + const { + element + } = props; + const commandStack = useService('commandStack'); + const translate = useService('translate'); + const loopCharacteristics = getLoopCharacteristics(element); + const getValue = () => { + return isAsyncAfter(loopCharacteristics); + }; + const setValue = value => { + commandStack.execute('element.updateModdleProperties', { + element, + moddleElement: loopCharacteristics, + properties: { + 'camunda:asyncAfter': value + } + }); + }; + return (0,_bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.CheckboxEntry)({ + element, + id: 'multiInstanceAsynchronousAfter', + label: translate('Asynchronous after'), + getValue, + setValue + }); +} +function MultiInstanceExclusive(props) { + const { + element + } = props; + const commandStack = useService('commandStack'), + translate = useService('translate'); + const loopCharacteristics = getLoopCharacteristics(element); + const getValue = () => { + return isExclusive(loopCharacteristics); + }; + const setValue = value => { + commandStack.execute('element.updateModdleProperties', { + element, + moddleElement: loopCharacteristics, + properties: { + 'camunda:exclusive': value + } + }); + }; + return (0,_bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.CheckboxEntry)({ + element, + id: 'multiInstanceExclusive', + label: translate('Exclusive'), + getValue, + setValue + }); +} +function MultiInstanceRetryTimeCycle(props) { + const { + element + } = props; + const bpmnFactory = useService('bpmnFactory'), + commandStack = useService('commandStack'), + translate = useService('translate'), + debounce = useService('debounceInput'); + const loopCharacteristics = getLoopCharacteristics(element); + const getValue = () => { + const failedJobRetryTimeCycle = getExtensionElementsList(loopCharacteristics, 'camunda:FailedJobRetryTimeCycle')[0]; + return failedJobRetryTimeCycle && failedJobRetryTimeCycle.body; + }; + const setValue = value => { + const commands = []; + let extensionElements = loopCharacteristics.get('extensionElements'); + + // (1) ensure extension elements + if (!extensionElements) { + extensionElements = createElement('bpmn:ExtensionElements', { + values: [] + }, loopCharacteristics, bpmnFactory); + commands.push({ + cmd: 'element.updateModdleProperties', + context: { + element, + moddleElement: loopCharacteristics, + properties: { + extensionElements + } + } + }); + } + + // (2) ensure failedJobRetryTimeCycle + let failedJobRetryTimeCycle = getExtensionElementsList(loopCharacteristics, 'camunda:FailedJobRetryTimeCycle')[0]; + if (!failedJobRetryTimeCycle) { + failedJobRetryTimeCycle = createElement('camunda:FailedJobRetryTimeCycle', {}, extensionElements, bpmnFactory); + commands.push({ + cmd: 'element.updateModdleProperties', + context: { + element: loopCharacteristics, + moddleElement: extensionElements, + properties: { + values: [...extensionElements.get('values'), failedJobRetryTimeCycle] + } + } + }); + } + + // (3) update failedJobRetryTimeCycle value + commands.push({ + cmd: 'element.updateModdleProperties', + context: { + element, + moddleElement: failedJobRetryTimeCycle, + properties: { + body: value + } + } + }); + + // (4) commit all updates + commandStack.execute('properties-panel.multi-command-executor', commands); + }; + return (0,_bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.TextFieldEntry)({ + element, + id: 'multiInstanceRetryTimeCycle', + label: translate('Retry time cycle'), + getValue, + setValue, + debounce + }); +} + +// helper //////////////////////////// + +// generic /////////////////////////// + +/** + * isMultiInstanceSupported - check whether given element supports camunda specific props + * for multiInstance (ref. ). + * + * @param {djs.model.Base} element + * @return {boolean} + */ +function isMultiInstanceSupported(element) { + const loopCharacteristics = getLoopCharacteristics(element); + return !!loopCharacteristics && (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.is)(loopCharacteristics, 'camunda:Collectable'); +} - /** - * Creates a new element under a provided parent and updates / creates a reference to it in - * one atomic action. - * - * @method CreateAndReferenceElementHandler#execute - * - * @param {Object} context - * @param {djs.model.Base} context.element which is the context for the reference - * @param {moddle.referencingObject} context.referencingObject the object which creates the reference - * @param {String} context.referenceProperty the property of the referencingObject which makes the reference - * @param {moddle.newObject} context.newObject the new object to add - * @param {moddle.newObjectContainer} context.newObjectContainer the container for the new object - * - * @returns {Array} the updated element - */ - CreateAndReferenceElementHandler.prototype.execute = function(context) { +/** + * getProperty - get a property value of the loop characteristics. + * + * @param {djs.model.Base} element + * @param {string} propertyName + * + * @return {any} the property value + */ +function getProperty(element, propertyName) { + var loopCharacteristics = getLoopCharacteristics(element); + return loopCharacteristics && loopCharacteristics.get(propertyName); +} - var referencingObject = ensureNotNull(context.referencingObject, 'referencingObject'), - referenceProperty = ensureNotNull(context.referenceProperty, 'referenceProperty'), - newObject = ensureNotNull(context.newObject, 'newObject'), - newObjectContainer = ensureNotNull(context.newObjectContainer, 'newObjectContainer'), - newObjectParent = ensureNotNull(context.newObjectParent, 'newObjectParent'), - changed = [ context.element ]; // this will not change any diagram-js elements +/** + * getLoopCharacteristics - get loopCharacteristics of a given element. + * + * @param {djs.model.Base} element + * @return {ModdleElement | undefined} + */ +function getLoopCharacteristics(element) { + const bo = (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element); + return bo.loopCharacteristics; +} - // create new object - var referencedObject = elementHelper - .createElement(newObject.type, newObject.properties, newObjectParent, this._bpmnFactory); - context.referencedObject = referencedObject; +// collection - // add to containing list - newObjectContainer.push(referencedObject); +/** + * getCollection - get the 'camunda:collection' attribute value of the loop characteristics. + * + * @param {djs.model.Base} element + * + * @return {string} the 'camunda:collection' value + */ +function getCollection(element) { + return getProperty(element, 'camunda:collection'); +} - // adjust reference attribute - context.previousReference = referencingObject[referenceProperty]; - referencingObject[referenceProperty] = referencedObject; +// elementVariable - context.changed = changed; +/** + * getElementVariable - get the 'camunda:elementVariable' attribute value of the loop characteristics. + * + * @param {djs.model.Base} element + * + * @return {string} the 'camunda:elementVariable' value + */ +function getElementVariable(element) { + return getProperty(element, 'camunda:elementVariable'); +} - // indicate changed on objects affected by the update - return changed; - }; +// asyncBefore asyncAfter - /** - * Reverts the update - * - * @method CreateAndReferenceElementHandler#revert - * - * @param {Object} context - * - * @returns {djs.mode.Base} the updated element - */ - CreateAndReferenceElementHandler.prototype.revert = function(context) { +/** + * Returns true if the attribute 'camunda:asyncBefore' is set + * to true. + * + * @param {ModdleElement} bo + * + * @return {boolean} a boolean value + */ +function isAsyncBefore(bo) { + return !!(bo.get('camunda:asyncBefore') || bo.get('camunda:async')); +} - var referencingObject = context.referencingObject, - referenceProperty = context.referenceProperty, - previousReference = context.previousReference, - referencedObject = context.referencedObject, - newObjectContainer = context.newObjectContainer; +/** + * Returns true if the attribute 'camunda:asyncAfter' is set + * to true. + * + * @param {ModdleElement} bo + * + * @return {boolean} a boolean value + */ +function isAsyncAfter(bo) { + return !!bo.get('camunda:asyncAfter'); +} - // reset reference - referencingObject.set(referenceProperty, previousReference); +/** + * Returns true if the attribute 'camunda:exclusive' is set + * to true. + * + * @param {ModdleElement} bo + * + * @return {boolean} a boolean value + */ +function isExclusive(bo) { + return !!bo.get('camunda:exclusive'); +} - // remove new element - newObjectContainer.splice(newObjectContainer.indexOf(referencedObject), 1); +/** + * isAsync - returns true if the attribute 'camunda:asyncAfter' or 'camunda:asyncBefore' + * is set to true. + * + * @param {ModdleElement} bo + * @return {boolean} + */ +function isAsync(bo) { + return isAsyncAfter(bo) || isAsyncBefore(bo); +} - return context.changed; - }; +// Checkbox +function checkboxIsEditedInverted(node) { + return node && !node.checked; +} +/** + * Cf. https://docs.camunda.org/manual/7.15/reference/bpmn20/subprocesses/call-activity/#passing-variables + */ +function OutMappingPropagationProps(props) { + const { + element + } = props; + if (!areOutMappingsSupported$1(element)) { + return []; + } + const entries = [{ + id: 'outMapping-propagation', + component: PropagateAll, + isEdited: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.isCheckboxEntryEdited + }]; + if (isPropagateAll(element)) { + entries.push({ + id: 'outMapping-propagation-local', + component: Local, + isEdited: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.isCheckboxEntryEdited + }); + } + return entries; +} +function PropagateAll(props) { + const { + element + } = props; + const commandStack = useService('commandStack'); + const bpmnFactory = useService('bpmnFactory'); + const translate = useService('translate'); + const getValue = () => { + return isPropagateAll(element); + }; + const setValue = value => { + if (value) { + addOutMapping(); + } else { + removeOutMapping(); + } + }; + function addOutMapping() { + const businessObject = (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element); + const mapping = createElement('camunda:Out', { + variables: 'all' + }, null, bpmnFactory); + addExtensionElements(element, businessObject, mapping, bpmnFactory, commandStack); + } + function removeOutMapping() { + const businessObject = (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element); + const mappings = findRelevantOutMappings(element); + removeExtensionElements(element, businessObject, mappings, commandStack); + } + return (0,_bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.CheckboxEntry)({ + id: 'outMapping-propagation', + label: translate('Propagate all variables'), + getValue, + setValue + }); +} +function Local(props) { + const { + element + } = props; + const commandStack = useService('commandStack'); + const translate = useService('translate'); + const mapping = findRelevantOutMappings(element)[0]; + const getValue = () => { + return mapping.get('camunda:local'); + }; + const setValue = value => { + commandStack.execute('element.updateModdleProperties', { + element, + moddleElement: mapping, + properties: { + local: value + } + }); + }; + return (0,_bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.CheckboxEntry)({ + element, + id: 'outMapping-propagation-local', + label: translate('Local'), + getValue, + setValue + }); +} + +// helper ////////////////////////// + +function areOutMappingsSupported$1(element) { + return (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.is)(element, 'bpmn:CallActivity'); +} +function getOutMappings$1(element) { + const businessObject = (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element); + return getExtensionElementsList(businessObject, 'camunda:Out'); +} +function findRelevantOutMappings(element) { + const inMappings = getOutMappings$1(element); + return (0,min_dash__WEBPACK_IMPORTED_MODULE_12__.filter)(inMappings, function (mapping) { + const variables = mapping.get('variables'); + return variables && variables === 'all'; + }); +} +function isPropagateAll(element) { + const mappings = findRelevantOutMappings(element); + return !!mappings.length; +} + +/** + * Cf. https://docs.camunda.org/manual/latest/reference/bpmn20/custom-extensions/extension-elements/#out + */ +function OutMappingProps({ + element, + injector +}) { + if (!areOutMappingsSupported(element)) { + return null; + } + const variableMappings = getOutMappings(element) || []; + const bpmnFactory = injector.get('bpmnFactory'), + commandStack = injector.get('commandStack'); + const items = variableMappings.map((mapping, index) => { + const id = element.id + '-outMapping-' + index; + return { + id, + label: mapping.get('target') || '', + entries: InOutMapping({ + idPrefix: id, + element, + mapping + }), + autoFocusEntry: id + '-target', + remove: removeFactory$1({ + commandStack, + element, + mapping + }) + }; + }); + return { + items, + add: addFactory$1({ + bpmnFactory, + commandStack, + element + }) + }; +} +function removeFactory$1({ + commandStack, + element, + mapping +}) { + return function (event) { + event.stopPropagation(); + const businessObject = (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element); + removeExtensionElements(element, businessObject, mapping, commandStack); + }; +} +function addFactory$1({ + bpmnFactory, + commandStack, + element +}) { + return function (event) { + event.stopPropagation(); + const businessObject = (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element); + const newMapping = createElement('camunda:Out', { + source: '' // source is the default type + }, null, bpmnFactory); + addExtensionElements(element, businessObject, newMapping, bpmnFactory, commandStack); + }; +} + +// helper /////////////// + +function getOutMappings(element) { + const businessObject = (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element); + const mappings = getExtensionElementsList(businessObject, 'camunda:Out'); + + // only retrieve relevant mappings here, others are handled in other groups + // mapping.businessKey => camunda-platform/CallAvtivityProps + // mapping.variables => camunda-platform/OutMappingPropagationProps + return (0,min_dash__WEBPACK_IMPORTED_MODULE_12__.filter)(mappings, function (mapping) { + return !mapping.businessKey && !(mapping.variables && mapping.variables === 'all'); + }); +} +function areOutMappingsSupported(element) { + return (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.is)(element, 'bpmn:CallActivity'); +} + +function OutputProps({ + element, + injector +}) { + if (!areOutputParametersSupported(element)) { + return null; + } + const outputParameters = getOutputParameters(element) || []; + const bpmnFactory = injector.get('bpmnFactory'), + commandStack = injector.get('commandStack'); + const items = outputParameters.map((parameter, index) => { + const id = element.id + '-outputParameter-' + index; + return { + id, + label: parameter.get('name') || '', + entries: InputOutputParameter({ + idPrefix: id, + element, + parameter + }), + autoFocusEntry: id + '-name', + remove: removeFactory({ + commandStack, + element, + parameter + }) + }; + }); + return { + items, + add: addFactory({ + bpmnFactory, + commandStack, + element + }), + shouldSort: false + }; +} +function removeFactory({ + commandStack, + element, + parameter +}) { + return function (event) { + event.stopPropagation(); + const inputOutput = getInputOutput(element); + if (!inputOutput) { + return; + } + commandStack.execute('element.updateModdleProperties', { + element, + moddleElement: inputOutput, + properties: { + outputParameters: (0,min_dash__WEBPACK_IMPORTED_MODULE_12__.without)(inputOutput.get('outputParameters'), parameter) + } + }); + }; +} +function addFactory({ + bpmnFactory, + commandStack, + element +}) { + return function (event) { + event.stopPropagation(); + commandStack.execute('properties-panel.multi-command-executor', AddParameterCmd(element, 'camunda:OutputParameter', bpmnFactory)); + }; +} + +function TimerProps(props) { + const { + element, + listener, + idPrefix + } = props; + let { + timerEventDefinition + } = props; + if (!timerEventDefinition) { + const businessObject = (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element); + timerEventDefinition = getTimerEventDefinition(businessObject); + } + const timerEventDefinitionType = getTimerDefinitionType(timerEventDefinition); + + // (1) Only show for supported elements + if (!isTimerSupported(element) && !isTimerSupportedOnListener(listener)) { + return []; + } + + // (2) Provide entries, have a value only if selection was made + const entries = []; + entries.push({ + id: getId(idPrefix, 'timerEventDefinitionType'), + component: TimerEventDefinitionType, + isEdited: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.isSelectEntryEdited, + timerEventDefinition, + timerEventDefinitionType + }); + if (timerEventDefinitionType) { + entries.push({ + id: getId(idPrefix, 'timerEventDefinitionValue'), + component: TimerEventDefinitionValue, + isEdited: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.isTextFieldEntryEdited, + timerEventDefinition, + timerEventDefinitionType + }); + } + return entries; +} + +/** + * TimerEventDefinitionType - Generic select entry allowing to select a specific + * timerEventDefintionType. To be used together with timerEventDefinitionValue. + * + * @param {type} props + * @return {SelectEntry} + */ +function TimerEventDefinitionType(props) { + const { + element, + timerEventDefinition, + timerEventDefinitionType + } = props; + const commandStack = useService('commandStack'), + bpmnFactory = useService('bpmnFactory'), + translate = useService('translate'); + const getValue = () => { + return timerEventDefinitionType || ''; + }; + const setValue = value => { + // (1) Check if value is different to current type + if (value === timerEventDefinitionType) { + return; + } + + // (2) Create empty formalExpression element + const formalExpression = bpmnFactory.create('bpmn:FormalExpression', { + body: undefined + }); + formalExpression.$parent = timerEventDefinition; + + // (3) Set the value for selected timerEventDefinitionType + const newProps = { + timeDuration: undefined, + timeDate: undefined, + timeCycle: undefined + }; + if (value !== '') { + newProps[value] = formalExpression; + } + + // (4) Execute businessObject update + commandStack.execute('element.updateModdleProperties', { + element, + moddleElement: timerEventDefinition, + properties: newProps + }); + }; + const getOptions = element => { + return [{ + value: '', + label: translate('') + }, { + value: 'timeDate', + label: translate('Date') + }, { + value: 'timeDuration', + label: translate('Duration') + }, { + value: 'timeCycle', + label: translate('Cycle') + }]; + }; + return (0,_bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.SelectEntry)({ + element, + id: 'timerEventDefinitionType', + label: translate('Type'), + getValue, + setValue, + getOptions + }); +} + +/** + * TimerEventDefinitionValue - Generic textField entry allowing to specify the + * timerEventDefintionValue based on the set timerEventDefintionType. To be used + * together with timerEventDefinitionType. + * + * @param {type} props + * @return {TextFieldEntry} + */ +function TimerEventDefinitionValue(props) { + const { + element, + timerEventDefinition, + timerEventDefinitionType + } = props; + const commandStack = useService('commandStack'), + translate = useService('translate'), + debounce = useService('debounceInput'); + const timerEventFormalExpression = timerEventDefinition.get(timerEventDefinitionType); + const getValue = () => { + return timerEventFormalExpression && timerEventFormalExpression.get('body'); + }; + const setValue = value => { + commandStack.execute('element.updateModdleProperties', { + element, + moddleElement: timerEventFormalExpression, + properties: { + body: value + } + }); + }; + return (0,_bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.TextFieldEntry)({ + element, + id: 'timerEventDefinitionValue', + label: translate('Value'), + getValue, + setValue, + debounce, + tooltip: getTimerEventDefinitionValueDescription(timerEventDefinitionType, translate) + }); +} + +// helper ////////////////////////// + +function getTimerEventDefinitionValueDescription(timerDefinitionType, translate) { + switch (timerDefinitionType) { + case 'timeDate': + return (0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("div", { + children: [(0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("p", { + children: translate('A specific point in time defined as ISO 8601 combined date and time representation.') + }), (0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("ul", { + children: [(0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("li", { + children: [(0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("code", { + children: "2019-10-01T12:00:00Z" + }), " - ", translate('UTC time')] + }), (0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("li", { + children: [(0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("code", { + children: "2019-10-02T08:09:40+02:00" + }), " - ", translate('UTC plus 2 hours zone offset')] + })] + }), (0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("a", { + href: "https://docs.camunda.org/manual/latest/reference/bpmn20/events/timer-events/#time-date", + target: "_blank", + rel: "noopener", + children: translate('Documentation: Timer events') + })] + }); + case 'timeCycle': + return (0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("div", { + children: [(0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("p", { + children: translate('A cycle defined as ISO 8601 repeating intervals format, or a cron expression.') + }), (0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("ul", { + children: [(0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("li", { + children: [(0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("code", { + children: "R5/PT10S" + }), " - ", translate('every 10 seconds, up to 5 times')] + }), (0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("li", { + children: [(0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("code", { + children: "R/P1D" + }), " - ", translate('every day, infinitely')] + }), (0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("li", { + children: [(0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("code", { + children: "0 0 9-17 * * MON-FRI" + }), " - ", translate('every hour on the hour from 9-5 p.m. UTC Monday-Friday')] + })] + }), (0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("a", { + href: "https://docs.camunda.org/manual/latest/reference/bpmn20/events/timer-events/#time-cycle", + target: "_blank", + rel: "noopener", + children: translate('Documentation: Timer events') + })] + }); + case 'timeDuration': + return (0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("div", { + children: [(0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("p", { + children: translate('A time duration defined as ISO 8601 durations format.') + }), (0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("ul", { + children: [(0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("li", { + children: [(0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("code", { + children: "PT15S" + }), " - ", translate('15 seconds')] + }), (0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("li", { + children: [(0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("code", { + children: "PT1H30M" + }), " - ", translate('1 hour and 30 minutes')] + }), (0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("li", { + children: [(0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("code", { + children: "P14D" + }), " - ", translate('14 days')] + })] + }), (0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("a", { + href: "https://docs.camunda.org/manual/latest/reference/bpmn20/events/timer-events/#time-duration", + target: "_blank", + rel: "noopener", + children: translate('Documentation: Timer events') + })] + }); + } +} +function isTimerSupportedOnListener(listener) { + return listener && (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.is)(listener, 'camunda:TaskListener') && getTimerEventDefinition(listener); +} +function getId(idPrefix, id) { + return idPrefix ? idPrefix + id : id; +} + +const LISTENER_ALLOWED_TYPES = ['bpmn:Activity', 'bpmn:Event', 'bpmn:Gateway', 'bpmn:SequenceFlow', 'bpmn:Process', 'bpmn:Participant']; +const SCRIPT_PROPS = { + 'script': undefined, + 'resource': undefined, + 'scriptFormat': undefined +}; +const CLASS_PROPS = { + 'class': undefined +}; +const EXPRESSION_PROPS = { + 'expression': undefined +}; +const DELEGATE_EXPRESSION_PROPS = { + 'delegateExpression': undefined +}; +const DEFAULT_PROPS = { + ...SCRIPT_PROPS, + ...CLASS_PROPS, + ...EXPRESSION_PROPS, + ...DELEGATE_EXPRESSION_PROPS +}; +const DEFAULT_EVENT_PROPS = { + 'eventDefinitions': undefined, + 'event': undefined +}; +const IMPLEMENTATION_TYPE_TO_LABEL = { + class: 'Java class', + expression: 'Expression', + delegateExpression: 'Delegate expression', + script: 'Script' +}; +const EVENT_TO_LABEL = { + start: 'Start', + end: 'End', + take: 'Take', + create: 'Create', + assignment: 'Assignment', + complete: 'Complete', + delete: 'Delete', + update: 'Update', + timeout: 'Timeout' +}; + +/** + * Cf. https://docs.camunda.org/manual/latest/user-guide/process-engine/delegation-code/#execution-listener + */ +function ExecutionListenerProps({ + element, + injector +}) { + if (!(0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.isAny)(element, LISTENER_ALLOWED_TYPES)) { + return; + } + const bpmnFactory = injector.get('bpmnFactory'), + commandStack = injector.get('commandStack'); + if ((0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.is)(element, 'bpmn:Participant') && !element.businessObject.processRef) { + return; + } + const businessObject = getListenersContainer(element); + const listeners = getExtensionElementsList(businessObject, 'camunda:ExecutionListener'); + return { + items: listeners.map((listener, index) => { + const id = `${element.id}-executionListener-${index}`; + + // @TODO(barmac): Find a way to pass translate for internationalized label. + return { + id, + label: getListenerLabel(listener), + entries: ExecutionListener({ + idPrefix: id, + element, + listener + }), + remove: removeListenerFactory({ + element, + listener, + commandStack + }) + }; + }), + add: addExecutionListenerFactory({ + bpmnFactory, + commandStack, + element + }) + }; +} +function ExecutionListener(props) { + const { + idPrefix, + element, + listener + } = props; + return [{ + id: `${idPrefix}-eventType`, + component: EventType, + listener + }, { + id: `${idPrefix}-listenerType`, + component: ListenerType, + listener + }, ...ImplementationDetails({ + idPrefix, + element, + listener + }), { + id: `${idPrefix}-fields`, + component: Fields, + listener + }]; +} +function TaskListenerProps({ + element, + injector +}) { + if (!(0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.is)(element, 'bpmn:UserTask')) { + return; + } + const bpmnFactory = injector.get('bpmnFactory'), + commandStack = injector.get('commandStack'); + const businessObject = getListenersContainer(element); + const listeners = getExtensionElementsList(businessObject, 'camunda:TaskListener'); + return { + items: listeners.map((listener, index) => { + const id = `${element.id}-taskListener-${index}`; + + // @TODO(barmac): Find a way to pass translate for internationalized label. + return { + id, + label: getListenerLabel(listener), + entries: TaskListener({ + idPrefix: id, + element, + listener + }), + remove: removeListenerFactory({ + element, + listener, + commandStack + }) + }; + }), + add: addTaskListenerFactory({ + bpmnFactory, + commandStack, + element + }) + }; +} +function TaskListener(props) { + const { + idPrefix, + element, + listener + } = props; + return [{ + id: `${idPrefix}-eventType`, + component: EventType, + listener + }, { + id: `${idPrefix}-listenerId`, + component: ListenerId, + listener + }, { + id: `${idPrefix}-listenerType`, + component: ListenerType, + listener + }, ...ImplementationDetails({ + idPrefix, + element, + listener + }), ...EventTypeDetails({ + idPrefix, + element, + listener + }), { + id: `${idPrefix}-fields`, + component: Fields, + listener + }]; +} +function removeListenerFactory({ + element, + listener, + commandStack +}) { + return function removeListener(event) { + event.stopPropagation(); + removeExtensionElements(element, getListenersContainer(element), listener, commandStack); + }; +} +function EventType({ + id, + element, + listener +}) { + const translate = useService('translate'); + const bpmnFactory = useService('bpmnFactory'); + const commandStack = useService('commandStack'); + function getValue() { + return listener.get('event'); + } + function setValue(value) { + const properties = getDefaultEventTypeProperties(value, bpmnFactory); + commandStack.execute('element.updateModdleProperties', { + element, + moddleElement: listener, + properties + }); + } + function getOptions() { + if ((0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.is)(listener, 'camunda:TaskListener')) { + return [{ + value: 'create', + label: translate('create') + }, { + value: 'assignment', + label: translate('assignment') + }, { + value: 'complete', + label: translate('complete') + }, { + value: 'delete', + label: translate('delete') + }, { + value: 'update', + label: translate('update') + }, { + value: 'timeout', + label: translate('timeout') + }]; + } + if ((0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.is)(element, 'bpmn:SequenceFlow')) { + return [{ + value: 'take', + label: translate('take') + }]; + } + return [{ + value: 'start', + label: translate('start') + }, { + value: 'end', + label: translate('end') + }]; + } + return (0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.SelectEntry, { + id: id, + label: translate('Event type'), + getValue: getValue, + setValue: setValue, + getOptions: getOptions + }); +} +function ListenerId({ + id, + element, + listener +}) { + const translate = useService('translate'); + const debounce = useService('debounceInput'); + const commandStack = useService('commandStack'); + let options = { + element, + id: id, + label: translate('Listener ID'), + debounce, + isEdited: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.isTextFieldEntryEdited, + setValue: value => { + commandStack.execute('element.updateModdleProperties', { + element, + moddleElement: listener, + properties: { + 'camunda:id': value + } + }); + }, + getValue: () => { + return listener.get('camunda:id'); + } + }; + return (0,_bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.TextFieldEntry)(options); +} +function ListenerType({ + id, + element, + listener +}) { + const modeling = useService('modeling'); + const translate = useService('translate'); + const bpmnFactory = useService('bpmnFactory'); + function getValue() { + return getListenerType(listener); + } + function setValue(value) { + const properties = getDefaultImplementationProperties(value, bpmnFactory); + modeling.updateModdleProperties(element, listener, properties); + } + function getOptions() { + return getListenerTypeOptions(translate); + } + return (0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.SelectEntry, { + id: id, + label: translate('Listener type'), + getValue: getValue, + setValue: setValue, + getOptions: getOptions + }); +} +function ImplementationDetails(props) { + const { + idPrefix, + element, + listener + } = props; + const type = getListenerType(listener); + if (type === 'class') { + return [{ + id: getPrefixedId(idPrefix, 'javaClass'), + component: JavaClass, + businessObject: listener + }]; + } else if (type === 'expression') { + return [{ + id: getPrefixedId(idPrefix, 'expression'), + component: Expression, + businessObject: listener + }]; + } else if (type === 'delegateExpression') { + return [{ + id: getPrefixedId(idPrefix, 'delegateExpression'), + component: DelegateExpression, + businessObject: listener + }]; + } else if (type === 'script') { + return ScriptProps({ + element, + script: listener.get('script'), + prefix: idPrefix + }); + } + + // should never happen + return []; +} +function EventTypeDetails(props) { + const { + idPrefix, + element, + listener + } = props; + const type = listener.get('event'); + if (type === 'timeout') { + return TimerProps({ + element, + listener, + timerEventDefinition: getTimerEventDefinition$1(listener), + idPrefix: idPrefix + }); + } + return []; +} +function Field(props) { + const { + element, + id: idPrefix, + index, + item: field, + open + } = props; + const fieldId = `${idPrefix}-field-${index}`; + return (0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.CollapsibleEntry, { + id: fieldId, + element: element, + entries: FieldInjection({ + element, + field, + idPrefix: fieldId + }), + label: field.get('name') || '', + open: open + }); +} +function Fields(props) { + const { + id, + element, + listener + } = props; + const bpmnFactory = useService('bpmnFactory'); + const commandStack = useService('commandStack'); + const translate = useService('translate'); + const fields = listener.get('fields'); + function addField() { + const field = createElement('camunda:Field', {}, listener, bpmnFactory); + commandStack.execute('element.updateModdleProperties', { + element, + moddleElement: listener, + properties: { + fields: [...listener.get('fields'), field] + } + }); + } + function removeField(field) { + commandStack.execute('element.updateModdleProperties', { + element, + moddleElement: listener, + properties: { + fields: (0,min_dash__WEBPACK_IMPORTED_MODULE_12__.without)(listener.get('fields'), field) + } + }); + } + return (0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.ListEntry, { + id: id, + element: element, + label: translate('Field injection'), + items: fields, + component: Field, + onAdd: addField, + onRemove: removeField, + compareFn: compareName, + autoFocusEntry: true + }); +} +function addListenerFactory({ + bpmnFactory, + commandStack, + element, + listenerGroup +}) { + return function (event) { + event.stopPropagation(); + const listener = bpmnFactory.create(listenerGroup, { + event: getDefaultEvent(element, listenerGroup), + class: '' + }); + const businessObject = getListenersContainer(element); + addExtensionElements(element, businessObject, listener, bpmnFactory, commandStack); + }; +} +function addTaskListenerFactory(props) { + return addListenerFactory({ + ...props, + listenerGroup: 'camunda:TaskListener' + }); +} +function addExecutionListenerFactory(props) { + return addListenerFactory({ + ...props, + listenerGroup: 'camunda:ExecutionListener' + }); +} + +// helper + +/** + * Get a readable label for a listener. + * + * @param {ModdleElement} listener + * @param {string => string} [translate] + */ +function getListenerLabel(listener, translate = value => value) { + const event = listener.get('event'); + const implementationType = getListenerType(listener); + return `${translate(EVENT_TO_LABEL[event])}: ${translate(IMPLEMENTATION_TYPE_TO_LABEL[implementationType])}`; +} +function getListenerTypeOptions(translate) { + return Object.entries(IMPLEMENTATION_TYPE_TO_LABEL).map(([value, label]) => ({ + value, + label: translate(label) + })); +} +function getListenerType(listener) { + return getImplementationType(listener); +} +function getDefaultEvent(element, listenerGroup) { + if (listenerGroup === 'camunda:TaskListener') return 'create'; + return (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.is)(element, 'bpmn:SequenceFlow') ? 'take' : 'start'; +} +function getDefaultImplementationProperties(type, bpmnFactory) { + switch (type) { + case 'class': + return { + ...DEFAULT_PROPS, + 'class': '' + }; + case 'expression': + return { + ...DEFAULT_PROPS, + 'expression': '' + }; + case 'delegateExpression': + return { + ...DEFAULT_PROPS, + 'delegateExpression': '' + }; + case 'script': + return { + ...DEFAULT_PROPS, + 'script': bpmnFactory.create('camunda:Script') + }; + } +} +function getDefaultEventTypeProperties(type, bpmnFactory) { + switch (type) { + case 'timeout': + return { + ...DEFAULT_EVENT_PROPS, + eventDefinitions: [bpmnFactory.create('bpmn:TimerEventDefinition')], + event: type + }; + default: + return { + ...DEFAULT_EVENT_PROPS, + event: type + }; + } +} +function getPrefixedId(prefix, id) { + return `${prefix}-${id}`; +} +function compareName(field, anotherField) { + const [name = '', anotherName = ''] = [field.name, anotherField.name]; + return name === anotherName ? 0 : name > anotherName ? 1 : -1; +} +function getListenersContainer(element) { + const businessObject = (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element); + return businessObject.get('processRef') || businessObject; +} + +function ProcessVariablesEntry(props) { + const { + element + } = props; + const [variables, setVariables] = (0,_bpmn_io_properties_panel_preact_hooks__WEBPACK_IMPORTED_MODULE_0__.useState)([]); + (0,_bpmn_io_properties_panel_preact_hooks__WEBPACK_IMPORTED_MODULE_0__.useEffect)(async () => { + const businessObject = (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element); + const rootElement = getRootElement(businessObject); + const scope = getScope(element); + const rawVariables = await (0,_bpmn_io_extract_process_variables__WEBPACK_IMPORTED_MODULE_8__.getVariablesForScope)(scope, rootElement); + const withName = populateElementNames(sortByName(rawVariables)); + setVariables(withName); + }, [element]); + if (!variables.length) { + return null; + } + const byScope = groupByScope(variables); + const multiScope = isMultiScope(byScope); + let variableItems = []; + + // (2) get variables to display + if (multiScope) { + // (2a) multiple scopes, sub scopes first + // assumption: variables extractor fetches parent variables first + const reversed = (0,min_dash__WEBPACK_IMPORTED_MODULE_12__.map)(reverse((0,min_dash__WEBPACK_IMPORTED_MODULE_12__.keys)(byScope)), scopeKey => byScope[scopeKey]); + variableItems = (0,min_dash__WEBPACK_IMPORTED_MODULE_12__.flatten)(reversed); + } else { + // (2b) single scope + variableItems = variables; + } + const items = variableItems.map((variable, index) => { + const id = element.id + '-variable-' + index; + return { + id, + label: variable.name, + entries: [...ProcessVariableItem({ + idPrefix: id, + multiScope, + variable + })] + }; + }); + return (0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.ListGroup, { + ...props, + items: items, + shouldSort: false + }); +} +function ProcessVariablesProps(props) { + const { + element + } = props; + if (!canHaveProcessVariables(element)) { + return null; + } + return { + component: ProcessVariablesEntry, + shouldSort: false + }; +} +function ProcessVariableItem(props) { + const { + idPrefix, + multiScope, + variable + } = props; + let entries = []; + if (multiScope) { + entries.push({ + id: idPrefix + '-scope', + component: Scope, + idPrefix, + variable + }); + } + entries.push({ + id: idPrefix + '-createdIn', + component: CreatedIn, + idPrefix, + variable + }); + return entries; +} +function Scope(props) { + const { + idPrefix, + variable + } = props; + const translate = useService('translate'); + const id = idPrefix + '-scope'; + return (0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("div", { + "data-entry-id": id, + class: "bio-properties-panel-entry", + children: [(0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("b", { + style: "font-weight: bold", + class: "bio-properties-panel-label", + children: translate('Scope') + }), (0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("label", { + id: prefixId(id), + class: "bio-properties-panel-label", + children: variable.scope + })] + }); +} +function CreatedIn(props) { + const { + idPrefix, + variable + } = props; + const translate = useService('translate'); + const id = idPrefix + '-createdIn'; + const origin = variable.origin.join(', '); + return (0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("div", { + "data-entry-id": id, + class: "bio-properties-panel-entry", + children: [(0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("b", { + style: "font-weight: bold", + class: "bio-properties-panel-label", + children: translate('Created in') + }), (0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("label", { + id: prefixId(id), + class: "bio-properties-panel-label", + children: origin + })] + }); +} + +// helper ////////////////////// + +function canHaveProcessVariables(element) { + const businessObject = (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element); + return (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.isAny)(element, ['bpmn:Process', 'bpmn:SubProcess']) || (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.is)(element, 'bpmn:Participant') && businessObject.get('processRef'); +} +function getRootElement(element) { + const businessObject = (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element); + if ((0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.is)(businessObject, 'bpmn:Participant')) { + return businessObject.processRef; + } + if ((0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.is)(businessObject, 'bpmn:Process')) { + return businessObject; + } + let parent = businessObject; + while (parent.$parent && !(0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.is)(parent, 'bpmn:Process')) { + parent = parent.$parent; + } + return parent; +} +function getScope(element) { + const bo = (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element); + if ((0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.is)(element, 'bpmn:Participant')) { + return bo.processRef.id; + } + return bo.id; +} +function sortByName(variables) { + return (0,min_dash__WEBPACK_IMPORTED_MODULE_12__.sortBy)(variables, function (variable) { + return variable.name; + }); +} +function groupByScope(variables) { + return (0,min_dash__WEBPACK_IMPORTED_MODULE_12__.groupBy)(variables, 'scope'); +} +function populateElementNames(variables) { + (0,min_dash__WEBPACK_IMPORTED_MODULE_12__.forEach)(variables, function (variable) { + const names = (0,min_dash__WEBPACK_IMPORTED_MODULE_12__.map)(variable.origin, function (element) { + return element.name || element.id; + }); + variable.origin = names; + variable.scope = variable.scope.name || variable.scope.id; + }); + return variables; +} +function isMultiScope(scopedVariables) { + return (0,min_dash__WEBPACK_IMPORTED_MODULE_12__.keys)(scopedVariables).length > 1; +} +function reverse(array) { + return (0,min_dash__WEBPACK_IMPORTED_MODULE_12__.map)(array, function (a, i) { + return array[array.length - 1 - i]; + }); +} +function prefixId(id) { + return `bio-properties-panel-${id}`; +} + +function ScriptTaskProps(props) { + const { + element + } = props; + if (!(0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.is)(element, 'bpmn:ScriptTask')) { + return []; + } + const entries = [...ScriptProps({ + element + })]; + entries.push({ + id: 'scriptResultVariable', + component: ResultVariable, + isEdited: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.isTextFieldEntryEdited + }); + return entries; +} +function ResultVariable(props) { + const { + element + } = props; + const commandStack = useService('commandStack'); + const translate = useService('translate'); + const debounce = useService('debounceInput'); + const businessObject = (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element); + const getValue = () => { + return businessObject.get('camunda:resultVariable'); + }; + const setValue = value => { + commandStack.execute('element.updateModdleProperties', { + element, + moddleElement: businessObject, + properties: { + 'camunda:resultVariable': value + } + }); + }; + return (0,_bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.TextFieldEntry)({ + element, + id: 'scriptResultVariable', + label: translate('Result variable'), + getValue, + setValue, + debounce + }); +} + +function TasklistProps(props) { + const { + element + } = props; + const businessObject = (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element); + const isEdited = node => { + return node && !node.checked; + }; + if (!(0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.is)(element, 'bpmn:Process') && !((0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.is)(element, 'bpmn:Participant') && businessObject.get('processRef'))) { + return []; + } + return [{ + id: 'isStartableInTasklist', + component: Startable, + isEdited + }]; +} +function Startable(props) { + const { + element + } = props; + const commandStack = useService('commandStack'); + const translate = useService('translate'); + const process = getProcess$1(element); + const getValue = () => { + return process.get('camunda:isStartableInTasklist'); + }; + const setValue = value => { + commandStack.execute('element.updateModdleProperties', { + element, + moddleElement: process, + properties: { + 'camunda:isStartableInTasklist': value + } + }); + }; + return (0,_bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.CheckboxEntry)({ + element, + id: 'isStartableInTasklist', + label: translate('Startable'), + getValue, + setValue + }); +} + +// helper ////////////////// + +function getProcess$1(element) { + return (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.is)(element, 'bpmn:Process') ? (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element) : (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element).get('processRef'); +} + +/** + * Cf. https://docs.camunda.org/manual/latest/reference/bpmn20/tasks/user-task/ + */ +function UserAssignmentProps(props) { + const { + element + } = props; + if (!(0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.is)(element, 'camunda:Assignable')) { + return []; + } + return [{ + id: 'assignee', + component: Assignee, + isEdited: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.isTextFieldEntryEdited + }, { + id: 'candidateGroups', + component: CandidateGroups, + isEdited: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.isTextFieldEntryEdited + }, { + id: 'candidateUsers', + component: CandidateUsers, + isEdited: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.isTextFieldEntryEdited + }, { + id: 'dueDate', + component: DueDate, + isEdited: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.isTextFieldEntryEdited + }, { + id: 'followUpDate', + component: FollowUpDate, + isEdited: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.isTextFieldEntryEdited + }, { + id: 'priority', + component: Priority, + isEdited: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.isTextFieldEntryEdited + }]; +} +function Assignee(props) { + const { + element + } = props; + const commandStack = useService('commandStack'); + const translate = useService('translate'); + const debounce = useService('debounceInput'); + const businessObject = (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element); + const getValue = () => { + return businessObject.get('camunda:assignee'); + }; + const setValue = value => { + commandStack.execute('element.updateModdleProperties', { + element, + moddleElement: businessObject, + properties: { + 'camunda:assignee': value + } + }); + }; + return (0,_bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.TextFieldEntry)({ + element, + id: 'assignee', + label: translate('Assignee'), + getValue, + setValue, + debounce + }); +} +function CandidateUsers(props) { + const { + element + } = props; + const commandStack = useService('commandStack'); + const translate = useService('translate'); + const debounce = useService('debounceInput'); + const businessObject = (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element); + const getValue = () => { + return businessObject.get('camunda:candidateUsers'); + }; + const setValue = value => { + commandStack.execute('element.updateModdleProperties', { + element, + moddleElement: businessObject, + properties: { + 'camunda:candidateUsers': value + } + }); + }; + return (0,_bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.TextFieldEntry)({ + element, + id: 'candidateUsers', + label: translate('Candidate users'), + getValue, + setValue, + debounce + }); +} +function CandidateGroups(props) { + const { + element + } = props; + const commandStack = useService('commandStack'); + const translate = useService('translate'); + const debounce = useService('debounceInput'); + const businessObject = (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element); + const getValue = () => { + return businessObject.get('camunda:candidateGroups'); + }; + const setValue = value => { + commandStack.execute('element.updateModdleProperties', { + element, + moddleElement: businessObject, + properties: { + 'camunda:candidateGroups': value + } + }); + }; + return (0,_bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.TextFieldEntry)({ + element, + id: 'candidateGroups', + label: translate('Candidate groups'), + getValue, + setValue, + debounce + }); +} +function DueDate(props) { + const { + element + } = props; + const commandStack = useService('commandStack'); + const translate = useService('translate'); + const debounce = useService('debounceInput'); + const businessObject = (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element); + const getValue = () => { + return businessObject.get('camunda:dueDate'); + }; + const setValue = value => { + commandStack.execute('element.updateModdleProperties', { + element, + moddleElement: businessObject, + properties: { + 'camunda:dueDate': value + } + }); + }; + return (0,_bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.TextFieldEntry)({ + element, + id: 'dueDate', + label: translate('Due date'), + description: translate('The due date as an EL expression (e.g. ${someDate}) or an ISO date (e.g. 2015-06-26T09:54:00).'), + getValue, + setValue, + debounce + }); +} +function FollowUpDate(props) { + const { + element + } = props; + const commandStack = useService('commandStack'); + const translate = useService('translate'); + const debounce = useService('debounceInput'); + const businessObject = (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element); + const getValue = () => { + return businessObject.get('camunda:followUpDate'); + }; + const setValue = value => { + commandStack.execute('element.updateModdleProperties', { + element, + moddleElement: businessObject, + properties: { + 'camunda:followUpDate': value + } + }); + }; + return (0,_bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.TextFieldEntry)({ + element, + id: 'followUpDate', + label: translate('Follow up date'), + description: translate('The follow up date as an EL expression (e.g. ${someDate}) or an ' + 'ISO date (e.g. 2015-06-26T09:54:00).'), + getValue, + setValue, + debounce + }); +} +function Priority(props) { + const { + element + } = props; + const commandStack = useService('commandStack'); + const translate = useService('translate'); + const debounce = useService('debounceInput'); + const businessObject = (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element); + const getValue = () => { + return businessObject.get('camunda:priority'); + }; + const setValue = value => { + commandStack.execute('element.updateModdleProperties', { + element, + moddleElement: businessObject, + properties: { + 'camunda:priority': value + } + }); + }; + return (0,_bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.TextFieldEntry)({ + element, + id: 'priority', + label: translate('Priority'), + getValue, + setValue, + debounce + }); +} + +function VersionTagProps(props) { + const { + element + } = props; + const businessObject = (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element); + if (!(0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.is)(element, 'bpmn:Process') && !((0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.is)(element, 'bpmn:Participant') && businessObject.get('processRef'))) { + return []; + } + return [{ + id: 'versionTag', + component: VersionTag, + isEdited: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.isTextFieldEntryEdited + }]; +} +function VersionTag(props) { + const { + element + } = props; + const commandStack = useService('commandStack'); + const translate = useService('translate'); + const debounce = useService('debounceInput'); + const process = getProcess(element); + const getValue = () => { + return process.get('camunda:versionTag') || ''; + }; + const setValue = value => { + commandStack.execute('element.updateModdleProperties', { + element, + moddleElement: process, + properties: { + 'camunda:versionTag': value + } + }); + }; + return (0,_bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.TextFieldEntry)({ + element, + id: 'versionTag', + label: translate('Version tag'), + getValue, + setValue, + debounce + }); +} + +// helper ////////////////// + +function getProcess(element) { + return (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.is)(element, 'bpmn:Process') ? (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element) : (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.getBusinessObject)(element).get('processRef'); +} + +const LOW_PRIORITY = 500; +const CAMUNDA_PLATFORM_GROUPS = [HistoryCleanupGroup, TasklistGroup, CandidateStarterGroup, ImplementationGroup, ExternalTaskGroup, ProcessVariablesGroup, ErrorsGroup, UserAssignmentGroup, FormGroup, FormDataGroup, TaskListenerGroup, StartInitiatorGroup, ScriptGroup, ConditionGroup, CallActivityGroup, AsynchronousContinuationsGroup, JobExecutionGroup, InMappingPropagationGroup, InMappingGroup, InputGroup, ConnectorInputGroup, OutMappingPropagationGroup, OutMappingGroup, OutputGroup, ConnectorOutputGroup, ExecutionListenerGroup, ExtensionPropertiesGroup, FieldInjectionGroup, BusinessKeyGroup]; + +/** + * Provides `camunda` namespace properties. + * + * @example + * ```javascript + * import BpmnModeler from 'bpmn-js/lib/Modeler'; + * import { + * BpmnPropertiesPanelModule, + * BpmnPropertiesProviderModule, + * CamundaPlatformPropertiesProviderModule + * } from 'bpmn-js-properties-panel'; + * + * const modeler = new BpmnModeler({ + * container: '#canvas', + * propertiesPanel: { + * parent: '#properties' + * }, + * additionalModules: [ + * BpmnPropertiesPanelModule, + * BpmnPropertiesProviderModule, + * CamundaPlatformPropertiesProviderModule + * ] + * }); + * ``` + */ +class CamundaPlatformPropertiesProvider { + constructor(propertiesPanel, injector) { + propertiesPanel.registerProvider(LOW_PRIORITY, this); + this._injector = injector; + } + getGroups(element) { + return groups => { + // (1) add Camunda Platform specific groups + groups = groups.concat(this._getGroups(element)); + + // (2) update existing groups with Camunda Platform specific properties + updateGeneralGroup(groups, element); + updateErrorGroup(groups, element); + updateEscalationGroup(groups, element); + updateMultiInstanceGroup(groups, element); + updateTimerGroup(groups, element); + + // (3) move groups given specific priorities + moveImplementationGroup(groups); + return groups; + }; + } + _getGroups(element) { + const groups = CAMUNDA_PLATFORM_GROUPS.map(createGroup => createGroup(element, this._injector)); + + // contract: if a group returns null, it should not be displayed at all + return groups.filter(group => group !== null); + } +} +CamundaPlatformPropertiesProvider.$inject = ['propertiesPanel', 'injector']; + +/** + * This ensures the group always locates after + */ +function moveImplementationGroup(groups) { + const documentationGroupIdx = findGroupIndex(groups, 'documentation'); + if (documentationGroupIdx < 0) { + return; + } + return moveGroup(groups, 'CamundaPlatform__Implementation', documentationGroupIdx + 1); +} +function updateGeneralGroup(groups, element) { + const generalGroup = findGroup(groups, 'general'); + if (!generalGroup) { + return; + } + const { + entries + } = generalGroup; + + // (1) add version tag before executable (if existing) + const executableEntry = (0,min_dash__WEBPACK_IMPORTED_MODULE_12__.findIndex)(entries, entry => entry.id === 'isExecutable'); + const insertIndex = executableEntry >= 0 ? executableEntry : entries.length; + entries.splice(insertIndex, 0, ...VersionTagProps({ + element + })); +} +function updateErrorGroup(groups, element) { + const errorGroup = findGroup(groups, 'error'); + if (!errorGroup) { + return; + } + const { + entries + } = errorGroup; + ErrorProps({ + element, + entries + }); +} +function updateMultiInstanceGroup(groups, element) { + const multiInstanceGroup = findGroup(groups, 'multiInstance'); + if (!multiInstanceGroup) { + return; + } + const { + entries + } = multiInstanceGroup; + MultiInstanceProps({ + element, + entries + }); +} +function updateEscalationGroup(groups, element) { + const escalationGroup = findGroup(groups, 'escalation'); + if (!escalationGroup) { + return; + } + const { + entries + } = escalationGroup; + EscalationProps({ + element, + entries + }); +} +function updateTimerGroup(groups, element) { + const timerEventGroup = findGroup(groups, 'timer'); + if (!timerEventGroup) { + return; + } + timerEventGroup.entries = [...TimerProps({ + element + })]; +} +function ImplementationGroup(element, injector) { + const translate = injector.get('translate'); + const group = { + label: translate('Implementation'), + id: 'CamundaPlatform__Implementation', + component: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.Group, + entries: [...ImplementationProps({ + element + })] + }; + if (group.entries.length) { + return group; + } + return null; +} +function ErrorsGroup(element, injector) { + const translate = injector.get('translate'); + const group = { + label: translate('Errors'), + id: 'CamundaPlatform__Errors', + component: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.ListGroup, + ...ErrorsProps({ + element, + injector + }) + }; + if (group.items) { + return group; + } + return null; +} +function UserAssignmentGroup(element, injector) { + const translate = injector.get('translate'); + const group = { + label: translate('User assignment'), + id: 'CamundaPlatform__UserAssignment', + component: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.Group, + entries: [...UserAssignmentProps({ + element + })] + }; + if (group.entries.length) { + return group; + } + return null; +} +function ScriptGroup(element, injector) { + const translate = injector.get('translate'); + const group = { + label: translate('Script'), + id: 'CamundaPlatform__Script', + component: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.Group, + entries: [...ScriptTaskProps({ + element + })] + }; + if (group.entries.length) { + return group; + } + return null; +} +function CallActivityGroup(element, injector) { + const translate = injector.get('translate'); + const group = { + label: translate('Called element'), + id: 'CamundaPlatform__CallActivity', + component: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.Group, + entries: [...CallActivityProps({ + element + })] + }; + if (group.entries.length) { + return group; + } + return null; +} +function ConditionGroup(element, injector) { + const translate = injector.get('translate'); + const group = { + label: translate('Condition'), + id: 'CamundaPlatform__Condition', + component: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.Group, + entries: [...ConditionProps({ + element + })] + }; + if (group.entries.length) { + return group; + } + return null; +} +function StartInitiatorGroup(element, injector) { + const translate = injector.get('translate'); + const group = { + label: translate('Start initiator'), + id: 'CamundaPlatform__StartInitiator', + component: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.Group, + entries: [...InitiatorProps({ + element + })] + }; + if (group.entries.length) { + return group; + } + return null; +} +function ExternalTaskGroup(element, injector) { + const translate = injector.get('translate'); + const group = { + label: translate('External task'), + id: 'CamundaPlatform__ExternalTask', + component: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.Group, + entries: [...ExternalTaskPriorityProps({ + element + })] + }; + if (group.entries.length) { + return group; + } + return null; +} +function AsynchronousContinuationsGroup(element, injector) { + const translate = injector.get('translate'); + const group = { + label: translate('Asynchronous continuations'), + id: 'CamundaPlatform__AsynchronousContinuations', + component: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.Group, + entries: [...AsynchronousContinuationsProps({ + element + })] + }; + if (group.entries.length) { + return group; + } + return null; +} +function JobExecutionGroup(element, injector) { + const translate = injector.get('translate'); + const group = { + label: translate('Job execution'), + id: 'CamundaPlatform__JobExecution', + component: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.Group, + entries: [...JobExecutionProps({ + element + })] + }; + if (group.entries.length) { + return group; + } + return null; +} +function CandidateStarterGroup(element, injector) { + const translate = injector.get('translate'); + const group = { + label: translate('Candidate starter'), + id: 'CamundaPlatform__CandidateStarter', + component: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.Group, + entries: [...CandidateStarterProps({ + element + })] + }; + if (group.entries.length) { + return group; + } + return null; +} +function FieldInjectionGroup(element, injector) { + const translate = injector.get('translate'); + const group = { + label: translate('Field injections'), + id: 'CamundaPlatform__FieldInjection', + component: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.ListGroup, + ...FieldInjectionProps({ + element, + injector + }) + }; + if (group.items) { + return group; + } + return null; +} +function HistoryCleanupGroup(element, injector) { + const translate = injector.get('translate'); + const group = { + label: translate('History cleanup'), + id: 'CamundaPlatform__HistoryCleanup', + component: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.Group, + entries: [...HistoryCleanupProps({ + element + })] + }; + if (group.entries.length) { + return group; + } + return null; +} +function TasklistGroup(element, injector) { + const translate = injector.get('translate'); + const group = { + label: translate('Tasklist'), + id: 'CamundaPlatform__Tasklist', + component: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.Group, + entries: [...TasklistProps({ + element + })] + }; + if (group.entries.length) { + return group; + } + return null; +} +function InMappingGroup(element, injector) { + const translate = injector.get('translate'); + const group = { + label: translate('In mappings'), + id: 'CamundaPlatform__InMapping', + component: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.ListGroup, + ...InMappingProps({ + element, + injector + }) + }; + if (group.items) { + return group; + } + return null; +} +function InMappingPropagationGroup(element, injector) { + const translate = injector.get('translate'); + const group = { + label: translate('In mapping propagation'), + id: 'CamundaPlatform__InMappingPropagation', + component: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.Group, + entries: [...InMappingPropagationProps({ + element + })] + }; + if (group.entries.length) { + return group; + } + return null; +} +function OutMappingGroup(element, injector) { + const translate = injector.get('translate'); + const group = { + label: translate('Out mappings'), + id: 'CamundaPlatform__OutMapping', + component: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.ListGroup, + ...OutMappingProps({ + element, + injector + }) + }; + if (group.items) { + return group; + } + return null; +} +function OutMappingPropagationGroup(element, injector) { + const translate = injector.get('translate'); + const group = { + label: translate('Out mapping propagation'), + id: 'CamundaPlatform__OutMappingPropagation', + component: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.Group, + entries: [...OutMappingPropagationProps({ + element + })] + }; + if (group.entries.length) { + return group; + } + return null; +} +function ProcessVariablesGroup(element, injector) { + const translate = injector.get('translate'); + const variableProps = ProcessVariablesProps({ + element, + injector + }); + if (!variableProps) { + return null; + } + const group = { + label: translate('Process variables'), + id: 'CamundaPlatform__ProcessVariables', + ...variableProps + }; + return group; +} +function FormDataGroup(element, injector) { + const translate = injector.get('translate'); + const group = { + label: translate('Form fields'), + id: 'CamundaPlatform__FormData', + component: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.ListGroup, + ...FormDataProps({ + element, + injector + }) + }; + if (group.items) { + return group; + } + return null; +} +function BusinessKeyGroup(element, injector) { + const translate = injector.get('translate'); + const group = { + label: translate('Business key'), + id: 'CamundaPlatform__BusinessKey', + component: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.Group, + entries: [...BusinessKeyProps$1({ + element + })] + }; + if (group.entries.length) { + return group; + } + return null; +} +function FormGroup(element, injector) { + const translate = injector.get('translate'); + const group = { + label: translate('Forms'), + id: 'CamundaPlatform__Form', + component: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.Group, + entries: [...FormProps({ + element + })] + }; + if (group.entries.length) { + return group; + } + return null; +} +function ExecutionListenerGroup(element, injector) { + const translate = injector.get('translate'); + const group = { + label: translate('Execution listeners'), + id: 'CamundaPlatform__ExecutionListener', + component: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.ListGroup, + ...ExecutionListenerProps({ + element, + injector + }) + }; + if (group.items) { + return group; + } + return null; +} +function TaskListenerGroup(element, injector) { + const translate = injector.get('translate'); + const group = { + label: translate('Task listeners'), + id: 'CamundaPlatform__TaskListener', + component: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.ListGroup, + ...TaskListenerProps({ + element, + injector + }) + }; + if (group.items) { + return group; + } + return null; +} +function InputGroup(element, injector) { + const translate = injector.get('translate'); + const group = { + label: translate('Inputs'), + id: 'CamundaPlatform__Input', + component: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.ListGroup, + ...InputProps({ + element, + injector + }) + }; + if (group.items) { + return group; + } + return null; +} +function OutputGroup(element, injector) { + const translate = injector.get('translate'); + const group = { + label: translate('Outputs'), + id: 'CamundaPlatform__Output', + component: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.ListGroup, + ...OutputProps({ + element, + injector + }) + }; + if (group.items) { + return group; + } + return null; +} +function ConnectorInputGroup(element, injector) { + const translate = injector.get('translate'); + const group = { + label: translate('Connector inputs'), + id: 'CamundaPlatform__ConnectorInput', + component: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.ListGroup, + ...ConnectorInputProps({ + element, + injector + }) + }; + if (group.items) { + return group; + } + return null; +} +function ConnectorOutputGroup(element, injector) { + const translate = injector.get('translate'); + const group = { + label: translate('Connector outputs'), + id: 'CamundaPlatform__ConnectorOutput', + component: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.ListGroup, + ...ConnectorOutputProps({ + element, + injector + }) + }; + if (group.items) { + return group; + } + return null; +} +function ExtensionPropertiesGroup(element, injector) { + const translate = injector.get('translate'); + const group = { + label: translate('Extension properties'), + id: 'CamundaPlatform__ExtensionProperties', + component: _bpmn_io_properties_panel__WEBPACK_IMPORTED_MODULE_1__.ListGroup, + ...ExtensionPropertiesProps({ + element, + injector + }) + }; + if (group.items) { + return group; + } + return null; +} + +// helper ///////////////////// + +function findGroup(groups, id) { + return groups.find(g => g.id === id); +} +function findGroupIndex(groups, id) { + return (0,min_dash__WEBPACK_IMPORTED_MODULE_12__.findIndex)(groups, g => g.id === id); +} +function moveGroup(groups, id, position) { + const groupIndex = findGroupIndex(groups, id); + if (position < 0 || groupIndex < 0) { + return; + } + return (0,array_move__WEBPACK_IMPORTED_MODULE_7__.arrayMoveMutable)(groups, groupIndex, position); +} + +var index = { + __init__: ['camundaPlatformPropertiesProvider'], + camundaPlatformPropertiesProvider: ['type', CamundaPlatformPropertiesProvider] +}; + +/* eslint-disable react-hooks/rules-of-hooks */ +const TooltipProvider = { + 'group-assignmentDefinition': element => { + const translate = useService('translate'); + return (0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("div", { + children: [translate('Define who the task is assigned to. One or all of the following attributes can be specified simultaneously. '), (0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("a", { + href: "https://docs.camunda.io/docs/components/modeler/bpmn/user-tasks/#assignments", + target: "_blank", + rel: "noopener", + title: translate('User task documentation'), + children: translate('Learn more.') + })] + }); + }, + 'group-condition': element => { + const translate = useService('translate'); + return (0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("div", { + children: [translate('Define a boolean condition expression that defines when this flow is taken. '), (0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("a", { + href: "https://docs.camunda.io/docs/components/modeler/bpmn/exclusive-gateways/#conditions", + target: "_blank", + rel: "noopener", + title: translate('Conditions documentation'), + children: translate('Learn how to define conditions.') + })] + }); + }, + 'group-businessRuleImplementation': element => { + const translate = useService('translate'); + return (0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("div", { + children: [translate('Evaluate a business rule, for example a DMN. To add a custom implementation, use a job worker. '), (0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("a", { + href: "https://docs.camunda.io/docs/components/modeler/bpmn/business-rule-tasks/#defining-a-task", + target: "_blank", + rel: "noopener", + title: translate('Business rule task documentation'), + children: translate('Learn more.') + })] + }); + }, + 'group-scriptImplementation': element => { + const translate = useService('translate'); + return (0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("div", { + children: [translate('Implement a script task using an inline FEEL expression. To add a custom implementation, use a job worker. '), (0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("a", { + href: "https://docs.camunda.io/docs/components/modeler/bpmn/script-tasks/#defining-a-script-task", + target: "_blank", + rel: "noopener", + title: translate('Script task documentation'), + children: translate('Learn more.') + })] + }); + }, + 'group-form': element => { + const translate = useService('translate'); + return (0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("div", { + children: [translate('Link or embed a form created with the Camunda Forms editor. To associate a custom form, application, or URL to the user task, specify a form key. '), (0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("a", { + href: "https://docs.camunda.io/docs/guides/utilizing-forms/#connect-your-form-to-a-bpmn-diagram", + target: "_blank", + rel: "noopener", + title: translate('User task form documentation'), + children: translate('Learn more.') + })] + }); + }, + 'group-message': element => { + const translate = useService('translate'); + if ((0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.is)(element, 'bpmn:ReceiveTask')) { + return (0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("div", { + children: [translate('Define the name of the message (e.g. '), (0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("code", { + children: "Money collected" + }), translate(') and the '), (0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("code", { + children: "correlationKey" + }), translate(' expression (e.g. '), (0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("code", { + children: "= orderId" + }), translate(')'), translate(' to subscribe to. '), translate('Learn more how to '), (0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("a", { + href: "https://docs.camunda.io/docs/components/modeler/bpmn/send-tasks", + target: "_blank", + rel: "noopener", + title: translate('Send task documentation'), + children: translate('send ') + }), translate('and '), (0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("a", { + href: "https://docs.camunda.io/docs/components/modeler/bpmn/receive-tasks", + target: "_blank", + rel: "noopener", + title: translate('Receive task documentation'), + children: translate('receive messages. ') + })] + }); + } + return (0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("div", { + children: [translate('Define the name of the message (e.g. '), (0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("code", { + children: "Money collected" + }), translate(') and the '), (0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("code", { + children: "correlationKey" + }), translate(' expression (e.g. '), (0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("code", { + children: "= orderId" + }), translate(')'), translate(' to subscribe to. '), (0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("a", { + href: "https://docs.camunda.io/docs/components/modeler/bpmn/message-events/#messages", + target: "_blank", + rel: "noopener", + title: translate('Message event documentation'), + children: translate('Learn more.') + })] + }); + }, + 'group-calledElement': element => { + const translate = useService('translate'); + return (0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("div", { + children: [translate('Define the ID of the process to call (e.g. '), " ", (0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("code", { + children: "shipping-process" + }), translate(' or '), (0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("code", { + children: "= \"shipping-\" + tenantId" + }), " ", translate('). '), (0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("a", { + href: "https://docs.camunda.io/docs/components/modeler/bpmn/call-activities/", + target: "_blank", + rel: "noopener", + title: translate('Call activity documentation'), + children: translate('Learn more.') + })] + }); + }, + 'group-taskDefinition': element => { + const translate = useService('translate'); + if ((0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.is)(element, 'bpmn:ServiceTask')) { + return (0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("div", { + children: [translate('Specify which job workers handle the task work to execute a service (e.g. '), (0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("code", { + children: "order-items" + }), translate('). '), (0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("a", { + href: "https://docs.camunda.io/docs/components/modeler/bpmn/service-tasks", + target: "_blank", + rel: "noopener", + title: translate('Service task documentation'), + children: translate('Learn more.') + })] + }); + } + if ((0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.is)(element, 'bpmn:BusinessRuleTask')) { + return (0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("div", { + children: [translate('Specify which job workers handle the task work to evaluate business rules. '), (0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("a", { + href: "https://docs.camunda.io/docs/components/modeler/bpmn/business-rule-tasks/#job-worker-implementation", + target: "_blank", + rel: "noopener", + title: translate('Business rule task documentation'), + children: translate('Learn more.') + })] + }); + } + if ((0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.is)(element, 'bpmn:ScriptTask')) { + return (0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("div", { + children: [translate('Specify which job workers handle the task work to execute a script. '), (0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("a", { + href: "https://docs.camunda.io/docs/components/modeler/bpmn/script-tasks/#defining-a-task", + target: "_blank", + rel: "noopener", + title: translate('Script task documentation'), + children: translate('Learn more.') + })] + }); + } + if ((0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.is)(element, 'bpmn:SendTask')) { + return (0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("div", { + children: [translate('Specify which job workers handle the task work to send a message (e.g. '), (0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("code", { + children: "kafka" + }), translate(' or '), (0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("code", { + children: "mail" + }), translate('). '), (0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("a", { + href: "https://docs.camunda.io/docs/components/modeler/bpmn/send-tasks/#defining-a-task", + target: "_blank", + rel: "noopener", + title: translate('Send task documentation'), + children: translate('Learn more.') + })] + }); + } + if ((0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_9__.is)(element, 'bpmn:ThrowEvent')) { + return (0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("div", { + children: [translate('Specify which job workers handle the event work. '), (0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("a", { + href: "https://docs.camunda.io/docs/components/modeler/bpmn/message-events/#message-throw-events", + target: "_blank", + rel: "noopener", + title: translate('Message throw event documentation'), + children: translate('Learn more.') + })] + }); + } + }, + 'group-multiInstance': element => { + const translate = useService('translate'); + return (0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("div", { + children: [translate('Execute this task for each element of a given collection. '), (0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("br", {}), translate('Define an input collection expression that defines the collection to iterate over (e.g. '), (0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("code", { + children: "= items" + }), translate('). '), translate('To collect the output define the output collection and the output element expressions. '), (0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("a", { + href: "https://docs.camunda.io/docs/components/modeler/bpmn/multi-instance/#defining-the-collection-to-iterate-over", + target: "_blank", + rel: "noopener", + title: translate('Multi instance documentation'), + children: translate('Learn more.') + })] + }); + }, + 'group-error': element => { + const translate = useService('translate'); + return (0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("div", { + children: [translate('Define an error code (e.g. '), (0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("code", { + children: "order-not-found" + }), translate('). '), (0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("a", { + href: "https://docs.camunda.io/docs/components/modeler/bpmn/error-events/#defining-the-error", + target: "_blank", + rel: "noopener", + title: translate('Error event documentation'), + children: translate('Learn more.') + })] + }); + }, + 'group-inputs': element => { + const translate = useService('translate'); + return (0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("div", { + children: [translate('Create a new local variable in the scope of this task. '), (0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("a", { + href: "https://docs.camunda.io/docs/components/concepts/variables/#input-mappings", + target: "_blank", + rel: "noopener", + title: translate('Input mappings documentation'), + children: translate('Learn more.') + })] + }); + }, + 'group-outputs': element => { + const translate = useService('translate'); + return (0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("div", { + children: [translate('Customize how result variables are merged into the global scope of the process instance. '), (0,_bpmn_io_properties_panel_preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("a", { + href: "https://docs.camunda.io/docs/components/concepts/variables/#output-mappings", + target: "_blank", + rel: "noopener", + title: translate('Output mappings documentation'), + children: translate('Learn more.') + })] + }); + } +}; + + +//# sourceMappingURL=index.esm.js.map + + +/***/ }), + +/***/ "../node_modules/bpmn-js/lib/BaseModeler.js": +/*!**************************************************!*\ + !*** ../node_modules/bpmn-js/lib/BaseModeler.js ***! + \**************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ BaseModeler) +/* harmony export */ }); +/* harmony import */ var inherits_browser__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! inherits-browser */ "../node_modules/inherits-browser/dist/index.es.js"); +/* harmony import */ var ids__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ids */ "../node_modules/ids/dist/index.esm.js"); +/* harmony import */ var _BaseViewer__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./BaseViewer */ "../node_modules/bpmn-js/lib/BaseViewer.js"); + + + + + + + +/** + * @typedef {import('./BaseViewer').BaseViewerOptions} BaseViewerOptions + * @typedef {import('./BaseViewer').ModdleElementsById} ModdleElementsById + * + * @typedef {import('./model/Types').ModdleElement} ModdleElement + */ -// helpers ////////////// +/** + * A base modeler for BPMN 2.0 diagrams. + * + * See {@link Modeler} for a fully-featured modeler. + * + * @param {BaseViewerOptions} [options] The options to configure the modeler. + */ +function BaseModeler(options) { + _BaseViewer__WEBPACK_IMPORTED_MODULE_1__["default"].call(this, options); - function ensureNotNull(prop, name) { - if (!prop) { - throw new Error(name + ' required'); - } - return prop; - } + // hook ID collection into the modeler + this.on('import.parse.complete', function(event) { + if (!event.error) { + this._collectIds(event.definitions, event.elementsById); + } + }, this); - },{"../helper/ElementHelper":26}],7:[function(require,module,exports){ - 'use strict'; + this.on('diagram.destroy', function() { + this.get('moddle').ids.clear(); + }, this); +} - var forEach = require('lodash/forEach'); +(0,inherits_browser__WEBPACK_IMPORTED_MODULE_2__["default"])(BaseModeler, _BaseViewer__WEBPACK_IMPORTED_MODULE_1__["default"]); - var elementHelper = require('../helper/ElementHelper'); - /** - * A handler that implements a BPMN 2.0 property update - * for business objects which are not represented in the - * diagram. - * - * This is useful in the context of the properties panel in - * order to update child elements of elements visible in - * the diagram. - * - * Example: perform an update of a specific event definition - * of an intermediate event. - * - * @class - * @constructor - */ - function CreateBusinessObjectListHandler(elementRegistry, bpmnFactory) { - this._elementRegistry = elementRegistry; - this._bpmnFactory = bpmnFactory; - } +/** + * Create a moddle instance, attaching IDs to it. + * + * @param {BaseViewerOptions} options + * + * @return {Moddle} + */ +BaseModeler.prototype._createModdle = function(options) { + var moddle = _BaseViewer__WEBPACK_IMPORTED_MODULE_1__["default"].prototype._createModdle.call(this, options); - CreateBusinessObjectListHandler.$inject = [ 'elementRegistry', 'bpmnFactory' ]; + // attach ids to moddle to be able to track and validated ids in the BPMN 2.0 + // XML document tree + moddle.ids = new ids__WEBPACK_IMPORTED_MODULE_0__["default"]([ 32, 36, 1 ]); - module.exports = CreateBusinessObjectListHandler; + return moddle; +}; - function ensureNotNull(prop, name) { - if (!prop) { - throw new Error(name + ' required'); - } - return prop; +/** + * Collect IDs processed during parsing of the definitions object. + * + * @param {ModdleElement} definitions + * @param {ModdleElementsById} elementsById + */ +BaseModeler.prototype._collectIds = function(definitions, elementsById) { + + var moddle = definitions.$model, + ids = moddle.ids, + id; + + // remove references from previous import + ids.clear(); + + for (id in elementsById) { + ids.claim(id, elementsById[ id ]); + } +}; + + +/***/ }), + +/***/ "../node_modules/bpmn-js/lib/BaseViewer.js": +/*!*************************************************!*\ + !*** ../node_modules/bpmn-js/lib/BaseViewer.js ***! + \*************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ BaseViewer) +/* harmony export */ }); +/* harmony import */ var min_dash__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! min-dash */ "../node_modules/min-dash/dist/index.esm.js"); +/* harmony import */ var min_dom__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! min-dom */ "../node_modules/min-dom/dist/index.esm.js"); +/* harmony import */ var tiny_svg__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! tiny-svg */ "../node_modules/tiny-svg/dist/index.esm.js"); +/* harmony import */ var diagram_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! diagram-js */ "../node_modules/diagram-js/lib/Diagram.js"); +/* harmony import */ var bpmn_moddle__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! bpmn-moddle */ "../node_modules/bpmn-moddle/dist/index.esm.js"); +/* harmony import */ var inherits_browser__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! inherits-browser */ "../node_modules/inherits-browser/dist/index.es.js"); +/* harmony import */ var _import_Importer__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./import/Importer */ "../node_modules/bpmn-js/lib/import/Importer.js"); +/* harmony import */ var _util_PoweredByUtil__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./util/PoweredByUtil */ "../node_modules/bpmn-js/lib/util/PoweredByUtil.js"); +/** + * The code in the area + * must not be changed. + * + * @see http://bpmn.io/license for more information. + */ - } - function ensureList(prop, name) { - if (!prop || Object.prototype.toString.call(prop) !== '[object Array]') { - throw new Error(name + ' needs to be a list'); - } - return prop; - } -// api ///////////////////////////////////////////// - /** - * Creates a new element under a provided parent and updates / creates a reference to it in - * one atomic action. - * - * @method CreateBusinessObjectListHandler#execute - * - * @param {Object} context - * @param {djs.model.Base} context.element which is the context for the reference - * @param {moddle.referencingObject} context.referencingObject the object which creates the reference - * @param {String} context.referenceProperty the property of the referencingObject which makes the reference - * @param {moddle.newObject} context.newObject the new object to add - * @param {moddle.newObjectContainer} context.newObjectContainer the container for the new object - * - * @return {Array} the updated element - */ - CreateBusinessObjectListHandler.prototype.execute = function(context) { - var currentObject = ensureNotNull(context.currentObject, 'currentObject'), - propertyName = ensureNotNull(context.propertyName, 'propertyName'), - newObjects = ensureList(context.newObjects, 'newObjects'), - changed = [ context.element ]; // this will not change any diagram-js elements - var childObjects = []; - var self = this; - // create new array of business objects - forEach(newObjects, function(obj) { - var element = elementHelper.createElement(obj.type, obj.properties, currentObject, self._bpmnFactory); - childObjects.push(element); - }); - context.childObject = childObjects; - // adjust array reference in the parent business object - context.previousChilds = currentObject[propertyName]; - currentObject[propertyName] = childObjects; - context.changed = changed; - // indicate changed on objects affected by the update - return changed; - }; - /** - * Reverts the update - * - * @method CreateBusinessObjectListHandler#revert - * - * @param {Object} context - * - * @return {djs.mode.Base} the updated element - */ - CreateBusinessObjectListHandler.prototype.revert = function(context) { - var currentObject = context.currentObject, - propertyName = context.propertyName, - previousChilds = context.previousChilds; +/** + * @template T + * + * @typedef {import('diagram-js/lib/core/EventBus').EventBusEventCallback} EventBusEventCallback + */ - // remove new element - currentObject.set(propertyName, previousChilds); +/** + * @typedef {import('didi').ModuleDeclaration} ModuleDeclaration + * + * @typedef {import('./model/Types').Moddle} Moddle + * @typedef {import('./model/Types').ModdleElement} ModdleElement + * @typedef {import('./model/Types').ModdleExtension} ModdleExtension + * + * @typedef { { + * width?: number|string; + * height?: number|string; + * position?: string; + * container?: string|HTMLElement; + * moddleExtensions?: ModdleExtensions; + * additionalModules?: ModuleDeclaration[]; + * } & Record } BaseViewerOptions + * + * @typedef {Record} ModdleElementsById + * + * @typedef { { + * [key: string]: ModdleExtension; + * } } ModdleExtensions + * + * @typedef { { + * warnings: string[]; + * } } ImportXMLResult + * + * @typedef {ImportXMLResult & Error} ImportXMLError + * + * @typedef {ImportXMLResult} ImportDefinitionsResult + * + * @typedef {ImportXMLError} ImportDefinitionsError + * + * @typedef {ImportXMLResult} OpenResult + * + * @typedef {ImportXMLError} OpenError + * + * @typedef { { + * format?: boolean; + * preamble?: boolean; + * } } SaveXMLOptions + * + * @typedef { { + * xml?: string; + * error?: Error; + * } } SaveXMLResult + * + * @typedef { { + * svg: string; + * } } SaveSVGResult + * + * @typedef { { + * xml: string; + * } } ImportParseStartEvent + * + * @typedef { { + * error?: ImportXMLError; + * definitions?: ModdleElement; + * elementsById?: ModdleElementsById; + * references?: ModdleElement[]; + * warnings: string[]; + * } } ImportParseCompleteEvent + * + * @typedef { { + * error?: ImportXMLError; + * warnings: string[]; + * } } ImportDoneEvent + * + * @typedef { { + * definitions: ModdleElement; + * } } SaveXMLStartEvent + * + * @typedef {SaveXMLResult} SaveXMLDoneEvent + * + * @typedef { { + * error?: Error; + * svg: string; + * } } SaveSVGDoneEvent + */ - return context.changed; - }; +/** + * A base viewer for BPMN 2.0 diagrams. + * + * Have a look at {@link Viewer}, {@link NavigatedViewer} or {@link Modeler} for + * bundles that include actual features. + * + * @param {BaseViewerOptions} [options] The options to configure the viewer. + */ +function BaseViewer(options) { - },{"../helper/ElementHelper":26,"lodash/forEach":613}],8:[function(require,module,exports){ - 'use strict'; + /** + * @type {BaseViewerOptions} + */ + options = (0,min_dash__WEBPACK_IMPORTED_MODULE_0__.assign)({}, DEFAULT_OPTIONS, options); - var forEach = require('lodash/forEach'); + /** + * @type {Moddle} + */ + this._moddle = this._createModdle(options); - /** - * A handler that combines and executes multiple commands. - * - * All updates are bundled on the command stack and executed in one step. - * This also makes it possible to revert the changes in one step. - * - * Example use case: remove the camunda:formKey attribute and in addition - * add all form fields needed for the camunda:formData property. - * - * @class - * @constructor - */ - function MultiCommandHandler(commandStack) { - this._commandStack = commandStack; - } + /** + * @type {HTMLElement} + */ + this._container = this._createContainer(options); - MultiCommandHandler.$inject = [ 'commandStack' ]; + /* */ - module.exports = MultiCommandHandler; + addProjectLogo(this._container); - MultiCommandHandler.prototype.preExecute = function(context) { + /* */ - var commandStack = this._commandStack; + this._init(this._container, this._moddle, options); +} - forEach(context, function(command) { - commandStack.execute(command.cmd, command.context); - }); - }; - },{"lodash/forEach":613}],9:[function(require,module,exports){ - 'use strict'; +(0,inherits_browser__WEBPACK_IMPORTED_MODULE_1__["default"])(BaseViewer, diagram_js__WEBPACK_IMPORTED_MODULE_2__["default"]); - var reduce = require('lodash/transform'), - is = require('bpmn-js/lib/util/ModelUtil').is, - keys = require('lodash/keys'), - forEach = require('lodash/forEach'); +/** + * Parse and render a BPMN 2.0 diagram. + * + * Once finished the viewer reports back the result to the + * provided callback function with (err, warnings). + * + * ## Life-Cycle Events + * + * During import the viewer will fire life-cycle events: + * + * * import.parse.start (about to read model from XML) + * * import.parse.complete (model read; may have worked or not) + * * import.render.start (graphical import start) + * * import.render.complete (graphical import finished) + * * import.done (everything done) + * + * You can use these events to hook into the life-cycle. + * + * @throws {ImportXMLError} An error thrown during the import of the XML. + * + * @fires BaseViewer#ImportParseStartEvent + * @fires BaseViewer#ImportParseCompleteEvent + * @fires Importer#ImportRenderStartEvent + * @fires Importer#ImportRenderCompleteEvent + * @fires BaseViewer#ImportDoneEvent + * + * @param {string} xml The BPMN 2.0 XML to be imported. + * @param {ModdleElement|string} [bpmnDiagram] The optional diagram or Id of the BPMN diagram to open. + * + * @return {Promise} A promise resolving with warnings that were produced during the import. + */ +BaseViewer.prototype.importXML = async function importXML(xml, bpmnDiagram) { + + const self = this; + + function ParseCompleteEvent(data) { + return self.get('eventBus').createEvent(data); + } + + let aggregatedWarnings = []; + try { + + // hook in pre-parse listeners + + // allow xml manipulation + + /** + * A `import.parse.start` event. + * + * @event BaseViewer#ImportParseStartEvent + * @type {ImportParseStartEvent} + */ + xml = this._emit('import.parse.start', { xml: xml }) || xml; + + let parseResult; + try { + parseResult = await this._moddle.fromXML(xml, 'bpmn:Definitions'); + } catch (error) { + this._emit('import.parse.complete', { + error + }); + + throw error; + } + + let definitions = parseResult.rootElement; + const references = parseResult.references; + const parseWarnings = parseResult.warnings; + const elementsById = parseResult.elementsById; + + aggregatedWarnings = aggregatedWarnings.concat(parseWarnings); + + // hook in post parse listeners + + // allow definitions manipulation + + /** + * A `import.parse.complete` event. + * + * @event BaseViewer#ImportParseCompleteEvent + * @type {ImportParseCompleteEvent} + */ + definitions = this._emit('import.parse.complete', ParseCompleteEvent({ + error: null, + definitions: definitions, + elementsById: elementsById, + references: references, + warnings: aggregatedWarnings + })) || definitions; + + const importResult = await this.importDefinitions(definitions, bpmnDiagram); + + aggregatedWarnings = aggregatedWarnings.concat(importResult.warnings); + + /** + * A `import.parse.complete` event. + * + * @event BaseViewer#ImportDoneEvent + * @type {ImportDoneEvent} + */ + this._emit('import.done', { error: null, warnings: aggregatedWarnings }); + + return { warnings: aggregatedWarnings }; + } catch (err) { + let error = err; + aggregatedWarnings = aggregatedWarnings.concat(error.warnings || []); + addWarningsToError(error, aggregatedWarnings); + + error = checkValidationError(error); + + this._emit('import.done', { error, warnings: error.warnings }); + + throw error; + } +}; + + +/** + * Import parsed definitions and render a BPMN 2.0 diagram. + * + * Once finished the viewer reports back the result to the + * provided callback function with (err, warnings). + * + * ## Life-Cycle Events + * + * During import the viewer will fire life-cycle events: + * + * * import.render.start (graphical import start) + * * import.render.complete (graphical import finished) + * + * You can use these events to hook into the life-cycle. + * + * @throws {ImportDefinitionsError} An error thrown during the import of the definitions. + * + * @param {ModdleElement} definitions The definitions. + * @param {ModdleElement|string} [bpmnDiagram] The optional diagram or ID of the BPMN diagram to open. + * + * @return {Promise} A promise resolving with warnings that were produced during the import. + */ +BaseViewer.prototype.importDefinitions = async function importDefinitions(definitions, bpmnDiagram) { + this._setDefinitions(definitions); + const result = await this.open(bpmnDiagram); - /** - * A handler that implements a BPMN 2.0 property update - * for business objects which are not represented in the - * diagram. - * - * This is useful in the context of the properties panel in - * order to update child elements of elements visible in - * the diagram. - * - * Example: perform an update of a specific event definition - * of an intermediate event. - * - * @class - * @constructor - */ - function UpdateBusinessObjectHandler(elementRegistry) { - this._elementRegistry = elementRegistry; - } + return { warnings: result.warnings }; +}; - UpdateBusinessObjectHandler.$inject = [ 'elementRegistry' ]; - module.exports = UpdateBusinessObjectHandler; +/** + * Open diagram of previously imported XML. + * + * Once finished the viewer reports back the result to the + * provided callback function with (err, warnings). + * + * ## Life-Cycle Events + * + * During switch the viewer will fire life-cycle events: + * + * * import.render.start (graphical import start) + * * import.render.complete (graphical import finished) + * + * You can use these events to hook into the life-cycle. + * + * @throws {OpenError} An error thrown during opening. + * + * @param {ModdleElement|string} bpmnDiagramOrId The diagram or Id of the BPMN diagram to open. + * + * @return {Promise} A promise resolving with warnings that were produced during opening. + */ +BaseViewer.prototype.open = async function open(bpmnDiagramOrId) { - /** - * returns the root element - */ - function getRoot(businessObject) { - var parent = businessObject; - while (parent.$parent) { - parent = parent.$parent; - } - return parent; - } + const definitions = this._definitions; + let bpmnDiagram = bpmnDiagramOrId; - function getProperties(businessObject, propertyNames) { - return reduce(propertyNames, function(result, key) { - result[key] = businessObject.get(key); - return result; - }, {}); - } + if (!definitions) { + const error = new Error('no XML imported'); + addWarningsToError(error, []); + throw error; + } - function setProperties(businessObject, properties) { - forEach(properties, function(value, key) { - businessObject.set(key, value); - }); - } + if (typeof bpmnDiagramOrId === 'string') { + bpmnDiagram = findBPMNDiagram(definitions, bpmnDiagramOrId); + if (!bpmnDiagram) { + const error = new Error('BPMNDiagram <' + bpmnDiagramOrId + '> not found'); + addWarningsToError(error, []); -// api ///////////////////////////////////////////// + throw error; + } + } - /** - * Updates a business object with a list of new properties - * - * @method UpdateBusinessObjectHandler#execute - * - * @param {Object} context - * @param {djs.model.Base} context.element the element which has a child business object updated - * @param {moddle.businessObject} context.businessObject the businessObject to update - * @param {Object} context.properties a list of properties to set on the businessObject - * - * @return {Array} the updated element - */ - UpdateBusinessObjectHandler.prototype.execute = function(context) { + // clear existing rendered diagram + // catch synchronous exceptions during #clear() + try { + this.clear(); + } catch (error) { + addWarningsToError(error, []); - var element = context.element, - businessObject = context.businessObject, - rootElements = getRoot(businessObject).rootElements, - referenceType = context.referenceType, - referenceProperty = context.referenceProperty, - changed = [ element ]; // this will not change any diagram-js elements + throw error; + } - if (!element) { - throw new Error('element required'); - } + // perform graphical import + const { warnings } = await (0,_import_Importer__WEBPACK_IMPORTED_MODULE_3__.importBpmnDiagram)(this, definitions, bpmnDiagram); - if (!businessObject) { - throw new Error('businessObject required'); - } + return { warnings }; +}; - var properties = context.properties, - oldProperties = context.oldProperties || getProperties(businessObject, keys(properties)); +/** + * Export the currently displayed BPMN 2.0 diagram as + * a BPMN 2.0 XML document. + * + * ## Life-Cycle Events + * + * During XML saving the viewer will fire life-cycle events: + * + * * saveXML.start (before serialization) + * * saveXML.serialized (after xml generation) + * * saveXML.done (everything done) + * + * You can use these events to hook into the life-cycle. + * + * @throws {Error} An error thrown during export. + * + * @fires BaseViewer#SaveXMLStart + * @fires BaseViewer#SaveXMLDone + * + * @param {SaveXMLOptions} [options] The options. + * + * @return {Promise} A promise resolving with the XML. + */ +BaseViewer.prototype.saveXML = async function saveXML(options) { - // check if there the update needs an external element for reference - if (typeof referenceType !== 'undefined' && typeof referenceProperty !== 'undefined') { - forEach(rootElements, function(rootElement) { - if (is(rootElement, referenceType)) { - if (rootElement.id === properties[referenceProperty]) { - properties[referenceProperty] = rootElement; - } - } - }); - } + options = options || {}; - // update properties - setProperties(businessObject, properties); + let definitions = this._definitions, + error, xml; - // store old values - context.oldProperties = oldProperties; - context.changed = changed; + try { + if (!definitions) { + throw new Error('no definitions loaded'); + } - // indicate changed on objects affected by the update - return changed; - }; + // allow to fiddle around with definitions - /** - * Reverts the update - * - * @method UpdateBusinessObjectHandler#revert - * - * @param {Object} context - * - * @return {djs.mode.Base} the updated element - */ - UpdateBusinessObjectHandler.prototype.revert = function(context) { + /** + * A `saveXML.start` event. + * + * @event BaseViewer#SaveXMLStartEvent + * @type {SaveXMLStartEvent} + */ + definitions = this._emit('saveXML.start', { + definitions + }) || definitions; - var oldProperties = context.oldProperties, - businessObject = context.businessObject; + const result = await this._moddle.toXML(definitions, options); + xml = result.xml; - // update properties - setProperties(businessObject, oldProperties); + xml = this._emit('saveXML.serialized', { + xml + }) || xml; + } catch (err) { + error = err; + } - return context.changed; - }; + const result = error ? { error } : { xml }; - },{"bpmn-js/lib/util/ModelUtil":240,"lodash/forEach":613,"lodash/keys":630,"lodash/transform":642}],10:[function(require,module,exports){ - 'use strict'; + /** + * A `saveXML.done` event. + * + * @event BaseViewer#SaveXMLDoneEvent + * @type {SaveXMLDoneEvent} + */ + this._emit('saveXML.done', result); - var forEach = require('lodash/forEach'); + if (error) { + throw error; + } - /** - * A handler that implements a BPMN 2.0 property update - * for business object lists which are not represented in the - * diagram. - * - * This is useful in the context of the properties panel in - * order to update child elements of elements visible in - * the diagram. - * - * Example: perform an update of a specific event definition - * of an intermediate event. - * - * @class - * @constructor - */ - function UpdateBusinessObjectListHandler(elementRegistry, bpmnFactory) { - this._elementRegistry = elementRegistry; - this._bpmnFactory = bpmnFactory; - } + return result; +}; - UpdateBusinessObjectListHandler.$inject = [ 'elementRegistry', 'bpmnFactory' ]; - module.exports = UpdateBusinessObjectListHandler; +/** + * Export the currently displayed BPMN 2.0 diagram as + * an SVG image. + * + * ## Life-Cycle Events + * + * During SVG saving the viewer will fire life-cycle events: + * + * * saveSVG.start (before serialization) + * * saveSVG.done (everything done) + * + * You can use these events to hook into the life-cycle. + * + * @throws {Error} An error thrown during export. + * + * @fires BaseViewer#SaveSVGDone + * + * @return {Promise} A promise resolving with the SVG. + */ +BaseViewer.prototype.saveSVG = async function saveSVG() { + this._emit('saveSVG.start'); - function ensureNotNull(prop, name) { - if (!prop) { - throw new Error(name + 'required'); - } - return prop; - } + let svg, err; -// api ///////////////////////////////////////////// + try { + const canvas = this.get('canvas'); - /** - * Updates a element under a provided parent. - */ - UpdateBusinessObjectListHandler.prototype.execute = function(context) { + const contentNode = canvas.getActiveLayer(), + defsNode = (0,min_dom__WEBPACK_IMPORTED_MODULE_4__.query)('defs', canvas._svg); - var currentObject = ensureNotNull(context.currentObject, 'currentObject'), - propertyName = ensureNotNull(context.propertyName, 'propertyName'), - updatedObjectList = context.updatedObjectList, - objectsToRemove = context.objectsToRemove || [], - objectsToAdd = context.objectsToAdd || [], - changed = [ context.element], // this will not change any diagram-js elements - referencePropertyName; + const contents = (0,tiny_svg__WEBPACK_IMPORTED_MODULE_5__.innerSVG)(contentNode), + defs = defsNode ? '' + (0,tiny_svg__WEBPACK_IMPORTED_MODULE_5__.innerSVG)(defsNode) + '' : ''; - if (context.referencePropertyName) { - referencePropertyName = context.referencePropertyName; - } + const bbox = contentNode.getBBox(); - var objectList = currentObject[propertyName]; - // adjust array reference in the parent business object - context.previousList = currentObject[propertyName]; + svg = + '\n' + + '\n' + + '\n' + + '' + + defs + contents + + ''; + } catch (e) { + err = e; + } - if (updatedObjectList) { - currentObject[propertyName] = updatedObjectList; - } else { - var listCopy = []; - // remove all objects which should be removed - forEach(objectList, function(object) { - if (objectsToRemove.indexOf(object) == -1) { - listCopy.push(object); - } - }); - // add all objects which should be added - listCopy = listCopy.concat(objectsToAdd); + /** + * A `saveSVG.done` event. + * + * @event BaseViewer#SaveSVGDoneEvent + * @type {SaveSVGDoneEvent} + */ + this._emit('saveSVG.done', { + error: err, + svg: svg + }); - // set property to new list - if (listCopy.length > 0 || !referencePropertyName) { + if (err) { + throw err; + } - // as long as there are elements in the list update the list - currentObject[propertyName] = listCopy; - } else if (referencePropertyName) { + return { svg }; +}; - // remove the list when it is empty - var parentObject = currentObject.$parent; - parentObject.set(referencePropertyName, undefined); - } - } +BaseViewer.prototype._setDefinitions = function(definitions) { + this._definitions = definitions; +}; - context.changed = changed; +/** + * Return modules to instantiate with. + * + * @return {ModuleDeclaration[]} The modules. + */ +BaseViewer.prototype.getModules = function() { + return this._modules; +}; - // indicate changed on objects affected by the update - return changed; - }; +/** + * Remove all drawn elements from the viewer. + * + * After calling this method the viewer can still be reused for opening another + * diagram. + */ +BaseViewer.prototype.clear = function() { + if (!this.getDefinitions()) { - /** - * Reverts the update - * - * @method CreateBusinessObjectListHandler#revert - * - * @param {Object} context - * - * @return {djs.mode.Base} the updated element - */ - UpdateBusinessObjectListHandler.prototype.revert = function(context) { + // no diagram to clear + return; + } - var currentObject = context.currentObject, - propertyName = context.propertyName, - previousList = context.previousList, - parentObject = currentObject.$parent; + // remove drawn elements + diagram_js__WEBPACK_IMPORTED_MODULE_2__["default"].prototype.clear.call(this); +}; - if (context.referencePropertyName) { - parentObject.set(context.referencePropertyName, currentObject); - } +/** + * Destroy the viewer instance and remove all its remainders from the document + * tree. + */ +BaseViewer.prototype.destroy = function() { - // remove new element - currentObject.set(propertyName, previousList); + // diagram destroy + diagram_js__WEBPACK_IMPORTED_MODULE_2__["default"].prototype.destroy.call(this); - return context.changed; - }; + // dom detach + (0,min_dom__WEBPACK_IMPORTED_MODULE_4__.remove)(this._container); +}; - },{"lodash/forEach":613}],11:[function(require,module,exports){ - 'use strict'; +/** + * Register an event listener. + * + * Remove an event listener via {@link BaseViewer#off}. + * + * @template T + * + * @param {string|string[]} events The event(s) to listen to. + * @param {number} [priority] The priority with which to listen. + * @param {EventBusEventCallback} callback The callback. + * @param {any} [that] Value of `this` the callback will be called with. + */ +BaseViewer.prototype.on = function(events, priority, callback, that) { + return this.get('eventBus').on(events, priority, callback, that); +}; - var forEach = require('lodash/forEach'); +/** + * Remove an event listener. + * + * @param {string|string[]} events The event(s). + * @param {Function} [callback] The callback. + */ +BaseViewer.prototype.off = function(events, callback) { + this.get('eventBus').off(events, callback); +}; - var HANDLERS = { - 'properties-panel.update-businessobject': require('./UpdateBusinessObjectHandler'), - 'properties-panel.create-and-reference': require('./CreateAndReferenceHandler'), - 'properties-panel.create-businessobject-list': require('./CreateBusinessObjectListHandler'), - 'properties-panel.update-businessobject-list': require('./UpdateBusinessObjectListHandler'), - 'properties-panel.multi-command-executor': require('./MultiCommandHandler') - }; +/** + * Attach the viewer to an HTML element. + * + * @param {HTMLElement} parentNode The parent node to attach to. + */ +BaseViewer.prototype.attachTo = function(parentNode) { + if (!parentNode) { + throw new Error('parentNode required'); + } - function CommandInitializer(eventBus, commandStack) { + // ensure we detach from the + // previous, old parent + this.detach(); - eventBus.on('diagram.init', function() { - forEach(HANDLERS, function(handler, id) { - commandStack.registerHandler(id, handler); - }); - }); - } + // unwrap jQuery if provided + if (parentNode.get && parentNode.constructor.prototype.jquery) { + parentNode = parentNode.get(0); + } - CommandInitializer.$inject = [ 'eventBus', 'commandStack' ]; + if (typeof parentNode === 'string') { + parentNode = (0,min_dom__WEBPACK_IMPORTED_MODULE_4__.query)(parentNode); + } - module.exports = { - __init__: [ CommandInitializer ] - }; - },{"./CreateAndReferenceHandler":6,"./CreateBusinessObjectListHandler":7,"./MultiCommandHandler":8,"./UpdateBusinessObjectHandler":9,"./UpdateBusinessObjectListHandler":10,"lodash/forEach":613}],12:[function(require,module,exports){ - 'use strict'; + parentNode.appendChild(this._container); - var getBusinessObject = require('bpmn-js/lib/util/ModelUtil').getBusinessObject, - cmdHelper = require('../helper/CmdHelper'), - escapeHTML = require('../Utils').escapeHTML; + this._emit('attach', {}); - var entryFieldDescription = require('./EntryFieldDescription'); + this.get('canvas').resized(); +}; +/** + * Get the definitions model element. + * + * @return {ModdleElement} The definitions model element. + */ +BaseViewer.prototype.getDefinitions = function() { + return this._definitions; +}; - var checkbox = function(options, defaultParameters) { - var resource = defaultParameters, - id = resource.id, - label = options.label || id, - canBeDisabled = !!options.disabled && typeof options.disabled === 'function', - canBeHidden = !!options.hidden && typeof options.hidden === 'function', - description = options.description; +/** + * Detach the viewer. + * + * @fires BaseViewer#DetachEvent + */ +BaseViewer.prototype.detach = function() { - resource.html = - '' + - ''; + const container = this._container, + parentNode = container.parentNode; - // add description below checkbox entry field - if (description) { - resource.html += entryFieldDescription(description); - } + if (!parentNode) { + return; + } - resource.get = function(element) { - var bo = getBusinessObject(element), - res = {}; + /** + * A `detach` event. + * + * @event BaseViewer#DetachEvent + * @type {Object} + */ + this._emit('detach', {}); - res[options.modelProperty] = bo.get(options.modelProperty); + parentNode.removeChild(container); +}; - return res; - }; +BaseViewer.prototype._init = function(container, moddle, options) { - resource.set = function(element, values) { - var res = {}; + const baseModules = options.modules || this.getModules(options), + additionalModules = options.additionalModules || [], + staticModules = [ + { + bpmnjs: [ 'value', this ], + moddle: [ 'value', moddle ] + } + ]; - res[options.modelProperty] = !!values[options.modelProperty]; + const diagramModules = [].concat(staticModules, baseModules, additionalModules); - return cmdHelper.updateProperties(element, res); - }; + const diagramOptions = (0,min_dash__WEBPACK_IMPORTED_MODULE_0__.assign)((0,min_dash__WEBPACK_IMPORTED_MODULE_0__.omit)(options, [ 'additionalModules' ]), { + canvas: (0,min_dash__WEBPACK_IMPORTED_MODULE_0__.assign)({}, options.canvas, { container: container }), + modules: diagramModules + }); - if (typeof options.set === 'function') { - resource.set = options.set; - } + // invoke diagram constructor + diagram_js__WEBPACK_IMPORTED_MODULE_2__["default"].call(this, diagramOptions); - if (typeof options.get === 'function') { - resource.get = options.get; - } + if (options && options.container) { + this.attachTo(options.container); + } +}; - if (canBeDisabled) { - resource.isDisabled = function() { - return options.disabled.apply(resource, arguments); - }; - } +/** + * Emit an event on the underlying {@link EventBus} + * + * @param {string} type + * @param {Object} event + * + * @return {Object} The return value after calling all event listeners. + */ +BaseViewer.prototype._emit = function(type, event) { + return this.get('eventBus').fire(type, event); +}; - if (canBeHidden) { - resource.isHidden = function() { - return !options.hidden.apply(resource, arguments); - }; - } +/** + * @param {BaseViewerOptions} options + * + * @return {HTMLElement} + */ +BaseViewer.prototype._createContainer = function(options) { - resource.cssClasses = ['bpp-checkbox']; + const container = (0,min_dom__WEBPACK_IMPORTED_MODULE_4__.domify)('
'); - return resource; - }; + (0,min_dom__WEBPACK_IMPORTED_MODULE_4__.assignStyle)(container, { + width: ensureUnit(options.width), + height: ensureUnit(options.height), + position: options.position + }); - module.exports = checkbox; + return container; +}; - },{"../Utils":5,"../helper/CmdHelper":25,"./EntryFieldDescription":15,"bpmn-js/lib/util/ModelUtil":240}],13:[function(require,module,exports){ - 'use strict'; +/** + * @param {BaseViewerOptions} options + * + * @return {Moddle} + */ +BaseViewer.prototype._createModdle = function(options) { + const moddleOptions = (0,min_dash__WEBPACK_IMPORTED_MODULE_0__.assign)({}, this._moddleExtensions, options.moddleExtensions); - var assign = require('lodash/assign'), - find = require('lodash/find'); + return new bpmn_moddle__WEBPACK_IMPORTED_MODULE_6__["default"](moddleOptions); +}; - var domQuery = require('min-dom').query; +BaseViewer.prototype._modules = []; - var escapeHTML = require('../Utils').escapeHTML; +// helpers /////////////// - var selectEntryFactory = require('./SelectEntryFactory'), - entryFieldDescription = require('./EntryFieldDescription'); +function addWarningsToError(err, warningsAry) { + err.warnings = warningsAry; + return err; +} +function checkValidationError(err) { - /** - * The combo box is a special implementation of the select entry and adds the option 'custom' to the - * select box. If 'custom' is selected, an additional text input field is shown which allows to define - * a custom value. - * - * @param {Object} options - * @param {string} options.id - * @param {string} options.label - * @param {Array} options.selectOptions list of name/value pairs - * @param {string} options.modelProperty - * @param {function} options.get - * @param {function} options.set - * @param {string} [options.customValue] custom select option value (default: 'custom') - * @param {string} [options.customName] custom select option name visible in the select box (default: 'custom') - * - * @return {Object} - */ - var comboBox = function(options) { + // check if we can help the user by indicating wrong BPMN 2.0 xml + // (in case he or the exporting tool did not get that right) - var selectOptions = options.selectOptions, - modelProperty = options.modelProperty, - customValue = options.customValue || 'custom', - customName = options.customName || 'custom ' + modelProperty, - description = options.description; + const pattern = /unparsable content <([^>]+)> detected([\s\S]*)$/; + const match = pattern.exec(err.message); - // check if a value is not a built in value - var isCustomValue = function(value) { - if (typeof value[modelProperty] === 'undefined') { - return false; - } + if (match) { + err.message = + 'unparsable content <' + match[1] + '> detected; ' + + 'this may indicate an invalid BPMN 2.0 diagram file' + match[2]; + } - var isCustom = !find(selectOptions, function(option) { - return value[modelProperty] === option.value; - }); + return err; +} - return isCustom; - }; +const DEFAULT_OPTIONS = { + width: '100%', + height: '100%', + position: 'relative' +}; - var comboOptions = assign({}, options); - // true if the selected value in the select box is customValue - comboOptions.showCustomInput = function(element, node) { - var selectBox = domQuery('[data-entry="'+ options.id +'"] select', node.parentNode); +/** + * Ensure the passed argument is a proper unit (defaulting to px) + */ +function ensureUnit(val) { + return val + ((0,min_dash__WEBPACK_IMPORTED_MODULE_0__.isNumber)(val) ? 'px' : ''); +} - if (selectBox) { - return selectBox.value === customValue; - } - return false; - }; +/** + * Find BPMNDiagram in definitions by ID + * + * @param {ModdleElement} definitions + * @param {string} diagramId + * + * @return {ModdleElement|null} + */ +function findBPMNDiagram(definitions, diagramId) { + if (!diagramId) { + return null; + } - comboOptions.get = function(element, node) { - var value = options.get(element, node); + return (0,min_dash__WEBPACK_IMPORTED_MODULE_0__.find)(definitions.diagrams, function(element) { + return element.id === diagramId; + }) || null; +} - var modifiedValues = {}; - if (!isCustomValue(value)) { - modifiedValues[modelProperty] = value[modelProperty] || ''; +/* */ - return modifiedValues; - } - modifiedValues[modelProperty] = customValue; - modifiedValues['custom-'+modelProperty] = value[modelProperty]; - return modifiedValues; - }; - comboOptions.set = function(element, values, node) { - var modifiedValues = {}; - // if the custom select option has been selected - // take the value from the text input field - if (values[modelProperty] === customValue) { - modifiedValues[modelProperty] = values['custom-' + modelProperty] || ''; - } - else if (options.emptyParameter && values[modelProperty] === '') { - modifiedValues[modelProperty] = undefined; - } else { - modifiedValues[modelProperty] = values[modelProperty]; - } - return options.set(element, modifiedValues, node); - }; +/** + * Adds the project logo to the diagram container as + * required by the bpmn.io license. + * + * @see http://bpmn.io/license + * + * @param {Element} container + */ +function addProjectLogo(container) { + const img = _util_PoweredByUtil__WEBPACK_IMPORTED_MODULE_7__.BPMNIO_IMG; - comboOptions.selectOptions.push({ name: customName, value: customValue }); + const linkMarkup = + '' + + img + + ''; - var comboBoxEntry = assign({}, selectEntryFactory(comboOptions, comboOptions)); + const linkElement = (0,min_dom__WEBPACK_IMPORTED_MODULE_4__.domify)(linkMarkup); - comboBoxEntry.html += '
' + - '' + - '
'; + (0,min_dom__WEBPACK_IMPORTED_MODULE_4__.assignStyle)((0,min_dom__WEBPACK_IMPORTED_MODULE_4__.query)('svg', linkElement), _util_PoweredByUtil__WEBPACK_IMPORTED_MODULE_7__.LOGO_STYLES); + (0,min_dom__WEBPACK_IMPORTED_MODULE_4__.assignStyle)(linkElement, _util_PoweredByUtil__WEBPACK_IMPORTED_MODULE_7__.LINK_STYLES, { + position: 'absolute', + bottom: '15px', + right: '15px', + zIndex: '100' + }); - // add description below combo box entry field - if (description) { - comboBoxEntry.html += entryFieldDescription(description); - } + container.appendChild(linkElement); - return comboBoxEntry; - }; + min_dom__WEBPACK_IMPORTED_MODULE_4__.event.bind(linkElement, 'click', function(event) { + (0,_util_PoweredByUtil__WEBPACK_IMPORTED_MODULE_7__.open)(); - module.exports = comboBox; + event.preventDefault(); + }); +} - },{"../Utils":5,"./EntryFieldDescription":15,"./SelectEntryFactory":18,"lodash/assign":604,"lodash/find":610,"min-dom":647}],14:[function(require,module,exports){ - 'use strict'; +/*
*/ - var getBusinessObject = require('bpmn-js/lib/util/ModelUtil').getBusinessObject; -// input entities - var textInputField = require('./TextInputEntryFactory'), - checkboxField = require('./CheckboxEntryFactory'), - selectBoxField = require('./SelectEntryFactory'), - comboBoxField = require('./ComboEntryFactory'), - textBoxField = require('./TextBoxEntryFactory'), - validationAwareTextInputField = require('./ValidationAwareTextInput'), - tableField = require('./TableEntryFactory'), - labelEntry = require('./LabelFactory'), - link = require('./LinkEntryFactory'); +/***/ }), - var cmdHelper = require('../helper/CmdHelper'); +/***/ "../node_modules/bpmn-js/lib/Modeler.js": +/*!**********************************************!*\ + !*** ../node_modules/bpmn-js/lib/Modeler.js ***! + \**********************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { -// helpers //////////////////////////////////////// +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ Modeler) +/* harmony export */ }); +/* harmony import */ var inherits_browser__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! inherits-browser */ "../node_modules/inherits-browser/dist/index.es.js"); +/* harmony import */ var _BaseModeler__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./BaseModeler */ "../node_modules/bpmn-js/lib/BaseModeler.js"); +/* harmony import */ var _Viewer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Viewer */ "../node_modules/bpmn-js/lib/Viewer.js"); +/* harmony import */ var _NavigatedViewer__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./NavigatedViewer */ "../node_modules/bpmn-js/lib/NavigatedViewer.js"); +/* harmony import */ var diagram_js_lib_navigation_keyboard_move__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! diagram-js/lib/navigation/keyboard-move */ "../node_modules/diagram-js/lib/navigation/keyboard-move/index.js"); +/* harmony import */ var diagram_js_lib_navigation_movecanvas__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! diagram-js/lib/navigation/movecanvas */ "../node_modules/diagram-js/lib/navigation/movecanvas/index.js"); +/* harmony import */ var diagram_js_lib_navigation_zoomscroll__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! diagram-js/lib/navigation/zoomscroll */ "../node_modules/diagram-js/lib/navigation/zoomscroll/index.js"); +/* harmony import */ var _features_align_elements__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./features/align-elements */ "../node_modules/bpmn-js/lib/features/align-elements/index.js"); +/* harmony import */ var _features_auto_place__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./features/auto-place */ "../node_modules/bpmn-js/lib/features/auto-place/index.js"); +/* harmony import */ var _features_auto_resize__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./features/auto-resize */ "../node_modules/bpmn-js/lib/features/auto-resize/index.js"); +/* harmony import */ var diagram_js_lib_features_auto_scroll__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! diagram-js/lib/features/auto-scroll */ "../node_modules/diagram-js/lib/features/auto-scroll/index.js"); +/* harmony import */ var diagram_js_lib_features_bendpoints__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! diagram-js/lib/features/bendpoints */ "../node_modules/diagram-js/lib/features/bendpoints/index.js"); +/* harmony import */ var diagram_js_lib_features_connect__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! diagram-js/lib/features/connect */ "../node_modules/diagram-js/lib/features/connect/index.js"); +/* harmony import */ var diagram_js_lib_features_connection_preview__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! diagram-js/lib/features/connection-preview */ "../node_modules/diagram-js/lib/features/connection-preview/index.js"); +/* harmony import */ var _features_context_pad__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./features/context-pad */ "../node_modules/bpmn-js/lib/features/context-pad/index.js"); +/* harmony import */ var _features_copy_paste__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./features/copy-paste */ "../node_modules/bpmn-js/lib/features/copy-paste/index.js"); +/* harmony import */ var diagram_js_lib_features_create__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! diagram-js/lib/features/create */ "../node_modules/diagram-js/lib/features/create/index.js"); +/* harmony import */ var _features_distribute_elements__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./features/distribute-elements */ "../node_modules/bpmn-js/lib/features/distribute-elements/index.js"); +/* harmony import */ var _features_editor_actions__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./features/editor-actions */ "../node_modules/bpmn-js/lib/features/editor-actions/index.js"); +/* harmony import */ var _features_grid_snapping__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./features/grid-snapping */ "../node_modules/bpmn-js/lib/features/grid-snapping/index.js"); +/* harmony import */ var _features_interaction_events__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./features/interaction-events */ "../node_modules/bpmn-js/lib/features/interaction-events/index.js"); +/* harmony import */ var _features_keyboard__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./features/keyboard */ "../node_modules/bpmn-js/lib/features/keyboard/index.js"); +/* harmony import */ var diagram_js_lib_features_keyboard_move_selection__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! diagram-js/lib/features/keyboard-move-selection */ "../node_modules/diagram-js/lib/features/keyboard-move-selection/index.js"); +/* harmony import */ var _features_label_editing__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./features/label-editing */ "../node_modules/bpmn-js/lib/features/label-editing/index.js"); +/* harmony import */ var _features_modeling__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./features/modeling */ "../node_modules/bpmn-js/lib/features/modeling/index.js"); +/* harmony import */ var _features_modeling_feedback__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./features/modeling-feedback */ "../node_modules/bpmn-js/lib/features/modeling-feedback/index.js"); +/* harmony import */ var diagram_js_lib_features_move__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! diagram-js/lib/features/move */ "../node_modules/diagram-js/lib/features/move/index.js"); +/* harmony import */ var _features_outline__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./features/outline */ "../node_modules/bpmn-js/lib/features/outline/index.js"); +/* harmony import */ var _features_palette__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ./features/palette */ "../node_modules/bpmn-js/lib/features/palette/index.js"); +/* harmony import */ var _features_replace_preview__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ./features/replace-preview */ "../node_modules/bpmn-js/lib/features/replace-preview/index.js"); +/* harmony import */ var diagram_js_lib_features_resize__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! diagram-js/lib/features/resize */ "../node_modules/diagram-js/lib/features/resize/index.js"); +/* harmony import */ var _features_snapping__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ./features/snapping */ "../node_modules/bpmn-js/lib/features/snapping/index.js"); +/* harmony import */ var _features_search__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ./features/search */ "../node_modules/bpmn-js/lib/features/search/index.js"); - function ensureNotNull(prop) { - if (!prop) { - throw new Error(prop + ' must be set.'); - } - return prop; - } - /** - * sets the default parameters which are needed to create an entry - * - * @param options - * @returns {{id: *, description: (*|string), get: (*|Function), set: (*|Function), - * validate: (*|Function), html: string}} - */ - var setDefaultParameters = function(options) { - // default method to fetch the current value of the input field - var defaultGet = function(element) { - var bo = getBusinessObject(element), - res = {}, - prop = ensureNotNull(options.modelProperty); - res[prop] = bo.get(prop); - return res; - }; - // default method to set a new value to the input field - var defaultSet = function(element, values) { - var res = {}, - prop = ensureNotNull(options.modelProperty); - if (values[prop] !== '') { - res[prop] = values[prop]; - } else { - res[prop] = undefined; - } - return cmdHelper.updateProperties(element, res); - }; - // default validation method - var defaultValidate = function() { - return {}; - }; - return { - id : options.id, - description : (options.description || ''), - get : (options.get || defaultGet), - set : (options.set || defaultSet), - validate : (options.validate || defaultValidate), - html: '' - }; - }; - function EntryFactory() { - } - /** - * Generates an text input entry object for a property panel. - * options are: - * - id: id of the entry - String - * - * - description: description of the property - String - * - * - label: label for the input field - String - * - * - set: setter method - Function - * - * - get: getter method - Function - * - * - validate: validation mehtod - Function - * - * - modelProperty: name of the model property - String - * - * - buttonAction: Object which contains the following properties: - Object - * ---- name: name of the [data-action] callback - String - * ---- method: callback function for [data-action] - Function - * - * - buttonShow: Object which contains the following properties: - Object - * ---- name: name of the [data-show] callback - String - * ---- method: callback function for [data-show] - Function - * - * @param options - * @returns the propertyPanel entry resource object - */ - EntryFactory.textField = function(options) { - return textInputField(options, setDefaultParameters(options)); - }; - EntryFactory.validationAwareTextField = function(options) { - return validationAwareTextInputField(options, setDefaultParameters(options)); - }; - /** - * Generates a checkbox input entry object for a property panel. - * options are: - * - id: id of the entry - String - * - * - description: description of the property - String - * - * - label: label for the input field - String - * - * - set: setter method - Function - * - * - get: getter method - Function - * - * - validate: validation method - Function - * - * - modelProperty: name of the model property - String - * - * @param options - * @returns the propertyPanel entry resource object - */ - EntryFactory.checkbox = function(options) { - return checkboxField(options, setDefaultParameters(options)); - }; - EntryFactory.textBox = function(options) { - return textBoxField(options, setDefaultParameters(options)); - }; - EntryFactory.selectBox = function(options) { - return selectBoxField(options, setDefaultParameters(options)); - }; - EntryFactory.comboBox = function(options) { - return comboBoxField(options); - }; - EntryFactory.table = function(options) { - return tableField(options); - }; - EntryFactory.label = function(options) { - return labelEntry(options); - }; - EntryFactory.link = function(options) { - return link(options); - }; - module.exports = EntryFactory; - },{"../helper/CmdHelper":25,"./CheckboxEntryFactory":12,"./ComboEntryFactory":13,"./LabelFactory":16,"./LinkEntryFactory":17,"./SelectEntryFactory":18,"./TableEntryFactory":19,"./TextBoxEntryFactory":20,"./TextInputEntryFactory":21,"./ValidationAwareTextInput":22,"bpmn-js/lib/util/ModelUtil":240}],15:[function(require,module,exports){ - 'use strict'; - var escapeHTML = require('../Utils').escapeHTML; - /** - * Create a linkified and HTML escaped entry field description. - * - * As a special feature, this description may contain both markdown, - * plain links and
- * - * @param {String} description - */ - module.exports = function entryFieldDescription(description) { - // we tokenize the description to extract text, HTML and markdown links - // text, links and new lines are handled seperately - var escaped = []; - // match markdown [{TEXT}]({URL}) and HTML links
{TEXT} - var pattern = /(?:\[([^\]]+)\]\((https?:\/\/[^)]+)\))|(?:(.+?(?=<\/))<\/a>)/gi; - var index = 0; - var match; - var link, text; - while ((match = pattern.exec(description))) { - // escape + insert text before match - if (match.index > index) { - escaped.push(escapeText(description.substring(index, match.index))); - } - link = match[2] && encodeURI(match[2]) || match[3]; - text = match[1] || match[4]; - // insert safe link - escaped.push('' + escapeText(text) + ''); - index = match.index + match[0].length; - } - // escape and insert text after last match - if (index < description.length) { - escaped.push(escapeText(description.substring(index))); - } - return '
' + escaped.join('') + '
'; - }; - function escapeText(text) { - var match, index = 0, escaped = []; - // match new line

etc. - var pattern = //gi; - while ((match = pattern.exec(text))) { +var initialDiagram = + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + ''; - if (match.index > index) { - escaped.push(escapeHTML(text.substring(index, match.index))); - } - escaped.push('
'); +/** + * @typedef {import('./BaseViewer').BaseViewerOptions} BaseViewerOptions + * @typedef {import('./BaseViewer').ImportXMLResult} ImportXMLResult + */ - index = match.index + match[0].length; - } +/** + * A modeler for BPMN 2.0 diagrams. + * + * + * ## Extending the Modeler + * + * In order to extend the viewer pass extension modules to bootstrap via the + * `additionalModules` option. An extension module is an object that exposes + * named services. + * + * The following example depicts the integration of a simple + * logging component that integrates with interaction events: + * + * + * ```javascript + * + * // logging component + * function InteractionLogger(eventBus) { + * eventBus.on('element.hover', function(event) { + * console.log() + * }) + * } + * + * InteractionLogger.$inject = [ 'eventBus' ]; // minification save + * + * // extension module + * var extensionModule = { + * __init__: [ 'interactionLogger' ], + * interactionLogger: [ 'type', InteractionLogger ] + * }; + * + * // extend the viewer + * var bpmnModeler = new Modeler({ additionalModules: [ extensionModule ] }); + * bpmnModeler.importXML(...); + * ``` + * + * + * ## Customizing / Replacing Components + * + * You can replace individual diagram components by redefining them in override modules. + * This works for all components, including those defined in the core. + * + * Pass in override modules via the `options.additionalModules` flag like this: + * + * ```javascript + * function CustomContextPadProvider(contextPad) { + * + * contextPad.registerProvider(this); + * + * this.getContextPadEntries = function(element) { + * // no entries, effectively disable the context pad + * return {}; + * }; + * } + * + * CustomContextPadProvider.$inject = [ 'contextPad' ]; + * + * var overrideModule = { + * contextPadProvider: [ 'type', CustomContextPadProvider ] + * }; + * + * var bpmnModeler = new Modeler({ additionalModules: [ overrideModule ]}); + * ``` + * + * @param {BaseViewerOptions} [options] The options to configure the modeler. + */ +function Modeler(options) { + _BaseModeler__WEBPACK_IMPORTED_MODULE_0__["default"].call(this, options); +} - if (index < text.length) { - escaped.push(escapeHTML(text.substring(index))); - } +(0,inherits_browser__WEBPACK_IMPORTED_MODULE_1__["default"])(Modeler, _BaseModeler__WEBPACK_IMPORTED_MODULE_0__["default"]); - return escaped.join(''); - } - },{"../Utils":5}],16:[function(require,module,exports){ - 'use strict'; +Modeler.Viewer = _Viewer__WEBPACK_IMPORTED_MODULE_2__["default"]; +Modeler.NavigatedViewer = _NavigatedViewer__WEBPACK_IMPORTED_MODULE_3__["default"]; - /** - * The label factory provides a label entry. For the label text - * it expects either a string provided by the options.labelText - * parameter or it could be generated programmatically using a - * function passed as the options.get parameter. - * - * @param {Object} options - * @param {string} options.id - * @param {string} [options.labelText] - * @param {Function} [options.get] - * @param {Function} [options.showLabel] - * @param {Boolean} [options.divider] adds a divider at the top of the label if true; default: false - */ - var label = function(options) { - return { - id: options.id, - html: '', - get: function(element, node) { - if (typeof options.get === 'function') { - return options.get(element, node); - } - return { label: options.labelText }; - }, - showLabel: function(element, node) { - if (typeof options.showLabel === 'function') { - return options.showLabel(element, node); - } - return true; - } - }; - }; +/** + * Create a new diagram to start modeling. + * + * @throws {ImportXMLError} An error thrown during the import of the XML. + * + * @return {Promise} A promise resolving with warnings that were produced during the import. + */ +Modeler.prototype.createDiagram = function createDiagram() { + return this.importXML(initialDiagram); +}; + + +Modeler.prototype._interactionModules = [ + + // non-modeling components + diagram_js_lib_navigation_keyboard_move__WEBPACK_IMPORTED_MODULE_4__["default"], + diagram_js_lib_navigation_movecanvas__WEBPACK_IMPORTED_MODULE_5__["default"], + diagram_js_lib_navigation_zoomscroll__WEBPACK_IMPORTED_MODULE_6__["default"] +]; + +Modeler.prototype._modelingModules = [ + + // modeling components + _features_align_elements__WEBPACK_IMPORTED_MODULE_7__["default"], + _features_auto_place__WEBPACK_IMPORTED_MODULE_8__["default"], + diagram_js_lib_features_auto_scroll__WEBPACK_IMPORTED_MODULE_9__["default"], + _features_auto_resize__WEBPACK_IMPORTED_MODULE_10__["default"], + diagram_js_lib_features_bendpoints__WEBPACK_IMPORTED_MODULE_11__["default"], + diagram_js_lib_features_connect__WEBPACK_IMPORTED_MODULE_12__["default"], + diagram_js_lib_features_connection_preview__WEBPACK_IMPORTED_MODULE_13__["default"], + _features_context_pad__WEBPACK_IMPORTED_MODULE_14__["default"], + _features_copy_paste__WEBPACK_IMPORTED_MODULE_15__["default"], + diagram_js_lib_features_create__WEBPACK_IMPORTED_MODULE_16__["default"], + _features_distribute_elements__WEBPACK_IMPORTED_MODULE_17__["default"], + _features_editor_actions__WEBPACK_IMPORTED_MODULE_18__["default"], + _features_grid_snapping__WEBPACK_IMPORTED_MODULE_19__["default"], + _features_interaction_events__WEBPACK_IMPORTED_MODULE_20__["default"], + _features_keyboard__WEBPACK_IMPORTED_MODULE_21__["default"], + diagram_js_lib_features_keyboard_move_selection__WEBPACK_IMPORTED_MODULE_22__["default"], + _features_label_editing__WEBPACK_IMPORTED_MODULE_23__["default"], + _features_modeling__WEBPACK_IMPORTED_MODULE_24__["default"], + _features_modeling_feedback__WEBPACK_IMPORTED_MODULE_25__["default"], + diagram_js_lib_features_move__WEBPACK_IMPORTED_MODULE_26__["default"], + _features_outline__WEBPACK_IMPORTED_MODULE_27__["default"], + _features_palette__WEBPACK_IMPORTED_MODULE_28__["default"], + _features_replace_preview__WEBPACK_IMPORTED_MODULE_29__["default"], + diagram_js_lib_features_resize__WEBPACK_IMPORTED_MODULE_30__["default"], + _features_snapping__WEBPACK_IMPORTED_MODULE_31__["default"], + _features_search__WEBPACK_IMPORTED_MODULE_32__["default"] +]; + + +// modules the modeler is composed of +// +// - viewer modules +// - interaction modules +// - modeling modules - module.exports = label; +Modeler.prototype._modules = [].concat( + _Viewer__WEBPACK_IMPORTED_MODULE_2__["default"].prototype._modules, + Modeler.prototype._interactionModules, + Modeler.prototype._modelingModules +); - },{}],17:[function(require,module,exports){ - 'use strict'; - var escapeHTML = require('../Utils').escapeHTML; +/***/ }), - var entryFieldDescription = require('./EntryFieldDescription'); +/***/ "../node_modules/bpmn-js/lib/NavigatedViewer.js": +/*!******************************************************!*\ + !*** ../node_modules/bpmn-js/lib/NavigatedViewer.js ***! + \******************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - var bind = require('lodash/bind'); +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ NavigatedViewer) +/* harmony export */ }); +/* harmony import */ var inherits_browser__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! inherits-browser */ "../node_modules/inherits-browser/dist/index.es.js"); +/* harmony import */ var _Viewer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Viewer */ "../node_modules/bpmn-js/lib/Viewer.js"); +/* harmony import */ var diagram_js_lib_navigation_keyboard_move__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! diagram-js/lib/navigation/keyboard-move */ "../node_modules/diagram-js/lib/navigation/keyboard-move/index.js"); +/* harmony import */ var diagram_js_lib_navigation_movecanvas__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! diagram-js/lib/navigation/movecanvas */ "../node_modules/diagram-js/lib/navigation/movecanvas/index.js"); +/* harmony import */ var diagram_js_lib_navigation_zoomscroll__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! diagram-js/lib/navigation/zoomscroll */ "../node_modules/diagram-js/lib/navigation/zoomscroll/index.js"); - /** - * An entry that renders a clickable link. - * - * A passed {@link options#handleClick} handler is responsible - * to process the click. - * - * The link may be conditionally shown or hidden. This can be - * controlled via the {@link options.showLink}. - * - * @param {Object} options - * @param {String} options.id - * @param {String} [options.label] - * @param {Function} options.handleClick - * @param {Function} [options.showLink] returning false to hide link - * @param {String} [options.description] - * - * @example - * - * var linkEntry = link({ - * id: 'foo', - * description: 'Some Description', - * handleClick: function(element, node, event) { ... }, - * showLink: function(element, node) { ... } - * }); - * - * @return {Entry} the newly created entry - */ - function link(options) { - var id = options.id, - label = options.label || id, - showLink = options.showLink, - handleClick = options.handleClick, - description = options.description; - if (showLink && typeof showLink !== 'function') { - throw new Error('options.showLink must be a function'); - } - if (typeof handleClick !== 'function') { - throw new Error('options.handleClick must be a function'); - } - var resource = { - id: id - }; - resource.html = - '' + escapeHTML(label) + ''; - // add description below link entry field - if (description) { - resource.html += entryFieldDescription(description); - } - resource.handleClick = bind(handleClick, resource); +/** + * @typedef { import('./BaseViewer').BaseViewerOptions } BaseViewerOptions + */ - if (typeof showLink === 'function') { - resource.showLink = function() { - return showLink.apply(resource, arguments); - }; - } +/** + * A viewer with mouse and keyboard navigation features. + * + * @param {BaseViewerOptions} [options] + */ +function NavigatedViewer(options) { + _Viewer__WEBPACK_IMPORTED_MODULE_0__["default"].call(this, options); +} - return resource; - } +(0,inherits_browser__WEBPACK_IMPORTED_MODULE_1__["default"])(NavigatedViewer, _Viewer__WEBPACK_IMPORTED_MODULE_0__["default"]); - module.exports = link; - },{"../Utils":5,"./EntryFieldDescription":15,"lodash/bind":605}],18:[function(require,module,exports){ - 'use strict'; +NavigatedViewer.prototype._navigationModules = [ + diagram_js_lib_navigation_keyboard_move__WEBPACK_IMPORTED_MODULE_2__["default"], + diagram_js_lib_navigation_movecanvas__WEBPACK_IMPORTED_MODULE_3__["default"], + diagram_js_lib_navigation_zoomscroll__WEBPACK_IMPORTED_MODULE_4__["default"] +]; - var escapeHTML = require('../Utils').escapeHTML; +NavigatedViewer.prototype._modules = [].concat( + _Viewer__WEBPACK_IMPORTED_MODULE_0__["default"].prototype._modules, + NavigatedViewer.prototype._navigationModules +); - var domify = require('min-dom').domify; +/***/ }), - var forEach = require('lodash/forEach'); +/***/ "../node_modules/bpmn-js/lib/Viewer.js": +/*!*********************************************!*\ + !*** ../node_modules/bpmn-js/lib/Viewer.js ***! + \*********************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - var entryFieldDescription = require('./EntryFieldDescription'); +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ Viewer) +/* harmony export */ }); +/* harmony import */ var inherits_browser__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! inherits-browser */ "../node_modules/inherits-browser/dist/index.es.js"); +/* harmony import */ var _core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./core */ "../node_modules/bpmn-js/lib/core/index.js"); +/* harmony import */ var diagram_js_lib_i18n_translate__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! diagram-js/lib/i18n/translate */ "../node_modules/diagram-js/lib/i18n/translate/index.js"); +/* harmony import */ var diagram_js_lib_features_selection__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! diagram-js/lib/features/selection */ "../node_modules/diagram-js/lib/features/selection/index.js"); +/* harmony import */ var diagram_js_lib_features_overlays__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! diagram-js/lib/features/overlays */ "../node_modules/diagram-js/lib/features/overlays/index.js"); +/* harmony import */ var _features_drilldown__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./features/drilldown */ "../node_modules/bpmn-js/lib/features/drilldown/index.js"); +/* harmony import */ var _BaseViewer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./BaseViewer */ "../node_modules/bpmn-js/lib/BaseViewer.js"); - var isList = function(list) { - return !(!list || Object.prototype.toString.call(list) !== '[object Array]'); - }; - var addEmptyParameter = function(list) { - return list.concat([ { name: '', value: '' } ]); - }; - var createOption = function(option) { - return ''; - }; - /** - * @param {Object} options - * @param {string} options.id - * @param {string} [options.label] - * @param {Array} options.selectOptions - * @param {string} options.modelProperty - * @param {boolean} options.emptyParameter - * @param {function} options.disabled - * @param {function} options.hidden - * @param {Object} defaultParameters - * - * @return {Object} - */ - var selectbox = function(options, defaultParameters) { - var resource = defaultParameters, - label = options.label || resource.id, - selectOptions = options.selectOptions || [ { name: '', value: '' } ], - modelProperty = options.modelProperty, - emptyParameter = options.emptyParameter, - canBeDisabled = !!options.disabled && typeof options.disabled === 'function', - canBeHidden = !!options.hidden && typeof options.hidden === 'function', - description = options.description; - - - if (emptyParameter) { - selectOptions = addEmptyParameter(selectOptions); - } - - - resource.html = - '' + - ''; - // add description below select box entry field - if (description && typeof options.showCustomInput !== 'function') { - resource.html += entryFieldDescription(description); - } - /** - * Fill the select box options dynamically. - * - * Calls the defined function #selectOptions in the entry to get the - * values for the options and set the value to the inputNode. - * - * @param {djs.model.Base} element - * @param {HTMLElement} entryNode - * @param {EntryDescriptor} inputNode - * @param {Object} inputName - * @param {Object} newValue - */ - resource.setControlValue = function(element, entryNode, inputNode, inputName, newValue) { - if (typeof selectOptions === 'function') { - var options = selectOptions(element, inputNode); - if (options) { - // remove existing options - while (inputNode.firstChild) { - inputNode.removeChild(inputNode.firstChild); - } +/** + * @typedef { import('./BaseViewer').BaseViewerOptions } BaseViewerOptions + */ - // add options - forEach(options, function(option) { - var template = domify(createOption(option)); +/** + * A viewer for BPMN 2.0 diagrams. + * + * Have a look at {@link NavigatedViewer} or {@link Modeler} for bundles that include + * additional features. + * + * + * ## Extending the Viewer + * + * In order to extend the viewer pass extension modules to bootstrap via the + * `additionalModules` option. An extension module is an object that exposes + * named services. + * + * The following example depicts the integration of a simple + * logging component that integrates with interaction events: + * + * + * ```javascript + * + * // logging component + * function InteractionLogger(eventBus) { + * eventBus.on('element.hover', function(event) { + * console.log() + * }) + * } + * + * InteractionLogger.$inject = [ 'eventBus' ]; // minification save + * + * // extension module + * var extensionModule = { + * __init__: [ 'interactionLogger' ], + * interactionLogger: [ 'type', InteractionLogger ] + * }; + * + * // extend the viewer + * var bpmnViewer = new Viewer({ additionalModules: [ extensionModule ] }); + * bpmnViewer.importXML(...); + * ``` + * + * @param {BaseViewerOptions} [options] The options to configure the viewer. + */ +function Viewer(options) { + _BaseViewer__WEBPACK_IMPORTED_MODULE_0__["default"].call(this, options); +} + +(0,inherits_browser__WEBPACK_IMPORTED_MODULE_1__["default"])(Viewer, _BaseViewer__WEBPACK_IMPORTED_MODULE_0__["default"]); + +// modules the viewer is composed of +Viewer.prototype._modules = [ + _core__WEBPACK_IMPORTED_MODULE_2__["default"], + diagram_js_lib_i18n_translate__WEBPACK_IMPORTED_MODULE_3__["default"], + diagram_js_lib_features_selection__WEBPACK_IMPORTED_MODULE_4__["default"], + diagram_js_lib_features_overlays__WEBPACK_IMPORTED_MODULE_5__["default"], + _features_drilldown__WEBPACK_IMPORTED_MODULE_6__["default"] +]; + +// default moddle extensions the viewer is composed of +Viewer.prototype._moddleExtensions = {}; + +/***/ }), + +/***/ "../node_modules/bpmn-js/lib/core/index.js": +/*!*************************************************!*\ + !*** ../node_modules/bpmn-js/lib/core/index.js ***! + \*************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _draw__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../draw */ "../node_modules/bpmn-js/lib/draw/index.js"); +/* harmony import */ var _import__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../import */ "../node_modules/bpmn-js/lib/import/index.js"); + + + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ + __depends__: [ + _draw__WEBPACK_IMPORTED_MODULE_0__["default"], + _import__WEBPACK_IMPORTED_MODULE_1__["default"] + ] +}); + +/***/ }), + +/***/ "../node_modules/bpmn-js/lib/draw/BpmnRenderUtil.js": +/*!**********************************************************!*\ + !*** ../node_modules/bpmn-js/lib/draw/BpmnRenderUtil.js ***! + \**********************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ black: () => (/* binding */ black), +/* harmony export */ getBounds: () => (/* binding */ getBounds), +/* harmony export */ getCirclePath: () => (/* binding */ getCirclePath), +/* harmony export */ getDi: () => (/* reexport safe */ _util_ModelUtil__WEBPACK_IMPORTED_MODULE_0__.getDi), +/* harmony export */ getDiamondPath: () => (/* binding */ getDiamondPath), +/* harmony export */ getFillColor: () => (/* binding */ getFillColor), +/* harmony export */ getHeight: () => (/* binding */ getHeight), +/* harmony export */ getLabelColor: () => (/* binding */ getLabelColor), +/* harmony export */ getRectPath: () => (/* binding */ getRectPath), +/* harmony export */ getRoundRectPath: () => (/* binding */ getRoundRectPath), +/* harmony export */ getSemantic: () => (/* reexport safe */ _util_ModelUtil__WEBPACK_IMPORTED_MODULE_0__.getBusinessObject), +/* harmony export */ getStrokeColor: () => (/* binding */ getStrokeColor), +/* harmony export */ getWidth: () => (/* binding */ getWidth), +/* harmony export */ isCollection: () => (/* binding */ isCollection), +/* harmony export */ isThrowEvent: () => (/* binding */ isThrowEvent), +/* harmony export */ isTypedEvent: () => (/* binding */ isTypedEvent), +/* harmony export */ white: () => (/* binding */ white) +/* harmony export */ }); +/* harmony import */ var min_dash__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! min-dash */ "../node_modules/min-dash/dist/index.esm.js"); +/* harmony import */ var _util_ModelUtil__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../util/ModelUtil */ "../node_modules/bpmn-js/lib/util/ModelUtil.js"); +/* harmony import */ var diagram_js_lib_util_RenderUtil__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! diagram-js/lib/util/RenderUtil */ "../node_modules/diagram-js/lib/util/RenderUtil.js"); + + + + + + + +/** + * @typedef {import('../model').ModdleElement} ModdleElement + * @typedef {import('../model').Element} Element + * + * @typedef {import('../model').ShapeLike} ShapeLike + * + * @typedef {import('diagram-js/lib/util/Types').Dimensions} Dimensions + * @typedef {import('diagram-js/lib/util/Types').Rect} Rect + */ - inputNode.appendChild(template); - }); +// re-export for compatibility - } - } - // set select value - if (newValue !== undefined) { - inputNode.value = newValue; - } +var black = 'hsl(225, 10%, 15%)'; +var white = 'white'; - }; +// element utils ////////////////////// - if (canBeDisabled) { - resource.isDisabled = function() { - return options.disabled.apply(resource, arguments); - }; - } +/** + * Checks if eventDefinition of the given element matches with semantic type. + * + * @param {ModdleElement} event + * @param {string} eventDefinitionType + * + * @return {boolean} + */ +function isTypedEvent(event, eventDefinitionType) { + return (0,min_dash__WEBPACK_IMPORTED_MODULE_1__.some)(event.eventDefinitions, function(definition) { + return definition.$type === eventDefinitionType; + }); +} + +/** + * Check if element is a throw event. + * + * @param {ModdleElement} event + * + * @return {boolean} + */ +function isThrowEvent(event) { + return (event.$type === 'bpmn:IntermediateThrowEvent') || (event.$type === 'bpmn:EndEvent'); +} - if (canBeHidden) { - resource.isHidden = function() { - return !options.hidden.apply(resource, arguments); - }; - } +/** + * Check if element is a throw event. + * + * @param {ModdleElement} element + * + * @return {boolean} + */ +function isCollection(element) { + var dataObject = element.dataObjectRef; - resource.cssClasses = ['bpp-dropdown']; + return element.isCollection || (dataObject && dataObject.isCollection); +} - return resource; - }; - module.exports = selectbox; +// color access ////////////////////// - },{"../Utils":5,"./EntryFieldDescription":15,"lodash/forEach":613,"min-dom":647}],19:[function(require,module,exports){ - 'use strict'; +/** + * @param {Element} element + * @param {string} [defaultColor] + * @param {string} [overrideColor] + * + * @return {string} + */ +function getFillColor(element, defaultColor, overrideColor) { + var di = (0,_util_ModelUtil__WEBPACK_IMPORTED_MODULE_0__.getDi)(element); - var escapeHTML = require('../Utils').escapeHTML; + return overrideColor || di.get('color:background-color') || di.get('bioc:fill') || defaultColor || white; +} - var cmdHelper = require('../helper/CmdHelper'); +/** + * @param {Element} element + * @param {string} [defaultColor] + * @param {string} [overrideColor] + * + * @return {string} + */ +function getStrokeColor(element, defaultColor, overrideColor) { + var di = (0,_util_ModelUtil__WEBPACK_IMPORTED_MODULE_0__.getDi)(element); - var domQuery = require('min-dom').query, - domAttr = require('min-dom').attr, - domClosest = require('min-dom').closest; + return overrideColor || di.get('color:border-color') || di.get('bioc:stroke') || defaultColor || black; +} - var filter = require('lodash/filter'), - forEach = require('lodash/forEach'), - keys = require('lodash/keys'); +/** + * @param {Element} element + * @param {string} [defaultColor] + * @param {string} [defaultStrokeColor] + * @param {string} [overrideColor] + * + * @return {string} + */ +function getLabelColor(element, defaultColor, defaultStrokeColor, overrideColor) { + var di = (0,_util_ModelUtil__WEBPACK_IMPORTED_MODULE_0__.getDi)(element), + label = di.get('label'); - var domify = require('min-dom').domify; + return overrideColor || (label && label.get('color:color')) || defaultColor || + getStrokeColor(element, defaultStrokeColor); +} - var entryFieldDescription = require('./EntryFieldDescription'); +// cropping path customizations ////////////////////// - var updateSelection = require('selection-update'); +/** + * @param {ShapeLike} shape + * + * @return {string} path + */ +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 (0,diagram_js_lib_util_RenderUtil__WEBPACK_IMPORTED_MODULE_2__.componentsToPath)(circlePath); +} + +/** + * @param {ShapeLike} shape + * @param {number} [borderRadius] + * + * @return {string} path + */ +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 (0,diagram_js_lib_util_RenderUtil__WEBPACK_IMPORTED_MODULE_2__.componentsToPath)(roundRectPath); +} + +/** + * @param {ShapeLike} shape + * + * @return {string} path + */ +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 (0,diagram_js_lib_util_RenderUtil__WEBPACK_IMPORTED_MODULE_2__.componentsToPath)(diamondPath); +} + +/** + * @param {ShapeLike} shape + * + * @return {string} path + */ +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 (0,diagram_js_lib_util_RenderUtil__WEBPACK_IMPORTED_MODULE_2__.componentsToPath)(rectPath); +} + +/** + * Get width and height from element or overrides. + * + * @param {Dimensions|Rect|ShapeLike} bounds + * @param {Object} overrides + * + * @returns {Dimensions} + */ +function getBounds(bounds, overrides = {}) { + return { + width: getWidth(bounds, overrides), + height: getHeight(bounds, overrides) + }; +} + +/** + * Get width from element or overrides. + * + * @param {Dimensions|Rect|ShapeLike} bounds + * @param {Object} overrides + * + * @returns {number} + */ +function getWidth(bounds, overrides = {}) { + return (0,min_dash__WEBPACK_IMPORTED_MODULE_1__.has)(overrides, 'width') ? overrides.width : bounds.width; +} - var TABLE_ROW_DIV_SNIPPET = '
'; - var DELETE_ROW_BUTTON_SNIPPET = ''; +/** + * Get height from element or overrides. + * + * @param {Dimensions|Rect|ShapeLike} bounds + * @param {Object} overrides + * + * @returns {number} + */ +function getHeight(bounds, overrides = {}) { + return (0,min_dash__WEBPACK_IMPORTED_MODULE_1__.has)(overrides, 'height') ? overrides.height : bounds.height; +} - function createInputRowTemplate(properties, canRemove) { - var template = TABLE_ROW_DIV_SNIPPET; - template += createInputTemplate(properties, canRemove); - template += canRemove ? DELETE_ROW_BUTTON_SNIPPET : ''; - template += '
'; +/***/ }), - return template; - } +/***/ "../node_modules/bpmn-js/lib/draw/BpmnRenderer.js": +/*!********************************************************!*\ + !*** ../node_modules/bpmn-js/lib/draw/BpmnRenderer.js ***! + \********************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - function createInputTemplate(properties, canRemove) { - var columns = properties.length; - var template = ''; - forEach(properties, function(prop) { - template += ''; - }); - return template; - } +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ BpmnRenderer) +/* harmony export */ }); +/* harmony import */ var inherits_browser__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! inherits-browser */ "../node_modules/inherits-browser/dist/index.es.js"); +/* harmony import */ var min_dash__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! min-dash */ "../node_modules/min-dash/dist/index.esm.js"); +/* harmony import */ var diagram_js_lib_draw_BaseRenderer__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! diagram-js/lib/draw/BaseRenderer */ "../node_modules/diagram-js/lib/draw/BaseRenderer.js"); +/* harmony import */ var _util_DiUtil__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../util/DiUtil */ "../node_modules/bpmn-js/lib/util/DiUtil.js"); +/* harmony import */ var _util_LabelUtil__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../util/LabelUtil */ "../node_modules/bpmn-js/lib/util/LabelUtil.js"); +/* harmony import */ var _BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./BpmnRenderUtil */ "../node_modules/bpmn-js/lib/util/ModelUtil.js"); +/* harmony import */ var diagram_js_lib_util_RenderUtil__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! diagram-js/lib/util/RenderUtil */ "../node_modules/diagram-js/lib/util/RenderUtil.js"); +/* harmony import */ var _BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./BpmnRenderUtil */ "../node_modules/bpmn-js/lib/draw/BpmnRenderUtil.js"); +/* harmony import */ var min_dom__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! min-dom */ "../node_modules/min-dom/dist/index.esm.js"); +/* harmony import */ var tiny_svg__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! tiny-svg */ "../node_modules/tiny-svg/dist/index.esm.js"); +/* harmony import */ var diagram_js_lib_util_SvgTransformUtil__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! diagram-js/lib/util/SvgTransformUtil */ "../node_modules/diagram-js/lib/util/SvgTransformUtil.js"); +/* harmony import */ var ids__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ids */ "../node_modules/ids/dist/index.esm.js"); - function createLabelRowTemplate(labels) { - var template = TABLE_ROW_DIV_SNIPPET; - template += createLabelTemplate(labels); - template += ''; - return template; - } - function createLabelTemplate(labels) { - var columns = labels.length; - var template = ''; - forEach(labels, function(label) { - template += ''; - }); - return template; - } - function pick(elements, properties) { - return (elements || []).map(function(elem) { - var newElement = {}; - forEach(properties, function(prop) { - newElement[prop] = elem[prop] || ''; - }); - return newElement; - }); - } - function diff(element, node, values, oldValues, editable) { - return filter(values, function(value, idx) { - return !valueEqual(element, node, value, oldValues[idx], editable, idx); - }); - } - function valueEqual(element, node, value, oldValue, editable, idx) { - if (value && !oldValue) { - return false; - } - var allKeys = keys(value).concat(keys(oldValue)); - return allKeys.every(function(key) { - var n = value[key] || undefined; - var o = oldValue[key] || undefined; - return !editable(element, node, key, idx) || n === o; - }); - } - function getEntryNode(node) { - return domClosest(node, '[data-entry]', true); - } - function getContainer(node) { - return domQuery('div[data-list-entry-container]', node); - } - function getSelection(node) { - return { - start: node.selectionStart, - end: node.selectionEnd - }; - } - function setSelection(node, selection) { - node.selectionStart = selection.start; - node.selectionEnd = selection.end; - } - /** - * @param {Object} options - * @param {string} options.id - * @param {string} options.description - * @param {Array} options.modelProperties - * @param {Array} options.labels - * @param {Function} options.getElements - this callback function must return a list of business object items - * @param {Function} options.removeElement - * @param {Function} options.addElement - * @param {Function} options.updateElement - * @param {Function} options.editable - * @param {Function} options.setControlValue - * @param {Function} options.show - * - * @return {Object} - */ - module.exports = function(options) { - var id = options.id, - modelProperties = options.modelProperties, - labels = options.labels, - description = options.description; - var labelRow = createLabelRowTemplate(labels); - var getElements = options.getElements; - var removeElement = options.removeElement, - canRemove = typeof removeElement === 'function'; - var addElement = options.addElement, - canAdd = typeof addElement === 'function', - addLabel = options.addLabel || 'Add Value'; - var updateElement = options.updateElement, - canUpdate = typeof updateElement === 'function'; - var editable = options.editable || function() { return true; }, - setControlValue = options.setControlValue; - var show = options.show, - canBeShown = typeof show === 'function'; - var elements = function(element, node) { - return pick(getElements(element, node), modelProperties); - }; - var factory = { - id: id, - html: (canAdd ? - '
' + - '' + - '' + - '
' : '') + - '
' + - '
' + - labelRow + - '
' + - '
' + - '
' + - '
' + - // add description below table entry field - (description ? entryFieldDescription(description) : ''), - get: function(element, node) { - var boElements = elements(element, node, this.__invalidValues); - var invalidValues = this.__invalidValues; - delete this.__invalidValues; +var rendererIds = new ids__WEBPACK_IMPORTED_MODULE_0__["default"](); - forEach(invalidValues, function(value, idx) { - var element = boElements[idx]; +var ELEMENT_LABEL_DISTANCE = 10, + INNER_OUTER_DIST = 3, + PARTICIPANT_STROKE_WIDTH = 1.5, + TASK_BORDER_RADIUS = 10; - forEach(modelProperties, function(prop) { - element[prop] = value[prop]; - }); - }); +var DEFAULT_OPACITY = 0.95, + FULL_OPACITY = 1, + LOW_OPACITY = 0.25; - return boElements; - }, +/** + * @typedef { Partial<{ + * defaultFillColor: string, + * defaultStrokeColor: string, + * defaultLabelColor: string + * }> } BpmnRendererConfig + * + * @typedef { Partial<{ + * fill: string, + * stroke: string, + * width: string, + * height: string + * }> } Attrs + */ - set: function(element, values, node) { - var action = this.__action || {}; - delete this.__action; +/** + * @typedef { import('../model/Types').Element } Element + */ - if (action.id === 'delete-element') { - return removeElement(element, node, action.idx); - } - else if (action.id === 'add-element') { - return addElement(element, node); - } - else if (canUpdate) { - var commands = [], - valuesToValidate = values; +/** + * A renderer for BPMN elements + * + * @param {BpmnRendererConfig} config + * @param {import('diagram-js/lib/core/EventBus').default} eventBus + * @param {import('diagram-js/lib/draw/Styles').default} styles + * @param {import('./PathMap').default} pathMap + * @param {import('diagram-js/lib/core/Canvas').default} canvas + * @param {import('./TextRenderer').default} textRenderer + * @param {number} [priority] + */ +function BpmnRenderer( + config, eventBus, styles, pathMap, + canvas, textRenderer, priority) { + + diagram_js_lib_draw_BaseRenderer__WEBPACK_IMPORTED_MODULE_1__["default"].call(this, eventBus, priority); + + var defaultFillColor = config && config.defaultFillColor, + defaultStrokeColor = config && config.defaultStrokeColor, + defaultLabelColor = config && config.defaultLabelColor; + + var rendererId = rendererIds.next(); + + var markers = {}; + + function shapeStyle(attrs) { + return styles.computeStyle(attrs, { + strokeLinecap: 'round', + strokeLinejoin: 'round', + stroke: _BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_2__.black, + strokeWidth: 2, + fill: 'white' + }); + } + + function lineStyle(attrs) { + return styles.computeStyle(attrs, [ 'no-fill' ], { + strokeLinecap: 'round', + strokeLinejoin: 'round', + stroke: _BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_2__.black, + strokeWidth: 2 + }); + } + + function addMarker(id, options) { + var { + ref = { x: 0, y: 0 }, + scale = 1, + element + } = options; + + var marker = (0,tiny_svg__WEBPACK_IMPORTED_MODULE_3__.create)('marker', { + id: id, + viewBox: '0 0 20 20', + refX: ref.x, + refY: ref.y, + markerWidth: 20 * scale, + markerHeight: 20 * scale, + orient: 'auto' + }); + + (0,tiny_svg__WEBPACK_IMPORTED_MODULE_3__.append)(marker, element); + + var defs = (0,min_dom__WEBPACK_IMPORTED_MODULE_4__.query)('defs', canvas._svg); + + if (!defs) { + defs = (0,tiny_svg__WEBPACK_IMPORTED_MODULE_3__.create)('defs'); + + (0,tiny_svg__WEBPACK_IMPORTED_MODULE_3__.append)(canvas._svg, defs); + } + + (0,tiny_svg__WEBPACK_IMPORTED_MODULE_3__.append)(defs, marker); + + markers[id] = marker; + } + + function colorEscape(str) { + + // only allow characters and numbers + return str.replace(/[^0-9a-zA-Z]+/g, '_'); + } + + function marker(type, fill, stroke) { + var id = type + '-' + colorEscape(fill) + '-' + colorEscape(stroke) + '-' + rendererId; + + if (!markers[id]) { + createMarker(id, type, fill, stroke); + } + + return 'url(#' + id + ')'; + } + + function createMarker(id, type, fill, stroke) { + + if (type === 'sequenceflow-end') { + var sequenceflowEnd = (0,tiny_svg__WEBPACK_IMPORTED_MODULE_3__.create)('path', { + d: 'M 1 5 L 11 10 L 1 15 Z', + ...shapeStyle({ + fill: stroke, + stroke: stroke, + strokeWidth: 1 + }) + }); + + addMarker(id, { + element: sequenceflowEnd, + ref: { x: 11, y: 10 }, + scale: 0.5 + }); + } + + if (type === 'messageflow-start') { + var messageflowStart = (0,tiny_svg__WEBPACK_IMPORTED_MODULE_3__.create)('circle', { + cx: 6, + cy: 6, + r: 3.5, + ...shapeStyle({ + fill, + stroke: stroke, + strokeWidth: 1, + + // fix for safari / chrome / firefox bug not correctly + // resetting stroke dash array + strokeDasharray: [ 10000, 1 ] + }) + }); + + addMarker(id, { + element: messageflowStart, + ref: { x: 6, y: 6 } + }); + } + + if (type === 'messageflow-end') { + var messageflowEnd = (0,tiny_svg__WEBPACK_IMPORTED_MODULE_3__.create)('path', { + d: 'm 1 5 l 0 -3 l 7 3 l -7 3 z', + ...shapeStyle({ + fill, + stroke: stroke, + strokeWidth: 1, + + // fix for safari / chrome / firefox bug not correctly + // resetting stroke dash array + strokeDasharray: [ 10000, 1 ] + }) + }); + + addMarker(id, { + element: messageflowEnd, + ref: { x: 8.5, y: 5 } + }); + } + + if (type === 'association-start') { + var associationStart = (0,tiny_svg__WEBPACK_IMPORTED_MODULE_3__.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: [ 10000, 1 ] + }) + }); + + addMarker(id, { + element: associationStart, + ref: { x: 1, y: 10 }, + scale: 0.5 + }); + } + + if (type === 'association-end') { + var associationEnd = (0,tiny_svg__WEBPACK_IMPORTED_MODULE_3__.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: [ 10000, 1 ] + }) + }); + + addMarker(id, { + element: associationEnd, + ref: { x: 11, y: 10 }, + scale: 0.5 + }); + } + + if (type === 'conditional-flow-marker') { + var conditionalFlowMarker = (0,tiny_svg__WEBPACK_IMPORTED_MODULE_3__.create)('path', { + d: 'M 0 10 L 8 6 L 16 10 L 8 14 Z', + ...shapeStyle({ + fill, + stroke: stroke + }) + }); + + addMarker(id, { + element: conditionalFlowMarker, + ref: { x: -1, y: 10 }, + scale: 0.5 + }); + } + + if (type === 'conditional-default-flow-marker') { + var defaultFlowMarker = (0,tiny_svg__WEBPACK_IMPORTED_MODULE_3__.create)('path', { + d: 'M 6 4 L 10 16', + ...shapeStyle({ + stroke: stroke + }) + }); + + addMarker(id, { + element: defaultFlowMarker, + ref: { x: 0, y: 10 }, + scale: 0.5 + }); + } + } + + function drawCircle(parentGfx, width, height, offset, attrs = {}) { + + if ((0,min_dash__WEBPACK_IMPORTED_MODULE_5__.isObject)(offset)) { + attrs = offset; + offset = 0; + } + + offset = offset || 0; + + attrs = shapeStyle(attrs); + + var cx = width / 2, + cy = height / 2; + + var circle = (0,tiny_svg__WEBPACK_IMPORTED_MODULE_3__.create)('circle', { + cx: cx, + cy: cy, + r: Math.round((width + height) / 4 - offset), + ...attrs + }); + + (0,tiny_svg__WEBPACK_IMPORTED_MODULE_3__.append)(parentGfx, circle); + + return circle; + } + + function drawRect(parentGfx, width, height, r, offset, attrs) { + + if ((0,min_dash__WEBPACK_IMPORTED_MODULE_5__.isObject)(offset)) { + attrs = offset; + offset = 0; + } + + offset = offset || 0; + + attrs = shapeStyle(attrs); + + var rect = (0,tiny_svg__WEBPACK_IMPORTED_MODULE_3__.create)('rect', { + x: offset, + y: offset, + width: width - offset * 2, + height: height - offset * 2, + rx: r, + ry: r, + ...attrs + }); + + (0,tiny_svg__WEBPACK_IMPORTED_MODULE_3__.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 = (0,tiny_svg__WEBPACK_IMPORTED_MODULE_3__.create)('polygon', { + ...attrs, + points: pointsString + }); - if (typeof options.validate !== 'function') { - valuesToValidate = diff(element, node, values, elements(element, node), editable); - } + (0,tiny_svg__WEBPACK_IMPORTED_MODULE_3__.append)(parentGfx, polygon); - var self = this; + return polygon; + } - forEach(valuesToValidate, function(value) { - var validationError, - idx = values.indexOf(value); + /** + * @param {SVGElement} parentGfx + * @param {Point[]} waypoints + * @param {any} attrs + * @param {number} [radius] + * + * @return {SVGElement} + */ + function drawLine(parentGfx, waypoints, attrs, radius) { + attrs = lineStyle(attrs); - if (typeof options.validate === 'function') { - validationError = options.validate(element, value, node, idx); - } + var line = (0,diagram_js_lib_util_RenderUtil__WEBPACK_IMPORTED_MODULE_6__.createLine)(waypoints, attrs, radius); - if (!validationError) { - var cmd = updateElement(element, value, node, idx); + (0,tiny_svg__WEBPACK_IMPORTED_MODULE_3__.append)(parentGfx, line); - if (cmd) { - commands.push(cmd); - } - } else { - // cache invalid value in an object by index as key - self.__invalidValues = self.__invalidValues || {}; - self.__invalidValues[idx] = value; + return line; + } - // execute a command, which does not do anything - commands.push(cmdHelper.updateProperties(element, {})); - } - }); + /** + * @param {SVGElement} parentGfx + * @param {Point[]} waypoints + * @param {any} attrs + * + * @return {SVGElement} + */ + function drawConnectionSegments(parentGfx, waypoints, attrs) { + return drawLine(parentGfx, waypoints, attrs, 5); + } + + function drawPath(parentGfx, d, attrs) { + attrs = lineStyle(attrs); + + var path = (0,tiny_svg__WEBPACK_IMPORTED_MODULE_3__.create)('path', { + ...attrs, + d + }); + + (0,tiny_svg__WEBPACK_IMPORTED_MODULE_3__.append)(parentGfx, path); + + return path; + } + + function drawMarker(type, parentGfx, path, attrs) { + return drawPath(parentGfx, path, (0,min_dash__WEBPACK_IMPORTED_MODULE_5__.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 + ? (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_2__.getStrokeColor)(element, defaultStrokeColor, attrs.stroke) + : (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_2__.getFillColor)(element, defaultFillColor, attrs.fill); + + var stroke = isThrowing + ? (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_2__.getFillColor)(element, defaultFillColor, attrs.fill) + : (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_2__.getStrokeColor)(element, defaultStrokeColor, attrs.stroke); + + var messagePath = drawPath(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: (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_2__.getFillColor)(element, defaultFillColor, attrs.fill), + stroke: (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_2__.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 + } + }); + + drawPath(parentGfx, pathData, { + stroke: (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_2__.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 + } + }); - return commands; - } - }, - createListEntryTemplate: function(value, index, selectBox) { - return createInputRowTemplate(modelProperties, canRemove); - }, + var width = element.width / 2, + height = element.height / 2; - addElement: function(element, node, event, scopeNode) { - var template = domify(createInputRowTemplate(modelProperties, canRemove)); + drawPath(parentGfx, linePathData, { + strokeWidth: 1, + stroke: (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_2__.getStrokeColor)(element, defaultStrokeColor, attrs.stroke), + transform: 'rotate(' + (i * 30) + ',' + height + ',' + width + ')' + }); + } + + return circle; + }, + 'bpmn:EscalationEventDefinition': function(parentGfx, event, attrs = {}, isThrowing) { + var pathData = pathMap.getScaledPath('EVENT_ESCALATION', { + xScaleFactor: 1, + yScaleFactor: 1, + containerWidth: event.width, + containerHeight: event.height, + position: { + mx: 0.5, + my: 0.2 + } + }); + + var fill = isThrowing + ? (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_2__.getStrokeColor)(event, defaultStrokeColor, attrs.stroke) + : (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_2__.getFillColor)(event, defaultFillColor, attrs.fill); + + return drawPath(parentGfx, pathData, { + fill, + stroke: (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_2__.getStrokeColor)(event, defaultStrokeColor, attrs.stroke), + strokeWidth: 1 + }); + }, + 'bpmn:ConditionalEventDefinition': function(parentGfx, event, attrs = {}) { + var pathData = pathMap.getScaledPath('EVENT_CONDITIONAL', { + xScaleFactor: 1, + yScaleFactor: 1, + containerWidth: event.width, + containerHeight: event.height, + position: { + mx: 0.5, + my: 0.222 + } + }); + + return drawPath(parentGfx, pathData, { + fill: (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_2__.getFillColor)(event, defaultFillColor, attrs.fill), + stroke: (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_2__.getStrokeColor)(event, defaultStrokeColor, attrs.stroke), + strokeWidth: 1 + }); + }, + 'bpmn:LinkEventDefinition': function(parentGfx, event, attrs = {}, isThrowing) { + var pathData = pathMap.getScaledPath('EVENT_LINK', { + xScaleFactor: 1, + yScaleFactor: 1, + containerWidth: event.width, + containerHeight: event.height, + position: { + mx: 0.57, + my: 0.263 + } + }); + + var fill = isThrowing + ? (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_2__.getStrokeColor)(event, defaultStrokeColor, attrs.stroke) + : (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_2__.getFillColor)(event, defaultFillColor, attrs.fill); + + return drawPath(parentGfx, pathData, { + fill, + stroke: (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_2__.getStrokeColor)(event, defaultStrokeColor, attrs.stroke), + strokeWidth: 1 + }); + }, + 'bpmn:ErrorEventDefinition': function(parentGfx, event, attrs = {}, isThrowing) { + var pathData = pathMap.getScaledPath('EVENT_ERROR', { + xScaleFactor: 1.1, + yScaleFactor: 1.1, + containerWidth: event.width, + containerHeight: event.height, + position: { + mx: 0.2, + my: 0.722 + } + }); + + var fill = isThrowing + ? (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_2__.getStrokeColor)(event, defaultStrokeColor, attrs.stroke) + : (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_2__.getFillColor)(event, defaultFillColor, attrs.fill); + + return drawPath(parentGfx, pathData, { + fill, + stroke: (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_2__.getStrokeColor)(event, defaultStrokeColor, attrs.stroke), + strokeWidth: 1 + }); + }, + 'bpmn:CancelEventDefinition': function(parentGfx, event, attrs = {}, isThrowing) { + var pathData = pathMap.getScaledPath('EVENT_CANCEL_45', { + xScaleFactor: 1.0, + yScaleFactor: 1.0, + containerWidth: event.width, + containerHeight: event.height, + position: { + mx: 0.638, + my: -0.055 + } + }); + + var fill = isThrowing ? (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_2__.getStrokeColor)(event, defaultStrokeColor, attrs.stroke) : 'none'; + + var path = drawPath(parentGfx, pathData, { + fill, + stroke: (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_2__.getStrokeColor)(event, defaultStrokeColor, attrs.stroke), + strokeWidth: 1 + }); + + (0,diagram_js_lib_util_SvgTransformUtil__WEBPACK_IMPORTED_MODULE_7__.rotate)(path, 45); + + return path; + }, + 'bpmn:CompensateEventDefinition': function(parentGfx, event, attrs = {}, isThrowing) { + var pathData = pathMap.getScaledPath('EVENT_COMPENSATION', { + xScaleFactor: 1, + yScaleFactor: 1, + containerWidth: event.width, + containerHeight: event.height, + position: { + mx: 0.22, + my: 0.5 + } + }); + + var fill = isThrowing + ? (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_2__.getStrokeColor)(event, defaultStrokeColor, attrs.stroke) + : (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_2__.getFillColor)(event, defaultFillColor, attrs.fill); + + return drawPath(parentGfx, pathData, { + fill, + stroke: (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_2__.getStrokeColor)(event, defaultStrokeColor, attrs.stroke), + strokeWidth: 1 + }); + }, + 'bpmn:SignalEventDefinition': function(parentGfx, event, attrs = {}, isThrowing) { + var pathData = pathMap.getScaledPath('EVENT_SIGNAL', { + xScaleFactor: 0.9, + yScaleFactor: 0.9, + containerWidth: event.width, + containerHeight: event.height, + position: { + mx: 0.5, + my: 0.2 + } + }); + + var fill = isThrowing + ? (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_2__.getStrokeColor)(event, defaultStrokeColor, attrs.stroke) + : (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_2__.getFillColor)(event, defaultFillColor, attrs.fill); + + return drawPath(parentGfx, pathData, { + strokeWidth: 1, + fill, + stroke: (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_2__.getStrokeColor)(event, defaultStrokeColor, attrs.stroke) + }); + }, + 'bpmn:MultipleEventDefinition': function(parentGfx, event, attrs = {}, isThrowing) { + var pathData = pathMap.getScaledPath('EVENT_MULTIPLE', { + xScaleFactor: 1.1, + yScaleFactor: 1.1, + containerWidth: event.width, + containerHeight: event.height, + position: { + mx: 0.222, + my: 0.36 + } + }); + + var fill = isThrowing + ? (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_2__.getStrokeColor)(event, defaultStrokeColor, attrs.stroke) + : (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_2__.getFillColor)(event, defaultFillColor, attrs.fill); + + return drawPath(parentGfx, pathData, { + fill, + strokeWidth: 1 + }); + }, + 'bpmn:ParallelMultipleEventDefinition': function(parentGfx, event, attrs = {}) { + var pathData = pathMap.getScaledPath('EVENT_PARALLEL_MULTIPLE', { + xScaleFactor: 1.2, + yScaleFactor: 1.2, + containerWidth: event.width, + containerHeight: event.height, + position: { + mx: 0.458, + my: 0.194 + } + }); + + return drawPath(parentGfx, pathData, { + fill: (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_2__.getFillColor)(event, defaultFillColor, attrs.fill), + stroke: (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_2__.getStrokeColor)(event, defaultStrokeColor, attrs.stroke), + strokeWidth: 1 + }); + }, + 'bpmn:TerminateEventDefinition': function(parentGfx, element, attrs = {}) { + var circle = drawCircle(parentGfx, element.width, element.height, 8, { + fill: (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_2__.getStrokeColor)(element, defaultStrokeColor, attrs.stroke), + stroke: (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_2__.getStrokeColor)(element, defaultStrokeColor, attrs.stroke), + strokeWidth: 4 + }); + + return circle; + } + }; + + function renderEventIcon(element, parentGfx, attrs = {}) { + var semantic = (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_8__.getBusinessObject)(element), + isThrowing = (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_2__.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 ((0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_2__.isTypedEvent)(semantic, 'bpmn:MessageEventDefinition')) { + return eventIconRenderers[ 'bpmn:MessageEventDefinition' ](parentGfx, element, attrs, isThrowing); + } + + if ((0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_2__.isTypedEvent)(semantic, 'bpmn:TimerEventDefinition')) { + return eventIconRenderers[ 'bpmn:TimerEventDefinition' ](parentGfx, element, attrs, isThrowing); + } + + if ((0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_2__.isTypedEvent)(semantic, 'bpmn:ConditionalEventDefinition')) { + return eventIconRenderers[ 'bpmn:ConditionalEventDefinition' ](parentGfx, element, attrs, isThrowing); + } + + if ((0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_2__.isTypedEvent)(semantic, 'bpmn:SignalEventDefinition')) { + return eventIconRenderers[ 'bpmn:SignalEventDefinition' ](parentGfx, element, attrs, isThrowing); + } + + if ((0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_2__.isTypedEvent)(semantic, 'bpmn:EscalationEventDefinition')) { + return eventIconRenderers[ 'bpmn:EscalationEventDefinition' ](parentGfx, element, attrs, isThrowing); + } + + if ((0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_2__.isTypedEvent)(semantic, 'bpmn:LinkEventDefinition')) { + return eventIconRenderers[ 'bpmn:LinkEventDefinition' ](parentGfx, element, attrs, isThrowing); + } + + if ((0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_2__.isTypedEvent)(semantic, 'bpmn:ErrorEventDefinition')) { + return eventIconRenderers[ 'bpmn:ErrorEventDefinition' ](parentGfx, element, attrs, isThrowing); + } + + if ((0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_2__.isTypedEvent)(semantic, 'bpmn:CancelEventDefinition')) { + return eventIconRenderers[ 'bpmn:CancelEventDefinition' ](parentGfx, element, attrs, isThrowing); + } + + if ((0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_2__.isTypedEvent)(semantic, 'bpmn:CompensateEventDefinition')) { + return eventIconRenderers[ 'bpmn:CompensateEventDefinition' ](parentGfx, element, attrs, isThrowing); + } + + if ((0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_2__.isTypedEvent)(semantic, 'bpmn:TerminateEventDefinition')) { + return eventIconRenderers[ 'bpmn:TerminateEventDefinition' ](parentGfx, element, attrs, isThrowing); + } + + return null; + } + + var taskMarkerRenderers = { + 'ParticipantMultiplicityMarker': function(parentGfx, element, attrs = {}) { + var width = (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_2__.getWidth)(element, attrs), + height = (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_2__.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: (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_2__.getFillColor)(element, defaultFillColor, attrs.fill), + stroke: (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_2__.getStrokeColor)(element, defaultStrokeColor, attrs.stroke) + }); + }, + 'SubProcessMarker': function(parentGfx, element, attrs = {}) { + var markerRect = drawRect(parentGfx, 14, 14, 0, { + strokeWidth: 1, + fill: (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_2__.getFillColor)(element, defaultFillColor, attrs.fill), + stroke: (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_2__.getStrokeColor)(element, defaultStrokeColor, attrs.stroke) + }); + + (0,diagram_js_lib_util_SvgTransformUtil__WEBPACK_IMPORTED_MODULE_7__.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: (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_2__.getFillColor)(element, defaultFillColor, attrs.fill), + stroke: (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_2__.getStrokeColor)(element, defaultStrokeColor, attrs.stroke) + }); + }, + 'ParallelMarker': function(parentGfx, element, attrs) { + var width = (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_2__.getWidth)(element, attrs), + height = (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_2__.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: (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_2__.getFillColor)(element, defaultFillColor, attrs.fill), + stroke: (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_2__.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: (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_2__.getFillColor)(element, defaultFillColor, attrs.fill), + stroke: (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_2__.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: (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_2__.getFillColor)(element, defaultFillColor, attrs.fill), + stroke: (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_2__.getStrokeColor)(element, defaultStrokeColor, attrs.stroke) + }); + }, + 'LoopMarker': function(parentGfx, element, attrs) { + var width = (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_2__.getWidth)(element, attrs), + height = (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_2__.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: (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_2__.getStrokeColor)(element, defaultStrokeColor, attrs.stroke), + strokeMiterlimit: 0.5 + }); + }, + 'AdhocMarker': function(parentGfx, element, attrs) { + var width = (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_2__.getWidth)(element, attrs), + height = (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_2__.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: (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_2__.getStrokeColor)(element, defaultStrokeColor, attrs.stroke), + stroke: (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_2__.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: (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_2__.getWidth)(element, attrs), + height: (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_2__.getHeight)(element, attrs) + }; + + var semantic = (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_8__.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 + }; + } + + (0,min_dash__WEBPACK_IMPORTED_MODULE_5__.forEach)(taskMarkers, function(marker) { + renderTaskMarker(marker, parentGfx, element, attrs); + }); + + if (semantic.get('isForCompensation')) { + renderTaskMarker('CompensationMarker', parentGfx, element, attrs); + } + + if ((0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_8__.is)(semantic, 'bpmn:AdHocSubProcess')) { + renderTaskMarker('AdhocMarker', parentGfx, element, attrs); + } + + var loopCharacteristics = semantic.get('loopCharacteristics'), + isSequential = loopCharacteristics && loopCharacteristics.get('isSequential'); + + if (loopCharacteristics) { + + if (isSequential === undefined) { + 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 = (0,min_dash__WEBPACK_IMPORTED_MODULE_5__.assign)({ + size: { + width: 100 + } + }, attrs); + + var text = textRenderer.createText(label || '', attrs); + + (0,tiny_svg__WEBPACK_IMPORTED_MODULE_3__.classes)(text).add('djs-label'); + + (0,tiny_svg__WEBPACK_IMPORTED_MODULE_3__.append)(parentGfx, text); + + return text; + } + + function renderEmbeddedLabel(parentGfx, element, align, attrs = {}) { + var semantic = (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_8__.getBusinessObject)(element); + + var box = (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_2__.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: (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_2__.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, (0,_util_LabelUtil__WEBPACK_IMPORTED_MODULE_9__.getLabel)(element), { + box: box, + fitBox: true, + style: (0,min_dash__WEBPACK_IMPORTED_MODULE_5__.assign)( + {}, + textRenderer.getExternalStyle(), + { + fill: (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_2__.getLabelColor)(element, defaultLabelColor, defaultStrokeColor, attrs.stroke) + } + ) + }); + } + + function renderLaneLabel(parentGfx, text, element, attrs = {}) { + var isHorizontalLane = (0,_util_DiUtil__WEBPACK_IMPORTED_MODULE_10__.isHorizontal)(element); + + var textBox = renderLabel(parentGfx, text, { + box: { + height: 30, + width: isHorizontalLane ? (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_2__.getHeight)(element, attrs) : (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_2__.getWidth)(element, attrs), + }, + align: 'center-middle', + style: { + fill: (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_2__.getLabelColor)(element, defaultLabelColor, defaultStrokeColor, attrs.stroke) + } + }); + + if (isHorizontalLane) { + var top = -1 * (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_2__.getHeight)(element, attrs); + (0,diagram_js_lib_util_SvgTransformUtil__WEBPACK_IMPORTED_MODULE_7__.transform)(textBox, 0, -top, 270); + } + } + + function renderActivity(parentGfx, element, attrs = {}) { + var { + width, + height + } = (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_2__.getBounds)(element, attrs); + + return drawRect(parentGfx, width, height, TASK_BORDER_RADIUS, { + ...attrs, + fill: (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_2__.getFillColor)(element, defaultFillColor, attrs.fill), + fillOpacity: DEFAULT_OPACITY, + stroke: (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_2__.getStrokeColor)(element, defaultStrokeColor, attrs.stroke) + }); + } + + function renderAssociation(parentGfx, element, attrs = {}) { + var semantic = (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_8__.getBusinessObject)(element); + + var fill = (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_2__.getFillColor)(element, defaultFillColor, attrs.fill), + stroke = (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_2__.getStrokeColor)(element, defaultStrokeColor, attrs.stroke); + + if (semantic.get('associationDirection') === 'One' || + semantic.get('associationDirection') === 'Both') { + attrs.markerEnd = marker('association-end', fill, stroke); + } + + if (semantic.get('associationDirection') === 'Both') { + attrs.markerStart = marker('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 = (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_2__.getFillColor)(element, defaultFillColor, attrs.fill), + stroke = (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_2__.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 = drawPath(parentGfx, pathData, { + fill, + fillOpacity: DEFAULT_OPACITY, + stroke + }); + + var semantic = (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_8__.getBusinessObject)(element); + + if ((0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_2__.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 + } + }); + + drawPath(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: (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_2__.getFillColor)(element, defaultFillColor, attrs.fill), + stroke: (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_2__.getStrokeColor)(element, defaultStrokeColor, attrs.stroke) + }); + } + + function renderGateway(parentGfx, element, attrs = {}) { + return drawDiamond(parentGfx, element.width, element.height, { + fill: (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_2__.getFillColor)(element, defaultFillColor, attrs.fill), + fillOpacity: DEFAULT_OPACITY, + stroke: (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_2__.getStrokeColor)(element, defaultStrokeColor, attrs.stroke) + }); + } + + function renderLane(parentGfx, element, attrs = {}) { + var lane = drawRect(parentGfx, (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_2__.getWidth)(element, attrs), (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_2__.getHeight)(element, attrs), 0, { + fill: (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_2__.getFillColor)(element, defaultFillColor, attrs.fill), + fillOpacity: attrs.fillOpacity || DEFAULT_OPACITY, + stroke: (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_2__.getStrokeColor)(element, defaultStrokeColor, attrs.stroke), + strokeWidth: 1.5 + }); + + var semantic = (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_8__.getBusinessObject)(element); + + if ((0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_8__.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 ((0,_util_DiUtil__WEBPACK_IMPORTED_MODULE_10__.isEventSubProcess)(element)) { + (0,tiny_svg__WEBPACK_IMPORTED_MODULE_3__.attr)(activity, { + strokeDasharray: '0, 5.5', + strokeWidth: 2.5 + }); + } + + var expanded = (0,_util_DiUtil__WEBPACK_IMPORTED_MODULE_10__.isExpanded)(element); + + renderEmbeddedLabel(parentGfx, element, expanded ? 'center-top' : 'center-middle', attrs); + + if (expanded) { + renderTaskMarkers(parentGfx, element, undefined, 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, undefined, attrs); + + return activity; + } + + var handlers = this.handlers = { + 'bpmn:AdHocSubProcess': function(parentGfx, element, attrs = {}) { + if ((0,_util_DiUtil__WEBPACK_IMPORTED_MODULE_10__.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 = (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_8__.getBusinessObject)(element), + cancelActivity = semantic.get('cancelActivity'); + + attrs = { + strokeWidth: 1.5, + fill: (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_2__.getFillColor)(element, defaultFillColor, attrs.fill), + fillOpacity: FULL_OPACITY, + stroke: (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_2__.getStrokeColor)(element, defaultStrokeColor, attrs.stroke) + }; + + if (!cancelActivity) { + attrs.strokeDasharray = '6'; + } + + var event = renderEvent(parentGfx, element, attrs); + + drawCircle(parentGfx, element.width, element.height, INNER_OUTER_DIST, { + ...attrs, + fill: 'none' + }); + + if (renderIcon) { + renderEventIcon(element, parentGfx, attrs); + } + + return event; + }, + '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 = drawPath(parentGfx, headerData); + + (0,tiny_svg__WEBPACK_IMPORTED_MODULE_3__.attr)(businessPath, { + fill: (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_2__.getFillColor)(element, defaultFillColor, attrs.fill), + stroke: (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_2__.getStrokeColor)(element, defaultStrokeColor, attrs.stroke), + strokeWidth: 1 + }); + + var headerPathData = pathMap.getScaledPath('TASK_TYPE_BUSINESS_RULE_HEADER', { + abspos: { + x: 8, + y: 8 + } + }); + + var businessHeaderPath = drawPath(parentGfx, headerPathData); + + (0,tiny_svg__WEBPACK_IMPORTED_MODULE_3__.attr)(businessHeaderPath, { + fill: (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_2__.getStrokeColor)(element, defaultStrokeColor, attrs.stroke), + stroke: (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_2__.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 + } + }); + + drawPath(parentGfx, pathData, { + fill: (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_2__.getStrokeColor)(element, defaultStrokeColor, attrs.stroke), + stroke: (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_2__.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); + + drawPath(parentGfx, arrowPathData, { + fill: 'none', + stroke: (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_2__.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('association-end', (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_2__.getFillColor)(element, defaultFillColor, attrs.fill), (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_2__.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); + + drawPath(parentGfx, arrowPathData, { + strokeWidth: 1, + fill: (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_2__.getFillColor)(element, defaultFillColor, attrs.fill), + stroke: (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_2__.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('association-end', (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_2__.getFillColor)(element, defaultFillColor, attrs.fill), (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_2__.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 drawPath(parentGfx, dataStorePath, { + fill: (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_2__.getFillColor)(element, defaultFillColor, attrs.fill), + fillOpacity: DEFAULT_OPACITY, + stroke: (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_2__.getStrokeColor)(element, defaultStrokeColor, attrs.stroke), + strokeWidth: 2 + }); + }, + 'bpmn:EndEvent': function(parentGfx, element, attrs = {}) { + var { renderIcon = true } = attrs; + + attrs = pickAttrs(attrs, [ + 'fill', + 'stroke' + ]); + + var event = renderEvent(parentGfx, element, { + ...attrs, + strokeWidth: 4 + }); + + if (renderIcon) { + renderEventIcon(element, parentGfx, attrs); + } + + return event; + }, + 'bpmn:EventBasedGateway': function(parentGfx, element, attrs = {}) { + attrs = pickAttrs(attrs, [ + 'fill', + 'stroke' + ]); + + var semantic = (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_8__.getBusinessObject)(element); + + var diamond = renderGateway(parentGfx, element, attrs); + + drawCircle(parentGfx, element.width, element.height, element.height * 0.20, { + fill: (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_2__.getFillColor)(element, 'none', attrs.fill), + stroke: (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_2__.getStrokeColor)(element, defaultStrokeColor, attrs.stroke), + strokeWidth: 1 + }); + + var type = semantic.get('eventGatewayType'), + instantiate = !!semantic.get('instantiate'); + + function drawEvent() { + + var pathData = pathMap.getScaledPath('GATEWAY_EVENT_BASED', { + xScaleFactor: 0.18, + yScaleFactor: 0.18, + containerWidth: element.width, + containerHeight: element.height, + position: { + mx: 0.36, + my: 0.44 + } + }); - var container = getContainer(node); - container.appendChild(template); + drawPath(parentGfx, pathData, { + fill: 'none', + stroke: (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_2__.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 + } + }); - this.__action = { - id: 'add-element' - }; + drawPath(parentGfx, pathData, { + fill: 'none', + stroke: (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_2__.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: (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_2__.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 = (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_8__.getDi)(element); + + if (di.get('isMarkerVisible')) { + drawPath(parentGfx, pathData, { + fill: (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_2__.getStrokeColor)(element, defaultStrokeColor, attrs.stroke), + stroke: (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_2__.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: (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_2__.getStrokeColor)(element, defaultStrokeColor, attrs.stroke), + strokeWidth: 1.5, + strokeDasharray: '10, 6, 0, 6', + fill: 'none', + pointerEvents: 'none', + width: (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_2__.getWidth)(element, attrs), + height: (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_2__.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: (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_2__.getFillColor)(element, defaultFillColor, attrs.fill), + stroke: (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_2__.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: (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_2__.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 + } + }); + + drawPath(parentGfx, pathData, { + fill: (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_2__.getFillColor)(element, defaultFillColor, attrs.fill), + stroke: (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_2__.getStrokeColor)(element, defaultStrokeColor, attrs.stroke), + strokeWidth: 0.5 + }); + + return task; + }, + 'bpmn:MessageFlow': function(parentGfx, element, attrs = {}) { + attrs = pickAttrs(attrs, [ + 'fill', + 'stroke' + ]); + + var semantic = (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_8__.getBusinessObject)(element), + di = (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_8__.getDi)(element); + + var fill = (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_2__.getFillColor)(element, defaultFillColor, attrs.fill), + stroke = (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_2__.getStrokeColor)(element, defaultStrokeColor, attrs.stroke); + + var path = drawConnectionSegments(parentGfx, element.waypoints, { + markerEnd: marker('messageflow-end', fill, stroke), + markerStart: marker('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 + } + }); - return true; - }, + var messageAttrs = { + strokeWidth: 1 + }; - deleteElement: function(element, node, event, scopeNode) { - var container = getContainer(node); - var rowToDelete = event.delegateTarget.parentNode; - var idx = parseInt(domAttr(rowToDelete, 'data-index'), 10); + if (di.get('messageVisibleKind') === 'initiating') { + messageAttrs.fill = fill; + messageAttrs.stroke = stroke; + } else { + messageAttrs.fill = stroke; + messageAttrs.stroke = fill; + } - container.removeChild(rowToDelete); + var message = drawPath(parentGfx, markerPathData, messageAttrs); - this.__action = { - id: 'delete-element', - idx: idx - }; + var messageRef = semantic.get('messageRef'), + name = messageRef.get('name'); - return true; - }, + var label = renderLabel(parentGfx, name, { + align: 'center-top', + fitBox: true, + style: { + fill: stroke + } + }); - editable: function(element, rowNode, input, prop, value, idx) { - var entryNode = domClosest(rowNode, '[data-entry]'); - return editable(element, entryNode, prop, idx); - }, + var messageBounds = message.getBBox(), + labelBounds = label.getBBox(); + + var translateX = midPoint.x - labelBounds.width / 2, + translateY = midPoint.y + messageBounds.height / 2 + ELEMENT_LABEL_DISTANCE; + + (0,diagram_js_lib_util_SvgTransformUtil__WEBPACK_IMPORTED_MODULE_7__.transform)(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 + } + }); + + drawPath(parentGfx, pathData, { + fill: (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_2__.getStrokeColor)(element, defaultStrokeColor, attrs.stroke), + stroke: (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_2__.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 = (0,_util_DiUtil__WEBPACK_IMPORTED_MODULE_10__.isExpanded)(element); + var horizontalParticipant = (0,_util_DiUtil__WEBPACK_IMPORTED_MODULE_10__.isHorizontal)(element); + + var semantic = (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_8__.getBusinessObject)(element), + name = semantic.get('name'); + + if (expandedParticipant) { + var waypoints = horizontalParticipant ? [ + { + x: 30, + y: 0 + }, + { + x: 30, + y: (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_2__.getHeight)(element, attrs) + } + ] : [ + { + x: 0, + y: 30 + }, + { + x: (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_2__.getWidth)(element, attrs), + y: 30 + } + ]; - show: function(element, entryNode, node, scopeNode) { - entryNode = getEntryNode(entryNode); - return show(element, entryNode, node, scopeNode); - }, + drawLine(parentGfx, waypoints, { + stroke: (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_2__.getStrokeColor)(element, defaultStrokeColor, attrs.stroke), + strokeWidth: PARTICIPANT_STROKE_WIDTH + }); - showTable: function(element, entryNode, node, scopeNode) { - entryNode = getEntryNode(entryNode); - var elems = elements(element, entryNode); - return elems && elems.length && (!canBeShown || show(element, entryNode, node, scopeNode)); - }, + renderLaneLabel(parentGfx, name, element, attrs); + } else { + var bounds = (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_2__.getBounds)(element, attrs); - validateListItem: function(element, value, node, idx) { - if (typeof options.validate === 'function') { - return options.validate(element, value, node, idx); - } - } + if (!horizontalParticipant) { + bounds.height = (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_2__.getWidth)(element, attrs); + bounds.width = (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_2__.getHeight)(element, attrs); + } - }; + var textBox = renderLabel(parentGfx, name, { + box: bounds, + align: 'center-middle', + style: { + fill: (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_2__.getLabelColor)(element, defaultLabelColor, defaultStrokeColor, attrs.stroke) + } + }); - // Update/set the selection on the correct position. - // It's the same code like for an input value in the PropertiesPanel.js. - if (setControlValue) { - factory.setControlValue = function(element, rowNode, input, prop, value, idx) { - var entryNode = getEntryNode(rowNode); + if (!horizontalParticipant) { + var top = -1 * (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_2__.getHeight)(element, attrs); + (0,diagram_js_lib_util_SvgTransformUtil__WEBPACK_IMPORTED_MODULE_7__.transform)(textBox, 0, -top, 270); + } + } - var isReadOnly = domAttr(input, 'readonly'); - var oldValue = input.value; + if (semantic.get('participantMultiplicity')) { + renderTaskMarker('ParticipantMultiplicityMarker', parentGfx, element, attrs); + } - var selection; + return participant; + }, + 'bpmn:ReceiveTask' : function(parentGfx, element, attrs = {}) { + attrs = pickAttrs(attrs, [ + 'fill', + 'stroke' + ]); - // prevents input fields from having the value 'undefined' - if (value === undefined) { - value = ''; - } + var semantic = (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_8__.getBusinessObject)(element); - // when the attribute 'readonly' exists, ignore the comparison - // with 'oldValue' and 'value' - if (!!isReadOnly && oldValue === value) { - return; - } + var task = renderTask(parentGfx, element, attrs); - // update selection on undo/redo - if (document.activeElement === input) { - selection = updateSelection(getSelection(input), oldValue, value); - } + var pathData; - setControlValue(element, entryNode, input, prop, value, idx); + if (semantic.get('instantiate')) { + drawCircle(parentGfx, 28, 28, 20 * 0.22, { + fill: (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_2__.getFillColor)(element, defaultFillColor, attrs.fill), + stroke: (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_2__.getStrokeColor)(element, defaultStrokeColor, attrs.stroke), + strokeWidth: 1 + }); - if (selection) { - setSelection(input, selection); - } + 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 + } + }); + } + + drawPath(parentGfx, pathData, { + fill: (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_2__.getFillColor)(element, defaultFillColor, attrs.fill), + stroke: (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_2__.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 + } + }); + + drawPath(parentGfx, pathData, { + fill: (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_2__.getFillColor)(element, defaultFillColor, attrs.fill), + stroke: (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_2__.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 + } + }); + + drawPath(parentGfx, pathData, { + fill: (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_2__.getStrokeColor)(element, defaultStrokeColor, attrs.stroke), + stroke: (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_2__.getFillColor)(element, defaultFillColor, attrs.fill), + strokeWidth: 1 + }); + + return task; + }, + 'bpmn:SequenceFlow': function(parentGfx, element, attrs = {}) { + attrs = pickAttrs(attrs, [ + 'fill', + 'stroke' + ]); + + var fill = (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_2__.getFillColor)(element, defaultFillColor, attrs.fill), + stroke = (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_2__.getStrokeColor)(element, defaultStrokeColor, attrs.stroke); + + var connection = drawConnectionSegments(parentGfx, element.waypoints, { + markerEnd: marker('sequenceflow-end', fill, stroke), + stroke + }); + + var semantic = (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_8__.getBusinessObject)(element); + + var { source } = element; + + if (source) { + var sourceSemantic = (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_8__.getBusinessObject)(source); + + // conditional flow marker + if (semantic.get('conditionExpression') && (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_8__.is)(sourceSemantic, 'bpmn:Activity')) { + (0,tiny_svg__WEBPACK_IMPORTED_MODULE_3__.attr)(connection, { + markerStart: marker('conditional-flow-marker', fill, stroke) + }); + } + + // default marker + if (sourceSemantic.get('default') && ((0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_8__.is)(sourceSemantic, 'bpmn:Gateway') || (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_8__.is)(sourceSemantic, 'bpmn:Activity')) && + sourceSemantic.get('default') === semantic) { + (0,tiny_svg__WEBPACK_IMPORTED_MODULE_3__.attr)(connection, { + markerStart: marker('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: (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_2__.getFillColor)(element, defaultFillColor, attrs.fill), + stroke: 'none', + transform: 'translate(6, 6)' + }); + + var pathDataService1 = pathMap.getScaledPath('TASK_TYPE_SERVICE', { + abspos: { + x: 12, + y: 18 + } + }); + + drawPath(parentGfx, pathDataService1, { + fill: (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_2__.getFillColor)(element, defaultFillColor, attrs.fill), + stroke: (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_2__.getStrokeColor)(element, defaultStrokeColor, attrs.stroke), + strokeWidth: 1 + }); + + drawCircle(parentGfx, 10, 10, { + fill: (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_2__.getFillColor)(element, defaultFillColor, attrs.fill), + stroke: 'none', + transform: 'translate(11, 10)' + }); + + var pathDataService2 = pathMap.getScaledPath('TASK_TYPE_SERVICE', { + abspos: { + x: 17, + y: 22 + } + }); + + drawPath(parentGfx, pathDataService2, { + fill: (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_2__.getFillColor)(element, defaultFillColor, attrs.fill), + stroke: (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_2__.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 = (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_8__.getBusinessObject)(element); + + if (!semantic.get('isInterrupting')) { + attrs = { + ...attrs, + strokeDasharray: '6' + }; + } + + var event = renderEvent(parentGfx, element, attrs); + + if (renderIcon) { + renderEventIcon(element, parentGfx, attrs); + } + + return event; + }, + 'bpmn:SubProcess': function(parentGfx, element, attrs = {}) { + if ((0,_util_DiUtil__WEBPACK_IMPORTED_MODULE_10__.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 + } = (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_2__.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.0, + my: 0.0 + } + }); + + drawPath(parentGfx, textPathData, { + stroke: (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_2__.getStrokeColor)(element, defaultStrokeColor, attrs.stroke) + }); + + var semantic = (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_8__.getBusinessObject)(element), + text = semantic.get('text') || ''; + + renderLabel(parentGfx, text, { + align: 'left-top', + box: (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_2__.getBounds)(element, attrs), + padding: 7, + style: { + fill: (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_2__.getLabelColor)(element, defaultLabelColor, defaultStrokeColor, attrs.stroke) + } + }); + + return textElement; + }, + 'bpmn:Transaction': function(parentGfx, element, attrs = {}) { + if ((0,_util_DiUtil__WEBPACK_IMPORTED_MODULE_10__.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: (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_2__.getStrokeColor)(element, defaultStrokeColor, attrs.stroke), + strokeWidth: 1.5 + }); + + var expanded = (0,_util_DiUtil__WEBPACK_IMPORTED_MODULE_10__.isExpanded)(element); + + if (!expanded) { + attrs = {}; + } + + drawRect( + parentGfx, + (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_2__.getWidth)(element, attrs), + (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_2__.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: x, + y: y + } + }); + + drawPath(parentGfx, pathDataUser1, { + fill: (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_2__.getFillColor)(element, defaultFillColor, attrs.fill), + stroke: (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_2__.getStrokeColor)(element, defaultStrokeColor, attrs.stroke), + strokeWidth: 0.5 + }); + + var pathDataUser2 = pathMap.getScaledPath('TASK_TYPE_USER_2', { + abspos: { + x: x, + y: y + } + }); + + drawPath(parentGfx, pathDataUser2, { + fill: (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_2__.getFillColor)(element, defaultFillColor, attrs.fill), + stroke: (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_2__.getStrokeColor)(element, defaultStrokeColor, attrs.stroke), + strokeWidth: 0.5 + }); + + var pathDataUser3 = pathMap.getScaledPath('TASK_TYPE_USER_3', { + abspos: { + x: x, + y: y + } + }); + + drawPath(parentGfx, pathDataUser3, { + fill: (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_2__.getStrokeColor)(element, defaultStrokeColor, attrs.stroke), + stroke: (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_2__.getStrokeColor)(element, defaultStrokeColor, attrs.stroke), + strokeWidth: 0.5 + }); + + return task; + }, + 'label': function(parentGfx, element, attrs = {}) { + return renderExternalLabel(parentGfx, element, attrs); + } + }; + + // extension API, use at your own risk + this._drawPath = drawPath; + + this._renderer = renderer; +} + + +(0,inherits_browser__WEBPACK_IMPORTED_MODULE_11__["default"])(BpmnRenderer, diagram_js_lib_draw_BaseRenderer__WEBPACK_IMPORTED_MODULE_1__["default"]); + +BpmnRenderer.$inject = [ + 'config.bpmnRenderer', + 'eventBus', + 'styles', + 'pathMap', + 'canvas', + 'textRenderer' +]; + + +/** + * @param {Element} element + * + * @return {boolean} + */ +BpmnRenderer.prototype.canRender = function(element) { + return (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_8__.is)(element, 'bpmn:BaseElement'); +}; - }; - } +/** + * Draw shape into parentGfx. + * + * @param {SVGElement} parentGfx + * @param {Element} element + * @param {Attrs} [attrs] + * + * @return {SVGElement} mainGfx + */ +BpmnRenderer.prototype.drawShape = function(parentGfx, element, attrs = {}) { + var { type } = element; - return factory; + var handler = this._renderer(type); - }; + return handler(parentGfx, element, attrs); +}; - },{"../Utils":5,"../helper/CmdHelper":25,"./EntryFieldDescription":15,"lodash/filter":609,"lodash/forEach":613,"lodash/keys":630,"min-dom":647,"selection-update":657}],20:[function(require,module,exports){ - 'use strict'; +/** + * Draw connection into parentGfx. + * + * @param {SVGElement} parentGfx + * @param {Element} element + * @param {Attrs} [attrs] + * + * @return {SVGElement} mainGfx + */ +BpmnRenderer.prototype.drawConnection = function(parentGfx, element, attrs = {}) { + var { type } = element; - var escapeHTML = require('../Utils').escapeHTML; + var handler = this._renderer(type); - var entryFieldDescription = require('./EntryFieldDescription'); + return handler(parentGfx, element, attrs); +}; +/** + * Get shape path. + * + * @param {Element} element + * + * @return {string} path + */ +BpmnRenderer.prototype.getShapePath = function(element) { + if ((0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_8__.is)(element, 'bpmn:Event')) { + return (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_2__.getCirclePath)(element); + } - var textBox = function(options, defaultParameters) { + if ((0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_8__.is)(element, 'bpmn:Activity')) { + return (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_2__.getRoundRectPath)(element, TASK_BORDER_RADIUS); + } - var resource = defaultParameters, - label = options.label || resource.id, - canBeShown = !!options.show && typeof options.show === 'function', - description = options.description; + if ((0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_8__.is)(element, 'bpmn:Gateway')) { + return (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_2__.getDiamondPath)(element); + } - resource.html = - '' + - '
' + - '
' + - '
'; + return (0,_BpmnRenderUtil__WEBPACK_IMPORTED_MODULE_2__.getRectPath)(element); +}; - // add description below text box entry field - if (description) { - resource.html += entryFieldDescription(description); - } +/** + * Pick attributes if they exist. + * + * @param {Object} attrs + * @param {string[]} keys + * + * @returns {Object} + */ +function pickAttrs(attrs, keys = []) { + return keys.reduce((pickedAttrs, key) => { + if (attrs[ key ]) { + pickedAttrs[ key ] = attrs[ key ]; + } + + return pickedAttrs; + }, {}); +} + +/***/ }), + +/***/ "../node_modules/bpmn-js/lib/draw/PathMap.js": +/*!***************************************************!*\ + !*** ../node_modules/bpmn-js/lib/draw/PathMap.js ***! + \***************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ PathMap) +/* harmony export */ }); +/** + * Map containing SVG paths needed by BpmnRenderer + */ +function PathMap() { - if (canBeShown) { - resource.isShown = function() { - return options.show.apply(resource, arguments); - }; - } + /** + * Contains a map of path elements + * + *

Path definition

+ * A parameterized path is defined like this: + *
+   * 'GATEWAY_PARALLEL': {
+   *   d: 'm {mx},{my} {e.x0},0 0,{e.x1} {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: 17.5,
+   *   width:  17.5,
+   *   heightElements: [2.5, 7.5],
+   *   widthElements: [2.5, 7.5]
+   * }
+   * 
+ *

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

+ *

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

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

+ */ + 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},0' + + 'c {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},0' + + 'm -{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,0' + + 'm -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 z' + + 'm -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 z' + + 'm 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' + } + }; + + /** + * Return raw path for the given ID. + * + * @param {string} pathId + * + * @return {string} raw path + */ + this.getRawPath = function getRawPath(pathId) { + return this.pathMap[pathId].d; + }; + + /** + * Scales the path to the given height and width. + *

Use case

+ *

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

+ *

Why not transform

+ *

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

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

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

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

+ * + * @return {string} scaled path + */ + this.getScaledPath = function getScaledPath(pathId, param) { + var rawPath = this.pathMap[pathId]; + + // positioning + // compute the start point of the path + 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 = {}; // map for the scaled coordinates + if (param.position) { + + // path + var heightRatio = (param.containerHeight / rawPath.height) * param.yScaleFactor; + var widthRatio = (param.containerWidth / rawPath.width) * param.xScaleFactor; + + + // Apply height ratio + for (var heightIndex = 0; heightIndex < rawPath.heightElements.length; heightIndex++) { + coordinates['y' + heightIndex] = rawPath.heightElements[heightIndex] * heightRatio; + } + + // Apply width ratio + for (var widthIndex = 0; widthIndex < rawPath.widthElements.length; widthIndex++) { + coordinates['x' + widthIndex] = rawPath.widthElements[widthIndex] * widthRatio; + } + } + + // Apply value to raw path + var path = format( + rawPath.d, { + mx: mx, + my: my, + e: coordinates + } + ); + return path; + }; +} + +// helpers ////////////////////// + +// copied and adjusted from https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js +var tokenRegex = /\{([^{}]+)\}/g, + objNotationRegex = /(?:(?:^|\.)(.+?)(?=\[|\.|$|\()|\[('|")(.+?)\2\])(\(\))?/g; // matches .xxxxx or ["xxxxx"] to run over object properties + +function replacer(all, key, obj) { + var res = obj; + key.replace(objNotationRegex, function(all, name, quote, quotedName, isFunc) { + name = name || quotedName; + if (res) { + if (name in res) { + res = res[name]; + } + typeof res == 'function' && isFunc && (res = res()); + } + }); + res = (res == null || res == obj ? all : res) + ''; + + return res; +} + +function format(str, obj) { + return String(str).replace(tokenRegex, function(all, key) { + return replacer(all, key, obj); + }); +} + + +/***/ }), + +/***/ "../node_modules/bpmn-js/lib/draw/TextRenderer.js": +/*!********************************************************!*\ + !*** ../node_modules/bpmn-js/lib/draw/TextRenderer.js ***! + \********************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ TextRenderer) +/* harmony export */ }); +/* harmony import */ var min_dash__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! min-dash */ "../node_modules/min-dash/dist/index.esm.js"); +/* harmony import */ var diagram_js_lib_util_Text__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! diagram-js/lib/util/Text */ "../node_modules/diagram-js/lib/util/Text.js"); + + + + +var DEFAULT_FONT_SIZE = 12; +var LINE_HEIGHT_RATIO = 1.2; + +var MIN_TEXT_ANNOTATION_HEIGHT = 30; + +/** + * @typedef { { + * fontFamily: string; + * fontSize: number; + * fontWeight: string; + * lineHeight: number; + * } } TextRendererStyle + * + * @typedef { { + * defaultStyle?: Partial; + * externalStyle?: Partial; + * } } TextRendererConfig + * + * @typedef { import('diagram-js/lib/util/Text').TextLayoutConfig } TextLayoutConfig + * + * @typedef { import('diagram-js/lib/util/Types').Rect } Rect + */ - resource.cssClasses = ['bpp-textbox']; - return resource; - }; +/** + * Renders text and computes text bounding boxes. + * + * @param {TextRendererConfig} [config] + */ +function TextRenderer(config) { - module.exports = textBox; + var defaultStyle = (0,min_dash__WEBPACK_IMPORTED_MODULE_0__.assign)({ + fontFamily: 'Arial, sans-serif', + fontSize: DEFAULT_FONT_SIZE, + fontWeight: 'normal', + lineHeight: LINE_HEIGHT_RATIO + }, config && config.defaultStyle || {}); - },{"../Utils":5,"./EntryFieldDescription":15}],21:[function(require,module,exports){ - 'use strict'; + var fontSize = parseInt(defaultStyle.fontSize, 10) - 1; - var escapeHTML = require('../Utils').escapeHTML; + var externalStyle = (0,min_dash__WEBPACK_IMPORTED_MODULE_0__.assign)({}, defaultStyle, { + fontSize: fontSize + }, config && config.externalStyle || {}); - var domQuery = require('min-dom').query; + var textUtil = new diagram_js_lib_util_Text__WEBPACK_IMPORTED_MODULE_1__["default"]({ + style: defaultStyle + }); - var entryFieldDescription = require('./EntryFieldDescription'); + /** + * Get the new bounds of an externally rendered, + * layouted label. + * + * @param {Rect} bounds + * @param {string} text + * + * @return {Rect} + */ + this.getExternalLabelBounds = function(bounds, text) { + + var layoutedDimensions = textUtil.getDimensions(text, { + box: { + width: 90, + height: 30 + }, + style: externalStyle + }); + + // resize label shape to fit label text + 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) + }; + + }; + + /** + * Get the new bounds of text annotation. + * + * @param {Rect} bounds + * @param {string} text + * + * @return {Rect} + */ + 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)) + }; + }; + + /** + * Create a layouted text element. + * + * @param {string} text + * @param {TextLayoutConfig} [options] + * + * @return {SVGElement} rendered text + */ + this.createText = function(text, options) { + return textUtil.createText(text, options || {}); + }; + /** + * Get default text style. + */ + this.getDefaultStyle = function() { + return defaultStyle; + }; - var textField = function(options, defaultParameters) { + /** + * Get the external text style. + */ + this.getExternalStyle = function() { + return externalStyle; + }; - // Default action for the button next to the input-field - var defaultButtonAction = function(element, inputNode) { - var input = domQuery('input[name="' + options.modelProperty + '"]', inputNode); - input.value = ''; +} - return true; - }; +TextRenderer.$inject = [ + 'config.textRenderer' +]; - // default method to determine if the button should be visible - var defaultButtonShow = function(element, inputNode) { - var input = domQuery('input[name="' + options.modelProperty + '"]', inputNode); +/***/ }), - return input.value !== ''; - }; +/***/ "../node_modules/bpmn-js/lib/draw/index.js": +/*!*************************************************!*\ + !*** ../node_modules/bpmn-js/lib/draw/index.js ***! + \*************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _BpmnRenderer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./BpmnRenderer */ "../node_modules/bpmn-js/lib/draw/BpmnRenderer.js"); +/* harmony import */ var _TextRenderer__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./TextRenderer */ "../node_modules/bpmn-js/lib/draw/TextRenderer.js"); +/* harmony import */ var _PathMap__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./PathMap */ "../node_modules/bpmn-js/lib/draw/PathMap.js"); - var resource = defaultParameters, - label = options.label || resource.id, - dataValueLabel = options.dataValueLabel, - buttonLabel = (options.buttonLabel || 'X'), - actionName = (typeof options.buttonAction != 'undefined') ? options.buttonAction.name : 'clear', - actionMethod = (typeof options.buttonAction != 'undefined') ? options.buttonAction.method : defaultButtonAction, - showName = (typeof options.buttonShow != 'undefined') ? options.buttonShow.name : 'canClear', - showMethod = (typeof options.buttonShow != 'undefined') ? options.buttonShow.method : defaultButtonShow, - canBeDisabled = !!options.disabled && typeof options.disabled === 'function', - canBeHidden = !!options.hidden && typeof options.hidden === 'function', - description = options.description; - - resource.html = - '' + - '
' + - '' + - '' + - '
'; - - // add description below text input entry field - if (description) { - resource.html += entryFieldDescription(description); - } - - resource[actionName] = actionMethod; - resource[showName] = showMethod; - - if (canBeDisabled) { - resource.isDisabled = function() { - return options.disabled.apply(resource, arguments); - }; - } - if (canBeHidden) { - resource.isHidden = function() { - return !options.hidden.apply(resource, arguments); - }; - } - resource.cssClasses = ['bpp-textfield']; - return resource; - }; - module.exports = textField; +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ + __init__: [ 'bpmnRenderer' ], + bpmnRenderer: [ 'type', _BpmnRenderer__WEBPACK_IMPORTED_MODULE_0__["default"] ], + textRenderer: [ 'type', _TextRenderer__WEBPACK_IMPORTED_MODULE_1__["default"] ], + pathMap: [ 'type', _PathMap__WEBPACK_IMPORTED_MODULE_2__["default"] ] +}); - },{"../Utils":5,"./EntryFieldDescription":15,"min-dom":647}],22:[function(require,module,exports){ - 'use strict'; - var textField = require('./TextInputEntryFactory'); +/***/ }), - /** - * This function is a wrapper around TextInputEntryFactory. - * It adds functionality to cache an invalid value entered in the - * text input, instead of setting it on the business object. - */ - var validationAwareTextField = function(options, defaultParameters) { +/***/ "../node_modules/bpmn-js/lib/features/align-elements/AlignElementsContextPadProvider.js": +/*!**********************************************************************************************!*\ + !*** ../node_modules/bpmn-js/lib/features/align-elements/AlignElementsContextPadProvider.js ***! + \**********************************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - var modelProperty = options.modelProperty; +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ AlignElementsContextPadProvider) +/* harmony export */ }); +/* harmony import */ var min_dash__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! min-dash */ "../node_modules/min-dash/dist/index.esm.js"); +/* harmony import */ var _AlignElementsIcons__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./AlignElementsIcons */ "../node_modules/bpmn-js/lib/features/align-elements/AlignElementsIcons.js"); - defaultParameters.get = function(element, node) { - var value = this.__lastInvalidValue; - delete this.__lastInvalidValue; - var properties = {}; - properties[modelProperty] = value !== undefined ? value : options.getProperty(element, node); +/** + * @typedef {import('diagram-js/lib/core/Canvas').default} Canvas + * @typedef {import('diagram-js/lib/features/context-pad/ContextPad').default} ContextPad + * @typedef {import('diagram-js/lib/features/popup-menu/PopupMenu').default} PopupMenu + * @typedef {import('diagram-js/lib/i18n/translate/translate').default} Translate + * + * @typedef {import('../../model/Types').Element} Element + * @typedef {import('diagram-js/lib/features/context-pad/ContextPad').ContextPadEntries} ContextPadEntries + * @typedef {import('diagram-js/lib/features/context-pad/ContextPadProvider').default} ContextPadProvider + */ - return properties; - }; +var LOW_PRIORITY = 900; - defaultParameters.set = function(element, values, node) { - var validationErrors = validate.apply(this, [ element, values, node ]), - propertyValue = values[modelProperty]; +/** + * A provider for the `Align elements` context pad entry. + * + * @implements {ContextPadProvider} + * + * @param {ContextPad} contextPad + * @param {PopupMenu} popupMenu + * @param {Translate} translate + * @param {Canvas} canvas + */ +function AlignElementsContextPadProvider(contextPad, popupMenu, translate, canvas) { - // make sure we do not update the id - if (validationErrors && validationErrors[modelProperty]) { - this.__lastInvalidValue = propertyValue; + contextPad.registerProvider(LOW_PRIORITY, this); - return options.setProperty(element, {}, node); - } else { - var properties = {}; + this._contextPad = contextPad; + this._popupMenu = popupMenu; + this._translate = translate; + this._canvas = canvas; +} - properties[modelProperty] = propertyValue; +AlignElementsContextPadProvider.$inject = [ + 'contextPad', + 'popupMenu', + 'translate', + 'canvas' +]; - return options.setProperty(element, properties, node); - } - }; +/** + * @param {Element[]} elements + * + * @return {ContextPadEntries} + */ +AlignElementsContextPadProvider.prototype.getMultiElementContextPadEntries = function(elements) { + var actions = {}; - var validate = defaultParameters.validate = function(element, values, node) { - var value = values[modelProperty] || this.__lastInvalidValue; + if (this._isAllowed(elements)) { + (0,min_dash__WEBPACK_IMPORTED_MODULE_0__.assign)(actions, this._getEntries(elements)); + } - var property = {}; - property[modelProperty] = value; + return actions; +}; - return options.validate(element, property, node); - }; +AlignElementsContextPadProvider.prototype._isAllowed = function(elements) { + return !this._popupMenu.isEmpty(elements, 'align-elements'); +}; - return textField(options, defaultParameters); - }; +AlignElementsContextPadProvider.prototype._getEntries = function() { + var self = this; - module.exports = validationAwareTextField; + return { + 'align-elements': { + group: 'align-elements', + title: self._translate('Align elements'), + html: `
${_AlignElementsIcons__WEBPACK_IMPORTED_MODULE_1__["default"]['align']}
`, + action: { + click: function(event, target) { + var position = self._getMenuPosition(target); - },{"./TextInputEntryFactory":21}],23:[function(require,module,exports){ - 'use strict'; + (0,min_dash__WEBPACK_IMPORTED_MODULE_0__.assign)(position, { + cursor: { + x: event.x, + y: event.y + } + }); - var map = require('lodash/map'); + self._popupMenu.open(target, 'align-elements', position); + } + } + } + }; +}; - var extensionElementsHelper = require('./ExtensionElementsHelper'); +AlignElementsContextPadProvider.prototype._getMenuPosition = function(elements) { + var Y_OFFSET = 5; - /** - * Returns true if the attribute 'camunda:asyncBefore' is set - * to true. - * - * @param {ModdleElement} bo - * - * @return {boolean} a boolean value - */ - function isAsyncBefore(bo) { - return !!(bo.get('camunda:asyncBefore') || bo.get('camunda:async')); - } + var pad = this._contextPad.getPad(elements).html; - module.exports.isAsyncBefore = isAsyncBefore; + var padRect = pad.getBoundingClientRect(); - /** - * Returns true if the attribute 'camunda:asyncAfter' is set - * to true. - * - * @param {ModdleElement} bo - * - * @return {boolean} a boolean value - */ - function isAsyncAfter(bo) { - return !!bo.get('camunda:asyncAfter'); - } + var pos = { + x: padRect.left, + y: padRect.bottom + Y_OFFSET + }; - module.exports.isAsyncAfter = isAsyncAfter; + return pos; +}; - /** - * Returns true if the attribute 'camunda:exclusive' is set - * to true. - * - * @param {ModdleElement} bo - * - * @return {boolean} a boolean value - */ - function isExclusive(bo) { - return !!bo.get('camunda:exclusive'); - } - module.exports.isExclusive = isExclusive; +/***/ }), - /** - * Get first 'camunda:FailedJobRetryTimeCycle' from the business object. - * - * @param {ModdleElement} bo - * - * @return {Array} a list of 'camunda:FailedJobRetryTimeCycle' - */ - function getFailedJobRetryTimeCycle(bo) { - return (extensionElementsHelper.getExtensionElements(bo, 'camunda:FailedJobRetryTimeCycle') || [])[0]; - } +/***/ "../node_modules/bpmn-js/lib/features/align-elements/AlignElementsIcons.js": +/*!*********************************************************************************!*\ + !*** ../node_modules/bpmn-js/lib/features/align-elements/AlignElementsIcons.js ***! + \*********************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - module.exports.getFailedJobRetryTimeCycle = getFailedJobRetryTimeCycle; +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/** + * To change the icons, modify the SVGs in `./resources`, execute `npx svgo -f resources --datauri enc -o dist`, + * and then replace respective icons with the optimized data URIs in `./dist`. + */ +var icons = { + align: ` + + + + `, + bottom: ` + + + + `, + center: ` + + + + `, + left: ` + + + + `, + right: ` + + + + `, + top: ` + + + + `, + middle: ` + + + + ` +}; + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (icons); + + +/***/ }), + +/***/ "../node_modules/bpmn-js/lib/features/align-elements/AlignElementsMenuProvider.js": +/*!****************************************************************************************!*\ + !*** ../node_modules/bpmn-js/lib/features/align-elements/AlignElementsMenuProvider.js ***! + \****************************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ AlignElementsMenuProvider) +/* harmony export */ }); +/* harmony import */ var _AlignElementsIcons__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./AlignElementsIcons */ "../node_modules/bpmn-js/lib/features/align-elements/AlignElementsIcons.js"); +/* harmony import */ var min_dash__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! min-dash */ "../node_modules/min-dash/dist/index.esm.js"); + + + + +/** + * @typedef {import('diagram-js/lib/features/align-elements/AlignElements').default} AlignElements + * @typedef {import('diagram-js/lib/features/popup-menu/PopupMenu').default} PopupMenu + * @typedef {import('diagram-js/lib/features/rules/Rules').default} Rules + * @typedef {import('diagram-js/lib/i18n/translate/translate').default} Translate + * + * @typedef {import('diagram-js/lib/features/popup-menu/PopupMenu').PopupMenuEntries} PopupMenuEntries + * @typedef {import('diagram-js/lib/features/popup-menu/PopupMenuProvider').default} PopupMenuProvider + * @typedef {import('diagram-js/lib/features/popup-menu/PopupMenu').PopupMenuTarget} PopupMenuTarget + */ - /** - * Removes all existing 'camunda:FailedJobRetryTimeCycle' from the business object - * - * @param {ModdleElement} bo - * - * @return {Array} a list of 'camunda:FailedJobRetryTimeCycle' - */ - function removeFailedJobRetryTimeCycle(bo, element) { - var retryTimeCycles = extensionElementsHelper.getExtensionElements(bo, 'camunda:FailedJobRetryTimeCycle'); - return map(retryTimeCycles, function(cycle) { - return extensionElementsHelper.removeEntry(bo, element, cycle); - }); - } +var ALIGNMENT_OPTIONS = [ + 'left', + 'center', + 'right', + 'top', + 'middle', + 'bottom' +]; + +/** + * A provider for the `Align elements` popup menu. + * + * @implements {PopupMenuProvider} + * + * @param {PopupMenu} popupMenu + * @param {AlignElements} alignElements + * @param {Translate} translate + * @param {Rules} rules + */ +function AlignElementsMenuProvider(popupMenu, alignElements, translate, rules) { - module.exports.removeFailedJobRetryTimeCycle = removeFailedJobRetryTimeCycle; - },{"./ExtensionElementsHelper":28,"lodash/map":631}],24:[function(require,module,exports){ - 'use strict'; + this._alignElements = alignElements; + this._translate = translate; + this._popupMenu = popupMenu; + this._rules = rules; - var collectionAdd = require('diagram-js/lib/util/Collections').add, - getBusinessObject = require('bpmn-js/lib/util/ModelUtil').getBusinessObject; + popupMenu.registerProvider('align-elements', this); +} - var CategoryHelper = {}; +AlignElementsMenuProvider.$inject = [ + 'popupMenu', + 'alignElements', + 'translate', + 'rules' +]; - module.exports = CategoryHelper; +/** + * @param {PopupMenuTarget} target + * + * @return {PopupMenuEntries} + */ +AlignElementsMenuProvider.prototype.getPopupMenuEntries = function(target) { + var entries = {}; - /** - * Creates a new bpmn:CategoryValue inside a new bpmn:Category - * - * @param {ModdleElement} definitions - * @param {BpmnFactory} bpmnFactory - * - * @return {ModdleElement} categoryValue. - */ - CategoryHelper.createCategoryValue = function(definitions, bpmnFactory) { - var categoryValue = bpmnFactory.create('bpmn:CategoryValue'), - category = bpmnFactory.create('bpmn:Category', { - categoryValue: [ categoryValue ] - }); + if (this._isAllowed(target)) { + (0,min_dash__WEBPACK_IMPORTED_MODULE_0__.assign)(entries, this._getEntries(target)); + } - // add to correct place - collectionAdd(definitions.get('rootElements'), category); - getBusinessObject(category).$parent = definitions; - getBusinessObject(categoryValue).$parent = category; + return entries; +}; - return categoryValue; +AlignElementsMenuProvider.prototype._isAllowed = function(target) { + return this._rules.allowed('elements.align', { elements: target }); +}; - }; - },{"bpmn-js/lib/util/ModelUtil":240,"diagram-js/lib/util/Collections":418}],25:[function(require,module,exports){ - 'use strict'; +/** + * @param {PopupMenuTarget} target + * + * @return {PopupMenuEntries} + */ +AlignElementsMenuProvider.prototype._getEntries = function(target) { + var alignElements = this._alignElements, + translate = this._translate, + popupMenu = this._popupMenu; - var CmdHelper = {}; - module.exports = CmdHelper; + var entries = {}; - CmdHelper.updateProperties = function(element, properties) { - return { - cmd: 'element.updateProperties', - context: { element: element, properties: properties } - }; - }; + (0,min_dash__WEBPACK_IMPORTED_MODULE_0__.forEach)(ALIGNMENT_OPTIONS, function(alignment) { + entries[ 'align-elements-' + alignment ] = { + group: 'align', + title: translate('Align elements ' + alignment), + className: 'bjs-align-elements-menu-entry', + imageHtml: _AlignElementsIcons__WEBPACK_IMPORTED_MODULE_1__["default"][ alignment ], + action: function() { + alignElements.trigger(target, alignment); + popupMenu.close(); + } + }; + }); - CmdHelper.updateBusinessObject = function(element, businessObject, newProperties) { - return { - cmd: 'properties-panel.update-businessobject', - context: { - element: element, - businessObject: businessObject, - properties: newProperties - } - }; - }; + return entries; +}; - CmdHelper.addElementsTolist = function(element, businessObject, listPropertyName, objectsToAdd) { - return { - cmd: 'properties-panel.update-businessobject-list', - context: { - element: element, - currentObject: businessObject, - propertyName: listPropertyName, - objectsToAdd: objectsToAdd - } - }; - }; - CmdHelper.removeElementsFromList = function(element, businessObject, listPropertyName, referencePropertyName, objectsToRemove) { +/***/ }), - return { - cmd: 'properties-panel.update-businessobject-list', - context: { - element: element, - currentObject: businessObject, - propertyName: listPropertyName, - referencePropertyName: referencePropertyName, - objectsToRemove: objectsToRemove - } - }; - }; +/***/ "../node_modules/bpmn-js/lib/features/align-elements/BpmnAlignElements.js": +/*!********************************************************************************!*\ + !*** ../node_modules/bpmn-js/lib/features/align-elements/BpmnAlignElements.js ***! + \********************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ BpmnAlignElements) +/* harmony export */ }); +/* harmony import */ var inherits_browser__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! inherits-browser */ "../node_modules/inherits-browser/dist/index.es.js"); +/* harmony import */ var diagram_js_lib_features_rules_RuleProvider__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! diagram-js/lib/features/rules/RuleProvider */ "../node_modules/diagram-js/lib/features/rules/RuleProvider.js"); +/* harmony import */ var diagram_js_lib_util_Elements__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! diagram-js/lib/util/Elements */ "../node_modules/diagram-js/lib/util/Elements.js"); +/* harmony import */ var min_dash__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! min-dash */ "../node_modules/min-dash/dist/index.esm.js"); - CmdHelper.addAndRemoveElementsFromList = function(element, businessObject, listPropertyName, referencePropertyName, objectsToAdd, objectsToRemove) { - return { - cmd: 'properties-panel.update-businessobject-list', - context: { - element: element, - currentObject: businessObject, - propertyName: listPropertyName, - referencePropertyName: referencePropertyName, - objectsToAdd: objectsToAdd, - objectsToRemove: objectsToRemove - } - }; - }; - CmdHelper.setList = function(element, businessObject, listPropertyName, updatedObjectList) { - return { - cmd: 'properties-panel.update-businessobject-list', - context: { - element: element, - currentObject: businessObject, - propertyName: listPropertyName, - updatedObjectList: updatedObjectList - } - }; - }; - },{}],26:[function(require,module,exports){ - 'use strict'; - var ElementHelper = {}; - module.exports = ElementHelper; - /** - * Creates a new element and set the parent to it - * - * @method ElementHelper#createElement - * - * @param {String} elementType of the new element - * @param {Object} properties of the new element in key-value pairs - * @param {moddle.object} parent of the new element - * @param {BpmnFactory} factory which creates the new element - * - * @returns {djs.model.Base} element which is created - */ - ElementHelper.createElement = function(elementType, properties, parent, factory) { - var element = factory.create(elementType, properties); - element.$parent = parent; +/** + * @typedef {import('diagram-js/lib/core/EventBus').default} EventBus + */ - return element; - }; +/** + * Rule provider for aligning BPMN elements. + * + * @param {EventBus} eventBus + */ +function BpmnAlignElements(eventBus) { + diagram_js_lib_features_rules_RuleProvider__WEBPACK_IMPORTED_MODULE_0__["default"].call(this, eventBus); +} - },{}],27:[function(require,module,exports){ - 'use strict'; +BpmnAlignElements.$inject = [ 'eventBus' ]; - var getBusinessObject = require('bpmn-js/lib/util/ModelUtil').getBusinessObject, - is = require('bpmn-js/lib/util/ModelUtil').is, - forEach = require('lodash/forEach'); +(0,inherits_browser__WEBPACK_IMPORTED_MODULE_1__["default"])(BpmnAlignElements, diagram_js_lib_features_rules_RuleProvider__WEBPACK_IMPORTED_MODULE_0__["default"]); - var EventDefinitionHelper = {}; +BpmnAlignElements.prototype.init = function() { + this.addRule('elements.align', function(context) { + var elements = context.elements; - module.exports = EventDefinitionHelper; + // filter out elements which cannot be aligned + var filteredElements = (0,min_dash__WEBPACK_IMPORTED_MODULE_2__.filter)(elements, function(element) { + return !(element.waypoints || element.host || element.labelTarget); + }); - EventDefinitionHelper.getEventDefinition = function(element, eventType) { + // filter out elements which are children of any of the selected elements + filteredElements = (0,diagram_js_lib_util_Elements__WEBPACK_IMPORTED_MODULE_3__.getParents)(filteredElements); - var bo = getBusinessObject(element), - eventDefinition = null; + if (filteredElements.length < 2) { + return false; + } - if (bo.eventDefinitions) { - forEach(bo.eventDefinitions, function(event) { - if (is(event, eventType)) { - eventDefinition = event; - } - }); - } + return filteredElements; + }); +}; - return eventDefinition; - }; - EventDefinitionHelper.getTimerEventDefinition = function(element) { - return this.getEventDefinition(element, 'bpmn:TimerEventDefinition'); - }; +/***/ }), - EventDefinitionHelper.getMessageEventDefinition = function(element) { - return this.getEventDefinition(element, 'bpmn:MessageEventDefinition'); - }; +/***/ "../node_modules/bpmn-js/lib/features/align-elements/index.js": +/*!********************************************************************!*\ + !*** ../node_modules/bpmn-js/lib/features/align-elements/index.js ***! + \********************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - EventDefinitionHelper.getSignalEventDefinition = function(element) { - return this.getEventDefinition(element, 'bpmn:SignalEventDefinition'); - }; +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var diagram_js_lib_features_align_elements__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! diagram-js/lib/features/align-elements */ "../node_modules/diagram-js/lib/features/align-elements/index.js"); +/* harmony import */ var diagram_js_lib_features_context_pad__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! diagram-js/lib/features/context-pad */ "../node_modules/diagram-js/lib/features/context-pad/index.js"); +/* harmony import */ var diagram_js_lib_features_popup_menu__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! diagram-js/lib/features/popup-menu */ "../node_modules/diagram-js/lib/features/popup-menu/index.js"); +/* harmony import */ var _AlignElementsContextPadProvider__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./AlignElementsContextPadProvider */ "../node_modules/bpmn-js/lib/features/align-elements/AlignElementsContextPadProvider.js"); +/* harmony import */ var _AlignElementsMenuProvider__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./AlignElementsMenuProvider */ "../node_modules/bpmn-js/lib/features/align-elements/AlignElementsMenuProvider.js"); +/* harmony import */ var _BpmnAlignElements__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./BpmnAlignElements */ "../node_modules/bpmn-js/lib/features/align-elements/BpmnAlignElements.js"); - EventDefinitionHelper.getErrorEventDefinition = function(element) { - return this.getEventDefinition(element, 'bpmn:ErrorEventDefinition'); - }; - EventDefinitionHelper.getEscalationEventDefinition = function(element) { - return this.getEventDefinition(element, 'bpmn:EscalationEventDefinition'); - }; - EventDefinitionHelper.getCompensateEventDefinition = function(element) { - return this.getEventDefinition(element, 'bpmn:CompensateEventDefinition'); - }; - EventDefinitionHelper.getLinkEventDefinition = function(element) { - return this.getEventDefinition(element, 'bpmn:LinkEventDefinition'); - }; - EventDefinitionHelper.getConditionalEventDefinition = function(element) { - return this.getEventDefinition(element, 'bpmn:ConditionalEventDefinition'); - }; - },{"bpmn-js/lib/util/ModelUtil":240,"lodash/forEach":613}],28:[function(require,module,exports){ - 'use strict'; - var cmdHelper = require('./CmdHelper'), - elementHelper = require('./ElementHelper'); - var is = require('bpmn-js/lib/util/ModelUtil').is; +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ + __depends__: [ + diagram_js_lib_features_align_elements__WEBPACK_IMPORTED_MODULE_0__["default"], + diagram_js_lib_features_context_pad__WEBPACK_IMPORTED_MODULE_1__["default"], + diagram_js_lib_features_popup_menu__WEBPACK_IMPORTED_MODULE_2__["default"] + ], + __init__: [ + 'alignElementsContextPadProvider', + 'alignElementsMenuProvider', + 'bpmnAlignElements' + ], + alignElementsContextPadProvider: [ 'type', _AlignElementsContextPadProvider__WEBPACK_IMPORTED_MODULE_3__["default"] ], + alignElementsMenuProvider: [ 'type', _AlignElementsMenuProvider__WEBPACK_IMPORTED_MODULE_4__["default"] ], + bpmnAlignElements: [ 'type', _BpmnAlignElements__WEBPACK_IMPORTED_MODULE_5__["default"] ] +}); - var ExtensionElementsHelper = {}; - var getExtensionElements = function(bo) { - return bo.get('extensionElements'); - }; +/***/ }), - ExtensionElementsHelper.getExtensionElements = function(bo, type) { - var extensionElements = getExtensionElements(bo); - if (typeof extensionElements !== 'undefined') { - var extensionValues = extensionElements.get('values'); - if (typeof extensionValues !== 'undefined') { - var elements = extensionValues.filter(function(value) { - return is(value, type); - }); - if (elements.length) { - return elements; - } - } - } - }; +/***/ "../node_modules/bpmn-js/lib/features/append-preview/AppendPreview.js": +/*!****************************************************************************!*\ + !*** ../node_modules/bpmn-js/lib/features/append-preview/AppendPreview.js ***! + \****************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - ExtensionElementsHelper.addEntry = function(bo, element, entry, bpmnFactory) { - var extensionElements = bo.get('extensionElements'); +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ AppendPreview) +/* harmony export */ }); +/* harmony import */ var min_dash__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! min-dash */ "../node_modules/min-dash/dist/index.esm.js"); - // if there is no extensionElements list, create one - if (!extensionElements) { - // TODO: Ask Daniel which operation costs more - extensionElements = elementHelper.createElement('bpmn:ExtensionElements', { values: [entry] }, bo, bpmnFactory); - return { extensionElements : extensionElements }; - } else { - // add new failedJobRetryExtensionElement to existing extensionElements list - return cmdHelper.addElementsTolist(element, extensionElements, 'values', [entry]); - } - }; - ExtensionElementsHelper.removeEntry = function(bo, element, entry) { - var extensionElements = bo.get('extensionElements'); +const round = Math.round; - if (!extensionElements) { +/** + * @typedef {import('diagram-js/lib/features/complex-preview/ComplexPreview').default} ComplexPreview + * @typedef {import('diagram-js/lib/layout/ConnectionDocking').default} ConnectionDocking + * @typedef {import('../modeling/ElementFactory').default} ElementFactory + * @typedef {import('diagram-js/lib/core/EventBus').default} EventBus + * @typedef {import('diagram-js/lib/layout/ManhattanLayout').default} ManhattanLayout + * @typedef {import('diagram-js/lib/features/rules/Rules').default} Rules + * + * @typedef {import('../../model/Types').Shape} Shape + */ - // return an empty command when there is no extensionElements list - return {}; - } +/** + * A preview for appending. + * + * @param {ComplexPreview} complexPreview + * @param {ConnectionDocking} connectionDocking + * @param {ElementFactory} elementFactory + * @param {EventBus} eventBus + * @param {ManhattanLayout} layouter + * @param {Rules} rules + */ +function AppendPreview(complexPreview, connectionDocking, elementFactory, eventBus, layouter, rules) { + this._complexPreview = complexPreview; + this._connectionDocking = connectionDocking; + this._elementFactory = elementFactory; + this._eventBus = eventBus; + this._layouter = layouter; + this._rules = rules; +} + +/** + * Create a preview of appending a shape of the given type to the given source. + * + * @param {Shape} source + * @param {string} type + * @param {Partial} options + */ +AppendPreview.prototype.create = function(source, type, options) { + const complexPreview = this._complexPreview, + connectionDocking = this._connectionDocking, + elementFactory = this._elementFactory, + eventBus = this._eventBus, + layouter = this._layouter, + rules = this._rules; + + const shape = elementFactory.createShape((0,min_dash__WEBPACK_IMPORTED_MODULE_0__.assign)({ type }, options)); + + const position = eventBus.fire('autoPlace', { + source, + shape + }); + + if (!position) { + return; + } + + (0,min_dash__WEBPACK_IMPORTED_MODULE_0__.assign)(shape, { + x: position.x - round(shape.width / 2), + y: position.y - round(shape.height / 2) + }); + + const connectionCreateAllowed = rules.allowed('connection.create', { + source, + target: shape, + hints: { + targetParent: source.parent + } + }); + + let connection = null; + + if (connectionCreateAllowed) { + connection = elementFactory.createConnection(connectionCreateAllowed); + + connection.waypoints = layouter.layoutConnection(connection, { + source, + target: shape + }); + + connection.waypoints = connectionDocking.getCroppedWaypoints(connection, source, shape); + } + + complexPreview.create({ + created: [ + shape, + connection + ].filter((element) => !(0,min_dash__WEBPACK_IMPORTED_MODULE_0__.isNil)(element)) + }); +}; + +AppendPreview.prototype.cleanUp = function() { + this._complexPreview.cleanUp(); +}; + +AppendPreview.$inject = [ + 'complexPreview', + 'connectionDocking', + 'elementFactory', + 'eventBus', + 'layouter', + 'rules' +]; + +/***/ }), + +/***/ "../node_modules/bpmn-js/lib/features/append-preview/index.js": +/*!********************************************************************!*\ + !*** ../node_modules/bpmn-js/lib/features/append-preview/index.js ***! + \********************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _auto_place__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../auto-place */ "../node_modules/bpmn-js/lib/features/auto-place/index.js"); +/* harmony import */ var diagram_js_lib_features_complex_preview__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! diagram-js/lib/features/complex-preview */ "../node_modules/diagram-js/lib/features/complex-preview/index.js"); +/* harmony import */ var _modeling__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../modeling */ "../node_modules/bpmn-js/lib/features/modeling/index.js"); +/* harmony import */ var _AppendPreview__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./AppendPreview */ "../node_modules/bpmn-js/lib/features/append-preview/AppendPreview.js"); + + + + + + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ + __depends__: [ + _auto_place__WEBPACK_IMPORTED_MODULE_0__["default"], + diagram_js_lib_features_complex_preview__WEBPACK_IMPORTED_MODULE_1__["default"], + _modeling__WEBPACK_IMPORTED_MODULE_2__["default"] + ], + __init__: [ 'appendPreview' ], + appendPreview: [ 'type', _AppendPreview__WEBPACK_IMPORTED_MODULE_3__["default"] ] +}); + + +/***/ }), + +/***/ "../node_modules/bpmn-js/lib/features/auto-place/BpmnAutoPlace.js": +/*!************************************************************************!*\ + !*** ../node_modules/bpmn-js/lib/features/auto-place/BpmnAutoPlace.js ***! + \************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - return cmdHelper.removeElementsFromList(element, extensionElements, 'values', 'extensionElements', [entry]); - }; +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ AutoPlace) +/* harmony export */ }); +/* harmony import */ var _BpmnAutoPlaceUtil__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./BpmnAutoPlaceUtil */ "../node_modules/bpmn-js/lib/features/auto-place/BpmnAutoPlaceUtil.js"); + + +/** + * @typedef {import('diagram-js/lib/core/EventBus').default} EventBus + */ - module.exports = ExtensionElementsHelper; +/** + * BPMN auto-place behavior. + * + * @param {EventBus} eventBus + */ +function AutoPlace(eventBus) { + eventBus.on('autoPlace', function(context) { + var shape = context.shape, + source = context.source; - },{"./CmdHelper":25,"./ElementHelper":26,"bpmn-js/lib/util/ModelUtil":240}],29:[function(require,module,exports){ - 'use strict'; + return (0,_BpmnAutoPlaceUtil__WEBPACK_IMPORTED_MODULE_0__.getNewShapePosition)(source, shape); + }); +} - var getBusinessObject = require('bpmn-js/lib/util/ModelUtil').getBusinessObject, - getExtensionElements = require('./ExtensionElementsHelper').getExtensionElements; +AutoPlace.$inject = [ 'eventBus' ]; - var FormHelper = {}; +/***/ }), - module.exports = FormHelper; +/***/ "../node_modules/bpmn-js/lib/features/auto-place/BpmnAutoPlaceUtil.js": +/*!****************************************************************************!*\ + !*** ../node_modules/bpmn-js/lib/features/auto-place/BpmnAutoPlaceUtil.js ***! + \****************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - /** - * Return form data from business object or undefined if none exist - * - * @param {djs.model.Base} element - * - * @return {ModdleElement|undefined} formData - */ - FormHelper.getFormData = function(element) { - var bo = getBusinessObject(element); +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ getDataElementPosition: () => (/* binding */ getDataElementPosition), +/* harmony export */ getFlowNodePosition: () => (/* binding */ getFlowNodePosition), +/* harmony export */ getNewShapePosition: () => (/* binding */ getNewShapePosition), +/* harmony export */ getTextAnnotationPosition: () => (/* binding */ getTextAnnotationPosition) +/* harmony export */ }); +/* harmony import */ var _util_ModelUtil__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../modeling/util/ModelingUtil */ "../node_modules/bpmn-js/lib/util/ModelUtil.js"); +/* harmony import */ var diagram_js_lib_layout_LayoutUtil__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! diagram-js/lib/layout/LayoutUtil */ "../node_modules/diagram-js/lib/layout/LayoutUtil.js"); +/* harmony import */ var diagram_js_lib_features_auto_place_AutoPlaceUtil__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! diagram-js/lib/features/auto-place/AutoPlaceUtil */ "../node_modules/diagram-js/lib/features/auto-place/AutoPlaceUtil.js"); +/* harmony import */ var diagram_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! diagram-js/lib/util/ModelUtil */ "../node_modules/diagram-js/lib/util/ModelUtil.js"); - var formData = getExtensionElements(bo, 'camunda:FormData'); - if (typeof formData !== 'undefined') { - return formData[0]; - } - }; - /** - * Return all form fields existing in the business object, and - * an empty array if none exist. - * - * @param {djs.model.Base} element - * - * @return {Array} a list of form field objects - */ - FormHelper.getFormFields = function(element) { - var formData = this.getFormData(element); - if (typeof formData === 'undefined') { - return []; - } - return formData.fields || []; - }; - /** - * Get a form field from the business object at given index - * - * @param {djs.model.Base} element - * @param {number} idx - * - * @return {ModdleElement} the form field - */ - FormHelper.getFormField = function(element, idx) { - var formFields = this.getFormFields(element); +/** + * @typedef {import('../../model/Types').Shape} Shape + * + * @typedef {import('diagram-js/lib/util/Types').Point} Point + * @typedef {import('diagram-js/lib/util/Types').DirectionTRBL} DirectionTRBL + */ - return formFields[idx]; - }; +/** + * Get the position for given new target relative to the source it will be + * connected to. + * + * @param {Shape} source + * @param {Shape} element + * + * @return {Point} + */ +function getNewShapePosition(source, element) { + if ((0,_util_ModelUtil__WEBPACK_IMPORTED_MODULE_0__.is)(element, 'bpmn:TextAnnotation')) { + return getTextAnnotationPosition(source, element); + } - /** - * Get all constraints for a specific form field from the business object - * - * @param {ModdleElement} formField - * - * @return {Array} a list of constraint objects - */ - FormHelper.getConstraints = function(formField) { - if (formField && formField.validation && formField.validation.constraints) { - return formField.validation.constraints; - } - return []; - }; + if ((0,_util_ModelUtil__WEBPACK_IMPORTED_MODULE_0__.isAny)(element, [ 'bpmn:DataObjectReference', 'bpmn:DataStoreReference' ])) { + return getDataElementPosition(source, element); + } + if ((0,_util_ModelUtil__WEBPACK_IMPORTED_MODULE_0__.is)(element, 'bpmn:FlowNode')) { + return getFlowNodePosition(source, element); + } +} - /** - * Get all camunda:value objects for a specific form field from the business object - * - * @param {ModdleElement} formField - * - * @return {Array} a list of camunda:value objects - */ - FormHelper.getEnumValues = function(formField) { - if (formField && formField.values) { - return formField.values; - } - return []; - }; +/** + * Get the position for given new flow node. Try placing the flow node right of + * the source. + * + * @param {Shape} source + * @param {Shape} element + * + * @return {Point} + */ +function getFlowNodePosition(source, element) { + + var sourceTrbl = (0,diagram_js_lib_layout_LayoutUtil__WEBPACK_IMPORTED_MODULE_1__.asTRBL)(source); + var sourceMid = (0,diagram_js_lib_layout_LayoutUtil__WEBPACK_IMPORTED_MODULE_1__.getMid)(source); + + var horizontalDistance = (0,diagram_js_lib_features_auto_place_AutoPlaceUtil__WEBPACK_IMPORTED_MODULE_2__.getConnectedDistance)(source, { + filter: function(connection) { + return (0,_util_ModelUtil__WEBPACK_IMPORTED_MODULE_0__.is)(connection, 'bpmn:SequenceFlow'); + } + }); + + var margin = 30, + minDistance = 80, + orientation = 'left'; + + if ((0,_util_ModelUtil__WEBPACK_IMPORTED_MODULE_0__.is)(source, 'bpmn:BoundaryEvent')) { + orientation = (0,diagram_js_lib_layout_LayoutUtil__WEBPACK_IMPORTED_MODULE_1__.getOrientation)(source, source.host, -25); + + if (orientation.indexOf('top') !== -1) { + margin *= -1; + } + } + + var position = { + x: sourceTrbl.right + horizontalDistance + element.width / 2, + y: sourceMid.y + getVerticalDistance(orientation, minDistance) + }; + + var nextPositionDirection = { + y: { + margin: margin, + minDistance: minDistance + } + }; + + return (0,diagram_js_lib_features_auto_place_AutoPlaceUtil__WEBPACK_IMPORTED_MODULE_2__.findFreePosition)(source, element, position, (0,diagram_js_lib_features_auto_place_AutoPlaceUtil__WEBPACK_IMPORTED_MODULE_2__.generateGetNextPosition)(nextPositionDirection)); +} + +/** + * @param {DirectionTRBL} orientation + * @param {number} minDistance + * + * @return {number} + */ +function getVerticalDistance(orientation, minDistance) { + if (orientation.includes('top')) { + return -1 * minDistance; + } else if (orientation.includes('bottom')) { + return minDistance; + } else { + return 0; + } +} + + +/** + * Get the position for given text annotation. Try placing the text annotation + * top-right of the source. + * + * @param {Shape} source + * @param {Shape} element + * + * @return {Point} + */ +function getTextAnnotationPosition(source, element) { + var sourceTrbl = (0,diagram_js_lib_layout_LayoutUtil__WEBPACK_IMPORTED_MODULE_1__.asTRBL)(source); - },{"./ExtensionElementsHelper":28,"bpmn-js/lib/util/ModelUtil":240}],30:[function(require,module,exports){ - 'use strict'; + var position = { + x: sourceTrbl.right + element.width / 2, + y: sourceTrbl.top - 50 - element.height / 2 + }; - var ModelUtil = require('bpmn-js/lib/util/ModelUtil'), - is = ModelUtil.is, - getBusinessObject = ModelUtil.getBusinessObject; + if ((0,diagram_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_3__.isConnection)(source)) { + position = (0,diagram_js_lib_layout_LayoutUtil__WEBPACK_IMPORTED_MODULE_1__.getMid)(source); + position.x += 100; + position.y -= 50; + } - var eventDefinitionHelper = require('./EventDefinitionHelper'); - var extensionsElementHelper = require('./ExtensionElementsHelper'); + var nextPositionDirection = { + y: { + margin: -30, + minDistance: 20 + } + }; - var ImplementationTypeHelper = {}; + return (0,diagram_js_lib_features_auto_place_AutoPlaceUtil__WEBPACK_IMPORTED_MODULE_2__.findFreePosition)(source, element, position, (0,diagram_js_lib_features_auto_place_AutoPlaceUtil__WEBPACK_IMPORTED_MODULE_2__.generateGetNextPosition)(nextPositionDirection)); +} - module.exports = ImplementationTypeHelper; - /** - * Returns 'true' if the given element is 'camunda:ServiceTaskLike' - * - * @param {djs.model.Base} element - * - * @return {boolean} a boolean value - */ - ImplementationTypeHelper.isServiceTaskLike = function(element) { - return is(element, 'camunda:ServiceTaskLike'); - }; +/** + * Get the position for given new data element. Try placing the data element + * bottom-right of the source. + * + * @param {Shape} source + * @param {Shape} element + * + * @return {Point} + */ +function getDataElementPosition(source, element) { - /** - * Returns 'true' if the given element is 'camunda:DmnCapable' - * - * @param {djs.model.Base} element - * - * @return {boolean} a boolean value - */ - ImplementationTypeHelper.isDmnCapable = function(element) { - return is(element, 'camunda:DmnCapable'); - }; + var sourceTrbl = (0,diagram_js_lib_layout_LayoutUtil__WEBPACK_IMPORTED_MODULE_1__.asTRBL)(source); - /** - * Returns 'true' if the given element is 'camunda:ExternalCapable' - * - * @param {djs.model.Base} element - * - * @return {boolean} a boolean value - */ - ImplementationTypeHelper.isExternalCapable = function(element) { - return is(element, 'camunda:ExternalCapable'); - }; + var position = { + x: sourceTrbl.right - 10 + element.width / 2, + y: sourceTrbl.bottom + 40 + element.width / 2 + }; - /** - * Returns 'true' if the given element is 'camunda:TaskListener' - * - * @param {djs.model.Base} element - * - * @return {boolean} a boolean value - */ - ImplementationTypeHelper.isTaskListener = function(element) { - return is(element, 'camunda:TaskListener'); - }; + var nextPositionDirection = { + x: { + margin: 30, + minDistance: 30 + } + }; - /** - * Returns 'true' if the given element is 'camunda:ExecutionListener' - * - * @param {djs.model.Base} element - * - * @return {boolean} a boolean value - */ - ImplementationTypeHelper.isExecutionListener = function(element) { - return is(element, 'camunda:ExecutionListener'); - }; + return (0,diagram_js_lib_features_auto_place_AutoPlaceUtil__WEBPACK_IMPORTED_MODULE_2__.findFreePosition)(source, element, position, (0,diagram_js_lib_features_auto_place_AutoPlaceUtil__WEBPACK_IMPORTED_MODULE_2__.generateGetNextPosition)(nextPositionDirection)); +} - /** - * Returns 'true' if the given element is 'camunda:ExecutionListener' or - * 'camunda:TaskListener' - * - * @param {djs.model.Base} element - * - * @return {boolean} a boolean value - */ - ImplementationTypeHelper.isListener = function(element) { - return this.isTaskListener(element) || this.isExecutionListener(element); - }; +/***/ }), - /** - * Returns 'true' if the given element is 'bpmn:SequenceFlow' - * - * @param {djs.model.Base} element - * - * @return {boolean} a boolean value - */ - ImplementationTypeHelper.isSequenceFlow = function(element) { - return is(element, 'bpmn:SequenceFlow'); - }; +/***/ "../node_modules/bpmn-js/lib/features/auto-place/index.js": +/*!****************************************************************!*\ + !*** ../node_modules/bpmn-js/lib/features/auto-place/index.js ***! + \****************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - /** - * Get a 'camunda:ServiceTaskLike' business object. - * - * If the given element is not a 'camunda:ServiceTaskLike', then 'false' - * is returned. - * - * @param {djs.model.Base} element - * - * @return {ModdleElement} the 'camunda:ServiceTaskLike' business object - */ - ImplementationTypeHelper.getServiceTaskLikeBusinessObject = function(element) { +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var diagram_js_lib_features_auto_place__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! diagram-js/lib/features/auto-place */ "../node_modules/diagram-js/lib/features/auto-place/index.js"); +/* harmony import */ var _BpmnAutoPlace__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./BpmnAutoPlace */ "../node_modules/bpmn-js/lib/features/auto-place/BpmnAutoPlace.js"); - if (is(element, 'bpmn:IntermediateThrowEvent') || is(element, 'bpmn:EndEvent')) { - // change business object to 'messageEventDefinition' when - // the element is a message intermediate throw event or message end event - // because the camunda extensions (e.g. camunda:class) are in the message - // event definition tag and not in the intermediate throw event or end event tag - var messageEventDefinition = eventDefinitionHelper.getMessageEventDefinition(element); - if (messageEventDefinition) { - element = messageEventDefinition; - } - } - return this.isServiceTaskLike(element) && getBusinessObject(element); - }; +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ + __depends__: [ diagram_js_lib_features_auto_place__WEBPACK_IMPORTED_MODULE_0__["default"] ], + __init__: [ 'bpmnAutoPlace' ], + bpmnAutoPlace: [ 'type', _BpmnAutoPlace__WEBPACK_IMPORTED_MODULE_1__["default"] ] +}); - /** - * Returns the implementation type of the given element. - * - * Possible implementation types are: - * - dmn - * - connector - * - external - * - class - * - expression - * - delegateExpression - * - script - * - or undefined, when no matching implementation type is found - * - * @param {djs.model.Base} element - * - * @return {String} the implementation type - */ - ImplementationTypeHelper.getImplementationType = function(element) { +/***/ }), - var bo = this.getServiceTaskLikeBusinessObject(element); +/***/ "../node_modules/bpmn-js/lib/features/auto-resize/BpmnAutoResize.js": +/*!**************************************************************************!*\ + !*** ../node_modules/bpmn-js/lib/features/auto-resize/BpmnAutoResize.js ***! + \**************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - if (!bo) { - if (this.isListener(element)) { - bo = element; - } else { - return; - } - } +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ BpmnAutoResize) +/* harmony export */ }); +/* harmony import */ var diagram_js_lib_features_auto_resize_AutoResize__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! diagram-js/lib/features/auto-resize/AutoResize */ "../node_modules/diagram-js/lib/features/auto-resize/AutoResize.js"); +/* harmony import */ var inherits_browser__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! inherits-browser */ "../node_modules/inherits-browser/dist/index.es.js"); +/* harmony import */ var _util_ModelUtil__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../util/ModelUtil */ "../node_modules/bpmn-js/lib/util/ModelUtil.js"); - if (this.isDmnCapable(bo)) { - var decisionRef = bo.get('camunda:decisionRef'); - if (typeof decisionRef !== 'undefined') { - return 'dmn'; - } - } - if (this.isServiceTaskLike(bo)) { - var connectors = extensionsElementHelper.getExtensionElements(bo, 'camunda:Connector'); - if (typeof connectors !== 'undefined') { - return 'connector'; - } - } - if (this.isExternalCapable(bo)) { - var type = bo.get('camunda:type'); - if (type === 'external') { - return 'external'; - } - } - var cls = bo.get('camunda:class'); - if (typeof cls !== 'undefined') { - return 'class'; - } - var expression = bo.get('camunda:expression'); - if (typeof expression !== 'undefined') { - return 'expression'; - } - var delegateExpression = bo.get('camunda:delegateExpression'); - if (typeof delegateExpression !== 'undefined') { - return 'delegateExpression'; - } +/** + * @typedef {import('didi').Injector} Injector + * + * @typedef {import('../../model/Types').Shape} Shape + * + * @typedef {import('diagram-js/lib/util/Types').Rect} Rect + */ - if (this.isListener(bo)) { - var script = bo.get('script'); - if (typeof script !== 'undefined') { - return 'script'; - } - } +/** + * BPMN-specific resize behavior. + * + * @param {Injector} injector + */ +function BpmnAutoResize(injector) { - }; + injector.invoke(diagram_js_lib_features_auto_resize_AutoResize__WEBPACK_IMPORTED_MODULE_0__["default"], this); +} - },{"./EventDefinitionHelper":27,"./ExtensionElementsHelper":28,"bpmn-js/lib/util/ModelUtil":240}],31:[function(require,module,exports){ - 'use strict'; +BpmnAutoResize.$inject = [ + 'injector' +]; - var ModelUtil = require('bpmn-js/lib/util/ModelUtil'), - is = ModelUtil.is, - getBusinessObject = ModelUtil.getBusinessObject; +(0,inherits_browser__WEBPACK_IMPORTED_MODULE_1__["default"])(BpmnAutoResize, diagram_js_lib_features_auto_resize_AutoResize__WEBPACK_IMPORTED_MODULE_0__["default"]); - var extensionElementsHelper = require('./ExtensionElementsHelper'), - implementationTypeHelper = require('./ImplementationTypeHelper'); +/** + * Perform BPMN-specific resizing of participants. + * + * @param {Shape} target + * @param {Rect} newBounds + * @param {Object} [hints] + * @param {string} [hints.autoResize] + */ +BpmnAutoResize.prototype.resize = function(target, newBounds, hints) { - var InputOutputHelper = {}; + if ((0,_util_ModelUtil__WEBPACK_IMPORTED_MODULE_2__.is)(target, 'bpmn:Participant')) { + this._modeling.resizeLane(target, newBounds, null, hints); + } else { + this._modeling.resizeShape(target, newBounds, null, hints); + } +}; - module.exports = InputOutputHelper; +/***/ }), - function getElements(bo, type, prop) { - var elems = extensionElementsHelper.getExtensionElements(bo, type) || []; - return !prop ? elems : (elems[0] || {})[prop] || []; - } +/***/ "../node_modules/bpmn-js/lib/features/auto-resize/BpmnAutoResizeProvider.js": +/*!**********************************************************************************!*\ + !*** ../node_modules/bpmn-js/lib/features/auto-resize/BpmnAutoResizeProvider.js ***! + \**********************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - function getParameters(element, prop, insideConnector) { - var inputOutput = InputOutputHelper.getInputOutput(element, insideConnector); - return (inputOutput && inputOutput.get(prop)) || []; - } +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ BpmnAutoResizeProvider) +/* harmony export */ }); +/* harmony import */ var _util_ModelUtil__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../util/ModelUtil */ "../node_modules/bpmn-js/lib/util/ModelUtil.js"); +/* harmony import */ var _util_LabelUtil__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../util/LabelUtil */ "../node_modules/diagram-js/lib/util/ModelUtil.js"); +/* harmony import */ var inherits_browser__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! inherits-browser */ "../node_modules/inherits-browser/dist/index.es.js"); +/* harmony import */ var min_dash__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! min-dash */ "../node_modules/min-dash/dist/index.esm.js"); +/* harmony import */ var diagram_js_lib_features_auto_resize_AutoResizeProvider__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! diagram-js/lib/features/auto-resize/AutoResizeProvider */ "../node_modules/diagram-js/lib/features/auto-resize/AutoResizeProvider.js"); - /** - * Get a inputOutput from the business object - * - * @param {djs.model.Base} element - * @param {boolean} insideConnector - * - * @return {ModdleElement} the inputOutput object - */ - InputOutputHelper.getInputOutput = function(element, insideConnector) { - if (!insideConnector) { - var bo = getBusinessObject(element); - return (getElements(bo, 'camunda:InputOutput') || [])[0]; - } - var connector = this.getConnector(element); - return connector && connector.get('inputOutput'); - }; - /** - * Get a connector from the business object - * - * @param {djs.model.Base} element - * - * @return {ModdleElement} the connector object - */ - InputOutputHelper.getConnector = function(element) { - var bo = implementationTypeHelper.getServiceTaskLikeBusinessObject(element); - return bo && (getElements(bo, 'camunda:Connector') || [])[0]; - }; - /** - * Return all input parameters existing in the business object, and - * an empty array if none exist. - * - * @param {djs.model.Base} element - * @param {boolean} insideConnector - * - * @return {Array} a list of input parameter objects - */ - InputOutputHelper.getInputParameters = function(element, insideConnector) { - return getParameters.apply(this, [ element, 'inputParameters', insideConnector ]); - }; - /** - * Return all output parameters existing in the business object, and - * an empty array if none exist. - * - * @param {djs.model.Base} element - * @param {boolean} insideConnector - * - * @return {Array} a list of output parameter objects - */ - InputOutputHelper.getOutputParameters = function(element, insideConnector) { - return getParameters.apply(this, [ element, 'outputParameters', insideConnector ]); - }; - /** - * Get a input parameter from the business object at given index - * - * @param {djs.model.Base} element - * @param {boolean} insideConnector - * @param {number} idx - * - * @return {ModdleElement} input parameter - */ - InputOutputHelper.getInputParameter = function(element, insideConnector, idx) { - return this.getInputParameters(element, insideConnector)[idx]; - }; - /** - * Get a output parameter from the business object at given index - * - * @param {djs.model.Base} element - * @param {boolean} insideConnector - * @param {number} idx - * - * @return {ModdleElement} output parameter - */ - InputOutputHelper.getOutputParameter = function(element, insideConnector, idx) { - return this.getOutputParameters(element, insideConnector)[idx]; - }; - /** - * Returns 'true' if the given element supports inputOutput - * - * @param {djs.model.Base} element - * @param {boolean} insideConnector - * - * @return {boolean} a boolean value - */ - InputOutputHelper.isInputOutputSupported = function(element, insideConnector) { - if (insideConnector) { - return true; - } - var bo = getBusinessObject(element); - return ( - is(bo, 'bpmn:FlowNode') && !( - is(bo, 'bpmn:StartEvent') || - is(bo, 'bpmn:Gateway') || - is(bo, 'bpmn:BoundaryEvent') || - ( - is(bo, 'bpmn:SubProcess') && bo.get('triggeredByEvent') - ) - ) - ); - }; +/** + * @typedef {import('diagram-js/lib/core/EventBus').default} EventBus + * @typedef {import('../modeling/Modeling').default} Modeling + * + * @typedef {import('../../model/Types').Shape} Shape + */ - /** - * Returns 'true' if the given element supports output parameters - * - * @param {djs.model.Base} element - * @param {boolean} insideConnector - * - * @return {boolean} a boolean value - */ - InputOutputHelper.areOutputParametersSupported = function(element, insideConnector) { - var bo = getBusinessObject(element); - return insideConnector || (!is(bo, 'bpmn:EndEvent') && !bo.loopCharacteristics); - }; +/** + * BPMN-specific provider for automatic resizung. + * + * @param {EventBus} eventBus + * @param {Modeling} modeling + */ +function BpmnAutoResizeProvider(eventBus, modeling) { + diagram_js_lib_features_auto_resize_AutoResizeProvider__WEBPACK_IMPORTED_MODULE_0__["default"].call(this, eventBus); - },{"./ExtensionElementsHelper":28,"./ImplementationTypeHelper":30,"bpmn-js/lib/util/ModelUtil":240}],32:[function(require,module,exports){ - 'use strict'; + this._modeling = modeling; +} - var is = require('bpmn-js/lib/util/ModelUtil').is, - getBusinessObject = require('bpmn-js/lib/util/ModelUtil').getBusinessObject, - cmdHelper = require('./CmdHelper'); +(0,inherits_browser__WEBPACK_IMPORTED_MODULE_1__["default"])(BpmnAutoResizeProvider, diagram_js_lib_features_auto_resize_AutoResizeProvider__WEBPACK_IMPORTED_MODULE_0__["default"]); +BpmnAutoResizeProvider.$inject = [ + 'eventBus', + 'modeling' +]; - var ParticipantHelper = {}; - module.exports = ParticipantHelper; +/** + * BPMN-specific check whether given elements can be resized. + * + * @param {Shape[]} elements + * @param {Shape} target + * + * @return {boolean} + */ +BpmnAutoResizeProvider.prototype.canResize = function(elements, target) { - ParticipantHelper.modifyProcessBusinessObject = function(element, property, values) { - if (!is(element, 'bpmn:Participant')) { - return {}; - } + // do not resize plane elements: + // root elements, collapsed sub-processes + if ((0,_util_ModelUtil__WEBPACK_IMPORTED_MODULE_2__.is)(target.di, 'bpmndi:BPMNPlane')) { + return false; + } - var bo = getBusinessObject(element).get('processRef'), - properties = {}; + if (!(0,_util_ModelUtil__WEBPACK_IMPORTED_MODULE_2__.is)(target, 'bpmn:Participant') && !(0,_util_ModelUtil__WEBPACK_IMPORTED_MODULE_2__.is)(target, 'bpmn:Lane') && !((0,_util_ModelUtil__WEBPACK_IMPORTED_MODULE_2__.is)(target, 'bpmn:SubProcess'))) { + return false; + } - properties[property] = values[property]; + var canResize = true; - return cmdHelper.updateBusinessObject(element, bo, properties); - }; + (0,min_dash__WEBPACK_IMPORTED_MODULE_3__.forEach)(elements, function(element) { - ParticipantHelper.getProcessBusinessObject = function(element, propertyName) { - if (!is(element, 'bpmn:Participant')) { - return {}; - } + if ((0,_util_ModelUtil__WEBPACK_IMPORTED_MODULE_2__.is)(element, 'bpmn:Lane') || (0,_util_LabelUtil__WEBPACK_IMPORTED_MODULE_4__.isLabel)(element)) { + canResize = false; + return; + } + }); - var bo = getBusinessObject(element).get('processRef'), - properties = {}; + return canResize; +}; - properties[propertyName] = bo.get(propertyName); - return properties; - }; - },{"./CmdHelper":25,"bpmn-js/lib/util/ModelUtil":240}],33:[function(require,module,exports){ - module.exports = { - __depends__: [ - require('./cmd'), - require('diagram-js/lib/i18n/translate').default - ], - __init__: [ 'propertiesPanel' ], - propertiesPanel: [ 'type', require('./PropertiesPanel') ] - }; +/***/ }), - },{"./PropertiesPanel":4,"./cmd":11,"diagram-js/lib/i18n/translate":401}],34:[function(require,module,exports){ - 'use strict'; +/***/ "../node_modules/bpmn-js/lib/features/auto-resize/index.js": +/*!*****************************************************************!*\ + !*** ../node_modules/bpmn-js/lib/features/auto-resize/index.js ***! + \*****************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - var entryFactory = require('../../../factory/EntryFactory'), - cmdHelper = require('../../../helper/CmdHelper'); +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _BpmnAutoResize__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./BpmnAutoResize */ "../node_modules/bpmn-js/lib/features/auto-resize/BpmnAutoResize.js"); +/* harmony import */ var _BpmnAutoResizeProvider__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./BpmnAutoResizeProvider */ "../node_modules/bpmn-js/lib/features/auto-resize/BpmnAutoResizeProvider.js"); - var ModelUtil = require('bpmn-js/lib/util/ModelUtil'), - is = ModelUtil.is, - getBusinessObject = ModelUtil.getBusinessObject; - module.exports = function(group, element, bpmnFactory, translate) { - var getValue = function(businessObject) { - return function(element) { - var documentations = businessObject && businessObject.get('documentation'), - text = (documentations && documentations.length > 0) ? documentations[0].text : ''; +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ + __init__: [ + 'bpmnAutoResize', + 'bpmnAutoResizeProvider' + ], + bpmnAutoResize: [ 'type', _BpmnAutoResize__WEBPACK_IMPORTED_MODULE_0__["default"] ], + bpmnAutoResizeProvider: [ 'type', _BpmnAutoResizeProvider__WEBPACK_IMPORTED_MODULE_1__["default"] ] +}); - return { documentation: text }; - }; - }; - var setValue = function(businessObject) { - return function(element, values) { - var newObjectList = []; +/***/ }), - if (typeof values.documentation !== 'undefined' && values.documentation !== '') { - newObjectList.push(bpmnFactory.create('bpmn:Documentation', { - text: values.documentation - })); - } +/***/ "../node_modules/bpmn-js/lib/features/context-pad/ContextPadProvider.js": +/*!******************************************************************************!*\ + !*** ../node_modules/bpmn-js/lib/features/context-pad/ContextPadProvider.js ***! + \******************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - return cmdHelper.setList(element, businessObject, 'documentation', newObjectList); - }; - }; +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ ContextPadProvider) +/* harmony export */ }); +/* harmony import */ var min_dash__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! min-dash */ "../node_modules/min-dash/dist/index.esm.js"); +/* harmony import */ var _modeling_util_ModelingUtil__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../modeling/util/ModelingUtil */ "../node_modules/bpmn-js/lib/util/ModelUtil.js"); +/* harmony import */ var _util_DiUtil__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../util/DiUtil */ "../node_modules/bpmn-js/lib/util/DiUtil.js"); +/* harmony import */ var _modeling_util_LaneUtil__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../modeling/util/LaneUtil */ "../node_modules/bpmn-js/lib/features/modeling/util/LaneUtil.js"); +/* harmony import */ var diagram_js_lib_util_Mouse__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! diagram-js/lib/util/Mouse */ "../node_modules/diagram-js/lib/util/Mouse.js"); - // Element Documentation - var elementDocuEntry = entryFactory.textBox({ - id: 'documentation', - label: translate('Element Documentation'), - modelProperty: 'documentation' - }); - elementDocuEntry.set = setValue(getBusinessObject(element)); - elementDocuEntry.get = getValue(getBusinessObject(element)); - group.entries.push(elementDocuEntry); - var processRef; - // Process Documentation when having a Collaboration Diagram - if (is(element, 'bpmn:Participant')) { - processRef = getBusinessObject(element).processRef; - // do not show for collapsed Pools/Participants - if (processRef) { - var processDocuEntry = entryFactory.textBox({ - id: 'process-documentation', - label: translate('Process Documentation'), - modelProperty: 'documentation' - }); - processDocuEntry.set = setValue(processRef); - processDocuEntry.get = getValue(processRef); - group.entries.push(processDocuEntry); - } - } +/** + * @typedef {import('didi').Injector} Injector + * @typedef {import('diagram-js/lib/core/EventBus').default} EventBus + * @typedef {import('diagram-js/lib/features/context-pad/ContextPad').default} ContextPad + * @typedef {import('../modeling/Modeling').default} Modeling + * @typedef {import('../modeling/ElementFactory').default} ElementFactory + * @typedef {import('diagram-js/lib/features/connect/Connect').default} Connect + * @typedef {import('diagram-js/lib/features/create/Create').default} Create + * @typedef {import('diagram-js/lib/features/popup-menu/PopupMenu').default} PopupMenu + * @typedef {import('diagram-js/lib/features/canvas/Canvas').default} Canvas + * @typedef {import('diagram-js/lib/features/rules/Rules').default} Rules + * @typedef {import('diagram-js/lib/i18n/translate/translate').default} Translate + * + * @typedef {import('../../model/Types').Element} Element + * @typedef {import('../../model/Types').ModdleElement} ModdleElement + * + * @typedef {import('diagram-js/lib/features/context-pad/ContextPadProvider').default} BaseContextPadProvider + * @typedef {import('diagram-js/lib/features/context-pad/ContextPadProvider').ContextPadEntries} ContextPadEntries + * @typedef {import('diagram-js/lib/features/context-pad/ContextPadProvider').ContextPadEntry} ContextPadEntry + * + * @typedef { { autoPlace?: boolean; } } ContextPadConfig + */ - }; +/** + * BPMN-specific context pad provider. + * + * @implements {BaseContextPadProvider} + * + * @param {ContextPadConfig} config + * @param {Injector} injector + * @param {EventBus} eventBus + * @param {ContextPad} contextPad + * @param {Modeling} modeling + * @param {ElementFactory} elementFactory + * @param {Connect} connect + * @param {Create} create + * @param {PopupMenu} popupMenu + * @param {Canvas} canvas + * @param {Rules} rules + * @param {Translate} translate + */ +function ContextPadProvider( + config, injector, eventBus, + contextPad, modeling, elementFactory, + connect, create, popupMenu, + canvas, rules, translate, appendPreview) { + + config = config || {}; + + contextPad.registerProvider(this); + + this._contextPad = contextPad; + + this._modeling = modeling; + + this._elementFactory = elementFactory; + this._connect = connect; + this._create = create; + this._popupMenu = popupMenu; + this._canvas = canvas; + this._rules = rules; + this._translate = translate; + this._eventBus = eventBus; + this._appendPreview = appendPreview; + + if (config.autoPlace !== false) { + this._autoPlace = injector.get('autoPlace', false); + } + + eventBus.on('create.end', 250, function(event) { + var context = event.context, + shape = context.shape; + + if (!(0,diagram_js_lib_util_Mouse__WEBPACK_IMPORTED_MODULE_0__.hasPrimaryModifier)(event) || !contextPad.isOpen(shape)) { + return; + } + + var entries = contextPad.getEntries(shape); + + if (entries.replace) { + entries.replace.action.click(event, shape); + } + }); +} + +ContextPadProvider.$inject = [ + 'config.contextPad', + 'injector', + 'eventBus', + 'contextPad', + 'modeling', + 'elementFactory', + 'connect', + 'create', + 'popupMenu', + 'canvas', + 'rules', + 'translate', + 'appendPreview' +]; + +/** + * @param {Element[]} elements + * + * @return {ContextPadEntries} + */ +ContextPadProvider.prototype.getMultiElementContextPadEntries = function(elements) { + var modeling = this._modeling; + + var actions = {}; + + if (this._isDeleteAllowed(elements)) { + (0,min_dash__WEBPACK_IMPORTED_MODULE_1__.assign)(actions, { + 'delete': { + group: 'edit', + className: 'bpmn-icon-trash', + title: this._translate('Delete'), + action: { + click: function(event, elements) { + modeling.removeElements(elements.slice()); + } + } + } + }); + } + + return actions; +}; + +/** + * @param {Element[]} elements + * + * @return {boolean} + */ +ContextPadProvider.prototype._isDeleteAllowed = function(elements) { + + var baseAllowed = this._rules.allowed('elements.delete', { + elements: elements + }); - },{"../../../factory/EntryFactory":14,"../../../helper/CmdHelper":25,"bpmn-js/lib/util/ModelUtil":240}],35:[function(require,module,exports){ - 'use strict'; + if ((0,min_dash__WEBPACK_IMPORTED_MODULE_1__.isArray)(baseAllowed)) { + return (0,min_dash__WEBPACK_IMPORTED_MODULE_1__.every)(baseAllowed, function(element) { + return includes(baseAllowed, element); + }); + } - var is = require('bpmn-js/lib/util/ModelUtil').is, - isAny = require('bpmn-js/lib/features/modeling/util/ModelingUtil').isAny, - getBusinessObject = require('bpmn-js/lib/util/ModelUtil').getBusinessObject, - eventDefinitionHelper = require('../../../helper/EventDefinitionHelper'); + return baseAllowed; +}; - var forEach = require('lodash/forEach'); +/** + * @param {Element} element + * + * @return {ContextPadEntries} + */ +ContextPadProvider.prototype.getContextPadEntries = function(element) { + var contextPad = this._contextPad, + modeling = this._modeling, + elementFactory = this._elementFactory, + connect = this._connect, + create = this._create, + popupMenu = this._popupMenu, + rules = this._rules, + autoPlace = this._autoPlace, + translate = this._translate, + appendPreview = this._appendPreview; - var message = require('./implementation/MessageEventDefinition'), - signal = require('./implementation/SignalEventDefinition'), - error = require('./implementation/ErrorEventDefinition'), - escalation = require('./implementation/EscalationEventDefinition'), - timer = require('./implementation/TimerEventDefinition'), - compensation = require('./implementation/CompensateEventDefinition'), - condition = require('./implementation/ConditionalEventDefinition'); + var actions = {}; + if (element.type === 'label') { + return actions; + } - module.exports = function(group, element, bpmnFactory, elementRegistry, translate) { - var events = [ - 'bpmn:StartEvent', - 'bpmn:EndEvent', - 'bpmn:IntermediateThrowEvent', - 'bpmn:BoundaryEvent', - 'bpmn:IntermediateCatchEvent' - ]; + var businessObject = element.businessObject; - // Message and Signal Event Definition - forEach(events, function(event) { - if (is(element, event)) { + function startConnect(event, element) { + connect.start(event, element); + } - var messageEventDefinition = eventDefinitionHelper.getMessageEventDefinition(element), - signalEventDefinition = eventDefinitionHelper.getSignalEventDefinition(element); + function removeElement(e, element) { + modeling.removeElements([ element ]); + } - if (messageEventDefinition) { - message(group, element, bpmnFactory, messageEventDefinition, translate); - } + function getReplaceMenuPosition(element) { - if (signalEventDefinition) { - signal(group, element, bpmnFactory, signalEventDefinition, translate); - } + var Y_OFFSET = 5; - } - }); + var pad = contextPad.getPad(element).html; - // Special Case: Receive Task - if (is(element, 'bpmn:ReceiveTask')) { - message(group, element, bpmnFactory, getBusinessObject(element), translate); - } + var padRect = pad.getBoundingClientRect(); - // Error Event Definition - var errorEvents = [ - 'bpmn:StartEvent', - 'bpmn:BoundaryEvent', - 'bpmn:EndEvent' - ]; + var pos = { + x: padRect.left, + y: padRect.bottom + Y_OFFSET + }; - forEach(errorEvents, function(event) { - if (is(element, event)) { + return pos; + } - var errorEventDefinition = eventDefinitionHelper.getErrorEventDefinition(element); + /** + * Create an append action. + * + * @param {string} type + * @param {string} className + * @param {string} title + * @param {Object} [options] + * + * @return {ContextPadEntry} + */ + function appendAction(type, className, title, options) { - if (errorEventDefinition) { + function appendStart(event, element) { - error(group, element, bpmnFactory, errorEventDefinition, translate); - } - } - }); + var shape = elementFactory.createShape((0,min_dash__WEBPACK_IMPORTED_MODULE_1__.assign)({ type: type }, options)); - // Escalation Event Definition - var escalationEvents = [ - 'bpmn:StartEvent', - 'bpmn:BoundaryEvent', - 'bpmn:IntermediateThrowEvent', - 'bpmn:EndEvent' - ]; + create.start(event, shape, { + source: element + }); - forEach(escalationEvents, function(event) { - if (is(element, event)) { + appendPreview.cleanUp(); + } - var showEscalationCodeVariable = is(element, 'bpmn:StartEvent') || is(element, 'bpmn:BoundaryEvent'); + var append = autoPlace ? function(_, element) { + var shape = elementFactory.createShape((0,min_dash__WEBPACK_IMPORTED_MODULE_1__.assign)({ type: type }, options)); - // get business object - var escalationEventDefinition = eventDefinitionHelper.getEscalationEventDefinition(element); + autoPlace.append(element, shape); - if (escalationEventDefinition) { - escalation(group, element, bpmnFactory, escalationEventDefinition, showEscalationCodeVariable, - translate); - } - } + appendPreview.cleanUp(); + } : appendStart; - }); + var previewAppend = autoPlace ? function(_, element) { - // Timer Event Definition - var timerEvents = [ - 'bpmn:StartEvent', - 'bpmn:BoundaryEvent', - 'bpmn:IntermediateCatchEvent' - ]; + // mouseover + appendPreview.create(element, type, options); - forEach(timerEvents, function(event) { - if (is(element, event)) { + return () => { - // get business object - var timerEventDefinition = eventDefinitionHelper.getTimerEventDefinition(element); + // mouseout + appendPreview.cleanUp(); + }; + } : null; - if (timerEventDefinition) { - timer(group, element, bpmnFactory, timerEventDefinition, translate); - } - } - }); + return { + group: 'model', + className: className, + title: title, + action: { + dragstart: appendStart, + click: append, + hover: previewAppend + } + }; + } - // Compensate Event Definition - var compensationEvents = [ - 'bpmn:EndEvent', - 'bpmn:IntermediateThrowEvent' - ]; + function splitLaneHandler(count) { - forEach(compensationEvents, function(event) { - if (is(element, event)) { + return function(_, element) { - // get business object - var compensateEventDefinition = eventDefinitionHelper.getCompensateEventDefinition(element); + // actual split + modeling.splitLane(element, count); - if (compensateEventDefinition) { - compensation(group, element, bpmnFactory, compensateEventDefinition, elementRegistry, translate); - } - } - }); + // refresh context pad after split to + // get rid of split icons + contextPad.open(element, true); + }; + } - // Conditional Event Definition - var conditionalEvents = [ - 'bpmn:StartEvent', - 'bpmn:BoundaryEvent', - 'bpmn:IntermediateThrowEvent', - 'bpmn:IntermediateCatchEvent' - ]; + if ((0,_modeling_util_ModelingUtil__WEBPACK_IMPORTED_MODULE_2__.isAny)(businessObject, [ 'bpmn:Lane', 'bpmn:Participant' ]) && (0,_util_DiUtil__WEBPACK_IMPORTED_MODULE_3__.isExpanded)(element)) { - if (isAny(element, conditionalEvents)) { + var childLanes = (0,_modeling_util_LaneUtil__WEBPACK_IMPORTED_MODULE_4__.getChildLanes)(element); - // get business object - var conditionalEventDefinition = eventDefinitionHelper.getConditionalEventDefinition(element); + (0,min_dash__WEBPACK_IMPORTED_MODULE_1__.assign)(actions, { + 'lane-insert-above': { + group: 'lane-insert-above', + className: 'bpmn-icon-lane-insert-above', + title: translate('Add lane above'), + action: { + click: function(event, element) { + modeling.addLane(element, 'top'); + } + } + } + }); - if (conditionalEventDefinition) { - condition(group, element, bpmnFactory, conditionalEventDefinition, elementRegistry, translate); - } + if (childLanes.length < 2) { + + if (element.height >= 120) { + (0,min_dash__WEBPACK_IMPORTED_MODULE_1__.assign)(actions, { + 'lane-divide-two': { + group: 'lane-divide', + className: 'bpmn-icon-lane-divide-two', + title: translate('Divide into two lanes'), + action: { + click: splitLaneHandler(2) } + } + }); + } + + if (element.height >= 180) { + (0,min_dash__WEBPACK_IMPORTED_MODULE_1__.assign)(actions, { + 'lane-divide-three': { + group: 'lane-divide', + className: 'bpmn-icon-lane-divide-three', + title: translate('Divide into three lanes'), + action: { + click: splitLaneHandler(3) + } + } + }); + } + } + + (0,min_dash__WEBPACK_IMPORTED_MODULE_1__.assign)(actions, { + 'lane-insert-below': { + group: 'lane-insert-below', + className: 'bpmn-icon-lane-insert-below', + title: translate('Add lane below'), + action: { + click: function(event, element) { + modeling.addLane(element, 'bottom'); + } + } + } + }); + + } + + if ((0,_modeling_util_ModelingUtil__WEBPACK_IMPORTED_MODULE_2__.is)(businessObject, 'bpmn:FlowNode')) { + + if ((0,_modeling_util_ModelingUtil__WEBPACK_IMPORTED_MODULE_2__.is)(businessObject, 'bpmn:EventBasedGateway')) { + + (0,min_dash__WEBPACK_IMPORTED_MODULE_1__.assign)(actions, { + 'append.receive-task': appendAction( + 'bpmn:ReceiveTask', + 'bpmn-icon-receive-task', + translate('Append receive task') + ), + 'append.message-intermediate-event': appendAction( + 'bpmn:IntermediateCatchEvent', + 'bpmn-icon-intermediate-event-catch-message', + translate('Append message intermediate catch event'), + { eventDefinitionType: 'bpmn:MessageEventDefinition' } + ), + 'append.timer-intermediate-event': appendAction( + 'bpmn:IntermediateCatchEvent', + 'bpmn-icon-intermediate-event-catch-timer', + translate('Append timer intermediate catch event'), + { eventDefinitionType: 'bpmn:TimerEventDefinition' } + ), + 'append.condition-intermediate-event': appendAction( + 'bpmn:IntermediateCatchEvent', + 'bpmn-icon-intermediate-event-catch-condition', + translate('Append conditional intermediate catch event'), + { eventDefinitionType: 'bpmn:ConditionalEventDefinition' } + ), + 'append.signal-intermediate-event': appendAction( + 'bpmn:IntermediateCatchEvent', + 'bpmn-icon-intermediate-event-catch-signal', + translate('Append signal intermediate catch event'), + { eventDefinitionType: 'bpmn:SignalEventDefinition' } + ) + }); + } else + + if (isEventType(businessObject, 'bpmn:BoundaryEvent', 'bpmn:CompensateEventDefinition')) { + + (0,min_dash__WEBPACK_IMPORTED_MODULE_1__.assign)(actions, { + 'append.compensation-activity': + appendAction( + 'bpmn:Task', + 'bpmn-icon-task', + translate('Append compensation activity'), + { + isForCompensation: true + } + ) + }); + } else + + if (!(0,_modeling_util_ModelingUtil__WEBPACK_IMPORTED_MODULE_2__.is)(businessObject, 'bpmn:EndEvent') && + !businessObject.isForCompensation && + !isEventType(businessObject, 'bpmn:IntermediateThrowEvent', 'bpmn:LinkEventDefinition') && + !(0,_util_DiUtil__WEBPACK_IMPORTED_MODULE_3__.isEventSubProcess)(businessObject)) { + + (0,min_dash__WEBPACK_IMPORTED_MODULE_1__.assign)(actions, { + 'append.end-event': appendAction( + 'bpmn:EndEvent', + 'bpmn-icon-end-event-none', + translate('Append end event') + ), + 'append.gateway': appendAction( + 'bpmn:ExclusiveGateway', + 'bpmn-icon-gateway-none', + translate('Append gateway') + ), + 'append.append-task': appendAction( + 'bpmn:Task', + 'bpmn-icon-task', + translate('Append task') + ), + 'append.intermediate-event': appendAction( + 'bpmn:IntermediateThrowEvent', + 'bpmn-icon-intermediate-event-none', + translate('Append intermediate/boundary event') + ) + }); + } + } + + if (!popupMenu.isEmpty(element, 'bpmn-replace')) { + + // Replace menu entry + (0,min_dash__WEBPACK_IMPORTED_MODULE_1__.assign)(actions, { + 'replace': { + group: 'edit', + className: 'bpmn-icon-screw-wrench', + title: translate('Change element'), + action: { + click: function(event, element) { + + var position = (0,min_dash__WEBPACK_IMPORTED_MODULE_1__.assign)(getReplaceMenuPosition(element), { + cursor: { x: event.x, y: event.y } + }); + + popupMenu.open(element, 'bpmn-replace', position, { + title: translate('Change element'), + width: 300, + search: true + }); + } + } + } + }); + } + + if ((0,_modeling_util_ModelingUtil__WEBPACK_IMPORTED_MODULE_2__.is)(businessObject, 'bpmn:SequenceFlow')) { + (0,min_dash__WEBPACK_IMPORTED_MODULE_1__.assign)(actions, { + 'append.text-annotation': appendAction( + 'bpmn:TextAnnotation', + 'bpmn-icon-text-annotation', + translate('Add text annotation') + ) + }); + } + + if ( + (0,_modeling_util_ModelingUtil__WEBPACK_IMPORTED_MODULE_2__.isAny)(businessObject, [ + 'bpmn:FlowNode', + 'bpmn:InteractionNode', + 'bpmn:DataObjectReference', + 'bpmn:DataStoreReference', + ]) + ) { + (0,min_dash__WEBPACK_IMPORTED_MODULE_1__.assign)(actions, { + 'append.text-annotation': appendAction( + 'bpmn:TextAnnotation', + 'bpmn-icon-text-annotation', + translate('Add text annotation') + ), + + 'connect': { + group: 'connect', + className: 'bpmn-icon-connection-multi', + title: translate('Connect to other element'), + action: { + click: startConnect, + dragstart: startConnect, + }, + }, + }); + } + + if ((0,_modeling_util_ModelingUtil__WEBPACK_IMPORTED_MODULE_2__.is)(businessObject, 'bpmn:TextAnnotation')) { + (0,min_dash__WEBPACK_IMPORTED_MODULE_1__.assign)(actions, { + 'connect': { + group: 'connect', + className: 'bpmn-icon-connection-multi', + title: translate('Connect using association'), + action: { + click: startConnect, + dragstart: startConnect, + }, + }, + }); + } + + if ((0,_modeling_util_ModelingUtil__WEBPACK_IMPORTED_MODULE_2__.isAny)(businessObject, [ 'bpmn:DataObjectReference', 'bpmn:DataStoreReference' ])) { + (0,min_dash__WEBPACK_IMPORTED_MODULE_1__.assign)(actions, { + 'connect': { + group: 'connect', + className: 'bpmn-icon-connection-multi', + title: translate('Connect using data input association'), + action: { + click: startConnect, + dragstart: startConnect + } + } + }); + } + + if ((0,_modeling_util_ModelingUtil__WEBPACK_IMPORTED_MODULE_2__.is)(businessObject, 'bpmn:Group')) { + (0,min_dash__WEBPACK_IMPORTED_MODULE_1__.assign)(actions, { + 'append.text-annotation': appendAction( + 'bpmn:TextAnnotation', + 'bpmn-icon-text-annotation', + translate('Add text annotation') + ) + }); + } + + // delete element entry, only show if allowed by rules + var deleteAllowed = rules.allowed('elements.delete', { elements: [ element ] }); + + if ((0,min_dash__WEBPACK_IMPORTED_MODULE_1__.isArray)(deleteAllowed)) { + + // was the element returned as a deletion candidate? + deleteAllowed = deleteAllowed[0] === element; + } + + if (deleteAllowed) { + (0,min_dash__WEBPACK_IMPORTED_MODULE_1__.assign)(actions, { + 'delete': { + group: 'edit', + className: 'bpmn-icon-trash', + title: translate('Delete'), + action: { + click: removeElement + } + } + }); + } + + return actions; +}; + + +// helpers ///////// + +/** + * @param {ModdleElement} businessObject + * @param {string} type + * @param {string} eventDefinitionType + * + * @return {boolean} + */ +function isEventType(businessObject, type, eventDefinitionType) { - }; + var isType = businessObject.$instanceOf(type); + var isDefinition = false; - },{"../../../helper/EventDefinitionHelper":27,"./implementation/CompensateEventDefinition":41,"./implementation/ConditionalEventDefinition":42,"./implementation/ErrorEventDefinition":44,"./implementation/EscalationEventDefinition":45,"./implementation/MessageEventDefinition":47,"./implementation/SignalEventDefinition":49,"./implementation/TimerEventDefinition":50,"bpmn-js/lib/features/modeling/util/ModelingUtil":211,"bpmn-js/lib/util/ModelUtil":240,"lodash/forEach":613}],36:[function(require,module,exports){ - 'use strict'; + var definitions = businessObject.eventDefinitions || []; + (0,min_dash__WEBPACK_IMPORTED_MODULE_1__.forEach)(definitions, function(def) { + if (def.$type === eventDefinitionType) { + isDefinition = true; + } + }); - var is = require('bpmn-js/lib/util/ModelUtil').is, - getBusinessObject = require('bpmn-js/lib/util/ModelUtil').getBusinessObject; + return isType && isDefinition; +} - var entryFactory = require('../../../factory/EntryFactory'); +function includes(array, item) { + return array.indexOf(item) !== -1; +} - var participantHelper = require('../../../helper/ParticipantHelper'); +/***/ }), - module.exports = function(group, element, translate) { +/***/ "../node_modules/bpmn-js/lib/features/context-pad/index.js": +/*!*****************************************************************!*\ + !*** ../node_modules/bpmn-js/lib/features/context-pad/index.js ***! + \*****************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - var bo = getBusinessObject(element); +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _append_preview__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../append-preview */ "../node_modules/bpmn-js/lib/features/append-preview/index.js"); +/* harmony import */ var diagram_js_direct_editing__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! diagram-js-direct-editing */ "../node_modules/diagram-js-direct-editing/lib/index.js"); +/* harmony import */ var diagram_js_lib_features_context_pad__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! diagram-js/lib/features/context-pad */ "../node_modules/diagram-js/lib/features/context-pad/index.js"); +/* harmony import */ var diagram_js_lib_features_selection__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! diagram-js/lib/features/selection */ "../node_modules/diagram-js/lib/features/selection/index.js"); +/* harmony import */ var diagram_js_lib_features_connect__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! diagram-js/lib/features/connect */ "../node_modules/diagram-js/lib/features/connect/index.js"); +/* harmony import */ var diagram_js_lib_features_create__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! diagram-js/lib/features/create */ "../node_modules/diagram-js/lib/features/create/index.js"); +/* harmony import */ var _popup_menu__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../popup-menu */ "../node_modules/bpmn-js/lib/features/popup-menu/index.js"); +/* harmony import */ var _ContextPadProvider__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./ContextPadProvider */ "../node_modules/bpmn-js/lib/features/context-pad/ContextPadProvider.js"); - if (!bo) { - return; - } - if (is(element, 'bpmn:Process') || (is(element, 'bpmn:Participant') && bo.get('processRef'))) { - var executableEntry = entryFactory.checkbox({ - id: 'process-is-executable', - label: translate('Executable'), - modelProperty: 'isExecutable' - }); - // in participants we have to change the default behavior of set and get - if (is(element, 'bpmn:Participant')) { - executableEntry.get = function(element) { - return participantHelper.getProcessBusinessObject(element, 'isExecutable'); - }; - executableEntry.set = function(element, values) { - return participantHelper.modifyProcessBusinessObject(element, 'isExecutable', values); - }; - } - group.entries.push(executableEntry); - } - }; - },{"../../../factory/EntryFactory":14,"../../../helper/ParticipantHelper":32,"bpmn-js/lib/util/ModelUtil":240}],37:[function(require,module,exports){ - 'use strict'; - var entryFactory = require('../../../factory/EntryFactory'), - getBusinessObject = require('bpmn-js/lib/util/ModelUtil').getBusinessObject, - utils = require('../../../Utils'), - cmdHelper = require('../../../helper/CmdHelper'); - module.exports = function(group, element, translate, options) { +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ + __depends__: [ + _append_preview__WEBPACK_IMPORTED_MODULE_1__["default"], + diagram_js_direct_editing__WEBPACK_IMPORTED_MODULE_0__["default"], + diagram_js_lib_features_context_pad__WEBPACK_IMPORTED_MODULE_2__["default"], + diagram_js_lib_features_selection__WEBPACK_IMPORTED_MODULE_3__["default"], + diagram_js_lib_features_connect__WEBPACK_IMPORTED_MODULE_4__["default"], + diagram_js_lib_features_create__WEBPACK_IMPORTED_MODULE_5__["default"], + _popup_menu__WEBPACK_IMPORTED_MODULE_6__["default"] + ], + __init__: [ 'contextPadProvider' ], + contextPadProvider: [ 'type', _ContextPadProvider__WEBPACK_IMPORTED_MODULE_7__["default"] ] +}); - var description = options && options.description; +/***/ }), - // Id - group.entries.push(entryFactory.validationAwareTextField({ - id: 'id', - label: translate('Id'), - description: description && translate(description), - modelProperty: 'id', - getProperty: function(element) { - return getBusinessObject(element).id; - }, - setProperty: function(element, properties) { +/***/ "../node_modules/bpmn-js/lib/features/copy-paste/BpmnCopyPaste.js": +/*!************************************************************************!*\ + !*** ../node_modules/bpmn-js/lib/features/copy-paste/BpmnCopyPaste.js ***! + \************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - element = element.labelTarget || element; +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ BpmnCopyPaste) +/* harmony export */ }); +/* harmony import */ var _util_ModelUtil__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../util/ModelUtil */ "../node_modules/bpmn-js/lib/util/ModelUtil.js"); +/* harmony import */ var min_dash__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! min-dash */ "../node_modules/min-dash/dist/index.esm.js"); +/* harmony import */ var _util_LabelUtil__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../util/LabelUtil */ "../node_modules/diagram-js/lib/util/ModelUtil.js"); - return cmdHelper.updateProperties(element, properties); - }, - validate: function(element, values) { - var idValue = values.id; - var bo = getBusinessObject(element); - var idError = utils.isIdValid(bo, idValue, translate); - return idError ? { id: idError } : {}; - } - })); - }; - },{"../../../Utils":5,"../../../factory/EntryFactory":14,"../../../helper/CmdHelper":25,"bpmn-js/lib/util/ModelUtil":240}],38:[function(require,module,exports){ - 'use strict'; +/** + * @typedef {import('../modeling/BpmnFactory').default} BpmnFactory + * @typedef {import('diagram-js/lib/core/EventBus').default} EventBus + * @typedef {import('./ModdleCopy').default} ModdleCopy + */ - var is = require('bpmn-js/lib/util/ModelUtil').is, - getBusinessObject = require('bpmn-js/lib/util/ModelUtil').getBusinessObject, - entryFactory = require('../../../factory/EntryFactory'), - cmdHelper = require('../../../helper/CmdHelper'); +function copyProperties(source, target, properties) { + if (!(0,min_dash__WEBPACK_IMPORTED_MODULE_0__.isArray)(properties)) { + properties = [ properties ]; + } - var forEach = require('lodash/forEach'); + (0,min_dash__WEBPACK_IMPORTED_MODULE_0__.forEach)(properties, function(property) { + if (!(0,min_dash__WEBPACK_IMPORTED_MODULE_0__.isUndefined)(source[property])) { + target[property] = source[property]; + } + }); +} - function getLinkEventDefinition(element) { +var LOW_PRIORITY = 750; - var bo = getBusinessObject(element); +/** + * BPMN-specific copy & paste. + * + * @param {BpmnFactory} bpmnFactory + * @param {EventBus} eventBus + * @param {ModdleCopy} moddleCopy + */ +function BpmnCopyPaste(bpmnFactory, eventBus, moddleCopy) { - var linkEventDefinition = null; - if (bo.eventDefinitions) { - forEach(bo.eventDefinitions, function(eventDefinition) { - if (is(eventDefinition, 'bpmn:LinkEventDefinition')) { - linkEventDefinition = eventDefinition; - } - }); - } + function copy(bo, clone) { + var targetBo = bpmnFactory.create(bo.$type); - return linkEventDefinition; - } + return moddleCopy.copyElement(bo, targetBo, null, clone); + } - module.exports = function(group, element, translate) { - var linkEvents = [ 'bpmn:IntermediateThrowEvent', 'bpmn:IntermediateCatchEvent' ]; + eventBus.on('copyPaste.copyElement', LOW_PRIORITY, function(context) { + var descriptor = context.descriptor, + element = context.element, + businessObject = (0,_util_ModelUtil__WEBPACK_IMPORTED_MODULE_1__.getBusinessObject)(element); - forEach(linkEvents, function(event) { - if (is(element, event)) { + // do not copy business object + di for labels; + // will be pulled from the referenced label target + if ((0,_util_LabelUtil__WEBPACK_IMPORTED_MODULE_2__.isLabel)(element)) { + return descriptor; + } - var linkEventDefinition = getLinkEventDefinition(element); + var businessObjectCopy = descriptor.businessObject = copy(businessObject, true); + var diCopy = descriptor.di = copy((0,_util_ModelUtil__WEBPACK_IMPORTED_MODULE_1__.getDi)(element), true); + diCopy.bpmnElement = businessObjectCopy; - if (linkEventDefinition) { - var entry = entryFactory.textField({ - id: 'link-event', - label: translate('Link Name'), - modelProperty: 'link-name' - }); + copyProperties(businessObjectCopy, descriptor, 'name'); + copyProperties(diCopy, descriptor, 'isExpanded'); - entry.get = function() { - return { 'link-name': linkEventDefinition.get('name') }; - }; + // default sequence flow + if (businessObject.default) { + descriptor.default = businessObject.default.id; + } + }); - entry.set = function(element, values) { - var newProperties = { - name: values['link-name'] - }; - return cmdHelper.updateBusinessObject(element, linkEventDefinition, newProperties); - }; + var referencesKey = '-bpmn-js-refs'; - group.entries.push(entry); - } - } - }); - }; + function getReferences(cache) { + return (cache[referencesKey] = cache[referencesKey] || {}); + } + function setReferences(cache, references) { + cache[referencesKey] = references; + } - },{"../../../factory/EntryFactory":14,"../../../helper/CmdHelper":25,"bpmn-js/lib/util/ModelUtil":240,"lodash/forEach":613}],39:[function(require,module,exports){ - 'use strict'; + function resolveReferences(descriptor, cache, references) { + var businessObject = (0,_util_ModelUtil__WEBPACK_IMPORTED_MODULE_1__.getBusinessObject)(descriptor); - var nameEntryFactory = require('./implementation/Name'), - createCategoryValue = require('../../../helper/CategoryHelper').createCategoryValue, - is = require('bpmn-js/lib/util/ModelUtil').is, - getBusinessObject = require('bpmn-js/lib/util/ModelUtil').getBusinessObject; + // default sequence flows + if (descriptor.default) { - module.exports = function(group, element, bpmnFactory, canvas, translate) { + // relationship cannot be resolved immediately + references[ descriptor.default ] = { + element: businessObject, + property: 'default' + }; + } - function initializeCategory(semantic) { - var rootElement = canvas.getRootElement(), - definitions = getBusinessObject(rootElement).$parent, - categoryValue = createCategoryValue(definitions, bpmnFactory); + // boundary events + if (descriptor.host) { - semantic.categoryValueRef = categoryValue; + // relationship can be resolved immediately + (0,_util_ModelUtil__WEBPACK_IMPORTED_MODULE_1__.getBusinessObject)(descriptor).attachedToRef = (0,_util_ModelUtil__WEBPACK_IMPORTED_MODULE_1__.getBusinessObject)(cache[ descriptor.host ]); + } - } + return (0,min_dash__WEBPACK_IMPORTED_MODULE_0__.omit)(references, (0,min_dash__WEBPACK_IMPORTED_MODULE_0__.reduce)(references, function(array, reference, key) { + var element = reference.element, + property = reference.property; - function setGroupName(element, values) { - var bo = getBusinessObject(element), - categoryValueRef = bo.categoryValueRef; + if (key === descriptor.id) { + element.set(property, businessObject); - if (!categoryValueRef) { - initializeCategory(bo); - } + array.push(descriptor.id); + } - // needs direct call to update categoryValue properly - return { - cmd: 'element.updateLabel', - context: { - element: element, - newLabel: values.categoryValue - } - }; - } + return array; + }, [])); + } - function getGroupName(element) { - var bo = getBusinessObject(element), - value = (bo.categoryValueRef || {}).value; + eventBus.on('copyPaste.pasteElement', function(context) { + var cache = context.cache, + descriptor = context.descriptor, + businessObject = descriptor.businessObject, + di = descriptor.di; - return { categoryValue: value }; - } + // wire existing di + businessObject for external label + if ((0,_util_LabelUtil__WEBPACK_IMPORTED_MODULE_2__.isLabel)(descriptor)) { + descriptor.businessObject = (0,_util_ModelUtil__WEBPACK_IMPORTED_MODULE_1__.getBusinessObject)(cache[ descriptor.labelTarget ]); + descriptor.di = (0,_util_ModelUtil__WEBPACK_IMPORTED_MODULE_1__.getDi)(cache[ descriptor.labelTarget ]); + + return; + } + + businessObject = descriptor.businessObject = copy(businessObject); + + di = descriptor.di = copy(di); + di.bpmnElement = businessObject; + + copyProperties(descriptor, businessObject, [ + 'isExpanded', + 'name' + ]); + + descriptor.type = businessObject.$type; + }); + + // copy + paste processRef with participant + + eventBus.on('copyPaste.copyElement', LOW_PRIORITY, function(context) { + var descriptor = context.descriptor, + element = context.element; + + if (!(0,_util_ModelUtil__WEBPACK_IMPORTED_MODULE_1__.is)(element, 'bpmn:Participant')) { + return; + } + + var participantBo = (0,_util_ModelUtil__WEBPACK_IMPORTED_MODULE_1__.getBusinessObject)(element); + + if (participantBo.processRef) { + descriptor.processRef = copy(participantBo.processRef, true); + } + }); + + eventBus.on('copyPaste.pasteElement', function(context) { + var descriptor = context.descriptor, + processRef = descriptor.processRef; + + if (processRef) { + descriptor.processRef = copy(processRef); + } + }); + + // resolve references - if (!is(element, 'bpmn:Collaboration')) { + eventBus.on('copyPaste.pasteElement', LOW_PRIORITY, function(context) { + var cache = context.cache, + descriptor = context.descriptor; + + // resolve references e.g. default sequence flow + setReferences( + cache, + resolveReferences(descriptor, cache, getReferences(cache)) + ); + }); - var options; - if (is(element, 'bpmn:TextAnnotation')) { - options = { modelProperty: 'text', label: translate('Text') }; - } else if (is(element, 'bpmn:Group')) { - options = { - modelProperty: 'categoryValue', - label: translate('Category Value'), - get: getGroupName, - set: setGroupName - }; - } +} + + +BpmnCopyPaste.$inject = [ + 'bpmnFactory', + 'eventBus', + 'moddleCopy' +]; + +/***/ }), + +/***/ "../node_modules/bpmn-js/lib/features/copy-paste/ModdleCopy.js": +/*!*********************************************************************!*\ + !*** ../node_modules/bpmn-js/lib/features/copy-paste/ModdleCopy.js ***! + \*********************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ ModdleCopy), +/* harmony export */ getPropertyNames: () => (/* binding */ getPropertyNames) +/* harmony export */ }); +/* harmony import */ var min_dash__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! min-dash */ "../node_modules/min-dash/dist/index.esm.js"); + + +var DISALLOWED_PROPERTIES = [ + 'artifacts', + 'dataInputAssociations', + 'dataOutputAssociations', + 'default', + 'flowElements', + 'lanes', + 'incoming', + 'outgoing', + 'categoryValue' +]; + +/** + * @typedef {import('diagram-js/lib/core/EventBus').default} EventBus + * @typedef {import('../modeling/BpmnFactory').default} BpmnFactory + * @typedef {import('../../model/Types').Moddle} Moddle + * + * @typedef {import('../../model/Types').ModdleElement} ModdleElement + */ - // name - group.entries = group.entries.concat(nameEntryFactory(element, options, translate)); +/** + * Utility for copying model properties from source element to target element. + * + * @param {EventBus} eventBus + * @param {BpmnFactory} bpmnFactory + * @param {Moddle} moddle + */ +function ModdleCopy(eventBus, bpmnFactory, moddle) { + this._bpmnFactory = bpmnFactory; + this._eventBus = eventBus; + this._moddle = moddle; + + // copy extension elements last + eventBus.on('moddleCopy.canCopyProperties', function(context) { + var propertyNames = context.propertyNames; + + if (!propertyNames || !propertyNames.length) { + return; + } + + return (0,min_dash__WEBPACK_IMPORTED_MODULE_0__.sortBy)(propertyNames, function(propertyName) { + return propertyName === 'extensionElements'; + }); + }); + + // default check whether property can be copied + eventBus.on('moddleCopy.canCopyProperty', function(context) { + var parent = context.parent, + parentDescriptor = (0,min_dash__WEBPACK_IMPORTED_MODULE_0__.isObject)(parent) && parent.$descriptor, + propertyName = context.propertyName; + + if (propertyName && DISALLOWED_PROPERTIES.indexOf(propertyName) !== -1) { + + // disallow copying property + return false; + } + + if (propertyName && + parentDescriptor && + !(0,min_dash__WEBPACK_IMPORTED_MODULE_0__.find)(parentDescriptor.properties, (0,min_dash__WEBPACK_IMPORTED_MODULE_0__.matchPattern)({ name: propertyName }))) { + + // disallow copying property + return false; + } + }); + + // do NOT allow to copy empty extension elements + eventBus.on('moddleCopy.canSetCopiedProperty', function(context) { + var property = context.property; + + if (is(property, 'bpmn:ExtensionElements') && (!property.values || !property.values.length)) { + + // disallow setting copied property + return false; + } + }); +} + +ModdleCopy.$inject = [ + 'eventBus', + 'bpmnFactory', + 'moddle' +]; + +/** + * Copy model properties of source element to target element. + * + * @param {ModdleElement} sourceElement + * @param {ModdleElement} targetElement + * @param {string[]} [propertyNames] + * @param {boolean} [clone=false] + * + * @return {ModdleElement} + */ +ModdleCopy.prototype.copyElement = function(sourceElement, targetElement, propertyNames, clone = false) { + var self = this; - } + if (propertyNames && !(0,min_dash__WEBPACK_IMPORTED_MODULE_0__.isArray)(propertyNames)) { + propertyNames = [ propertyNames ]; + } - }; + propertyNames = propertyNames || getPropertyNames(sourceElement.$descriptor); - },{"../../../helper/CategoryHelper":24,"./implementation/Name":48,"bpmn-js/lib/util/ModelUtil":240}],40:[function(require,module,exports){ - 'use strict'; + var canCopyProperties = this._eventBus.fire('moddleCopy.canCopyProperties', { + propertyNames: propertyNames, + sourceElement: sourceElement, + targetElement: targetElement, + clone: clone + }); - var is = require('bpmn-js/lib/util/ModelUtil').is, - entryFactory = require('../../../factory/EntryFactory'), - participantHelper = require('../../../helper/ParticipantHelper'), - getBusinessObject = require('bpmn-js/lib/util/ModelUtil').getBusinessObject, - nameEntryFactory = require('./implementation/Name'), - utils = require('../../../Utils'); + if (canCopyProperties === false) { + return targetElement; + } - module.exports = function(group, element, translate, options) { - var businessObject = getBusinessObject(element); + if ((0,min_dash__WEBPACK_IMPORTED_MODULE_0__.isArray)(canCopyProperties)) { + propertyNames = canCopyProperties; + } - var processIdDescription = options && options.processIdDescription; + // copy properties + (0,min_dash__WEBPACK_IMPORTED_MODULE_0__.forEach)(propertyNames, function(propertyName) { + var sourceProperty; - if (is(element, 'bpmn:Process') || (is(element, 'bpmn:Participant') && businessObject.get('processRef'))) { + if ((0,min_dash__WEBPACK_IMPORTED_MODULE_0__.has)(sourceElement, propertyName)) { + sourceProperty = sourceElement.get(propertyName); + } - /** - * processId - */ - if (is(element, 'bpmn:Participant')) { - var idEntry = entryFactory.validationAwareTextField({ - id: 'process-id', - label: translate('Process Id'), - description: processIdDescription && translate(processIdDescription), - modelProperty: 'processId' - }); + var copiedProperty = self.copyProperty(sourceProperty, targetElement, propertyName, clone); - // in participants we have to change the default behavior of set and get - idEntry.get = function(element) { - var properties = participantHelper.getProcessBusinessObject(element, 'id'); - return { processId: properties.id }; - }; + if (!(0,min_dash__WEBPACK_IMPORTED_MODULE_0__.isDefined)(copiedProperty)) { + return; + } - idEntry.set = function(element, values) { - return participantHelper.modifyProcessBusinessObject(element, 'id', { id: values.processId }); - }; + var canSetProperty = self._eventBus.fire('moddleCopy.canSetCopiedProperty', { + parent: targetElement, + property: copiedProperty, + propertyName: propertyName + }); - idEntry.validate = function(element, values) { - var idValue = values.processId; + if (canSetProperty === false) { + return; + } - var bo = getBusinessObject(element); + // TODO(nikku): unclaim old IDs if ID property is copied over + // this._moddle.getPropertyDescriptor(parent, propertyName) + targetElement.set(propertyName, copiedProperty); + }); - var processIdError = utils.isIdValid(bo.processRef, idValue, translate); + return targetElement; +}; - return processIdError ? { processId: processIdError } : {}; - }; +/** + * Copy model property. + * + * @param {any} property + * @param {ModdleElement} parent + * @param {string} propertyName + * @param {boolean} [clone=false] + * + * @return {any} + */ +ModdleCopy.prototype.copyProperty = function(property, parent, propertyName, clone = false) { + var self = this; - group.entries.push(idEntry); + // allow others to copy property + var copiedProperty = this._eventBus.fire('moddleCopy.canCopyProperty', { + parent: parent, + property: property, + propertyName: propertyName, + clone: clone + }); + // return if copying is NOT allowed + if (copiedProperty === false) { + return; + } + + if (copiedProperty) { + if ((0,min_dash__WEBPACK_IMPORTED_MODULE_0__.isObject)(copiedProperty) && copiedProperty.$type && !copiedProperty.$parent) { + copiedProperty.$parent = parent; + } + + return copiedProperty; + } - /** - * process name - */ - var processNameEntry = nameEntryFactory(element, { - id: 'process-name', - label: translate('Process Name') - })[0]; + var propertyDescriptor = this._moddle.getPropertyDescriptor(parent, propertyName); - // in participants we have to change the default behavior of set and get - processNameEntry.get = function(element) { - return participantHelper.getProcessBusinessObject(element, 'name'); - }; + // do NOT copy references + if (propertyDescriptor.isReference) { + return; + } - processNameEntry.set = function(element, values) { - return participantHelper.modifyProcessBusinessObject(element, 'name', values); - }; + // copy id + if (propertyDescriptor.isId) { + return property && this._copyId(property, parent, clone); + } - group.entries.push(processNameEntry); - } - } - }; + // copy arrays + if ((0,min_dash__WEBPACK_IMPORTED_MODULE_0__.isArray)(property)) { + return (0,min_dash__WEBPACK_IMPORTED_MODULE_0__.reduce)(property, function(childProperties, childProperty) { - },{"../../../Utils":5,"../../../factory/EntryFactory":14,"../../../helper/ParticipantHelper":32,"./implementation/Name":48,"bpmn-js/lib/util/ModelUtil":240}],41:[function(require,module,exports){ - 'use strict'; + // recursion + copiedProperty = self.copyProperty(childProperty, parent, propertyName, clone); - var entryFactory = require('../../../../factory/EntryFactory'); + // copying might NOT be allowed + if (copiedProperty) { + return childProperties.concat(copiedProperty); + } - var cmdHelper = require('../../../../helper/CmdHelper'), - eventDefinitionHelper = require('../../../../helper/EventDefinitionHelper'), - utils = require('../../../../Utils'); + return childProperties; + }, []); + } - var getBusinessObject = require('bpmn-js/lib/util/ModelUtil').getBusinessObject, - is = require('bpmn-js/lib/util/ModelUtil').is; + // copy model elements + if ((0,min_dash__WEBPACK_IMPORTED_MODULE_0__.isObject)(property) && property.$type) { + if (this._moddle.getElementDescriptor(property).isGeneric) { + return; + } - var forEach = require('lodash/forEach'), - find = require('lodash/find'), - filter = require('lodash/filter'); + copiedProperty = self._bpmnFactory.create(property.$type); + copiedProperty.$parent = parent; - function getContainedActivities(element) { - return getFlowElements(element, 'bpmn:Activity'); - } + // recursion + copiedProperty = self.copyElement(property, copiedProperty, null, clone); - function getContainedBoundaryEvents(element) { - return getFlowElements(element, 'bpmn:BoundaryEvent'); - } + return copiedProperty; + } - function getFlowElements(element, type) { - return utils.filterElementsByType(element.flowElements, type); - } + // copy primitive properties + return property; +}; - function isCompensationEventAttachedToActivity(activity, boundaryEvents) { - var activityId = activity.id; - var boundaryEvent = find(boundaryEvents, function(boundaryEvent) { - var compensateEventDefinition = eventDefinitionHelper.getCompensateEventDefinition(boundaryEvent); - var attachedToRef = boundaryEvent.attachedToRef; - return compensateEventDefinition && attachedToRef && attachedToRef.id === activityId; - }); - return !!boundaryEvent; - } +ModdleCopy.prototype._copyId = function(id, element, clone = false) { + if (clone) { + return id; + } -// subprocess: only when it is not triggeredByEvent -// activity: only when it attach a compensation boundary event -// callActivity: no limitation - function canActivityBeCompensated(activity, boundaryEvents) { - return (is(activity, 'bpmn:SubProcess') && !activity.triggeredByEvent) || - is(activity, 'bpmn:CallActivity') || - isCompensationEventAttachedToActivity(activity, boundaryEvents); - } + // disallow if already taken + if (this._moddle.ids.assigned(id)) { + return; + } else { - function getActivitiesForCompensation(element) { - var boundaryEvents = getContainedBoundaryEvents(element); - return filter(getContainedActivities(element), function(activity) { - return canActivityBeCompensated(activity, boundaryEvents); - }); - } + this._moddle.ids.claim(id, element); + return id; + } +}; - function getActivitiesForActivityRef(element) { - var bo = getBusinessObject(element); - var parent = bo.$parent; +// helpers ////////// - var activitiesForActivityRef = getActivitiesForCompensation(parent); +function getPropertyNames(descriptor, keepDefaultProperties) { + return (0,min_dash__WEBPACK_IMPORTED_MODULE_0__.reduce)(descriptor.properties, function(properties, property) { - // if throwing compensation event is in an event sub process: - // get also all activities outside of the event sub process - if (is(parent, 'bpmn:SubProcess') && parent.triggeredByEvent) { - parent = parent.$parent; - if (parent) { - activitiesForActivityRef = activitiesForActivityRef.concat(getActivitiesForCompensation(parent)); - } + if (keepDefaultProperties && property.default) { + return properties; + } - } + return properties.concat(property.name); + }, []); +} - return activitiesForActivityRef; - } +function is(element, type) { + return element && (0,min_dash__WEBPACK_IMPORTED_MODULE_0__.isFunction)(element.$instanceOf) && element.$instanceOf(type); +} - function createActivityRefOptions(element) { - var options = [ { value: '' } ]; +/***/ }), - var activities = getActivitiesForActivityRef(element); - forEach(activities, function(activity) { - var activityId = activity.id; - var name = (activity.name ? (activity.name + ' ') : '') + '(id=' + activityId + ')'; - options.push({ value: activityId, name: name }); - }); +/***/ "../node_modules/bpmn-js/lib/features/copy-paste/index.js": +/*!****************************************************************!*\ + !*** ../node_modules/bpmn-js/lib/features/copy-paste/index.js ***! + \****************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - return options; - } +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var diagram_js_lib_features_copy_paste__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! diagram-js/lib/features/copy-paste */ "../node_modules/diagram-js/lib/features/copy-paste/index.js"); +/* harmony import */ var _BpmnCopyPaste__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./BpmnCopyPaste */ "../node_modules/bpmn-js/lib/features/copy-paste/BpmnCopyPaste.js"); +/* harmony import */ var _ModdleCopy__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./ModdleCopy */ "../node_modules/bpmn-js/lib/features/copy-paste/ModdleCopy.js"); - module.exports = function(group, element, bpmnFactory, compensateEventDefinition, elementRegistry, translate) { - group.entries.push(entryFactory.checkbox({ - id: 'wait-for-completion', - label: translate('Wait for Completion'), - modelProperty: 'waitForCompletion', - get: function(element, node) { - return { - waitForCompletion: compensateEventDefinition.waitForCompletion - }; - }, - set: function(element, values) { - values.waitForCompletion = values.waitForCompletion || false; - return cmdHelper.updateBusinessObject(element, compensateEventDefinition, values); - } - })); +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ + __depends__: [ + diagram_js_lib_features_copy_paste__WEBPACK_IMPORTED_MODULE_0__["default"] + ], + __init__: [ 'bpmnCopyPaste', 'moddleCopy' ], + bpmnCopyPaste: [ 'type', _BpmnCopyPaste__WEBPACK_IMPORTED_MODULE_1__["default"] ], + moddleCopy: [ 'type', _ModdleCopy__WEBPACK_IMPORTED_MODULE_2__["default"] ] +}); - group.entries.push(entryFactory.selectBox({ - id: 'activity-ref', - label: translate('Activity Ref'), - selectOptions: createActivityRefOptions(element), - modelProperty: 'activityRef', - - get: function(element, node) { - var activityRef = compensateEventDefinition.activityRef; - activityRef = activityRef && activityRef.id; - return { - activityRef: activityRef || '' - }; - }, - set: function(element, values) { - var activityRef = values.activityRef || undefined; - activityRef = activityRef && getBusinessObject(elementRegistry.get(activityRef)); - return cmdHelper.updateBusinessObject(element, compensateEventDefinition, { - activityRef: activityRef - }); - } - })); +/***/ }), - }; +/***/ "../node_modules/bpmn-js/lib/features/di-ordering/BpmnDiOrdering.js": +/*!**************************************************************************!*\ + !*** ../node_modules/bpmn-js/lib/features/di-ordering/BpmnDiOrdering.js ***! + \**************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - },{"../../../../Utils":5,"../../../../factory/EntryFactory":14,"../../../../helper/CmdHelper":25,"../../../../helper/EventDefinitionHelper":27,"bpmn-js/lib/util/ModelUtil":240,"lodash/filter":609,"lodash/find":610,"lodash/forEach":613}],42:[function(require,module,exports){ - 'use strict'; +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ BpmnDiOrdering) +/* harmony export */ }); +/* harmony import */ var _util_ModelUtil__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../util/ModelUtil */ "../node_modules/bpmn-js/lib/util/ModelUtil.js"); +/* harmony import */ var min_dash__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! min-dash */ "../node_modules/min-dash/dist/index.esm.js"); +/* harmony import */ var diagram_js_lib_util_Elements__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! diagram-js/lib/util/Elements */ "../node_modules/diagram-js/lib/util/Elements.js"); - var entryFactory = require('../../../../factory/EntryFactory'), - cmdHelper = require('../../../../helper/CmdHelper'); - var is = require('bpmn-js/lib/util/ModelUtil').is, - isEventSubProcess = require('bpmn-js/lib/util/DiUtil').isEventSubProcess; - module.exports = function(group, element, bpmnFactory, conditionalEventDefinition, elementRegistry, translate) { - var getValue = function(modelProperty) { - return function(element) { - var modelPropertyValue = conditionalEventDefinition.get('camunda:' + modelProperty); - var value = {}; - value[modelProperty] = modelPropertyValue; - return value; - }; - }; - var setValue = function(modelProperty) { - return function(element, values) { - var props = {}; +/** + * @typedef {import('diagram-js/lib/core/EventBus').default} EventBus + * @typedef {import('diagram-js/lib/core/Canvas').default} Canvas + */ - props['camunda:' + modelProperty] = values[modelProperty] || undefined; +var HIGH_PRIORITY = 2000; - return cmdHelper.updateBusinessObject(element, conditionalEventDefinition, props); - }; - }; +/** + * @param {EventBus} eventBus + * @param {Canvas} canvas + */ +function BpmnDiOrdering(eventBus, canvas) { - group.entries.push(entryFactory.textField({ - id: 'variableName', - label: translate('Variable Name'), - modelProperty : 'variableName', + eventBus.on('saveXML.start', HIGH_PRIORITY, orderDi); - get: getValue('variableName'), - set: setValue('variableName') - })); + function orderDi() { + var rootElements = canvas.getRootElements(); - var isConditionalStartEvent = - is(element, 'bpmn:StartEvent') && !isEventSubProcess(element.parent); + (0,min_dash__WEBPACK_IMPORTED_MODULE_0__.forEach)(rootElements, function(root) { + var rootDi = (0,_util_ModelUtil__WEBPACK_IMPORTED_MODULE_1__.getDi)(root), + elements, + diElements; - if (!isConditionalStartEvent) { - group.entries.push(entryFactory.textField({ - id: 'variableEvent', - label: translate('Variable Event'), - description: translate('Specify more than one variable change event as a comma separated list.'), - modelProperty : 'variableEvent', + elements = (0,diagram_js_lib_util_Elements__WEBPACK_IMPORTED_MODULE_2__.selfAndAllChildren)([ root ], false); - get: getValue('variableEvent'), - set: setValue('variableEvent') - })); - } - }; + // only bpmndi:Shape and bpmndi:Edge can be direct children of bpmndi:Plane + elements = (0,min_dash__WEBPACK_IMPORTED_MODULE_0__.filter)(elements, function(element) { + return element !== root && !element.labelTarget; + }); - },{"../../../../factory/EntryFactory":14,"../../../../helper/CmdHelper":25,"bpmn-js/lib/util/DiUtil":238,"bpmn-js/lib/util/ModelUtil":240}],43:[function(require,module,exports){ - 'use strict'; + diElements = (0,min_dash__WEBPACK_IMPORTED_MODULE_0__.map)(elements, _util_ModelUtil__WEBPACK_IMPORTED_MODULE_1__.getDi); - var entryFactory = require('../../../../factory/EntryFactory'); + rootDi.set('planeElement', diElements); + }); + } +} - var cmdHelper = require('../../../../helper/CmdHelper'); +BpmnDiOrdering.$inject = [ 'eventBus', 'canvas' ]; - /** - * Create an entry to modify a property of an element which - * is referenced by a event definition. - * - * @param {djs.model.Base} element - * @param {ModdleElement} definition - * @param {BpmnFactory} bpmnFactory - * @param {Object} options - * @param {string} options.id the id of the entry - * @param {string} options.label the label of the entry - * @param {string} options.referenceProperty the name of referencing property - * @param {string} options.modelProperty the name of property to modify - * @param {string} options.shouldValidate a flag indicate whether to validate or not - * - * @return {Array} return an array containing the entries - */ - module.exports = function(element, definition, bpmnFactory, options) { - - var id = options.id || 'element-property'; - var label = options.label; - var referenceProperty = options.referenceProperty; - var modelProperty = options.modelProperty || 'name'; - var shouldValidate = options.shouldValidate || false; - - var entry = entryFactory.textField({ - id: id, - label: label, - modelProperty: modelProperty, - - get: function(element, node) { - var reference = definition.get(referenceProperty); - var props = {}; - props[modelProperty] = reference && reference.get(modelProperty); - return props; - }, - set: function(element, values, node) { - var reference = definition.get(referenceProperty); - var props = {}; - props[modelProperty] = values[modelProperty] || undefined; - return cmdHelper.updateBusinessObject(element, reference, props); - }, +/***/ }), - hidden: function(element, node) { - return !definition.get(referenceProperty); - } - }); +/***/ "../node_modules/bpmn-js/lib/features/di-ordering/index.js": +/*!*****************************************************************!*\ + !*** ../node_modules/bpmn-js/lib/features/di-ordering/index.js ***! + \*****************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - if (shouldValidate) { - entry.validate = function(element, values, node) { - var reference = definition.get(referenceProperty); - if (reference && !values[modelProperty]) { - var validationErrors = {}; - validationErrors[modelProperty] = 'Must provide a value'; - return validationErrors; - } - }; - } +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _di_ordering_BpmnDiOrdering__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../di-ordering/BpmnDiOrdering */ "../node_modules/bpmn-js/lib/features/di-ordering/BpmnDiOrdering.js"); - return [ entry ]; - }; - },{"../../../../factory/EntryFactory":14,"../../../../helper/CmdHelper":25}],44:[function(require,module,exports){ - 'use strict'; +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ + __init__: [ + 'bpmnDiOrdering' + ], + bpmnDiOrdering: [ 'type', _di_ordering_BpmnDiOrdering__WEBPACK_IMPORTED_MODULE_0__["default"] ] +}); - var eventDefinitionReference = require('./EventDefinitionReference'), - elementReferenceProperty = require('./ElementReferenceProperty'); +/***/ }), +/***/ "../node_modules/bpmn-js/lib/features/distribute-elements/BpmnDistributeElements.js": +/*!******************************************************************************************!*\ + !*** ../node_modules/bpmn-js/lib/features/distribute-elements/BpmnDistributeElements.js ***! + \******************************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - module.exports = function(group, element, bpmnFactory, errorEventDefinition, translate) { +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ BpmnDistributeElements) +/* harmony export */ }); +/* harmony import */ var inherits_browser__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! inherits-browser */ "../node_modules/inherits-browser/dist/index.es.js"); +/* harmony import */ var diagram_js_lib_features_rules_RuleProvider__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! diagram-js/lib/features/rules/RuleProvider */ "../node_modules/diagram-js/lib/features/rules/RuleProvider.js"); +/* harmony import */ var diagram_js_lib_util_Elements__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! diagram-js/lib/util/Elements */ "../node_modules/diagram-js/lib/util/Elements.js"); +/* harmony import */ var min_dash__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! min-dash */ "../node_modules/min-dash/dist/index.esm.js"); +/* harmony import */ var _modeling_util_ModelingUtil__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../modeling/util/ModelingUtil */ "../node_modules/bpmn-js/lib/util/ModelUtil.js"); - group.entries = group.entries.concat(eventDefinitionReference(element, errorEventDefinition, bpmnFactory, { - label: translate('Error'), - elementName: 'error', - elementType: 'bpmn:Error', - referenceProperty: 'errorRef', - newElementIdPrefix: 'Error_' - })); - group.entries = group.entries.concat(elementReferenceProperty(element, errorEventDefinition, bpmnFactory, { - id: 'error-element-name', - label: translate('Error Name'), - referenceProperty: 'errorRef', - modelProperty: 'name', - shouldValidate: true - })); - group.entries = group.entries.concat(elementReferenceProperty(element, errorEventDefinition, bpmnFactory, { - id: 'error-element-code', - label: translate('Error Code'), - referenceProperty: 'errorRef', - modelProperty: 'errorCode' - })); - }; - },{"./ElementReferenceProperty":43,"./EventDefinitionReference":46}],45:[function(require,module,exports){ - 'use strict'; - var entryFactory = require('../../../../factory/EntryFactory'), - cmdHelper = require('../../../../helper/CmdHelper'); +/** + * @typedef {import('diagram-js/lib/core/EventBus').default} EventBus + */ - var eventDefinitionReference = require('./EventDefinitionReference'), - elementReferenceProperty = require('./ElementReferenceProperty'); +/** + * Registers element exclude filters for elements that currently do not support + * distribution. + * + * @param {EventBus} eventBus + */ +function BpmnDistributeElements(eventBus) { + diagram_js_lib_features_rules_RuleProvider__WEBPACK_IMPORTED_MODULE_0__["default"].call(this, eventBus); +} + +BpmnDistributeElements.$inject = [ 'eventBus' ]; + +(0,inherits_browser__WEBPACK_IMPORTED_MODULE_1__["default"])(BpmnDistributeElements, diagram_js_lib_features_rules_RuleProvider__WEBPACK_IMPORTED_MODULE_0__["default"]); + +BpmnDistributeElements.prototype.init = function() { + this.addRule('elements.distribute', function(context) { + var elements = context.elements; + + elements = (0,min_dash__WEBPACK_IMPORTED_MODULE_2__.filter)(elements, function(element) { + var cannotDistribute = (0,_modeling_util_ModelingUtil__WEBPACK_IMPORTED_MODULE_3__.isAny)(element, [ + 'bpmn:Association', + 'bpmn:BoundaryEvent', + 'bpmn:DataInputAssociation', + 'bpmn:DataOutputAssociation', + 'bpmn:Lane', + 'bpmn:MessageFlow', + 'bpmn:SequenceFlow', + 'bpmn:TextAnnotation' + ]); + + return !(element.labelTarget || cannotDistribute); + }); + + // filter out elements which are children of any of the selected elements + elements = (0,diagram_js_lib_util_Elements__WEBPACK_IMPORTED_MODULE_4__.getParents)(elements); + + if (elements.length < 3) { + return false; + } + + return elements; + }); +}; + + +/***/ }), + +/***/ "../node_modules/bpmn-js/lib/features/distribute-elements/DistributeElementsIcons.js": +/*!*******************************************************************************************!*\ + !*** ../node_modules/bpmn-js/lib/features/distribute-elements/DistributeElementsIcons.js ***! + \*******************************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/** + * To change the icons, modify the SVGs in `./resources`, execute `npx svgo -f resources --datauri enc -o dist`, + * and then replace respective icons with the optimized data URIs in `./dist`. + */ +var icons = { + horizontal: ` + + + + `, + vertical: ` + + + + ` +}; + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (icons); + + +/***/ }), + +/***/ "../node_modules/bpmn-js/lib/features/distribute-elements/DistributeElementsMenuProvider.js": +/*!**************************************************************************************************!*\ + !*** ../node_modules/bpmn-js/lib/features/distribute-elements/DistributeElementsMenuProvider.js ***! + \**************************************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ DistributeElementsMenuProvider) +/* harmony export */ }); +/* harmony import */ var _DistributeElementsIcons__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./DistributeElementsIcons */ "../node_modules/bpmn-js/lib/features/distribute-elements/DistributeElementsIcons.js"); +/* harmony import */ var min_dash__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! min-dash */ "../node_modules/min-dash/dist/index.esm.js"); + + + + +/** + * @typedef {import('diagram-js/lib/features/popup-menu/PopupMenu').default} PopupMenu + * @typedef {import('./BpmnDistributeElements').default} DistributeElements + * @typedef {import('diagram-js/lib/i18n/translate/translate').default} Translate + * @typedef {import('diagram-js/lib/features/rules/Rules').default} Rules + * + * @typedef {import('diagram-js/lib/features/popup-menu/PopupMenuProvider').PopupMenuEntries} PopupMenuEntries + * @typedef {import('diagram-js/lib/features/popup-menu/PopupMenuProvider').default} PopupMenuProvider + * @typedef {import('diagram-js/lib/features/popup-menu/PopupMenu').PopupMenuTarget} PopupMenuTarget + */ +var LOW_PRIORITY = 900; - module.exports = function(group, element, bpmnFactory, escalationEventDefinition, showEscalationCodeVariable, translate) { +/** + * A provider for the distribute elements popup menu. + * + * @implements {PopupMenuProvider} + * + * @param {PopupMenu} popupMenu + * @param {DistributeElements} distributeElements + * @param {Translate} translate + * @param {Rules} rules + */ +function DistributeElementsMenuProvider( + popupMenu, distributeElements, translate, rules) { + this._distributeElements = distributeElements; + this._translate = translate; + this._popupMenu = popupMenu; + this._rules = rules; + + popupMenu.registerProvider('align-elements', LOW_PRIORITY, this); +} + +DistributeElementsMenuProvider.$inject = [ + 'popupMenu', + 'distributeElements', + 'translate', + 'rules' +]; + +/** + * @param {PopupMenuTarget} target + * + * @return {PopupMenuEntries} + */ +DistributeElementsMenuProvider.prototype.getPopupMenuEntries = function(target) { + var entries = {}; + + if (this._isAllowed(target)) { + (0,min_dash__WEBPACK_IMPORTED_MODULE_0__.assign)(entries, this._getEntries(target)); + } - group.entries = group.entries.concat(eventDefinitionReference(element, escalationEventDefinition, bpmnFactory, { - label: translate('Escalation'), - elementName: 'escalation', - elementType: 'bpmn:Escalation', - referenceProperty: 'escalationRef', - newElementIdPrefix: 'Escalation_' - })); + return entries; +}; +DistributeElementsMenuProvider.prototype._isAllowed = function(elements) { + return this._rules.allowed('elements.distribute', { elements: elements }); +}; - group.entries = group.entries.concat(elementReferenceProperty(element, escalationEventDefinition, bpmnFactory, { - id: 'escalation-element-name', - label: translate('Escalation Name'), - referenceProperty: 'escalationRef', - modelProperty: 'name', - shouldValidate: true - })); +DistributeElementsMenuProvider.prototype._getEntries = function(elements) { + var distributeElements = this._distributeElements, + translate = this._translate, + popupMenu = this._popupMenu; + var entries = { + 'distribute-elements-horizontal': { + group: 'distribute', + title: translate('Distribute elements horizontally'), + className: 'bjs-align-elements-menu-entry', + imageHtml: _DistributeElementsIcons__WEBPACK_IMPORTED_MODULE_1__["default"]['horizontal'], + action: function(event, entry) { + distributeElements.trigger(elements, 'horizontal'); + popupMenu.close(); + } + }, + 'distribute-elements-vertical': { + group: 'distribute', + title: translate('Distribute elements vertically'), + imageHtml: _DistributeElementsIcons__WEBPACK_IMPORTED_MODULE_1__["default"]['vertical'], + action: function(event, entry) { + distributeElements.trigger(elements, 'vertical'); + popupMenu.close(); + } + }, + }; - group.entries = group.entries.concat(elementReferenceProperty(element, escalationEventDefinition, bpmnFactory, { - id: 'escalation-element-code', - label: translate('Escalation Code'), - referenceProperty: 'escalationRef', - modelProperty: 'escalationCode' - })); + return entries; +}; - if (showEscalationCodeVariable) { - group.entries.push(entryFactory.textField({ - id : 'escalationCodeVariable', - label : translate('Escalation Code Variable'), - modelProperty : 'escalationCodeVariable', +/***/ }), - get: function(element) { - var codeVariable = escalationEventDefinition.get('camunda:escalationCodeVariable'); - return { - escalationCodeVariable: codeVariable - }; - }, +/***/ "../node_modules/bpmn-js/lib/features/distribute-elements/index.js": +/*!*************************************************************************!*\ + !*** ../node_modules/bpmn-js/lib/features/distribute-elements/index.js ***! + \*************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - set: function(element, values) { - return cmdHelper.updateBusinessObject(element, escalationEventDefinition, { - 'camunda:escalationCodeVariable': values.escalationCodeVariable || undefined - }); - } - })); - } - }; +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var diagram_js_lib_features_distribute_elements__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! diagram-js/lib/features/distribute-elements */ "../node_modules/diagram-js/lib/features/distribute-elements/index.js"); +/* harmony import */ var diagram_js_lib_features_popup_menu__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! diagram-js/lib/features/popup-menu */ "../node_modules/diagram-js/lib/features/popup-menu/index.js"); +/* harmony import */ var _BpmnDistributeElements__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./BpmnDistributeElements */ "../node_modules/bpmn-js/lib/features/distribute-elements/BpmnDistributeElements.js"); +/* harmony import */ var _DistributeElementsMenuProvider__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./DistributeElementsMenuProvider */ "../node_modules/bpmn-js/lib/features/distribute-elements/DistributeElementsMenuProvider.js"); - },{"../../../../factory/EntryFactory":14,"../../../../helper/CmdHelper":25,"./ElementReferenceProperty":43,"./EventDefinitionReference":46}],46:[function(require,module,exports){ - 'use strict'; - var cmdHelper = require('../../../../helper/CmdHelper'); - var domQuery = require('min-dom').query, - domify = require('min-dom').domify, - domAttr = require('min-dom').attr; - var forEach = require('lodash/forEach'), - find = require('lodash/find'); - var elementHelper = require('../../../../helper/ElementHelper'); - var utils = require('../../../../Utils'), - escapeHTML = utils.escapeHTML; - var selector = 'select[name=selectedElement]'; - /** - * Get select box containing all elements. - * - * @param {DOMElement} node - * - * @return {DOMElement} the select box - */ - function getSelectBox(node) { - return domQuery(selector, node.parentElement); - } +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ + __depends__: [ + diagram_js_lib_features_popup_menu__WEBPACK_IMPORTED_MODULE_0__["default"], + diagram_js_lib_features_distribute_elements__WEBPACK_IMPORTED_MODULE_1__["default"] + ], + __init__: [ + 'bpmnDistributeElements', + 'distributeElementsMenuProvider' + ], + bpmnDistributeElements: [ 'type', _BpmnDistributeElements__WEBPACK_IMPORTED_MODULE_2__["default"] ], + distributeElementsMenuProvider: [ 'type', _DistributeElementsMenuProvider__WEBPACK_IMPORTED_MODULE_3__["default"] ] +}); - /** - * Find element by given id. - * - * @param {ModdleElement} eventDefinition - * - * @return {ModdleElement} an element - */ - function findElementById(eventDefinition, type, id) { - var elements = utils.findRootElementsByType(eventDefinition, type); - return find(elements, function(element) { - return element.id === id; - }); - } - /** - * Create an entry to modify the reference to an element from an - * event definition. - * - * @param {djs.model.Base} element - * @param {ModdleElement} definition - * @param {BpmnFactory} bpmnFactory - * @param {Object} options - * @param {string} options.label the label of the entry - * @param {string} options.description the description of the entry - * @param {string} options.elementName the name of the element - * @param {string} options.elementType the type of the element - * @param {string} options.referenceProperty the name of referencing property - * @param {string} options.newElementIdPrefix the prefix of a new created element - * - * @return {Array} return an array containing the entries - */ - module.exports = function(element, definition, bpmnFactory, options) { - - var elementName = options.elementName || '', - elementType = options.elementType, - referenceProperty = options.referenceProperty; - - var newElementIdPrefix = options.newElementIdPrefix || 'elem_'; - - var label = options.label || '', - description = options.description || ''; - - var entries = []; - - entries.push({ - - id: 'event-definitions-' + elementName, - description: description, - html: '
' + - '' + - '
' + - '' + - '' + - '
' + - '
', - - get: function(element, entryNode) { - utils.updateOptionsDropDown(selector, definition, elementType, entryNode); - var reference = definition.get(referenceProperty); - return { - selectedElement: (reference && reference.id) || '' - }; - }, +/***/ }), - set: function(element, values) { - var selection = values.selectedElement; +/***/ "../node_modules/bpmn-js/lib/features/drilldown/DrilldownBreadcrumbs.js": +/*!******************************************************************************!*\ + !*** ../node_modules/bpmn-js/lib/features/drilldown/DrilldownBreadcrumbs.js ***! + \******************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - var props = {}; +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ DrilldownBreadcrumbs) +/* harmony export */ }); +/* harmony import */ var min_dom__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! min-dom */ "../node_modules/min-dom/dist/index.esm.js"); +/* harmony import */ var min_dash__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! min-dash */ "../node_modules/min-dash/dist/index.esm.js"); +/* harmony import */ var diagram_js_lib_util_EscapeUtil__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! diagram-js/lib/util/EscapeUtil */ "../node_modules/diagram-js/lib/util/EscapeUtil.js"); +/* harmony import */ var _util_ModelUtil__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../util/ModelUtil */ "../node_modules/bpmn-js/lib/util/ModelUtil.js"); +/* harmony import */ var _util_DrilldownUtil__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../util/DrilldownUtil */ "../node_modules/bpmn-js/lib/util/DrilldownUtil.js"); - if (!selection || typeof selection === 'undefined') { - // remove reference to element - props[referenceProperty] = undefined; - return cmdHelper.updateBusinessObject(element, definition, props); - } - var commands = []; - var selectedElement = findElementById(definition, elementType, selection); - if (!selectedElement) { - var root = utils.getRoot(definition); - // create a new element - selectedElement = elementHelper.createElement(elementType, { name: selection }, root, bpmnFactory); - commands.push(cmdHelper.addAndRemoveElementsFromList(element, root, 'rootElements', null, [ selectedElement ])); - } - // update reference to element - props[referenceProperty] = selectedElement; - commands.push(cmdHelper.updateBusinessObject(element, definition, props)); - return commands; - }, - addElement: function(element, inputNode) { - // note: this generated id will be used as name - // of the element and not as id - var id = utils.nextId(newElementIdPrefix); +/** + * @typedef {import('diagram-js/lib/core/Canvas').default} Canvas + * @typedef {import('diagram-js/lib/core/ElementRegistry').default} ElementRegistry + * @typedef {import('diagram-js/lib/core/EventBus').default} EventBus + * + * @typedef {import('../../model/Types').Element} Element + * @typedef {import('../../model/Types').Shape} Shape + */ - var optionTemplate = domify(''); +var OPEN_CLASS = 'bjs-breadcrumbs-shown'; - // add new option - var selectBox = getSelectBox(inputNode); - selectBox.insertBefore(optionTemplate, selectBox.firstChild); - // select new element in the select box - forEach(selectBox, function(option) { - if (option.value === id) { - domAttr(option, 'selected', 'selected'); - } else { - domAttr(option, 'selected', null); - } - }); +/** + * Adds overlays that allow switching planes on collapsed subprocesses. + * + * @param {EventBus} eventBus + * @param {ElementRegistry} elementRegistry + * @param {Canvas} canvas + */ +function DrilldownBreadcrumbs(eventBus, elementRegistry, canvas) { + var breadcrumbs = (0,min_dom__WEBPACK_IMPORTED_MODULE_0__.domify)('
    '); + var container = canvas.getContainer(); + var containerClasses = (0,min_dom__WEBPACK_IMPORTED_MODULE_0__.classes)(container); + container.appendChild(breadcrumbs); - return true; - } + var businessObjectParents = []; - }); + // update breadcrumbs if name or ID of the primary shape changes + eventBus.on('element.changed', function(event) { + var shape = event.element, + businessObject = (0,_util_ModelUtil__WEBPACK_IMPORTED_MODULE_1__.getBusinessObject)(shape); - return entries; + var isPresent = (0,min_dash__WEBPACK_IMPORTED_MODULE_2__.find)(businessObjectParents, function(element) { + return element === businessObject; + }); - }; + if (!isPresent) { + return; + } - },{"../../../../Utils":5,"../../../../helper/CmdHelper":25,"../../../../helper/ElementHelper":26,"lodash/find":610,"lodash/forEach":613,"min-dom":647}],47:[function(require,module,exports){ - 'use strict'; + updateBreadcrumbs(); + }); - var eventDefinitionReference = require('./EventDefinitionReference'), - elementReferenceProperty = require('./ElementReferenceProperty'); + /** + * Updates the displayed breadcrumbs. If no element is provided, only the + * labels are updated. + * + * @param {Element} [element] + */ + function updateBreadcrumbs(element) { + if (element) { + businessObjectParents = getBusinessObjectParentChain(element); + } + var path = businessObjectParents.map(function(parent) { + var title = (0,diagram_js_lib_util_EscapeUtil__WEBPACK_IMPORTED_MODULE_3__.escapeHTML)(parent.name || parent.id); + var link = (0,min_dom__WEBPACK_IMPORTED_MODULE_0__.domify)('
  • ' + title + '
  • '); - module.exports = function(group, element, bpmnFactory, messageEventDefinition, translate) { + var parentPlane = canvas.findRoot((0,_util_DrilldownUtil__WEBPACK_IMPORTED_MODULE_4__.getPlaneIdFromShape)(parent)) || canvas.findRoot(parent.id); - group.entries = group.entries.concat(eventDefinitionReference(element, messageEventDefinition, bpmnFactory, { - label: translate('Message'), - elementName: 'message', - elementType: 'bpmn:Message', - referenceProperty: 'messageRef', - newElementIdPrefix: 'Message_' - })); + // when the root is a collaboration, the process does not have a corresponding + // element in the elementRegisty. Instead, we search for the corresponding participant + if (!parentPlane && (0,_util_ModelUtil__WEBPACK_IMPORTED_MODULE_1__.is)(parent, 'bpmn:Process')) { + var participant = elementRegistry.find(function(element) { + var businessObject = (0,_util_ModelUtil__WEBPACK_IMPORTED_MODULE_1__.getBusinessObject)(element); + return businessObject && businessObject.get('processRef') && businessObject.get('processRef') === parent; + }); - group.entries = group.entries.concat(elementReferenceProperty(element, messageEventDefinition, bpmnFactory, { - id: 'message-element-name', - label: translate('Message Name'), - referenceProperty: 'messageRef', - modelProperty: 'name', - shouldValidate: true - })); + parentPlane = canvas.findRoot(participant.id); + } - }; + link.addEventListener('click', function() { + canvas.setRootElement(parentPlane); + }); - },{"./ElementReferenceProperty":43,"./EventDefinitionReference":46}],48:[function(require,module,exports){ - 'use strict'; + return link; + }); - var entryFactory = require('../../../../factory/EntryFactory'); + breadcrumbs.innerHTML = ''; - /** - * Create an entry to modify the name of an an element. - * - * @param {djs.model.Base} element - * @param {Object} options - * @param {string} options.id the id of the entry - * @param {string} options.label the label of the entry - * - * @return {Array} return an array containing - * the entry to modify the name - */ - module.exports = function(element, options, translate) { - - options = options || {}; - var id = options.id || 'name', - label = options.label || translate('Name'), - modelProperty = options.modelProperty || 'name'; - - var nameEntry = entryFactory.textBox({ - id: id, - label: label, - modelProperty: modelProperty, - get: options.get, - set: options.set - }); + // show breadcrumbs and expose state to .djs-container + var visible = path.length > 1; - return [ nameEntry ]; + containerClasses.toggle(OPEN_CLASS, visible); - }; + path.forEach(function(element) { + breadcrumbs.appendChild(element); + }); + } - },{"../../../../factory/EntryFactory":14}],49:[function(require,module,exports){ - 'use strict'; + eventBus.on('root.set', function(event) { + updateBreadcrumbs(event.element); + }); - var eventDefinitionReference = require('./EventDefinitionReference'), - elementReferenceProperty = require('./ElementReferenceProperty'); +} +DrilldownBreadcrumbs.$inject = [ 'eventBus', 'elementRegistry', 'canvas' ]; - module.exports = function(group, element, bpmnFactory, signalEventDefinition, translate) { - group.entries = group.entries.concat(eventDefinitionReference(element, signalEventDefinition, bpmnFactory, { - label: translate('Signal'), - elementName: 'signal', - elementType: 'bpmn:Signal', - referenceProperty: 'signalRef', - newElementIdPrefix: 'Signal_' - })); +// helpers ////////// +/** + * Returns the parents for the element using the business object chain, + * starting with the root element. + * + * @param {Shape} child + * + * @return {Shape} + */ +function getBusinessObjectParentChain(child) { + var businessObject = (0,_util_ModelUtil__WEBPACK_IMPORTED_MODULE_1__.getBusinessObject)(child); - group.entries = group.entries.concat(elementReferenceProperty(element, signalEventDefinition, bpmnFactory, { - id: 'signal-element-name', - label: translate('Signal Name'), - referenceProperty: 'signalRef', - modelProperty: 'name', - shouldValidate: true - })); + var parents = []; - }; + for (var element = businessObject; element; element = element.$parent) { + if ((0,_util_ModelUtil__WEBPACK_IMPORTED_MODULE_1__.is)(element, 'bpmn:SubProcess') || (0,_util_ModelUtil__WEBPACK_IMPORTED_MODULE_1__.is)(element, 'bpmn:Process')) { + parents.push(element); + } + } - },{"./ElementReferenceProperty":43,"./EventDefinitionReference":46}],50:[function(require,module,exports){ - 'use strict'; + return parents.reverse(); +} - var elementHelper = require('../../../../helper/ElementHelper'), - cmdHelper = require('../../../../helper/CmdHelper'); +/***/ }), - var entryFactory = require('../../../../factory/EntryFactory'); +/***/ "../node_modules/bpmn-js/lib/features/drilldown/DrilldownCentering.js": +/*!****************************************************************************!*\ + !*** ../node_modules/bpmn-js/lib/features/drilldown/DrilldownCentering.js ***! + \****************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - /** - * Get the timer definition type for a given timer event definition. - * - * @param {ModdleElement} timer - * - * @return {string|undefined} the timer definition type - */ - function getTimerDefinitionType(timer) { +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ DrilldownCentering) +/* harmony export */ }); +/* harmony import */ var _util_ModelUtil__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../util/ModelUtil */ "../node_modules/bpmn-js/lib/util/ModelUtil.js"); - if (!timer) { - return; - } - var timeDate = timer.get('timeDate'); - if (typeof timeDate !== 'undefined') { - return 'timeDate'; - } +/** + * @typedef {import('diagram-js/lib/core/Canvas').default} Canvas + * @typedef {import('diagram-js/lib/core/EventBus').default} EventBus + */ - var timeCycle = timer.get('timeCycle'); - if (typeof timeCycle !== 'undefined') { - return 'timeCycle'; - } +/** + * Move collapsed subprocesses into view when drilling down. + * + * Zoom and scroll are saved in a session. + * + * @param {EventBus} eventBus + * @param {Canvas} canvas + */ +function DrilldownCentering(eventBus, canvas) { - var timeDuration = timer.get('timeDuration'); - if (typeof timeDuration !== 'undefined') { - return 'timeDuration'; - } - } + var currentRoot = null; + var positionMap = new Map(); - /** - * Get the actual timer event definition based on option, whether it's a getter - * to fetch the timer event definition or the exact event definition itself - * - * @param {ModdleElement|Function} timerOrFunction - * @param {Shape} element - * @param {HTMLElement} node - * - * @return ModdleElement - */ - function getTimerDefinition(timerOrFunction, element, node) { - if (typeof timerOrFunction === 'function') { - return timerOrFunction(element, node); - } + eventBus.on('root.set', function(event) { + var newRoot = event.element; + var currentViewbox = canvas.viewbox(); + var storedViewbox = positionMap.get(newRoot); - return timerOrFunction; - } + positionMap.set(currentRoot, { + x: currentViewbox.x, + y: currentViewbox.y, + zoom: currentViewbox.scale + }); - /** - * Creates 'bpmn:FormalExpression' element. - * - * @param {ModdleElement} parent - * @param {string} body - * @param {BpmnFactory} bpmnFactory - * - * @return {ModdleElement} a formal expression - */ - function createFormalExpression(parent, body, bpmnFactory) { - body = body || undefined; - return elementHelper.createElement('bpmn:FormalExpression', { body: body }, parent, bpmnFactory); - } + currentRoot = newRoot; - function TimerEventDefinition(group, element, bpmnFactory, timerEventDefinition, translate, options) { + // current root was replaced with a collaboration, we don't update the viewbox + if ((0,_util_ModelUtil__WEBPACK_IMPORTED_MODULE_0__.is)(newRoot, 'bpmn:Collaboration') && !storedViewbox) { + return; + } - var selectOptions = [ - { value: 'timeDate', name: translate('Date') }, - { value: 'timeDuration', name: translate('Duration') }, - { value: 'timeCycle', name: translate('Cycle') } - ]; + storedViewbox = storedViewbox || { x: 0, y: 0, zoom: 1 }; - var prefix = options && options.idPrefix, - createTimerEventDefinition = options && options.createTimerEventDefinition; + var dx = (currentViewbox.x - storedViewbox.x) * currentViewbox.scale, + dy = (currentViewbox.y - storedViewbox.y) * currentViewbox.scale; + if (dx !== 0 || dy !== 0) { + canvas.scroll({ + dx: dx, + dy: dy + }); + } - group.entries.push(entryFactory.selectBox({ - id: prefix + 'timer-event-definition-type', - label: translate('Timer Definition Type'), - selectOptions: selectOptions, - emptyParameter: true, - modelProperty: 'timerDefinitionType', + if (storedViewbox.zoom !== currentViewbox.scale) { + canvas.zoom(storedViewbox.zoom, { x: 0, y: 0 }); + } + }); - get: function(element, node) { - var timerDefinition = getTimerDefinition(timerEventDefinition, element, node); + eventBus.on('diagram.clear', function() { + positionMap.clear(); + currentRoot = null; + }); - return { - timerDefinitionType: getTimerDefinitionType(timerDefinition) || '' - }; - }, +} - set: function(element, values, node) { - var props = { - timeDuration: undefined, - timeDate: undefined, - timeCycle: undefined - }; +DrilldownCentering.$inject = [ 'eventBus', 'canvas' ]; - var timerDefinition = getTimerDefinition(timerEventDefinition, element, node), - newType = values.timerDefinitionType; +/** + * ES5 Map implementation. Works. + */ +function Map() { - if (!timerDefinition && typeof createTimerEventDefinition === 'function') { - timerDefinition = createTimerEventDefinition(element, node); - } + this._entries = []; - if (values.timerDefinitionType) { - var oldType = getTimerDefinitionType(timerDefinition); + this.set = function(key, value) { - var value; - if (oldType) { - var definition = timerDefinition.get(oldType); - value = definition.get('body'); - } + var found = false; - props[newType] = createFormalExpression(timerDefinition, value, bpmnFactory); - } + for (var k in this._entries) { + if (this._entries[k][0] === key) { + this._entries[k][1] = value; - return cmdHelper.updateBusinessObject(element, timerDefinition, props); - }, + found = true; - hidden: function(element, node) { - return getTimerDefinition(timerEventDefinition, element, node) === undefined; - } + break; + } + } - })); + if (!found) { + this._entries.push([ key, value ]); + } + }; + this.get = function(key) { - group.entries.push(entryFactory.textField({ - id: prefix + 'timer-event-definition', - label: translate('Timer Definition'), - modelProperty: 'timerDefinition', + for (var k in this._entries) { + if (this._entries[k][0] === key) { + return this._entries[k][1]; + } + } - get: function(element, node) { - var timerDefinition = getTimerDefinition(timerEventDefinition, element, node), - type = getTimerDefinitionType(timerDefinition), - definition = type && timerDefinition.get(type), - value = definition && definition.get('body'); + return null; + }; - return { - timerDefinition: value - }; - }, + this.clear = function() { + this._entries.length = 0; + }; - set: function(element, values, node) { - var timerDefinition = getTimerDefinition(timerEventDefinition, element, node), - type = getTimerDefinitionType(timerDefinition), - definition = type && timerDefinition.get(type); + this.remove = function(key) { - if (definition) { - return cmdHelper.updateBusinessObject(element, definition, { - body: values.timerDefinition || undefined - }); - } - }, + var idx = -1; - validate: function(element, node) { - var timerDefinition = getTimerDefinition(timerEventDefinition, element, node), - type = getTimerDefinitionType(timerDefinition), - definition = type && timerDefinition.get(type); - - if (definition) { - var value = definition.get('body'); - if (!value) { - return { - timerDefinition: translate('Must provide a value') - }; - } - } - }, + for (var k in this._entries) { + if (this._entries[k][0] === key) { + idx = k; - hidden: function(element, node) { - var timerDefinition = getTimerDefinition(timerEventDefinition, element, node); + break; + } + } - return !getTimerDefinitionType(timerDefinition); - } + if (idx !== -1) { + this._entries.splice(idx, 1); + } + }; +} - })); +/***/ }), - } +/***/ "../node_modules/bpmn-js/lib/features/drilldown/DrilldownOverlayBehavior.js": +/*!**********************************************************************************!*\ + !*** ../node_modules/bpmn-js/lib/features/drilldown/DrilldownOverlayBehavior.js ***! + \**********************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - module.exports = TimerEventDefinition; +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ DrilldownOverlayBehavior) +/* harmony export */ }); +/* harmony import */ var inherits_browser__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! inherits-browser */ "../node_modules/inherits-browser/dist/index.es.js"); +/* harmony import */ var diagram_js_lib_command_CommandInterceptor__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! diagram-js/lib/command/CommandInterceptor */ "../node_modules/diagram-js/lib/command/CommandInterceptor.js"); +/* harmony import */ var _util_ModelUtil__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../util/ModelUtil */ "../node_modules/bpmn-js/lib/util/ModelUtil.js"); +/* harmony import */ var min_dom__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! min-dom */ "../node_modules/min-dom/dist/index.esm.js"); +/* harmony import */ var _util_DrilldownUtil__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../util/DrilldownUtil */ "../node_modules/bpmn-js/lib/util/DrilldownUtil.js"); - },{"../../../../factory/EntryFactory":14,"../../../../helper/CmdHelper":25,"../../../../helper/ElementHelper":26}],51:[function(require,module,exports){ - 'use strict'; - var inherits = require('inherits'); - var PropertiesActivator = require('../../PropertiesActivator'); - var asyncCapableHelper = require('../../helper/AsyncCapableHelper'), - ImplementationTypeHelper = require('../../helper/ImplementationTypeHelper'); - var is = require('bpmn-js/lib/util/ModelUtil').is; -// bpmn properties - var processProps = require('../bpmn/parts/ProcessProps'), - eventProps = require('../bpmn/parts/EventProps'), - linkProps = require('../bpmn/parts/LinkProps'), - documentationProps = require('../bpmn/parts/DocumentationProps'), - idProps = require('../bpmn/parts/IdProps'), - nameProps = require('../bpmn/parts/NameProps'), - executableProps = require('../bpmn/parts/ExecutableProps'); -// camunda properties - var serviceTaskDelegateProps = require('./parts/ServiceTaskDelegateProps'), - userTaskProps = require('./parts/UserTaskProps'), - asynchronousContinuationProps = require('./parts/AsynchronousContinuationProps'), - callActivityProps = require('./parts/CallActivityProps'), - multiInstanceProps = require('./parts/MultiInstanceLoopProps'), - conditionalProps = require('./parts/ConditionalProps'), - scriptProps = require('./parts/ScriptTaskProps'), - errorProps = require('./parts/ErrorEventProps'), - formProps = require('./parts/FormProps'), - startEventInitiator = require('./parts/StartEventInitiator'), - variableMapping = require('./parts/VariableMappingProps'), - versionTag = require('./parts/VersionTagProps'); +/** + * @typedef {import('diagram-js/lib/core/Canvas').default} Canvas + * @typedef {import('diagram-js/lib/core/ElementRegistry').default} ElementRegistry + * @typedef {import('diagram-js/lib/core/EventBus').default} EventBus + * @typedef {import('diagram-js/lib/features/overlays/Overlays').default} Overlays + * + * @typedef {import('../../model/Types').Element} Element + * @typedef {import('../../model/Types').Parent} Parent + * @typedef {import('../../model/Types').Shape} Shape + */ - var listenerProps = require('./parts/ListenerProps'), - listenerDetails = require('./parts/ListenerDetailProps'), - listenerFields = require('./parts/ListenerFieldInjectionProps'); +var LOW_PRIORITY = 250; +var ARROW_DOWN_SVG = ''; - var elementTemplateChooserProps = require('./element-templates/parts/ChooserProps'), - elementTemplateCustomProps = require('./element-templates/parts/CustomProps'); +var EMPTY_MARKER = 'bjs-drilldown-empty'; -// Input/Output - var inputOutput = require('./parts/InputOutputProps'), - inputOutputParameter = require('./parts/InputOutputParameterProps'); +/** + * @param {Canvas} canvas + * @param {EventBus} eventBus + * @param {ElementRegistry} elementRegistry + * @param {Overlays} overlays + */ +function DrilldownOverlayBehavior( + canvas, eventBus, elementRegistry, overlays +) { + diagram_js_lib_command_CommandInterceptor__WEBPACK_IMPORTED_MODULE_0__["default"].call(this, eventBus); + + this._canvas = canvas; + this._eventBus = eventBus; + this._elementRegistry = elementRegistry; + this._overlays = overlays; + + var self = this; + + this.executed('shape.toggleCollapse', LOW_PRIORITY, function(context) { + var shape = context.shape; + + // Add overlay to the collapsed shape + if (self._canDrillDown(shape)) { + self._addOverlay(shape); + } else { + self._removeOverlay(shape); + } + }, true); + + + this.reverted('shape.toggleCollapse', LOW_PRIORITY, function(context) { + var shape = context.shape; + + // Add overlay to the collapsed shape + if (self._canDrillDown(shape)) { + self._addOverlay(shape); + } else { + self._removeOverlay(shape); + } + }, true); + + + this.executed([ 'shape.create', 'shape.move', 'shape.delete' ], LOW_PRIORITY, + function(context) { + var oldParent = context.oldParent, + newParent = context.newParent || context.parent, + shape = context.shape; + + // Add overlay to the collapsed 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_PRIORITY, + function(context) { + var oldParent = context.oldParent, + newParent = context.newParent || context.parent, + shape = context.shape; + + // Add overlay to the collapsed 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(e) { + return self._canDrillDown(e); + }).map(function(el) { + self._addOverlay(el); + }); + }); + +} + +(0,inherits_browser__WEBPACK_IMPORTED_MODULE_1__["default"])(DrilldownOverlayBehavior, diagram_js_lib_command_CommandInterceptor__WEBPACK_IMPORTED_MODULE_0__["default"]); + +/** + * @param {Shape} shape + */ +DrilldownOverlayBehavior.prototype._updateDrilldownOverlay = function(shape) { + var canvas = this._canvas; -// Connector - var connectorDetails = require('./parts/ConnectorDetailProps'), - connectorInputOutput = require('./parts/ConnectorInputOutputProps'), - connectorInputOutputParameter = require('./parts/ConnectorInputOutputParameterProps'); + if (!shape) { + return; + } -// properties - var properties = require('./parts/PropertiesProps'); + var root = canvas.findRoot(shape); -// job configuration - var jobConfiguration = require('./parts/JobConfigurationProps'); + if (root) { + this._updateOverlayVisibility(root); + } +}; -// history time to live - var historyTimeToLive = require('./parts/HistoryTimeToLiveProps'); +/** + * @param {Element} element + * + * @return {boolean} + */ +DrilldownOverlayBehavior.prototype._canDrillDown = function(element) { + var canvas = this._canvas; -// candidate starter groups/users - var candidateStarter = require('./parts/CandidateStarterProps'); + return (0,_util_ModelUtil__WEBPACK_IMPORTED_MODULE_2__.is)(element, 'bpmn:SubProcess') && canvas.findRoot((0,_util_DrilldownUtil__WEBPACK_IMPORTED_MODULE_3__.getPlaneIdFromShape)(element)); +}; -// tasklist - var tasklist = require('./parts/TasklistProps'); +/** + * Update the visibility of the drilldown overlay. If the plane has no elements, + * the drilldown will only be shown when the element is selected. + * + * @param {Parent} element The collapsed root or shape. + */ +DrilldownOverlayBehavior.prototype._updateOverlayVisibility = function(element) { + var overlays = this._overlays; -// external task configuration - var externalTaskConfiguration = require('./parts/ExternalTaskConfigurationProps'); + var businessObject = (0,_util_ModelUtil__WEBPACK_IMPORTED_MODULE_2__.getBusinessObject)(element); -// field injection - var fieldInjections = require('./parts/FieldInjectionProps'); + var overlay = overlays.get({ element: businessObject.id, type: 'drilldown' })[0]; - var getBusinessObject = require('bpmn-js/lib/util/ModelUtil').getBusinessObject, - eventDefinitionHelper = require('../../helper/EventDefinitionHelper'), - implementationTypeHelper = require('../../helper/ImplementationTypeHelper'); + if (!overlay) { + return; + } -// helpers //////////////////////////////////////// + var hasFlowElements = businessObject + && businessObject.get('flowElements') + && businessObject.get('flowElements').length; - var isExternalTaskPriorityEnabled = function(element) { - var businessObject = getBusinessObject(element); + (0,min_dom__WEBPACK_IMPORTED_MODULE_4__.classes)(overlay.html).toggle(EMPTY_MARKER, !hasFlowElements); +}; - // show only if element is a process, a participant ... - if (is(element, 'bpmn:Process') || is(element, 'bpmn:Participant') && businessObject.get('processRef')) { - return true; - } +/** + * Add a drilldown button to the given element assuming the plane has the same + * ID as the element. + * + * @param {Shape} element The collapsed shape. + */ +DrilldownOverlayBehavior.prototype._addOverlay = function(element) { + var canvas = this._canvas, + overlays = this._overlays; - var externalBo = ImplementationTypeHelper.getServiceTaskLikeBusinessObject(element), - isExternalTask = ImplementationTypeHelper.getImplementationType(externalBo) === 'external'; + var existingOverlays = overlays.get({ element: element, type: 'drilldown' }); - // ... or an external task with selected external implementation type - return !!ImplementationTypeHelper.isExternalCapable(externalBo) && isExternalTask; - }; + if (existingOverlays.length) { + this._removeOverlay(element); + } - var isJobConfigEnabled = function(element) { - var businessObject = getBusinessObject(element); + var button = (0,min_dom__WEBPACK_IMPORTED_MODULE_4__.domify)(''); - if (is(element, 'bpmn:Process') || is(element, 'bpmn:Participant') && businessObject.get('processRef')) { - return true; - } + button.addEventListener('click', function() { + canvas.setRootElement(canvas.findRoot((0,_util_DrilldownUtil__WEBPACK_IMPORTED_MODULE_3__.getPlaneIdFromShape)(element))); + }); - // async behavior - var bo = getBusinessObject(element); - if (asyncCapableHelper.isAsyncBefore(bo) || asyncCapableHelper.isAsyncAfter(bo)) { - return true; - } + overlays.add(element, 'drilldown', { + position: { + bottom: -7, + right: -8 + }, + html: button + }); - // timer definition - if (is(element, 'bpmn:Event')) { - return !!eventDefinitionHelper.getTimerEventDefinition(element); - } + this._updateOverlayVisibility(element); +}; - return false; - }; +DrilldownOverlayBehavior.prototype._removeOverlay = function(element) { + var overlays = this._overlays; - var getInputOutputParameterLabel = function(param, translate) { + overlays.remove({ + element: element, + type: 'drilldown' + }); +}; - if (is(param, 'camunda:InputParameter')) { - return translate('Input Parameter'); - } +DrilldownOverlayBehavior.$inject = [ + 'canvas', + 'eventBus', + 'elementRegistry', + 'overlays' +]; - if (is(param, 'camunda:OutputParameter')) { - return translate('Output Parameter'); - } +/***/ }), - return ''; - }; +/***/ "../node_modules/bpmn-js/lib/features/drilldown/SubprocessCompatibility.js": +/*!*********************************************************************************!*\ + !*** ../node_modules/bpmn-js/lib/features/drilldown/SubprocessCompatibility.js ***! + \*********************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - var getListenerLabel = function(param, translate) { +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ SubprocessCompatibility) +/* harmony export */ }); +/* harmony import */ var diagram_js_lib_layout_LayoutUtil__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! diagram-js/lib/layout/LayoutUtil */ "../node_modules/diagram-js/lib/layout/LayoutUtil.js"); +/* harmony import */ var _util_ModelUtil__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../util/ModelUtil */ "../node_modules/bpmn-js/lib/util/ModelUtil.js"); - if (is(param, 'camunda:ExecutionListener')) { - return translate('Execution Listener'); - } - if (is(param, 'camunda:TaskListener')) { - return translate('Task Listener'); - } - return ''; - }; - var PROCESS_KEY_HINT = 'This maps to the process definition key.'; - var TASK_KEY_HINT = 'This maps to the task definition key.'; +/** + * @typedef {import('diagram-js/lib/core/EventBus').default} EventBus + * @typedef {import('../../model/Types').Moddle} Moddle + * + * @typedef {import('../../model/Types').Element} Element + * @typedef {import('../../model/Types').Shape} Shape + * + * @typedef {import('diagram-js/lib/core/Canvas').CanvasPlane} CanvasPlane + * + * @typedef {import('diagram-js/lib/util/Types').Rect} Rect + */ - function createGeneralTabGroups( - element, canvas, bpmnFactory, - elementRegistry, elementTemplates, translate) { +var DEFAULT_POSITION = { + x: 180, + y: 160 +}; - // refer to target element for external labels - element = element.labelTarget || element; +/** + * Hook into `import.render.start` and create new planes for diagrams with + * collapsed subprocesses and all DI elements on the same plane. + * + * @param {EventBus} eventBus + * @param {Moddle} moddle + */ +function SubprocessCompatibility(eventBus, moddle) { + this._eventBus = eventBus; + this._moddle = moddle; - var generalGroup = { - id: 'general', - label: translate('General'), - entries: [] - }; + var self = this; - var idOptions; - var processOptions; + eventBus.on('import.render.start', 1500, function(e, context) { + self._handleImport(context.definitions); + }); +} - if (is(element, 'bpmn:Process')) { - idOptions = { description: PROCESS_KEY_HINT }; - } +/** + * @param {ModdleElement} definitions + */ +SubprocessCompatibility.prototype._handleImport = function(definitions) { + if (!definitions.diagrams) { + return; + } - if (is(element, 'bpmn:UserTask')) { - idOptions = { description: TASK_KEY_HINT }; - } + var self = this; + this._definitions = definitions; + this._processToDiagramMap = {}; - if (is(element, 'bpmn:Participant')) { - processOptions = { processIdDescription: PROCESS_KEY_HINT }; - } + definitions.diagrams.forEach(function(diagram) { + if (!diagram.plane || !diagram.plane.bpmnElement) { + return; + } - idProps(generalGroup, element, translate, idOptions); - nameProps(generalGroup, element, bpmnFactory, canvas, translate); - processProps(generalGroup, element, translate, processOptions); - versionTag(generalGroup, element, translate); - executableProps(generalGroup, element, translate); - elementTemplateChooserProps(generalGroup, element, elementTemplates, translate); + self._processToDiagramMap[diagram.plane.bpmnElement.id] = diagram; + }); - var customFieldsGroups = elementTemplateCustomProps(element, elementTemplates, bpmnFactory, translate); + var newDiagrams = []; + definitions.diagrams.forEach(function(diagram) { + var createdDiagrams = self._createNewDiagrams(diagram.plane); + Array.prototype.push.apply(newDiagrams, createdDiagrams); + }); - var detailsGroup = { - id: 'details', - label: translate('Details'), - entries: [] - }; - serviceTaskDelegateProps(detailsGroup, element, bpmnFactory, translate); - userTaskProps(detailsGroup, element, translate); - scriptProps(detailsGroup, element, bpmnFactory, translate); - linkProps(detailsGroup, element, translate); - callActivityProps(detailsGroup, element, bpmnFactory, translate); - eventProps(detailsGroup, element, bpmnFactory, elementRegistry, translate); - errorProps(detailsGroup, element, bpmnFactory, translate); - conditionalProps(detailsGroup, element, bpmnFactory, translate); - startEventInitiator(detailsGroup, element, translate); // this must be the last element of the details group! - - var multiInstanceGroup = { - id: 'multiInstance', - label: translate('Multi Instance'), - entries: [] - }; - multiInstanceProps(multiInstanceGroup, element, bpmnFactory, translate); + newDiagrams.forEach(function(diagram) { + self._movePlaneElementsToOrigin(diagram.plane); + }); +}; - var asyncGroup = { - id : 'async', - label: translate('Asynchronous Continuations'), - entries : [] - }; - asynchronousContinuationProps(asyncGroup, element, bpmnFactory, translate); - var jobConfigurationGroup = { - id : 'jobConfiguration', - label : translate('Job Configuration'), - entries : [], - enabled: isJobConfigEnabled - }; - jobConfiguration(jobConfigurationGroup, element, bpmnFactory, translate); +/** + * Moves all DI elements from collapsed subprocesses to a new plane. + * + * @param {CanvasPlane} plane + * + * @return {ModdleElement[]} new diagrams created for the collapsed subprocesses + */ +SubprocessCompatibility.prototype._createNewDiagrams = function(plane) { + var self = this; - var externalTaskGroup = { - id : 'externalTaskConfiguration', - label : translate('External Task Configuration'), - entries : [], - enabled: isExternalTaskPriorityEnabled - }; - externalTaskConfiguration(externalTaskGroup, element, bpmnFactory, translate); + var collapsedElements = []; + var elementsToMove = []; + plane.get('planeElement').forEach(function(diElement) { + var businessObject = diElement.bpmnElement; - var candidateStarterGroup = { - id: 'candidateStarterConfiguration', - label: translate('Candidate Starter Configuration'), - entries: [] - }; - candidateStarter(candidateStarterGroup, element, bpmnFactory, translate); + if (!businessObject) { + return; + } - var historyTimeToLiveGroup = { - id: 'historyConfiguration', - label: translate('History Configuration'), - entries: [] - }; - historyTimeToLive(historyTimeToLiveGroup, element, bpmnFactory, translate); + var parent = businessObject.$parent; - var tasklistGroup = { - id: 'tasklist', - label: translate('Tasklist Configuration'), - entries: [] - }; - tasklist(tasklistGroup, element, bpmnFactory, translate); + if ((0,_util_ModelUtil__WEBPACK_IMPORTED_MODULE_0__.is)(businessObject, 'bpmn:SubProcess') && !diElement.isExpanded) { + collapsedElements.push(businessObject); + } - var documentationGroup = { - id: 'documentation', - label: translate('Documentation'), - entries: [] - }; - documentationProps(documentationGroup, element, bpmnFactory, translate); + if (shouldMoveToPlane(businessObject, plane)) { - var groups = []; - groups.push(generalGroup); - customFieldsGroups.forEach(function(group) { - groups.push(group); - }); - groups.push(detailsGroup); - groups.push(externalTaskGroup); - groups.push(multiInstanceGroup); - groups.push(asyncGroup); - groups.push(jobConfigurationGroup); - groups.push(candidateStarterGroup); - groups.push(historyTimeToLiveGroup); - groups.push(tasklistGroup); - groups.push(documentationGroup); - - return groups; - } - - function createVariablesTabGroups(element, bpmnFactory, elementRegistry, translate) { - var variablesGroup = { - id : 'variables', - label : translate('Variables'), - entries: [] - }; - variableMapping(variablesGroup, element, bpmnFactory, translate); + // don't change the array while we iterate over it + elementsToMove.push({ diElement: diElement, parent: parent }); + } + }); - return [ - variablesGroup - ]; - } + var newDiagrams = []; - function createFormsTabGroups(element, bpmnFactory, elementRegistry, translate) { - var formGroup = { - id : 'forms', - label : translate('Forms'), - entries: [] - }; - formProps(formGroup, element, bpmnFactory, translate); + // create new planes for all collapsed subprocesses, even when they are empty + collapsedElements.forEach(function(element) { + if (!self._processToDiagramMap[ element.id ]) { + var diagram = self._createDiagram(element); - return [ - formGroup - ]; - } + self._processToDiagramMap[element.id] = diagram; - function createListenersTabGroups(element, bpmnFactory, elementRegistry, translate) { + newDiagrams.push(diagram); + } + }); - var listenersGroup = { - id : 'listeners', - label: translate('Listeners'), - entries: [] - }; + elementsToMove.forEach(function(element) { + var diElement = element.diElement; + var parent = element.parent; - var options = listenerProps(listenersGroup, element, bpmnFactory, translate); + // parent is expanded, get nearest collapsed parent + while (parent && collapsedElements.indexOf(parent) === -1) { + parent = parent.$parent; + } - var listenerDetailsGroup = { - id: 'listener-details', - entries: [], - enabled: function(element, node) { - return options.getSelectedListener(element, node); - }, - label: function(element, node) { - var param = options.getSelectedListener(element, node); - return getListenerLabel(param, translate); - } - }; + // false positive, all parents are expanded + if (!parent) { + return; + } - listenerDetails(listenerDetailsGroup, element, bpmnFactory, options, translate); + var diagram = self._processToDiagramMap[ parent.id ]; - var listenerFieldsGroup = { - id: 'listener-fields', - label: translate('Field Injection'), - entries: [], - enabled: function(element, node) { - return options.getSelectedListener(element, node); - } - }; + self._moveToDiPlane(diElement, diagram.plane); + }); - listenerFields(listenerFieldsGroup, element, bpmnFactory, options, translate); + return newDiagrams; +}; - return [ - listenersGroup, - listenerDetailsGroup, - listenerFieldsGroup - ]; - } +/** + * @param {CanvasPlane} plane + */ +SubprocessCompatibility.prototype._movePlaneElementsToOrigin = function(plane) { + var elements = plane.get('planeElement'); + + // get bounding box of all elements + 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; + } + }); +}; + +/** + * @param {ModdleElement} diElement + * @param {CanvasPlane} newPlane + */ +SubprocessCompatibility.prototype._moveToDiPlane = function(diElement, newPlane) { + var containingDiagram = findRootDiagram(diElement); - function createInputOutputTabGroups(element, bpmnFactory, elementRegistry, translate) { + // remove DI from old Plane and add it to the new one + var parentPlaneElement = containingDiagram.plane.get('planeElement'); - var inputOutputGroup = { - id: 'input-output', - label: translate('Parameters'), - entries: [] - }; + parentPlaneElement.splice(parentPlaneElement.indexOf(diElement), 1); - var options = inputOutput(inputOutputGroup, element, bpmnFactory, translate); + newPlane.get('planeElement').push(diElement); +}; - var inputOutputParameterGroup = { - id: 'input-output-parameter', - entries: [], - enabled: function(element, node) { - return options.getSelectedParameter(element, node); - }, - label: function(element, node) { - var param = options.getSelectedParameter(element, node); - return getInputOutputParameterLabel(param, translate); - } - }; +/** + * @param {ModdleElement} businessObject + * + * @return {ModdleElement} + */ +SubprocessCompatibility.prototype._createDiagram = function(businessObject) { + var plane = this._moddle.create('bpmndi:BPMNPlane', { + bpmnElement: businessObject + }); - inputOutputParameter(inputOutputParameterGroup, element, bpmnFactory, options, translate); + var diagram = this._moddle.create('bpmndi:BPMNDiagram', { + plane: plane + }); - return [ - inputOutputGroup, - inputOutputParameterGroup - ]; - } + plane.$parent = diagram; - function createConnectorTabGroups(element, bpmnFactory, elementRegistry, translate) { - var connectorDetailsGroup = { - id: 'connector-details', - label: translate('Details'), - entries: [] - }; + plane.bpmnElement = businessObject; - connectorDetails(connectorDetailsGroup, element, bpmnFactory, translate); + diagram.$parent = this._definitions; - var connectorInputOutputGroup = { - id: 'connector-input-output', - label: translate('Input/Output'), - entries: [] - }; + this._definitions.diagrams.push(diagram); - var options = connectorInputOutput(connectorInputOutputGroup, element, bpmnFactory, translate); + return diagram; +}; - var connectorInputOutputParameterGroup = { - id: 'connector-input-output-parameter', - entries: [], - enabled: function(element, node) { - return options.getSelectedParameter(element, node); - }, - label: function(element, node) { - var param = options.getSelectedParameter(element, node); - return getInputOutputParameterLabel(param, translate); - } - }; +SubprocessCompatibility.$inject = [ 'eventBus', 'moddle' ]; - connectorInputOutputParameter(connectorInputOutputParameterGroup, element, bpmnFactory, options, translate); - return [ - connectorDetailsGroup, - connectorInputOutputGroup, - connectorInputOutputParameterGroup - ]; - } +// helpers ////////// - function createFieldInjectionsTabGroups(element, bpmnFactory, elementRegistry, translate) { +function findRootDiagram(element) { + if ((0,_util_ModelUtil__WEBPACK_IMPORTED_MODULE_0__.is)(element, 'bpmndi:BPMNDiagram')) { + return element; + } else { + return findRootDiagram(element.$parent); + } +} - var fieldGroup = { - id: 'field-injections-properties', - label: translate('Field Injections'), - entries: [] - }; +/** + * @param {CanvasPlane} plane + * + * @return {Rect} + */ +function getPlaneBounds(plane) { + var planeTrbl = { + top: Infinity, + right: -Infinity, + bottom: -Infinity, + left: Infinity + }; + + plane.planeElement.forEach(function(element) { + if (!element.bounds) { + return; + } + + var trbl = (0,diagram_js_lib_layout_LayoutUtil__WEBPACK_IMPORTED_MODULE_1__.asTRBL)(element.bounds); + + planeTrbl.top = Math.min(trbl.top, planeTrbl.top); + planeTrbl.left = Math.min(trbl.left, planeTrbl.left); + }); + + return (0,diagram_js_lib_layout_LayoutUtil__WEBPACK_IMPORTED_MODULE_1__.asBounds)(planeTrbl); +} + +/** + * @param {ModdleElement} businessObject + * @param {CanvasPlane} plane + * + * @return {boolean} + */ +function shouldMoveToPlane(businessObject, plane) { + var parent = businessObject.$parent; - fieldInjections(fieldGroup, element, bpmnFactory, translate); + // don't move elements that are already on the plane + if (!(0,_util_ModelUtil__WEBPACK_IMPORTED_MODULE_0__.is)(parent, 'bpmn:SubProcess') || parent === plane.bpmnElement) { + return false; + } - return [ - fieldGroup - ]; - } + // dataAssociations are children of the subprocess but rendered on process level + // cf. https://github.com/bpmn-io/bpmn-js/issues/1619 + if ((0,_util_ModelUtil__WEBPACK_IMPORTED_MODULE_0__.isAny)(businessObject, [ 'bpmn:DataInputAssociation', 'bpmn:DataOutputAssociation' ])) { + return false; + } - function createExtensionElementsGroups(element, bpmnFactory, elementRegistry, translate) { + return true; +} - var propertiesGroup = { - id : 'extensionElements-properties', - label: translate('Properties'), - entries: [] - }; - properties(propertiesGroup, element, bpmnFactory, translate); - return [ - propertiesGroup - ]; - } +/***/ }), -// Camunda Properties Provider ///////////////////////////////////// +/***/ "../node_modules/bpmn-js/lib/features/drilldown/index.js": +/*!***************************************************************!*\ + !*** ../node_modules/bpmn-js/lib/features/drilldown/index.js ***! + \***************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var diagram_js_lib_features_overlays__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! diagram-js/lib/features/overlays */ "../node_modules/diagram-js/lib/features/overlays/index.js"); +/* harmony import */ var diagram_js_lib_features_change_support__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! diagram-js/lib/features/change-support */ "../node_modules/diagram-js/lib/features/change-support/index.js"); +/* harmony import */ var diagram_js_lib_features_root_elements__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! diagram-js/lib/features/root-elements */ "../node_modules/diagram-js/lib/features/root-elements/index.js"); +/* harmony import */ var _DrilldownBreadcrumbs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./DrilldownBreadcrumbs */ "../node_modules/bpmn-js/lib/features/drilldown/DrilldownBreadcrumbs.js"); +/* harmony import */ var _DrilldownCentering__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./DrilldownCentering */ "../node_modules/bpmn-js/lib/features/drilldown/DrilldownCentering.js"); +/* harmony import */ var _SubprocessCompatibility__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./SubprocessCompatibility */ "../node_modules/bpmn-js/lib/features/drilldown/SubprocessCompatibility.js"); +/* harmony import */ var _DrilldownOverlayBehavior__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./DrilldownOverlayBehavior */ "../node_modules/bpmn-js/lib/features/drilldown/DrilldownOverlayBehavior.js"); - /** - * A properties provider for Camunda related properties. - * - * @param {EventBus} eventBus - * @param {Canvas} canvas - * @param {BpmnFactory} bpmnFactory - * @param {ElementRegistry} elementRegistry - * @param {ElementTemplates} elementTemplates - * @param {Translate} translate - */ - function CamundaPropertiesProvider( - eventBus, canvas, bpmnFactory, - elementRegistry, elementTemplates, translate) { - PropertiesActivator.call(this, eventBus); - this.getTabs = function(element) { - var generalTab = { - id: 'general', - label: translate('General'), - groups: createGeneralTabGroups( - element, canvas, bpmnFactory, - elementRegistry, elementTemplates, translate) - }; - var variablesTab = { - id: 'variables', - label: translate('Variables'), - groups: createVariablesTabGroups(element, bpmnFactory, elementRegistry, translate) - }; - var formsTab = { - id: 'forms', - label: translate('Forms'), - groups: createFormsTabGroups(element, bpmnFactory, elementRegistry, translate) - }; - var listenersTab = { - id: 'listeners', - label: translate('Listeners'), - groups: createListenersTabGroups(element, bpmnFactory, elementRegistry, translate), - enabled: function(element) { - return !eventDefinitionHelper.getLinkEventDefinition(element) - || (!is(element, 'bpmn:IntermediateThrowEvent') - && eventDefinitionHelper.getLinkEventDefinition(element)); - } - }; - var inputOutputTab = { - id: 'input-output', - label: translate('Input/Output'), - groups: createInputOutputTabGroups(element, bpmnFactory, elementRegistry, translate) - }; - var connectorTab = { - id: 'connector', - label: translate('Connector'), - groups: createConnectorTabGroups(element, bpmnFactory, elementRegistry, translate), - enabled: function(element) { - var bo = implementationTypeHelper.getServiceTaskLikeBusinessObject(element); - return bo && implementationTypeHelper.getImplementationType(bo) === 'connector'; - } - }; +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ + __depends__: [ diagram_js_lib_features_overlays__WEBPACK_IMPORTED_MODULE_0__["default"], diagram_js_lib_features_change_support__WEBPACK_IMPORTED_MODULE_1__["default"], diagram_js_lib_features_root_elements__WEBPACK_IMPORTED_MODULE_2__["default"] ], + __init__: [ 'drilldownBreadcrumbs', 'drilldownOverlayBehavior', 'drilldownCentering', 'subprocessCompatibility' ], + drilldownBreadcrumbs: [ 'type', _DrilldownBreadcrumbs__WEBPACK_IMPORTED_MODULE_3__["default"] ], + drilldownCentering: [ 'type', _DrilldownCentering__WEBPACK_IMPORTED_MODULE_4__["default"] ], + drilldownOverlayBehavior: [ 'type', _DrilldownOverlayBehavior__WEBPACK_IMPORTED_MODULE_5__["default"] ], + subprocessCompatibility: [ 'type', _SubprocessCompatibility__WEBPACK_IMPORTED_MODULE_6__["default"] ] +}); - var fieldInjectionsTab = { - id: 'field-injections', - label: translate('Field Injections'), - groups: createFieldInjectionsTabGroups(element, bpmnFactory, elementRegistry, translate) - }; +/***/ }), - var extensionsTab = { - id: 'extensionElements', - label: translate('Extensions'), - groups: createExtensionElementsGroups(element, bpmnFactory, elementRegistry, translate) - }; +/***/ "../node_modules/bpmn-js/lib/features/editor-actions/BpmnEditorActions.js": +/*!********************************************************************************!*\ + !*** ../node_modules/bpmn-js/lib/features/editor-actions/BpmnEditorActions.js ***! + \********************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - return [ - generalTab, - variablesTab, - connectorTab, - formsTab, - listenersTab, - inputOutputTab, - fieldInjectionsTab, - extensionsTab - ]; - }; +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ BpmnEditorActions) +/* harmony export */ }); +/* harmony import */ var inherits_browser__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! inherits-browser */ "../node_modules/inherits-browser/dist/index.es.js"); +/* harmony import */ var diagram_js_lib_features_editor_actions_EditorActions__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! diagram-js/lib/features/editor-actions/EditorActions */ "../node_modules/diagram-js/lib/features/editor-actions/EditorActions.js"); +/* harmony import */ var min_dash__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! min-dash */ "../node_modules/min-dash/dist/index.esm.js"); +/* harmony import */ var _util_ModelUtil__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../util/ModelUtil */ "../node_modules/bpmn-js/lib/util/ModelUtil.js"); +/* harmony import */ var diagram_js_lib_util_Elements__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! diagram-js/lib/util/Elements */ "../node_modules/diagram-js/lib/util/Elements.js"); - } - CamundaPropertiesProvider.$inject = [ - 'eventBus', - 'canvas', - 'bpmnFactory', - 'elementRegistry', - 'elementTemplates', - 'translate' - ]; - inherits(CamundaPropertiesProvider, PropertiesActivator); - module.exports = CamundaPropertiesProvider; - },{"../../PropertiesActivator":3,"../../helper/AsyncCapableHelper":23,"../../helper/EventDefinitionHelper":27,"../../helper/ImplementationTypeHelper":30,"../bpmn/parts/DocumentationProps":34,"../bpmn/parts/EventProps":35,"../bpmn/parts/ExecutableProps":36,"../bpmn/parts/IdProps":37,"../bpmn/parts/LinkProps":38,"../bpmn/parts/NameProps":39,"../bpmn/parts/ProcessProps":40,"./element-templates/parts/ChooserProps":61,"./element-templates/parts/CustomProps":62,"./parts/AsynchronousContinuationProps":64,"./parts/CallActivityProps":65,"./parts/CandidateStarterProps":66,"./parts/ConditionalProps":67,"./parts/ConnectorDetailProps":68,"./parts/ConnectorInputOutputParameterProps":69,"./parts/ConnectorInputOutputProps":70,"./parts/ErrorEventProps":71,"./parts/ExternalTaskConfigurationProps":72,"./parts/FieldInjectionProps":73,"./parts/FormProps":74,"./parts/HistoryTimeToLiveProps":75,"./parts/InputOutputParameterProps":76,"./parts/InputOutputProps":77,"./parts/JobConfigurationProps":78,"./parts/ListenerDetailProps":79,"./parts/ListenerFieldInjectionProps":80,"./parts/ListenerProps":81,"./parts/MultiInstanceLoopProps":82,"./parts/PropertiesProps":83,"./parts/ScriptTaskProps":84,"./parts/ServiceTaskDelegateProps":85,"./parts/StartEventInitiator":86,"./parts/TasklistProps":87,"./parts/UserTaskProps":88,"./parts/VariableMappingProps":89,"./parts/VersionTagProps":90,"bpmn-js/lib/util/ModelUtil":240,"inherits":438}],52:[function(require,module,exports){ - 'use strict'; - var assign = require('lodash/assign'); - /** - * Create an input parameter representing the given - * binding and value. - * - * @param {PropertyBinding} binding - * @param {String} value - * @param {BpmnFactory} bpmnFactory - * - * @return {ModdleElement} - */ - function createInputParameter(binding, value, bpmnFactory) { - var scriptFormat = binding.scriptFormat, - parameterValue, - parameterDefinition; - - if (scriptFormat) { - parameterDefinition = bpmnFactory.create('camunda:Script', { - scriptFormat: scriptFormat, - value: value - }); - } else { - parameterValue = value; - } - return bpmnFactory.create('camunda:InputParameter', { - name: binding.name, - value: parameterValue, - definition: parameterDefinition - }); - } - module.exports.createInputParameter = createInputParameter; +/** + * @typedef {import('didi').Injector} Injector + */ - /** - * Create an output parameter representing the given - * binding and value. - * - * @param {PropertyBinding} binding - * @param {String} value - * @param {BpmnFactory} bpmnFactory - * - * @return {ModdleElement} - */ - function createOutputParameter(binding, value, bpmnFactory) { - var scriptFormat = binding.scriptFormat, - parameterValue, - parameterDefinition; - - if (scriptFormat) { - parameterDefinition = bpmnFactory.create('camunda:Script', { - scriptFormat: scriptFormat, - value: binding.source - }); - } else { - parameterValue = binding.source; - } +/** + * Registers and executes BPMN specific editor actions. + * + * @param {Injector} injector + */ +function BpmnEditorActions(injector) { + injector.invoke(diagram_js_lib_features_editor_actions_EditorActions__WEBPACK_IMPORTED_MODULE_0__["default"], this); +} - return bpmnFactory.create('camunda:OutputParameter', { - name: value, - value: parameterValue, - definition: parameterDefinition - }); - } +(0,inherits_browser__WEBPACK_IMPORTED_MODULE_1__["default"])(BpmnEditorActions, diagram_js_lib_features_editor_actions_EditorActions__WEBPACK_IMPORTED_MODULE_0__["default"]); - module.exports.createOutputParameter = createOutputParameter; +BpmnEditorActions.$inject = [ + 'injector' +]; +/** + * Register default actions. + * + * @param {Injector} injector + */ +BpmnEditorActions.prototype._registerDefaultActions = function(injector) { + + // (0) invoke super method + + diagram_js_lib_features_editor_actions_EditorActions__WEBPACK_IMPORTED_MODULE_0__["default"].prototype._registerDefaultActions.call(this, injector); + + // (1) retrieve optional components to integrate with + + var canvas = injector.get('canvas', false); + var elementRegistry = injector.get('elementRegistry', false); + var selection = injector.get('selection', false); + var spaceTool = injector.get('spaceTool', false); + var lassoTool = injector.get('lassoTool', false); + var handTool = injector.get('handTool', false); + var globalConnect = injector.get('globalConnect', false); + var distributeElements = injector.get('distributeElements', false); + var alignElements = injector.get('alignElements', false); + var directEditing = injector.get('directEditing', false); + var searchPad = injector.get('searchPad', false); + var modeling = injector.get('modeling', false); + var contextPad = injector.get('contextPad', false); + + // (2) check components and register actions + + if (canvas && elementRegistry && selection) { + this._registerAction('selectElements', function() { + + // select all elements except for the invisible + // root element + var rootElement = canvas.getRootElement(); + + var elements = elementRegistry.filter(function(element) { + return element !== rootElement; + }); + + selection.select(elements); + + return elements; + }); + } + + if (spaceTool) { + this._registerAction('spaceTool', function() { + spaceTool.toggle(); + }); + } + + if (lassoTool) { + this._registerAction('lassoTool', function() { + lassoTool.toggle(); + }); + } + + if (handTool) { + this._registerAction('handTool', function() { + handTool.toggle(); + }); + } + + if (globalConnect) { + this._registerAction('globalConnectTool', function() { + globalConnect.toggle(); + }); + } + + if (selection && distributeElements) { + this._registerAction('distributeElements', function(opts) { + var currentSelection = selection.get(), + type = opts.type; + + if (currentSelection.length) { + distributeElements.trigger(currentSelection, type); + } + }); + } + + if (selection && alignElements) { + this._registerAction('alignElements', function(opts) { + var currentSelection = selection.get(), + aligneableElements = [], + type = opts.type; + + if (currentSelection.length) { + aligneableElements = (0,min_dash__WEBPACK_IMPORTED_MODULE_2__.filter)(currentSelection, function(element) { + return !(0,_util_ModelUtil__WEBPACK_IMPORTED_MODULE_3__.is)(element, 'bpmn:Lane'); + }); - /** - * Create camunda property from the given binding. - * - * @param {PropertyBinding} binding - * @param {String} value - * @param {BpmnFactory} bpmnFactory - * - * @return {ModdleElement} - */ - function createCamundaProperty(binding, value, bpmnFactory) { - return bpmnFactory.create('camunda:Property', { - name: binding.name, - value: value || '' - }); - } + alignElements.trigger(aligneableElements, type); + } + }); + } + + if (selection && modeling) { + this._registerAction('setColor', function(opts) { + var currentSelection = selection.get(); + + if (currentSelection.length) { + modeling.setColor(currentSelection, opts); + } + }); + } + + if (selection && directEditing) { + this._registerAction('directEditing', function() { + var currentSelection = selection.get(); + + if (currentSelection.length) { + directEditing.activate(currentSelection[0]); + } + }); + } + + if (searchPad) { + this._registerAction('find', function() { + searchPad.toggle(); + }); + } + + if (canvas && modeling) { + this._registerAction('moveToOrigin', function() { + var rootElement = canvas.getRootElement(), + boundingBox, + elements; + + if ((0,_util_ModelUtil__WEBPACK_IMPORTED_MODULE_3__.is)(rootElement, 'bpmn:Collaboration')) { + elements = elementRegistry.filter(function(element) { + return (0,_util_ModelUtil__WEBPACK_IMPORTED_MODULE_3__.is)(element.parent, 'bpmn:Collaboration'); + }); + } else { + elements = elementRegistry.filter(function(element) { + return element !== rootElement && !(0,_util_ModelUtil__WEBPACK_IMPORTED_MODULE_3__.is)(element.parent, 'bpmn:SubProcess'); + }); + } - module.exports.createCamundaProperty = createCamundaProperty; + boundingBox = (0,diagram_js_lib_util_Elements__WEBPACK_IMPORTED_MODULE_4__.getBBox)(elements); + modeling.moveElements( + elements, + { x: -boundingBox.x, y: -boundingBox.y }, + rootElement + ); + }); + } - /** - * Create camunda:in element from given binding. - * - * @param {PropertyBinding} binding - * @param {String} value - * @param {BpmnFactory} bpmnFactory - * - * @return {ModdleElement} - */ - function createCamundaIn(binding, value, bpmnFactory) { + if (selection && contextPad) { + this._registerAction('replaceElement', function(event) { + contextPad.triggerEntry('replace', 'click', event); + }); + } - var properties = createCamundaInOutAttrs(binding, value); +}; - return bpmnFactory.create('camunda:In', properties); - } - module.exports.createCamundaIn = createCamundaIn; +/***/ }), +/***/ "../node_modules/bpmn-js/lib/features/editor-actions/index.js": +/*!********************************************************************!*\ + !*** ../node_modules/bpmn-js/lib/features/editor-actions/index.js ***! + \********************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - /** - * Create camunda:in with businessKey element from given binding. - * - * @param {PropertyBinding} binding - * @param {String} value - * @param {BpmnFactory} bpmnFactory - * - * @return {ModdleElement} - */ - function createCamundaInWithBusinessKey(binding, value, bpmnFactory) { - return bpmnFactory.create('camunda:In', { - businessKey: value - }); - } +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var diagram_js_lib_features_editor_actions__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! diagram-js/lib/features/editor-actions */ "../node_modules/diagram-js/lib/features/editor-actions/index.js"); +/* harmony import */ var _BpmnEditorActions__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./BpmnEditorActions */ "../node_modules/bpmn-js/lib/features/editor-actions/BpmnEditorActions.js"); - module.exports.createCamundaInWithBusinessKey = createCamundaInWithBusinessKey; - /** - * Create camunda:out element from given binding. - * - * @param {PropertyBinding} binding - * @param {String} value - * @param {BpmnFactory} bpmnFactory - * - * @return {ModdleElement} - */ - function createCamundaOut(binding, value, bpmnFactory) { - var properties = createCamundaInOutAttrs(binding, value); - return bpmnFactory.create('camunda:Out', properties); - } +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ + __depends__: [ + diagram_js_lib_features_editor_actions__WEBPACK_IMPORTED_MODULE_0__["default"] + ], + editorActions: [ 'type', _BpmnEditorActions__WEBPACK_IMPORTED_MODULE_1__["default"] ] +}); - module.exports.createCamundaOut = createCamundaOut; +/***/ }), - /** - * Create camunda:executionListener element containing an inline script from given binding. - * - * @param {PropertyBinding} binding - * @param {String} value - * @param {BpmnFactory} bpmnFactory - * - * @return {ModdleElement} - */ - function createCamundaExecutionListenerScript(binding, value, bpmnFactory) { - var scriptFormat = binding.scriptFormat, - parameterValue, - parameterDefinition; - - if (scriptFormat) { - parameterDefinition = bpmnFactory.create('camunda:Script', { - scriptFormat: scriptFormat, - value: value - }); - } else { - parameterValue = value; - } +/***/ "../node_modules/bpmn-js/lib/features/grid-snapping/BpmnGridSnapping.js": +/*!******************************************************************************!*\ + !*** ../node_modules/bpmn-js/lib/features/grid-snapping/BpmnGridSnapping.js ***! + \******************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - return bpmnFactory.create('camunda:ExecutionListener', { - event: binding.event, - value: parameterValue, - script: parameterDefinition - }); - } +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ BpmnGridSnapping) +/* harmony export */ }); +/* harmony import */ var _modeling_util_ModelingUtil__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../modeling/util/ModelingUtil */ "../node_modules/bpmn-js/lib/util/ModelUtil.js"); - module.exports.createCamundaExecutionListenerScript = createCamundaExecutionListenerScript; - /** - * Create camunda:field element containing string or expression from given binding. - * - * @param {PropertyBinding} binding - * @param {String} value - * @param {BpmnFactory} bpmnFactory - * - * @return {ModdleElement} - */ - function createCamundaFieldInjection(binding, value, bpmnFactory) { - var DEFAULT_PROPS = { - 'string': undefined, - 'expression': undefined, - 'name': undefined - }; +/** + * @typedef {import('diagram-js/lib/core/EventBus').default} EventBus + */ - var props = assign({}, DEFAULT_PROPS); +/** + * @param {EventBus} eventBus + */ +function BpmnGridSnapping(eventBus) { + eventBus.on([ + 'create.init', + 'shape.move.init' + ], function(event) { + var context = event.context, + shape = event.shape; + + if ((0,_modeling_util_ModelingUtil__WEBPACK_IMPORTED_MODULE_0__.isAny)(shape, [ + 'bpmn:Participant', + 'bpmn:SubProcess', + 'bpmn:TextAnnotation' + ])) { + if (!context.gridSnappingContext) { + context.gridSnappingContext = {}; + } + + context.gridSnappingContext.snapLocation = 'top-left'; + } + }); +} + +BpmnGridSnapping.$inject = [ 'eventBus' ]; + +/***/ }), + +/***/ "../node_modules/bpmn-js/lib/features/grid-snapping/behavior/GridSnappingAutoPlaceBehavior.js": +/*!****************************************************************************************************!*\ + !*** ../node_modules/bpmn-js/lib/features/grid-snapping/behavior/GridSnappingAutoPlaceBehavior.js ***! + \****************************************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ GridSnappingAutoPlaceBehavior) +/* harmony export */ }); +/* harmony import */ var _auto_place_BpmnAutoPlaceUtil__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../auto-place/BpmnAutoPlaceUtil */ "../node_modules/bpmn-js/lib/features/auto-place/BpmnAutoPlaceUtil.js"); +/* harmony import */ var diagram_js_lib_layout_LayoutUtil__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! diagram-js/lib/layout/LayoutUtil */ "../node_modules/diagram-js/lib/layout/LayoutUtil.js"); +/* harmony import */ var _util_ModelUtil__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../util/ModelUtil */ "../node_modules/bpmn-js/lib/util/ModelUtil.js"); + + + + + +/** + * @typedef {import('diagram-js/lib/core/EventBus').default} EventBus + * @typedef {import('diagram-js/lib/features/grid-snapping/GridSnapping').default} GridSnapping + * + * @typedef {import('diagram-js/lib/util/Types').Axis} Axis + */ - if (!binding.expression) { - props.string = value; - } else { - props.expression = value; - } - props.name = binding.name; +var HIGH_PRIORITY = 2000; - return bpmnFactory.create('camunda:Field', props); - } - module.exports.createCamundaFieldInjection = createCamundaFieldInjection; +/** + * @param {EventBus} eventBus + * @param {GridSnapping} gridSnapping + */ +function GridSnappingAutoPlaceBehavior(eventBus, gridSnapping) { + eventBus.on('autoPlace', HIGH_PRIORITY, function(context) { + var source = context.source, + sourceMid = (0,diagram_js_lib_layout_LayoutUtil__WEBPACK_IMPORTED_MODULE_0__.getMid)(source), + shape = context.shape; + var position = (0,_auto_place_BpmnAutoPlaceUtil__WEBPACK_IMPORTED_MODULE_1__.getNewShapePosition)(source, shape); -// helpers //////////////////////////// + [ 'x', 'y' ].forEach(function(axis) { + var options = {}; - /** - * Create properties for camunda:in and camunda:out types. - */ - function createCamundaInOutAttrs(binding, value) { + // do not snap if x/y equal + if (position[ axis ] === sourceMid[ axis ]) { + return; + } - var properties = {}; + if (position[ axis ] > sourceMid[ axis ]) { + options.min = position[ axis ]; + } else { + options.max = position[ axis ]; + } - // camunda:in source(Expression) target - if (binding.target) { + if ((0,_util_ModelUtil__WEBPACK_IMPORTED_MODULE_2__.is)(shape, 'bpmn:TextAnnotation')) { - properties.target = binding.target; + if (isHorizontal(axis)) { + options.offset = -shape.width / 2; + } else { + options.offset = -shape.height / 2; + } - if (binding.expression) { - properties.sourceExpression = value; - } else { - properties.source = value; - } - } else + } - // camunda:(in|out) variables local - if (binding.variables) { - properties.variables = 'all'; + position[ axis ] = gridSnapping.snapValue(position[ axis ], options); - if (binding.variables === 'local') { - properties.local = true; - } - } + }); - // camunda:out source(Expression) target - else { - properties.target = value; + // must be returned to be considered by auto place + return position; + }); +} - [ 'source', 'sourceExpression' ].forEach(function(k) { - if (binding[k]) { - properties[k] = binding[k]; - } - }); - } +GridSnappingAutoPlaceBehavior.$inject = [ + 'eventBus', + 'gridSnapping' +]; - return properties; - } +// helpers ////////// - },{"lodash/assign":604}],53:[function(require,module,exports){ - 'use strict'; +/** + * @param {Axis} axis + * + * @return {boolean} + */ +function isHorizontal(axis) { + return axis === 'x'; +} - var inherits = require('inherits'); +/***/ }), - var getTemplate = require('./Helper').getTemplate; +/***/ "../node_modules/bpmn-js/lib/features/grid-snapping/behavior/GridSnappingLayoutConnectionBehavior.js": +/*!***********************************************************************************************************!*\ + !*** ../node_modules/bpmn-js/lib/features/grid-snapping/behavior/GridSnappingLayoutConnectionBehavior.js ***! + \***********************************************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - var PropertiesActivator = require('../../../PropertiesActivator'); +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ GridSnappingLayoutConnectionBehavior) +/* harmony export */ }); +/* harmony import */ var inherits_browser__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! inherits-browser */ "../node_modules/inherits-browser/dist/index.es.js"); +/* harmony import */ var diagram_js_lib_command_CommandInterceptor__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! diagram-js/lib/command/CommandInterceptor */ "../node_modules/diagram-js/lib/command/CommandInterceptor.js"); +/* harmony import */ var diagram_js_lib_util_Geometry__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! diagram-js/lib/util/Geometry */ "../node_modules/diagram-js/lib/util/Geometry.js"); +/* harmony import */ var min_dash__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! min-dash */ "../node_modules/min-dash/dist/index.esm.js"); - var HIGHER_PRIORITY = 1100; - /** - * Applies template visibility settings. - * - * Controlled using `entriesVisible` on template config object: - * - * ```json - * "entriesVisible": { - * "_all": true|false, - * "entryName": true|false, - * ... - * } - * ``` - * - * @param {EventBus} eventBus - * @param {ElementTemplates} elementTemplates - */ - function CustomElementsPropertiesActivator(eventBus, elementTemplates) { - PropertiesActivator.call(this, eventBus, HIGHER_PRIORITY); - this.isEntryVisible = function(entry, element) { - var template = getTemplate(element, elementTemplates); - if (template && !isEntryVisible(entry, template)) { - return false; - } - }; - this.isPropertyEditable = function(entry, propertyName, element) { - var template = getTemplate(element, elementTemplates); - if (template && !isEntryEditable(entry, template)) { - return false; - } - }; - } +/** + * @typedef {import('diagram-js/lib/core/EventBus').default} EventBus + * @typedef {import('diagram-js/lib/features/grid-snapping/GridSnapping').default} GridSnapping + * @typedef {import('../../modeling/Modeling').default} Modeling + * + * @typedef {import('diagram-js/lib/util/Types').Point} Point + */ - CustomElementsPropertiesActivator.$inject = [ 'eventBus', 'elementTemplates' ]; +var HIGH_PRIORITY = 3000; - inherits(CustomElementsPropertiesActivator, PropertiesActivator); - module.exports = CustomElementsPropertiesActivator; +/** + * Snaps connections with Manhattan layout. + * + * @param {EventBus} eventBus + * @param {GridSnapping} gridSnapping + * @param {Modeling} modeling + */ +function GridSnappingLayoutConnectionBehavior(eventBus, gridSnapping, modeling) { + diagram_js_lib_command_CommandInterceptor__WEBPACK_IMPORTED_MODULE_0__["default"].call(this, eventBus); + this._gridSnapping = gridSnapping; + var self = this; -// helpers //////////////////////////////////// + this.postExecuted([ + 'connection.create', + 'connection.layout' + ], HIGH_PRIORITY, function(event) { + var context = event.context, + connection = context.connection, + hints = context.hints || {}, + waypoints = connection.waypoints; + if (hints.connectionStart || hints.connectionEnd || hints.createElementsBehavior === false) { + return; + } - var CUSTOM_PROPERTIES_PATTERN = /^custom-/; + if (!hasMiddleSegments(waypoints)) { + return; + } - var DEFAULT_ENTRIES_VISIBLE = { - _all: false, - id: true, - name: true - }; + modeling.updateWaypoints(connection, self.snapMiddleSegments(waypoints)); + }); +} - function isCustomEntry(entry) { - return CUSTOM_PROPERTIES_PATTERN.test(entry.id); - } +GridSnappingLayoutConnectionBehavior.$inject = [ + 'eventBus', + 'gridSnapping', + 'modeling' +]; - function isEntryVisible(entry, template) { +(0,inherits_browser__WEBPACK_IMPORTED_MODULE_1__["default"])(GridSnappingLayoutConnectionBehavior, diagram_js_lib_command_CommandInterceptor__WEBPACK_IMPORTED_MODULE_0__["default"]); - var entryId = entry.id; +/** + * Snap middle segments of a given connection. + * + * @param {Point[]} waypoints + * + * @return {Point[]} + */ +GridSnappingLayoutConnectionBehavior.prototype.snapMiddleSegments = function(waypoints) { + var gridSnapping = this._gridSnapping, + snapped; - if (entryId === 'elementTemplate-chooser' || isCustomEntry(entry)) { - return true; - } + waypoints = waypoints.slice(); - var entriesVisible = template.entriesVisible || DEFAULT_ENTRIES_VISIBLE; + for (var i = 1; i < waypoints.length - 2; i++) { - if (typeof entriesVisible === 'boolean') { - return entriesVisible; - } + snapped = snapSegment(gridSnapping, waypoints[i], waypoints[i + 1]); - var defaultVisible = entriesVisible._all || false, - entryVisible = entriesVisible[entryId]; + waypoints[i] = snapped[0]; + waypoints[i + 1] = snapped[1]; + } - // d = true, e = false => false - // d = false, e = true => true - // d = false, e = false - return ( - (defaultVisible === true && entryVisible !== false) || - (defaultVisible === false && entryVisible === true) - ); - } + return waypoints; +}; - function isEntryEditable(entry, template) { - var property; +// helpers ////////// - if (isCustomEntry(entry)) { - property = getProperty(template, entry); +/** + * Check whether a connection has a middle segments. + * + * @param {Point[]} waypoints + * + * @return {boolean} + */ +function hasMiddleSegments(waypoints) { + return waypoints.length > 3; +} - return property && property.editable !== false; - } +/** + * Check whether an alignment is horizontal. + * + * @param {string} aligned + * + * @return {boolean} + */ +function horizontallyAligned(aligned) { + return aligned === 'h'; +} - return true; - } +/** + * Check whether an alignment is vertical. + * + * @param {string} aligned + * + * @return {boolean} + */ +function verticallyAligned(aligned) { + return aligned === 'v'; +} - function getProperty(template, entry) { +/** + * Get middle segments from a given connection. + * + * @param {Point[]} waypoints + * + * @return {Point[]} + */ +function snapSegment(gridSnapping, segmentStart, segmentEnd) { - var index; - var idx = entry.id.replace('custom-' + template.id + '-', ''); - if (idx.indexOf('-') !== -1) { - var indexes = idx.split('-'); - if (indexes.length == 2) { - var scopeName = indexes[0].replace(/_/g, ':'); - index = parseInt(indexes[1], 10); - if (scopeName && !isNaN(index)) { - return template.scopes[scopeName].properties[index]; - } - } - } else { - index = parseInt(idx, 10); - if (!isNaN(index)) { - return template.properties[index]; - } - } + var aligned = (0,diagram_js_lib_util_Geometry__WEBPACK_IMPORTED_MODULE_2__.pointsAligned)(segmentStart, segmentEnd); - throw new Error('cannot extract property index for entry <' + entry.id + '>'); - } + var snapped = {}; - },{"../../../PropertiesActivator":3,"./Helper":56,"inherits":438}],54:[function(require,module,exports){ - 'use strict'; + if (horizontallyAligned(aligned)) { - var values = require('lodash/values'); + // snap horizontally + snapped.y = gridSnapping.snapValue(segmentStart.y); + } - /** - * The guy knowing all configured element templates. - * - * This registry won't validate. Use the {@link Validator} - * to verify a template is valid prior to adding it to - * this registry. - */ - function ElementTemplates() { + if (verticallyAligned(aligned)) { - this._templates = {}; + // snap vertically + snapped.x = gridSnapping.snapValue(segmentStart.x); + } - /** - * Sets the known element templates. - * - * @param {Array} descriptors - * - * @return {ElementTemplates} - */ - this.set = function(descriptors) { + if ('x' in snapped || 'y' in snapped) { + segmentStart = (0,min_dash__WEBPACK_IMPORTED_MODULE_3__.assign)({}, segmentStart, snapped); + segmentEnd = (0,min_dash__WEBPACK_IMPORTED_MODULE_3__.assign)({}, segmentEnd, snapped); + } - var templates = this._templates = {}; + return [ segmentStart, segmentEnd ]; +} - descriptors.forEach(function(descriptor) { - templates[descriptor.id] = descriptor; - }); +/***/ }), - return this; - }; +/***/ "../node_modules/bpmn-js/lib/features/grid-snapping/behavior/GridSnappingParticipantBehavior.js": +/*!******************************************************************************************************!*\ + !*** ../node_modules/bpmn-js/lib/features/grid-snapping/behavior/GridSnappingParticipantBehavior.js ***! + \******************************************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - /** - * Get template descriptor with given id. - * - * @param {String} id - * - * @return {TemplateDescriptor} - */ - this.get = function(id) { - return this._templates[id]; - }; +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ GridSnappingParticipantBehavior) +/* harmony export */ }); +/* harmony import */ var _util_ModelUtil__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../util/ModelUtil */ "../node_modules/bpmn-js/lib/util/ModelUtil.js"); - /** - * Return all known template descriptors. - * - * @return {Array} - */ - this.getAll = function() { - return values(this._templates); - }; - } +/** + * @typedef {import('diagram-js/lib/core/Canvas').default} Canvas + * @typedef {import('diagram-js/lib/core/EventBus').default} EventBus + * @typedef {import('diagram-js/lib/features/grid-snapping/GridSnapping').default} GridSnapping + */ - module.exports = ElementTemplates; - },{"lodash/values":643}],55:[function(require,module,exports){ - 'use strict'; +var HIGHER_PRIORITY = 1750; - var Validator = require('./Validator'); +/** + * @param {Canvas} canvas + * @param {EventBus} eventBus + * @param {GridSnapping} gridSnapping + */ +function GridSnappingParticipantBehavior(canvas, eventBus, gridSnapping) { + eventBus.on([ + 'create.start', + 'shape.move.start' + ], HIGHER_PRIORITY, function(event) { + var context = event.context, + shape = context.shape, + rootElement = canvas.getRootElement(); + + if (!(0,_util_ModelUtil__WEBPACK_IMPORTED_MODULE_0__.is)(shape, 'bpmn:Participant') || + !(0,_util_ModelUtil__WEBPACK_IMPORTED_MODULE_0__.is)(rootElement, 'bpmn:Process') || + !rootElement.children.length) { + return; + } + + var createConstraints = context.createConstraints; + + if (!createConstraints) { + return; + } + + shape.width = gridSnapping.snapValue(shape.width, { min: shape.width }); + shape.height = gridSnapping.snapValue(shape.height, { min: shape.height }); + }); +} + +GridSnappingParticipantBehavior.$inject = [ + 'canvas', + 'eventBus', + 'gridSnapping' +]; + +/***/ }), + +/***/ "../node_modules/bpmn-js/lib/features/grid-snapping/behavior/index.js": +/*!****************************************************************************!*\ + !*** ../node_modules/bpmn-js/lib/features/grid-snapping/behavior/index.js ***! + \****************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _GridSnappingAutoPlaceBehavior__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./GridSnappingAutoPlaceBehavior */ "../node_modules/bpmn-js/lib/features/grid-snapping/behavior/GridSnappingAutoPlaceBehavior.js"); +/* harmony import */ var _GridSnappingParticipantBehavior__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./GridSnappingParticipantBehavior */ "../node_modules/bpmn-js/lib/features/grid-snapping/behavior/GridSnappingParticipantBehavior.js"); +/* harmony import */ var _GridSnappingLayoutConnectionBehavior__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./GridSnappingLayoutConnectionBehavior */ "../node_modules/bpmn-js/lib/features/grid-snapping/behavior/GridSnappingLayoutConnectionBehavior.js"); + + + + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ + __init__: [ + 'gridSnappingAutoPlaceBehavior', + 'gridSnappingParticipantBehavior', + 'gridSnappingLayoutConnectionBehavior', + ], + gridSnappingAutoPlaceBehavior: [ 'type', _GridSnappingAutoPlaceBehavior__WEBPACK_IMPORTED_MODULE_0__["default"] ], + gridSnappingParticipantBehavior: [ 'type', _GridSnappingParticipantBehavior__WEBPACK_IMPORTED_MODULE_1__["default"] ], + gridSnappingLayoutConnectionBehavior: [ 'type', _GridSnappingLayoutConnectionBehavior__WEBPACK_IMPORTED_MODULE_2__["default"] ] +}); + +/***/ }), + +/***/ "../node_modules/bpmn-js/lib/features/grid-snapping/index.js": +/*!*******************************************************************!*\ + !*** ../node_modules/bpmn-js/lib/features/grid-snapping/index.js ***! + \*******************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _BpmnGridSnapping__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./BpmnGridSnapping */ "../node_modules/bpmn-js/lib/features/grid-snapping/BpmnGridSnapping.js"); +/* harmony import */ var diagram_js_lib_features_grid_snapping__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! diagram-js/lib/features/grid-snapping */ "../node_modules/diagram-js/lib/features/grid-snapping/index.js"); +/* harmony import */ var _behavior__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./behavior */ "../node_modules/bpmn-js/lib/features/grid-snapping/behavior/index.js"); + + + + + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ + __depends__: [ + diagram_js_lib_features_grid_snapping__WEBPACK_IMPORTED_MODULE_0__["default"], + _behavior__WEBPACK_IMPORTED_MODULE_1__["default"] + ], + __init__: [ 'bpmnGridSnapping' ], + bpmnGridSnapping: [ 'type', _BpmnGridSnapping__WEBPACK_IMPORTED_MODULE_2__["default"] ] +}); + +/***/ }), + +/***/ "../node_modules/bpmn-js/lib/features/interaction-events/BpmnInteractionEvents.js": +/*!****************************************************************************************!*\ + !*** ../node_modules/bpmn-js/lib/features/interaction-events/BpmnInteractionEvents.js ***! + \****************************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ BpmnInteractionEvents) +/* harmony export */ }); +/* harmony import */ var _util_ModelUtil__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../util/ModelUtil */ "../node_modules/bpmn-js/lib/util/ModelUtil.js"); +/* harmony import */ var _util_DiUtil__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../util/DiUtil */ "../node_modules/bpmn-js/lib/util/DiUtil.js"); - /** - * The guy responsible for template loading. - * - * Provide the actual templates via the `config.elementTemplates`. - * - * That configuration can either be an array of template - * descriptors or a node style callback to retrieve - * the templates asynchronously. - * - * @param {Array|Function} loadTemplates - * @param {EventBus} eventBus - * @param {ElementTemplates} elementTemplates - */ - function ElementTemplatesLoader(loadTemplates, eventBus, elementTemplates) { - this._loadTemplates = loadTemplates; - this._eventBus = eventBus; - this._elementTemplates = elementTemplates; - var self = this; - eventBus.on('diagram.init', function() { - self.reload(); - }); - } - module.exports = ElementTemplatesLoader; +/** + * @typedef {import('diagram-js/lib/core/EventBus').default} EventBus + * @typedef {import('diagram-js/lib/features/interaction-events/InteractionEvents').default} InteractionEvents + * + * @typedef {import('../../model/Types').Element} Element + * @typedef {import('../../model/Types').Shape} Shape + */ - ElementTemplatesLoader.$inject = [ - 'config.elementTemplates', - 'eventBus', - 'elementTemplates' - ]; +var LABEL_WIDTH = 30, + LABEL_HEIGHT = 30; - ElementTemplatesLoader.prototype.reload = function() { +/** + * BPMN-specific hit zones and interaction fixes. + * + * @param {EventBus} eventBus + * @param {InteractionEvents} interactionEvents + */ +function BpmnInteractionEvents(eventBus, interactionEvents) { + + this._interactionEvents = interactionEvents; + + var self = this; + + eventBus.on([ + 'interactionEvents.createHit', + 'interactionEvents.updateHit' + ], function(context) { + var element = context.element, + gfx = context.gfx; + + if ((0,_util_ModelUtil__WEBPACK_IMPORTED_MODULE_0__.is)(element, 'bpmn:Lane')) { + return self._createParticipantHit(element, gfx); + } else + + if ((0,_util_ModelUtil__WEBPACK_IMPORTED_MODULE_0__.is)(element, 'bpmn:Participant')) { + if ((0,_util_DiUtil__WEBPACK_IMPORTED_MODULE_1__.isExpanded)(element)) { + return self._createParticipantHit(element, gfx); + } else { + return self._createDefaultHit(element, gfx); + } + } else + + if ((0,_util_ModelUtil__WEBPACK_IMPORTED_MODULE_0__.is)(element, 'bpmn:SubProcess')) { + if ((0,_util_DiUtil__WEBPACK_IMPORTED_MODULE_1__.isExpanded)(element)) { + return self._createSubProcessHit(element, gfx); + } else { + return self._createDefaultHit(element, gfx); + } + } + }); + +} + +BpmnInteractionEvents.$inject = [ + 'eventBus', + 'interactionEvents' +]; + +/** + * @param {Element} element + * @param {SVGElement} gfx + * + * @return {boolean} + */ +BpmnInteractionEvents.prototype._createDefaultHit = function(element, gfx) { + this._interactionEvents.removeHits(gfx); - var self = this; + this._interactionEvents.createDefaultHit(element, gfx); - var loadTemplates = this._loadTemplates; + // indicate that we created a hit + return true; +}; - // no templates specified - if (typeof loadTemplates === 'undefined') { - return; - } +/** + * @param {Shape} element + * @param {SVGElement} gfx + * + * @return {boolean} + */ +BpmnInteractionEvents.prototype._createParticipantHit = function(element, gfx) { + + // remove existing hits + this._interactionEvents.removeHits(gfx); + + // add body hit + this._interactionEvents.createBoxHit(gfx, 'no-move', { + width: element.width, + height: element.height + }); + + // add outline hit + this._interactionEvents.createBoxHit(gfx, 'click-stroke', { + width: element.width, + height: element.height + }); + + // add label hit + this._interactionEvents.createBoxHit(gfx, 'all', { + width: LABEL_WIDTH, + height: element.height + }); + + // indicate that we created a hit + return true; +}; + +/** + * @param {Shape} element + * @param {SVGElement} gfx + * + * @return {boolean} + */ +BpmnInteractionEvents.prototype._createSubProcessHit = function(element, gfx) { - // template loader function specified - if (typeof loadTemplates === 'function') { + // remove existing hits + this._interactionEvents.removeHits(gfx); - return loadTemplates(function(err, templates) { + // add body hit + this._interactionEvents.createBoxHit(gfx, 'no-move', { + width: element.width, + height: element.height + }); - if (err) { - return self.templateErrors([ err ]); - } + // add outline hit + this._interactionEvents.createBoxHit(gfx, 'click-stroke', { + width: element.width, + height: element.height + }); - self.setTemplates(templates); - }); - } + // add label hit + this._interactionEvents.createBoxHit(gfx, 'all', { + width: element.width, + height: LABEL_HEIGHT + }); - // templates array specified - if (loadTemplates.length) { - return this.setTemplates(loadTemplates); - } + // indicate that we created a hit + return true; +}; - }; +/***/ }), - ElementTemplatesLoader.prototype.setTemplates = function(templates) { +/***/ "../node_modules/bpmn-js/lib/features/interaction-events/index.js": +/*!************************************************************************!*\ + !*** ../node_modules/bpmn-js/lib/features/interaction-events/index.js ***! + \************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - var elementTemplates = this._elementTemplates; +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _BpmnInteractionEvents__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./BpmnInteractionEvents */ "../node_modules/bpmn-js/lib/features/interaction-events/BpmnInteractionEvents.js"); - var validator = new Validator().addAll(templates); - var errors = validator.getErrors(), - validTemplates = validator.getValidTemplates(); +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ + __init__: [ 'bpmnInteractionEvents' ], + bpmnInteractionEvents: [ 'type', _BpmnInteractionEvents__WEBPACK_IMPORTED_MODULE_0__["default"] ] +}); - elementTemplates.set(validTemplates); +/***/ }), - if (errors.length) { - this.templateErrors(errors); - } +/***/ "../node_modules/bpmn-js/lib/features/keyboard/BpmnKeyboardBindings.js": +/*!*****************************************************************************!*\ + !*** ../node_modules/bpmn-js/lib/features/keyboard/BpmnKeyboardBindings.js ***! + \*****************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - this.templatesChanged(); - }; +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ BpmnKeyboardBindings) +/* harmony export */ }); +/* harmony import */ var inherits_browser__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! inherits-browser */ "../node_modules/inherits-browser/dist/index.es.js"); +/* harmony import */ var diagram_js_lib_features_keyboard_KeyboardBindings__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! diagram-js/lib/features/keyboard/KeyboardBindings */ "../node_modules/diagram-js/lib/features/keyboard/KeyboardBindings.js"); - ElementTemplatesLoader.prototype.templatesChanged = function() { - this._eventBus.fire('elementTemplates.changed'); - }; - ElementTemplatesLoader.prototype.templateErrors = function(errors) { - this._eventBus.fire('elementTemplates.errors', { - errors: errors - }); - }; - },{"./Validator":57}],56:[function(require,module,exports){ - 'use strict'; - var getBusinessObject = require('bpmn-js/lib/util/ModelUtil').getBusinessObject; - var is = require('bpmn-js/lib/util/ModelUtil').is, - isAny = require('bpmn-js/lib/features/modeling/util/ModelingUtil').isAny; +/** + * @typedef {import('didi').Injector} Injector + * @typedef {import('diagram-js/lib/features/editor-actions/EditorActions').default} EditorActions + * @typedef {import('diagram-js/lib/features/keyboard/Keyboard').default} Keyboard + */ - var find = require('lodash/find'); +/** + * BPMN 2.0 specific keyboard bindings. + * + * @param {Injector} injector + */ +function BpmnKeyboardBindings(injector) { + injector.invoke(diagram_js_lib_features_keyboard_KeyboardBindings__WEBPACK_IMPORTED_MODULE_0__["default"], this); +} +(0,inherits_browser__WEBPACK_IMPORTED_MODULE_1__["default"])(BpmnKeyboardBindings, diagram_js_lib_features_keyboard_KeyboardBindings__WEBPACK_IMPORTED_MODULE_0__["default"]); - var TEMPLATE_ATTR = 'camunda:modelerTemplate'; +BpmnKeyboardBindings.$inject = [ + 'injector' +]; - /** - * The BPMN 2.0 extension attribute name under - * which the element template is stored. - * - * @type {String} - */ - module.exports.TEMPLATE_ATTR = TEMPLATE_ATTR; +/** + * Register available keyboard bindings. + * + * @param {Keyboard} keyboard + * @param {EditorActions} editorActions + */ +BpmnKeyboardBindings.prototype.registerBindings = function(keyboard, editorActions) { - /** - * Get template id for a given diagram element. - * - * @param {djs.model.Base} element - * - * @return {String} - */ - function getTemplateId(element) { + // inherit default bindings + diagram_js_lib_features_keyboard_KeyboardBindings__WEBPACK_IMPORTED_MODULE_0__["default"].prototype.registerBindings.call(this, keyboard, editorActions); - var bo = getBusinessObject(element); + /** + * Add keyboard binding if respective editor action + * is registered. + * + * @param {string} action name + * @param {Function} fn that implements the key binding + */ + function addListener(action, fn) { - if (bo) { - return bo.get(TEMPLATE_ATTR); - } - } + if (editorActions.isRegistered(action)) { + keyboard.addListener(fn); + } + } - module.exports.getTemplateId = getTemplateId; + // select all elements + // CTRL + A + addListener('selectElements', function(context) { + var event = context.keyEvent; - /** - * Get template of a given element. - * - * @param {Element} element - * @param {ElementTemplates} elementTemplates - * - * @return {TemplateDefinition} - */ - function getTemplate(element, elementTemplates) { - var id = getTemplateId(element); + if (keyboard.isKey([ 'a', 'A' ], event) && keyboard.isCmd(event)) { + editorActions.trigger('selectElements'); - return id && elementTemplates.get(id); - } + return true; + } + }); - module.exports.getTemplate = getTemplate; + // search labels + // CTRL + F + addListener('find', function(context) { - /** - * Get default template for a given element. - * - * @param {Element} element - * @param {ElementTemplates} elementTemplates - * - * @return {TemplateDefinition} - */ - function getDefaultTemplate(element, elementTemplates) { + var event = context.keyEvent; - // return first default template, if any exists - return ( - elementTemplates.getAll().filter(function(t) { - return isAny(element, t.appliesTo) && t.isDefault; - }) - )[0]; - } + if (keyboard.isKey([ 'f', 'F' ], event) && keyboard.isCmd(event)) { + editorActions.trigger('find'); - module.exports.getDefaultTemplate = getDefaultTemplate; + return true; + } + }); + // activate space tool + // S + addListener('spaceTool', function(context) { - /** - * Find extension with given type in - * BPMN element, diagram element or ExtensionElement. - * - * @param {ModdleElement|djs.model.Base} element - * @param {String} type - * - * @return {ModdleElement} the extension - */ - function findExtension(element, type) { - var bo = getBusinessObject(element); + var event = context.keyEvent; - var extensionElements; + if (keyboard.hasModifier(event)) { + return; + } - if (is(bo, 'bpmn:ExtensionElements')) { - extensionElements = bo; - } else { - extensionElements = bo.extensionElements; - } + if (keyboard.isKey([ 's', 'S' ], event)) { + editorActions.trigger('spaceTool'); - if (!extensionElements) { - return null; - } + return true; + } + }); - return find(extensionElements.get('values'), function(e) { - return is(e, type); - }); - } + // activate lasso tool + // L + addListener('lassoTool', function(context) { - module.exports.findExtension = findExtension; + var event = context.keyEvent; + if (keyboard.hasModifier(event)) { + return; + } - function findExtensions(element, types) { - var extensionElements = getExtensionElements(element); + if (keyboard.isKey([ 'l', 'L' ], event)) { + editorActions.trigger('lassoTool'); - if (!extensionElements) { - return []; - } + return true; + } + }); - return extensionElements.get('values').filter(function(e) { - return isAny(e, types); - }); - } + // activate hand tool + // H + addListener('handTool', function(context) { - module.exports.findExtensions = findExtensions; + var event = context.keyEvent; + if (keyboard.hasModifier(event)) { + return; + } - function findCamundaInOut(element, binding) { + if (keyboard.isKey([ 'h', 'H' ], event)) { + editorActions.trigger('handTool'); - var extensionElements = getExtensionElements(element); + return true; + } + }); - if (!extensionElements) { - return; - } + // activate global connect tool + // C + addListener('globalConnectTool', function(context) { - var matcher; + var event = context.keyEvent; - if (binding.type === 'camunda:in') { - matcher = function(e) { - return is(e, 'camunda:In') && isInOut(e, binding); - }; - } else - if (binding.type === 'camunda:out') { - matcher = function(e) { - return is(e, 'camunda:Out') && isInOut(e, binding); - }; - } else - if (binding.type === 'camunda:in:businessKey') { - matcher = function(e) { - return is(e, 'camunda:In') && 'businessKey' in e; - }; - } + if (keyboard.hasModifier(event)) { + return; + } - return find(extensionElements.get('values'), matcher); - } + if (keyboard.isKey([ 'c', 'C' ], event)) { + editorActions.trigger('globalConnectTool'); - module.exports.findCamundaInOut = findCamundaInOut; + return true; + } + }); - function findCamundaProperty(camundaProperties, binding) { - return find(camundaProperties.get('values'), function(p) { - return p.name === binding.name; - }); - } + // activate direct editing + // E + addListener('directEditing', function(context) { - module.exports.findCamundaProperty = findCamundaProperty; + var event = context.keyEvent; + if (keyboard.hasModifier(event)) { + return; + } - function findInputParameter(inputOutput, binding) { - var parameters = inputOutput.get('inputParameters'); + if (keyboard.isKey([ 'e', 'E' ], event)) { + editorActions.trigger('directEditing'); - return find(parameters, function(p) { - return p.name === binding.name; - }); - } + return true; + } + }); - module.exports.findInputParameter = findInputParameter; + // activate replace element + // R + addListener('replaceElement', function(context) { + var event = context.keyEvent; - function findOutputParameter(inputOutput, binding) { - var parameters = inputOutput.get('outputParameters'); + if (keyboard.hasModifier(event)) { + return; + } - return find(parameters, function(p) { - var value = p.value; + if (keyboard.isKey([ 'r', 'R' ], event)) { + editorActions.trigger('replaceElement', event); - if (!binding.scriptFormat) { - return value === binding.source; - } + return true; + } + }); - var definition = p.definition; +}; - if (!definition || binding.scriptFormat !== definition.scriptFormat) { - return false; - } +/***/ }), - return definition.value === binding.source; - }); - } +/***/ "../node_modules/bpmn-js/lib/features/keyboard/index.js": +/*!**************************************************************!*\ + !*** ../node_modules/bpmn-js/lib/features/keyboard/index.js ***! + \**************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - module.exports.findOutputParameter = findOutputParameter; +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var diagram_js_lib_features_keyboard__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! diagram-js/lib/features/keyboard */ "../node_modules/diagram-js/lib/features/keyboard/index.js"); +/* harmony import */ var _BpmnKeyboardBindings__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./BpmnKeyboardBindings */ "../node_modules/bpmn-js/lib/features/keyboard/BpmnKeyboardBindings.js"); -// helpers ///////////////////////////////// - function getExtensionElements(element) { - var bo = getBusinessObject(element); +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ + __depends__: [ + diagram_js_lib_features_keyboard__WEBPACK_IMPORTED_MODULE_0__["default"] + ], + __init__: [ 'keyboardBindings' ], + keyboardBindings: [ 'type', _BpmnKeyboardBindings__WEBPACK_IMPORTED_MODULE_1__["default"] ] +}); - if (is(bo, 'bpmn:ExtensionElements')) { - return bo; - } else { - return bo.extensionElements; - } - } +/***/ }), - function isInOut(element, binding) { +/***/ "../node_modules/bpmn-js/lib/features/label-editing/LabelEditingPreview.js": +/*!*********************************************************************************!*\ + !*** ../node_modules/bpmn-js/lib/features/label-editing/LabelEditingPreview.js ***! + \*********************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - if (binding.type === 'camunda:in') { - // find based on target attribute - if (binding.target) { - return element.target === binding.target; - } - } +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ LabelEditingPreview) +/* harmony export */ }); +/* harmony import */ var tiny_svg__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! tiny-svg */ "../node_modules/tiny-svg/dist/index.esm.js"); +/* harmony import */ var _util_ModelUtil__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../util/ModelUtil */ "../node_modules/bpmn-js/lib/util/ModelUtil.js"); +/* harmony import */ var diagram_js_lib_util_SvgTransformUtil__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! diagram-js/lib/util/SvgTransformUtil */ "../node_modules/diagram-js/lib/util/SvgTransformUtil.js"); - if (binding.type === 'camunda:out') { - // find based on source / sourceExpression - if (binding.source) { - return element.source === binding.source; - } - if (binding.sourceExpression) { - return element.sourceExpression === binding.sourceExpression; - } - } - // find based variables / local combination - if (binding.variables) { - return element.variables === 'all' && ( - binding.variables !== 'local' || element.local - ); - } - } - },{"bpmn-js/lib/features/modeling/util/ModelingUtil":211,"bpmn-js/lib/util/ModelUtil":240,"lodash/find":610}],57:[function(require,module,exports){ - 'use strict'; - var isArray = require('lodash/isArray'); - var isObject = require('lodash/isObject'); - var DROPDOWN_TYPE = 'Dropdown'; +/** + * @typedef {import('diagram-js/lib/core/Canvas').default} Canvas + * @typedef {import('diagram-js/lib/core/EventBus').default} EventBus + * @typedef {import('../../draw/PathMap').default} PathMap + */ - var VALID_TYPES = [ 'String', 'Text', 'Boolean', 'Hidden', DROPDOWN_TYPE ]; +var MARKER_HIDDEN = 'djs-element-hidden', + MARKER_LABEL_HIDDEN = 'djs-label-hidden'; - var PROPERTY_TYPE = 'property', - CAMUNDA_PROPERTY_TYPE = 'camunda:property', - CAMUNDA_INPUT_PARAMETER_TYPE = 'camunda:inputParameter', - CAMUNDA_OUTPUT_PARAMETER_TYPE = 'camunda:outputParameter', - CAMUNDA_IN_TYPE = 'camunda:in', - CAMUNDA_OUT_TYPE = 'camunda:out', - CAMUNDA_IN_BUSINESS_KEY_TYPE = 'camunda:in:businessKey', - CAMUNDA_EXECUTION_LISTENER = 'camunda:executionListener', - CAMUNDA_FIELD = 'camunda:field'; +/** + * @param {EventBus} eventBus + * @param {Canvas} canvas + * @param {PathMap} pathMap + */ +function LabelEditingPreview(eventBus, canvas, pathMap) { - var VALID_BINDING_TYPES = [ - PROPERTY_TYPE, - CAMUNDA_PROPERTY_TYPE, - CAMUNDA_INPUT_PARAMETER_TYPE, - CAMUNDA_OUTPUT_PARAMETER_TYPE, - CAMUNDA_IN_TYPE, - CAMUNDA_OUT_TYPE, - CAMUNDA_IN_BUSINESS_KEY_TYPE, - CAMUNDA_EXECUTION_LISTENER, - CAMUNDA_FIELD - ]; + var self = this; + var defaultLayer = canvas.getDefaultLayer(); - /** - * A element template validator. - */ - function Validator() { + var element, absoluteElementBBox, gfx; - this._templatesById = {}; + eventBus.on('directEditing.activate', function(context) { + var activeProvider = context.active; - this._validTemplates = []; - this._errors = []; + element = activeProvider.element.label || activeProvider.element; + // text annotation + if ((0,_util_ModelUtil__WEBPACK_IMPORTED_MODULE_0__.is)(element, 'bpmn:TextAnnotation')) { + absoluteElementBBox = canvas.getAbsoluteBBox(element); - /** - * Adds the templates. - * - * @param {Array} templates - * - * @return {Validator} self - */ - this.addAll = function(templates) { + gfx = (0,tiny_svg__WEBPACK_IMPORTED_MODULE_1__.create)('g'); - if (!isArray(templates)) { - this._logError('templates must be []'); - } else { - templates.forEach(this.add, this); - } + var textPathData = pathMap.getScaledPath('TEXT_ANNOTATION', { + xScaleFactor: 1, + yScaleFactor: 1, + containerWidth: element.width, + containerHeight: element.height, + position: { + mx: 0.0, + my: 0.0 + } + }); - return this; - }; + var path = self.path = (0,tiny_svg__WEBPACK_IMPORTED_MODULE_1__.create)('path'); - /** - * Add the given element template, if it is valid. - * - * @param {TemplateDescriptor} template - * - * @return {Validator} self - */ - this.add = function(template) { + (0,tiny_svg__WEBPACK_IMPORTED_MODULE_1__.attr)(path, { + d: textPathData, + strokeWidth: 2, + stroke: getStrokeColor(element) + }); - var err = this._validateTemplate(template); + (0,tiny_svg__WEBPACK_IMPORTED_MODULE_1__.append)(gfx, path); - if (!err) { - this._templatesById[template.id] = template; + (0,tiny_svg__WEBPACK_IMPORTED_MODULE_1__.append)(defaultLayer, gfx); - this._validTemplates.push(template); - } + (0,diagram_js_lib_util_SvgTransformUtil__WEBPACK_IMPORTED_MODULE_2__.translate)(gfx, element.x, element.y); + } - return this; - }; + if ((0,_util_ModelUtil__WEBPACK_IMPORTED_MODULE_0__.is)(element, 'bpmn:TextAnnotation') || + element.labelTarget) { + canvas.addMarker(element, MARKER_HIDDEN); + } else if ((0,_util_ModelUtil__WEBPACK_IMPORTED_MODULE_0__.is)(element, 'bpmn:Task') || + (0,_util_ModelUtil__WEBPACK_IMPORTED_MODULE_0__.is)(element, 'bpmn:CallActivity') || + (0,_util_ModelUtil__WEBPACK_IMPORTED_MODULE_0__.is)(element, 'bpmn:SubProcess') || + (0,_util_ModelUtil__WEBPACK_IMPORTED_MODULE_0__.is)(element, 'bpmn:Participant')) { + canvas.addMarker(element, MARKER_LABEL_HIDDEN); + } + }); - /** - * Validate given template and return error (if any). - * - * @param {TemplateDescriptor} template - * - * @return {Error} validation error, if any - */ - this._validateTemplate = function(template) { - - var err, - id = template.id, - appliesTo = template.appliesTo, - properties = template.properties, - scopes = template.scopes; - - if (!id) { - return this._logError('missing template id'); - } + eventBus.on('directEditing.resize', function(context) { - if (id in this._templatesById) { - return this._logError('template id <' + id + '> already used'); - } + // text annotation + if ((0,_util_ModelUtil__WEBPACK_IMPORTED_MODULE_0__.is)(element, 'bpmn:TextAnnotation')) { + var height = context.height, + dy = context.dy; - if (!isArray(appliesTo)) { - err = this._logError('missing appliesTo=[]', template); - } + var newElementHeight = Math.max(element.height / absoluteElementBBox.height * (height + dy), 0); - if (!isArray(properties)) { - err = this._logError('missing properties=[]', template); - } else { - if (!this._validateProperties(properties)) { - err = new Error('invalid properties'); - } - } + var textPathData = pathMap.getScaledPath('TEXT_ANNOTATION', { + xScaleFactor: 1, + yScaleFactor: 1, + containerWidth: element.width, + containerHeight: newElementHeight, + position: { + mx: 0.0, + my: 0.0 + } + }); - if (scopes) { - err = this._validateScopes(template, scopes); - } + (0,tiny_svg__WEBPACK_IMPORTED_MODULE_1__.attr)(self.path, { + d: textPathData + }); + } + }); - return err; - }; + eventBus.on([ 'directEditing.complete', 'directEditing.cancel' ], function(context) { + var activeProvider = context.active; - this._validateScopes = function(template, scopes) { + if (activeProvider) { + canvas.removeMarker(activeProvider.element.label || activeProvider.element, MARKER_HIDDEN); + canvas.removeMarker(element, MARKER_LABEL_HIDDEN); + } - var err, - scope, - scopeName; + element = undefined; + absoluteElementBBox = undefined; - if (!isObject(scopes) || isArray(scopes)) { - return this._logError('invalid scopes, should be scopes={}', template); - } + if (gfx) { + (0,tiny_svg__WEBPACK_IMPORTED_MODULE_1__.remove)(gfx); - for (scopeName in scopes) { - scope = scopes[scopeName]; + gfx = undefined; + } + }); +} - if (!isObject(scope) || isArray(scope)) { - err = this._logError('invalid scope, should be scope={}', template); - } +LabelEditingPreview.$inject = [ + 'eventBus', + 'canvas', + 'pathMap' +]; - if (!isArray(scope.properties)) { - err = this._logError( - 'missing properties=[] in scope <' + scopeName + '>', template - ); - } else { - if (!this._validateProperties(scope.properties)) { - err = new Error('invalid properties in scope <' + scopeName + '>'); - } - } - } - return err; - }; +// helpers ////////// - /** - * Validate properties and return false if any is invalid. - * - * @param {Array} properties - * - * @return {Boolean} true if all properties are valid - */ - this._validateProperties = function(properties) { - var validProperties = properties.filter(this._validateProperty, this); - - return properties.length === validProperties.length; - }; +function getStrokeColor(element, defaultColor) { + var di = (0,_util_ModelUtil__WEBPACK_IMPORTED_MODULE_0__.getDi)(element); - /** - * Validate property and return false, if there was - * a validation error. - * - * @param {PropertyDescriptor} property - * - * @return {Boolean} true if property is valid - */ - this._validateProperty = function(property) { + return di.get('stroke') || defaultColor || 'black'; +} - var type = property.type, - binding = property.binding; +/***/ }), - var err; +/***/ "../node_modules/bpmn-js/lib/features/label-editing/LabelEditingProvider.js": +/*!**********************************************************************************!*\ + !*** ../node_modules/bpmn-js/lib/features/label-editing/LabelEditingProvider.js ***! + \**********************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - var bindingType = binding.type; +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ LabelEditingProvider) +/* harmony export */ }); +/* harmony import */ var min_dash__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! min-dash */ "../node_modules/min-dash/dist/index.esm.js"); +/* harmony import */ var _util_LabelUtil__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../util/LabelUtil */ "../node_modules/bpmn-js/lib/util/LabelUtil.js"); +/* harmony import */ var _modeling_util_ModelingUtil__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../modeling/util/ModelingUtil */ "../node_modules/bpmn-js/lib/util/ModelUtil.js"); +/* harmony import */ var _util_DiUtil__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../util/DiUtil */ "../node_modules/bpmn-js/lib/util/DiUtil.js"); +/* harmony import */ var _util_LabelUtil__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../util/LabelUtil */ "../node_modules/diagram-js/lib/util/ModelUtil.js"); - if (VALID_TYPES.indexOf(type) === -1) { - err = this._logError( - 'invalid property type <' + type + '>; ' + - 'must be any of { ' + VALID_TYPES.join(', ') + ' }' - ); - } - if (type === DROPDOWN_TYPE && bindingType !== CAMUNDA_EXECUTION_LISTENER) { - if (!isArray(property.choices)) { - err = this._logError( - 'must provide choices=[] with ' + DROPDOWN_TYPE + ' type' - ); - } else - - if (!property.choices.every(isDropdownChoiceValid)) { - err = this._logError( - '{ name, value } must be specified for ' + - DROPDOWN_TYPE + ' choices' - ); - } - } - if (!binding) { - return this._logError('property missing binding'); - } - if (VALID_BINDING_TYPES.indexOf(bindingType) === -1) { - err = this._logError( - 'invalid property.binding type <' + bindingType + '>; ' + - 'must be any of { ' + VALID_BINDING_TYPES.join(', ') + ' }' - ); - } - if (bindingType === PROPERTY_TYPE || - bindingType === CAMUNDA_PROPERTY_TYPE || - bindingType === CAMUNDA_INPUT_PARAMETER_TYPE || - bindingType === CAMUNDA_FIELD) { - if (!binding.name) { - err = this._logError( - 'property.binding <' + bindingType + '> requires name' - ); - } - } - if (bindingType === CAMUNDA_OUTPUT_PARAMETER_TYPE) { - if (!binding.source) { - err = this._logError( - 'property.binding <' + bindingType + '> requires source' - ); - } - } - if (bindingType === CAMUNDA_IN_TYPE) { - if (!binding.variables && !binding.target) { - err = this._logError( - 'property.binding <' + bindingType + '> requires ' + - 'variables or target' - ); - } - } - if (bindingType === CAMUNDA_OUT_TYPE) { - if (!binding.variables && !binding.source && !binding.sourceExpression) { - err = this._logError( - 'property.binding <' + bindingType + '> requires ' + - 'variables, sourceExpression or source' - ); - } - } - if (bindingType === CAMUNDA_EXECUTION_LISTENER) { +/** + * @typedef {import('diagram-js/lib/core/EventBus').default} EventBus + * @typedef {import('../modeling/BpmnFactory').default} BpmnFactory + * @typedef {import('diagram-js/lib/core/Canvas').default} Canvas + * @typedef {import('diagram-js-direct-editing/lib/DirectEditing').default} DirectEditing + * @typedef {import('../modeling/Modeling').default} Modeling + * @typedef {import('diagram-js/lib/features/resize/ResizeHandles').default} ResizeHandles + * @typedef {import('../../draw/TextRenderer').default} TextRenderer + * + * @typedef {import('../../model/Types').Element} Element + * + * @typedef { { + * bounds: { + * x: number; + * y: number; + * width: number; + * height: number; + * minWidth?: number; + * minHeight?: number; + * }; + * style: Object; + * } } DirectEditingContext + */ - if (type !== 'Hidden') { - err = this._logError( - 'invalid property type <' + type + '> for ' + CAMUNDA_EXECUTION_LISTENER + '; ' + - 'must be ' - ); - } - } +var HIGH_PRIORITY = 2000; - return !err; - }; +/** + * @param {EventBus} eventBus + * @param {BpmnFactory} bpmnFactory + * @param {Canvas} canvas + * @param {DirectEditing} directEditing + * @param {Modeling} modeling + * @param {ResizeHandles} resizeHandles + * @param {TextRenderer} textRenderer + */ +function LabelEditingProvider( + eventBus, bpmnFactory, canvas, directEditing, + modeling, resizeHandles, textRenderer) { + + this._bpmnFactory = bpmnFactory; + this._canvas = canvas; + this._modeling = modeling; + this._textRenderer = textRenderer; + + directEditing.registerProvider(this); + + // listen to dblclick on non-root elements + eventBus.on('element.dblclick', function(event) { + activateDirectEdit(event.element, true); + }); + + // complete on followup canvas operation + eventBus.on([ + 'autoPlace.start', + 'canvas.viewbox.changing', + 'drag.init', + 'element.mousedown', + 'popupMenu.open', + 'root.set', + 'selection.changed' + ], function() { + if (directEditing.isActive()) { + directEditing.complete(); + } + }); + + eventBus.on([ + 'shape.remove', + 'connection.remove' + ], HIGH_PRIORITY, function(event) { + + if (directEditing.isActive(event.element)) { + directEditing.cancel(); + } + }); + + // cancel on command stack changes + eventBus.on([ 'commandStack.changed' ], function(e) { + if (directEditing.isActive()) { + directEditing.cancel(); + } + }); + + + eventBus.on('directEditing.activate', function(event) { + resizeHandles.removeResizers(); + }); + + eventBus.on('create.end', 500, function(event) { + + var context = event.context, + element = context.shape, + canExecute = event.context.canExecute, + isTouch = event.isTouch; + + // TODO(nikku): we need to find a way to support the + // direct editing on mobile devices; right now this will + // break for desworkflowediting on mobile devices + // as it breaks the user interaction workflow + + // TODO(nikku): we should temporarily focus the edited element + // here and release the focused viewport after the direct edit + // operation is finished + if (isTouch) { + return; + } + + if (!canExecute) { + return; + } + + if (context.hints && context.hints.createElementsBehavior === false) { + return; + } + + activateDirectEdit(element); + }); + + eventBus.on('autoPlace.end', 500, function(event) { + activateDirectEdit(event.shape); + }); + + + function activateDirectEdit(element, force) { + if (force || + (0,_modeling_util_ModelingUtil__WEBPACK_IMPORTED_MODULE_0__.isAny)(element, [ 'bpmn:Task', 'bpmn:TextAnnotation', 'bpmn:Participant' ]) || + isCollapsedSubProcess(element)) { + + directEditing.activate(element); + } + } + +} + +LabelEditingProvider.$inject = [ + 'eventBus', + 'bpmnFactory', + 'canvas', + 'directEditing', + 'modeling', + 'resizeHandles', + 'textRenderer' +]; + + +/** + * Activate direct editing for activities and text annotations. + * + * @param {Element} element + * + * @return { { + * text: string; + * options?: { + * autoResize?: boolean; + * centerVertically?: boolean; + * resizable?: boolean; + * } + * } & DirectEditingContext } + */ +LabelEditingProvider.prototype.activate = function(element) { + + // text + var text = (0,_util_LabelUtil__WEBPACK_IMPORTED_MODULE_1__.getLabel)(element); + + if (text === undefined) { + return; + } + + var context = { + text: text + }; + + // bounds + var bounds = this.getEditingBBox(element); + + (0,min_dash__WEBPACK_IMPORTED_MODULE_2__.assign)(context, bounds); + + var options = {}; + + // tasks + if ( + (0,_modeling_util_ModelingUtil__WEBPACK_IMPORTED_MODULE_0__.isAny)(element, [ + 'bpmn:Task', + 'bpmn:Participant', + 'bpmn:Lane', + 'bpmn:CallActivity' + ]) || + isCollapsedSubProcess(element) + ) { + (0,min_dash__WEBPACK_IMPORTED_MODULE_2__.assign)(options, { + centerVertically: true + }); + } + + // external labels + if ((0,_util_LabelUtil__WEBPACK_IMPORTED_MODULE_1__.isLabelExternal)(element)) { + (0,min_dash__WEBPACK_IMPORTED_MODULE_2__.assign)(options, { + autoResize: true + }); + } + + // text annotations + if ((0,_modeling_util_ModelingUtil__WEBPACK_IMPORTED_MODULE_0__.is)(element, 'bpmn:TextAnnotation')) { + (0,min_dash__WEBPACK_IMPORTED_MODULE_2__.assign)(options, { + resizable: true, + autoResize: true + }); + } + + (0,min_dash__WEBPACK_IMPORTED_MODULE_2__.assign)(context, { + options: options + }); + + return context; +}; + + +/** + * Get the editing bounding box based on the element's size and position. + * + * @param {Element} element + * + * @return {DirectEditingContext} + */ +LabelEditingProvider.prototype.getEditingBBox = function(element) { + var canvas = this._canvas; + + var target = element.label || element; + + var bbox = canvas.getAbsoluteBBox(target); + + var mid = { + x: bbox.x + bbox.width / 2, + y: bbox.y + bbox.height / 2 + }; + + // default position + var bounds = { x: bbox.x, y: bbox.y }; + + var zoom = canvas.zoom(); + + var defaultStyle = this._textRenderer.getDefaultStyle(), + externalStyle = this._textRenderer.getExternalStyle(); + + // take zoom into account + var externalFontSize = externalStyle.fontSize * zoom, + externalLineHeight = externalStyle.lineHeight, + defaultFontSize = defaultStyle.fontSize * zoom, + defaultLineHeight = defaultStyle.lineHeight; + + var style = { + fontFamily: this._textRenderer.getDefaultStyle().fontFamily, + fontWeight: this._textRenderer.getDefaultStyle().fontWeight + }; + + // adjust for expanded pools AND lanes + if ((0,_modeling_util_ModelingUtil__WEBPACK_IMPORTED_MODULE_0__.is)(element, 'bpmn:Lane') || isExpandedPool(element)) { + var isHorizontalLane = (0,_util_DiUtil__WEBPACK_IMPORTED_MODULE_3__.isHorizontal)(element); + + var laneBounds = isHorizontalLane ? { + width: bbox.height, + height: 30 * zoom, + x: bbox.x - bbox.height / 2 + (15 * zoom), + y: mid.y - (30 * zoom) / 2 + } : { + width: bbox.width, + height: 30 * zoom + }; + + (0,min_dash__WEBPACK_IMPORTED_MODULE_2__.assign)(bounds, laneBounds); + + (0,min_dash__WEBPACK_IMPORTED_MODULE_2__.assign)(style, { + fontSize: defaultFontSize + 'px', + lineHeight: defaultLineHeight, + paddingTop: (7 * zoom) + 'px', + paddingBottom: (7 * zoom) + 'px', + paddingLeft: (5 * zoom) + 'px', + paddingRight: (5 * zoom) + 'px', + transform: isHorizontalLane ? 'rotate(-90deg)' : null + }); + } + + + // internal labels for collapsed participants + if (isCollapsedPool(element)) { + var isHorizontalPool = (0,_util_DiUtil__WEBPACK_IMPORTED_MODULE_3__.isHorizontal)(element); + + var poolBounds = isHorizontalPool ? { + width: bbox.width, + height: bbox.height + } : { + width: bbox.height, + height: bbox.width, + x: mid.x - bbox.height / 2, + y: mid.y - bbox.width / 2 + }; + + (0,min_dash__WEBPACK_IMPORTED_MODULE_2__.assign)(bounds, poolBounds); + + (0,min_dash__WEBPACK_IMPORTED_MODULE_2__.assign)(style, { + fontSize: defaultFontSize + 'px', + lineHeight: defaultLineHeight, + paddingTop: (7 * zoom) + 'px', + paddingBottom: (7 * zoom) + 'px', + paddingLeft: (5 * zoom) + 'px', + paddingRight: (5 * zoom) + 'px', + transform: isHorizontalPool ? null : 'rotate(-90deg)' + }); + } + + + // internal labels for tasks and collapsed call activities + // and sub processes + if ((0,_modeling_util_ModelingUtil__WEBPACK_IMPORTED_MODULE_0__.isAny)(element, [ 'bpmn:Task', 'bpmn:CallActivity' ]) || + isCollapsedSubProcess(element)) { + + (0,min_dash__WEBPACK_IMPORTED_MODULE_2__.assign)(bounds, { + width: bbox.width, + height: bbox.height + }); + + (0,min_dash__WEBPACK_IMPORTED_MODULE_2__.assign)(style, { + fontSize: defaultFontSize + 'px', + lineHeight: defaultLineHeight, + paddingTop: (7 * zoom) + 'px', + paddingBottom: (7 * zoom) + 'px', + paddingLeft: (5 * zoom) + 'px', + paddingRight: (5 * zoom) + 'px' + }); + } + + + // internal labels for expanded sub processes + if (isExpandedSubProcess(element)) { + (0,min_dash__WEBPACK_IMPORTED_MODULE_2__.assign)(bounds, { + width: bbox.width, + x: bbox.x + }); + + (0,min_dash__WEBPACK_IMPORTED_MODULE_2__.assign)(style, { + fontSize: defaultFontSize + 'px', + lineHeight: defaultLineHeight, + paddingTop: (7 * zoom) + 'px', + paddingBottom: (7 * zoom) + 'px', + paddingLeft: (5 * zoom) + 'px', + paddingRight: (5 * zoom) + 'px' + }); + } + + var width = 90 * zoom, + paddingTop = 7 * zoom, + paddingBottom = 4 * zoom; + + // external labels for events, data elements, gateways, groups and connections + if (target.labelTarget) { + (0,min_dash__WEBPACK_IMPORTED_MODULE_2__.assign)(bounds, { + width: width, + height: bbox.height + paddingTop + paddingBottom, + x: mid.x - width / 2, + y: bbox.y - paddingTop + }); + + (0,min_dash__WEBPACK_IMPORTED_MODULE_2__.assign)(style, { + fontSize: externalFontSize + 'px', + lineHeight: externalLineHeight, + paddingTop: paddingTop + 'px', + paddingBottom: paddingBottom + 'px' + }); + } + + // external label not yet created + if ((0,_util_LabelUtil__WEBPACK_IMPORTED_MODULE_1__.isLabelExternal)(target) + && !(0,_util_LabelUtil__WEBPACK_IMPORTED_MODULE_1__.hasExternalLabel)(target) + && !(0,_util_LabelUtil__WEBPACK_IMPORTED_MODULE_4__.isLabel)(target)) { + + var externalLabelMid = (0,_util_LabelUtil__WEBPACK_IMPORTED_MODULE_1__.getExternalLabelMid)(element); + + var absoluteBBox = canvas.getAbsoluteBBox({ + x: externalLabelMid.x, + y: externalLabelMid.y, + width: 0, + height: 0 + }); + + var height = externalFontSize + paddingTop + paddingBottom; + + (0,min_dash__WEBPACK_IMPORTED_MODULE_2__.assign)(bounds, { + width: width, + height: height, + x: absoluteBBox.x - width / 2, + y: absoluteBBox.y - height / 2 + }); + + (0,min_dash__WEBPACK_IMPORTED_MODULE_2__.assign)(style, { + fontSize: externalFontSize + 'px', + lineHeight: externalLineHeight, + paddingTop: paddingTop + 'px', + paddingBottom: paddingBottom + 'px' + }); + } + + // text annotations + if ((0,_modeling_util_ModelingUtil__WEBPACK_IMPORTED_MODULE_0__.is)(element, 'bpmn:TextAnnotation')) { + (0,min_dash__WEBPACK_IMPORTED_MODULE_2__.assign)(bounds, { + width: bbox.width, + height: bbox.height, + minWidth: 30 * zoom, + minHeight: 10 * zoom + }); + + (0,min_dash__WEBPACK_IMPORTED_MODULE_2__.assign)(style, { + textAlign: 'left', + paddingTop: (5 * zoom) + 'px', + paddingBottom: (7 * zoom) + 'px', + paddingLeft: (7 * zoom) + 'px', + paddingRight: (5 * zoom) + 'px', + fontSize: defaultFontSize + 'px', + lineHeight: defaultLineHeight + }); + } + + return { bounds: bounds, style: style }; +}; + + +LabelEditingProvider.prototype.update = function( + element, newLabel, + activeContextText, bounds) { + + var newBounds, + bbox; + + if ((0,_modeling_util_ModelingUtil__WEBPACK_IMPORTED_MODULE_0__.is)(element, 'bpmn:TextAnnotation')) { + + bbox = this._canvas.getAbsoluteBBox(element); + + newBounds = { + x: element.x, + y: element.y, + width: element.width / bbox.width * bounds.width, + height: element.height / bbox.height * bounds.height + }; + } + + if (isEmptyText(newLabel)) { + newLabel = null; + } + + this._modeling.updateLabel(element, newLabel, newBounds); +}; + + + +// helpers ////////// + +function isCollapsedSubProcess(element) { + return (0,_modeling_util_ModelingUtil__WEBPACK_IMPORTED_MODULE_0__.is)(element, 'bpmn:SubProcess') && !(0,_util_DiUtil__WEBPACK_IMPORTED_MODULE_3__.isExpanded)(element); +} + +function isExpandedSubProcess(element) { + return (0,_modeling_util_ModelingUtil__WEBPACK_IMPORTED_MODULE_0__.is)(element, 'bpmn:SubProcess') && (0,_util_DiUtil__WEBPACK_IMPORTED_MODULE_3__.isExpanded)(element); +} + +function isCollapsedPool(element) { + return (0,_modeling_util_ModelingUtil__WEBPACK_IMPORTED_MODULE_0__.is)(element, 'bpmn:Participant') && !(0,_util_DiUtil__WEBPACK_IMPORTED_MODULE_3__.isExpanded)(element); +} +function isExpandedPool(element) { + return (0,_modeling_util_ModelingUtil__WEBPACK_IMPORTED_MODULE_0__.is)(element, 'bpmn:Participant') && (0,_util_DiUtil__WEBPACK_IMPORTED_MODULE_3__.isExpanded)(element); +} - this._logError = function(err, template) { +function isEmptyText(label) { + return !label || !label.trim(); +} - if (typeof err === 'string') { - if (template) { - err = 'template(id: ' + template.id + ') ' + err; - } +/***/ }), - err = new Error(err); - } +/***/ "../node_modules/bpmn-js/lib/features/label-editing/cmd/UpdateLabelHandler.js": +/*!************************************************************************************!*\ + !*** ../node_modules/bpmn-js/lib/features/label-editing/cmd/UpdateLabelHandler.js ***! + \************************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - this._errors.push(err); +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ UpdateLabelHandler) +/* harmony export */ }); +/* harmony import */ var _util_LabelUtil__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../util/LabelUtil */ "../node_modules/bpmn-js/lib/util/LabelUtil.js"); +/* harmony import */ var _util_LabelUtil__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../util/LabelUtil */ "../node_modules/diagram-js/lib/util/ModelUtil.js"); +/* harmony import */ var _util_ModelUtil__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../util/ModelUtil */ "../node_modules/bpmn-js/lib/util/ModelUtil.js"); - return err; - }; - this.getErrors = function() { - return this._errors; - }; - this.getValidTemplates = function() { - return this._validTemplates; - }; - } - module.exports = Validator; -// helpers /////////////////////////////////// +var NULL_DIMENSIONS = { + width: 0, + height: 0 +}; - function isDropdownChoiceValid(c) { - return 'name' in c && 'value' in c; - } +/** + * @typedef {import('../../modeling/Modeling').default} Modeling + * @typedef {import('../../../draw/TextRenderer').default} TextRenderer + * @typedef {import('../../modeling/BpmnFactory').default} BpmnFactory + * + * @typedef {import('../../../model/Types').Element} Element + */ - },{"lodash/isArray":618,"lodash/isObject":625}],58:[function(require,module,exports){ - 'use strict'; +/** + * A handler that updates the text of a BPMN element. + * + * @param {Modeling} modeling + * @param {TextRenderer} textRenderer + * @param {BpmnFactory} bpmnFactory + */ +function UpdateLabelHandler(modeling, textRenderer, bpmnFactory) { - var findExtension = require('../Helper').findExtension, - findExtensions = require('../Helper').findExtensions; + /** + * Set the label and return the changed elements. + * + * Element parameter can be label itself or connection (i.e. sequence flow). + * + * @param {Element} element + * @param {string} text + */ + function setText(element, text) { - var createCamundaProperty = require('../CreateHelper').createCamundaProperty, - createInputParameter = require('../CreateHelper').createInputParameter, - createOutputParameter = require('../CreateHelper').createOutputParameter, - createCamundaIn = require('../CreateHelper').createCamundaIn, - createCamundaOut = require('../CreateHelper').createCamundaOut, - createCamundaInWithBusinessKey = require('../CreateHelper').createCamundaInWithBusinessKey, - createCamundaExecutionListenerScript = require('../CreateHelper').createCamundaExecutionListenerScript, - createCamundaFieldInjection = require('../CreateHelper').createCamundaFieldInjection; + // external label if present + var label = element.label || element; - var forEach = require('lodash/forEach'); + var labelTarget = element.labelTarget || element; - var CAMUNDA_SERVICE_TASK_LIKE = [ - 'camunda:class', - 'camunda:delegateExpression', - 'camunda:expression' - ]; + (0,_util_LabelUtil__WEBPACK_IMPORTED_MODULE_0__.setLabel)(label, text, labelTarget !== label); - /** - * A handler that changes the modeling template of a BPMN element. - */ - function ChangeElementTemplateHandler(modeling, commandStack, bpmnFactory) { + return [ label, labelTarget ]; + } - function getOrCreateExtensionElements(element) { + function preExecute(ctx) { + var element = ctx.element, + businessObject = element.businessObject, + newLabel = ctx.newLabel; - var bo = element.businessObject; + if (!(0,_util_LabelUtil__WEBPACK_IMPORTED_MODULE_1__.isLabel)(element) + && (0,_util_LabelUtil__WEBPACK_IMPORTED_MODULE_0__.isLabelExternal)(element) + && !(0,_util_LabelUtil__WEBPACK_IMPORTED_MODULE_0__.hasExternalLabel)(element) + && !isEmptyText(newLabel)) { + + // create label + var paddingTop = 7; - var extensionElements = bo.extensionElements; + var labelCenter = (0,_util_LabelUtil__WEBPACK_IMPORTED_MODULE_0__.getExternalLabelMid)(element); - // add extension elements - if (!extensionElements) { - extensionElements = bpmnFactory.create('bpmn:ExtensionElements', { - values: [] - }); + labelCenter = { + x: labelCenter.x, + y: labelCenter.y + paddingTop + }; - modeling.updateProperties(element, { - extensionElements: extensionElements - }); - } + modeling.createLabel(element, labelCenter, { + id: businessObject.id + '_label', + businessObject: businessObject, + di: element.di + }); + } + } - return extensionElements; - } + function execute(ctx) { + ctx.oldLabel = (0,_util_LabelUtil__WEBPACK_IMPORTED_MODULE_0__.getLabel)(ctx.element); + return setText(ctx.element, ctx.newLabel); + } - function updateModelerTemplate(element, newTemplate) { - modeling.updateProperties(element, { - 'camunda:modelerTemplate': newTemplate && newTemplate.id - }); - } + function revert(ctx) { + return setText(ctx.element, ctx.oldLabel); + } - function updateIoMappings(element, newTemplate, context) { + function postExecute(ctx) { + var element = ctx.element, + label = element.label || element, + newLabel = ctx.newLabel, + newBounds = ctx.newBounds, + hints = ctx.hints || {}; - var newMappings = createInputOutputMappings(newTemplate, bpmnFactory), - oldMappings; + // ignore internal labels for elements except text annotations + if (!(0,_util_LabelUtil__WEBPACK_IMPORTED_MODULE_1__.isLabel)(label) && !(0,_util_ModelUtil__WEBPACK_IMPORTED_MODULE_2__.is)(label, 'bpmn:TextAnnotation')) { + return; + } - if (!newMappings) { - return; - } + if ((0,_util_LabelUtil__WEBPACK_IMPORTED_MODULE_1__.isLabel)(label) && isEmptyText(newLabel)) { - if (context) { - commandStack.execute('properties-panel.update-businessobject', { - element: element, - businessObject: context, - properties: { inputOutput: newMappings } - }); - } else { - context = getOrCreateExtensionElements(element); - oldMappings = findExtension(element, 'camunda:InputOutput'); - commandStack.execute('properties-panel.update-businessobject-list', { - element: element, - currentObject: context, - propertyName: 'values', - objectsToAdd: [ newMappings ], - objectsToRemove: oldMappings ? [ oldMappings ] : [] - }); - } - } + if (hints.removeShape !== false) { + modeling.removeShape(label, { unsetLabel: false }); + } - function updateCamundaField(element, newTemplate, context) { + return; + } - var newMappings = createCamundaFieldInjections(newTemplate, bpmnFactory), - oldMappings; + var text = (0,_util_LabelUtil__WEBPACK_IMPORTED_MODULE_0__.getLabel)(element); - if (!newMappings) { - return; - } - if (context) { - commandStack.execute('properties-panel.update-businessobject', { - element: element, - businessObject: context, - properties: { field: newMappings } - }); - } else { - context = getOrCreateExtensionElements(element); - oldMappings = findExtensions(element, ['camunda:Field']); - - commandStack.execute('properties-panel.update-businessobject-list', { - element: element, - currentObject: context, - propertyName: 'values', - objectsToAdd: newMappings, - objectsToRemove: oldMappings ? oldMappings : [] - }); - } - } + // resize element based on label _or_ pre-defined bounds + if (typeof newBounds === 'undefined') { + newBounds = textRenderer.getExternalLabelBounds(label, text); + } + // setting newBounds to false or _null_ will + // disable the postExecute resize operation + if (newBounds) { + modeling.resizeShape(label, newBounds, NULL_DIMENSIONS); + } + } - function updateCamundaProperties(element, newTemplate, context) { + // API - var newProperties = createCamundaProperties(newTemplate, bpmnFactory), - oldProperties; + this.preExecute = preExecute; + this.execute = execute; + this.revert = revert; + this.postExecute = postExecute; +} - if (!newProperties) { - return; - } +UpdateLabelHandler.$inject = [ + 'modeling', + 'textRenderer', + 'bpmnFactory' +]; - if (context) { - commandStack.execute('properties-panel.update-businessobject', { - element: element, - businessObject: context, - properties: { properties: newProperties } - }); - } else { - context = getOrCreateExtensionElements(element); - oldProperties = findExtension(element, 'camunda:Properties'); - - commandStack.execute('properties-panel.update-businessobject-list', { - element: element, - currentObject: context, - propertyName: 'values', - objectsToAdd: [ newProperties ], - objectsToRemove: oldProperties ? [ oldProperties ] : [] - }); - } - } - function updateProperties(element, newTemplate, context) { +// helpers ////////// - var newProperties = createBpmnPropertyUpdates(newTemplate, bpmnFactory); +function isEmptyText(label) { + return !label || !label.trim(); +} - var newPropertiesCount = Object.keys(newProperties).length; +/***/ }), - if (!newPropertiesCount) { - return; - } +/***/ "../node_modules/bpmn-js/lib/features/label-editing/index.js": +/*!*******************************************************************!*\ + !*** ../node_modules/bpmn-js/lib/features/label-editing/index.js ***! + \*******************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - if (context) { - commandStack.execute('properties-panel.update-businessobject', { - element: element, - businessObject: context, - properties: newProperties - }); - } else { - modeling.updateProperties(element, newProperties); - } - } +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var diagram_js_lib_features_change_support__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! diagram-js/lib/features/change-support */ "../node_modules/diagram-js/lib/features/change-support/index.js"); +/* harmony import */ var diagram_js_lib_features_resize__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! diagram-js/lib/features/resize */ "../node_modules/diagram-js/lib/features/resize/index.js"); +/* harmony import */ var diagram_js_direct_editing__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! diagram-js-direct-editing */ "../node_modules/diagram-js-direct-editing/lib/index.js"); +/* harmony import */ var _LabelEditingProvider__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./LabelEditingProvider */ "../node_modules/bpmn-js/lib/features/label-editing/LabelEditingProvider.js"); +/* harmony import */ var _LabelEditingPreview__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./LabelEditingPreview */ "../node_modules/bpmn-js/lib/features/label-editing/LabelEditingPreview.js"); - function updateInOut(element, newTemplate, context) { - var newInOut = createCamundaInOut(newTemplate, bpmnFactory), - oldInOut; - if (!newInOut) { - return; - } - if (context) { - commandStack.execute('properties-panel.update-businessobject', { - element: element, - businessObject: context, - properties: { inout: newInOut } - }); - } else { - context = getOrCreateExtensionElements(element); - oldInOut = findExtensions(context, [ 'camunda:In', 'camunda:Out' ]); - - commandStack.execute('properties-panel.update-businessobject-list', { - element: element, - currentObject: context, - propertyName: 'values', - objectsToAdd: newInOut, - objectsToRemove: oldInOut - }); - } - } - function updateExecutionListener(element, newTemplate, context) { - var newExecutionListeners = createCamundaExecutionListeners(newTemplate, bpmnFactory), - oldExecutionsListeners; - if (!newExecutionListeners.length) { - return; - } - if (context) { - commandStack.execute('properties-panel.update-businessobject', { - element: element, - businessObject: context, - properties: { executionListener: newExecutionListeners } - }); - } else { - context = getOrCreateExtensionElements(element); - oldExecutionsListeners = findExtensions(context, [ 'camunda:ExecutionListener' ]); - - commandStack.execute('properties-panel.update-businessobject-list', { - element: element, - currentObject: context, - propertyName: 'values', - objectsToAdd: newExecutionListeners, - objectsToRemove: oldExecutionsListeners - }); - } - } +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ + __depends__: [ + diagram_js_lib_features_change_support__WEBPACK_IMPORTED_MODULE_1__["default"], + diagram_js_lib_features_resize__WEBPACK_IMPORTED_MODULE_2__["default"], + diagram_js_direct_editing__WEBPACK_IMPORTED_MODULE_0__["default"] + ], + __init__: [ + 'labelEditingProvider', + 'labelEditingPreview' + ], + labelEditingProvider: [ 'type', _LabelEditingProvider__WEBPACK_IMPORTED_MODULE_3__["default"] ], + labelEditingPreview: [ 'type', _LabelEditingPreview__WEBPACK_IMPORTED_MODULE_4__["default"] ] +}); - /** - * Update / recreate a scoped element. - * - * @param {djs.model.Base} element the diagram parent element - * @param {String} scopeName name of the scope, i.e. camunda:Connector - * @param {Object} scopeDefinition - */ - function updateScopeElements(element, scopeName, scopeDefinition) { - var scopeElement = bpmnFactory.create(scopeName); +/***/ }), - // update camunda:inputOutput - updateIoMappings(element, scopeDefinition, scopeElement); +/***/ "../node_modules/bpmn-js/lib/features/modeling-feedback/ModelingFeedback.js": +/*!**********************************************************************************!*\ + !*** ../node_modules/bpmn-js/lib/features/modeling-feedback/ModelingFeedback.js ***! + \**********************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - // update camunda:field - updateCamundaField(element, scopeDefinition, scopeElement); +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ ModelingFeedback) +/* harmony export */ }); +/* harmony import */ var _util_ModelUtil__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../util/ModelUtil */ "../node_modules/bpmn-js/lib/util/ModelUtil.js"); - // update camunda:properties - updateCamundaProperties(element, scopeDefinition, scopeElement); - // update other properties (bpmn:condition, camunda:async, ...) - updateProperties(element, scopeDefinition, scopeElement); +/** + * @typedef {import('diagram-js/lib/core/EventBus').default} EventBus + * @typedef {import('diagram-js/lib/features/tooltips/Tooltips').default} Tooltips + * @typedef {import('diagram-js/lib/i18n/translate/translate').default} Translate + */ - // update camunda:in and camunda:out - updateInOut(element, scopeDefinition, scopeElement); +var COLLAB_ERR_MSG = 'flow elements must be children of pools/participants'; - // update camunda:executionListener - updateExecutionListener(element, scopeDefinition, scopeElement); +/** + * @param {EventBus} eventBus + * @param {Tooltips} tooltips + * @param {Translate} translate + */ +function ModelingFeedback(eventBus, tooltips, translate) { - var extensionElements = getOrCreateExtensionElements(element); - var oldScope = findExtension(extensionElements, scopeName); + function showError(position, message, timeout) { + tooltips.add({ + position: { + x: position.x + 5, + y: position.y + 5 + }, + type: 'error', + timeout: timeout || 2000, + html: '
    ' + message + '
    ' + }); + } - commandStack.execute('properties-panel.update-businessobject-list', { - element: element, - currentObject: extensionElements, - propertyName: 'values', - objectsToAdd: [ scopeElement ], - objectsToRemove: oldScope ? [ oldScope ] : [] - }); - } + eventBus.on([ 'shape.move.rejected', 'create.rejected' ], function(event) { + var context = event.context, + shape = context.shape, + target = context.target; - /** - * Compose an element template change action, updating all - * necessary underlying properties. - * - * @param {Object} context - * @param {Object} context.element - * @param {Object} context.oldTemplate - * @param {Object} context.newTemplate - */ - this.preExecute = function(context) { + if ((0,_util_ModelUtil__WEBPACK_IMPORTED_MODULE_0__.is)(target, 'bpmn:Collaboration') && (0,_util_ModelUtil__WEBPACK_IMPORTED_MODULE_0__.is)(shape, 'bpmn:FlowNode')) { + showError(event, translate(COLLAB_ERR_MSG)); + } + }); - var element = context.element, - newTemplate = context.newTemplate; +} - // update camunda:modelerTemplate attribute - updateModelerTemplate(element, newTemplate); +ModelingFeedback.$inject = [ + 'eventBus', + 'tooltips', + 'translate' +]; - if (newTemplate) { - // update camunda:inputOutput - updateIoMappings(element, newTemplate); +/***/ }), - // update camunda:field - updateCamundaField(element, newTemplate); +/***/ "../node_modules/bpmn-js/lib/features/modeling-feedback/index.js": +/*!***********************************************************************!*\ + !*** ../node_modules/bpmn-js/lib/features/modeling-feedback/index.js ***! + \***********************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - // update camunda:properties - updateCamundaProperties(element, newTemplate); +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var diagram_js_lib_features_tooltips__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! diagram-js/lib/features/tooltips */ "../node_modules/diagram-js/lib/features/tooltips/index.js"); +/* harmony import */ var _ModelingFeedback__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./ModelingFeedback */ "../node_modules/bpmn-js/lib/features/modeling-feedback/ModelingFeedback.js"); - // update other properties (bpmn:condition, camunda:async, ...) - updateProperties(element, newTemplate); - // update camunda:in and camunda:out - updateInOut(element, newTemplate); - // update camunda:executionListener - updateExecutionListener(element, newTemplate); - // loop on scopes properties - forEach(newTemplate.scopes, function(scopeDefinition, scopeName) { - updateScopeElements(element, scopeName, scopeDefinition); - }); +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ + __depends__: [ + diagram_js_lib_features_tooltips__WEBPACK_IMPORTED_MODULE_0__["default"] + ], + __init__: [ + 'modelingFeedback' + ], + modelingFeedback: [ 'type', _ModelingFeedback__WEBPACK_IMPORTED_MODULE_1__["default"] ] +}); - } - }; - } +/***/ }), - ChangeElementTemplateHandler.$inject = [ 'modeling', 'commandStack', 'bpmnFactory' ]; +/***/ "../node_modules/bpmn-js/lib/features/modeling/BpmnFactory.js": +/*!********************************************************************!*\ + !*** ../node_modules/bpmn-js/lib/features/modeling/BpmnFactory.js ***! + \********************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - module.exports = ChangeElementTemplateHandler; +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ BpmnFactory) +/* harmony export */ }); +/* harmony import */ var min_dash__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! min-dash */ "../node_modules/min-dash/dist/index.esm.js"); +/* harmony import */ var _util_ModelingUtil__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../util/ModelUtil */ "../node_modules/bpmn-js/lib/util/ModelUtil.js"); -// helpers ///////////////////////////// - function createBpmnPropertyUpdates(template, bpmnFactory) { - var propertyUpdates = {}; - template.properties.forEach(function(p) { +/** + * @typedef {import('../../model/Types').Moddle} Moddle + * @typedef {import('../../model/Types').ModdleElement} ModdleElement + * + * @typedef {import('diagram-js/lib/util/Types').Point} Point + */ - var binding = p.binding, - bindingTarget = binding.name, - propertyValue; +/** + * A factory for BPMN elements. + * + * @param {Moddle} moddle + */ +function BpmnFactory(moddle) { + this._model = moddle; +} - if (binding.type === 'property') { +BpmnFactory.$inject = [ 'moddle' ]; - if (bindingTarget === 'conditionExpression') { - propertyValue = bpmnFactory.create('bpmn:FormalExpression', { - body: p.value, - language: binding.scriptFormat - }); - } else { - propertyValue = p.value; - } +/** + * @param {ModdleElement} element + * + * @return {boolean} + */ +BpmnFactory.prototype._needsId = function(element) { + return (0,_util_ModelingUtil__WEBPACK_IMPORTED_MODULE_0__.isAny)(element, [ + 'bpmn:RootElement', + 'bpmn:FlowElement', + 'bpmn:MessageFlow', + 'bpmn:DataAssociation', + 'bpmn:Artifact', + 'bpmn:Participant', + 'bpmn:Lane', + 'bpmn:LaneSet', + 'bpmn:Process', + 'bpmn:Collaboration', + 'bpmndi:BPMNShape', + 'bpmndi:BPMNEdge', + 'bpmndi:BPMNDiagram', + 'bpmndi:BPMNPlane', + 'bpmn:Property', + 'bpmn:CategoryValue' + ]); +}; + +/** + * @param {ModdleElement} element + */ +BpmnFactory.prototype._ensureId = function(element) { + if (element.id) { + this._model.ids.claim(element.id, element); + return; + } + + // generate semantic ids for elements + // bpmn:SequenceFlow -> SequenceFlow_ID + var prefix; + + if ((0,_util_ModelingUtil__WEBPACK_IMPORTED_MODULE_0__.is)(element, 'bpmn:Activity')) { + prefix = 'Activity'; + } else if ((0,_util_ModelingUtil__WEBPACK_IMPORTED_MODULE_0__.is)(element, 'bpmn:Event')) { + prefix = 'Event'; + } else if ((0,_util_ModelingUtil__WEBPACK_IMPORTED_MODULE_0__.is)(element, 'bpmn:Gateway')) { + prefix = 'Gateway'; + } else if ((0,_util_ModelingUtil__WEBPACK_IMPORTED_MODULE_0__.isAny)(element, [ 'bpmn:SequenceFlow', 'bpmn:MessageFlow' ])) { + prefix = 'Flow'; + } else { + prefix = (element.$type || '').replace(/^[^:]*:/g, ''); + } + + prefix += '_'; + + if (!element.id && this._needsId(element)) { + element.id = this._model.ids.nextPrefixed(prefix, element); + } +}; + +/** + * Create BPMN element. + * + * @param {string} type + * @param {Object} [attrs] + * + * @return {ModdleElement} + */ +BpmnFactory.prototype.create = function(type, attrs) { + var element = this._model.create(type, attrs || {}); - // assigning camunda:async to true|false - // assigning bpmn:conditionExpression to { $type: 'bpmn:FormalExpression', ... } - propertyUpdates[bindingTarget] = propertyValue; - - // make sure we unset other "implementation types" - // when applying a camunda:class template onto a preconfigured - // camunda:delegateExpression element - if (CAMUNDA_SERVICE_TASK_LIKE.indexOf(bindingTarget) !== -1) { - CAMUNDA_SERVICE_TASK_LIKE.forEach(function(prop) { - if (prop !== bindingTarget) { - propertyUpdates[prop] = undefined; - } - }); - } - } - }); + this._ensureId(element); - return propertyUpdates; - } + return element; +}; - function createCamundaFieldInjections(template, bpmnFactory) { - var injections = []; +/** + * @return {ModdleElement} + */ +BpmnFactory.prototype.createDiLabel = function() { + return this.create('bpmndi:BPMNLabel', { + bounds: this.createDiBounds() + }); +}; + +/** + * @param {ModdleElement} semantic + * @param {Object} [attrs] + * @return {ModdleElement} + */ +BpmnFactory.prototype.createDiShape = function(semantic, attrs) { + return this.create('bpmndi:BPMNShape', (0,min_dash__WEBPACK_IMPORTED_MODULE_1__.assign)({ + bpmnElement: semantic, + bounds: this.createDiBounds() + }, attrs)); +}; + +/** + * @return {ModdleElement} + */ +BpmnFactory.prototype.createDiBounds = function(bounds) { + return this.create('dc:Bounds', bounds); +}; - template.properties.forEach(function(p) { - var binding = p.binding, - bindingType = binding.type; - if (bindingType === 'camunda:field') { - injections.push(createCamundaFieldInjection( - binding, p.value, bpmnFactory - )); - } - }); +/** + * @param {Point[]} waypoints + * + * @return {ModdleElement[]} + */ +BpmnFactory.prototype.createDiWaypoints = function(waypoints) { + var self = this; - if (injections.length) { - return injections; - } - } + return (0,min_dash__WEBPACK_IMPORTED_MODULE_1__.map)(waypoints, function(pos) { + return self.createDiWaypoint(pos); + }); +}; - function createCamundaProperties(template, bpmnFactory) { +/** + * @param {Point} point + * + * @return {ModdleElement} + */ +BpmnFactory.prototype.createDiWaypoint = function(point) { + return this.create('dc:Point', (0,min_dash__WEBPACK_IMPORTED_MODULE_1__.pick)(point, [ 'x', 'y' ])); +}; - var properties = []; +/** + * @param {ModdleElement} semantic + * @param {Object} [attrs] + * + * @return {ModdleElement} + */ +BpmnFactory.prototype.createDiEdge = function(semantic, attrs) { + return this.create('bpmndi:BPMNEdge', (0,min_dash__WEBPACK_IMPORTED_MODULE_1__.assign)({ + bpmnElement: semantic, + waypoint: this.createDiWaypoints([]) + }, attrs)); +}; + +/** + * @param {ModdleElement} semantic + * @param {Object} [attrs] + * + * @return {ModdleElement} + */ +BpmnFactory.prototype.createDiPlane = function(semantic, attrs) { + return this.create('bpmndi:BPMNPlane', (0,min_dash__WEBPACK_IMPORTED_MODULE_1__.assign)({ + bpmnElement: semantic + }, attrs)); +}; - template.properties.forEach(function(p) { - var binding = p.binding, - bindingType = binding.type; - if (bindingType === 'camunda:property') { - properties.push(createCamundaProperty( - binding, p.value, bpmnFactory - )); - } - }); +/***/ }), - if (properties.length) { - return bpmnFactory.create('camunda:Properties', { - values: properties - }); - } - } +/***/ "../node_modules/bpmn-js/lib/features/modeling/BpmnLayouter.js": +/*!*********************************************************************!*\ + !*** ../node_modules/bpmn-js/lib/features/modeling/BpmnLayouter.js ***! + \*********************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - function createInputOutputMappings(template, bpmnFactory) { +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ BpmnLayouter) +/* harmony export */ }); +/* harmony import */ var inherits_browser__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! inherits-browser */ "../node_modules/inherits-browser/dist/index.es.js"); +/* harmony import */ var min_dash__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! min-dash */ "../node_modules/min-dash/dist/index.esm.js"); +/* harmony import */ var diagram_js_lib_layout_BaseLayouter__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! diagram-js/lib/layout/BaseLayouter */ "../node_modules/diagram-js/lib/layout/BaseLayouter.js"); +/* harmony import */ var diagram_js_lib_layout_ManhattanLayout__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! diagram-js/lib/layout/ManhattanLayout */ "../node_modules/diagram-js/lib/layout/ManhattanLayout.js"); +/* harmony import */ var diagram_js_lib_layout_LayoutUtil__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! diagram-js/lib/layout/LayoutUtil */ "../node_modules/diagram-js/lib/layout/LayoutUtil.js"); +/* harmony import */ var _util_DiUtil__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../util/DiUtil */ "../node_modules/bpmn-js/lib/util/DiUtil.js"); +/* harmony import */ var _util_ModelUtil__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../util/ModelUtil */ "../node_modules/bpmn-js/lib/util/ModelUtil.js"); - var inputParameters = [], - outputParameters = []; - template.properties.forEach(function(p) { - var binding = p.binding, - bindingType = binding.type; - if (bindingType === 'camunda:inputParameter') { - inputParameters.push(createInputParameter( - binding, p.value, bpmnFactory - )); - } - if (bindingType === 'camunda:outputParameter') { - outputParameters.push(createOutputParameter( - binding, p.value, bpmnFactory - )); - } - }); - // do we need to create new ioMappings (?) - if (outputParameters.length || inputParameters.length) { - return bpmnFactory.create('camunda:InputOutput', { - inputParameters: inputParameters, - outputParameters: outputParameters - }); - } - } - function createCamundaInOut(template, bpmnFactory) { - var inOuts = []; - template.properties.forEach(function(p) { - var binding = p.binding, - bindingType = binding.type; - if (bindingType === 'camunda:in') { - inOuts.push(createCamundaIn( - binding, p.value, bpmnFactory - )); - } else - if (bindingType === 'camunda:out') { - inOuts.push(createCamundaOut( - binding, p.value, bpmnFactory - )); - } else - if (bindingType === 'camunda:in:businessKey') { - inOuts.push(createCamundaInWithBusinessKey( - binding, p.value, bpmnFactory - )); - } - }); - return inOuts; - } - function createCamundaExecutionListeners(template, bpmnFactory) { - var executionListener = []; - template.properties.forEach(function(p) { - var binding = p.binding, - bindingType = binding.type; +/** + * @typedef {import('diagram-js/lib/util/Types').Point} Point + * + * @typedef {import('../../model/Types').Connection} Connection + * @typedef {import('../../model/Types').Element} Element + * + * @typedef {import('diagram-js/lib/layout/BaseLayouter').LayoutConnectionHints} LayoutConnectionHints + * + * @typedef { { + * source?: Element; + * target?: Element; + * waypoints?: Point[]; + * connectionStart?: Point; + * connectionEnd?: Point; + * } & LayoutConnectionHints } BpmnLayoutConnectionHints + */ - if (bindingType === 'camunda:executionListener') { - executionListener.push(createCamundaExecutionListenerScript( - binding, p.value, bpmnFactory - )); - } - }); +var ATTACH_ORIENTATION_PADDING = -10, + BOUNDARY_TO_HOST_THRESHOLD = 40; + +var oppositeOrientationMapping = { + 'top': 'bottom', + 'top-right': 'bottom-left', + 'top-left': 'bottom-right', + 'right': 'left', + 'bottom': 'top', + 'bottom-right': 'top-left', + 'bottom-left': 'top-right', + 'left': 'right' +}; + +var orientationDirectionMapping = { + top: 't', + right: 'r', + bottom: 'b', + left: 'l' +}; + +function BpmnLayouter() {} + +(0,inherits_browser__WEBPACK_IMPORTED_MODULE_0__["default"])(BpmnLayouter, diagram_js_lib_layout_BaseLayouter__WEBPACK_IMPORTED_MODULE_1__["default"]); + +/** + * Returns waypoints of laid out connection. + * + * @param {Connection} connection + * @param {BpmnLayoutConnectionHints} [hints] + * + * @return {Point[]} + */ +BpmnLayouter.prototype.layoutConnection = function(connection, hints) { + if (!hints) { + hints = {}; + } + + var source = hints.source || connection.source, + target = hints.target || connection.target, + waypoints = hints.waypoints || connection.waypoints, + connectionStart = hints.connectionStart, + connectionEnd = hints.connectionEnd; + + var manhattanOptions, + updatedWaypoints; + + if (!connectionStart) { + connectionStart = getConnectionDocking(waypoints && waypoints[ 0 ], source); + } + + if (!connectionEnd) { + connectionEnd = getConnectionDocking(waypoints && waypoints[ waypoints.length - 1 ], target); + } + + // TODO(nikku): support vertical modeling + // and invert preferredLayouts accordingly + + if ((0,_util_ModelUtil__WEBPACK_IMPORTED_MODULE_2__.is)(connection, 'bpmn:Association') || + (0,_util_ModelUtil__WEBPACK_IMPORTED_MODULE_2__.is)(connection, 'bpmn:DataAssociation')) { + + if (waypoints && !isCompensationAssociation(source, target)) { + return [].concat([ connectionStart ], waypoints.slice(1, -1), [ connectionEnd ]); + } + } + + if ((0,_util_ModelUtil__WEBPACK_IMPORTED_MODULE_2__.is)(connection, 'bpmn:MessageFlow')) { + manhattanOptions = getMessageFlowManhattanOptions(source, target); + } else if ((0,_util_ModelUtil__WEBPACK_IMPORTED_MODULE_2__.is)(connection, 'bpmn:SequenceFlow') || isCompensationAssociation(source, target)) { + + // layout all connection between flow elements h:h, except for + // (1) outgoing of boundary events -> layout based on attach orientation and target orientation + // (2) incoming/outgoing of gateways -> v:h for outgoing, h:v for incoming + // (3) loops + if (source === target) { + manhattanOptions = { + preferredLayouts: getLoopPreferredLayout(source, connection) + }; + } else if ((0,_util_ModelUtil__WEBPACK_IMPORTED_MODULE_2__.is)(source, 'bpmn:BoundaryEvent')) { + manhattanOptions = { + preferredLayouts: getBoundaryEventPreferredLayouts(source, target, connectionEnd) + }; + } else if (isExpandedSubProcess(source) || isExpandedSubProcess(target)) { + manhattanOptions = getSubProcessManhattanOptions(source); + } else if ((0,_util_ModelUtil__WEBPACK_IMPORTED_MODULE_2__.is)(source, 'bpmn:Gateway')) { + manhattanOptions = { + preferredLayouts: [ 'v:h' ] + }; + } else if ((0,_util_ModelUtil__WEBPACK_IMPORTED_MODULE_2__.is)(target, 'bpmn:Gateway')) { + manhattanOptions = { + preferredLayouts: [ 'h:v' ] + }; + } else { + manhattanOptions = { + preferredLayouts: [ 'h:h' ] + }; + } + } + + if (manhattanOptions) { + manhattanOptions = (0,min_dash__WEBPACK_IMPORTED_MODULE_3__.assign)(manhattanOptions, hints); + + updatedWaypoints = (0,diagram_js_lib_layout_ManhattanLayout__WEBPACK_IMPORTED_MODULE_4__.withoutRedundantPoints)((0,diagram_js_lib_layout_ManhattanLayout__WEBPACK_IMPORTED_MODULE_4__.repairConnection)( + source, + target, + connectionStart, + connectionEnd, + waypoints, + manhattanOptions + )); + } + + return updatedWaypoints || [ connectionStart, connectionEnd ]; +}; + + +// helpers ////////// + +function getAttachOrientation(attachedElement) { + var hostElement = attachedElement.host; + + return (0,diagram_js_lib_layout_LayoutUtil__WEBPACK_IMPORTED_MODULE_5__.getOrientation)((0,diagram_js_lib_layout_LayoutUtil__WEBPACK_IMPORTED_MODULE_5__.getMid)(attachedElement), hostElement, ATTACH_ORIENTATION_PADDING); +} + +function getMessageFlowManhattanOptions(source, target) { + return { + preferredLayouts: [ 'straight', 'v:v' ], + preserveDocking: getMessageFlowPreserveDocking(source, target) + }; +} + +function getMessageFlowPreserveDocking(source, target) { + + // (1) docking element connected to participant has precedence + if ((0,_util_ModelUtil__WEBPACK_IMPORTED_MODULE_2__.is)(target, 'bpmn:Participant')) { + return 'source'; + } + + if ((0,_util_ModelUtil__WEBPACK_IMPORTED_MODULE_2__.is)(source, 'bpmn:Participant')) { + return 'target'; + } + + // (2) docking element connected to expanded sub-process has precedence + if (isExpandedSubProcess(target)) { + return 'source'; + } + + if (isExpandedSubProcess(source)) { + return 'target'; + } + + // (3) docking event has precedence + if ((0,_util_ModelUtil__WEBPACK_IMPORTED_MODULE_2__.is)(target, 'bpmn:Event')) { + return 'target'; + } + + if ((0,_util_ModelUtil__WEBPACK_IMPORTED_MODULE_2__.is)(source, 'bpmn:Event')) { + return 'source'; + } + + return null; +} + +function getSubProcessManhattanOptions(source) { + return { + preferredLayouts: [ 'straight', 'h:h' ], + preserveDocking: getSubProcessPreserveDocking(source) + }; +} + +function getSubProcessPreserveDocking(source) { + return isExpandedSubProcess(source) ? 'target' : 'source'; +} + +function getConnectionDocking(point, shape) { + return point ? (point.original || point) : (0,diagram_js_lib_layout_LayoutUtil__WEBPACK_IMPORTED_MODULE_5__.getMid)(shape); +} + +function isCompensationAssociation(source, target) { + return (0,_util_ModelUtil__WEBPACK_IMPORTED_MODULE_2__.is)(target, 'bpmn:Activity') && + (0,_util_ModelUtil__WEBPACK_IMPORTED_MODULE_2__.is)(source, 'bpmn:BoundaryEvent') && + target.businessObject.isForCompensation; +} + +function isExpandedSubProcess(element) { + return (0,_util_ModelUtil__WEBPACK_IMPORTED_MODULE_2__.is)(element, 'bpmn:SubProcess') && (0,_util_DiUtil__WEBPACK_IMPORTED_MODULE_6__.isExpanded)(element); +} + +function isSame(a, b) { + return a === b; +} - return executionListener; - } +function isAnyOrientation(orientation, orientations) { + return orientations.indexOf(orientation) !== -1; +} - },{"../CreateHelper":52,"../Helper":56,"lodash/forEach":613}],59:[function(require,module,exports){ - 'use strict'; +function getHorizontalOrientation(orientation) { + var matches = /right|left/.exec(orientation); - var ChangeElementTemplateHandler = require('./ChangeElementTemplateHandler'); + return matches && matches[0]; +} - var getTemplate = require('../Helper').getTemplate, - getDefaultTemplate = require('../Helper').getDefaultTemplate; +function getVerticalOrientation(orientation) { + var matches = /top|bottom/.exec(orientation); - function registerHandlers(commandStack, elementTemplates, eventBus, elementRegistry) { - commandStack.registerHandler( - 'propertiesPanel.camunda.changeTemplate', - ChangeElementTemplateHandler - ); + return matches && matches[0]; +} - // apply default element templates on shape creation - eventBus.on([ 'commandStack.shape.create.postExecuted' ], function(context) { - applyDefaultTemplate(context.context.shape, elementTemplates, commandStack); - }); +function isOppositeOrientation(a, b) { + return oppositeOrientationMapping[a] === b; +} - // apply default element templates on connection creation - eventBus.on([ 'commandStack.connection.create.postExecuted' ], function(context) { - applyDefaultTemplate(context.context.connection, elementTemplates, commandStack); - }); - } +function isOppositeHorizontalOrientation(a, b) { + var horizontalOrientation = getHorizontalOrientation(a); - registerHandlers.$inject = [ 'commandStack', 'elementTemplates', 'eventBus', 'elementRegistry' ]; + var oppositeHorizontalOrientation = oppositeOrientationMapping[horizontalOrientation]; + return b.indexOf(oppositeHorizontalOrientation) !== -1; +} - module.exports = { - __init__: [ registerHandlers ] - }; +function isOppositeVerticalOrientation(a, b) { + var verticalOrientation = getVerticalOrientation(a); + var oppositeVerticalOrientation = oppositeOrientationMapping[verticalOrientation]; + + return b.indexOf(oppositeVerticalOrientation) !== -1; +} + +function isHorizontalOrientation(orientation) { + return orientation === 'right' || orientation === 'left'; +} + +function getLoopPreferredLayout(source, connection) { + var waypoints = connection.waypoints; + + var orientation = waypoints && waypoints.length && (0,diagram_js_lib_layout_LayoutUtil__WEBPACK_IMPORTED_MODULE_5__.getOrientation)(waypoints[0], source); - function applyDefaultTemplate(element, elementTemplates, commandStack) { + if (orientation === 'top') { + return [ 't:r' ]; + } else if (orientation === 'right') { + return [ 'r:b' ]; + } else if (orientation === 'left') { + return [ 'l:t' ]; + } - if (!getTemplate(element, elementTemplates) - && getDefaultTemplate(element, elementTemplates)) { + return [ 'b:l' ]; +} + +function getBoundaryEventPreferredLayouts(source, target, end) { + var sourceMid = (0,diagram_js_lib_layout_LayoutUtil__WEBPACK_IMPORTED_MODULE_5__.getMid)(source), + targetMid = (0,diagram_js_lib_layout_LayoutUtil__WEBPACK_IMPORTED_MODULE_5__.getMid)(target), + attachOrientation = getAttachOrientation(source), + sourceLayout, + targetLayout; - var command = 'propertiesPanel.camunda.changeTemplate'; - var commandContext = { - element: element, - newTemplate: getDefaultTemplate(element, elementTemplates) - }; + var isLoop = isSame(source.host, target); - commandStack.execute(command, commandContext); - } - } + var attachedToSide = isAnyOrientation(attachOrientation, [ 'top', 'right', 'bottom', 'left' ]); - },{"../Helper":56,"./ChangeElementTemplateHandler":58}],60:[function(require,module,exports){ - module.exports = { - __depends__: [ - require('./cmd'), - require('diagram-js/lib/i18n/translate').default - ], - __init__: [ - 'customElementsPropertiesActivator', - 'elementTemplatesLoader' - ], - customElementsPropertiesActivator: [ 'type', require('./CustomElementsPropertiesActivator') ], - elementTemplates: [ 'type', require('./ElementTemplates') ], - elementTemplatesLoader: [ 'type', require('./ElementTemplatesLoader') ] - }; + var targetOrientation = (0,diagram_js_lib_layout_LayoutUtil__WEBPACK_IMPORTED_MODULE_5__.getOrientation)(targetMid, sourceMid, { + x: source.width / 2 + target.width / 2, + y: source.height / 2 + target.height / 2 + }); + + if (isLoop) { + return getBoundaryEventLoopLayout(attachOrientation, attachedToSide, source, target, end); + } + + // source layout + sourceLayout = getBoundaryEventSourceLayout(attachOrientation, targetOrientation, attachedToSide); - },{"./CustomElementsPropertiesActivator":53,"./ElementTemplates":54,"./ElementTemplatesLoader":55,"./cmd":59,"diagram-js/lib/i18n/translate":401}],61:[function(require,module,exports){ - 'use strict'; + // target layout + targetLayout = getBoundaryEventTargetLayout(attachOrientation, targetOrientation, attachedToSide); - var entryFactory = require('../../../../factory/EntryFactory'), - is = require('bpmn-js/lib/util/ModelUtil').is, - getTemplate = require('../Helper').getTemplate, - getTemplateId = require('../Helper').getTemplateId; + return [ sourceLayout + ':' + targetLayout ]; +} + +function getBoundaryEventLoopLayout(attachOrientation, attachedToSide, source, target, end) { + var orientation = attachedToSide ? attachOrientation : getVerticalOrientation(attachOrientation), + sourceLayout = orientationDirectionMapping[ orientation ], + targetLayout; + + if (attachedToSide) { + if (isHorizontalOrientation(attachOrientation)) { + targetLayout = shouldConnectToSameSide('y', source, target, end) ? 'h' : 'b'; + } else { + targetLayout = shouldConnectToSameSide('x', source, target, end) ? 'v' : 'l'; + } + } else { + targetLayout = 'v'; + } - var find = require('lodash/find'); + return [ sourceLayout + ':' + targetLayout ]; +} + +function shouldConnectToSameSide(axis, source, target, end) { + var threshold = BOUNDARY_TO_HOST_THRESHOLD; + + return !( + areCloseOnAxis(axis, end, target, threshold) || + areCloseOnAxis(axis, end, { + x: target.x + target.width, + y: target.y + target.height + }, threshold) || + areCloseOnAxis(axis, end, (0,diagram_js_lib_layout_LayoutUtil__WEBPACK_IMPORTED_MODULE_5__.getMid)(source), threshold) + ); +} + +function areCloseOnAxis(axis, a, b, threshold) { + return Math.abs(a[ axis ] - b[ axis ]) < threshold; +} - var TEMPLATE_ATTR = require('../Helper').TEMPLATE_ATTR; +function getBoundaryEventSourceLayout(attachOrientation, targetOrientation, attachedToSide) { - function isAny(element, types) { - return types.reduce(function(result, type) { - return result || is(element, type); - }, false); - } + // attached to either top, right, bottom or left side + if (attachedToSide) { + return orientationDirectionMapping[ attachOrientation ]; + } + // attached to either top-right, top-left, bottom-right or bottom-left corner - module.exports = function(group, element, elementTemplates, translate) { + // same vertical or opposite horizontal orientation + if (isSame( + getVerticalOrientation(attachOrientation), getVerticalOrientation(targetOrientation) + ) || isOppositeOrientation( + getHorizontalOrientation(attachOrientation), getHorizontalOrientation(targetOrientation) + )) { + return orientationDirectionMapping[ getVerticalOrientation(attachOrientation) ]; + } - var options = getTemplateOptions(element, elementTemplates, translate); + // fallback + return orientationDirectionMapping[ getHorizontalOrientation(attachOrientation) ]; +} - if (options.length === 1 && !options[0].isDefault) { - return; - } +function getBoundaryEventTargetLayout(attachOrientation, targetOrientation, attachedToSide) { - // select element template (via dropdown) - group.entries.push(entryFactory.selectBox({ - id: 'elementTemplate-chooser', - label: translate('Element Template'), - modelProperty: 'camunda:modelerTemplate', - selectOptions: options, - set: function(element, properties) { - return applyTemplate(element, properties[TEMPLATE_ATTR], elementTemplates); - }, - disabled: function() { - var template = getTemplate(element, elementTemplates); + // attached to either top, right, bottom or left side + if (attachedToSide) { + if (isHorizontalOrientation(attachOrientation)) { - return template && isDefaultTemplate(template); - } - })); + // orientation is right or left - }; + // opposite horizontal orientation or same orientation + if ( + isOppositeHorizontalOrientation(attachOrientation, targetOrientation) || + isSame(attachOrientation, targetOrientation) + ) { + return 'h'; + } + // fallback + return 'v'; + } else { -// helpers ////////////////////////////////////// + // orientation is top or bottom - function applyTemplate(element, newTemplateId, elementTemplates) { + // opposite vertical orientation or same orientation + if ( + isOppositeVerticalOrientation(attachOrientation, targetOrientation) || + isSame(attachOrientation, targetOrientation) + ) { + return 'v'; + } - // cleanup - // clear input output mappings - // undo changes to properties defined in template + // fallback + return 'h'; + } + } - // re-establish - // set input output mappings - // apply changes to properties as defined in new template + // attached to either top-right, top-left, bottom-right or bottom-left corner - var oldTemplate = getTemplate(element, elementTemplates), - newTemplate = elementTemplates.get(newTemplateId); + // orientation is right, left + // or same vertical orientation but also right or left + if (isHorizontalOrientation(targetOrientation) || + (isSame(getVerticalOrientation(attachOrientation), getVerticalOrientation(targetOrientation)) && + getHorizontalOrientation(targetOrientation))) { + return 'h'; + } else { + return 'v'; + } +} - if (oldTemplate === newTemplate) { - return; - } - return { - cmd: 'propertiesPanel.camunda.changeTemplate', - context: { - element: element, - oldTemplate: oldTemplate, - newTemplate: newTemplate - } - }; - } +/***/ }), - function getTemplateOptions(element, elementTemplates, translate) { +/***/ "../node_modules/bpmn-js/lib/features/modeling/BpmnUpdater.js": +/*!********************************************************************!*\ + !*** ../node_modules/bpmn-js/lib/features/modeling/BpmnUpdater.js ***! + \********************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - var currentTemplateId = getTemplateId(element); +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ BpmnUpdater) +/* harmony export */ }); +/* harmony import */ var min_dash__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! min-dash */ "../node_modules/min-dash/dist/index.esm.js"); +/* harmony import */ var inherits_browser__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! inherits-browser */ "../node_modules/inherits-browser/dist/index.es.js"); +/* harmony import */ var diagram_js_lib_util_Collections__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! diagram-js/lib/util/Collections */ "../node_modules/diagram-js/lib/util/Collections.js"); +/* harmony import */ var _util_ModelUtil__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./util/ModelingUtil */ "../node_modules/bpmn-js/lib/util/ModelUtil.js"); +/* harmony import */ var _util_LabelUtil__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../util/LabelUtil */ "../node_modules/bpmn-js/lib/util/LabelUtil.js"); +/* harmony import */ var _util_LabelUtil__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../util/LabelUtil */ "../node_modules/diagram-js/lib/util/ModelUtil.js"); +/* harmony import */ var _util_DrilldownUtil__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../util/DrilldownUtil */ "../node_modules/bpmn-js/lib/util/DrilldownUtil.js"); +/* harmony import */ var diagram_js_lib_util_PositionUtil__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! diagram-js/lib/util/PositionUtil */ "../node_modules/diagram-js/lib/util/PositionUtil.js"); +/* harmony import */ var diagram_js_lib_command_CommandInterceptor__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! diagram-js/lib/command/CommandInterceptor */ "../node_modules/diagram-js/lib/command/CommandInterceptor.js"); - var emptyOption = { - name: '', - value: '' - }; - var allOptions = elementTemplates.getAll().reduce(function(templates, t) { - if (!isAny(element, t.appliesTo)) { - return templates; - } - return templates.concat({ - name: translate(t.name), - value: t.id, - isDefault: t.isDefault - }); - }, [ emptyOption ]); - var defaultOption = find(allOptions, function(option) { - return isDefaultTemplate(option); - }); - var currentOption = find(allOptions, function(option) { - return option.value === currentTemplateId; - }); - if (currentTemplateId && !currentOption) { - currentOption = unknownTemplate(currentTemplateId, translate); - allOptions.push(currentOption); - } - if (!defaultOption) { - // return all options, including empty - // and optionally unknownTemplate option - return allOptions; - } - // special limited handling for - // default options - var options = []; - // current template not set - if (!currentTemplateId) { - options.push({ - name: '', - value: '' - }); - } - // current template not default - if (currentOption && currentOption !== defaultOption) { - options.push(currentOption); - } - options.push(defaultOption); - // [ (empty), (current), defaultOption ] - return options; - } - function unknownTemplate(templateId, translate) { - return { - name: translate('[unknown template: {templateId}]', { templateId: templateId }), - value: templateId - }; - } - function isDefaultTemplate(elementTemplate) { - return elementTemplate.isDefault; - } - },{"../../../../factory/EntryFactory":14,"../Helper":56,"bpmn-js/lib/util/ModelUtil":240,"lodash/find":610}],62:[function(require,module,exports){ - 'use strict'; - - var assign = require('lodash/assign'); - - var entryFactory = require('../../../../factory/EntryFactory'), - getBusinessObject = require('bpmn-js/lib/util/ModelUtil').getBusinessObject, - getTemplate = require('../Helper').getTemplate, - cmdHelper = require('../../../../helper/CmdHelper'), - elementHelper = require('../../../../helper/ElementHelper'); - - var findExtension = require('../Helper').findExtension, - findExtensions = require('../Helper').findExtensions, - findInputParameter = require('../Helper').findInputParameter, - findOutputParameter = require('../Helper').findOutputParameter, - findCamundaProperty = require('../Helper').findCamundaProperty, - findCamundaInOut = require('../Helper').findCamundaInOut; - - var createCamundaProperty = require('../CreateHelper').createCamundaProperty, - createInputParameter = require('../CreateHelper').createInputParameter, - createOutputParameter = require('../CreateHelper').createOutputParameter, - createCamundaIn = require('../CreateHelper').createCamundaIn, - createCamundaOut = require('../CreateHelper').createCamundaOut, - createCamundaInWithBusinessKey = require('../CreateHelper').createCamundaInWithBusinessKey, - createCamundaFieldInjection = require('../CreateHelper').createCamundaFieldInjection; - - var CAMUNDA_PROPERTY_TYPE = 'camunda:property', - CAMUNDA_INPUT_PARAMETER_TYPE = 'camunda:inputParameter', - CAMUNDA_OUTPUT_PARAMETER_TYPE = 'camunda:outputParameter', - CAMUNDA_IN_TYPE = 'camunda:in', - CAMUNDA_OUT_TYPE = 'camunda:out', - CAMUNDA_IN_BUSINESS_KEY_TYPE = 'camunda:in:businessKey', - CAMUNDA_EXECUTION_LISTENER_TYPE = 'camunda:executionListener', - CAMUNDA_FIELD = 'camunda:field'; - - var BASIC_MODDLE_TYPES = [ - 'Boolean', - 'Integer', - 'String' - ]; +/** + * @typedef {import('diagram-js/lib/core/EventBus').default} EventBus + * @typedef {import('./BpmnFactory').default} BpmnFactory + * @typedef {import('diagram-js/lib/layout/CroppingConnectionDocking').default} CroppingConnectionDocking + * @typedef {import('diagram-js/lib/i18n/translate/translate').default} Translate + * + * @typedef {import('../../model/Types').Connection} Connection + * @typedef {import('../../model/Types').Element} Element + * @typedef {import('../../model/Types').Shape} Shape + * @typedef {import('../../model/Types').Parent} Parent + * @typedef {import('../../model/Types').ModdleElement} ModdleElement + */ - var EXTENSION_BINDING_TYPES = [ - CAMUNDA_PROPERTY_TYPE, - CAMUNDA_INPUT_PARAMETER_TYPE, - CAMUNDA_OUTPUT_PARAMETER_TYPE, - CAMUNDA_IN_TYPE, - CAMUNDA_OUT_TYPE, - CAMUNDA_IN_BUSINESS_KEY_TYPE, - CAMUNDA_FIELD - ]; +/** + * A handler responsible for updating the underlying BPMN 2.0 XML & DI + * once changes on the diagram happen. + * + * @param {EventBus} eventBus + * @param {BpmnFactory} bpmnFactory + * @param {CroppingConnectionDocking} connectionDocking + * @param {Translate} translate + */ +function BpmnUpdater( + eventBus, + bpmnFactory, + connectionDocking, + translate +) { - var IO_BINDING_TYPES = [ - CAMUNDA_INPUT_PARAMETER_TYPE, - CAMUNDA_OUTPUT_PARAMETER_TYPE - ]; + diagram_js_lib_command_CommandInterceptor__WEBPACK_IMPORTED_MODULE_0__["default"].call(this, eventBus); - var IN_OUT_BINDING_TYPES = [ - CAMUNDA_IN_TYPE, - CAMUNDA_OUT_TYPE, - CAMUNDA_IN_BUSINESS_KEY_TYPE - ]; + this._bpmnFactory = bpmnFactory; + this._translate = translate; - /** - * Injects custom properties into the given group. - * - * @param {djs.model.Base} element - * @param {ElementTemplates} elementTemplates - * @param {BpmnFactory} bpmnFactory - * @param {Function} translate - */ - module.exports = function(element, elementTemplates, bpmnFactory, translate) { + var self = this; - var template = getTemplate(element, elementTemplates); - if (!template) { - return []; - } - var renderCustomField = function(id, p, idx) { - var propertyType = p.type; + // connection cropping ////////////////////// - var entryOptions = { - id: id, - description: p.description, - label: p.label ? translate(p.label) : p.label, - modelProperty: id, - get: propertyGetter(id, p), - set: propertySetter(id, p, bpmnFactory), - validate: propertyValidator(id, p, translate) - }; + // crop connection ends during create/update + function cropConnection(e) { + var context = e.context, + hints = context.hints || {}, + connection; - var entry; + if (!context.cropped && hints.createElementsBehavior !== false) { + connection = context.connection; + connection.waypoints = connectionDocking.getCroppedWaypoints(connection); + context.cropped = true; + } + } - if (propertyType === 'Boolean') { - entry = entryFactory.checkbox(entryOptions); - } + this.executed([ + 'connection.layout', + 'connection.create' + ], cropConnection); - if (propertyType === 'String') { - entry = entryFactory.textField(entryOptions); - } + this.reverted([ 'connection.layout' ], function(e) { + delete e.context.cropped; + }); - if (propertyType === 'Text') { - entry = entryFactory.textBox(entryOptions); - } - if (propertyType === 'Dropdown') { - entryOptions.selectOptions = p.choices; - entry = entryFactory.selectBox(entryOptions); - } + // BPMN + DI update ////////////////////// - return entry; - }; - var groups = []; - var id, entry; + // update parent + function updateParent(e) { + var context = e.context; - var customFieldsGroup = { - id: 'customField', - label: translate('Custom Fields'), - entries: [] - }; - template.properties.forEach(function(p, idx) { + self.updateParent(context.shape || context.connection, context.oldParent); + } - id = 'custom-' + template.id + '-' + idx; + function reverseUpdateParent(e) { + var context = e.context; - entry = renderCustomField(id, p, idx); - if (entry) { - customFieldsGroup.entries.push(entry); - } - }); - if (customFieldsGroup.entries.length > 0) { - groups.push(customFieldsGroup); - } + var element = context.shape || context.connection, - if (template.scopes) { - for (var scopeName in template.scopes) { + // oldParent is the (old) new parent, because we are undoing + oldParent = context.parent || context.newParent; - var scope = template.scopes[scopeName]; - var idScopeName = scopeName.replace(/:/g, '_'); + self.updateParent(element, oldParent); + } - var customScopeFieldsGroup = { - id: 'customField-' + idScopeName, - label: translate('Custom Fields for scope: ') + scopeName, - entries: [] - }; + this.executed([ + 'shape.move', + 'shape.create', + 'shape.delete', + 'connection.create', + 'connection.move', + 'connection.delete' + ], ifBpmn(updateParent)); - scope.properties.forEach(function(p, idx) { + this.reverted([ + 'shape.move', + 'shape.create', + 'shape.delete', + 'connection.create', + 'connection.move', + 'connection.delete' + ], ifBpmn(reverseUpdateParent)); - var propertyId = 'custom-' + template.id + '-' + idScopeName + '-' + idx; + /* + * ## Updating Parent + * + * When morphing a Process into a Collaboration or vice-versa, + * make sure that both the *semantic* and *di* parent of each element + * is updated. + * + */ + function updateRoot(event) { + var context = event.context, + oldRoot = context.oldRoot, + children = oldRoot.children; + + (0,min_dash__WEBPACK_IMPORTED_MODULE_1__.forEach)(children, function(child) { + if ((0,_util_ModelUtil__WEBPACK_IMPORTED_MODULE_2__.is)(child, 'bpmn:BaseElement')) { + self.updateParent(child); + } + }); + } + + this.executed([ 'canvas.updateRoot' ], updateRoot); + this.reverted([ 'canvas.updateRoot' ], updateRoot); + + + // update bounds + function updateBounds(e) { + var shape = e.context.shape; + + if (!(0,_util_ModelUtil__WEBPACK_IMPORTED_MODULE_2__.is)(shape, 'bpmn:BaseElement')) { + return; + } + + self.updateBounds(shape); + } + + this.executed([ 'shape.move', 'shape.create', 'shape.resize' ], ifBpmn(function(event) { + + // exclude labels because they're handled separately during shape.changed + if (event.context.shape.type === 'label') { + return; + } + + updateBounds(event); + })); + + this.reverted([ 'shape.move', 'shape.create', 'shape.resize' ], ifBpmn(function(event) { + + // exclude labels because they're handled separately during shape.changed + if (event.context.shape.type === 'label') { + return; + } + + updateBounds(event); + })); + + // Handle labels separately. This is necessary, because the label bounds have to be updated + // every time its shape changes, not only on move, create and resize. + eventBus.on('shape.changed', function(event) { + if (event.element.type === 'label') { + updateBounds({ context: { shape: event.element } }); + } + }); + + // attach / detach connection + function updateConnection(e) { + self.updateConnection(e.context); + } + + this.executed([ + 'connection.create', + 'connection.move', + 'connection.delete', + 'connection.reconnect' + ], ifBpmn(updateConnection)); + + this.reverted([ + 'connection.create', + 'connection.move', + 'connection.delete', + 'connection.reconnect' + ], ifBpmn(updateConnection)); + + + // update waypoints + function updateConnectionWaypoints(e) { + self.updateConnectionWaypoints(e.context.connection); + } + + this.executed([ + 'connection.layout', + 'connection.move', + 'connection.updateWaypoints', + ], ifBpmn(updateConnectionWaypoints)); + + this.reverted([ + 'connection.layout', + 'connection.move', + 'connection.updateWaypoints', + ], ifBpmn(updateConnectionWaypoints)); + + // update conditional/default flows + this.executed('connection.reconnect', ifBpmn(function(event) { + var context = event.context, + connection = context.connection, + oldSource = context.oldSource, + newSource = context.newSource, + connectionBo = (0,_util_ModelUtil__WEBPACK_IMPORTED_MODULE_2__.getBusinessObject)(connection), + oldSourceBo = (0,_util_ModelUtil__WEBPACK_IMPORTED_MODULE_2__.getBusinessObject)(oldSource), + newSourceBo = (0,_util_ModelUtil__WEBPACK_IMPORTED_MODULE_2__.getBusinessObject)(newSource); + + // remove condition from connection on reconnect to new source + // if new source can NOT have condional sequence flow + if (connectionBo.conditionExpression && !(0,_util_ModelUtil__WEBPACK_IMPORTED_MODULE_2__.isAny)(newSourceBo, [ + 'bpmn:Activity', + 'bpmn:ExclusiveGateway', + 'bpmn:InclusiveGateway' + ])) { + context.oldConditionExpression = connectionBo.conditionExpression; + + delete connectionBo.conditionExpression; + } + + // remove default from old source flow on reconnect to new source + // if source changed + if (oldSource !== newSource && oldSourceBo.default === connectionBo) { + context.oldDefault = oldSourceBo.default; + + delete oldSourceBo.default; + } + })); + + this.reverted('connection.reconnect', ifBpmn(function(event) { + var context = event.context, + connection = context.connection, + oldSource = context.oldSource, + newSource = context.newSource, + connectionBo = (0,_util_ModelUtil__WEBPACK_IMPORTED_MODULE_2__.getBusinessObject)(connection), + oldSourceBo = (0,_util_ModelUtil__WEBPACK_IMPORTED_MODULE_2__.getBusinessObject)(oldSource), + newSourceBo = (0,_util_ModelUtil__WEBPACK_IMPORTED_MODULE_2__.getBusinessObject)(newSource); + + // add condition to connection on revert reconnect to new source + if (context.oldConditionExpression) { + connectionBo.conditionExpression = context.oldConditionExpression; + } + + // add default to old source on revert reconnect to new source + if (context.oldDefault) { + oldSourceBo.default = context.oldDefault; + + delete newSourceBo.default; + } + })); + + // update attachments + function updateAttachment(e) { + self.updateAttachment(e.context); + } + + this.executed([ 'element.updateAttachment' ], ifBpmn(updateAttachment)); + this.reverted([ 'element.updateAttachment' ], ifBpmn(updateAttachment)); + + + // update BPMNLabel + this.executed('element.updateLabel', ifBpmn(updateBPMNLabel)); + this.reverted('element.updateLabel', ifBpmn(updateBPMNLabel)); + + function updateBPMNLabel(event) { + const { element } = event.context, + label = (0,_util_LabelUtil__WEBPACK_IMPORTED_MODULE_3__.getLabel)(element); + const di = (0,_util_ModelUtil__WEBPACK_IMPORTED_MODULE_2__.getDi)(element), + diLabel = di && di.get('label'); + + if ((0,_util_LabelUtil__WEBPACK_IMPORTED_MODULE_3__.isLabelExternal)(element) || (0,_util_DrilldownUtil__WEBPACK_IMPORTED_MODULE_4__.isPlane)(element)) { + return; + } + + if (label && !diLabel) { + di.set('label', bpmnFactory.create('bpmndi:BPMNLabel')); + } else if (!label && diLabel) { + di.set('label', undefined); + } + } +} + +(0,inherits_browser__WEBPACK_IMPORTED_MODULE_5__["default"])(BpmnUpdater, diagram_js_lib_command_CommandInterceptor__WEBPACK_IMPORTED_MODULE_0__["default"]); + +BpmnUpdater.$inject = [ + 'eventBus', + 'bpmnFactory', + 'connectionDocking', + 'translate' +]; + + +// implementation ////////////////////// + +/** + * @param { { + * shape: Shape; + * host: Shape; + * } } context + */ +BpmnUpdater.prototype.updateAttachment = function(context) { - var scopedProperty = propertyWithScope(p, scopeName); + var shape = context.shape, + businessObject = shape.businessObject, + host = shape.host; - entry = renderCustomField(propertyId, scopedProperty, idx); - if (entry) { - customScopeFieldsGroup.entries.push(entry); - } - }); + businessObject.attachedToRef = host && host.businessObject; +}; - if (customScopeFieldsGroup.entries.length > 0) { - groups.push(customScopeFieldsGroup); - } - } - } +/** + * @param {Element} element + * @param {Parent} oldParent + */ +BpmnUpdater.prototype.updateParent = function(element, oldParent) { + + // do not update BPMN 2.0 label parent + if ((0,_util_LabelUtil__WEBPACK_IMPORTED_MODULE_6__.isLabel)(element)) { + return; + } + + // data stores in collaborations are handled separately by DataStoreBehavior + if ((0,_util_ModelUtil__WEBPACK_IMPORTED_MODULE_2__.is)(element, 'bpmn:DataStoreReference') && + element.parent && + (0,_util_ModelUtil__WEBPACK_IMPORTED_MODULE_2__.is)(element.parent, 'bpmn:Collaboration')) { + return; + } + + var parentShape = element.parent; + + var businessObject = element.businessObject, + di = (0,_util_ModelUtil__WEBPACK_IMPORTED_MODULE_2__.getDi)(element), + parentBusinessObject = parentShape && parentShape.businessObject, + parentDi = (0,_util_ModelUtil__WEBPACK_IMPORTED_MODULE_2__.getDi)(parentShape); + + if ((0,_util_ModelUtil__WEBPACK_IMPORTED_MODULE_2__.is)(element, 'bpmn:FlowNode')) { + this.updateFlowNodeRefs(businessObject, parentBusinessObject, oldParent && oldParent.businessObject); + } + + if ((0,_util_ModelUtil__WEBPACK_IMPORTED_MODULE_2__.is)(element, 'bpmn:DataOutputAssociation')) { + if (element.source) { + parentBusinessObject = element.source.businessObject; + } else { + parentBusinessObject = null; + } + } + + if ((0,_util_ModelUtil__WEBPACK_IMPORTED_MODULE_2__.is)(element, 'bpmn:DataInputAssociation')) { + if (element.target) { + parentBusinessObject = element.target.businessObject; + } else { + parentBusinessObject = null; + } + } + + this.updateSemanticParent(businessObject, parentBusinessObject); + + if ((0,_util_ModelUtil__WEBPACK_IMPORTED_MODULE_2__.is)(element, 'bpmn:DataObjectReference') && businessObject.dataObjectRef) { + this.updateSemanticParent(businessObject.dataObjectRef, parentBusinessObject); + } + + this.updateDiParent(di, parentDi); +}; + +/** + * @param {Shape} shape + */ +BpmnUpdater.prototype.updateBounds = function(shape) { + + var di = (0,_util_ModelUtil__WEBPACK_IMPORTED_MODULE_2__.getDi)(shape), + embeddedLabelBounds = getEmbeddedLabelBounds(shape); + + // update embedded label bounds if possible + if (embeddedLabelBounds) { + var embeddedLabelBoundsDelta = (0,diagram_js_lib_util_PositionUtil__WEBPACK_IMPORTED_MODULE_7__.delta)(embeddedLabelBounds, di.get('bounds')); + + (0,min_dash__WEBPACK_IMPORTED_MODULE_1__.assign)(embeddedLabelBounds, { + x: shape.x + embeddedLabelBoundsDelta.x, + y: shape.y + embeddedLabelBoundsDelta.y + }); + } + + var target = (0,_util_LabelUtil__WEBPACK_IMPORTED_MODULE_6__.isLabel)(shape) ? this._getLabel(di) : di; + + var bounds = target.bounds; + + if (!bounds) { + bounds = this._bpmnFactory.createDiBounds(); + target.set('bounds', bounds); + } + + (0,min_dash__WEBPACK_IMPORTED_MODULE_1__.assign)(bounds, { + x: shape.x, + y: shape.y, + width: shape.width, + height: shape.height + }); +}; + +/** + * @param {ModdleElement} businessObject + * @param {ModdleElement} newContainment + * @param {ModdleElement} oldContainment + */ +BpmnUpdater.prototype.updateFlowNodeRefs = function(businessObject, newContainment, oldContainment) { - return groups; - }; + if (oldContainment === newContainment) { + return; + } + var oldRefs, newRefs; -// getters, setters and validators /////////////// + if ((0,_util_ModelUtil__WEBPACK_IMPORTED_MODULE_2__.is) (oldContainment, 'bpmn:Lane')) { + oldRefs = oldContainment.get('flowNodeRef'); + (0,diagram_js_lib_util_Collections__WEBPACK_IMPORTED_MODULE_8__.remove)(oldRefs, businessObject); + } + if ((0,_util_ModelUtil__WEBPACK_IMPORTED_MODULE_2__.is)(newContainment, 'bpmn:Lane')) { + newRefs = newContainment.get('flowNodeRef'); + (0,diagram_js_lib_util_Collections__WEBPACK_IMPORTED_MODULE_8__.add)(newRefs, businessObject); + } +}; - /** - * Return a getter that retrieves the given property. - * - * @param {String} name - * @param {PropertyDescriptor} property - * - * @return {Function} - */ - function propertyGetter(name, property) { +/** + * @param {Connection} connection + * @param {Element} newSource + * @param {Element} newTarget + */ +BpmnUpdater.prototype.updateDiConnection = function(connection, newSource, newTarget) { + var connectionDi = (0,_util_ModelUtil__WEBPACK_IMPORTED_MODULE_2__.getDi)(connection), + newSourceDi = (0,_util_ModelUtil__WEBPACK_IMPORTED_MODULE_2__.getDi)(newSource), + newTargetDi = (0,_util_ModelUtil__WEBPACK_IMPORTED_MODULE_2__.getDi)(newTarget); - /* getter */ - return function get(element) { - var value = getPropertyValue(element, property); + if (connectionDi.sourceElement && connectionDi.sourceElement.bpmnElement !== (0,_util_ModelUtil__WEBPACK_IMPORTED_MODULE_2__.getBusinessObject)(newSource)) { + connectionDi.sourceElement = newSource && newSourceDi; + } - return objectWithKey(name, value); - }; - } + if (connectionDi.targetElement && connectionDi.targetElement.bpmnElement !== (0,_util_ModelUtil__WEBPACK_IMPORTED_MODULE_2__.getBusinessObject)(newTarget)) { + connectionDi.targetElement = newTarget && newTargetDi; + } - /** - * Return a setter that updates the given property. - * - * @param {String} name - * @param {PropertyDescriptor} property - * @param {BpmnFactory} bpmnFactory - * - * @return {Function} - */ - function propertySetter(name, property, bpmnFactory) { +}; - /* setter */ - return function set(element, values) { +/** + * @param {ModdleElement} di + * @param {ModdleElement} parentDi + */ +BpmnUpdater.prototype.updateDiParent = function(di, parentDi) { - var value = values[name]; + if (parentDi && !(0,_util_ModelUtil__WEBPACK_IMPORTED_MODULE_2__.is)(parentDi, 'bpmndi:BPMNPlane')) { + parentDi = parentDi.$parent; + } - return setPropertyValue(element, property, value, bpmnFactory); - }; - } + if (di.$parent === parentDi) { + return; + } - /** - * Return a validator that ensures the property is ok. - * - * @param {String} name - * @param {PropertyDescriptor} property - * @param {Function} translate - * - * @return {Function} - */ - function propertyValidator(name, property, translate) { + var planeElements = (parentDi || di.$parent).get('planeElement'); - /* validator */ - return function validate(element, values) { - var value = values[name]; + if (parentDi) { + planeElements.push(di); + di.$parent = parentDi; + } else { + (0,diagram_js_lib_util_Collections__WEBPACK_IMPORTED_MODULE_8__.remove)(planeElements, di); + di.$parent = null; + } +}; - var error = validateValue(value, property, translate); +/** + * @param {ModdleElement} element + * + * @return {ModdleElement} + */ +function getDefinitions(element) { + while (element && !(0,_util_ModelUtil__WEBPACK_IMPORTED_MODULE_2__.is)(element, 'bpmn:Definitions')) { + element = element.$parent; + } - if (error) { - return objectWithKey(name, error); - } - }; - } + return element; +} +/** + * @param {ModdleElement} container + * + * @return {ModdleElement} + */ +BpmnUpdater.prototype.getLaneSet = function(container) { -// get, set and validate helpers /////////////////// + var laneSet, laneSets; - /** - * Return the value of the specified property descriptor, - * on the passed diagram element. - * - * @param {djs.model.Base} element - * @param {PropertyDescriptor} property - * - * @return {Any} - */ - function getPropertyValue(element, property) { + // bpmn:Lane + if ((0,_util_ModelUtil__WEBPACK_IMPORTED_MODULE_2__.is)(container, 'bpmn:Lane')) { + laneSet = container.childLaneSet; - var bo = getBusinessObject(element); + if (!laneSet) { + laneSet = this._bpmnFactory.create('bpmn:LaneSet'); + container.childLaneSet = laneSet; + laneSet.$parent = container; + } - var binding = property.binding, - scope = property.scope; + return laneSet; + } - var bindingType = binding.type, - bindingName = binding.name; + // bpmn:Participant + if ((0,_util_ModelUtil__WEBPACK_IMPORTED_MODULE_2__.is)(container, 'bpmn:Participant')) { + container = container.processRef; + } - var propertyValue = property.value || ''; + // bpmn:FlowElementsContainer + laneSets = container.get('laneSets'); + laneSet = laneSets[0]; - if (scope) { - bo = findExtension(bo, scope.name); - if (!bo) { - return propertyValue; - } - } + if (!laneSet) { + laneSet = this._bpmnFactory.create('bpmn:LaneSet'); + laneSet.$parent = container; + laneSets.push(laneSet); + } - // property - if (bindingType === 'property') { + return laneSet; +}; - var value = bo.get(bindingName); +/** + * @param {ModdleElement} businessObject + * @param {ModdleElement} newParent + * @param {ModdleElement} visualParent + */ +BpmnUpdater.prototype.updateSemanticParent = function(businessObject, newParent, visualParent) { - if (bindingName === 'conditionExpression') { - if (value) { - return value.body; - } else { - // return defined default - return propertyValue; - } - } else { - // return value; default to defined default - return typeof value !== 'undefined' ? value : propertyValue; - } - } + var containment, + translate = this._translate; - var camundaProperties, - camundaProperty; + if (businessObject.$parent === newParent) { + return; + } - if (bindingType === CAMUNDA_PROPERTY_TYPE) { - if (scope) { - camundaProperties = bo.get('properties'); - } else { - camundaProperties = findExtension(bo, 'camunda:Properties'); - } + if ((0,_util_ModelUtil__WEBPACK_IMPORTED_MODULE_2__.is)(businessObject, 'bpmn:DataInput') || (0,_util_ModelUtil__WEBPACK_IMPORTED_MODULE_2__.is)(businessObject, 'bpmn:DataOutput')) { - if (camundaProperties) { - camundaProperty = findCamundaProperty(camundaProperties, binding); + if ((0,_util_ModelUtil__WEBPACK_IMPORTED_MODULE_2__.is)(newParent, 'bpmn:Participant') && 'processRef' in newParent) { + newParent = newParent.processRef; + } - if (camundaProperty) { - return camundaProperty.value; - } - } + // already in correct ioSpecification + if ('ioSpecification' in newParent && newParent.ioSpecification === businessObject.$parent) { + return; + } + } - return propertyValue; - } + if ((0,_util_ModelUtil__WEBPACK_IMPORTED_MODULE_2__.is)(businessObject, 'bpmn:Lane')) { - var inputOutput, - ioParameter; + if (newParent) { + newParent = this.getLaneSet(newParent); + } - if (IO_BINDING_TYPES.indexOf(bindingType) !== -1) { + containment = 'lanes'; + } else - if (scope) { - inputOutput = bo.get('inputOutput'); - } else { - inputOutput = findExtension(bo, 'camunda:InputOutput'); - } + if ((0,_util_ModelUtil__WEBPACK_IMPORTED_MODULE_2__.is)(businessObject, 'bpmn:FlowElement')) { - if (!inputOutput) { - // ioParameter cannot exist yet, return property value - return propertyValue; - } - } + if (newParent) { - // camunda input parameter - if (bindingType === CAMUNDA_INPUT_PARAMETER_TYPE) { - ioParameter = findInputParameter(inputOutput, binding); + if ((0,_util_ModelUtil__WEBPACK_IMPORTED_MODULE_2__.is)(newParent, 'bpmn:Participant')) { + newParent = newParent.processRef; + } else - if (ioParameter) { - if (binding.scriptFormat) { - if (ioParameter.definition) { - return ioParameter.definition.value; - } - } else { - return ioParameter.value || ''; - } - } + if ((0,_util_ModelUtil__WEBPACK_IMPORTED_MODULE_2__.is)(newParent, 'bpmn:Lane')) { + do { - return propertyValue; - } + // unwrap Lane -> LaneSet -> (Lane | FlowElementsContainer) + newParent = newParent.$parent.$parent; + } while ((0,_util_ModelUtil__WEBPACK_IMPORTED_MODULE_2__.is)(newParent, 'bpmn:Lane')); - // camunda output parameter - if (binding.type === CAMUNDA_OUTPUT_PARAMETER_TYPE) { - ioParameter = findOutputParameter(inputOutput, binding); + } + } - if (ioParameter) { - return ioParameter.name; - } + containment = 'flowElements'; - return propertyValue; - } + } else + if ((0,_util_ModelUtil__WEBPACK_IMPORTED_MODULE_2__.is)(businessObject, 'bpmn:Artifact')) { - var ioElement; + while (newParent && + !(0,_util_ModelUtil__WEBPACK_IMPORTED_MODULE_2__.is)(newParent, 'bpmn:Process') && + !(0,_util_ModelUtil__WEBPACK_IMPORTED_MODULE_2__.is)(newParent, 'bpmn:SubProcess') && + !(0,_util_ModelUtil__WEBPACK_IMPORTED_MODULE_2__.is)(newParent, 'bpmn:Collaboration')) { - if (IN_OUT_BINDING_TYPES.indexOf(bindingType) != -1) { - ioElement = findCamundaInOut(bo, binding); + if ((0,_util_ModelUtil__WEBPACK_IMPORTED_MODULE_2__.is)(newParent, 'bpmn:Participant')) { + newParent = newParent.processRef; + break; + } else { + newParent = newParent.$parent; + } + } - if (ioElement) { - if (bindingType === CAMUNDA_IN_BUSINESS_KEY_TYPE) { - return ioElement.businessKey; - } else - if (bindingType === CAMUNDA_OUT_TYPE) { - return ioElement.target; - } else - if (bindingType === CAMUNDA_IN_TYPE) { - return ioElement[binding.expression ? 'sourceExpression' : 'source']; - } - } + containment = 'artifacts'; + } else - return propertyValue; - } + if ((0,_util_ModelUtil__WEBPACK_IMPORTED_MODULE_2__.is)(businessObject, 'bpmn:MessageFlow')) { + containment = 'messageFlows'; - if (bindingType === CAMUNDA_EXECUTION_LISTENER_TYPE) { - var executionListener; - if (scope) { - executionListener = bo.get('executionListener'); - } else { - executionListener = findExtension(bo, 'camunda:ExecutionListener'); - } + } else - return executionListener.script.value; - } + if ((0,_util_ModelUtil__WEBPACK_IMPORTED_MODULE_2__.is)(businessObject, 'bpmn:Participant')) { + containment = 'participants'; - var fieldInjection; - if (CAMUNDA_FIELD === bindingType) { - var fieldInjections = findExtensions(bo, [ 'camunda:Field' ]); - fieldInjections.forEach(function(item) { - if (item.name === binding.name) { - fieldInjection = item; - } - }); - if (fieldInjection) { - return fieldInjection.string || fieldInjection.expression; - } else { - return ''; - } - } + // make sure the participants process is properly attached / detached + // from the XML document - throw unknownPropertyBinding(property); - } + var process = businessObject.processRef, + definitions; - module.exports.getPropertyValue = getPropertyValue; + if (process) { + definitions = getDefinitions(businessObject.$parent || newParent); + if (businessObject.$parent) { + (0,diagram_js_lib_util_Collections__WEBPACK_IMPORTED_MODULE_8__.remove)(definitions.get('rootElements'), process); + process.$parent = null; + } - /** - * Return an update operation that changes the diagram - * element's custom property to the given value. - * - * The response of this method will be processed via - * {@link PropertiesPanel#applyChanges}. - * - * @param {djs.model.Base} element - * @param {PropertyDescriptor} property - * @param {String} value - * @param {BpmnFactory} bpmnFactory - * - * @return {Object|Array} results to be processed - */ - function setPropertyValue(element, property, value, bpmnFactory) { - var bo = getBusinessObject(element); + if (newParent) { + (0,diagram_js_lib_util_Collections__WEBPACK_IMPORTED_MODULE_8__.add)(definitions.get('rootElements'), process); + process.$parent = definitions; + } + } + } else - var binding = property.binding, - scope = property.scope; + if ((0,_util_ModelUtil__WEBPACK_IMPORTED_MODULE_2__.is)(businessObject, 'bpmn:DataOutputAssociation')) { + containment = 'dataOutputAssociations'; + } else - var bindingType = binding.type, - bindingName = binding.name; + if ((0,_util_ModelUtil__WEBPACK_IMPORTED_MODULE_2__.is)(businessObject, 'bpmn:DataInputAssociation')) { + containment = 'dataInputAssociations'; + } - var propertyValue; + if (!containment) { + throw new Error(translate( + 'no parent for {element} in {parent}', + { + element: businessObject.id, + parent: newParent.id + } + )); + } - var updates = []; + var children; - var extensionElements; + if (businessObject.$parent) { - if (EXTENSION_BINDING_TYPES.indexOf(bindingType) !== -1) { - extensionElements = bo.get('extensionElements'); + // remove from old parent + children = businessObject.$parent.get(containment); + (0,diagram_js_lib_util_Collections__WEBPACK_IMPORTED_MODULE_8__.remove)(children, businessObject); + } - // create extension elements, if they do not exist (yet) - if (!extensionElements) { - extensionElements = elementHelper.createElement('bpmn:ExtensionElements', null, element, bpmnFactory); + if (!newParent) { + businessObject.$parent = null; + } else { - updates.push(cmdHelper.updateBusinessObject( - element, bo, objectWithKey('extensionElements', extensionElements) - )); - } - } + // add to new parent + children = newParent.get(containment); + children.push(businessObject); + businessObject.$parent = newParent; + } - if (scope) { - bo = findExtension(bo, scope.name); - if (!bo) { - bo = elementHelper.createElement(scope.name, null, element, bpmnFactory); + if (visualParent) { + var diChildren = visualParent.get(containment); - updates.push(cmdHelper.addElementsTolist( - bo, extensionElements, 'values', [ bo ] - )); - } - } + (0,diagram_js_lib_util_Collections__WEBPACK_IMPORTED_MODULE_8__.remove)(children, businessObject); - // property - if (bindingType === 'property') { + if (newParent) { - if (bindingName === 'conditionExpression') { + if (!diChildren) { + diChildren = []; + newParent.set(containment, diChildren); + } - propertyValue = elementHelper.createElement('bpmn:FormalExpression', { - body: value, - language: binding.scriptFormat - }, bo, bpmnFactory); - } else { + diChildren.push(businessObject); + } + } +}; - var moddlePropertyDescriptor = bo.$descriptor.propertiesByName[bindingName]; +/** + * @param {Connection} connection + */ +BpmnUpdater.prototype.updateConnectionWaypoints = function(connection) { + var di = (0,_util_ModelUtil__WEBPACK_IMPORTED_MODULE_2__.getDi)(connection); + + di.set('waypoint', this._bpmnFactory.createDiWaypoints(connection.waypoints)); +}; + +/** + * @param { { + * connection: Connection; + * parent: Parent; + * newParent: Parent; + * } } context + */ +BpmnUpdater.prototype.updateConnection = function(context) { + var connection = context.connection, + businessObject = (0,_util_ModelUtil__WEBPACK_IMPORTED_MODULE_2__.getBusinessObject)(connection), + newSource = connection.source, + newSourceBo = (0,_util_ModelUtil__WEBPACK_IMPORTED_MODULE_2__.getBusinessObject)(newSource), + newTarget = connection.target, + newTargetBo = (0,_util_ModelUtil__WEBPACK_IMPORTED_MODULE_2__.getBusinessObject)(connection.target), + visualParent; - var moddleType = moddlePropertyDescriptor.type; + if (!(0,_util_ModelUtil__WEBPACK_IMPORTED_MODULE_2__.is)(businessObject, 'bpmn:DataAssociation')) { - // make sure we only update String, Integer, Real and - // Boolean properties (do not accidentally override complex objects...) - if (BASIC_MODDLE_TYPES.indexOf(moddleType) === -1) { - throw new Error('cannot set moddle type <' + moddleType + '>'); - } + var inverseSet = (0,_util_ModelUtil__WEBPACK_IMPORTED_MODULE_2__.is)(businessObject, 'bpmn:SequenceFlow'); - if (moddleType === 'Boolean') { - propertyValue = !!value; - } else - if (moddleType === 'Integer') { - propertyValue = parseInt(value, 10); + if (businessObject.sourceRef !== newSourceBo) { + if (inverseSet) { + (0,diagram_js_lib_util_Collections__WEBPACK_IMPORTED_MODULE_8__.remove)(businessObject.sourceRef && businessObject.sourceRef.get('outgoing'), businessObject); - if (isNaN(propertyValue)) { - // do not write NaN value - propertyValue = undefined; - } - } else { - propertyValue = value; - } - } + if (newSourceBo && newSourceBo.get('outgoing')) { + newSourceBo.get('outgoing').push(businessObject); + } + } - if (propertyValue !== undefined) { - updates.push(cmdHelper.updateBusinessObject( - element, bo, objectWithKey(bindingName, propertyValue) - )); - } - } + businessObject.sourceRef = newSourceBo; + } - // camunda:property - var camundaProperties, - existingCamundaProperty, - newCamundaProperty; + if (businessObject.targetRef !== newTargetBo) { + if (inverseSet) { + (0,diagram_js_lib_util_Collections__WEBPACK_IMPORTED_MODULE_8__.remove)(businessObject.targetRef && businessObject.targetRef.get('incoming'), businessObject); - if (bindingType === CAMUNDA_PROPERTY_TYPE) { + if (newTargetBo && newTargetBo.get('incoming')) { + newTargetBo.get('incoming').push(businessObject); + } + } - if (scope) { - camundaProperties = bo.get('properties'); - } else { - camundaProperties = findExtension(extensionElements, 'camunda:Properties'); - } + businessObject.targetRef = newTargetBo; + } + } else - if (!camundaProperties) { - camundaProperties = elementHelper.createElement('camunda:Properties', null, bo, bpmnFactory); + if ((0,_util_ModelUtil__WEBPACK_IMPORTED_MODULE_2__.is)(businessObject, 'bpmn:DataInputAssociation')) { - if (scope) { - updates.push(cmdHelper.updateBusinessObject( - element, bo, { properties: camundaProperties } - )); - } - else { - updates.push(cmdHelper.addElementsTolist( - element, extensionElements, 'values', [ camundaProperties ] - )); - } - } + // handle obnoxious isMsome sourceRef + businessObject.get('sourceRef')[0] = newSourceBo; - existingCamundaProperty = findCamundaProperty(camundaProperties, binding); + visualParent = context.parent || context.newParent || newTargetBo; - newCamundaProperty = createCamundaProperty(binding, value, bpmnFactory); + this.updateSemanticParent(businessObject, newTargetBo, visualParent); + } else - updates.push(cmdHelper.addAndRemoveElementsFromList( - element, - camundaProperties, - 'values', - null, - [ newCamundaProperty ], - existingCamundaProperty ? [ existingCamundaProperty ] : [] - )); - } + if ((0,_util_ModelUtil__WEBPACK_IMPORTED_MODULE_2__.is)(businessObject, 'bpmn:DataOutputAssociation')) { + visualParent = context.parent || context.newParent || newSourceBo; - // camunda:inputParameter - // camunda:outputParameter - var inputOutput, - existingIoParameter, - newIoParameter; + this.updateSemanticParent(businessObject, newSourceBo, visualParent); - if (IO_BINDING_TYPES.indexOf(bindingType) !== -1) { + // targetRef = new target + businessObject.targetRef = newTargetBo; + } - if (scope) { - inputOutput = bo.get('inputOutput'); - } else { - inputOutput = findExtension(extensionElements, 'camunda:InputOutput'); - } + this.updateConnectionWaypoints(connection); - // create inputOutput element, if it do not exist (yet) - if (!inputOutput) { - inputOutput = elementHelper.createElement('camunda:InputOutput', null, bo, bpmnFactory); + this.updateDiConnection(connection, newSource, newTarget); +}; - if (scope) { - updates.push(cmdHelper.updateBusinessObject( - element, bo, { inputOutput: inputOutput } - )); - } - else { - updates.push(cmdHelper.addElementsTolist( - element, extensionElements, 'values', inputOutput - )); - } - } - } - if (bindingType === CAMUNDA_INPUT_PARAMETER_TYPE) { +// helpers ////////////////////// - existingIoParameter = findInputParameter(inputOutput, binding); +BpmnUpdater.prototype._getLabel = function(di) { + if (!di.label) { + di.label = this._bpmnFactory.createDiLabel(); + } - newIoParameter = createInputParameter(binding, value, bpmnFactory); + return di.label; +}; - updates.push(cmdHelper.addAndRemoveElementsFromList( - element, - inputOutput, - 'inputParameters', - null, - [ newIoParameter ], - existingIoParameter ? [ existingIoParameter ] : [] - )); - } - if (bindingType === CAMUNDA_OUTPUT_PARAMETER_TYPE) { +/** + * Call function if shape or connection is BPMN element. + * + * @param {Function} fn + * + * @return {Function} + */ +function ifBpmn(fn) { - existingIoParameter = findOutputParameter(inputOutput, binding); + return function(event) { - newIoParameter = createOutputParameter(binding, value, bpmnFactory); + var context = event.context, + element = context.shape || context.connection || context.element; - updates.push(cmdHelper.addAndRemoveElementsFromList( - element, - inputOutput, - 'outputParameters', - null, - [ newIoParameter ], - existingIoParameter ? [ existingIoParameter ] : [] - )); - } + if ((0,_util_ModelUtil__WEBPACK_IMPORTED_MODULE_2__.is)(element, 'bpmn:BaseElement')) { + fn(event); + } + }; +} +/** + * Return dc:Bounds of bpmndi:BPMNLabel if exists. + * + * @param {Shape} shape + * + * @return {ModdleElement|undefined} + */ +function getEmbeddedLabelBounds(shape) { + if (!(0,_util_ModelUtil__WEBPACK_IMPORTED_MODULE_2__.is)(shape, 'bpmn:Activity')) { + return; + } - // camunda:in - // camunda:out - // camunda:in:businessKey - var existingInOut, - newInOut; + var di = (0,_util_ModelUtil__WEBPACK_IMPORTED_MODULE_2__.getDi)(shape); - if (IN_OUT_BINDING_TYPES.indexOf(bindingType) !== -1) { + if (!di) { + return; + } - existingInOut = findCamundaInOut(bo, binding); + var label = di.get('label'); - if (bindingType === CAMUNDA_IN_TYPE) { - newInOut = createCamundaIn(binding, value, bpmnFactory); - } else - if (bindingType === CAMUNDA_OUT_TYPE) { - newInOut = createCamundaOut(binding, value, bpmnFactory); - } else { - newInOut = createCamundaInWithBusinessKey(binding, value, bpmnFactory); - } + if (!label) { + return; + } - updates.push(cmdHelper.addAndRemoveElementsFromList( - element, - extensionElements, - 'values', - null, - [ newInOut ], - existingInOut ? [ existingInOut ] : [] - )); - } - - if (bindingType === CAMUNDA_FIELD) { - var existingFieldInjections = findExtensions(bo, [ 'camunda:Field' ]); - var newFieldInjections = []; - - if (existingFieldInjections.length > 0) { - existingFieldInjections.forEach(function(item) { - if (item.name === binding.name) { - newFieldInjections.push(createCamundaFieldInjection(binding, value, bpmnFactory)); - } else { - newFieldInjections.push(item); - } - }); - } else { - newFieldInjections.push(createCamundaFieldInjection(binding, value, bpmnFactory)); - } + return label.get('bounds'); +} - updates.push(cmdHelper.addAndRemoveElementsFromList( - element, - extensionElements, - 'values', - null, - newFieldInjections, - existingFieldInjections ? existingFieldInjections : [] - )); - } +/***/ }), - if (updates.length) { - return updates; - } +/***/ "../node_modules/bpmn-js/lib/features/modeling/ElementFactory.js": +/*!***********************************************************************!*\ + !*** ../node_modules/bpmn-js/lib/features/modeling/ElementFactory.js ***! + \***********************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - // quick warning for better debugging - console.warn('no update', element, property, value); - } +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ ElementFactory) +/* harmony export */ }); +/* harmony import */ var min_dash__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! min-dash */ "../node_modules/min-dash/dist/index.esm.js"); +/* harmony import */ var inherits_browser__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! inherits-browser */ "../node_modules/inherits-browser/dist/index.es.js"); +/* harmony import */ var _util_ModelUtil__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../modeling/util/ModelingUtil */ "../node_modules/bpmn-js/lib/util/ModelUtil.js"); +/* harmony import */ var _util_DiUtil__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../util/DiUtil */ "../node_modules/bpmn-js/lib/util/DiUtil.js"); +/* harmony import */ var diagram_js_lib_core_ElementFactory__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! diagram-js/lib/core/ElementFactory */ "../node_modules/diagram-js/lib/core/ElementFactory.js"); +/* harmony import */ var _util_LabelUtil__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../util/LabelUtil */ "../node_modules/bpmn-js/lib/util/LabelUtil.js"); +/* harmony import */ var _util_CompatibilityUtil__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../util/CompatibilityUtil */ "../node_modules/bpmn-js/lib/util/CompatibilityUtil.js"); - module.exports.setPropertyValue = setPropertyValue; - /** - * Validate value of a given property. - * - * @param {String} value - * @param {PropertyDescriptor} property - * @param {Function} translate - * - * @return {Object} with validation errors - */ - function validateValue(value, property, translate) { - var constraints = property.constraints || {}; - if (constraints.notEmpty && isEmpty(value)) { - return translate('Must not be empty'); - } - if (constraints.maxLength && value.length > constraints.maxLength) { - return translate('Must have max length {length}', { length: constraints.maxLength }); - } - if (constraints.minLength && value.length < constraints.minLength) { - return translate('Must have min length {length}', { length: constraints.minLength }); - } - var pattern = constraints.pattern, - message; - if (pattern) { - if (typeof pattern !== 'string') { - message = pattern.message; - pattern = pattern.value; - } - if (!matchesPattern(value, pattern)) { - return message || translate('Must match pattern {pattern}', { pattern: pattern }); - } - } - } -// misc helpers /////////////////////////////// - function propertyWithScope(property, scopeName) { - if (!scopeName) { - return property; - } - return assign({}, property, { - scope: { - name: scopeName - } - }); - } - /** - * Return an object with a single key -> value association. - * - * @param {String} key - * @param {Any} value - * - * @return {Object} - */ - function objectWithKey(key, value) { - var obj = {}; - obj[key] = value; +/** + * @typedef {import('diagram-js/lib/i18n/translate/translate').default} Translate + * + * @typedef {import('diagram-js/lib/util/Types').Dimensions} Dimensions + * + * @typedef {import('./BpmnFactory').default} BpmnFactory + * + * @typedef {import('../../model/Types').BpmnAttributes} BpmnAttributes + * @typedef {import('../../model/Types').Connection} Connection + * @typedef {import('../../model/Types').Element} Element + * @typedef {import('../../model/Types').Label} Label + * @typedef {import('../../model/Types').Root} Root + * @typedef {import('../../model/Types').Shape} Shape + * @typedef {import('../../model/Types').Moddle} Moddle + * @typedef {import('../../model/Types').ModdleElement} ModdleElement + */ - return obj; - } +/** + * A BPMN-specific element factory. + * + * @template {Connection} [T=Connection] + * @template {Label} [U=Label] + * @template {Root} [V=Root] + * @template {Shape} [W=Shape] + * + * @extends {BaseElementFactory} + * + * @param {BpmnFactory} bpmnFactory + * @param {Moddle} moddle + * @param {Translate} translate + */ +function ElementFactory(bpmnFactory, moddle, translate) { + diagram_js_lib_core_ElementFactory__WEBPACK_IMPORTED_MODULE_0__["default"].call(this); - /** - * Does the given string match the specified pattern? - * - * @param {String} str - * @param {String} pattern - * - * @return {Boolean} - */ - function matchesPattern(str, pattern) { - var regexp = new RegExp(pattern); + this._bpmnFactory = bpmnFactory; + this._moddle = moddle; + this._translate = translate; +} - return regexp.test(str); - } +(0,inherits_browser__WEBPACK_IMPORTED_MODULE_1__["default"])(ElementFactory, diagram_js_lib_core_ElementFactory__WEBPACK_IMPORTED_MODULE_0__["default"]); - function isEmpty(str) { - return !str || /^\s*$/.test(str); - } +ElementFactory.$inject = [ + 'bpmnFactory', + 'moddle', + 'translate' +]; - /** - * Create a new {@link Error} indicating an unknown - * property binding. - * - * @param {PropertyDescriptor} property - * - * @return {Error} - */ - function unknownPropertyBinding(property) { - var binding = property.binding; +ElementFactory.prototype._baseCreate = diagram_js_lib_core_ElementFactory__WEBPACK_IMPORTED_MODULE_0__["default"].prototype.create; - return new Error('unknown binding: <' + binding.type + '>'); - } +/** + * Create a root element. + * + * @overlord + * @param {'root'} elementType + * @param {Partial & Partial} [attrs] + * @return {V} + */ - },{"../../../../factory/EntryFactory":14,"../../../../helper/CmdHelper":25,"../../../../helper/ElementHelper":26,"../CreateHelper":52,"../Helper":56,"bpmn-js/lib/util/ModelUtil":240,"lodash/assign":604}],63:[function(require,module,exports){ - module.exports = { - __depends__: [ - require('./element-templates'), - require('diagram-js/lib/i18n/translate').default - ], - __init__: [ 'propertiesProvider' ], - propertiesProvider: [ 'type', require('./CamundaPropertiesProvider') ] - }; +/** + * Create a shape. + * + * @overlord + * @param {'shape'} elementType + * @param {Partial & Partial} [attrs] + * @return {W} + */ - },{"./CamundaPropertiesProvider":51,"./element-templates":60,"diagram-js/lib/i18n/translate":401}],64:[function(require,module,exports){ - 'use strict'; +/** + * Create a connection. + * + * @overlord + * @param {'connection'} elementType + * @param {Partial & Partial} [attrs] + * @return {T} + */ - var getBusinessObject = require('bpmn-js/lib/util/ModelUtil').getBusinessObject, - is = require('bpmn-js/lib/util/ModelUtil').is, - asyncContinuation = require('./implementation/AsyncContinuation'); +/** + * Create a label. + * + * @param {'label'} elementType + * @param {Partial