cli-claw-kit 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +245 -0
- package/config/default-groups.json +1 -0
- package/config/global-agents-md.template.md +37 -0
- package/config/mount-allowlist.json +11 -0
- package/container/Dockerfile +160 -0
- package/container/agent-runner/dist/.tsbuildinfo +1 -0
- package/container/agent-runner/dist/agent-definitions.js +22 -0
- package/container/agent-runner/dist/channel-prefixes.js +16 -0
- package/container/agent-runner/dist/codex-config.js +29 -0
- package/container/agent-runner/dist/image-detector.js +96 -0
- package/container/agent-runner/dist/index.js +2587 -0
- package/container/agent-runner/dist/mcp-tools.js +1076 -0
- package/container/agent-runner/dist/stream-event.types.js +5 -0
- package/container/agent-runner/dist/stream-processor.js +867 -0
- package/container/agent-runner/dist/types.js +6 -0
- package/container/agent-runner/dist/utils.js +115 -0
- package/container/agent-runner/package.json +36 -0
- package/container/agent-runner/prompts/security-rules.md +31 -0
- package/container/agent-runner/src/agent-definitions.ts +27 -0
- package/container/agent-runner/src/channel-prefixes.ts +16 -0
- package/container/agent-runner/src/codex-config.ts +40 -0
- package/container/agent-runner/src/image-detector.ts +116 -0
- package/container/agent-runner/src/index.ts +3107 -0
- package/container/agent-runner/src/mcp-tools.ts +1295 -0
- package/container/agent-runner/src/stream-event.types.ts +10 -0
- package/container/agent-runner/src/stream-processor.ts +932 -0
- package/container/agent-runner/src/types.ts +75 -0
- package/container/agent-runner/src/utils.ts +114 -0
- package/container/agent-runner/tsconfig.json +17 -0
- package/container/build.sh +28 -0
- package/container/entrypoint.sh +64 -0
- package/container/skills/agent-browser/SKILL.md +159 -0
- package/container/skills/install-skill/SKILL.md +64 -0
- package/container/skills/post-test-cleanup/SKILL.md +121 -0
- package/dist/.tsbuildinfo +1 -0
- package/dist/agent-output-parser.js +459 -0
- package/dist/app-root.js +52 -0
- package/dist/assistant-meta-footer.js +1 -0
- package/dist/auth.js +91 -0
- package/dist/billing.js +694 -0
- package/dist/channel-prefixes.js +16 -0
- package/dist/cli.js +86 -0
- package/dist/commands.js +79 -0
- package/dist/config.js +120 -0
- package/dist/container-runner.js +981 -0
- package/dist/daily-summary.js +210 -0
- package/dist/db.js +3683 -0
- package/dist/dingtalk.js +1347 -0
- package/dist/feishu-markdown-style.js +97 -0
- package/dist/feishu-streaming-card.js +1875 -0
- package/dist/feishu.js +1628 -0
- package/dist/file-manager.js +270 -0
- package/dist/group-queue.js +1070 -0
- package/dist/group-runtime.js +35 -0
- package/dist/host-workspace-cwd.js +85 -0
- package/dist/im-channel.js +384 -0
- package/dist/im-command-utils.js +142 -0
- package/dist/im-downloader.js +45 -0
- package/dist/im-manager.js +527 -0
- package/dist/im-utils.js +53 -0
- package/dist/image-detector.js +96 -0
- package/dist/index.js +5828 -0
- package/dist/logger.js +22 -0
- package/dist/mcp-utils.js +66 -0
- package/dist/message-attachments.js +69 -0
- package/dist/message-notifier.js +36 -0
- package/dist/middleware/auth.js +85 -0
- package/dist/mount-security.js +315 -0
- package/dist/permissions.js +67 -0
- package/dist/project-memory.js +6 -0
- package/dist/provider-pool.js +189 -0
- package/dist/qq.js +826 -0
- package/dist/reset-admin.js +42 -0
- package/dist/routes/admin.js +543 -0
- package/dist/routes/agent-definitions.js +241 -0
- package/dist/routes/agents.js +533 -0
- package/dist/routes/auth.js +675 -0
- package/dist/routes/billing.js +490 -0
- package/dist/routes/browse.js +210 -0
- package/dist/routes/bug-report.js +387 -0
- package/dist/routes/config.js +1868 -0
- package/dist/routes/files.js +671 -0
- package/dist/routes/groups.js +1367 -0
- package/dist/routes/mcp-servers.js +320 -0
- package/dist/routes/memory.js +523 -0
- package/dist/routes/monitor.js +307 -0
- package/dist/routes/skills.js +777 -0
- package/dist/routes/tasks.js +509 -0
- package/dist/routes/usage.js +64 -0
- package/dist/routes/workspace-config.js +458 -0
- package/dist/runtime-build.js +112 -0
- package/dist/runtime-command-handler.js +189 -0
- package/dist/runtime-command-registry.js +1 -0
- package/dist/runtime-config.js +1777 -0
- package/dist/runtime-identity.js +52 -0
- package/dist/schemas.js +590 -0
- package/dist/script-runner.js +64 -0
- package/dist/sdk-query.js +82 -0
- package/dist/skill-utils.js +145 -0
- package/dist/sqlite-compat.js +19 -0
- package/dist/stream-event.types.js +5 -0
- package/dist/streaming-runtime-meta.js +29 -0
- package/dist/task-scheduler.js +695 -0
- package/dist/task-utils.js +13 -0
- package/dist/telegram-pairing.js +59 -0
- package/dist/telegram.js +897 -0
- package/dist/terminal-manager.js +307 -0
- package/dist/tool-step-display.js +1 -0
- package/dist/types.js +1 -0
- package/dist/utils.js +85 -0
- package/dist/web-context.js +161 -0
- package/dist/web.js +1377 -0
- package/dist/wechat-crypto.js +182 -0
- package/dist/wechat.js +589 -0
- package/dist/workspace-runtime-reset.js +35 -0
- package/package.json +107 -0
- package/shared/assistant-meta-footer.ts +127 -0
- package/shared/channel-prefixes.ts +16 -0
- package/shared/dist/assistant-meta-footer.d.ts +29 -0
- package/shared/dist/assistant-meta-footer.js +85 -0
- package/shared/dist/channel-prefixes.d.ts +4 -0
- package/shared/dist/channel-prefixes.js +16 -0
- package/shared/dist/image-detector.d.ts +20 -0
- package/shared/dist/image-detector.js +96 -0
- package/shared/dist/runtime-command-registry.d.ts +38 -0
- package/shared/dist/runtime-command-registry.js +185 -0
- package/shared/dist/stream-event.d.ts +65 -0
- package/shared/dist/stream-event.js +8 -0
- package/shared/dist/tool-step-display.d.ts +4 -0
- package/shared/dist/tool-step-display.js +11 -0
- package/shared/image-detector.ts +116 -0
- package/shared/runtime-command-registry.ts +252 -0
- package/shared/stream-event.ts +67 -0
- package/shared/tool-step-display.ts +21 -0
- package/shared/tsconfig.json +24 -0
- package/web/dist/assets/BillingPage-B1wBR_o-.js +52 -0
- package/web/dist/assets/ChatPage-6GBZ9nXN.css +32 -0
- package/web/dist/assets/ChatPage-BOJcXtaj.js +161 -0
- package/web/dist/assets/KaTeX_AMS-Regular-BQhdFMY1.woff2 +0 -0
- package/web/dist/assets/KaTeX_AMS-Regular-DMm9YOAa.woff +0 -0
- package/web/dist/assets/KaTeX_AMS-Regular-DRggAlZN.ttf +0 -0
- package/web/dist/assets/KaTeX_Caligraphic-Bold-ATXxdsX0.ttf +0 -0
- package/web/dist/assets/KaTeX_Caligraphic-Bold-BEiXGLvX.woff +0 -0
- package/web/dist/assets/KaTeX_Caligraphic-Bold-Dq_IR9rO.woff2 +0 -0
- package/web/dist/assets/KaTeX_Caligraphic-Regular-CTRA-rTL.woff +0 -0
- package/web/dist/assets/KaTeX_Caligraphic-Regular-Di6jR-x-.woff2 +0 -0
- package/web/dist/assets/KaTeX_Caligraphic-Regular-wX97UBjC.ttf +0 -0
- package/web/dist/assets/KaTeX_Fraktur-Bold-BdnERNNW.ttf +0 -0
- package/web/dist/assets/KaTeX_Fraktur-Bold-BsDP51OF.woff +0 -0
- package/web/dist/assets/KaTeX_Fraktur-Bold-CL6g_b3V.woff2 +0 -0
- package/web/dist/assets/KaTeX_Fraktur-Regular-CB_wures.ttf +0 -0
- package/web/dist/assets/KaTeX_Fraktur-Regular-CTYiF6lA.woff2 +0 -0
- package/web/dist/assets/KaTeX_Fraktur-Regular-Dxdc4cR9.woff +0 -0
- package/web/dist/assets/KaTeX_Main-Bold-Cx986IdX.woff2 +0 -0
- package/web/dist/assets/KaTeX_Main-Bold-Jm3AIy58.woff +0 -0
- package/web/dist/assets/KaTeX_Main-Bold-waoOVXN0.ttf +0 -0
- package/web/dist/assets/KaTeX_Main-BoldItalic-DxDJ3AOS.woff2 +0 -0
- package/web/dist/assets/KaTeX_Main-BoldItalic-DzxPMmG6.ttf +0 -0
- package/web/dist/assets/KaTeX_Main-BoldItalic-SpSLRI95.woff +0 -0
- package/web/dist/assets/KaTeX_Main-Italic-3WenGoN9.ttf +0 -0
- package/web/dist/assets/KaTeX_Main-Italic-BMLOBm91.woff +0 -0
- package/web/dist/assets/KaTeX_Main-Italic-NWA7e6Wa.woff2 +0 -0
- package/web/dist/assets/KaTeX_Main-Regular-B22Nviop.woff2 +0 -0
- package/web/dist/assets/KaTeX_Main-Regular-Dr94JaBh.woff +0 -0
- package/web/dist/assets/KaTeX_Main-Regular-ypZvNtVU.ttf +0 -0
- package/web/dist/assets/KaTeX_Math-BoldItalic-B3XSjfu4.ttf +0 -0
- package/web/dist/assets/KaTeX_Math-BoldItalic-CZnvNsCZ.woff2 +0 -0
- package/web/dist/assets/KaTeX_Math-BoldItalic-iY-2wyZ7.woff +0 -0
- package/web/dist/assets/KaTeX_Math-Italic-DA0__PXp.woff +0 -0
- package/web/dist/assets/KaTeX_Math-Italic-flOr_0UB.ttf +0 -0
- package/web/dist/assets/KaTeX_Math-Italic-t53AETM-.woff2 +0 -0
- package/web/dist/assets/KaTeX_SansSerif-Bold-CFMepnvq.ttf +0 -0
- package/web/dist/assets/KaTeX_SansSerif-Bold-D1sUS0GD.woff2 +0 -0
- package/web/dist/assets/KaTeX_SansSerif-Bold-DbIhKOiC.woff +0 -0
- package/web/dist/assets/KaTeX_SansSerif-Italic-C3H0VqGB.woff2 +0 -0
- package/web/dist/assets/KaTeX_SansSerif-Italic-DN2j7dab.woff +0 -0
- package/web/dist/assets/KaTeX_SansSerif-Italic-YYjJ1zSn.ttf +0 -0
- package/web/dist/assets/KaTeX_SansSerif-Regular-BNo7hRIc.ttf +0 -0
- package/web/dist/assets/KaTeX_SansSerif-Regular-CS6fqUqJ.woff +0 -0
- package/web/dist/assets/KaTeX_SansSerif-Regular-DDBCnlJ7.woff2 +0 -0
- package/web/dist/assets/KaTeX_Script-Regular-C5JkGWo-.ttf +0 -0
- package/web/dist/assets/KaTeX_Script-Regular-D3wIWfF6.woff2 +0 -0
- package/web/dist/assets/KaTeX_Script-Regular-D5yQViql.woff +0 -0
- package/web/dist/assets/KaTeX_Size1-Regular-C195tn64.woff +0 -0
- package/web/dist/assets/KaTeX_Size1-Regular-Dbsnue_I.ttf +0 -0
- package/web/dist/assets/KaTeX_Size1-Regular-mCD8mA8B.woff2 +0 -0
- package/web/dist/assets/KaTeX_Size2-Regular-B7gKUWhC.ttf +0 -0
- package/web/dist/assets/KaTeX_Size2-Regular-Dy4dx90m.woff2 +0 -0
- package/web/dist/assets/KaTeX_Size2-Regular-oD1tc_U0.woff +0 -0
- package/web/dist/assets/KaTeX_Size3-Regular-CTq5MqoE.woff +0 -0
- package/web/dist/assets/KaTeX_Size3-Regular-DgpXs0kz.ttf +0 -0
- package/web/dist/assets/KaTeX_Size4-Regular-BF-4gkZK.woff +0 -0
- package/web/dist/assets/KaTeX_Size4-Regular-DWFBv043.ttf +0 -0
- package/web/dist/assets/KaTeX_Size4-Regular-Dl5lxZxV.woff2 +0 -0
- package/web/dist/assets/KaTeX_Typewriter-Regular-C0xS9mPB.woff +0 -0
- package/web/dist/assets/KaTeX_Typewriter-Regular-CO6r4hn1.woff2 +0 -0
- package/web/dist/assets/KaTeX_Typewriter-Regular-D3Ib7_Hf.ttf +0 -0
- package/web/dist/assets/SettingsPage-DoY7FoZ_.js +153 -0
- package/web/dist/assets/ShareImageDialog-C1ga8b7l.js +22 -0
- package/web/dist/assets/TasksPage-CRivnNsx.js +14 -0
- package/web/dist/assets/_basePickBy-Bf-bSoS9.js +1 -0
- package/web/dist/assets/_baseUniq-zAOaCuKw.js +1 -0
- package/web/dist/assets/arc-Dm9mVQ9U.js +1 -0
- package/web/dist/assets/architectureDiagram-2XIMDMQ5-BLmzX1wr.js +36 -0
- package/web/dist/assets/band-CquvqAHh.js +1 -0
- package/web/dist/assets/blockDiagram-WCTKOSBZ-B9pcqm3j.js +132 -0
- package/web/dist/assets/c4Diagram-IC4MRINW-Cytx1q3b.js +10 -0
- package/web/dist/assets/channel-BOVj73LR.js +1 -0
- package/web/dist/assets/channel-meta-CQD0Pei-.js +41 -0
- package/web/dist/assets/chunk-4BX2VUAB-0ToDr6RE.js +1 -0
- package/web/dist/assets/chunk-55IACEB6-DQDjnXfS.js +1 -0
- package/web/dist/assets/chunk-FMBD7UC4-Di8ABm6c.js +15 -0
- package/web/dist/assets/chunk-JSJVCQXG-BZQN6rnX.js +1 -0
- package/web/dist/assets/chunk-KX2RTZJC-zBbcpaN_.js +1 -0
- package/web/dist/assets/chunk-NQ4KR5QH-BCrLoU88.js +220 -0
- package/web/dist/assets/chunk-QZHKN3VN-Bqk8juan.js +1 -0
- package/web/dist/assets/chunk-WL4C6EOR-D2YX-MHY.js +189 -0
- package/web/dist/assets/classDiagram-VBA2DB6C-DUUoMyaK.js +1 -0
- package/web/dist/assets/classDiagram-v2-RAHNMMFH-DUUoMyaK.js +1 -0
- package/web/dist/assets/clone-BmaCesfa.js +1 -0
- package/web/dist/assets/cose-bilkent-S5V4N54A-CTsv6qQA.js +1 -0
- package/web/dist/assets/cytoscape.esm-BQaXIfA_.js +331 -0
- package/web/dist/assets/dagre-KLK3FWXG-Ci4Jh9nu.js +4 -0
- package/web/dist/assets/defaultLocale-DX6XiGOO.js +1 -0
- package/web/dist/assets/diagram-E7M64L7V-BFRnfTI2.js +24 -0
- package/web/dist/assets/diagram-IFDJBPK2-B7Zhnp0b.js +43 -0
- package/web/dist/assets/diagram-P4PSJMXO-BVyP7nwq.js +24 -0
- package/web/dist/assets/erDiagram-INFDFZHY-NorKdTOF.js +70 -0
- package/web/dist/assets/error-CGD5mp5f.js +1 -0
- package/web/dist/assets/flowDiagram-PKNHOUZH-Ch97nABF.js +162 -0
- package/web/dist/assets/ganttDiagram-A5KZAMGK-BQ2pLWsy.js +292 -0
- package/web/dist/assets/gitGraphDiagram-K3NZZRJ6-bcvnBsD2.js +65 -0
- package/web/dist/assets/graph-CeAEckur.js +1 -0
- package/web/dist/assets/index-CPnL1_qC.js +768 -0
- package/web/dist/assets/index-DVevCbcO.css +10 -0
- package/web/dist/assets/infoDiagram-LFFYTUFH-CcsrFdj-.js +2 -0
- package/web/dist/assets/init-Dmth1JHB.js +1 -0
- package/web/dist/assets/ishikawaDiagram-PHBUUO56-1upyMfHN.js +70 -0
- package/web/dist/assets/journeyDiagram-4ABVD52K-CKUi-V0c.js +139 -0
- package/web/dist/assets/kanban-definition-K7BYSVSG-DOnQwXfL.js +89 -0
- package/web/dist/assets/layout-BmMMqTnJ.js +1 -0
- package/web/dist/assets/linear-DiaJloY5.js +1 -0
- package/web/dist/assets/mermaid.core-BWLV1B2v.js +254 -0
- package/web/dist/assets/mindmap-definition-YRQLILUH-BeAKHVWP.js +68 -0
- package/web/dist/assets/ordinal-DILIJJjt.js +1 -0
- package/web/dist/assets/pieDiagram-SKSYHLDU-DfiMSfWo.js +30 -0
- package/web/dist/assets/quadrantDiagram-337W2JSQ-wZxZOJxd.js +7 -0
- package/web/dist/assets/requirementDiagram-Z7DCOOCP-BK4HHm17.js +73 -0
- package/web/dist/assets/sankeyDiagram-WA2Y5GQK-BX6t2avX.js +10 -0
- package/web/dist/assets/sequenceDiagram-2WXFIKYE-BPQlkbAa.js +145 -0
- package/web/dist/assets/sheet-rI0FfB1g.js +6 -0
- package/web/dist/assets/sliders-horizontal-CuijWFNK.js +6 -0
- package/web/dist/assets/sparkles-BsMYXJoT.js +11 -0
- package/web/dist/assets/square-0CqMX1Q3.js +11 -0
- package/web/dist/assets/stateDiagram-RAJIS63D-DxkV0Vwd.js +1 -0
- package/web/dist/assets/stateDiagram-v2-FVOUBMTO-qLYoiOPe.js +1 -0
- package/web/dist/assets/step-D51IIHGA.js +1 -0
- package/web/dist/assets/tasks-D8JjBTwx.js +1 -0
- package/web/dist/assets/time-O8zIGux3.js +1 -0
- package/web/dist/assets/timeline-definition-YZTLITO2-kNp1DyFc.js +61 -0
- package/web/dist/assets/treemap-KZPCXAKY-CkrClVhk.js +162 -0
- package/web/dist/assets/utils-KGAn0XTg.js +11 -0
- package/web/dist/assets/vennDiagram-LZ73GAT5-CgdzEZz4.js +34 -0
- package/web/dist/assets/xychartDiagram-JWTSCODW-DfYGPfNB.js +7 -0
- package/web/dist/assets/zap-_hKJYy7J.js +6 -0
- package/web/dist/favicon.svg +332 -0
- package/web/dist/fonts/AlibabaPuHuiTi-3-55-Regular.woff2 +0 -0
- package/web/dist/fonts/AlibabaPuHuiTi-3-65-Medium.woff2 +0 -0
- package/web/dist/fonts/AlibabaPuHuiTi-3-75-SemiBold.woff2 +0 -0
- package/web/dist/fonts/DMSans-latin-ext.woff2 +0 -0
- package/web/dist/fonts/DMSans-latin.woff2 +0 -0
- package/web/dist/icons/README.md +20 -0
- package/web/dist/icons/apple-touch-icon-180.png +0 -0
- package/web/dist/icons/icon-128.png +0 -0
- package/web/dist/icons/icon-144.png +0 -0
- package/web/dist/icons/icon-152.png +0 -0
- package/web/dist/icons/icon-192.png +0 -0
- package/web/dist/icons/icon-192.svg +332 -0
- package/web/dist/icons/icon-384.png +0 -0
- package/web/dist/icons/icon-48.png +0 -0
- package/web/dist/icons/icon-512-maskable.png +0 -0
- package/web/dist/icons/icon-512.png +0 -0
- package/web/dist/icons/icon-512.svg +332 -0
- package/web/dist/icons/icon-72.png +0 -0
- package/web/dist/icons/icon-96.png +0 -0
- package/web/dist/icons/loading-logo.svg +332 -0
- package/web/dist/icons/logo-1024.png +0 -0
- package/web/dist/icons/logo-icon.svg +332 -0
- package/web/dist/icons/logo-text.svg +332 -0
- package/web/dist/index.html +30 -0
- package/web/dist/manifest.webmanifest +1 -0
- package/web/dist/registerSW.js +1 -0
- package/web/dist/sw.js +1 -0
- package/web/dist/workbox-08d6266a.js +1 -0
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import{_,n as je,c as et,d as kt,l as Q,j as ve,e as ts,f as es,k as S,b as me,s as ss,p as rs,a as as,g as is,q as ns,t as os,J as cs,y as ls,i as vt,u as q,L as U,M as Nt,N as Ce,Z as hs,O as ds,P as Me,F as Gt}from"./mermaid.core-BWLV1B2v.js";import{a as Ts,b as Qt,g as lt,d as Es,e as $t,f as jt}from"./chunk-JSJVCQXG-BZQN6rnX.js";import{I as ps}from"./chunk-QZHKN3VN-Bqk8juan.js";import"./index-CPnL1_qC.js";import"./step-D51IIHGA.js";var Xt=(function(){var e=_(function(Tt,b,A,N){for(A=A||{},N=Tt.length;N--;A[Tt[N]]=b);return A},"o"),t=[1,2],a=[1,3],s=[1,4],i=[2,4],n=[1,9],o=[1,11],h=[1,12],l=[1,14],r=[1,15],E=[1,17],p=[1,18],f=[1,19],u=[1,25],y=[1,26],I=[1,27],L=[1,28],w=[1,29],P=[1,30],m=[1,31],k=[1,32],v=[1,33],W=[1,34],K=[1,35],H=[1,36],G=[1,37],X=[1,38],z=[1,39],C=[1,40],$=[1,42],J=[1,43],j=[1,44],st=[1,45],rt=[1,46],O=[1,47],R=[1,4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,48,49,50,51,53,54,56,61,62,63,64,73],nt=[1,74],ot=[1,80],M=[1,81],te=[1,82],ee=[1,83],se=[1,84],re=[1,85],ae=[1,86],ie=[1,87],ne=[1,88],oe=[1,89],ce=[1,90],le=[1,91],he=[1,92],de=[1,93],Te=[1,94],Ee=[1,95],pe=[1,96],ue=[1,97],_e=[1,98],fe=[1,99],ge=[1,100],xe=[1,101],Ie=[1,102],Re=[1,103],Oe=[1,104],ye=[1,105],Le=[2,78],Lt=[4,5,17,51,53,54],At=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,51,53,54,56,61,62,63,64,73],be=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,50,51,53,54,56,61,62,63,64,73],Wt=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,49,51,53,54,56,61,62,63,64,73],Se=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,48,51,53,54,56,61,62,63,64,73],Kt=[5,52],B=[70,71,72,73],at=[1,151],Ft={trace:_(function(){},"trace"),yy:{},symbols_:{error:2,start:3,SPACE:4,NEWLINE:5,SD:6,document:7,line:8,statement:9,INVALID:10,box_section:11,box_line:12,participant_statement:13,create:14,box:15,restOfLine:16,end:17,signal:18,autonumber:19,NUM:20,off:21,activate:22,actor:23,deactivate:24,note_statement:25,links_statement:26,link_statement:27,properties_statement:28,details_statement:29,title:30,legacy_title:31,acc_title:32,acc_title_value:33,acc_descr:34,acc_descr_value:35,acc_descr_multiline_value:36,loop:37,rect:38,opt:39,alt:40,else_sections:41,par:42,par_sections:43,par_over:44,critical:45,option_sections:46,break:47,option:48,and:49,else:50,participant:51,AS:52,participant_actor:53,destroy:54,actor_with_config:55,note:56,placement:57,text2:58,over:59,actor_pair:60,links:61,link:62,properties:63,details:64,spaceList:65,",":66,left_of:67,right_of:68,signaltype:69,"+":70,"-":71,"()":72,ACTOR:73,config_object:74,CONFIG_START:75,CONFIG_CONTENT:76,CONFIG_END:77,SOLID_OPEN_ARROW:78,DOTTED_OPEN_ARROW:79,SOLID_ARROW:80,SOLID_ARROW_TOP:81,SOLID_ARROW_BOTTOM:82,STICK_ARROW_TOP:83,STICK_ARROW_BOTTOM:84,SOLID_ARROW_TOP_DOTTED:85,SOLID_ARROW_BOTTOM_DOTTED:86,STICK_ARROW_TOP_DOTTED:87,STICK_ARROW_BOTTOM_DOTTED:88,SOLID_ARROW_TOP_REVERSE:89,SOLID_ARROW_BOTTOM_REVERSE:90,STICK_ARROW_TOP_REVERSE:91,STICK_ARROW_BOTTOM_REVERSE:92,SOLID_ARROW_TOP_REVERSE_DOTTED:93,SOLID_ARROW_BOTTOM_REVERSE_DOTTED:94,STICK_ARROW_TOP_REVERSE_DOTTED:95,STICK_ARROW_BOTTOM_REVERSE_DOTTED:96,BIDIRECTIONAL_SOLID_ARROW:97,DOTTED_ARROW:98,BIDIRECTIONAL_DOTTED_ARROW:99,SOLID_CROSS:100,DOTTED_CROSS:101,SOLID_POINT:102,DOTTED_POINT:103,TXT:104,$accept:0,$end:1},terminals_:{2:"error",4:"SPACE",5:"NEWLINE",6:"SD",10:"INVALID",14:"create",15:"box",16:"restOfLine",17:"end",19:"autonumber",20:"NUM",21:"off",22:"activate",24:"deactivate",30:"title",31:"legacy_title",32:"acc_title",33:"acc_title_value",34:"acc_descr",35:"acc_descr_value",36:"acc_descr_multiline_value",37:"loop",38:"rect",39:"opt",40:"alt",42:"par",44:"par_over",45:"critical",47:"break",48:"option",49:"and",50:"else",51:"participant",52:"AS",53:"participant_actor",54:"destroy",56:"note",59:"over",61:"links",62:"link",63:"properties",64:"details",66:",",67:"left_of",68:"right_of",70:"+",71:"-",72:"()",73:"ACTOR",75:"CONFIG_START",76:"CONFIG_CONTENT",77:"CONFIG_END",78:"SOLID_OPEN_ARROW",79:"DOTTED_OPEN_ARROW",80:"SOLID_ARROW",81:"SOLID_ARROW_TOP",82:"SOLID_ARROW_BOTTOM",83:"STICK_ARROW_TOP",84:"STICK_ARROW_BOTTOM",85:"SOLID_ARROW_TOP_DOTTED",86:"SOLID_ARROW_BOTTOM_DOTTED",87:"STICK_ARROW_TOP_DOTTED",88:"STICK_ARROW_BOTTOM_DOTTED",89:"SOLID_ARROW_TOP_REVERSE",90:"SOLID_ARROW_BOTTOM_REVERSE",91:"STICK_ARROW_TOP_REVERSE",92:"STICK_ARROW_BOTTOM_REVERSE",93:"SOLID_ARROW_TOP_REVERSE_DOTTED",94:"SOLID_ARROW_BOTTOM_REVERSE_DOTTED",95:"STICK_ARROW_TOP_REVERSE_DOTTED",96:"STICK_ARROW_BOTTOM_REVERSE_DOTTED",97:"BIDIRECTIONAL_SOLID_ARROW",98:"DOTTED_ARROW",99:"BIDIRECTIONAL_DOTTED_ARROW",100:"SOLID_CROSS",101:"DOTTED_CROSS",102:"SOLID_POINT",103:"DOTTED_POINT",104:"TXT"},productions_:[0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[8,1],[8,1],[8,1],[11,0],[11,2],[12,2],[12,1],[12,1],[9,1],[9,2],[9,4],[9,2],[9,4],[9,3],[9,3],[9,2],[9,3],[9,3],[9,2],[9,2],[9,2],[9,2],[9,2],[9,1],[9,1],[9,2],[9,2],[9,1],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[46,1],[46,4],[43,1],[43,4],[41,1],[41,4],[13,5],[13,3],[13,5],[13,3],[13,3],[13,5],[13,3],[13,5],[13,3],[25,4],[25,4],[26,3],[27,3],[28,3],[29,3],[65,2],[65,1],[60,3],[60,1],[57,1],[57,1],[18,5],[18,5],[18,5],[18,5],[18,6],[18,4],[55,2],[74,3],[23,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[58,1]],performAction:_(function(b,A,N,g,V,c,bt){var T=c.length-1;switch(V){case 3:return g.apply(c[T]),c[T];case 4:case 10:this.$=[];break;case 5:case 11:c[T-1].push(c[T]),this.$=c[T-1];break;case 6:case 7:case 12:case 13:this.$=c[T];break;case 8:case 9:case 14:this.$=[];break;case 16:c[T].type="createParticipant",this.$=c[T];break;case 17:c[T-1].unshift({type:"boxStart",boxData:g.parseBoxData(c[T-2])}),c[T-1].push({type:"boxEnd",boxText:c[T-2]}),this.$=c[T-1];break;case 19:this.$={type:"sequenceIndex",sequenceIndex:Number(c[T-2]),sequenceIndexStep:Number(c[T-1]),sequenceVisible:!0,signalType:g.LINETYPE.AUTONUMBER};break;case 20:this.$={type:"sequenceIndex",sequenceIndex:Number(c[T-1]),sequenceIndexStep:1,sequenceVisible:!0,signalType:g.LINETYPE.AUTONUMBER};break;case 21:this.$={type:"sequenceIndex",sequenceVisible:!1,signalType:g.LINETYPE.AUTONUMBER};break;case 22:this.$={type:"sequenceIndex",sequenceVisible:!0,signalType:g.LINETYPE.AUTONUMBER};break;case 23:this.$={type:"activeStart",signalType:g.LINETYPE.ACTIVE_START,actor:c[T-1].actor};break;case 24:this.$={type:"activeEnd",signalType:g.LINETYPE.ACTIVE_END,actor:c[T-1].actor};break;case 30:g.setDiagramTitle(c[T].substring(6)),this.$=c[T].substring(6);break;case 31:g.setDiagramTitle(c[T].substring(7)),this.$=c[T].substring(7);break;case 32:this.$=c[T].trim(),g.setAccTitle(this.$);break;case 33:case 34:this.$=c[T].trim(),g.setAccDescription(this.$);break;case 35:c[T-1].unshift({type:"loopStart",loopText:g.parseMessage(c[T-2]),signalType:g.LINETYPE.LOOP_START}),c[T-1].push({type:"loopEnd",loopText:c[T-2],signalType:g.LINETYPE.LOOP_END}),this.$=c[T-1];break;case 36:c[T-1].unshift({type:"rectStart",color:g.parseMessage(c[T-2]),signalType:g.LINETYPE.RECT_START}),c[T-1].push({type:"rectEnd",color:g.parseMessage(c[T-2]),signalType:g.LINETYPE.RECT_END}),this.$=c[T-1];break;case 37:c[T-1].unshift({type:"optStart",optText:g.parseMessage(c[T-2]),signalType:g.LINETYPE.OPT_START}),c[T-1].push({type:"optEnd",optText:g.parseMessage(c[T-2]),signalType:g.LINETYPE.OPT_END}),this.$=c[T-1];break;case 38:c[T-1].unshift({type:"altStart",altText:g.parseMessage(c[T-2]),signalType:g.LINETYPE.ALT_START}),c[T-1].push({type:"altEnd",signalType:g.LINETYPE.ALT_END}),this.$=c[T-1];break;case 39:c[T-1].unshift({type:"parStart",parText:g.parseMessage(c[T-2]),signalType:g.LINETYPE.PAR_START}),c[T-1].push({type:"parEnd",signalType:g.LINETYPE.PAR_END}),this.$=c[T-1];break;case 40:c[T-1].unshift({type:"parStart",parText:g.parseMessage(c[T-2]),signalType:g.LINETYPE.PAR_OVER_START}),c[T-1].push({type:"parEnd",signalType:g.LINETYPE.PAR_END}),this.$=c[T-1];break;case 41:c[T-1].unshift({type:"criticalStart",criticalText:g.parseMessage(c[T-2]),signalType:g.LINETYPE.CRITICAL_START}),c[T-1].push({type:"criticalEnd",signalType:g.LINETYPE.CRITICAL_END}),this.$=c[T-1];break;case 42:c[T-1].unshift({type:"breakStart",breakText:g.parseMessage(c[T-2]),signalType:g.LINETYPE.BREAK_START}),c[T-1].push({type:"breakEnd",optText:g.parseMessage(c[T-2]),signalType:g.LINETYPE.BREAK_END}),this.$=c[T-1];break;case 44:this.$=c[T-3].concat([{type:"option",optionText:g.parseMessage(c[T-1]),signalType:g.LINETYPE.CRITICAL_OPTION},c[T]]);break;case 46:this.$=c[T-3].concat([{type:"and",parText:g.parseMessage(c[T-1]),signalType:g.LINETYPE.PAR_AND},c[T]]);break;case 48:this.$=c[T-3].concat([{type:"else",altText:g.parseMessage(c[T-1]),signalType:g.LINETYPE.ALT_ELSE},c[T]]);break;case 49:c[T-3].draw="participant",c[T-3].type="addParticipant",c[T-3].description=g.parseMessage(c[T-1]),this.$=c[T-3];break;case 50:c[T-1].draw="participant",c[T-1].type="addParticipant",this.$=c[T-1];break;case 51:c[T-3].draw="actor",c[T-3].type="addParticipant",c[T-3].description=g.parseMessage(c[T-1]),this.$=c[T-3];break;case 52:case 57:c[T-1].draw="actor",c[T-1].type="addParticipant",this.$=c[T-1];break;case 53:c[T-1].type="destroyParticipant",this.$=c[T-1];break;case 54:c[T-3].draw="participant",c[T-3].type="addParticipant",c[T-3].description=g.parseMessage(c[T-1]),this.$=c[T-3];break;case 55:c[T-1].draw="participant",c[T-1].type="addParticipant",this.$=c[T-1];break;case 56:c[T-3].draw="actor",c[T-3].type="addParticipant",c[T-3].description=g.parseMessage(c[T-1]),this.$=c[T-3];break;case 58:this.$=[c[T-1],{type:"addNote",placement:c[T-2],actor:c[T-1].actor,text:c[T]}];break;case 59:c[T-2]=[].concat(c[T-1],c[T-1]).slice(0,2),c[T-2][0]=c[T-2][0].actor,c[T-2][1]=c[T-2][1].actor,this.$=[c[T-1],{type:"addNote",placement:g.PLACEMENT.OVER,actor:c[T-2].slice(0,2),text:c[T]}];break;case 60:this.$=[c[T-1],{type:"addLinks",actor:c[T-1].actor,text:c[T]}];break;case 61:this.$=[c[T-1],{type:"addALink",actor:c[T-1].actor,text:c[T]}];break;case 62:this.$=[c[T-1],{type:"addProperties",actor:c[T-1].actor,text:c[T]}];break;case 63:this.$=[c[T-1],{type:"addDetails",actor:c[T-1].actor,text:c[T]}];break;case 66:this.$=[c[T-2],c[T]];break;case 67:this.$=c[T];break;case 68:this.$=g.PLACEMENT.LEFTOF;break;case 69:this.$=g.PLACEMENT.RIGHTOF;break;case 70:this.$=[c[T-4],c[T-1],{type:"addMessage",from:c[T-4].actor,to:c[T-1].actor,signalType:c[T-3],msg:c[T],activate:!0},{type:"activeStart",signalType:g.LINETYPE.ACTIVE_START,actor:c[T-1].actor}];break;case 71:this.$=[c[T-4],c[T-1],{type:"addMessage",from:c[T-4].actor,to:c[T-1].actor,signalType:c[T-3],msg:c[T]},{type:"activeEnd",signalType:g.LINETYPE.ACTIVE_END,actor:c[T-4].actor}];break;case 72:this.$=[c[T-4],c[T-1],{type:"addMessage",from:c[T-4].actor,to:c[T-1].actor,signalType:c[T-3],msg:c[T],activate:!0,centralConnection:g.LINETYPE.CENTRAL_CONNECTION},{type:"centralConnection",signalType:g.LINETYPE.CENTRAL_CONNECTION,actor:c[T-1].actor}];break;case 73:this.$=[c[T-4],c[T-1],{type:"addMessage",from:c[T-4].actor,to:c[T-1].actor,signalType:c[T-2],msg:c[T],activate:!1,centralConnection:g.LINETYPE.CENTRAL_CONNECTION_REVERSE},{type:"centralConnectionReverse",signalType:g.LINETYPE.CENTRAL_CONNECTION_REVERSE,actor:c[T-4].actor}];break;case 74:this.$=[c[T-5],c[T-1],{type:"addMessage",from:c[T-5].actor,to:c[T-1].actor,signalType:c[T-3],msg:c[T],activate:!0,centralConnection:g.LINETYPE.CENTRAL_CONNECTION_DUAL},{type:"centralConnection",signalType:g.LINETYPE.CENTRAL_CONNECTION,actor:c[T-1].actor},{type:"centralConnectionReverse",signalType:g.LINETYPE.CENTRAL_CONNECTION_REVERSE,actor:c[T-5].actor}];break;case 75:this.$=[c[T-3],c[T-1],{type:"addMessage",from:c[T-3].actor,to:c[T-1].actor,signalType:c[T-2],msg:c[T]}];break;case 76:this.$={type:"addParticipant",actor:c[T-1],config:c[T]};break;case 77:this.$=c[T-1].trim();break;case 78:this.$={type:"addParticipant",actor:c[T]};break;case 79:this.$=g.LINETYPE.SOLID_OPEN;break;case 80:this.$=g.LINETYPE.DOTTED_OPEN;break;case 81:this.$=g.LINETYPE.SOLID;break;case 82:this.$=g.LINETYPE.SOLID_TOP;break;case 83:this.$=g.LINETYPE.SOLID_BOTTOM;break;case 84:this.$=g.LINETYPE.STICK_TOP;break;case 85:this.$=g.LINETYPE.STICK_BOTTOM;break;case 86:this.$=g.LINETYPE.SOLID_TOP_DOTTED;break;case 87:this.$=g.LINETYPE.SOLID_BOTTOM_DOTTED;break;case 88:this.$=g.LINETYPE.STICK_TOP_DOTTED;break;case 89:this.$=g.LINETYPE.STICK_BOTTOM_DOTTED;break;case 90:this.$=g.LINETYPE.SOLID_ARROW_TOP_REVERSE;break;case 91:this.$=g.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE;break;case 92:this.$=g.LINETYPE.STICK_ARROW_TOP_REVERSE;break;case 93:this.$=g.LINETYPE.STICK_ARROW_BOTTOM_REVERSE;break;case 94:this.$=g.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED;break;case 95:this.$=g.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED;break;case 96:this.$=g.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED;break;case 97:this.$=g.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED;break;case 98:this.$=g.LINETYPE.BIDIRECTIONAL_SOLID;break;case 99:this.$=g.LINETYPE.DOTTED;break;case 100:this.$=g.LINETYPE.BIDIRECTIONAL_DOTTED;break;case 101:this.$=g.LINETYPE.SOLID_CROSS;break;case 102:this.$=g.LINETYPE.DOTTED_CROSS;break;case 103:this.$=g.LINETYPE.SOLID_POINT;break;case 104:this.$=g.LINETYPE.DOTTED_POINT;break;case 105:this.$=g.parseMessage(c[T].trim().substring(1));break}},"anonymous"),table:[{3:1,4:t,5:a,6:s},{1:[3]},{3:5,4:t,5:a,6:s},{3:6,4:t,5:a,6:s},e([1,4,5,10,14,15,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,51,53,54,56,61,62,63,64,73],i,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:n,5:o,8:8,9:10,10:h,13:13,14:l,15:r,18:16,19:E,22:p,23:41,24:f,25:20,26:21,27:22,28:23,29:24,30:u,31:y,32:I,34:L,36:w,37:P,38:m,39:k,40:v,42:W,44:K,45:H,47:G,51:X,53:z,54:C,56:$,61:J,62:j,63:st,64:rt,73:O},e(R,[2,5]),{9:48,13:13,14:l,15:r,18:16,19:E,22:p,23:41,24:f,25:20,26:21,27:22,28:23,29:24,30:u,31:y,32:I,34:L,36:w,37:P,38:m,39:k,40:v,42:W,44:K,45:H,47:G,51:X,53:z,54:C,56:$,61:J,62:j,63:st,64:rt,73:O},e(R,[2,7]),e(R,[2,8]),e(R,[2,9]),e(R,[2,15]),{13:49,51:X,53:z,54:C},{16:[1,50]},{5:[1,51]},{5:[1,54],20:[1,52],21:[1,53]},{23:55,73:O},{23:56,73:O},{5:[1,57]},{5:[1,58]},{5:[1,59]},{5:[1,60]},{5:[1,61]},e(R,[2,30]),e(R,[2,31]),{33:[1,62]},{35:[1,63]},e(R,[2,34]),{16:[1,64]},{16:[1,65]},{16:[1,66]},{16:[1,67]},{16:[1,68]},{16:[1,69]},{16:[1,70]},{16:[1,71]},{23:72,55:73,73:nt},{23:75,55:76,73:nt},{23:77,73:O},{69:78,72:[1,79],78:ot,79:M,80:te,81:ee,82:se,83:re,84:ae,85:ie,86:ne,87:oe,88:ce,89:le,90:he,91:de,92:Te,93:Ee,94:pe,95:ue,96:_e,97:fe,98:ge,99:xe,100:Ie,101:Re,102:Oe,103:ye},{57:106,59:[1,107],67:[1,108],68:[1,109]},{23:110,73:O},{23:111,73:O},{23:112,73:O},{23:113,73:O},e([5,66,72,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104],Le),e(R,[2,6]),e(R,[2,16]),e(Lt,[2,10],{11:114}),e(R,[2,18]),{5:[1,116],20:[1,115]},{5:[1,117]},e(R,[2,22]),{5:[1,118]},{5:[1,119]},e(R,[2,25]),e(R,[2,26]),e(R,[2,27]),e(R,[2,28]),e(R,[2,29]),e(R,[2,32]),e(R,[2,33]),e(At,i,{7:120}),e(At,i,{7:121}),e(At,i,{7:122}),e(be,i,{41:123,7:124}),e(Wt,i,{43:125,7:126}),e(Wt,i,{7:126,43:127}),e(Se,i,{46:128,7:129}),e(At,i,{7:130}),{5:[1,132],52:[1,131]},{5:[1,134],52:[1,133]},e(Kt,Le,{74:135,75:[1,136]}),{5:[1,138],52:[1,137]},{5:[1,140],52:[1,139]},{5:[1,141]},{23:145,70:[1,142],71:[1,143],72:[1,144],73:O},{69:146,78:ot,79:M,80:te,81:ee,82:se,83:re,84:ae,85:ie,86:ne,87:oe,88:ce,89:le,90:he,91:de,92:Te,93:Ee,94:pe,95:ue,96:_e,97:fe,98:ge,99:xe,100:Ie,101:Re,102:Oe,103:ye},e(B,[2,79]),e(B,[2,80]),e(B,[2,81]),e(B,[2,82]),e(B,[2,83]),e(B,[2,84]),e(B,[2,85]),e(B,[2,86]),e(B,[2,87]),e(B,[2,88]),e(B,[2,89]),e(B,[2,90]),e(B,[2,91]),e(B,[2,92]),e(B,[2,93]),e(B,[2,94]),e(B,[2,95]),e(B,[2,96]),e(B,[2,97]),e(B,[2,98]),e(B,[2,99]),e(B,[2,100]),e(B,[2,101]),e(B,[2,102]),e(B,[2,103]),e(B,[2,104]),{23:147,73:O},{23:149,60:148,73:O},{73:[2,68]},{73:[2,69]},{58:150,104:at},{58:152,104:at},{58:153,104:at},{58:154,104:at},{4:[1,157],5:[1,159],12:156,13:158,17:[1,155],51:X,53:z,54:C},{5:[1,160]},e(R,[2,20]),e(R,[2,21]),e(R,[2,23]),e(R,[2,24]),{4:n,5:o,8:8,9:10,10:h,13:13,14:l,15:r,17:[1,161],18:16,19:E,22:p,23:41,24:f,25:20,26:21,27:22,28:23,29:24,30:u,31:y,32:I,34:L,36:w,37:P,38:m,39:k,40:v,42:W,44:K,45:H,47:G,51:X,53:z,54:C,56:$,61:J,62:j,63:st,64:rt,73:O},{4:n,5:o,8:8,9:10,10:h,13:13,14:l,15:r,17:[1,162],18:16,19:E,22:p,23:41,24:f,25:20,26:21,27:22,28:23,29:24,30:u,31:y,32:I,34:L,36:w,37:P,38:m,39:k,40:v,42:W,44:K,45:H,47:G,51:X,53:z,54:C,56:$,61:J,62:j,63:st,64:rt,73:O},{4:n,5:o,8:8,9:10,10:h,13:13,14:l,15:r,17:[1,163],18:16,19:E,22:p,23:41,24:f,25:20,26:21,27:22,28:23,29:24,30:u,31:y,32:I,34:L,36:w,37:P,38:m,39:k,40:v,42:W,44:K,45:H,47:G,51:X,53:z,54:C,56:$,61:J,62:j,63:st,64:rt,73:O},{17:[1,164]},{4:n,5:o,8:8,9:10,10:h,13:13,14:l,15:r,17:[2,47],18:16,19:E,22:p,23:41,24:f,25:20,26:21,27:22,28:23,29:24,30:u,31:y,32:I,34:L,36:w,37:P,38:m,39:k,40:v,42:W,44:K,45:H,47:G,50:[1,165],51:X,53:z,54:C,56:$,61:J,62:j,63:st,64:rt,73:O},{17:[1,166]},{4:n,5:o,8:8,9:10,10:h,13:13,14:l,15:r,17:[2,45],18:16,19:E,22:p,23:41,24:f,25:20,26:21,27:22,28:23,29:24,30:u,31:y,32:I,34:L,36:w,37:P,38:m,39:k,40:v,42:W,44:K,45:H,47:G,49:[1,167],51:X,53:z,54:C,56:$,61:J,62:j,63:st,64:rt,73:O},{17:[1,168]},{17:[1,169]},{4:n,5:o,8:8,9:10,10:h,13:13,14:l,15:r,17:[2,43],18:16,19:E,22:p,23:41,24:f,25:20,26:21,27:22,28:23,29:24,30:u,31:y,32:I,34:L,36:w,37:P,38:m,39:k,40:v,42:W,44:K,45:H,47:G,48:[1,170],51:X,53:z,54:C,56:$,61:J,62:j,63:st,64:rt,73:O},{4:n,5:o,8:8,9:10,10:h,13:13,14:l,15:r,17:[1,171],18:16,19:E,22:p,23:41,24:f,25:20,26:21,27:22,28:23,29:24,30:u,31:y,32:I,34:L,36:w,37:P,38:m,39:k,40:v,42:W,44:K,45:H,47:G,51:X,53:z,54:C,56:$,61:J,62:j,63:st,64:rt,73:O},{16:[1,172]},e(R,[2,50]),{16:[1,173]},e(R,[2,55]),e(Kt,[2,76]),{76:[1,174]},{16:[1,175]},e(R,[2,52]),{16:[1,176]},e(R,[2,57]),e(R,[2,53]),{23:177,73:O},{23:178,73:O},{23:179,73:O},{58:180,104:at},{23:181,72:[1,182],73:O},{58:183,104:at},{58:184,104:at},{66:[1,185],104:[2,67]},{5:[2,60]},{5:[2,105]},{5:[2,61]},{5:[2,62]},{5:[2,63]},e(R,[2,17]),e(Lt,[2,11]),{13:186,51:X,53:z,54:C},e(Lt,[2,13]),e(Lt,[2,14]),e(R,[2,19]),e(R,[2,35]),e(R,[2,36]),e(R,[2,37]),e(R,[2,38]),{16:[1,187]},e(R,[2,39]),{16:[1,188]},e(R,[2,40]),e(R,[2,41]),{16:[1,189]},e(R,[2,42]),{5:[1,190]},{5:[1,191]},{77:[1,192]},{5:[1,193]},{5:[1,194]},{58:195,104:at},{58:196,104:at},{58:197,104:at},{5:[2,75]},{58:198,104:at},{23:199,73:O},{5:[2,58]},{5:[2,59]},{23:200,73:O},e(Lt,[2,12]),e(be,i,{7:124,41:201}),e(Wt,i,{7:126,43:202}),e(Se,i,{7:129,46:203}),e(R,[2,49]),e(R,[2,54]),e(Kt,[2,77]),e(R,[2,51]),e(R,[2,56]),{5:[2,70]},{5:[2,71]},{5:[2,72]},{5:[2,73]},{58:204,104:at},{104:[2,66]},{17:[2,48]},{17:[2,46]},{17:[2,44]},{5:[2,74]}],defaultActions:{5:[2,1],6:[2,2],108:[2,68],109:[2,69],150:[2,60],151:[2,105],152:[2,61],153:[2,62],154:[2,63],180:[2,75],183:[2,58],184:[2,59],195:[2,70],196:[2,71],197:[2,72],198:[2,73],200:[2,66],201:[2,48],202:[2,46],203:[2,44],204:[2,74]},parseError:_(function(b,A){if(A.recoverable)this.trace(b);else{var N=new Error(b);throw N.hash=A,N}},"parseError"),parse:_(function(b){var A=this,N=[0],g=[],V=[null],c=[],bt=this.table,T="",Pt=0,Ne=0,Je=2,Ae=1,Ze=c.slice.call(arguments,1),F=Object.create(this.lexer),ut={yy:{}};for(var qt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,qt)&&(ut.yy[qt]=this.yy[qt]);F.setInput(b,ut.yy),ut.yy.lexer=F,ut.yy.parser=this,typeof F.yylloc>"u"&&(F.yylloc={});var Ht=F.yylloc;c.push(Ht);var Qe=F.options&&F.options.ranges;typeof ut.yy.parseError=="function"?this.parseError=ut.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function $e(tt){N.length=N.length-2*tt,V.length=V.length-tt,c.length=c.length-tt}_($e,"popStack");function we(){var tt;return tt=g.pop()||F.lex()||Ae,typeof tt!="number"&&(tt instanceof Array&&(g=tt,tt=g.pop()),tt=A.symbols_[tt]||tt),tt}_(we,"lex");for(var Z,_t,it,zt,It={},mt,ht,Pe,Dt;;){if(_t=N[N.length-1],this.defaultActions[_t]?it=this.defaultActions[_t]:((Z===null||typeof Z>"u")&&(Z=we()),it=bt[_t]&&bt[_t][Z]),typeof it>"u"||!it.length||!it[0]){var Ut="";Dt=[];for(mt in bt[_t])this.terminals_[mt]&&mt>Je&&Dt.push("'"+this.terminals_[mt]+"'");F.showPosition?Ut="Parse error on line "+(Pt+1)+`:
|
|
2
|
+
`+F.showPosition()+`
|
|
3
|
+
Expecting `+Dt.join(", ")+", got '"+(this.terminals_[Z]||Z)+"'":Ut="Parse error on line "+(Pt+1)+": Unexpected "+(Z==Ae?"end of input":"'"+(this.terminals_[Z]||Z)+"'"),this.parseError(Ut,{text:F.match,token:this.terminals_[Z]||Z,line:F.yylineno,loc:Ht,expected:Dt})}if(it[0]instanceof Array&&it.length>1)throw new Error("Parse Error: multiple actions possible at state: "+_t+", token: "+Z);switch(it[0]){case 1:N.push(Z),V.push(F.yytext),c.push(F.yylloc),N.push(it[1]),Z=null,Ne=F.yyleng,T=F.yytext,Pt=F.yylineno,Ht=F.yylloc;break;case 2:if(ht=this.productions_[it[1]][1],It.$=V[V.length-ht],It._$={first_line:c[c.length-(ht||1)].first_line,last_line:c[c.length-1].last_line,first_column:c[c.length-(ht||1)].first_column,last_column:c[c.length-1].last_column},Qe&&(It._$.range=[c[c.length-(ht||1)].range[0],c[c.length-1].range[1]]),zt=this.performAction.apply(It,[T,Ne,Pt,ut.yy,it[1],V,c].concat(Ze)),typeof zt<"u")return zt;ht&&(N=N.slice(0,-1*ht*2),V=V.slice(0,-1*ht),c=c.slice(0,-1*ht)),N.push(this.productions_[it[1]][0]),V.push(It.$),c.push(It._$),Pe=bt[N[N.length-2]][N[N.length-1]],N.push(Pe);break;case 3:return!0}}return!0},"parse")},Xe=(function(){var Tt={EOF:1,parseError:_(function(A,N){if(this.yy.parser)this.yy.parser.parseError(A,N);else throw new Error(A)},"parseError"),setInput:_(function(b,A){return this.yy=A||this.yy||{},this._input=b,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:_(function(){var b=this._input[0];this.yytext+=b,this.yyleng++,this.offset++,this.match+=b,this.matched+=b;var A=b.match(/(?:\r\n?|\n).*/g);return A?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),b},"input"),unput:_(function(b){var A=b.length,N=b.split(/(?:\r\n?|\n)/g);this._input=b+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-A),this.offset-=A;var g=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),N.length-1&&(this.yylineno-=N.length-1);var V=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:N?(N.length===g.length?this.yylloc.first_column:0)+g[g.length-N.length].length-N[0].length:this.yylloc.first_column-A},this.options.ranges&&(this.yylloc.range=[V[0],V[0]+this.yyleng-A]),this.yyleng=this.yytext.length,this},"unput"),more:_(function(){return this._more=!0,this},"more"),reject:_(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
|
|
4
|
+
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:_(function(b){this.unput(this.match.slice(b))},"less"),pastInput:_(function(){var b=this.matched.substr(0,this.matched.length-this.match.length);return(b.length>20?"...":"")+b.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:_(function(){var b=this.match;return b.length<20&&(b+=this._input.substr(0,20-b.length)),(b.substr(0,20)+(b.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:_(function(){var b=this.pastInput(),A=new Array(b.length+1).join("-");return b+this.upcomingInput()+`
|
|
5
|
+
`+A+"^"},"showPosition"),test_match:_(function(b,A){var N,g,V;if(this.options.backtrack_lexer&&(V={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(V.yylloc.range=this.yylloc.range.slice(0))),g=b[0].match(/(?:\r\n?|\n).*/g),g&&(this.yylineno+=g.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:g?g[g.length-1].length-g[g.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+b[0].length},this.yytext+=b[0],this.match+=b[0],this.matches=b,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(b[0].length),this.matched+=b[0],N=this.performAction.call(this,this.yy,this,A,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),N)return N;if(this._backtrack){for(var c in V)this[c]=V[c];return!1}return!1},"test_match"),next:_(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var b,A,N,g;this._more||(this.yytext="",this.match="");for(var V=this._currentRules(),c=0;c<V.length;c++)if(N=this._input.match(this.rules[V[c]]),N&&(!A||N[0].length>A[0].length)){if(A=N,g=c,this.options.backtrack_lexer){if(b=this.test_match(N,V[c]),b!==!1)return b;if(this._backtrack){A=!1;continue}else return!1}else if(!this.options.flex)break}return A?(b=this.test_match(A,V[g]),b!==!1?b:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
|
|
6
|
+
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:_(function(){var A=this.next();return A||this.lex()},"lex"),begin:_(function(A){this.conditionStack.push(A)},"begin"),popState:_(function(){var A=this.conditionStack.length-1;return A>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:_(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:_(function(A){return A=this.conditionStack.length-1-Math.abs(A||0),A>=0?this.conditionStack[A]:"INITIAL"},"topState"),pushState:_(function(A){this.begin(A)},"pushState"),stateStackSize:_(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:_(function(A,N,g,V){switch(g){case 0:return 5;case 1:break;case 2:break;case 3:break;case 4:break;case 5:break;case 6:return 20;case 7:return this.begin("CONFIG"),75;case 8:return 76;case 9:return this.popState(),this.begin("ALIAS"),77;case 10:return this.popState(),this.popState(),77;case 11:return N.yytext=N.yytext.trim(),73;case 12:return N.yytext=N.yytext.trim(),this.begin("ALIAS"),73;case 13:return N.yytext=N.yytext.trim(),this.popState(),73;case 14:return this.popState(),10;case 15:return this.begin("LINE"),15;case 16:return this.begin("ID"),51;case 17:return this.begin("ID"),53;case 18:return 14;case 19:return this.begin("ID"),54;case 20:return this.popState(),this.popState(),this.begin("LINE"),52;case 21:return this.popState(),this.popState(),5;case 22:return this.begin("LINE"),37;case 23:return this.begin("LINE"),38;case 24:return this.begin("LINE"),39;case 25:return this.begin("LINE"),40;case 26:return this.begin("LINE"),50;case 27:return this.begin("LINE"),42;case 28:return this.begin("LINE"),44;case 29:return this.begin("LINE"),49;case 30:return this.begin("LINE"),45;case 31:return this.begin("LINE"),48;case 32:return this.begin("LINE"),47;case 33:return this.popState(),16;case 34:return 17;case 35:return 67;case 36:return 68;case 37:return 61;case 38:return 62;case 39:return 63;case 40:return 64;case 41:return 59;case 42:return 56;case 43:return this.begin("ID"),22;case 44:return this.begin("ID"),24;case 45:return 30;case 46:return 31;case 47:return this.begin("acc_title"),32;case 48:return this.popState(),"acc_title_value";case 49:return this.begin("acc_descr"),34;case 50:return this.popState(),"acc_descr_value";case 51:this.begin("acc_descr_multiline");break;case 52:this.popState();break;case 53:return"acc_descr_multiline_value";case 54:return 6;case 55:return 19;case 56:return 21;case 57:return 66;case 58:return 5;case 59:return N.yytext=N.yytext.trim(),73;case 60:return 80;case 61:return 97;case 62:return 98;case 63:return 99;case 64:return 78;case 65:return 79;case 66:return 100;case 67:return 101;case 68:return 102;case 69:return 103;case 70:return 85;case 71:return 86;case 72:return 87;case 73:return 88;case 74:return 93;case 75:return 94;case 76:return 95;case 77:return 96;case 78:return 81;case 79:return 82;case 80:return 83;case 81:return 84;case 82:return 89;case 83:return 90;case 84:return 91;case 85:return 92;case 86:return 104;case 87:return 104;case 88:return 70;case 89:return 71;case 90:return 72;case 91:return 5;case 92:return 10}},"anonymous"),rules:[/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:((?!\n)\s)+)/i,/^(?:#[^\n]*)/i,/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[0-9]+(?=[ \n]+))/i,/^(?:@\{)/i,/^(?:[^\}]+)/i,/^(?:\}(?=\s+as\s))/i,/^(?:\})/i,/^(?:[^\<->\->:\n,;@\s]+(?=@\{))/i,/^(?:[^<>:\n,;@\s]+(?=\s+as\s))/i,/^(?:[^<>:\n,;@]+(?=\s*[\n;#]|$))/i,/^(?:[^<>:\n,;@]*<[^\n]*)/i,/^(?:box\b)/i,/^(?:participant\b)/i,/^(?:actor\b)/i,/^(?:create\b)/i,/^(?:destroy\b)/i,/^(?:as\b)/i,/^(?:(?:))/i,/^(?:loop\b)/i,/^(?:rect\b)/i,/^(?:opt\b)/i,/^(?:alt\b)/i,/^(?:else\b)/i,/^(?:par\b)/i,/^(?:par_over\b)/i,/^(?:and\b)/i,/^(?:critical\b)/i,/^(?:option\b)/i,/^(?:break\b)/i,/^(?:(?:[:]?(?:no)?wrap)?[^#\n;]*)/i,/^(?:end\b)/i,/^(?:left of\b)/i,/^(?:right of\b)/i,/^(?:links\b)/i,/^(?:link\b)/i,/^(?:properties\b)/i,/^(?:details\b)/i,/^(?:over\b)/i,/^(?:note\b)/i,/^(?:activate\b)/i,/^(?:deactivate\b)/i,/^(?:title\s[^#\n;]+)/i,/^(?:title:\s[^#\n;]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:sequenceDiagram\b)/i,/^(?:autonumber\b)/i,/^(?:off\b)/i,/^(?:,)/i,/^(?:;)/i,/^(?:[^\/\\\+\()\+<\->\->:\n,;]+((?!(-x|--x|-\)|--\)|-\|\\|-\\|-\/|-\/\/|-\|\/|\/\|-|\\\|-|\/\/-|\\\\-|\/\|-|--\|\\|--|\(\)))[\-]*[^\+<\->\->:\n,;]+)*)/i,/^(?:->>)/i,/^(?:<<->>)/i,/^(?:-->>)/i,/^(?:<<-->>)/i,/^(?:->)/i,/^(?:-->)/i,/^(?:-[x])/i,/^(?:--[x])/i,/^(?:-[\)])/i,/^(?:--[\)])/i,/^(?:--\|\\)/i,/^(?:--\|\/)/i,/^(?:--\\\\)/i,/^(?:--\/\/)/i,/^(?:\/\|--)/i,/^(?:\\\|--)/i,/^(?:\/\/--)/i,/^(?:\\\\--)/i,/^(?:-\|\\)/i,/^(?:-\|\/)/i,/^(?:-\\\\)/i,/^(?:-\/\/)/i,/^(?:\/\|-)/i,/^(?:\\\|-)/i,/^(?:\/\/-)/i,/^(?:\\\\-)/i,/^(?::(?:(?:no)?wrap)?[^#\n;]*)/i,/^(?::)/i,/^(?:\+)/i,/^(?:-)/i,/^(?:\(\))/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[52,53],inclusive:!1},acc_descr:{rules:[50],inclusive:!1},acc_title:{rules:[48],inclusive:!1},ID:{rules:[2,3,7,11,12,13,14],inclusive:!1},ALIAS:{rules:[2,3,20,21],inclusive:!1},LINE:{rules:[2,3,33],inclusive:!1},CONFIG:{rules:[8,9,10],inclusive:!1},CONFIG_DATA:{rules:[],inclusive:!1},INITIAL:{rules:[0,1,3,4,5,6,15,16,17,18,19,22,23,24,25,26,27,28,29,30,31,32,34,35,36,37,38,39,40,41,42,43,44,45,46,47,49,51,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92],inclusive:!0}}};return Tt})();Ft.lexer=Xe;function wt(){this.yy={}}return _(wt,"Parser"),wt.prototype=Ft,Ft.Parser=wt,new wt})();Xt.parser=Xt;var us=Xt,_s={SOLID:0,DOTTED:1,NOTE:2,SOLID_CROSS:3,DOTTED_CROSS:4,SOLID_OPEN:5,DOTTED_OPEN:6,LOOP_START:10,LOOP_END:11,ALT_START:12,ALT_ELSE:13,ALT_END:14,OPT_START:15,OPT_END:16,ACTIVE_START:17,ACTIVE_END:18,PAR_START:19,PAR_AND:20,PAR_END:21,RECT_START:22,RECT_END:23,SOLID_POINT:24,DOTTED_POINT:25,AUTONUMBER:26,CRITICAL_START:27,CRITICAL_OPTION:28,CRITICAL_END:29,BREAK_START:30,BREAK_END:31,PAR_OVER_START:32,BIDIRECTIONAL_SOLID:33,BIDIRECTIONAL_DOTTED:34,SOLID_TOP:41,SOLID_BOTTOM:42,STICK_TOP:43,STICK_BOTTOM:44,SOLID_ARROW_TOP_REVERSE:45,SOLID_ARROW_BOTTOM_REVERSE:46,STICK_ARROW_TOP_REVERSE:47,STICK_ARROW_BOTTOM_REVERSE:48,SOLID_TOP_DOTTED:51,SOLID_BOTTOM_DOTTED:52,STICK_TOP_DOTTED:53,STICK_BOTTOM_DOTTED:54,SOLID_ARROW_TOP_REVERSE_DOTTED:55,SOLID_ARROW_BOTTOM_REVERSE_DOTTED:56,STICK_ARROW_TOP_REVERSE_DOTTED:57,STICK_ARROW_BOTTOM_REVERSE_DOTTED:58,CENTRAL_CONNECTION:59,CENTRAL_CONNECTION_REVERSE:60,CENTRAL_CONNECTION_DUAL:61},fs={FILLED:0,OPEN:1},gs={LEFTOF:0,RIGHTOF:1,OVER:2},Ct={ACTOR:"actor",CONTROL:"control",DATABASE:"database",ENTITY:"entity"},Ot,xs=(Ot=class{constructor(){this.state=new ps(()=>({prevActor:void 0,actors:new Map,createdActors:new Map,destroyedActors:new Map,boxes:[],messages:[],notes:[],sequenceNumbersEnabled:!1,wrapEnabled:void 0,currentBox:void 0,lastCreated:void 0,lastDestroyed:void 0})),this.setAccTitle=me,this.setAccDescription=ss,this.setDiagramTitle=rs,this.getAccTitle=as,this.getAccDescription=is,this.getDiagramTitle=ns,this.apply=this.apply.bind(this),this.parseBoxData=this.parseBoxData.bind(this),this.parseMessage=this.parseMessage.bind(this),this.clear(),this.setWrap(et().wrap),this.LINETYPE=_s,this.ARROWTYPE=fs,this.PLACEMENT=gs}addBox(t){this.state.records.boxes.push({name:t.text,wrap:t.wrap??this.autoWrap(),fill:t.color,actorKeys:[]}),this.state.records.currentBox=this.state.records.boxes.slice(-1)[0]}addActor(t,a,s,i,n){let o=this.state.records.currentBox,h;if(n!==void 0){let r;n.includes(`
|
|
7
|
+
`)?r=n+`
|
|
8
|
+
`:r=`{
|
|
9
|
+
`+n+`
|
|
10
|
+
}`,h=os(r,{schema:cs})}i=(h==null?void 0:h.type)??i,h!=null&&h.alias&&(!s||s.text===a)&&(s={text:h.alias,wrap:s==null?void 0:s.wrap,type:i});const l=this.state.records.actors.get(t);if(l){if(this.state.records.currentBox&&l.box&&this.state.records.currentBox!==l.box)throw new Error(`A same participant should only be defined in one Box: ${l.name} can't be in '${l.box.name}' and in '${this.state.records.currentBox.name}' at the same time.`);if(o=l.box?l.box:this.state.records.currentBox,l.box=o,l&&a===l.name&&s==null)return}if((s==null?void 0:s.text)==null&&(s={text:a,type:i}),(i==null||s.text==null)&&(s={text:a,type:i}),this.state.records.actors.set(t,{box:o,name:a,description:s.text,wrap:s.wrap??this.autoWrap(),prevActor:this.state.records.prevActor,links:{},properties:{},actorCnt:null,rectData:null,type:i??"participant"}),this.state.records.prevActor){const r=this.state.records.actors.get(this.state.records.prevActor);r&&(r.nextActor=t)}this.state.records.currentBox&&this.state.records.currentBox.actorKeys.push(t),this.state.records.prevActor=t}activationCount(t){let a,s=0;if(!t)return 0;for(a=0;a<this.state.records.messages.length;a++)this.state.records.messages[a].type===this.LINETYPE.ACTIVE_START&&this.state.records.messages[a].from===t&&s++,this.state.records.messages[a].type===this.LINETYPE.ACTIVE_END&&this.state.records.messages[a].from===t&&s--;return s}addMessage(t,a,s,i){this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:t,to:a,message:s.text,wrap:s.wrap??this.autoWrap(),answer:i})}addSignal(t,a,s,i,n=!1,o){if(i===this.LINETYPE.ACTIVE_END&&this.activationCount(t??"")<1){const l=new Error("Trying to inactivate an inactive participant ("+t+")");throw l.hash={text:"->>-",token:"->>-",line:"1",loc:{first_line:1,last_line:1,first_column:1,last_column:1},expected:["'ACTIVE_PARTICIPANT'"]},l}return this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:t,to:a,message:(s==null?void 0:s.text)??"",wrap:(s==null?void 0:s.wrap)??this.autoWrap(),type:i,activate:n,centralConnection:o??0}),!0}hasAtLeastOneBox(){return this.state.records.boxes.length>0}hasAtLeastOneBoxWithTitle(){return this.state.records.boxes.some(t=>t.name)}getMessages(){return this.state.records.messages}getBoxes(){return this.state.records.boxes}getActors(){return this.state.records.actors}getCreatedActors(){return this.state.records.createdActors}getDestroyedActors(){return this.state.records.destroyedActors}getActor(t){return this.state.records.actors.get(t)}getActorKeys(){return[...this.state.records.actors.keys()]}enableSequenceNumbers(){this.state.records.sequenceNumbersEnabled=!0}disableSequenceNumbers(){this.state.records.sequenceNumbersEnabled=!1}showSequenceNumbers(){return this.state.records.sequenceNumbersEnabled}setWrap(t){this.state.records.wrapEnabled=t}extractWrap(t){if(t===void 0)return{};t=t.trim();const a=/^:?wrap:/.exec(t)!==null?!0:/^:?nowrap:/.exec(t)!==null?!1:void 0;return{cleanedText:(a===void 0?t:t.replace(/^:?(?:no)?wrap:/,"")).trim(),wrap:a}}autoWrap(){var t;return this.state.records.wrapEnabled!==void 0?this.state.records.wrapEnabled:((t=et().sequence)==null?void 0:t.wrap)??!1}clear(){this.state.reset(),ls()}parseMessage(t){const a=t.trim(),{wrap:s,cleanedText:i}=this.extractWrap(a),n={text:i,wrap:s};return Q.debug(`parseMessage: ${JSON.stringify(n)}`),n}parseBoxData(t){const a=/^((?:rgba?|hsla?)\s*\(.*\)|\w*)(.*)$/.exec(t);let s=a!=null&&a[1]?a[1].trim():"transparent",i=a!=null&&a[2]?a[2].trim():void 0;if(window!=null&&window.CSS)window.CSS.supports("color",s)||(s="transparent",i=t.trim());else{const h=new Option().style;h.color=s,h.color!==s&&(s="transparent",i=t.trim())}const{wrap:n,cleanedText:o}=this.extractWrap(i);return{text:o?vt(o,et()):void 0,color:s,wrap:n}}addNote(t,a,s){const i={actor:t,placement:a,message:s.text,wrap:s.wrap??this.autoWrap()},n=[].concat(t,t);this.state.records.notes.push(i),this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:n[0],to:n[1],message:s.text,wrap:s.wrap??this.autoWrap(),type:this.LINETYPE.NOTE,placement:a})}addLinks(t,a){const s=this.getActor(t);try{let i=vt(a.text,et());i=i.replace(/=/g,"="),i=i.replace(/&/g,"&");const n=JSON.parse(i);this.insertLinks(s,n)}catch(i){Q.error("error while parsing actor link text",i)}}addALink(t,a){const s=this.getActor(t);try{const i={};let n=vt(a.text,et());const o=n.indexOf("@");n=n.replace(/=/g,"="),n=n.replace(/&/g,"&");const h=n.slice(0,o-1).trim(),l=n.slice(o+1).trim();i[h]=l,this.insertLinks(s,i)}catch(i){Q.error("error while parsing actor link text",i)}}insertLinks(t,a){if(t.links==null)t.links=a;else for(const s in a)t.links[s]=a[s]}addProperties(t,a){const s=this.getActor(t);try{const i=vt(a.text,et()),n=JSON.parse(i);this.insertProperties(s,n)}catch(i){Q.error("error while parsing actor properties text",i)}}insertProperties(t,a){if(t.properties==null)t.properties=a;else for(const s in a)t.properties[s]=a[s]}boxEnd(){this.state.records.currentBox=void 0}addDetails(t,a){const s=this.getActor(t),i=document.getElementById(a.text);try{const n=i.innerHTML,o=JSON.parse(n);o.properties&&this.insertProperties(s,o.properties),o.links&&this.insertLinks(s,o.links)}catch(n){Q.error("error while parsing actor details text",n)}}getActorProperty(t,a){if((t==null?void 0:t.properties)!==void 0)return t.properties[a]}apply(t){if(Array.isArray(t))t.forEach(a=>{this.apply(a)});else switch(t.type){case"sequenceIndex":this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:void 0,to:void 0,message:{start:t.sequenceIndex,step:t.sequenceIndexStep,visible:t.sequenceVisible},wrap:!1,type:t.signalType});break;case"addParticipant":this.addActor(t.actor,t.actor,t.description,t.draw,t.config);break;case"createParticipant":if(this.state.records.actors.has(t.actor))throw new Error("It is not possible to have actors with the same id, even if one is destroyed before the next is created. Use 'AS' aliases to simulate the behavior");this.state.records.lastCreated=t.actor,this.addActor(t.actor,t.actor,t.description,t.draw,t.config),this.state.records.createdActors.set(t.actor,this.state.records.messages.length);break;case"destroyParticipant":this.state.records.lastDestroyed=t.actor,this.state.records.destroyedActors.set(t.actor,this.state.records.messages.length);break;case"activeStart":this.addSignal(t.actor,void 0,void 0,t.signalType);break;case"centralConnection":this.addSignal(t.actor,void 0,void 0,t.signalType);break;case"centralConnectionReverse":this.addSignal(t.actor,void 0,void 0,t.signalType);break;case"activeEnd":this.addSignal(t.actor,void 0,void 0,t.signalType);break;case"addNote":this.addNote(t.actor,t.placement,t.text);break;case"addLinks":this.addLinks(t.actor,t.text);break;case"addALink":this.addALink(t.actor,t.text);break;case"addProperties":this.addProperties(t.actor,t.text);break;case"addDetails":this.addDetails(t.actor,t.text);break;case"addMessage":if(this.state.records.lastCreated){if(t.to!==this.state.records.lastCreated)throw new Error("The created participant "+this.state.records.lastCreated.name+" does not have an associated creating message after its declaration. Please check the sequence diagram.");this.state.records.lastCreated=void 0}else if(this.state.records.lastDestroyed){if(t.to!==this.state.records.lastDestroyed&&t.from!==this.state.records.lastDestroyed)throw new Error("The destroyed participant "+this.state.records.lastDestroyed.name+" does not have an associated destroying message after its declaration. Please check the sequence diagram.");this.state.records.lastDestroyed=void 0}this.addSignal(t.from,t.to,t.msg,t.signalType,t.activate,t.centralConnection);break;case"boxStart":this.addBox(t.boxData);break;case"boxEnd":this.boxEnd();break;case"loopStart":this.addSignal(void 0,void 0,t.loopText,t.signalType);break;case"loopEnd":this.addSignal(void 0,void 0,void 0,t.signalType);break;case"rectStart":this.addSignal(void 0,void 0,t.color,t.signalType);break;case"rectEnd":this.addSignal(void 0,void 0,void 0,t.signalType);break;case"optStart":this.addSignal(void 0,void 0,t.optText,t.signalType);break;case"optEnd":this.addSignal(void 0,void 0,void 0,t.signalType);break;case"altStart":this.addSignal(void 0,void 0,t.altText,t.signalType);break;case"else":this.addSignal(void 0,void 0,t.altText,t.signalType);break;case"altEnd":this.addSignal(void 0,void 0,void 0,t.signalType);break;case"setAccTitle":me(t.text);break;case"parStart":this.addSignal(void 0,void 0,t.parText,t.signalType);break;case"and":this.addSignal(void 0,void 0,t.parText,t.signalType);break;case"parEnd":this.addSignal(void 0,void 0,void 0,t.signalType);break;case"criticalStart":this.addSignal(void 0,void 0,t.criticalText,t.signalType);break;case"option":this.addSignal(void 0,void 0,t.optionText,t.signalType);break;case"criticalEnd":this.addSignal(void 0,void 0,void 0,t.signalType);break;case"breakStart":this.addSignal(void 0,void 0,t.breakText,t.signalType);break;case"breakEnd":this.addSignal(void 0,void 0,void 0,t.signalType);break}}getConfig(){return et().sequence}},_(Ot,"SequenceDB"),Ot),Is=_(e=>`.actor {
|
|
11
|
+
stroke: ${e.actorBorder};
|
|
12
|
+
fill: ${e.actorBkg};
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
text.actor > tspan {
|
|
16
|
+
fill: ${e.actorTextColor};
|
|
17
|
+
stroke: none;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.actor-line {
|
|
21
|
+
stroke: ${e.actorLineColor};
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.innerArc {
|
|
25
|
+
stroke-width: 1.5;
|
|
26
|
+
stroke-dasharray: none;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.messageLine0 {
|
|
30
|
+
stroke-width: 1.5;
|
|
31
|
+
stroke-dasharray: none;
|
|
32
|
+
stroke: ${e.signalColor};
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.messageLine1 {
|
|
36
|
+
stroke-width: 1.5;
|
|
37
|
+
stroke-dasharray: 2, 2;
|
|
38
|
+
stroke: ${e.signalColor};
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
#arrowhead path {
|
|
42
|
+
fill: ${e.signalColor};
|
|
43
|
+
stroke: ${e.signalColor};
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.sequenceNumber {
|
|
47
|
+
fill: ${e.sequenceNumberColor};
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
#sequencenumber {
|
|
51
|
+
fill: ${e.signalColor};
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
#crosshead path {
|
|
55
|
+
fill: ${e.signalColor};
|
|
56
|
+
stroke: ${e.signalColor};
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.messageText {
|
|
60
|
+
fill: ${e.signalTextColor};
|
|
61
|
+
stroke: none;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.labelBox {
|
|
65
|
+
stroke: ${e.labelBoxBorderColor};
|
|
66
|
+
fill: ${e.labelBoxBkgColor};
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.labelText, .labelText > tspan {
|
|
70
|
+
fill: ${e.labelTextColor};
|
|
71
|
+
stroke: none;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.loopText, .loopText > tspan {
|
|
75
|
+
fill: ${e.loopTextColor};
|
|
76
|
+
stroke: none;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.loopLine {
|
|
80
|
+
stroke-width: 2px;
|
|
81
|
+
stroke-dasharray: 2, 2;
|
|
82
|
+
stroke: ${e.labelBoxBorderColor};
|
|
83
|
+
fill: ${e.labelBoxBorderColor};
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.note {
|
|
87
|
+
//stroke: #decc93;
|
|
88
|
+
stroke: ${e.noteBorderColor};
|
|
89
|
+
fill: ${e.noteBkgColor};
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.noteText, .noteText > tspan {
|
|
93
|
+
fill: ${e.noteTextColor};
|
|
94
|
+
stroke: none;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.activation0 {
|
|
98
|
+
fill: ${e.activationBkgColor};
|
|
99
|
+
stroke: ${e.activationBorderColor};
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.activation1 {
|
|
103
|
+
fill: ${e.activationBkgColor};
|
|
104
|
+
stroke: ${e.activationBorderColor};
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.activation2 {
|
|
108
|
+
fill: ${e.activationBkgColor};
|
|
109
|
+
stroke: ${e.activationBorderColor};
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
.actorPopupMenu {
|
|
113
|
+
position: absolute;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.actorPopupMenuPanel {
|
|
117
|
+
position: absolute;
|
|
118
|
+
fill: ${e.actorBkg};
|
|
119
|
+
box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
|
|
120
|
+
filter: drop-shadow(3px 5px 2px rgb(0 0 0 / 0.4));
|
|
121
|
+
}
|
|
122
|
+
.actor-man line {
|
|
123
|
+
stroke: ${e.actorBorder};
|
|
124
|
+
fill: ${e.actorBkg};
|
|
125
|
+
}
|
|
126
|
+
.actor-man circle, line {
|
|
127
|
+
stroke: ${e.actorBorder};
|
|
128
|
+
fill: ${e.actorBkg};
|
|
129
|
+
stroke-width: 2px;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
`,"getStyles"),Rs=Is,ft=36,Et="actor-top",pt="actor-bottom",Bt="actor-box",gt="actor-man",St=_(function(e,t){return Es(e,t)},"drawRect"),Os=_(function(e,t,a,s,i){if(t.links===void 0||t.links===null||Object.keys(t.links).length===0)return{height:0,width:0};const n=t.links,o=t.actorCnt,h=t.rectData;var l="none";i&&(l="block !important");const r=e.append("g");r.attr("id","actor"+o+"_popup"),r.attr("class","actorPopupMenu"),r.attr("display",l);var E="";h.class!==void 0&&(E=" "+h.class);let p=h.width>a?h.width:a;const f=r.append("rect");if(f.attr("class","actorPopupMenuPanel"+E),f.attr("x",h.x),f.attr("y",h.height),f.attr("fill",h.fill),f.attr("stroke",h.stroke),f.attr("width",p),f.attr("height",h.height),f.attr("rx",h.rx),f.attr("ry",h.ry),n!=null){var u=20;for(let L in n){var y=r.append("a"),I=ve.sanitizeUrl(n[L]);y.attr("xlink:href",I),y.attr("target","_blank"),Hs(s)(L,y,h.x+10,h.height+u,p,20,{class:"actor"},s),u+=30}}return f.attr("height",u),{height:h.height+u,width:p}},"drawPopup"),Vt=_(function(e){return"var pu = document.getElementById('"+e+"'); if (pu != null) { pu.style.display = pu.style.display == 'block' ? 'none' : 'block'; }"},"popupMenuToggle"),Mt=_(async function(e,t,a=null){let s=e.append("foreignObject");const i=await Me(t.text,Gt()),o=s.append("xhtml:div").attr("style","width: fit-content;").attr("xmlns","http://www.w3.org/1999/xhtml").html(i).node().getBoundingClientRect();if(s.attr("height",Math.round(o.height)).attr("width",Math.round(o.width)),t.class==="noteText"){const h=e.node().firstChild;h.setAttribute("height",o.height+2*t.textMargin);const l=h.getBBox();s.attr("x",Math.round(l.x+l.width/2-o.width/2)).attr("y",Math.round(l.y+l.height/2-o.height/2))}else if(a){let{startx:h,stopx:l,starty:r}=a;if(h>l){const E=h;h=l,l=E}s.attr("x",Math.round(h+Math.abs(h-l)/2-o.width/2)),t.class==="loopText"?s.attr("y",Math.round(r)):s.attr("y",Math.round(r-o.height))}return[s]},"drawKatex"),yt=_(function(e,t){let a=0,s=0;const i=t.text.split(S.lineBreakRegex),[n,o]=Ce(t.fontSize);let h=[],l=0,r=_(()=>t.y,"yfunc");if(t.valign!==void 0&&t.textMargin!==void 0&&t.textMargin>0)switch(t.valign){case"top":case"start":r=_(()=>Math.round(t.y+t.textMargin),"yfunc");break;case"middle":case"center":r=_(()=>Math.round(t.y+(a+s+t.textMargin)/2),"yfunc");break;case"bottom":case"end":r=_(()=>Math.round(t.y+(a+s+2*t.textMargin)-t.textMargin),"yfunc");break}if(t.anchor!==void 0&&t.textMargin!==void 0&&t.width!==void 0)switch(t.anchor){case"left":case"start":t.x=Math.round(t.x+t.textMargin),t.anchor="start",t.dominantBaseline="middle",t.alignmentBaseline="middle";break;case"middle":case"center":t.x=Math.round(t.x+t.width/2),t.anchor="middle",t.dominantBaseline="middle",t.alignmentBaseline="middle";break;case"right":case"end":t.x=Math.round(t.x+t.width-t.textMargin),t.anchor="end",t.dominantBaseline="middle",t.alignmentBaseline="middle";break}for(let[E,p]of i.entries()){t.textMargin!==void 0&&t.textMargin===0&&n!==void 0&&(l=E*n);const f=e.append("text");f.attr("x",t.x),f.attr("y",r()),t.anchor!==void 0&&f.attr("text-anchor",t.anchor).attr("dominant-baseline",t.dominantBaseline).attr("alignment-baseline",t.alignmentBaseline),t.fontFamily!==void 0&&f.style("font-family",t.fontFamily),o!==void 0&&f.style("font-size",o),t.fontWeight!==void 0&&f.style("font-weight",t.fontWeight),t.fill!==void 0&&f.attr("fill",t.fill),t.class!==void 0&&f.attr("class",t.class),t.dy!==void 0?f.attr("dy",t.dy):l!==0&&f.attr("dy",l);const u=p||hs;if(t.tspan){const y=f.append("tspan");y.attr("x",t.x),t.fill!==void 0&&y.attr("fill",t.fill),y.text(u)}else f.text(u);t.valign!==void 0&&t.textMargin!==void 0&&t.textMargin>0&&(s+=(f._groups||f)[0][0].getBBox().height,a=s),h.push(f)}return h},"drawText"),Be=_(function(e,t){function a(i,n,o,h,l){return i+","+n+" "+(i+o)+","+n+" "+(i+o)+","+(n+h-l)+" "+(i+o-l*1.2)+","+(n+h)+" "+i+","+(n+h)}_(a,"genPoints");const s=e.append("polygon");return s.attr("points",a(t.x,t.y,t.width,t.height,7)),s.attr("class","labelBox"),t.y=t.y+t.height/2,yt(e,t),s},"drawLabel"),D=-1,Ve=_((e,t,a,s)=>{e.select&&a.forEach(i=>{const n=t.get(i),o=e.select("#actor"+n.actorCnt);!s.mirrorActors&&n.stopy?o.attr("y2",n.stopy+n.height/2):s.mirrorActors&&o.attr("y2",n.stopy)})},"fixLifeLineHeights"),ys=_(function(e,t,a,s){var u,y;const i=s?t.stopy:t.starty,n=t.x+t.width/2,o=i+t.height,h=e.append("g").lower();var l=h;s||(D++,Object.keys(t.links||{}).length&&!a.forceMenus&&l.attr("onclick",Vt(`actor${D}_popup`)).attr("cursor","pointer"),l.append("line").attr("id","actor"+D).attr("x1",n).attr("y1",o).attr("x2",n).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",t.name),l=h.append("g"),t.actorCnt=D,t.links!=null&&l.attr("id","root-"+D));const r=lt();var E="actor";(u=t.properties)!=null&&u.class?E=t.properties.class:r.fill="#eaeaea",s?E+=` ${pt}`:E+=` ${Et}`,r.x=t.x,r.y=i,r.width=t.width,r.height=t.height,r.class=E,r.rx=3,r.ry=3,r.name=t.name;const p=St(l,r);if(t.rectData=r,(y=t.properties)!=null&&y.icon){const I=t.properties.icon.trim();I.charAt(0)==="@"?$t(l,r.x+r.width-20,r.y+10,I.substr(1)):jt(l,r.x+r.width-20,r.y+10,I)}dt(a,U(t.description))(t.description,l,r.x,r.y,r.width,r.height,{class:`actor ${Bt}`},a);let f=t.height;if(p.node){const I=p.node().getBBox();t.height=I.height,f=I.height}return f},"drawActorTypeParticipant"),Ls=_(function(e,t,a,s){var I,L;const i=s?t.stopy:t.starty,n=t.x+t.width/2,o=i+t.height,h=e.append("g").lower();var l=h;s||(D++,Object.keys(t.links||{}).length&&!a.forceMenus&&l.attr("onclick",Vt(`actor${D}_popup`)).attr("cursor","pointer"),l.append("line").attr("id","actor"+D).attr("x1",n).attr("y1",o).attr("x2",n).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",t.name),l=h.append("g"),t.actorCnt=D,t.links!=null&&l.attr("id","root-"+D));const r=lt();var E="actor";(I=t.properties)!=null&&I.class?E=t.properties.class:r.fill="#eaeaea",s?E+=` ${pt}`:E+=` ${Et}`,r.x=t.x,r.y=i,r.width=t.width,r.height=t.height,r.class=E,r.name=t.name;const p=6,f={...r,x:r.x+-p,y:r.y+ +p,class:"actor"},u=St(l,r);if(St(l,f),t.rectData=r,(L=t.properties)!=null&&L.icon){const w=t.properties.icon.trim();w.charAt(0)==="@"?$t(l,r.x+r.width-20,r.y+10,w.substr(1)):jt(l,r.x+r.width-20,r.y+10,w)}dt(a,U(t.description))(t.description,l,r.x-p,r.y+p,r.width,r.height,{class:`actor ${Bt}`},a);let y=t.height;if(u.node){const w=u.node().getBBox();t.height=w.height,y=w.height}return y},"drawActorTypeCollections"),bs=_(function(e,t,a,s){var w,P;const i=s?t.stopy:t.starty,n=t.x+t.width/2,o=i+t.height,h=e.append("g").lower();let l=h;s||(D++,Object.keys(t.links||{}).length&&!a.forceMenus&&l.attr("onclick",Vt(`actor${D}_popup`)).attr("cursor","pointer"),l.append("line").attr("id","actor"+D).attr("x1",n).attr("y1",o).attr("x2",n).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",t.name),l=h.append("g"),t.actorCnt=D,t.links!=null&&l.attr("id","root-"+D));const r=lt();let E="actor";(w=t.properties)!=null&&w.class?E=t.properties.class:r.fill="#eaeaea",s?E+=` ${pt}`:E+=` ${Et}`,r.x=t.x,r.y=i,r.width=t.width,r.height=t.height,r.class=E,r.name=t.name;const p=r.height/2,f=p/(2.5+r.height/50),u=l.append("g"),y=l.append("g");if(u.append("path").attr("d",`M ${r.x},${r.y+p}
|
|
133
|
+
a ${f},${p} 0 0 0 0,${r.height}
|
|
134
|
+
h ${r.width-2*f}
|
|
135
|
+
a ${f},${p} 0 0 0 0,-${r.height}
|
|
136
|
+
Z
|
|
137
|
+
`).attr("class",E),y.append("path").attr("d",`M ${r.x},${r.y+p}
|
|
138
|
+
a ${f},${p} 0 0 0 0,${r.height}`).attr("stroke","#666").attr("stroke-width","1px").attr("class",E),u.attr("transform",`translate(${f}, ${-(r.height/2)})`),y.attr("transform",`translate(${r.width-f}, ${-r.height/2})`),t.rectData=r,(P=t.properties)!=null&&P.icon){const m=t.properties.icon.trim(),k=r.x+r.width-20,v=r.y+10;m.charAt(0)==="@"?$t(l,k,v,m.substr(1)):jt(l,k,v,m)}dt(a,U(t.description))(t.description,l,r.x,r.y,r.width,r.height,{class:`actor ${Bt}`},a);let I=t.height;const L=u.select("path:last-child");if(L.node()){const m=L.node().getBBox();t.height=m.height,I=m.height}return I},"drawActorTypeQueue"),Ss=_(function(e,t,a,s){var I;const i=s?t.stopy:t.starty,n=t.x+t.width/2,o=i+75,h=e.append("g").lower();s||(D++,h.append("line").attr("id","actor"+D).attr("x1",n).attr("y1",o).attr("x2",n).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",t.name),t.actorCnt=D);const l=e.append("g");let r=gt;s?r+=` ${pt}`:r+=` ${Et}`,l.attr("class",r),l.attr("name",t.name);const E=lt();E.x=t.x,E.y=i,E.fill="#eaeaea",E.width=t.width,E.height=t.height,E.class="actor";const p=t.x+t.width/2,f=i+32,u=22;l.append("defs").append("marker").attr("id","filled-head-control").attr("refX",11).attr("refY",5.8).attr("markerWidth",20).attr("markerHeight",28).attr("orient","172.5").append("path").attr("d","M 14.4 5.6 L 7.2 10.4 L 8.8 5.6 L 7.2 0.8 Z"),l.append("circle").attr("cx",p).attr("cy",f).attr("r",u).attr("fill","#eaeaf7").attr("stroke","#666").attr("stroke-width",1.2),l.append("line").attr("marker-end","url(#filled-head-control)").attr("transform",`translate(${p}, ${f-u})`);const y=l.node().getBBox();return t.height=y.height+2*(((I=a==null?void 0:a.sequence)==null?void 0:I.labelBoxHeight)??0),dt(a,U(t.description))(t.description,l,E.x,E.y+u+(s?5:12),E.width,E.height,{class:`actor ${gt}`},a),t.height},"drawActorTypeControl"),Ns=_(function(e,t,a,s){var I;const i=s?t.stopy:t.starty,n=t.x+t.width/2,o=i+75,h=e.append("g").lower(),l=e.append("g");let r="actor";s?r+=` ${pt}`:r+=` ${Et}`,l.attr("class",r),l.attr("name",t.name);const E=lt();E.x=t.x,E.y=i,E.fill="#eaeaea",E.width=t.width,E.height=t.height,E.class="actor";const p=t.x+t.width/2,f=i+(s?10:25),u=22;l.append("circle").attr("cx",p).attr("cy",f).attr("r",u).attr("width",t.width).attr("height",t.height),l.append("line").attr("x1",p-u).attr("x2",p+u).attr("y1",f+u).attr("y2",f+u).attr("stroke-width",2);const y=l.node().getBBox();return t.height=y.height+(((I=a==null?void 0:a.sequence)==null?void 0:I.labelBoxHeight)??0),s||(D++,h.append("line").attr("id","actor"+D).attr("x1",n).attr("y1",o).attr("x2",n).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",t.name),t.actorCnt=D),dt(a,U(t.description))(t.description,l,E.x,E.y+(s?15:30),E.width,E.height,{class:`actor ${gt}`},a),s?l.attr("transform",`translate(0, ${u})`):l.attr("transform",`translate(0, ${u/2-5})`),t.height},"drawActorTypeEntity"),As=_(function(e,t,a,s){var P;const i=s?t.stopy:t.starty,n=t.x+t.width/2,o=i+t.height+2*a.boxTextMargin,h=e.append("g").lower();let l=h;s||(D++,Object.keys(t.links||{}).length&&!a.forceMenus&&l.attr("onclick",Vt(`actor${D}_popup`)).attr("cursor","pointer"),l.append("line").attr("id","actor"+D).attr("x1",n).attr("y1",o).attr("x2",n).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",t.name),l=h.append("g"),t.actorCnt=D,t.links!=null&&l.attr("id","root-"+D));const r=lt();let E="actor";(P=t.properties)!=null&&P.class?E=t.properties.class:r.fill="#eaeaea",s?E+=` ${pt}`:E+=` ${Et}`,r.x=t.x,r.y=i,r.width=t.width,r.height=t.height,r.class=E,r.name=t.name,r.x=t.x,r.y=i;const p=r.width/3,f=r.width/3,u=p/2,y=u/(2.5+p/50),I=l.append("g"),L=`
|
|
139
|
+
M ${r.x},${r.y+y}
|
|
140
|
+
a ${u},${y} 0 0 0 ${p},0
|
|
141
|
+
a ${u},${y} 0 0 0 -${p},0
|
|
142
|
+
l 0,${f-2*y}
|
|
143
|
+
a ${u},${y} 0 0 0 ${p},0
|
|
144
|
+
l 0,-${f-2*y}
|
|
145
|
+
`;I.append("path").attr("d",L).attr("fill","#eaeaea").attr("stroke","#000").attr("stroke-width",1).attr("class",E),I.attr("transform",`translate(${p}, ${y})`),t.rectData=r,dt(a,U(t.description))(t.description,l,r.x,r.y+35,r.width,r.height,{class:`actor ${Bt}`},a);const w=I.select("path:last-child");if(w.node()){const m=w.node().getBBox();t.height=m.height+(a.sequence.labelBoxHeight??0)}return t.height},"drawActorTypeDatabase"),ws=_(function(e,t,a,s){const i=s?t.stopy:t.starty,n=t.x+t.width/2,o=i+80,h=22,l=e.append("g").lower();s||(D++,l.append("line").attr("id","actor"+D).attr("x1",n).attr("y1",o).attr("x2",n).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",t.name),t.actorCnt=D);const r=e.append("g");let E=gt;s?E+=` ${pt}`:E+=` ${Et}`,r.attr("class",E),r.attr("name",t.name);const p=lt();p.x=t.x,p.y=i,p.fill="#eaeaea",p.width=t.width,p.height=t.height,p.class="actor",r.append("line").attr("id","actor-man-torso"+D).attr("x1",t.x+t.width/2-h*2.5).attr("y1",i+12).attr("x2",t.x+t.width/2-15).attr("y2",i+12),r.append("line").attr("id","actor-man-arms"+D).attr("x1",t.x+t.width/2-h*2.5).attr("y1",i+2).attr("x2",t.x+t.width/2-h*2.5).attr("y2",i+22),r.append("circle").attr("cx",t.x+t.width/2).attr("cy",i+12).attr("r",h);const f=r.node().getBBox();return t.height=f.height+(a.sequence.labelBoxHeight??0),dt(a,U(t.description))(t.description,r,p.x,p.y+15,p.width,p.height,{class:`actor ${gt}`},a),s?r.attr("transform",`translate(0,${h/2+10})`):r.attr("transform",`translate(0,${h/2+10})`),t.height},"drawActorTypeBoundary"),Ps=_(function(e,t,a,s){const i=s?t.stopy:t.starty,n=t.x+t.width/2,o=i+80,h=e.append("g").lower();s||(D++,h.append("line").attr("id","actor"+D).attr("x1",n).attr("y1",o).attr("x2",n).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",t.name),t.actorCnt=D);const l=e.append("g");let r=gt;s?r+=` ${pt}`:r+=` ${Et}`,l.attr("class",r),l.attr("name",t.name);const E=lt();E.x=t.x,E.y=i,E.fill="#eaeaea",E.width=t.width,E.height=t.height,E.class="actor",E.rx=3,E.ry=3,l.append("line").attr("id","actor-man-torso"+D).attr("x1",n).attr("y1",i+25).attr("x2",n).attr("y2",i+45),l.append("line").attr("id","actor-man-arms"+D).attr("x1",n-ft/2).attr("y1",i+33).attr("x2",n+ft/2).attr("y2",i+33),l.append("line").attr("x1",n-ft/2).attr("y1",i+60).attr("x2",n).attr("y2",i+45),l.append("line").attr("x1",n).attr("y1",i+45).attr("x2",n+ft/2-2).attr("y2",i+60);const p=l.append("circle");p.attr("cx",t.x+t.width/2),p.attr("cy",i+10),p.attr("r",15),p.attr("width",t.width),p.attr("height",t.height);const f=l.node().getBBox();return t.height=f.height,dt(a,U(t.description))(t.description,l,E.x,E.y+35,E.width,E.height,{class:`actor ${gt}`},a),t.height},"drawActorTypeActor"),ms=_(async function(e,t,a,s){switch(t.type){case"actor":return await Ps(e,t,a,s);case"participant":return await ys(e,t,a,s);case"boundary":return await ws(e,t,a,s);case"control":return await Ss(e,t,a,s);case"entity":return await Ns(e,t,a,s);case"database":return await As(e,t,a,s);case"collections":return await Ls(e,t,a,s);case"queue":return await bs(e,t,a,s)}},"drawActor"),Ds=_(function(e,t,a){const i=e.append("g");Ye(i,t),t.name&&dt(a)(t.name,i,t.x,t.y+a.boxTextMargin+(t.textMaxHeight||0)/2,t.width,0,{class:"text"},a),i.lower()},"drawBox"),ks=_(function(e){return e.append("g")},"anchorElement"),vs=_(function(e,t,a,s,i){const n=lt(),o=t.anchored;n.x=t.startx,n.y=t.starty,n.class="activation"+i%3,n.width=t.stopx-t.startx,n.height=a-t.starty,St(o,n)},"drawActivation"),Cs=_(async function(e,t,a,s){const{boxMargin:i,boxTextMargin:n,labelBoxHeight:o,labelBoxWidth:h,messageFontFamily:l,messageFontSize:r,messageFontWeight:E}=s,p=e.append("g"),f=_(function(I,L,w,P){return p.append("line").attr("x1",I).attr("y1",L).attr("x2",w).attr("y2",P).attr("class","loopLine")},"drawLoopLine");f(t.startx,t.starty,t.stopx,t.starty),f(t.stopx,t.starty,t.stopx,t.stopy),f(t.startx,t.stopy,t.stopx,t.stopy),f(t.startx,t.starty,t.startx,t.stopy),t.sections!==void 0&&t.sections.forEach(function(I){f(t.startx,I.y,t.stopx,I.y).style("stroke-dasharray","3, 3")});let u=Qt();u.text=a,u.x=t.startx,u.y=t.starty,u.fontFamily=l,u.fontSize=r,u.fontWeight=E,u.anchor="middle",u.valign="middle",u.tspan=!1,u.width=h||50,u.height=o||20,u.textMargin=n,u.class="labelText",Be(p,u),u=We(),u.text=t.title,u.x=t.startx+h/2+(t.stopx-t.startx)/2,u.y=t.starty+i+n,u.anchor="middle",u.valign="middle",u.textMargin=n,u.class="loopText",u.fontFamily=l,u.fontSize=r,u.fontWeight=E,u.wrap=!0;let y=U(u.text)?await Mt(p,u,t):yt(p,u);if(t.sectionTitles!==void 0){for(const[I,L]of Object.entries(t.sectionTitles))if(L.message){u.text=L.message,u.x=t.startx+(t.stopx-t.startx)/2,u.y=t.sections[I].y+i+n,u.class="loopText",u.anchor="middle",u.valign="middle",u.tspan=!1,u.fontFamily=l,u.fontSize=r,u.fontWeight=E,u.wrap=t.wrap,U(u.text)?(t.starty=t.sections[I].y,await Mt(p,u,t)):yt(p,u);let w=Math.round(y.map(P=>(P._groups||P)[0][0].getBBox().height).reduce((P,m)=>P+m));t.sections[I].height+=w-(i+n)}}return t.height=Math.round(t.stopy-t.starty),p},"drawLoop"),Ye=_(function(e,t){Ts(e,t)},"drawBackgroundRect"),Ms=_(function(e){e.append("defs").append("symbol").attr("id","database").attr("fill-rule","evenodd").attr("clip-rule","evenodd").append("path").attr("transform","scale(.5)").attr("d","M12.258.001l.256.004.255.005.253.008.251.01.249.012.247.015.246.016.242.019.241.02.239.023.236.024.233.027.231.028.229.031.225.032.223.034.22.036.217.038.214.04.211.041.208.043.205.045.201.046.198.048.194.05.191.051.187.053.183.054.18.056.175.057.172.059.168.06.163.061.16.063.155.064.15.066.074.033.073.033.071.034.07.034.069.035.068.035.067.035.066.035.064.036.064.036.062.036.06.036.06.037.058.037.058.037.055.038.055.038.053.038.052.038.051.039.05.039.048.039.047.039.045.04.044.04.043.04.041.04.04.041.039.041.037.041.036.041.034.041.033.042.032.042.03.042.029.042.027.042.026.043.024.043.023.043.021.043.02.043.018.044.017.043.015.044.013.044.012.044.011.045.009.044.007.045.006.045.004.045.002.045.001.045v17l-.001.045-.002.045-.004.045-.006.045-.007.045-.009.044-.011.045-.012.044-.013.044-.015.044-.017.043-.018.044-.02.043-.021.043-.023.043-.024.043-.026.043-.027.042-.029.042-.03.042-.032.042-.033.042-.034.041-.036.041-.037.041-.039.041-.04.041-.041.04-.043.04-.044.04-.045.04-.047.039-.048.039-.05.039-.051.039-.052.038-.053.038-.055.038-.055.038-.058.037-.058.037-.06.037-.06.036-.062.036-.064.036-.064.036-.066.035-.067.035-.068.035-.069.035-.07.034-.071.034-.073.033-.074.033-.15.066-.155.064-.16.063-.163.061-.168.06-.172.059-.175.057-.18.056-.183.054-.187.053-.191.051-.194.05-.198.048-.201.046-.205.045-.208.043-.211.041-.214.04-.217.038-.22.036-.223.034-.225.032-.229.031-.231.028-.233.027-.236.024-.239.023-.241.02-.242.019-.246.016-.247.015-.249.012-.251.01-.253.008-.255.005-.256.004-.258.001-.258-.001-.256-.004-.255-.005-.253-.008-.251-.01-.249-.012-.247-.015-.245-.016-.243-.019-.241-.02-.238-.023-.236-.024-.234-.027-.231-.028-.228-.031-.226-.032-.223-.034-.22-.036-.217-.038-.214-.04-.211-.041-.208-.043-.204-.045-.201-.046-.198-.048-.195-.05-.19-.051-.187-.053-.184-.054-.179-.056-.176-.057-.172-.059-.167-.06-.164-.061-.159-.063-.155-.064-.151-.066-.074-.033-.072-.033-.072-.034-.07-.034-.069-.035-.068-.035-.067-.035-.066-.035-.064-.036-.063-.036-.062-.036-.061-.036-.06-.037-.058-.037-.057-.037-.056-.038-.055-.038-.053-.038-.052-.038-.051-.039-.049-.039-.049-.039-.046-.039-.046-.04-.044-.04-.043-.04-.041-.04-.04-.041-.039-.041-.037-.041-.036-.041-.034-.041-.033-.042-.032-.042-.03-.042-.029-.042-.027-.042-.026-.043-.024-.043-.023-.043-.021-.043-.02-.043-.018-.044-.017-.043-.015-.044-.013-.044-.012-.044-.011-.045-.009-.044-.007-.045-.006-.045-.004-.045-.002-.045-.001-.045v-17l.001-.045.002-.045.004-.045.006-.045.007-.045.009-.044.011-.045.012-.044.013-.044.015-.044.017-.043.018-.044.02-.043.021-.043.023-.043.024-.043.026-.043.027-.042.029-.042.03-.042.032-.042.033-.042.034-.041.036-.041.037-.041.039-.041.04-.041.041-.04.043-.04.044-.04.046-.04.046-.039.049-.039.049-.039.051-.039.052-.038.053-.038.055-.038.056-.038.057-.037.058-.037.06-.037.061-.036.062-.036.063-.036.064-.036.066-.035.067-.035.068-.035.069-.035.07-.034.072-.034.072-.033.074-.033.151-.066.155-.064.159-.063.164-.061.167-.06.172-.059.176-.057.179-.056.184-.054.187-.053.19-.051.195-.05.198-.048.201-.046.204-.045.208-.043.211-.041.214-.04.217-.038.22-.036.223-.034.226-.032.228-.031.231-.028.234-.027.236-.024.238-.023.241-.02.243-.019.245-.016.247-.015.249-.012.251-.01.253-.008.255-.005.256-.004.258-.001.258.001zm-9.258 20.499v.01l.001.021.003.021.004.022.005.021.006.022.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.023.018.024.019.024.021.024.022.025.023.024.024.025.052.049.056.05.061.051.066.051.07.051.075.051.079.052.084.052.088.052.092.052.097.052.102.051.105.052.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.048.144.049.147.047.152.047.155.047.16.045.163.045.167.043.171.043.176.041.178.041.183.039.187.039.19.037.194.035.197.035.202.033.204.031.209.03.212.029.216.027.219.025.222.024.226.021.23.02.233.018.236.016.24.015.243.012.246.01.249.008.253.005.256.004.259.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.021.224-.024.22-.026.216-.027.212-.028.21-.031.205-.031.202-.034.198-.034.194-.036.191-.037.187-.039.183-.04.179-.04.175-.042.172-.043.168-.044.163-.045.16-.046.155-.046.152-.047.148-.048.143-.049.139-.049.136-.05.131-.05.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.053.083-.051.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.05.023-.024.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.023.01-.022.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.127l-.077.055-.08.053-.083.054-.085.053-.087.052-.09.052-.093.051-.095.05-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.045-.118.044-.12.043-.122.042-.124.042-.126.041-.128.04-.13.04-.132.038-.134.038-.135.037-.138.037-.139.035-.142.035-.143.034-.144.033-.147.032-.148.031-.15.03-.151.03-.153.029-.154.027-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.01-.179.008-.179.008-.181.006-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.006-.179-.008-.179-.008-.178-.01-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.027-.153-.029-.151-.03-.15-.03-.148-.031-.146-.032-.145-.033-.143-.034-.141-.035-.14-.035-.137-.037-.136-.037-.134-.038-.132-.038-.13-.04-.128-.04-.126-.041-.124-.042-.122-.042-.12-.044-.117-.043-.116-.045-.113-.045-.112-.046-.109-.047-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.05-.093-.052-.09-.051-.087-.052-.085-.053-.083-.054-.08-.054-.077-.054v4.127zm0-5.654v.011l.001.021.003.021.004.021.005.022.006.022.007.022.009.022.01.022.011.023.012.023.013.023.015.024.016.023.017.024.018.024.019.024.021.024.022.024.023.025.024.024.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.052.11.051.114.051.119.052.123.05.127.051.131.05.135.049.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.044.171.042.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.022.23.02.233.018.236.016.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.012.241-.015.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.048.139-.05.136-.049.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.051.051-.049.023-.025.023-.024.021-.025.02-.024.019-.024.018-.024.017-.024.015-.023.014-.023.013-.024.012-.022.01-.023.01-.023.008-.022.006-.022.006-.022.004-.021.004-.022.001-.021.001-.021v-4.139l-.077.054-.08.054-.083.054-.085.052-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.044-.118.044-.12.044-.122.042-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.035-.143.033-.144.033-.147.033-.148.031-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.009-.179.009-.179.007-.181.007-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.007-.179-.007-.179-.009-.178-.009-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.031-.146-.033-.145-.033-.143-.033-.141-.035-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.04-.126-.041-.124-.042-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.051-.093-.051-.09-.051-.087-.053-.085-.052-.083-.054-.08-.054-.077-.054v4.139zm0-5.666v.011l.001.02.003.022.004.021.005.022.006.021.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.024.018.023.019.024.021.025.022.024.023.024.024.025.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.051.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.043.171.043.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.021.23.02.233.018.236.017.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.013.241-.014.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.049.139-.049.136-.049.131-.051.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.049.023-.025.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.022.01-.023.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.153l-.077.054-.08.054-.083.053-.085.053-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.048-.105.048-.106.048-.109.046-.111.046-.114.046-.115.044-.118.044-.12.043-.122.043-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.034-.143.034-.144.033-.147.032-.148.032-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.024-.161.024-.162.023-.163.023-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.01-.178.01-.179.009-.179.007-.181.006-.182.006-.182.004-.184.003-.184.001-.185.001-.185-.001-.184-.001-.184-.003-.182-.004-.182-.006-.181-.006-.179-.007-.179-.009-.178-.01-.176-.01-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.023-.162-.023-.161-.024-.159-.024-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.032-.146-.032-.145-.033-.143-.034-.141-.034-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.041-.126-.041-.124-.041-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.048-.105-.048-.102-.048-.1-.05-.097-.049-.095-.051-.093-.051-.09-.052-.087-.052-.085-.053-.083-.053-.08-.054-.077-.054v4.153zm8.74-8.179l-.257.004-.254.005-.25.008-.247.011-.244.012-.241.014-.237.016-.233.018-.231.021-.226.022-.224.023-.22.026-.216.027-.212.028-.21.031-.205.032-.202.033-.198.034-.194.036-.191.038-.187.038-.183.04-.179.041-.175.042-.172.043-.168.043-.163.045-.16.046-.155.046-.152.048-.148.048-.143.048-.139.049-.136.05-.131.05-.126.051-.123.051-.118.051-.114.052-.11.052-.106.052-.101.052-.096.052-.092.052-.088.052-.083.052-.079.052-.074.051-.07.052-.065.051-.06.05-.056.05-.051.05-.023.025-.023.024-.021.024-.02.025-.019.024-.018.024-.017.023-.015.024-.014.023-.013.023-.012.023-.01.023-.01.022-.008.022-.006.023-.006.021-.004.022-.004.021-.001.021-.001.021.001.021.001.021.004.021.004.022.006.021.006.023.008.022.01.022.01.023.012.023.013.023.014.023.015.024.017.023.018.024.019.024.02.025.021.024.023.024.023.025.051.05.056.05.06.05.065.051.07.052.074.051.079.052.083.052.088.052.092.052.096.052.101.052.106.052.11.052.114.052.118.051.123.051.126.051.131.05.136.05.139.049.143.048.148.048.152.048.155.046.16.046.163.045.168.043.172.043.175.042.179.041.183.04.187.038.191.038.194.036.198.034.202.033.205.032.21.031.212.028.216.027.22.026.224.023.226.022.231.021.233.018.237.016.241.014.244.012.247.011.25.008.254.005.257.004.26.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.022.224-.023.22-.026.216-.027.212-.028.21-.031.205-.032.202-.033.198-.034.194-.036.191-.038.187-.038.183-.04.179-.041.175-.042.172-.043.168-.043.163-.045.16-.046.155-.046.152-.048.148-.048.143-.048.139-.049.136-.05.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.05.051-.05.023-.025.023-.024.021-.024.02-.025.019-.024.018-.024.017-.023.015-.024.014-.023.013-.023.012-.023.01-.023.01-.022.008-.022.006-.023.006-.021.004-.022.004-.021.001-.021.001-.021-.001-.021-.001-.021-.004-.021-.004-.022-.006-.021-.006-.023-.008-.022-.01-.022-.01-.023-.012-.023-.013-.023-.014-.023-.015-.024-.017-.023-.018-.024-.019-.024-.02-.025-.021-.024-.023-.024-.023-.025-.051-.05-.056-.05-.06-.05-.065-.051-.07-.052-.074-.051-.079-.052-.083-.052-.088-.052-.092-.052-.096-.052-.101-.052-.106-.052-.11-.052-.114-.052-.118-.051-.123-.051-.126-.051-.131-.05-.136-.05-.139-.049-.143-.048-.148-.048-.152-.048-.155-.046-.16-.046-.163-.045-.168-.043-.172-.043-.175-.042-.179-.041-.183-.04-.187-.038-.191-.038-.194-.036-.198-.034-.202-.033-.205-.032-.21-.031-.212-.028-.216-.027-.22-.026-.224-.023-.226-.022-.231-.021-.233-.018-.237-.016-.241-.014-.244-.012-.247-.011-.25-.008-.254-.005-.257-.004-.26-.001-.26.001z")},"insertDatabaseIcon"),Bs=_(function(e){e.append("defs").append("symbol").attr("id","computer").attr("width","24").attr("height","24").append("path").attr("transform","scale(.5)").attr("d","M2 2v13h20v-13h-20zm18 11h-16v-9h16v9zm-10.228 6l.466-1h3.524l.467 1h-4.457zm14.228 3h-24l2-6h2.104l-1.33 4h18.45l-1.297-4h2.073l2 6zm-5-10h-14v-7h14v7z")},"insertComputerIcon"),Vs=_(function(e){e.append("defs").append("symbol").attr("id","clock").attr("width","24").attr("height","24").append("path").attr("transform","scale(.5)").attr("d","M12 2c5.514 0 10 4.486 10 10s-4.486 10-10 10-10-4.486-10-10 4.486-10 10-10zm0-2c-6.627 0-12 5.373-12 12s5.373 12 12 12 12-5.373 12-12-5.373-12-12-12zm5.848 12.459c.202.038.202.333.001.372-1.907.361-6.045 1.111-6.547 1.111-.719 0-1.301-.582-1.301-1.301 0-.512.77-5.447 1.125-7.445.034-.192.312-.181.343.014l.985 6.238 5.394 1.011z")},"insertClockIcon"),Ys=_(function(e){e.append("defs").append("marker").attr("id","arrowhead").attr("refX",7.9).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto-start-reverse").append("path").attr("d","M -1 0 L 10 5 L 0 10 z")},"insertArrowHead"),Ws=_(function(e){e.append("defs").append("marker").attr("id","filled-head").attr("refX",15.5).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},"insertArrowFilledHead"),Ks=_(function(e){e.append("defs").append("marker").attr("id","sequencenumber").attr("refX",15).attr("refY",15).attr("markerWidth",60).attr("markerHeight",40).attr("orient","auto").append("circle").attr("cx",15).attr("cy",15).attr("r",6)},"insertSequenceNumber"),Fs=_(function(e){e.append("defs").append("marker").attr("id","crosshead").attr("markerWidth",15).attr("markerHeight",8).attr("orient","auto").attr("refX",4).attr("refY",4.5).append("path").attr("fill","none").attr("stroke","#000000").style("stroke-dasharray","0, 0").attr("stroke-width","1pt").attr("d","M 1,2 L 6,7 M 6,2 L 1,7")},"insertArrowCrossHead"),We=_(function(){return{x:0,y:0,fill:void 0,anchor:void 0,style:"#666",width:void 0,height:void 0,textMargin:0,rx:0,ry:0,tspan:!0,valign:void 0}},"getTextObj"),qs=_(function(){return{x:0,y:0,fill:"#EDF2AE",stroke:"#666",width:100,anchor:"start",height:100,rx:0,ry:0}},"getNoteRect"),dt=(function(){function e(n,o,h,l,r,E,p){const f=o.append("text").attr("x",h+r/2).attr("y",l+E/2+5).style("text-anchor","middle").text(n);i(f,p)}_(e,"byText");function t(n,o,h,l,r,E,p,f){const{actorFontSize:u,actorFontFamily:y,actorFontWeight:I}=f,[L,w]=Ce(u),P=n.split(S.lineBreakRegex);for(let m=0;m<P.length;m++){const k=m*L-L*(P.length-1)/2,v=o.append("text").attr("x",h+r/2).attr("y",l).style("text-anchor","middle").style("font-size",w).style("font-weight",I).style("font-family",y);v.append("tspan").attr("x",h+r/2).attr("dy",k).text(P[m]),v.attr("y",l+E/2).attr("dominant-baseline","central").attr("alignment-baseline","central"),i(v,p)}}_(t,"byTspan");function a(n,o,h,l,r,E,p,f){const u=o.append("switch"),I=u.append("foreignObject").attr("x",h).attr("y",l).attr("width",r).attr("height",E).append("xhtml:div").style("display","table").style("height","100%").style("width","100%");I.append("div").style("display","table-cell").style("text-align","center").style("vertical-align","middle").text(n),t(n,u,h,l,r,E,p,f),i(I,p)}_(a,"byFo");async function s(n,o,h,l,r,E,p,f){const u=await Nt(n,Gt()),y=o.append("switch"),L=y.append("foreignObject").attr("x",h+r/2-u.width/2).attr("y",l+E/2-u.height/2).attr("width",u.width).attr("height",u.height).append("xhtml:div").style("height","100%").style("width","100%");L.append("div").style("text-align","center").style("vertical-align","middle").html(await Me(n,Gt())),t(n,y,h,l,r,E,p,f),i(L,p)}_(s,"byKatex");function i(n,o){for(const h in o)o.hasOwnProperty(h)&&n.attr(h,o[h])}return _(i,"_setTextAttrs"),function(n,o=!1){return o?s:n.textPlacement==="fo"?a:n.textPlacement==="old"?e:t}})(),Hs=(function(){function e(i,n,o,h,l,r,E){const p=n.append("text").attr("x",o).attr("y",h).style("text-anchor","start").text(i);s(p,E)}_(e,"byText");function t(i,n,o,h,l,r,E,p){const{actorFontSize:f,actorFontFamily:u,actorFontWeight:y}=p,I=i.split(S.lineBreakRegex);for(let L=0;L<I.length;L++){const w=L*f-f*(I.length-1)/2,P=n.append("text").attr("x",o).attr("y",h).style("text-anchor","start").style("font-size",f).style("font-weight",y).style("font-family",u);P.append("tspan").attr("x",o).attr("dy",w).text(I[L]),P.attr("y",h+r/2).attr("dominant-baseline","central").attr("alignment-baseline","central"),s(P,E)}}_(t,"byTspan");function a(i,n,o,h,l,r,E,p){const f=n.append("switch"),y=f.append("foreignObject").attr("x",o).attr("y",h).attr("width",l).attr("height",r).append("xhtml:div").style("display","table").style("height","100%").style("width","100%");y.append("div").style("display","table-cell").style("text-align","center").style("vertical-align","middle").text(i),t(i,f,o,h,l,r,E,p),s(y,E)}_(a,"byFo");function s(i,n){for(const o in n)n.hasOwnProperty(o)&&i.attr(o,n[o])}return _(s,"_setTextAttrs"),function(i){return i.textPlacement==="fo"?a:i.textPlacement==="old"?e:t}})(),zs=_(function(e){e.append("defs").append("marker").attr("id","solidTopArrowHead").attr("refX",7.9).attr("refY",7.25).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto-start-reverse").append("path").attr("d","M 0 0 L 10 8 L 0 8 z")},"insertSolidTopArrowHead"),Us=_(function(e){e.append("defs").append("marker").attr("id","solidBottomArrowHead").attr("refX",7.9).attr("refY",.75).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto-start-reverse").append("path").attr("d","M 0 0 L 10 0 L 0 8 z")},"insertSolidBottomArrowHead"),Gs=_(function(e){e.append("defs").append("marker").attr("id","stickTopArrowHead").attr("refX",7.5).attr("refY",7).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto-start-reverse").append("path").attr("d","M 0 0 L 7 7").attr("stroke","black").attr("stroke-width",1.5).attr("fill","none")},"insertStickTopArrowHead"),Xs=_(function(e){e.append("defs").append("marker").attr("id","stickBottomArrowHead").attr("refX",7.5).attr("refY",0).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto-start-reverse").append("path").attr("d","M 0 7 L 7 0").attr("stroke","black").attr("stroke-width",1.5).attr("fill","none")},"insertStickBottomArrowHead"),Y={drawRect:St,drawText:yt,drawLabel:Be,drawActor:ms,drawBox:Ds,drawPopup:Os,anchorElement:ks,drawActivation:vs,drawLoop:Cs,drawBackgroundRect:Ye,insertArrowHead:Ys,insertArrowFilledHead:Ws,insertSequenceNumber:Ks,insertArrowCrossHead:Fs,insertDatabaseIcon:Ms,insertComputerIcon:Bs,insertClockIcon:Vs,getTextObj:We,getNoteRect:qs,fixLifeLineHeights:Ve,sanitizeUrl:ve.sanitizeUrl,insertSolidTopArrowHead:zs,insertSolidBottomArrowHead:Us,insertStickTopArrowHead:Gs,insertStickBottomArrowHead:Xs},d={},x={data:{startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},verticalPos:0,sequenceItems:[],activations:[],models:{getHeight:_(function(){return Math.max.apply(null,this.actors.length===0?[0]:this.actors.map(e=>e.height||0))+(this.loops.length===0?0:this.loops.map(e=>e.height||0).reduce((e,t)=>e+t))+(this.messages.length===0?0:this.messages.map(e=>e.height||0).reduce((e,t)=>e+t))+(this.notes.length===0?0:this.notes.map(e=>e.height||0).reduce((e,t)=>e+t))},"getHeight"),clear:_(function(){this.actors=[],this.boxes=[],this.loops=[],this.messages=[],this.notes=[]},"clear"),addBox:_(function(e){this.boxes.push(e)},"addBox"),addActor:_(function(e){this.actors.push(e)},"addActor"),addLoop:_(function(e){this.loops.push(e)},"addLoop"),addMessage:_(function(e){this.messages.push(e)},"addMessage"),addNote:_(function(e){this.notes.push(e)},"addNote"),lastActor:_(function(){return this.actors[this.actors.length-1]},"lastActor"),lastLoop:_(function(){return this.loops[this.loops.length-1]},"lastLoop"),lastMessage:_(function(){return this.messages[this.messages.length-1]},"lastMessage"),lastNote:_(function(){return this.notes[this.notes.length-1]},"lastNote"),actors:[],boxes:[],loops:[],messages:[],notes:[]},init:_(function(){this.sequenceItems=[],this.activations=[],this.models.clear(),this.data={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},this.verticalPos=0,qe(et())},"init"),updateVal:_(function(e,t,a,s){e[t]===void 0?e[t]=a:e[t]=s(a,e[t])},"updateVal"),updateBounds:_(function(e,t,a,s){const i=this;let n=0;function o(h){return _(function(r){n++;const E=i.sequenceItems.length-n+1;i.updateVal(r,"starty",t-E*d.boxMargin,Math.min),i.updateVal(r,"stopy",s+E*d.boxMargin,Math.max),i.updateVal(x.data,"startx",e-E*d.boxMargin,Math.min),i.updateVal(x.data,"stopx",a+E*d.boxMargin,Math.max),h!=="activation"&&(i.updateVal(r,"startx",e-E*d.boxMargin,Math.min),i.updateVal(r,"stopx",a+E*d.boxMargin,Math.max),i.updateVal(x.data,"starty",t-E*d.boxMargin,Math.min),i.updateVal(x.data,"stopy",s+E*d.boxMargin,Math.max))},"updateItemBounds")}_(o,"updateFn"),this.sequenceItems.forEach(o()),this.activations.forEach(o("activation"))},"updateBounds"),insert:_(function(e,t,a,s){const i=S.getMin(e,a),n=S.getMax(e,a),o=S.getMin(t,s),h=S.getMax(t,s);this.updateVal(x.data,"startx",i,Math.min),this.updateVal(x.data,"starty",o,Math.min),this.updateVal(x.data,"stopx",n,Math.max),this.updateVal(x.data,"stopy",h,Math.max),this.updateBounds(i,o,n,h)},"insert"),newActivation:_(function(e,t,a){const s=a.get(e.from),i=Yt(e.from).length||0,n=s.x+s.width/2+(i-1)*d.activationWidth/2;this.activations.push({startx:n,starty:this.verticalPos+2,stopx:n+d.activationWidth,stopy:void 0,actor:e.from,anchored:Y.anchorElement(t)})},"newActivation"),endActivation:_(function(e){const t=this.activations.map(function(a){return a.actor}).lastIndexOf(e.from);return this.activations.splice(t,1)[0]},"endActivation"),createLoop:_(function(e={message:void 0,wrap:!1,width:void 0},t){return{startx:void 0,starty:this.verticalPos,stopx:void 0,stopy:void 0,title:e.message,wrap:e.wrap,width:e.width,height:0,fill:t}},"createLoop"),newLoop:_(function(e={message:void 0,wrap:!1,width:void 0},t){this.sequenceItems.push(this.createLoop(e,t))},"newLoop"),endLoop:_(function(){return this.sequenceItems.pop()},"endLoop"),isLoopOverlap:_(function(){return this.sequenceItems.length?this.sequenceItems[this.sequenceItems.length-1].overlap:!1},"isLoopOverlap"),addSectionToLoop:_(function(e){const t=this.sequenceItems.pop();t.sections=t.sections||[],t.sectionTitles=t.sectionTitles||[],t.sections.push({y:x.getVerticalPos(),height:0}),t.sectionTitles.push(e),this.sequenceItems.push(t)},"addSectionToLoop"),saveVerticalPos:_(function(){this.isLoopOverlap()&&(this.savedVerticalPos=this.verticalPos)},"saveVerticalPos"),resetVerticalPos:_(function(){this.isLoopOverlap()&&(this.verticalPos=this.savedVerticalPos)},"resetVerticalPos"),bumpVerticalPos:_(function(e){this.verticalPos=this.verticalPos+e,this.data.stopy=S.getMax(this.data.stopy,this.verticalPos)},"bumpVerticalPos"),getVerticalPos:_(function(){return this.verticalPos},"getVerticalPos"),getBounds:_(function(){return{bounds:this.data,models:this.models}},"getBounds")},Js=_(async function(e,t){x.bumpVerticalPos(d.boxMargin),t.height=d.boxMargin,t.starty=x.getVerticalPos();const a=lt();a.x=t.startx,a.y=t.starty,a.width=t.width||d.width,a.class="note";const s=e.append("g"),i=Y.drawRect(s,a),n=Qt();n.x=t.startx,n.y=t.starty,n.width=a.width,n.dy="1em",n.text=t.message,n.class="noteText",n.fontFamily=d.noteFontFamily,n.fontSize=d.noteFontSize,n.fontWeight=d.noteFontWeight,n.anchor=d.noteAlign,n.textMargin=d.noteMargin,n.valign="center";const o=U(n.text)?await Mt(s,n):yt(s,n),h=Math.round(o.map(l=>(l._groups||l)[0][0].getBBox().height).reduce((l,r)=>l+r));i.attr("height",h+2*d.noteMargin),t.height+=h+2*d.noteMargin,x.bumpVerticalPos(h+2*d.noteMargin),t.stopy=t.starty+h+2*d.noteMargin,t.stopx=t.startx+a.width,x.insert(t.startx,t.starty,t.stopx,t.stopy),x.models.addNote(t)},"drawNote"),Zs=_(function(e,t,a,s,i,n,o){const h=s.db.getActors(),l=h.get(t.from),r=h.get(t.to),E=a.sequenceVisible;let p=l.x+l.width/2,f=r.x+r.width/2;const u=p<=f,y=Ge(t,s),I=e.append("g"),L=16.5,w=_((W,K)=>{const H=W?L:-L;return K?-H:H},"getCircleOffset"),P=_(W=>{I.append("circle").attr("cx",W).attr("cy",o).attr("r",5).attr("width",10).attr("height",10)},"drawCircle"),{CENTRAL_CONNECTION:m,CENTRAL_CONNECTION_REVERSE:k,CENTRAL_CONNECTION_DUAL:v}=s.db.LINETYPE;if(E)switch(t.centralConnection){case m:y&&(f+=w(u,!0));break;case k:y||(p+=w(u,!1));break;case v:y?f+=w(u,!0):p+=w(u,!1);break}switch(t.centralConnection){case m:P(f);break;case k:P(p);break;case v:P(p),P(f);break}},"drawCentralConnection"),xt=_(e=>({fontFamily:e.messageFontFamily,fontSize:e.messageFontSize,fontWeight:e.messageFontWeight}),"messageFont"),Rt=_(e=>({fontFamily:e.noteFontFamily,fontSize:e.noteFontSize,fontWeight:e.noteFontWeight}),"noteFont"),Jt=_(e=>({fontFamily:e.actorFontFamily,fontSize:e.actorFontSize,fontWeight:e.actorFontWeight}),"actorFont");async function Ke(e,t){x.bumpVerticalPos(10);const{startx:a,stopx:s,message:i}=t,n=S.splitBreaks(i).length,o=U(i),h=o?await Nt(i,et()):q.calculateTextDimensions(i,xt(d));if(!o){const p=h.height/n;t.height+=p,x.bumpVerticalPos(p)}let l,r=h.height-10;const E=h.width;if(a===s){l=x.getVerticalPos()+r,d.rightAngles||(r+=d.boxMargin,l=x.getVerticalPos()+r),r+=30;const p=S.getMax(E/2,d.width/2);x.insert(a-p,x.getVerticalPos()-10+r,s+p,x.getVerticalPos()+30+r)}else r+=d.boxMargin,l=x.getVerticalPos()+r,x.insert(a,l-10,s,l);return x.bumpVerticalPos(r),t.height+=r,t.stopy=t.starty+t.height,x.insert(t.fromBounds,t.starty,t.toBounds,t.stopy),l}_(Ke,"boundMessage");var Qs=_(async function(e,t,a,s,i){const{startx:n,stopx:o,starty:h,message:l,type:r,sequenceIndex:E,sequenceVisible:p}=t,f=q.calculateTextDimensions(l,xt(d)),u=Qt();u.x=n,u.y=h+10,u.width=o-n,u.class="messageText",u.dy="1em",u.text=l,u.fontFamily=d.messageFontFamily,u.fontSize=d.messageFontSize,u.fontWeight=d.messageFontWeight,u.anchor=d.messageAlign,u.valign="center",u.textMargin=d.wrapPadding,u.tspan=!1,U(u.text)?await Mt(e,u,{startx:n,stopx:o,starty:a}):yt(e,u);const y=f.width;let I;if(n===o){const w=p||d.showSequenceNumbers,P=Ge(i,s),m=ar(i,s),k=n+(w&&(P||m)?10:0);d.rightAngles?I=e.append("path").attr("d",`M ${k},${a} H ${n+S.getMax(d.width/2,y/2)} V ${a+25} H ${n}`):I=e.append("path").attr("d","M "+k+","+a+" C "+(k+60)+","+(a-10)+" "+(n+60)+","+(a+30)+" "+n+","+(a+20))}else I=e.append("line"),I.attr("x1",n),I.attr("y1",a),I.attr("x2",o),I.attr("y2",a),ke(i,s)&&Zs(e,i,t,s,n,o,a);r===s.db.LINETYPE.DOTTED||r===s.db.LINETYPE.DOTTED_CROSS||r===s.db.LINETYPE.DOTTED_POINT||r===s.db.LINETYPE.DOTTED_OPEN||r===s.db.LINETYPE.BIDIRECTIONAL_DOTTED||r===s.db.LINETYPE.SOLID_TOP_DOTTED||r===s.db.LINETYPE.SOLID_BOTTOM_DOTTED||r===s.db.LINETYPE.STICK_TOP_DOTTED||r===s.db.LINETYPE.STICK_BOTTOM_DOTTED||r===s.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED||r===s.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED||r===s.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED||r===s.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED?(I.style("stroke-dasharray","3, 3"),I.attr("class","messageLine1")):I.attr("class","messageLine0");let L="";if(d.arrowMarkerAbsolute&&(L=ds(!0)),I.attr("stroke-width",2),I.attr("stroke","none"),I.style("fill","none"),(r===s.db.LINETYPE.SOLID_TOP||r===s.db.LINETYPE.SOLID_TOP_DOTTED)&&I.attr("marker-end","url("+L+"#solidTopArrowHead)"),(r===s.db.LINETYPE.SOLID_BOTTOM||r===s.db.LINETYPE.SOLID_BOTTOM_DOTTED)&&I.attr("marker-end","url("+L+"#solidBottomArrowHead)"),(r===s.db.LINETYPE.STICK_TOP||r===s.db.LINETYPE.STICK_TOP_DOTTED)&&I.attr("marker-end","url("+L+"#stickTopArrowHead)"),(r===s.db.LINETYPE.STICK_BOTTOM||r===s.db.LINETYPE.STICK_BOTTOM_DOTTED)&&I.attr("marker-end","url("+L+"#stickBottomArrowHead)"),(r===s.db.LINETYPE.SOLID_ARROW_TOP_REVERSE||r===s.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED)&&I.attr("marker-start","url("+L+"#solidBottomArrowHead)"),(r===s.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE||r===s.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED)&&I.attr("marker-start","url("+L+"#solidTopArrowHead)"),(r===s.db.LINETYPE.STICK_ARROW_TOP_REVERSE||r===s.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED)&&I.attr("marker-start","url("+L+"#stickBottomArrowHead)"),(r===s.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE||r===s.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED)&&I.attr("marker-start","url("+L+"#stickTopArrowHead)"),(r===s.db.LINETYPE.SOLID||r===s.db.LINETYPE.DOTTED)&&I.attr("marker-end","url("+L+"#arrowhead)"),(r===s.db.LINETYPE.BIDIRECTIONAL_SOLID||r===s.db.LINETYPE.BIDIRECTIONAL_DOTTED)&&(I.attr("marker-start","url("+L+"#arrowhead)"),I.attr("marker-end","url("+L+"#arrowhead)")),(r===s.db.LINETYPE.SOLID_POINT||r===s.db.LINETYPE.DOTTED_POINT)&&I.attr("marker-end","url("+L+"#filled-head)"),(r===s.db.LINETYPE.SOLID_CROSS||r===s.db.LINETYPE.DOTTED_CROSS)&&I.attr("marker-end","url("+L+"#crosshead)"),p||d.showSequenceNumbers){const w=r===s.db.LINETYPE.BIDIRECTIONAL_SOLID||r===s.db.LINETYPE.BIDIRECTIONAL_DOTTED,P=r===s.db.LINETYPE.SOLID_ARROW_TOP_REVERSE||r===s.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED||r===s.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE||r===s.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED||r===s.db.LINETYPE.STICK_ARROW_TOP_REVERSE||r===s.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED||r===s.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE||r===s.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED,m=6,k=ke(i,s);let v=n,W=o;w?(n<o?v=n+m*2:(v=n-m+(k?-5:0),v+=(i==null?void 0:i.centralConnection)===s.db.LINETYPE.CENTRAL_CONNECTION_DUAL||(i==null?void 0:i.centralConnection)===s.db.LINETYPE.CENTRAL_CONNECTION_REVERSE?-7.5:0),I.attr("x1",v)):P?(o>n?W=o-2*m:(W=o-m,v+=(i==null?void 0:i.centralConnection)===s.db.LINETYPE.CENTRAL_CONNECTION_DUAL||(i==null?void 0:i.centralConnection)===s.db.LINETYPE.CENTRAL_CONNECTION_REVERSE?-7.5:0),W+=k?15:0,I.attr("x2",W),I.attr("x1",v)):I.attr("x1",n+m);let K=0;const H=n===o,G=n<=o;H?K=t.fromBounds+1:P?K=G?t.toBounds-1:t.fromBounds+1:K=G?t.fromBounds+1:t.toBounds-1,e.append("line").attr("x1",K).attr("y1",a).attr("x2",K).attr("y2",a).attr("stroke-width",0).attr("marker-start","url("+L+"#sequencenumber)"),e.append("text").attr("x",K).attr("y",a+4).attr("font-family","sans-serif").attr("font-size","12px").attr("text-anchor","middle").attr("class","sequenceNumber").text(E)}},"drawMessage"),$s=_(function(e,t,a,s,i,n,o){let h=0,l=0,r,E=0;for(const p of s){const f=t.get(p),u=f.box;r&&r!=u&&(o||x.models.addBox(r),l+=d.boxMargin+r.margin),u&&u!=r&&(o||(u.x=h+l,u.y=i),l+=u.margin),f.width=f.width||d.width,f.height=S.getMax(f.height||d.height,d.height),f.margin=f.margin||d.actorMargin,E=S.getMax(E,f.height),a.get(f.name)&&(l+=f.width/2),f.x=h+l,f.starty=x.getVerticalPos(),x.insert(f.x,i,f.x+f.width,f.height),h+=f.width+l,f.box&&(f.box.width=h+u.margin-f.box.x),l=f.margin,r=f.box,x.models.addActor(f)}r&&!o&&x.models.addBox(r),x.bumpVerticalPos(E)},"addActorRenderingData"),Zt=_(async function(e,t,a,s){if(s){let i=0;x.bumpVerticalPos(d.boxMargin*2);for(const n of a){const o=t.get(n);o.stopy||(o.stopy=x.getVerticalPos());const h=await Y.drawActor(e,o,d,!0);i=S.getMax(i,h)}x.bumpVerticalPos(i+d.boxMargin)}else for(const i of a){const n=t.get(i);await Y.drawActor(e,n,d,!1)}},"drawActors"),Fe=_(function(e,t,a,s){let i=0,n=0;for(const o of a){const h=t.get(o),l=tr(h),r=Y.drawPopup(e,h,l,d,d.forceMenus,s);r.height>i&&(i=r.height),r.width+h.x>n&&(n=r.width+h.x)}return{maxHeight:i,maxWidth:n}},"drawActorsPopup"),qe=_(function(e){es(d,e),e.fontFamily&&(d.actorFontFamily=d.noteFontFamily=d.messageFontFamily=e.fontFamily),e.fontSize&&(d.actorFontSize=d.noteFontSize=d.messageFontSize=e.fontSize),e.fontWeight&&(d.actorFontWeight=d.noteFontWeight=d.messageFontWeight=e.fontWeight)},"setConf"),Yt=_(function(e){return x.activations.filter(function(t){return t.actor===e})},"actorActivations"),De=_(function(e,t){const a=t.get(e),s=Yt(e),i=s.reduce(function(o,h){return S.getMin(o,h.startx)},a.x+a.width/2-1),n=s.reduce(function(o,h){return S.getMax(o,h.stopx)},a.x+a.width/2+1);return[i,n]},"activationBounds");function ct(e,t,a,s,i){x.bumpVerticalPos(a);let n=s;if(t.id&&t.message&&e[t.id]){const o=e[t.id].width,h=xt(d);t.message=q.wrapLabel(`[${t.message}]`,o-2*d.wrapPadding,h),t.width=o,t.wrap=!0;const l=q.calculateTextDimensions(t.message,h),r=S.getMax(l.height,d.labelBoxHeight);n=s+r,Q.debug(`${r} - ${t.message}`)}i(t),x.bumpVerticalPos(n)}_(ct,"adjustLoopHeightForWrap");function He(e,t,a,s,i,n,o){function h(E,p){E.x<i.get(e.from).x?(x.insert(t.stopx-p,t.starty,t.startx,t.stopy+E.height/2+d.noteMargin),t.stopx=t.stopx+p):(x.insert(t.startx,t.starty,t.stopx+p,t.stopy+E.height/2+d.noteMargin),t.stopx=t.stopx-p)}_(h,"receiverAdjustment");function l(E,p){E.x<i.get(e.to).x?(x.insert(t.startx-p,t.starty,t.stopx,t.stopy+E.height/2+d.noteMargin),t.startx=t.startx+p):(x.insert(t.stopx,t.starty,t.startx+p,t.stopy+E.height/2+d.noteMargin),t.startx=t.startx-p)}_(l,"senderAdjustment");const r=[Ct.ACTOR,Ct.CONTROL,Ct.ENTITY,Ct.DATABASE];if(n.get(e.to)==s){const E=i.get(e.to),p=r.includes(E.type)?ft/2+3:E.width/2+3;h(E,p),E.starty=a-E.height/2,x.bumpVerticalPos(E.height/2)}else if(o.get(e.from)==s){const E=i.get(e.from);if(d.mirrorActors){const p=r.includes(E.type)?ft/2:E.width/2;l(E,p)}E.stopy=a-E.height/2,x.bumpVerticalPos(E.height/2)}else if(o.get(e.to)==s){const E=i.get(e.to);if(d.mirrorActors){const p=r.includes(E.type)?ft/2+3:E.width/2+3;h(E,p)}E.stopy=a-E.height/2,x.bumpVerticalPos(E.height/2)}}_(He,"adjustCreatedDestroyedData");var js=_(async function(e,t,a,s){const{securityLevel:i,sequence:n}=et();d=n;let o;i==="sandbox"&&(o=kt("#i"+t));const h=i==="sandbox"?kt(o.nodes()[0].contentDocument.body):kt("body"),l=i==="sandbox"?o.nodes()[0].contentDocument:document;x.init(),Q.debug(s.db);const r=i==="sandbox"?h.select(`[id="${t}"]`):kt(`[id="${t}"]`),E=s.db.getActors(),p=s.db.getCreatedActors(),f=s.db.getDestroyedActors(),u=s.db.getBoxes();let y=s.db.getActorKeys();const I=s.db.getMessages(),L=s.db.getDiagramTitle(),w=s.db.hasAtLeastOneBox(),P=s.db.hasAtLeastOneBoxWithTitle(),m=await ze(E,I,s);if(d.height=await Ue(E,m,u),Y.insertComputerIcon(r),Y.insertDatabaseIcon(r),Y.insertClockIcon(r),w&&(x.bumpVerticalPos(d.boxMargin),P&&x.bumpVerticalPos(u[0].textMaxHeight)),d.hideUnusedParticipants===!0){const O=new Set;I.forEach(R=>{O.add(R.from),O.add(R.to)}),y=y.filter(R=>O.has(R))}$s(r,E,p,y,0,I,!1);const k=await nr(I,E,m,s);Y.insertArrowHead(r),Y.insertArrowCrossHead(r),Y.insertArrowFilledHead(r),Y.insertSequenceNumber(r),Y.insertSolidTopArrowHead(r),Y.insertSolidBottomArrowHead(r),Y.insertStickTopArrowHead(r),Y.insertStickBottomArrowHead(r);function v(O,R){const nt=x.endActivation(O);nt.starty+18>R&&(nt.starty=R-6,R+=12),Y.drawActivation(r,nt,R,d,Yt(O.from).length),x.insert(nt.startx,R-10,nt.stopx,R)}_(v,"activeEnd");let W=1,K=1;const H=[],G=[];let X=0;for(const O of I){let R,nt,ot;switch(O.type){case s.db.LINETYPE.NOTE:x.resetVerticalPos(),nt=O.noteModel,await Js(r,nt);break;case s.db.LINETYPE.ACTIVE_START:x.newActivation(O,r,E);break;case s.db.LINETYPE.CENTRAL_CONNECTION:x.newActivation(O,r,E);break;case s.db.LINETYPE.CENTRAL_CONNECTION_REVERSE:x.newActivation(O,r,E);break;case s.db.LINETYPE.ACTIVE_END:v(O,x.getVerticalPos());break;case s.db.LINETYPE.LOOP_START:ct(k,O,d.boxMargin,d.boxMargin+d.boxTextMargin,M=>x.newLoop(M));break;case s.db.LINETYPE.LOOP_END:R=x.endLoop(),await Y.drawLoop(r,R,"loop",d),x.bumpVerticalPos(R.stopy-x.getVerticalPos()),x.models.addLoop(R);break;case s.db.LINETYPE.RECT_START:ct(k,O,d.boxMargin,d.boxMargin,M=>x.newLoop(void 0,M.message));break;case s.db.LINETYPE.RECT_END:R=x.endLoop(),G.push(R),x.models.addLoop(R),x.bumpVerticalPos(R.stopy-x.getVerticalPos());break;case s.db.LINETYPE.OPT_START:ct(k,O,d.boxMargin,d.boxMargin+d.boxTextMargin,M=>x.newLoop(M));break;case s.db.LINETYPE.OPT_END:R=x.endLoop(),await Y.drawLoop(r,R,"opt",d),x.bumpVerticalPos(R.stopy-x.getVerticalPos()),x.models.addLoop(R);break;case s.db.LINETYPE.ALT_START:ct(k,O,d.boxMargin,d.boxMargin+d.boxTextMargin,M=>x.newLoop(M));break;case s.db.LINETYPE.ALT_ELSE:ct(k,O,d.boxMargin+d.boxTextMargin,d.boxMargin,M=>x.addSectionToLoop(M));break;case s.db.LINETYPE.ALT_END:R=x.endLoop(),await Y.drawLoop(r,R,"alt",d),x.bumpVerticalPos(R.stopy-x.getVerticalPos()),x.models.addLoop(R);break;case s.db.LINETYPE.PAR_START:case s.db.LINETYPE.PAR_OVER_START:ct(k,O,d.boxMargin,d.boxMargin+d.boxTextMargin,M=>x.newLoop(M)),x.saveVerticalPos();break;case s.db.LINETYPE.PAR_AND:ct(k,O,d.boxMargin+d.boxTextMargin,d.boxMargin,M=>x.addSectionToLoop(M));break;case s.db.LINETYPE.PAR_END:R=x.endLoop(),await Y.drawLoop(r,R,"par",d),x.bumpVerticalPos(R.stopy-x.getVerticalPos()),x.models.addLoop(R);break;case s.db.LINETYPE.AUTONUMBER:W=O.message.start||W,K=O.message.step||K,O.message.visible?s.db.enableSequenceNumbers():s.db.disableSequenceNumbers();break;case s.db.LINETYPE.CRITICAL_START:ct(k,O,d.boxMargin,d.boxMargin+d.boxTextMargin,M=>x.newLoop(M));break;case s.db.LINETYPE.CRITICAL_OPTION:ct(k,O,d.boxMargin+d.boxTextMargin,d.boxMargin,M=>x.addSectionToLoop(M));break;case s.db.LINETYPE.CRITICAL_END:R=x.endLoop(),await Y.drawLoop(r,R,"critical",d),x.bumpVerticalPos(R.stopy-x.getVerticalPos()),x.models.addLoop(R);break;case s.db.LINETYPE.BREAK_START:ct(k,O,d.boxMargin,d.boxMargin+d.boxTextMargin,M=>x.newLoop(M));break;case s.db.LINETYPE.BREAK_END:R=x.endLoop(),await Y.drawLoop(r,R,"break",d),x.bumpVerticalPos(R.stopy-x.getVerticalPos()),x.models.addLoop(R);break;default:try{ot=O.msgModel,ot.starty=x.getVerticalPos(),ot.sequenceIndex=W,ot.sequenceVisible=s.db.showSequenceNumbers();const M=await Ke(r,ot);He(O,ot,M,X,E,p,f),H.push({messageModel:ot,lineStartY:M,msg:O}),x.models.addMessage(ot)}catch(M){Q.error("error while drawing message",M)}}[s.db.LINETYPE.SOLID_OPEN,s.db.LINETYPE.DOTTED_OPEN,s.db.LINETYPE.SOLID,s.db.LINETYPE.SOLID_TOP,s.db.LINETYPE.SOLID_BOTTOM,s.db.LINETYPE.STICK_TOP,s.db.LINETYPE.STICK_BOTTOM,s.db.LINETYPE.SOLID_TOP_DOTTED,s.db.LINETYPE.SOLID_BOTTOM_DOTTED,s.db.LINETYPE.STICK_TOP_DOTTED,s.db.LINETYPE.STICK_BOTTOM_DOTTED,s.db.LINETYPE.SOLID_ARROW_TOP_REVERSE,s.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE,s.db.LINETYPE.STICK_ARROW_TOP_REVERSE,s.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE,s.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED,s.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED,s.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED,s.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED,s.db.LINETYPE.DOTTED,s.db.LINETYPE.SOLID_CROSS,s.db.LINETYPE.DOTTED_CROSS,s.db.LINETYPE.SOLID_POINT,s.db.LINETYPE.DOTTED_POINT,s.db.LINETYPE.BIDIRECTIONAL_SOLID,s.db.LINETYPE.BIDIRECTIONAL_DOTTED].includes(O.type)&&(W=W+K),X++}Q.debug("createdActors",p),Q.debug("destroyedActors",f),await Zt(r,E,y,!1);for(const O of H)await Qs(r,O.messageModel,O.lineStartY,s,O.msg);d.mirrorActors&&await Zt(r,E,y,!0),G.forEach(O=>Y.drawBackgroundRect(r,O)),Ve(r,E,y,d);for(const O of x.models.boxes){O.height=x.getVerticalPos()-O.y,x.insert(O.x,O.y,O.x+O.width,O.height);const R=d.boxMargin*2;O.startx=O.x-R,O.starty=O.y-R*.25,O.stopx=O.startx+O.width+2*R,O.stopy=O.starty+O.height+R*.75,O.stroke="rgb(0,0,0, 0.5)",Y.drawBox(r,O,d)}w&&x.bumpVerticalPos(d.boxMargin);const z=Fe(r,E,y,l),{bounds:C}=x.getBounds();C.startx===void 0&&(C.startx=0),C.starty===void 0&&(C.starty=0),C.stopx===void 0&&(C.stopx=0),C.stopy===void 0&&(C.stopy=0);let $=C.stopy-C.starty;$<z.maxHeight&&($=z.maxHeight);let J=$+2*d.diagramMarginY;d.mirrorActors&&(J=J-d.boxMargin+d.bottomMarginAdj);let j=C.stopx-C.startx;j<z.maxWidth&&(j=z.maxWidth);const st=j+2*d.diagramMarginX;L&&r.append("text").text(L).attr("x",(C.stopx-C.startx)/2-2*d.diagramMarginX).attr("y",-25),ts(r,J,st,d.useMaxWidth);const rt=L?40:0;r.attr("viewBox",C.startx-d.diagramMarginX+" -"+(d.diagramMarginY+rt)+" "+st+" "+(J+rt)),Q.debug("models:",x.models)},"draw");async function ze(e,t,a){const s={};for(const i of t)if(e.get(i.to)&&e.get(i.from)){const n=e.get(i.to);if(i.placement===a.db.PLACEMENT.LEFTOF&&!n.prevActor||i.placement===a.db.PLACEMENT.RIGHTOF&&!n.nextActor)continue;const o=i.placement!==void 0,h=!o,l=o?Rt(d):xt(d),r=i.wrap?q.wrapLabel(i.message,d.width-2*d.wrapPadding,l):i.message,p=(U(r)?await Nt(i.message,et()):q.calculateTextDimensions(r,l)).width+2*d.wrapPadding;h&&i.from===n.nextActor?s[i.to]=S.getMax(s[i.to]||0,p):h&&i.from===n.prevActor?s[i.from]=S.getMax(s[i.from]||0,p):h&&i.from===i.to?(s[i.from]=S.getMax(s[i.from]||0,p/2),s[i.to]=S.getMax(s[i.to]||0,p/2)):i.placement===a.db.PLACEMENT.RIGHTOF?s[i.from]=S.getMax(s[i.from]||0,p):i.placement===a.db.PLACEMENT.LEFTOF?s[n.prevActor]=S.getMax(s[n.prevActor]||0,p):i.placement===a.db.PLACEMENT.OVER&&(n.prevActor&&(s[n.prevActor]=S.getMax(s[n.prevActor]||0,p/2)),n.nextActor&&(s[i.from]=S.getMax(s[i.from]||0,p/2)))}return Q.debug("maxMessageWidthPerActor:",s),s}_(ze,"getMaxMessageWidthPerActor");var tr=_(function(e){let t=0;const a=Jt(d);for(const s in e.links){const n=q.calculateTextDimensions(s,a).width+2*d.wrapPadding+2*d.boxMargin;t<n&&(t=n)}return t},"getRequiredPopupWidth");async function Ue(e,t,a){let s=0;for(const n of e.keys()){const o=e.get(n);o.wrap&&(o.description=q.wrapLabel(o.description,d.width-2*d.wrapPadding,Jt(d)));const h=U(o.description)?await Nt(o.description,et()):q.calculateTextDimensions(o.description,Jt(d));o.width=o.wrap?d.width:S.getMax(d.width,h.width+2*d.wrapPadding),o.height=o.wrap?S.getMax(h.height,d.height):d.height,s=S.getMax(s,o.height)}for(const n in t){const o=e.get(n);if(!o)continue;const h=e.get(o.nextActor);if(!h){const p=t[n]+d.actorMargin-o.width/2;o.margin=S.getMax(p,d.actorMargin);continue}const r=t[n]+d.actorMargin-o.width/2-h.width/2;o.margin=S.getMax(r,d.actorMargin)}let i=0;return a.forEach(n=>{const o=xt(d);let h=n.actorKeys.reduce((p,f)=>p+=e.get(f).width+(e.get(f).margin||0),0);const l=d.boxMargin*8;h+=l,h-=2*d.boxTextMargin,n.wrap&&(n.name=q.wrapLabel(n.name,h-2*d.wrapPadding,o));const r=q.calculateTextDimensions(n.name,o);i=S.getMax(r.height,i);const E=S.getMax(h,r.width+2*d.wrapPadding);if(n.margin=d.boxTextMargin,h<E){const p=(E-h)/2;n.margin+=p}}),a.forEach(n=>n.textMaxHeight=i),S.getMax(s,d.height)}_(Ue,"calculateActorMargins");var er=_(async function(e,t,a){const s=t.get(e.from),i=t.get(e.to),n=s.x,o=i.x,h=e.wrap&&e.message;let l=U(e.message)?await Nt(e.message,et()):q.calculateTextDimensions(h?q.wrapLabel(e.message,d.width,Rt(d)):e.message,Rt(d));const r={width:h?d.width:S.getMax(d.width,l.width+2*d.noteMargin),height:0,startx:s.x,stopx:0,starty:0,stopy:0,message:e.message};return e.placement===a.db.PLACEMENT.RIGHTOF?(r.width=h?S.getMax(d.width,l.width):S.getMax(s.width/2+i.width/2,l.width+2*d.noteMargin),r.startx=n+(s.width+d.actorMargin)/2):e.placement===a.db.PLACEMENT.LEFTOF?(r.width=h?S.getMax(d.width,l.width+2*d.noteMargin):S.getMax(s.width/2+i.width/2,l.width+2*d.noteMargin),r.startx=n-r.width+(s.width-d.actorMargin)/2):e.to===e.from?(l=q.calculateTextDimensions(h?q.wrapLabel(e.message,S.getMax(d.width,s.width),Rt(d)):e.message,Rt(d)),r.width=h?S.getMax(d.width,s.width):S.getMax(s.width,d.width,l.width+2*d.noteMargin),r.startx=n+(s.width-r.width)/2):(r.width=Math.abs(n+s.width/2-(o+i.width/2))+d.actorMargin,r.startx=n<o?n+s.width/2-d.actorMargin/2:o+i.width/2-d.actorMargin/2),h&&(r.message=q.wrapLabel(e.message,r.width-2*d.wrapPadding,Rt(d))),Q.debug(`NM:[${r.startx},${r.stopx},${r.starty},${r.stopy}:${r.width},${r.height}=${e.message}]`),r},"buildNoteModel"),sr=4,ke=_(function(e,t){const{CENTRAL_CONNECTION:a,CENTRAL_CONNECTION_REVERSE:s,CENTRAL_CONNECTION_DUAL:i}=t.db.LINETYPE;return[a,s,i].includes(e.centralConnection)},"hasCentralConnection"),rr=_(function(e,t,a){const{CENTRAL_CONNECTION_REVERSE:s,CENTRAL_CONNECTION_DUAL:i,BIDIRECTIONAL_SOLID:n,BIDIRECTIONAL_DOTTED:o}=t.db.LINETYPE;let h=0;return(e.centralConnection===s||e.centralConnection===i)&&(h+=sr),(e.centralConnection===s||e.centralConnection===i)&&(e.type===n||e.type===o)&&(h+=a?0:-6),h},"calculateCentralConnectionOffset"),Ge=_(function(e,t){const{SOLID_ARROW_TOP_REVERSE:a,SOLID_ARROW_TOP_REVERSE_DOTTED:s,SOLID_ARROW_BOTTOM_REVERSE:i,SOLID_ARROW_BOTTOM_REVERSE_DOTTED:n,STICK_ARROW_TOP_REVERSE:o,STICK_ARROW_TOP_REVERSE_DOTTED:h,STICK_ARROW_BOTTOM_REVERSE:l,STICK_ARROW_BOTTOM_REVERSE_DOTTED:r}=t.db.LINETYPE;return[a,s,i,n,o,h,l,r].includes(e.type)},"isReverseArrowType"),ar=_(function(e,t){const{BIDIRECTIONAL_SOLID:a,BIDIRECTIONAL_DOTTED:s}=t.db.LINETYPE;return[a,s].includes(e.type)},"isBidirectionalArrowType"),ir=_(function(e,t,a){if(![a.db.LINETYPE.SOLID_OPEN,a.db.LINETYPE.DOTTED_OPEN,a.db.LINETYPE.SOLID,a.db.LINETYPE.SOLID_TOP,a.db.LINETYPE.SOLID_BOTTOM,a.db.LINETYPE.STICK_TOP,a.db.LINETYPE.STICK_BOTTOM,a.db.LINETYPE.SOLID_TOP_DOTTED,a.db.LINETYPE.SOLID_BOTTOM_DOTTED,a.db.LINETYPE.STICK_TOP_DOTTED,a.db.LINETYPE.STICK_BOTTOM_DOTTED,a.db.LINETYPE.SOLID_ARROW_TOP_REVERSE,a.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE,a.db.LINETYPE.STICK_ARROW_TOP_REVERSE,a.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE,a.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED,a.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED,a.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED,a.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED,a.db.LINETYPE.DOTTED,a.db.LINETYPE.SOLID_CROSS,a.db.LINETYPE.DOTTED_CROSS,a.db.LINETYPE.SOLID_POINT,a.db.LINETYPE.DOTTED_POINT,a.db.LINETYPE.BIDIRECTIONAL_SOLID,a.db.LINETYPE.BIDIRECTIONAL_DOTTED].includes(e.type))return{};const[s,i]=De(e.from,t),[n,o]=De(e.to,t),h=s<=n;let l=h?i:s,r=h?n:o;l+=rr(e,a,h);const E=Math.abs(n-o)>2,p=_(I=>h?-I:I,"adjustValue");e.from===e.to?r=l:(e.activate&&!E&&(r+=p(d.activationWidth/2-1)),[a.db.LINETYPE.SOLID_OPEN,a.db.LINETYPE.DOTTED_OPEN,a.db.LINETYPE.STICK_TOP,a.db.LINETYPE.STICK_BOTTOM,a.db.LINETYPE.STICK_TOP_DOTTED,a.db.LINETYPE.STICK_BOTTOM_DOTTED,a.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED,a.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED,a.db.LINETYPE.STICK_ARROW_TOP_REVERSE,a.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE,a.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED,a.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED,a.db.LINETYPE.SOLID_ARROW_TOP_REVERSE,a.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE].includes(e.type)||(r+=p(3)),[a.db.LINETYPE.BIDIRECTIONAL_SOLID,a.db.LINETYPE.BIDIRECTIONAL_DOTTED,a.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED,a.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED,a.db.LINETYPE.SOLID_ARROW_TOP_REVERSE,a.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE].includes(e.type)&&(l-=p(3)));const f=[s,i,n,o],u=Math.abs(l-r);e.wrap&&e.message&&(e.message=q.wrapLabel(e.message,S.getMax(u+2*d.wrapPadding,d.width),xt(d)));const y=q.calculateTextDimensions(e.message,xt(d));return{width:S.getMax(e.wrap?0:y.width+2*d.wrapPadding,u+2*d.wrapPadding,d.width),height:0,startx:l,stopx:r,starty:0,stopy:0,message:e.message,type:e.type,wrap:e.wrap,fromBounds:Math.min.apply(null,f),toBounds:Math.max.apply(null,f)}},"buildMessageModel"),nr=_(async function(e,t,a,s){const i={},n=[];let o,h,l;for(const r of e){switch(r.type){case s.db.LINETYPE.LOOP_START:case s.db.LINETYPE.ALT_START:case s.db.LINETYPE.OPT_START:case s.db.LINETYPE.PAR_START:case s.db.LINETYPE.PAR_OVER_START:case s.db.LINETYPE.CRITICAL_START:case s.db.LINETYPE.BREAK_START:n.push({id:r.id,msg:r.message,from:Number.MAX_SAFE_INTEGER,to:Number.MIN_SAFE_INTEGER,width:0});break;case s.db.LINETYPE.ALT_ELSE:case s.db.LINETYPE.PAR_AND:case s.db.LINETYPE.CRITICAL_OPTION:r.message&&(o=n.pop(),i[o.id]=o,i[r.id]=o,n.push(o));break;case s.db.LINETYPE.LOOP_END:case s.db.LINETYPE.ALT_END:case s.db.LINETYPE.OPT_END:case s.db.LINETYPE.PAR_END:case s.db.LINETYPE.CRITICAL_END:case s.db.LINETYPE.BREAK_END:o=n.pop(),i[o.id]=o;break;case s.db.LINETYPE.ACTIVE_START:{const p=t.get(r.from?r.from:r.to.actor),f=Yt(r.from?r.from:r.to.actor).length,u=p.x+p.width/2+(f-1)*d.activationWidth/2,y={startx:u,stopx:u+d.activationWidth,actor:r.from,enabled:!0};x.activations.push(y)}break;case s.db.LINETYPE.ACTIVE_END:{const p=x.activations.map(f=>f.actor).lastIndexOf(r.from);x.activations.splice(p,1).splice(0,1)}break}r.placement!==void 0?(h=await er(r,t,s),r.noteModel=h,n.forEach(p=>{o=p,o.from=S.getMin(o.from,h.startx),o.to=S.getMax(o.to,h.startx+h.width),o.width=S.getMax(o.width,Math.abs(o.from-o.to))-d.labelBoxWidth})):(l=ir(r,t,s),r.msgModel=l,l.startx&&l.stopx&&n.length>0&&n.forEach(p=>{if(o=p,l.startx===l.stopx){const f=t.get(r.from),u=t.get(r.to);o.from=S.getMin(f.x-l.width/2,f.x-f.width/2,o.from),o.to=S.getMax(u.x+l.width/2,u.x+f.width/2,o.to),o.width=S.getMax(o.width,Math.abs(o.to-o.from))-d.labelBoxWidth}else o.from=S.getMin(l.startx,o.from),o.to=S.getMax(l.stopx,o.to),o.width=S.getMax(o.width,l.width)-d.labelBoxWidth}))}return x.activations=[],Q.debug("Loop type widths:",i),i},"calculateLoopBounds"),or={bounds:x,drawActors:Zt,drawActorsPopup:Fe,setConf:qe,draw:js},Er={parser:us,get db(){return new xs},renderer:or,styles:Rs,init:_(e=>{e.sequence||(e.sequence={}),e.wrap&&(e.sequence.wrap=e.wrap,je({sequence:{wrap:e.wrap}}))},"init")};export{Er as diagram};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import{c as r,j as t,R as l,C as n,d as c,B as h,X as f,e as s,T as p,P as u,O as m}from"./index-CPnL1_qC.js";/**
|
|
2
|
+
* @license lucide-react v0.400.0 - ISC
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the ISC license.
|
|
5
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/const j=r("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]]);function y({...a}){return t.jsx(l,{"data-slot":"sheet",...a})}function x({...a}){return t.jsx(u,{"data-slot":"sheet-portal",...a})}function b({className:a,...e}){return t.jsx(m,{"data-slot":"sheet-overlay",className:s("fixed inset-0 z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0",a),...e})}function v({className:a,children:e,side:d="right",showCloseButton:o=!0,...i}){return t.jsxs(x,{children:[t.jsx(b,{}),t.jsxs(n,{"data-slot":"sheet-content","data-side":d,className:s("fixed z-50 flex flex-col gap-4 bg-popover bg-clip-padding text-sm text-popover-foreground shadow-lg transition duration-200 ease-in-out data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-3/4 data-[side=left]:border-r data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-3/4 data-[side=right]:border-l data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=left]:sm:max-w-sm data-[side=right]:sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-[side=bottom]:data-open:slide-in-from-bottom-10 data-[side=left]:data-open:slide-in-from-left-10 data-[side=right]:data-open:slide-in-from-right-10 data-[side=top]:data-open:slide-in-from-top-10 data-closed:animate-out data-closed:fade-out-0 data-[side=bottom]:data-closed:slide-out-to-bottom-10 data-[side=left]:data-closed:slide-out-to-left-10 data-[side=right]:data-closed:slide-out-to-right-10 data-[side=top]:data-closed:slide-out-to-top-10",a),...i,children:[e,o&&t.jsx(c,{"data-slot":"sheet-close",asChild:!0,children:t.jsxs(h,{variant:"ghost",className:"absolute top-3 right-3",size:"icon-sm",children:[t.jsx(f,{}),t.jsx("span",{className:"sr-only",children:"Close"})]})})]})]})}function k({className:a,...e}){return t.jsx("div",{"data-slot":"sheet-header",className:s("flex flex-col gap-0.5 p-4",a),...e})}function S({className:a,...e}){return t.jsx(p,{"data-slot":"sheet-title",className:s("text-base font-medium text-foreground",a),...e})}export{y as S,j as U,v as a,k as b,S as c};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import{c as y}from"./index-CPnL1_qC.js";/**
|
|
2
|
+
* @license lucide-react v0.400.0 - ISC
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the ISC license.
|
|
5
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/const x=y("SlidersHorizontal",[["line",{x1:"21",x2:"14",y1:"4",y2:"4",key:"obuewd"}],["line",{x1:"10",x2:"3",y1:"4",y2:"4",key:"1q6298"}],["line",{x1:"21",x2:"12",y1:"12",y2:"12",key:"1iu8h1"}],["line",{x1:"8",x2:"3",y1:"12",y2:"12",key:"ntss68"}],["line",{x1:"21",x2:"16",y1:"20",y2:"20",key:"14d8ph"}],["line",{x1:"12",x2:"3",y1:"20",y2:"20",key:"m0wm8r"}],["line",{x1:"14",x2:"14",y1:"2",y2:"6",key:"14e1ph"}],["line",{x1:"8",x2:"8",y1:"10",y2:"14",key:"1i6ji0"}],["line",{x1:"16",x2:"16",y1:"18",y2:"22",key:"1lctlv"}]]);export{x as S};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import{c as a}from"./index-CPnL1_qC.js";/**
|
|
2
|
+
* @license lucide-react v0.400.0 - ISC
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the ISC license.
|
|
5
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/const l=a("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/**
|
|
7
|
+
* @license lucide-react v0.400.0 - ISC
|
|
8
|
+
*
|
|
9
|
+
* This source code is licensed under the ISC license.
|
|
10
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
11
|
+
*/const c=a("Sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]]);export{l as C,c as S};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import{c as e}from"./index-CPnL1_qC.js";/**
|
|
2
|
+
* @license lucide-react v0.400.0 - ISC
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the ISC license.
|
|
5
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/const a=e("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/**
|
|
7
|
+
* @license lucide-react v0.400.0 - ISC
|
|
8
|
+
*
|
|
9
|
+
* This source code is licensed under the ISC license.
|
|
10
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
11
|
+
*/const r=e("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);export{a as F,r as S};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{s as R,a as W,S as N}from"./chunk-NQ4KR5QH-BCrLoU88.js";import{_ as f,c as t,d as H,l as S,e as P,k as z,O as _,u as U}from"./mermaid.core-BWLV1B2v.js";import{G as C}from"./graph-CeAEckur.js";import{l as F}from"./layout-BmMMqTnJ.js";import{l as O,c as J}from"./step-D51IIHGA.js";import"./chunk-55IACEB6-DQDjnXfS.js";import"./chunk-KX2RTZJC-zBbcpaN_.js";import"./index-CPnL1_qC.js";import"./_baseUniq-zAOaCuKw.js";import"./_basePickBy-Bf-bSoS9.js";var X=f(e=>e.append("circle").attr("class","start-state").attr("r",t().state.sizeUnit).attr("cx",t().state.padding+t().state.sizeUnit).attr("cy",t().state.padding+t().state.sizeUnit),"drawStartState"),D=f(e=>e.append("line").style("stroke","grey").style("stroke-dasharray","3").attr("x1",t().state.textHeight).attr("class","divider").attr("x2",t().state.textHeight*2).attr("y1",0).attr("y2",0),"drawDivider"),Y=f((e,i)=>{const d=e.append("text").attr("x",2*t().state.padding).attr("y",t().state.textHeight+2*t().state.padding).attr("font-size",t().state.fontSize).attr("class","state-title").text(i.id),c=d.node().getBBox();return e.insert("rect",":first-child").attr("x",t().state.padding).attr("y",t().state.padding).attr("width",c.width+2*t().state.padding).attr("height",c.height+2*t().state.padding).attr("rx",t().state.radius),d},"drawSimpleState"),I=f((e,i)=>{const d=f(function(g,B,m){const E=g.append("tspan").attr("x",2*t().state.padding).text(B);m||E.attr("dy",t().state.textHeight)},"addTspan"),n=e.append("text").attr("x",2*t().state.padding).attr("y",t().state.textHeight+1.3*t().state.padding).attr("font-size",t().state.fontSize).attr("class","state-title").text(i.descriptions[0]).node().getBBox(),l=n.height,x=e.append("text").attr("x",t().state.padding).attr("y",l+t().state.padding*.4+t().state.dividerMargin+t().state.textHeight).attr("class","state-description");let a=!0,s=!0;i.descriptions.forEach(function(g){a||(d(x,g,s),s=!1),a=!1});const w=e.append("line").attr("x1",t().state.padding).attr("y1",t().state.padding+l+t().state.dividerMargin/2).attr("y2",t().state.padding+l+t().state.dividerMargin/2).attr("class","descr-divider"),p=x.node().getBBox(),o=Math.max(p.width,n.width);return w.attr("x2",o+3*t().state.padding),e.insert("rect",":first-child").attr("x",t().state.padding).attr("y",t().state.padding).attr("width",o+2*t().state.padding).attr("height",p.height+l+2*t().state.padding).attr("rx",t().state.radius),e},"drawDescrState"),$=f((e,i,d)=>{const c=t().state.padding,n=2*t().state.padding,l=e.node().getBBox(),x=l.width,a=l.x,s=e.append("text").attr("x",0).attr("y",t().state.titleShift).attr("font-size",t().state.fontSize).attr("class","state-title").text(i.id),p=s.node().getBBox().width+n;let o=Math.max(p,x);o===x&&(o=o+n);let g;const B=e.node().getBBox();i.doc,g=a-c,p>x&&(g=(x-o)/2+c),Math.abs(a-B.x)<c&&p>x&&(g=a-(p-x)/2);const m=1-t().state.textHeight;return e.insert("rect",":first-child").attr("x",g).attr("y",m).attr("class",d?"alt-composit":"composit").attr("width",o).attr("height",B.height+t().state.textHeight+t().state.titleShift+1).attr("rx","0"),s.attr("x",g+c),p<=x&&s.attr("x",a+(o-n)/2-p/2+c),e.insert("rect",":first-child").attr("x",g).attr("y",t().state.titleShift-t().state.textHeight-t().state.padding).attr("width",o).attr("height",t().state.textHeight*3).attr("rx",t().state.radius),e.insert("rect",":first-child").attr("x",g).attr("y",t().state.titleShift-t().state.textHeight-t().state.padding).attr("width",o).attr("height",B.height+3+2*t().state.textHeight).attr("rx",t().state.radius),e},"addTitleAndBox"),q=f(e=>(e.append("circle").attr("class","end-state-outer").attr("r",t().state.sizeUnit+t().state.miniPadding).attr("cx",t().state.padding+t().state.sizeUnit+t().state.miniPadding).attr("cy",t().state.padding+t().state.sizeUnit+t().state.miniPadding),e.append("circle").attr("class","end-state-inner").attr("r",t().state.sizeUnit).attr("cx",t().state.padding+t().state.sizeUnit+2).attr("cy",t().state.padding+t().state.sizeUnit+2)),"drawEndState"),Z=f((e,i)=>{let d=t().state.forkWidth,c=t().state.forkHeight;if(i.parentId){let n=d;d=c,c=n}return e.append("rect").style("stroke","black").style("fill","black").attr("width",d).attr("height",c).attr("x",t().state.padding).attr("y",t().state.padding)},"drawForkJoinState"),j=f((e,i,d,c)=>{let n=0;const l=c.append("text");l.style("text-anchor","start"),l.attr("class","noteText");let x=e.replace(/\r\n/g,"<br/>");x=x.replace(/\n/g,"<br/>");const a=x.split(z.lineBreakRegex);let s=1.25*t().state.noteMargin;for(const w of a){const p=w.trim();if(p.length>0){const o=l.append("tspan");if(o.text(p),s===0){const g=o.node().getBBox();s+=g.height}n+=s,o.attr("x",i+t().state.noteMargin),o.attr("y",d+n+1.25*t().state.noteMargin)}}return{textWidth:l.node().getBBox().width,textHeight:n}},"_drawLongText"),K=f((e,i)=>{i.attr("class","state-note");const d=i.append("rect").attr("x",0).attr("y",t().state.padding),c=i.append("g"),{textWidth:n,textHeight:l}=j(e,0,0,c);return d.attr("height",l+2*t().state.noteMargin),d.attr("width",n+t().state.noteMargin*2),d},"drawNote"),L=f(function(e,i){const d=i.id,c={id:d,label:i.id,width:0,height:0},n=e.append("g").attr("id",d).attr("class","stateGroup");i.type==="start"&&X(n),i.type==="end"&&q(n),(i.type==="fork"||i.type==="join")&&Z(n,i),i.type==="note"&&K(i.note.text,n),i.type==="divider"&&D(n),i.type==="default"&&i.descriptions.length===0&&Y(n,i),i.type==="default"&&i.descriptions.length>0&&I(n,i);const l=n.node().getBBox();return c.width=l.width+2*t().state.padding,c.height=l.height+2*t().state.padding,c},"drawState"),A=0,Q=f(function(e,i,d){const c=f(function(s){switch(s){case N.relationType.AGGREGATION:return"aggregation";case N.relationType.EXTENSION:return"extension";case N.relationType.COMPOSITION:return"composition";case N.relationType.DEPENDENCY:return"dependency"}},"getRelationType");i.points=i.points.filter(s=>!Number.isNaN(s.y));const n=i.points,l=O().x(function(s){return s.x}).y(function(s){return s.y}).curve(J),x=e.append("path").attr("d",l(n)).attr("id","edge"+A).attr("class","transition");let a="";if(t().state.arrowMarkerAbsolute&&(a=_(!0)),x.attr("marker-end","url("+a+"#"+c(N.relationType.DEPENDENCY)+"End)"),d.title!==void 0){const s=e.append("g").attr("class","stateLabel"),{x:w,y:p}=U.calcLabelPosition(i.points),o=z.getRows(d.title);let g=0;const B=[];let m=0,E=0;for(let u=0;u<=o.length;u++){const h=s.append("text").attr("text-anchor","middle").text(o[u]).attr("x",w).attr("y",p+g),y=h.node().getBBox();m=Math.max(m,y.width),E=Math.min(E,y.x),S.info(y.x,w,p+g),g===0&&(g=h.node().getBBox().height,S.info("Title height",g,p)),B.push(h)}let k=g*o.length;if(o.length>1){const u=(o.length-1)*g*.5;B.forEach((h,y)=>h.attr("y",p+y*g-u)),k=g*o.length}const r=s.node().getBBox();s.insert("rect",":first-child").attr("class","box").attr("x",w-m/2-t().state.padding/2).attr("y",p-k/2-t().state.padding/2-3.5).attr("width",m+t().state.padding).attr("height",k+t().state.padding),S.info(r)}A++},"drawEdge"),b,T={},V=f(function(){},"setConf"),tt=f(function(e){e.append("defs").append("marker").attr("id","dependencyEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},"insertMarkers"),et=f(function(e,i,d,c){b=t().state;const n=t().securityLevel;let l;n==="sandbox"&&(l=H("#i"+i));const x=n==="sandbox"?H(l.nodes()[0].contentDocument.body):H("body"),a=n==="sandbox"?l.nodes()[0].contentDocument:document;S.debug("Rendering diagram "+e);const s=x.select(`[id='${i}']`);tt(s);const w=c.db.getRootDoc();G(w,s,void 0,!1,x,a,c);const p=b.padding,o=s.node().getBBox(),g=o.width+p*2,B=o.height+p*2,m=g*1.75;P(s,B,m,b.useMaxWidth),s.attr("viewBox",`${o.x-b.padding} ${o.y-b.padding} `+g+" "+B)},"draw"),at=f(e=>e?e.length*b.fontSizeFactor:1,"getLabelWidth"),G=f((e,i,d,c,n,l,x)=>{const a=new C({compound:!0,multigraph:!0});let s,w=!0;for(s=0;s<e.length;s++)if(e[s].stmt==="relation"){w=!1;break}d?a.setGraph({rankdir:"LR",multigraph:!0,compound:!0,ranker:"tight-tree",ranksep:w?1:b.edgeLengthFactor,nodeSep:w?1:50,isMultiGraph:!0}):a.setGraph({rankdir:"TB",multigraph:!0,compound:!0,ranksep:w?1:b.edgeLengthFactor,nodeSep:w?1:50,ranker:"tight-tree",isMultiGraph:!0}),a.setDefaultEdgeLabel(function(){return{}});const p=x.db.getStates(),o=x.db.getRelations(),g=Object.keys(p);for(const r of g){const u=p[r];d&&(u.parentId=d);let h;if(u.doc){let y=i.append("g").attr("id",u.id).attr("class","stateGroup");h=G(u.doc,y,u.id,!c,n,l,x);{y=$(y,u,c);let v=y.node().getBBox();h.width=v.width,h.height=v.height+b.padding/2,T[u.id]={y:b.compositTitleSize}}}else h=L(i,u,a);if(u.note){const y={descriptions:[],id:u.id+"-note",note:u.note,type:"note"},v=L(i,y,a);u.note.position==="left of"?(a.setNode(h.id+"-note",v),a.setNode(h.id,h)):(a.setNode(h.id,h),a.setNode(h.id+"-note",v)),a.setParent(h.id,h.id+"-group"),a.setParent(h.id+"-note",h.id+"-group")}else a.setNode(h.id,h)}S.debug("Count=",a.nodeCount(),a);let B=0;o.forEach(function(r){B++,S.debug("Setting edge",r),a.setEdge(r.id1,r.id2,{relation:r,width:at(r.title),height:b.labelHeight*z.getRows(r.title).length,labelpos:"c"},"id"+B)}),F(a),S.debug("Graph after layout",a.nodes());const m=i.node();a.nodes().forEach(function(r){r!==void 0&&a.node(r)!==void 0?(S.warn("Node "+r+": "+JSON.stringify(a.node(r))),n.select("#"+m.id+" #"+r).attr("transform","translate("+(a.node(r).x-a.node(r).width/2)+","+(a.node(r).y+(T[r]?T[r].y:0)-a.node(r).height/2)+" )"),n.select("#"+m.id+" #"+r).attr("data-x-shift",a.node(r).x-a.node(r).width/2),l.querySelectorAll("#"+m.id+" #"+r+" .divider").forEach(h=>{const y=h.parentElement;let v=0,M=0;y&&(y.parentElement&&(v=y.parentElement.getBBox().width),M=parseInt(y.getAttribute("data-x-shift"),10),Number.isNaN(M)&&(M=0)),h.setAttribute("x1",0-M+8),h.setAttribute("x2",v-M-8)})):S.debug("No Node "+r+": "+JSON.stringify(a.node(r)))});let E=m.getBBox();a.edges().forEach(function(r){r!==void 0&&a.edge(r)!==void 0&&(S.debug("Edge "+r.v+" -> "+r.w+": "+JSON.stringify(a.edge(r))),Q(i,a.edge(r),a.edge(r).relation))}),E=m.getBBox();const k={id:d||"root",label:d||"root",width:0,height:0};return k.width=E.width+2*b.padding,k.height=E.height+2*b.padding,S.debug("Doc rendered",k,a),k},"renderDoc"),it={setConf:V,draw:et},xt={parser:W,get db(){return new N(1)},renderer:it,styles:R,init:f(e=>{e.state||(e.state={}),e.state.arrowMarkerAbsolute=e.arrowMarkerAbsolute},"init")};export{xt as diagram};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{s as r,b as e,a,S as s}from"./chunk-NQ4KR5QH-BCrLoU88.js";import{_ as i}from"./mermaid.core-BWLV1B2v.js";import"./chunk-55IACEB6-DQDjnXfS.js";import"./chunk-KX2RTZJC-zBbcpaN_.js";import"./index-CPnL1_qC.js";import"./step-D51IIHGA.js";var u={parser:a,get db(){return new s(2)},renderer:e,styles:r,init:i(t=>{t.state||(t.state={}),t.state.arrowMarkerAbsolute=t.arrowMarkerAbsolute},"init")};export{u as diagram};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function X(t,i,e){t.prototype=i.prototype=e,e.constructor=t}function ct(t,i){var e=Object.create(t.prototype);for(var n in i)e[n]=i[n];return e}function N(){}var $=.7,T=1/$,w="\\s*([+-]?\\d+)\\s*",v="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",p="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Mt=/^#([0-9a-f]{3,8})$/,kt=new RegExp(`^rgb\\(${w},${w},${w}\\)$`),Tt=new RegExp(`^rgb\\(${p},${p},${p}\\)$`),Et=new RegExp(`^rgba\\(${w},${w},${w},${v}\\)$`),St=new RegExp(`^rgba\\(${p},${p},${p},${v}\\)$`),Pt=new RegExp(`^hsl\\(${v},${p},${p}\\)$`),Rt=new RegExp(`^hsla\\(${v},${p},${p},${v}\\)$`),U={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};X(N,Y,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:V,formatHex:V,formatHex8:Ct,formatHsl:Ht,formatRgb:W,toString:W});function V(){return this.rgb().formatHex()}function Ct(){return this.rgb().formatHex8()}function Ht(){return lt(this).formatHsl()}function W(){return this.rgb().formatRgb()}function Y(t){var i,e;return t=(t+"").trim().toLowerCase(),(i=Mt.exec(t))?(e=i[1].length,i=parseInt(i[1],16),e===6?tt(i):e===3?new _(i>>8&15|i>>4&240,i>>4&15|i&240,(i&15)<<4|i&15,1):e===8?M(i>>24&255,i>>16&255,i>>8&255,(i&255)/255):e===4?M(i>>12&15|i>>8&240,i>>8&15|i>>4&240,i>>4&15|i&240,((i&15)<<4|i&15)/255):null):(i=kt.exec(t))?new _(i[1],i[2],i[3],1):(i=Tt.exec(t))?new _(i[1]*255/100,i[2]*255/100,i[3]*255/100,1):(i=Et.exec(t))?M(i[1],i[2],i[3],i[4]):(i=St.exec(t))?M(i[1]*255/100,i[2]*255/100,i[3]*255/100,i[4]):(i=Pt.exec(t))?nt(i[1],i[2]/100,i[3]/100,1):(i=Rt.exec(t))?nt(i[1],i[2]/100,i[3]/100,i[4]):U.hasOwnProperty(t)?tt(U[t]):t==="transparent"?new _(NaN,NaN,NaN,0):null}function tt(t){return new _(t>>16&255,t>>8&255,t&255,1)}function M(t,i,e,n){return n<=0&&(t=i=e=NaN),new _(t,i,e,n)}function qt(t){return t instanceof N||(t=Y(t)),t?(t=t.rgb(),new _(t.r,t.g,t.b,t.opacity)):new _}function I(t,i,e,n){return arguments.length===1?qt(t):new _(t,i,e,n??1)}function _(t,i,e,n){this.r=+t,this.g=+i,this.b=+e,this.opacity=+n}X(_,I,ct(N,{brighter(t){return t=t==null?T:Math.pow(T,t),new _(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?$:Math.pow($,t),new _(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new _(m(this.r),m(this.g),m(this.b),E(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:it,formatHex:it,formatHex8:zt,formatRgb:et,toString:et}));function it(){return`#${g(this.r)}${g(this.g)}${g(this.b)}`}function zt(){return`#${g(this.r)}${g(this.g)}${g(this.b)}${g((isNaN(this.opacity)?1:this.opacity)*255)}`}function et(){const t=E(this.opacity);return`${t===1?"rgb(":"rgba("}${m(this.r)}, ${m(this.g)}, ${m(this.b)}${t===1?")":`, ${t})`}`}function E(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function m(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function g(t){return t=m(t),(t<16?"0":"")+t.toString(16)}function nt(t,i,e,n){return n<=0?t=i=e=NaN:e<=0||e>=1?t=i=NaN:i<=0&&(t=NaN),new x(t,i,e,n)}function lt(t){if(t instanceof x)return new x(t.h,t.s,t.l,t.opacity);if(t instanceof N||(t=Y(t)),!t)return new x;if(t instanceof x)return t;t=t.rgb();var i=t.r/255,e=t.g/255,n=t.b/255,s=Math.min(i,e,n),r=Math.max(i,e,n),o=NaN,h=r-s,a=(r+s)/2;return h?(i===r?o=(e-n)/h+(e<n)*6:e===r?o=(n-i)/h+2:o=(i-e)/h+4,h/=a<.5?r+s:2-r-s,o*=60):h=a>0&&a<1?0:o,new x(o,h,a,t.opacity)}function At(t,i,e,n){return arguments.length===1?lt(t):new x(t,i,e,n??1)}function x(t,i,e,n){this.h=+t,this.s=+i,this.l=+e,this.opacity=+n}X(x,At,ct(N,{brighter(t){return t=t==null?T:Math.pow(T,t),new x(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?$:Math.pow($,t),new x(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,i=isNaN(t)||isNaN(this.s)?0:this.s,e=this.l,n=e+(e<.5?e:1-e)*i,s=2*e-n;return new _(z(t>=240?t-240:t+120,s,n),z(t,s,n),z(t<120?t+240:t-120,s,n),this.opacity)},clamp(){return new x(st(this.h),k(this.s),k(this.l),E(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=E(this.opacity);return`${t===1?"hsl(":"hsla("}${st(this.h)}, ${k(this.s)*100}%, ${k(this.l)*100}%${t===1?")":`, ${t})`}`}}));function st(t){return t=(t||0)%360,t<0?t+360:t}function k(t){return Math.max(0,Math.min(1,t||0))}function z(t,i,e){return(t<60?i+(e-i)*t/60:t<180?e:t<240?i+(e-i)*(240-t)/60:i)*255}const G=t=>()=>t;function ut(t,i){return function(e){return t+e*i}}function Bt(t,i,e){return t=Math.pow(t,e),i=Math.pow(i,e)-t,e=1/e,function(n){return Math.pow(t+n*i,e)}}function Kt(t,i){var e=i-t;return e?ut(t,e>180||e<-180?e-360*Math.round(e/360):e):G(isNaN(t)?i:t)}function It(t){return(t=+t)==1?_t:function(i,e){return e-i?Bt(i,e,t):G(isNaN(i)?e:i)}}function _t(t,i){var e=i-t;return e?ut(t,e):G(isNaN(t)?i:t)}const Ut=(function t(i){var e=It(i);function n(s,r){var o=e((s=I(s)).r,(r=I(r)).r),h=e(s.g,r.g),a=e(s.b,r.b),f=_t(s.opacity,r.opacity);return function(c){return s.r=o(c),s.g=h(c),s.b=a(c),s.opacity=f(c),s+""}}return n.gamma=t,n})(1);function Lt(t,i){return t=+t,i=+i,function(e){return t*(1-e)+i*e}}var L=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,A=new RegExp(L.source,"g");function jt(t){return function(){return t}}function Ot(t){return function(i){return t(i)+""}}function Vt(t,i){var e=L.lastIndex=A.lastIndex=0,n,s,r,o=-1,h=[],a=[];for(t=t+"",i=i+"";(n=L.exec(t))&&(s=A.exec(i));)(r=s.index)>e&&(r=i.slice(e,r),h[o]?h[o]+=r:h[++o]=r),(n=n[0])===(s=s[0])?h[o]?h[o]+=s:h[++o]=s:(h[++o]=null,a.push({i:o,x:Lt(n,s)})),e=A.lastIndex;return e<i.length&&(r=i.slice(e),h[o]?h[o]+=r:h[++o]=r),h.length<2?a[0]?Ot(a[0].x):jt(i):(i=a.length,function(f){for(var c=0,l;c<i;++c)h[(l=a[c]).i]=l.x(f);return h.join("")})}const j=Math.PI,O=2*j,b=1e-6,Xt=O-b;function xt(t){this._+=t[0];for(let i=1,e=t.length;i<e;++i)this._+=arguments[i]+t[i]}function Yt(t){let i=Math.floor(t);if(!(i>=0))throw new Error(`invalid digits: ${t}`);if(i>15)return xt;const e=10**i;return function(n){this._+=n[0];for(let s=1,r=n.length;s<r;++s)this._+=Math.round(arguments[s]*e)/e+n[s]}}class Gt{constructor(i){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=i==null?xt:Yt(i)}moveTo(i,e){this._append`M${this._x0=this._x1=+i},${this._y0=this._y1=+e}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(i,e){this._append`L${this._x1=+i},${this._y1=+e}`}quadraticCurveTo(i,e,n,s){this._append`Q${+i},${+e},${this._x1=+n},${this._y1=+s}`}bezierCurveTo(i,e,n,s,r,o){this._append`C${+i},${+e},${+n},${+s},${this._x1=+r},${this._y1=+o}`}arcTo(i,e,n,s,r){if(i=+i,e=+e,n=+n,s=+s,r=+r,r<0)throw new Error(`negative radius: ${r}`);let o=this._x1,h=this._y1,a=n-i,f=s-e,c=o-i,l=h-e,u=c*c+l*l;if(this._x1===null)this._append`M${this._x1=i},${this._y1=e}`;else if(u>b)if(!(Math.abs(l*a-f*c)>b)||!r)this._append`L${this._x1=i},${this._y1=e}`;else{let d=n-o,H=s-h,Z=a*a+f*f,Nt=d*d+H*H,D=Math.sqrt(Z),F=Math.sqrt(u),J=r*Math.tan((j-Math.acos((Z+u-Nt)/(2*D*F)))/2),q=J/F,K=J/D;Math.abs(q-1)>b&&this._append`L${i+q*c},${e+q*l}`,this._append`A${r},${r},0,0,${+(l*d>c*H)},${this._x1=i+K*a},${this._y1=e+K*f}`}}arc(i,e,n,s,r,o){if(i=+i,e=+e,n=+n,o=!!o,n<0)throw new Error(`negative radius: ${n}`);let h=n*Math.cos(s),a=n*Math.sin(s),f=i+h,c=e+a,l=1^o,u=o?s-r:r-s;this._x1===null?this._append`M${f},${c}`:(Math.abs(this._x1-f)>b||Math.abs(this._y1-c)>b)&&this._append`L${f},${c}`,n&&(u<0&&(u=u%O+O),u>Xt?this._append`A${n},${n},0,1,${l},${i-h},${e-a}A${n},${n},0,1,${l},${this._x1=f},${this._y1=c}`:u>b&&this._append`A${n},${n},0,${+(u>=j)},${l},${this._x1=i+n*Math.cos(r)},${this._y1=e+n*Math.sin(r)}`)}rect(i,e,n,s){this._append`M${this._x0=this._x1=+i},${this._y0=this._y1=+e}h${n=+n}v${+s}h${-n}Z`}toString(){return this._}}function y(t){return function(){return t}}const Wt=Math.abs,ti=Math.atan2,ii=Math.cos,ei=Math.max,ni=Math.min,si=Math.sin,ri=Math.sqrt,oi=1e-12,Q=Math.PI,rt=Q/2,hi=2*Q;function ai(t){return t>1?0:t<-1?Q:Math.acos(t)}function fi(t){return t>=1?rt:t<=-1?-rt:Math.asin(t)}function Qt(t){let i=3;return t.digits=function(e){if(!arguments.length)return i;if(e==null)i=null;else{const n=Math.floor(e);if(!(n>=0))throw new RangeError(`invalid digits: ${e}`);i=n}return t},()=>new Gt(i)}function Zt(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function pt(t){this._context=t}pt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,i){switch(t=+t,i=+i,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,i):this._context.moveTo(t,i);break;case 1:this._point=2;default:this._context.lineTo(t,i);break}}};function Dt(t){return new pt(t)}function Ft(t){return t[0]}function Jt(t){return t[1]}function ci(t,i){var e=y(!0),n=null,s=Dt,r=null,o=Qt(h);t=typeof t=="function"?t:t===void 0?Ft:y(t),i=typeof i=="function"?i:i===void 0?Jt:y(i);function h(a){var f,c=(a=Zt(a)).length,l,u=!1,d;for(n==null&&(r=s(d=o())),f=0;f<=c;++f)!(f<c&&e(l=a[f],f,a))===u&&((u=!u)?r.lineStart():r.lineEnd()),u&&r.point(+t(l,f,a),+i(l,f,a));if(d)return r=null,d+""||null}return h.x=function(a){return arguments.length?(t=typeof a=="function"?a:y(+a),h):t},h.y=function(a){return arguments.length?(i=typeof a=="function"?a:y(+a),h):i},h.defined=function(a){return arguments.length?(e=typeof a=="function"?a:y(!!a),h):e},h.curve=function(a){return arguments.length?(s=a,n!=null&&(r=s(n)),h):s},h.context=function(a){return arguments.length?(a==null?n=r=null:r=s(n=a),h):n},h}class dt{constructor(i,e){this._context=i,this._x=e}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(i,e){switch(i=+i,e=+e,this._point){case 0:{this._point=1,this._line?this._context.lineTo(i,e):this._context.moveTo(i,e);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+i)/2,this._y0,this._x0,e,i,e):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+e)/2,i,this._y0,i,e);break}}this._x0=i,this._y0=e}}function li(t){return new dt(t,!0)}function ui(t){return new dt(t,!1)}function S(){}function P(t,i,e){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+i)/6,(t._y0+4*t._y1+e)/6)}function bt(t){this._context=t}bt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:P(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,i){switch(t=+t,i=+i,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,i):this._context.moveTo(t,i);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:P(this,t,i);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=i}};function _i(t){return new bt(t)}function gt(t){this._context=t}gt.prototype={areaStart:S,areaEnd:S,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(t,i){switch(t=+t,i=+i,this._point){case 0:this._point=1,this._x2=t,this._y2=i;break;case 1:this._point=2,this._x3=t,this._y3=i;break;case 2:this._point=3,this._x4=t,this._y4=i,this._context.moveTo((this._x0+4*this._x1+t)/6,(this._y0+4*this._y1+i)/6);break;default:P(this,t,i);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=i}};function xi(t){return new gt(t)}function mt(t){this._context=t}mt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(t,i){switch(t=+t,i=+i,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var e=(this._x0+4*this._x1+t)/6,n=(this._y0+4*this._y1+i)/6;this._line?this._context.lineTo(e,n):this._context.moveTo(e,n);break;case 3:this._point=4;default:P(this,t,i);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=i}};function pi(t){return new mt(t)}function yt(t){this._context=t}yt.prototype={areaStart:S,areaEnd:S,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(t,i){t=+t,i=+i,this._point?this._context.lineTo(t,i):(this._point=1,this._context.moveTo(t,i))}};function di(t){return new yt(t)}function ot(t){return t<0?-1:1}function ht(t,i,e){var n=t._x1-t._x0,s=i-t._x1,r=(t._y1-t._y0)/(n||s<0&&-0),o=(e-t._y1)/(s||n<0&&-0),h=(r*s+o*n)/(n+s);return(ot(r)+ot(o))*Math.min(Math.abs(r),Math.abs(o),.5*Math.abs(h))||0}function at(t,i){var e=t._x1-t._x0;return e?(3*(t._y1-t._y0)/e-i)/2:i}function B(t,i,e){var n=t._x0,s=t._y0,r=t._x1,o=t._y1,h=(r-n)/3;t._context.bezierCurveTo(n+h,s+h*i,r-h,o-h*e,r,o)}function R(t){this._context=t}R.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:B(this,this._t0,at(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,i){var e=NaN;if(t=+t,i=+i,!(t===this._x1&&i===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,i):this._context.moveTo(t,i);break;case 1:this._point=2;break;case 2:this._point=3,B(this,at(this,e=ht(this,t,i)),e);break;default:B(this,this._t0,e=ht(this,t,i));break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=i,this._t0=e}}};function wt(t){this._context=new $t(t)}(wt.prototype=Object.create(R.prototype)).point=function(t,i){R.prototype.point.call(this,i,t)};function $t(t){this._context=t}$t.prototype={moveTo:function(t,i){this._context.moveTo(i,t)},closePath:function(){this._context.closePath()},lineTo:function(t,i){this._context.lineTo(i,t)},bezierCurveTo:function(t,i,e,n,s,r){this._context.bezierCurveTo(i,t,n,e,r,s)}};function bi(t){return new R(t)}function gi(t){return new wt(t)}function vt(t){this._context=t}vt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var t=this._x,i=this._y,e=t.length;if(e)if(this._line?this._context.lineTo(t[0],i[0]):this._context.moveTo(t[0],i[0]),e===2)this._context.lineTo(t[1],i[1]);else for(var n=ft(t),s=ft(i),r=0,o=1;o<e;++r,++o)this._context.bezierCurveTo(n[0][r],s[0][r],n[1][r],s[1][r],t[o],i[o]);(this._line||this._line!==0&&e===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(t,i){this._x.push(+t),this._y.push(+i)}};function ft(t){var i,e=t.length-1,n,s=new Array(e),r=new Array(e),o=new Array(e);for(s[0]=0,r[0]=2,o[0]=t[0]+2*t[1],i=1;i<e-1;++i)s[i]=1,r[i]=4,o[i]=4*t[i]+2*t[i+1];for(s[e-1]=2,r[e-1]=7,o[e-1]=8*t[e-1]+t[e],i=1;i<e;++i)n=s[i]/r[i-1],r[i]-=n,o[i]-=n*o[i-1];for(s[e-1]=o[e-1]/r[e-1],i=e-2;i>=0;--i)s[i]=(o[i]-s[i+1])/r[i];for(r[e-1]=(t[e]+s[e-1])/2,i=0;i<e-1;++i)r[i]=2*t[i+1]-s[i+1];return[s,r]}function mi(t){return new vt(t)}function C(t,i){this._context=t,this._t=i}C.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,i){switch(t=+t,i=+i,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,i):this._context.moveTo(t,i);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,i),this._context.lineTo(t,i);else{var e=this._x*(1-this._t)+t*this._t;this._context.lineTo(e,this._y),this._context.lineTo(e,i)}break}}this._x=t,this._y=i}};function yi(t){return new C(t,.5)}function wi(t){return new C(t,0)}function $i(t){return new C(t,1)}export{Ut as A,Vt as B,N as C,bt as D,S as E,wi as F,$i as G,yi as H,mi as I,gi as J,bi as K,di as L,Dt as M,ui as N,li as O,pi as P,xi as Q,_ as R,Ft as S,Jt as T,ii as a,y as b,_i as c,ri as d,oi as e,Wt as f,ti as g,rt as h,ei as i,fi as j,ai as k,ci as l,ni as m,Zt as n,X as o,Q as p,ct as q,qt as r,si as s,hi as t,_t as u,Kt as v,Qt as w,G as x,Lt as y,Y as z};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as p,b as e}from"./index-CPnL1_qC.js";import{e as n}from"./error-CGD5mp5f.js";function w(r){const s=r.trim();if(/^\d+$/.test(s)){const a=Number.parseInt(s,10);return new Date(a).toISOString()}return new Date(s).toISOString()}const m=p((r,s)=>({tasks:[],logs:{},loading:!1,error:null,runningTaskIds:new Set,loadTasks:async()=>{r({loading:!0});try{const a=await e.get("/api/tasks");r({tasks:a.tasks,runningTaskIds:new Set(a.runningTaskIds||[]),loading:!1,error:null})}catch(a){r({loading:!1,error:n(a)})}},createTask:async(a,t,o,c,d,u,k)=>{try{const l=t==="once"?w(o):o.trim(),i={prompt:a.trim(),schedule_type:t,schedule_value:l};c&&(i.execution_type=c),d&&(i.execution_mode=d),u&&(i.script_command=u),k!==void 0&&(i.notify_channels=k),await e.post("/api/tasks",i),r({error:null}),await s().loadTasks()}catch(l){r({error:n(l)})}},updateTaskStatus:async(a,t)=>{try{await e.patch(`/api/tasks/${a}`,{status:t}),r({error:null}),await s().loadTasks()}catch(o){r({error:n(o)})}},updateTask:async(a,t)=>{try{await e.patch(`/api/tasks/${a}`,t),r({error:null}),await s().loadTasks()}catch(o){r({error:n(o)})}},deleteTask:async a=>{try{await e.delete(`/api/tasks/${a}`),r({error:null}),await s().loadTasks()}catch(t){r({error:n(t)})}},loadLogs:async a=>{try{const t=await e.get(`/api/tasks/${a}/logs`);r(o=>({logs:{...o.logs,[a]:t.logs},error:null}))}catch(t){r({error:n(t)})}},runTaskNow:async a=>{try{await e.post(`/api/tasks/${a}/run`),r({error:null}),await s().loadTasks()}catch(t){r({error:n(t)})}}}));export{m as useTasksStore};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as un,t as Te,c as on,a as an}from"./linear-DiaJloY5.js";import{i as cn}from"./init-Dmth1JHB.js";function Yt(e,n){let t;if(n===void 0)for(const r of e)r!=null&&(t<r||t===void 0&&r>=r)&&(t=r);else{let r=-1;for(let c of e)(c=n(c,++r,e))!=null&&(t<c||t===void 0&&c>=c)&&(t=c)}return t}function xt(e,n){let t;if(n===void 0)for(const r of e)r!=null&&(t>r||t===void 0&&r>=r)&&(t=r);else{let r=-1;for(let c of e)(c=n(c,++r,e))!=null&&(t>c||t===void 0&&c>=c)&&(t=c)}return t}function sn(e,n){e=e.slice();var t=0,r=e.length-1,c=e[t],o=e[r],i;return o<c&&(i=t,t=r,r=i,i=c,c=o,o=i),e[t]=n.floor(c),e[r]=n.ceil(o),e}const re=new Date,ue=new Date;function M(e,n,t,r){function c(o){return e(o=arguments.length===0?new Date:new Date(+o)),o}return c.floor=o=>(e(o=new Date(+o)),o),c.ceil=o=>(e(o=new Date(o-1)),n(o,1),e(o),o),c.round=o=>{const i=c(o),y=c.ceil(o);return o-i<y-o?i:y},c.offset=(o,i)=>(n(o=new Date(+o),i==null?1:Math.floor(i)),o),c.range=(o,i,y)=>{const C=[];if(o=c.ceil(o),y=y==null?1:Math.floor(y),!(o<i)||!(y>0))return C;let h;do C.push(h=new Date(+o)),n(o,y),e(o);while(h<o&&o<i);return C},c.filter=o=>M(i=>{if(i>=i)for(;e(i),!o(i);)i.setTime(i-1)},(i,y)=>{if(i>=i)if(y<0)for(;++y<=0;)for(;n(i,-1),!o(i););else for(;--y>=0;)for(;n(i,1),!o(i););}),t&&(c.count=(o,i)=>(re.setTime(+o),ue.setTime(+i),e(re),e(ue),Math.floor(t(re,ue))),c.every=o=>(o=Math.floor(o),!isFinite(o)||!(o>0)?null:o>1?c.filter(r?i=>r(i)%o===0:i=>c.count(0,i)%o===0):c)),c}const G=M(()=>{},(e,n)=>{e.setTime(+e+n)},(e,n)=>n-e);G.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?M(n=>{n.setTime(Math.floor(n/e)*e)},(n,t)=>{n.setTime(+n+t*e)},(n,t)=>(t-n)/e):G);G.range;const b=1e3,x=b*60,L=x*60,k=L*24,ie=k*7,ye=k*30,oe=k*365,q=M(e=>{e.setTime(e-e.getMilliseconds())},(e,n)=>{e.setTime(+e+n*b)},(e,n)=>(n-e)/b,e=>e.getUTCSeconds());q.range;const se=M(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*b)},(e,n)=>{e.setTime(+e+n*x)},(e,n)=>(n-e)/x,e=>e.getMinutes());se.range;const xe=M(e=>{e.setUTCSeconds(0,0)},(e,n)=>{e.setTime(+e+n*x)},(e,n)=>(n-e)/x,e=>e.getUTCMinutes());xe.range;const fe=M(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*b-e.getMinutes()*x)},(e,n)=>{e.setTime(+e+n*L)},(e,n)=>(n-e)/L,e=>e.getHours());fe.range;const He=M(e=>{e.setUTCMinutes(0,0,0)},(e,n)=>{e.setTime(+e+n*L)},(e,n)=>(n-e)/L,e=>e.getUTCHours());He.range;const B=M(e=>e.setHours(0,0,0,0),(e,n)=>e.setDate(e.getDate()+n),(e,n)=>(n-e-(n.getTimezoneOffset()-e.getTimezoneOffset())*x)/k,e=>e.getDate()-1);B.range;const le=M(e=>{e.setUTCHours(0,0,0,0)},(e,n)=>{e.setUTCDate(e.getUTCDate()+n)},(e,n)=>(n-e)/k,e=>e.getUTCDate()-1);le.range;const We=M(e=>{e.setUTCHours(0,0,0,0)},(e,n)=>{e.setUTCDate(e.getUTCDate()+n)},(e,n)=>(n-e)/k,e=>Math.floor(e/k));We.range;function Z(e){return M(n=>{n.setDate(n.getDate()-(n.getDay()+7-e)%7),n.setHours(0,0,0,0)},(n,t)=>{n.setDate(n.getDate()+t*7)},(n,t)=>(t-n-(t.getTimezoneOffset()-n.getTimezoneOffset())*x)/ie)}const K=Z(0),$=Z(1),fn=Z(2),ln=Z(3),P=Z(4),gn=Z(5),mn=Z(6);K.range;$.range;fn.range;ln.range;P.range;gn.range;mn.range;function d(e){return M(n=>{n.setUTCDate(n.getUTCDate()-(n.getUTCDay()+7-e)%7),n.setUTCHours(0,0,0,0)},(n,t)=>{n.setUTCDate(n.getUTCDate()+t*7)},(n,t)=>(t-n)/ie)}const ge=d(0),E=d(1),hn=d(2),Tn=d(3),Q=d(4),yn=d(5),Mn=d(6);ge.range;E.range;hn.range;Tn.range;Q.range;yn.range;Mn.range;const me=M(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,n)=>{e.setMonth(e.getMonth()+n)},(e,n)=>n.getMonth()-e.getMonth()+(n.getFullYear()-e.getFullYear())*12,e=>e.getMonth());me.range;const be=M(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,n)=>{e.setUTCMonth(e.getUTCMonth()+n)},(e,n)=>n.getUTCMonth()-e.getUTCMonth()+(n.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth());be.range;const O=M(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,n)=>{e.setFullYear(e.getFullYear()+n)},(e,n)=>n.getFullYear()-e.getFullYear(),e=>e.getFullYear());O.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:M(n=>{n.setFullYear(Math.floor(n.getFullYear()/e)*e),n.setMonth(0,1),n.setHours(0,0,0,0)},(n,t)=>{n.setFullYear(n.getFullYear()+t*e)});O.range;const I=M(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,n)=>{e.setUTCFullYear(e.getUTCFullYear()+n)},(e,n)=>n.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());I.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:M(n=>{n.setUTCFullYear(Math.floor(n.getUTCFullYear()/e)*e),n.setUTCMonth(0,1),n.setUTCHours(0,0,0,0)},(n,t)=>{n.setUTCFullYear(n.getUTCFullYear()+t*e)});I.range;function Le(e,n,t,r,c,o){const i=[[q,1,b],[q,5,5*b],[q,15,15*b],[q,30,30*b],[o,1,x],[o,5,5*x],[o,15,15*x],[o,30,30*x],[c,1,L],[c,3,3*L],[c,6,6*L],[c,12,12*L],[r,1,k],[r,2,2*k],[t,1,ie],[n,1,ye],[n,3,3*ye],[e,1,oe]];function y(h,T,Y){const D=T<h;D&&([h,T]=[T,h]);const w=Y&&typeof Y.range=="function"?Y:C(h,T,Y),N=w?w.range(h,+T+1):[];return D?N.reverse():N}function C(h,T,Y){const D=Math.abs(T-h)/Y,w=un(([,,_])=>_).right(i,D);if(w===i.length)return e.every(Te(h/oe,T/oe,Y));if(w===0)return G.every(Math.max(Te(h,T,Y),1));const[N,V]=i[D/i[w-1][2]<i[w][2]/D?w-1:w];return N.every(V)}return[y,C]}const[Ht,Wt]=Le(I,be,ge,We,He,xe),[Un,Cn]=Le(O,me,K,B,fe,se);function ae(e){if(0<=e.y&&e.y<100){var n=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return n.setFullYear(e.y),n}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function ce(e){if(0<=e.y&&e.y<100){var n=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return n.setUTCFullYear(e.y),n}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function z(e,n,t){return{y:e,m:n,d:t,H:0,M:0,S:0,L:0}}function Dn(e){var n=e.dateTime,t=e.date,r=e.time,c=e.periods,o=e.days,i=e.shortDays,y=e.months,C=e.shortMonths,h=J(c),T=X(c),Y=J(o),D=X(o),w=J(i),N=X(i),V=J(y),_=X(y),ee=J(C),ne=X(C),H={a:Je,A:Xe,b:Be,B:je,c:null,d:Se,e:Se,f:Vn,g:Kn,G:nt,H:qn,I:Pn,j:Qn,L:ke,m:_n,M:zn,p:Ge,q:$e,Q:Fe,s:Ye,S:Jn,u:Xn,U:Bn,V:jn,w:Gn,W:$n,x:null,X:null,y:En,Y:et,Z:tt,"%":pe},W={a:Ee,A:Ke,b:en,B:nn,c:null,d:we,e:we,f:at,g:yt,G:Ut,H:rt,I:ut,j:ot,L:Ne,m:ct,M:it,p:tn,q:rn,Q:Fe,s:Ye,S:st,u:ft,U:lt,V:gt,w:mt,W:ht,x:null,X:null,y:Tt,Y:Mt,Z:Ct,"%":pe},te={a:Re,A:qe,b:Pe,B:Qe,c:Ve,d:De,e:De,f:An,g:Ce,G:Ue,H:ve,I:ve,j:kn,L:In,m:Ln,M:On,p:de,q:bn,Q:dn,s:Rn,S:Nn,u:Fn,U:Yn,V:xn,w:pn,W:Hn,x:_e,X:ze,y:Ce,Y:Ue,Z:Wn,"%":Zn};H.x=s(t,H),H.X=s(r,H),H.c=s(n,H),W.x=s(t,W),W.X=s(r,W),W.c=s(n,W);function s(a,f){return function(l){var u=[],S=-1,m=0,p=a.length,F,A,he;for(l instanceof Date||(l=new Date(+l));++S<p;)a.charCodeAt(S)===37&&(u.push(a.slice(m,S)),(A=Me[F=a.charAt(++S)])!=null?F=a.charAt(++S):A=F==="e"?" ":"0",(he=f[F])&&(F=he(l,A)),u.push(F),m=S+1);return u.push(a.slice(m,S)),u.join("")}}function v(a,f){return function(l){var u=z(1900,void 0,1),S=j(u,a,l+="",0),m,p;if(S!=l.length)return null;if("Q"in u)return new Date(u.Q);if("s"in u)return new Date(u.s*1e3+("L"in u?u.L:0));if(f&&!("Z"in u)&&(u.Z=0),"p"in u&&(u.H=u.H%12+u.p*12),u.m===void 0&&(u.m="q"in u?u.q:0),"V"in u){if(u.V<1||u.V>53)return null;"w"in u||(u.w=1),"Z"in u?(m=ce(z(u.y,0,1)),p=m.getUTCDay(),m=p>4||p===0?E.ceil(m):E(m),m=le.offset(m,(u.V-1)*7),u.y=m.getUTCFullYear(),u.m=m.getUTCMonth(),u.d=m.getUTCDate()+(u.w+6)%7):(m=ae(z(u.y,0,1)),p=m.getDay(),m=p>4||p===0?$.ceil(m):$(m),m=B.offset(m,(u.V-1)*7),u.y=m.getFullYear(),u.m=m.getMonth(),u.d=m.getDate()+(u.w+6)%7)}else("W"in u||"U"in u)&&("w"in u||(u.w="u"in u?u.u%7:"W"in u?1:0),p="Z"in u?ce(z(u.y,0,1)).getUTCDay():ae(z(u.y,0,1)).getDay(),u.m=0,u.d="W"in u?(u.w+6)%7+u.W*7-(p+5)%7:u.w+u.U*7-(p+6)%7);return"Z"in u?(u.H+=u.Z/100|0,u.M+=u.Z%100,ce(u)):ae(u)}}function j(a,f,l,u){for(var S=0,m=f.length,p=l.length,F,A;S<m;){if(u>=p)return-1;if(F=f.charCodeAt(S++),F===37){if(F=f.charAt(S++),A=te[F in Me?f.charAt(S++):F],!A||(u=A(a,l,u))<0)return-1}else if(F!=l.charCodeAt(u++))return-1}return u}function de(a,f,l){var u=h.exec(f.slice(l));return u?(a.p=T.get(u[0].toLowerCase()),l+u[0].length):-1}function Re(a,f,l){var u=w.exec(f.slice(l));return u?(a.w=N.get(u[0].toLowerCase()),l+u[0].length):-1}function qe(a,f,l){var u=Y.exec(f.slice(l));return u?(a.w=D.get(u[0].toLowerCase()),l+u[0].length):-1}function Pe(a,f,l){var u=ee.exec(f.slice(l));return u?(a.m=ne.get(u[0].toLowerCase()),l+u[0].length):-1}function Qe(a,f,l){var u=V.exec(f.slice(l));return u?(a.m=_.get(u[0].toLowerCase()),l+u[0].length):-1}function Ve(a,f,l){return j(a,n,f,l)}function _e(a,f,l){return j(a,t,f,l)}function ze(a,f,l){return j(a,r,f,l)}function Je(a){return i[a.getDay()]}function Xe(a){return o[a.getDay()]}function Be(a){return C[a.getMonth()]}function je(a){return y[a.getMonth()]}function Ge(a){return c[+(a.getHours()>=12)]}function $e(a){return 1+~~(a.getMonth()/3)}function Ee(a){return i[a.getUTCDay()]}function Ke(a){return o[a.getUTCDay()]}function en(a){return C[a.getUTCMonth()]}function nn(a){return y[a.getUTCMonth()]}function tn(a){return c[+(a.getUTCHours()>=12)]}function rn(a){return 1+~~(a.getUTCMonth()/3)}return{format:function(a){var f=s(a+="",H);return f.toString=function(){return a},f},parse:function(a){var f=v(a+="",!1);return f.toString=function(){return a},f},utcFormat:function(a){var f=s(a+="",W);return f.toString=function(){return a},f},utcParse:function(a){var f=v(a+="",!0);return f.toString=function(){return a},f}}}var Me={"-":"",_:" ",0:"0"},U=/^\s*\d+/,vn=/^%/,Sn=/[\\^$*+?|[\]().{}]/g;function g(e,n,t){var r=e<0?"-":"",c=(r?-e:e)+"",o=c.length;return r+(o<t?new Array(t-o+1).join(n)+c:c)}function wn(e){return e.replace(Sn,"\\$&")}function J(e){return new RegExp("^(?:"+e.map(wn).join("|")+")","i")}function X(e){return new Map(e.map((n,t)=>[n.toLowerCase(),t]))}function pn(e,n,t){var r=U.exec(n.slice(t,t+1));return r?(e.w=+r[0],t+r[0].length):-1}function Fn(e,n,t){var r=U.exec(n.slice(t,t+1));return r?(e.u=+r[0],t+r[0].length):-1}function Yn(e,n,t){var r=U.exec(n.slice(t,t+2));return r?(e.U=+r[0],t+r[0].length):-1}function xn(e,n,t){var r=U.exec(n.slice(t,t+2));return r?(e.V=+r[0],t+r[0].length):-1}function Hn(e,n,t){var r=U.exec(n.slice(t,t+2));return r?(e.W=+r[0],t+r[0].length):-1}function Ue(e,n,t){var r=U.exec(n.slice(t,t+4));return r?(e.y=+r[0],t+r[0].length):-1}function Ce(e,n,t){var r=U.exec(n.slice(t,t+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),t+r[0].length):-1}function Wn(e,n,t){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(n.slice(t,t+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||"00")),t+r[0].length):-1}function bn(e,n,t){var r=U.exec(n.slice(t,t+1));return r?(e.q=r[0]*3-3,t+r[0].length):-1}function Ln(e,n,t){var r=U.exec(n.slice(t,t+2));return r?(e.m=r[0]-1,t+r[0].length):-1}function De(e,n,t){var r=U.exec(n.slice(t,t+2));return r?(e.d=+r[0],t+r[0].length):-1}function kn(e,n,t){var r=U.exec(n.slice(t,t+3));return r?(e.m=0,e.d=+r[0],t+r[0].length):-1}function ve(e,n,t){var r=U.exec(n.slice(t,t+2));return r?(e.H=+r[0],t+r[0].length):-1}function On(e,n,t){var r=U.exec(n.slice(t,t+2));return r?(e.M=+r[0],t+r[0].length):-1}function Nn(e,n,t){var r=U.exec(n.slice(t,t+2));return r?(e.S=+r[0],t+r[0].length):-1}function In(e,n,t){var r=U.exec(n.slice(t,t+3));return r?(e.L=+r[0],t+r[0].length):-1}function An(e,n,t){var r=U.exec(n.slice(t,t+6));return r?(e.L=Math.floor(r[0]/1e3),t+r[0].length):-1}function Zn(e,n,t){var r=vn.exec(n.slice(t,t+1));return r?t+r[0].length:-1}function dn(e,n,t){var r=U.exec(n.slice(t));return r?(e.Q=+r[0],t+r[0].length):-1}function Rn(e,n,t){var r=U.exec(n.slice(t));return r?(e.s=+r[0],t+r[0].length):-1}function Se(e,n){return g(e.getDate(),n,2)}function qn(e,n){return g(e.getHours(),n,2)}function Pn(e,n){return g(e.getHours()%12||12,n,2)}function Qn(e,n){return g(1+B.count(O(e),e),n,3)}function ke(e,n){return g(e.getMilliseconds(),n,3)}function Vn(e,n){return ke(e,n)+"000"}function _n(e,n){return g(e.getMonth()+1,n,2)}function zn(e,n){return g(e.getMinutes(),n,2)}function Jn(e,n){return g(e.getSeconds(),n,2)}function Xn(e){var n=e.getDay();return n===0?7:n}function Bn(e,n){return g(K.count(O(e)-1,e),n,2)}function Oe(e){var n=e.getDay();return n>=4||n===0?P(e):P.ceil(e)}function jn(e,n){return e=Oe(e),g(P.count(O(e),e)+(O(e).getDay()===4),n,2)}function Gn(e){return e.getDay()}function $n(e,n){return g($.count(O(e)-1,e),n,2)}function En(e,n){return g(e.getFullYear()%100,n,2)}function Kn(e,n){return e=Oe(e),g(e.getFullYear()%100,n,2)}function et(e,n){return g(e.getFullYear()%1e4,n,4)}function nt(e,n){var t=e.getDay();return e=t>=4||t===0?P(e):P.ceil(e),g(e.getFullYear()%1e4,n,4)}function tt(e){var n=e.getTimezoneOffset();return(n>0?"-":(n*=-1,"+"))+g(n/60|0,"0",2)+g(n%60,"0",2)}function we(e,n){return g(e.getUTCDate(),n,2)}function rt(e,n){return g(e.getUTCHours(),n,2)}function ut(e,n){return g(e.getUTCHours()%12||12,n,2)}function ot(e,n){return g(1+le.count(I(e),e),n,3)}function Ne(e,n){return g(e.getUTCMilliseconds(),n,3)}function at(e,n){return Ne(e,n)+"000"}function ct(e,n){return g(e.getUTCMonth()+1,n,2)}function it(e,n){return g(e.getUTCMinutes(),n,2)}function st(e,n){return g(e.getUTCSeconds(),n,2)}function ft(e){var n=e.getUTCDay();return n===0?7:n}function lt(e,n){return g(ge.count(I(e)-1,e),n,2)}function Ie(e){var n=e.getUTCDay();return n>=4||n===0?Q(e):Q.ceil(e)}function gt(e,n){return e=Ie(e),g(Q.count(I(e),e)+(I(e).getUTCDay()===4),n,2)}function mt(e){return e.getUTCDay()}function ht(e,n){return g(E.count(I(e)-1,e),n,2)}function Tt(e,n){return g(e.getUTCFullYear()%100,n,2)}function yt(e,n){return e=Ie(e),g(e.getUTCFullYear()%100,n,2)}function Mt(e,n){return g(e.getUTCFullYear()%1e4,n,4)}function Ut(e,n){var t=e.getUTCDay();return e=t>=4||t===0?Q(e):Q.ceil(e),g(e.getUTCFullYear()%1e4,n,4)}function Ct(){return"+0000"}function pe(){return"%"}function Fe(e){return+e}function Ye(e){return Math.floor(+e/1e3)}var R,Ae,Dt;vt({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function vt(e){return R=Dn(e),Ae=R.format,R.parse,Dt=R.utcFormat,R.utcParse,R}function St(e){return new Date(e)}function wt(e){return e instanceof Date?+e:+new Date(+e)}function Ze(e,n,t,r,c,o,i,y,C,h){var T=on(),Y=T.invert,D=T.domain,w=h(".%L"),N=h(":%S"),V=h("%I:%M"),_=h("%I %p"),ee=h("%a %d"),ne=h("%b %d"),H=h("%B"),W=h("%Y");function te(s){return(C(s)<s?w:y(s)<s?N:i(s)<s?V:o(s)<s?_:r(s)<s?c(s)<s?ee:ne:t(s)<s?H:W)(s)}return T.invert=function(s){return new Date(Y(s))},T.domain=function(s){return arguments.length?D(Array.from(s,wt)):D().map(St)},T.ticks=function(s){var v=D();return e(v[0],v[v.length-1],s??10)},T.tickFormat=function(s,v){return v==null?te:h(v)},T.nice=function(s){var v=D();return(!s||typeof s.range!="function")&&(s=n(v[0],v[v.length-1],s??10)),s?D(sn(v,s)):T},T.copy=function(){return an(T,Ze(e,n,t,r,c,o,i,y,C,h))},T}function bt(){return cn.apply(Ze(Un,Cn,O,me,K,B,fe,se,q,Ae).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}export{Wt as A,Ht as B,Yt as a,Ae as b,me as c,K as d,mn as e,gn as f,P as g,ln as h,fn as i,$ as j,B as k,fe as l,xt as m,se as n,G as o,sn as p,Ze as q,xe as r,q as s,bt as t,Dt as u,He as v,le as w,ge as x,be as y,I as z};
|