@xopcai/xopc 0.0.143 → 0.0.144

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (178) hide show
  1. package/dist/browser-ext/manifest.json +1 -1
  2. package/dist/extensions/feishu/src/workflow-progress.js +1 -1
  3. package/dist/extensions/telegram/src/adapters/streaming-adapter.js +1 -1
  4. package/dist/extensions/telegram/src/inbound-processor.js +1 -1
  5. package/dist/extensions/telegram/src/plugin.js +1 -1
  6. package/dist/extensions/telegram/src/routing-integration.js +2 -2
  7. package/dist/extensions/telegram/src/workflow-progress.js +1 -1
  8. package/dist/extensions/telegram/xopc.extension.json +1 -1
  9. package/dist/extensions/weixin/src/api/api.js +1 -1
  10. package/dist/extensions/weixin/src/plugin.js +1 -1
  11. package/dist/extensions/weixin/src/workflow-progress.js +1 -1
  12. package/dist/gateway/static/root/assets/{agent-avatar-dicebear-DiME9u_P.js → agent-avatar-dicebear-EAVnrCAs.js} +1 -1
  13. package/dist/gateway/static/root/assets/{agents-DzBXhZXO.js → agents-5rTuJOtT.js} +1 -1
  14. package/dist/gateway/static/root/assets/{app-management-settings-panel-Cuo7SbUP.js → app-management-settings-panel-Bu568NpC.js} +1 -1
  15. package/dist/gateway/static/root/assets/{appearance-settings-DUfdNQqk.js → appearance-settings-DSkm9bp_.js} +1 -1
  16. package/dist/gateway/static/root/assets/{apps-page-CKuKK5AU.js → apps-page-DWetalKp.js} +1 -1
  17. package/dist/gateway/static/root/assets/{archive-plugin-B-Qk6cGr.js → archive-plugin-C99N0vV6.js} +1 -1
  18. package/dist/gateway/static/root/assets/{attachment-load-Di6EEbQX.js → attachment-load-CHTDqME5.js} +1 -1
  19. package/dist/gateway/static/root/assets/{automation-suggestion-card-DGxvRxtO.js → automation-suggestion-card-CBt6U3-S.js} +1 -1
  20. package/dist/gateway/static/root/assets/{automations-page-D-FF_WKV.js → automations-page-ICUfxeOz.js} +1 -1
  21. package/dist/gateway/static/root/assets/{binary-plugins-ZaOZDH2I.js → binary-plugins-BRtxOLlM.js} +1 -1
  22. package/dist/gateway/static/root/assets/{block-editor-BTFhjWfg.js → block-editor-CUlXfgXd.js} +1 -1
  23. package/dist/gateway/static/root/assets/{browser-settings-page-BvKLdEQt.js → browser-settings-page-D7Bj4MKi.js} +1 -1
  24. package/dist/gateway/static/root/assets/{capability-presets-api-BU-pVZiZ.js → capability-presets-api-Bg1ntFSD.js} +1 -1
  25. package/dist/gateway/static/root/assets/{capability-presets-settings-panel-DgyeEwzh.js → capability-presets-settings-panel-C-8I-Ktn.js} +1 -1
  26. package/dist/gateway/static/root/assets/{channels-settings-BbVsdD_I.js → channels-settings-Dm5EqQyK.js} +1 -1
  27. package/dist/gateway/static/root/assets/{connectors-page-B8QqVy3I.js → connectors-page-BOzjh-OK.js} +1 -1
  28. package/dist/gateway/static/root/assets/{desktop-pet---yzVxVR.js → desktop-pet-C-Drhqyk.js} +1 -1
  29. package/dist/gateway/static/root/assets/{desktop-pet-settings-Dc3gqBJE.js → desktop-pet-settings-CRGiolqF.js} +1 -1
  30. package/dist/gateway/static/root/assets/{directory-picker-path-field-DCmOGLtK.js → directory-picker-path-field-Dw1L3M84.js} +1 -1
  31. package/dist/gateway/static/root/assets/dist-SwiI0Xu3.js +1 -0
  32. package/dist/gateway/static/root/assets/{dreaming-settings-BgT5KZVe.js → dreaming-settings-CF21cbjo.js} +1 -1
  33. package/dist/gateway/static/root/assets/{extension-debug-page-ByaKTTq4.js → extension-debug-page-Dcl8LJG_.js} +1 -1
  34. package/dist/gateway/static/root/assets/{extension-page-BmRzHAZr.js → extension-page-i_BXmO_x.js} +1 -1
  35. package/dist/gateway/static/root/assets/{extension-settings-page-JUtwIhbF.js → extension-settings-page-CWIi7xsn.js} +1 -1
  36. package/dist/gateway/static/root/assets/{gateway-config-api-CxicF50_.js → gateway-config-api-2sLP2kkA.js} +1 -1
  37. package/dist/gateway/static/root/assets/{gateway-settings-Bz2I_EO5.js → gateway-settings-DMHiZc-2.js} +1 -1
  38. package/dist/gateway/static/root/assets/{goal-create-dialog-VcoyuZGN.js → goal-create-dialog-CAODVDiA.js} +1 -1
  39. package/dist/gateway/static/root/assets/{goal-detail-page-Cilkap2G.js → goal-detail-page-_d4DjmeX.js} +1 -1
  40. package/dist/gateway/static/root/assets/{goals-config-api-CwcHRdC0.js → goals-config-api-B4qeLKQS.js} +1 -1
  41. package/dist/gateway/static/root/assets/{goals-page-C6eoni4z.js → goals-page-lgsop664.js} +1 -1
  42. package/dist/gateway/static/root/assets/{goals-settings-o4i-qAOS.js → goals-settings-Dx_1ZNgb.js} +1 -1
  43. package/dist/gateway/static/root/assets/{heartbeat-settings-DQQkETX8.js → heartbeat-settings-DeTseEk_.js} +1 -1
  44. package/dist/gateway/static/root/assets/{index-BKRqeRHm.js → index-VWvztcst.js} +7 -7
  45. package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-LT6qB-ua.js → keyboard-shortcuts-settings-BpwpMmlk.js} +1 -1
  46. package/dist/gateway/static/root/assets/{logs-page-Dli2e3fS.js → logs-page-9_hbTg3j.js} +1 -1
  47. package/dist/gateway/static/root/assets/{markdown-split-Dw-yE2-y.js → markdown-split-BTRFTK0w.js} +1 -1
  48. package/dist/gateway/static/root/assets/{media-plugins-D9NNNUgE.js → media-plugins-BABfIZPU.js} +1 -1
  49. package/dist/gateway/static/root/assets/{models-hub-panel-DVn2Q1Ik.js → models-hub-panel-B1CUvZxh.js} +1 -1
  50. package/dist/gateway/static/root/assets/{notes-page-CRgbJGgk.js → notes-page-88QBHW9a.js} +1 -1
  51. package/dist/gateway/static/root/assets/{notes-workbench-BxZRHLWx.js → notes-workbench-CerZOeLW.js} +2 -2
  52. package/dist/gateway/static/root/assets/{page-tabs-D4hkWVt_.js → page-tabs-je95DZOf.js} +1 -1
  53. package/dist/gateway/static/root/assets/{preview-open-alternatives-CIckv0uy.js → preview-open-alternatives-BJbwi7Rc.js} +1 -1
  54. package/dist/gateway/static/root/assets/{project-detail-page-Doz53xLn.js → project-detail-page-BmrApldl.js} +1 -1
  55. package/dist/gateway/static/root/assets/{projects-page-DoMtcRLg.js → projects-page-tTn-k76N.js} +1 -1
  56. package/dist/gateway/static/root/assets/{remote-access-hub-BeHVEgrm.js → remote-access-hub-DeA2-pOi.js} +1 -1
  57. package/dist/gateway/static/root/assets/{save-bar-controls-B0b42kB2.js → save-bar-controls-qWMQ9mod.js} +1 -1
  58. package/dist/gateway/static/root/assets/{schedule-field-BtjEkczK.js → schedule-field-kxd270Gs.js} +1 -1
  59. package/dist/gateway/static/root/assets/{schema-form-Bf0bk3i6.js → schema-form-DLnD-MuD.js} +1 -1
  60. package/dist/gateway/static/root/assets/{sessions-page-Bk4bQsBe.js → sessions-page-D4kvvcL1.js} +1 -1
  61. package/dist/gateway/static/root/assets/settings-advanced-gate-CI1OG4gq.js +1 -0
  62. package/dist/gateway/static/root/assets/{settings-collapsible-section-BTKTdTNX.js → settings-collapsible-section-DQprvu5J.js} +1 -1
  63. package/dist/gateway/static/root/assets/{settings-form-section-DL4P0sAj.js → settings-form-section-Cqq7Y98y.js} +1 -1
  64. package/dist/gateway/static/root/assets/{settings-loading-skeleton-BV6KFNj4.js → settings-loading-skeleton-b6rXULL5.js} +1 -1
  65. package/dist/gateway/static/root/assets/{settings-page-B_4DsX5W.js → settings-page-BtBVz3cX.js} +1 -1
  66. package/dist/gateway/static/root/assets/{settings-page-layout-CyGlrInB.js → settings-page-layout-BNJbtklV.js} +1 -1
  67. package/dist/gateway/static/root/assets/{setup-status-panel-DJ1_MLgX.js → setup-status-panel-cmclUJzS.js} +1 -1
  68. package/dist/gateway/static/root/assets/{share-preview-page-BQBV7YrV.js → share-preview-page--zO-A1W1.js} +1 -1
  69. package/dist/gateway/static/root/assets/{shares-settings-0VuFLBeU.js → shares-settings-DNJvqA67.js} +1 -1
  70. package/dist/gateway/static/root/assets/skill-reload-api-DWr_0Xgn.js +1 -0
  71. package/dist/gateway/static/root/assets/{skills-page-D3VdtxAn.js → skills-page-DEGsTbJx.js} +1 -1
  72. package/dist/gateway/static/root/assets/{system-settings-panel-D85fBBuI.js → system-settings-panel-Cq9J7i7v.js} +1 -1
  73. package/dist/gateway/static/root/assets/{typed-models-lib-CwEuYrHX.js → typed-models-lib-CdSwi1gT.js} +1 -1
  74. package/dist/gateway/static/root/assets/{user-context-page-m9JVQ73F.js → user-context-page-C-V73ZaJ.js} +1 -1
  75. package/dist/gateway/static/root/assets/{user-profile-fields-editor-DtQiuY7E.js → user-profile-fields-editor-B1cxoGkh.js} +1 -1
  76. package/dist/gateway/static/root/assets/{user-profile-settings-panel-CWM0fEpb.js → user-profile-settings-panel-B8hlamVB.js} +1 -1
  77. package/dist/gateway/static/root/assets/{utils--BO6xT3u.js → utils-Dx01V8qF.js} +1 -1
  78. package/dist/gateway/static/root/assets/{voice-api-key-field-LoT3wgZ9.js → voice-api-key-field-DGpIUelZ.js} +1 -1
  79. package/dist/gateway/static/root/assets/{work-item-detail-page-DSTMz_mO.js → work-item-detail-page-fzWTxF26.js} +1 -1
  80. package/dist/gateway/static/root/assets/{workflow-run-setup-panel-B35lJzvm.js → workflow-run-setup-panel-Dt_x8LGg.js} +1 -1
  81. package/dist/gateway/static/root/assets/{workflows-page-BfSm9oR8.js → workflows-page-Bg02zEUh.js} +1 -1
  82. package/dist/gateway/static/root/index.html +2 -2
  83. package/dist/package.js +1 -1
  84. package/dist/src/activity/emitter.js +1 -1
  85. package/dist/src/agent/agent-manager.js +4 -4
  86. package/dist/src/agent/code-intelligence/binary.js +1 -1
  87. package/dist/src/agent/context/project-context.js +2 -2
  88. package/dist/src/agent/context/workspace-seed.js +2 -2
  89. package/dist/src/agent/embedded/run-for-session.js +1 -1
  90. package/dist/src/agent/goals/post-turn.js +2 -2
  91. package/dist/src/agent/ipc/bus.js +1 -1
  92. package/dist/src/agent/mcp/bundle-mcp-materialize.js +1 -1
  93. package/dist/src/agent/mcp/bundle-mcp-runtime.js +1 -1
  94. package/dist/src/agent/mcp/mcp-transport-config.js +1 -1
  95. package/dist/src/agent/mcp/mcp-transport.js +1 -1
  96. package/dist/src/agent/memory/plugin-discovery.js +1 -1
  97. package/dist/src/agent/models/manager.js +1 -1
  98. package/dist/src/agent/orchestration/agent-orchestrator.js +1 -1
  99. package/dist/src/agent/service.js +3 -3
  100. package/dist/src/agent/session/session-inspector.js +2 -2
  101. package/dist/src/agent/skills/hub-pull.js +1 -1
  102. package/dist/src/agent/tools/composio-tool.js +1 -1
  103. package/dist/src/agent/tools/goal-tool.js +2 -2
  104. package/dist/src/agent/tools/workflow-tool.js +1 -1
  105. package/dist/src/agent/tools/xopc-use-tool.js +1 -1
  106. package/dist/src/agent/workspace-runtime/registry.js +2 -2
  107. package/dist/src/automations/api/routes.js +1 -1
  108. package/dist/src/automations/service/action-executor.js +2 -2
  109. package/dist/src/browser/cdp-local-launcher.js +1 -1
  110. package/dist/src/browser/providers/browser-ext-install.js +3 -3
  111. package/dist/src/browser/providers/cloakbrowser.js +2 -2
  112. package/dist/src/browser/providers/playwright-doctor.js +1 -1
  113. package/dist/src/browser/stealth.js +1 -1
  114. package/dist/src/capabilities/store-connector.js +1 -1
  115. package/dist/src/chat-commands/agent-edit.js +1 -1
  116. package/dist/src/chat-commands/builtins/config.js +1 -1
  117. package/dist/src/chat-commands/builtins/goal.js +2 -2
  118. package/dist/src/chat-commands/context.js +1 -1
  119. package/dist/src/cli/commands/agent.js +1 -1
  120. package/dist/src/cli/commands/doctor/checks/database-schema.js +1 -1
  121. package/dist/src/cli/commands/doctor/checks/session-integrity.js +1 -1
  122. package/dist/src/cli/commands/extension-marketplace.js +1 -1
  123. package/dist/src/cli/commands/extension-pack.js +1 -1
  124. package/dist/src/cli/commands/goal.js +2 -2
  125. package/dist/src/cli/commands/init.js +1 -1
  126. package/dist/src/cli/commands/project.js +3 -3
  127. package/dist/src/config/gateway-bind.js +1 -1
  128. package/dist/src/config/index.js +1 -1
  129. package/dist/src/config/loader.js +1 -1
  130. package/dist/src/config/models-json.js +1 -1
  131. package/dist/src/connectors/composio-sessions.js +1 -1
  132. package/dist/src/connectors/composio.js +1 -1
  133. package/dist/src/daemon/launchd.js +1 -1
  134. package/dist/src/daemon/systemd.js +1 -1
  135. package/dist/src/extensions/discover-extensions.js +1 -1
  136. package/dist/src/extensions/loader.js +2 -2
  137. package/dist/src/gateway/hono/lib/static-ui.js +1 -1
  138. package/dist/src/gateway/hono/routes/home.js +2 -2
  139. package/dist/src/gateway/hono/routes/memory.js +3 -3
  140. package/dist/src/gateway/hono/routes/projects.js +5 -5
  141. package/dist/src/gateway/hono/routes/workflows.js +1 -1
  142. package/dist/src/gateway/hono/routes/you.js +6 -6
  143. package/dist/src/gateway/lock.js +1 -1
  144. package/dist/src/gateway/ports.js +1 -1
  145. package/dist/src/gateway/service.js +6 -6
  146. package/dist/src/goals/goal-workflow-judge.js +1 -1
  147. package/dist/src/infra/ports.js +1 -1
  148. package/dist/src/infra/ssh-tunnel.js +1 -1
  149. package/dist/src/infra/update-check.js +1 -1
  150. package/dist/src/migrations/runner.js +1 -1
  151. package/dist/src/notes/service.js +3 -3
  152. package/dist/src/notes/store.js +1 -1
  153. package/dist/src/projects/project-service.js +1 -1
  154. package/dist/src/projects/workspace.js +1 -1
  155. package/dist/src/routing/agent-session-key.js +1 -1
  156. package/dist/src/routing/resolve-route.js +1 -1
  157. package/dist/src/routing/resolve-tui-session-key.js +1 -1
  158. package/dist/src/session/init-session-turn.js +1 -1
  159. package/dist/src/session/resolve-session.js +1 -1
  160. package/dist/src/session/session-title.js +2 -2
  161. package/dist/src/session/store.js +1 -1
  162. package/dist/src/storage/sqlite/connection.js +1 -1
  163. package/dist/src/storage/sqlite/row-mappers.js +1 -1
  164. package/dist/src/tui/backends/embedded-backend.js +4 -4
  165. package/dist/src/tui/clipboard-image.js +1 -1
  166. package/dist/src/tui/tui-command-formatters.js +2 -2
  167. package/dist/src/tui/tui-commands.js +3 -3
  168. package/dist/src/tui/tui.js +1 -1
  169. package/dist/src/utils/index.js +1 -1
  170. package/dist/src/utils/logger/index.js +1 -1
  171. package/dist/src/utils/logger.js +1 -1
  172. package/dist/src/work-items/work-item-service.js +1 -1
  173. package/dist/src/workflows/draft/workflow-draft-service.js +1 -1
  174. package/dist/src/workflows/service/workflow-session-bridge.js +3 -3
  175. package/package.json +2 -2
  176. package/dist/gateway/static/root/assets/dist-Mys7eFJ5.js +0 -1
  177. package/dist/gateway/static/root/assets/settings-advanced-gate-DdFyaRMm.js +0 -1
  178. package/dist/gateway/static/root/assets/skill-reload-api-DO87Ckeo.js +0 -1
@@ -1,4 +1,4 @@
1
- import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,i as n,n as r,t as i}from"./vendor-react-BOUWij0V.js";import{d as a,l as o,t as s,u as c}from"./chunk-QUQL4437-DXsxWP7r.js";import{t as l}from"./cn-BQ_8x0bT.js";import{t as u}from"./check-BODqo66o.js";import{t as d}from"./messages-CzKxM6I4.js";import{a as f}from"./fetch-8QNN25Sh.js";import{n as p}from"./locale-store-Ba72bFmP.js";import{i as m}from"./vendor-swr-BIWyz7Rc.js";import{$ as h,$c as g,$o as _,A as v,Al as y,B as b,Ct as x,E as S,F as C,Fi as w,G as T,H as E,Hs as D,I as O,Js as k,K as A,L as j,M,Mc as N,Ms as P,N as F,Na as I,O as L,Oc as R,P as z,Po as B,Ps as V,Q as H,R as U,Rl as ee,Ro as W,S as te,Sc as ne,U as G,V as re,W as ie,Wo as K,Ws as ae,X as oe,Xo as se,Y as ce,Z as le,Zc as q,_o as ue,_t as de,as as fe,at as pe,bo as me,bt as he,ct as ge,dr as _e,dt as ve,et as ye,ft as be,g as xe,gc as Se,gl as Ce,gt as we,ht as J,is as Te,j as Ee,k as De,kl as Oe,ks as ke,lt as Ae,mt as je,nl as Me,no as Ne,oc as Pe,ot as Fe,q as Ie,qo as Le,rl as Re,st as ze,ut as Be,vo as Ve,vr as He,vt as Ue,wc as We,wl as Ge,wt as Ke,xt as qe,ys as Je,yt as Ye,zc as Xe}from"./index-BKRqeRHm.js";import{t as Ze}from"./with-selector-aYPsXwdl.js";import{t as Qe}from"./page-tabs-D4hkWVt_.js";import{i as $e,n as et,r as tt,t as nt}from"./workflow-run-setup-panel-B35lJzvm.js";var Y=e(t(),1),X=r(),rt=[`queued`,`running`,`succeeded`,`attention`],it=new Set([`failed`,`timeout`,`cancelled`]);function at(e){return e.metadata?.sessionKey?.trim()||null}function ot(e,t){return e.length<=t?e:`${e.slice(0,t-1)}…`}function st(e,t){if(!e||typeof e!=`object`)return null;let n=e;for(let e of t){let t=n[e];if(typeof t==`string`&&t.trim())return t.trim()}return null}function ct(e,t=90){let n=e.metadata?.input?.goal?.trim()||(typeof e.metadata?.input?.payload==`string`?e.metadata.input.payload.trim():null)||st(e.metadata?.input?.payload,[`query`,`goal`,`prompt`,`input`,`message`])||st(e.metadata?.input?.variables,[`query`,`goal`,`prompt`,`input`,`message`]);return n?ot(n,t):null}function lt(e,t=90){return ct(e,t)??ot(e.title?.trim()||e.definitionId,t)}function ut(e,t=44){return ot(e.title?.trim()||e.definitionId,t)}function dt(e,t){let n=t.trim().toLowerCase();return n?[ct(e,500),e.title,e.definitionId,e.id].filter(Boolean).join(` `).toLowerCase().includes(n):!0}function ft(e,t){let n=t.workflowFilterId.trim();return e.filter(e=>n&&e.definitionId!==n||!O(e,t.triggerFilter??`all`)?!1:dt(e,t.searchQuery))}function pt(e){return e.completedAtMs??e.createdAtMs}function mt(e,t){return e.status===`queued`?`queued`:e.status===`running`?`running`:e.status===`succeeded`?`succeeded`:it.has(e.status)?`attention`:null}function ht(e,t){let n=[...t];return e===`queued`?n.sort((e,t)=>e.createdAtMs-t.createdAtMs):e===`running`?n.sort((e,t)=>(t.startedAtMs??t.createdAtMs)-(e.startedAtMs??e.createdAtMs)):n.sort((e,t)=>pt(t)-pt(e))}function gt(e,t){let n={queued:[],running:[],succeeded:[],attention:[]};for(let r of e){let e=mt(r,t);e&&n[e].push(r)}return rt.map(e=>{if(e===`succeeded`){let t=ht(`succeeded`,n.succeeded);return{id:e,runs:t,totalInWindow:t.length}}return{id:e,runs:ht(e,n[e])}})}var _t=new Map;function vt(e){let t=_t.get(e);return t||(t=new Intl.RelativeTimeFormat(e,{numeric:`auto`}),_t.set(e,t)),t}function yt(e,t,n){let r=Math.round((t-e)/1e3),i=vt(n);if(r<60)return i.format(-r,`second`);let a=Math.round(r/60);if(a<60)return i.format(-a,`minute`);let o=Math.round(a/60);if(o<48)return i.format(-o,`hour`);let s=Math.round(o/24);return i.format(-s,`day`)}function bt(e){return e.status===`queued`||e.status===`running`}function xt(e){return e.status===`failed`||e.status===`timeout`||e.status===`cancelled`}var Z=i(),St=(0,Y.memo)(function(e){let t=(0,X.c)(76),{run:n,language:r,localeTag:i,nowMs:a,selected:o,onOpen:s,onOpenChat:c,onCancel:u,onRetry:f}=e,p=d(r).workflows,[m,h]=(0,Y.useState)(!1),g;t[0]===n?g=t[1]:(g=at(n),t[0]=n,t[1]=g);let _=!g,y;t[2]===n?y=t[3]:(y=bt(n),t[2]=n,t[3]=y);let b=y,x=n.status===`running`||n.status===`queued`,S;t[4]!==n.metrics.agentCount||t[5]!==n.metrics.doneAgentCount?(S=n.metrics.agentCount>0?Math.round(n.metrics.doneAgentCount/n.metrics.agentCount*100):0,t[4]=n.metrics.agentCount,t[5]=n.metrics.doneAgentCount,t[6]=S):S=t[6];let C=S,w=n.metrics.errorAgentCount>0,T=n.startedAtMs??n.createdAtMs,E=v(b?a-T:n.metrics.durationMs),D=F(p.taskArtifacts,{count:n.metrics.artifactCount}),O;t[7]===n?O=t[8]:(O=lt(n),t[7]=n,t[8]=O);let k=O,A;t[9]===n?A=t[10]:(A=ut(n),t[9]=n,t[10]=A);let M=A,N;t[11]!==s||t[12]!==n?(N=()=>{s(n)},t[11]=s,t[12]=n,t[13]=N):N=t[13];let P=N,I;t[14]!==_||t[15]!==c||t[16]!==n?(I=()=>{_||c(n)},t[14]=_,t[15]=c,t[16]=n,t[17]=I):I=t[17];let L=I,R=o&&`ring-1 ring-accent/30`,z;t[18]===R?z=t[19]:(z=l(`group relative min-h-24 overflow-hidden rounded-lg bg-surface-panel px-3 py-3 shadow-surface transition-colors`,R,`hover:bg-surface-hover`),t[18]=R,t[19]=z);let B;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(B=l(`w-full text-left`,W.focusRingPanel),t[20]=B):B=t[20];let V;t[21]===k?V=t[22]:(V=(0,Z.jsx)(`div`,{className:`line-clamp-2 text-sm font-medium leading-5 text-fg`,children:k}),t[21]=k,t[22]=V);let H;t[23]===M?H=t[24]:(H=(0,Z.jsx)(`div`,{className:`mt-1 truncate text-[11px] font-medium text-fg-muted`,children:M}),t[23]=M,t[24]=H);let U;t[25]!==V||t[26]!==H?(U=(0,Z.jsxs)(`div`,{className:`min-w-0`,children:[V,H]}),t[25]=V,t[26]=H,t[27]=U):U=t[27];let ee;t[28]===n.status?ee=t[29]:(ee=l(`shrink-0 rounded-full px-2 py-0.5 text-[10px] font-semibold shadow-sm`,j(n.status)),t[28]=n.status,t[29]=ee);let te;t[30]!==i||t[31]!==a||t[32]!==T?(te=yt(T,a,i),t[30]=i,t[31]=a,t[32]=T,t[33]=te):te=t[33];let ne;t[34]===te?ne=t[35]:(ne=(0,Z.jsx)(`span`,{children:te}),t[34]=te,t[35]=ne);let G=E===`—`?null:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`span`,{"aria-hidden":!0,children:`·`}),(0,Z.jsx)(`span`,{children:F(p.taskElapsed,{duration:E})})]}),re;t[36]!==ne||t[37]!==G?(re=(0,Z.jsxs)(`div`,{className:`mt-2 flex flex-wrap items-center gap-1.5 text-[11px] text-fg-subtle`,children:[ne,G]}),t[36]=ne,t[37]=G,t[38]=re):re=t[38];let ie=n.metrics.artifactCount>0?(0,Z.jsx)(`span`,{className:`rounded-full bg-surface-hover px-2 py-0.5 font-medium text-fg-muted`,children:D}):null,ae=o?(0,Z.jsx)(`span`,{className:`font-medium text-accent-fg`,children:p.taskOpenDetails}):null,oe;t[39]!==ie||t[40]!==ae?(oe=(0,Z.jsxs)(`div`,{className:`mt-3 flex flex-wrap items-center gap-2 text-[11px] text-fg-subtle`,children:[ie,ae]}),t[39]=ie,t[40]=ae,t[41]=oe):oe=t[41];let se=_&&`cursor-not-allowed text-fg-disabled hover:bg-transparent`,ce;t[42]===se?ce=t[43]:(ce=l(`rounded-md px-2 py-1 text-xs font-medium`,`text-accent-fg hover:bg-accent-soft`,W.focusRingPanel,se),t[42]=se,t[43]=ce);let le;t[44]!==_||t[45]!==L||t[46]!==p.continueInChat||t[47]!==ce?(le=(0,Z.jsx)(`button`,{type:`button`,className:ce,disabled:_,onClick:L,children:p.continueInChat}),t[44]=_,t[45]=L,t[46]=p.continueInChat,t[47]=ce,t[48]=le):le=t[48];let ue;t[49]===Symbol.for(`react.memo_cache_sentinel`)?(ue=l(`rounded-md px-2 py-1 text-xs font-medium text-fg-muted hover:bg-surface-hover hover:text-fg`,W.focusRingPanel),t[49]=ue):ue=t[49];let de;t[50]!==P||t[51]!==p.taskOpenDetails?(de=(0,Z.jsx)(`button`,{type:`button`,className:ue,onClick:P,children:p.taskOpenDetails}),t[50]=P,t[51]=p.taskOpenDetails,t[52]=de):de=t[52];let fe;t[53]!==le||t[54]!==de?(fe=(0,Z.jsxs)(`div`,{className:`mt-3 flex flex-wrap items-center gap-2 border-t border-edge-subtle pt-2`,children:[le,de]}),t[53]=le,t[54]=de,t[55]=fe):fe=t[55];let pe;t[56]===h?pe=t[57]:(pe=()=>h(wt),t[56]=h,t[57]=pe);let me;t[58]===Symbol.for(`react.memo_cache_sentinel`)?(me=(0,Z.jsx)(q,{className:`size-4`,"aria-hidden":!0}),t[58]=me):me=t[58];let he;t[59]!==p.taskActionsAria||t[60]!==m||t[61]!==pe?(he=(0,Z.jsx)(K,{variant:`ghost`,className:`size-7 p-0 opacity-0 group-hover:opacity-100 group-focus-within:opacity-100`,"aria-label":p.taskActionsAria,"aria-expanded":m,onClick:pe,children:me}),t[59]=p.taskActionsAria,t[60]=m,t[61]=pe,t[62]=he):he=t[62];let ge;t[63]!==b||t[64]!==p.cancel||t[65]!==p.rerun||t[66]!==p.taskCloseMenu||t[67]!==m||t[68]!==u||t[69]!==f||t[70]!==n||t[71]!==h?(ge=m?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`button`,{type:`button`,className:`fixed inset-0 z-10 cursor-default`,"aria-label":p.taskCloseMenu,onClick:()=>h(!1)}),(0,Z.jsxs)(`div`,{className:`absolute right-0 z-20 mt-1 min-w-36 rounded-lg border border-edge bg-surface-panel py-1 shadow-surface`,children:[b?(0,Z.jsx)(Ct,{label:p.cancel,tone:`danger`,onClick:()=>{h(!1),u(n.id)}}):null,xt(n)?(0,Z.jsx)(Ct,{label:p.rerun,onClick:()=>{h(!1),f(n.id)}}):null]})]}):null,t[63]=b,t[64]=p.cancel,t[65]=p.rerun,t[66]=p.taskCloseMenu,t[67]=m,t[68]=u,t[69]=f,t[70]=n,t[71]=h,t[72]=ge):ge=t[72];let _e;return t[73]!==he||t[74]!==ge?(_e=(0,Z.jsxs)(`div`,{className:`absolute right-2 top-2`,children:[he,ge]}),t[73]=he,t[74]=ge,t[75]=_e):_e=t[75],(0,Z.jsxs)(`div`,{className:z,children:[(0,Z.jsxs)(`button`,{type:`button`,onClick:P,"aria-label":`${p.taskOpenDetails}: ${k}`,"aria-current":o?`true`:void 0,className:B,children:[(0,Z.jsxs)(`div`,{className:`pr-7`,children:[(0,Z.jsxs)(`div`,{className:`flex min-w-0 items-start justify-between gap-2`,children:[U,(0,Z.jsx)(`span`,{className:ee,children:p.status[n.status]??n.status})]}),re]}),x?(0,Z.jsxs)(`div`,{className:`mt-2.5`,children:[(0,Z.jsxs)(`div`,{className:`flex items-center justify-between gap-2 text-[11px] text-fg-muted`,children:[(0,Z.jsx)(`span`,{children:F(p.agentProgress,{done:n.metrics.doneAgentCount,total:n.metrics.agentCount})}),(0,Z.jsxs)(`span`,{children:[C,`%`]})]}),(0,Z.jsx)(`div`,{className:`mt-1.5 h-1.5 overflow-hidden rounded-full bg-surface-hover`,children:(0,Z.jsx)(`div`,{className:`h-full rounded-full bg-accent transition-all`,style:{width:`${C}%`}})})]}):null,oe,w?(0,Z.jsxs)(`div`,{className:`mt-2 flex items-center gap-1 text-[11px] text-amber-700 dark:text-amber-300`,children:[(0,Z.jsx)(Te,{className:`size-3 shrink-0`,"aria-hidden":!0}),F(p.runRowErrorSummary,{count:n.metrics.errorAgentCount})]}):null]}),fe,_e]})});function Ct(e){let t=(0,X.c)(8),{label:n,disabled:r,tone:i,onClick:a}=e,o=r?`cursor-not-allowed text-fg-subtle`:`text-fg hover:bg-surface-hover`,s=i===`danger`&&!r&&`text-red-600 dark:text-red-300`,c;t[0]!==o||t[1]!==s?(c=l(`block w-full px-3 py-1.5 text-left text-xs`,o,s),t[0]=o,t[1]=s,t[2]=c):c=t[2];let u;return t[3]!==r||t[4]!==n||t[5]!==a||t[6]!==c?(u=(0,Z.jsx)(`button`,{type:`button`,disabled:r,onClick:a,className:c,children:n}),t[3]=r,t[4]=n,t[5]=a,t[6]=c,t[7]=u):u=t[7],u}function wt(e){return!e}function Tt(e,t){return t.boardColumns[e]}var Et=(0,Y.memo)(function(e){let t=(0,X.c)(17),{column:n,language:r,localeTag:i,nowMs:a,selectedRunId:o,loading:s,onOpenRun:c,onOpenRunChat:u,onCancelRun:f,onRetryRun:p}=e,m=d(r).workflows,[h,g]=(0,Y.useState)(!1),_=n.id===`succeeded`,v=_?5:n.runs.length,y;t[0]!==v||t[1]!==n.runs||t[2]!==h||t[3]!==_?(y=_&&!h?n.runs.slice(0,v):n.runs,t[0]=v,t[1]=n.runs,t[2]=h,t[3]=_,t[4]=y):y=t[4];let b=y,x=_&&n.runs.length>5&&!h,S=_&&h,C;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(C=l(`flex max-h-full w-72 min-w-72 max-w-72 shrink-0 flex-col overflow-y-auto rounded-lg bg-surface-base shadow-surface`),t[5]=C):C=t[5];let w;t[6]===n.runs.length?w=t[7]:(w=(0,Z.jsx)(`span`,{className:`shrink-0 text-xs text-fg-subtle`,children:n.runs.length}),t[6]=n.runs.length,t[7]=w);let T;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(T=(0,Z.jsx)(q,{className:`size-4 shrink-0 text-fg-subtle`,"aria-hidden":!0}),t[8]=T):T=t[8];let E=s&&b.length===0?(0,Z.jsx)(Dt,{}):b.length===0?(0,Z.jsx)(`div`,{className:`rounded-lg bg-surface-panel/70 px-3 py-6 text-center text-xs text-fg-subtle`,children:m.boardColumnEmpty}):b.map(e=>(0,Z.jsx)(St,{run:e,language:r,localeTag:i,nowMs:a,selected:e.id===o,onOpen:c,onOpenChat:u,onCancel:f,onRetry:p},e.id)),D=x?(0,Z.jsx)(K,{variant:`ghost`,className:`h-8 w-full text-xs`,onClick:()=>g(!0),children:F(m.boardExpandSucceeded,{count:Math.min(n.runs.length,n.totalInWindow??n.runs.length)})}):null,O;t[9]!==S||t[10]!==m||t[11]!==g?(O=S?(0,Z.jsx)(K,{variant:`ghost`,className:`h-8 w-full text-xs`,onClick:()=>g(!1),children:m.boardCollapseSucceeded}):null,t[9]=S,t[10]=m,t[11]=g,t[12]=O):O=t[12];let k;return t[13]!==E||t[14]!==D||t[15]!==O?(k=(0,Z.jsxs)(`div`,{className:`mx-2 mt-3 grid min-h-0 min-w-0 content-start gap-2 pb-2 pr-1 [scrollbar-gutter:stable]`,children:[E,D,O]}),t[13]=E,t[14]=D,t[15]=O,t[16]=k):k=t[16],(0,Z.jsxs)(`section`,{className:C,"aria-label":Tt(n.id,m),children:[(0,Z.jsxs)(`header`,{className:`flex shrink-0 items-center justify-between gap-2 px-3 py-3`,children:[(0,Z.jsxs)(`div`,{className:`flex min-w-0 items-baseline gap-2`,children:[(0,Z.jsx)(`h2`,{className:`truncate text-sm font-semibold text-fg`,children:Tt(n.id,m)}),w]}),T]}),k]})});function Dt(){let e=(0,X.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Z.jsxs)(`article`,{className:`min-h-24 rounded-lg bg-surface-panel px-3 py-3 shadow-surface`,"aria-hidden":`true`,children:[(0,Z.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,Z.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Z.jsx)(I,{className:`h-4 w-4/5`}),(0,Z.jsx)(I,{className:`mt-2 h-3 w-24`})]}),(0,Z.jsx)(I,{className:`h-5 w-14 rounded-full`})]}),(0,Z.jsx)(I,{className:`mt-3 h-3 w-2/3`}),(0,Z.jsx)(I,{className:`mt-4 h-5 w-20 rounded-full`})]}),e[0]=t):t=e[0],t}function Ot(e){return e instanceof Element?!!e.closest(`a,button,input,select,textarea,[contenteditable="true"],[draggable="true"],[data-board-pan-skip="true"]`):!0}var kt=(0,Y.memo)(function(e){let t=(0,X.c)(54),{runs:n,language:r,localeTag:i,labels:a,searchQuery:o,workflowFilterId:s,triggerFilter:c,selectedRunId:l,loading:u,onOpenRun:d,onOpenRunChat:f,onCancelRun:p,onRetryRun:m,onStart:h}=e,g;t[0]===n?g=t[1]:(g=n.some(At),t[0]=n,t[1]=g);let _=g,v=(0,Y.useRef)(null),y=(0,Y.useRef)(null),[b,x]=(0,Y.useState)(jt),[S,C]=(0,Y.useState)(!1),w,T;t[2]===_?(w=t[3],T=t[4]):(w=()=>{if(!_)return;let e=window.setInterval(()=>x(Date.now()),1e3);return()=>window.clearInterval(e)},T=[_],t[2]=_,t[3]=w,t[4]=T),(0,Y.useEffect)(w,T);let E;t[5]!==b||t[6]!==n||t[7]!==o||t[8]!==c||t[9]!==s?(E=gt(ft(n,{searchQuery:o,workflowFilterId:s,triggerFilter:c}),b),t[5]=b,t[6]=n,t[7]=o,t[8]=c,t[9]=s,t[10]=E):E=t[10];let D=E,O=D.reduce(Mt,0),k;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(k=e=>{let t=y.current;!t||t.pointerId!==e.pointerId||(y.current=null,C(!1),e.currentTarget.hasPointerCapture?.(e.pointerId)&&e.currentTarget.releasePointerCapture(e.pointerId))},t[11]=k):k=t[11];let A=k,j;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(j=e=>{if(e.button!==0||Ot(e.target))return;let t=v.current;t&&(y.current={pointerId:e.pointerId,startX:e.clientX,scrollLeft:t.scrollLeft,active:!1},e.currentTarget.setPointerCapture(e.pointerId))},t[12]=j):j=t[12];let M=j,N;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(N=e=>{let t=y.current,n=v.current;if(!t||!n||t.pointerId!==e.pointerId)return;let r=e.clientX-t.startX;!t.active&&Math.abs(r)<5||(t.active||(t.active=!0,C(!0)),e.preventDefault(),n.scrollLeft=t.scrollLeft-r)},t[13]=N):N=t[13];let P=N;if(!u&&O===0){let e;t[14]===a.boardEmptyTitle?e=t[15]:(e=(0,Z.jsx)(`p`,{className:`text-sm font-medium text-fg`,children:a.boardEmptyTitle}),t[14]=a.boardEmptyTitle,t[15]=e);let n;t[16]===a.boardEmptyHint?n=t[17]:(n=(0,Z.jsx)(`p`,{className:`mx-auto mt-2 max-w-md text-sm leading-6 text-fg-muted`,children:a.boardEmptyHint}),t[16]=a.boardEmptyHint,t[17]=n);let r;t[18]!==a.boardStart||t[19]!==h?(r=(0,Z.jsx)(`div`,{className:`mt-4 flex justify-center`,children:(0,Z.jsx)(K,{variant:`primary`,onClick:h,children:a.boardStart})}),t[18]=a.boardStart,t[19]=h,t[20]=r):r=t[20];let i;return t[21]!==r||t[22]!==e||t[23]!==n?(i=(0,Z.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col items-center justify-center rounded-2xl border border-dashed border-edge bg-surface-panel/40 px-6 py-12 text-center`,children:[e,n,r]}),t[21]=r,t[22]=e,t[23]=n,t[24]=i):i=t[24],i}let F=S?`cursor-grabbing select-none`:`cursor-grab`,I;t[25]===F?I=t[26]:(I=[`min-h-0 h-full min-w-0 overflow-x-auto rounded-lg px-2 py-2`,F],t[25]=F,t[26]=I);let L=I.join(` `),R;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(R=e=>{y.current?.pointerId===e.pointerId&&(y.current=null,C(!1))},t[27]=R):R=t[27];let z;if(t[28]!==D||t[29]!==r||t[30]!==u||t[31]!==i||t[32]!==b||t[33]!==p||t[34]!==d||t[35]!==f||t[36]!==m||t[37]!==l){let e;t[39]!==r||t[40]!==u||t[41]!==i||t[42]!==b||t[43]!==p||t[44]!==d||t[45]!==f||t[46]!==m||t[47]!==l?(e=e=>(0,Z.jsx)(Et,{column:e,language:r,localeTag:i,nowMs:b,selectedRunId:l,loading:u,onOpenRun:d,onOpenRunChat:f,onCancelRun:p,onRetryRun:m},e.id),t[39]=r,t[40]=u,t[41]=i,t[42]=b,t[43]=p,t[44]=d,t[45]=f,t[46]=m,t[47]=l,t[48]=e):e=t[48],z=D.map(e),t[28]=D,t[29]=r,t[30]=u,t[31]=i,t[32]=b,t[33]=p,t[34]=d,t[35]=f,t[36]=m,t[37]=l,t[38]=z}else z=t[38];let B;t[49]===z?B=t[50]:(B=(0,Z.jsx)(`div`,{className:`flex min-h-full min-w-max items-start gap-3 pr-4`,children:z}),t[49]=z,t[50]=B);let V;return t[51]!==L||t[52]!==B?(V=(0,Z.jsx)(`div`,{ref:v,className:L,onPointerDown:M,onPointerMove:P,onPointerUp:A,onPointerCancel:A,onLostPointerCapture:R,children:B}),t[51]=L,t[52]=B,t[53]=V):V=t[53],V});function At(e){return e.status===`queued`||e.status===`running`}function jt(){return Date.now()}function Mt(e,t){return e+t.runs.length}function Nt(e,t){let n=e.metadata.estimatedAgents;return n?n.min===n.max?F(t.agentScaleExact,{count:n.min}):F(t.agentScaleRange,{min:n.min,max:n.max}):null}function Pt(e){let t=(0,X.c)(71),{definition:n,language:r,labels:i,onPick:a,onDetail:o,onEdit:s}=e,c;t[0]!==n||t[1]!==r?(c=ce(n,r),t[0]=n,t[1]=r,t[2]=c):c=t[2];let u=c,d;t[3]!==n||t[4]!==i?(d=Nt(n,i),t[3]=n,t[4]=i,t[5]=d):d=t[5];let f=d,p=n.metadata.source===`user`,m,h;t[6]!==n||t[7]!==o?(m=e=>{e.target.closest(`button, a`)||o(n)},h=e=>{e.target!==e.currentTarget||e.key!==`Enter`&&e.key!==` `||(e.preventDefault(),o(n))},t[6]=n,t[7]=o,t[8]=m,t[9]=h):(m=t[8],h=t[9]);let g;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(g=l(`group flex h-full cursor-pointer flex-col rounded-xl bg-surface-panel p-4 text-left shadow-surface transition-colors`,`hover:bg-surface-hover`,W.focusRingPanel),t[10]=g):g=t[10];let v=p?`bg-accent-soft text-accent-fg`:`bg-surface-hover text-fg-muted`,y;t[11]===v?y=t[12]:(y=l(`rounded-full px-2 py-0.5 text-[10px] font-medium`,v),t[11]=v,t[12]=y);let b=p?i.badgeUser:i.badgeBuiltin,x;t[13]!==y||t[14]!==b?(x=(0,Z.jsx)(`span`,{className:y,children:b}),t[13]=y,t[14]=b,t[15]=x):x=t[15];let S;t[16]!==n.inputSchema||t[17]!==i.inputSchemaBadge?(S=n.inputSchema?(0,Z.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-full bg-surface-hover px-2 py-0.5 text-[10px] text-fg-subtle`,children:[(0,Z.jsx)(Oe,{className:`size-2.5`,"aria-hidden":!0}),i.inputSchemaBadge]}):null,t[16]=n.inputSchema,t[17]=i.inputSchemaBadge,t[18]=S):S=t[18];let C;t[19]===n.metadata.tags?C=t[20]:(C=n.metadata.tags.slice(0,2).map(Ft),t[19]=n.metadata.tags,t[20]=C);let w;t[21]!==S||t[22]!==C||t[23]!==x?(w=(0,Z.jsxs)(`div`,{className:`mb-2 flex flex-wrap items-center gap-1.5`,children:[x,S,C]}),t[21]=S,t[22]=C,t[23]=x,t[24]=w):w=t[24];let T;t[25]===n.title?T=t[26]:(T=(0,Z.jsx)(`span`,{className:`line-clamp-2 text-sm font-semibold leading-5 text-fg`,children:n.title}),t[25]=n.title,t[26]=T);let E;t[27]!==w||t[28]!==T?(E=(0,Z.jsx)(`div`,{className:`flex items-start gap-2`,children:(0,Z.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[w,T]})}),t[27]=w,t[28]=T,t[29]=E):E=t[29];let D;t[30]===u.description?D=t[31]:(D=u.description?(0,Z.jsx)(`p`,{className:`mt-2 line-clamp-2 text-xs leading-5 text-fg-muted`,children:u.description}):null,t[30]=u.description,t[31]=D);let O;t[32]===Symbol.for(`react.memo_cache_sentinel`)?(O=(0,Z.jsx)(We,{className:`size-3`,"aria-hidden":!0}),t[32]=O):O=t[32];let A;t[33]!==n.phases.length||t[34]!==i.phaseCount?(A=F(i.phaseCount,{count:n.phases.length}),t[33]=n.phases.length,t[34]=i.phaseCount,t[35]=A):A=t[35];let j;t[36]===A?j=t[37]:(j=(0,Z.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[O,A]}),t[36]=A,t[37]=j);let M;t[38]===f?M=t[39]:(M=f?(0,Z.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[(0,Z.jsx)(_,{className:`size-3`,"aria-hidden":!0}),f]}):null,t[38]=f,t[39]=M);let N;t[40]!==j||t[41]!==M?(N=(0,Z.jsxs)(`div`,{className:`mt-auto flex flex-wrap items-center gap-3 pt-3 text-[11px] text-fg-subtle`,children:[j,M]}),t[40]=j,t[41]=M,t[42]=N):N=t[42];let P;t[43]!==E||t[44]!==D||t[45]!==N?(P=(0,Z.jsxs)(`div`,{className:`flex flex-1 flex-col`,children:[E,D,N]}),t[43]=E,t[44]=D,t[45]=N,t[46]=P):P=t[46];let I;t[47]!==n||t[48]!==a?(I=()=>a(n),t[47]=n,t[48]=a,t[49]=I):I=t[49];let L;t[50]===Symbol.for(`react.memo_cache_sentinel`)?(L=(0,Z.jsx)(ae,{className:`size-3.5`,"aria-hidden":!0}),t[50]=L):L=t[50];let R;t[51]!==i.runWorkflow||t[52]!==I?(R=(0,Z.jsxs)(K,{type:`button`,variant:`primary`,className:`h-8 flex-1 rounded-lg text-xs`,onClick:I,children:[L,i.runWorkflow]}),t[51]=i.runWorkflow,t[52]=I,t[53]=R):R=t[53];let z;t[54]!==n||t[55]!==s?(z=()=>s(n),t[54]=n,t[55]=s,t[56]=z):z=t[56];let B;t[57]===p?B=t[58]:(B=p?(0,Z.jsx)(k,{className:`size-3.5`,"aria-hidden":!0}):(0,Z.jsx)(Re,{className:`size-3.5`,"aria-hidden":!0}),t[57]=p,t[58]=B);let V=p?i.editWorkflow:i.copyAndEditWorkflow,H;t[59]!==z||t[60]!==B||t[61]!==V?(H=(0,Z.jsxs)(K,{type:`button`,variant:`secondary`,className:`h-8 rounded-lg text-xs`,onClick:z,children:[B,V]}),t[59]=z,t[60]=B,t[61]=V,t[62]=H):H=t[62];let U;t[63]!==R||t[64]!==H?(U=(0,Z.jsxs)(`div`,{className:`mt-4 flex flex-wrap gap-2 border-t border-edge-subtle pt-3`,children:[R,H]}),t[63]=R,t[64]=H,t[65]=U):U=t[65];let ee;return t[66]!==P||t[67]!==U||t[68]!==m||t[69]!==h?(ee=(0,Z.jsxs)(`article`,{role:`link`,tabIndex:0,onClick:m,onKeyDown:h,className:g,children:[P,U]}),t[66]=P,t[67]=U,t[68]=m,t[69]=h,t[70]=ee):ee=t[70],ee}function Ft(e){return(0,Z.jsx)(`span`,{className:`rounded-full bg-surface-hover px-2 py-0.5 text-[10px] text-fg-subtle`,children:e},e)}function It(e,t){return e===`uncategorized`?t.categories.uncategorized:t.categories[e]}function Lt(e){let t=(0,X.c)(11),{definitions:n,language:r,onPick:i,onDetail:a,onEdit:o}=e,s=d(r).workflows,[c,u]=(0,Y.useState)(``),[f,p]=(0,Y.useState)(`all`),m;t[0]!==f||t[1]!==n||t[2]!==c?(m=De(n,c,f,`all`),t[0]=f,t[1]=n,t[2]=c,t[3]=m):m=t[3];let h=m,g;t[4]===h?g=t[5]:(g=M(h),t[4]=h,t[5]=g);let _=g,v;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,Z.jsx)(ke,{className:`pointer-events-none absolute left-3 top-1/2 size-4 -translate-y-1/2 text-fg-subtle`,"aria-hidden":!0}),t[6]=v):v=t[6];let y;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(y=e=>u(e.target.value),t[7]=y):y=t[7];let b=s.searchPlaceholder,x;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(x=l(`h-10 w-full rounded-xl border border-edge bg-surface-base py-2 pl-10 pr-3 text-sm text-fg`,`placeholder:text-fg-subtle`,W.focusRingPanel),t[8]=x):x=t[8];let S=h.length===0?(0,Z.jsxs)(`div`,{className:`flex h-full flex-col items-center justify-center px-4 py-12 text-center`,children:[(0,Z.jsx)(`p`,{className:`text-sm text-fg-muted`,children:s.noDefinitions}),(0,Z.jsx)(`p`,{className:`mt-1 max-w-sm text-xs leading-5 text-fg-subtle`,children:s.noDefinitionsHint})]}):f===`all`?(0,Z.jsx)(`div`,{className:`flex flex-col gap-6 pb-1`,children:_.map(e=>(0,Z.jsxs)(`section`,{children:[(0,Z.jsx)(`h3`,{className:`mb-3 text-xs font-semibold uppercase tracking-wide text-fg-subtle`,children:It(e.category,s)}),(0,Z.jsx)(`div`,{className:`grid grid-cols-1 gap-3 sm:grid-cols-2 xl:grid-cols-3`,children:e.items.map(e=>(0,Z.jsx)(Pt,{definition:e,language:r,labels:s,onPick:i,onDetail:a,onEdit:o},e.id))})]},e.category))}):(0,Z.jsx)(`div`,{className:`grid grid-cols-1 gap-3 pb-1 sm:grid-cols-2 xl:grid-cols-3`,children:h.map(e=>(0,Z.jsx)(Pt,{definition:e,language:r,labels:s,onPick:i,onDetail:a,onEdit:o},e.id))}),C;return t[9]===S?C=t[10]:(C=(0,Z.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto`,children:S}),t[9]=S,t[10]=C),(0,Z.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-4`,children:[(0,Z.jsxs)(`div`,{className:`flex shrink-0 flex-col gap-4`,children:[(0,Z.jsxs)(`div`,{className:`relative`,children:[v,(0,Z.jsx)(`input`,{value:c,onChange:y,placeholder:b,className:x})]}),(0,Z.jsx)(`div`,{className:`flex flex-wrap gap-2`,role:`group`,"aria-label":s.categoryFilterAria,children:ie.map(e=>(0,Z.jsx)(K,{type:`button`,variant:f===e?`secondary`:`ghost`,className:`h-8 rounded-full px-3 py-1.5 text-xs`,onClick:()=>p(e),children:s.categories[e]},e))})]}),C]})}function Rt(e){let t=(0,X.c)(30),{stats:n,language:r}=e,i,a,o;if(t[0]!==r||t[1]!==n){o=Symbol.for(`react.early_return_sentinel`);bb0:{if(i=d(r).workflows,!n||n.totalRuns===0){o=null;break bb0}a=n.topDefinitions[0]?F(i.statsTopWorkflow,{name:n.topDefinitions[0].definitionId,count:n.topDefinitions[0].count}):null}t[0]=r,t[1]=n,t[2]=i,t[3]=a,t[4]=o}else i=t[2],a=t[3],o=t[4];if(o!==Symbol.for(`react.early_return_sentinel`))return o;let s=a,c=i.statsTotalRuns,l=String(n.totalRuns),u;t[5]!==i.statsTotalRuns||t[6]!==l?(u=(0,Z.jsx)(zt,{label:c,value:l}),t[5]=i.statsTotalRuns,t[6]=l,t[7]=u):u=t[7];let f=i.statsActiveRuns,p=String(n.activeRuns),m;t[8]!==i.statsActiveRuns||t[9]!==p?(m=(0,Z.jsx)(zt,{label:f,value:p}),t[8]=i.statsActiveRuns,t[9]=p,t[10]=m):m=t[10];let h;t[11]!==n.succeededRuns||t[12]!==n.totalRuns?(h=n.totalRuns>0?`${Math.round(n.succeededRuns/n.totalRuns*100)}%`:`—`,t[11]=n.succeededRuns,t[12]=n.totalRuns,t[13]=h):h=t[13];let g;t[14]!==i.statsSuccessRate||t[15]!==h?(g=(0,Z.jsx)(zt,{label:i.statsSuccessRate,value:h}),t[14]=i.statsSuccessRate,t[15]=h,t[16]=g):g=t[16];let _;t[17]===n.averageDurationMs?_=t[18]:(_=n.averageDurationMs==null?`—`:v(n.averageDurationMs),t[17]=n.averageDurationMs,t[18]=_);let y;t[19]!==i.statsAvgDuration||t[20]!==_?(y=(0,Z.jsx)(zt,{label:i.statsAvgDuration,value:_}),t[19]=i.statsAvgDuration,t[20]=_,t[21]=y):y=t[21];let b;t[22]===s?b=t[23]:(b=s?(0,Z.jsx)(`span`,{className:`min-w-0 truncate text-xs text-fg-muted`,children:s}):null,t[22]=s,t[23]=b);let x;return t[24]!==g||t[25]!==y||t[26]!==b||t[27]!==u||t[28]!==m?(x=(0,Z.jsxs)(`section`,{className:`flex min-w-0 flex-wrap items-center gap-2 rounded-lg bg-surface-panel/70 px-3 py-2 shadow-surface`,children:[u,m,g,y,b]}),t[24]=g,t[25]=y,t[26]=b,t[27]=u,t[28]=m,t[29]=x):x=t[29],x}function zt(e){let t=(0,X.c)(7),{label:n,value:r}=e,i;t[0]===n?i=t[1]:(i=(0,Z.jsx)(`span`,{children:n}),t[0]=n,t[1]=i);let a;t[2]===r?a=t[3]:(a=(0,Z.jsx)(`span`,{className:`font-semibold tabular-nums text-fg`,children:r}),t[2]=r,t[3]=a);let o;return t[4]!==i||t[5]!==a?(o=(0,Z.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 rounded-full bg-surface-muted px-2.5 py-1 text-xs text-fg-muted`,children:[i,a]}),t[4]=i,t[5]=a,t[6]=o):o=t[6],o}function Bt(e){let t=(0,X.c)(10),{vm:n}=e,{labels:r,loading:i,refreshAll:a}=n,o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,Z.jsx)(D,{className:`size-4`,"aria-hidden":!0}),t[0]=o):o=t[0];let c;t[1]===r.addWorkflow?c=t[2]:(c=(0,Z.jsx)(K,{asChild:!0,variant:`primary`,className:`h-9 rounded-lg`,children:(0,Z.jsxs)(s,{to:`/workflows/new`,children:[o,r.addWorkflow]})}),t[1]=r.addWorkflow,t[2]=c);let l;t[3]!==r.refresh||t[4]!==i||t[5]!==a?(l=(0,Z.jsx)(w,{className:`size-9 shrink-0 p-0`,loading:i,label:r.refresh,onClick:a}),t[3]=r.refresh,t[4]=i,t[5]=a,t[6]=l):l=t[6];let u;return t[7]!==c||t[8]!==l?(u=(0,Z.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-2`,children:[c,l]}),t[7]=c,t[8]=l,t[9]=u):u=t[9],u}var Vt=[`attention`,`running`,`queued`,`recent`],Ht=[`pr_review`,`implementation_plan`,`research`,`debug_incident`,`meeting_prep`,`content_draft`];function Ut(e){return e.status===`failed`||e.status===`timeout`||e.status===`cancelled`?`attention`:e.status===`running`?`running`:e.status===`queued`?`queued`:e.status===`succeeded`?`recent`:null}function Wt(e){return e.completedAtMs??e.startedAtMs??e.createdAtMs}function Gt(e,t){let n=[...t];return e===`queued`?n.sort((e,t)=>e.createdAtMs-t.createdAtMs):n.sort((e,t)=>Wt(t)-Wt(e))}function Kt(e){let t=new Map(Vt.map(e=>[e,[]]));for(let n of e){let e=Ut(n);e&&t.get(e)?.push(n)}for(let e of Vt)t.set(e,Gt(e,t.get(e)??[]));return t}function qt(){let e=(0,X.c)(2),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Z.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,Z.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(I,{className:`size-4 rounded-full`}),(0,Z.jsx)(I,{className:`h-4 w-32`})]}),(0,Z.jsx)(I,{className:`mt-3 h-4 w-full`}),(0,Z.jsx)(I,{className:`mt-2 h-4 w-2/3`})]}),(0,Z.jsx)(I,{className:`h-6 w-20 rounded-full`})]}),e[0]=t):t=e[0];let n;return e[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Z.jsxs)(`article`,{className:`rounded-lg bg-surface-panel p-3 shadow-surface`,"aria-hidden":`true`,children:[t,(0,Z.jsxs)(`div`,{className:`mt-4 flex gap-2`,children:[(0,Z.jsx)(I,{className:`h-8 w-20 rounded-md`}),(0,Z.jsx)(I,{className:`h-8 w-24 rounded-md`})]})]}),e[1]=n):n=e[1],n}function Jt(e){let t=new Map(e.map(e=>[e.id,e])),n=[];for(let e of Ht){let r=t.get(e);r&&n.push(r)}for(let t of e){if(n.length>=6)break;n.some(e=>e.id===t.id)||n.push(t)}return n}function Yt(e,t){let n=G[e.name]??[];return n.length>0?n.slice(0,2).map(e=>$e(t.args,e.labelKey)).join(` · `):e.inputSchema?.properties&&Object.keys(e.inputSchema.properties).length>0?t.templateInputsStructured:t.templateInputsGoalOnly}function Xt(e){let t=(0,X.c)(42),{definitions:n,language:r,labels:i,onStart:a,onDetail:o,onBrowseAll:s,onManageTemplates:c}=e,[u,d]=(0,Y.useState)(!0),f,p;if(t[0]!==n||t[1]!==u||t[2]!==i||t[3]!==r||t[4]!==s||t[5]!==o||t[6]!==c||t[7]!==a){p=Symbol.for(`react.early_return_sentinel`);bb0:{let e=Jt(n);if(e.length===0){p=null;break bb0}let m;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(m=l(`flex min-w-0 flex-1 items-start gap-3 text-left`,W.focusRingPanel),t[10]=m):m=t[10];let h;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(h=()=>d(Zt),t[11]=h):h=t[11];let g=u?`rotate-180`:null,_;t[12]===g?_=t[13]:(_=l(`mt-1 size-4 shrink-0 text-fg-subtle transition-transform`,g),t[12]=g,t[13]=_);let v;t[14]===_?v=t[15]:(v=(0,Z.jsx)(Ge,{className:_,"aria-hidden":!0}),t[14]=_,t[15]=v);let y;t[16]===i.launchRecommended?y=t[17]:(y=(0,Z.jsx)(`span`,{className:`block text-xs font-medium text-accent-fg`,children:i.launchRecommended}),t[16]=i.launchRecommended,t[17]=y);let b;t[18]===i.launchTitle?b=t[19]:(b=(0,Z.jsx)(`span`,{className:`mt-1 block text-base font-semibold text-fg`,children:i.launchTitle}),t[18]=i.launchTitle,t[19]=b);let x;t[20]===i.launchHint?x=t[21]:(x=(0,Z.jsx)(`span`,{className:`mt-1 block max-w-3xl text-sm leading-6 text-fg-muted`,children:i.launchHint}),t[20]=i.launchHint,t[21]=x);let S;t[22]!==x||t[23]!==y||t[24]!==b?(S=(0,Z.jsxs)(`span`,{className:`min-w-0`,children:[y,b,x]}),t[22]=x,t[23]=y,t[24]=b,t[25]=S):S=t[25];let C;t[26]!==u||t[27]!==S||t[28]!==v?(C=(0,Z.jsxs)(`button`,{type:`button`,className:m,"aria-expanded":u,onClick:h,children:[v,S]}),t[26]=u,t[27]=S,t[28]=v,t[29]=C):C=t[29];let w;t[30]!==i.launchBrowseAll||t[31]!==s?(w=(0,Z.jsx)(K,{type:`button`,variant:`secondary`,className:`h-8 rounded-lg text-xs`,onClick:s,children:i.launchBrowseAll}),t[30]=i.launchBrowseAll,t[31]=s,t[32]=w):w=t[32];let T;t[33]!==i.launchManageTemplates||t[34]!==c?(T=(0,Z.jsx)(K,{type:`button`,variant:`secondary`,className:`h-8 rounded-lg text-xs`,onClick:c,children:i.launchManageTemplates}),t[33]=i.launchManageTemplates,t[34]=c,t[35]=T):T=t[35];let E;t[36]!==w||t[37]!==T?(E=(0,Z.jsxs)(`div`,{className:`flex shrink-0 flex-wrap gap-2`,children:[w,T]}),t[36]=w,t[37]=T,t[38]=E):E=t[38];let D;t[39]!==C||t[40]!==E?(D=(0,Z.jsxs)(`div`,{className:`flex flex-col gap-3 lg:flex-row lg:items-start lg:justify-between`,children:[C,E]}),t[39]=C,t[40]=E,t[41]=D):D=t[41],f=(0,Z.jsxs)(`section`,{className:`rounded-lg border border-edge-subtle bg-surface-base px-4 py-4 shadow-surface`,children:[D,u?(0,Z.jsx)(`div`,{className:`mt-4 grid gap-3 md:grid-cols-2 xl:grid-cols-3`,children:e.map(e=>{let t=ce(e,r);return(0,Z.jsxs)(`article`,{className:`relative min-w-0 rounded-lg border border-edge bg-surface-panel p-3 transition-colors hover:bg-surface-hover/45`,children:[(0,Z.jsx)(`button`,{type:`button`,"aria-label":`${i.viewDetails}: ${e.title}`,className:l(`absolute inset-0 cursor-pointer rounded-lg`,W.focusRingPanel),onClick:()=>o(e)}),(0,Z.jsxs)(`div`,{className:`pointer-events-none relative z-10 flex items-start justify-between gap-3`,children:[(0,Z.jsxs)(`div`,{className:`min-w-0 flex-1 text-left`,children:[(0,Z.jsx)(`span`,{className:`line-clamp-1 text-sm font-semibold text-fg`,children:e.title}),(0,Z.jsx)(`span`,{className:`mt-1 block line-clamp-2 text-xs leading-5 text-fg-muted`,children:t.whenToUse||t.description})]}),(0,Z.jsxs)(K,{type:`button`,variant:`primary`,className:`pointer-events-auto h-8 shrink-0 rounded-lg px-2.5 text-xs`,onClick:()=>a(e),children:[(0,Z.jsx)(ae,{className:`size-3.5`,"aria-hidden":!0}),i.runWorkflow]})]}),(0,Z.jsxs)(`dl`,{className:`pointer-events-none relative z-10 mt-3 grid gap-2 text-xs sm:grid-cols-2`,children:[(0,Z.jsxs)(`div`,{className:`rounded-md bg-surface-muted/50 px-2.5 py-2`,children:[(0,Z.jsx)(`dt`,{className:`font-medium text-fg-subtle`,children:i.templateInputs}),(0,Z.jsx)(`dd`,{className:`mt-0.5 line-clamp-1 text-fg-muted`,children:Yt(e,i)})]}),(0,Z.jsxs)(`div`,{className:`rounded-md bg-surface-muted/50 px-2.5 py-2`,children:[(0,Z.jsx)(`dt`,{className:`font-medium text-fg-subtle`,children:i.templateExpectedOutput}),(0,Z.jsx)(`dd`,{className:`mt-0.5 line-clamp-1 text-fg-muted`,children:i.templateOutputReport})]})]})]},e.id)})}):null]})}t[0]=n,t[1]=u,t[2]=i,t[3]=r,t[4]=s,t[5]=o,t[6]=c,t[7]=a,t[8]=f,t[9]=p}else f=t[8],p=t[9];return p===Symbol.for(`react.early_return_sentinel`)?f:p}function Zt(e){return!e}function Qt(e){let t=(0,X.c)(134),{vm:n}=e,{language:r,localeTag:i,labels:a,hasToken:o,definitions:s,runs:c,searchQuery:u,setSearchQuery:f,ownerAgentId:p,agentOptions:m,setOwnerAgentId:h,workflowFilterId:g,setWorkflowFilterId:_,triggerFilter:v,setTriggerFilter:y,viewMode:b,setViewMode:x,openRunDetails:S,openRunInChat:C,openDefinitionDetails:w,openWorkflowEditor:T,startWorkflow:E,actionError:D,actionFeedback:O,loading:k,error:A,stats:j,cancelRun:M,retryRun:N}=n,P=Ne(on),F=Ne(an),I;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(I=Date.now(),t[0]=I):I=t[0];let L=I,R=Kt(ft(c,{searchQuery:u,workflowFilterId:g,triggerFilter:v})),z;t[1]!==F||t[2]!==o||t[3]!==a.statsActiveRuns||t[4]!==a.statsTotalRuns||t[5]!==a.subtitleBoard||t[6]!==a.title||t[7]!==P||t[8]!==j||t[9]!==n?(z=()=>{if(!o){F();return}return P({startExtra:null,main:(0,Z.jsxs)(`div`,{className:`min-w-0`,children:[(0,Z.jsx)(`h1`,{className:`truncate text-base font-semibold tracking-tight text-fg`,children:a.title}),(0,Z.jsx)(`p`,{className:`truncate text-xs text-fg-muted`,children:j?`${a.statsTotalRuns}: ${j.totalRuns} · ${a.statsActiveRuns}: ${j.activeRuns}`:a.subtitleBoard})]}),end:(0,Z.jsx)(Bt,{vm:n})}),()=>F()},t[1]=F,t[2]=o,t[3]=a.statsActiveRuns,t[4]=a.statsTotalRuns,t[5]=a.subtitleBoard,t[6]=a.title,t[7]=P,t[8]=j,t[9]=n,t[10]=z):z=t[10];let B;if(t[11]!==F||t[12]!==o||t[13]!==a.statsActiveRuns||t[14]!==a.statsTotalRuns||t[15]!==a.subtitleBoard||t[16]!==a.title||t[17]!==k||t[18]!==j||t[19]!==n?(B=[F,o,a.title,a.statsActiveRuns,a.statsTotalRuns,a.subtitleBoard,k,j,n,n.refreshAll,n.setSearchQuery],t[11]=F,t[12]=o,t[13]=a.statsActiveRuns,t[14]=a.statsTotalRuns,t[15]=a.subtitleBoard,t[16]=a.title,t[17]=k,t[18]=j,t[19]=n,t[20]=B):B=t[20],(0,Y.useLayoutEffect)(z,B),!o){let e;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(Xe,{className:`size-10 text-accent-fg`,"aria-hidden":!0}),t[21]=e):e=t[21];let n;t[22]===a.title?n=t[23]:(n=(0,Z.jsx)(`h1`,{className:`mt-4 text-xl font-semibold text-fg`,children:a.title}),t[22]=a.title,t[23]=n);let r;t[24]===a.needToken?r=t[25]:(r=(0,Z.jsx)(`p`,{className:`mt-2 max-w-md text-sm leading-6 text-fg-muted`,children:a.needToken}),t[24]=a.needToken,t[25]=r);let i;return t[26]!==n||t[27]!==r?(i=(0,Z.jsx)(`main`,{className:`min-h-0 flex-1 overflow-auto bg-surface-panel`,children:(0,Z.jsxs)(`div`,{className:`flex w-full flex-col items-center px-3 py-16 text-center sm:px-5 xl:px-6`,children:[e,n,r]})}),t[26]=n,t[27]=r,t[28]=i):i=t[28],i}let V;t[29]!==s||t[30]!==a||t[31]!==r||t[32]!==w||t[33]!==E?(V=(0,Z.jsx)(Xt,{definitions:s,language:r,labels:a,onStart:E,onDetail:w,onBrowseAll:rn,onManageTemplates:nn}),t[29]=s,t[30]=a,t[31]=r,t[32]=w,t[33]=E,t[34]=V):V=t[34];let H;t[35]===Symbol.for(`react.memo_cache_sentinel`)?(H=(0,Z.jsx)(ke,{className:`pointer-events-none absolute left-2.5 top-1/2 size-4 -translate-y-1/2 text-fg-subtle`,"aria-hidden":!0}),t[35]=H):H=t[35];let U;t[36]===f?U=t[37]:(U=e=>f(e.target.value),t[36]=f,t[37]=U);let ee=a.searchPlaceholder,te;t[38]===Symbol.for(`react.memo_cache_sentinel`)?(te=l(`h-9 w-full rounded-lg border border-edge bg-surface-panel py-2 pl-9 pr-3 text-sm text-fg shadow-surface`,`placeholder:text-fg-subtle`,W.focusRingPanel),t[38]=te):te=t[38];let G;t[39]!==a.searchPlaceholder||t[40]!==u||t[41]!==U?(G=(0,Z.jsxs)(`div`,{className:`relative min-w-48 flex-1 sm:max-w-xs`,children:[H,(0,Z.jsx)(`input`,{value:u,onChange:U,placeholder:ee,className:te})]}),t[39]=a.searchPlaceholder,t[40]=u,t[41]=U,t[42]=G):G=t[42];let re;t[43]!==m||t[44]!==r||t[45]!==p||t[46]!==h?(re=m.length>1?(0,Z.jsx)(Ve,{value:p??``,"aria-label":`Agent`,onChange:e=>h(e.target.value),className:l(`h-9 min-w-32 rounded-lg border border-edge bg-surface-panel px-2.5 text-xs font-medium text-fg shadow-surface`,W.focusRingPanel),children:m.map(e=>(0,Z.jsx)(me,{value:e.id,children:_e(e,d(r).agentsSettings)},e.id))}):null,t[43]=m,t[44]=r,t[45]=p,t[46]=h,t[47]=re):re=t[47];let ie=a.boardTriggerFilterAria,K;t[48]===y?K=t[49]:(K=e=>y(e.target.value),t[48]=y,t[49]=K);let ae;t[50]===Symbol.for(`react.memo_cache_sentinel`)?(ae=l(`h-9 min-w-[7.5rem] rounded-lg border border-edge bg-surface-panel px-2.5 text-xs font-medium text-fg shadow-surface`,W.focusRingPanel),t[50]=ae):ae=t[50];let oe;t[51]===a.boardTriggerFilterAll?oe=t[52]:(oe=(0,Z.jsx)(me,{value:`all`,children:a.boardTriggerFilterAll}),t[51]=a.boardTriggerFilterAll,t[52]=oe);let se;t[53]===a.boardTriggerFilterAutomation?se=t[54]:(se=(0,Z.jsx)(me,{value:`automation`,children:a.boardTriggerFilterAutomation}),t[53]=a.boardTriggerFilterAutomation,t[54]=se);let ce;t[55]===a.boardTriggerFilterWebui?ce=t[56]:(ce=(0,Z.jsx)(me,{value:`webui`,children:a.boardTriggerFilterWebui}),t[55]=a.boardTriggerFilterWebui,t[56]=ce);let le;t[57]===a.boardTriggerFilterChat?le=t[58]:(le=(0,Z.jsx)(me,{value:`chat`,children:a.boardTriggerFilterChat}),t[57]=a.boardTriggerFilterChat,t[58]=le);let q;t[59]===a.boardTriggerFilterApi?q=t[60]:(q=(0,Z.jsx)(me,{value:`api`,children:a.boardTriggerFilterApi}),t[59]=a.boardTriggerFilterApi,t[60]=q);let ue;t[61]!==a.boardTriggerFilterAria||t[62]!==K||t[63]!==oe||t[64]!==se||t[65]!==ce||t[66]!==le||t[67]!==q||t[68]!==v?(ue=(0,Z.jsxs)(Ve,{value:v,"aria-label":ie,onChange:K,className:ae,children:[oe,se,ce,le,q]}),t[61]=a.boardTriggerFilterAria,t[62]=K,t[63]=oe,t[64]=se,t[65]=ce,t[66]=le,t[67]=q,t[68]=v,t[69]=ue):ue=t[69];let de=a.boardWorkflowFilterAria,fe;t[70]===_?fe=t[71]:(fe=e=>_(e.target.value),t[70]=_,t[71]=fe);let pe;t[72]===Symbol.for(`react.memo_cache_sentinel`)?(pe=l(`h-9 min-w-40 rounded-lg border border-edge bg-surface-panel px-2.5 text-xs font-medium text-fg shadow-surface`,W.focusRingPanel),t[72]=pe):pe=t[72];let he;t[73]===a.boardWorkflowFilterAll?he=t[74]:(he=(0,Z.jsx)(me,{value:``,children:a.boardWorkflowFilterAll}),t[73]=a.boardWorkflowFilterAll,t[74]=he);let ge;t[75]===s?ge=t[76]:(ge=s.map(tn),t[75]=s,t[76]=ge);let ve;t[77]!==a.boardWorkflowFilterAria||t[78]!==fe||t[79]!==he||t[80]!==ge||t[81]!==g?(ve=(0,Z.jsxs)(Ve,{value:g,"aria-label":de,onChange:fe,className:pe,children:[he,ge]}),t[77]=a.boardWorkflowFilterAria,t[78]=fe,t[79]=he,t[80]=ge,t[81]=g,t[82]=ve):ve=t[82];let ye=b===`operations`?`bg-surface-panel text-fg shadow-surface`:`text-fg-muted hover:text-fg`,be;t[83]===ye?be=t[84]:(be=l(`inline-flex h-8 items-center gap-1.5 rounded-md px-2.5 text-xs font-medium transition-colors`,ye),t[83]=ye,t[84]=be);let xe;t[85]===x?xe=t[86]:(xe=()=>x(`operations`),t[85]=x,t[86]=xe);let Ce;t[87]===Symbol.for(`react.memo_cache_sentinel`)?(Ce=(0,Z.jsx)(Se,{className:`size-3.5`,"aria-hidden":!0}),t[87]=Ce):Ce=t[87];let we;t[88]!==a.viewModes.operations||t[89]!==be||t[90]!==xe?(we=(0,Z.jsxs)(`button`,{type:`button`,className:be,onClick:xe,children:[Ce,a.viewModes.operations]}),t[88]=a.viewModes.operations,t[89]=be,t[90]=xe,t[91]=we):we=t[91];let J=b===`board`?`bg-surface-panel text-fg shadow-surface`:`text-fg-muted hover:text-fg`,Te;t[92]===J?Te=t[93]:(Te=l(`inline-flex h-8 items-center gap-1.5 rounded-md px-2.5 text-xs font-medium transition-colors`,J),t[92]=J,t[93]=Te);let Ee;t[94]===x?Ee=t[95]:(Ee=()=>x(`board`),t[94]=x,t[95]=Ee);let De;t[96]===Symbol.for(`react.memo_cache_sentinel`)?(De=(0,Z.jsx)(ne,{className:`size-3.5`,"aria-hidden":!0}),t[96]=De):De=t[96];let Oe;t[97]!==a.viewModes.board||t[98]!==Te||t[99]!==Ee?(Oe=(0,Z.jsxs)(`button`,{type:`button`,className:Te,onClick:Ee,children:[De,a.viewModes.board]}),t[97]=a.viewModes.board,t[98]=Te,t[99]=Ee,t[100]=Oe):Oe=t[100];let Ae;t[101]!==we||t[102]!==Oe?(Ae=(0,Z.jsxs)(`div`,{className:`flex rounded-lg bg-surface-muted p-0.5`,children:[we,Oe]}),t[101]=we,t[102]=Oe,t[103]=Ae):Ae=t[103];let je;t[104]!==re||t[105]!==ue||t[106]!==ve||t[107]!==Ae||t[108]!==G?(je=(0,Z.jsxs)(`section`,{className:`flex w-full flex-wrap items-center gap-2 rounded-lg border border-edge-subtle bg-surface-base px-3 py-2 shadow-surface`,children:[G,re,ue,ve,Ae]}),t[104]=re,t[105]=ue,t[106]=ve,t[107]=Ae,t[108]=G,t[109]=je):je=t[109];let Me;t[110]===O?Me=t[111]:(Me=O?(0,Z.jsx)(`div`,{className:`w-full rounded-xl border border-emerald-500/25 bg-emerald-500/10 px-3 py-2 text-sm text-emerald-800 dark:text-emerald-200`,children:O}):null,t[110]=O,t[111]=Me);let Pe;t[112]!==D||t[113]!==A?(Pe=D??A?(0,Z.jsx)(`div`,{className:`w-full rounded-xl border border-red-500/25 bg-red-500/10 px-3 py-2 text-sm text-red-700 dark:text-red-300`,children:D??A}):null,t[112]=D,t[113]=A,t[114]=Pe):Pe=t[114];let Fe;t[115]!==r||t[116]!==j?(Fe=(0,Z.jsx)(`div`,{className:`w-full`,children:(0,Z.jsx)(Rt,{stats:j,language:r})}),t[115]=r,t[116]=j,t[117]=Fe):Fe=t[117];let Ie=r===`zh`?`全部工作流`:`All workflows`,Le;t[118]===Ie?Le=t[119]:(Le=(0,Z.jsx)(`h2`,{className:`text-base font-semibold text-fg`,children:Ie}),t[118]=Ie,t[119]=Le);let Re=r===`zh`?`点击卡片进入详情,了解步骤、输入和最近运行。`:`Select a card to see its steps, inputs, and recent runs.`,ze;t[120]===Re?ze=t[121]:(ze=(0,Z.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:Re}),t[120]=Re,t[121]=ze);let Be;t[122]!==Le||t[123]!==ze?(Be=(0,Z.jsxs)(`div`,{className:`mb-4`,children:[Le,ze]}),t[122]=Le,t[123]=ze,t[124]=Be):Be=t[124];let He;t[125]!==s||t[126]!==r||t[127]!==w||t[128]!==T||t[129]!==E?(He=(0,Z.jsx)(Lt,{definitions:s,language:r,onPick:E,onDetail:w,onEdit:T}),t[125]=s,t[126]=r,t[127]=w,t[128]=T,t[129]=E,t[130]=He):He=t[130];let Ue;return t[131]!==Be||t[132]!==He?(Ue=(0,Z.jsxs)(`section`,{id:`workflow-library`,className:`scroll-mt-4 border-t border-edge pt-6`,children:[Be,He]}),t[131]=Be,t[132]=He,t[133]=Ue):Ue=t[133],(0,Z.jsx)(`main`,{className:`min-h-0 flex-1 overflow-y-auto bg-surface-panel`,children:(0,Z.jsxs)(`div`,{className:`flex min-h-full w-full flex-col gap-4 px-3 py-5 sm:px-5 xl:px-6`,children:[V,je,Me,Pe,(0,Z.jsx)(`section`,{className:`grid w-full gap-2 sm:grid-cols-2 xl:grid-cols-4`,"aria-label":a.subtitleBoard,children:Vt.map(e=>{let t=R.get(e)?.length??0;return(0,Z.jsxs)(`button`,{type:`button`,className:l(`min-w-0 rounded-lg border border-edge-subtle bg-surface-base px-3 py-2 text-left shadow-surface`,`hover:bg-surface-hover/45`,W.focusRingPanel),onClick:()=>x(`operations`),children:[(0,Z.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,Z.jsx)(`span`,{className:`truncate text-xs font-medium text-fg-muted`,children:a.operationSections[e].title}),(0,Z.jsx)(`span`,{className:`font-mono text-sm font-semibold tabular-nums text-fg`,children:t})]}),(0,Z.jsx)(`p`,{className:`mt-1 truncate text-xs text-fg-subtle`,children:a.operationSections[e].description})]},e)})}),Fe,b===`operations`?(0,Z.jsx)(`div`,{className:`pb-3`,children:(0,Z.jsx)(`div`,{className:`grid w-full gap-4`,children:Vt.map(e=>{let t=R.get(e)??[];return(0,Z.jsxs)(`section`,{className:`rounded-lg border border-edge-subtle bg-surface-base shadow-surface`,children:[(0,Z.jsxs)(`header`,{className:`flex flex-wrap items-start justify-between gap-3 border-b border-edge-subtle px-4 py-3`,children:[(0,Z.jsxs)(`div`,{className:`min-w-0`,children:[(0,Z.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:a.operationSections[e].title}),(0,Z.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:a.operationSections[e].description})]}),(0,Z.jsx)(`span`,{className:`rounded-full bg-surface-hover px-2.5 py-1 text-xs font-semibold tabular-nums text-fg-muted`,children:t.length})]}),(0,Z.jsxs)(`div`,{className:`grid gap-2 p-2.5 md:grid-cols-2 xl:grid-cols-3`,children:[k&&t.length===0?Array.from({length:3}).map(en):t.map(e=>(0,Z.jsx)(St,{run:e,language:r,localeTag:i,nowMs:L,selected:!1,onOpen:S,onOpenChat:C,onCancel:e=>void M(e),onRetry:e=>void N(e)},e.id)),!k&&t.length===0?(0,Z.jsx)(`div`,{className:`flex min-h-24 items-center justify-center rounded-md border border-dashed border-edge bg-surface-panel/40 px-4 py-5 text-center text-xs text-fg-subtle md:col-span-2 xl:col-span-3`,children:a.operationSections[e].empty}):null]})]},e)})})}):(0,Z.jsx)(`div`,{className:`h-[min(72vh,48rem)] min-h-[24rem] w-full sm:min-h-[28rem]`,children:(0,Z.jsx)(kt,{runs:c,language:r,localeTag:i,labels:{boardEmptyTitle:a.boardEmptyTitle,boardEmptyHint:a.boardEmptyHint,boardStart:a.boardStart,loading:a.loading},searchQuery:u,workflowFilterId:g,triggerFilter:v,selectedRunId:null,loading:k,onOpenRun:S,onOpenRunChat:C,onCancelRun:e=>void M(e),onRetryRun:e=>void N(e),onStart:$t})}),Ue]})})}function $t(){return document.getElementById(`workflow-library`)?.scrollIntoView({behavior:`smooth`,block:`start`})}function en(e,t){return(0,Z.jsx)(qt,{},t)}function tn(e){return(0,Z.jsx)(me,{value:e.id,children:e.title},e.id)}function nn(){return document.getElementById(`workflow-library`)?.scrollIntoView({behavior:`smooth`,block:`start`})}function rn(){return document.getElementById(`workflow-library`)?.scrollIntoView({behavior:`smooth`,block:`start`})}function an(e){return e.clearPageHeader}function on(e){return e.setPageHeader}function sn(){let e=(0,X.c)(128),t=p(dn),n;e[0]===t?n=e[1]:(n=d(t),e[0]=t,e[1]=n);let r=n.workflows,i=t===`zh`?`zh-CN`:`en-US`,s=f(un),c=!!s,l=o(),[u,h]=a(),g;e[2]===u?g=e[3]:(g=u.get(`q`)??``,e[2]=u,e[3]=g);let _=g,v;e[4]===u?v=e[5]:(v=u.get(`wf`)?.trim()??``,e[4]=u,e[5]=v);let y=v,x;e[6]===u?x=e[7]:(x=u.get(`trigger`)?.trim()||`all`,e[6]=u,e[7]=x);let S=x,C,w;if(e[8]!==u){let t=u.get(`view`)?.trim()??``;C=u.get(`agent`)?.trim()??``,w=A.has(t)?t:`operations`,e[8]=u,e[9]=C,e[10]=w}else C=e[9],w=e[10];let D=w,[O,k]=(0,Y.useState)(null),[j,M]=(0,Y.useState)(null),N;e[11]!==c||e[12]!==s?(N=c?[`workflow-agents`,s]:null,e[11]=c,e[12]=s,e[13]=N):N=e[13];let P;e[14]===Symbol.for(`react.memo_cache_sentinel`)?(P={revalidateOnFocus:!1},e[14]=P):P=e[14];let I=m(N,He,P),L;bb0:{let e=I.data?.agents??[];if(C&&(e.length===0||e.some(e=>e.id===C))){L=C;break bb0}L=I.data?.defaultId}let R=L,z;e[15]!==c||e[16]!==s?(z=c?[`workflow-definitions`,s]:null,e[15]=c,e[16]=s,e[17]=z):z=e[17];let B;e[18]===Symbol.for(`react.memo_cache_sentinel`)?(B={revalidateOnFocus:!1},e[18]=B):B=e[18];let V=m(z,je,B),H;e[19]!==c||e[20]!==R||e[21]!==s?(H=c&&R?[`workflow-runs`,s,R]:null,e[19]=c,e[20]=R,e[21]=s,e[22]=H):H=e[22];let U;e[23]===R?U=e[24]:(U=()=>we(100,{ownerAgentId:R}),e[23]=R,e[24]=U);let ee;e[25]===Symbol.for(`react.memo_cache_sentinel`)?(ee={revalidateOnFocus:!1,refreshInterval:cn},e[25]=ee):ee=e[25];let W=m(H,U,ee),te;e[26]!==c||e[27]!==R||e[28]!==s||e[29]!==y?(te=c&&R?[`workflow-stats`,s,R,y]:null,e[26]=c,e[27]=R,e[28]=s,e[29]=y,e[30]=te):te=e[30];let ne;e[31]!==R||e[32]!==y?(ne=()=>be(y,{ownerAgentId:R}),e[31]=R,e[32]=y,e[33]=ne):ne=e[33];let G;e[34]===Symbol.for(`react.memo_cache_sentinel`)?(G={revalidateOnFocus:!1},e[34]=G):G=e[34];let re=m(te,ne,G),ie;e[35]===V.data?ie=e[36]:(ie=V.data??[],e[35]=V.data,e[36]=ie);let K=ie,ae;e[37]===W.data?ae=e[38]:(ae=W.data??[],e[37]=W.data,e[38]=ae);let oe=ae,se;e[39]!==K||e[40]!==_?(se=De(K,_,`all`,`all`),e[39]=K,e[40]=_,e[41]=se):se=e[41];let ce=se,le;e[42]===h?le=e[43]:(le=e=>{h(t=>{let n=new URLSearchParams(t);return e(n),n},{replace:!0})},e[42]=h,e[43]=le);let q=le,ue;e[44]===q?ue=e[45]:(ue=e=>q(t=>{let n=e.trim();n?t.set(`q`,n):t.delete(`q`)}),e[44]=q,e[45]=ue);let de=ue,fe;e[46]===q?fe=e[47]:(fe=e=>q(t=>{let n=e.trim();n?t.set(E,n):t.delete(E)}),e[46]=q,e[47]=fe);let me=fe,he;e[48]===q?he=e[49]:(he=e=>q(t=>{let n=e.trim();n?t.set(`wf`,n):t.delete(`wf`)}),e[48]=q,e[49]=he);let _e=he,ve;e[50]===q?ve=e[51]:(ve=e=>q(t=>{e&&e!==`all`?t.set(T,e):t.delete(T)}),e[50]=q,e[51]=ve);let ye=ve,xe;e[52]===q?xe=e[53]:(xe=e=>q(t=>{e===`operations`?t.delete(Ie):t.set(Ie,e)}),e[52]=q,e[53]=xe);let Se=xe,Ce=R?`?agentId=${encodeURIComponent(R)}`:``,J;e[54]!==l||e[55]!==Ce?(J=e=>l(`/workflows/${e.id}${Ce}`),e[54]=l,e[55]=Ce,e[56]=J):J=e[56];let Te=J,Ee=Te,Oe;e[57]!==l||e[58]!==R||e[59]!==Ce?(Oe=e=>{l(e.metadata.source===`user`?`/workflows/${e.id}/edit${Ce}`:`/workflows/new?copy=${encodeURIComponent(e.id)}${R?`&agentId=${encodeURIComponent(R)}`:``}`)},e[57]=l,e[58]=R,e[59]=Ce,e[60]=Oe):Oe=e[60];let ke=Oe,Ae;e[61]!==l||e[62]!==Ce?(Ae=e=>l(`/workflows/runs/${e.id}${Ce}`),e[61]=l,e[62]=Ce,e[63]=Ae):Ae=e[63];let Me=Ae,Ne;e[64]===l?Ne=e[65]:(Ne=e=>{let t=at(e);t&&l(b(t))},e[64]=l,e[65]=Ne);let Pe=Ne,Fe;e[66]!==r.cancelFailed||e[67]!==R||e[68]!==W||e[69]!==re?(Fe=async e=>{try{await pe(e,{ownerAgentId:R}),await Promise.all([W.mutate(),re.mutate()])}catch(e){let t=e;k(t instanceof Error?t.message:r.cancelFailed)}},e[66]=r.cancelFailed,e[67]=R,e[68]=W,e[69]=re,e[70]=Fe):Fe=e[70];let Le=Fe,Re;e[71]!==r.retryFailed||e[72]!==l||e[73]!==R||e[74]!==Ce?(Re=async e=>{try{l(`/workflows/runs/${(await Ye(e,{ownerAgentId:R})).runId}${Ce}`)}catch(e){let t=e;k(t instanceof Error?t.message:r.retryFailed)}},e[71]=r.retryFailed,e[72]=l,e[73]=R,e[74]=Ce,e[75]=Re):Re=e[75];let ze=Re,Be;e[76]!==V||e[77]!==r.deleteConfirm||e[78]!==r.deleteWorkflowFailed||e[79]!==r.deleteWorkflowSuccess?(Be=async e=>{if(e.metadata.source===`user`&&window.confirm(F(r.deleteConfirm,{name:e.name})))try{await ge(e.id),await V.mutate(),M(r.deleteWorkflowSuccess)}catch(e){let t=e;k(t instanceof Error?t.message:r.deleteWorkflowFailed)}},e[76]=V,e[77]=r.deleteConfirm,e[78]=r.deleteWorkflowFailed,e[79]=r.deleteWorkflowSuccess,e[80]=Be):Be=e[80];let Ve=Be,Ue,We;e[81]===j?(Ue=e[82],We=e[83]):(Ue=()=>{if(!j)return;let e=window.setTimeout(()=>M(null),4e3);return()=>window.clearTimeout(e)},We=[j],e[81]=j,e[82]=Ue,e[83]=We),(0,Y.useEffect)(Ue,We);let Ge,Ke;e[84]!==W||e[85]!==re?(Ge=()=>{let e=()=>void Promise.all([W.mutate(),re.mutate()]);return window.addEventListener(`workflow-run-updated`,e),window.addEventListener(`workflow-run-error`,e),()=>{window.removeEventListener(`workflow-run-updated`,e),window.removeEventListener(`workflow-run-error`,e)}},Ke=[W,re],e[84]=W,e[85]=re,e[86]=Ge,e[87]=Ke):(Ge=e[86],Ke=e[87]),(0,Y.useEffect)(Ge,Ke);let qe;e[88]!==I||e[89]!==V||e[90]!==W||e[91]!==re?(qe=()=>{Promise.all([I.mutate(),V.mutate(),W.mutate(),re.mutate()])},e[88]=I,e[89]=V,e[90]=W,e[91]=re,e[92]=qe):qe=e[92];let Je=qe,Xe=I.isLoading||V.isLoading||W.isLoading,Ze=I.error?.message??V.error?.message??W.error?.message??null,Qe;e[93]===I.data?.agents?Qe=e[94]:(Qe=I.data?.agents??[],e[93]=I.data?.agents,e[94]=Qe);let $e;return e[95]!==O||e[96]!==j||e[97]!==Le||e[98]!==K||e[99]!==Ze||e[100]!==ce||e[101]!==c||e[102]!==r||e[103]!==t||e[104]!==Xe||e[105]!==i||e[106]!==Te||e[107]!==Me||e[108]!==Pe||e[109]!==ke||e[110]!==R||e[111]!==Je||e[112]!==Ve||e[113]!==ze||e[114]!==oe||e[115]!==_||e[116]!==me||e[117]!==de||e[118]!==ye||e[119]!==Se||e[120]!==_e||e[121]!==Ee||e[122]!==re.data||e[123]!==Qe||e[124]!==S||e[125]!==D||e[126]!==y?($e={language:t,localeTag:i,labels:r,hasToken:c,searchQuery:_,setSearchQuery:de,ownerAgentId:R,agentOptions:Qe,setOwnerAgentId:me,workflowFilterId:y,setWorkflowFilterId:_e,triggerFilter:S,setTriggerFilter:ye,viewMode:D,setViewMode:Se,definitions:K,filteredDefinitions:ce,runs:oe,openDefinitionDetails:Te,startWorkflow:Ee,openWorkflowEditor:ke,openRunDetails:Me,openRunInChat:Pe,actionError:O,actionFeedback:j,loading:Xe,error:Ze,stats:re.data,refreshAll:Je,cancelRun:Le,retryRun:ze,removeCustomWorkflow:Ve},e[95]=O,e[96]=j,e[97]=Le,e[98]=K,e[99]=Ze,e[100]=ce,e[101]=c,e[102]=r,e[103]=t,e[104]=Xe,e[105]=i,e[106]=Te,e[107]=Me,e[108]=Pe,e[109]=ke,e[110]=R,e[111]=Je,e[112]=Ve,e[113]=ze,e[114]=oe,e[115]=_,e[116]=me,e[117]=de,e[118]=ye,e[119]=Se,e[120]=_e,e[121]=Ee,e[122]=re.data,e[123]=Qe,e[124]=S,e[125]=D,e[126]=y,e[127]=$e):$e=e[127],$e}function cn(e){return e?.some(ln)?3e3:0}function ln(e){return e.status===`queued`||e.status===`running`}function un(e){return e.token}function dn(e){return e.language}function fn(){let e=(0,X.c)(2),t=sn(),n;return e[0]===t?n=e[1]:(n=(0,Z.jsx)(Qt,{vm:t}),e[0]=t,e[1]=n),n}function pn(e){if(typeof e==`string`||typeof e==`number`)return``+e;let t=``;if(Array.isArray(e))for(let n=0,r;n<e.length;n++)(r=pn(e[n]))!==``&&(t+=(t&&` `)+r);else for(let n in e)e[n]&&(t+=(t&&` `)+n);return t}var mn={value:()=>{}};function hn(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+``)||r in n||/[\s.]/.test(r))throw Error(`illegal type: `+r);n[r]=[]}return new gn(n)}function gn(e){this._=e}function _n(e,t){return e.trim().split(/^|\s+/).map(function(e){var n=``,r=e.indexOf(`.`);if(r>=0&&(n=e.slice(r+1),e=e.slice(0,r)),e&&!t.hasOwnProperty(e))throw Error(`unknown type: `+e);return{type:e,name:n}})}gn.prototype=hn.prototype={constructor:gn,on:function(e,t){var n=this._,r=_n(e+``,n),i,a=-1,o=r.length;if(arguments.length<2){for(;++a<o;)if((i=(e=r[a]).type)&&(i=vn(n[i],e.name)))return i;return}if(t!=null&&typeof t!=`function`)throw Error(`invalid callback: `+t);for(;++a<o;)if(i=(e=r[a]).type)n[i]=yn(n[i],e.name,t);else if(t==null)for(i in n)n[i]=yn(n[i],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new gn(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var n=Array(i),r=0,i,a;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw Error(`unknown type: `+e);for(a=this._[e],r=0,i=a.length;r<i;++r)a[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw Error(`unknown type: `+e);for(var r=this._[e],i=0,a=r.length;i<a;++i)r[i].value.apply(t,n)}};function vn(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function yn(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=mn,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var bn={svg:`http://www.w3.org/2000/svg`,xhtml:`http://www.w3.org/1999/xhtml`,xlink:`http://www.w3.org/1999/xlink`,xml:`http://www.w3.org/XML/1998/namespace`,xmlns:`http://www.w3.org/2000/xmlns/`};function xn(e){var t=e+=``,n=t.indexOf(`:`);return n>=0&&(t=e.slice(0,n))!==`xmlns`&&(e=e.slice(n+1)),bn.hasOwnProperty(t)?{space:bn[t],local:e}:e}function Sn(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===`http://www.w3.org/1999/xhtml`&&t.documentElement.namespaceURI===`http://www.w3.org/1999/xhtml`?t.createElement(e):t.createElementNS(n,e)}}function Cn(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function wn(e){var t=xn(e);return(t.local?Cn:Sn)(t)}function Tn(){}function En(e){return e==null?Tn:function(){return this.querySelector(e)}}function Dn(e){typeof e!=`function`&&(e=En(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=Array(o),c,l,u=0;u<o;++u)(c=a[u])&&(l=e.call(c,c.__data__,u,a))&&(`__data__`in c&&(l.__data__=c.__data__),s[u]=l);return new hi(r,this._parents)}function On(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function kn(){return[]}function An(e){return e==null?kn:function(){return this.querySelectorAll(e)}}function jn(e){return function(){return On(e.apply(this,arguments))}}function Mn(e){e=typeof e==`function`?jn(e):An(e);for(var t=this._groups,n=t.length,r=[],i=[],a=0;a<n;++a)for(var o=t[a],s=o.length,c,l=0;l<s;++l)(c=o[l])&&(r.push(e.call(c,c.__data__,l,o)),i.push(c));return new hi(r,i)}function Nn(e){return function(){return this.matches(e)}}function Pn(e){return function(t){return t.matches(e)}}var Fn=Array.prototype.find;function In(e){return function(){return Fn.call(this.children,e)}}function Ln(){return this.firstElementChild}function Rn(e){return this.select(e==null?Ln:In(typeof e==`function`?e:Pn(e)))}var zn=Array.prototype.filter;function Bn(){return Array.from(this.children)}function Vn(e){return function(){return zn.call(this.children,e)}}function Hn(e){return this.selectAll(e==null?Bn:Vn(typeof e==`function`?e:Pn(e)))}function Un(e){typeof e!=`function`&&(e=Nn(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=[],c,l=0;l<o;++l)(c=a[l])&&e.call(c,c.__data__,l,a)&&s.push(c);return new hi(r,this._parents)}function Wn(e){return Array(e.length)}function Gn(){return new hi(this._enter||this._groups.map(Wn),this._parents)}function Kn(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Kn.prototype={constructor:Kn,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function qn(e){return function(){return e}}function Jn(e,t,n,r,i,a){for(var o=0,s,c=t.length,l=a.length;o<l;++o)(s=t[o])?(s.__data__=a[o],r[o]=s):n[o]=new Kn(e,a[o]);for(;o<c;++o)(s=t[o])&&(i[o]=s)}function Yn(e,t,n,r,i,a,o){var s,c,l=new Map,u=t.length,d=a.length,f=Array(u),p;for(s=0;s<u;++s)(c=t[s])&&(f[s]=p=o.call(c,c.__data__,s,t)+``,l.has(p)?i[s]=c:l.set(p,c));for(s=0;s<d;++s)p=o.call(e,a[s],s,a)+``,(c=l.get(p))?(r[s]=c,c.__data__=a[s],l.delete(p)):n[s]=new Kn(e,a[s]);for(s=0;s<u;++s)(c=t[s])&&l.get(f[s])===c&&(i[s]=c)}function Xn(e){return e.__data__}function Zn(e,t){if(!arguments.length)return Array.from(this,Xn);var n=t?Yn:Jn,r=this._parents,i=this._groups;typeof e!=`function`&&(e=qn(e));for(var a=i.length,o=Array(a),s=Array(a),c=Array(a),l=0;l<a;++l){var u=r[l],d=i[l],f=d.length,p=Qn(e.call(u,u&&u.__data__,l,r)),m=p.length,h=s[l]=Array(m),g=o[l]=Array(m);n(u,d,h,g,c[l]=Array(f),p,t);for(var _=0,v=0,y,b;_<m;++_)if(y=h[_]){for(_>=v&&(v=_+1);!(b=g[v])&&++v<m;);y._next=b||null}}return o=new hi(o,r),o._enter=s,o._exit=c,o}function Qn(e){return typeof e==`object`&&`length`in e?e:Array.from(e)}function $n(){return new hi(this._exit||this._groups.map(Wn),this._parents)}function er(e,t,n){var r=this.enter(),i=this,a=this.exit();return typeof e==`function`?(r=e(r),r&&=r.selection()):r=r.append(e+``),t!=null&&(i=t(i),i&&=i.selection()),n==null?a.remove():n(a),r&&i?r.merge(i).order():i}function tr(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,i=n.length,a=r.length,o=Math.min(i,a),s=Array(i),c=0;c<o;++c)for(var l=n[c],u=r[c],d=l.length,f=s[c]=Array(d),p,m=0;m<d;++m)(p=l[m]||u[m])&&(f[m]=p);for(;c<i;++c)s[c]=n[c];return new hi(s,this._parents)}function nr(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],i=r.length-1,a=r[i],o;--i>=0;)(o=r[i])&&(a&&o.compareDocumentPosition(a)^4&&a.parentNode.insertBefore(o,a),a=o);return this}function rr(e){e||=ir;function t(t,n){return t&&n?e(t.__data__,n.__data__):!t-!n}for(var n=this._groups,r=n.length,i=Array(r),a=0;a<r;++a){for(var o=n[a],s=o.length,c=i[a]=Array(s),l,u=0;u<s;++u)(l=o[u])&&(c[u]=l);c.sort(t)}return new hi(i,this._parents).order()}function ir(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function ar(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function or(){return Array.from(this)}function sr(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,a=r.length;i<a;++i){var o=r[i];if(o)return o}return null}function cr(){let e=0;for(let t of this)++e;return e}function lr(){return!this.node()}function ur(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var i=t[n],a=0,o=i.length,s;a<o;++a)(s=i[a])&&e.call(s,s.__data__,a,i);return this}function dr(e){return function(){this.removeAttribute(e)}}function fr(e){return function(){this.removeAttributeNS(e.space,e.local)}}function pr(e,t){return function(){this.setAttribute(e,t)}}function mr(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function hr(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function gr(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function _r(e,t){var n=xn(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((t==null?n.local?fr:dr:typeof t==`function`?n.local?gr:hr:n.local?mr:pr)(n,t))}function vr(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function yr(e){return function(){this.style.removeProperty(e)}}function br(e,t,n){return function(){this.style.setProperty(e,t,n)}}function xr(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function Sr(e,t,n){return arguments.length>1?this.each((t==null?yr:typeof t==`function`?xr:br)(e,t,n??``)):Cr(this.node(),e)}function Cr(e,t){return e.style.getPropertyValue(t)||vr(e).getComputedStyle(e,null).getPropertyValue(t)}function wr(e){return function(){delete this[e]}}function Tr(e,t){return function(){this[e]=t}}function Er(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function Dr(e,t){return arguments.length>1?this.each((t==null?wr:typeof t==`function`?Er:Tr)(e,t)):this.node()[e]}function Or(e){return e.trim().split(/^|\s+/)}function kr(e){return e.classList||new Ar(e)}function Ar(e){this._node=e,this._names=Or(e.getAttribute(`class`)||``)}Ar.prototype={add:function(e){this._names.indexOf(e)<0&&(this._names.push(e),this._node.setAttribute(`class`,this._names.join(` `)))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute(`class`,this._names.join(` `)))},contains:function(e){return this._names.indexOf(e)>=0}};function jr(e,t){for(var n=kr(e),r=-1,i=t.length;++r<i;)n.add(t[r])}function Mr(e,t){for(var n=kr(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}function Nr(e){return function(){jr(this,e)}}function Pr(e){return function(){Mr(this,e)}}function Fr(e,t){return function(){(t.apply(this,arguments)?jr:Mr)(this,e)}}function Ir(e,t){var n=Or(e+``);if(arguments.length<2){for(var r=kr(this.node()),i=-1,a=n.length;++i<a;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof t==`function`?Fr:t?Nr:Pr)(n,t))}function Lr(){this.textContent=``}function Rr(e){return function(){this.textContent=e}}function zr(e){return function(){var t=e.apply(this,arguments);this.textContent=t??``}}function Br(e){return arguments.length?this.each(e==null?Lr:(typeof e==`function`?zr:Rr)(e)):this.node().textContent}function Vr(){this.innerHTML=``}function Hr(e){return function(){this.innerHTML=e}}function Ur(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??``}}function Wr(e){return arguments.length?this.each(e==null?Vr:(typeof e==`function`?Ur:Hr)(e)):this.node().innerHTML}function Gr(){this.nextSibling&&this.parentNode.appendChild(this)}function Kr(){return this.each(Gr)}function qr(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Jr(){return this.each(qr)}function Yr(e){var t=typeof e==`function`?e:wn(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function Xr(){return null}function Zr(e,t){var n=typeof e==`function`?e:wn(e),r=t==null?Xr:typeof t==`function`?t:En(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function Qr(){var e=this.parentNode;e&&e.removeChild(this)}function $r(){return this.each(Qr)}function ei(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function ti(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function ni(e){return this.select(e?ti:ei)}function ri(e){return arguments.length?this.property(`__data__`,e):this.node().__data__}function ii(e){return function(t){e.call(this,t,this.__data__)}}function ai(e){return e.trim().split(/^|\s+/).map(function(e){var t=``,n=e.indexOf(`.`);return n>=0&&(t=e.slice(n+1),e=e.slice(0,n)),{type:e,name:t}})}function oi(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,i=t.length,a;n<i;++n)a=t[n],(!e.type||a.type===e.type)&&a.name===e.name?this.removeEventListener(a.type,a.listener,a.options):t[++r]=a;++r?t.length=r:delete this.__on}}}function si(e,t,n){return function(){var r=this.__on,i,a=ii(t);if(r){for(var o=0,s=r.length;o<s;++o)if((i=r[o]).type===e.type&&i.name===e.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=a,i.options=n),i.value=t;return}}this.addEventListener(e.type,a,n),i={type:e.type,name:e.name,value:t,listener:a,options:n},r?r.push(i):this.__on=[i]}}function ci(e,t,n){var r=ai(e+``),i,a=r.length,o;if(arguments.length<2){var s=this.node().__on;if(s){for(var c=0,l=s.length,u;c<l;++c)for(i=0,u=s[c];i<a;++i)if((o=r[i]).type===u.type&&o.name===u.name)return u.value}return}for(s=t?si:oi,i=0;i<a;++i)this.each(s(r[i],t,n));return this}function li(e,t,n){var r=vr(e),i=r.CustomEvent;typeof i==`function`?i=new i(t,n):(i=r.document.createEvent(`Event`),n?(i.initEvent(t,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(t,!1,!1)),e.dispatchEvent(i)}function ui(e,t){return function(){return li(this,e,t)}}function di(e,t){return function(){return li(this,e,t.apply(this,arguments))}}function fi(e,t){return this.each((typeof t==`function`?di:ui)(e,t))}function*pi(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,a=r.length,o;i<a;++i)(o=r[i])&&(yield o)}var mi=[null];function hi(e,t){this._groups=e,this._parents=t}function gi(){return new hi([[document.documentElement]],mi)}function _i(){return this}hi.prototype=gi.prototype={constructor:hi,select:Dn,selectAll:Mn,selectChild:Rn,selectChildren:Hn,filter:Un,data:Zn,enter:Gn,exit:$n,join:er,merge:tr,selection:_i,order:nr,sort:rr,call:ar,nodes:or,node:sr,size:cr,empty:lr,each:ur,attr:_r,style:Sr,property:Dr,classed:Ir,text:Br,html:Wr,raise:Kr,lower:Jr,append:Yr,insert:Zr,remove:$r,clone:ni,datum:ri,on:ci,dispatch:fi,[Symbol.iterator]:pi};function vi(e){return typeof e==`string`?new hi([[document.querySelector(e)]],[document.documentElement]):new hi([[e]],mi)}function yi(e){let t;for(;t=e.sourceEvent;)e=t;return e}function bi(e,t){if(e=yi(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,r=r.matrixTransform(t.getScreenCTM().inverse()),[r.x,r.y]}if(t.getBoundingClientRect){var i=t.getBoundingClientRect();return[e.clientX-i.left-t.clientLeft,e.clientY-i.top-t.clientTop]}}return[e.pageX,e.pageY]}var xi={passive:!1},Si={capture:!0,passive:!1};function Ci(e){e.stopImmediatePropagation()}function wi(e){e.preventDefault(),e.stopImmediatePropagation()}function Ti(e){var t=e.document.documentElement,n=vi(e).on(`dragstart.drag`,wi,Si);`onselectstart`in t?n.on(`selectstart.drag`,wi,Si):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect=`none`)}function Ei(e,t){var n=e.document.documentElement,r=vi(e).on(`dragstart.drag`,null);t&&(r.on(`click.drag`,wi,Si),setTimeout(function(){r.on(`click.drag`,null)},0)),`onselectstart`in n?r.on(`selectstart.drag`,null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}var Di=e=>()=>e;function Oi(e,{sourceEvent:t,subject:n,target:r,identifier:i,active:a,x:o,y:s,dx:c,dy:l,dispatch:u}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:i,enumerable:!0,configurable:!0},active:{value:a,enumerable:!0,configurable:!0},x:{value:o,enumerable:!0,configurable:!0},y:{value:s,enumerable:!0,configurable:!0},dx:{value:c,enumerable:!0,configurable:!0},dy:{value:l,enumerable:!0,configurable:!0},_:{value:u}})}Oi.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function ki(e){return!e.ctrlKey&&!e.button}function Ai(){return this.parentNode}function ji(e,t){return t??{x:e.x,y:e.y}}function Mi(){return navigator.maxTouchPoints||`ontouchstart`in this}function Ni(){var e=ki,t=Ai,n=ji,r=Mi,i={},a=hn(`start`,`drag`,`end`),o=0,s,c,l,u,d=0;function f(e){e.on(`mousedown.drag`,p).filter(r).on(`touchstart.drag`,g).on(`touchmove.drag`,_,xi).on(`touchend.drag touchcancel.drag`,v).style(`touch-action`,`none`).style(`-webkit-tap-highlight-color`,`rgba(0,0,0,0)`)}function p(n,r){if(!(u||!e.call(this,n,r))){var i=y(this,t.call(this,n,r),n,r,`mouse`);i&&(vi(n.view).on(`mousemove.drag`,m,Si).on(`mouseup.drag`,h,Si),Ti(n.view),Ci(n),l=!1,s=n.clientX,c=n.clientY,i(`start`,n))}}function m(e){if(wi(e),!l){var t=e.clientX-s,n=e.clientY-c;l=t*t+n*n>d}i.mouse(`drag`,e)}function h(e){vi(e.view).on(`mousemove.drag mouseup.drag`,null),Ei(e.view,l),wi(e),i.mouse(`end`,e)}function g(n,r){if(e.call(this,n,r)){var i=n.changedTouches,a=t.call(this,n,r),o=i.length,s,c;for(s=0;s<o;++s)(c=y(this,a,n,r,i[s].identifier,i[s]))&&(Ci(n),c(`start`,n,i[s]))}}function _(e){var t=e.changedTouches,n=t.length,r,a;for(r=0;r<n;++r)(a=i[t[r].identifier])&&(wi(e),a(`drag`,e,t[r]))}function v(e){var t=e.changedTouches,n=t.length,r,a;for(u&&clearTimeout(u),u=setTimeout(function(){u=null},500),r=0;r<n;++r)(a=i[t[r].identifier])&&(Ci(e),a(`end`,e,t[r]))}function y(e,t,r,s,c,l){var u=a.copy(),d=bi(l||r,t),p,m,h;if((h=n.call(e,new Oi(`beforestart`,{sourceEvent:r,target:f,identifier:c,active:o,x:d[0],y:d[1],dx:0,dy:0,dispatch:u}),s))!=null)return p=h.x-d[0]||0,m=h.y-d[1]||0,function n(r,a,l){var g=d,_;switch(r){case`start`:i[c]=n,_=o++;break;case`end`:delete i[c],--o;case`drag`:d=bi(l||a,t),_=o;break}u.call(r,e,new Oi(r,{sourceEvent:a,subject:h,target:f,identifier:c,active:_,x:d[0]+p,y:d[1]+m,dx:d[0]-g[0],dy:d[1]-g[1],dispatch:u}),s)}}return f.filter=function(t){return arguments.length?(e=typeof t==`function`?t:Di(!!t),f):e},f.container=function(e){return arguments.length?(t=typeof e==`function`?e:Di(e),f):t},f.subject=function(e){return arguments.length?(n=typeof e==`function`?e:Di(e),f):n},f.touchable=function(e){return arguments.length?(r=typeof e==`function`?e:Di(!!e),f):r},f.on=function(){var e=a.on.apply(a,arguments);return e===a?f:e},f.clickDistance=function(e){return arguments.length?(d=(e=+e)*e,f):Math.sqrt(d)},f}function Pi(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Fi(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Ii(){}var Li=.7,Ri=1/Li,zi=`\\s*([+-]?\\d+)\\s*`,Bi=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*`,Vi=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*`,Hi=/^#([0-9a-f]{3,8})$/,Ui=RegExp(`^rgb\\(${zi},${zi},${zi}\\)$`),Wi=RegExp(`^rgb\\(${Vi},${Vi},${Vi}\\)$`),Gi=RegExp(`^rgba\\(${zi},${zi},${zi},${Bi}\\)$`),Ki=RegExp(`^rgba\\(${Vi},${Vi},${Vi},${Bi}\\)$`),qi=RegExp(`^hsl\\(${Bi},${Vi},${Vi}\\)$`),Ji=RegExp(`^hsla\\(${Bi},${Vi},${Vi},${Bi}\\)$`),Yi={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};Pi(Ii,ea,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Xi,formatHex:Xi,formatHex8:Zi,formatHsl:Qi,formatRgb:$i,toString:$i});function Xi(){return this.rgb().formatHex()}function Zi(){return this.rgb().formatHex8()}function Qi(){return pa(this).formatHsl()}function $i(){return this.rgb().formatRgb()}function ea(e){var t,n;return e=(e+``).trim().toLowerCase(),(t=Hi.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?ta(t):n===3?new aa(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?na(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?na(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=Ui.exec(e))?new aa(t[1],t[2],t[3],1):(t=Wi.exec(e))?new aa(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=Gi.exec(e))?na(t[1],t[2],t[3],t[4]):(t=Ki.exec(e))?na(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=qi.exec(e))?fa(t[1],t[2]/100,t[3]/100,1):(t=Ji.exec(e))?fa(t[1],t[2]/100,t[3]/100,t[4]):Yi.hasOwnProperty(e)?ta(Yi[e]):e===`transparent`?new aa(NaN,NaN,NaN,0):null}function ta(e){return new aa(e>>16&255,e>>8&255,e&255,1)}function na(e,t,n,r){return r<=0&&(e=t=n=NaN),new aa(e,t,n,r)}function ra(e){return e instanceof Ii||(e=ea(e)),e?(e=e.rgb(),new aa(e.r,e.g,e.b,e.opacity)):new aa}function ia(e,t,n,r){return arguments.length===1?ra(e):new aa(e,t,n,r??1)}function aa(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}Pi(aa,ia,Fi(Ii,{brighter(e){return e=e==null?Ri:Ri**+e,new aa(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Li:Li**+e,new aa(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new aa(ua(this.r),ua(this.g),ua(this.b),la(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:oa,formatHex:oa,formatHex8:sa,formatRgb:ca,toString:ca}));function oa(){return`#${da(this.r)}${da(this.g)}${da(this.b)}`}function sa(){return`#${da(this.r)}${da(this.g)}${da(this.b)}${da((isNaN(this.opacity)?1:this.opacity)*255)}`}function ca(){let e=la(this.opacity);return`${e===1?`rgb(`:`rgba(`}${ua(this.r)}, ${ua(this.g)}, ${ua(this.b)}${e===1?`)`:`, ${e})`}`}function la(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function ua(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function da(e){return e=ua(e),(e<16?`0`:``)+e.toString(16)}function fa(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new ha(e,t,n,r)}function pa(e){if(e instanceof ha)return new ha(e.h,e.s,e.l,e.opacity);if(e instanceof Ii||(e=ea(e)),!e)return new ha;if(e instanceof ha)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),a=Math.max(t,n,r),o=NaN,s=a-i,c=(a+i)/2;return s?(o=t===a?(n-r)/s+(n<r)*6:n===a?(r-t)/s+2:(t-n)/s+4,s/=c<.5?a+i:2-a-i,o*=60):s=c>0&&c<1?0:o,new ha(o,s,c,e.opacity)}function ma(e,t,n,r){return arguments.length===1?pa(e):new ha(e,t,n,r??1)}function ha(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}Pi(ha,ma,Fi(Ii,{brighter(e){return e=e==null?Ri:Ri**+e,new ha(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Li:Li**+e,new ha(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new aa(va(e>=240?e-240:e+120,i,r),va(e,i,r),va(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new ha(ga(this.h),_a(this.s),_a(this.l),la(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(){let e=la(this.opacity);return`${e===1?`hsl(`:`hsla(`}${ga(this.h)}, ${_a(this.s)*100}%, ${_a(this.l)*100}%${e===1?`)`:`, ${e})`}`}}));function ga(e){return e=(e||0)%360,e<0?e+360:e}function _a(e){return Math.max(0,Math.min(1,e||0))}function va(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}var ya=e=>()=>e;function ba(e,t){return function(n){return e+n*t}}function xa(e,t,n){return e**=+n,t=t**+n-e,n=1/n,function(r){return(e+r*t)**+n}}function Sa(e){return(e=+e)==1?Ca:function(t,n){return n-t?xa(t,n,e):ya(isNaN(t)?n:t)}}function Ca(e,t){var n=t-e;return n?ba(e,n):ya(isNaN(e)?t:e)}var wa=(function e(t){var n=Sa(t);function r(e,t){var r=n((e=ia(e)).r,(t=ia(t)).r),i=n(e.g,t.g),a=n(e.b,t.b),o=Ca(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=i(t),e.b=a(t),e.opacity=o(t),e+``}}return r.gamma=e,r})(1);function Ta(e,t){t||=[];var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(a){for(i=0;i<n;++i)r[i]=e[i]*(1-a)+t[i]*a;return r}}function Ea(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function Da(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,i=Array(r),a=Array(n),o;for(o=0;o<r;++o)i[o]=Ia(e[o],t[o]);for(;o<n;++o)a[o]=t[o];return function(e){for(o=0;o<r;++o)a[o]=i[o](e);return a}}function Oa(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function ka(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function Aa(e,t){var n={},r={},i;for(i in(typeof e!=`object`||!e)&&(e={}),(typeof t!=`object`||!t)&&(t={}),t)i in e?n[i]=Ia(e[i],t[i]):r[i]=t[i];return function(e){for(i in n)r[i]=n[i](e);return r}}var ja=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Ma=new RegExp(ja.source,`g`);function Na(e){return function(){return e}}function Pa(e){return function(t){return e(t)+``}}function Fa(e,t){var n=ja.lastIndex=Ma.lastIndex=0,r,i,a,o=-1,s=[],c=[];for(e+=``,t+=``;(r=ja.exec(e))&&(i=Ma.exec(t));)(a=i.index)>n&&(a=t.slice(n,a),s[o]?s[o]+=a:s[++o]=a),(r=r[0])===(i=i[0])?s[o]?s[o]+=i:s[++o]=i:(s[++o]=null,c.push({i:o,x:ka(r,i)})),n=Ma.lastIndex;return n<t.length&&(a=t.slice(n),s[o]?s[o]+=a:s[++o]=a),s.length<2?c[0]?Pa(c[0].x):Na(t):(t=c.length,function(e){for(var n=0,r;n<t;++n)s[(r=c[n]).i]=r.x(e);return s.join(``)})}function Ia(e,t){var n=typeof t,r;return t==null||n===`boolean`?ya(t):(n===`number`?ka:n===`string`?(r=ea(t))?(t=r,wa):Fa:t instanceof ea?wa:t instanceof Date?Oa:Ea(t)?Ta:Array.isArray(t)?Da:typeof t.valueOf!=`function`&&typeof t.toString!=`function`||isNaN(t)?Aa:ka)(e,t)}var La=180/Math.PI,Ra={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function za(e,t,n,r,i,a){var o,s,c;return(o=Math.sqrt(e*e+t*t))&&(e/=o,t/=o),(c=e*n+t*r)&&(n-=e*c,r-=t*c),(s=Math.sqrt(n*n+r*r))&&(n/=s,r/=s,c/=s),e*r<t*n&&(e=-e,t=-t,c=-c,o=-o),{translateX:i,translateY:a,rotate:Math.atan2(t,e)*La,skewX:Math.atan(c)*La,scaleX:o,scaleY:s}}var Ba;function Va(e){let t=new(typeof DOMMatrix==`function`?DOMMatrix:WebKitCSSMatrix)(e+``);return t.isIdentity?Ra:za(t.a,t.b,t.c,t.d,t.e,t.f)}function Ha(e){return e==null||(Ba||=document.createElementNS(`http://www.w3.org/2000/svg`,`g`),Ba.setAttribute(`transform`,e),!(e=Ba.transform.baseVal.consolidate()))?Ra:(e=e.matrix,za(e.a,e.b,e.c,e.d,e.e,e.f))}function Ua(e,t,n,r){function i(e){return e.length?e.pop()+` `:``}function a(e,r,i,a,o,s){if(e!==i||r!==a){var c=o.push(`translate(`,null,t,null,n);s.push({i:c-4,x:ka(e,i)},{i:c-2,x:ka(r,a)})}else (i||a)&&o.push(`translate(`+i+t+a+n)}function o(e,t,n,a){e===t?t&&n.push(i(n)+`rotate(`+t+r):(e-t>180?t+=360:t-e>180&&(e+=360),a.push({i:n.push(i(n)+`rotate(`,null,r)-2,x:ka(e,t)}))}function s(e,t,n,a){e===t?t&&n.push(i(n)+`skewX(`+t+r):a.push({i:n.push(i(n)+`skewX(`,null,r)-2,x:ka(e,t)})}function c(e,t,n,r,a,o){if(e!==n||t!==r){var s=a.push(i(a)+`scale(`,null,`,`,null,`)`);o.push({i:s-4,x:ka(e,n)},{i:s-2,x:ka(t,r)})}else (n!==1||r!==1)&&a.push(i(a)+`scale(`+n+`,`+r+`)`)}return function(t,n){var r=[],i=[];return t=e(t),n=e(n),a(t.translateX,t.translateY,n.translateX,n.translateY,r,i),o(t.rotate,n.rotate,r,i),s(t.skewX,n.skewX,r,i),c(t.scaleX,t.scaleY,n.scaleX,n.scaleY,r,i),t=n=null,function(e){for(var t=-1,n=i.length,a;++t<n;)r[(a=i[t]).i]=a.x(e);return r.join(``)}}}var Wa=Ua(Va,`px, `,`px)`,`deg)`),Ga=Ua(Ha,`, `,`)`,`)`),Ka=1e-12;function qa(e){return((e=Math.exp(e))+1/e)/2}function Ja(e){return((e=Math.exp(e))-1/e)/2}function Ya(e){return((e=Math.exp(2*e))-1)/(e+1)}var Xa=(function e(t,n,r){function i(e,i){var a=e[0],o=e[1],s=e[2],c=i[0],l=i[1],u=i[2],d=c-a,f=l-o,p=d*d+f*f,m,h;if(p<Ka)h=Math.log(u/s)/t,m=function(e){return[a+e*d,o+e*f,s*Math.exp(t*e*h)]};else{var g=Math.sqrt(p),_=(u*u-s*s+r*p)/(2*s*n*g),v=(u*u-s*s-r*p)/(2*u*n*g),y=Math.log(Math.sqrt(_*_+1)-_);h=(Math.log(Math.sqrt(v*v+1)-v)-y)/t,m=function(e){var r=e*h,i=qa(y),c=s/(n*g)*(i*Ya(t*r+y)-Ja(y));return[a+c*d,o+c*f,s*i/qa(t*r+y)]}}return m.duration=h*1e3*t/Math.SQRT2,m}return i.rho=function(t){var n=Math.max(.001,+t),r=n*n;return e(n,r,r*r)},i})(Math.SQRT2,2,4),Za=0,Qa=0,$a=0,eo=1e3,to,no,ro=0,io=0,ao=0,oo=typeof performance==`object`&&performance.now?performance:Date,so=typeof window==`object`&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function co(){return io||=(so(lo),oo.now()+ao)}function lo(){io=0}function uo(){this._call=this._time=this._next=null}uo.prototype=fo.prototype={constructor:uo,restart:function(e,t,n){if(typeof e!=`function`)throw TypeError(`callback is not a function`);n=(n==null?co():+n)+(t==null?0:+t),!this._next&&no!==this&&(no?no._next=this:to=this,no=this),this._call=e,this._time=n,_o()},stop:function(){this._call&&(this._call=null,this._time=1/0,_o())}};function fo(e,t,n){var r=new uo;return r.restart(e,t,n),r}function po(){co(),++Za;for(var e=to,t;e;)(t=io-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Za}function mo(){io=(ro=oo.now())+ao,Za=Qa=0;try{po()}finally{Za=0,go(),io=0}}function ho(){var e=oo.now(),t=e-ro;t>eo&&(ao-=t,ro=e)}function go(){for(var e,t=to,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:to=n);no=e,_o(r)}function _o(e){Za||(Qa&&=clearTimeout(Qa),e-io>24?(e<1/0&&(Qa=setTimeout(mo,e-oo.now()-ao)),$a&&=clearInterval($a)):($a||=(ro=oo.now(),setInterval(ho,eo)),Za=1,so(mo)))}function vo(e,t,n){var r=new uo;return t=t==null?0:+t,r.restart(n=>{r.stop(),e(n+t)},t,n),r}var yo=hn(`start`,`end`,`cancel`,`interrupt`),bo=[];function xo(e,t,n,r,i,a){var o=e.__transition;if(!o)e.__transition={};else if(n in o)return;To(e,n,{name:t,index:r,group:i,on:yo,tween:bo,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:0})}function So(e,t){var n=wo(e,t);if(n.state>0)throw Error(`too late; already scheduled`);return n}function Co(e,t){var n=wo(e,t);if(n.state>3)throw Error(`too late; already running`);return n}function wo(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw Error(`transition not found`);return n}function To(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=fo(a,0,n.time);function a(e){n.state=1,n.timer.restart(o,n.delay,n.time),n.delay<=e&&o(e-n.delay)}function o(a){var l,u,d,f;if(n.state!==1)return c();for(l in r)if(f=r[l],f.name===n.name){if(f.state===3)return vo(o);f.state===4?(f.state=6,f.timer.stop(),f.on.call(`interrupt`,e,e.__data__,f.index,f.group),delete r[l]):+l<t&&(f.state=6,f.timer.stop(),f.on.call(`cancel`,e,e.__data__,f.index,f.group),delete r[l])}if(vo(function(){n.state===3&&(n.state=4,n.timer.restart(s,n.delay,n.time),s(a))}),n.state=2,n.on.call(`start`,e,e.__data__,n.index,n.group),n.state===2){for(n.state=3,i=Array(d=n.tween.length),l=0,u=-1;l<d;++l)(f=n.tween[l].value.call(e,e.__data__,n.index,n.group))&&(i[++u]=f);i.length=u+1}}function s(t){for(var r=t<n.duration?n.ease.call(null,t/n.duration):(n.timer.restart(c),n.state=5,1),a=-1,o=i.length;++a<o;)i[a].call(e,r);n.state===5&&(n.on.call(`end`,e,e.__data__,n.index,n.group),c())}function c(){for(var i in n.state=6,n.timer.stop(),delete r[t],r)return;delete e.__transition}}function Eo(e,t){var n=e.__transition,r,i,a=!0,o;if(n){for(o in t=t==null?null:t+``,n){if((r=n[o]).name!==t){a=!1;continue}i=r.state>2&&r.state<5,r.state=6,r.timer.stop(),r.on.call(i?`interrupt`:`cancel`,e,e.__data__,r.index,r.group),delete n[o]}a&&delete e.__transition}}function Do(e){return this.each(function(){Eo(this,e)})}function Oo(e,t){var n,r;return function(){var i=Co(this,e),a=i.tween;if(a!==n){r=n=a;for(var o=0,s=r.length;o<s;++o)if(r[o].name===t){r=r.slice(),r.splice(o,1);break}}i.tween=r}}function ko(e,t,n){var r,i;if(typeof n!=`function`)throw Error();return function(){var a=Co(this,e),o=a.tween;if(o!==r){i=(r=o).slice();for(var s={name:t,value:n},c=0,l=i.length;c<l;++c)if(i[c].name===t){i[c]=s;break}c===l&&i.push(s)}a.tween=i}}function Ao(e,t){var n=this._id;if(e+=``,arguments.length<2){for(var r=wo(this.node(),n).tween,i=0,a=r.length,o;i<a;++i)if((o=r[i]).name===e)return o.value;return null}return this.each((t==null?Oo:ko)(n,e,t))}function jo(e,t,n){var r=e._id;return e.each(function(){var e=Co(this,r);(e.value||={})[t]=n.apply(this,arguments)}),function(e){return wo(e,r).value[t]}}function Mo(e,t){var n;return(typeof t==`number`?ka:t instanceof ea?wa:(n=ea(t))?(t=n,wa):Fa)(e,t)}function No(e){return function(){this.removeAttribute(e)}}function Po(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Fo(e,t,n){var r,i=n+``,a;return function(){var o=this.getAttribute(e);return o===i?null:o===r?a:a=t(r=o,n)}}function Io(e,t,n){var r,i=n+``,a;return function(){var o=this.getAttributeNS(e.space,e.local);return o===i?null:o===r?a:a=t(r=o,n)}}function Lo(e,t,n){var r,i,a;return function(){var o,s=n(this),c;return s==null?void this.removeAttribute(e):(o=this.getAttribute(e),c=s+``,o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,s)))}}function Ro(e,t,n){var r,i,a;return function(){var o,s=n(this),c;return s==null?void this.removeAttributeNS(e.space,e.local):(o=this.getAttributeNS(e.space,e.local),c=s+``,o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,s)))}}function zo(e,t){var n=xn(e),r=n===`transform`?Ga:Mo;return this.attrTween(e,typeof t==`function`?(n.local?Ro:Lo)(n,r,jo(this,`attr.`+e,t)):t==null?(n.local?Po:No)(n):(n.local?Io:Fo)(n,r,t))}function Bo(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function Vo(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function Ho(e,t){var n,r;function i(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&Vo(e,i)),n}return i._value=t,i}function Uo(e,t){var n,r;function i(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&Bo(e,i)),n}return i._value=t,i}function Wo(e,t){var n=`attr.`+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!=`function`)throw Error();var r=xn(e);return this.tween(n,(r.local?Ho:Uo)(r,t))}function Go(e,t){return function(){So(this,e).delay=+t.apply(this,arguments)}}function Ko(e,t){return t=+t,function(){So(this,e).delay=t}}function qo(e){var t=this._id;return arguments.length?this.each((typeof e==`function`?Go:Ko)(t,e)):wo(this.node(),t).delay}function Jo(e,t){return function(){Co(this,e).duration=+t.apply(this,arguments)}}function Yo(e,t){return t=+t,function(){Co(this,e).duration=t}}function Xo(e){var t=this._id;return arguments.length?this.each((typeof e==`function`?Jo:Yo)(t,e)):wo(this.node(),t).duration}function Zo(e,t){if(typeof t!=`function`)throw Error();return function(){Co(this,e).ease=t}}function Qo(e){var t=this._id;return arguments.length?this.each(Zo(t,e)):wo(this.node(),t).ease}function $o(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!=`function`)throw Error();Co(this,e).ease=n}}function es(e){if(typeof e!=`function`)throw Error();return this.each($o(this._id,e))}function ts(e){typeof e!=`function`&&(e=Nn(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=[],c,l=0;l<o;++l)(c=a[l])&&e.call(c,c.__data__,l,a)&&s.push(c);return new As(r,this._parents,this._name,this._id)}function ns(e){if(e._id!==this._id)throw Error();for(var t=this._groups,n=e._groups,r=t.length,i=n.length,a=Math.min(r,i),o=Array(r),s=0;s<a;++s)for(var c=t[s],l=n[s],u=c.length,d=o[s]=Array(u),f,p=0;p<u;++p)(f=c[p]||l[p])&&(d[p]=f);for(;s<r;++s)o[s]=t[s];return new As(o,this._parents,this._name,this._id)}function rs(e){return(e+``).trim().split(/^|\s+/).every(function(e){var t=e.indexOf(`.`);return t>=0&&(e=e.slice(0,t)),!e||e===`start`})}function is(e,t,n){var r,i,a=rs(t)?So:Co;return function(){var o=a(this,e),s=o.on;s!==r&&(i=(r=s).copy()).on(t,n),o.on=i}}function as(e,t){var n=this._id;return arguments.length<2?wo(this.node(),n).on.on(e):this.each(is(n,e,t))}function os(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function ss(){return this.on(`end.remove`,os(this._id))}function cs(e){var t=this._name,n=this._id;typeof e!=`function`&&(e=En(e));for(var r=this._groups,i=r.length,a=Array(i),o=0;o<i;++o)for(var s=r[o],c=s.length,l=a[o]=Array(c),u,d,f=0;f<c;++f)(u=s[f])&&(d=e.call(u,u.__data__,f,s))&&(`__data__`in u&&(d.__data__=u.__data__),l[f]=d,xo(l[f],t,n,f,l,wo(u,n)));return new As(a,this._parents,t,n)}function ls(e){var t=this._name,n=this._id;typeof e!=`function`&&(e=An(e));for(var r=this._groups,i=r.length,a=[],o=[],s=0;s<i;++s)for(var c=r[s],l=c.length,u,d=0;d<l;++d)if(u=c[d]){for(var f=e.call(u,u.__data__,d,c),p,m=wo(u,n),h=0,g=f.length;h<g;++h)(p=f[h])&&xo(p,t,n,h,f,m);a.push(f),o.push(u)}return new As(a,o,t,n)}var us=gi.prototype.constructor;function ds(){return new us(this._groups,this._parents)}function fs(e,t){var n,r,i;return function(){var a=Cr(this,e),o=(this.style.removeProperty(e),Cr(this,e));return a===o?null:a===n&&o===r?i:i=t(n=a,r=o)}}function ps(e){return function(){this.style.removeProperty(e)}}function ms(e,t,n){var r,i=n+``,a;return function(){var o=Cr(this,e);return o===i?null:o===r?a:a=t(r=o,n)}}function hs(e,t,n){var r,i,a;return function(){var o=Cr(this,e),s=n(this),c=s+``;return s??(c=s=(this.style.removeProperty(e),Cr(this,e))),o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,s))}}function gs(e,t){var n,r,i,a=`style.`+t,o=`end.`+a,s;return function(){var c=Co(this,e),l=c.on,u=c.value[a]==null?s||=ps(t):void 0;(l!==n||i!==u)&&(r=(n=l).copy()).on(o,i=u),c.on=r}}function _s(e,t,n){var r=(e+=``)==`transform`?Wa:Mo;return t==null?this.styleTween(e,fs(e,r)).on(`end.style.`+e,ps(e)):typeof t==`function`?this.styleTween(e,hs(e,r,jo(this,`style.`+e,t))).each(gs(this._id,e)):this.styleTween(e,ms(e,r,t),n).on(`end.style.`+e,null)}function vs(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function ys(e,t,n){var r,i;function a(){var a=t.apply(this,arguments);return a!==i&&(r=(i=a)&&vs(e,a,n)),r}return a._value=t,a}function bs(e,t,n){var r=`style.`+(e+=``);if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!=`function`)throw Error();return this.tween(r,ys(e,t,n??``))}function xs(e){return function(){this.textContent=e}}function Ss(e){return function(){var t=e(this);this.textContent=t??``}}function Cs(e){return this.tween(`text`,typeof e==`function`?Ss(jo(this,`text`,e)):xs(e==null?``:e+``))}function ws(e){return function(t){this.textContent=e.call(this,t)}}function Ts(e){var t,n;function r(){var r=e.apply(this,arguments);return r!==n&&(t=(n=r)&&ws(r)),t}return r._value=e,r}function Es(e){var t=`text`;if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!=`function`)throw Error();return this.tween(t,Ts(e))}function Ds(){for(var e=this._name,t=this._id,n=Ms(),r=this._groups,i=r.length,a=0;a<i;++a)for(var o=r[a],s=o.length,c,l=0;l<s;++l)if(c=o[l]){var u=wo(c,t);xo(c,e,n,l,o,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new As(r,this._parents,e,n)}function Os(){var e,t,n=this,r=n._id,i=n.size();return new Promise(function(a,o){var s={value:o},c={value:function(){--i===0&&a()}};n.each(function(){var n=Co(this,r),i=n.on;i!==e&&(t=(e=i).copy(),t._.cancel.push(s),t._.interrupt.push(s),t._.end.push(c)),n.on=t}),i===0&&a()})}var ks=0;function As(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function js(e){return gi().transition(e)}function Ms(){return++ks}var Ns=gi.prototype;As.prototype=js.prototype={constructor:As,select:cs,selectAll:ls,selectChild:Ns.selectChild,selectChildren:Ns.selectChildren,filter:ts,merge:ns,selection:ds,transition:Ds,call:Ns.call,nodes:Ns.nodes,node:Ns.node,size:Ns.size,empty:Ns.empty,each:Ns.each,on:as,attr:zo,attrTween:Wo,style:_s,styleTween:bs,text:Cs,textTween:Es,remove:ss,tween:Ao,delay:qo,duration:Xo,ease:Qo,easeVarying:es,end:Os,[Symbol.iterator]:Ns[Symbol.iterator]};function Ps(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var Fs={time:null,delay:0,duration:250,ease:Ps};function Is(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw Error(`transition ${t} not found`);return n}function Ls(e){var t,n;e instanceof As?(t=e._id,e=e._name):(t=Ms(),(n=Fs).time=co(),e=e==null?null:e+``);for(var r=this._groups,i=r.length,a=0;a<i;++a)for(var o=r[a],s=o.length,c,l=0;l<s;++l)(c=o[l])&&xo(c,e,t,l,o,n||Is(c,t));return new As(r,this._parents,e,t)}gi.prototype.interrupt=Do,gi.prototype.transition=Ls;var Rs=e=>()=>e;function zs(e,{sourceEvent:t,target:n,transform:r,dispatch:i}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:i}})}function Bs(e,t,n){this.k=e,this.x=t,this.y=n}Bs.prototype={constructor:Bs,scale:function(e){return e===1?this:new Bs(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Bs(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return`translate(`+this.x+`,`+this.y+`) scale(`+this.k+`)`}};var Vs=new Bs(1,0,0);Hs.prototype=Bs.prototype;function Hs(e){for(;!e.__zoom;)if(!(e=e.parentNode))return Vs;return e.__zoom}function Us(e){e.stopImmediatePropagation()}function Ws(e){e.preventDefault(),e.stopImmediatePropagation()}function Gs(e){return(!e.ctrlKey||e.type===`wheel`)&&!e.button}function Ks(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute(`viewBox`)?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function qs(){return this.__zoom||Vs}function Js(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function Ys(){return navigator.maxTouchPoints||`ontouchstart`in this}function Xs(e,t,n){var r=e.invertX(t[0][0])-n[0][0],i=e.invertX(t[1][0])-n[1][0],a=e.invertY(t[0][1])-n[0][1],o=e.invertY(t[1][1])-n[1][1];return e.translate(i>r?(r+i)/2:Math.min(0,r)||Math.max(0,i),o>a?(a+o)/2:Math.min(0,a)||Math.max(0,o))}function Zs(){var e=Gs,t=Ks,n=Xs,r=Js,i=Ys,a=[0,1/0],o=[[-1/0,-1/0],[1/0,1/0]],s=250,c=Xa,l=hn(`start`,`zoom`,`end`),u,d,f,p=500,m=150,h=0,g=10;function _(e){e.property(`__zoom`,qs).on(`wheel.zoom`,w,{passive:!1}).on(`mousedown.zoom`,T).on(`dblclick.zoom`,E).filter(i).on(`touchstart.zoom`,D).on(`touchmove.zoom`,O).on(`touchend.zoom touchcancel.zoom`,k).style(`-webkit-tap-highlight-color`,`rgba(0,0,0,0)`)}_.transform=function(e,t,n,r){var i=e.selection?e.selection():e;i.property(`__zoom`,qs),e===i?i.interrupt().each(function(){S(this,arguments).event(r).start().zoom(null,typeof t==`function`?t.apply(this,arguments):t).end()}):x(e,t,n,r)},_.scaleBy=function(e,t,n,r){_.scaleTo(e,function(){return this.__zoom.k*(typeof t==`function`?t.apply(this,arguments):t)},n,r)},_.scaleTo=function(e,r,i,a){_.transform(e,function(){var e=t.apply(this,arguments),a=this.__zoom,s=i==null?b(e):typeof i==`function`?i.apply(this,arguments):i,c=a.invert(s),l=typeof r==`function`?r.apply(this,arguments):r;return n(y(v(a,l),s,c),e,o)},i,a)},_.translateBy=function(e,r,i,a){_.transform(e,function(){return n(this.__zoom.translate(typeof r==`function`?r.apply(this,arguments):r,typeof i==`function`?i.apply(this,arguments):i),t.apply(this,arguments),o)},null,a)},_.translateTo=function(e,r,i,a,s){_.transform(e,function(){var e=t.apply(this,arguments),s=this.__zoom,c=a==null?b(e):typeof a==`function`?a.apply(this,arguments):a;return n(Vs.translate(c[0],c[1]).scale(s.k).translate(typeof r==`function`?-r.apply(this,arguments):-r,typeof i==`function`?-i.apply(this,arguments):-i),e,o)},a,s)};function v(e,t){return t=Math.max(a[0],Math.min(a[1],t)),t===e.k?e:new Bs(t,e.x,e.y)}function y(e,t,n){var r=t[0]-n[0]*e.k,i=t[1]-n[1]*e.k;return r===e.x&&i===e.y?e:new Bs(e.k,r,i)}function b(e){return[(+e[0][0]+ +e[1][0])/2,(+e[0][1]+ +e[1][1])/2]}function x(e,n,r,i){e.on(`start.zoom`,function(){S(this,arguments).event(i).start()}).on(`interrupt.zoom end.zoom`,function(){S(this,arguments).event(i).end()}).tween(`zoom`,function(){var e=this,a=arguments,o=S(e,a).event(i),s=t.apply(e,a),l=r==null?b(s):typeof r==`function`?r.apply(e,a):r,u=Math.max(s[1][0]-s[0][0],s[1][1]-s[0][1]),d=e.__zoom,f=typeof n==`function`?n.apply(e,a):n,p=c(d.invert(l).concat(u/d.k),f.invert(l).concat(u/f.k));return function(e){if(e===1)e=f;else{var t=p(e),n=u/t[2];e=new Bs(n,l[0]-t[0]*n,l[1]-t[1]*n)}o.zoom(null,e)}})}function S(e,t,n){return!n&&e.__zooming||new C(e,t)}function C(e,n){this.that=e,this.args=n,this.active=0,this.sourceEvent=null,this.extent=t.apply(e,n),this.taps=0}C.prototype={event:function(e){return e&&(this.sourceEvent=e),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit(`start`)),this},zoom:function(e,t){return this.mouse&&e!==`mouse`&&(this.mouse[1]=t.invert(this.mouse[0])),this.touch0&&e!==`touch`&&(this.touch0[1]=t.invert(this.touch0[0])),this.touch1&&e!==`touch`&&(this.touch1[1]=t.invert(this.touch1[0])),this.that.__zoom=t,this.emit(`zoom`),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit(`end`)),this},emit:function(e){var t=vi(this.that).datum();l.call(e,this.that,new zs(e,{sourceEvent:this.sourceEvent,target:_,type:e,transform:this.that.__zoom,dispatch:l}),t)}};function w(t,...i){if(!e.apply(this,arguments))return;var s=S(this,i).event(t),c=this.__zoom,l=Math.max(a[0],Math.min(a[1],c.k*2**r.apply(this,arguments))),u=bi(t);if(s.wheel)(s.mouse[0][0]!==u[0]||s.mouse[0][1]!==u[1])&&(s.mouse[1]=c.invert(s.mouse[0]=u)),clearTimeout(s.wheel);else if(c.k===l)return;else s.mouse=[u,c.invert(u)],Eo(this),s.start();Ws(t),s.wheel=setTimeout(d,m),s.zoom(`mouse`,n(y(v(c,l),s.mouse[0],s.mouse[1]),s.extent,o));function d(){s.wheel=null,s.end()}}function T(t,...r){if(f||!e.apply(this,arguments))return;var i=t.currentTarget,a=S(this,r,!0).event(t),s=vi(t.view).on(`mousemove.zoom`,d,!0).on(`mouseup.zoom`,p,!0),c=bi(t,i),l=t.clientX,u=t.clientY;Ti(t.view),Us(t),a.mouse=[c,this.__zoom.invert(c)],Eo(this),a.start();function d(e){if(Ws(e),!a.moved){var t=e.clientX-l,r=e.clientY-u;a.moved=t*t+r*r>h}a.event(e).zoom(`mouse`,n(y(a.that.__zoom,a.mouse[0]=bi(e,i),a.mouse[1]),a.extent,o))}function p(e){s.on(`mousemove.zoom mouseup.zoom`,null),Ei(e.view,a.moved),Ws(e),a.event(e).end()}}function E(r,...i){if(e.apply(this,arguments)){var a=this.__zoom,c=bi(r.changedTouches?r.changedTouches[0]:r,this),l=a.invert(c),u=a.k*(r.shiftKey?.5:2),d=n(y(v(a,u),c,l),t.apply(this,i),o);Ws(r),s>0?vi(this).transition().duration(s).call(x,d,c,r):vi(this).call(_.transform,d,c,r)}}function D(t,...n){if(e.apply(this,arguments)){var r=t.touches,i=r.length,a=S(this,n,t.changedTouches.length===i).event(t),o,s,c,l;for(Us(t),s=0;s<i;++s)c=r[s],l=bi(c,this),l=[l,this.__zoom.invert(l),c.identifier],a.touch0?!a.touch1&&a.touch0[2]!==l[2]&&(a.touch1=l,a.taps=0):(a.touch0=l,o=!0,a.taps=1+!!u);u&&=clearTimeout(u),o&&(a.taps<2&&(d=l[0],u=setTimeout(function(){u=null},p)),Eo(this),a.start())}}function O(e,...t){if(this.__zooming){var r=S(this,t).event(e),i=e.changedTouches,a=i.length,s,c,l,u;for(Ws(e),s=0;s<a;++s)c=i[s],l=bi(c,this),r.touch0&&r.touch0[2]===c.identifier?r.touch0[0]=l:r.touch1&&r.touch1[2]===c.identifier&&(r.touch1[0]=l);if(c=r.that.__zoom,r.touch1){var d=r.touch0[0],f=r.touch0[1],p=r.touch1[0],m=r.touch1[1],h=(h=p[0]-d[0])*h+(h=p[1]-d[1])*h,g=(g=m[0]-f[0])*g+(g=m[1]-f[1])*g;c=v(c,Math.sqrt(h/g)),l=[(d[0]+p[0])/2,(d[1]+p[1])/2],u=[(f[0]+m[0])/2,(f[1]+m[1])/2]}else if(r.touch0)l=r.touch0[0],u=r.touch0[1];else return;r.zoom(`touch`,n(y(c,l,u),r.extent,o))}}function k(e,...t){if(this.__zooming){var n=S(this,t).event(e),r=e.changedTouches,i=r.length,a,o;for(Us(e),f&&clearTimeout(f),f=setTimeout(function(){f=null},p),a=0;a<i;++a)o=r[a],n.touch0&&n.touch0[2]===o.identifier?delete n.touch0:n.touch1&&n.touch1[2]===o.identifier&&delete n.touch1;if(n.touch1&&!n.touch0&&(n.touch0=n.touch1,delete n.touch1),n.touch0)n.touch0[1]=this.__zoom.invert(n.touch0[0]);else if(n.end(),n.taps===2&&(o=bi(o,this),Math.hypot(d[0]-o[0],d[1]-o[1])<g)){var s=vi(this).on(`dblclick.zoom`);s&&s.apply(this,arguments)}}}return _.wheelDelta=function(e){return arguments.length?(r=typeof e==`function`?e:Rs(+e),_):r},_.filter=function(t){return arguments.length?(e=typeof t==`function`?t:Rs(!!t),_):e},_.touchable=function(e){return arguments.length?(i=typeof e==`function`?e:Rs(!!e),_):i},_.extent=function(e){return arguments.length?(t=typeof e==`function`?e:Rs([[+e[0][0],+e[0][1]],[+e[1][0],+e[1][1]]]),_):t},_.scaleExtent=function(e){return arguments.length?(a[0]=+e[0],a[1]=+e[1],_):[a[0],a[1]]},_.translateExtent=function(e){return arguments.length?(o[0][0]=+e[0][0],o[1][0]=+e[1][0],o[0][1]=+e[0][1],o[1][1]=+e[1][1],_):[[o[0][0],o[0][1]],[o[1][0],o[1][1]]]},_.constrain=function(e){return arguments.length?(n=e,_):n},_.duration=function(e){return arguments.length?(s=+e,_):s},_.interpolate=function(e){return arguments.length?(c=e,_):c},_.on=function(){var e=l.on.apply(l,arguments);return e===l?_:e},_.clickDistance=function(e){return arguments.length?(h=(e=+e)*e,_):Math.sqrt(h)},_.tapDistance=function(e){return arguments.length?(g=+e,_):g},_}var Qs={error001:(e=`react`)=>`Seems like you have not used ${e===`svelte`?`SvelteFlowProvider`:`ReactFlowProvider`} as an ancestor. Help: https://${e}flow.dev/error#001`,error002:()=>`It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.`,error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>`The parent container needs a width and a height to render the graph.`,error005:()=>`Only child nodes can use a parent extent.`,error006:()=>`Can't create edge. An edge needs a source and a target.`,error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:t,sourceHandle:n,targetHandle:r})=>`Couldn't create edge for ${e} handle id: "${e===`source`?n:r}", edge id: ${t}.`,error010:()=>`Handle: No node id found. Make sure to only use a Handle inside a custom Node.`,error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e=`react`)=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>`useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.`,error015:()=>`It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs.`,error016:e=>`Edge with id "${e}" does not exist, it may have been removed. This can happen when an edge is deleted before the "onEdgeClick" handler is called.`},$s=[[-1/0,-1/0],[1/0,1/0]],ec=[`Enter`,` `,`Escape`],tc={"node.a11yDescription.default":`Press enter or space to select a node. Press delete to remove it and escape to cancel.`,"node.a11yDescription.keyboardDisabled":`Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.`,"node.a11yDescription.ariaLiveMessage":({direction:e,x:t,y:n})=>`Moved selected node ${e}. New position, x: ${t}, y: ${n}`,"edge.a11yDescription.default":`Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.`,"controls.ariaLabel":`Control Panel`,"controls.zoomIn.ariaLabel":`Zoom In`,"controls.zoomOut.ariaLabel":`Zoom Out`,"controls.fitView.ariaLabel":`Fit View`,"controls.interactive.ariaLabel":`Toggle Interactivity`,"minimap.ariaLabel":`Mini Map`,"handle.ariaLabel":`Handle`},nc;(function(e){e.Strict=`strict`,e.Loose=`loose`})(nc||={});var rc;(function(e){e.Free=`free`,e.Vertical=`vertical`,e.Horizontal=`horizontal`})(rc||={});var ic;(function(e){e.Partial=`partial`,e.Full=`full`})(ic||={});var ac={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null},oc;(function(e){e.Bezier=`default`,e.Straight=`straight`,e.Step=`step`,e.SmoothStep=`smoothstep`,e.SimpleBezier=`simplebezier`})(oc||={});var sc;(function(e){e.Arrow=`arrow`,e.ArrowClosed=`arrowclosed`})(sc||={});var Q;(function(e){e.Left=`left`,e.Top=`top`,e.Right=`right`,e.Bottom=`bottom`})(Q||={});var cc={[Q.Left]:Q.Right,[Q.Right]:Q.Left,[Q.Top]:Q.Bottom,[Q.Bottom]:Q.Top};function lc(e){return e===null?null:e?`valid`:`invalid`}var uc=e=>!!e&&typeof e==`object`&&`id`in e&&`source`in e&&`target`in e,dc=e=>!!e&&typeof e==`object`&&`id`in e&&`position`in e&&!(`source`in e)&&!(`target`in e),fc=e=>!!e&&typeof e==`object`&&`id`in e&&`internals`in e&&!(`source`in e)&&!(`target`in e),pc=(e,t=[0,0])=>{let{width:n,height:r}=qc(e),i=e.origin??t,a=n*i[0],o=r*i[1];return{x:e.position.x-a,y:e.position.y-o}},mc=(e,t={nodeOrigin:[0,0]})=>e.length===0?{x:0,y:0,width:0,height:0}:kc(e.reduce((e,n)=>{let r=typeof n==`string`,i=!t.nodeLookup&&!r?n:void 0;return t.nodeLookup&&(i=r?t.nodeLookup.get(n):fc(n)?n:t.nodeLookup.get(n.id)),Dc(e,i?jc(i,t.nodeOrigin):{x:0,y:0,x2:0,y2:0})},{x:1/0,y:1/0,x2:-1/0,y2:-1/0})),hc=(e,t={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},r=!1;return e.forEach(e=>{(t.filter===void 0||t.filter(e))&&(n=Dc(n,jc(e)),r=!0)}),r?kc(n):{x:0,y:0,width:0,height:0}},gc=(e,t,[n,r,i]=[0,0,1],a=!1,o=!1)=>{let s=(t.x-n)/i,c=(t.y-r)/i,l=t.width/i,u=t.height/i,d=[];for(let t of e.values()){let{measured:e,selectable:n=!0,hidden:r=!1}=t;if(o&&!n||r)continue;let i=e.width??t.width??t.initialWidth??0,f=e.height??t.height??t.initialHeight??0,{x:p,y:m}=t.internals.positionAbsolute,h=Nc(s,c,l,u,p,m,i,f),g=i*f,_=a&&h>0;(!t.internals.handleBounds||_||h>=g||t.dragging)&&d.push(t)}return d},_c=(e,t)=>{let n=new Set;return e.forEach(e=>{n.add(e.id)}),t.filter(e=>n.has(e.source)||n.has(e.target))};function vc(e,t){let n=new Map,r=t?.nodes?new Set(t.nodes.map(e=>e.id)):null;return e.forEach(e=>{let i;if(t?.includeHiddenNodes){let{width:t,height:n}=qc(e);i=t>0&&n>0}else i=!!(e.measured.width&&e.measured.height&&!e.hidden);i&&(!r||r.has(e.id))&&n.set(e.id,e)}),n}async function yc({nodes:e,width:t,height:n,panZoom:r,minZoom:i,maxZoom:a},o){if(e.size===0)return!0;let s=Wc(hc(vc(e,o)),t,n,o?.minZoom??i,o?.maxZoom??a,o?.padding??.1);return await r.setViewport(s,{duration:o?.duration,ease:o?.ease,interpolate:o?.interpolate}),!0}function bc({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:r=[0,0],nodeExtent:i,onError:a}){let o=n.get(e),s=o.parentId?n.get(o.parentId):void 0,{x:c,y:l}=s?s.internals.positionAbsolute:{x:0,y:0},u=o.origin??r,d=o.extent||i;if(o.extent===`parent`&&!o.expandParent)if(!s)a?.(`005`,Qs.error005());else{let e=s.measured.width,t=s.measured.height;e&&t&&(d=[[c,l],[c+e,l+t]])}else s&&Kc(o.extent)&&(d=[[o.extent[0][0]+c,o.extent[0][1]+l],[o.extent[1][0]+c,o.extent[1][1]+l]]);let f=Kc(d)?Cc(t,d,o.measured):t;return(o.measured.width===void 0||o.measured.height===void 0)&&a?.(`015`,Qs.error015()),{position:{x:f.x-c+(o.measured.width??0)*u[0],y:f.y-l+(o.measured.height??0)*u[1]},positionAbsolute:f}}async function xc({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:r,onBeforeDelete:i}){let a=new Set(e.map(e=>e.id)),o=[];for(let e of n){if(e.deletable===!1)continue;let t=a.has(e.id),n=!t&&e.parentId&&o.find(t=>t.id===e.parentId);(t||n)&&o.push(e)}let s=new Set(t.map(e=>e.id)),c=r.filter(e=>e.deletable!==!1),l=_c(o,c);for(let e of c)s.has(e.id)&&!l.find(t=>t.id===e.id)&&l.push(e);if(!i)return{edges:l,nodes:o};let u=await i({nodes:o,edges:l});return typeof u==`boolean`?u?{edges:l,nodes:o}:{edges:[],nodes:[]}:u}var Sc=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),Cc=(e={x:0,y:0},t,n)=>({x:Sc(e.x,t[0][0],t[1][0]-(n?.width??0)),y:Sc(e.y,t[0][1],t[1][1]-(n?.height??0))});function wc(e,t,n){let{width:r,height:i}=qc(n),{x:a,y:o}=n.internals.positionAbsolute;return Cc(e,[[a,o],[a+r,o+i]],t)}var Tc=(e,t,n)=>e<t?Sc(Math.abs(e-t),1,t)/t:e>n?-Sc(Math.abs(e-n),1,t)/t:0,Ec=(e,t,n=15,r=40)=>[Tc(e.x,r,t.width-r)*n,Tc(e.y,r,t.height-r)*n],Dc=(e,t)=>({x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}),Oc=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),kc=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),Ac=(e,t=[0,0])=>{let{x:n,y:r}=fc(e)?e.internals.positionAbsolute:pc(e,t);return{x:n,y:r,width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}},jc=(e,t=[0,0])=>{let{x:n,y:r}=fc(e)?e.internals.positionAbsolute:pc(e,t);return{x:n,y:r,x2:n+(e.measured?.width??e.width??e.initialWidth??0),y2:r+(e.measured?.height??e.height??e.initialHeight??0)}},Mc=(e,t)=>kc(Dc(Oc(e),Oc(t))),Nc=(e,t,n,r,i,a,o,s)=>{let c=Math.max(0,Math.min(e+n,i+o)-Math.max(e,i)),l=Math.max(0,Math.min(t+r,a+s)-Math.max(t,a));return Math.ceil(c*l)},Pc=(e,t)=>Nc(e.x,e.y,e.width,e.height,t.x,t.y,t.width,t.height),Fc=e=>Ic(e.width)&&Ic(e.height)&&Ic(e.x)&&Ic(e.y),Ic=e=>!isNaN(e)&&isFinite(e),Lc=(e,t)=>(e,t)=>{},Rc=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),zc=({x:e,y:t},[n,r,i],a=!1,o=[1,1])=>{let s={x:(e-n)/i,y:(t-r)/i};return a?Rc(s,o):s},Bc=({x:e,y:t},[n,r,i])=>({x:e*i+n,y:t*i+r});function Vc(e,t){if(typeof e==`number`)return Math.floor((t-t/(1+e))*.5);if(typeof e==`string`&&e.endsWith(`px`)){let t=parseFloat(e);if(!Number.isNaN(t))return Math.floor(t)}if(typeof e==`string`&&e.endsWith(`%`)){let n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(t*n*.01)}return console.error(`The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function Hc(e,t,n){if(typeof e==`string`||typeof e==`number`){let r=Vc(e,n),i=Vc(e,t);return{top:r,right:i,bottom:r,left:i,x:i*2,y:r*2}}if(typeof e==`object`){let r=Vc(e.top??e.y??0,n),i=Vc(e.bottom??e.y??0,n),a=Vc(e.left??e.x??0,t),o=Vc(e.right??e.x??0,t);return{top:r,right:o,bottom:i,left:a,x:a+o,y:r+i}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function Uc(e,t,n,r,i,a){let{x:o,y:s}=Bc(e,[t,n,r]),{x:c,y:l}=Bc({x:e.x+e.width,y:e.y+e.height},[t,n,r]),u=i-c,d=a-l;return{left:Math.floor(o),top:Math.floor(s),right:Math.floor(u),bottom:Math.floor(d)}}var Wc=(e,t,n,r,i,a)=>{let o=Hc(a,t,n),s=(t-o.x)/e.width,c=(n-o.y)/e.height,l=Sc(Math.min(s,c),r,i),u=e.x+e.width/2,d=e.y+e.height/2,f=t/2-u*l,p=n/2-d*l,m=Uc(e,f,p,l,t,n),h={left:Math.min(m.left-o.left,0),top:Math.min(m.top-o.top,0),right:Math.min(m.right-o.right,0),bottom:Math.min(m.bottom-o.bottom,0)};return{x:f-h.left+h.right,y:p-h.top+h.bottom,zoom:l}},Gc=()=>typeof navigator<`u`&&navigator?.userAgent?.indexOf(`Mac`)>=0;function Kc(e){return e!=null&&e!==`parent`}function qc(e){return{width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}}function Jc(e){return(e.measured?.width??e.width??e.initialWidth)!==void 0&&(e.measured?.height??e.height??e.initialHeight)!==void 0}function Yc(e,t={width:0,height:0},n,r,i){let a={...e},o=r.get(n);if(o){let e=o.origin||i;a.x+=o.internals.positionAbsolute.x-(t.width??0)*e[0],a.y+=o.internals.positionAbsolute.y-(t.height??0)*e[1]}return a}function Xc(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}function Zc(){let e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}function Qc(e){return{...tc,...e||{}}}function $c(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:i}){let{x:a,y:o}=al(e),s=zc({x:a-(i?.left??0),y:o-(i?.top??0)},r),{x:c,y:l}=n?Rc(s,t):s;return{xSnapped:c,ySnapped:l,...s}}var el=e=>({width:e.offsetWidth,height:e.offsetHeight}),tl=e=>e?.getRootNode?.()||window?.document,nl=[`INPUT`,`SELECT`,`TEXTAREA`];function rl(e){let t=e.composedPath?.()?.[0]||e.target;return t?.nodeType===1?nl.includes(t.nodeName)||t.hasAttribute(`contenteditable`)||!!t.closest(`.nokey`):!1}var il=e=>`clientX`in e,al=(e,t)=>{let n=il(e),r=n?e.clientX:e.touches?.[0].clientX,i=n?e.clientY:e.touches?.[0].clientY;return{x:r-(t?.left??0),y:i-(t?.top??0)}},ol=(e,t,n,r,i)=>{let a=t.querySelectorAll(`.${e}`);return!a||!a.length?null:Array.from(a).map(t=>{let a=t.getBoundingClientRect();return{id:t.getAttribute(`data-handleid`),type:e,nodeId:i,position:t.getAttribute(`data-handlepos`),x:(a.left-n.left)/r,y:(a.top-n.top)/r,...el(t)}})};function sl({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:i,sourceControlY:a,targetControlX:o,targetControlY:s}){let c=e*.125+i*.375+o*.375+n*.125,l=t*.125+a*.375+s*.375+r*.125;return[c,l,Math.abs(c-e),Math.abs(l-t)]}function cl(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function ll({pos:e,x1:t,y1:n,x2:r,y2:i,c:a}){switch(e){case Q.Left:return[t-cl(t-r,a),n];case Q.Right:return[t+cl(r-t,a),n];case Q.Top:return[t,n-cl(n-i,a)];case Q.Bottom:return[t,n+cl(i-n,a)]}}function ul({sourceX:e,sourceY:t,sourcePosition:n=Q.Bottom,targetX:r,targetY:i,targetPosition:a=Q.Top,curvature:o=.25}){let[s,c]=ll({pos:n,x1:e,y1:t,x2:r,y2:i,c:o}),[l,u]=ll({pos:a,x1:r,y1:i,x2:e,y2:t,c:o}),[d,f,p,m]=sl({sourceX:e,sourceY:t,targetX:r,targetY:i,sourceControlX:s,sourceControlY:c,targetControlX:l,targetControlY:u});return[`M${e},${t} C${s},${c} ${l},${u} ${r},${i}`,d,f,p,m]}function dl({sourceX:e,sourceY:t,targetX:n,targetY:r}){let i=Math.abs(n-e)/2,a=n<e?n+i:n-i,o=Math.abs(r-t)/2;return[a,r<t?r+o:r-o,i,o]}function fl({sourceNode:e,targetNode:t,selected:n=!1,zIndex:r=0,elevateOnSelect:i=!1,zIndexMode:a=`basic`}){return a===`manual`?r:(i&&n?r+1e3:r)+Math.max(e.parentId||i&&e.selected?e.internals.z:0,t.parentId||i&&t.selected?t.internals.z:0)}function pl({sourceNode:e,targetNode:t,width:n,height:r,transform:i}){let a=Dc(jc(e),jc(t));return a.x===a.x2&&(a.x2+=1),a.y===a.y2&&(a.y2+=1),Pc({x:-i[0]/i[2],y:-i[1]/i[2],width:n/i[2],height:r/i[2]},kc(a))>0}var ml=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||``}-${n}${r||``}`,hl=(e,t)=>t.some(t=>t.source===e.source&&t.target===e.target&&(t.sourceHandle===e.sourceHandle||!t.sourceHandle&&!e.sourceHandle)&&(t.targetHandle===e.targetHandle||!t.targetHandle&&!e.targetHandle)),gl=(e,t,n={})=>{if(!e.source||!e.target)return n.onError?.(`006`,Qs.error006()),t;let r=n.getEdgeId||ml,i;return i=uc(e)?{...e}:{...e,id:r(e)},hl(i,t)?t:(i.sourceHandle===null&&delete i.sourceHandle,i.targetHandle===null&&delete i.targetHandle,t.concat(i))};function _l({sourceX:e,sourceY:t,targetX:n,targetY:r}){let[i,a,o,s]=dl({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,i,a,o,s]}var vl={[Q.Left]:{x:-1,y:0},[Q.Right]:{x:1,y:0},[Q.Top]:{x:0,y:-1},[Q.Bottom]:{x:0,y:1}},yl=({source:e,sourcePosition:t=Q.Bottom,target:n})=>t===Q.Left||t===Q.Right?e.x<n.x?{x:1,y:0}:{x:-1,y:0}:e.y<n.y?{x:0,y:1}:{x:0,y:-1},bl=(e,t)=>Math.sqrt((t.x-e.x)**2+(t.y-e.y)**2);function xl({source:e,sourcePosition:t=Q.Bottom,target:n,targetPosition:r=Q.Top,center:i,offset:a,stepPosition:o}){let s=vl[t],c=vl[r],l={x:e.x+s.x*a,y:e.y+s.y*a},u={x:n.x+c.x*a,y:n.y+c.y*a},d=yl({source:l,sourcePosition:t,target:u}),f=d.x===0?`y`:`x`,p=d[f],m=[],h,g,_={x:0,y:0},v={x:0,y:0},[,,y,b]=dl({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(s[f]*c[f]===-1){f===`x`?(h=i.x??l.x+(u.x-l.x)*o,g=i.y??(l.y+u.y)/2):(h=i.x??(l.x+u.x)/2,g=i.y??l.y+(u.y-l.y)*o);let e=[{x:h,y:l.y},{x:h,y:u.y}],t=[{x:l.x,y:g},{x:u.x,y:g}];m=s[f]===p?f===`x`?e:t:f===`x`?t:e}else{let i=[{x:l.x,y:u.y}],o=[{x:u.x,y:l.y}];if(m=f===`x`?s.x===p?o:i:s.y===p?i:o,t===r){let t=Math.abs(e[f]-n[f]);if(t<=a){let r=Math.min(a-1,a-t);s[f]===p?_[f]=(l[f]>e[f]?-1:1)*r:v[f]=(u[f]>n[f]?-1:1)*r}}if(t!==r){let e=f===`x`?`y`:`x`,t=s[f]===c[e],n=l[e]>u[e],r=l[e]<u[e];(s[f]===1&&(!t&&n||t&&r)||s[f]!==1&&(!t&&r||t&&n))&&(m=f===`x`?i:o)}let d={x:l.x+_.x,y:l.y+_.y},y={x:u.x+v.x,y:u.y+v.y};Math.max(Math.abs(d.x-m[0].x),Math.abs(y.x-m[0].x))>=Math.max(Math.abs(d.y-m[0].y),Math.abs(y.y-m[0].y))?(h=(d.x+y.x)/2,g=m[0].y):(h=m[0].x,g=(d.y+y.y)/2)}let x={x:l.x+_.x,y:l.y+_.y},S={x:u.x+v.x,y:u.y+v.y};return[[e,...x.x!==m[0].x||x.y!==m[0].y?[x]:[],...m,...S.x!==m[m.length-1].x||S.y!==m[m.length-1].y?[S]:[],n],h,g,y,b]}function Sl(e,t,n,r){let i=Math.min(bl(e,t)/2,bl(t,n)/2,r),{x:a,y:o}=t;if(e.x===a&&a===n.x||e.y===o&&o===n.y)return`L${a} ${o}`;if(e.y===o){let t=e.x<n.x?-1:1,r=e.y<n.y?1:-1;return`L ${a+i*t},${o}Q ${a},${o} ${a},${o+i*r}`}let s=e.x<n.x?1:-1;return`L ${a},${o+i*(e.y<n.y?-1:1)}Q ${a},${o} ${a+i*s},${o}`}function Cl({sourceX:e,sourceY:t,sourcePosition:n=Q.Bottom,targetX:r,targetY:i,targetPosition:a=Q.Top,borderRadius:o=5,centerX:s,centerY:c,offset:l=20,stepPosition:u=.5}){let[d,f,p,m,h]=xl({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:i},targetPosition:a,center:{x:s,y:c},offset:l,stepPosition:u}),g=`M${d[0].x} ${d[0].y}`;for(let e=1;e<d.length-1;e++)g+=Sl(d[e-1],d[e],d[e+1],o);return g+=`L${d[d.length-1].x} ${d[d.length-1].y}`,[g,f,p,m,h]}function wl(e){return e&&!!(e.internals.handleBounds||e.handles?.length)&&!!(e.measured.width||e.width||e.initialWidth)}function Tl(e){let{sourceNode:t,targetNode:n}=e;if(!wl(t)||!wl(n))return null;let r=t.internals.handleBounds||El(t.handles),i=n.internals.handleBounds||El(n.handles),a=Ol(r?.source??[],e.sourceHandle),o=Ol(e.connectionMode===nc.Strict?i?.target??[]:(i?.target??[]).concat(i?.source??[]),e.targetHandle);if(!a||!o)return e.onError?.(`008`,Qs.error008(a?`target`:`source`,{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;let s=a?.position||Q.Bottom,c=o?.position||Q.Top,l=Dl(t,a,s),u=Dl(n,o,c);return{sourceX:l.x,sourceY:l.y,targetX:u.x,targetY:u.y,sourcePosition:s,targetPosition:c}}function El(e){if(!e)return null;let t=[],n=[];for(let r of e)r.width=r.width??1,r.height=r.height??1,r.type===`source`?t.push(r):r.type===`target`&&n.push(r);return{source:t,target:n}}function Dl(e,t,n=Q.Left,r=!1){let i=(t?.x??0)+e.internals.positionAbsolute.x,a=(t?.y??0)+e.internals.positionAbsolute.y,{width:o,height:s}=t??qc(e);if(r)return{x:i+o/2,y:a+s/2};switch(t?.position??n){case Q.Top:return{x:i+o/2,y:a};case Q.Right:return{x:i+o,y:a+s/2};case Q.Bottom:return{x:i+o/2,y:a+s};case Q.Left:return{x:i,y:a+s/2}}}function Ol(e,t){return e&&(t?e.find(e=>e.id===t):e[0])||null}function kl(e,t){return e?typeof e==`string`?e:`${t?`${t}__`:``}${Object.keys(e).sort().map(t=>`${t}=${e[t]}`).join(`&`)}`:``}function Al(e,{id:t,defaultColor:n,defaultMarkerStart:r,defaultMarkerEnd:i}){let a=new Set;return e.reduce((e,o)=>([o.markerStart||r,o.markerEnd||i].forEach(r=>{if(r&&typeof r==`object`){let i=kl(r,t);a.has(i)||(e.push({id:i,color:r.color||n,...r}),a.add(i))}}),e),[]).sort((e,t)=>e.id.localeCompare(t.id))}var jl=1e3,Ml=10,Nl={nodeOrigin:[0,0],nodeExtent:$s,elevateNodesOnSelect:!0,zIndexMode:`basic`,defaults:{}},Pl={...Nl,checkEquality:!0};function Fl(e,t){let n={...e};for(let e in t)t[e]!==void 0&&(n[e]=t[e]);return n}function Il(e,t,n){let r=Fl(Nl,n);for(let n of e.values())if(n.parentId)Vl(n,e,t,r);else{let e=Cc(pc(n,r.nodeOrigin),Kc(n.extent)?n.extent:r.nodeExtent,qc(n));n.internals.positionAbsolute=e}}function Ll(e,t){if(!e.handles)return e.measured?t?.internals.handleBounds:void 0;let n=[],r=[];for(let t of e.handles){let i={id:t.id,width:t.width??1,height:t.height??1,nodeId:e.id,x:t.x,y:t.y,position:t.position,type:t.type};t.type===`source`?n.push(i):t.type===`target`&&r.push(i)}return{source:n,target:r}}function Rl(e){return e===`manual`}function zl(e,t,n,r={}){let i=Fl(Pl,r),a={i:0},o=new Map(t),s=i?.elevateNodesOnSelect&&!Rl(i.zIndexMode)?jl:0,c=e.length>0,l=!1;t.clear(),n.clear();for(let u of e){let e=o.get(u.id);if(i.checkEquality&&u===e?.internals.userNode)t.set(u.id,e);else{let n=Cc(pc(u,i.nodeOrigin),Kc(u.extent)?u.extent:i.nodeExtent,qc(u));e={...i.defaults,...u,measured:{width:u.measured?.width,height:u.measured?.height},internals:{positionAbsolute:n,handleBounds:Ll(u,e),z:Hl(u,s,i.zIndexMode),userNode:u}},t.set(u.id,e)}(e.measured===void 0||e.measured.width===void 0||e.measured.height===void 0)&&!e.hidden&&(c=!1),u.parentId&&Vl(e,t,n,r,a),l||=u.selected??!1}return{nodesInitialized:c,hasSelectedNodes:l}}function Bl(e,t){if(!e.parentId)return;let n=t.get(e.parentId);n?n.set(e.id,e):t.set(e.parentId,new Map([[e.id,e]]))}function Vl(e,t,n,r,i){let{elevateNodesOnSelect:a,nodeOrigin:o,nodeExtent:s,zIndexMode:c}=Fl(Nl,r),l=e.parentId,u=t.get(l);if(!u){console.warn(`Parent node ${l} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}Bl(e,n),i&&!u.parentId&&u.internals.rootParentIndex===void 0&&c===`auto`&&(u.internals.rootParentIndex=++i.i,u.internals.z=u.internals.z+i.i*Ml),i&&u.internals.rootParentIndex!==void 0&&(i.i=u.internals.rootParentIndex);let{x:d,y:f,z:p}=Ul(e,u,o,s,a&&!Rl(c)?jl:0,c),{positionAbsolute:m}=e.internals,h=d!==m.x||f!==m.y;(h||p!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:h?{x:d,y:f}:m,z:p}})}function Hl(e,t,n){let r=Ic(e.zIndex)?e.zIndex:0;return Rl(n)?r:r+(e.selected?t:0)}function Ul(e,t,n,r,i,a){let{x:o,y:s}=t.internals.positionAbsolute,c=qc(e),l=pc(e,n),u=Kc(e.extent)?Cc(l,e.extent,c):l,d=Cc({x:o+u.x,y:s+u.y},r,c);e.extent===`parent`&&(d=wc(d,c,t));let f=Hl(e,i,a),p=t.internals.z??0;return{x:d.x,y:d.y,z:p>=f?p+1:f}}function Wl(e,t,n,r=[0,0]){let i=[],a=new Map;for(let n of e){let e=t.get(n.parentId);if(!e)continue;let r=Mc(a.get(n.parentId)?.expandedRect??Ac(e),n.rect);a.set(n.parentId,{expandedRect:r,parent:e})}return a.size>0&&a.forEach(({expandedRect:t,parent:a},o)=>{let s=a.internals.positionAbsolute,c=qc(a),l=a.origin??r,u=t.x<s.x?Math.round(Math.abs(s.x-t.x)):0,d=t.y<s.y?Math.round(Math.abs(s.y-t.y)):0,f=Math.max(c.width,Math.round(t.width)),p=Math.max(c.height,Math.round(t.height)),m=(f-c.width)*l[0],h=(p-c.height)*l[1];(u>0||d>0||m||h)&&(i.push({id:o,type:`position`,position:{x:a.position.x-u+m,y:a.position.y-d+h}}),n.get(o)?.forEach(t=>{e.some(e=>e.id===t.id)||i.push({id:t.id,type:`position`,position:{x:t.position.x+u,y:t.position.y+d}})})),(c.width<t.width||c.height<t.height||u||d)&&i.push({id:o,type:`dimensions`,setAttributes:!0,dimensions:{width:f+(u?l[0]*u-m:0),height:p+(d?l[1]*d-h:0)}})}),i}function Gl(e,t,n,r,i,a,o){let s=r?.querySelector(`.xyflow__viewport`),c=!1;if(!s)return{changes:[],updatedInternals:c};let l=[],u=window.getComputedStyle(s),{m22:d}=new window.DOMMatrixReadOnly(u.transform),f=[];for(let r of e.values()){let e=t.get(r.id);if(!e)continue;if(e.hidden){t.set(e.id,{...e,internals:{...e.internals,handleBounds:void 0}}),c=!0;continue}let s=el(r.nodeElement),u=e.measured.width!==s.width||e.measured.height!==s.height;if(s.width&&s.height&&(u||!e.internals.handleBounds||r.force)){let p=r.nodeElement.getBoundingClientRect(),m=Kc(e.extent)?e.extent:a,{positionAbsolute:h}=e.internals;if(e.parentId&&e.extent===`parent`){let n=t.get(e.parentId);n&&(h=wc(h,s,n))}else m&&(h=Cc(h,m,s));let g={...e,measured:s,internals:{...e.internals,positionAbsolute:h,handleBounds:{source:ol(`source`,r.nodeElement,p,d,e.id),target:ol(`target`,r.nodeElement,p,d,e.id)}}};t.set(e.id,g),e.parentId&&Vl(g,t,n,{nodeOrigin:i,zIndexMode:o}),c=!0,u&&(l.push({id:e.id,type:`dimensions`,dimensions:s}),e.expandParent&&e.parentId&&f.push({id:e.id,parentId:e.parentId,rect:Ac(g,i)}))}}if(f.length>0){let e=Wl(f,t,n,i);l.push(...e)}return{changes:l,updatedInternals:c}}async function Kl({delta:e,panZoom:t,transform:n,translateExtent:r,width:i,height:a}){if(!t||!e.x&&!e.y)return!1;let o=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[i,a]],r);return!!o&&(o.x!==n[0]||o.y!==n[1]||o.k!==n[2])}function ql(e,t,n,r,i,a){let o=i,s=r.get(o)||new Map;r.set(o,s.set(n,t)),o=`${i}-${e}`;let c=r.get(o)||new Map;if(r.set(o,c.set(n,t)),a){o=`${i}-${e}-${a}`;let s=r.get(o)||new Map;r.set(o,s.set(n,t))}}function Jl(e,t,n){e.clear(),t.clear();for(let r of n){let{source:n,target:i,sourceHandle:a=null,targetHandle:o=null}=r,s={edgeId:r.id,source:n,target:i,sourceHandle:a,targetHandle:o},c=`${n}-${a}--${i}-${o}`;ql(`source`,s,`${i}-${o}--${n}-${a}`,e,n,a),ql(`target`,s,c,e,i,o),t.set(r.id,r)}}function Yl(e,t){if(!e.parentId)return!1;let n=t.get(e.parentId);return n?n.selected?!0:Yl(n,t):!1}function Xl(e,t,n){let r=e;do{if(r?.matches?.(t))return!0;if(r===n)return!1;r=r?.parentElement}while(r);return!1}function Zl(e,t,n,r){let i=new Map;for(let[a,o]of e)if((o.selected||o.id===r)&&(!o.parentId||!Yl(o,e))&&(o.draggable||t&&o.draggable===void 0)){let t=e.get(a);t&&i.set(a,{id:a,position:t.position||{x:0,y:0},distance:{x:n.x-t.internals.positionAbsolute.x,y:n.y-t.internals.positionAbsolute.y},extent:t.extent,parentId:t.parentId,origin:t.origin,expandParent:t.expandParent,internals:{positionAbsolute:t.internals.positionAbsolute||{x:0,y:0}},measured:{width:t.measured.width??0,height:t.measured.height??0}})}return i}function Ql({nodeId:e,dragItems:t,nodeLookup:n,dragging:r=!0}){let i=[];for(let[e,a]of t){let t=n.get(e)?.internals.userNode;t&&i.push({...t,position:a.position,dragging:r})}if(!e)return[i[0],i];let a=n.get(e)?.internals.userNode;return[a?{...a,position:t.get(e)?.position||a.position,dragging:r}:i[0],i]}function $l({dragItems:e,snapGrid:t,x:n,y:r}){let i=e.values().next().value;if(!i)return null;let a={x:n-i.distance.x,y:r-i.distance.y},o=Rc(a,t);return{x:o.x-a.x,y:o.y-a.y}}function eu({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:r,onDragStop:i}){let a={x:null,y:null},o=0,s=new Map,c=!1,l={x:0,y:0},u=null,d=!1,f=null,p=!1,m=!1,h=null;function g({noDragClassName:g,handleSelector:_,domNode:v,isSelectable:y,nodeId:b,nodeClickDistance:x=0}){f=vi(v);function S({x:e,y:n}){let{nodeLookup:i,nodeExtent:o,snapGrid:c,snapToGrid:l,nodeOrigin:u,onNodeDrag:d,onSelectionDrag:f,onError:p,updateNodePositions:g}=t();a={x:e,y:n};let _=!1,v=s.size>1,y=v&&o?Oc(hc(s)):null,x=v&&l?$l({dragItems:s,snapGrid:c,x:e,y:n}):null;for(let[t,r]of s){if(!i.has(t))continue;let a={x:e-r.distance.x,y:n-r.distance.y};l&&(a=x?{x:Math.round(a.x+x.x),y:Math.round(a.y+x.y)}:Rc(a,c));let s=null;if(v&&o&&!r.extent&&y){let{positionAbsolute:e}=r.internals,t=e.x-y.x+o[0][0],n=e.x+r.measured.width-y.x2+o[1][0],i=e.y-y.y+o[0][1],a=e.y+r.measured.height-y.y2+o[1][1];s=[[t,i],[n,a]]}let{position:d,positionAbsolute:f}=bc({nodeId:t,nextPosition:a,nodeLookup:i,nodeExtent:s||o,nodeOrigin:u,onError:p});_=_||r.position.x!==d.x||r.position.y!==d.y,r.position=d,r.internals.positionAbsolute=f}if(m||=_,_&&(g(s,!0),h&&(r||d||!b&&f))){let[e,t]=Ql({nodeId:b,dragItems:s,nodeLookup:i});r?.(h,s,e,t),d?.(h,e,t),b||f?.(h,t)}}async function C(){if(!u)return;let{transform:e,panBy:n,autoPanSpeed:r,autoPanOnNodeDrag:i}=t();if(!i){c=!1,cancelAnimationFrame(o);return}let[s,d]=Ec(l,u,r);(s!==0||d!==0)&&(a.x=(a.x??0)-s/e[2],a.y=(a.y??0)-d/e[2],await n({x:s,y:d})&&S(a)),o=requestAnimationFrame(C)}function w(r){let{nodeLookup:i,multiSelectionActive:o,nodesDraggable:c,transform:l,snapGrid:f,snapToGrid:p,selectNodesOnDrag:m,onNodeDragStart:h,onSelectionDragStart:g,unselectNodesAndEdges:_}=t();d=!0,(!m||!y)&&!o&&b&&(i.get(b)?.selected||_()),y&&m&&b&&e?.(b);let v=$c(r.sourceEvent,{transform:l,snapGrid:f,snapToGrid:p,containerBounds:u});if(a=v,s=Zl(i,c,v,b),s.size>0&&(n||h||!b&&g)){let[e,t]=Ql({nodeId:b,dragItems:s,nodeLookup:i});n?.(r.sourceEvent,s,e,t),h?.(r.sourceEvent,e,t),b||g?.(r.sourceEvent,t)}}let T=Ni().clickDistance(x).on(`start`,e=>{let{domNode:n,nodeDragThreshold:r,transform:i,snapGrid:o,snapToGrid:s}=t();u=n?.getBoundingClientRect()||null,p=!1,m=!1,h=e.sourceEvent,r===0&&w(e),a=$c(e.sourceEvent,{transform:i,snapGrid:o,snapToGrid:s,containerBounds:u}),l=al(e.sourceEvent,u)}).on(`drag`,e=>{let{autoPanOnNodeDrag:n,transform:r,snapGrid:i,snapToGrid:o,nodeDragThreshold:f,nodeLookup:m}=t(),g=$c(e.sourceEvent,{transform:r,snapGrid:i,snapToGrid:o,containerBounds:u});if(h=e.sourceEvent,(e.sourceEvent.type===`touchmove`&&e.sourceEvent.touches.length>1||b&&!m.has(b))&&(p=!0),!p){if(!c&&n&&d&&(c=!0,C()),!d){let t=al(e.sourceEvent,u),n=t.x-l.x,r=t.y-l.y;Math.sqrt(n*n+r*r)>f&&w(e)}(a.x!==g.xSnapped||a.y!==g.ySnapped)&&s&&d&&(l=al(e.sourceEvent,u),S(g))}}).on(`end`,e=>{if(!d||p){p&&s.size>0&&t().updateNodePositions(s,!1);return}if(c=!1,d=!1,cancelAnimationFrame(o),s.size>0){let{nodeLookup:n,updateNodePositions:r,onNodeDragStop:a,onSelectionDragStop:o}=t();if(m&&=(r(s,!1),!1),i||a||!b&&o){let[t,r]=Ql({nodeId:b,dragItems:s,nodeLookup:n,dragging:!1});i?.(e.sourceEvent,s,t,r),a?.(e.sourceEvent,t,r),b||o?.(e.sourceEvent,r)}}}).filter(e=>{let t=e.target;return!e.button&&(!g||!Xl(t,`.${g}`,v))&&(!_||Xl(t,_,v))});f.call(T)}function _(){f?.on(`.drag`,null)}return{update:g,destroy:_}}function tu(e,t,n){let r=[],i={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(let e of t.values())Pc(i,Ac(e))>0&&r.push(e);return r}var nu=250;function ru(e,t,n,r){let i=[],a=1/0,o=tu(e,n,t+nu);for(let n of o){let o=[...n.internals.handleBounds?.source??[],...n.internals.handleBounds?.target??[]];for(let s of o){if(r.nodeId===s.nodeId&&r.type===s.type&&r.id===s.id)continue;let{x:o,y:c}=Dl(n,s,s.position,!0),l=Math.sqrt((o-e.x)**2+(c-e.y)**2);l>t||(l<a?(i=[{...s,x:o,y:c}],a=l):l===a&&i.push({...s,x:o,y:c}))}}if(!i.length)return null;if(i.length>1){let e=r.type===`source`?`target`:`source`;return i.find(t=>t.type===e)??i[0]}return i[0]}function iu(e,t,n,r,i,a=!1){let o=r.get(e);if(!o)return null;let s=i===`strict`?o.internals.handleBounds?.[t]:[...o.internals.handleBounds?.source??[],...o.internals.handleBounds?.target??[]],c=(n?s?.find(e=>e.id===n):s?.[0])??null;return c&&a?{...c,...Dl(o,c,c.position,!0)}:c}function au(e,t){return e||(t?.classList.contains(`target`)?`target`:t?.classList.contains(`source`)?`source`:null)}function ou(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}var su=()=>!0;function cu(e,{connectionMode:t,connectionRadius:n,handleId:r,nodeId:i,edgeUpdaterType:a,isTarget:o,domNode:s,nodeLookup:c,lib:l,autoPanOnConnect:u,flowId:d,panBy:f,cancelConnection:p,onConnectStart:m,onConnect:h,onConnectEnd:g,isValidConnection:_=su,onReconnectEnd:v,updateConnection:y,getTransform:b,getFromHandle:x,autoPanSpeed:S,dragThreshold:C=1,handleDomNode:w}){let T=tl(e.target),E=0,D,{x:O,y:k}=al(e),A=au(a,w),j=s?.getBoundingClientRect(),M=!1;if(!j||!A)return;let N=iu(i,A,r,c,t);if(!N)return;let P=al(e,j),F=!1,I=null,L=!1,R=null;function z(){if(!u||!j)return;let[e,t]=Ec(P,j,S);f({x:e,y:t}),E=requestAnimationFrame(z)}let B={...N,nodeId:i,type:A,position:N.position},V=c.get(i),H={inProgress:!0,isValid:null,from:Dl(V,B,Q.Left,!0),fromHandle:B,fromPosition:B.position,fromNode:V,to:P,toHandle:null,toPosition:cc[B.position],toNode:null,pointer:P};function U(){M=!0,y(H),m?.(e,{nodeId:i,handleId:r,handleType:A})}C===0&&U();function ee(e){if(!M){let{x:t,y:n}=al(e),r=t-O,i=n-k;if(!(r*r+i*i>C*C))return;U()}if(!x()||!B){W(e);return}let a=b();P=al(e,j),D=ru(zc(P,a,!1,[1,1]),n,c,B),F||=(z(),!0);let s=lu(e,{handle:D,connectionMode:t,fromNodeId:i,fromHandleId:r,fromType:o?`target`:`source`,isValidConnection:_,doc:T,lib:l,flowId:d,nodeLookup:c});R=s.handleDomNode,I=s.connection,L=ou(!!D,s.isValid);let u=c.get(i),f=u?Dl(u,B,Q.Left,!0):H.from,p={...H,from:f,isValid:L,to:s.toHandle&&L?Bc({x:s.toHandle.x,y:s.toHandle.y},a):P,toHandle:s.toHandle,toPosition:L&&s.toHandle?s.toHandle.position:cc[B.position],toNode:s.toHandle?c.get(s.toHandle.nodeId):null,pointer:P};y(p),H=p}function W(e){if(!(`touches`in e&&e.touches.length>0)){if(M){(D||R)&&I&&L&&h?.(I);let{inProgress:t,...n}=H,r={...n,toPosition:H.toHandle?H.toPosition:null};g?.(e,r),a&&v?.(e,r)}p(),cancelAnimationFrame(E),F=!1,L=!1,I=null,R=null,T.removeEventListener(`mousemove`,ee),T.removeEventListener(`mouseup`,W),T.removeEventListener(`touchmove`,ee),T.removeEventListener(`touchend`,W)}}T.addEventListener(`mousemove`,ee),T.addEventListener(`mouseup`,W),T.addEventListener(`touchmove`,ee),T.addEventListener(`touchend`,W)}function lu(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:i,fromType:a,doc:o,lib:s,flowId:c,isValidConnection:l=su,nodeLookup:u}){let d=a===`target`,f=t?o.querySelector(`.${s}-flow__handle[data-id="${c}-${t?.nodeId}-${t?.id}-${t?.type}"]`):null,{x:p,y:m}=al(e),h=o.elementFromPoint(p,m),g=h?.classList.contains(`${s}-flow__handle`)?h:f,_={handleDomNode:g,isValid:!1,connection:null,toHandle:null};if(g){let e=au(void 0,g),t=g.getAttribute(`data-nodeid`),a=g.getAttribute(`data-handleid`),o=g.classList.contains(`connectable`),s=g.classList.contains(`connectableend`);if(!t||!e)return _;let c={source:d?t:r,sourceHandle:d?a:i,target:d?r:t,targetHandle:d?i:a};_.connection=c,_.isValid=o&&s&&(n===nc.Strict?d&&e===`source`||!d&&e===`target`:t!==r||a!==i)&&l(c),_.toHandle=iu(t,e,a,u,n,!0)}return _}var uu={onPointerDown:cu,isValid:lu};function du({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){let i=vi(e);function a({translateExtent:e,width:a,height:o,zoomStep:s=1,pannable:c=!0,zoomable:l=!0,inversePan:u=!1}){let d=e=>{if(e.sourceEvent.type!==`wheel`||!t)return;let r=n(),i=e.sourceEvent.ctrlKey&&Gc()?10:1,a=-e.sourceEvent.deltaY*(e.sourceEvent.deltaMode===1?.05:e.sourceEvent.deltaMode?1:.002)*s,o=r[2]*2**(a*i);t.scaleTo(o)},f=[0,0],p=Zs().on(`start`,e=>{(e.sourceEvent.type===`mousedown`||e.sourceEvent.type===`touchstart`)&&(f=[e.sourceEvent.clientX??e.sourceEvent.touches[0].clientX,e.sourceEvent.clientY??e.sourceEvent.touches[0].clientY])}).on(`zoom`,c?i=>{let s=n();if(i.sourceEvent.type!==`mousemove`&&i.sourceEvent.type!==`touchmove`||!t)return;let c=[i.sourceEvent.clientX??i.sourceEvent.touches[0].clientX,i.sourceEvent.clientY??i.sourceEvent.touches[0].clientY],l=[c[0]-f[0],c[1]-f[1]];f=c;let d=r()*Math.max(s[2],Math.log(s[2]))*(u?-1:1),p={x:s[0]-l[0]*d,y:s[1]-l[1]*d},m=[[0,0],[a,o]];t.setViewportConstrained({x:p.x,y:p.y,zoom:s[2]},m,e)}:null).on(`zoom.wheel`,l?d:null);i.call(p,{})}function o(){i.on(`zoom`,null)}return{update:a,destroy:o,pointer:bi}}var fu=e=>({x:e.x,y:e.y,zoom:e.k}),pu=({x:e,y:t,zoom:n})=>Vs.translate(e,t).scale(n),mu=(e,t)=>e.target.closest(`.${t}`),hu=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),gu=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,_u=(e,t=0,n=gu,r=()=>{})=>{let i=typeof t==`number`&&t>0;return i||r(),i?e.transition().duration(t).ease(n).on(`end`,r):e},vu=e=>{let t=e.ctrlKey&&Gc()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function yu({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:i,panOnScrollSpeed:a,zoomOnPinch:o,onPanZoomStart:s,onPanZoom:c,onPanZoomEnd:l}){return u=>{if(mu(u,t))return u.ctrlKey&&u.preventDefault(),!1;u.preventDefault(),u.stopImmediatePropagation();let d=n.property(`__zoom`).k||1;if(u.ctrlKey&&o){let e=bi(u),t=d*2**vu(u);r.scaleTo(n,t,e,u);return}let f=u.deltaMode===1?20:1,p=i===rc.Vertical?0:u.deltaX*f,m=i===rc.Horizontal?0:u.deltaY*f;!Gc()&&u.shiftKey&&i!==rc.Vertical&&(p=u.deltaY*f,m=0),r.translateBy(n,-(p/d)*a,-(m/d)*a,{internal:!0});let h=fu(n.property(`__zoom`));clearTimeout(e.panScrollTimeout),e.isPanScrolling?c?.(u,h):(e.isPanScrolling=!0,s?.(u,h)),e.panScrollTimeout=setTimeout(()=>{l?.(u,h),e.isPanScrolling=!1},150)}}function bu({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,i){let a=r.type===`wheel`,o=!t&&a&&!r.ctrlKey,s=mu(r,e);if(r.ctrlKey&&a&&s&&r.preventDefault(),o||s)return null;r.preventDefault(),n.call(this,r,i)}}function xu({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{if(r.sourceEvent?.internal)return;let i=fu(r.transform);e.mouseButton=r.sourceEvent?.button||0,e.isZoomingOrPanning=!0,e.prevViewport=i,r.sourceEvent?.type===`mousedown`&&t(!0),n&&n?.(r.sourceEvent,i)}}function Su({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:i}){return a=>{e.usedRightMouseButton=!!(n&&hu(t,e.mouseButton??0)),a.sourceEvent?.sync||r([a.transform.x,a.transform.y,a.transform.k]),i&&!a.sourceEvent?.internal&&i?.(a.sourceEvent,fu(a.transform))}}function Cu({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:r,onPanZoomEnd:i,onPaneContextMenu:a}){return o=>{if(!o.sourceEvent?.internal&&(e.isZoomingOrPanning=!1,a&&hu(t,e.mouseButton??0)&&!e.usedRightMouseButton&&o.sourceEvent&&a(o.sourceEvent),e.usedRightMouseButton=!1,r(!1),i)){let t=fu(o.transform);e.prevViewport=t,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{i?.(o.sourceEvent,t)},n?150:0)}}}function wu({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:r,panOnScroll:i,zoomOnDoubleClick:a,userSelectionActive:o,noWheelClassName:s,noPanClassName:c,lib:l,connectionInProgress:u}){return d=>{let f=e||t,p=n&&d.ctrlKey,m=d.type===`wheel`;if(d.button===1&&d.type===`mousedown`&&(mu(d,`${l}-flow__node`)||mu(d,`${l}-flow__edge`)))return!0;if(!r&&!f&&!i&&!a&&!n||o||u&&!m||mu(d,s)&&m||mu(d,c)&&(!m||i&&m&&!e)||!n&&d.ctrlKey&&m)return!1;if(!n&&d.type===`touchstart`&&d.touches?.length>1)return d.preventDefault(),!1;if(!f&&!i&&!p&&m||!r&&(d.type===`mousedown`||d.type===`touchstart`)||Array.isArray(r)&&!r.includes(d.button)&&d.type===`mousedown`)return!1;let h=Array.isArray(r)&&r.includes(d.button)||!d.button||d.button<=1;return(!d.ctrlKey||m)&&h}}function Tu({domNode:e,minZoom:t,maxZoom:n,translateExtent:r,viewport:i,onPanZoom:a,onPanZoomStart:o,onPanZoomEnd:s,onDraggingChange:c}){let l={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},u=e.getBoundingClientRect(),d=[[0,0],[u.width,u.height]];(typeof ResizeObserver<`u`?new ResizeObserver(e=>{let t=e[0];t&&(d=[[0,0],[t.contentRect.width,t.contentRect.height]])}):null)?.observe(e);let f=Zs().extent(()=>d).scaleExtent([t,n]).translateExtent(r),p=vi(e).call(f);y({x:i.x,y:i.y,zoom:Sc(i.zoom,t,n)},[[0,0],[u.width,u.height]],r);let m=p.on(`wheel.zoom`),h=p.on(`dblclick.zoom`);f.wheelDelta(vu);async function g(e,t){return p?new Promise(n=>{f?.interpolate(t?.interpolate===`linear`?Ia:Xa).transform(_u(p,t?.duration,t?.ease,()=>n(!0)),e)}):!1}function _({noWheelClassName:e,noPanClassName:t,onPaneContextMenu:n,userSelectionActive:r,panOnScroll:i,panOnDrag:u,panOnScrollMode:d,panOnScrollSpeed:g,preventScrolling:_,zoomOnPinch:y,zoomOnScroll:b,zoomOnDoubleClick:x,zoomActivationKeyPressed:S,lib:C,onTransformChange:w,connectionInProgress:T,paneClickDistance:E,selectionOnDrag:D}){r&&!l.isZoomingOrPanning&&v();let O=i&&!S&&!r;f.clickDistance(D?1/0:!Ic(E)||E<0?0:E);let k=O?yu({zoomPanValues:l,noWheelClassName:e,d3Selection:p,d3Zoom:f,panOnScrollMode:d,panOnScrollSpeed:g,zoomOnPinch:y,onPanZoomStart:o,onPanZoom:a,onPanZoomEnd:s}):bu({noWheelClassName:e,preventScrolling:_,d3ZoomHandler:m});p.on(`wheel.zoom`,k,{passive:!1});let A=xu({zoomPanValues:l,onDraggingChange:c,onPanZoomStart:o});f.on(`start`,A);let j=Su({zoomPanValues:l,panOnDrag:u,onPaneContextMenu:!!n,onPanZoom:a,onTransformChange:w});f.on(`zoom`,j);let M=Cu({zoomPanValues:l,panOnDrag:u,panOnScroll:i,onPaneContextMenu:n,onPanZoomEnd:s,onDraggingChange:c});f.on(`end`,M);let N=wu({zoomActivationKeyPressed:S,panOnDrag:u,zoomOnScroll:b,panOnScroll:i,zoomOnDoubleClick:x,zoomOnPinch:y,userSelectionActive:r,noPanClassName:t,noWheelClassName:e,lib:C,connectionInProgress:T});f.filter(N),x?p.on(`dblclick.zoom`,h):p.on(`dblclick.zoom`,null)}function v(){f.on(`zoom`,null)}async function y(e,t,n){let r=pu(e),i=f?.constrain()(r,t,n);return i&&await g(i),i}async function b(e,t){let n=pu(e);return await g(n,t),n}function x(e){if(p){let t=pu(e),n=p.property(`__zoom`);(n.k!==e.zoom||n.x!==e.x||n.y!==e.y)&&f?.transform(p,t,null,{sync:!0})}}function S(){let e=p?Hs(p.node()):{x:0,y:0,k:1};return{x:e.x,y:e.y,zoom:e.k}}async function C(e,t){return p?new Promise(n=>{f?.interpolate(t?.interpolate===`linear`?Ia:Xa).scaleTo(_u(p,t?.duration,t?.ease,()=>n(!0)),e)}):!1}async function w(e,t){return p?new Promise(n=>{f?.interpolate(t?.interpolate===`linear`?Ia:Xa).scaleBy(_u(p,t?.duration,t?.ease,()=>n(!0)),e)}):!1}function T(e){f?.scaleExtent(e)}function E(e){f?.translateExtent(e)}function D(e){let t=!Ic(e)||e<0?0:e;f?.clickDistance(t)}return{update:_,destroy:v,setViewport:b,setViewportConstrained:y,getViewport:S,scaleTo:C,scaleBy:w,setScaleExtent:T,setTranslateExtent:E,syncViewport:x,setClickDistance:D}}var Eu;(function(e){e.Line=`line`,e.Handle=`handle`})(Eu||={});function Du({width:e,prevWidth:t,height:n,prevHeight:r,affectsX:i,affectsY:a}){let o=e-t,s=n-r,c=[o>0?1:o<0?-1:0,s>0?1:s<0?-1:0];return o&&i&&(c[0]*=-1),s&&a&&(c[1]*=-1),c}function Ou(e){return{isHorizontal:e.includes(`right`)||e.includes(`left`),isVertical:e.includes(`bottom`)||e.includes(`top`),affectsX:e.includes(`left`),affectsY:e.includes(`top`)}}function ku(e,t){return Math.max(0,t-e)}function Au(e,t){return Math.max(0,e-t)}function ju(e,t,n){return Math.max(0,t-e,e-n)}function Mu(e,t){return e?!t:t}function Nu(e,t,n,r,i,a,o,s){let{affectsX:c,affectsY:l}=t,{isHorizontal:u,isVertical:d}=t,f=u&&d,{xSnapped:p,ySnapped:m}=n,{minWidth:h,maxWidth:g,minHeight:_,maxHeight:v}=r,{x:y,y:b,width:x,height:S,aspectRatio:C}=e,w=Math.floor(u?p-e.pointerX:0),T=Math.floor(d?m-e.pointerY:0),E=x+(c?-w:w),D=S+(l?-T:T),O=-a[0]*x,k=-a[1]*S,A=ju(E,h,g),j=ju(D,_,v);if(o){let e=0,t=0;c&&w<0?e=ku(y+w+O,o[0][0]):!c&&w>0&&(e=Au(y+E+O,o[1][0])),l&&T<0?t=ku(b+T+k,o[0][1]):!l&&T>0&&(t=Au(b+D+k,o[1][1])),A=Math.max(A,e),j=Math.max(j,t)}if(s){let e=0,t=0;c&&w>0?e=Au(y+w,s[0][0]):!c&&w<0&&(e=ku(y+E,s[1][0])),l&&T>0?t=Au(b+T,s[0][1]):!l&&T<0&&(t=ku(b+D,s[1][1])),A=Math.max(A,e),j=Math.max(j,t)}if(i){if(u){let e=ju(E/C,_,v)*C;if(A=Math.max(A,e),o){let e=0;e=!c&&!l||c&&!l&&f?Au(b+k+E/C,o[1][1])*C:ku(b+k+(c?w:-w)/C,o[0][1])*C,A=Math.max(A,e)}if(s){let e=0;e=!c&&!l||c&&!l&&f?ku(b+E/C,s[1][1])*C:Au(b+(c?w:-w)/C,s[0][1])*C,A=Math.max(A,e)}}if(d){let e=ju(D*C,h,g)/C;if(j=Math.max(j,e),o){let e=0;e=!c&&!l||l&&!c&&f?Au(y+D*C+O,o[1][0])/C:ku(y+(l?T:-T)*C+O,o[0][0])/C,j=Math.max(j,e)}if(s){let e=0;e=!c&&!l||l&&!c&&f?ku(y+D*C,s[1][0])/C:Au(y+(l?T:-T)*C,s[0][0])/C,j=Math.max(j,e)}}}T+=T<0?j:-j,w+=w<0?A:-A,i&&(f?E>D*C?T=(Mu(c,l)?-w:w)/C:w=(Mu(c,l)?-T:T)*C:u?(T=w/C,l=c):(w=T*C,c=l));let M=c?y+w:y,N=l?b+T:b;return{width:x+(c?-w:w),height:S+(l?-T:T),x:a[0]*w*(c?-1:1)+M,y:a[1]*T*(l?-1:1)+N}}var Pu={width:0,height:0,x:0,y:0},Fu={...Pu,pointerX:0,pointerY:0,aspectRatio:1};function Iu(e,t,n){let r=t.position.x+e.position.x,i=t.position.y+e.position.y,a=e.measured.width??0,o=e.measured.height??0,s=n[0]*a,c=n[1]*o;return[[r-s,i-c],[r+a-s,i+o-c]]}function Lu({domNode:e,nodeId:t,getStoreItems:n,onChange:r,onEnd:i}){let a=vi(e),o={controlDirection:Ou(`bottom-right`),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function s({controlPosition:e,boundaries:s,keepAspectRatio:c,resizeDirection:l,onResizeStart:u,onResize:d,onResizeEnd:f,shouldResize:p}){let m={...Pu},h={...Fu};o={boundaries:s,resizeDirection:l,keepAspectRatio:c,controlDirection:Ou(e)};let g,_=null,v=[],y,b,x,S=!1,C=Ni().on(`start`,e=>{let{nodeLookup:r,transform:i,snapGrid:a,snapToGrid:o,nodeOrigin:s,paneDomNode:c}=n();if(g=r.get(t),!g)return;_=c?.getBoundingClientRect()??null;let{xSnapped:l,ySnapped:d}=$c(e.sourceEvent,{transform:i,snapGrid:a,snapToGrid:o,containerBounds:_});m={width:g.measured.width??0,height:g.measured.height??0,x:g.position.x??0,y:g.position.y??0},h={...m,pointerX:l,pointerY:d,aspectRatio:m.width/m.height},y=void 0,b=Kc(g.extent)?g.extent:void 0,g.parentId&&(g.extent===`parent`||g.expandParent)&&(y=r.get(g.parentId)),y&&g.extent===`parent`&&(b=[[0,0],[y.measured.width,y.measured.height]]),v=[],x=void 0;for(let[e,n]of r)if(n.parentId===t&&(v.push({id:e,position:{...n.position},extent:n.extent}),n.extent===`parent`||n.expandParent)){let e=Iu(n,g,n.origin??s);x=x?[[Math.min(e[0][0],x[0][0]),Math.min(e[0][1],x[0][1])],[Math.max(e[1][0],x[1][0]),Math.max(e[1][1],x[1][1])]]:e}u?.(e,{...m})}).on(`drag`,e=>{let{transform:t,snapGrid:i,snapToGrid:a,nodeOrigin:s}=n(),c=$c(e.sourceEvent,{transform:t,snapGrid:i,snapToGrid:a,containerBounds:_}),l=[];if(!g)return;let{x:u,y:f,width:C,height:w}=m,T={},E=g.origin??s,{width:D,height:O,x:k,y:A}=Nu(h,o.controlDirection,c,o.boundaries,o.keepAspectRatio,E,b,x),j=D!==C,M=O!==w,N=k!==u&&j,P=A!==f&&M;if(!N&&!P&&!j&&!M)return;if((N||P||E[0]===1||E[1]===1)&&(T.x=N?k:m.x,T.y=P?A:m.y,m.x=T.x,m.y=T.y,v.length>0)){let e=k-u,t=A-f;for(let n of v)n.position={x:n.position.x-e+E[0]*(D-C),y:n.position.y-t+E[1]*(O-w)},l.push(n)}if((j||M)&&(T.width=j&&(!o.resizeDirection||o.resizeDirection===`horizontal`)?D:m.width,T.height=M&&(!o.resizeDirection||o.resizeDirection===`vertical`)?O:m.height,m.width=T.width,m.height=T.height),y&&g.expandParent){let e=E[0]*(T.width??0);T.x&&T.x<e&&(m.x=e,h.x-=T.x-e);let t=E[1]*(T.height??0);T.y&&T.y<t&&(m.y=t,h.y-=T.y-t)}let F=Du({width:m.width,prevWidth:C,height:m.height,prevHeight:w,affectsX:o.controlDirection.affectsX,affectsY:o.controlDirection.affectsY}),I={...m,direction:F};p?.(e,I)!==!1&&(S=!0,d?.(e,I),r(T,l))}).on(`end`,e=>{S&&=(f?.(e,{...m}),i?.({...m}),!1)});a.call(C)}function c(){a.on(`.drag`,null)}return{update:s,destroy:c}}var Ru=e(Ze(),1),zu=e=>{let t,n=new Set,r=(e,r)=>{let i=typeof e==`function`?e(t):e;if(!Object.is(i,t)){let e=t;t=r??(typeof i!=`object`||!i)?i:Object.assign({},t,i),n.forEach(n=>n(t,e))}},i=()=>t,a={setState:r,getState:i,getInitialState:()=>o,subscribe:e=>(n.add(e),()=>n.delete(e)),destroy:()=>{n.clear()}},o=t=e(r,i,a);return a},Bu=e=>e?zu(e):zu,{useDebugValue:Vu}=Y.default,{useSyncExternalStoreWithSelector:Hu}=Ru.default,Uu=e=>e;function Wu(e,t=Uu,n){let r=Hu(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return Vu(r),r}var Gu=(e,t)=>{let n=Bu(e),r=(e,r=t)=>Wu(n,e,r);return Object.assign(r,n),r},Ku=(e,t)=>e?Gu(e,t):Gu;function qu(e,t){if(Object.is(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(let[n,r]of e)if(!Object.is(r,t.get(n)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}let n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(let r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||!Object.is(e[r],t[r]))return!1;return!0}n();var Ju=(0,Y.createContext)(null),Yu=Ju.Provider,Xu=Qs.error001(`react`);function $(e,t){let n=(0,Y.useContext)(Ju);if(n===null)throw Error(Xu);return Wu(n,e,t)}function Zu(){let e=(0,Y.useContext)(Ju);if(e===null)throw Error(Xu);return(0,Y.useMemo)(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}var Qu={display:`none`},$u={position:`absolute`,width:1,height:1,margin:-1,border:0,padding:0,overflow:`hidden`,clip:`rect(0px, 0px, 0px, 0px)`,clipPath:`inset(100%)`},ed=`react-flow__node-desc`,td=`react-flow__edge-desc`,nd=`react-flow__aria-live`,rd=e=>e.ariaLiveMessage,id=e=>e.ariaLabelConfig;function ad({rfId:e}){let t=$(rd);return(0,Z.jsx)(`div`,{id:`${nd}-${e}`,"aria-live":`assertive`,"aria-atomic":`true`,style:$u,children:t})}function od({rfId:e,disableKeyboardA11y:t}){let n=$(id);return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`div`,{id:`${ed}-${e}`,style:Qu,children:t?n[`node.a11yDescription.default`]:n[`node.a11yDescription.keyboardDisabled`]}),(0,Z.jsx)(`div`,{id:`${td}-${e}`,style:Qu,children:n[`edge.a11yDescription.default`]}),!t&&(0,Z.jsx)(ad,{rfId:e})]})}var sd=(0,Y.forwardRef)(({position:e=`top-left`,children:t,className:n,style:r,...i},a)=>(0,Z.jsx)(`div`,{className:pn([`react-flow__panel`,n,...`${e}`.split(`-`)]),style:r,ref:a,...i,children:t}));sd.displayName=`Panel`;var cd=`https://reactflow.dev?utm_source=attribution`;function ld({proOptions:e,position:t=`bottom-right`}){return e?.hideAttribution?null:(0,Z.jsx)(sd,{position:t,className:`react-flow__attribution`,"data-message":`Please only hide this attribution when you are subscribed to React Flow Pro: ${cd}`,children:(0,Z.jsx)(`a`,{href:cd,target:`_blank`,rel:`noopener noreferrer`,"aria-label":`React Flow attribution`,children:`React Flow`})})}var ud=e=>{let t=[],n=[];for(let[,n]of e.nodeLookup)n.selected&&t.push(n.internals.userNode);for(let[,t]of e.edgeLookup)t.selected&&n.push(t);return{selectedNodes:t,selectedEdges:n}},dd=e=>e.id;function fd(e,t){return qu(e.selectedNodes.map(dd),t.selectedNodes.map(dd))&&qu(e.selectedEdges.map(dd),t.selectedEdges.map(dd))}function pd({onSelectionChange:e}){let t=Zu(),{selectedNodes:n,selectedEdges:r}=$(ud,fd);return(0,Y.useEffect)(()=>{let i={nodes:n,edges:r};e?.(i),t.getState().onSelectionChangeHandlers.forEach(e=>e(i))},[n,r,e]),null}var md=e=>!!e.onSelectionChangeHandlers;function hd({onSelectionChange:e}){let t=$(md);return e||t?(0,Z.jsx)(pd,{onSelectionChange:e}):null}var gd=[0,0],_d={x:0,y:0,zoom:1},vd=[...`nodes.edges.defaultNodes.defaultEdges.onConnect.onConnectStart.onConnectEnd.onClickConnectStart.onClickConnectEnd.nodesDraggable.autoPanOnNodeFocus.nodesConnectable.nodesFocusable.edgesFocusable.edgesReconnectable.elevateNodesOnSelect.elevateEdgesOnSelect.minZoom.maxZoom.nodeExtent.onNodesChange.onEdgesChange.elementsSelectable.connectionMode.snapGrid.snapToGrid.translateExtent.connectOnClick.defaultEdgeOptions.fitView.fitViewOptions.onNodesDelete.onEdgesDelete.onDelete.onNodeDrag.onNodeDragStart.onNodeDragStop.onSelectionDrag.onSelectionDragStart.onSelectionDragStop.onMoveStart.onMove.onMoveEnd.noPanClassName.nodeOrigin.autoPanOnConnect.autoPanOnNodeDrag.onError.connectionRadius.isValidConnection.selectNodesOnDrag.nodeDragThreshold.connectionDragThreshold.onBeforeDelete.debug.autoPanSpeed.ariaLabelConfig.zIndexMode`.split(`.`),`rfId`],yd=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges}),bd={translateExtent:$s,nodeOrigin:gd,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:`nopan`,rfId:`1`};function xd(e){let{setNodes:t,setEdges:n,setMinZoom:r,setMaxZoom:i,setTranslateExtent:a,setNodeExtent:o,reset:s,setDefaultNodesAndEdges:c}=$(yd,qu),l=Zu();(0,Y.useEffect)(()=>(c(e.defaultNodes,e.defaultEdges),()=>{u.current=bd,s()}),[]);let u=(0,Y.useRef)(bd);return(0,Y.useEffect)(()=>{for(let s of vd){let c=e[s];c!==u.current[s]&&e[s]!==void 0&&(s===`nodes`?t(c):s===`edges`?n(c):s===`minZoom`?r(c):s===`maxZoom`?i(c):s===`translateExtent`?a(c):s===`nodeExtent`?o(c):s===`ariaLabelConfig`?l.setState({ariaLabelConfig:Qc(c)}):s===`fitView`?l.setState({fitViewQueued:c}):s===`fitViewOptions`?l.setState({fitViewOptions:c}):l.setState({[s]:c}))}u.current=e},vd.map(t=>e[t])),null}function Sd(){return typeof window>`u`||!window.matchMedia?null:window.matchMedia(`(prefers-color-scheme: dark)`)}function Cd(e){let[t,n]=(0,Y.useState)(e===`system`?null:e);return(0,Y.useEffect)(()=>{if(e!==`system`){n(e);return}let t=Sd(),r=()=>n(t?.matches?`dark`:`light`);return r(),t?.addEventListener(`change`,r),()=>{t?.removeEventListener(`change`,r)}},[e]),t===null?Sd()?.matches?`dark`:`light`:t}var wd=typeof document<`u`?document:null;function Td(e=null,t={target:wd,actInsideInputWithModifier:!0}){let[n,r]=(0,Y.useState)(!1),i=(0,Y.useRef)(!1),a=(0,Y.useRef)(new Set([])),[o,s]=(0,Y.useMemo)(()=>{if(e!==null){let t=(Array.isArray(e)?e:[e]).filter(e=>typeof e==`string`).map(e=>e.replace(`+`,`
1
+ import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,i as n,n as r,t as i}from"./vendor-react-BOUWij0V.js";import{d as a,l as o,t as s,u as c}from"./chunk-QUQL4437-DXsxWP7r.js";import{t as l}from"./cn-BQ_8x0bT.js";import{t as u}from"./check-BODqo66o.js";import{t as d}from"./messages-CzKxM6I4.js";import{a as f}from"./fetch-8QNN25Sh.js";import{n as p}from"./locale-store-Ba72bFmP.js";import{i as m}from"./vendor-swr-BIWyz7Rc.js";import{$ as h,$c as g,$o as _,A as v,Al as y,B as b,Ct as x,E as S,F as C,Fi as w,G as T,H as E,Hs as D,I as O,Js as k,K as A,L as j,M,Mc as N,Ms as P,N as F,Na as I,O as L,Oc as R,P as z,Po as B,Ps as V,Q as H,R as U,Rl as ee,Ro as W,S as te,Sc as ne,U as G,V as re,W as ie,Wo as K,Ws as ae,X as oe,Xo as se,Y as ce,Z as le,Zc as q,_o as ue,_t as de,as as fe,at as pe,bo as me,bt as he,ct as ge,dr as _e,dt as ve,et as ye,ft as be,g as xe,gc as Se,gl as Ce,gt as we,ht as J,is as Te,j as Ee,k as De,kl as Oe,ks as ke,lt as Ae,mt as je,nl as Me,no as Ne,oc as Pe,ot as Fe,q as Ie,qo as Le,rl as Re,st as ze,ut as Be,vo as Ve,vr as He,vt as Ue,wc as We,wl as Ge,wt as Ke,xt as qe,ys as Je,yt as Ye,zc as Xe}from"./index-VWvztcst.js";import{t as Ze}from"./with-selector-aYPsXwdl.js";import{t as Qe}from"./page-tabs-je95DZOf.js";import{i as $e,n as et,r as tt,t as nt}from"./workflow-run-setup-panel-Dt_x8LGg.js";var Y=e(t(),1),X=r(),rt=[`queued`,`running`,`succeeded`,`attention`],it=new Set([`failed`,`timeout`,`cancelled`]);function at(e){return e.metadata?.sessionKey?.trim()||null}function ot(e,t){return e.length<=t?e:`${e.slice(0,t-1)}…`}function st(e,t){if(!e||typeof e!=`object`)return null;let n=e;for(let e of t){let t=n[e];if(typeof t==`string`&&t.trim())return t.trim()}return null}function ct(e,t=90){let n=e.metadata?.input?.goal?.trim()||(typeof e.metadata?.input?.payload==`string`?e.metadata.input.payload.trim():null)||st(e.metadata?.input?.payload,[`query`,`goal`,`prompt`,`input`,`message`])||st(e.metadata?.input?.variables,[`query`,`goal`,`prompt`,`input`,`message`]);return n?ot(n,t):null}function lt(e,t=90){return ct(e,t)??ot(e.title?.trim()||e.definitionId,t)}function ut(e,t=44){return ot(e.title?.trim()||e.definitionId,t)}function dt(e,t){let n=t.trim().toLowerCase();return n?[ct(e,500),e.title,e.definitionId,e.id].filter(Boolean).join(` `).toLowerCase().includes(n):!0}function ft(e,t){let n=t.workflowFilterId.trim();return e.filter(e=>n&&e.definitionId!==n||!O(e,t.triggerFilter??`all`)?!1:dt(e,t.searchQuery))}function pt(e){return e.completedAtMs??e.createdAtMs}function mt(e,t){return e.status===`queued`?`queued`:e.status===`running`?`running`:e.status===`succeeded`?`succeeded`:it.has(e.status)?`attention`:null}function ht(e,t){let n=[...t];return e===`queued`?n.sort((e,t)=>e.createdAtMs-t.createdAtMs):e===`running`?n.sort((e,t)=>(t.startedAtMs??t.createdAtMs)-(e.startedAtMs??e.createdAtMs)):n.sort((e,t)=>pt(t)-pt(e))}function gt(e,t){let n={queued:[],running:[],succeeded:[],attention:[]};for(let r of e){let e=mt(r,t);e&&n[e].push(r)}return rt.map(e=>{if(e===`succeeded`){let t=ht(`succeeded`,n.succeeded);return{id:e,runs:t,totalInWindow:t.length}}return{id:e,runs:ht(e,n[e])}})}var _t=new Map;function vt(e){let t=_t.get(e);return t||(t=new Intl.RelativeTimeFormat(e,{numeric:`auto`}),_t.set(e,t)),t}function yt(e,t,n){let r=Math.round((t-e)/1e3),i=vt(n);if(r<60)return i.format(-r,`second`);let a=Math.round(r/60);if(a<60)return i.format(-a,`minute`);let o=Math.round(a/60);if(o<48)return i.format(-o,`hour`);let s=Math.round(o/24);return i.format(-s,`day`)}function bt(e){return e.status===`queued`||e.status===`running`}function xt(e){return e.status===`failed`||e.status===`timeout`||e.status===`cancelled`}var Z=i(),St=(0,Y.memo)(function(e){let t=(0,X.c)(76),{run:n,language:r,localeTag:i,nowMs:a,selected:o,onOpen:s,onOpenChat:c,onCancel:u,onRetry:f}=e,p=d(r).workflows,[m,h]=(0,Y.useState)(!1),g;t[0]===n?g=t[1]:(g=at(n),t[0]=n,t[1]=g);let _=!g,y;t[2]===n?y=t[3]:(y=bt(n),t[2]=n,t[3]=y);let b=y,x=n.status===`running`||n.status===`queued`,S;t[4]!==n.metrics.agentCount||t[5]!==n.metrics.doneAgentCount?(S=n.metrics.agentCount>0?Math.round(n.metrics.doneAgentCount/n.metrics.agentCount*100):0,t[4]=n.metrics.agentCount,t[5]=n.metrics.doneAgentCount,t[6]=S):S=t[6];let C=S,w=n.metrics.errorAgentCount>0,T=n.startedAtMs??n.createdAtMs,E=v(b?a-T:n.metrics.durationMs),D=F(p.taskArtifacts,{count:n.metrics.artifactCount}),O;t[7]===n?O=t[8]:(O=lt(n),t[7]=n,t[8]=O);let k=O,A;t[9]===n?A=t[10]:(A=ut(n),t[9]=n,t[10]=A);let M=A,N;t[11]!==s||t[12]!==n?(N=()=>{s(n)},t[11]=s,t[12]=n,t[13]=N):N=t[13];let P=N,I;t[14]!==_||t[15]!==c||t[16]!==n?(I=()=>{_||c(n)},t[14]=_,t[15]=c,t[16]=n,t[17]=I):I=t[17];let L=I,R=o&&`ring-1 ring-accent/30`,z;t[18]===R?z=t[19]:(z=l(`group relative min-h-24 overflow-hidden rounded-lg bg-surface-panel px-3 py-3 shadow-surface transition-colors`,R,`hover:bg-surface-hover`),t[18]=R,t[19]=z);let B;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(B=l(`w-full text-left`,W.focusRingPanel),t[20]=B):B=t[20];let V;t[21]===k?V=t[22]:(V=(0,Z.jsx)(`div`,{className:`line-clamp-2 text-sm font-medium leading-5 text-fg`,children:k}),t[21]=k,t[22]=V);let H;t[23]===M?H=t[24]:(H=(0,Z.jsx)(`div`,{className:`mt-1 truncate text-[11px] font-medium text-fg-muted`,children:M}),t[23]=M,t[24]=H);let U;t[25]!==V||t[26]!==H?(U=(0,Z.jsxs)(`div`,{className:`min-w-0`,children:[V,H]}),t[25]=V,t[26]=H,t[27]=U):U=t[27];let ee;t[28]===n.status?ee=t[29]:(ee=l(`shrink-0 rounded-full px-2 py-0.5 text-[10px] font-semibold shadow-sm`,j(n.status)),t[28]=n.status,t[29]=ee);let te;t[30]!==i||t[31]!==a||t[32]!==T?(te=yt(T,a,i),t[30]=i,t[31]=a,t[32]=T,t[33]=te):te=t[33];let ne;t[34]===te?ne=t[35]:(ne=(0,Z.jsx)(`span`,{children:te}),t[34]=te,t[35]=ne);let G=E===`—`?null:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`span`,{"aria-hidden":!0,children:`·`}),(0,Z.jsx)(`span`,{children:F(p.taskElapsed,{duration:E})})]}),re;t[36]!==ne||t[37]!==G?(re=(0,Z.jsxs)(`div`,{className:`mt-2 flex flex-wrap items-center gap-1.5 text-[11px] text-fg-subtle`,children:[ne,G]}),t[36]=ne,t[37]=G,t[38]=re):re=t[38];let ie=n.metrics.artifactCount>0?(0,Z.jsx)(`span`,{className:`rounded-full bg-surface-hover px-2 py-0.5 font-medium text-fg-muted`,children:D}):null,ae=o?(0,Z.jsx)(`span`,{className:`font-medium text-accent-fg`,children:p.taskOpenDetails}):null,oe;t[39]!==ie||t[40]!==ae?(oe=(0,Z.jsxs)(`div`,{className:`mt-3 flex flex-wrap items-center gap-2 text-[11px] text-fg-subtle`,children:[ie,ae]}),t[39]=ie,t[40]=ae,t[41]=oe):oe=t[41];let se=_&&`cursor-not-allowed text-fg-disabled hover:bg-transparent`,ce;t[42]===se?ce=t[43]:(ce=l(`rounded-md px-2 py-1 text-xs font-medium`,`text-accent-fg hover:bg-accent-soft`,W.focusRingPanel,se),t[42]=se,t[43]=ce);let le;t[44]!==_||t[45]!==L||t[46]!==p.continueInChat||t[47]!==ce?(le=(0,Z.jsx)(`button`,{type:`button`,className:ce,disabled:_,onClick:L,children:p.continueInChat}),t[44]=_,t[45]=L,t[46]=p.continueInChat,t[47]=ce,t[48]=le):le=t[48];let ue;t[49]===Symbol.for(`react.memo_cache_sentinel`)?(ue=l(`rounded-md px-2 py-1 text-xs font-medium text-fg-muted hover:bg-surface-hover hover:text-fg`,W.focusRingPanel),t[49]=ue):ue=t[49];let de;t[50]!==P||t[51]!==p.taskOpenDetails?(de=(0,Z.jsx)(`button`,{type:`button`,className:ue,onClick:P,children:p.taskOpenDetails}),t[50]=P,t[51]=p.taskOpenDetails,t[52]=de):de=t[52];let fe;t[53]!==le||t[54]!==de?(fe=(0,Z.jsxs)(`div`,{className:`mt-3 flex flex-wrap items-center gap-2 border-t border-edge-subtle pt-2`,children:[le,de]}),t[53]=le,t[54]=de,t[55]=fe):fe=t[55];let pe;t[56]===h?pe=t[57]:(pe=()=>h(wt),t[56]=h,t[57]=pe);let me;t[58]===Symbol.for(`react.memo_cache_sentinel`)?(me=(0,Z.jsx)(q,{className:`size-4`,"aria-hidden":!0}),t[58]=me):me=t[58];let he;t[59]!==p.taskActionsAria||t[60]!==m||t[61]!==pe?(he=(0,Z.jsx)(K,{variant:`ghost`,className:`size-7 p-0 opacity-0 group-hover:opacity-100 group-focus-within:opacity-100`,"aria-label":p.taskActionsAria,"aria-expanded":m,onClick:pe,children:me}),t[59]=p.taskActionsAria,t[60]=m,t[61]=pe,t[62]=he):he=t[62];let ge;t[63]!==b||t[64]!==p.cancel||t[65]!==p.rerun||t[66]!==p.taskCloseMenu||t[67]!==m||t[68]!==u||t[69]!==f||t[70]!==n||t[71]!==h?(ge=m?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`button`,{type:`button`,className:`fixed inset-0 z-10 cursor-default`,"aria-label":p.taskCloseMenu,onClick:()=>h(!1)}),(0,Z.jsxs)(`div`,{className:`absolute right-0 z-20 mt-1 min-w-36 rounded-lg border border-edge bg-surface-panel py-1 shadow-surface`,children:[b?(0,Z.jsx)(Ct,{label:p.cancel,tone:`danger`,onClick:()=>{h(!1),u(n.id)}}):null,xt(n)?(0,Z.jsx)(Ct,{label:p.rerun,onClick:()=>{h(!1),f(n.id)}}):null]})]}):null,t[63]=b,t[64]=p.cancel,t[65]=p.rerun,t[66]=p.taskCloseMenu,t[67]=m,t[68]=u,t[69]=f,t[70]=n,t[71]=h,t[72]=ge):ge=t[72];let _e;return t[73]!==he||t[74]!==ge?(_e=(0,Z.jsxs)(`div`,{className:`absolute right-2 top-2`,children:[he,ge]}),t[73]=he,t[74]=ge,t[75]=_e):_e=t[75],(0,Z.jsxs)(`div`,{className:z,children:[(0,Z.jsxs)(`button`,{type:`button`,onClick:P,"aria-label":`${p.taskOpenDetails}: ${k}`,"aria-current":o?`true`:void 0,className:B,children:[(0,Z.jsxs)(`div`,{className:`pr-7`,children:[(0,Z.jsxs)(`div`,{className:`flex min-w-0 items-start justify-between gap-2`,children:[U,(0,Z.jsx)(`span`,{className:ee,children:p.status[n.status]??n.status})]}),re]}),x?(0,Z.jsxs)(`div`,{className:`mt-2.5`,children:[(0,Z.jsxs)(`div`,{className:`flex items-center justify-between gap-2 text-[11px] text-fg-muted`,children:[(0,Z.jsx)(`span`,{children:F(p.agentProgress,{done:n.metrics.doneAgentCount,total:n.metrics.agentCount})}),(0,Z.jsxs)(`span`,{children:[C,`%`]})]}),(0,Z.jsx)(`div`,{className:`mt-1.5 h-1.5 overflow-hidden rounded-full bg-surface-hover`,children:(0,Z.jsx)(`div`,{className:`h-full rounded-full bg-accent transition-all`,style:{width:`${C}%`}})})]}):null,oe,w?(0,Z.jsxs)(`div`,{className:`mt-2 flex items-center gap-1 text-[11px] text-amber-700 dark:text-amber-300`,children:[(0,Z.jsx)(Te,{className:`size-3 shrink-0`,"aria-hidden":!0}),F(p.runRowErrorSummary,{count:n.metrics.errorAgentCount})]}):null]}),fe,_e]})});function Ct(e){let t=(0,X.c)(8),{label:n,disabled:r,tone:i,onClick:a}=e,o=r?`cursor-not-allowed text-fg-subtle`:`text-fg hover:bg-surface-hover`,s=i===`danger`&&!r&&`text-red-600 dark:text-red-300`,c;t[0]!==o||t[1]!==s?(c=l(`block w-full px-3 py-1.5 text-left text-xs`,o,s),t[0]=o,t[1]=s,t[2]=c):c=t[2];let u;return t[3]!==r||t[4]!==n||t[5]!==a||t[6]!==c?(u=(0,Z.jsx)(`button`,{type:`button`,disabled:r,onClick:a,className:c,children:n}),t[3]=r,t[4]=n,t[5]=a,t[6]=c,t[7]=u):u=t[7],u}function wt(e){return!e}function Tt(e,t){return t.boardColumns[e]}var Et=(0,Y.memo)(function(e){let t=(0,X.c)(17),{column:n,language:r,localeTag:i,nowMs:a,selectedRunId:o,loading:s,onOpenRun:c,onOpenRunChat:u,onCancelRun:f,onRetryRun:p}=e,m=d(r).workflows,[h,g]=(0,Y.useState)(!1),_=n.id===`succeeded`,v=_?5:n.runs.length,y;t[0]!==v||t[1]!==n.runs||t[2]!==h||t[3]!==_?(y=_&&!h?n.runs.slice(0,v):n.runs,t[0]=v,t[1]=n.runs,t[2]=h,t[3]=_,t[4]=y):y=t[4];let b=y,x=_&&n.runs.length>5&&!h,S=_&&h,C;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(C=l(`flex max-h-full w-72 min-w-72 max-w-72 shrink-0 flex-col overflow-y-auto rounded-lg bg-surface-base shadow-surface`),t[5]=C):C=t[5];let w;t[6]===n.runs.length?w=t[7]:(w=(0,Z.jsx)(`span`,{className:`shrink-0 text-xs text-fg-subtle`,children:n.runs.length}),t[6]=n.runs.length,t[7]=w);let T;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(T=(0,Z.jsx)(q,{className:`size-4 shrink-0 text-fg-subtle`,"aria-hidden":!0}),t[8]=T):T=t[8];let E=s&&b.length===0?(0,Z.jsx)(Dt,{}):b.length===0?(0,Z.jsx)(`div`,{className:`rounded-lg bg-surface-panel/70 px-3 py-6 text-center text-xs text-fg-subtle`,children:m.boardColumnEmpty}):b.map(e=>(0,Z.jsx)(St,{run:e,language:r,localeTag:i,nowMs:a,selected:e.id===o,onOpen:c,onOpenChat:u,onCancel:f,onRetry:p},e.id)),D=x?(0,Z.jsx)(K,{variant:`ghost`,className:`h-8 w-full text-xs`,onClick:()=>g(!0),children:F(m.boardExpandSucceeded,{count:Math.min(n.runs.length,n.totalInWindow??n.runs.length)})}):null,O;t[9]!==S||t[10]!==m||t[11]!==g?(O=S?(0,Z.jsx)(K,{variant:`ghost`,className:`h-8 w-full text-xs`,onClick:()=>g(!1),children:m.boardCollapseSucceeded}):null,t[9]=S,t[10]=m,t[11]=g,t[12]=O):O=t[12];let k;return t[13]!==E||t[14]!==D||t[15]!==O?(k=(0,Z.jsxs)(`div`,{className:`mx-2 mt-3 grid min-h-0 min-w-0 content-start gap-2 pb-2 pr-1 [scrollbar-gutter:stable]`,children:[E,D,O]}),t[13]=E,t[14]=D,t[15]=O,t[16]=k):k=t[16],(0,Z.jsxs)(`section`,{className:C,"aria-label":Tt(n.id,m),children:[(0,Z.jsxs)(`header`,{className:`flex shrink-0 items-center justify-between gap-2 px-3 py-3`,children:[(0,Z.jsxs)(`div`,{className:`flex min-w-0 items-baseline gap-2`,children:[(0,Z.jsx)(`h2`,{className:`truncate text-sm font-semibold text-fg`,children:Tt(n.id,m)}),w]}),T]}),k]})});function Dt(){let e=(0,X.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Z.jsxs)(`article`,{className:`min-h-24 rounded-lg bg-surface-panel px-3 py-3 shadow-surface`,"aria-hidden":`true`,children:[(0,Z.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,Z.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Z.jsx)(I,{className:`h-4 w-4/5`}),(0,Z.jsx)(I,{className:`mt-2 h-3 w-24`})]}),(0,Z.jsx)(I,{className:`h-5 w-14 rounded-full`})]}),(0,Z.jsx)(I,{className:`mt-3 h-3 w-2/3`}),(0,Z.jsx)(I,{className:`mt-4 h-5 w-20 rounded-full`})]}),e[0]=t):t=e[0],t}function Ot(e){return e instanceof Element?!!e.closest(`a,button,input,select,textarea,[contenteditable="true"],[draggable="true"],[data-board-pan-skip="true"]`):!0}var kt=(0,Y.memo)(function(e){let t=(0,X.c)(54),{runs:n,language:r,localeTag:i,labels:a,searchQuery:o,workflowFilterId:s,triggerFilter:c,selectedRunId:l,loading:u,onOpenRun:d,onOpenRunChat:f,onCancelRun:p,onRetryRun:m,onStart:h}=e,g;t[0]===n?g=t[1]:(g=n.some(At),t[0]=n,t[1]=g);let _=g,v=(0,Y.useRef)(null),y=(0,Y.useRef)(null),[b,x]=(0,Y.useState)(jt),[S,C]=(0,Y.useState)(!1),w,T;t[2]===_?(w=t[3],T=t[4]):(w=()=>{if(!_)return;let e=window.setInterval(()=>x(Date.now()),1e3);return()=>window.clearInterval(e)},T=[_],t[2]=_,t[3]=w,t[4]=T),(0,Y.useEffect)(w,T);let E;t[5]!==b||t[6]!==n||t[7]!==o||t[8]!==c||t[9]!==s?(E=gt(ft(n,{searchQuery:o,workflowFilterId:s,triggerFilter:c}),b),t[5]=b,t[6]=n,t[7]=o,t[8]=c,t[9]=s,t[10]=E):E=t[10];let D=E,O=D.reduce(Mt,0),k;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(k=e=>{let t=y.current;!t||t.pointerId!==e.pointerId||(y.current=null,C(!1),e.currentTarget.hasPointerCapture?.(e.pointerId)&&e.currentTarget.releasePointerCapture(e.pointerId))},t[11]=k):k=t[11];let A=k,j;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(j=e=>{if(e.button!==0||Ot(e.target))return;let t=v.current;t&&(y.current={pointerId:e.pointerId,startX:e.clientX,scrollLeft:t.scrollLeft,active:!1},e.currentTarget.setPointerCapture(e.pointerId))},t[12]=j):j=t[12];let M=j,N;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(N=e=>{let t=y.current,n=v.current;if(!t||!n||t.pointerId!==e.pointerId)return;let r=e.clientX-t.startX;!t.active&&Math.abs(r)<5||(t.active||(t.active=!0,C(!0)),e.preventDefault(),n.scrollLeft=t.scrollLeft-r)},t[13]=N):N=t[13];let P=N;if(!u&&O===0){let e;t[14]===a.boardEmptyTitle?e=t[15]:(e=(0,Z.jsx)(`p`,{className:`text-sm font-medium text-fg`,children:a.boardEmptyTitle}),t[14]=a.boardEmptyTitle,t[15]=e);let n;t[16]===a.boardEmptyHint?n=t[17]:(n=(0,Z.jsx)(`p`,{className:`mx-auto mt-2 max-w-md text-sm leading-6 text-fg-muted`,children:a.boardEmptyHint}),t[16]=a.boardEmptyHint,t[17]=n);let r;t[18]!==a.boardStart||t[19]!==h?(r=(0,Z.jsx)(`div`,{className:`mt-4 flex justify-center`,children:(0,Z.jsx)(K,{variant:`primary`,onClick:h,children:a.boardStart})}),t[18]=a.boardStart,t[19]=h,t[20]=r):r=t[20];let i;return t[21]!==r||t[22]!==e||t[23]!==n?(i=(0,Z.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col items-center justify-center rounded-2xl border border-dashed border-edge bg-surface-panel/40 px-6 py-12 text-center`,children:[e,n,r]}),t[21]=r,t[22]=e,t[23]=n,t[24]=i):i=t[24],i}let F=S?`cursor-grabbing select-none`:`cursor-grab`,I;t[25]===F?I=t[26]:(I=[`min-h-0 h-full min-w-0 overflow-x-auto rounded-lg px-2 py-2`,F],t[25]=F,t[26]=I);let L=I.join(` `),R;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(R=e=>{y.current?.pointerId===e.pointerId&&(y.current=null,C(!1))},t[27]=R):R=t[27];let z;if(t[28]!==D||t[29]!==r||t[30]!==u||t[31]!==i||t[32]!==b||t[33]!==p||t[34]!==d||t[35]!==f||t[36]!==m||t[37]!==l){let e;t[39]!==r||t[40]!==u||t[41]!==i||t[42]!==b||t[43]!==p||t[44]!==d||t[45]!==f||t[46]!==m||t[47]!==l?(e=e=>(0,Z.jsx)(Et,{column:e,language:r,localeTag:i,nowMs:b,selectedRunId:l,loading:u,onOpenRun:d,onOpenRunChat:f,onCancelRun:p,onRetryRun:m},e.id),t[39]=r,t[40]=u,t[41]=i,t[42]=b,t[43]=p,t[44]=d,t[45]=f,t[46]=m,t[47]=l,t[48]=e):e=t[48],z=D.map(e),t[28]=D,t[29]=r,t[30]=u,t[31]=i,t[32]=b,t[33]=p,t[34]=d,t[35]=f,t[36]=m,t[37]=l,t[38]=z}else z=t[38];let B;t[49]===z?B=t[50]:(B=(0,Z.jsx)(`div`,{className:`flex min-h-full min-w-max items-start gap-3 pr-4`,children:z}),t[49]=z,t[50]=B);let V;return t[51]!==L||t[52]!==B?(V=(0,Z.jsx)(`div`,{ref:v,className:L,onPointerDown:M,onPointerMove:P,onPointerUp:A,onPointerCancel:A,onLostPointerCapture:R,children:B}),t[51]=L,t[52]=B,t[53]=V):V=t[53],V});function At(e){return e.status===`queued`||e.status===`running`}function jt(){return Date.now()}function Mt(e,t){return e+t.runs.length}function Nt(e,t){let n=e.metadata.estimatedAgents;return n?n.min===n.max?F(t.agentScaleExact,{count:n.min}):F(t.agentScaleRange,{min:n.min,max:n.max}):null}function Pt(e){let t=(0,X.c)(71),{definition:n,language:r,labels:i,onPick:a,onDetail:o,onEdit:s}=e,c;t[0]!==n||t[1]!==r?(c=ce(n,r),t[0]=n,t[1]=r,t[2]=c):c=t[2];let u=c,d;t[3]!==n||t[4]!==i?(d=Nt(n,i),t[3]=n,t[4]=i,t[5]=d):d=t[5];let f=d,p=n.metadata.source===`user`,m,h;t[6]!==n||t[7]!==o?(m=e=>{e.target.closest(`button, a`)||o(n)},h=e=>{e.target!==e.currentTarget||e.key!==`Enter`&&e.key!==` `||(e.preventDefault(),o(n))},t[6]=n,t[7]=o,t[8]=m,t[9]=h):(m=t[8],h=t[9]);let g;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(g=l(`group flex h-full cursor-pointer flex-col rounded-xl bg-surface-panel p-4 text-left shadow-surface transition-colors`,`hover:bg-surface-hover`,W.focusRingPanel),t[10]=g):g=t[10];let v=p?`bg-accent-soft text-accent-fg`:`bg-surface-hover text-fg-muted`,y;t[11]===v?y=t[12]:(y=l(`rounded-full px-2 py-0.5 text-[10px] font-medium`,v),t[11]=v,t[12]=y);let b=p?i.badgeUser:i.badgeBuiltin,x;t[13]!==y||t[14]!==b?(x=(0,Z.jsx)(`span`,{className:y,children:b}),t[13]=y,t[14]=b,t[15]=x):x=t[15];let S;t[16]!==n.inputSchema||t[17]!==i.inputSchemaBadge?(S=n.inputSchema?(0,Z.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-full bg-surface-hover px-2 py-0.5 text-[10px] text-fg-subtle`,children:[(0,Z.jsx)(Oe,{className:`size-2.5`,"aria-hidden":!0}),i.inputSchemaBadge]}):null,t[16]=n.inputSchema,t[17]=i.inputSchemaBadge,t[18]=S):S=t[18];let C;t[19]===n.metadata.tags?C=t[20]:(C=n.metadata.tags.slice(0,2).map(Ft),t[19]=n.metadata.tags,t[20]=C);let w;t[21]!==S||t[22]!==C||t[23]!==x?(w=(0,Z.jsxs)(`div`,{className:`mb-2 flex flex-wrap items-center gap-1.5`,children:[x,S,C]}),t[21]=S,t[22]=C,t[23]=x,t[24]=w):w=t[24];let T;t[25]===n.title?T=t[26]:(T=(0,Z.jsx)(`span`,{className:`line-clamp-2 text-sm font-semibold leading-5 text-fg`,children:n.title}),t[25]=n.title,t[26]=T);let E;t[27]!==w||t[28]!==T?(E=(0,Z.jsx)(`div`,{className:`flex items-start gap-2`,children:(0,Z.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[w,T]})}),t[27]=w,t[28]=T,t[29]=E):E=t[29];let D;t[30]===u.description?D=t[31]:(D=u.description?(0,Z.jsx)(`p`,{className:`mt-2 line-clamp-2 text-xs leading-5 text-fg-muted`,children:u.description}):null,t[30]=u.description,t[31]=D);let O;t[32]===Symbol.for(`react.memo_cache_sentinel`)?(O=(0,Z.jsx)(We,{className:`size-3`,"aria-hidden":!0}),t[32]=O):O=t[32];let A;t[33]!==n.phases.length||t[34]!==i.phaseCount?(A=F(i.phaseCount,{count:n.phases.length}),t[33]=n.phases.length,t[34]=i.phaseCount,t[35]=A):A=t[35];let j;t[36]===A?j=t[37]:(j=(0,Z.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[O,A]}),t[36]=A,t[37]=j);let M;t[38]===f?M=t[39]:(M=f?(0,Z.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[(0,Z.jsx)(_,{className:`size-3`,"aria-hidden":!0}),f]}):null,t[38]=f,t[39]=M);let N;t[40]!==j||t[41]!==M?(N=(0,Z.jsxs)(`div`,{className:`mt-auto flex flex-wrap items-center gap-3 pt-3 text-[11px] text-fg-subtle`,children:[j,M]}),t[40]=j,t[41]=M,t[42]=N):N=t[42];let P;t[43]!==E||t[44]!==D||t[45]!==N?(P=(0,Z.jsxs)(`div`,{className:`flex flex-1 flex-col`,children:[E,D,N]}),t[43]=E,t[44]=D,t[45]=N,t[46]=P):P=t[46];let I;t[47]!==n||t[48]!==a?(I=()=>a(n),t[47]=n,t[48]=a,t[49]=I):I=t[49];let L;t[50]===Symbol.for(`react.memo_cache_sentinel`)?(L=(0,Z.jsx)(ae,{className:`size-3.5`,"aria-hidden":!0}),t[50]=L):L=t[50];let R;t[51]!==i.runWorkflow||t[52]!==I?(R=(0,Z.jsxs)(K,{type:`button`,variant:`primary`,className:`h-8 flex-1 rounded-lg text-xs`,onClick:I,children:[L,i.runWorkflow]}),t[51]=i.runWorkflow,t[52]=I,t[53]=R):R=t[53];let z;t[54]!==n||t[55]!==s?(z=()=>s(n),t[54]=n,t[55]=s,t[56]=z):z=t[56];let B;t[57]===p?B=t[58]:(B=p?(0,Z.jsx)(k,{className:`size-3.5`,"aria-hidden":!0}):(0,Z.jsx)(Re,{className:`size-3.5`,"aria-hidden":!0}),t[57]=p,t[58]=B);let V=p?i.editWorkflow:i.copyAndEditWorkflow,H;t[59]!==z||t[60]!==B||t[61]!==V?(H=(0,Z.jsxs)(K,{type:`button`,variant:`secondary`,className:`h-8 rounded-lg text-xs`,onClick:z,children:[B,V]}),t[59]=z,t[60]=B,t[61]=V,t[62]=H):H=t[62];let U;t[63]!==R||t[64]!==H?(U=(0,Z.jsxs)(`div`,{className:`mt-4 flex flex-wrap gap-2 border-t border-edge-subtle pt-3`,children:[R,H]}),t[63]=R,t[64]=H,t[65]=U):U=t[65];let ee;return t[66]!==P||t[67]!==U||t[68]!==m||t[69]!==h?(ee=(0,Z.jsxs)(`article`,{role:`link`,tabIndex:0,onClick:m,onKeyDown:h,className:g,children:[P,U]}),t[66]=P,t[67]=U,t[68]=m,t[69]=h,t[70]=ee):ee=t[70],ee}function Ft(e){return(0,Z.jsx)(`span`,{className:`rounded-full bg-surface-hover px-2 py-0.5 text-[10px] text-fg-subtle`,children:e},e)}function It(e,t){return e===`uncategorized`?t.categories.uncategorized:t.categories[e]}function Lt(e){let t=(0,X.c)(11),{definitions:n,language:r,onPick:i,onDetail:a,onEdit:o}=e,s=d(r).workflows,[c,u]=(0,Y.useState)(``),[f,p]=(0,Y.useState)(`all`),m;t[0]!==f||t[1]!==n||t[2]!==c?(m=De(n,c,f,`all`),t[0]=f,t[1]=n,t[2]=c,t[3]=m):m=t[3];let h=m,g;t[4]===h?g=t[5]:(g=M(h),t[4]=h,t[5]=g);let _=g,v;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,Z.jsx)(ke,{className:`pointer-events-none absolute left-3 top-1/2 size-4 -translate-y-1/2 text-fg-subtle`,"aria-hidden":!0}),t[6]=v):v=t[6];let y;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(y=e=>u(e.target.value),t[7]=y):y=t[7];let b=s.searchPlaceholder,x;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(x=l(`h-10 w-full rounded-xl border border-edge bg-surface-base py-2 pl-10 pr-3 text-sm text-fg`,`placeholder:text-fg-subtle`,W.focusRingPanel),t[8]=x):x=t[8];let S=h.length===0?(0,Z.jsxs)(`div`,{className:`flex h-full flex-col items-center justify-center px-4 py-12 text-center`,children:[(0,Z.jsx)(`p`,{className:`text-sm text-fg-muted`,children:s.noDefinitions}),(0,Z.jsx)(`p`,{className:`mt-1 max-w-sm text-xs leading-5 text-fg-subtle`,children:s.noDefinitionsHint})]}):f===`all`?(0,Z.jsx)(`div`,{className:`flex flex-col gap-6 pb-1`,children:_.map(e=>(0,Z.jsxs)(`section`,{children:[(0,Z.jsx)(`h3`,{className:`mb-3 text-xs font-semibold uppercase tracking-wide text-fg-subtle`,children:It(e.category,s)}),(0,Z.jsx)(`div`,{className:`grid grid-cols-1 gap-3 sm:grid-cols-2 xl:grid-cols-3`,children:e.items.map(e=>(0,Z.jsx)(Pt,{definition:e,language:r,labels:s,onPick:i,onDetail:a,onEdit:o},e.id))})]},e.category))}):(0,Z.jsx)(`div`,{className:`grid grid-cols-1 gap-3 pb-1 sm:grid-cols-2 xl:grid-cols-3`,children:h.map(e=>(0,Z.jsx)(Pt,{definition:e,language:r,labels:s,onPick:i,onDetail:a,onEdit:o},e.id))}),C;return t[9]===S?C=t[10]:(C=(0,Z.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto`,children:S}),t[9]=S,t[10]=C),(0,Z.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-4`,children:[(0,Z.jsxs)(`div`,{className:`flex shrink-0 flex-col gap-4`,children:[(0,Z.jsxs)(`div`,{className:`relative`,children:[v,(0,Z.jsx)(`input`,{value:c,onChange:y,placeholder:b,className:x})]}),(0,Z.jsx)(`div`,{className:`flex flex-wrap gap-2`,role:`group`,"aria-label":s.categoryFilterAria,children:ie.map(e=>(0,Z.jsx)(K,{type:`button`,variant:f===e?`secondary`:`ghost`,className:`h-8 rounded-full px-3 py-1.5 text-xs`,onClick:()=>p(e),children:s.categories[e]},e))})]}),C]})}function Rt(e){let t=(0,X.c)(30),{stats:n,language:r}=e,i,a,o;if(t[0]!==r||t[1]!==n){o=Symbol.for(`react.early_return_sentinel`);bb0:{if(i=d(r).workflows,!n||n.totalRuns===0){o=null;break bb0}a=n.topDefinitions[0]?F(i.statsTopWorkflow,{name:n.topDefinitions[0].definitionId,count:n.topDefinitions[0].count}):null}t[0]=r,t[1]=n,t[2]=i,t[3]=a,t[4]=o}else i=t[2],a=t[3],o=t[4];if(o!==Symbol.for(`react.early_return_sentinel`))return o;let s=a,c=i.statsTotalRuns,l=String(n.totalRuns),u;t[5]!==i.statsTotalRuns||t[6]!==l?(u=(0,Z.jsx)(zt,{label:c,value:l}),t[5]=i.statsTotalRuns,t[6]=l,t[7]=u):u=t[7];let f=i.statsActiveRuns,p=String(n.activeRuns),m;t[8]!==i.statsActiveRuns||t[9]!==p?(m=(0,Z.jsx)(zt,{label:f,value:p}),t[8]=i.statsActiveRuns,t[9]=p,t[10]=m):m=t[10];let h;t[11]!==n.succeededRuns||t[12]!==n.totalRuns?(h=n.totalRuns>0?`${Math.round(n.succeededRuns/n.totalRuns*100)}%`:`—`,t[11]=n.succeededRuns,t[12]=n.totalRuns,t[13]=h):h=t[13];let g;t[14]!==i.statsSuccessRate||t[15]!==h?(g=(0,Z.jsx)(zt,{label:i.statsSuccessRate,value:h}),t[14]=i.statsSuccessRate,t[15]=h,t[16]=g):g=t[16];let _;t[17]===n.averageDurationMs?_=t[18]:(_=n.averageDurationMs==null?`—`:v(n.averageDurationMs),t[17]=n.averageDurationMs,t[18]=_);let y;t[19]!==i.statsAvgDuration||t[20]!==_?(y=(0,Z.jsx)(zt,{label:i.statsAvgDuration,value:_}),t[19]=i.statsAvgDuration,t[20]=_,t[21]=y):y=t[21];let b;t[22]===s?b=t[23]:(b=s?(0,Z.jsx)(`span`,{className:`min-w-0 truncate text-xs text-fg-muted`,children:s}):null,t[22]=s,t[23]=b);let x;return t[24]!==g||t[25]!==y||t[26]!==b||t[27]!==u||t[28]!==m?(x=(0,Z.jsxs)(`section`,{className:`flex min-w-0 flex-wrap items-center gap-2 rounded-lg bg-surface-panel/70 px-3 py-2 shadow-surface`,children:[u,m,g,y,b]}),t[24]=g,t[25]=y,t[26]=b,t[27]=u,t[28]=m,t[29]=x):x=t[29],x}function zt(e){let t=(0,X.c)(7),{label:n,value:r}=e,i;t[0]===n?i=t[1]:(i=(0,Z.jsx)(`span`,{children:n}),t[0]=n,t[1]=i);let a;t[2]===r?a=t[3]:(a=(0,Z.jsx)(`span`,{className:`font-semibold tabular-nums text-fg`,children:r}),t[2]=r,t[3]=a);let o;return t[4]!==i||t[5]!==a?(o=(0,Z.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 rounded-full bg-surface-muted px-2.5 py-1 text-xs text-fg-muted`,children:[i,a]}),t[4]=i,t[5]=a,t[6]=o):o=t[6],o}function Bt(e){let t=(0,X.c)(10),{vm:n}=e,{labels:r,loading:i,refreshAll:a}=n,o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,Z.jsx)(D,{className:`size-4`,"aria-hidden":!0}),t[0]=o):o=t[0];let c;t[1]===r.addWorkflow?c=t[2]:(c=(0,Z.jsx)(K,{asChild:!0,variant:`primary`,className:`h-9 rounded-lg`,children:(0,Z.jsxs)(s,{to:`/workflows/new`,children:[o,r.addWorkflow]})}),t[1]=r.addWorkflow,t[2]=c);let l;t[3]!==r.refresh||t[4]!==i||t[5]!==a?(l=(0,Z.jsx)(w,{className:`size-9 shrink-0 p-0`,loading:i,label:r.refresh,onClick:a}),t[3]=r.refresh,t[4]=i,t[5]=a,t[6]=l):l=t[6];let u;return t[7]!==c||t[8]!==l?(u=(0,Z.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-2`,children:[c,l]}),t[7]=c,t[8]=l,t[9]=u):u=t[9],u}var Vt=[`attention`,`running`,`queued`,`recent`],Ht=[`pr_review`,`implementation_plan`,`research`,`debug_incident`,`meeting_prep`,`content_draft`];function Ut(e){return e.status===`failed`||e.status===`timeout`||e.status===`cancelled`?`attention`:e.status===`running`?`running`:e.status===`queued`?`queued`:e.status===`succeeded`?`recent`:null}function Wt(e){return e.completedAtMs??e.startedAtMs??e.createdAtMs}function Gt(e,t){let n=[...t];return e===`queued`?n.sort((e,t)=>e.createdAtMs-t.createdAtMs):n.sort((e,t)=>Wt(t)-Wt(e))}function Kt(e){let t=new Map(Vt.map(e=>[e,[]]));for(let n of e){let e=Ut(n);e&&t.get(e)?.push(n)}for(let e of Vt)t.set(e,Gt(e,t.get(e)??[]));return t}function qt(){let e=(0,X.c)(2),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Z.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,Z.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(I,{className:`size-4 rounded-full`}),(0,Z.jsx)(I,{className:`h-4 w-32`})]}),(0,Z.jsx)(I,{className:`mt-3 h-4 w-full`}),(0,Z.jsx)(I,{className:`mt-2 h-4 w-2/3`})]}),(0,Z.jsx)(I,{className:`h-6 w-20 rounded-full`})]}),e[0]=t):t=e[0];let n;return e[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Z.jsxs)(`article`,{className:`rounded-lg bg-surface-panel p-3 shadow-surface`,"aria-hidden":`true`,children:[t,(0,Z.jsxs)(`div`,{className:`mt-4 flex gap-2`,children:[(0,Z.jsx)(I,{className:`h-8 w-20 rounded-md`}),(0,Z.jsx)(I,{className:`h-8 w-24 rounded-md`})]})]}),e[1]=n):n=e[1],n}function Jt(e){let t=new Map(e.map(e=>[e.id,e])),n=[];for(let e of Ht){let r=t.get(e);r&&n.push(r)}for(let t of e){if(n.length>=6)break;n.some(e=>e.id===t.id)||n.push(t)}return n}function Yt(e,t){let n=G[e.name]??[];return n.length>0?n.slice(0,2).map(e=>$e(t.args,e.labelKey)).join(` · `):e.inputSchema?.properties&&Object.keys(e.inputSchema.properties).length>0?t.templateInputsStructured:t.templateInputsGoalOnly}function Xt(e){let t=(0,X.c)(42),{definitions:n,language:r,labels:i,onStart:a,onDetail:o,onBrowseAll:s,onManageTemplates:c}=e,[u,d]=(0,Y.useState)(!0),f,p;if(t[0]!==n||t[1]!==u||t[2]!==i||t[3]!==r||t[4]!==s||t[5]!==o||t[6]!==c||t[7]!==a){p=Symbol.for(`react.early_return_sentinel`);bb0:{let e=Jt(n);if(e.length===0){p=null;break bb0}let m;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(m=l(`flex min-w-0 flex-1 items-start gap-3 text-left`,W.focusRingPanel),t[10]=m):m=t[10];let h;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(h=()=>d(Zt),t[11]=h):h=t[11];let g=u?`rotate-180`:null,_;t[12]===g?_=t[13]:(_=l(`mt-1 size-4 shrink-0 text-fg-subtle transition-transform`,g),t[12]=g,t[13]=_);let v;t[14]===_?v=t[15]:(v=(0,Z.jsx)(Ge,{className:_,"aria-hidden":!0}),t[14]=_,t[15]=v);let y;t[16]===i.launchRecommended?y=t[17]:(y=(0,Z.jsx)(`span`,{className:`block text-xs font-medium text-accent-fg`,children:i.launchRecommended}),t[16]=i.launchRecommended,t[17]=y);let b;t[18]===i.launchTitle?b=t[19]:(b=(0,Z.jsx)(`span`,{className:`mt-1 block text-base font-semibold text-fg`,children:i.launchTitle}),t[18]=i.launchTitle,t[19]=b);let x;t[20]===i.launchHint?x=t[21]:(x=(0,Z.jsx)(`span`,{className:`mt-1 block max-w-3xl text-sm leading-6 text-fg-muted`,children:i.launchHint}),t[20]=i.launchHint,t[21]=x);let S;t[22]!==x||t[23]!==y||t[24]!==b?(S=(0,Z.jsxs)(`span`,{className:`min-w-0`,children:[y,b,x]}),t[22]=x,t[23]=y,t[24]=b,t[25]=S):S=t[25];let C;t[26]!==u||t[27]!==S||t[28]!==v?(C=(0,Z.jsxs)(`button`,{type:`button`,className:m,"aria-expanded":u,onClick:h,children:[v,S]}),t[26]=u,t[27]=S,t[28]=v,t[29]=C):C=t[29];let w;t[30]!==i.launchBrowseAll||t[31]!==s?(w=(0,Z.jsx)(K,{type:`button`,variant:`secondary`,className:`h-8 rounded-lg text-xs`,onClick:s,children:i.launchBrowseAll}),t[30]=i.launchBrowseAll,t[31]=s,t[32]=w):w=t[32];let T;t[33]!==i.launchManageTemplates||t[34]!==c?(T=(0,Z.jsx)(K,{type:`button`,variant:`secondary`,className:`h-8 rounded-lg text-xs`,onClick:c,children:i.launchManageTemplates}),t[33]=i.launchManageTemplates,t[34]=c,t[35]=T):T=t[35];let E;t[36]!==w||t[37]!==T?(E=(0,Z.jsxs)(`div`,{className:`flex shrink-0 flex-wrap gap-2`,children:[w,T]}),t[36]=w,t[37]=T,t[38]=E):E=t[38];let D;t[39]!==C||t[40]!==E?(D=(0,Z.jsxs)(`div`,{className:`flex flex-col gap-3 lg:flex-row lg:items-start lg:justify-between`,children:[C,E]}),t[39]=C,t[40]=E,t[41]=D):D=t[41],f=(0,Z.jsxs)(`section`,{className:`rounded-lg border border-edge-subtle bg-surface-base px-4 py-4 shadow-surface`,children:[D,u?(0,Z.jsx)(`div`,{className:`mt-4 grid gap-3 md:grid-cols-2 xl:grid-cols-3`,children:e.map(e=>{let t=ce(e,r);return(0,Z.jsxs)(`article`,{className:`relative min-w-0 rounded-lg border border-edge bg-surface-panel p-3 transition-colors hover:bg-surface-hover/45`,children:[(0,Z.jsx)(`button`,{type:`button`,"aria-label":`${i.viewDetails}: ${e.title}`,className:l(`absolute inset-0 cursor-pointer rounded-lg`,W.focusRingPanel),onClick:()=>o(e)}),(0,Z.jsxs)(`div`,{className:`pointer-events-none relative z-10 flex items-start justify-between gap-3`,children:[(0,Z.jsxs)(`div`,{className:`min-w-0 flex-1 text-left`,children:[(0,Z.jsx)(`span`,{className:`line-clamp-1 text-sm font-semibold text-fg`,children:e.title}),(0,Z.jsx)(`span`,{className:`mt-1 block line-clamp-2 text-xs leading-5 text-fg-muted`,children:t.whenToUse||t.description})]}),(0,Z.jsxs)(K,{type:`button`,variant:`primary`,className:`pointer-events-auto h-8 shrink-0 rounded-lg px-2.5 text-xs`,onClick:()=>a(e),children:[(0,Z.jsx)(ae,{className:`size-3.5`,"aria-hidden":!0}),i.runWorkflow]})]}),(0,Z.jsxs)(`dl`,{className:`pointer-events-none relative z-10 mt-3 grid gap-2 text-xs sm:grid-cols-2`,children:[(0,Z.jsxs)(`div`,{className:`rounded-md bg-surface-muted/50 px-2.5 py-2`,children:[(0,Z.jsx)(`dt`,{className:`font-medium text-fg-subtle`,children:i.templateInputs}),(0,Z.jsx)(`dd`,{className:`mt-0.5 line-clamp-1 text-fg-muted`,children:Yt(e,i)})]}),(0,Z.jsxs)(`div`,{className:`rounded-md bg-surface-muted/50 px-2.5 py-2`,children:[(0,Z.jsx)(`dt`,{className:`font-medium text-fg-subtle`,children:i.templateExpectedOutput}),(0,Z.jsx)(`dd`,{className:`mt-0.5 line-clamp-1 text-fg-muted`,children:i.templateOutputReport})]})]})]},e.id)})}):null]})}t[0]=n,t[1]=u,t[2]=i,t[3]=r,t[4]=s,t[5]=o,t[6]=c,t[7]=a,t[8]=f,t[9]=p}else f=t[8],p=t[9];return p===Symbol.for(`react.early_return_sentinel`)?f:p}function Zt(e){return!e}function Qt(e){let t=(0,X.c)(134),{vm:n}=e,{language:r,localeTag:i,labels:a,hasToken:o,definitions:s,runs:c,searchQuery:u,setSearchQuery:f,ownerAgentId:p,agentOptions:m,setOwnerAgentId:h,workflowFilterId:g,setWorkflowFilterId:_,triggerFilter:v,setTriggerFilter:y,viewMode:b,setViewMode:x,openRunDetails:S,openRunInChat:C,openDefinitionDetails:w,openWorkflowEditor:T,startWorkflow:E,actionError:D,actionFeedback:O,loading:k,error:A,stats:j,cancelRun:M,retryRun:N}=n,P=Ne(on),F=Ne(an),I;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(I=Date.now(),t[0]=I):I=t[0];let L=I,R=Kt(ft(c,{searchQuery:u,workflowFilterId:g,triggerFilter:v})),z;t[1]!==F||t[2]!==o||t[3]!==a.statsActiveRuns||t[4]!==a.statsTotalRuns||t[5]!==a.subtitleBoard||t[6]!==a.title||t[7]!==P||t[8]!==j||t[9]!==n?(z=()=>{if(!o){F();return}return P({startExtra:null,main:(0,Z.jsxs)(`div`,{className:`min-w-0`,children:[(0,Z.jsx)(`h1`,{className:`truncate text-base font-semibold tracking-tight text-fg`,children:a.title}),(0,Z.jsx)(`p`,{className:`truncate text-xs text-fg-muted`,children:j?`${a.statsTotalRuns}: ${j.totalRuns} · ${a.statsActiveRuns}: ${j.activeRuns}`:a.subtitleBoard})]}),end:(0,Z.jsx)(Bt,{vm:n})}),()=>F()},t[1]=F,t[2]=o,t[3]=a.statsActiveRuns,t[4]=a.statsTotalRuns,t[5]=a.subtitleBoard,t[6]=a.title,t[7]=P,t[8]=j,t[9]=n,t[10]=z):z=t[10];let B;if(t[11]!==F||t[12]!==o||t[13]!==a.statsActiveRuns||t[14]!==a.statsTotalRuns||t[15]!==a.subtitleBoard||t[16]!==a.title||t[17]!==k||t[18]!==j||t[19]!==n?(B=[F,o,a.title,a.statsActiveRuns,a.statsTotalRuns,a.subtitleBoard,k,j,n,n.refreshAll,n.setSearchQuery],t[11]=F,t[12]=o,t[13]=a.statsActiveRuns,t[14]=a.statsTotalRuns,t[15]=a.subtitleBoard,t[16]=a.title,t[17]=k,t[18]=j,t[19]=n,t[20]=B):B=t[20],(0,Y.useLayoutEffect)(z,B),!o){let e;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(Xe,{className:`size-10 text-accent-fg`,"aria-hidden":!0}),t[21]=e):e=t[21];let n;t[22]===a.title?n=t[23]:(n=(0,Z.jsx)(`h1`,{className:`mt-4 text-xl font-semibold text-fg`,children:a.title}),t[22]=a.title,t[23]=n);let r;t[24]===a.needToken?r=t[25]:(r=(0,Z.jsx)(`p`,{className:`mt-2 max-w-md text-sm leading-6 text-fg-muted`,children:a.needToken}),t[24]=a.needToken,t[25]=r);let i;return t[26]!==n||t[27]!==r?(i=(0,Z.jsx)(`main`,{className:`min-h-0 flex-1 overflow-auto bg-surface-panel`,children:(0,Z.jsxs)(`div`,{className:`flex w-full flex-col items-center px-3 py-16 text-center sm:px-5 xl:px-6`,children:[e,n,r]})}),t[26]=n,t[27]=r,t[28]=i):i=t[28],i}let V;t[29]!==s||t[30]!==a||t[31]!==r||t[32]!==w||t[33]!==E?(V=(0,Z.jsx)(Xt,{definitions:s,language:r,labels:a,onStart:E,onDetail:w,onBrowseAll:rn,onManageTemplates:nn}),t[29]=s,t[30]=a,t[31]=r,t[32]=w,t[33]=E,t[34]=V):V=t[34];let H;t[35]===Symbol.for(`react.memo_cache_sentinel`)?(H=(0,Z.jsx)(ke,{className:`pointer-events-none absolute left-2.5 top-1/2 size-4 -translate-y-1/2 text-fg-subtle`,"aria-hidden":!0}),t[35]=H):H=t[35];let U;t[36]===f?U=t[37]:(U=e=>f(e.target.value),t[36]=f,t[37]=U);let ee=a.searchPlaceholder,te;t[38]===Symbol.for(`react.memo_cache_sentinel`)?(te=l(`h-9 w-full rounded-lg border border-edge bg-surface-panel py-2 pl-9 pr-3 text-sm text-fg shadow-surface`,`placeholder:text-fg-subtle`,W.focusRingPanel),t[38]=te):te=t[38];let G;t[39]!==a.searchPlaceholder||t[40]!==u||t[41]!==U?(G=(0,Z.jsxs)(`div`,{className:`relative min-w-48 flex-1 sm:max-w-xs`,children:[H,(0,Z.jsx)(`input`,{value:u,onChange:U,placeholder:ee,className:te})]}),t[39]=a.searchPlaceholder,t[40]=u,t[41]=U,t[42]=G):G=t[42];let re;t[43]!==m||t[44]!==r||t[45]!==p||t[46]!==h?(re=m.length>1?(0,Z.jsx)(Ve,{value:p??``,"aria-label":`Agent`,onChange:e=>h(e.target.value),className:l(`h-9 min-w-32 rounded-lg border border-edge bg-surface-panel px-2.5 text-xs font-medium text-fg shadow-surface`,W.focusRingPanel),children:m.map(e=>(0,Z.jsx)(me,{value:e.id,children:_e(e,d(r).agentsSettings)},e.id))}):null,t[43]=m,t[44]=r,t[45]=p,t[46]=h,t[47]=re):re=t[47];let ie=a.boardTriggerFilterAria,K;t[48]===y?K=t[49]:(K=e=>y(e.target.value),t[48]=y,t[49]=K);let ae;t[50]===Symbol.for(`react.memo_cache_sentinel`)?(ae=l(`h-9 min-w-[7.5rem] rounded-lg border border-edge bg-surface-panel px-2.5 text-xs font-medium text-fg shadow-surface`,W.focusRingPanel),t[50]=ae):ae=t[50];let oe;t[51]===a.boardTriggerFilterAll?oe=t[52]:(oe=(0,Z.jsx)(me,{value:`all`,children:a.boardTriggerFilterAll}),t[51]=a.boardTriggerFilterAll,t[52]=oe);let se;t[53]===a.boardTriggerFilterAutomation?se=t[54]:(se=(0,Z.jsx)(me,{value:`automation`,children:a.boardTriggerFilterAutomation}),t[53]=a.boardTriggerFilterAutomation,t[54]=se);let ce;t[55]===a.boardTriggerFilterWebui?ce=t[56]:(ce=(0,Z.jsx)(me,{value:`webui`,children:a.boardTriggerFilterWebui}),t[55]=a.boardTriggerFilterWebui,t[56]=ce);let le;t[57]===a.boardTriggerFilterChat?le=t[58]:(le=(0,Z.jsx)(me,{value:`chat`,children:a.boardTriggerFilterChat}),t[57]=a.boardTriggerFilterChat,t[58]=le);let q;t[59]===a.boardTriggerFilterApi?q=t[60]:(q=(0,Z.jsx)(me,{value:`api`,children:a.boardTriggerFilterApi}),t[59]=a.boardTriggerFilterApi,t[60]=q);let ue;t[61]!==a.boardTriggerFilterAria||t[62]!==K||t[63]!==oe||t[64]!==se||t[65]!==ce||t[66]!==le||t[67]!==q||t[68]!==v?(ue=(0,Z.jsxs)(Ve,{value:v,"aria-label":ie,onChange:K,className:ae,children:[oe,se,ce,le,q]}),t[61]=a.boardTriggerFilterAria,t[62]=K,t[63]=oe,t[64]=se,t[65]=ce,t[66]=le,t[67]=q,t[68]=v,t[69]=ue):ue=t[69];let de=a.boardWorkflowFilterAria,fe;t[70]===_?fe=t[71]:(fe=e=>_(e.target.value),t[70]=_,t[71]=fe);let pe;t[72]===Symbol.for(`react.memo_cache_sentinel`)?(pe=l(`h-9 min-w-40 rounded-lg border border-edge bg-surface-panel px-2.5 text-xs font-medium text-fg shadow-surface`,W.focusRingPanel),t[72]=pe):pe=t[72];let he;t[73]===a.boardWorkflowFilterAll?he=t[74]:(he=(0,Z.jsx)(me,{value:``,children:a.boardWorkflowFilterAll}),t[73]=a.boardWorkflowFilterAll,t[74]=he);let ge;t[75]===s?ge=t[76]:(ge=s.map(tn),t[75]=s,t[76]=ge);let ve;t[77]!==a.boardWorkflowFilterAria||t[78]!==fe||t[79]!==he||t[80]!==ge||t[81]!==g?(ve=(0,Z.jsxs)(Ve,{value:g,"aria-label":de,onChange:fe,className:pe,children:[he,ge]}),t[77]=a.boardWorkflowFilterAria,t[78]=fe,t[79]=he,t[80]=ge,t[81]=g,t[82]=ve):ve=t[82];let ye=b===`operations`?`bg-surface-panel text-fg shadow-surface`:`text-fg-muted hover:text-fg`,be;t[83]===ye?be=t[84]:(be=l(`inline-flex h-8 items-center gap-1.5 rounded-md px-2.5 text-xs font-medium transition-colors`,ye),t[83]=ye,t[84]=be);let xe;t[85]===x?xe=t[86]:(xe=()=>x(`operations`),t[85]=x,t[86]=xe);let Ce;t[87]===Symbol.for(`react.memo_cache_sentinel`)?(Ce=(0,Z.jsx)(Se,{className:`size-3.5`,"aria-hidden":!0}),t[87]=Ce):Ce=t[87];let we;t[88]!==a.viewModes.operations||t[89]!==be||t[90]!==xe?(we=(0,Z.jsxs)(`button`,{type:`button`,className:be,onClick:xe,children:[Ce,a.viewModes.operations]}),t[88]=a.viewModes.operations,t[89]=be,t[90]=xe,t[91]=we):we=t[91];let J=b===`board`?`bg-surface-panel text-fg shadow-surface`:`text-fg-muted hover:text-fg`,Te;t[92]===J?Te=t[93]:(Te=l(`inline-flex h-8 items-center gap-1.5 rounded-md px-2.5 text-xs font-medium transition-colors`,J),t[92]=J,t[93]=Te);let Ee;t[94]===x?Ee=t[95]:(Ee=()=>x(`board`),t[94]=x,t[95]=Ee);let De;t[96]===Symbol.for(`react.memo_cache_sentinel`)?(De=(0,Z.jsx)(ne,{className:`size-3.5`,"aria-hidden":!0}),t[96]=De):De=t[96];let Oe;t[97]!==a.viewModes.board||t[98]!==Te||t[99]!==Ee?(Oe=(0,Z.jsxs)(`button`,{type:`button`,className:Te,onClick:Ee,children:[De,a.viewModes.board]}),t[97]=a.viewModes.board,t[98]=Te,t[99]=Ee,t[100]=Oe):Oe=t[100];let Ae;t[101]!==we||t[102]!==Oe?(Ae=(0,Z.jsxs)(`div`,{className:`flex rounded-lg bg-surface-muted p-0.5`,children:[we,Oe]}),t[101]=we,t[102]=Oe,t[103]=Ae):Ae=t[103];let je;t[104]!==re||t[105]!==ue||t[106]!==ve||t[107]!==Ae||t[108]!==G?(je=(0,Z.jsxs)(`section`,{className:`flex w-full flex-wrap items-center gap-2 rounded-lg border border-edge-subtle bg-surface-base px-3 py-2 shadow-surface`,children:[G,re,ue,ve,Ae]}),t[104]=re,t[105]=ue,t[106]=ve,t[107]=Ae,t[108]=G,t[109]=je):je=t[109];let Me;t[110]===O?Me=t[111]:(Me=O?(0,Z.jsx)(`div`,{className:`w-full rounded-xl border border-emerald-500/25 bg-emerald-500/10 px-3 py-2 text-sm text-emerald-800 dark:text-emerald-200`,children:O}):null,t[110]=O,t[111]=Me);let Pe;t[112]!==D||t[113]!==A?(Pe=D??A?(0,Z.jsx)(`div`,{className:`w-full rounded-xl border border-red-500/25 bg-red-500/10 px-3 py-2 text-sm text-red-700 dark:text-red-300`,children:D??A}):null,t[112]=D,t[113]=A,t[114]=Pe):Pe=t[114];let Fe;t[115]!==r||t[116]!==j?(Fe=(0,Z.jsx)(`div`,{className:`w-full`,children:(0,Z.jsx)(Rt,{stats:j,language:r})}),t[115]=r,t[116]=j,t[117]=Fe):Fe=t[117];let Ie=r===`zh`?`全部工作流`:`All workflows`,Le;t[118]===Ie?Le=t[119]:(Le=(0,Z.jsx)(`h2`,{className:`text-base font-semibold text-fg`,children:Ie}),t[118]=Ie,t[119]=Le);let Re=r===`zh`?`点击卡片进入详情,了解步骤、输入和最近运行。`:`Select a card to see its steps, inputs, and recent runs.`,ze;t[120]===Re?ze=t[121]:(ze=(0,Z.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:Re}),t[120]=Re,t[121]=ze);let Be;t[122]!==Le||t[123]!==ze?(Be=(0,Z.jsxs)(`div`,{className:`mb-4`,children:[Le,ze]}),t[122]=Le,t[123]=ze,t[124]=Be):Be=t[124];let He;t[125]!==s||t[126]!==r||t[127]!==w||t[128]!==T||t[129]!==E?(He=(0,Z.jsx)(Lt,{definitions:s,language:r,onPick:E,onDetail:w,onEdit:T}),t[125]=s,t[126]=r,t[127]=w,t[128]=T,t[129]=E,t[130]=He):He=t[130];let Ue;return t[131]!==Be||t[132]!==He?(Ue=(0,Z.jsxs)(`section`,{id:`workflow-library`,className:`scroll-mt-4 border-t border-edge pt-6`,children:[Be,He]}),t[131]=Be,t[132]=He,t[133]=Ue):Ue=t[133],(0,Z.jsx)(`main`,{className:`min-h-0 flex-1 overflow-y-auto bg-surface-panel`,children:(0,Z.jsxs)(`div`,{className:`flex min-h-full w-full flex-col gap-4 px-3 py-5 sm:px-5 xl:px-6`,children:[V,je,Me,Pe,(0,Z.jsx)(`section`,{className:`grid w-full gap-2 sm:grid-cols-2 xl:grid-cols-4`,"aria-label":a.subtitleBoard,children:Vt.map(e=>{let t=R.get(e)?.length??0;return(0,Z.jsxs)(`button`,{type:`button`,className:l(`min-w-0 rounded-lg border border-edge-subtle bg-surface-base px-3 py-2 text-left shadow-surface`,`hover:bg-surface-hover/45`,W.focusRingPanel),onClick:()=>x(`operations`),children:[(0,Z.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,Z.jsx)(`span`,{className:`truncate text-xs font-medium text-fg-muted`,children:a.operationSections[e].title}),(0,Z.jsx)(`span`,{className:`font-mono text-sm font-semibold tabular-nums text-fg`,children:t})]}),(0,Z.jsx)(`p`,{className:`mt-1 truncate text-xs text-fg-subtle`,children:a.operationSections[e].description})]},e)})}),Fe,b===`operations`?(0,Z.jsx)(`div`,{className:`pb-3`,children:(0,Z.jsx)(`div`,{className:`grid w-full gap-4`,children:Vt.map(e=>{let t=R.get(e)??[];return(0,Z.jsxs)(`section`,{className:`rounded-lg border border-edge-subtle bg-surface-base shadow-surface`,children:[(0,Z.jsxs)(`header`,{className:`flex flex-wrap items-start justify-between gap-3 border-b border-edge-subtle px-4 py-3`,children:[(0,Z.jsxs)(`div`,{className:`min-w-0`,children:[(0,Z.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:a.operationSections[e].title}),(0,Z.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:a.operationSections[e].description})]}),(0,Z.jsx)(`span`,{className:`rounded-full bg-surface-hover px-2.5 py-1 text-xs font-semibold tabular-nums text-fg-muted`,children:t.length})]}),(0,Z.jsxs)(`div`,{className:`grid gap-2 p-2.5 md:grid-cols-2 xl:grid-cols-3`,children:[k&&t.length===0?Array.from({length:3}).map(en):t.map(e=>(0,Z.jsx)(St,{run:e,language:r,localeTag:i,nowMs:L,selected:!1,onOpen:S,onOpenChat:C,onCancel:e=>void M(e),onRetry:e=>void N(e)},e.id)),!k&&t.length===0?(0,Z.jsx)(`div`,{className:`flex min-h-24 items-center justify-center rounded-md border border-dashed border-edge bg-surface-panel/40 px-4 py-5 text-center text-xs text-fg-subtle md:col-span-2 xl:col-span-3`,children:a.operationSections[e].empty}):null]})]},e)})})}):(0,Z.jsx)(`div`,{className:`h-[min(72vh,48rem)] min-h-[24rem] w-full sm:min-h-[28rem]`,children:(0,Z.jsx)(kt,{runs:c,language:r,localeTag:i,labels:{boardEmptyTitle:a.boardEmptyTitle,boardEmptyHint:a.boardEmptyHint,boardStart:a.boardStart,loading:a.loading},searchQuery:u,workflowFilterId:g,triggerFilter:v,selectedRunId:null,loading:k,onOpenRun:S,onOpenRunChat:C,onCancelRun:e=>void M(e),onRetryRun:e=>void N(e),onStart:$t})}),Ue]})})}function $t(){return document.getElementById(`workflow-library`)?.scrollIntoView({behavior:`smooth`,block:`start`})}function en(e,t){return(0,Z.jsx)(qt,{},t)}function tn(e){return(0,Z.jsx)(me,{value:e.id,children:e.title},e.id)}function nn(){return document.getElementById(`workflow-library`)?.scrollIntoView({behavior:`smooth`,block:`start`})}function rn(){return document.getElementById(`workflow-library`)?.scrollIntoView({behavior:`smooth`,block:`start`})}function an(e){return e.clearPageHeader}function on(e){return e.setPageHeader}function sn(){let e=(0,X.c)(128),t=p(dn),n;e[0]===t?n=e[1]:(n=d(t),e[0]=t,e[1]=n);let r=n.workflows,i=t===`zh`?`zh-CN`:`en-US`,s=f(un),c=!!s,l=o(),[u,h]=a(),g;e[2]===u?g=e[3]:(g=u.get(`q`)??``,e[2]=u,e[3]=g);let _=g,v;e[4]===u?v=e[5]:(v=u.get(`wf`)?.trim()??``,e[4]=u,e[5]=v);let y=v,x;e[6]===u?x=e[7]:(x=u.get(`trigger`)?.trim()||`all`,e[6]=u,e[7]=x);let S=x,C,w;if(e[8]!==u){let t=u.get(`view`)?.trim()??``;C=u.get(`agent`)?.trim()??``,w=A.has(t)?t:`operations`,e[8]=u,e[9]=C,e[10]=w}else C=e[9],w=e[10];let D=w,[O,k]=(0,Y.useState)(null),[j,M]=(0,Y.useState)(null),N;e[11]!==c||e[12]!==s?(N=c?[`workflow-agents`,s]:null,e[11]=c,e[12]=s,e[13]=N):N=e[13];let P;e[14]===Symbol.for(`react.memo_cache_sentinel`)?(P={revalidateOnFocus:!1},e[14]=P):P=e[14];let I=m(N,He,P),L;bb0:{let e=I.data?.agents??[];if(C&&(e.length===0||e.some(e=>e.id===C))){L=C;break bb0}L=I.data?.defaultId}let R=L,z;e[15]!==c||e[16]!==s?(z=c?[`workflow-definitions`,s]:null,e[15]=c,e[16]=s,e[17]=z):z=e[17];let B;e[18]===Symbol.for(`react.memo_cache_sentinel`)?(B={revalidateOnFocus:!1},e[18]=B):B=e[18];let V=m(z,je,B),H;e[19]!==c||e[20]!==R||e[21]!==s?(H=c&&R?[`workflow-runs`,s,R]:null,e[19]=c,e[20]=R,e[21]=s,e[22]=H):H=e[22];let U;e[23]===R?U=e[24]:(U=()=>we(100,{ownerAgentId:R}),e[23]=R,e[24]=U);let ee;e[25]===Symbol.for(`react.memo_cache_sentinel`)?(ee={revalidateOnFocus:!1,refreshInterval:cn},e[25]=ee):ee=e[25];let W=m(H,U,ee),te;e[26]!==c||e[27]!==R||e[28]!==s||e[29]!==y?(te=c&&R?[`workflow-stats`,s,R,y]:null,e[26]=c,e[27]=R,e[28]=s,e[29]=y,e[30]=te):te=e[30];let ne;e[31]!==R||e[32]!==y?(ne=()=>be(y,{ownerAgentId:R}),e[31]=R,e[32]=y,e[33]=ne):ne=e[33];let G;e[34]===Symbol.for(`react.memo_cache_sentinel`)?(G={revalidateOnFocus:!1},e[34]=G):G=e[34];let re=m(te,ne,G),ie;e[35]===V.data?ie=e[36]:(ie=V.data??[],e[35]=V.data,e[36]=ie);let K=ie,ae;e[37]===W.data?ae=e[38]:(ae=W.data??[],e[37]=W.data,e[38]=ae);let oe=ae,se;e[39]!==K||e[40]!==_?(se=De(K,_,`all`,`all`),e[39]=K,e[40]=_,e[41]=se):se=e[41];let ce=se,le;e[42]===h?le=e[43]:(le=e=>{h(t=>{let n=new URLSearchParams(t);return e(n),n},{replace:!0})},e[42]=h,e[43]=le);let q=le,ue;e[44]===q?ue=e[45]:(ue=e=>q(t=>{let n=e.trim();n?t.set(`q`,n):t.delete(`q`)}),e[44]=q,e[45]=ue);let de=ue,fe;e[46]===q?fe=e[47]:(fe=e=>q(t=>{let n=e.trim();n?t.set(E,n):t.delete(E)}),e[46]=q,e[47]=fe);let me=fe,he;e[48]===q?he=e[49]:(he=e=>q(t=>{let n=e.trim();n?t.set(`wf`,n):t.delete(`wf`)}),e[48]=q,e[49]=he);let _e=he,ve;e[50]===q?ve=e[51]:(ve=e=>q(t=>{e&&e!==`all`?t.set(T,e):t.delete(T)}),e[50]=q,e[51]=ve);let ye=ve,xe;e[52]===q?xe=e[53]:(xe=e=>q(t=>{e===`operations`?t.delete(Ie):t.set(Ie,e)}),e[52]=q,e[53]=xe);let Se=xe,Ce=R?`?agentId=${encodeURIComponent(R)}`:``,J;e[54]!==l||e[55]!==Ce?(J=e=>l(`/workflows/${e.id}${Ce}`),e[54]=l,e[55]=Ce,e[56]=J):J=e[56];let Te=J,Ee=Te,Oe;e[57]!==l||e[58]!==R||e[59]!==Ce?(Oe=e=>{l(e.metadata.source===`user`?`/workflows/${e.id}/edit${Ce}`:`/workflows/new?copy=${encodeURIComponent(e.id)}${R?`&agentId=${encodeURIComponent(R)}`:``}`)},e[57]=l,e[58]=R,e[59]=Ce,e[60]=Oe):Oe=e[60];let ke=Oe,Ae;e[61]!==l||e[62]!==Ce?(Ae=e=>l(`/workflows/runs/${e.id}${Ce}`),e[61]=l,e[62]=Ce,e[63]=Ae):Ae=e[63];let Me=Ae,Ne;e[64]===l?Ne=e[65]:(Ne=e=>{let t=at(e);t&&l(b(t))},e[64]=l,e[65]=Ne);let Pe=Ne,Fe;e[66]!==r.cancelFailed||e[67]!==R||e[68]!==W||e[69]!==re?(Fe=async e=>{try{await pe(e,{ownerAgentId:R}),await Promise.all([W.mutate(),re.mutate()])}catch(e){let t=e;k(t instanceof Error?t.message:r.cancelFailed)}},e[66]=r.cancelFailed,e[67]=R,e[68]=W,e[69]=re,e[70]=Fe):Fe=e[70];let Le=Fe,Re;e[71]!==r.retryFailed||e[72]!==l||e[73]!==R||e[74]!==Ce?(Re=async e=>{try{l(`/workflows/runs/${(await Ye(e,{ownerAgentId:R})).runId}${Ce}`)}catch(e){let t=e;k(t instanceof Error?t.message:r.retryFailed)}},e[71]=r.retryFailed,e[72]=l,e[73]=R,e[74]=Ce,e[75]=Re):Re=e[75];let ze=Re,Be;e[76]!==V||e[77]!==r.deleteConfirm||e[78]!==r.deleteWorkflowFailed||e[79]!==r.deleteWorkflowSuccess?(Be=async e=>{if(e.metadata.source===`user`&&window.confirm(F(r.deleteConfirm,{name:e.name})))try{await ge(e.id),await V.mutate(),M(r.deleteWorkflowSuccess)}catch(e){let t=e;k(t instanceof Error?t.message:r.deleteWorkflowFailed)}},e[76]=V,e[77]=r.deleteConfirm,e[78]=r.deleteWorkflowFailed,e[79]=r.deleteWorkflowSuccess,e[80]=Be):Be=e[80];let Ve=Be,Ue,We;e[81]===j?(Ue=e[82],We=e[83]):(Ue=()=>{if(!j)return;let e=window.setTimeout(()=>M(null),4e3);return()=>window.clearTimeout(e)},We=[j],e[81]=j,e[82]=Ue,e[83]=We),(0,Y.useEffect)(Ue,We);let Ge,Ke;e[84]!==W||e[85]!==re?(Ge=()=>{let e=()=>void Promise.all([W.mutate(),re.mutate()]);return window.addEventListener(`workflow-run-updated`,e),window.addEventListener(`workflow-run-error`,e),()=>{window.removeEventListener(`workflow-run-updated`,e),window.removeEventListener(`workflow-run-error`,e)}},Ke=[W,re],e[84]=W,e[85]=re,e[86]=Ge,e[87]=Ke):(Ge=e[86],Ke=e[87]),(0,Y.useEffect)(Ge,Ke);let qe;e[88]!==I||e[89]!==V||e[90]!==W||e[91]!==re?(qe=()=>{Promise.all([I.mutate(),V.mutate(),W.mutate(),re.mutate()])},e[88]=I,e[89]=V,e[90]=W,e[91]=re,e[92]=qe):qe=e[92];let Je=qe,Xe=I.isLoading||V.isLoading||W.isLoading,Ze=I.error?.message??V.error?.message??W.error?.message??null,Qe;e[93]===I.data?.agents?Qe=e[94]:(Qe=I.data?.agents??[],e[93]=I.data?.agents,e[94]=Qe);let $e;return e[95]!==O||e[96]!==j||e[97]!==Le||e[98]!==K||e[99]!==Ze||e[100]!==ce||e[101]!==c||e[102]!==r||e[103]!==t||e[104]!==Xe||e[105]!==i||e[106]!==Te||e[107]!==Me||e[108]!==Pe||e[109]!==ke||e[110]!==R||e[111]!==Je||e[112]!==Ve||e[113]!==ze||e[114]!==oe||e[115]!==_||e[116]!==me||e[117]!==de||e[118]!==ye||e[119]!==Se||e[120]!==_e||e[121]!==Ee||e[122]!==re.data||e[123]!==Qe||e[124]!==S||e[125]!==D||e[126]!==y?($e={language:t,localeTag:i,labels:r,hasToken:c,searchQuery:_,setSearchQuery:de,ownerAgentId:R,agentOptions:Qe,setOwnerAgentId:me,workflowFilterId:y,setWorkflowFilterId:_e,triggerFilter:S,setTriggerFilter:ye,viewMode:D,setViewMode:Se,definitions:K,filteredDefinitions:ce,runs:oe,openDefinitionDetails:Te,startWorkflow:Ee,openWorkflowEditor:ke,openRunDetails:Me,openRunInChat:Pe,actionError:O,actionFeedback:j,loading:Xe,error:Ze,stats:re.data,refreshAll:Je,cancelRun:Le,retryRun:ze,removeCustomWorkflow:Ve},e[95]=O,e[96]=j,e[97]=Le,e[98]=K,e[99]=Ze,e[100]=ce,e[101]=c,e[102]=r,e[103]=t,e[104]=Xe,e[105]=i,e[106]=Te,e[107]=Me,e[108]=Pe,e[109]=ke,e[110]=R,e[111]=Je,e[112]=Ve,e[113]=ze,e[114]=oe,e[115]=_,e[116]=me,e[117]=de,e[118]=ye,e[119]=Se,e[120]=_e,e[121]=Ee,e[122]=re.data,e[123]=Qe,e[124]=S,e[125]=D,e[126]=y,e[127]=$e):$e=e[127],$e}function cn(e){return e?.some(ln)?3e3:0}function ln(e){return e.status===`queued`||e.status===`running`}function un(e){return e.token}function dn(e){return e.language}function fn(){let e=(0,X.c)(2),t=sn(),n;return e[0]===t?n=e[1]:(n=(0,Z.jsx)(Qt,{vm:t}),e[0]=t,e[1]=n),n}function pn(e){if(typeof e==`string`||typeof e==`number`)return``+e;let t=``;if(Array.isArray(e))for(let n=0,r;n<e.length;n++)(r=pn(e[n]))!==``&&(t+=(t&&` `)+r);else for(let n in e)e[n]&&(t+=(t&&` `)+n);return t}var mn={value:()=>{}};function hn(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+``)||r in n||/[\s.]/.test(r))throw Error(`illegal type: `+r);n[r]=[]}return new gn(n)}function gn(e){this._=e}function _n(e,t){return e.trim().split(/^|\s+/).map(function(e){var n=``,r=e.indexOf(`.`);if(r>=0&&(n=e.slice(r+1),e=e.slice(0,r)),e&&!t.hasOwnProperty(e))throw Error(`unknown type: `+e);return{type:e,name:n}})}gn.prototype=hn.prototype={constructor:gn,on:function(e,t){var n=this._,r=_n(e+``,n),i,a=-1,o=r.length;if(arguments.length<2){for(;++a<o;)if((i=(e=r[a]).type)&&(i=vn(n[i],e.name)))return i;return}if(t!=null&&typeof t!=`function`)throw Error(`invalid callback: `+t);for(;++a<o;)if(i=(e=r[a]).type)n[i]=yn(n[i],e.name,t);else if(t==null)for(i in n)n[i]=yn(n[i],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new gn(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var n=Array(i),r=0,i,a;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw Error(`unknown type: `+e);for(a=this._[e],r=0,i=a.length;r<i;++r)a[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw Error(`unknown type: `+e);for(var r=this._[e],i=0,a=r.length;i<a;++i)r[i].value.apply(t,n)}};function vn(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function yn(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=mn,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var bn={svg:`http://www.w3.org/2000/svg`,xhtml:`http://www.w3.org/1999/xhtml`,xlink:`http://www.w3.org/1999/xlink`,xml:`http://www.w3.org/XML/1998/namespace`,xmlns:`http://www.w3.org/2000/xmlns/`};function xn(e){var t=e+=``,n=t.indexOf(`:`);return n>=0&&(t=e.slice(0,n))!==`xmlns`&&(e=e.slice(n+1)),bn.hasOwnProperty(t)?{space:bn[t],local:e}:e}function Sn(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===`http://www.w3.org/1999/xhtml`&&t.documentElement.namespaceURI===`http://www.w3.org/1999/xhtml`?t.createElement(e):t.createElementNS(n,e)}}function Cn(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function wn(e){var t=xn(e);return(t.local?Cn:Sn)(t)}function Tn(){}function En(e){return e==null?Tn:function(){return this.querySelector(e)}}function Dn(e){typeof e!=`function`&&(e=En(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=Array(o),c,l,u=0;u<o;++u)(c=a[u])&&(l=e.call(c,c.__data__,u,a))&&(`__data__`in c&&(l.__data__=c.__data__),s[u]=l);return new hi(r,this._parents)}function On(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function kn(){return[]}function An(e){return e==null?kn:function(){return this.querySelectorAll(e)}}function jn(e){return function(){return On(e.apply(this,arguments))}}function Mn(e){e=typeof e==`function`?jn(e):An(e);for(var t=this._groups,n=t.length,r=[],i=[],a=0;a<n;++a)for(var o=t[a],s=o.length,c,l=0;l<s;++l)(c=o[l])&&(r.push(e.call(c,c.__data__,l,o)),i.push(c));return new hi(r,i)}function Nn(e){return function(){return this.matches(e)}}function Pn(e){return function(t){return t.matches(e)}}var Fn=Array.prototype.find;function In(e){return function(){return Fn.call(this.children,e)}}function Ln(){return this.firstElementChild}function Rn(e){return this.select(e==null?Ln:In(typeof e==`function`?e:Pn(e)))}var zn=Array.prototype.filter;function Bn(){return Array.from(this.children)}function Vn(e){return function(){return zn.call(this.children,e)}}function Hn(e){return this.selectAll(e==null?Bn:Vn(typeof e==`function`?e:Pn(e)))}function Un(e){typeof e!=`function`&&(e=Nn(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=[],c,l=0;l<o;++l)(c=a[l])&&e.call(c,c.__data__,l,a)&&s.push(c);return new hi(r,this._parents)}function Wn(e){return Array(e.length)}function Gn(){return new hi(this._enter||this._groups.map(Wn),this._parents)}function Kn(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Kn.prototype={constructor:Kn,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function qn(e){return function(){return e}}function Jn(e,t,n,r,i,a){for(var o=0,s,c=t.length,l=a.length;o<l;++o)(s=t[o])?(s.__data__=a[o],r[o]=s):n[o]=new Kn(e,a[o]);for(;o<c;++o)(s=t[o])&&(i[o]=s)}function Yn(e,t,n,r,i,a,o){var s,c,l=new Map,u=t.length,d=a.length,f=Array(u),p;for(s=0;s<u;++s)(c=t[s])&&(f[s]=p=o.call(c,c.__data__,s,t)+``,l.has(p)?i[s]=c:l.set(p,c));for(s=0;s<d;++s)p=o.call(e,a[s],s,a)+``,(c=l.get(p))?(r[s]=c,c.__data__=a[s],l.delete(p)):n[s]=new Kn(e,a[s]);for(s=0;s<u;++s)(c=t[s])&&l.get(f[s])===c&&(i[s]=c)}function Xn(e){return e.__data__}function Zn(e,t){if(!arguments.length)return Array.from(this,Xn);var n=t?Yn:Jn,r=this._parents,i=this._groups;typeof e!=`function`&&(e=qn(e));for(var a=i.length,o=Array(a),s=Array(a),c=Array(a),l=0;l<a;++l){var u=r[l],d=i[l],f=d.length,p=Qn(e.call(u,u&&u.__data__,l,r)),m=p.length,h=s[l]=Array(m),g=o[l]=Array(m);n(u,d,h,g,c[l]=Array(f),p,t);for(var _=0,v=0,y,b;_<m;++_)if(y=h[_]){for(_>=v&&(v=_+1);!(b=g[v])&&++v<m;);y._next=b||null}}return o=new hi(o,r),o._enter=s,o._exit=c,o}function Qn(e){return typeof e==`object`&&`length`in e?e:Array.from(e)}function $n(){return new hi(this._exit||this._groups.map(Wn),this._parents)}function er(e,t,n){var r=this.enter(),i=this,a=this.exit();return typeof e==`function`?(r=e(r),r&&=r.selection()):r=r.append(e+``),t!=null&&(i=t(i),i&&=i.selection()),n==null?a.remove():n(a),r&&i?r.merge(i).order():i}function tr(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,i=n.length,a=r.length,o=Math.min(i,a),s=Array(i),c=0;c<o;++c)for(var l=n[c],u=r[c],d=l.length,f=s[c]=Array(d),p,m=0;m<d;++m)(p=l[m]||u[m])&&(f[m]=p);for(;c<i;++c)s[c]=n[c];return new hi(s,this._parents)}function nr(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],i=r.length-1,a=r[i],o;--i>=0;)(o=r[i])&&(a&&o.compareDocumentPosition(a)^4&&a.parentNode.insertBefore(o,a),a=o);return this}function rr(e){e||=ir;function t(t,n){return t&&n?e(t.__data__,n.__data__):!t-!n}for(var n=this._groups,r=n.length,i=Array(r),a=0;a<r;++a){for(var o=n[a],s=o.length,c=i[a]=Array(s),l,u=0;u<s;++u)(l=o[u])&&(c[u]=l);c.sort(t)}return new hi(i,this._parents).order()}function ir(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function ar(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function or(){return Array.from(this)}function sr(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,a=r.length;i<a;++i){var o=r[i];if(o)return o}return null}function cr(){let e=0;for(let t of this)++e;return e}function lr(){return!this.node()}function ur(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var i=t[n],a=0,o=i.length,s;a<o;++a)(s=i[a])&&e.call(s,s.__data__,a,i);return this}function dr(e){return function(){this.removeAttribute(e)}}function fr(e){return function(){this.removeAttributeNS(e.space,e.local)}}function pr(e,t){return function(){this.setAttribute(e,t)}}function mr(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function hr(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function gr(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function _r(e,t){var n=xn(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((t==null?n.local?fr:dr:typeof t==`function`?n.local?gr:hr:n.local?mr:pr)(n,t))}function vr(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function yr(e){return function(){this.style.removeProperty(e)}}function br(e,t,n){return function(){this.style.setProperty(e,t,n)}}function xr(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function Sr(e,t,n){return arguments.length>1?this.each((t==null?yr:typeof t==`function`?xr:br)(e,t,n??``)):Cr(this.node(),e)}function Cr(e,t){return e.style.getPropertyValue(t)||vr(e).getComputedStyle(e,null).getPropertyValue(t)}function wr(e){return function(){delete this[e]}}function Tr(e,t){return function(){this[e]=t}}function Er(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function Dr(e,t){return arguments.length>1?this.each((t==null?wr:typeof t==`function`?Er:Tr)(e,t)):this.node()[e]}function Or(e){return e.trim().split(/^|\s+/)}function kr(e){return e.classList||new Ar(e)}function Ar(e){this._node=e,this._names=Or(e.getAttribute(`class`)||``)}Ar.prototype={add:function(e){this._names.indexOf(e)<0&&(this._names.push(e),this._node.setAttribute(`class`,this._names.join(` `)))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute(`class`,this._names.join(` `)))},contains:function(e){return this._names.indexOf(e)>=0}};function jr(e,t){for(var n=kr(e),r=-1,i=t.length;++r<i;)n.add(t[r])}function Mr(e,t){for(var n=kr(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}function Nr(e){return function(){jr(this,e)}}function Pr(e){return function(){Mr(this,e)}}function Fr(e,t){return function(){(t.apply(this,arguments)?jr:Mr)(this,e)}}function Ir(e,t){var n=Or(e+``);if(arguments.length<2){for(var r=kr(this.node()),i=-1,a=n.length;++i<a;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof t==`function`?Fr:t?Nr:Pr)(n,t))}function Lr(){this.textContent=``}function Rr(e){return function(){this.textContent=e}}function zr(e){return function(){var t=e.apply(this,arguments);this.textContent=t??``}}function Br(e){return arguments.length?this.each(e==null?Lr:(typeof e==`function`?zr:Rr)(e)):this.node().textContent}function Vr(){this.innerHTML=``}function Hr(e){return function(){this.innerHTML=e}}function Ur(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??``}}function Wr(e){return arguments.length?this.each(e==null?Vr:(typeof e==`function`?Ur:Hr)(e)):this.node().innerHTML}function Gr(){this.nextSibling&&this.parentNode.appendChild(this)}function Kr(){return this.each(Gr)}function qr(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Jr(){return this.each(qr)}function Yr(e){var t=typeof e==`function`?e:wn(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function Xr(){return null}function Zr(e,t){var n=typeof e==`function`?e:wn(e),r=t==null?Xr:typeof t==`function`?t:En(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function Qr(){var e=this.parentNode;e&&e.removeChild(this)}function $r(){return this.each(Qr)}function ei(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function ti(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function ni(e){return this.select(e?ti:ei)}function ri(e){return arguments.length?this.property(`__data__`,e):this.node().__data__}function ii(e){return function(t){e.call(this,t,this.__data__)}}function ai(e){return e.trim().split(/^|\s+/).map(function(e){var t=``,n=e.indexOf(`.`);return n>=0&&(t=e.slice(n+1),e=e.slice(0,n)),{type:e,name:t}})}function oi(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,i=t.length,a;n<i;++n)a=t[n],(!e.type||a.type===e.type)&&a.name===e.name?this.removeEventListener(a.type,a.listener,a.options):t[++r]=a;++r?t.length=r:delete this.__on}}}function si(e,t,n){return function(){var r=this.__on,i,a=ii(t);if(r){for(var o=0,s=r.length;o<s;++o)if((i=r[o]).type===e.type&&i.name===e.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=a,i.options=n),i.value=t;return}}this.addEventListener(e.type,a,n),i={type:e.type,name:e.name,value:t,listener:a,options:n},r?r.push(i):this.__on=[i]}}function ci(e,t,n){var r=ai(e+``),i,a=r.length,o;if(arguments.length<2){var s=this.node().__on;if(s){for(var c=0,l=s.length,u;c<l;++c)for(i=0,u=s[c];i<a;++i)if((o=r[i]).type===u.type&&o.name===u.name)return u.value}return}for(s=t?si:oi,i=0;i<a;++i)this.each(s(r[i],t,n));return this}function li(e,t,n){var r=vr(e),i=r.CustomEvent;typeof i==`function`?i=new i(t,n):(i=r.document.createEvent(`Event`),n?(i.initEvent(t,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(t,!1,!1)),e.dispatchEvent(i)}function ui(e,t){return function(){return li(this,e,t)}}function di(e,t){return function(){return li(this,e,t.apply(this,arguments))}}function fi(e,t){return this.each((typeof t==`function`?di:ui)(e,t))}function*pi(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,a=r.length,o;i<a;++i)(o=r[i])&&(yield o)}var mi=[null];function hi(e,t){this._groups=e,this._parents=t}function gi(){return new hi([[document.documentElement]],mi)}function _i(){return this}hi.prototype=gi.prototype={constructor:hi,select:Dn,selectAll:Mn,selectChild:Rn,selectChildren:Hn,filter:Un,data:Zn,enter:Gn,exit:$n,join:er,merge:tr,selection:_i,order:nr,sort:rr,call:ar,nodes:or,node:sr,size:cr,empty:lr,each:ur,attr:_r,style:Sr,property:Dr,classed:Ir,text:Br,html:Wr,raise:Kr,lower:Jr,append:Yr,insert:Zr,remove:$r,clone:ni,datum:ri,on:ci,dispatch:fi,[Symbol.iterator]:pi};function vi(e){return typeof e==`string`?new hi([[document.querySelector(e)]],[document.documentElement]):new hi([[e]],mi)}function yi(e){let t;for(;t=e.sourceEvent;)e=t;return e}function bi(e,t){if(e=yi(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,r=r.matrixTransform(t.getScreenCTM().inverse()),[r.x,r.y]}if(t.getBoundingClientRect){var i=t.getBoundingClientRect();return[e.clientX-i.left-t.clientLeft,e.clientY-i.top-t.clientTop]}}return[e.pageX,e.pageY]}var xi={passive:!1},Si={capture:!0,passive:!1};function Ci(e){e.stopImmediatePropagation()}function wi(e){e.preventDefault(),e.stopImmediatePropagation()}function Ti(e){var t=e.document.documentElement,n=vi(e).on(`dragstart.drag`,wi,Si);`onselectstart`in t?n.on(`selectstart.drag`,wi,Si):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect=`none`)}function Ei(e,t){var n=e.document.documentElement,r=vi(e).on(`dragstart.drag`,null);t&&(r.on(`click.drag`,wi,Si),setTimeout(function(){r.on(`click.drag`,null)},0)),`onselectstart`in n?r.on(`selectstart.drag`,null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}var Di=e=>()=>e;function Oi(e,{sourceEvent:t,subject:n,target:r,identifier:i,active:a,x:o,y:s,dx:c,dy:l,dispatch:u}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:i,enumerable:!0,configurable:!0},active:{value:a,enumerable:!0,configurable:!0},x:{value:o,enumerable:!0,configurable:!0},y:{value:s,enumerable:!0,configurable:!0},dx:{value:c,enumerable:!0,configurable:!0},dy:{value:l,enumerable:!0,configurable:!0},_:{value:u}})}Oi.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function ki(e){return!e.ctrlKey&&!e.button}function Ai(){return this.parentNode}function ji(e,t){return t??{x:e.x,y:e.y}}function Mi(){return navigator.maxTouchPoints||`ontouchstart`in this}function Ni(){var e=ki,t=Ai,n=ji,r=Mi,i={},a=hn(`start`,`drag`,`end`),o=0,s,c,l,u,d=0;function f(e){e.on(`mousedown.drag`,p).filter(r).on(`touchstart.drag`,g).on(`touchmove.drag`,_,xi).on(`touchend.drag touchcancel.drag`,v).style(`touch-action`,`none`).style(`-webkit-tap-highlight-color`,`rgba(0,0,0,0)`)}function p(n,r){if(!(u||!e.call(this,n,r))){var i=y(this,t.call(this,n,r),n,r,`mouse`);i&&(vi(n.view).on(`mousemove.drag`,m,Si).on(`mouseup.drag`,h,Si),Ti(n.view),Ci(n),l=!1,s=n.clientX,c=n.clientY,i(`start`,n))}}function m(e){if(wi(e),!l){var t=e.clientX-s,n=e.clientY-c;l=t*t+n*n>d}i.mouse(`drag`,e)}function h(e){vi(e.view).on(`mousemove.drag mouseup.drag`,null),Ei(e.view,l),wi(e),i.mouse(`end`,e)}function g(n,r){if(e.call(this,n,r)){var i=n.changedTouches,a=t.call(this,n,r),o=i.length,s,c;for(s=0;s<o;++s)(c=y(this,a,n,r,i[s].identifier,i[s]))&&(Ci(n),c(`start`,n,i[s]))}}function _(e){var t=e.changedTouches,n=t.length,r,a;for(r=0;r<n;++r)(a=i[t[r].identifier])&&(wi(e),a(`drag`,e,t[r]))}function v(e){var t=e.changedTouches,n=t.length,r,a;for(u&&clearTimeout(u),u=setTimeout(function(){u=null},500),r=0;r<n;++r)(a=i[t[r].identifier])&&(Ci(e),a(`end`,e,t[r]))}function y(e,t,r,s,c,l){var u=a.copy(),d=bi(l||r,t),p,m,h;if((h=n.call(e,new Oi(`beforestart`,{sourceEvent:r,target:f,identifier:c,active:o,x:d[0],y:d[1],dx:0,dy:0,dispatch:u}),s))!=null)return p=h.x-d[0]||0,m=h.y-d[1]||0,function n(r,a,l){var g=d,_;switch(r){case`start`:i[c]=n,_=o++;break;case`end`:delete i[c],--o;case`drag`:d=bi(l||a,t),_=o;break}u.call(r,e,new Oi(r,{sourceEvent:a,subject:h,target:f,identifier:c,active:_,x:d[0]+p,y:d[1]+m,dx:d[0]-g[0],dy:d[1]-g[1],dispatch:u}),s)}}return f.filter=function(t){return arguments.length?(e=typeof t==`function`?t:Di(!!t),f):e},f.container=function(e){return arguments.length?(t=typeof e==`function`?e:Di(e),f):t},f.subject=function(e){return arguments.length?(n=typeof e==`function`?e:Di(e),f):n},f.touchable=function(e){return arguments.length?(r=typeof e==`function`?e:Di(!!e),f):r},f.on=function(){var e=a.on.apply(a,arguments);return e===a?f:e},f.clickDistance=function(e){return arguments.length?(d=(e=+e)*e,f):Math.sqrt(d)},f}function Pi(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Fi(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Ii(){}var Li=.7,Ri=1/Li,zi=`\\s*([+-]?\\d+)\\s*`,Bi=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*`,Vi=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*`,Hi=/^#([0-9a-f]{3,8})$/,Ui=RegExp(`^rgb\\(${zi},${zi},${zi}\\)$`),Wi=RegExp(`^rgb\\(${Vi},${Vi},${Vi}\\)$`),Gi=RegExp(`^rgba\\(${zi},${zi},${zi},${Bi}\\)$`),Ki=RegExp(`^rgba\\(${Vi},${Vi},${Vi},${Bi}\\)$`),qi=RegExp(`^hsl\\(${Bi},${Vi},${Vi}\\)$`),Ji=RegExp(`^hsla\\(${Bi},${Vi},${Vi},${Bi}\\)$`),Yi={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};Pi(Ii,ea,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Xi,formatHex:Xi,formatHex8:Zi,formatHsl:Qi,formatRgb:$i,toString:$i});function Xi(){return this.rgb().formatHex()}function Zi(){return this.rgb().formatHex8()}function Qi(){return pa(this).formatHsl()}function $i(){return this.rgb().formatRgb()}function ea(e){var t,n;return e=(e+``).trim().toLowerCase(),(t=Hi.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?ta(t):n===3?new aa(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?na(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?na(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=Ui.exec(e))?new aa(t[1],t[2],t[3],1):(t=Wi.exec(e))?new aa(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=Gi.exec(e))?na(t[1],t[2],t[3],t[4]):(t=Ki.exec(e))?na(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=qi.exec(e))?fa(t[1],t[2]/100,t[3]/100,1):(t=Ji.exec(e))?fa(t[1],t[2]/100,t[3]/100,t[4]):Yi.hasOwnProperty(e)?ta(Yi[e]):e===`transparent`?new aa(NaN,NaN,NaN,0):null}function ta(e){return new aa(e>>16&255,e>>8&255,e&255,1)}function na(e,t,n,r){return r<=0&&(e=t=n=NaN),new aa(e,t,n,r)}function ra(e){return e instanceof Ii||(e=ea(e)),e?(e=e.rgb(),new aa(e.r,e.g,e.b,e.opacity)):new aa}function ia(e,t,n,r){return arguments.length===1?ra(e):new aa(e,t,n,r??1)}function aa(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}Pi(aa,ia,Fi(Ii,{brighter(e){return e=e==null?Ri:Ri**+e,new aa(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Li:Li**+e,new aa(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new aa(ua(this.r),ua(this.g),ua(this.b),la(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:oa,formatHex:oa,formatHex8:sa,formatRgb:ca,toString:ca}));function oa(){return`#${da(this.r)}${da(this.g)}${da(this.b)}`}function sa(){return`#${da(this.r)}${da(this.g)}${da(this.b)}${da((isNaN(this.opacity)?1:this.opacity)*255)}`}function ca(){let e=la(this.opacity);return`${e===1?`rgb(`:`rgba(`}${ua(this.r)}, ${ua(this.g)}, ${ua(this.b)}${e===1?`)`:`, ${e})`}`}function la(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function ua(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function da(e){return e=ua(e),(e<16?`0`:``)+e.toString(16)}function fa(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new ha(e,t,n,r)}function pa(e){if(e instanceof ha)return new ha(e.h,e.s,e.l,e.opacity);if(e instanceof Ii||(e=ea(e)),!e)return new ha;if(e instanceof ha)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),a=Math.max(t,n,r),o=NaN,s=a-i,c=(a+i)/2;return s?(o=t===a?(n-r)/s+(n<r)*6:n===a?(r-t)/s+2:(t-n)/s+4,s/=c<.5?a+i:2-a-i,o*=60):s=c>0&&c<1?0:o,new ha(o,s,c,e.opacity)}function ma(e,t,n,r){return arguments.length===1?pa(e):new ha(e,t,n,r??1)}function ha(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}Pi(ha,ma,Fi(Ii,{brighter(e){return e=e==null?Ri:Ri**+e,new ha(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Li:Li**+e,new ha(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new aa(va(e>=240?e-240:e+120,i,r),va(e,i,r),va(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new ha(ga(this.h),_a(this.s),_a(this.l),la(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(){let e=la(this.opacity);return`${e===1?`hsl(`:`hsla(`}${ga(this.h)}, ${_a(this.s)*100}%, ${_a(this.l)*100}%${e===1?`)`:`, ${e})`}`}}));function ga(e){return e=(e||0)%360,e<0?e+360:e}function _a(e){return Math.max(0,Math.min(1,e||0))}function va(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}var ya=e=>()=>e;function ba(e,t){return function(n){return e+n*t}}function xa(e,t,n){return e**=+n,t=t**+n-e,n=1/n,function(r){return(e+r*t)**+n}}function Sa(e){return(e=+e)==1?Ca:function(t,n){return n-t?xa(t,n,e):ya(isNaN(t)?n:t)}}function Ca(e,t){var n=t-e;return n?ba(e,n):ya(isNaN(e)?t:e)}var wa=(function e(t){var n=Sa(t);function r(e,t){var r=n((e=ia(e)).r,(t=ia(t)).r),i=n(e.g,t.g),a=n(e.b,t.b),o=Ca(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=i(t),e.b=a(t),e.opacity=o(t),e+``}}return r.gamma=e,r})(1);function Ta(e,t){t||=[];var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(a){for(i=0;i<n;++i)r[i]=e[i]*(1-a)+t[i]*a;return r}}function Ea(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function Da(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,i=Array(r),a=Array(n),o;for(o=0;o<r;++o)i[o]=Ia(e[o],t[o]);for(;o<n;++o)a[o]=t[o];return function(e){for(o=0;o<r;++o)a[o]=i[o](e);return a}}function Oa(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function ka(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function Aa(e,t){var n={},r={},i;for(i in(typeof e!=`object`||!e)&&(e={}),(typeof t!=`object`||!t)&&(t={}),t)i in e?n[i]=Ia(e[i],t[i]):r[i]=t[i];return function(e){for(i in n)r[i]=n[i](e);return r}}var ja=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Ma=new RegExp(ja.source,`g`);function Na(e){return function(){return e}}function Pa(e){return function(t){return e(t)+``}}function Fa(e,t){var n=ja.lastIndex=Ma.lastIndex=0,r,i,a,o=-1,s=[],c=[];for(e+=``,t+=``;(r=ja.exec(e))&&(i=Ma.exec(t));)(a=i.index)>n&&(a=t.slice(n,a),s[o]?s[o]+=a:s[++o]=a),(r=r[0])===(i=i[0])?s[o]?s[o]+=i:s[++o]=i:(s[++o]=null,c.push({i:o,x:ka(r,i)})),n=Ma.lastIndex;return n<t.length&&(a=t.slice(n),s[o]?s[o]+=a:s[++o]=a),s.length<2?c[0]?Pa(c[0].x):Na(t):(t=c.length,function(e){for(var n=0,r;n<t;++n)s[(r=c[n]).i]=r.x(e);return s.join(``)})}function Ia(e,t){var n=typeof t,r;return t==null||n===`boolean`?ya(t):(n===`number`?ka:n===`string`?(r=ea(t))?(t=r,wa):Fa:t instanceof ea?wa:t instanceof Date?Oa:Ea(t)?Ta:Array.isArray(t)?Da:typeof t.valueOf!=`function`&&typeof t.toString!=`function`||isNaN(t)?Aa:ka)(e,t)}var La=180/Math.PI,Ra={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function za(e,t,n,r,i,a){var o,s,c;return(o=Math.sqrt(e*e+t*t))&&(e/=o,t/=o),(c=e*n+t*r)&&(n-=e*c,r-=t*c),(s=Math.sqrt(n*n+r*r))&&(n/=s,r/=s,c/=s),e*r<t*n&&(e=-e,t=-t,c=-c,o=-o),{translateX:i,translateY:a,rotate:Math.atan2(t,e)*La,skewX:Math.atan(c)*La,scaleX:o,scaleY:s}}var Ba;function Va(e){let t=new(typeof DOMMatrix==`function`?DOMMatrix:WebKitCSSMatrix)(e+``);return t.isIdentity?Ra:za(t.a,t.b,t.c,t.d,t.e,t.f)}function Ha(e){return e==null||(Ba||=document.createElementNS(`http://www.w3.org/2000/svg`,`g`),Ba.setAttribute(`transform`,e),!(e=Ba.transform.baseVal.consolidate()))?Ra:(e=e.matrix,za(e.a,e.b,e.c,e.d,e.e,e.f))}function Ua(e,t,n,r){function i(e){return e.length?e.pop()+` `:``}function a(e,r,i,a,o,s){if(e!==i||r!==a){var c=o.push(`translate(`,null,t,null,n);s.push({i:c-4,x:ka(e,i)},{i:c-2,x:ka(r,a)})}else (i||a)&&o.push(`translate(`+i+t+a+n)}function o(e,t,n,a){e===t?t&&n.push(i(n)+`rotate(`+t+r):(e-t>180?t+=360:t-e>180&&(e+=360),a.push({i:n.push(i(n)+`rotate(`,null,r)-2,x:ka(e,t)}))}function s(e,t,n,a){e===t?t&&n.push(i(n)+`skewX(`+t+r):a.push({i:n.push(i(n)+`skewX(`,null,r)-2,x:ka(e,t)})}function c(e,t,n,r,a,o){if(e!==n||t!==r){var s=a.push(i(a)+`scale(`,null,`,`,null,`)`);o.push({i:s-4,x:ka(e,n)},{i:s-2,x:ka(t,r)})}else (n!==1||r!==1)&&a.push(i(a)+`scale(`+n+`,`+r+`)`)}return function(t,n){var r=[],i=[];return t=e(t),n=e(n),a(t.translateX,t.translateY,n.translateX,n.translateY,r,i),o(t.rotate,n.rotate,r,i),s(t.skewX,n.skewX,r,i),c(t.scaleX,t.scaleY,n.scaleX,n.scaleY,r,i),t=n=null,function(e){for(var t=-1,n=i.length,a;++t<n;)r[(a=i[t]).i]=a.x(e);return r.join(``)}}}var Wa=Ua(Va,`px, `,`px)`,`deg)`),Ga=Ua(Ha,`, `,`)`,`)`),Ka=1e-12;function qa(e){return((e=Math.exp(e))+1/e)/2}function Ja(e){return((e=Math.exp(e))-1/e)/2}function Ya(e){return((e=Math.exp(2*e))-1)/(e+1)}var Xa=(function e(t,n,r){function i(e,i){var a=e[0],o=e[1],s=e[2],c=i[0],l=i[1],u=i[2],d=c-a,f=l-o,p=d*d+f*f,m,h;if(p<Ka)h=Math.log(u/s)/t,m=function(e){return[a+e*d,o+e*f,s*Math.exp(t*e*h)]};else{var g=Math.sqrt(p),_=(u*u-s*s+r*p)/(2*s*n*g),v=(u*u-s*s-r*p)/(2*u*n*g),y=Math.log(Math.sqrt(_*_+1)-_);h=(Math.log(Math.sqrt(v*v+1)-v)-y)/t,m=function(e){var r=e*h,i=qa(y),c=s/(n*g)*(i*Ya(t*r+y)-Ja(y));return[a+c*d,o+c*f,s*i/qa(t*r+y)]}}return m.duration=h*1e3*t/Math.SQRT2,m}return i.rho=function(t){var n=Math.max(.001,+t),r=n*n;return e(n,r,r*r)},i})(Math.SQRT2,2,4),Za=0,Qa=0,$a=0,eo=1e3,to,no,ro=0,io=0,ao=0,oo=typeof performance==`object`&&performance.now?performance:Date,so=typeof window==`object`&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function co(){return io||=(so(lo),oo.now()+ao)}function lo(){io=0}function uo(){this._call=this._time=this._next=null}uo.prototype=fo.prototype={constructor:uo,restart:function(e,t,n){if(typeof e!=`function`)throw TypeError(`callback is not a function`);n=(n==null?co():+n)+(t==null?0:+t),!this._next&&no!==this&&(no?no._next=this:to=this,no=this),this._call=e,this._time=n,_o()},stop:function(){this._call&&(this._call=null,this._time=1/0,_o())}};function fo(e,t,n){var r=new uo;return r.restart(e,t,n),r}function po(){co(),++Za;for(var e=to,t;e;)(t=io-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Za}function mo(){io=(ro=oo.now())+ao,Za=Qa=0;try{po()}finally{Za=0,go(),io=0}}function ho(){var e=oo.now(),t=e-ro;t>eo&&(ao-=t,ro=e)}function go(){for(var e,t=to,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:to=n);no=e,_o(r)}function _o(e){Za||(Qa&&=clearTimeout(Qa),e-io>24?(e<1/0&&(Qa=setTimeout(mo,e-oo.now()-ao)),$a&&=clearInterval($a)):($a||=(ro=oo.now(),setInterval(ho,eo)),Za=1,so(mo)))}function vo(e,t,n){var r=new uo;return t=t==null?0:+t,r.restart(n=>{r.stop(),e(n+t)},t,n),r}var yo=hn(`start`,`end`,`cancel`,`interrupt`),bo=[];function xo(e,t,n,r,i,a){var o=e.__transition;if(!o)e.__transition={};else if(n in o)return;To(e,n,{name:t,index:r,group:i,on:yo,tween:bo,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:0})}function So(e,t){var n=wo(e,t);if(n.state>0)throw Error(`too late; already scheduled`);return n}function Co(e,t){var n=wo(e,t);if(n.state>3)throw Error(`too late; already running`);return n}function wo(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw Error(`transition not found`);return n}function To(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=fo(a,0,n.time);function a(e){n.state=1,n.timer.restart(o,n.delay,n.time),n.delay<=e&&o(e-n.delay)}function o(a){var l,u,d,f;if(n.state!==1)return c();for(l in r)if(f=r[l],f.name===n.name){if(f.state===3)return vo(o);f.state===4?(f.state=6,f.timer.stop(),f.on.call(`interrupt`,e,e.__data__,f.index,f.group),delete r[l]):+l<t&&(f.state=6,f.timer.stop(),f.on.call(`cancel`,e,e.__data__,f.index,f.group),delete r[l])}if(vo(function(){n.state===3&&(n.state=4,n.timer.restart(s,n.delay,n.time),s(a))}),n.state=2,n.on.call(`start`,e,e.__data__,n.index,n.group),n.state===2){for(n.state=3,i=Array(d=n.tween.length),l=0,u=-1;l<d;++l)(f=n.tween[l].value.call(e,e.__data__,n.index,n.group))&&(i[++u]=f);i.length=u+1}}function s(t){for(var r=t<n.duration?n.ease.call(null,t/n.duration):(n.timer.restart(c),n.state=5,1),a=-1,o=i.length;++a<o;)i[a].call(e,r);n.state===5&&(n.on.call(`end`,e,e.__data__,n.index,n.group),c())}function c(){for(var i in n.state=6,n.timer.stop(),delete r[t],r)return;delete e.__transition}}function Eo(e,t){var n=e.__transition,r,i,a=!0,o;if(n){for(o in t=t==null?null:t+``,n){if((r=n[o]).name!==t){a=!1;continue}i=r.state>2&&r.state<5,r.state=6,r.timer.stop(),r.on.call(i?`interrupt`:`cancel`,e,e.__data__,r.index,r.group),delete n[o]}a&&delete e.__transition}}function Do(e){return this.each(function(){Eo(this,e)})}function Oo(e,t){var n,r;return function(){var i=Co(this,e),a=i.tween;if(a!==n){r=n=a;for(var o=0,s=r.length;o<s;++o)if(r[o].name===t){r=r.slice(),r.splice(o,1);break}}i.tween=r}}function ko(e,t,n){var r,i;if(typeof n!=`function`)throw Error();return function(){var a=Co(this,e),o=a.tween;if(o!==r){i=(r=o).slice();for(var s={name:t,value:n},c=0,l=i.length;c<l;++c)if(i[c].name===t){i[c]=s;break}c===l&&i.push(s)}a.tween=i}}function Ao(e,t){var n=this._id;if(e+=``,arguments.length<2){for(var r=wo(this.node(),n).tween,i=0,a=r.length,o;i<a;++i)if((o=r[i]).name===e)return o.value;return null}return this.each((t==null?Oo:ko)(n,e,t))}function jo(e,t,n){var r=e._id;return e.each(function(){var e=Co(this,r);(e.value||={})[t]=n.apply(this,arguments)}),function(e){return wo(e,r).value[t]}}function Mo(e,t){var n;return(typeof t==`number`?ka:t instanceof ea?wa:(n=ea(t))?(t=n,wa):Fa)(e,t)}function No(e){return function(){this.removeAttribute(e)}}function Po(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Fo(e,t,n){var r,i=n+``,a;return function(){var o=this.getAttribute(e);return o===i?null:o===r?a:a=t(r=o,n)}}function Io(e,t,n){var r,i=n+``,a;return function(){var o=this.getAttributeNS(e.space,e.local);return o===i?null:o===r?a:a=t(r=o,n)}}function Lo(e,t,n){var r,i,a;return function(){var o,s=n(this),c;return s==null?void this.removeAttribute(e):(o=this.getAttribute(e),c=s+``,o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,s)))}}function Ro(e,t,n){var r,i,a;return function(){var o,s=n(this),c;return s==null?void this.removeAttributeNS(e.space,e.local):(o=this.getAttributeNS(e.space,e.local),c=s+``,o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,s)))}}function zo(e,t){var n=xn(e),r=n===`transform`?Ga:Mo;return this.attrTween(e,typeof t==`function`?(n.local?Ro:Lo)(n,r,jo(this,`attr.`+e,t)):t==null?(n.local?Po:No)(n):(n.local?Io:Fo)(n,r,t))}function Bo(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function Vo(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function Ho(e,t){var n,r;function i(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&Vo(e,i)),n}return i._value=t,i}function Uo(e,t){var n,r;function i(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&Bo(e,i)),n}return i._value=t,i}function Wo(e,t){var n=`attr.`+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!=`function`)throw Error();var r=xn(e);return this.tween(n,(r.local?Ho:Uo)(r,t))}function Go(e,t){return function(){So(this,e).delay=+t.apply(this,arguments)}}function Ko(e,t){return t=+t,function(){So(this,e).delay=t}}function qo(e){var t=this._id;return arguments.length?this.each((typeof e==`function`?Go:Ko)(t,e)):wo(this.node(),t).delay}function Jo(e,t){return function(){Co(this,e).duration=+t.apply(this,arguments)}}function Yo(e,t){return t=+t,function(){Co(this,e).duration=t}}function Xo(e){var t=this._id;return arguments.length?this.each((typeof e==`function`?Jo:Yo)(t,e)):wo(this.node(),t).duration}function Zo(e,t){if(typeof t!=`function`)throw Error();return function(){Co(this,e).ease=t}}function Qo(e){var t=this._id;return arguments.length?this.each(Zo(t,e)):wo(this.node(),t).ease}function $o(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!=`function`)throw Error();Co(this,e).ease=n}}function es(e){if(typeof e!=`function`)throw Error();return this.each($o(this._id,e))}function ts(e){typeof e!=`function`&&(e=Nn(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=[],c,l=0;l<o;++l)(c=a[l])&&e.call(c,c.__data__,l,a)&&s.push(c);return new As(r,this._parents,this._name,this._id)}function ns(e){if(e._id!==this._id)throw Error();for(var t=this._groups,n=e._groups,r=t.length,i=n.length,a=Math.min(r,i),o=Array(r),s=0;s<a;++s)for(var c=t[s],l=n[s],u=c.length,d=o[s]=Array(u),f,p=0;p<u;++p)(f=c[p]||l[p])&&(d[p]=f);for(;s<r;++s)o[s]=t[s];return new As(o,this._parents,this._name,this._id)}function rs(e){return(e+``).trim().split(/^|\s+/).every(function(e){var t=e.indexOf(`.`);return t>=0&&(e=e.slice(0,t)),!e||e===`start`})}function is(e,t,n){var r,i,a=rs(t)?So:Co;return function(){var o=a(this,e),s=o.on;s!==r&&(i=(r=s).copy()).on(t,n),o.on=i}}function as(e,t){var n=this._id;return arguments.length<2?wo(this.node(),n).on.on(e):this.each(is(n,e,t))}function os(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function ss(){return this.on(`end.remove`,os(this._id))}function cs(e){var t=this._name,n=this._id;typeof e!=`function`&&(e=En(e));for(var r=this._groups,i=r.length,a=Array(i),o=0;o<i;++o)for(var s=r[o],c=s.length,l=a[o]=Array(c),u,d,f=0;f<c;++f)(u=s[f])&&(d=e.call(u,u.__data__,f,s))&&(`__data__`in u&&(d.__data__=u.__data__),l[f]=d,xo(l[f],t,n,f,l,wo(u,n)));return new As(a,this._parents,t,n)}function ls(e){var t=this._name,n=this._id;typeof e!=`function`&&(e=An(e));for(var r=this._groups,i=r.length,a=[],o=[],s=0;s<i;++s)for(var c=r[s],l=c.length,u,d=0;d<l;++d)if(u=c[d]){for(var f=e.call(u,u.__data__,d,c),p,m=wo(u,n),h=0,g=f.length;h<g;++h)(p=f[h])&&xo(p,t,n,h,f,m);a.push(f),o.push(u)}return new As(a,o,t,n)}var us=gi.prototype.constructor;function ds(){return new us(this._groups,this._parents)}function fs(e,t){var n,r,i;return function(){var a=Cr(this,e),o=(this.style.removeProperty(e),Cr(this,e));return a===o?null:a===n&&o===r?i:i=t(n=a,r=o)}}function ps(e){return function(){this.style.removeProperty(e)}}function ms(e,t,n){var r,i=n+``,a;return function(){var o=Cr(this,e);return o===i?null:o===r?a:a=t(r=o,n)}}function hs(e,t,n){var r,i,a;return function(){var o=Cr(this,e),s=n(this),c=s+``;return s??(c=s=(this.style.removeProperty(e),Cr(this,e))),o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,s))}}function gs(e,t){var n,r,i,a=`style.`+t,o=`end.`+a,s;return function(){var c=Co(this,e),l=c.on,u=c.value[a]==null?s||=ps(t):void 0;(l!==n||i!==u)&&(r=(n=l).copy()).on(o,i=u),c.on=r}}function _s(e,t,n){var r=(e+=``)==`transform`?Wa:Mo;return t==null?this.styleTween(e,fs(e,r)).on(`end.style.`+e,ps(e)):typeof t==`function`?this.styleTween(e,hs(e,r,jo(this,`style.`+e,t))).each(gs(this._id,e)):this.styleTween(e,ms(e,r,t),n).on(`end.style.`+e,null)}function vs(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function ys(e,t,n){var r,i;function a(){var a=t.apply(this,arguments);return a!==i&&(r=(i=a)&&vs(e,a,n)),r}return a._value=t,a}function bs(e,t,n){var r=`style.`+(e+=``);if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!=`function`)throw Error();return this.tween(r,ys(e,t,n??``))}function xs(e){return function(){this.textContent=e}}function Ss(e){return function(){var t=e(this);this.textContent=t??``}}function Cs(e){return this.tween(`text`,typeof e==`function`?Ss(jo(this,`text`,e)):xs(e==null?``:e+``))}function ws(e){return function(t){this.textContent=e.call(this,t)}}function Ts(e){var t,n;function r(){var r=e.apply(this,arguments);return r!==n&&(t=(n=r)&&ws(r)),t}return r._value=e,r}function Es(e){var t=`text`;if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!=`function`)throw Error();return this.tween(t,Ts(e))}function Ds(){for(var e=this._name,t=this._id,n=Ms(),r=this._groups,i=r.length,a=0;a<i;++a)for(var o=r[a],s=o.length,c,l=0;l<s;++l)if(c=o[l]){var u=wo(c,t);xo(c,e,n,l,o,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new As(r,this._parents,e,n)}function Os(){var e,t,n=this,r=n._id,i=n.size();return new Promise(function(a,o){var s={value:o},c={value:function(){--i===0&&a()}};n.each(function(){var n=Co(this,r),i=n.on;i!==e&&(t=(e=i).copy(),t._.cancel.push(s),t._.interrupt.push(s),t._.end.push(c)),n.on=t}),i===0&&a()})}var ks=0;function As(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function js(e){return gi().transition(e)}function Ms(){return++ks}var Ns=gi.prototype;As.prototype=js.prototype={constructor:As,select:cs,selectAll:ls,selectChild:Ns.selectChild,selectChildren:Ns.selectChildren,filter:ts,merge:ns,selection:ds,transition:Ds,call:Ns.call,nodes:Ns.nodes,node:Ns.node,size:Ns.size,empty:Ns.empty,each:Ns.each,on:as,attr:zo,attrTween:Wo,style:_s,styleTween:bs,text:Cs,textTween:Es,remove:ss,tween:Ao,delay:qo,duration:Xo,ease:Qo,easeVarying:es,end:Os,[Symbol.iterator]:Ns[Symbol.iterator]};function Ps(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var Fs={time:null,delay:0,duration:250,ease:Ps};function Is(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw Error(`transition ${t} not found`);return n}function Ls(e){var t,n;e instanceof As?(t=e._id,e=e._name):(t=Ms(),(n=Fs).time=co(),e=e==null?null:e+``);for(var r=this._groups,i=r.length,a=0;a<i;++a)for(var o=r[a],s=o.length,c,l=0;l<s;++l)(c=o[l])&&xo(c,e,t,l,o,n||Is(c,t));return new As(r,this._parents,e,t)}gi.prototype.interrupt=Do,gi.prototype.transition=Ls;var Rs=e=>()=>e;function zs(e,{sourceEvent:t,target:n,transform:r,dispatch:i}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:i}})}function Bs(e,t,n){this.k=e,this.x=t,this.y=n}Bs.prototype={constructor:Bs,scale:function(e){return e===1?this:new Bs(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Bs(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return`translate(`+this.x+`,`+this.y+`) scale(`+this.k+`)`}};var Vs=new Bs(1,0,0);Hs.prototype=Bs.prototype;function Hs(e){for(;!e.__zoom;)if(!(e=e.parentNode))return Vs;return e.__zoom}function Us(e){e.stopImmediatePropagation()}function Ws(e){e.preventDefault(),e.stopImmediatePropagation()}function Gs(e){return(!e.ctrlKey||e.type===`wheel`)&&!e.button}function Ks(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute(`viewBox`)?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function qs(){return this.__zoom||Vs}function Js(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function Ys(){return navigator.maxTouchPoints||`ontouchstart`in this}function Xs(e,t,n){var r=e.invertX(t[0][0])-n[0][0],i=e.invertX(t[1][0])-n[1][0],a=e.invertY(t[0][1])-n[0][1],o=e.invertY(t[1][1])-n[1][1];return e.translate(i>r?(r+i)/2:Math.min(0,r)||Math.max(0,i),o>a?(a+o)/2:Math.min(0,a)||Math.max(0,o))}function Zs(){var e=Gs,t=Ks,n=Xs,r=Js,i=Ys,a=[0,1/0],o=[[-1/0,-1/0],[1/0,1/0]],s=250,c=Xa,l=hn(`start`,`zoom`,`end`),u,d,f,p=500,m=150,h=0,g=10;function _(e){e.property(`__zoom`,qs).on(`wheel.zoom`,w,{passive:!1}).on(`mousedown.zoom`,T).on(`dblclick.zoom`,E).filter(i).on(`touchstart.zoom`,D).on(`touchmove.zoom`,O).on(`touchend.zoom touchcancel.zoom`,k).style(`-webkit-tap-highlight-color`,`rgba(0,0,0,0)`)}_.transform=function(e,t,n,r){var i=e.selection?e.selection():e;i.property(`__zoom`,qs),e===i?i.interrupt().each(function(){S(this,arguments).event(r).start().zoom(null,typeof t==`function`?t.apply(this,arguments):t).end()}):x(e,t,n,r)},_.scaleBy=function(e,t,n,r){_.scaleTo(e,function(){return this.__zoom.k*(typeof t==`function`?t.apply(this,arguments):t)},n,r)},_.scaleTo=function(e,r,i,a){_.transform(e,function(){var e=t.apply(this,arguments),a=this.__zoom,s=i==null?b(e):typeof i==`function`?i.apply(this,arguments):i,c=a.invert(s),l=typeof r==`function`?r.apply(this,arguments):r;return n(y(v(a,l),s,c),e,o)},i,a)},_.translateBy=function(e,r,i,a){_.transform(e,function(){return n(this.__zoom.translate(typeof r==`function`?r.apply(this,arguments):r,typeof i==`function`?i.apply(this,arguments):i),t.apply(this,arguments),o)},null,a)},_.translateTo=function(e,r,i,a,s){_.transform(e,function(){var e=t.apply(this,arguments),s=this.__zoom,c=a==null?b(e):typeof a==`function`?a.apply(this,arguments):a;return n(Vs.translate(c[0],c[1]).scale(s.k).translate(typeof r==`function`?-r.apply(this,arguments):-r,typeof i==`function`?-i.apply(this,arguments):-i),e,o)},a,s)};function v(e,t){return t=Math.max(a[0],Math.min(a[1],t)),t===e.k?e:new Bs(t,e.x,e.y)}function y(e,t,n){var r=t[0]-n[0]*e.k,i=t[1]-n[1]*e.k;return r===e.x&&i===e.y?e:new Bs(e.k,r,i)}function b(e){return[(+e[0][0]+ +e[1][0])/2,(+e[0][1]+ +e[1][1])/2]}function x(e,n,r,i){e.on(`start.zoom`,function(){S(this,arguments).event(i).start()}).on(`interrupt.zoom end.zoom`,function(){S(this,arguments).event(i).end()}).tween(`zoom`,function(){var e=this,a=arguments,o=S(e,a).event(i),s=t.apply(e,a),l=r==null?b(s):typeof r==`function`?r.apply(e,a):r,u=Math.max(s[1][0]-s[0][0],s[1][1]-s[0][1]),d=e.__zoom,f=typeof n==`function`?n.apply(e,a):n,p=c(d.invert(l).concat(u/d.k),f.invert(l).concat(u/f.k));return function(e){if(e===1)e=f;else{var t=p(e),n=u/t[2];e=new Bs(n,l[0]-t[0]*n,l[1]-t[1]*n)}o.zoom(null,e)}})}function S(e,t,n){return!n&&e.__zooming||new C(e,t)}function C(e,n){this.that=e,this.args=n,this.active=0,this.sourceEvent=null,this.extent=t.apply(e,n),this.taps=0}C.prototype={event:function(e){return e&&(this.sourceEvent=e),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit(`start`)),this},zoom:function(e,t){return this.mouse&&e!==`mouse`&&(this.mouse[1]=t.invert(this.mouse[0])),this.touch0&&e!==`touch`&&(this.touch0[1]=t.invert(this.touch0[0])),this.touch1&&e!==`touch`&&(this.touch1[1]=t.invert(this.touch1[0])),this.that.__zoom=t,this.emit(`zoom`),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit(`end`)),this},emit:function(e){var t=vi(this.that).datum();l.call(e,this.that,new zs(e,{sourceEvent:this.sourceEvent,target:_,type:e,transform:this.that.__zoom,dispatch:l}),t)}};function w(t,...i){if(!e.apply(this,arguments))return;var s=S(this,i).event(t),c=this.__zoom,l=Math.max(a[0],Math.min(a[1],c.k*2**r.apply(this,arguments))),u=bi(t);if(s.wheel)(s.mouse[0][0]!==u[0]||s.mouse[0][1]!==u[1])&&(s.mouse[1]=c.invert(s.mouse[0]=u)),clearTimeout(s.wheel);else if(c.k===l)return;else s.mouse=[u,c.invert(u)],Eo(this),s.start();Ws(t),s.wheel=setTimeout(d,m),s.zoom(`mouse`,n(y(v(c,l),s.mouse[0],s.mouse[1]),s.extent,o));function d(){s.wheel=null,s.end()}}function T(t,...r){if(f||!e.apply(this,arguments))return;var i=t.currentTarget,a=S(this,r,!0).event(t),s=vi(t.view).on(`mousemove.zoom`,d,!0).on(`mouseup.zoom`,p,!0),c=bi(t,i),l=t.clientX,u=t.clientY;Ti(t.view),Us(t),a.mouse=[c,this.__zoom.invert(c)],Eo(this),a.start();function d(e){if(Ws(e),!a.moved){var t=e.clientX-l,r=e.clientY-u;a.moved=t*t+r*r>h}a.event(e).zoom(`mouse`,n(y(a.that.__zoom,a.mouse[0]=bi(e,i),a.mouse[1]),a.extent,o))}function p(e){s.on(`mousemove.zoom mouseup.zoom`,null),Ei(e.view,a.moved),Ws(e),a.event(e).end()}}function E(r,...i){if(e.apply(this,arguments)){var a=this.__zoom,c=bi(r.changedTouches?r.changedTouches[0]:r,this),l=a.invert(c),u=a.k*(r.shiftKey?.5:2),d=n(y(v(a,u),c,l),t.apply(this,i),o);Ws(r),s>0?vi(this).transition().duration(s).call(x,d,c,r):vi(this).call(_.transform,d,c,r)}}function D(t,...n){if(e.apply(this,arguments)){var r=t.touches,i=r.length,a=S(this,n,t.changedTouches.length===i).event(t),o,s,c,l;for(Us(t),s=0;s<i;++s)c=r[s],l=bi(c,this),l=[l,this.__zoom.invert(l),c.identifier],a.touch0?!a.touch1&&a.touch0[2]!==l[2]&&(a.touch1=l,a.taps=0):(a.touch0=l,o=!0,a.taps=1+!!u);u&&=clearTimeout(u),o&&(a.taps<2&&(d=l[0],u=setTimeout(function(){u=null},p)),Eo(this),a.start())}}function O(e,...t){if(this.__zooming){var r=S(this,t).event(e),i=e.changedTouches,a=i.length,s,c,l,u;for(Ws(e),s=0;s<a;++s)c=i[s],l=bi(c,this),r.touch0&&r.touch0[2]===c.identifier?r.touch0[0]=l:r.touch1&&r.touch1[2]===c.identifier&&(r.touch1[0]=l);if(c=r.that.__zoom,r.touch1){var d=r.touch0[0],f=r.touch0[1],p=r.touch1[0],m=r.touch1[1],h=(h=p[0]-d[0])*h+(h=p[1]-d[1])*h,g=(g=m[0]-f[0])*g+(g=m[1]-f[1])*g;c=v(c,Math.sqrt(h/g)),l=[(d[0]+p[0])/2,(d[1]+p[1])/2],u=[(f[0]+m[0])/2,(f[1]+m[1])/2]}else if(r.touch0)l=r.touch0[0],u=r.touch0[1];else return;r.zoom(`touch`,n(y(c,l,u),r.extent,o))}}function k(e,...t){if(this.__zooming){var n=S(this,t).event(e),r=e.changedTouches,i=r.length,a,o;for(Us(e),f&&clearTimeout(f),f=setTimeout(function(){f=null},p),a=0;a<i;++a)o=r[a],n.touch0&&n.touch0[2]===o.identifier?delete n.touch0:n.touch1&&n.touch1[2]===o.identifier&&delete n.touch1;if(n.touch1&&!n.touch0&&(n.touch0=n.touch1,delete n.touch1),n.touch0)n.touch0[1]=this.__zoom.invert(n.touch0[0]);else if(n.end(),n.taps===2&&(o=bi(o,this),Math.hypot(d[0]-o[0],d[1]-o[1])<g)){var s=vi(this).on(`dblclick.zoom`);s&&s.apply(this,arguments)}}}return _.wheelDelta=function(e){return arguments.length?(r=typeof e==`function`?e:Rs(+e),_):r},_.filter=function(t){return arguments.length?(e=typeof t==`function`?t:Rs(!!t),_):e},_.touchable=function(e){return arguments.length?(i=typeof e==`function`?e:Rs(!!e),_):i},_.extent=function(e){return arguments.length?(t=typeof e==`function`?e:Rs([[+e[0][0],+e[0][1]],[+e[1][0],+e[1][1]]]),_):t},_.scaleExtent=function(e){return arguments.length?(a[0]=+e[0],a[1]=+e[1],_):[a[0],a[1]]},_.translateExtent=function(e){return arguments.length?(o[0][0]=+e[0][0],o[1][0]=+e[1][0],o[0][1]=+e[0][1],o[1][1]=+e[1][1],_):[[o[0][0],o[0][1]],[o[1][0],o[1][1]]]},_.constrain=function(e){return arguments.length?(n=e,_):n},_.duration=function(e){return arguments.length?(s=+e,_):s},_.interpolate=function(e){return arguments.length?(c=e,_):c},_.on=function(){var e=l.on.apply(l,arguments);return e===l?_:e},_.clickDistance=function(e){return arguments.length?(h=(e=+e)*e,_):Math.sqrt(h)},_.tapDistance=function(e){return arguments.length?(g=+e,_):g},_}var Qs={error001:(e=`react`)=>`Seems like you have not used ${e===`svelte`?`SvelteFlowProvider`:`ReactFlowProvider`} as an ancestor. Help: https://${e}flow.dev/error#001`,error002:()=>`It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.`,error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>`The parent container needs a width and a height to render the graph.`,error005:()=>`Only child nodes can use a parent extent.`,error006:()=>`Can't create edge. An edge needs a source and a target.`,error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:t,sourceHandle:n,targetHandle:r})=>`Couldn't create edge for ${e} handle id: "${e===`source`?n:r}", edge id: ${t}.`,error010:()=>`Handle: No node id found. Make sure to only use a Handle inside a custom Node.`,error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e=`react`)=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>`useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.`,error015:()=>`It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs.`,error016:e=>`Edge with id "${e}" does not exist, it may have been removed. This can happen when an edge is deleted before the "onEdgeClick" handler is called.`},$s=[[-1/0,-1/0],[1/0,1/0]],ec=[`Enter`,` `,`Escape`],tc={"node.a11yDescription.default":`Press enter or space to select a node. Press delete to remove it and escape to cancel.`,"node.a11yDescription.keyboardDisabled":`Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.`,"node.a11yDescription.ariaLiveMessage":({direction:e,x:t,y:n})=>`Moved selected node ${e}. New position, x: ${t}, y: ${n}`,"edge.a11yDescription.default":`Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.`,"controls.ariaLabel":`Control Panel`,"controls.zoomIn.ariaLabel":`Zoom In`,"controls.zoomOut.ariaLabel":`Zoom Out`,"controls.fitView.ariaLabel":`Fit View`,"controls.interactive.ariaLabel":`Toggle Interactivity`,"minimap.ariaLabel":`Mini Map`,"handle.ariaLabel":`Handle`},nc;(function(e){e.Strict=`strict`,e.Loose=`loose`})(nc||={});var rc;(function(e){e.Free=`free`,e.Vertical=`vertical`,e.Horizontal=`horizontal`})(rc||={});var ic;(function(e){e.Partial=`partial`,e.Full=`full`})(ic||={});var ac={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null},oc;(function(e){e.Bezier=`default`,e.Straight=`straight`,e.Step=`step`,e.SmoothStep=`smoothstep`,e.SimpleBezier=`simplebezier`})(oc||={});var sc;(function(e){e.Arrow=`arrow`,e.ArrowClosed=`arrowclosed`})(sc||={});var Q;(function(e){e.Left=`left`,e.Top=`top`,e.Right=`right`,e.Bottom=`bottom`})(Q||={});var cc={[Q.Left]:Q.Right,[Q.Right]:Q.Left,[Q.Top]:Q.Bottom,[Q.Bottom]:Q.Top};function lc(e){return e===null?null:e?`valid`:`invalid`}var uc=e=>!!e&&typeof e==`object`&&`id`in e&&`source`in e&&`target`in e,dc=e=>!!e&&typeof e==`object`&&`id`in e&&`position`in e&&!(`source`in e)&&!(`target`in e),fc=e=>!!e&&typeof e==`object`&&`id`in e&&`internals`in e&&!(`source`in e)&&!(`target`in e),pc=(e,t=[0,0])=>{let{width:n,height:r}=qc(e),i=e.origin??t,a=n*i[0],o=r*i[1];return{x:e.position.x-a,y:e.position.y-o}},mc=(e,t={nodeOrigin:[0,0]})=>e.length===0?{x:0,y:0,width:0,height:0}:kc(e.reduce((e,n)=>{let r=typeof n==`string`,i=!t.nodeLookup&&!r?n:void 0;return t.nodeLookup&&(i=r?t.nodeLookup.get(n):fc(n)?n:t.nodeLookup.get(n.id)),Dc(e,i?jc(i,t.nodeOrigin):{x:0,y:0,x2:0,y2:0})},{x:1/0,y:1/0,x2:-1/0,y2:-1/0})),hc=(e,t={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},r=!1;return e.forEach(e=>{(t.filter===void 0||t.filter(e))&&(n=Dc(n,jc(e)),r=!0)}),r?kc(n):{x:0,y:0,width:0,height:0}},gc=(e,t,[n,r,i]=[0,0,1],a=!1,o=!1)=>{let s=(t.x-n)/i,c=(t.y-r)/i,l=t.width/i,u=t.height/i,d=[];for(let t of e.values()){let{measured:e,selectable:n=!0,hidden:r=!1}=t;if(o&&!n||r)continue;let i=e.width??t.width??t.initialWidth??0,f=e.height??t.height??t.initialHeight??0,{x:p,y:m}=t.internals.positionAbsolute,h=Nc(s,c,l,u,p,m,i,f),g=i*f,_=a&&h>0;(!t.internals.handleBounds||_||h>=g||t.dragging)&&d.push(t)}return d},_c=(e,t)=>{let n=new Set;return e.forEach(e=>{n.add(e.id)}),t.filter(e=>n.has(e.source)||n.has(e.target))};function vc(e,t){let n=new Map,r=t?.nodes?new Set(t.nodes.map(e=>e.id)):null;return e.forEach(e=>{let i;if(t?.includeHiddenNodes){let{width:t,height:n}=qc(e);i=t>0&&n>0}else i=!!(e.measured.width&&e.measured.height&&!e.hidden);i&&(!r||r.has(e.id))&&n.set(e.id,e)}),n}async function yc({nodes:e,width:t,height:n,panZoom:r,minZoom:i,maxZoom:a},o){if(e.size===0)return!0;let s=Wc(hc(vc(e,o)),t,n,o?.minZoom??i,o?.maxZoom??a,o?.padding??.1);return await r.setViewport(s,{duration:o?.duration,ease:o?.ease,interpolate:o?.interpolate}),!0}function bc({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:r=[0,0],nodeExtent:i,onError:a}){let o=n.get(e),s=o.parentId?n.get(o.parentId):void 0,{x:c,y:l}=s?s.internals.positionAbsolute:{x:0,y:0},u=o.origin??r,d=o.extent||i;if(o.extent===`parent`&&!o.expandParent)if(!s)a?.(`005`,Qs.error005());else{let e=s.measured.width,t=s.measured.height;e&&t&&(d=[[c,l],[c+e,l+t]])}else s&&Kc(o.extent)&&(d=[[o.extent[0][0]+c,o.extent[0][1]+l],[o.extent[1][0]+c,o.extent[1][1]+l]]);let f=Kc(d)?Cc(t,d,o.measured):t;return(o.measured.width===void 0||o.measured.height===void 0)&&a?.(`015`,Qs.error015()),{position:{x:f.x-c+(o.measured.width??0)*u[0],y:f.y-l+(o.measured.height??0)*u[1]},positionAbsolute:f}}async function xc({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:r,onBeforeDelete:i}){let a=new Set(e.map(e=>e.id)),o=[];for(let e of n){if(e.deletable===!1)continue;let t=a.has(e.id),n=!t&&e.parentId&&o.find(t=>t.id===e.parentId);(t||n)&&o.push(e)}let s=new Set(t.map(e=>e.id)),c=r.filter(e=>e.deletable!==!1),l=_c(o,c);for(let e of c)s.has(e.id)&&!l.find(t=>t.id===e.id)&&l.push(e);if(!i)return{edges:l,nodes:o};let u=await i({nodes:o,edges:l});return typeof u==`boolean`?u?{edges:l,nodes:o}:{edges:[],nodes:[]}:u}var Sc=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),Cc=(e={x:0,y:0},t,n)=>({x:Sc(e.x,t[0][0],t[1][0]-(n?.width??0)),y:Sc(e.y,t[0][1],t[1][1]-(n?.height??0))});function wc(e,t,n){let{width:r,height:i}=qc(n),{x:a,y:o}=n.internals.positionAbsolute;return Cc(e,[[a,o],[a+r,o+i]],t)}var Tc=(e,t,n)=>e<t?Sc(Math.abs(e-t),1,t)/t:e>n?-Sc(Math.abs(e-n),1,t)/t:0,Ec=(e,t,n=15,r=40)=>[Tc(e.x,r,t.width-r)*n,Tc(e.y,r,t.height-r)*n],Dc=(e,t)=>({x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}),Oc=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),kc=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),Ac=(e,t=[0,0])=>{let{x:n,y:r}=fc(e)?e.internals.positionAbsolute:pc(e,t);return{x:n,y:r,width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}},jc=(e,t=[0,0])=>{let{x:n,y:r}=fc(e)?e.internals.positionAbsolute:pc(e,t);return{x:n,y:r,x2:n+(e.measured?.width??e.width??e.initialWidth??0),y2:r+(e.measured?.height??e.height??e.initialHeight??0)}},Mc=(e,t)=>kc(Dc(Oc(e),Oc(t))),Nc=(e,t,n,r,i,a,o,s)=>{let c=Math.max(0,Math.min(e+n,i+o)-Math.max(e,i)),l=Math.max(0,Math.min(t+r,a+s)-Math.max(t,a));return Math.ceil(c*l)},Pc=(e,t)=>Nc(e.x,e.y,e.width,e.height,t.x,t.y,t.width,t.height),Fc=e=>Ic(e.width)&&Ic(e.height)&&Ic(e.x)&&Ic(e.y),Ic=e=>!isNaN(e)&&isFinite(e),Lc=(e,t)=>(e,t)=>{},Rc=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),zc=({x:e,y:t},[n,r,i],a=!1,o=[1,1])=>{let s={x:(e-n)/i,y:(t-r)/i};return a?Rc(s,o):s},Bc=({x:e,y:t},[n,r,i])=>({x:e*i+n,y:t*i+r});function Vc(e,t){if(typeof e==`number`)return Math.floor((t-t/(1+e))*.5);if(typeof e==`string`&&e.endsWith(`px`)){let t=parseFloat(e);if(!Number.isNaN(t))return Math.floor(t)}if(typeof e==`string`&&e.endsWith(`%`)){let n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(t*n*.01)}return console.error(`The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function Hc(e,t,n){if(typeof e==`string`||typeof e==`number`){let r=Vc(e,n),i=Vc(e,t);return{top:r,right:i,bottom:r,left:i,x:i*2,y:r*2}}if(typeof e==`object`){let r=Vc(e.top??e.y??0,n),i=Vc(e.bottom??e.y??0,n),a=Vc(e.left??e.x??0,t),o=Vc(e.right??e.x??0,t);return{top:r,right:o,bottom:i,left:a,x:a+o,y:r+i}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function Uc(e,t,n,r,i,a){let{x:o,y:s}=Bc(e,[t,n,r]),{x:c,y:l}=Bc({x:e.x+e.width,y:e.y+e.height},[t,n,r]),u=i-c,d=a-l;return{left:Math.floor(o),top:Math.floor(s),right:Math.floor(u),bottom:Math.floor(d)}}var Wc=(e,t,n,r,i,a)=>{let o=Hc(a,t,n),s=(t-o.x)/e.width,c=(n-o.y)/e.height,l=Sc(Math.min(s,c),r,i),u=e.x+e.width/2,d=e.y+e.height/2,f=t/2-u*l,p=n/2-d*l,m=Uc(e,f,p,l,t,n),h={left:Math.min(m.left-o.left,0),top:Math.min(m.top-o.top,0),right:Math.min(m.right-o.right,0),bottom:Math.min(m.bottom-o.bottom,0)};return{x:f-h.left+h.right,y:p-h.top+h.bottom,zoom:l}},Gc=()=>typeof navigator<`u`&&navigator?.userAgent?.indexOf(`Mac`)>=0;function Kc(e){return e!=null&&e!==`parent`}function qc(e){return{width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}}function Jc(e){return(e.measured?.width??e.width??e.initialWidth)!==void 0&&(e.measured?.height??e.height??e.initialHeight)!==void 0}function Yc(e,t={width:0,height:0},n,r,i){let a={...e},o=r.get(n);if(o){let e=o.origin||i;a.x+=o.internals.positionAbsolute.x-(t.width??0)*e[0],a.y+=o.internals.positionAbsolute.y-(t.height??0)*e[1]}return a}function Xc(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}function Zc(){let e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}function Qc(e){return{...tc,...e||{}}}function $c(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:i}){let{x:a,y:o}=al(e),s=zc({x:a-(i?.left??0),y:o-(i?.top??0)},r),{x:c,y:l}=n?Rc(s,t):s;return{xSnapped:c,ySnapped:l,...s}}var el=e=>({width:e.offsetWidth,height:e.offsetHeight}),tl=e=>e?.getRootNode?.()||window?.document,nl=[`INPUT`,`SELECT`,`TEXTAREA`];function rl(e){let t=e.composedPath?.()?.[0]||e.target;return t?.nodeType===1?nl.includes(t.nodeName)||t.hasAttribute(`contenteditable`)||!!t.closest(`.nokey`):!1}var il=e=>`clientX`in e,al=(e,t)=>{let n=il(e),r=n?e.clientX:e.touches?.[0].clientX,i=n?e.clientY:e.touches?.[0].clientY;return{x:r-(t?.left??0),y:i-(t?.top??0)}},ol=(e,t,n,r,i)=>{let a=t.querySelectorAll(`.${e}`);return!a||!a.length?null:Array.from(a).map(t=>{let a=t.getBoundingClientRect();return{id:t.getAttribute(`data-handleid`),type:e,nodeId:i,position:t.getAttribute(`data-handlepos`),x:(a.left-n.left)/r,y:(a.top-n.top)/r,...el(t)}})};function sl({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:i,sourceControlY:a,targetControlX:o,targetControlY:s}){let c=e*.125+i*.375+o*.375+n*.125,l=t*.125+a*.375+s*.375+r*.125;return[c,l,Math.abs(c-e),Math.abs(l-t)]}function cl(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function ll({pos:e,x1:t,y1:n,x2:r,y2:i,c:a}){switch(e){case Q.Left:return[t-cl(t-r,a),n];case Q.Right:return[t+cl(r-t,a),n];case Q.Top:return[t,n-cl(n-i,a)];case Q.Bottom:return[t,n+cl(i-n,a)]}}function ul({sourceX:e,sourceY:t,sourcePosition:n=Q.Bottom,targetX:r,targetY:i,targetPosition:a=Q.Top,curvature:o=.25}){let[s,c]=ll({pos:n,x1:e,y1:t,x2:r,y2:i,c:o}),[l,u]=ll({pos:a,x1:r,y1:i,x2:e,y2:t,c:o}),[d,f,p,m]=sl({sourceX:e,sourceY:t,targetX:r,targetY:i,sourceControlX:s,sourceControlY:c,targetControlX:l,targetControlY:u});return[`M${e},${t} C${s},${c} ${l},${u} ${r},${i}`,d,f,p,m]}function dl({sourceX:e,sourceY:t,targetX:n,targetY:r}){let i=Math.abs(n-e)/2,a=n<e?n+i:n-i,o=Math.abs(r-t)/2;return[a,r<t?r+o:r-o,i,o]}function fl({sourceNode:e,targetNode:t,selected:n=!1,zIndex:r=0,elevateOnSelect:i=!1,zIndexMode:a=`basic`}){return a===`manual`?r:(i&&n?r+1e3:r)+Math.max(e.parentId||i&&e.selected?e.internals.z:0,t.parentId||i&&t.selected?t.internals.z:0)}function pl({sourceNode:e,targetNode:t,width:n,height:r,transform:i}){let a=Dc(jc(e),jc(t));return a.x===a.x2&&(a.x2+=1),a.y===a.y2&&(a.y2+=1),Pc({x:-i[0]/i[2],y:-i[1]/i[2],width:n/i[2],height:r/i[2]},kc(a))>0}var ml=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||``}-${n}${r||``}`,hl=(e,t)=>t.some(t=>t.source===e.source&&t.target===e.target&&(t.sourceHandle===e.sourceHandle||!t.sourceHandle&&!e.sourceHandle)&&(t.targetHandle===e.targetHandle||!t.targetHandle&&!e.targetHandle)),gl=(e,t,n={})=>{if(!e.source||!e.target)return n.onError?.(`006`,Qs.error006()),t;let r=n.getEdgeId||ml,i;return i=uc(e)?{...e}:{...e,id:r(e)},hl(i,t)?t:(i.sourceHandle===null&&delete i.sourceHandle,i.targetHandle===null&&delete i.targetHandle,t.concat(i))};function _l({sourceX:e,sourceY:t,targetX:n,targetY:r}){let[i,a,o,s]=dl({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,i,a,o,s]}var vl={[Q.Left]:{x:-1,y:0},[Q.Right]:{x:1,y:0},[Q.Top]:{x:0,y:-1},[Q.Bottom]:{x:0,y:1}},yl=({source:e,sourcePosition:t=Q.Bottom,target:n})=>t===Q.Left||t===Q.Right?e.x<n.x?{x:1,y:0}:{x:-1,y:0}:e.y<n.y?{x:0,y:1}:{x:0,y:-1},bl=(e,t)=>Math.sqrt((t.x-e.x)**2+(t.y-e.y)**2);function xl({source:e,sourcePosition:t=Q.Bottom,target:n,targetPosition:r=Q.Top,center:i,offset:a,stepPosition:o}){let s=vl[t],c=vl[r],l={x:e.x+s.x*a,y:e.y+s.y*a},u={x:n.x+c.x*a,y:n.y+c.y*a},d=yl({source:l,sourcePosition:t,target:u}),f=d.x===0?`y`:`x`,p=d[f],m=[],h,g,_={x:0,y:0},v={x:0,y:0},[,,y,b]=dl({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(s[f]*c[f]===-1){f===`x`?(h=i.x??l.x+(u.x-l.x)*o,g=i.y??(l.y+u.y)/2):(h=i.x??(l.x+u.x)/2,g=i.y??l.y+(u.y-l.y)*o);let e=[{x:h,y:l.y},{x:h,y:u.y}],t=[{x:l.x,y:g},{x:u.x,y:g}];m=s[f]===p?f===`x`?e:t:f===`x`?t:e}else{let i=[{x:l.x,y:u.y}],o=[{x:u.x,y:l.y}];if(m=f===`x`?s.x===p?o:i:s.y===p?i:o,t===r){let t=Math.abs(e[f]-n[f]);if(t<=a){let r=Math.min(a-1,a-t);s[f]===p?_[f]=(l[f]>e[f]?-1:1)*r:v[f]=(u[f]>n[f]?-1:1)*r}}if(t!==r){let e=f===`x`?`y`:`x`,t=s[f]===c[e],n=l[e]>u[e],r=l[e]<u[e];(s[f]===1&&(!t&&n||t&&r)||s[f]!==1&&(!t&&r||t&&n))&&(m=f===`x`?i:o)}let d={x:l.x+_.x,y:l.y+_.y},y={x:u.x+v.x,y:u.y+v.y};Math.max(Math.abs(d.x-m[0].x),Math.abs(y.x-m[0].x))>=Math.max(Math.abs(d.y-m[0].y),Math.abs(y.y-m[0].y))?(h=(d.x+y.x)/2,g=m[0].y):(h=m[0].x,g=(d.y+y.y)/2)}let x={x:l.x+_.x,y:l.y+_.y},S={x:u.x+v.x,y:u.y+v.y};return[[e,...x.x!==m[0].x||x.y!==m[0].y?[x]:[],...m,...S.x!==m[m.length-1].x||S.y!==m[m.length-1].y?[S]:[],n],h,g,y,b]}function Sl(e,t,n,r){let i=Math.min(bl(e,t)/2,bl(t,n)/2,r),{x:a,y:o}=t;if(e.x===a&&a===n.x||e.y===o&&o===n.y)return`L${a} ${o}`;if(e.y===o){let t=e.x<n.x?-1:1,r=e.y<n.y?1:-1;return`L ${a+i*t},${o}Q ${a},${o} ${a},${o+i*r}`}let s=e.x<n.x?1:-1;return`L ${a},${o+i*(e.y<n.y?-1:1)}Q ${a},${o} ${a+i*s},${o}`}function Cl({sourceX:e,sourceY:t,sourcePosition:n=Q.Bottom,targetX:r,targetY:i,targetPosition:a=Q.Top,borderRadius:o=5,centerX:s,centerY:c,offset:l=20,stepPosition:u=.5}){let[d,f,p,m,h]=xl({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:i},targetPosition:a,center:{x:s,y:c},offset:l,stepPosition:u}),g=`M${d[0].x} ${d[0].y}`;for(let e=1;e<d.length-1;e++)g+=Sl(d[e-1],d[e],d[e+1],o);return g+=`L${d[d.length-1].x} ${d[d.length-1].y}`,[g,f,p,m,h]}function wl(e){return e&&!!(e.internals.handleBounds||e.handles?.length)&&!!(e.measured.width||e.width||e.initialWidth)}function Tl(e){let{sourceNode:t,targetNode:n}=e;if(!wl(t)||!wl(n))return null;let r=t.internals.handleBounds||El(t.handles),i=n.internals.handleBounds||El(n.handles),a=Ol(r?.source??[],e.sourceHandle),o=Ol(e.connectionMode===nc.Strict?i?.target??[]:(i?.target??[]).concat(i?.source??[]),e.targetHandle);if(!a||!o)return e.onError?.(`008`,Qs.error008(a?`target`:`source`,{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;let s=a?.position||Q.Bottom,c=o?.position||Q.Top,l=Dl(t,a,s),u=Dl(n,o,c);return{sourceX:l.x,sourceY:l.y,targetX:u.x,targetY:u.y,sourcePosition:s,targetPosition:c}}function El(e){if(!e)return null;let t=[],n=[];for(let r of e)r.width=r.width??1,r.height=r.height??1,r.type===`source`?t.push(r):r.type===`target`&&n.push(r);return{source:t,target:n}}function Dl(e,t,n=Q.Left,r=!1){let i=(t?.x??0)+e.internals.positionAbsolute.x,a=(t?.y??0)+e.internals.positionAbsolute.y,{width:o,height:s}=t??qc(e);if(r)return{x:i+o/2,y:a+s/2};switch(t?.position??n){case Q.Top:return{x:i+o/2,y:a};case Q.Right:return{x:i+o,y:a+s/2};case Q.Bottom:return{x:i+o/2,y:a+s};case Q.Left:return{x:i,y:a+s/2}}}function Ol(e,t){return e&&(t?e.find(e=>e.id===t):e[0])||null}function kl(e,t){return e?typeof e==`string`?e:`${t?`${t}__`:``}${Object.keys(e).sort().map(t=>`${t}=${e[t]}`).join(`&`)}`:``}function Al(e,{id:t,defaultColor:n,defaultMarkerStart:r,defaultMarkerEnd:i}){let a=new Set;return e.reduce((e,o)=>([o.markerStart||r,o.markerEnd||i].forEach(r=>{if(r&&typeof r==`object`){let i=kl(r,t);a.has(i)||(e.push({id:i,color:r.color||n,...r}),a.add(i))}}),e),[]).sort((e,t)=>e.id.localeCompare(t.id))}var jl=1e3,Ml=10,Nl={nodeOrigin:[0,0],nodeExtent:$s,elevateNodesOnSelect:!0,zIndexMode:`basic`,defaults:{}},Pl={...Nl,checkEquality:!0};function Fl(e,t){let n={...e};for(let e in t)t[e]!==void 0&&(n[e]=t[e]);return n}function Il(e,t,n){let r=Fl(Nl,n);for(let n of e.values())if(n.parentId)Vl(n,e,t,r);else{let e=Cc(pc(n,r.nodeOrigin),Kc(n.extent)?n.extent:r.nodeExtent,qc(n));n.internals.positionAbsolute=e}}function Ll(e,t){if(!e.handles)return e.measured?t?.internals.handleBounds:void 0;let n=[],r=[];for(let t of e.handles){let i={id:t.id,width:t.width??1,height:t.height??1,nodeId:e.id,x:t.x,y:t.y,position:t.position,type:t.type};t.type===`source`?n.push(i):t.type===`target`&&r.push(i)}return{source:n,target:r}}function Rl(e){return e===`manual`}function zl(e,t,n,r={}){let i=Fl(Pl,r),a={i:0},o=new Map(t),s=i?.elevateNodesOnSelect&&!Rl(i.zIndexMode)?jl:0,c=e.length>0,l=!1;t.clear(),n.clear();for(let u of e){let e=o.get(u.id);if(i.checkEquality&&u===e?.internals.userNode)t.set(u.id,e);else{let n=Cc(pc(u,i.nodeOrigin),Kc(u.extent)?u.extent:i.nodeExtent,qc(u));e={...i.defaults,...u,measured:{width:u.measured?.width,height:u.measured?.height},internals:{positionAbsolute:n,handleBounds:Ll(u,e),z:Hl(u,s,i.zIndexMode),userNode:u}},t.set(u.id,e)}(e.measured===void 0||e.measured.width===void 0||e.measured.height===void 0)&&!e.hidden&&(c=!1),u.parentId&&Vl(e,t,n,r,a),l||=u.selected??!1}return{nodesInitialized:c,hasSelectedNodes:l}}function Bl(e,t){if(!e.parentId)return;let n=t.get(e.parentId);n?n.set(e.id,e):t.set(e.parentId,new Map([[e.id,e]]))}function Vl(e,t,n,r,i){let{elevateNodesOnSelect:a,nodeOrigin:o,nodeExtent:s,zIndexMode:c}=Fl(Nl,r),l=e.parentId,u=t.get(l);if(!u){console.warn(`Parent node ${l} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}Bl(e,n),i&&!u.parentId&&u.internals.rootParentIndex===void 0&&c===`auto`&&(u.internals.rootParentIndex=++i.i,u.internals.z=u.internals.z+i.i*Ml),i&&u.internals.rootParentIndex!==void 0&&(i.i=u.internals.rootParentIndex);let{x:d,y:f,z:p}=Ul(e,u,o,s,a&&!Rl(c)?jl:0,c),{positionAbsolute:m}=e.internals,h=d!==m.x||f!==m.y;(h||p!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:h?{x:d,y:f}:m,z:p}})}function Hl(e,t,n){let r=Ic(e.zIndex)?e.zIndex:0;return Rl(n)?r:r+(e.selected?t:0)}function Ul(e,t,n,r,i,a){let{x:o,y:s}=t.internals.positionAbsolute,c=qc(e),l=pc(e,n),u=Kc(e.extent)?Cc(l,e.extent,c):l,d=Cc({x:o+u.x,y:s+u.y},r,c);e.extent===`parent`&&(d=wc(d,c,t));let f=Hl(e,i,a),p=t.internals.z??0;return{x:d.x,y:d.y,z:p>=f?p+1:f}}function Wl(e,t,n,r=[0,0]){let i=[],a=new Map;for(let n of e){let e=t.get(n.parentId);if(!e)continue;let r=Mc(a.get(n.parentId)?.expandedRect??Ac(e),n.rect);a.set(n.parentId,{expandedRect:r,parent:e})}return a.size>0&&a.forEach(({expandedRect:t,parent:a},o)=>{let s=a.internals.positionAbsolute,c=qc(a),l=a.origin??r,u=t.x<s.x?Math.round(Math.abs(s.x-t.x)):0,d=t.y<s.y?Math.round(Math.abs(s.y-t.y)):0,f=Math.max(c.width,Math.round(t.width)),p=Math.max(c.height,Math.round(t.height)),m=(f-c.width)*l[0],h=(p-c.height)*l[1];(u>0||d>0||m||h)&&(i.push({id:o,type:`position`,position:{x:a.position.x-u+m,y:a.position.y-d+h}}),n.get(o)?.forEach(t=>{e.some(e=>e.id===t.id)||i.push({id:t.id,type:`position`,position:{x:t.position.x+u,y:t.position.y+d}})})),(c.width<t.width||c.height<t.height||u||d)&&i.push({id:o,type:`dimensions`,setAttributes:!0,dimensions:{width:f+(u?l[0]*u-m:0),height:p+(d?l[1]*d-h:0)}})}),i}function Gl(e,t,n,r,i,a,o){let s=r?.querySelector(`.xyflow__viewport`),c=!1;if(!s)return{changes:[],updatedInternals:c};let l=[],u=window.getComputedStyle(s),{m22:d}=new window.DOMMatrixReadOnly(u.transform),f=[];for(let r of e.values()){let e=t.get(r.id);if(!e)continue;if(e.hidden){t.set(e.id,{...e,internals:{...e.internals,handleBounds:void 0}}),c=!0;continue}let s=el(r.nodeElement),u=e.measured.width!==s.width||e.measured.height!==s.height;if(s.width&&s.height&&(u||!e.internals.handleBounds||r.force)){let p=r.nodeElement.getBoundingClientRect(),m=Kc(e.extent)?e.extent:a,{positionAbsolute:h}=e.internals;if(e.parentId&&e.extent===`parent`){let n=t.get(e.parentId);n&&(h=wc(h,s,n))}else m&&(h=Cc(h,m,s));let g={...e,measured:s,internals:{...e.internals,positionAbsolute:h,handleBounds:{source:ol(`source`,r.nodeElement,p,d,e.id),target:ol(`target`,r.nodeElement,p,d,e.id)}}};t.set(e.id,g),e.parentId&&Vl(g,t,n,{nodeOrigin:i,zIndexMode:o}),c=!0,u&&(l.push({id:e.id,type:`dimensions`,dimensions:s}),e.expandParent&&e.parentId&&f.push({id:e.id,parentId:e.parentId,rect:Ac(g,i)}))}}if(f.length>0){let e=Wl(f,t,n,i);l.push(...e)}return{changes:l,updatedInternals:c}}async function Kl({delta:e,panZoom:t,transform:n,translateExtent:r,width:i,height:a}){if(!t||!e.x&&!e.y)return!1;let o=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[i,a]],r);return!!o&&(o.x!==n[0]||o.y!==n[1]||o.k!==n[2])}function ql(e,t,n,r,i,a){let o=i,s=r.get(o)||new Map;r.set(o,s.set(n,t)),o=`${i}-${e}`;let c=r.get(o)||new Map;if(r.set(o,c.set(n,t)),a){o=`${i}-${e}-${a}`;let s=r.get(o)||new Map;r.set(o,s.set(n,t))}}function Jl(e,t,n){e.clear(),t.clear();for(let r of n){let{source:n,target:i,sourceHandle:a=null,targetHandle:o=null}=r,s={edgeId:r.id,source:n,target:i,sourceHandle:a,targetHandle:o},c=`${n}-${a}--${i}-${o}`;ql(`source`,s,`${i}-${o}--${n}-${a}`,e,n,a),ql(`target`,s,c,e,i,o),t.set(r.id,r)}}function Yl(e,t){if(!e.parentId)return!1;let n=t.get(e.parentId);return n?n.selected?!0:Yl(n,t):!1}function Xl(e,t,n){let r=e;do{if(r?.matches?.(t))return!0;if(r===n)return!1;r=r?.parentElement}while(r);return!1}function Zl(e,t,n,r){let i=new Map;for(let[a,o]of e)if((o.selected||o.id===r)&&(!o.parentId||!Yl(o,e))&&(o.draggable||t&&o.draggable===void 0)){let t=e.get(a);t&&i.set(a,{id:a,position:t.position||{x:0,y:0},distance:{x:n.x-t.internals.positionAbsolute.x,y:n.y-t.internals.positionAbsolute.y},extent:t.extent,parentId:t.parentId,origin:t.origin,expandParent:t.expandParent,internals:{positionAbsolute:t.internals.positionAbsolute||{x:0,y:0}},measured:{width:t.measured.width??0,height:t.measured.height??0}})}return i}function Ql({nodeId:e,dragItems:t,nodeLookup:n,dragging:r=!0}){let i=[];for(let[e,a]of t){let t=n.get(e)?.internals.userNode;t&&i.push({...t,position:a.position,dragging:r})}if(!e)return[i[0],i];let a=n.get(e)?.internals.userNode;return[a?{...a,position:t.get(e)?.position||a.position,dragging:r}:i[0],i]}function $l({dragItems:e,snapGrid:t,x:n,y:r}){let i=e.values().next().value;if(!i)return null;let a={x:n-i.distance.x,y:r-i.distance.y},o=Rc(a,t);return{x:o.x-a.x,y:o.y-a.y}}function eu({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:r,onDragStop:i}){let a={x:null,y:null},o=0,s=new Map,c=!1,l={x:0,y:0},u=null,d=!1,f=null,p=!1,m=!1,h=null;function g({noDragClassName:g,handleSelector:_,domNode:v,isSelectable:y,nodeId:b,nodeClickDistance:x=0}){f=vi(v);function S({x:e,y:n}){let{nodeLookup:i,nodeExtent:o,snapGrid:c,snapToGrid:l,nodeOrigin:u,onNodeDrag:d,onSelectionDrag:f,onError:p,updateNodePositions:g}=t();a={x:e,y:n};let _=!1,v=s.size>1,y=v&&o?Oc(hc(s)):null,x=v&&l?$l({dragItems:s,snapGrid:c,x:e,y:n}):null;for(let[t,r]of s){if(!i.has(t))continue;let a={x:e-r.distance.x,y:n-r.distance.y};l&&(a=x?{x:Math.round(a.x+x.x),y:Math.round(a.y+x.y)}:Rc(a,c));let s=null;if(v&&o&&!r.extent&&y){let{positionAbsolute:e}=r.internals,t=e.x-y.x+o[0][0],n=e.x+r.measured.width-y.x2+o[1][0],i=e.y-y.y+o[0][1],a=e.y+r.measured.height-y.y2+o[1][1];s=[[t,i],[n,a]]}let{position:d,positionAbsolute:f}=bc({nodeId:t,nextPosition:a,nodeLookup:i,nodeExtent:s||o,nodeOrigin:u,onError:p});_=_||r.position.x!==d.x||r.position.y!==d.y,r.position=d,r.internals.positionAbsolute=f}if(m||=_,_&&(g(s,!0),h&&(r||d||!b&&f))){let[e,t]=Ql({nodeId:b,dragItems:s,nodeLookup:i});r?.(h,s,e,t),d?.(h,e,t),b||f?.(h,t)}}async function C(){if(!u)return;let{transform:e,panBy:n,autoPanSpeed:r,autoPanOnNodeDrag:i}=t();if(!i){c=!1,cancelAnimationFrame(o);return}let[s,d]=Ec(l,u,r);(s!==0||d!==0)&&(a.x=(a.x??0)-s/e[2],a.y=(a.y??0)-d/e[2],await n({x:s,y:d})&&S(a)),o=requestAnimationFrame(C)}function w(r){let{nodeLookup:i,multiSelectionActive:o,nodesDraggable:c,transform:l,snapGrid:f,snapToGrid:p,selectNodesOnDrag:m,onNodeDragStart:h,onSelectionDragStart:g,unselectNodesAndEdges:_}=t();d=!0,(!m||!y)&&!o&&b&&(i.get(b)?.selected||_()),y&&m&&b&&e?.(b);let v=$c(r.sourceEvent,{transform:l,snapGrid:f,snapToGrid:p,containerBounds:u});if(a=v,s=Zl(i,c,v,b),s.size>0&&(n||h||!b&&g)){let[e,t]=Ql({nodeId:b,dragItems:s,nodeLookup:i});n?.(r.sourceEvent,s,e,t),h?.(r.sourceEvent,e,t),b||g?.(r.sourceEvent,t)}}let T=Ni().clickDistance(x).on(`start`,e=>{let{domNode:n,nodeDragThreshold:r,transform:i,snapGrid:o,snapToGrid:s}=t();u=n?.getBoundingClientRect()||null,p=!1,m=!1,h=e.sourceEvent,r===0&&w(e),a=$c(e.sourceEvent,{transform:i,snapGrid:o,snapToGrid:s,containerBounds:u}),l=al(e.sourceEvent,u)}).on(`drag`,e=>{let{autoPanOnNodeDrag:n,transform:r,snapGrid:i,snapToGrid:o,nodeDragThreshold:f,nodeLookup:m}=t(),g=$c(e.sourceEvent,{transform:r,snapGrid:i,snapToGrid:o,containerBounds:u});if(h=e.sourceEvent,(e.sourceEvent.type===`touchmove`&&e.sourceEvent.touches.length>1||b&&!m.has(b))&&(p=!0),!p){if(!c&&n&&d&&(c=!0,C()),!d){let t=al(e.sourceEvent,u),n=t.x-l.x,r=t.y-l.y;Math.sqrt(n*n+r*r)>f&&w(e)}(a.x!==g.xSnapped||a.y!==g.ySnapped)&&s&&d&&(l=al(e.sourceEvent,u),S(g))}}).on(`end`,e=>{if(!d||p){p&&s.size>0&&t().updateNodePositions(s,!1);return}if(c=!1,d=!1,cancelAnimationFrame(o),s.size>0){let{nodeLookup:n,updateNodePositions:r,onNodeDragStop:a,onSelectionDragStop:o}=t();if(m&&=(r(s,!1),!1),i||a||!b&&o){let[t,r]=Ql({nodeId:b,dragItems:s,nodeLookup:n,dragging:!1});i?.(e.sourceEvent,s,t,r),a?.(e.sourceEvent,t,r),b||o?.(e.sourceEvent,r)}}}).filter(e=>{let t=e.target;return!e.button&&(!g||!Xl(t,`.${g}`,v))&&(!_||Xl(t,_,v))});f.call(T)}function _(){f?.on(`.drag`,null)}return{update:g,destroy:_}}function tu(e,t,n){let r=[],i={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(let e of t.values())Pc(i,Ac(e))>0&&r.push(e);return r}var nu=250;function ru(e,t,n,r){let i=[],a=1/0,o=tu(e,n,t+nu);for(let n of o){let o=[...n.internals.handleBounds?.source??[],...n.internals.handleBounds?.target??[]];for(let s of o){if(r.nodeId===s.nodeId&&r.type===s.type&&r.id===s.id)continue;let{x:o,y:c}=Dl(n,s,s.position,!0),l=Math.sqrt((o-e.x)**2+(c-e.y)**2);l>t||(l<a?(i=[{...s,x:o,y:c}],a=l):l===a&&i.push({...s,x:o,y:c}))}}if(!i.length)return null;if(i.length>1){let e=r.type===`source`?`target`:`source`;return i.find(t=>t.type===e)??i[0]}return i[0]}function iu(e,t,n,r,i,a=!1){let o=r.get(e);if(!o)return null;let s=i===`strict`?o.internals.handleBounds?.[t]:[...o.internals.handleBounds?.source??[],...o.internals.handleBounds?.target??[]],c=(n?s?.find(e=>e.id===n):s?.[0])??null;return c&&a?{...c,...Dl(o,c,c.position,!0)}:c}function au(e,t){return e||(t?.classList.contains(`target`)?`target`:t?.classList.contains(`source`)?`source`:null)}function ou(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}var su=()=>!0;function cu(e,{connectionMode:t,connectionRadius:n,handleId:r,nodeId:i,edgeUpdaterType:a,isTarget:o,domNode:s,nodeLookup:c,lib:l,autoPanOnConnect:u,flowId:d,panBy:f,cancelConnection:p,onConnectStart:m,onConnect:h,onConnectEnd:g,isValidConnection:_=su,onReconnectEnd:v,updateConnection:y,getTransform:b,getFromHandle:x,autoPanSpeed:S,dragThreshold:C=1,handleDomNode:w}){let T=tl(e.target),E=0,D,{x:O,y:k}=al(e),A=au(a,w),j=s?.getBoundingClientRect(),M=!1;if(!j||!A)return;let N=iu(i,A,r,c,t);if(!N)return;let P=al(e,j),F=!1,I=null,L=!1,R=null;function z(){if(!u||!j)return;let[e,t]=Ec(P,j,S);f({x:e,y:t}),E=requestAnimationFrame(z)}let B={...N,nodeId:i,type:A,position:N.position},V=c.get(i),H={inProgress:!0,isValid:null,from:Dl(V,B,Q.Left,!0),fromHandle:B,fromPosition:B.position,fromNode:V,to:P,toHandle:null,toPosition:cc[B.position],toNode:null,pointer:P};function U(){M=!0,y(H),m?.(e,{nodeId:i,handleId:r,handleType:A})}C===0&&U();function ee(e){if(!M){let{x:t,y:n}=al(e),r=t-O,i=n-k;if(!(r*r+i*i>C*C))return;U()}if(!x()||!B){W(e);return}let a=b();P=al(e,j),D=ru(zc(P,a,!1,[1,1]),n,c,B),F||=(z(),!0);let s=lu(e,{handle:D,connectionMode:t,fromNodeId:i,fromHandleId:r,fromType:o?`target`:`source`,isValidConnection:_,doc:T,lib:l,flowId:d,nodeLookup:c});R=s.handleDomNode,I=s.connection,L=ou(!!D,s.isValid);let u=c.get(i),f=u?Dl(u,B,Q.Left,!0):H.from,p={...H,from:f,isValid:L,to:s.toHandle&&L?Bc({x:s.toHandle.x,y:s.toHandle.y},a):P,toHandle:s.toHandle,toPosition:L&&s.toHandle?s.toHandle.position:cc[B.position],toNode:s.toHandle?c.get(s.toHandle.nodeId):null,pointer:P};y(p),H=p}function W(e){if(!(`touches`in e&&e.touches.length>0)){if(M){(D||R)&&I&&L&&h?.(I);let{inProgress:t,...n}=H,r={...n,toPosition:H.toHandle?H.toPosition:null};g?.(e,r),a&&v?.(e,r)}p(),cancelAnimationFrame(E),F=!1,L=!1,I=null,R=null,T.removeEventListener(`mousemove`,ee),T.removeEventListener(`mouseup`,W),T.removeEventListener(`touchmove`,ee),T.removeEventListener(`touchend`,W)}}T.addEventListener(`mousemove`,ee),T.addEventListener(`mouseup`,W),T.addEventListener(`touchmove`,ee),T.addEventListener(`touchend`,W)}function lu(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:i,fromType:a,doc:o,lib:s,flowId:c,isValidConnection:l=su,nodeLookup:u}){let d=a===`target`,f=t?o.querySelector(`.${s}-flow__handle[data-id="${c}-${t?.nodeId}-${t?.id}-${t?.type}"]`):null,{x:p,y:m}=al(e),h=o.elementFromPoint(p,m),g=h?.classList.contains(`${s}-flow__handle`)?h:f,_={handleDomNode:g,isValid:!1,connection:null,toHandle:null};if(g){let e=au(void 0,g),t=g.getAttribute(`data-nodeid`),a=g.getAttribute(`data-handleid`),o=g.classList.contains(`connectable`),s=g.classList.contains(`connectableend`);if(!t||!e)return _;let c={source:d?t:r,sourceHandle:d?a:i,target:d?r:t,targetHandle:d?i:a};_.connection=c,_.isValid=o&&s&&(n===nc.Strict?d&&e===`source`||!d&&e===`target`:t!==r||a!==i)&&l(c),_.toHandle=iu(t,e,a,u,n,!0)}return _}var uu={onPointerDown:cu,isValid:lu};function du({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){let i=vi(e);function a({translateExtent:e,width:a,height:o,zoomStep:s=1,pannable:c=!0,zoomable:l=!0,inversePan:u=!1}){let d=e=>{if(e.sourceEvent.type!==`wheel`||!t)return;let r=n(),i=e.sourceEvent.ctrlKey&&Gc()?10:1,a=-e.sourceEvent.deltaY*(e.sourceEvent.deltaMode===1?.05:e.sourceEvent.deltaMode?1:.002)*s,o=r[2]*2**(a*i);t.scaleTo(o)},f=[0,0],p=Zs().on(`start`,e=>{(e.sourceEvent.type===`mousedown`||e.sourceEvent.type===`touchstart`)&&(f=[e.sourceEvent.clientX??e.sourceEvent.touches[0].clientX,e.sourceEvent.clientY??e.sourceEvent.touches[0].clientY])}).on(`zoom`,c?i=>{let s=n();if(i.sourceEvent.type!==`mousemove`&&i.sourceEvent.type!==`touchmove`||!t)return;let c=[i.sourceEvent.clientX??i.sourceEvent.touches[0].clientX,i.sourceEvent.clientY??i.sourceEvent.touches[0].clientY],l=[c[0]-f[0],c[1]-f[1]];f=c;let d=r()*Math.max(s[2],Math.log(s[2]))*(u?-1:1),p={x:s[0]-l[0]*d,y:s[1]-l[1]*d},m=[[0,0],[a,o]];t.setViewportConstrained({x:p.x,y:p.y,zoom:s[2]},m,e)}:null).on(`zoom.wheel`,l?d:null);i.call(p,{})}function o(){i.on(`zoom`,null)}return{update:a,destroy:o,pointer:bi}}var fu=e=>({x:e.x,y:e.y,zoom:e.k}),pu=({x:e,y:t,zoom:n})=>Vs.translate(e,t).scale(n),mu=(e,t)=>e.target.closest(`.${t}`),hu=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),gu=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,_u=(e,t=0,n=gu,r=()=>{})=>{let i=typeof t==`number`&&t>0;return i||r(),i?e.transition().duration(t).ease(n).on(`end`,r):e},vu=e=>{let t=e.ctrlKey&&Gc()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function yu({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:i,panOnScrollSpeed:a,zoomOnPinch:o,onPanZoomStart:s,onPanZoom:c,onPanZoomEnd:l}){return u=>{if(mu(u,t))return u.ctrlKey&&u.preventDefault(),!1;u.preventDefault(),u.stopImmediatePropagation();let d=n.property(`__zoom`).k||1;if(u.ctrlKey&&o){let e=bi(u),t=d*2**vu(u);r.scaleTo(n,t,e,u);return}let f=u.deltaMode===1?20:1,p=i===rc.Vertical?0:u.deltaX*f,m=i===rc.Horizontal?0:u.deltaY*f;!Gc()&&u.shiftKey&&i!==rc.Vertical&&(p=u.deltaY*f,m=0),r.translateBy(n,-(p/d)*a,-(m/d)*a,{internal:!0});let h=fu(n.property(`__zoom`));clearTimeout(e.panScrollTimeout),e.isPanScrolling?c?.(u,h):(e.isPanScrolling=!0,s?.(u,h)),e.panScrollTimeout=setTimeout(()=>{l?.(u,h),e.isPanScrolling=!1},150)}}function bu({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,i){let a=r.type===`wheel`,o=!t&&a&&!r.ctrlKey,s=mu(r,e);if(r.ctrlKey&&a&&s&&r.preventDefault(),o||s)return null;r.preventDefault(),n.call(this,r,i)}}function xu({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{if(r.sourceEvent?.internal)return;let i=fu(r.transform);e.mouseButton=r.sourceEvent?.button||0,e.isZoomingOrPanning=!0,e.prevViewport=i,r.sourceEvent?.type===`mousedown`&&t(!0),n&&n?.(r.sourceEvent,i)}}function Su({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:i}){return a=>{e.usedRightMouseButton=!!(n&&hu(t,e.mouseButton??0)),a.sourceEvent?.sync||r([a.transform.x,a.transform.y,a.transform.k]),i&&!a.sourceEvent?.internal&&i?.(a.sourceEvent,fu(a.transform))}}function Cu({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:r,onPanZoomEnd:i,onPaneContextMenu:a}){return o=>{if(!o.sourceEvent?.internal&&(e.isZoomingOrPanning=!1,a&&hu(t,e.mouseButton??0)&&!e.usedRightMouseButton&&o.sourceEvent&&a(o.sourceEvent),e.usedRightMouseButton=!1,r(!1),i)){let t=fu(o.transform);e.prevViewport=t,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{i?.(o.sourceEvent,t)},n?150:0)}}}function wu({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:r,panOnScroll:i,zoomOnDoubleClick:a,userSelectionActive:o,noWheelClassName:s,noPanClassName:c,lib:l,connectionInProgress:u}){return d=>{let f=e||t,p=n&&d.ctrlKey,m=d.type===`wheel`;if(d.button===1&&d.type===`mousedown`&&(mu(d,`${l}-flow__node`)||mu(d,`${l}-flow__edge`)))return!0;if(!r&&!f&&!i&&!a&&!n||o||u&&!m||mu(d,s)&&m||mu(d,c)&&(!m||i&&m&&!e)||!n&&d.ctrlKey&&m)return!1;if(!n&&d.type===`touchstart`&&d.touches?.length>1)return d.preventDefault(),!1;if(!f&&!i&&!p&&m||!r&&(d.type===`mousedown`||d.type===`touchstart`)||Array.isArray(r)&&!r.includes(d.button)&&d.type===`mousedown`)return!1;let h=Array.isArray(r)&&r.includes(d.button)||!d.button||d.button<=1;return(!d.ctrlKey||m)&&h}}function Tu({domNode:e,minZoom:t,maxZoom:n,translateExtent:r,viewport:i,onPanZoom:a,onPanZoomStart:o,onPanZoomEnd:s,onDraggingChange:c}){let l={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},u=e.getBoundingClientRect(),d=[[0,0],[u.width,u.height]];(typeof ResizeObserver<`u`?new ResizeObserver(e=>{let t=e[0];t&&(d=[[0,0],[t.contentRect.width,t.contentRect.height]])}):null)?.observe(e);let f=Zs().extent(()=>d).scaleExtent([t,n]).translateExtent(r),p=vi(e).call(f);y({x:i.x,y:i.y,zoom:Sc(i.zoom,t,n)},[[0,0],[u.width,u.height]],r);let m=p.on(`wheel.zoom`),h=p.on(`dblclick.zoom`);f.wheelDelta(vu);async function g(e,t){return p?new Promise(n=>{f?.interpolate(t?.interpolate===`linear`?Ia:Xa).transform(_u(p,t?.duration,t?.ease,()=>n(!0)),e)}):!1}function _({noWheelClassName:e,noPanClassName:t,onPaneContextMenu:n,userSelectionActive:r,panOnScroll:i,panOnDrag:u,panOnScrollMode:d,panOnScrollSpeed:g,preventScrolling:_,zoomOnPinch:y,zoomOnScroll:b,zoomOnDoubleClick:x,zoomActivationKeyPressed:S,lib:C,onTransformChange:w,connectionInProgress:T,paneClickDistance:E,selectionOnDrag:D}){r&&!l.isZoomingOrPanning&&v();let O=i&&!S&&!r;f.clickDistance(D?1/0:!Ic(E)||E<0?0:E);let k=O?yu({zoomPanValues:l,noWheelClassName:e,d3Selection:p,d3Zoom:f,panOnScrollMode:d,panOnScrollSpeed:g,zoomOnPinch:y,onPanZoomStart:o,onPanZoom:a,onPanZoomEnd:s}):bu({noWheelClassName:e,preventScrolling:_,d3ZoomHandler:m});p.on(`wheel.zoom`,k,{passive:!1});let A=xu({zoomPanValues:l,onDraggingChange:c,onPanZoomStart:o});f.on(`start`,A);let j=Su({zoomPanValues:l,panOnDrag:u,onPaneContextMenu:!!n,onPanZoom:a,onTransformChange:w});f.on(`zoom`,j);let M=Cu({zoomPanValues:l,panOnDrag:u,panOnScroll:i,onPaneContextMenu:n,onPanZoomEnd:s,onDraggingChange:c});f.on(`end`,M);let N=wu({zoomActivationKeyPressed:S,panOnDrag:u,zoomOnScroll:b,panOnScroll:i,zoomOnDoubleClick:x,zoomOnPinch:y,userSelectionActive:r,noPanClassName:t,noWheelClassName:e,lib:C,connectionInProgress:T});f.filter(N),x?p.on(`dblclick.zoom`,h):p.on(`dblclick.zoom`,null)}function v(){f.on(`zoom`,null)}async function y(e,t,n){let r=pu(e),i=f?.constrain()(r,t,n);return i&&await g(i),i}async function b(e,t){let n=pu(e);return await g(n,t),n}function x(e){if(p){let t=pu(e),n=p.property(`__zoom`);(n.k!==e.zoom||n.x!==e.x||n.y!==e.y)&&f?.transform(p,t,null,{sync:!0})}}function S(){let e=p?Hs(p.node()):{x:0,y:0,k:1};return{x:e.x,y:e.y,zoom:e.k}}async function C(e,t){return p?new Promise(n=>{f?.interpolate(t?.interpolate===`linear`?Ia:Xa).scaleTo(_u(p,t?.duration,t?.ease,()=>n(!0)),e)}):!1}async function w(e,t){return p?new Promise(n=>{f?.interpolate(t?.interpolate===`linear`?Ia:Xa).scaleBy(_u(p,t?.duration,t?.ease,()=>n(!0)),e)}):!1}function T(e){f?.scaleExtent(e)}function E(e){f?.translateExtent(e)}function D(e){let t=!Ic(e)||e<0?0:e;f?.clickDistance(t)}return{update:_,destroy:v,setViewport:b,setViewportConstrained:y,getViewport:S,scaleTo:C,scaleBy:w,setScaleExtent:T,setTranslateExtent:E,syncViewport:x,setClickDistance:D}}var Eu;(function(e){e.Line=`line`,e.Handle=`handle`})(Eu||={});function Du({width:e,prevWidth:t,height:n,prevHeight:r,affectsX:i,affectsY:a}){let o=e-t,s=n-r,c=[o>0?1:o<0?-1:0,s>0?1:s<0?-1:0];return o&&i&&(c[0]*=-1),s&&a&&(c[1]*=-1),c}function Ou(e){return{isHorizontal:e.includes(`right`)||e.includes(`left`),isVertical:e.includes(`bottom`)||e.includes(`top`),affectsX:e.includes(`left`),affectsY:e.includes(`top`)}}function ku(e,t){return Math.max(0,t-e)}function Au(e,t){return Math.max(0,e-t)}function ju(e,t,n){return Math.max(0,t-e,e-n)}function Mu(e,t){return e?!t:t}function Nu(e,t,n,r,i,a,o,s){let{affectsX:c,affectsY:l}=t,{isHorizontal:u,isVertical:d}=t,f=u&&d,{xSnapped:p,ySnapped:m}=n,{minWidth:h,maxWidth:g,minHeight:_,maxHeight:v}=r,{x:y,y:b,width:x,height:S,aspectRatio:C}=e,w=Math.floor(u?p-e.pointerX:0),T=Math.floor(d?m-e.pointerY:0),E=x+(c?-w:w),D=S+(l?-T:T),O=-a[0]*x,k=-a[1]*S,A=ju(E,h,g),j=ju(D,_,v);if(o){let e=0,t=0;c&&w<0?e=ku(y+w+O,o[0][0]):!c&&w>0&&(e=Au(y+E+O,o[1][0])),l&&T<0?t=ku(b+T+k,o[0][1]):!l&&T>0&&(t=Au(b+D+k,o[1][1])),A=Math.max(A,e),j=Math.max(j,t)}if(s){let e=0,t=0;c&&w>0?e=Au(y+w,s[0][0]):!c&&w<0&&(e=ku(y+E,s[1][0])),l&&T>0?t=Au(b+T,s[0][1]):!l&&T<0&&(t=ku(b+D,s[1][1])),A=Math.max(A,e),j=Math.max(j,t)}if(i){if(u){let e=ju(E/C,_,v)*C;if(A=Math.max(A,e),o){let e=0;e=!c&&!l||c&&!l&&f?Au(b+k+E/C,o[1][1])*C:ku(b+k+(c?w:-w)/C,o[0][1])*C,A=Math.max(A,e)}if(s){let e=0;e=!c&&!l||c&&!l&&f?ku(b+E/C,s[1][1])*C:Au(b+(c?w:-w)/C,s[0][1])*C,A=Math.max(A,e)}}if(d){let e=ju(D*C,h,g)/C;if(j=Math.max(j,e),o){let e=0;e=!c&&!l||l&&!c&&f?Au(y+D*C+O,o[1][0])/C:ku(y+(l?T:-T)*C+O,o[0][0])/C,j=Math.max(j,e)}if(s){let e=0;e=!c&&!l||l&&!c&&f?ku(y+D*C,s[1][0])/C:Au(y+(l?T:-T)*C,s[0][0])/C,j=Math.max(j,e)}}}T+=T<0?j:-j,w+=w<0?A:-A,i&&(f?E>D*C?T=(Mu(c,l)?-w:w)/C:w=(Mu(c,l)?-T:T)*C:u?(T=w/C,l=c):(w=T*C,c=l));let M=c?y+w:y,N=l?b+T:b;return{width:x+(c?-w:w),height:S+(l?-T:T),x:a[0]*w*(c?-1:1)+M,y:a[1]*T*(l?-1:1)+N}}var Pu={width:0,height:0,x:0,y:0},Fu={...Pu,pointerX:0,pointerY:0,aspectRatio:1};function Iu(e,t,n){let r=t.position.x+e.position.x,i=t.position.y+e.position.y,a=e.measured.width??0,o=e.measured.height??0,s=n[0]*a,c=n[1]*o;return[[r-s,i-c],[r+a-s,i+o-c]]}function Lu({domNode:e,nodeId:t,getStoreItems:n,onChange:r,onEnd:i}){let a=vi(e),o={controlDirection:Ou(`bottom-right`),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function s({controlPosition:e,boundaries:s,keepAspectRatio:c,resizeDirection:l,onResizeStart:u,onResize:d,onResizeEnd:f,shouldResize:p}){let m={...Pu},h={...Fu};o={boundaries:s,resizeDirection:l,keepAspectRatio:c,controlDirection:Ou(e)};let g,_=null,v=[],y,b,x,S=!1,C=Ni().on(`start`,e=>{let{nodeLookup:r,transform:i,snapGrid:a,snapToGrid:o,nodeOrigin:s,paneDomNode:c}=n();if(g=r.get(t),!g)return;_=c?.getBoundingClientRect()??null;let{xSnapped:l,ySnapped:d}=$c(e.sourceEvent,{transform:i,snapGrid:a,snapToGrid:o,containerBounds:_});m={width:g.measured.width??0,height:g.measured.height??0,x:g.position.x??0,y:g.position.y??0},h={...m,pointerX:l,pointerY:d,aspectRatio:m.width/m.height},y=void 0,b=Kc(g.extent)?g.extent:void 0,g.parentId&&(g.extent===`parent`||g.expandParent)&&(y=r.get(g.parentId)),y&&g.extent===`parent`&&(b=[[0,0],[y.measured.width,y.measured.height]]),v=[],x=void 0;for(let[e,n]of r)if(n.parentId===t&&(v.push({id:e,position:{...n.position},extent:n.extent}),n.extent===`parent`||n.expandParent)){let e=Iu(n,g,n.origin??s);x=x?[[Math.min(e[0][0],x[0][0]),Math.min(e[0][1],x[0][1])],[Math.max(e[1][0],x[1][0]),Math.max(e[1][1],x[1][1])]]:e}u?.(e,{...m})}).on(`drag`,e=>{let{transform:t,snapGrid:i,snapToGrid:a,nodeOrigin:s}=n(),c=$c(e.sourceEvent,{transform:t,snapGrid:i,snapToGrid:a,containerBounds:_}),l=[];if(!g)return;let{x:u,y:f,width:C,height:w}=m,T={},E=g.origin??s,{width:D,height:O,x:k,y:A}=Nu(h,o.controlDirection,c,o.boundaries,o.keepAspectRatio,E,b,x),j=D!==C,M=O!==w,N=k!==u&&j,P=A!==f&&M;if(!N&&!P&&!j&&!M)return;if((N||P||E[0]===1||E[1]===1)&&(T.x=N?k:m.x,T.y=P?A:m.y,m.x=T.x,m.y=T.y,v.length>0)){let e=k-u,t=A-f;for(let n of v)n.position={x:n.position.x-e+E[0]*(D-C),y:n.position.y-t+E[1]*(O-w)},l.push(n)}if((j||M)&&(T.width=j&&(!o.resizeDirection||o.resizeDirection===`horizontal`)?D:m.width,T.height=M&&(!o.resizeDirection||o.resizeDirection===`vertical`)?O:m.height,m.width=T.width,m.height=T.height),y&&g.expandParent){let e=E[0]*(T.width??0);T.x&&T.x<e&&(m.x=e,h.x-=T.x-e);let t=E[1]*(T.height??0);T.y&&T.y<t&&(m.y=t,h.y-=T.y-t)}let F=Du({width:m.width,prevWidth:C,height:m.height,prevHeight:w,affectsX:o.controlDirection.affectsX,affectsY:o.controlDirection.affectsY}),I={...m,direction:F};p?.(e,I)!==!1&&(S=!0,d?.(e,I),r(T,l))}).on(`end`,e=>{S&&=(f?.(e,{...m}),i?.({...m}),!1)});a.call(C)}function c(){a.on(`.drag`,null)}return{update:s,destroy:c}}var Ru=e(Ze(),1),zu=e=>{let t,n=new Set,r=(e,r)=>{let i=typeof e==`function`?e(t):e;if(!Object.is(i,t)){let e=t;t=r??(typeof i!=`object`||!i)?i:Object.assign({},t,i),n.forEach(n=>n(t,e))}},i=()=>t,a={setState:r,getState:i,getInitialState:()=>o,subscribe:e=>(n.add(e),()=>n.delete(e)),destroy:()=>{n.clear()}},o=t=e(r,i,a);return a},Bu=e=>e?zu(e):zu,{useDebugValue:Vu}=Y.default,{useSyncExternalStoreWithSelector:Hu}=Ru.default,Uu=e=>e;function Wu(e,t=Uu,n){let r=Hu(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return Vu(r),r}var Gu=(e,t)=>{let n=Bu(e),r=(e,r=t)=>Wu(n,e,r);return Object.assign(r,n),r},Ku=(e,t)=>e?Gu(e,t):Gu;function qu(e,t){if(Object.is(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(let[n,r]of e)if(!Object.is(r,t.get(n)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}let n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(let r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||!Object.is(e[r],t[r]))return!1;return!0}n();var Ju=(0,Y.createContext)(null),Yu=Ju.Provider,Xu=Qs.error001(`react`);function $(e,t){let n=(0,Y.useContext)(Ju);if(n===null)throw Error(Xu);return Wu(n,e,t)}function Zu(){let e=(0,Y.useContext)(Ju);if(e===null)throw Error(Xu);return(0,Y.useMemo)(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}var Qu={display:`none`},$u={position:`absolute`,width:1,height:1,margin:-1,border:0,padding:0,overflow:`hidden`,clip:`rect(0px, 0px, 0px, 0px)`,clipPath:`inset(100%)`},ed=`react-flow__node-desc`,td=`react-flow__edge-desc`,nd=`react-flow__aria-live`,rd=e=>e.ariaLiveMessage,id=e=>e.ariaLabelConfig;function ad({rfId:e}){let t=$(rd);return(0,Z.jsx)(`div`,{id:`${nd}-${e}`,"aria-live":`assertive`,"aria-atomic":`true`,style:$u,children:t})}function od({rfId:e,disableKeyboardA11y:t}){let n=$(id);return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`div`,{id:`${ed}-${e}`,style:Qu,children:t?n[`node.a11yDescription.default`]:n[`node.a11yDescription.keyboardDisabled`]}),(0,Z.jsx)(`div`,{id:`${td}-${e}`,style:Qu,children:n[`edge.a11yDescription.default`]}),!t&&(0,Z.jsx)(ad,{rfId:e})]})}var sd=(0,Y.forwardRef)(({position:e=`top-left`,children:t,className:n,style:r,...i},a)=>(0,Z.jsx)(`div`,{className:pn([`react-flow__panel`,n,...`${e}`.split(`-`)]),style:r,ref:a,...i,children:t}));sd.displayName=`Panel`;var cd=`https://reactflow.dev?utm_source=attribution`;function ld({proOptions:e,position:t=`bottom-right`}){return e?.hideAttribution?null:(0,Z.jsx)(sd,{position:t,className:`react-flow__attribution`,"data-message":`Please only hide this attribution when you are subscribed to React Flow Pro: ${cd}`,children:(0,Z.jsx)(`a`,{href:cd,target:`_blank`,rel:`noopener noreferrer`,"aria-label":`React Flow attribution`,children:`React Flow`})})}var ud=e=>{let t=[],n=[];for(let[,n]of e.nodeLookup)n.selected&&t.push(n.internals.userNode);for(let[,t]of e.edgeLookup)t.selected&&n.push(t);return{selectedNodes:t,selectedEdges:n}},dd=e=>e.id;function fd(e,t){return qu(e.selectedNodes.map(dd),t.selectedNodes.map(dd))&&qu(e.selectedEdges.map(dd),t.selectedEdges.map(dd))}function pd({onSelectionChange:e}){let t=Zu(),{selectedNodes:n,selectedEdges:r}=$(ud,fd);return(0,Y.useEffect)(()=>{let i={nodes:n,edges:r};e?.(i),t.getState().onSelectionChangeHandlers.forEach(e=>e(i))},[n,r,e]),null}var md=e=>!!e.onSelectionChangeHandlers;function hd({onSelectionChange:e}){let t=$(md);return e||t?(0,Z.jsx)(pd,{onSelectionChange:e}):null}var gd=[0,0],_d={x:0,y:0,zoom:1},vd=[...`nodes.edges.defaultNodes.defaultEdges.onConnect.onConnectStart.onConnectEnd.onClickConnectStart.onClickConnectEnd.nodesDraggable.autoPanOnNodeFocus.nodesConnectable.nodesFocusable.edgesFocusable.edgesReconnectable.elevateNodesOnSelect.elevateEdgesOnSelect.minZoom.maxZoom.nodeExtent.onNodesChange.onEdgesChange.elementsSelectable.connectionMode.snapGrid.snapToGrid.translateExtent.connectOnClick.defaultEdgeOptions.fitView.fitViewOptions.onNodesDelete.onEdgesDelete.onDelete.onNodeDrag.onNodeDragStart.onNodeDragStop.onSelectionDrag.onSelectionDragStart.onSelectionDragStop.onMoveStart.onMove.onMoveEnd.noPanClassName.nodeOrigin.autoPanOnConnect.autoPanOnNodeDrag.onError.connectionRadius.isValidConnection.selectNodesOnDrag.nodeDragThreshold.connectionDragThreshold.onBeforeDelete.debug.autoPanSpeed.ariaLabelConfig.zIndexMode`.split(`.`),`rfId`],yd=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges}),bd={translateExtent:$s,nodeOrigin:gd,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:`nopan`,rfId:`1`};function xd(e){let{setNodes:t,setEdges:n,setMinZoom:r,setMaxZoom:i,setTranslateExtent:a,setNodeExtent:o,reset:s,setDefaultNodesAndEdges:c}=$(yd,qu),l=Zu();(0,Y.useEffect)(()=>(c(e.defaultNodes,e.defaultEdges),()=>{u.current=bd,s()}),[]);let u=(0,Y.useRef)(bd);return(0,Y.useEffect)(()=>{for(let s of vd){let c=e[s];c!==u.current[s]&&e[s]!==void 0&&(s===`nodes`?t(c):s===`edges`?n(c):s===`minZoom`?r(c):s===`maxZoom`?i(c):s===`translateExtent`?a(c):s===`nodeExtent`?o(c):s===`ariaLabelConfig`?l.setState({ariaLabelConfig:Qc(c)}):s===`fitView`?l.setState({fitViewQueued:c}):s===`fitViewOptions`?l.setState({fitViewOptions:c}):l.setState({[s]:c}))}u.current=e},vd.map(t=>e[t])),null}function Sd(){return typeof window>`u`||!window.matchMedia?null:window.matchMedia(`(prefers-color-scheme: dark)`)}function Cd(e){let[t,n]=(0,Y.useState)(e===`system`?null:e);return(0,Y.useEffect)(()=>{if(e!==`system`){n(e);return}let t=Sd(),r=()=>n(t?.matches?`dark`:`light`);return r(),t?.addEventListener(`change`,r),()=>{t?.removeEventListener(`change`,r)}},[e]),t===null?Sd()?.matches?`dark`:`light`:t}var wd=typeof document<`u`?document:null;function Td(e=null,t={target:wd,actInsideInputWithModifier:!0}){let[n,r]=(0,Y.useState)(!1),i=(0,Y.useRef)(!1),a=(0,Y.useRef)(new Set([])),[o,s]=(0,Y.useMemo)(()=>{if(e!==null){let t=(Array.isArray(e)?e:[e]).filter(e=>typeof e==`string`).map(e=>e.replace(`+`,`
2
2
  `).replace(`
3
3
 
4
4
  `,`